new Map)):[],x=v?new Array(a).fill(0).map((()=>new Map)):[],S=[],A=new Set,k=new Map;for(let n=0;n=u&&h
String(t[n][e]))).join("||"):String(t[n][m]);const o=b[r],l=null!==(s=o.get(i))&&void 0!==s?s:0;if(o.set(i,l+a),A.has(i)||(A.add(i),S.push(i),y(m)?k.set(i,Object.fromEntries(m.map((e=>[e,t[n][e]])))):k.set(i,t[n][m])),e&&e.includeValues){const e=x[r];e.has(i)||e.set(i,[]);const s=e.get(i);s&&s.push(t[n])}}else _[r][l]+=a;e&&e.includeValues&&!v&&_[r][c].push(t[n]);break}}}let M=0;const T=[];if(v){for(let t=0;t0?e[l]/t:0}else{for(let t=0,e=_.length;t0?_[t][l]/M:0,T.push(_[t])}return T},Kr=(t,e)=>{var i,s,n,r,a,o,l,h,c,d;const p=null==e?void 0:e.field;if(!p)return[];const g=e.countField,f=t.length;let m,v=1/0,_=-1/0;if(e.extent)v=e.extent[0],_=e.extent[1];else for(let e=0;e_&&(_=s))}if(!Number.isFinite(v)||!Number.isFinite(_)||0===f)return[];if(e.thresholds&&e.thresholds.length)m=e.thresholds.slice(),m.sort(((t,e)=>t-e));else if("number"==typeof e.step&&e.step>0){const t=e.step;let i=v;for(e.extent||(i=Math.floor(v/t)*t),m=[i];i<=_;)i+=t,m.push(i)}else{let t=e.bins&&e.bins>0?Math.floor(e.bins):10;if(_-v>1){const e=Math.floor(v),i=Math.ceil((_-e)/t);m=new Array(t+1);for(let s=0;s<=t;s++)if(m[s]=e+i*s,m[s]>_){t=s,m.length=t+1;break}}else{const e=(_-v)/t;m=new Array(t+1);for(let i=0;i<=t;i++)if(m[i]=v+e*i,m[i]>_){t=i,m.length=t+1;break}}}const b=Math.max(0,m.length-1);if(0===b)return[];const x=null!==(s=null===(i=e.outputNames)||void 0===i?void 0:i.x0)&&void 0!==s?s:"x0",S=null!==(r=null===(n=e.outputNames)||void 0===n?void 0:n.x1)&&void 0!==r?r:"x1",A=null!==(o=null===(a=e.outputNames)||void 0===a?void 0:a.count)&&void 0!==o?o:"count",k=null!==(h=null===(l=e.outputNames)||void 0===l?void 0:l.values)&&void 0!==h?h:"values",M=null!==(d=null===(c=e.outputNames)||void 0===c?void 0:c.percentage)&&void 0!==d?d:"percentage",T=y(null==e?void 0:e.facetField)?null==e?void 0:e.facetField:(null==e?void 0:e.facetField)?[e.facetField]:[],w=y(null==e?void 0:e.groupField)?null==e?void 0:e.groupField:(null==e?void 0:e.groupField)?[e.groupField]:[],C=w.length?w:void 0,E=Object.assign(Object.assign({},e),{numBins:b,thresholds:m,countName:A,percentageName:M,valuesName:k,countField:g,field:p,n:f,x0Name:x,x1Name:S,groupField:C});if(!T.length)return Xr(t,E);const B={};return t.forEach((t=>{const e=T.map((e=>null==t?void 0:t[e])).join("-&&-");B[e]?B[e].push(t):B[e]=[t]})),Object.values(B).map((t=>{const e=[...w,...T];return Xr(t,Object.assign(Object.assign({},E),{groupField:e.length?e:void 0,n:t.length}))})).flat()},qr=(t,e)=>{var i,s,n,r,a,o,l,h,c,d,p,g,f,m,v,_;const b=null==e?void 0:e.field;if(!b)return[];const x=null==e?void 0:e.groupField;let S=null!==(i=null==e?void 0:e.whiskers)&&void 0!==i?i:1.5;const A=!!(null==e?void 0:e.includeValues),k=null!==(s=null==e?void 0:e.outputNames)&&void 0!==s?s:{},M=null!==(n=k.key)&&void 0!==n?n:y(x)?null:null!==(r=x)&&void 0!==r?r:"key",T=null!==(a=k.count)&&void 0!==a?a:"count",w=null!==(o=k.mean)&&void 0!==o?o:"mean",C=null!==(l=k.q1)&&void 0!==l?l:"q1",E=null!==(h=k.median)&&void 0!==h?h:"median",B=null!==(c=k.q3)&&void 0!==c?c:"q3",P=null!==(d=k.iqr)&&void 0!==d?d:"iqr",L=null!==(p=k.min)&&void 0!==p?p:"min",R=null!==(g=k.max)&&void 0!==g?g:"max",O=null!==(f=k.lowerWhisker)&&void 0!==f?f:"lowerWhisker",I=null!==(m=k.upperWhisker)&&void 0!==m?m:"upperWhisker",D=null!==(v=k.outliers)&&void 0!==v?v:"outliers",F=null!==(_=k.values)&&void 0!==_?_:"values",z=new Map,j=new Map,H=new Map,N=t.length;for(let e=0;eString(i[t]))).join("||"):x?String(i[x]):"___all",z.has(r)||(z.set(r,[]),A&&j.set(r,[]),y(x)?H.set(r,Object.fromEntries(x.map((t=>[t,i[t]])))):H.set(r,x?i[x]:null));const a=z.get(r);if(a&&a.push(n),A){const t=j.get(r);t&&t.push(i)}}y(S)&&(S=[_t(Math.min.apply(null,S),0,1),_t(Math.max.apply(null,S),0,1)]);const V=[];for(const[t,e]of z){if(!e||0===e.length)continue;const i=e.slice().sort(((t,e)=>t-e)),s=i.length,n=i[0],r=i[i.length-1];let a=0;for(let t=0;tp)&&g.push(i[t]);const f={},m=H.get(t);if(null!==M)f[M]=m;else if(y(x)){const t=m||{};for(const e of x)f[e]=t[e]}f[T]=s,f[w]=o,f[C]=l,f[E]=h,f[B]=c,f[P]=d,f[L]=n,f[R]=r,f[O]=u,f[I]=p,f[D]=g,A&&(f[F]=j.get(t)||[]),V.push(f)}return V};var Zr={},Jr={};function Qr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function ta(t){var e=Object.create(null),i=[];return t.forEach((function(t){for(var s in t)s in e||i.push(e[s]=s)})),i}function ea(t,e){var i=t+"",s=i.length;return s9999?"+"+ea(e,6):ea(e,4))+"-"+ea(t.getUTCMonth()+1,2)+"-"+ea(t.getUTCDate(),2)+(r?"T"+ea(i,2)+":"+ea(s,2)+":"+ea(n,2)+"."+ea(r,3)+"Z":n?"T"+ea(i,2)+":"+ea(s,2)+":"+ea(n,2)+"Z":s||i?"T"+ea(i,2)+":"+ea(s,2)+"Z":"")}function sa(t){var e=new RegExp('["'+t+"\n\r]"),i=t.charCodeAt(0);function s(t,e){var s,n=[],r=t.length,a=0,o=0,l=r<=0,h=!1;function c(){if(l)return Jr;if(h)return h=!1,Zr;var e,s,n=a;if(34===t.charCodeAt(n)){for(;a++=r?l=!0:10===(s=t.charCodeAt(a++))?h=!0:13===s&&(h=!0,10===t.charCodeAt(a)&&++a),t.slice(n+1,e-1).replace(/""/g,'"')}for(;a0}function ga(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i is required");if("boolean"!=typeof s)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=oa(t));var r=[];switch(t.type){case"GeometryCollection":return fa(t,(function(t){va(t,s)})),t;case"FeatureCollection":return ga(t,(function(t){ga(va(t,s),(function(t){r.push(t)}))})),hi(r)}return va(t,s)}function va(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return fa(t,(function(t){va(t,e)})),t;case"LineString":return _a(ua(t),e),t;case"Polygon":return ya(ua(t),e),t;case"MultiLineString":return ua(t).forEach((function(t){_a(t,e)})),t;case"MultiPolygon":return ua(t).forEach((function(t){ya(t,e)})),t;case"Point":case"MultiPoint":return t}}function _a(t,e){pa(t)===e&&t.reverse()}function ya(t,e){pa(t[0])!==e&&t[0].reverse();for(var i=1;i{if(t.geometry.type.startsWith("Multi")){const e=ba(t).features[0];return Object.assign(Object.assign({},e),e.properties)}return Object.assign(Object.assign({},t),t.properties)},ka=(t,e={},i)=>{i.type=Yr.GEO;const s=Nr(Sa,e),{centroid:n,name:r,bbox:a,rewind:o}=s;if(Array.isArray(t))return(t=>{const e=[];return t.forEach((t=>{"FeatureCollection"===t.type?t.features.forEach((t=>{e.push(Aa(t))})):e.push(Aa(t))})),e})(t);let l=t.features;return o&&(l=ma(t,{reverse:!g(o)||o.reverse}).features),l.forEach((t=>{if(n){const e=xa.centroid(t);t.centroidX=e[0],t.centroidY=e[1]}if(r&&(t.name=t.properties.name),a){const e=xa.bounds(t);t.bbox=e}})),t.features=l,t},Ma={},Ta=(t,e,i)=>{i.type=Yr.GEO;const s=Nr(Sa,Ma,e),{object:n}=s;if(!_(n))throw new TypeError("Invalid object: must be a string!");const r=(a=t,"string"==typeof(o=t.objects[n])&&(o=a.objects[o]),"GeometryCollection"===o.type?{type:"FeatureCollection",features:o.geometries.map((function(t){return Or(a,t)}))}:Or(a,o));var a,o;return ka(r,s,i)},wa=(t,e,i)=>{const s=!c(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!y(t))throw new TypeError("Invalid data: must be DataView array!");return y(i.rawData)&&i.rawData.forEach((t=>{t.target&&(t.target.removeListener("change",i.reRunAllTransform),t.target.removeListener("markRunning",i.markRunning))})),s&&t.forEach((t=>{t.target.addListener("change",i.reRunAllTransform),t.target.addListener("markRunning",i.markRunning)})),t};let Ca=0;function Ea(t="dataset"){return Ca>1e8&&(Ca=0),t+"_"+Ca++}class Ba{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new l,i=(null==t?void 0:t.name)?t.name:Ea("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:ot.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let s=this._callMap.get(i);s||(s=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,s)})),this._callMap.set(i,s)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const s=this._callMap.get(i);s&&t.forEach((t=>{t.target.removeListener(e,s)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}class Pa{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new l,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(t={})=>{const e=this.latestData;return this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})})),this.isRunning=!1,!1===t.emitMessage||t.skipEqual&&U(e,this.latestData)||this.target.emit("change",{latestData:this.latestData}),this},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:Ea("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var s;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(s=this.dataSet.getParser(e.type))&&void 0!==s?s:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t,e={}){const{pushHistory:i,emitMessage:s,skipEqual:n}=e,r=this.dataSet.getTransform(t.type),a=this.latestData,o=r(a,t.options);this.history&&!1!==i&&this.historyData.push(o),this.latestData=o,!1===s||n&&U(a,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let i=!1;return t instanceof Pa||!0!==(null==e?void 0:e.clone)||(i=!0),i?I(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?j({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!u(this._fields)&&u(i)?(this.dataSet.registerTransform("fields",$r),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}Yn();const La={},Ra={albers:dr,albersusa:function(){var t,e,i,s,n,r,a=dr(),o=cr().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=cr().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){r=[t,e]}};function c(t){var e=t[0],a=t[1];return r=null,i.point(e,a),r||(s.point(e,a),r)||(n.point(e,a),r)}function d(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),i=a.translate(),s=(t[0]-i[0])/e,n=(t[1]-i[1])/e;return(n>=.12&&n<.234&&s>=-.425&&s<-.214?o:n>=.166&&n<.234&&s>=-.214&&s<-.115?l:a).invert(t)},c.stream=function(i){return t&&e===i?t:(s=[a.stream(e=i),o.stream(i),l.stream(i)],n=s.length,t={point:function(t,e){for(var i=-1;++i2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)}},Oa=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Ia(t,e){return function i(){const s=e();return s.type=t,s.path=Yn().projection(s),s.copy=s.copy||function(){const t=i();return Oa.forEach((e=>{s[e]&&t[e](s[e]())})),t.path.pointRadius(s.path.pointRadius()),t},s}}class Da{static GenAutoIncrementId(){return Da.auto_increment_id++}}Da.auto_increment_id=0;class Fa{constructor(t){this.id=Da.GenAutoIncrementId(),this.registry=t}}const za="named",ja="inject",Ha="multi_inject",Na="inversify:tagged",Va="inversify:paramtypes";class Ua{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===za?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Wa=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),s=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),n=new WeakMap;function r(t,e,i){let r=n.get(t);if(h(r)){if(!i)return;r=new s,n.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new s,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const s=f(e);return!c(s)&&a(t,s,i)}function o(t,e,i){const s=r(e,i,!1);return!h(s)&&!!s.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const s=r(e,i,!1);if(!h(s))return s.get(t)}(t,e,i);const s=f(e);return c(s)?void 0:l(t,s,i)}function h(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const s=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,s);if(d(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const s=t.prototype,n=s&&Object.getPrototypeOf(s);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,s){if(!d(i))throw new TypeError;return n=t,a=e,void r(i,s,!0).set(n,a);var n,a})),t("hasMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function Ga(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};Wa.hasOwnMetadata(t,e)&&(r=Wa.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,Wa.defineMetadata(t,r,e)}(Na,t,i.toString(),s)}function Ya(t){return(e,i,s)=>{Ga(e,0,s,t)}}function $a(t){return e=>(i,s,n)=>Ya(new Ua(t,e))(i,s,n)}const Xa=$a(ja),Ka=$a(Ha);function qa(){return function(t){return Wa.defineMetadata(Va,null,t),t}}function Za(t){return Ya(new Ua(za,t))}const Ja="Singleton",Qa="Transient",to="ConstantValue",eo="DynamicValue",io="Factory",so="Function",no="Instance",ro="Invalid";class ao{constructor(t,e){this.id=Da.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=ro,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new ao(this.serviceIdentifier,this.scope);return t.activated=t.scope===Ja&&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 oo{getConstructorMetadata(t){return{compilerGeneratedMetadata:Wa.getMetadata(Va,t),userGeneratedMetadata:Wa.getMetadata(Na,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const lo=(ho=za,t=>{const e=e=>{if(null==e)return!1;if(e.key===ho&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;ee.container.get(t)))}}const po=Symbol("ContributionProvider");class go{constructor(t,e){this.serviceIdentifier=t,this.container=e,mo.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 fo(t,e){t(po).toDynamicValue((({container:t})=>new go(e,t))).inSingletonScope().whenTargetNamed(e)}class mo{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()}))}}mo.store=new Map;class vo{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let s;if("string"==typeof e)s={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw new Error("Missing name for tap");return s=Object.assign({type:t,fn:i},s),s}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let s=this.taps.length;for(;s>0;){s--;const t=this.taps[s];this.taps[s+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){s++;break}}this.taps[s]=t}}class _o extends vo{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const yo=Symbol.for("EnvContribution"),bo=Symbol.for("VGlobal"),xo=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Qa,this.options=e,this.id=Da.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new oo}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,za,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new ao(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new uo(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),n=e=>i=>{const s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,s){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:s}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),s=Object.keys(i),n=[];for(let t=0;t{s[t.key]=t.value}));const r={inject:s[ja],multiInject:s[Ha]},a=r.inject||r.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};n.push(t)}}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case to:case so:e=t.cache;break;case no:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Ja&&(t.cache=e,t.activated=!0)}},So=Symbol.for("RenderService");const Ao=new class{get renderService(){return this._renderService||(this._renderService=xo.get(So)),this._renderService}};let ko=0;class Mo{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach((e=>e(t)))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=Ao.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++ko,t),this.tryRunAnimationFrameNextFrame(),ko}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}}class To{constructor(){this._listenerMap=new Map,this._eventListenerTransformer=t=>t}setEventListenerTransformer(t){this._eventListenerTransformer=t||(t=>t)}addEventListener(t,e,i){if(!e)return;const s=t=>{const i=this._eventListenerTransformer(t);"function"==typeof e?e(i):e.handleEvent&&e.handleEvent(i)};this._listenerMap.has(t)||this._listenerMap.set(t,new Map),this._listenerMap.get(t).set(e,s),this._nativeAddEventListener(t,s,i)}removeEventListener(t,e,i){var s;if(!e)return;const n=null===(s=this._listenerMap.get(t))||void 0===s?void 0:s.get(e);n&&(this._nativeRemoveEventListener(t,n,i),this._listenerMap.get(t).delete(e),0===this._listenerMap.get(t).size&&this._listenerMap.delete(t))}dispatchEvent(t){return this._nativeDispatchEvent(t)}clearAllEventListeners(){this._listenerMap.forEach(((t,e)=>{t.forEach(((t,i)=>{this._nativeRemoveEventListener(e,t,void 0)}))})),this._listenerMap.clear()}_nativeAddEventListener(t,e,i){throw new Error("_nativeAddEventListener must be implemented by derived classes")}_nativeRemoveEventListener(t,e,i){throw new Error("_nativeRemoveEventListener must be implemented by derived classes")}_nativeDispatchEvent(t){throw new Error("_nativeDispatchEvent must be implemented by derived classes")}}var wo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Co=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eo=function(t,e){return function(i,s){e(i,s,t)}},Bo=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};let Po=class extends To{get env(){return this._env}get isImageAnonymous(){return this._isImageAnonymous}set isImageAnonymous(t){this._isImageAnonymous=t}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){super(),this.contributions=t,this._isImageAnonymous=!0,this._performanceRAFList=[],this.eventListenerTransformer=t=>t,this.id=Da.GenAutoIncrementId(),this.hooks={onSetEnv:new _o(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}_nativeAddEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const s=i.configure(this,t);s&&s.then&&e.push(s)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const s=this.bindContribution(e);if(s&&s.then)return s.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getSpecifiedRequestAnimationFrame(t){this._env||this.setEnv("browser"),this._performanceRAFList[t]||(this._performanceRAFList[t]=new Mo);const e=this._performanceRAFList[t];return t=>e.addAnimationFrameCb(t)}getSpecifiedCancelAnimationFrame(t){if(this._env||this.setEnv("browser"),!this._performanceRAFList[t])return()=>!1;const e=this._performanceRAFList[t];return t=>e.removeAnimationFrameCb(t)}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}loadFont(t,e,i){return Bo(this,void 0,void 0,(function*(){return this._env||this.setEnv("browser"),this.envContribution.loadFont(t,e,i)}))}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}isMacOS(){return this._env||this.setEnv("browser"),this.envContribution.isMacOS()}copyToClipBoard(t){return this._env||this.setEnv("browser"),this.envContribution.copyToClipBoard(t)}};var Lo,Ro,Oo,Io;Po=wo([qa(),Eo(0,Xa(po)),Eo(0,Za(yo)),Co("design:paramtypes",[Object])],Po),function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(Lo||(Lo={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Ro||(Ro={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Oo||(Oo={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Io||(Io={}));const Do=Nt-1e-8;class Fo{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>Do)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,d=-1/0,u=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),ld&&(d=l),hp&&(p=h)}if(g(s),g(n),n!==s)if((s%=Nt)<0&&(s+=Nt),(n%=Nt)<0&&(n+=Nt),nn;++o,a-=Ht)g(a);else for(a=s-s%Ht+Ht,o=0;o<4&&at.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const jo=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ho={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},No={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Vo,Uo,Wo,Go,Yo,$o;var Xo,Ko,qo,Zo,Jo,Qo;function tl(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,d=o*r,u=l*a,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),m=Math.sin(n),v=.5*(n-s),_=Math.sin(.5*v),y=8/3*_*_/Math.sin(v),b=e+p-y*g,x=i+g+y*p,S=e+f,A=i+m,k=S+y*m,M=A-y*f;return[h*b+c*x,d*b+u*x,h*k+c*M,d*k+u*M,h*S+c*A,d*S+u*A]}function el(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=oe(a),c=Math.sin(h),d=Math.cos(h),u=d*(o-t)*.5+c*(l-e)*.5,p=d*(l-e)*.5-c*(o-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const f=d/i,m=c/i,v=-c/s,_=d/s,y=f*o+m*l,b=v*o+_*l,x=f*t+m*e,S=v*t+_*e;let A=1/((x-y)*(x-y)+(S-b)*(S-b))-.25;A<0&&(A=0);let k=Math.sqrt(A);r===n&&(k=-k);const M=.5*(y+x)-k*(S-b),T=.5*(b+S)+k*(x-y),w=Math.atan2(b-T,y-M);let C=Math.atan2(S-T,x-M)-w;C<0&&1===r?C+=Nt:C>0&&0===r&&(C-=Nt);const E=Math.ceil(Math.abs(C/(Ht+.001))),B=[];for(let t=0;te.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function sl(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;o=1)t.bezierCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i,this.p3.x*s+e,this.p3.y*n+i);else if(r>0){const[a]=cl(this,r);t.bezierCurveTo(a.p1.x*s+e,a.p1.y*n+i,a.p2.x*s+e,a.p2.y*n+i,a.p3.x*s+e,a.p3.y*n+i)}}includeX(t){const e=$t(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=Yt(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=$t(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(Yt(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}function ul(t,e){const{p0:i,p1:s}=t,n=ae.pointAtPP(i,s,e);return[new pl(i,n),new pl(n,s)]}class pl extends nl{constructor(t,e){super(),this.type=Jo.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return ae.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Wt(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()?ae.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Zo.ROW?Ut(this.p0.x-this.p1.x):t===Zo.COLUMN?Ut(this.p0.y-this.p1.y):0}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.lineTo(this.p1.x*s+e,this.p1.y*n+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*s+e,a.y*n+i)}}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,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}class gl{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,i,s,n,r,a,o){const l=new dl(new re(this._lastX,this._lastY),new re(t,e),new re(i,s),new re(n,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=n,this._lastY=r,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,i,s){const n=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,n){const r=new pl(new re(this._lastX,this._lastY),new re(t,e));return r.originP1=s,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Zo.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],s=null!==(e=i.p3)&&void 0!==e?e:i.p1;return Ut(t.p0.y-s.y)}if(t===Zo.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(i=e.p3)&&void 0!==i?i:e.p1;return Ut(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class fl extends gl{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function ml(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function vl(t,e,i){const s=null!=e?e:Ut(i[i.length-1].x-i[0].x)>Ut(i[i.length-1].y-i[0].y)?Zo.ROW:Zo.COLUMN;return"monotoneY"===t?new fl(t,s):new gl(t,s)}class _l{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,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function yl(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=vl("linear",i,t);return function(t,e){ml(t,e,1)}(new _l(n,s),t),n}function bl(t,e,i,s,n){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+i)/6,s,t.lastPoint1)}class xl{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&&bl(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,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:bl(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Sl(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return yl(t,e);const n=vl("basis",i,t);return function(t,e){ml(t,e,2)}(new xl(n,s),t),n}function Al(t){return t<0?-1:1}function kl(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(Al(r)+Al(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Ml(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Tl(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,s,t.lastPoint1)}class wl{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:Tl(this,this._t0,Ml(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 i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,Tl(this,Ml(this,e=kl(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Tl(this,this._t0,e=kl(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,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 Cl extends wl{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function El(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return yl(t,e);const n=vl("monotoneX",i,t);return function(t,e){ml(t,e,2)}(new wl(n,s),t),n}function Bl(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return yl(t,e);const n=vl("monotoneY",i,t);return function(t,e){ml(t,e,2)}(new Cl(n,s),t),n}let Pl=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}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=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class Ll extends Pl{lineEnd(){this.context.closePath()}}function Rl(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new gl("step",null!=s?s:Ut(t[t.length-1].x-t[0].x)>Ut(t[t.length-1].y-t[0].y)?Zo.ROW:Zo.COLUMN);return Ol(new Pl(r,e,n),t),r}function Ol(t,e){return ml(t,e,1)}class Il extends _l{lineEnd(){this.context.closePath()}}function Dl(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=vl("linear",i,t);return function(t,e){ml(t,e,1)}(new Il(n,s),t),n}function Fl(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>zt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>zt){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function zl(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return yl(i,n);const o=vl(t,r,i);return ml(new e(o,s,a),i,2),o}}const jl=zl("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,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:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Fl(this,e,i,!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=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Hl=zl("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,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:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Fl(this,e,i,!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=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class Nl extends nl{constructor(t,e,i){super(),this.type=Jo.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_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 hl(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,rl([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Zo.ROW?Ut(this.p0.x-this.p2.x):t===Zo.COLUMN?Ut(this.p0.y-this.p2.y):0}getAngleAt(t){const e=Yt(t-.01,0),i=$t(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return Wt(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:s,p2:n}=t,r=hl(i,s,n,e),a=ae.pointAtPP(i,s,e),o=ae.pointAtPP(s,n,e);return[new Nl(i,a,r),new Nl(r,o,n)]}(this,r);t.quadraticCurveTo(a.p1.x*s+e,a.p1.y*n+i,a.p2.x*s+e,a.p2.y*n+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class Vl{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 i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new pl(new re(this._lastX,this._lastY),new re(t,e))}quadraticCurveTo(t,e,i,s){const n=new Nl(new re(this._lastX,this._lastY),new re(t,e),new re(i,s));this.path.addCurve(n),this._lastX=i,this._lastY=s}bezierCurveTo(t,e,i,s,n,r){const a=new dl(new re(this._lastX,this._lastY),new re(t,e),new re(i,s),new re(n,r));this.path.addCurve(a),this._lastX=n,this._lastY=r}arcTo(t,e,i,s,n){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,s,n,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,s){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,s,n,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ul(t,e,i){var s,n;switch(e){case"linear":default:return yl(t,i);case"basis":return Sl(t,i);case"monotoneX":return El(t,i);case"monotoneY":return Bl(t,i);case"step":return Rl(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new gl("step",null!=s?s:Ut(t[t.length-1].x-t[0].x)>Ut(t[t.length-1].y-t[0].y)?Zo.ROW:Zo.COLUMN);return Ol(new Ll(r,e,n),t),r}(t,.5,i);case"stepBefore":return Rl(t,0,i);case"stepAfter":return Rl(t,1,i);case"catmullRom":return jl(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return Hl(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return Dl(t,i)}}class Wl extends zo{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Fo(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([No.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([No.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([No.Q,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([No.C,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([No.AT,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([No.E,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([No.R,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([No.A,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([No.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 Vl(this);sl(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[No.M]=t=>`M${t[1]} ${t[2]}`,t[No.L]=t=>`L${t[1]} ${t[2]}`,t[No.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[No.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[No.A]=t=>{const e=[],i=t[1],s=t[2],n=t[3];((t,e,i,s,n,r,a,o=!1)=>{const l=2*Math.PI,h=(e%l+l)%l;let c,d=(i%l+l)%l;o?(d>=h&&(d-=l),c=d-h):(d<=h&&(d+=l),c=d-h);const u=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/u;for(let e=0;e`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[No.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,r=e.length;t$o){let t,e=Wo;for(let s=1,r=i.length;s{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,n=1){let r,a,o,l,h,c=null,d=0,u=0,p=0,g=0;for(let f=0,m=t.length;ft.slice()))}_updateBounds(){this.bounds.clear(),sl(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Zo.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return Ut(t.p0.y-e.p1.y)}if(this.direction===Zo.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return Ut(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=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,n){this.tryBuildCurves();const r=this.getLength()*n;let a=0;for(let n=0;n{ot.getInstance().warn("空函数")}}),lh=Object.assign(Object.assign({},th),{points:[],cornerRadius:0,closePath:!0}),hh=Object.assign(Object.assign({},th),{width:100,height:100,spikes:5,thickness:.5}),ch=Object.assign(Object.assign({},th),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round",drawStrokeWhenZeroWH:!1});Object.assign(Object.assign({},th),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round",drawStrokeWhenZeroWH:!1});const dh=Object.assign(Object.assign({},th),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),uh=Object.assign(Object.assign(Object.assign({},th),Zl),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ph=Object.assign(Object.assign(Object.assign({},th),Zl),{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}),gh=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},th),{fill:!0,cornerRadius:0,cornerType:"round"}),fh=Object.assign(Object.assign({},gh),{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}),mh=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 i(t){const i=new Error(e+": "+t);throw i.source=e,i}function s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s,r){const a=v(s);if(a){v(t.startCall)||i("Missing (");const s=function(s){const r=n();return r&&(v(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(p)}}();return v(t.endCall)||i("Missing )"),s}}(s)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,v(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=d();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=d();return t||i("Missing positioning value"),t}}function d(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let s=e();const n=[];if(s)for(n.push(s);v(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const s=v(e);if(s)return{type:t,value:s[i]}}function v(t){const i=/^[\n\r\t\s]+/.exec(e);i&&_(i[0].length);const s=t.exec(e);return s&&_(s[0].length),s}function _(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class vh{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(vh.IsGradientStr(t))try{const e=mh(t)[0];if(e){if("linear"===e.type)return vh.ParseLinear(e);if("radial"===e.type)return vh.ParseRadial(e);if("conic"===e.type)return vh.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{const s=t.length>1?i/(t.length-1):0;return{color:e.value,offset:s}}))}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=jt/2,n=parseFloat(e.value)/180*jt-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+Vt,stops:vh.processColorStops(i)}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:vh.processColorStops(e)}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,s=jt/2;let n="angular"===e.type?parseFloat(e.value)/180*jt:0;for(;n<0;)n+=Vt;for(;n>=Vt;)n-=Vt;let r=0,a=0,o=0,l=0;return n{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,d,u):"conical"===c.gradient?h=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(n+i,r+s,void 0):l}(t,c,p,g,d,u):"radial"===c.gradient&&(h=function(t,e,i,s,n,r){var a,o,l,h,c,d;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(n,r)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,c,p,g,d,u))}return h||"orange"}const bh={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"}},xh=!0,Sh=!1,Ah=/\w|\(|\)|-/,kh=/[.?!,;:/,。?!、;:]/,Mh=/\S/,Th=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function wh(t,e,i,s,n){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=Ao.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=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(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return n&&(a=Ch(t,a)),a}function Ch(t,e,i=!1){let s=e;for(;Ah.test(t[s-1])&&Ah.test(t[s])||kh.test(t[s]);)if(s--,s<=0)return i?Eh(t,e):e;return s}function Eh(t,e){let i=e;for(;Ah.test(t[i+1])&&Ah.test(t[i])||kh.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function Bh(t,e,i="actual"){var s;if(""===t)return{ascent:0,height:0,descent:0,width:0};const n=Ao.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?n.actualBoundingBoxAscent:n.fontBoundingBoxAscent,o="actual"===i?n.actualBoundingBoxDescent:n.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(n.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(n.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(s=e.space)&&void 0!==s?s:0;return r.width+=l,r}var Ph=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Lh=class{constructor(){this.id="ATextMeasure"}configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}_measureTextWithoutAlignBaseline(t,e,i){this.context.setTextStyleWithoutAlignBaseline(e);const s=this.context.measureText(t);return i?this.compatibleMetrics(s,e):s}_measureTextWithAlignBaseline(t,e,i){this.context.setTextStyle(e);const s=this.context.measureText(t);return i?this.compatibleMetrics(s,e):s}compatibleMetrics(t,e){if(null==t.actualBoundingBoxAscent||null==t.actualBoundingBoxDescent||null==t.fontBoundingBoxAscent||null==t.fontBoundingBoxDescent){t={width:t.width};const{ascent:i,descent:s}=this.measureTextBoundADscentEstimate(e);t.actualBoundingBoxAscent=i,t.actualBoundingBoxDescent=s,t.fontBoundingBoxAscent=i,t.fontBoundingBoxDescent=s}if(null==t.actualBoundingBoxLeft||null==t.actualBoundingBoxRight){t={width:t.width,actualBoundingBoxAscent:t.actualBoundingBoxAscent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent};const{left:i,right:s}=this.measureTextBoundLeftRightEstimate(e);t.actualBoundingBoxLeft=i,t.actualBoundingBoxRight=s}return t}estimate(t,{fontSize:e=uh.fontSize}){let i=0,s=0;for(let e=0;e{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let a=0,o=0;for(;o1){const n=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(s&&n.str!==t[o].text){let i="",s=0;for(let e=0;ei)return{str:"",width:0};const a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(s&&a.str!==t){let i=Ch(t,a.str.length,n);i!==a.str.length&&(i>a.str.length&&(a.wordBreaked=i,i=a.str.length),a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a}_clipText(t,e,i,s,n,r,a){let o;if("start"===r)o=this._clipTextStart(t,e,i,s,n),a&&(o.result=a+o.str);else if("middle"===r){const s=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:s.width,result:s.left+a+s.right}}else o=this._clipTextEnd(t,e,i,s,n),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,s,n){if(s===n){ot.getInstance().warn(`【_clipTextEnd】不应该走到这里${t}, ${s}, ${n}`);const i=t.substring(0,n+1);return{str:i,width:this.measureTextWidth(i,e)}}const r=Math.floor((s+n)/2),a=t.substring(0,r+1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(0,r);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextEnd(t,e,i,s,r)}if(o=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(0,r+2);return l=this.measureTextWidth(s,e),l>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,r,n)}return{str:a,width:o}}_clipTextStart(t,e,i,s,n){const r=Math.ceil((s+n)/2),a=t.substring(r-1,t.length),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const s=t.substring(r,t.length);return l=this.measureTextWidth(s,e),l<=i?{str:s,width:l}:this._clipTextStart(t,e,i,r,t.length)}if(o=i?{str:a,width:o}:this._clipTextStart(t,e,i,s,r)}return{str:a,width:o}}_clipTextMiddle(t,e,i,s,n,r,a,o){const l=t.substring(0,o),h=this.measureTextWidth(l,e);if(h+a>i)return{left:s,right:n,width:r+a};const c=t.substring(t.length-o,t.length),d=this.measureTextWidth(c,e);return h+d>i?{left:l,right:n,width:h+a}:this._clipTextMiddle(t,e,i,l,c,h,d,o+1)}clipTextWithSuffixVertical(t,e,i,s,n,r){if(""===s)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,n);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(s,e);if(o>i)return a;let l;if(i-=o,"start"===r){const r=this.revertVerticalList(t);l=this.clipTextVertical(r,e,i,n);const a=this.revertVerticalList(l.verticalList);a.unshift({text:s,direction:1,width:o}),l.verticalList=a}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),a=this.revertVerticalList(t),h=this.clipTextVertical(a,e,i/2,n);r.verticalList.push({text:s,direction:1,width:o}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),l={verticalList:r.verticalList,width:r.width+h.width}}else l=this.clipTextVertical(t,e,i,n),l.verticalList.push({text:s,direction:1,width:o});return l.width+=o,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,s,n,r,a=!1){if(""===s)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const l=this.measureTextWidth(s,e);if(l>i)return{str:"",width:0};if(a&&o+l<=i)return{str:t+s,width:o+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,r,s);if(n&&h.str!==t){const i=Ch(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else a&&h.str===t&&(h.result=t+s);return h.str=h.result,h.width+=l,h}};Lh=Ph([qa()],Lh);var Rh=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Oh=Symbol.for("TextMeasureContribution");let Ih=class extends Lh{constructor(){super(...arguments),this.id="DefaultTextMeasureContribution"}};Ih=Rh([qa()],Ih);const Dh=Symbol.for("CanvasFactory"),Fh=Symbol.for("Context2dFactory");function zh(t){return xo.getNamed(Dh,Ao.global.env)(t)}const jh=1e-4,Hh=Math.sqrt(3),Nh=1/3;function Vh(t){return t>-ec&&tec||t<-ec}const Wh=[0,0],Gh=[0,0],Yh=[0,0];function $h(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Xh(t,e,i,s){const n=1-s;return n*(n*t+2*s*e)+s*s*i}function Kh(t,e,i,s,n){const r=1-n;return r*r*(r*t+3*n*e)+n*n*(n*s+3*r*i)}function qh(t){return(t%=Vt)<0&&(t+=Vt),t}function Zh(t,e,i,s,n,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>s+h&&l>r+h||lt+h&&o>i+h&&o>n+h||o=0&&le+d&&c>s+d&&c>r+d&&c>o+d||ct+d&&h>i+d&&h>n+d&&h>a+d||h=0&&pi||c+hn&&(n+=Vt);let d=Math.atan2(l,o);return d<0&&(d+=Vt),d>=s&&d<=n||d+Vt>=s&&d+Vt<=n}function tc(t,e,i,s,n,r,a){if(0===n)return!1;const o=n,l=n/2;let h=0,c=t;if(a>e+l&&a>s+l||at+l&&r>i+l||r=0&&t<=1&&(n[l++]=t)}}else{const t=r*r-4*a*o;if(Vh(t))n[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),s=(-r-e)/(2*a);i>=0&&i<=1&&(n[l++]=i),s>=0&&s<=1&&(n[l++]=s)}}return l}const sc=[-1,-1,-1],nc=[-1,-1];function rc(){const t=nc[0];nc[0]=nc[1],nc[1]=t}function ac(t,e,i,s,n,r,a,o,l,h){if(h>e&&h>s&&h>r&&h>o||h=0&&t<=1&&(r[p++]=t)}else{const t=d*d-4*c*u;if(Vh(t)){const t=d/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-d+e),s=c*o+1.5*a*(-d-e);i=i<0?-Math.pow(-i,Nh):Math.pow(i,Nh),s=s<0?-Math.pow(-s,Nh):Math.pow(s,Nh);const n=(-o-(i+s))/(3*a);n>=0&&n<=1&&(r[p++]=n)}else{const t=(2*c*o-3*a*d)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),s=Math.cos(e),n=(-o-2*i*s)/(3*a),l=(-o+i*(s+Hh*Math.sin(e)))/(3*a),h=(-o+i*(s-Hh*Math.sin(e)))/(3*a);n>=0&&n<=1&&(r[p++]=n),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,s,r,o,h,sc);if(0===c)return 0;let d=0,u=-1,p=0,g=0;for(let h=0;h1&&rc(),p=Kh(e,s,r,o,nc[0]),u>1&&(g=Kh(e,s,r,o,nc[1]))),2===u?ce&&o>s&&o>r||o=0&&t<=1&&(n[l++]=t)}}else{const t=a*a-4*r*o;if(Vh(t)){const t=-a/(2*r);t>=0&&t<=1&&(n[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),s=(-a-e)/(2*r);i>=0&&i<=1&&(n[l++]=i),s>=0&&s<=1&&(n[l++]=s)}}return l}(e,s,r,o,sc);if(0===l)return 0;const h=function(t,e,i){const s=t+i-2*e;return 0===s?.5:(t-e)/s}(e,s,r);if(h>=0&&h<=1){let o=0;const c=Xh(e,s,r,h);for(let s=0;si||o<-i)return 0;const l=Math.sqrt(i*i-o*o);sc[0]=-l,sc[1]=l;const h=Math.abs(s-n);if(h<1e-4)return 0;if(h>=Vt-1e-4){s=0,n=Vt;const e=r?1:-1;return a>=sc[0]+t&&a<=sc[1]+t?e:0}if(s>n){const t=s;s=n,n=t}s<0&&(s+=Vt,n+=Vt);let c=0;for(let e=0;e<2;e++){const i=sc[e];if(i+t>a){let t=Math.atan2(o,i),e=r?1:-1;t<0&&(t=Vt+t),(t>=s&&t<=n||t+Vt>=s&&t+Vt<=n)&&(t>jt/2&&t<1.5*jt&&(e=-e),c+=e)}}return c}function hc(t){return Math.round(t/jt*1e8)/1e8%2*jt}function cc(t,e){let i=hc(t[0]);i<0&&(i+=Vt);const s=i-t[0];let n=t[1];n+=s,!e&&n-i>=Vt?n=i+Vt:e&&i-n>=Vt?n=i-Vt:!e&&i>n?n=i+(Vt-hc(i-n)):e&&i1&&(i||(h+=Re(c,d,u,p,s,n))),g&&(c=a[1],d=a[2],u=c,p=d);const f=a[0],m=a[1],v=a[2],_=a[3],y=a[4],b=a[5],x=a[6];let S=y,A=b;dc[0]=S,dc[1]=A,cc(dc,Boolean(a[6])),S=dc[0],A=dc[1];const k=S,M=A-S,T=!!(1-(a[6]?0:1)),w=(s-m)*_/_+m;switch(f){case No.M:u=m,p=v,c=u,d=p;break;case No.L:if(i){if(tc(c,d,m,v,e,s,n))return!0}else h+=Re(c,d,m,v,s,n)||0;c=m,d=v;break;case No.C:if(i){if(Jh(c,d,m,v,_,y,b,x,e,s,n))return!0}else h+=ac(c,d,m,v,_,y,b,x,s,n)||0;c=b,d=x;break;case No.Q:if(i){if(Zh(c,d,m,v,_,y,e,s,n))return!0}else h+=oc(c,d,m,v,_,y,s,n)||0;c=_,d=y;break;case No.A:if(o=Math.cos(k)*_+m,l=Math.sin(k)*_+v,g?(u=o,p=l):h+=Re(c,d,o,l,s,n),i){if(Qh(m,v,_,k,k+M,T,e,w,n))return!0}else h+=lc(m,v,_,k,k+M,T,w,n);c=Math.cos(k+M)*_+m,d=Math.sin(k+M)*_+v;break;case No.R:if(u=c=m,p=d=v,o=u+_,l=p+y,i){if(tc(u,p,o,p,e,s,n)||tc(o,p,o,l,e,s,n)||tc(o,l,u,l,e,s,n)||tc(u,l,u,p,e,s,n))return!0}else h+=Re(o,p,o,l,s,n),h+=Re(u,l,u,p,s,n);break;case No.Z:if(i){if(tc(c,d,u,p,e,s,n))return!0}else h+=Re(c,d,u,p,s,n);c=u,d=p}}return i||function(t,e){return Math.abs(t-e)=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const mc=Symbol.for("VWindow"),vc=Symbol.for("WindowHandlerContribution");let _c=class extends To{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){super(),this.hooks={onChange:new _o(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(xo.getNamed(vc,t.env).configure(this,t),this.actived=!0)},this._uid=Da.GenAutoIncrementId(),this.global=Ao.global,this.postInit()}_nativeAddEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._handler.dispatchEvent(t)}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const s=this._handler.getWH();this._width=s.width,this._height=s.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this.clearAllEventListeners(),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,s,n,r){this._handler.setViewBoxTransform(t,e,i,s,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),s={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},s),s.x-=i.x1,s.y-=i.y1,s}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&>(this.width,t.width())&>(this.height,t.height()))}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};_c=gc([qa(),fc("design:paramtypes",[])],_c);var yc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,s){e(i,s,t)}};let Sc=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=Ao.global,this._textMeasureMap=new Map,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}getTextMeasureInstance(t){return t&&this._textMeasureMap.get(t)||this.textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=pc.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure&&"DefaultTextMeasureContribution"!==t.id||(this._textMeasure=t),this._textMeasureMap.has(t.id)||this._textMeasureMap.set(t.id,t)}measureText(t,e,i="native"){var s;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(s=e.fontSize)&&void 0!==s?s:Zl.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Fe(Object.assign({defaultFontParams:{fontFamily:Zl.fontFamily,fontSize:Zl.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Fe.ALPHABET_CHAR_SET+Fe.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const s=xo.get(mc),n=t.AABBBounds,r=n.width(),a=n.height(),o=-n.x1,l=-n.y1;s.create({viewBox:{x1:o,y1:l,x2:n.x2,y2:n.y2},width:r,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(s,[t],{transMatrix:s.getViewBoxTransform(),viewBox:s.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const c=s.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}};var Ac;Sc=yc([qa(),xc(0,Xa(po)),xc(0,Za(Oh)),bc("design:paramtypes",[Object])],Sc),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Ac||(Ac={}));const kc=new We;let Mc=class{constructor(){this.matrix=new We}init(t){return this.mode=Ac.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Ac.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const s=this.outSourceMatrix;if(kc.setValue(s.a,s.b,s.c,s.d,s.e,s.f),this.outTargetMatrix.reset(),i){const{x:s,y:n}=i;this.outTargetMatrix.translate(s,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-s,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(kc.a,kc.b,kc.c,kc.d,kc.e,kc.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(kc.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:s}=e;this.outTargetMatrix.translate(i,s),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-s)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(kc.a,kc.b,kc.c,kc.d,kc.e,kc.f),this}scale(t,e,i){return this.mode===Ac.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===Ac.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return kc.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(kc.a,kc.b,kc.c,kc.d,kc.e,kc.f),this}translate(t,e){return this.mode===Ac.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Ac.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Mc=yc([qa(),bc("design:paramtypes",[])],Mc);const Tc={arc:eh,area:ih,circle:sh,line:ah,path:oh,symbol:dh,text:uh,rect:ch,polygon:lh,star:hh,richtext:ph,richtextIcon:fh,image:gh,group:nh,glyph:rh},wc=Object.keys(Tc);function Cc(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Ec={arc:Object.assign({},Tc.arc),area:Object.assign({},Tc.area),circle:Object.assign({},Tc.circle),line:Object.assign({},Tc.line),path:Object.assign({},Tc.path),symbol:Object.assign({},Tc.symbol),text:Object.assign({},Tc.text),rect:Object.assign({},Tc.rect),polygon:Object.assign({},Tc.polygon),star:Object.assign({},Tc.star),richtext:Object.assign({},Tc.richtext),richtextIcon:Object.assign({},Tc.richtextIcon),image:Object.assign({},Tc.image),group:Object.assign({},Tc.group),glyph:Object.assign({},Tc.glyph)};class Bc{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},wc.forEach((t=>{this._defaultTheme[t]=Object.create(Ec[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,ot.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;wc.forEach((s=>{const n=Object.create(Ec[s]);t&&t[s]&&Cc(n,t[s]),i[s]&&Cc(n,i[s]),e[s]&&Cc(n,e[s]),this.combinedTheme[s]=n})),e.common&&wc.forEach((t=>{Cc(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,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 Pc=new Bc;function Lc(t,e){return t.glyphHost?Lc(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)):Pc.getTheme()}return null}(t)||t.attachedThemeGraphic&&Lc(t.attachedThemeGraphic)||Pc.getTheme()}var Rc=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};class Oc extends l{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=Da.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Rc(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)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 console.error("暂不支持该函数"),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&&ot.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 i=this._firstChild;for(let t=0;t0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._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 i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}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 i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}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 i=0;i{if(!(t instanceof Fc))return void ot.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(Nc(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,s;if(!(t instanceof Fc))return void ot.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=Nc(n.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let s=null==o?void 0:o.parent;for(;s&&s!==this.rootTarget.parent&&s!==n.target;)s=s.parent;if(!s||s===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let s=o;for(;s&&s!==this.rootTarget;)i.add(s),s=s.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(s=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor()),a.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,s;if(!(t instanceof Fc))return void ot.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),a=Nc(r.pointerType);this.dispatchEvent(r,"pointerover"),a&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(s=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof Fc))return void ot.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Nc(t.pointerType),s=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",s||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",s||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Fc))return void ot.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=Hc.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Nc(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),a=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=a;if(a&&!n.composedPath().includes(a)){let e=a;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(Nc(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:s});const a=r.clicksByButton[t.button];a.target===e.target&&s-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=s,e.detail=a.clickCount,Nc(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this._config.supportsTouchEvents&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Fc))return void ot.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(s){let e=s;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):Nc(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof zc))return void ot.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,s,n,r,a,o;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const c=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[c])&&(null===(s=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[c])||void 0===s?void 0:s.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[c])||void 0===r?void 0:r.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?h=this._prePointTargetCache[c]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[c]:h,stageRenderCount:null!==(o=null==h?void 0:h.stage.renderCount)&&void 0!==o?o:-1})),l)for(let e=0,i=l.length;e=0;s--)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Hc.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let s=0,n=i.length;s{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,s=i.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:s,global:n,autoPreventDefault:r=!1,clickInterval:a,supportsTouchEvents:o=n.supportsTouchEvents,supportsPointerEvents:l=n.supportsPointerEvents}=t;this.manager=new Vc(s,{clickInterval:a,supportsTouchEvents:o}),this.globalObj=n,this.supportsPointerEvents=l,this.supportsTouchEvents=o,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new Fc,this.rootWheelEvent=new zc,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:s}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?s.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(s.style,n):i&&_(t)&&!O(this.cursorStyles,t)&&(s.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.addEventListener("pointermove",this.onPointerMove,!0),t.addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.addEventListener("mousemove",this.onPointerMove,!0),t.addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.removeEventListener("pointermove",this.onPointerMove,!0),t.removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.removeEventListener("mousemove",this.onPointerMove,!0),t.removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const s=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(s)return s;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:n-a.left,y:r-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,s=t.changedTouches.length;i0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class Yc{static GetImage(t,e){var i;const s=Yc.cache.get(t);s?"fail"===s.loadState?Ao.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Yc.loadImage(t,e)}static GetSvg(t,e){var i;let s=Yc.cache.get(t);s?"fail"===s.loadState?Ao.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Yc.cache.set(t,s),s.dataPromise=Ao.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Yc.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Yc.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Ao.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Ao.global.loadBlob(t):"json"===e&&(i.dataPromise=Ao.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Yc.isLoading&&Yc.toLoadAueue.length){Yc.isLoading=!0;const t=Yc.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Yc.cache.set(i,n),n.dataPromise=Ao.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Yc.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Yc.loading()})).catch((t=>{console.error(t),Yc.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Yc.loading()}))}}),0)}static loadImage(t,e){const i=$c(t,Yc.toLoadAueue);if(-1!==i)return Yc.toLoadAueue[i].marks.push(e),void Yc.loading();Yc.toLoadAueue.push({url:t,marks:[e]}),Yc.loading()}static improveImageLoading(t){const e=$c(t,Yc.toLoadAueue);if(-1!==e){const t=Yc.toLoadAueue.splice(e,1);Yc.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function $c(t,e){for(let i=0;it?y(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(qc[0]=t[0],qc[2]=t[0],qc[1]=t[1],qc[3]=t[1],qc):t:t:0,Jc=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qc=[1,2,3,0,1,2,3,0];function td(t,e,i,s){for(;t>=Vt;)t-=Vt;for(;t<0;)t+=Vt;for(;t>e;)e+=Vt;Jc[0].x=i,Jc[1].y=i,Jc[2].x=-i,Jc[3].y=-i;const n=Math.ceil(t/Ht)%4,r=Math.ceil(e/Ht)%4;if(s.add(Gt(t)*i,Xt(t)*i),s.add(Gt(e)*i,Xt(e)*i),n!==r||e-t>jt){let t=!1;for(let e=0;ee.length){s=e.map((t=>{const e=new re(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{const e=new re(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}nd.TimeOut=1e3/60;const rd=new nd,ad=(t,e)=>{const i=((t,e)=>_(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};class od{bounds(t,e){if(S(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return S(t)?t:Math.min(t[0],t[1])}}function ld(t,e,i,s,n){return n?t.arc(i,s,e,0,Nt,!1,n):t.arc(i,s,e,0,Nt),!1}var hd=new class extends od{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,i,s,n){return ld(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return ld(t,this.parseSize(e)/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var cd=new class extends od{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,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n)}drawOffset(t,e,i,s,n,r){return function(t,e,i,s,n,r){return t.moveTo(-3*e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-3*e+s-n,r),t.lineTo(e+i+n,-3*e+s-n,r),t.lineTo(e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,e+s+n,r),t.lineTo(e+i+n,e+s+n,r),t.lineTo(e+i+n,3*e+s+n,r),t.lineTo(-e+i-n,3*e+s+n,r),t.lineTo(-e+i-n,e+s+n,r),t.lineTo(-3*e+i-n,e+s+n,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n,r)}};function dd(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}var ud=new class extends od{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return dd(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return dd(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return dd(t,this.parseSize(e)/2+n,i,s,r)}};function pd(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var gd=new class extends od{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return pd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return pd(t,this.parseSize(e)/2+n,i,s)}};function fd(t,e,i,s,n=0){return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class md extends od{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return fd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return fd(t,this.parseSize(e)/2,i,s,n)}}var vd=new md;var _d=new class extends md{constructor(){super(...arguments),this.type="triangle"}};const yd=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),bd=Math.sin(Nt/10)*yd,xd=-Math.cos(Nt/10)*yd;function Sd(t,e,i,s){const n=bd*e,r=xd*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=Nt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}var Ad=new class extends od{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,i,s){return Sd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Sd(t,this.parseSize(e)/2+n,i,s)}};const kd=Kt(3);function Md(t,e,i,s){const n=e,r=n/kd,a=r/5,o=e;return t.moveTo(0+i,-n+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,o+s),t.lineTo(-a/2+i,o+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}var Td=new class extends od{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,i,s){return Md(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Md(t,this.parseSize(e)/2+n,i,s)}};function wd(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}var Cd=new class extends od{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return wd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return wd(t,this.parseSize(e)/2+n,i,s)}};function Ed(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var Bd=new class extends od{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Ed(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ed(t,this.parseSize(e)/2+n,i,s)}};const Pd=-.5,Ld=Kt(3)/2,Rd=1/Kt(12);function Od(t,e,i,s){const n=e/2,r=e*Rd,a=n,o=e*Rd+e,l=-a,h=o;return t.moveTo(n+i,r+s),t.lineTo(a+i,o+s),t.lineTo(l+i,h+s),t.lineTo(Pd*n-Ld*r+i,Ld*n+Pd*r+s),t.lineTo(Pd*a-Ld*o+i,Ld*a+Pd*o+s),t.lineTo(Pd*l-Ld*h+i,Ld*l+Pd*h+s),t.lineTo(Pd*n+Ld*r+i,Pd*r-Ld*n+s),t.lineTo(Pd*a+Ld*o+i,Pd*o-Ld*a+s),t.lineTo(Pd*l+Ld*h+i,Pd*h-Ld*l+s),t.closePath(),!1}var Id=new class extends od{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,i,s){return Od(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Od(t,this.parseSize(e)/2+n,i,s)}};function Dd(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}var Fd=new class extends od{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return Dd(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return Dd(t,this.parseSize(e)/2,i,s,n)}};function zd(t,e,i,s,n=0){return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}var jd=new class extends od{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,i,s){return zd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return zd(t,this.parseSize(e)/2,i,s,n)}};function Hd(t,e,i,s,n=0){return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}var Nd=new class extends od{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return Hd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Hd(t,this.parseSize(e)/2,i,s,n)}};const Vd=Kt(3);function Ud(t,e,i,s){const n=e*Vd;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var Wd=new class extends od{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Ud(t,this.parseSize(e)/2/Vd,i,s)}drawOffset(t,e,i,s,n){return Ud(t,this.parseSize(e)/2/Vd+n,i,s)}};function Gd(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}var Yd=new class extends od{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,i,s){return Gd(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Gd(t,this.parseSize(e)/4+n,i,s)}};function $d(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}var Xd=new class extends od{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,i,s){return $d(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return $d(t,this.parseSize(e)/4+n,i,s)}};function Kd(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}var qd=new class extends od{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,i,s){return Kd(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Kd(t,this.parseSize(e)/4+n,i,s)}};function Zd(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}var Jd=new class extends od{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,i,s){return Zd(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Zd(t,this.parseSize(e)/4+n,i,s)}};function Qd(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var tu=new class extends od{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return Qd(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return Qd(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function eu(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var iu=new class extends od{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return eu(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return eu(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function su(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var nu=new class extends od{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,i,s,n){return su(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return su(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function ru(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function au(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}var ou=new class extends od{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,i,s){return S(e)?au(t,e,i,s):ru(t,e,i,s)}drawWithClipRange(t,e,i,s,n,r,a){S(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*n,l=[{x:i+e[0]/2,y:s-e[1]/2},{x:i+e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;eo){const e=(i.x-c.x)*(o-h)/s,n=(i.y-c.y)*(o-h)/s;t.lineTo(c.x+e,c.y+n);break}t.lineTo(i.x,i.y),c=i,h+=s}return!1}drawOffset(t,e,i,s,n){return S(e)?au(t,e+2*n,i,s):ru(t,[e[0]+2*n,e[1]+2*n],i,s)}};const lu=new Ve;class hu{constructor(t,e,i=!1){this.pathStr="",this.type=t,y(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),sl(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(sl(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,n,r)}parseSize(t){return S(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,s,n),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,s,n),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{lu.x1=i.bounds.x1*t,lu.y1=i.bounds.y1*t,lu.x2=i.bounds.x2*t,lu.y2=i.bounds.y2*t,e.union(lu)}))}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 cu={};[hd,cd,ud,gd,Wd,_d,Ad,Td,Cd,Bd,Id,Fd,jd,vd,Nd,Yd,Xd,qd,Jd,ou,tu,iu,nu].forEach((t=>{cu[t.type]=t}));const du={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 uu{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 pu(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function gu(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r",r,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",r=e}else if("?"===t[r+1])r=gu(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=pu(t,"--\x3e",r+4,"Comment is not closed.");else{const a=gu(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);const t=new uu(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new uu(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=c}else s+=t[r];return e.child}}function vu(t,e){return _u(t)}function _u(t,e){const i={};for(let e=0;ewu.set(t,!0)));const Cu=new Map;function Eu(t){if(wu.has(t))return!0;if(Cu.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Cu.set(t,!0)));const Bu=Mu(),Pu=Mu(),Lu=Mu(),Ru=Mu(),Ou=Mu(),Iu=Mu(),Du=Mu(),Fu=Mu(),zu=Mu(),ju=Mu();Mu();const Hu=Mu();Mu();const Nu=Mu();Mu();const Vu=Mu(),Uu=Mu(),Wu=Symbol.for("GraphicService"),Gu=Symbol.for("GraphicCreator"),Yu={"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"},$u=Object.keys(Yu),Xu={duration:200,easing:"cubicOut"};function Ku(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 qu(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,c,d,u,p,g,f,m,v;return e===t?(t[12]=e[0]*s+e[4]*n+e[8]*r+e[12],t[13]=e[1]*s+e[5]*n+e[9]*r+e[13],t[14]=e[2]*s+e[6]*n+e[10]*r+e[14],t[15]=e[3]*s+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],d=e[5],u=e[6],p=e[7],g=e[8],f=e[9],m=e[10],v=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=v,t[12]=a*s+c*n+g*r+e[12],t[13]=o*s+d*n+f*r+e[13],t[14]=l*s+u*n+m*r+e[14],t[15]=h*s+p*n+v*r+e[15]),t}function Zu(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Ju(t,e,i){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],d=e[8],u=e[9],p=e[10],g=e[11],f=e[12],m=e[13],v=e[14],_=e[15];let y=i[0],b=i[1],x=i[2],S=i[3];return t[0]=y*s+b*o+x*d+S*f,t[1]=y*n+b*l+x*u+S*m,t[2]=y*r+b*h+x*p+S*v,t[3]=y*a+b*c+x*g+S*_,y=i[4],b=i[5],x=i[6],S=i[7],t[4]=y*s+b*o+x*d+S*f,t[5]=y*n+b*l+x*u+S*m,t[6]=y*r+b*h+x*p+S*v,t[7]=y*a+b*c+x*g+S*_,y=i[8],b=i[9],x=i[10],S=i[11],t[8]=y*s+b*o+x*d+S*f,t[9]=y*n+b*l+x*u+S*m,t[10]=y*r+b*h+x*p+S*v,t[11]=y*a+b*c+x*g+S*_,y=i[12],b=i[13],x=i[14],S=i[15],t[12]=y*s+b*o+x*d+S*f,t[13]=y*n+b*l+x*u+S*m,t[14]=y*r+b*h+x*p+S*v,t[15]=y*a+b*c+x*g+S*_,t}function Qu(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}class tp{constructor(){this.pools=[]}static identity(t){return Ku(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 tp.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 i=0;i=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const rp=new We(1,0,0,1,0,0),ap={x:0,y:0};let op=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new We(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new We(1,0,0,1,0,0),this.path=new Wl,this._clearMatrix=new We(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 ep.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new We(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(ep.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(ep.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,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,r),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,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,s,n,r){this.path.arc(t,e,i,s,n,r)}arcTo(t,e,i,s,n){this.path.arcTo(t,e,i,s,n)}bezierCurveTo(t,e,i,s,n,r){this.path.bezierCurveTo(t,e,i,s,n,r)}closePath(){this.path.closePath()}ellipse(t,e,i,s,n,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.path.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.path.rect(t,e,i,s)}createImageData(t,e){return null}createLinearGradient(t,e,i,s){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,s,n,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,s){return null}fill(t,e){}fillRect(t,e,i,s){this.path.rect(t,e,i,s)}clearRect(t,e,i,s){}fillText(t,e,i){}getImageData(t,e,i,s){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},ap),function(t,e,i){return uc(t,0,!1,e,i)}(this.path.commandList,ap.x,ap.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},ap);const i=_h(this,this.lineWidth,this.dpr);return function(t,e,i,s){return uc(t,e,!0,i,s)}(this.path.commandList,i,ap.x,ap.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,s){this.path.rect(t,e,i,s)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,s,n){}_setCommonStyle(t,e,i,s){}setStrokeStyle(t,e,i,s,n){}_setStrokeStyle(t,e,i,s){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(rp,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}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=>ep.free(t))),this.stack.length=0}};op=sp([qa(),np("design:paramtypes",[Object,Number])],op);const lp={WIDTH:500,HEIGHT:500,DPR:1};class hp{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}set nativeCanvas(t){this._nativeCanvas=t}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:s=lp.WIDTH,height:n=lp.HEIGHT,dpr:r=lp.DPR,x:a,y:o,id:l,canvasControled:h=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=s*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=s,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,s){return this._context.getImageData(t,e,i,s)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}var cp;hp.env="browser",function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(cp||(cp={}));class dp{static Get(t,e=cp.Color1,i=[0,0,0,1]){if(e===cp.Color1){const e=dp.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=ii.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];dp.store1[t]=e,dp.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=dp.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=ii.parseColorString(t);return n&&(dp.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],dp.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===cp.Color1){if(dp.store1[t])return;dp.store1[t]=i,dp.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(dp.store255[t])return;dp.store255[t]=i,dp.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function up(t,e=!1){return Array.isArray(t)&&S(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function pp(t,e,i,s,n){return Array.isArray(t)&&!S(t[0])||Array.isArray(e)&&!S(e[0])?new Array(4).fill(0).map(((n,r)=>{var a,o;return gp(y(t)?null!==(a=t[r])&&void 0!==a?a:t[0]:t,y(e)?null!==(o=e[r])&&void 0!==o?o:e[0]:e,i,s)})):gp(t,e,i,s,n)}function gp(t,e,i,s,n){if(!t||!e)return t&&up(t)||e&&up(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=dp.Get(t,cp.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=dp.Get(e,cp.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:up(a)})))});return o?pp(r,l,i,s,n):pp(l,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:_p(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:_p(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:_p(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(r,a),up(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),s)}function fp(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}dp.store255={},dp.store1={};const mp=[0,0,0,0],vp=[0,0,0,0];function _p(t,e,i){return dp.Get(t,cp.Color255,mp),dp.Get(e,cp.Color255,vp),`rgba(${Math.round(mp[0]+(vp[0]-mp[0])*i)},${Math.round(mp[1]+(vp[1]-mp[1])*i)},${Math.round(mp[2]+(vp[2]-mp[2])*i)},${mp[3]+(vp[3]-mp[3])*i})`}class yp{static GetCanvas(){try{return yp.canvas||(yp.canvas=Ao.global.createCanvas({})),yp.canvas}catch(t){return null}}static GetCtx(){if(!yp.ctx){const t=yp.GetCanvas();yp.ctx=t.getContext("2d")}return yp.ctx}}class bp extends Ge{static getInstance(){return bp._instance||(bp._instance=new bp),bp._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=yp.GetCanvas(),s=yp.GetCtx();if(i.width=e,i.height=1,!s)return;if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");const n=s.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),s.fillStyle=n,s.fillRect(0,0,e,1),this.rgbaSet=s.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,s,n=[],r=100){let a=`${t}${e}${i}${s}`;n.forEach((t=>a+=t.join())),a+=r;let o=this.dataMap.get(a);return o||(o={data:new bp(n,r),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class xp{static GetSize(t){for(let e=0;e=t)return xp.ImageSize[e];return t}static Get(t,e,i,s,n,r,a){const o=xp.GenKey(t,e,i,s,n),l=xp.cache[o];if(!l||0===l.length)return null;for(let t=0;t=r&&l[t].height>=a)return l[t].pattern;return null}static Set(t,e,i,s,n,r,a,o){const l=xp.GenKey(t,e,i,s,n);xp.cache[l]?xp.cache[l].push({width:a,height:o,pattern:r}):xp.cache[l]=[{width:a,height:o,pattern:r}]}static GenKey(t,e,i,s,n){return`${e},${i},${s},${n},${t.join()}`}}xp.cache={},xp.ImageSize=[20,40,80,160,320,640,1280,2560];const Sp=new Ve,Ap=new We;new Ve;const kp=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Mp=["x","y"],Tp=["scaleX","scaleY"],wp=["angle"],Cp=new re,Ep={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 Bp extends Oc{static mixin(t){const e=Object.keys(t);for(let i=0;i10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=cu[t];if(e)return e;if(e=Bp.userSymbolMap[t],e)return e;if(!0===((i=t=du[t]||t).startsWith("{const e=(new Wl).fromString(t.d),i={};$u.forEach((e=>{t[e]&&(i[Yu[e]]=t[e])})),n.push({path:e,attribute:i}),Sp.union(e.bounds)}));const r=Sp.width(),a=Sp.height(),o=1/Yt(r,a);n.forEach((t=>t.path.transform(0,0,o,o)));const l=new hu(t,n,!0);return Bp.userSymbolMap[t]=l,l}var i;const s=(new Wl).fromString(t),n=s.bounds.width(),r=s.bounds.height(),a=1/Yt(n,r);s.transform(0,0,a,a);const o=new hu(t,s);return Bp.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,s=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:n=e.boundsPadding}=i,r=Zc(n);return r&&s.expand(r),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new Fo(t);return sl(e.commandList,i,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 We),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Xo.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Xo.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Xo.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Xo.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Xo.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Xo.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Xo.CLEAR_SHAPE}containsPoint(t,e,i,s){if(!s)return!1;if(i===Ko.GLOBAL){const i=new re(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,s){this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||s)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,i){t&&((t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i))}_setAttributes(t,e=!1,i){const s=Object.keys(t);for(let e=0;e{i[e]?(o||(o={}),o[e]=t[e]):a[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(n=this.context&&this.context.stateAnimateConfig)&&void 0!==n?n:this.stateAnimateConfig)&&void 0!==r?r:Xu;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:qo.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t)}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:qo.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:qo.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,i;const s=this.attribute[t];return this.animates&&this.animates.size?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=s?s:null===(i=this.finalAttribute)||void 0===i?void 0:i[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 i=y(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stateSort&&(t=t.sort(this.stateSort));const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=Xo.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Xo.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Xo.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Xo.UPDATE_SHAPE_AND_BOUNDS)===Xo.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Xo.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Xo.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Xo.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Xo.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Xo.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Xo.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Xo.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Xo.UPDATE_LAYOUT)}getAnchor(t,e,i){const s=[0,0],n=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(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,i=n();s[0]=i.x1+(i.x2-i.x1)*e}else s[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=n();s[1]=i.y1+(i.y2-i.y1)*e}else s[1]=t[1];return s}doUpdateLocalMatrix(){const{x:t=$l.x,y:e=$l.y,scaleX:i=$l.scaleX,scaleY:s=$l.scaleY,angle:n=$l.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&n&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,c=e.c,d=e.d,u=e.e,p=e.f,g=Gt(a),f=Xt(a);let m,v;o?(m=o[0],v=o[1]):(m=i,v=s);const _=m-i,y=v-s,b=l*g+c*f,x=h*g+d*f,S=c*g-l*f,A=d*g-h*f;t.a=n*b,t.b=n*x,t.c=r*S,t.d=r*A,t.e=u+l*m+c*v-b*_-S*y,t.f=p+h*m+d*v-x*_-A*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),Ao.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const c=this.getOffsetXY($l);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=Ap.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:qo.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:Ao.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 _(t,!0)?this.pathProxy=(new Wl).fromString(t):this.pathProxy=new Wl,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("{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(),Ao.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new jc(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}toCustomPath(){var t,e,i;const s=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||Ao.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(s){const t=new op(null,1);return s.drawShape(this,t,0,0,{},{}),t.path}return null}}var Pp;Bp.userSymbolMap={},Bp.mixin(Uc),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Pp||(Pp={}));let Lp=class t extends Bp{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Iu,this._childUpdateTag=Xo.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 Bc),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Bc)}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,i){if(i===Ko.GLOBAL){const i=new re(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Xo.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=$l.x,y:e=$l.y,dx:i=$l.dx,dy:s=$l.dy,scaleX:n=$l.scaleX,scaleY:r=$l.scaleY,angle:a=$l.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==n||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Lc(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:s=0}=t;i.translate(e,s)}return Ao.graphicService.updateTempAABBBounds(i),Ao.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=Xo.CLEAR_BOUNDS,this._childUpdateTag&=Xo.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=Xo.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Xo.UPDATE_BOUNDS||(this._childUpdateTag|=Xo.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 i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}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&Xo.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let s=this._getChildByName(t);return s?s.setAttributes(e):(s=Ao.graphicService.creator[i](e),s.name=t,this.add(s)),s}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 Rp(t){return new Lp(t)}Lp.NOWORK_ANIMATE_ATTR=Ep;class Op extends Lp{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,s){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=s.main,this.layerHandler=s.layerHandler,this.layerHandler.init(this,i,{main:s.main,canvasId:s.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=s.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new Bc,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Ao.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Ao.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const Ip=Symbol.for("TransformUtil"),Dp=Symbol.for("GraphicUtil"),Fp=Symbol.for("LayerService"),zp=Symbol.for("StaticLayerHandlerContribution"),jp=Symbol.for("DynamicLayerHandlerContribution"),Hp=Symbol.for("VirtualLayerHandlerContribution");var Np,Vp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Up=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Wp=Np=class{static GenerateLayerId(){return`${Np.idprefix}_${Np.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Ao.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?xo.get(zp):"dynamic"===t?xo.get(jp):xo.get(Hp),e}createLayer(t,e={main:!1}){var i;this.tryInit();let s=this.getRecommendedLayerType(e.layerMode);s=e.main||e.canvasId?"static":s;const n=this.getLayerHandler(s),r=new Op(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:s,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:Np.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(t)||[];return a.push(r),this.layerMap.set(t,a),this.staticLayerCountInEnv--,r}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}};Wp.idprefix="visactor_layer",Wp.prefix_count=0,Wp=Np=Vp([qa(),Up("design:paramtypes",[])],Wp);var Gp=new Fa((t=>{t(bo).to(Po).inSingletonScope(),t(mc).to(_c),t(Dp).to(Sc).inSingletonScope(),t(Ip).to(Mc).inSingletonScope(),t(Fp).to(Wp).inSingletonScope()}));function Yp(t,e){return!(!t&&!e)}function $p(t,e){let i;return i=y(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Xp(t,e,i){return i&&t*e>0}function Kp(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function qp(t,e){return t*e>0}function Zp(t,e,i,s,n){return n?t*e>0:t*e>0&&0!==i&&0!==s}function Jp(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,d=-h*o,u=t+c,p=e+d,g=i+c,f=s+d,m=(u+g)/2,v=(p+f)/2,_=g-u,y=f-p,b=_*_+y*y,x=n-r,S=u*f-g*p,A=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S));let k=(S*y-_*A)/b,M=(-S*_-y*A)/b;const T=(S*y+_*A)/b,w=(-S*_+y*A)/b,C=k-m,E=M-v,B=T-m,P=w-v;return C*C+E*E>B*B+P*P&&(k=T,M=w),{cx:k,cy:M,x01:-c,y01:-d,x11:k*(n/x-1),y11:M*(n/x-1)}}function Qp(t,e,i,s,n){const r=Ut(i-e),a=t.getParsedCornerRadius(),o=y(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:c,outerEndAngle:d,innerEndAngle:u,innerStartAngle:p}=t.getParsePadAngle(e,i),g=o?a[0]:a,f=o?a[1]:a,m=o?a[2]:a,v=o?a[3]:a,_=Math.max(f,g),b=Math.max(m,v);let x=_,S=b;const A=n*Gt(c),k=n*Xt(c),M=s*Gt(u),T=s*Xt(u);let w,C,E,B;if((b>zt||_>zt)&&(w=n*Gt(d),C=n*Xt(d),E=s*Gt(p),B=s*Xt(p),r1?0:P<-1?jt:Math.acos(P))/2),l=Kt(t[0]*t[0]+t[1]*t[1]);S=$t(b,(s-l)/(o-1)),x=$t(_,(n-l)/(o+1))}}var P;return{outerDeltaAngle:l,xors:A,yors:k,xirs:E,yirs:B,xore:w,yore:C,xire:M,yire:T,limitedOcr:x,limitedIcr:S,outerCornerRadiusStart:g,outerCornerRadiusEnd:f,maxOuterCornerRadius:_,maxInnerCornerRadius:b,outerStartAngle:c,outerEndAngle:d,innerDeltaAngle:h,innerEndAngle:u,innerStartAngle:p,innerCornerRadiusStart:v,innerCornerRadiusEnd:m}}function tg(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=Ut(l-o),c=l>o;let d=!1;if(n=Vt-zt)e.moveTo(i+n*Gt(o),s+n*Xt(o)),e.arc(i,s,n,o,l,!c),r>zt&&(e.moveTo(i+r*Gt(l),s+r*Xt(l)),e.arc(i,s,r,l,o,c));else{const{outerDeltaAngle:h,xors:u,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:v,outerCornerRadiusEnd:_,maxOuterCornerRadius:y,xore:b,yore:x,xire:S,yire:A,outerStartAngle:k,outerEndAngle:M,limitedIcr:T,innerDeltaAngle:w,innerEndAngle:C,innerStartAngle:E,innerCornerRadiusStart:B,innerCornerRadiusEnd:P,maxInnerCornerRadius:L}=Qp(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+u,s+p),d=!0;else if(m>zt){const t=$t(v,m),r=$t(_,m),o=Jp(g,f,u,p,n,t,Number(c)),l=Jp(b,x,S,A,n,r,Number(c));m0&&e.arc(i+o.cx,s+o.cy,t,Wt(o.y01,o.x01),Wt(o.y11,o.x11),!c),e.arc(i,s,n,Wt(o.cy+o.y11,o.cx+o.x11),Wt(l.cy+l.y11,l.cx+l.x11),!c),r>0&&e.arc(i+l.cx,s+l.cy,r,Wt(l.y11,l.x11),Wt(l.y01,l.x01),!c)):r>0?e.moveTo(i+l.cx+r*Gt(Wt(l.y01,l.x01)),s+l.cy+r*Xt(Wt(l.y01,l.x01))):e.moveTo(i+b,s+n*Xt(M))}else!a||a[0]?(e.moveTo(i+u,s+p),e.arc(i,s,n,k,M,!c)):e.moveTo(i+n*Gt(M),s+n*Xt(M));if(!(r>zt)||w<.001)!a||a[1]?e.lineTo(i+S,s+A):e.moveTo(i+S,s+A),d=!0;else if(T>zt){const t=$t(B,T),n=$t(P,T),o=Jp(S,A,b,x,r,-n,Number(c)),l=Jp(u,p,g,f,r,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),T0&&e.arc(i+o.cx,s+o.cy,n,Wt(o.y01,o.x01),Wt(o.y11,o.x11),!c),e.arc(i,s,r,Wt(o.cy+o.y11,o.cx+o.x11),Wt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,s+l.cy,t,Wt(l.y11,l.x11),Wt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*Gt(Wt(l.y01,l.x01)),s+l.cy+t*Xt(Wt(l.y01,l.x01))):e.moveTo(i+g,s+f)}else!a||a[1]?e.lineTo(i+S,s+A):e.moveTo(i+S,s+A),!a||a[2]?e.arc(i,s,r,C,E,c):e.moveTo(i+r*Gt(E),s+r*Xt(E))}return a?a[3]&&e.lineTo(i+n*Gt(o),s+n*Xt(o)):e.closePath(),d}const eg=Symbol.for("ArcRenderContribution"),ig=Symbol.for("AreaRenderContribution"),sg=Symbol.for("CircleRenderContribution"),ng=Symbol.for("GroupRenderContribution"),rg=Symbol.for("ImageRenderContribution"),ag=Symbol.for("PathRenderContribution"),og=Symbol.for("PolygonRenderContribution"),lg=Symbol.for("RectRenderContribution"),hg=Symbol.for("SymbolRenderContribution"),cg=Symbol.for("TextRenderContribution"),dg=Symbol.for("InteractiveSubRenderContribution");function ug(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function pg(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var gg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},fg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mg=function(t,e){return function(i,s){e(i,s,t)}};function vg(t,e,i){var s;const{x:n=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:v}=e.attribute,_=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;_[0]=i.x1+(i.x2-i.x1)*t}else _[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;_[1]=i.x1+(i.x2-i.x1)*t}else _[1]=m[1];_[2]=null!==(s=m[2])&&void 0!==s?s:0}if(Ku(t),qu(t,t,[n+o,r+l,a+h]),qu(t,t,[_[0],_[1],_[2]]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],d=e[10],u=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]=r*n+h*s,t[5]=a*n+c*s,t[6]=o*n+d*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=c*n-a*s,t[10]=d*n-o*s,t[11]=u*n-l*s}(t,t,g),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],d=e[10],u=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]=r*n-h*s,t[1]=a*n-c*s,t[2]=o*n-d*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+c*n,t[10]=o*s+d*n,t[11]=l*s+u*n}(t,t,p),qu(t,t,[-_[0],-_[1],_[2]]),function(t,e,i){const s=i[0],n=i[1],r=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,d,u]),f){const i=ip.allocate(),s=[0,0];if(v){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=m[1]}qu(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],d=e[6],u=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]=r*n+h*s,t[1]=a*n+c*s,t[2]=o*n+d*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=c*n-a*s,t[6]=d*n-o*s,t[7]=u*n-l*s}(i,i,f),qu(i,i,[-s[0],-s[1],0]),Ju(t,t,i)}}let _g=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new _o(["graphic"]),onSetStage:new _o(["graphic","stage"]),onRemove:new _o(["graphic"]),onRelease:new _o(["graphic"]),onAddIncremental:new _o(["graphic","group","stage"]),onClearIncremental:new _o(["graphic","group","stage"]),beforeUpdateAABBBounds:new _o(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new _o(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new _o(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Ve,this.tempAABBBounds2=new Ve}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,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,n)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new Fo(t);return sl(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=S(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=pg(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=S(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=ug(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l){Au(d,(l+h)/Math.abs(n+r),s,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;Au(d,o/Math.abs(n+r)*2,!1,c+1),d.translate(s,a),e.union(d)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&He(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot||s.isContainer)return!0;const{visible:n=e.visible}=t;return!(!s.valid||!n)||(i.empty()||(s.parent&&i.transformWithMatrix(s.parent.globalTransMatrix),this.clearAABBBounds(s,s.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};_g=gg([qa(),mg(0,Xa(Gu)),fg("design:paramtypes",[Object])],_g);const yg=(t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}return i},bg=["radius","startAngle","endAngle",...kp];class xg extends Bp{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Ru}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return Lc(this).circle}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Ao.graphicService.updateTempAABBBounds(i);return yg(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Ao.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:s=e.radius}=t;return i.set(-s,-s,s,s),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:s=e.startAngle,endAngle:n=e.endAngle,radius:r=e.radius}=t;return n-s>Vt-zt?i.set(-r,-r,r,r):td(s,n,r,i),i}needUpdateTags(t){return super.needUpdateTags(t,bg)}needUpdateTag(t){return super.needUpdateTag(t,bg)}toCustomPath(){var t,e,i;let s=super.toCustomPath();if(s)return s;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),a=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle");return s=new Wl,s.arc(0,0,r,a,o),s}clone(){return new xg(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return xg.NOWORK_ANIMATE_ATTR}}function Sg(t){return new xg(t)}xg.NOWORK_ANIMATE_ATTR=Ep;class Ag{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,s){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===s.length){const t=s[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,s,n="",r,a){const{lineWidth:o,suffixPosition:l="end",measureMode:h=Lo.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const d=[],u=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,s=t.length;io){const s=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,n,r,l);a=s.str,e=s.width}else e=s.width;d.push({str:a,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:c})}u[0]=o}else{let e,i,s=0;for(let n=0,r=t.length;nMath.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(p,e,i,d),this.layoutWithBBox(p,d,e,i,s)}layoutWithBBox(t,e,i,s,n){const r=[0,0],a=e.length*n;"top"===s||("middle"===s?r[1]=(t.height-a)/2:"bottom"===s&&(r[1]=t.height-a));for(let a=0;a{t+=e.str})),(Array.isArray(r)?r.join(""):r).toString()!==t}return"vertical"===s.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==s.text.toString():null!=this.clipedText&&this.clipedText!==s.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=Uu,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return y(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Lc(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;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 Mg({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:n,y:r}=e,a={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},o=Te(a,i,{x:n,y:r});return this._OBBBounds.copy(s),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=Ao.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){Au(n,o/Math.abs(r+a),!0,l),i.union(n)}return Ao.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Ao.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,He(i,i,this.transMatrix),i}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:i=e.direction,underlineOffset:s=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&s&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+s),n}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),n=this.attribute,{fontFamily:r=s.fontFamily,textAlign:a=s.textAlign,textBaseline:o=s.textBaseline,fontSize:l=s.fontSize,fontWeight:h=s.fontWeight,ellipsis:c=s.ellipsis,maxLineWidth:d,stroke:u=s.stroke,wrap:p=s.wrap,measureMode:g=s.measureMode,lineWidth:f=s.lineWidth,whiteSpace:m=s.whiteSpace,suffixPosition:v=s.suffixPosition,ignoreBuf:_=s.ignoreBuf,keepCenterInLine:y=s.keepCenterInLine}=n,b=_?0:this.guessLineHeightBuf(l),x=this.getLineHeight(n,s,b);if("normal"===m||p)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),u&&this._AABBBounds.expand(f/2),this._AABBBounds}const S=Ao.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(i=this.stage)||void 0===i?void 0:i.textMeasureId)),A=new Ag(r,{fontSize:l,fontWeight:h,fontFamily:r,lineHeight:x},S).GetLayoutByLines(t,a,o,x,!0===c?s.ellipsis:c||void 0,!1,{lineWidth:d,suffixPosition:v,measureMode:g,keepCenterInLine:y}),{bbox:k}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),u&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:d,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:m=r.ignoreBuf,measureMode:v=r.measureMode,suffixPosition:_=r.suffixPosition,heightLimit:b=0,lineClamp:x,keepCenterInLine:S=r.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(h),k=this.getLineHeight(this.attribute,r,A);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),u&&this._AABBBounds.expand(p/2),this._AABBBounds}const M=Ao.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(i=this.stage)||void 0===i?void 0:i.textMeasureId)),T={fontSize:h,fontWeight:f,fontFamily:a,lineHeight:k},w=new Ag(a,T,M),C=y(t)?t.map((t=>t.toString())):[t.toString()],E=[],B=[0,0];let P=1/0;if(b>0&&(P=Math.max(Math.floor(b/k),1)),x&&(P=Math.min(P,x)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,i=0;for(let s=0,n=C.length;s{const e=t.reduce(((t,e)=>t+e.width),0);a=Yt(e,a)}));const t=ug(_,a),e=this.cache.verticalList.length*v,i=pg(y,e,d);return this._AABBBounds.set(i,t,i+e,t+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const b=t.map((t=>function(t){const e=[];let i=0,s="";for(let n=0;n{if(Number.isFinite(l))if(h){const i=!0===h?n.ellipsis:h,s=r.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,i,!1,m);b[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,!1);b[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===Tu.HORIZONTAL?d:r.measureTextWidth(t.text,{fontSize:d,fontWeight:u,fontFamily:c});a+=e,t.width=e}))})),this.cache.verticalList=b,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=Yt(e,a)}));const x=ug(_,a),S=this.cache.verticalList.length*v,A=pg(y,S,d);return this._AABBBounds.set(A,x,A+S,x+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}getMaxWidth(t){var e,i;const s=this.attribute;return null!==(i=null!==(e=s.maxLineWidth)&&void 0!==e?e:s.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var s;return null!==(s=ad(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==s?s:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=kg){return super.needUpdateTags(t,e)}needUpdateTag(t,e=kg){return super.needUpdateTag(t,e)}_interpolate(t,e,i,s,n){"text"===t&&(n.text=s)}clone(){return new Mg(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Mg.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Mg.baselineMapAlign}getAlignMapBaseline(){return Mg.alignMapBaseline}}function Tg(t){return new Mg(t)}Mg.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ep),Mg.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Mg.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const wg=["symbolType","size",...kp];let Cg=class t extends Bp{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Vu}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let s=null;try{s=new Path2D}catch(t){return null}const n=this.getParsedPath();if(!n)return null;n.draw(s,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return y(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Lc(this).symbol}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Ao.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=s;Au(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return Ao.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(y(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t,n=this.getParsedPath();return n?(n.bounds(s,i),i):i}needUpdateTags(t){return super.needUpdateTags(t,wg)}needUpdateTag(t){return super.needUpdateTag(t,wg)}toCustomPath(){const t=this.getParsedPath();if(!t)return null;const e=this.attribute.size,i=y(e)?e:[e,e];return t.path?(new Wl).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Wl).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Eg(t){return new Cg(t)}Cg.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ep);const Bg=["segments","points","curveType","curveTension",...kp];let Pg=class t extends Bp{constructor(t={}){super(t),this.type="line",this.numberType=Fu}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,s,n){"points"===t&&(n.points=id(i,s,e))}getGraphicTheme(){return Lc(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Ao.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:s=e.lineJoin}=t;return Ao.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){const{points:n=e.points,connectedType:r}=t,a=i;return n.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments,connectedType:r}=t,a=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,Bg)}needUpdateTag(t){return super.needUpdateTag(t,Bg)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new Wl;const i=e.segments,s=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{s(t.points)})):e.points&&s(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Lg(t){return new Pg(t)}Pg.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ep);const Rg=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=u(t.width)?t.x1-t.x:t.width,i=u(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}},Og=["width","x1","y1","height","cornerRadius",...kp];class Ig extends Bp{constructor(t){super(t),this.type="rect",this.numberType=Hu}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Lc(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=Ao.graphicService.updateTempAABBBounds(i);return yg(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Ao.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Og)}needUpdateTag(t){return super.needUpdateTag(t,Og)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:i,y:s,width:n,height:r}=Rg(e);return t=new Wl,t.moveTo(i,s),t.rect(i,s,n,r),t}clone(){return new Ig(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ig.NOWORK_ANIMATE_ATTR}}function Dg(t){return new Ig(t)}Ig.NOWORK_ANIMATE_ATTR=Ep;class Fg extends Bp{constructor(t){super(t),this.type="glyph",this.numberType=Ou,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,s){super.setAttribute(t,e,i,s),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return Lc(this).glyph}updateAABBBounds(t,e,i){return this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++,this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates(),this.stateSort&&(t=t.sort(this.stateSort));const s={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(s,r.attributes),(null===(i=r.subAttributes)||void 0===i?void 0:i.length)&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new Fg(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Fg.NOWORK_ANIMATE_ATTR}}function zg(t){return new Fg(t)}Fg.NOWORK_ANIMATE_ATTR=Ep;class jg{constructor(t,e,i,s,n,r,a,o,l,h,c,d,u,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=bh[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=d,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-n:"center"===this.globalAlign&&(o=-n/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;ithis[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;ithis[this.directionKey.top]+l||rthis[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;it&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width,this.height;let n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(let i=0;ithis[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((n-this.actualHeight)/2);for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+n||at&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+rthis[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function Hg(t,e,i,s){const n=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(s);return{left:t>n?n:n-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>s?o:o+.5}}class Ng{constructor(t,e,i,s){var n,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=s;const a=ad(i.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:h,width:c}=Bh(t,i,this.ascentDescentMode);let d=0,u=0,p=0;this.height>l&&(d=(this.height-l)/2,u=Math.ceil(d),p=Math.floor(d)),"top"===this.textBaseline?(this.ascent=d,this.descent=l-d):"bottom"===this.textBaseline?(this.ascent=l-d,this.descent=d):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+u,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(n=i.dx)&&void 0!==n?n:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.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}=Bh(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,i,s,n,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+s;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=wh(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=Bh(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const d=Hg(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},d),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,s,n,r,a){var o;let l=e+i,h=this.text,c=this.left+s+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let d=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,d="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=wh(h,("vertical"===d?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===d);else{const{width:e}=Bh(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===d&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:u=1}=this.character;if(this.character.stroke&&u&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=Hg(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.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,i=Hg(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=Hg(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.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,i=Hg(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===d&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=wh(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=Bh(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-s}return i}}const Vg=["width","height","image",...kp];class Ug extends Bp{constructor(t){super(t),this.type="image",this.numberType=Du,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,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return Lc(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:s=e.maxWidth,maxHeight:n=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>s/n?(r=s,a=s/t):(a=n,r=n*t)}}else r=s,a=n}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:s,tb2:n}=Ao.graphicService.updateTempAABBBounds(i);return yg(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Ao.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return gh[t]}needUpdateTags(t){return super.needUpdateTags(t,Vg)}needUpdateTag(t){return super.needUpdateTag(t,Vg)}clone(){return new Ug(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ug.NOWORK_ANIMATE_ATTR}}function Wg(t){return new Ug(t)}Ug.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Ep);class Gg extends Ug{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=Zc(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(y(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zc(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=gh.width,height:e=gh.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Yg{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Gg?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=bh[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Ng){const e=Mh.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 i=this.directionKey,s=this.height;let n=this.left,r=0;this.actualWidtht.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const s=this.paragraphs[e];if(s.overflow)t=t&&""===s.text;else if(t){i=!0;break}}let s=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof Gg)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:a}=Bh(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,n)=>{if(e instanceof Gg)return;const r=e.drawBackground(t,s,this.ascent,i,0===n,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],s=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,s.right-i.left,s.bottom-i.top)})),this.paragraphs.forEach(((e,n)=>{if(e instanceof Gg)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+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 i=e&&e.stroke||Sh;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Th(t,e)})(t,e.character),function(t,e,i){const s=e&&e.fill||xh;if(!s)return void(t.globalAlpha=0);const{fillOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.fillStyle=i?yh(t,s,{AABBBounds:i}):s,Th(t,e)}(t,e.character,a),e.draw(t,s,this.ascent,i,0===n,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof Gg)break;const{width:n}=Bh(t,s.character,s.ascentDescentMode),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof Gg?t.width:t.getWidthWithEllips(this.direction)})),i}}class $g{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=bh[this.direction]}store(t){if(t instanceof Gg){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}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,i=new Yg(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(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof Gg?"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 i=this[this.directionKey.width]-this.lineWidth||0,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=wh(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new Ng(i,t.newLine,t.character,t.ascentDescentMode),new Ng(s,!0,t.character,t.ascentDescentMode)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let Xg=!1;try{Xg=Intl&&"function"==typeof Intl.Segmenter}catch(t){Xg=!1}const Kg=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...kp];class qg extends Bp{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Nu,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ph.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:ph.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:ph.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:ph.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:ph.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:ph.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:ph.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:ph.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Lc(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&_(t.text)&&qg.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&_(t.text)&&qg.splitText(t.text).length>1)))}static splitText(t){if(Xg){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:s}of e.segment(t))i.push(s);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const i=qg.splitText(t.text.toString());if(_(t.text)&&i.length>1)for(let s=0;s0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:s}=t.getActualSize();let n=o||e||0,r=l||s||0;r="number"==typeof c&&r>c?c:r||0,n="number"==typeof h&&n>h?h:n||0,i.set(0,0,n,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(u){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(d){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return l||("middle"===this.verticalDirection?g-=i.height()/2:"bottom"===this.verticalDirection&&(g-=i.height())),i.translate(f,g),Ao.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Ao.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Ao.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,Kg)}needUpdateTag(t){return super.needUpdateTag(t,Kg)}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;e0&&!qg.AllSingleCharacter(_)&&(_=qg.TransformTextConfig2SingleCharacter(_),this.attribute.textConfig=_);const y=[],b=null!=t?t:_;for(let t=0;t{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,y.push(t)}}else{const e=this.combinedStyleToCharacter(b[t]);if(S(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let s=0;s0,A="number"==typeof s&&Number.isFinite(s)&&s>0,k="number"==typeof n&&Number.isFinite(n)&&n>0&&(!x||n<=i),M="number"==typeof r&&Number.isFinite(r)&&r>0&&(!A||r<=s),T=new jg(0,0,(k?n:x?i:0)||0,(M?r:A?s:0)||0,a,o,l,h,c,d||"horizontal",!k&&x,!M&&A,u||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),w=new $g(T);if(w.newLine=v,p){let t=0,e=!1;for(let i=0;i{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=T}clone(){return new qg(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.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,i,s,n,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(s=this.stage)||void 0===s||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-s})&&(n=e,n.globalX=(null!==(a=n.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],n.globalY=(null!==(o=n.attribute.y)&&void 0!==o?o:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return qg.NOWORK_ANIMATE_ATTR}}function Zg(t){return new qg(t)}qg.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Ep);const Jg=["path","customPath",...kp];class Qg extends Bp{constructor(t){super(t),this.type="path",this.numberType=zu}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Wl?e.path:(u(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Wl?this.cache:t.path)}getGraphicTheme(){return Lc(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=Ao.graphicService.updateTempAABBBounds(i);yg(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return Ao.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;_(t.path,!0)?this.cache=(new Wl).fromString(t.path):t.customPath&&(this.cache=new Wl,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Jg)}needUpdateTag(t){return super.needUpdateTag(t,Jg)}toCustomPath(){return(new Wl).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Qg(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Qg.NOWORK_ANIMATE_ATTR}}function tf(t){return new Qg(t)}Qg.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ep);const ef=["segments","points","curveType","curveTension",...kp];class sf extends Bp{constructor(t){super(t),this.type="area",this.numberType=Lu}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Lc(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Ao.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:s=e.lineJoin}=t;return Ao.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){const{points:n=e.points}=t,r=i;return n.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,s,n){"points"===t&&(n.points=id(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,ef)}needUpdateTag(t){return super.needUpdateTag(t,ef)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new Wl;const e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0;const s=[];if(e.forEach((e=>{var n,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),s.length){for(let e=s.length-1;e>=0;e--)t.lineTo(s[e].x,s[e].y);t.closePath()}}};return e.points?s(e.points):i&&i.length&&i.forEach((t=>{s(t.points)})),t}clone(){return new sf(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sf.NOWORK_ANIMATE_ATTR}}function nf(t){return new sf(t)}sf.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ep);const rf=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...kp];class af extends Bp{constructor(t){super(t),this.type="arc",this.numberType=Bu}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(S(t,!0)?t:a*parseFloat(t)/100,a/2);if(y(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:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=he(e),i=e+r,s&&Ut(r)zt&&o>zt)return{startAngle:e-n*u*r,endAngle:i+n*u*a,sc:n*u*r,ec:n*u*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=Kt(a*a+o*o)}=this.attribute,h=Ut(e-t);let c=t,d=e,u=t,p=e;const g=r/2;let f=h,m=h;if(g>zt&&l>zt){const i=e>t?1:-1;let s=Zt(Number(l)/o*Xt(g)),n=Zt(Number(l)/a*Xt(g));return(f-=2*s)>zt?(s*=i,u+=s,p-=s):(f=0,u=p=(t+e)/2),(m-=2*n)>zt?(n*=i,c+=n,d-=n):(m=0,c=d=(t+e)/2),{outerStartAngle:c,outerEndAngle:d,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:c,outerEndAngle:d,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return Lc(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Ao.graphicService.updateTempAABBBounds(i);yg(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return Ao.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,so){const t=l;l=o,o=t}return s<=zt?i.set(0,0,0,0):Math.abs(o-l)>Vt-zt?i.set(-s,-s,s,s):(td(l,o,s,i),td(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,rf)}needUpdateTag(t){return super.needUpdateTag(t,rf)}toCustomPath(){var t,e,i,s;let n=super.toCustomPath();if(n)return n;const r=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(s=r.outerPadding)&&void 0!==s?s:0);const c=Ut(o-a),d=o>a;if(h=Vt-zt)n.moveTo(0+h*Gt(a),0+h*Xt(a)),n.arc(0,0,h,a,o,!d),l>zt&&(n.moveTo(0+l*Gt(o),0+l*Xt(o)),n.arc(0,0,l,o,a,d));else{const t=h*Gt(a),e=h*Xt(a),i=l*Gt(o),s=l*Xt(o);n.moveTo(0+t,0+e),n.arc(0,0,h,a,o,!d),n.lineTo(0+i,0+s),n.arc(0,0,l,o,a,d),n.closePath()}return n}clone(){return new af(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return af.NOWORK_ANIMATE_ATTR}}function of(t){return new af(t)}af.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ep);const lf=["points","cornerRadius",...kp];class hf extends Bp{constructor(t){super(t),this.type="polygon",this.numberType=ju}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Lc(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Ao.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:s=e.lineJoin}=t;return Ao.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:s=e.points}=t;return s.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,s,n){"points"===t&&(n.points=id(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,lf)}needUpdateTag(t){return super.needUpdateTag(t,lf)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute.points;return t=new Wl,e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t}clone(){return new hf(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return hf.NOWORK_ANIMATE_ATTR}}function cf(t){return new hf(t)}hf.NOWORK_ANIMATE_ATTR=Ep;class df extends Lp{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function uf(t){return new df(t)}const pf=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let gf,ff;function mf(t){return gf||(gf=pf.CreateGraphic("text",{})),gf.initAttributes(t),gf.AABBBounds}var vf=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},_f=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yf=function(t,e){return function(i,s){e(i,s,t)}};class bf{constructor(){this.time=Qo.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:v=l.backgroundMode,backgroundFit:_=l.backgroundFit,backgroundKeepAspectRatio:y=l.backgroundKeepAspectRatio,backgroundScale:b=l.backgroundScale,backgroundOffsetX:x=l.backgroundOffsetX,backgroundOffsetY:S=l.backgroundOffsetY,backgroundClip:A=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Lc(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}A&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=f*m,this.doDrawImage(e,n.data,r,{backgroundMode:v,backgroundFit:_,backgroundKeepAspectRatio:y,backgroundScale:b,backgroundOffsetX:x,backgroundOffsetY:S}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s){const{backgroundMode:n,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=s,c=i.width(),d=i.height();let u=c,p=d;if("no-repeat"===n)if(r)if(a){const s=Math.max(c/e.width,d/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*s*o,e.height*s*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=e.width*o,n=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,s,n)}else{if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,s=e.height;"repeat-x"===n?(u=i*(d/s),p=d):"repeat-y"===n&&(p=s*(c/i),u=c);const r=t.dpr,a=pc.allocate({width:u,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,u,p),o.drawImage(e,0,0,u,p),e=a.nativeCanvas),pc.free(a)}const s=t.dpr,a=t.createPattern(e,n);a.setTransform&&a.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,d),t.translate(-i.x1,-i.y1)}}}const xf=new bf;let Sf=class{constructor(t){this.subRenderContribitions=t,this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}};Sf=vf([qa(),yf(0,Xa(po)),yf(0,Za(dg)),_f("design:paramtypes",[Object])],Sf);const Af=new class{constructor(){this.time=Qo.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const v=!(c||d),_=t.AABBBounds,y=null!==(p=t.attribute.width)&&void 0!==p?p:_.width(),b=null!==(g=t.attribute.height)&&void 0!==g?g:_.height();v&&e.save(),e.beginPath(),!1===m.draw(e,[y,b],i+y/2,s+b/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),v&&e.clip()}};const kf=new class{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||d||e.restore())}};class Mf{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=pc.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),n(r,l);const h=s.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),pc.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Vt),e.fill()}))}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{const n=t/2,r=n;s.fillStyle=i,s.moveTo(n,r-e),s.lineTo(e+n,r),s.lineTo(n,r+e),s.lineTo(n-e,r),s.closePath(),s.fill()}))}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*s,t)}))}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*s)}))}createBiasLRLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(0,0),s.lineTo(t,t);const n=t/2,r=-n;s.moveTo(n,r),s.lineTo(n+t,r+t),s.moveTo(-n,-r),s.lineTo(-n+t,-r+t),s.stroke()}))}createBiasRLLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(t,0),s.lineTo(0,t);const n=t/2,r=n;s.moveTo(t+n,r),s.lineTo(n,r+t),s.moveTo(t-n,-r),s.lineTo(-n,-r+t),s.stroke()}))}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,t,t),s.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,g,f,m)}drawTexture(t,e,i,s,n,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:d=null}=e.attribute;let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(o,l,a,i);break;case"diamond":u=this.createDiamondPattern(o,l,a,i);break;case"rect":u=this.createRectPattern(o,l,a,i);break;case"vertical-line":u=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":u=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":u=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":u=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":u=this.createGridPattern(o,l,a,i)}if(d&&d.dynamicTexture){const{gridConfig:u={},useNewCanvas:p}=d,g=e.AABBBounds;s=g.x1,n=g.y1;const f=i;let m;if(p){m=pc.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),s=0,n=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,s,n,r),f.clip();const v=g.width(),_=g.height(),y=l,b=o,x=u.columns?u.columns:Math.ceil(v/b),S=u.rows?u.rows:Math.ceil(_/b),A=u.gutterColumn?u.gutterColumn:2*y,k=u.gutterRow?u.gutterRow:2*y;this._tempSymbolGraphic||(this._tempSymbolGraphic=Eg({}));const M=u.columns?v/u.columns:b,T=u.rows?_/u.rows:b;this._tempSymbolGraphic.setAttributes({size:[M-A,T-k],symbolType:t});const w=this._tempSymbolGraphic.getParsedPath();for(let t=0;t{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=M?o:_h(e,o,e.dpr),c=o/w,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:w+u*h,innerRadius:T-u*h,startAngle:_-u*c,endAngle:y+u*c}),e.beginPath(),tg(t,e,i,s,w+u*h,T-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/A,(S-s)/k,l[r]),l[r].opacity=a,e.stroke()}};g&&C(u,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:w,innerRadius:T,startAngle:_,endAngle:y})}},Cf=Tf,Ef=xf;const Bf=new class{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{radius:m=l.radius,startAngle:v=l.startAngle,endAngle:_=l.endAngle,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:S=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:k=l.keepStrokeScale}=t.attribute,M=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=k?o:_h(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),e.arc(i,s,m+c*h,v,_),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=y,e.setStrokeStyle(t,n,(b-i)/S,(x-s)/A,l[r]),l[r].opacity=a,e.stroke()}};g&&M(u,"outerBorder"),f&&M(p,"innerBorder")}},Pf=Tf,Lf=xf;const Rf=new class extends bf{constructor(){super(...arguments),this.time=Qo.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const{background:u,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit,backgroundKeepAspectRatio:f=l.backgroundKeepAspectRatio,backgroundScale:m=l.backgroundScale,backgroundOffsetX:v=l.backgroundOffsetX,backgroundOffsetY:_=l.backgroundOffsetY}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const s=t.AABBBounds;this.doDrawImage(e,i.data,s,{backgroundMode:p,backgroundFit:g,backgroundKeepAspectRatio:f,backgroundScale:m,backgroundOffsetX:v,backgroundOffsetY:_}),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}},Of=jt/2;function If(t,e,i,s,n,r,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),s<0&&(e+=s,s=-s),n<0&&(i+=n,n=-n),S(r,!0))l=[r=Ut(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=Ut(t[0]),l=[e,e,e,e];break;case 2:case 3:e=Ut(t[0]),i=Ut(t[1]),l=[e,i,e,i];break;default:l=t,l[0]=Ut(l[0]),l[1]=Ut(l[1]),l[2]=Ut(l[2]),l[3]=Ut(l[3])}}else l=[0,0,0,0];if(s<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,i,s,n);const[h,c,d,u]=[[e,i],[e+s,i],[e+s,i+n],[e,i+n]],p=Math.min(s/2,n/2),g=[Math.min(p,l[0]),Math.min(p,l[1]),Math.min(p,l[2]),Math.min(p,l[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],v=[c[0]-g[1],c[1]],_=[c[0],c[1]+g[1]],y=[d[0]-g[2],d[1]],b=[d[0],d[1]-g[2]],x=[u[0]+g[3],u[1]],A=[u[0],u[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(o&&o[0]?o[0](f[0],f[1],v[0],v[1]):t.lineTo(v[0],v[1]),!q(v,_)){o&&o[0]&&t.moveTo(v[0],v[1]);const e=v[0],i=v[1]+g[1];t.arc(e,i,g[1],-Of,0,!1)}if(o&&o[1]?o[1](_[0],_[1],b[0],b[1]):t.lineTo(b[0],b[1]),!q(y,b)){const e=b[0]-g[2],i=b[1];o&&o[1]&&t.moveTo(b[0],b[1]),t.arc(e,i,g[2],0,Of,!1)}if(o&&o[2]?o[2](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!q(x,A)){const e=x[0],i=x[1]-g[3];o&&o[2]&&t.moveTo(x[0],x[1]),t.arc(e,i,g[3],Of,jt,!1)}if(o&&o[3]?o[3](A[0],A[1],m[0],m[1]):t.lineTo(m[0],m[1]),!q(f,m)){const e=f[0],i=f[1]+g[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],jt,jt+Of,!1)}}else o&&o[0]?o[0](f[0],f[1],v[0],v[1]):t.lineTo(v[0],v[1]),o&&o[1]?o[1](v[0],v[1],y[0],y[1]):t.lineTo(y[0],y[1]),o&&o[2]?o[2](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),o&&o[2]?o[2](x[0],x[1],f[0],f[1]):t.lineTo(f[0],f[1]);return!o&&t.closePath(),t}var Df=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class Ff{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{cornerRadius:m=l.cornerRadius,cornerType:v=l.cornerType,opacity:_=l.opacity,x:b=l.x,y:x=l.y,scaleX:S=l.scaleX,scaleY:A=l.scaleY,x1:k,y1:M,keepStrokeScale:T=l.keepStrokeScale}=t.attribute;let{width:w,height:C}=t.attribute;w=(null!=w?w:k-i)||0,C=(null!=C?C:M-s)||0;const E=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,c=T?h:_h(e,h,e.dpr),u=i+o*c,p=s+o*c,g=2*c;if(0===m||y(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(u,p,w-o*g,C-o*g)):(e.beginPath(),If(e,u,p,w-o*g,C-o*g,m,"bevel"!==v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=_,e.setStrokeStyle(t,n,(b-i)/S,(x-s)/A,l[r]),l[r].opacity=a,e.stroke()}};g&&E(u,"outerBorder"),f&&E(p,"innerBorder")}}let zf=class{constructor(){this.time=Qo.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};zf=Df([qa()],zf);let jf=class{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const{x1:u,y1:p,x:g=l.x,y:f=l.y,stroke:m=l.stroke,cornerRadius:v=l.cornerRadius,cornerType:_=l.cornerType}=t.attribute;let{width:b,height:x}=t.attribute;if(b=(null!=b?b:u-g)||0,x=(null!=x?x:p-f)||0,Array.isArray(m)&&m.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===v||y(v)&&v.every((t=>0===t)))){let n,r=0;return If(e,i,s,b,x,v,"bevel"!==_,new Array(4).fill(0).map(((a,o)=>(a,h,c,d)=>{m[o]&&(r===o-1&&m[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=m[o]),r=o,e.lineTo(c,d),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),m[0]?e.lineTo(i+b,s):e.moveTo(i+b,s),m[1]?e.lineTo(i+b,s+x):e.moveTo(i+b,s+x),m[2]?e.lineTo(i,s+x):e.moveTo(i,s+x),m[3]){const t=m[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};jf=Df([qa()],jf);const Hf=new Ff,Nf=Tf,Vf=xf;const Uf=new class extends Ff{constructor(){super(...arguments),this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){return super.drawShape(t,e,i,s,n,r,a,o,l,h,c,d)}},Wf=xf;const Gf=new class{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:v=l.size,opacity:_=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY,keepStrokeScale:A=l.keepStrokeScale}=t.attribute,k=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=A?o:_h(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,v,i,s,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=_,e.setStrokeStyle(t,n,(y-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};f&&k(p,"outerBorder"),m&&k(g,"innerBorder")}},Yf=new class{constructor(){this.time=Qo.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:v=l.size,scaleX:_=l.scaleX,scaleY:y=l.scaleY}=t.attribute,b=t.getParsedPath();b&&p<1&&p>0&&(e.beginPath(),b.drawWithClipRange&&b.drawWithClipRange(e,v,i,s,p,m,((n,r)=>{var a,h,c,u;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(u=r.lineWidth)&&void 0!==u?u:t.attribute.lineWidth,r=e}r.stroke&&(d?d(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/_,(f-s)/y,l),e.stroke()))})),r&&!b.isSvg&&(d?d(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/_,(f-s)/y,l),e.stroke())))}},$f=Tf,Xf=xf;const Kf={x:0,y:0,z:0,lastModelMatrix:null};class qf{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Af),this.builtinContributions.push(kf),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===Qo.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Qo.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,c,d,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,c,d,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}drawPathProxy(t,e,i,s,n,r,a,o){if(!t.pathProxy)return!1;const l=Lc(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:d=l.opacity,fillOpacity:u=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:v=l.y}=t.attribute,_=Xp(d,u,h),y=qp(d,g),b=Yp(h),x=$p(c,p);if(!f)return!0;if(!b&&!x)return!0;if(!(_||y||a||o))return!0;e.beginPath();return sl(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,b,x,_,y,l,n,a,o),x&&(o?o(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,i-m,s-v,l),e.stroke())),b&&(a?a(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,i-m,s-v,l),e.fill())),this.afterRenderStep(t,e,i,s,b,x,_,y,l,n,a,o),!0}valid(t,e,i,s){const{fill:n=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:d=e.visible}=t.attribute,u=Xp(o,l,n),p=qp(o,c),g=Yp(n,r),f=$p(a,h);return!(!t.valid||!d)&&!(!g&&!f)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i,s=!1){const{x:n=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,d=i.modelMatrix,u=i.camera;Kf.x=n,Kf.y=r,Kf.z=a,Kf.lastModelMatrix=d;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const s=ip.allocate(),n=ip.allocate();vg(n,t,e),Ju(s,d||s,n),Kf.x=0,Kf.y=0,Kf.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),ip.free(n)}if(g&&!d){const s=t.getOffsetXY(e);Kf.x+=s.x,Kf.y+=s.y,Kf.z=a,i.setTransformForCurrent()}else if(p)Kf.x=0,Kf.y=0,Kf.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);Kf.x+=s.x,Kf.y+=s.y,this.transformWithoutTranslate(i,Kf.x,Kf.y,Kf.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Kf.x=0,Kf.y=0,Kf.z=0;return Kf}transformUseContext2d(t,e,i,s){const n=s.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,a=s.project(0,0,i),o=s.project(n,0,i),l=s.project(n,r,i),h={x:0,y:0},c={x:n,y:0},d={x:n,y:r};s.camera=null;const u=1/(h.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+d.y*o.x+(c.y-d.y)*a.x)*u,g=(c.y*l.y+h.y*(o.y-l.y)-d.y*o.y+(d.y-c.y)*a.y)*u,f=(h.x*(l.x-o.x)-c.x*l.x+d.x*o.x+(c.x-d.x)*a.x)*u,m=-(c.x*l.y+h.x*(o.y-l.y)-d.x*o.y+(d.x-c.x)*a.y)*u,v=(h.x*(d.y*o.x-c.y*l.x)+h.y*(c.x*l.x-d.x*o.x)+(d.x*c.y-c.x*d.y)*a.x)*u,_=(h.x*(d.y*o.y-c.y*l.y)+h.y*(c.x*l.y-d.x*o.y)+(d.x*c.y-c.x*d.y)*a.y)*u;s.setTransform(p,g,f,m,v,_,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,n,r,a){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(n,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,n,r){const{context:a}=s;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:d,lastModelMatrix:u}=l;this.z=d,this.drawPathProxy(t,a,h,c,s,n)||(this.drawShape(t,a,h,c,s,n,null,null,r),this.z=0,a.modelMatrix!==u&&ip.free(a.modelMatrix),a.modelMatrix=u),a.highPerformanceRestore()}}var Zf=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qf=function(t,e){return function(i,s){e(i,s,t)}};let tm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Bu,this.builtinContributions=[wf,Ef,Cf],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),c=h.startAngle;let d=h.endAngle;d=o;const u=d>c;let p=!1;if(nzt){const t=$t(b,y),r=$t(x,y),a=Jp(v,_,f,m,n,t,Number(u)),o=Jp(A,k,M,T,n,r,Number(u));if(y0&&e.arc(i+o.cx,s+o.cy,r,Wt(o.y11,o.x11),Wt(o.y01,o.x01),!u)}}else e.moveTo(i+f,s+m);if(!(r>zt)||C<.001)e.lineTo(i+M,s+T),p=!0;else if(w>zt){const t=$t(B,w),n=$t(P,w),a=Jp(M,T,A,k,r,-n,Number(u)),o=Jp(f,m,v,_,r,-t,Number(u));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),w0&&e.arc(i+a.cx,s+a.cy,n,Wt(a.y01,a.x01),Wt(a.y11,a.x11),!u);const t=Wt(a.cy+a.y11,a.cx+a.x11),o=d-l-.03;e.arc(i,s,r,t,o,u)}}else e.lineTo(i+r*Gt(E),s+r*Xt(E));return p}drawShape(t,e,i,s,n,r,a,o,l){l=null!=l?l:Lc(t,null==r?void 0:r.theme).arc;const{fill:h=l.fill,stroke:d=l.stroke,x:u=l.x,y:p=l.y,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,f=this.valid(t,l,a,o);if(!f)return;const{fVisible:m,sVisible:v,doFill:_,doStroke:y}=f,{outerPadding:b=l.outerPadding,innerPadding:x=l.innerPadding,cap:S=l.cap,forceShowCap:A=l.forceShowCap}=t.attribute;let{outerRadius:k=l.outerRadius,innerRadius:M=l.innerRadius}=t.attribute;k+=b,M-=x;let T=0;const w=(c(S)&&S||S[0])&&"conical"===h.gradient;if(w){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();Ut(s-i){var e;let i=!0;if(c(t,!0)){for(let s=0;s<4;s++)Kc[s]=t,i&&(i=!(null!==(e=Kc[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Kc[e]=!!t[e],i&&(i=!!Kc[e]);else Kc[0]=!1,Kc[1]=!1,Kc[2]=!1,Kc[3]=!1;return{isFullStroke:i,stroke:Kc}})(d);if((_||E)&&(e.beginPath(),tg(t,e,i,s,k,M),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,y,m,v,l,n,a,o),g?(this._runStroke(t,e,i,s,l,y,E,v,o),this._runFill(t,e,i,s,l,_,m,u,p,a)):(this._runFill(t,e,i,s,l,_,m,u,p,a),this._runStroke(t,e,i,s,l,y,E,v,o))),!E&&y&&(e.beginPath(),tg(t,e,i,s,k,M,B),C||this.beforeRenderStep(t,e,i,s,_,y,m,v,l,n,a,o),o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),(c(S)&&S||S[1])&&A){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(Ut(h-r)>=Vt-zt){e.beginPath();const r=Math.abs(k-M)/2/k,{endAngle:h=l.endAngle,fill:c=l.fill}=t.attribute,d=h;this.drawArcTailCapPath(t,e,i,s,k,M,d,d+r),C||this.beforeRenderStep(t,e,i,s,_,y,m,v,l,n,a,o);const u=()=>{if(_){const n=c;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=Vt;for(;i>Vt;)i-=Vt;if(ia)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),pp(o.color,l.color,h,!1)}(0,0,h,n);a||Xp&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=r,e.fill())}}},p=()=>{y&&(o||v&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke()))};u(),p()}}this.afterRenderStep(t,e,i,s,_,y,m,v,l,n,a,o),w&&(h.startAngle+=T,h.endAngle+=T)}_runFill(t,e,i,s,n,r,a,o,l,h){r&&(h?h(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l){r&&a&&(l?l(e,t.attribute,n):o&&(e.setStrokeStyle(t,t.attribute,i,s,n),e.stroke()))}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s,n)}};tm=Zf([qa(),Qf(0,Xa(po)),Qf(0,Za(eg)),Jf("design:paramtypes",[Object])],tm);var em=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},im=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sm=function(t,e){return function(i,s){e(i,s,t)}};let nm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Ru,this.builtinContributions=[Bf,Lf,Pf],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Lc(t,null==r?void 0:r.theme).circle,{radius:h=l.radius,startAngle:c=l.startAngle,endAngle:d=l.endAngle,x:u=l.x,y:p=l.y,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,f=this.valid(t,l,a,o);if(!f)return;const{fVisible:m,sVisible:v,doFill:_,doStroke:y}=f;e.beginPath(),e.arc(i,s,h,c,d),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,y,m,v,l,n,a,o);const b=()=>{_&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,p-s,l),e.fill()))},x=()=>{y&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,l),e.stroke()))};g?(x(),b()):(b(),x()),this.afterRenderStep(t,e,i,s,_,y,m,v,l,n,a,o)}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).circle;this._draw(t,n,!1,i,s)}};function rm(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=cl(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function am(t,e,i,s,n,r,a){var o;let l=e.p0,h=s;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)s||(t.lineTo(l.x+n,l.y+r,a),h=!s);else{const{originP1:c,originP2:d}=e;let u;if(c&&!1!==c.defined&&!i?u=l:c&&!1!==d.defined&&(u=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=u?u.x:e.p0.x,o=u?u.y:e.p0.y;t.moveTo(i+n,o+r,a)}else u&&(h=!s,t.lineTo(u.x+n,u.y+r,a))}return h}function om(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:d}=e;if(i>=1){if(h){let e,i=!0;d.forEach(((s,n)=>{s.originP1!==s.originP2?(i=am(t,s,e,i,r,a,o),e=s):e=s}))}else d.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),rm(t,e,1,n),c=!1):c=!0}));return}if(i<=0)return;let u;"x"===s?u=Zo.ROW:"y"===s?u=Zo.COLUMN:"auto"===s&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,f=!0,m=null;for(let e=0,i=d.length;e=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let hm=class extends qf{constructor(){super(...arguments),this.numberType=Fu}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).line;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,c,d,u,p,g){var f;if(!e)return;t.beginPath();om(t,e,l,h,{offsetX:c,offsetY:d,offsetZ:null!==(f=this.z)&&void 0!==f?f:0}),u.cache&&!y(u.cache)&&u.cache.curves.every((t=>t.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,a,o);const{x:m=0,x:v=0}=a;return!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,a,m-c,v-d,o),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,a,m-c,v-d,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,c,d,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t!1===t.defined))&&"linear"===_)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,d,u,i,s,l,n,r,a,o);function x(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,s=e;if(i&&i.length){let e,s;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(s={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:s.endX,y:s.endY,defined:s.curves[s.curves.length-1].defined}:i>1&&(e.x=s.endX,e.y=s.endY,e.defined=s.curves[s.curves.length-1].defined);const n=Ul(x(t.points,v),_,{startPoint:e,curveTension:m});return s=n,n})).filter((t=>!!t)),"linearClosed"===_){let e;for(let i=0;it.points.length));if(1===n[0].points.length&&n.shift(),1===y){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,d,u,n[g],[l,t.attribute],y,b,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=y*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const v=r.getLength(),_=(p-g)/v;g+=v,_>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,d,u,n[m],[l,t.attribute],$t(_,1),b,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,d,u,t.attribute,l,y,b,i,s,t,a,o)}};function cm(t,e,i,s){const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+n,e.p0.y+r,a),rm(t,e,1,s),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(o&&t.lineTo(l.p0.x+n,l.p0.y+r,a),rm(t,l,1,s),o=!1):o=!0}t.closePath()}hm=lm([qa()],hm);const dm=new class extends Mf{constructor(){super(...arguments),this.time=Qo.afterFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){var p,g,f,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:v=t.attribute}=u||{},{texture:_=(null!==(p=t.attribute.texture)&&void 0!==p?p:sd(l,"texture")),textureColor:y=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:sd(l,"textureColor")),textureSize:b=(null!==(f=t.attribute.textureSize)&&void 0!==f?f:sd(l,"textureSize")),texturePadding:x=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:sd(l,"texturePadding"))}=v;_&&this.drawTexture(_,t,e,i,s,l,y,b,x)}},um=xf;var pm=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},gm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fm=function(t,e){return function(i,s){e(i,s,t)}};let mm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Lu,this.builtinContributions=[dm,um],this.init(t)}drawLinearAreaHighPerformance(t,e,i,s,n,r,a,o,l,h,c,d,u){var p,g,f;const{points:m}=t.attribute;if(m.length<2)return;e.beginPath();const v=null!==(p=this.z)&&void 0!==p?p:0,_=m[0];e.moveTo(_.x+a,_.y+o,v);for(let t=1;t=0;t--){const i=m[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+a,(null!==(f=i.y1)&&void 0!==f?f:i.y)+o,v)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,d,null,{attribute:t.attribute});const{x:b=0,x:x=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,b-a,x-o,l),e.fill())),this.afterRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,d,null,{attribute:t.attribute}),(()=>{var i,n;if(s){const{stroke:s=l&&l.stroke}=t.attribute;if(y(s)&&(s[0]||s[2])&&!1===s[1])if(e.beginPath(),s[0]){e.moveTo(_.x+a,_.y+o,v);for(let t=1;t=0;t--){const s=m[t];e.lineTo((null!==(i=s.x1)&&void 0!==i?i:s.x)+a,(null!==(n=s.y1)&&void 0!==n?n:s.y)+o,v)}}u?u(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,b-a,x-o,l),e.stroke())}})()}drawShape(t,e,i,s,n,r,a,o){var l,h,c,d,u,p;const g=Lc(t,null==r?void 0:r.theme).area,{fill:f=g.fill,stroke:m=g.stroke,fillOpacity:v=g.fillOpacity,z:_=g.z,strokeOpacity:y=g.strokeOpacity,curveTension:b=g.curveTension,connectedType:x=g.connectedType}=t.attribute,S=this.valid(t,g,a,o);if(!S)return;const{doFill:A}=S,k=S.doStroke&&S.sVisible,{clipRange:M=g.clipRange,closePath:T,points:w,segments:C}=t.attribute;let{curveType:E=g.curveType}=t.attribute;function B(t,e){return"connect"!==e?t:t.filter((t=>!1!==t.defined))}if(T&&"linear"===E&&(E="linearClosed"),1===M&&!C&&!w.some((t=>!1===t.defined))&&"linear"===E)return this.drawLinearAreaHighPerformance(t,e,!!f,k,v,y,i,s,g,n,r,a,o);if(t.shouldUpdateShape()){if(C&&C.length){let e,i;const s=C.map(((t,s)=>{if(t.points.length<=1&&0===s)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===s?e={x:i.endX,y:i.endY}:s>1&&(e.x=i.endX,e.y=i.endY);const n=Ul(B(t.points,x),E,{startPoint:e,curveTension:b});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=C.length-1;t>=0;t--){const e=C[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=C[t-1].points,s=e[e.length-1];s&&i.push({x:null!==(c=s.x1)&&void 0!==c?c:s.x,y:null!==(d=s.y1)&&void 0!==d?d:s.y})}i.length>1&&(n=Ul(B(i,x),"stepBefore"===E?"stepAfter":"stepAfter"===E?"stepBefore":E,{curveTension:b}),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!w||!w.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=B(w,x),i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(u=e[t].x1)&&void 0!==u?u:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=Ul(e,E,{curveTension:b}),n=Ul(i,"stepBefore"===E?"stepAfter":"stepAfter"===E?"stepBefore":E,{curveTension:b});t.cacheArea={top:s,bottom:n}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===M){let l=!1;t.cacheArea.forEach(((h,c)=>{l||(l=this.drawSegmentItem(e,h,A,v,k,y,r[c],[g,t.attribute],M,i,s,_,t,n,a,o))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=M*l;let c=0,d=!1;t.cacheArea.forEach(((l,u)=>{if(d)return;const p=l.top.getLength(),f=(h-c)/p;c+=p,f>0&&(d=this.drawSegmentItem(e,l,A,v,k,y,r[u],[g,t.attribute],$t(f,1),i,s,_,t,n,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,A,v,k,y,t.attribute,g,M,i,s,_,t,n,a,o)}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).area;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f){return this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f)}_drawSegmentItem(t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f){if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;t.beginPath();const{points:m,segments:v}=u.attribute;let _,b,x=Zo.ROW;if(v){const t=v[v.length-1];b=v[0].points[0],_=t.points[t.points.length-1]}else b=m[0],_=m[m.length-1];const S=Ut(_.x-b.x),A=Ut(_.y-b.y);x=null==_.x1?Zo.ROW:null==_.y1?Zo.COLUMN:Number.isFinite(S+A)?S>A?Zo.ROW:Zo.COLUMN:Zo.ROW,function(t,e,i,s){var n;const{top:r,bottom:a}=e;if(r.curves.length!==a.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;for(let o=0,l=r.curves.length;od?Zo.ROW:Zo.COLUMN,Number.isFinite(c)||(o=Zo.COLUMN),Number.isFinite(d)||(o=Zo.ROW);const u=i*(o===Zo.ROW?c:d);let p=0,g=!0;const f=[],m=[];for(let e=0,i=r.curves.length;e{if(!1!==n)if(f)f(t,a,o);else{const{stroke:i=o&&o[1]&&o[1].stroke}=a;y(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),om(t,i[0]?e.top:e.bottom,l,x===Zo.ROW?"x":"y",{offsetX:h,offsetY:c,offsetZ:d})),t.setStrokeStyle(u,a,k-h,M-c,o),t.stroke()}})(),!1}};mm=pm([qa(),fm(0,Xa(po)),fm(0,Za(ig)),gm("design:paramtypes",[Object])],mm);const vm=Tf,_m=xf;var ym=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},bm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xm=function(t,e){return function(i,s){e(i,s,t)}};let Sm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=zu,this.builtinContributions=[_m,vm],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,c;const d=null!==(l=this.tempTheme)&&void 0!==l?l:Lc(t,null==r?void 0:r.theme).path,{x:u=d.x,y:p=d.y,fillStrokeOrder:g=d.fillStrokeOrder}=t.attribute,f=null!==(h=this.z)&&void 0!==h?h:0,m=this.valid(t,d,a,o);if(!m)return;const{fVisible:v,sVisible:_,doFill:y,doStroke:b}=m;if(e.beginPath(),t.pathShape)sl(t.pathShape.commandList,e,i,s,1,1,f);else{sl((null!==(c=t.attribute.path)&&void 0!==c?c:d.path).commandList,e,i,s,1,1,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,s,y,b,v,_,d,n,a,o);const x=()=>{b&&(o?o(e,t.attribute,d):_&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,d),e.stroke()))},S=()=>{y&&(a?a(e,t.attribute,d):v&&(e.setCommonStyle(t,t.attribute,u-i,p-s,d),e.fill()))};g?(x(),S()):(S(),x()),this.afterRenderStep(t,e,i,s,y,b,v,_,d,n,a,o)}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};Sm=ym([qa(),xm(0,Xa(po)),xm(0,Za(ag)),bm("design:paramtypes",[Object])],Sm);var Am=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},km=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mm=function(t,e){return function(i,s){e(i,s,t)}};let Tm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=Hu,this.builtinContributions=[Hf,Vf,Nf],this.init(t)}drawShape(t,e,i,s,n,r,a,o,l){l=null!=l?l:Lc(t,null==r?void 0:r.theme).rect;const{fill:h=l.fill,background:c,stroke:d=l.stroke,cornerRadius:u=l.cornerRadius,cornerType:p=l.cornerType,opacity:g=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:_=l.visible,x1:b,y1:x,x:S=l.x,y:A=l.y,fillStrokeOrder:k=l.fillStrokeOrder,drawStrokeWhenZeroWH:M=l.drawStrokeWhenZeroWH}=t.attribute;let{width:T,height:w}=t.attribute;T=(null!=T?T:b-S)||0,w=(null!=w?w:x-A)||0;const C=Kp(g,f,T,w,h),E=Zp(g,v,T,w,M),B=Yp(h,c),P=$p(d,m);if(!t.valid||!_)return;if(!B&&!P)return;if(!(C||E||a||o||c))return;0===u||y(u)&&u.every((t=>0===t))?(e.beginPath(),e.rect(i,s,T,w)):(e.beginPath(),If(e,i,s,T,w,u,"bevel"!==p));const L={doFill:B,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,B,P,C,E,l,n,a,o,L),k?(this._runStroke(t,e,i,s,l,L,E,S,A,o),this._runFill(t,e,i,s,l,L,C,S,A,a)):(this._runFill(t,e,i,s,l,L,C,S,A,a),this._runStroke(t,e,i,s,l,L,E,S,A,o)),this.afterRenderStep(t,e,i,s,B,P,C,E,l,n,a,o)}_runFill(t,e,i,s,n,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,n):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-s,n),e.stroke()))}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).rect;this._draw(t,n,!1,i,s,n)}};Tm=Am([qa(),Mm(0,Xa(po)),Mm(0,Za(lg)),km("design:paramtypes",[Object])],Tm);var wm=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Cm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Em=function(t,e){return function(i,s){e(i,s,t)}};let Bm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Vu,this.builtinContributions=[Gf,Xf,$f,Yf],this.init(t)}drawShape(t,e,i,s,n,r,a,o,l){var h;l=null!=l?l:Lc(t,null==r?void 0:r.theme).symbol;const{size:c=l.size,x:d=l.x,y:u=l.y,scaleX:p=l.scaleX,scaleY:g=l.scaleY,fillStrokeOrder:f=l.fillStrokeOrder,clipRange:m=l.clipRange}=t.attribute,v=this.valid(t,l,a,o);if(!v)return;const{fVisible:_,sVisible:b,doFill:x,doStroke:S}=v,A=t.getParsedPath();if(!A)return;const{keepDirIn3d:k=l.keepDirIn3d}=t.attribute,M=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();let T=i,w=s,C=M;const E=e.camera;if(k&&E&&e.project){const t=e.project(i,s,M);e.camera=null,y(c)&&(c[0],c[1]),T=t.x,w=t.y,C=void 0}!1===A.draw(e,c,T,w,C,((n,r)=>{var h,c,v,_;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(h=r.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(v=r.stroke)&&void 0!==v?v:t.attribute.stroke,e.lineWidth=null!==(_=r.lineWidth)&&void 0!==_?_:t.attribute.lineWidth,r=e}const y=()=>{r.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,r,d-i,u-s,l),e.fill()))},x=()=>{r.stroke&&(o?o(e,t.attribute,l):b&&m>=1&&(e.setStrokeStyle(t,r,(d-i)/p,(u-s)/g,l),e.stroke()))};f?(x(),y()):(y(),x())}))&&e.closePath(),e.camera=E,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,x,S,_,b,l,n,a,o),f?(this._runStroke(t,e,i,s,l,S,b,d,u,A,m,p,g,o),this._runFill(t,e,i,s,l,x,_,d,u,A,a)):(this._runFill(t,e,i,s,l,x,_,d,u,A,a),this._runStroke(t,e,i,s,l,S,b,d,u,A,m,p,g,o)),this.afterRenderStep(t,e,i,s,x,S,_,b,l,n,a,o)}_runFill(t,e,i,s,n,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l,h,c,d,u,p){r&&!h.isSvg&&(p?p(e,t.attribute,n):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/d,(l-s)/u,n),e.stroke()))}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Bm=wm([qa(),Em(0,Xa(po)),Em(0,Za(hg)),Cm("design:paramtypes",[Object])],Bm);const Pm=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Ve)}allocate(t,e,i,s){if(!this.pools.length)return(new Ve).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new Ve(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 Lm=new class extends bf{constructor(){super(...arguments),this.time=Qo.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){var u,p,f,m,v,_,y,b,x,S;const{backgroundMode:A=l.backgroundMode,backgroundFit:k=l.backgroundFit,backgroundKeepAspectRatio:M=l.backgroundKeepAspectRatio}=t.attribute;let T,{background:w}=t.attribute;if(!w)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let E;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const B=g(w)&&w.background,P=t.transMatrix.onlyTranslate();if(B){const e=t.AABBBounds,i=(null!==(u=w.x)&&void 0!==u?u:e.x1)+(null!==(p=w.dx)&&void 0!==p?p:0),s=(null!==(f=w.y)&&void 0!==f?f:e.y1)+(null!==(m=w.dy)&&void 0!==m?m:0),n=null!==(v=w.width)&&void 0!==v?v:e.width(),r=null!==(_=w.height)&&void 0!==_?_:e.height();if(E=Pm.allocate(i,s,i+n,s+r),w=w.background,!P){const t=E.width(),e=E.height();E.set((null!==(y=w.x)&&void 0!==y?y:0)+(null!==(b=w.dx)&&void 0!==b?b:0),(null!==(x=w.y)&&void 0!==x?x:0)+(null!==(S=w.dy)&&void 0!==S?S:0),t,e)}}else E=t.AABBBounds,P||(E=mf(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 n=t.resources.get(w);if("success"!==n.state||!n.data)return void C();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,E,{backgroundMode:A,backgroundFit:k,backgroundKeepAspectRatio:M}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=w,n?(If(e,E.x1,E.y1,E.width(),E.height(),n,!0),e.fill()):e.fillRect(E.x1,E.y1,E.width(),E.height()),e.highPerformanceRestore()}B&&Pm.free(E),C()}};var Rm=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Om=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Im=function(t,e){return function(i,s){e(i,s,t)}};let Dm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Uu,this.builtinContributions=[Lm],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,c;const d=Lc(t,null==r?void 0:r.theme).text,{text:u,underline:p=d.underline,lineThrough:g=d.lineThrough,keepDirIn3d:f=d.keepDirIn3d,direction:m=d.direction,fontSize:v=d.fontSize,verticalMode:_=d.verticalMode,x:y=d.x,y:b=d.y}=t.attribute,x=null!==(l=ad(t.attribute.lineHeight,v))&&void 0!==l?l:v,S=this.valid(t,d,a,o);if(!S)return;const{fVisible:A,sVisible:k,doFill:M,doStroke:T}=S,w=!f,C=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,s,M,T,A,k,d,n,a,o),w&&this.transformUseContext2d(t,d,C,e);const E=(n,r,l,h)=>{let c=i+r;const u=s+l;if(h){e.highPerformanceSave(),c+=v;const t=ep.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,u),e.transformFromMatrix(t,!0),ep.free(t)}T&&(o?o(e,t.attribute,d):k&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,d),e.strokeText(n,c,u,C))),M&&(a?a(e,t.attribute,d):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,d),e.fillText(n,c,u,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,d,C),"horizontal"===m){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;T&&(o?o(e,t.attribute,d):k&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,d),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,C)})))),M&&(a?a(e,t.attribute,d):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,d),n.lines.forEach((n=>{e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,C),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,n.descent,(n.descent-n.ascent)/2,C,d,e,{width:n.width})}))))}else{let{textAlign:i=d.textAlign,textBaseline:s=d.textBaseline}=t.attribute;if(!_){const e=i;i=null!==(h=t.getBaselineMapAlign()[s])&&void 0!==h?h:"left",s=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const n=t.cache,{verticalList:r}=n;e.textAlign="left",e.textBaseline="top";const a=x*r.length;let o=0;r.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=Yt(e,o)}));let l=0,u=0;"bottom"===s?u=-a:"middle"===s&&(u=-a/2),"center"===i?l-=o/2:"right"===i&&(l-=o),r.forEach(((t,e)=>{const s=t.reduce(((t,e)=>t+(e.width||0)),0),n=o-s;let r=l;"center"===i?r+=n/2:"right"===i&&(r+=n),t.forEach((t=>{const{text:i,width:s,direction:n}=t;E(i,a-(e+1)*x+u,r,n),r+=s}))}))}w&&this.restoreTransformUseContext2d(t,d,C,e),this.afterRenderStep(t,e,i,s,M,T,A,k,d,n,a,o)}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,l,h,c){if(e+t<=0)return;const{textAlign:d=l.textAlign,fill:p=l.fill,opacity:g=l.opacity,underlineOffset:f=l.underlineOffset,underlineDash:m=l.underlineDash,fillOpacity:v=l.fillOpacity}=i.attribute,_=!u(c),y=_?c.width:i.clipedWidth,b=_?0:ug(d,y),x={lineWidth:0,stroke:p,opacity:g,strokeOpacity:v};if(t){x.lineWidth=t,h.setStrokeStyle(i,x,s,n,l),m&&h.setLineDash(m),h.beginPath();const e=n+r+f;h.moveTo(s+b,e,o),h.lineTo(s+b+y,e,o),h.stroke()}if(e){x.lineWidth=e,h.setStrokeStyle(i,x,s,n,l),h.beginPath();const t=n+a;h.moveTo(s+b,t,o),h.lineTo(s+b+y,t,o),h.stroke()}}};function Fm(t,e,i,s){if(e&&e.length){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Um=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wm=function(t,e){return function(i,s){e(i,s,t)}};let Gm=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=ju,this.builtinContributions=[Nm,Hm],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Lc(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:d=l.x,y:u=l.y,closePath:p=l.closePath,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,f=this.valid(t,l,a,o);if(!f)return;const{fVisible:m,sVisible:v,doFill:_,doStroke:b}=f;e.beginPath(),c<=0||y(c)&&c.every((t=>0===t))?Fm(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void Fm(t,e,i,s);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+s));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],d=h.x-o.x,u=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(u,d)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let v=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,_=v/m;const y=zm(d,u),b=zm(p,g),x=Math.min(y,b);_>x&&(_=x,v=x*m);const S=jm(h,_,y,d,u),A=jm(h,_,b,p,g),k=2*h.x-S.x-A.x,M=2*h.y-S.y-A.y,T=zm(k,M),w=jm(h,zm(_,v),T,k,M);let C=Math.atan2(S.y-w.y,S.x-w.x);const E=Math.atan2(A.y-w.y,A.x-w.x);let B=E-C;B<0&&(C=E,B=-B),B>Math.PI&&(B-=Math.PI),0===r?t.moveTo(S.x+i,S.y+s):t.lineTo(S.x+i,S.y+s),B&&t.arcTo(h.x+i,h.y+s,A.x+i,A.y+s,v),t.lineTo(A.x+i,A.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,b,m,v,l,n,a,o);const x=()=>{_&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,d-i,u-s,l),e.fill()))},S=()=>{b&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,d-i,u-s,l),e.stroke()))};g?(S(),x()):(x(),S()),this.afterRenderStep(t,e,i,s,_,b,m,v,l,n,a,o)}draw(t,e,i,s){const n=Lc(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};Gm=Vm([qa(),Wm(0,Xa(po)),Wm(0,Za(og)),Um("design:paramtypes",[Object])],Gm);var Ym=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},$m=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xm=function(t,e){return function(i,s){e(i,s,t)}};let Km=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Iu}reInit(){this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Rf)}drawShape(t,e,i,s,n,r,a,o,l){const{clip:h,fill:c,stroke:d,background:u}=t.attribute;if(!(h||c||d||u))return;l=null!=l?l:Lc(t,null==r?void 0:r.theme).group;const{opacity:p=l.opacity,width:g=l.width,height:f=l.height,fillOpacity:m=l.fillOpacity,strokeOpacity:v=l.strokeOpacity,cornerRadius:_=l.cornerRadius,path:b=l.path,lineWidth:x=l.lineWidth,visible:S=l.visible,fillStrokeOrder:A=l.fillStrokeOrder,cornerType:k=l.cornerType,x:M=l.x,y:T=l.y}=t.attribute,w=Kp(p,m,g,f,c),C=Zp(p,v,g,f),E=Yp(c,u),B=$p(d,x);if(!t.valid||!S)return;if(!h){if(!E&&!B)return;if(!(w||C||a||o||u))return}if(b&&b.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,s=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,b.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=s}else 0===_||y(_)&&_.every((t=>0===t))?(e.beginPath(),e.rect(i,s,g,f)):(e.beginPath(),If(e,i,s,g,f,_,"bevel"!==k));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Rf));const P={doFill:E,doStroke:B};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this._groupRenderContribitions.forEach((r=>{r.time===Qo.beforeFillStroke&&r.drawShape(t,e,i,s,E,B,w,C,l,n,a,o,P)})),h&&e.clip();const L=()=>{P.doFill&&(a?a(e,t.attribute,l):w&&(e.setCommonStyle(t,t.attribute,M-i,T-s,l),e.fill()))},R=()=>{P.doStroke&&(o?o(e,t.attribute,l):C&&(e.setStrokeStyle(t,t.attribute,M-i,T-s,l),e.stroke()))};A?(R(),L()):(L(),R()),this._groupRenderContribitions.forEach((r=>{r.time===Qo.afterFillStroke&&r.drawShape(t,e,i,s,E,B,w,C,l,n,a,o)}))}draw(t,e,i,s){var n,r;const{context:a}=i;if(!a)return;const{clip:o,baseOpacity:l=1,drawMode:h}=t.attribute,c=a.nativeContext,d=a.canvas.nativeCanvas;if(h>0){const{x:e,y:i,width:s,height:n}=t.attribute,r=a.canvas,o=Ao.global.createCanvas({width:r.width,height:r.height,dpr:1}),l=o.getContext("2d"),c=a.nativeContext.getTransform();l.setTransform(c.a,c.b,c.c,c.d,c.e,c.f),1===h&&(l.save(),l.clearRect(0,0,r.width,r.height),l.beginPath(),l.rect(e,i,s,n),l.clip(),l.drawImage(r.nativeCanvas,0,0,r.width,r.height,0,0,r.displayWidth,r.displayHeight),l.restore()),a.nativeContext=l,r.nativeCanvas=o}o?a.save():a.highPerformanceSave();const u=a.baseGlobalAlpha;a.baseGlobalAlpha*=l;const p=a.modelMatrix;if(a.camera){const e=Lc(t,null==s?void 0:s.theme).group,i=ip.allocate(),n=ip.allocate();vg(n,t,e),Ju(i,p||i,n),a.modelMatrix=i,ip.free(n),a.setTransform(1,0,0,1,0,0,!0)}else a.transformFromMatrix(t.transMatrix,!0);a.beginPath(),s.skipDraw?this.drawShape(t,a,0,0,i,s,(()=>!1),(()=>!1)):this.drawShape(t,a,0,0,i,null,null,null);const{scrollX:g,scrollY:f}=t.attribute;let m;if((g||f)&&a.translate(g,f),s&&s.renderInGroup&&(m=s.renderInGroup(null===(n=s.renderInGroupParams)||void 0===n?void 0:n.skipSort,t,i,null===(r=s.renderInGroupParams)||void 0===r?void 0:r.nextM)),a.modelMatrix!==p&&ip.free(a.modelMatrix),a.modelMatrix=p,a.baseGlobalAlpha=u,h>0){const{x:e,y:i,width:s,height:n}=t.attribute,r=a.nativeContext,o=a.canvas.nativeCanvas;c.save(),c.setTransform(a.dpr,0,0,a.dpr,0,0,!0),1===h&&r.rect(e,i,s,n),c.drawImage(o,0,0,o.width,o.height,0,0,a.canvas.displayWidth,a.canvas.displayHeight);const l=r.getTransform();c.setTransform(l.a,l.b,l.c,l.d,l.e,l.f),a.nativeContext=c,a.canvas.nativeCanvas=d,c.restore()}m&&m.then?m.then((()=>{o?a.restore():a.highPerformanceRestore()})):o?a.restore():a.highPerformanceRestore()}};Km=Ym([qa(),Xm(0,Xa(po)),Xm(0,Za(ng)),$m("design:paramtypes",[Object])],Km);var qm=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Zm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jm=function(t,e){return function(i,s){e(i,s,t)}};const Qm=["","repeat-x","repeat-y","repeat"];let tv=class extends qf{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Du,this.builtinContributions=[Uf,Wf],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Lc(t).image,{repeatX:h=l.repeatX,repeatY:c=l.repeatY,x:d=l.x,y:u=l.y,cornerRadius:p=l.cornerRadius,fillStrokeOrder:g=l.fillStrokeOrder,cornerType:f=l.cornerType,image:m}=t.attribute,v=this.valid(t,l,a);if(!v)return;const{fVisible:_,sVisible:b,doFill:x,doStroke:S}=v;if(!m||!t.resources)return;const A=t.resources.get(m);if("success"!==A.state)return;const k=t.width,M=t.height;e.beginPath();let T=!1;0===p||y(p)&&p.every((t=>0===t))?e.rect(i,s,k,M):(If(e,i,s,k,M,p,"bevel"!==f),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const w=()=>{if(x)if(a)a(e,t.attribute,l);else if(_){e.setCommonStyle(t,t.attribute,i,s,l);let n=0;if("repeat"===h&&(n|=1),"repeat"===c&&(n|=2),n){const t=e.createPattern(A.data,Qm[n]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,k,M),e.translate(-i,-s,!0)}else e.drawImage(A.data,i,s,k,M)}},C=()=>{S&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,d-i,u-s,l),e.stroke()))};g?(C(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,x,!1,_,!1,l,n,a),w(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,x,!1,_,!1,l,n,a),w(),T&&e.restore(),C()),this.afterRenderStep(t,e,i,s,x,!1,_,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&_(s))return void Yc.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Lc(t).image;this._draw(t,a,!1,i)}};tv=qm([qa(),Jm(0,Xa(po)),Jm(0,Za(rg)),Zm("design:paramtypes",[Object])],tv);const ev=Symbol.for("IncrementalDrawContribution"),iv=Symbol.for("ArcRender"),sv=Symbol.for("AreaRender"),nv=Symbol.for("CircleRender"),rv=Symbol.for("GraphicRender"),av=Symbol.for("GroupRender"),ov=Symbol.for("LineRender"),lv=Symbol.for("PathRender"),hv=Symbol.for("PolygonRender"),cv=Symbol.for("RectRender"),dv=Symbol.for("SymbolRender"),uv=Symbol.for("TextRender"),pv=Symbol.for("RichTextRender"),gv=Symbol.for("GlyphRender"),fv=Symbol.for("ImageRender"),mv=Symbol.for("DrawContribution"),vv=(t,e,i,s)=>{let n,r=!1,a=!1;if(e.forEachChildren((t=>(r=t.numberType===Pu,!r))),e.forEachChildren((t=>(a=!!t.findFace,!a))),r){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,s,n,r;let a=(null!==(s=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==s?s:0)/2,o=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;a<0;)a+=Vt;for(;o<0;)o+=Vt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),s.hack_pieFace="outside",n=i(r,a),n&&n.graphic||(s.hack_pieFace="inside",n=i(r,a)),n&&n.graphic||(s.hack_pieFace="top",n=i(r,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const s=e.getChildren(),o=s.map((e=>({ave_z:e.findFace().vertices.map((i=>{var s;return t.view(i[0],i[1],null!==(s=i[2]+e.attribute.z)&&void 0!==s?s:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),n=i(r,a),e.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),e.update(),s.forEach((t=>{e.add(t)}))}else n=i(r,a);return n};var _v=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},yv=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const bv=Symbol.for("DrawItemInterceptor"),xv=new Ve,Sv=new Ve;class Av{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,s,n),!1}beforeDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),s.dirtyBounds&&s.backupDirtyBounds){xv.copy(s.dirtyBounds),Sv.copy(s.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();s.dirtyBounds.copy(s.backupDirtyBounds).transformWithMatrix(e),s.backupDirtyBounds.copy(s.dirtyBounds)}return s.renderGroup(t.shadowRoot,i,ep.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),s.dirtyBounds&&s.backupDirtyBounds&&(s.dirtyBounds.copy(xv),s.backupDirtyBounds.copy(Sv)),!0}}class kv{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(a.x1,a.y1,a.width(),a.height()),r.highPerformanceRestore(),!0}}let Mv=class{constructor(){this.order=1,this.interceptors=[new Av,new wv,new Tv,new kv]}afterDrawItem(t,e,i,s,n){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!t.attribute._debug_bounds&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;rs.renderGroup(t,i,t.parent.globalTransMatrix,!e&&n)),i):s.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==h&&ip.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Cv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ev=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bv=function(t,e){return function(i,s){e(i,s,t)}};let Pv=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}reInit(){this.drawContribution.reInit()}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};Pv=Cv([qa(),Bv(0,Xa(mv)),Ev("design:paramtypes",[Object])],Pv);var Lv=new Fa((t=>{t(So).to(Pv)}));const Rv=Symbol.for("PickerService"),Ov=Symbol.for("GlobalPickerService"),Iv=Symbol.for("PickItemInterceptor"),Dv=Symbol.for("PickServiceInterceptor");var Fv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let zv=class{constructor(){this.order=1}afterPickItem(t,e,i,s,n){if(t.graphic){let e=t.graphic;for(;e.parent;)e=e.parent;e.shadowHost&&(t.params={shadowTarget:t.graphic},t.graphic=e.shadowHost)}return t}};zv=Fv([qa()],zv);let jv=class{constructor(){this.order=1}afterPickItem(t,e,i,s,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,s,n):null}beforePickItem(t,e,i,s,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,s,n):null}_pickItem(t,e,i,s,n){var r;if(!t.shadowRoot)return null;const{parentMatrix:a}=n||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const l=null===(r=Lc(t))||void 0===r?void 0:r[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,c=t.shadowRoot,d=ep.allocateByObj(a),u=new re(d.a*i.x+d.c*i.y+d.e,d.b*i.x+d.d*i.y+d.f),p=e.pickGroup(c,u,d,s);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}};jv=Fv([qa()],jv);let Hv=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){const r=t.baseGraphic;if(r&&r.parent){const t=new re(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const a=r.parent.globalTransMatrix;a.transformPoint(t,t);const o=r.isContainer?e.pickGroup(r,t.clone(),a,s):e.pickItem(r,t.clone(),a,s);return n.highPerformanceRestore(),o}return null}};Hv=Fv([qa()],Hv);let Nv=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){if(!t.in3dMode||s.in3dInterceptor)return null;const r=e.pickContext,a=t.stage;if(!r||!a)return null;if(s.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=a.camera,t.isContainer){const a=vv(r,t,(()=>e.pickGroup(t,i,n.parentMatrix,s)),s);return r.camera=null,s.in3dInterceptor=!1,r.restore(),a}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};Nv=Fv([qa()],Nv);var Vv=new Fa(((t,e,i)=>{i(Rv)||(t(Ov).toSelf(),t(Rv).toService(Ov)),t(Nv).toSelf().inSingletonScope(),t(Iv).toService(Nv),t(jv).toSelf().inSingletonScope(),t(Iv).toService(jv),t(Hv).toSelf().inSingletonScope(),t(Iv).toService(Hv),fo(t,Iv),t(zv).toSelf().inSingletonScope(),t(Dv).toService(zv),fo(t,Dv)})),Uv=new Fa((t=>{t(Wu).to(_g),t(Gu).toConstantValue(pf)}));const Wv=Symbol.for("AutoEnablePlugins"),Gv=Symbol.for("PluginService");var Yv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},$v=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xv=function(t,e){return function(i,s){e(i,s,t)}};let Kv=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&xo.isBound(Wv)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};Kv=Yv([qa(),Xv(0,Xa(po)),Xv(0,Za(Wv)),$v("design:paramtypes",[Object])],Kv);var qv=new Fa((t=>{t(Gv).to(Kv),function(t,e){t(po).toDynamicValue((({container:t})=>new go(e,t))).whenTargetNamed(e)}(t,Wv)})),Zv=new Fa((t=>{fo(t,yo)})),Jv=new Fa((t=>{t(Oh).to(Ih).inSingletonScope(),fo(t,Oh)})),Qv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},t_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let e_=class{constructor(){this.type="static",this.offscreen=!1,this.global=Ao.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const s=e.getContext().getCanvas().nativeCanvas,n=zh({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:s.offsetLeft,y:s.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var s;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(s=e.background)&&void 0!==s?s:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var s;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(s=i.background)&&void 0!==s?s:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};e_=Qv([qa(),t_("design:paramtypes",[])],e_);var i_=new Fa((t=>{t(e_).toSelf(),t(zp).toService(e_)}));var s_=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};function n_(t,e,i){const s={},n=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],n.push(i))}),i),n.sort(((t,e)=>i?e-t:t-e)),{childMap:s,zIdxArray:n}}function r_(t,e,i,s=!1,n=!1){let r=!1;if(n)r=!0;else{let i;t.forEachChildren(((t,s)=>{const{zIndex:n=e}=t.attribute;if(0===s)i=n;else if(i!==n)return r=!0,!0;return!1}),s)}if(r){const{childMap:r,zIdxArray:a}=n_(t,e,s);let o=!1;for(let t=0;t{var i,n;return(s?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t{const{zIndex:s=i}=t.attribute;if(0===e);else if(void 0!==s)return n=!0,!0;return!1}),s);let r=null,a=!1;if(n){const{childMap:n,zIdxArray:o}=n_(t,i,s);let l=!1;for(let t=0;ta?(r=t,!0):(t._uid===e&&(a=!0),!1)),s);return r}var l_=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},h_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},c_=function(t,e){return function(i,s){e(i,s,t)}};let d_=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this._renderInGroup=(t,e,i,s)=>{var n;t?e.forEachChildren((t=>{i.break||(t.isContainer?this.renderGroup(t,i,s):this.renderItem(t,i))})):r_(e,th.zIndex,(t=>{i.break||(t.isContainer?this.renderGroup(t,i,s):this.renderItem(t,i))}),!1,!!(null===(n=i.context)||void 0===n?void 0:n.camera))},this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Ne,this.backupDirtyBounds=new Ne,this.global=Ao.global,this.layerService=Ao.layerService,y(this.contributions)||(this.contributions=[this.contributions]),this.init()}reInit(){this.init(),this.contributions.forEach((t=>{t.reInit()}))}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){var i;this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:s,stage:n,viewBox:r,transMatrix:a}=e;if(!s)return;const o=this.dirtyBounds.setValue(0,0,r.width(),r.height());if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=ye(o,n.dirtyBounds,!1);o.x1=Math.floor(t.x1),o.y1=Math.floor(t.y1),o.x2=Math.ceil(t.x2),o.y2=Math.ceil(t.y2)}const l=s.dpr%1;(l||.5!==l)&&(o.x1=Math.floor(o.x1*s.dpr)/s.dpr,o.y1=Math.floor(o.y1*s.dpr)/s.dpr,o.x2=Math.ceil(o.x2*s.dpr)/s.dpr,o.y2=Math.ceil(o.y2*s.dpr)/s.dpr),this.backupDirtyBounds.copy(o),s.reset(!1),s.save(),s.setClearMatrix(a.a,a.b,a.c,a.d,a.e,a.f),s.clearMatrix(!1),s.translate(r.x1,r.y1,!0),s.beginPath(),s.rect(o.x1,o.y1,o.width(),o.height()),s.clip(),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,s,e),(null===(i=t.drawParams)||void 0===i?void 0:i.stage)&&t.drawParams.stage.hooks.afterClearScreen.call(t.drawParams),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:th.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:th.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,ep.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),s.restore(),s.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=o_(e,i,th.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,s){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!Ae(t.AABBBounds,this.dirtyBounds,!1)&&"empty"!==t.attribute.boundsMode)return;let n,r=i;if(this.useDirtyBounds){n=Pm.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=ep.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}e.isGroupScroll=!(!t.attribute.scrollX&&!t.attribute.scrollY),this.renderItem(t,e,{renderInGroupParams:{skipSort:s,nextM:r},renderInGroup:this._renderInGroup}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),Pm.free(n),ep.free(r))}_increaseRender(t,e){const{layer:i,stage:s}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(s),zIndex:n.size,group:t},n.set(t._uid,r));const a=r.layer.getNativeHandler().getContext(),o=r.drawContribution||xo.get(ev);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:r.layer,context:a,startAtId:t._uid,break:!1})),r.drawContribution=o;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=n.get(l._uid);t||(t={layer:this.layerService.createLayer(s),zIndex:n.size},n.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let s=0;s=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let p_=class extends hm{constructor(){super(...arguments),this.numberType=Fu}drawShape(t,e,i,s,n,r,a,o){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Lc(t).line,{fill:c=h.fill,stroke:d=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,v=Xp(u,p,c),_=qp(u,g),y=Yp(c),b=$p(d,f);if(!t.valid||!m)return;if(!y&&!b)return;if(!(v||_||a||o))return;const{context:x}=n;for(let n=e;n{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,a,o,r),e.stroke())}};p_=u_([qa()],p_);var g_=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let f_=class extends mm{constructor(){super(...arguments),this.numberType=Lu}drawShape(t,e,i,s,n,r,a){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:o}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(r>l.length)return;const h=Lc(t).area,{fill:c=h.fill,fillOpacity:d=h.fillOpacity,opacity:u=h.opacity,visible:p=h.visible}=t.attribute,g=Xp(u,d,c),f=Yp(c);if(!t.valid||!p)return;if(!f)return;if(!g&&!a)return;for(let n=r;n{var a,o,l,h;const c=e&&0===s?e.points[e.points.length-1]:i[0];t.moveTo(c.x+n,c.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const s=i[e];t.lineTo(null!==(a=s.x1)&&void 0!==a?a:s.x,null!==(o=s.y1)&&void 0!==o?o:s.y)}t.lineTo(null!==(l=c.x1)&&void 0!==l?l:c.x,null!==(h=c.y1)&&void 0!==h?h:c.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,a,o,r),e.fill())}};f_=g_([qa()],f_);var m_,v_=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},__=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},y_=function(t,e){return function(i,s){e(i,s,t)}},b_=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(m_||(m_={}));let x_=class extends d_{constructor(t,e,i,s){super(t,s),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=m_.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new _o([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return b_(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:s,viewBox:n}=e;s&&(s.inuse=!0,s.clearMatrix(),s.setTransformForCurrent(!0),s.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,s,e),s.translate(n.x1,n.y1,!0),s.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:th.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:th.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{s.restore(),s.restore(),s.draw(),s.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return b_(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return b_(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>b_(this,void 0,void 0,(function*(){if(2!==t.count)yield a_(t,th.zIndex,((i,s)=>{if(this.status===m_.STOP)return!0;if(i.isContainer)return!1;if(s