@antv/g 6.1.7 → 6.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.min.js +8 -8
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @antv/g
|
|
3
3
|
* @description A core module for rendering engine implements DOM API.
|
|
4
|
-
* @version 6.1.
|
|
5
|
-
* @date 11/
|
|
4
|
+
* @version 6.1.9
|
|
5
|
+
* @date 11/15/2024, 6:18:37 AM
|
|
6
6
|
* @author AntVis
|
|
7
7
|
* @docs https://g.antv.antgroup.com/
|
|
8
8
|
*/
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
* @antv/g-math
|
|
12
12
|
* @description Geometry util
|
|
13
13
|
* @version 3.0.0
|
|
14
|
-
* @date 11/
|
|
14
|
+
* @date 11/15/2024, 6:16:27 AM
|
|
15
15
|
* @author AntVis
|
|
16
16
|
* @docs https://g.antv.antgroup.com/
|
|
17
|
-
*/function pn(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function mn(t,e){var n=Math.min.apply(Math,h(t)),r=Math.min.apply(Math,h(e));return{x:n,y:r,width:Math.max.apply(Math,h(t))-n,height:Math.max.apply(Math,h(e))-r}}function yn(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function gn(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function kn(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=yn(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,g=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var E=p+k;o>a?E>a&&o>E&&g.push(E):E>o&&a>E&&g.push(E)}for(var x=0;g.length>x;x++){var b=gn(0,e,n,r,i,g[x]);m>b&&(m=b),b>y&&(y=b)}return{x:u,y:m,width:l-u,height:y-m}}function En(t,e,n,r){return pn(t,e,n,r)}function xn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function bn(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Tn(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(Xt(s,0))Xt(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;Xt(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function Mn(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=Tn(t,n,i,o),h=Tn(e,r,a,s),f=0;c.length>f;f++)u.push(bn(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(bn(e,r,a,s,h[d]));return mn(u,l)}function wn(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=pn(r[0],r[1],i[0],i[1])}return e}(t)}function Nn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Pn(t,e,n){var r=t+n-2*e;if(Xt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Sn(t,e,n,r,i,a){var o=Pn(t,n,i)[0],s=Pn(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(Nn(t,n,i,o)),void 0!==s&&l.push(Nn(e,r,a,s)),mn(u,l)}function An(){An=function(){return n};var t,n={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=Object.create((e&&e.prototype instanceof g?e:g).prototype),o=new R(r||[]);return a(i,"_invoke",{value:P(t,n,o)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var d="suspendedStart",v="suspendedYield",p="executing",m="completed",y={};function g(){}function k(){}function E(){}var x={};c(x,s,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(O([])));T&&T!==r&&i.call(T,s)&&(x=T);var M=E.prototype=g.prototype=Object.create(x);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,n){function r(a,o,s,u){var l=f(t[a],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==e(h)&&i.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new n((function(n,i){r(t,e,n,i)}))}return o=o?o.then(i,i):i()}})}function P(e,n,r){var i=d;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=S(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?m:v,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=m,r.method="throw",r.arg=l.arg)}}}function S(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function O(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var a=-1,o=function e(){for(;++a<n.length;)if(i.call(n,a))return e.value=n[a],e.done=!1,e;return e.value=t,e.done=!0,e};return o.next=o}}throw new TypeError(e(n)+" is not iterable")}return k.prototype=E,a(M,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:k,configurable:!0}),k.displayName=c(E,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},n.awrap=function(t){return{__await:t}},w(N.prototype),c(N.prototype,u,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,r,i,a){void 0===a&&(a=Promise);var o=new N(h(t,e,r,i),a);return n.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},w(M),c(M,l,"Generator"),c(M,s,(function(){return this})),c(M,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=O,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var u=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(u&&l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&i.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var a=r;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}function Cn(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Rn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){Cn(a,r,i,o,s,"next",t)}function s(t){Cn(a,r,i,o,s,"throw",t)}o(void 0)}))}}function On(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ln(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)e.includes(n=a[r])||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}_e(Fe,Je,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$e,formatHex:$e,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return cn(this).formatHsl()},formatRgb:Qe,toString:Qe}),_e(nn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Fe||(i=Je(i)),i?new nn((i=i.rgb()).r,i.g,i.b,i.opacity):new nn):new nn(t,e,n,null==r?1:r);var i}),De(Fe,{brighter(t){return new nn(this.r*(t=null==t?Be:Math.pow(Be,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new nn(this.r*(t=null==t?Ge:Math.pow(Ge,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new nn(sn(this.r),sn(this.g),sn(this.b),on(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:rn,formatHex:rn,formatHex8:function(){return`#${un(this.r)}${un(this.g)}${un(this.b)}${un(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:an,toString:an})),_e(hn,(function(t,e,n,r){return 1===arguments.length?cn(t):new hn(t,e,n,null==r?1:r)}),De(Fe,{brighter(t){return new hn(this.h,this.s,this.l*(t=null==t?Be:Math.pow(Be,t)),this.opacity)},darker(t){return new hn(this.h,this.s,this.l*(t=null==t?Ge:Math.pow(Ge,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new nn(vn(240>t?t+120:t-240,r,n),vn(t,r,n),vn(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new hn(fn(this.h),dn(this.s),dn(this.l),on(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=on(this.opacity);return`${1===t?"hsl(":"hsla("}${fn(this.h)}, ${100*dn(this.s)}%, ${100*dn(this.l)}%${1===t?")":`, ${t})`}`}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var In={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(a,Math.floor(r+(s-u)*c/s+h)),o)}var f=t[r],d=i,v=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);v>d;){for(n(t,d,v),d++,v--;0>o(t[d],f);)d++;for(;o(t[v],f)>0;)v--}0===o(t[i],f)?n(t,i,v):n(t,++v,a),v>r||(i=v+1),r>v||(a=v-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;n>a;a++){var o=t.children[a];u(i,t.leaf?r(o):o)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function v(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function p(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,a){for(var o=[n,r];o.length;)if((r=o.pop())-(n=o.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;e.children.length>a;a++){var o=e.children[a],s=e.leaf?r(o):o;m(t,s)&&(e.leaf?n.push(o):p(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(m(t,a)){if(e.leaf||p(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),u=[],l=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),o.leaf){var c=a(t,o.children,e);if(-1!==c)return o.children.splice(c,1),u.push(o),this._condense(u),this}i||o.leaf||!p(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(u.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(s>=a)return o(i=y(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(a/Math.pow(s,(r=Math.ceil(Math.log(a)/Math.log(s)))-1))),(i=y([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));g(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);g(t,c,h,u,this.compareMinY);for(var f=c;h>=f;f+=u)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=d(t,u)-l;a>c?(a=c,i=i>l?l:i,o=u):c===a&&i>l&&(i=l,o=u)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),u(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=y(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;n-e>=o;o++){var u=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),c=v(u,l),f=h(u)+h(l);i>c?(i=c,r=o,a=a>f?f:a):c===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>a&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=f(a)+f(o),c=e;n-e>c;c++){var h=t.children[c];u(a,t.leaf?i(h):h),l+=f(a)}for(var d=n-e-1;d>=e;d--){var v=t.children[d];u(o,t.leaf?i(v):v),l+=f(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}(In);var _n=In.exports,Dn=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),Fn=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),Gn=function(){return u((function t(){o(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))}}])}(),Bn=function(){return u((function t(e){o(this,t),this.clipSpaceNearZ=Fn.NEGATIVE_ONE,this.plugins=[],this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),Vn=ut,Yn=ot,Un=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},zn=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},jn=ct,Xn=yt,Hn=function(){function t(){o(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return u(t,[{key:"update",value:function(t,e){Yn(this.center,t),Yn(this.halfExtents,e),Xn(this.min,this.center,this.halfExtents),Vn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Vn(this.center,e,t),jn(this.center,this.center,.5),Xn(this.halfExtents,e,t),jn(this.halfExtents,this.halfExtents,.5),Yn(this.min,t),Yn(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,v=a-l,p=a+l,m=e.center,y=m[0],g=m[1],k=m[2],E=e.halfExtents,x=E[0],b=E[1],T=E[2],M=y-x,w=y+x,N=g-b,P=g+b,S=k-T,A=k+T;c>M&&(c=M),w>h&&(h=w),f>N&&(f=N),P>d&&(d=P),v>S&&(v=S),A>p&&(p=A),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(v+p),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(p-v),this.min[0]=c,this.min[1]=f,this.min[2]=v,this.max[0]=h,this.max[1]=d,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],v=e[10],p=Math.abs(o),m=Math.abs(s),y=Math.abs(u),g=Math.abs(l),k=Math.abs(c),E=Math.abs(h),x=Math.abs(f),b=Math.abs(d),T=Math.abs(v);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+v*i[2],r[0]=p*a[0]+m*a[1]+y*a[2],r[1]=g*a[0]+k*a[1]+E*a[2],r[2]=x*a[0]+b*a[1]+T*a[2],Xn(this.min,n,r),Vn(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=Un([0,0,0],this.getMin(),e.getMin()),i=zn([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Yn([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Yn([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Wn=function(){return u((function t(e,n){o(this,t),this.distance=e||0,this.normal=n||at(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ft(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/kt(this.normal);ct(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&vt(n,t,e,i),a}}])}(),qn=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Zn=function(){return u((function t(e){if(o(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new Wn)}),[{key:"extractFromVPMatrix",value:function(t){var e=g(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],m=e[14],y=e[15];st(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=y-v,st(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=y+v,st(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=y+p,st(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=y-p,st(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=y-m,st(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Kn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),$n=function(){function t(e,n,r,i){o(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return u(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=xt(e.x,e.y,0,1),i=xt(e.x+e.width,e.y,0,1),a=xt(e.x,e.y+e.height,0,1),o=xt(e.x+e.width,e.y+e.height,0,1),s=Et(),u=Et(),l=Et(),c=Et();bt(s,r,n),bt(u,i,n),bt(l,a,n),bt(c,o,n);var h=Math.min(s[0],u[0],l[0],c[0]),f=Math.min(s[1],u[1],l[1],c[1]);return t.fromRect({x:h,y:f,width:Math.max(s[0],u[0],l[0],c[0])-h,height:Math.max(s[1],u[1],l[1],c[1])-f})}}])}(),Qn="Method not implemented.",Jn="Use document.documentElement instead.";function tr(t){return void 0===t?0:t>360||-360>t?t%360:t}var er=nt();function nr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?r?rt(t):ot(er,t):zt(t)?r?at(t,e,n):st(er,t,e,n):r?at(t[0],t[1]||e,t[2]||n):st(er,t[0],t[1]||e,t[2]||n)}var rr=Math.PI/180;function ir(t){return t*rr}var ar=180/Math.PI;function or(t){return t*ar}function sr(t){return 360*t}var ur=Math.PI/2;function lr(t,e){return 16===e.length?function(t,e){var n,r,i=g(j(nt(),e),3),a=i[0],o=i[1],s=i[2],u=Math.asin(-e[2]/a);return ur>u?u>-ur?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=ur,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-ur,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function cr(t,e,n,r,i){var a,o,s,u,l,c,h,f,d,v,p=Math.cos(t),m=Math.sin(t);return a=r*p,o=i*m,s=0,u=-r*m,l=i*p,c=0,h=e,f=n,d=1,(v=new b(9))[0]=a,v[1]=o,v[2]=s,v[3]=u,v[4]=l,v[5]=c,v[6]=h,v[7]=f,v[8]=d,v}function hr(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var u=1/o;r*=u,i*=u}var l=or(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var fr=M(),dr=M(),vr=Et(),pr=[nt(),nt(),nt()],mr=nt();function yr(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var gr=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),kr=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Er=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),xr={UPDATED:"updated"},br=2e-4,Tr=function(){return u((function t(){o(this,t),this.clipSpaceNearZ=Fn.NEGATIVE_ONE,this.eventEmitter=new E,this.matrix=M(),this.right=at(1,0,0),this.up=at(0,1,0),this.forward=at(0,0,1),this.position=at(0,0,1),this.focalPoint=at(0,0,0),this.distanceVector=at(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=M(),this.projectionMatrixInverse=M(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=gr.EXPLORING,this.trackingMode=kr.DEFAULT,this.projectionMode=Er.PERSPECTIVE,this.frustum=new Zn,this.orthoMatrix=M()}),[{key:"isOrtho",value:function(){return this.projectionMode===Er.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.setWorldRotation(this.type===gr.EXPLORING),this._getAngles(),this.type===gr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==gr.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return C(M(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=D(M(),[t,e,0]);this.jitteredProjectionMatrix=O(M(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Er.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Er.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Er.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Er.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Er.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Er.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=at(o.x-r,o.y-i,0),u=ft(s,this.right)/it(this.right),l=ft(s,this.up)/it(this.up),c=g(this.getPosition(),2),h=c[0],f=c[1],d=g(this.getFocalPoint(),2),v=d[0],p=d[1];return this.setPosition(h-u,f-l),this.setFocalPoint(v-u,p-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=Er.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(ir(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,u=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*s/l,a-=this.view.offsetY*o/c,s*=this.view.width/l,o*=this.view.height/c}return function(t,e,n,r,i,a,o){var s,u,l=2*a,c=n-e,h=r-i,f=l/h,d=(n+e)/c,v=(r+i)/h,p=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/p,u=-m/p):(s=-(o+a)/p,u=-2*m/p),t[0]=l/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=v,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0}(this.projectionMatrix,u,u+s,a-o,a,t,this.far,this.clipSpaceNearZ===Fn.ZERO),C(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=Er.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=l-s,f=l+s,d=c+u,v=c-u;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(h+=p*this.view.offsetX)+p*this.view.width,v=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===Fn.NEGATIVE_ONE?K(this.projectionMatrix,h,f,d,v,i,a):$(this.projectionMatrix,h,f,d,v,i,a),C(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=at(0,1,0);if(this.focalPoint=nr(t,e,n),this.trackingMode===kr.CINEMATIC){var i=lt(nt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=it(i),o=or(Math.asin(e/a)),s=90+or(Math.atan2(n,t)),u=M();_(u,u,ir(s)),I(u,u,ir(o)),r=pt(nt(),[0,1,0],u)}return C(this.matrix,Q(M(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||0>t)return this;this.distance=t,br>this.distance&&(this.distance=br),this.dollyingStep=this.distance/100;var e=nt(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=tr(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=tr(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=tr(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Mt(Tt(),[0,0,1],ir(this.roll));S(this.matrix);var e=Mt(Tt(),[1,0,0],ir((this.rotateWorld&&this.type!==gr.TRACKING||this.type===gr.TRACKING?1:-1)*this.elevation)),n=Mt(Tt(),[0,1,0],ir((this.rotateWorld&&this.type!==gr.TRACKING||this.type===gr.TRACKING?1:-1)*this.azimuth)),r=wt(Tt(),n,e);r=wt(Tt(),r,t);var i=W(M(),r);this.type===gr.ORBITING||this.type===gr.EXPLORING?(L(this.matrix,this.matrix,this.focalPoint),O(this.matrix,this.matrix,i),L(this.matrix,this.matrix,[0,0,this.distance])):this.type===gr.TRACKING&&(L(this.matrix,this.matrix,this.position),O(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=nr(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ot(this.right,nr(bt(Et(),[1,0,0,0],this.matrix))),ot(this.up,nr(bt(Et(),[0,1,0,0],this.matrix))),ot(this.forward,nr(bt(Et(),[0,0,1,0],this.matrix))),ht(this.right,this.right),ht(this.up,this.up),ht(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=it(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===gr.TRACKING||this.rotateWorld?(this.elevation=or(Math.asin(e/r)),this.azimuth=or(Math.atan2(-t,-n))):(this.elevation=-or(Math.asin(e/r)),this.azimuth=-or(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ot(this.position,nr(bt(Et(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=T(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ut(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=lt(nt(),this.focalPoint,this.position),this.distance=it(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Er.ORTHOGRAPHIC){var t=this.position,e=Mt(Tt(),[0,0,1],-this.roll*Math.PI/180);H(this.orthoMatrix,e,at((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),at(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=O(M(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(xr.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(Qn)}},{key:"pan",value:function(t,e){throw Error(Qn)}},{key:"dolly",value:function(t){throw Error(Qn)}},{key:"createLandmark",value:function(t,e){throw Error(Qn)}},{key:"gotoLandmark",value:function(t,e){throw Error(Qn)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(Qn)}}])}(),Mr=function(t){return t[t.Standard=0]="Standard",t}({}),wr=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Nr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new $n(0,0,0,0)},Pr=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function Sr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(Sr.Cache||Map),n}Sr.Cache=Map;var Ar=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Cr=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Rr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Or=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Lr=[{name:"em",unit_type:Ar.kEms},{name:"px",unit_type:Ar.kPixels},{name:"deg",unit_type:Ar.kDegrees},{name:"rad",unit_type:Ar.kRadians},{name:"grad",unit_type:Ar.kGradians},{name:"ms",unit_type:Ar.kMilliseconds},{name:"s",unit_type:Ar.kSeconds},{name:"rem",unit_type:Ar.kRems},{name:"turn",unit_type:Ar.kTurns}],Ir=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),_r=function(t){return t?"number"===t?Ar.kNumber:"percent"===t||"%"===t?Ar.kPercentage:function(t){return Lr.find((function(e){return e.name===t})).unit_type}(t):Ar.kUnknown},Dr=function(t){var e=1;switch(t){case Ar.kPixels:case Ar.kDegrees:case Ar.kSeconds:break;case Ar.kMilliseconds:e=.001;break;case Ar.kRadians:e=180/Math.PI;break;case Ar.kGradians:e=.9;break;case Ar.kTurns:e=360}return e},Fr=function(t){switch(t){case Ar.kNumber:case Ar.kInteger:return"";case Ar.kPercentage:return"%";case Ar.kEms:return"em";case Ar.kRems:return"rem";case Ar.kPixels:return"px";case Ar.kDegrees:return"deg";case Ar.kRadians:return"rad";case Ar.kGradians:return"grad";case Ar.kMilliseconds:return"ms";case Ar.kSeconds:return"s";case Ar.kTurns:return"turn"}return""},Gr=function(){return u((function t(){o(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Rr.kNo,Or.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Ir.kUnitType&&this.getType()<=Ir.kClampType}}],[{key:"isAngle",value:function(t){return t===Ar.kDegrees||t===Ar.kRadians||t===Ar.kGradians||t===Ar.kTurns}},{key:"isLength",value:function(t){return t>=Ar.kEms&&Ar.kDegrees>t}},{key:"isRelativeUnit",value:function(t){return t===Ar.kPercentage||t===Ar.kEms||t===Ar.kRems}},{key:"isTime",value:function(t){return t===Ar.kSeconds||t===Ar.kMilliseconds}}])}(),Br=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).colorSpace=t,n}return y(e,t),u(e,[{key:"getType",value:function(){return Ir.kColorType}},{key:"to",value:function(t){return this}}])}(Gr),Vr=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Yr=function(t){function e(t,n){var r;return o(this,e),(r=p(this,e)).type=t,r.value=n,r}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Ir.kColorType}}])}(Gr),Ur=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).value=t,n}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Ir.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Gr),zr=function(t){return function(t){switch(t){case Cr.kUNumber:return Ar.kNumber;case Cr.kULength:return Ar.kPixels;case Cr.kUPercent:return Ar.kPercentage;case Cr.kUTime:return Ar.kSeconds;case Cr.kUAngle:return Ar.kDegrees;default:return Ar.kUnknown}}(function(t){switch(t){case Ar.kNumber:case Ar.kInteger:return Cr.kUNumber;case Ar.kPercentage:return Cr.kUPercent;case Ar.kPixels:return Cr.kULength;case Ar.kMilliseconds:case Ar.kSeconds:return Cr.kUTime;case Ar.kDegrees:case Ar.kRadians:case Ar.kGradians:case Ar.kTurns:return Cr.kUAngle;default:return Cr.kUOther}}(t))},jr=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ar.kNumber;return o(this,e),n=p(this,e),r="string"==typeof i?_r(i):i,n.unit=r,n.value=t,n}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return Ir.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=zr(this.unit);if(n!==zr(t)||n===Ar.kUnknown)return null;var r=Dr(this.unit)/Dr(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case Ar.kUnknown:break;case Ar.kInteger:r=Number(this.value).toFixed(0);break;case Ar.kNumber:case Ar.kPercentage:case Ar.kEms:case Ar.kRems:case Ar.kPixels:case Ar.kDegrees:case Ar.kRadians:case Ar.kGradians:case Ar.kMilliseconds:case Ar.kSeconds:case Ar.kTurns:var i=this.value,a=Fr(this.unit);if(-999999>i||i>999999){var o=Fr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Gr),Xr=new jr(0,"px");new jr(1,"px");var Hr=new jr(0,"deg"),Wr=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o(this,e),(i=p(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=s,i}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Br),qr=new Ur("unset"),Zr={"":qr,unset:qr,initial:new Ur("initial"),inherit:new Ur("inherit")},Kr=new Wr(0,0,0,0,!0),$r=new Wr(0,0,0,0),Qr=Sr((function(t,e,n,r){return new Wr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Jr=function(t){return new jr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ar.kNumber)};function ti(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new jr(50,"%");var ei=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-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/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error("".concat(e,": ").concat(t))}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return a("linear-gradient",t.linearGradient,s)||a("repeating-linear-gradient",t.repeatingLinearGradient,s)||a("radial-gradient",t.radialGradient,u)||a("repeating-radial-gradient",t.repeatingRadialGradient,u)||a("conic-gradient",t.conicGradient,u)}function a(e,r,i){return o(r,(function(r){var a=i();return a&&(k(t.comma)||n("Missing comma before color stops")),{type:e,orientation:a,colorStops:d(v)}}))}function o(e,r){var i=k(e);if(i){k(t.startCall)||n("Missing (");var a=r(i);return k(t.endCall)||n("Missing )"),a}}function s(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,k(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=g("shape",/^(circle)/i,0);t&&(t.style=y()||c());return t}()||function(){var t=g("shape",/^(ellipse)/i,0);t&&(t.style=m()||c());return t}();if(t)t.at=h();else{var e=c();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=f();r&&(t={type:"default-radial",at:r})}}return t}function c(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);k(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function v(){var e=g("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:d(p)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:d(p)}}))||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function p(){return k(t.number)[1]}function m(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||y()}function y(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,n){var r=k(e);if(r)return{type:t,value:r[n]}}function k(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();var ni=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ri=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ii=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ai=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var oi={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},si=Sr((function(t){return Jr("angular"===t.type?Number(t.value):oi[t.value]||0,"deg")})),ui=Sr((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Jr(e,r),cy:Jr(n,i)}})),li=Sr((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return ei(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!_t(u)&&!_t(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(r);var i,a=r.map((function(t){return{offset:Jr(Number(t.length.value),"%"),color:ti(t)}}));if("linear-gradient"===e)return new Yr(Vr.LinearGradient,{angle:n?si(n):Hr,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=ui(n[0].at),u=s.cx,l=s.cy;if(n[0].style){var c=n[0].style,h=c.type,f=c.value;"extent-keyword"===h?(Zr[i=f]||(Zr[i]=new Ur(i)),o=Zr[i]):o=Jr(f,h)}return new Yr(Vr.RadialGradient,{cx:u,cy:l,size:o,steps:a})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=ni.exec(t);if(n){var r,i=(null===(r=n[2].match(ai))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new Yr(Vr.LinearGradient,{angle:Jr(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=g(t,2),n=e[1];return{offset:Jr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===e){var a=function(t){var e=ri.exec(t);if(e){var n,r=(null===(n=e[4].match(ai))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Jr(50,"%"),cy:Jr(50,"%"),steps:r.map((function(t){var e=g(t,2),n=e[1];return{offset:Jr(100*Number(e[0]),"%"),color:n}}))}}return null}(t);if(a){if(!Yt(a))return[new Yr(Vr.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=ii.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function ci(t){return t&&!!t.image}function hi(t){return t&&!_t(t.r)&&!_t(t.g)&&!_t(t.b)}var fi=Sr((function(t){if(ci(t))return a({repetition:"repeat"},t);if(_t(t)&&(t=""),"transparent"===t)return $r;if("currentColor"===t)t="black";else if("none"===t)return Kr;var e=li(t);if(e)return e;var n=Je(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Qr.apply(void 0,r)}));function di(t,e){if(hi(t)&&hi(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Ut(e[n],0,255));return e[3]=Ut(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function vi(t,e){if(_t(e))return Jr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Jr(Number(e),"px");if("deg".search(t)>=0)return Jr(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return Jr(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var pi=function(t){return vi(/px/g,t)},mi=Sr(pi);Sr((function(t){return vi(RegExp("%","g"),t)}));var yi=function(t){return zt(t)||isFinite(Number(t))?Jr(Number(t)||0,"px"):vi(RegExp("px|%|em|rem","g"),t)},gi=Sr(yi),ki=function(t){return vi(/deg|rad|grad|turn/g,t)},Ei=Sr(ki);function xi(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=zr(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=Fr(t.unit)):(jr.isLength(t.unit)||jr.isLength(e.unit))&&(o=Mi(t,i,n),s=Mi(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function bi(t){var e=0;return t.unit===Ar.kDegrees?e=t.value:t.unit===Ar.kRadians?e=or(Number(t.value)):t.unit===Ar.kTurns?e=sr(Number(t.value)):t.value&&(e=t.value),e}function Ti(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):Yt(t)?n=t.split(" ").map((function(t){return Number(t)})):zt(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Mi(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Ar.kPixels)return Number(t.value);if(t.unit===Ar.kPercentage&&n){var i=n.nodeName===Dn.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var wi=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ni(t){return""+t}var Pi=function(t){return Jr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},Si=Sr(Pi);function Ai(t,e){return[t,e,Ni]}function Ci(t,e){return function(n,r){return[n,r,function(n){return Ni(Ut(n,t,e))}]}}function Ri(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Oi(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ae(t.parsedStyle.d.absolutePath,void 0,Zt(Zt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Li(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ii(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((a+o-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(a)*Math.sqrt(o)));if(!s||0===Math.sin(s)||Xt(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function _i(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Sr((function(t){return Yt(t)?t.split(" ").map(Si):t.map(Si)}));var Di=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Fi=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=ir(r=Ht(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),v=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),m=v*(-n*h.x/e),y={x:Math.cos(u)*p-Math.sin(u)*m+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*m+(t.y+o.y)/2},g={x:(h.x-p)/e,y:(h.y-m)/n},k=Di({x:1,y:0},g),E=Di(g,{x:(-h.x-p)/e,y:(-h.y-m)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var x=k+(E%=2*Math.PI)*s,b=e*Math.cos(x),T=n*Math.sin(x);return{x:Math.cos(u)*b-Math.sin(u)*T+y.x,y:Math.sin(u)*b+Math.cos(u)*T+y.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+E,ellipticalArcAngle:x,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Gi(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Fi({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Fi({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function Bi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Vi(t,e){return Bi(t)*Bi(e)?(t[0]*e[0]+t[1]*e[1])/(Bi(t)*Bi(e)):1}function Yi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Vi(t,e))}function Ui(t,e){var n=e[1],r=e[2],i=Ht(ir(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var m=r?p*n*f/r:0,y=n?p*-r*h/n:0,g=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,k=(u+c)/2+Math.sin(i)*m+Math.cos(i)*y,E=[(h-m)/n,(f-y)/r],x=[(-1*h-m)/n,(-1*f-y)/r],b=Yi([1,0],E),T=Yi(E,x);return Vi(E,x)>-1||(T=Math.PI),1>Vi(E,x)||(T=0),0===o&&T>0&&(T-=2*Math.PI),1===o&&0>T&&(T+=2*Math.PI),{cx:g,cy:k,rx:Li(t,[l,c])?0:n,ry:Li(t,[l,c])?0:r,startAngle:b,endAngle:b+T,xRotation:i,arcFlag:a,sweepFlag:o}}function zi(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var ji=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=de(t)}catch(n){e=de(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Li([r[1],r[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=Ui(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Li(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],m=_i(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var y=[u[1],u[2]],g=[u[3],u[4]];c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[y[0]-g[0],y[1]-g[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===l){var k=e[s-1],E=_i(k.currentPoint,d),x=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]]):(c.command="SQ",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]])}else if("A"===l){var b=Gi(c,0),T=b.x,M=b.y,w=Gi(c,1,!1),N=w.x,P=w.y;c.startTangent=[T,M],c.endTangent=[N,P]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Sn(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=Mn(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=kn(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=Vt(n),d=Vt(r),v=Bt(n),p=Bt(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var m=0;i.length>m;m++){var y=i[m],g=y.currentPoint;g[0]===f?f-=Ii(y,e).xExtra:g[0]===v&&(v+=Ii(y,e).xExtra),g[1]===d?d-=Ii(y,e).yExtra:g[1]===p&&(p+=Ii(y,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Xi=Sr(ji);function Hi(t){return Yt(t)?Xi(t):ji(t)}function Wi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ke(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ke(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Oe(r,i));var o,s,u,l,c,h,f,d,v=Ce(a[0])!==Ce(a[1])?(s=(o=a[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Ee(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function qi(t,e){return[t.points,e.points,function(t){return t}]}var Zi=null,Ki=/\s*(\w+)\(([^)]*)\)/g;function $i(t){return function(e){var n=0;return t.map((function(t){return t===Zi?e[n++]:t}))}}function Qi(t){return t}var Ji={matrix:["NNNNNN",[Zi,Zi,0,0,Zi,Zi,0,0,0,0,1,0,Zi,Zi,0,1],Qi],matrix3d:["NNNNNNNNNNNNNNNN",Qi],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",$i([Zi,Zi,new jr(1)]),Qi],scaleX:["N",$i([Zi,new jr(1),new jr(1)]),$i([Zi,new jr(1)])],scaleY:["N",$i([new jr(1),Zi,new jr(1)]),$i([new jr(1),Zi])],scaleZ:["N",$i([new jr(1),new jr(1),Zi])],scale3d:["NNN",Qi],skew:["Aa",null,Qi],skewX:["A",null,$i([Zi,Hr])],skewY:["A",null,$i([Hr,Zi])],translate:["Tt",$i([Zi,Zi,Xr]),Qi],translateX:["T",$i([Zi,Xr,Xr]),$i([Zi,Xr])],translateY:["T",$i([Xr,Zi,Xr]),$i([Xr,Zi])],translateZ:["L",$i([Xr,Xr,Zi])],translate3d:["TTL",Qi]};function ta(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!Ji[a])return[];var s=o.map((function(t){return Jr(t)}));e.push({t:a,d:s})}return e}function ea(t){if(Array.isArray(t))return ta(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Ki.lastIndex=0;e=Ki.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?Hr:Ei(t)},N:Si,T:gi,L:mi}[h.toUpperCase()](c):{a:Hr,n:u[0],t:Xr}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Ki.lastIndex===t.length)return n}return[]}function na(t){if(Array.isArray(t))return ta(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Ki.lastIndex=0;e=Ki.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?Hr:ki(t)},N:Pi,T:yi,L:pi}[h.toUpperCase()](c):{a:Hr,n:u[0],t:Xr}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Ki.lastIndex===t.length)return n}return[]}function ra(t){var e,n,r,i;switch(t.t){case"rotateX":return i=ir(bi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=ir(bi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=ir(bi(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=ir(bi(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=ir(bi(t.d[0])),h=ir(bi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=ir(bi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=ir(bi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Mi(t.d[0],0,null)||0,n=Mi(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Mi(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Mi(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Mi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Mi(t.d[0],0,null)||0,n=Mi(t.d[1],0,null)||0,r=Mi(t.d[2],0,null)||0,1];case"perspective":var f=Mi(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function ia(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function aa(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(fr,t))return!1;if(N(dr,fr),dr[3]=0,dr[7]=0,dr[11]=0,dr[15]=1,1e-8>Math.abs(R(dr)))return!1;var o,s,u=fr[3],l=fr[7],c=fr[11],h=fr[12],f=fr[13],d=fr[14],v=fr[15];if(0!==u||0!==l||0!==c){if(vr[0]=u,vr[1]=l,vr[2]=c,vr[3]=v,!C(dr,dr))return!1;A(dr,dr),bt(i,vr,dr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=pr)[0][0]=(s=fr)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=it(pr[0]),ht(pr[0],pr[0]),r[0]=ft(pr[0],pr[1]),yr(pr[1],pr[1],pr[0],1,-r[0]),n[1]=it(pr[1]),ht(pr[1],pr[1]),r[0]/=n[1],r[1]=ft(pr[0],pr[2]),yr(pr[2],pr[2],pr[0],1,-r[1]),r[2]=ft(pr[1],pr[2]),yr(pr[2],pr[2],pr[1],1,-r[2]),n[2]=it(pr[2]),ht(pr[2],pr[2]),r[1]/=n[2],r[2]/=n[2],dt(mr,pr[1],pr[2]),0>ft(pr[0],mr))for(var p=0;3>p;p++)n[p]*=-1,pr[p][0]*=-1,pr[p][1]*=-1,pr[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+pr[0][0]-pr[1][1]-pr[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-pr[0][0]+pr[1][1]-pr[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-pr[0][0]-pr[1][1]+pr[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+pr[0][0]+pr[1][1]+pr[2][2],0)),pr[2][1]>pr[1][2]&&(a[0]=-a[0]),pr[0][2]>pr[2][0]&&(a[1]=-a[1]),pr[1][0]>pr[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ra).reduce(ia)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var oa=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(m[2][1]=r[2],o=t(o,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],o=t(o,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],o=t(o,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)o[y][g]*=n[y];return 0===(p=o)[0][2]&&0===p[0][3]&&0===p[1][2]&&0===p[1][3]&&0===p[2][0]&&0===p[2][1]&&1===p[2][2]&&0===p[2][3]&&0===p[3][2]&&1===p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function sa(t){return t.toFixed(6).replace(".000000","")}function ua(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=aa(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=aa(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=Ut(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return oa(t[0],t[1],t[2],e,t[4]).map(sa).join(",")}])}function la(t){return t.replace(/[XY]/,"")}function ca(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function ha(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Jr(o):Jr(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=ua(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,v=e[f].t,p=t[f].d,m=e[f].d,y=Ji[d],g=Ji[v],k=void 0;if(s=v,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var E=ua([t[f]],[e[f]]);u.push(E[0]),l.push(E[1]),c.push(["matrix",[E[2]]])}else{if(d===v)k=d;else if(y[2]&&g[2]&&la(d)===la(v))k=la(d),p=y[2](p),m=g[2](m);else{if(!y[1]||!g[1]||ca(d)!==ca(v)){var x=ua(t,e);u=[x[0]],l=[x[1]],c=[["matrix",[x[2]]]];break}k=ca(d),p=y[1](p),m=g[1](m)}for(var b=[],T=[],M=[],w=0;p.length>w;w++){var N=xi(p[w],m[w],n,!1,w);b[w]=N[0],T[w]=N[1],M.push(N[2])}u.push(b),l.push(T),c.push([k,M])}}if(r){var P=u;u=l,l=P}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(n,")")})).join(" ")}]}var fa=Sr((function(t){if(Yt(t)){if("text-anchor"===t)return[Jr(0,"px"),Jr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[gi(da(e[0])),gi(da(e[1]))]}return[Jr(t[0]||0,"px"),Jr(t[1]||0,"px")]}));function da(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var va=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Pr.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Pr.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Pr.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Pr.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Pr.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Pr.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Pr.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Pr.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Pr.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Pr.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Pr.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Pr.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Pr.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Pr.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Pr.FILTER},{n:"clipPath",syntax:Pr.DEFINED_PATH},{n:"textPath",syntax:Pr.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Pr.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Pr.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Pr.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Pr.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Pr.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Pr.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Pr.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Pr.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Pr.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Pr.NUMBER,d:function(t){return t===Dn.PATH||t===Dn.POLYGON||t===Dn.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Pr.MARKER},{n:"markerEnd",syntax:Pr.MARKER},{n:"markerMid",syntax:Pr.MARKER},{n:"markerStartOffset",syntax:Pr.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Pr.LENGTH,l:!0,int:!0,d:"0"}],pa=new Set(va.filter((function(t){return!!t.l})).map((function(t){return t.n}))),ma={},ya=function(){return u((function t(e){var n=this;o(this,t),this.runtime=e,va.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(h(t.a||[])).forEach((function(e){ma[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){if(!Es.enableMassiveParsedStyleAssignOptimization)return void Object.assign(t.parsedStyle,e);var n=t.constructor.PARSED_STYLE_LIST;for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var o,s=!!n.forceUpdateGeometry;if(!s)for(var u in e)if(pa.has(u)){s=!0;break}e.fill&&(t.parsedStyle.fill=fi(e.fill)),e.stroke&&(t.parsedStyle.stroke=fi(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=fi(e.shadowColor)),e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,wi.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return vi(/deg|rad|grad|turn|px|%/g,t)||fi(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),_t(e.radius)||(t.parsedStyle.radius=Ti(e.radius,4)),_t(e.lineDash)||(t.parsedStyle.lineDash=Ti(e.lineDash,2)),e.points&&(t.parsedStyle.points={points:Yt(o=e.points)?o.split(" ").map((function(t){var e=g(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):o,totalLength:0,segments:[]}),""===e.d&&(t.parsedStyle.d=a({},Nr)),e.d&&(t.parsedStyle.d=Hi(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Pr.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),qt(e.clipPath)||this.runtime.CSSPropertySyntaxFactory[Pr.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Pr.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=ea(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=fa(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Pr.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Pr.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Pr.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),_t(e.zIndex)||this.runtime.CSSPropertySyntaxFactory[Pr.Z_INDEX].postProcessor(t),_t(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[Pr.OFFSET_DISTANCE].postProcessor(t),e.transform&&this.runtime.CSSPropertySyntaxFactory[Pr.TRANSFORM].postProcessor(t),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Pr.TRANSFORM_ORIGIN].postProcessor(t),s&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Hn),r.renderBounds||(r.renderBounds=new Hn);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,u=a.cy,l=void 0===u?0:u,c=a.cz,h=void 0===c?0:c,f=a.hwidth,d=void 0===f?0:f,v=a.hheight,p=void 0===v?0:v,m=a.hdepth,y=void 0===m?0:m,g=[Math.abs(d),Math.abs(p),y],k=i.stroke,E=i.lineWidth,x=void 0===E?1:E,b=i.increasedLineWidthForHitTesting,T=void 0===b?0:b,M=i.shadowType,w=void 0===M?"outer":M,N=i.shadowColor,P=i.filter,S=void 0===P?[]:P,A=i.transformOrigin,C=[s,l,h];if(r.contentBounds.update(C,g),k&&!k.isNone){var R=((x||0)+(T||0))*(e===Dn.POLYLINE||e===Dn.POLYGON||e===Dn.PATH?Math.SQRT2:.5);g[0]+=R,g[1]+=R}if(r.renderBounds.update(C,g),N&&w&&"inner"!==w){var O=r.renderBounds,L=O.min,I=O.max,_=i.shadowBlur||0,D=i.shadowOffsetX||0,F=i.shadowOffsetY||0,G=I[0]+_+D,B=L[1]-_+F,V=I[1]+_+F;L[0]=Math.min(L[0],L[0]-_+D),I[0]=Math.max(I[0],G),L[1]=Math.min(L[1],B),I[1]=Math.max(I[1],V),r.renderBounds.setMinMax(L,I)}S.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ut(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),r.renderBounds.setMinMax(l,c)}})),t.geometry.dirty=!1;var Y=0>p,U=(0>d?-1:1)*(A?Mi(A[0],0,t,!0):0),z=(Y?-1:1)*(A?Mi(A[1],1,t,!0):0);(U||z)&&t.setOrigin(U,z)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===Dn.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Dn.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();var ga=function(){return u((function t(){o(this,t),this.mixer=Ai}),[{key:"calculator",value:function(t,e,n,r){return bi(n)}}])}(),ka=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Ur&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),Ea=function(){return u((function t(){o(this,t),this.parser=fi,this.mixer=di}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ur?"none"===n.value?Kr:$r:n}}])}(),xa=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof Ur?[]:n}}])}();function ba(t){var e=t.parsedStyle.fontSize;return _t(e)?null:e}var Ta=function(){return u((function t(){o(this,t),this.mixer=Ai}),[{key:"calculator",value:function(t,e,n,r,i){if(zt(n))return n;if(!jr.isRelativeUnit(n.unit))return n.value;if(n.unit===Ar.kPercentage)return 0;if(n.unit===Ar.kEms){if(r.parentNode){var a=ba(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===Ar.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=ba(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Ma=function(){return u((function t(){o(this,t),this.mixer=Ri}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),wa=function(){return u((function t(){o(this,t),this.mixer=Ri}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Na=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Ur&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Pa=function(){return u((function t(){o(this,t),this.mixer=Ai}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Sa=function(){return u((function t(){o(this,t),this.mixer=Ci(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===Dn.LINE||r===Dn.PATH||r===Dn.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}])}(),Aa=function(){return u((function t(){o(this,t),this.mixer=Ci(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ca=function(){return u((function t(){o(this,t),this.parser=Hi,this.mixer=Wi}),[{key:"calculator",value:function(t,e,n){return n instanceof Ur&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new $n(0,0,0,0)}:n}}])}(),Ra=u((function t(){o(this,t),this.mixer=qi})),Oa=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).mixer=Ci(0,1/0),t}return y(e,t),u(e)}(Ta),La=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ur?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ia=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),_a=new WeakMap;function Da(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;_a.has(r)&&_a.get(r).destroy(n),_a.set(r,e)}}var Fa="undefined"!=typeof window&&void 0!==window.document;function Ga(t){return!!t.getAttribute}function Ba(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Va(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Ya(t,e){if(Fa)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Ua={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},za="object"==typeof performance&&performance.now?performance:Date;function ja(t){return t.nodeName===Dn.FRAGMENT||t.getRootNode().nodeName===Dn.FRAGMENT}var Xa=1,Ha="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},Wa=Date.now(),qa={},Za=Date.now(),Ka=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Za,r=n>16?0:16-n,i=Xa++;return qa[i]=t,Object.keys(qa).length>1||setTimeout((function(){Za=e;var t=qa;qa={},Object.keys(t).forEach((function(e){return t[e](Ha.performance&&"function"==typeof Ha.performance.now?Ha.performance.now():Date.now()-Wa)}))}),r),i},$a=function(t){delete qa[t]},Qa=function(t){return"string"!=typeof t?Ka:""===t?Ha.requestAnimationFrame:Ha["".concat(t,"RequestAnimationFrame")]},Ja=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Qa(t)})),to=Qa(Ja),eo=function(t){return"string"!=typeof t?$a:""===t?Ha.cancelAnimationFrame:Ha["".concat(t,"CancelAnimationFrame")]||Ha["".concat(t,"CancelRequestAnimationFrame")]}(Ja);Ha.requestAnimationFrame=to,Ha.cancelAnimationFrame=eo;var no=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),ro=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Rn(An().mark((function t(){var e,n,r,i,a=arguments;return An().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(r>=this.callbacks.length-1){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),io=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),ao=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=this.callbacks[0].apply(void 0,arguments),i=0;this.callbacks.length-1>i;i++){r=(0,this.callbacks[i])(r)}return r}return null}}])}(),oo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],so=/([\"\'])[^\'\"]+\1/;function uo(t,e,n){return S(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var lo=M(),co=M(),ho={scale:function(t){F(lo,[t[0].value,t[1].value,1])},scaleX:function(t){F(lo,[t[0].value,1,1])},scaleY:function(t){F(lo,[1,t[0].value,1])},scaleZ:function(t){F(lo,[1,1,t[0].value])},scale3d:function(t){F(lo,[t[0].value,t[1].value,t[2].value])},translate:function(t){D(lo,[t[0].value,t[1].value,0])},translateX:function(t){D(lo,[t[0].value,0,0])},translateY:function(t){D(lo,[0,t[0].value,0])},translateZ:function(t){D(lo,[0,0,t[0].value])},translate3d:function(t){D(lo,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Y(lo,ir(bi(t[0])))},rotateX:function(t){B(lo,ir(bi(t[0])))},rotateY:function(t){V(lo,ir(bi(t[0])))},rotateZ:function(t){Y(lo,ir(bi(t[0])))},rotate3d:function(t){G(lo,ir(bi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){uo(lo,ir(t[0].value),ir(t[1].value))},skewX:function(t){uo(lo,ir(t[0].value),0)},skewY:function(t){uo(lo,0,ir(t[0].value))},matrix:function(t){P(lo,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){P.apply(et,[lo].concat(h(t.map((function(t){return t.value})))))}},fo=at(1,1,1),vo=nt(),po={translate:function(t,e){Es.sceneGraphService.setLocalScale(t,fo,!1),Es.sceneGraphService.setLocalEulerAngles(t,vo,void 0,void 0,!1),Es.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Es.sceneGraphService.dirtifyLocal(t,t.transformable)}};function mo(t,e){if(t.length){if(1===t.length&&po[t[0].t])return void po[t[0].t](e,t[0].d);for(var n=S(co),r=0;t.length>r;r++){var i=t[r],a=ho[i.t];a&&(a(i.d),tt(n,n,lo))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var yo=function(){return u((function t(){o(this,t),this.parser=na,this.mixer=ha}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ur?[]:n}},{key:"postProcessor",value:function(t){mo(t.parsedStyle.transform,t)}}])}(),go=function(){return u((function t(){o(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Ar.kPixels&&e[1].unit===Ar.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),ko=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=wr.Z_INDEX_CHANGED)}}}])}(),Eo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),xo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),bo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),To=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),Mo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t){if(t.points&&Gt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,h(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,h(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,h(e.map((function(t){return t[1]})))),a=(r-n)/2,o=(Math.max.apply(Math,h(e.map((function(t){return t[1]}))))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),wo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!Yt(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),No=function(){return u((function t(e){o(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,m=t.y,y=void 0===m?0:m;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var g=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(r,t,g.offscreenCanvas);t.metrics=k;var E=k.width/2,x=k.height/2,b=p+E;"center"===a||"middle"===a?b+=s/2-E:"right"!==a&&"end"!==a||(b+=s-2*E);var T=y-x;return"middle"===l?T+=x:"top"===l||"hanging"===l?T+=2*x:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(T+=0),h&&(b+=h),d&&(T+=d),{cx:b,cy:T,hwidth:E,hheight:x}}}])}(),Po=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),So=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}();var Ao=function(){return u((function t(e){o(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Kn,this.page=new Kn,this.canvas=new Kn,this.viewport=new Kn,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(Qn)}}])}(),Co=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).client=new Kn,t.movement=new Kn,t.offset=new Kn,t.global=new Kn,t.screen=new Kn,t}return y(e,t),u(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(Qn)}}])}(Ao),Ro=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return y(e,t),u(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Co),Oo=function(t){function e(){return o(this,e),p(this,e,arguments)}return y(e,t),u(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Co),Lo=function(t){function e(t,n){var r;return o(this,e),(r=p(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return y(e,t),u(e)}(Ao),Io=new WeakMap,_o=function(){return u((function t(){o(this,t),this.emitter=new E}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(Wt(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=It(e)?e:e.handleEvent;var s=It(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(Wt(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=It(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=It(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Lo(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Io.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Io.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Do=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return y(e,t),u(e,[{key:"textContent",get:function(){var t="";this.nodeName===Dn.TEXT&&(t+=this.style.text);var e,n=On(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===Dn.TEXT?r.nodeValue:r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Dn.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(Qn)}},{key:"lookupNamespaceURI",value:function(t){throw Error(Qn)}},{key:"lookupPrefix",value:function(t){throw Error(Qn)}},{key:"normalize",value:function(){throw Error(Qn)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(_o);Do.DOCUMENT_POSITION_DISCONNECTED=1,Do.DOCUMENT_POSITION_PRECEDING=2,Do.DOCUMENT_POSITION_FOLLOWING=4,Do.DOCUMENT_POSITION_CONTAINS=8,Do.DOCUMENT_POSITION_CONTAINED_BY=16,Do.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Fo=function(){return u((function t(e,n){var r=this;o(this,t),this.emitter=new E,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=M(),this.tmpVec3=nt(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=za.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Do.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&r.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>e-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Do.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Do.isNode(a)&&a.parentNode;l&&l!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Do.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Do.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Do.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Do.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new Kn((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new Kn((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=O(this.tmpMatrix,u,s),c=st(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return pt(c,c,l),new Kn(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=O(this.tmpMatrix,n,r),a=st(this.tmpVec3,t.x,t.y,0);pt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new Kn((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Do.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var r=this.nativeHTMLMap.get(n[e]);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Ro);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Oo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Oo);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Ro);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=za.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Do.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ga(e)&&e.getAttribute("cursor");if(n)return n;e=Do.isNode(e)&&e.parentNode}}}])}(),Go=function(){return u((function t(){o(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Es.offscreenCanvas)this.canvas=t||Es.offscreenCanvas,this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Bo=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Vo=function(){return u((function t(e,n){o(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new io,initAsync:new no,dirtycheck:new ao,cull:new ao,beginFrame:new io,beforeRender:new io,render:new io,afterRender:new io,endFrame:new io,destroy:new io,pick:new ro,pickSync:new ao,pointerDown:new io,pointerUp:new io,pointerMove:new io,pointerOut:new io,pointerOver:new io,pointerWheel:new io,pointerCancel:new io,click:new io},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=a(a({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Bo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Bo.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=o?r.hooks.cull.call(s,r.context.camera):s;u&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(u))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l=u.pop();s(l);for(var c=l.sortable.sorted||l.childNodes,h=c.length-1;h>=0;h--)u.push(c[h])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==wr.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);0>r||e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Ba(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Ba)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Bo.DISPLAY_OBJECT_CHANGED)}}])}(),Yo=/\[\s*(.*)=(.*)\s*\]/,Uo=function(){return u((function t(){o(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Yo),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return _t(n)?"":n.toString?""+n:""}}])}(),zo=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),jo=function(t){function e(t,n,r,i,a,s,u,l){var c;return o(this,e),(c=p(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return y(e,t),u(e)}(Ao);function Xo(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}jo.ADDITION=2,jo.MODIFICATION=1,jo.REMOVAL=3;var Ho,Wo,qo,Zo=new jo(zo.REPARENT,null,"","","",0,"",""),Ko=Lt(),$o=nt(),Qo=at(1,1,1),Jo=M(),ts=Lt(),es=nt(),ns=M(),rs=Tt(),is=nt(),as=Tt(),os=nt(),ss=nt(),us=nt(),ls=M(),cs=Tt(),hs=Tt(),fs=Tt(),ds={affectChildren:!0},vs=function(){return u((function t(e){o(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Lo(zo.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===Dn.FRAGMENT,o=ja(e);t.parentNode=e;var s=a?t.childNodes:[t];zt(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var u=e.sortable;if((null!=u&&null!==(r=u.sorted)&&void 0!==r&&r.length||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=wr.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(Zo)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=wr.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=rs;Pt(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);At(fs,a),Nt(fs,fs),wt(r,fs,r),wt(n.localRotation,r,i),Ot(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Pt(hs,e[0],e[1],e[2]),Rt(n.localRotation,n.localRotation,hs),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Pt(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);At(cs,Nt(rs,r)),Rt(n.localRotation,n.localRotation,cs),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Pt(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;mt(e,$o)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,v=r*c-i*l,p=2*n[3];c*=p,h*=p,d*=2,v*=2,t[0]=o+(l*=p)+(f*=2),t[1]=s+c+d,t[2]=u+h+v}(e,e,n.localRotation),ut(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(us[0]=e[0],us[1]=e[1],us[2]=null!==(n=e[2])&&void 0!==n?n:0,!mt(this.getPosition(t),us)){if(ot(r.position,us),null!==t.parentNode&&t.parentNode.transformable)N(ls,t.parentNode.transformable.worldTransform),C(ls,ls),pt(r.localPosition,us,ls);else ot(r.localPosition,us);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ss[0]=e[0],ss[1]=e[1],ss[2]=null!==(n=e[2])&&void 0!==n?n:0,mt(i.localPosition,ss)||(ot(i.localPosition,ss),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=st(es,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtifyLocal(t,o)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;st(es,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),mt(es,i.localScale)||(ot(i.localScale,es),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=st(es,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),mt(e,$o)||(ut(es,this.getPosition(t),e),this.setPosition(t,es))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=St(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);At(rs,o),Nt(rs,rs),wt(a.localRotation,rs,e),Ot(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ct(rs,e,n,r,i));var o=t.transformable;At(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(ts,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){ja(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;r>i;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===Dn.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==Dn.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==Dn.FRAGMENT&&(ds.affectChildren=t,t?e.forEach((function(t){n(t,ds)})):n(e,ds))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Xo(n),n=n.parentNode;e&&t.forEach((function(t){Xo(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new jo(zo.ATTR_MODIFIED,n,e,e,t,jo.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return z(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return X(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return j(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){H(t.localTransform,t.localRotation,t.localPosition,at(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(S(ns),ns[4]=Math.tan(t.localSkew[0]),ns[1]=Math.tan(t.localSkew[1]),O(t.localTransform,t.localTransform,ns));var e=H(ns,Ct(rs,0,0,0,1),st(es,1,1,1),t.localScale,t.origin);O(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?H(n,i,r,a,o):s?D(n,r):S(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=z(is,e),r=X(as,e),i=j(os,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Qo,!1),this.setLocalPosition(t,$o,!1),this.setLocalEulerAngles(t,$o,void 0,void 0,!1),this.setLocalSkew(t,Ko,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!Hn.isEmpty(n)){var r=e||new Hn;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Es.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Hn}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Hn).update(r.center,r.halfExtents))})),a||(a=new Hn),n){var o=Va(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Jo;t.parentNode.transformable&&(e=C(ns,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Hn.isEmpty(n)){var r=new Hn;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Hn.isEmpty(r)||(n=new Hn).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=g(n.getMin(),2),o=a[0],s=a[1],u=g(n.getMax(),2);return new $n(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new $n((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?O(e.worldTransform,r.worldTransform,e.localTransform):N(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),ps={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},ms=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ys=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),gs=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ks=function(){return u((function t(e){var n=this;o(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!gs.exec(e)&&!ys.exec(t))},this.trimByKinsokuShorui=function(t){var e=h(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=ps.MetricsString+ps.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ps.BaselineSymbol).width),u=ps.HeightMultiplier*s;s=s*ps.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==l[d+m]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,m=e.textPath,y=e.leading,g=void 0===y?0:y,k=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,u=void 0===s?"normal":s,l=t.fontWeight,c=void 0===l?"normal":l,h=zt(n)&&"".concat(n,"px")||"16px",f=i.split(","),d=f.length-1;d>=0;d--){var v=f[d].trim();!so.test(v)&&0>oo.indexOf(v)&&(v='"'.concat(v,'"')),f[d]=v}return"".concat(o," ").concat(u," ").concat(c," ").concat(h," ").concat(f.join(","))}(e),E=this.measureFont(k,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var x=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);x.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),T=Array(b.length),M=0;if(!m){for(var w=0;b.length>w;w++){var N=x.measureText(b[w]).width+(b[w].length-1)*p;T[w]=N,M=Math.max(M,N)}var P=M+l,S=s||E.fontSize+l,A=Math.max(S,E.fontSize+l)+(b.length-1)*(S+g),C=0;return"middle"===h?C=-A/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?C=-A:"top"!==h&&"hanging"!==h||(C=0),{font:k,width:P,height:A,lines:b,lineWidths:T,lineHeight:S+=g,maxLineWidth:M,fontProperties:E,lineMetrics:T.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new $n(n-l/2,C+e*S,t+l,S)}))}}m.getTotalLength();for(var R=0;b.length>R;R++)x.measureText(b[R])}},{key:"setGraphemeOnPath",value:function(){}},{key:"wordWrap",value:function(t,e,n){var r=this,i=e.wordWrapWidth,a=void 0===i?0:i,o=e.letterSpacing,s=void 0===o?0:o,u=e.maxLines,l=void 0===u?1/0:u,c=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),f=a+s,d="";"ellipsis"===c?d="...":c&&"clip"!==c&&(d=c);for(var v=[],p=0,m=0,y={},g=function(t){return r.getFromCache(t,s,y,h)},k=Array.from(d).reduce((function(t,e){return t+g(e)}),0),E=Array.from(t),x=0;E.length>x;x++){var b=E[x],T=t[x-1],M=t[x+1],w=g(b);if(this.isNewline(b)){if(++p>=l){e.isOverflowing=!0;break}m=0,v[p]=""}else{if(m>0&&m+w>f){if(p+1>=l){if(e.isOverflowing=!0,k>0&&f>=k){for(var N=v[p].length,P=0,S=N,A=0;N>A;A++){var C=g(v[p][A]);if(P+C+k>f){S=A;break}P+=C}v[p]=(v[p]||"").slice(0,S)+d}break}if(m=0,v[++p]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(v=this.trimToBreakable(v),m=this.sumTextWidthByCache(v[p]||"",y)),this.shouldBreakByKinsokuShorui(b,M)&&(v=this.trimByKinsokuShorui(v),m+=g(T||""))}m+=w,v[p]=(v[p]||"")+b}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ps.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ps.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=h(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!ms.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!ms.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n[t]=i}return i}}])}(),Es={},xs=(Wo=new wo,qo=new Mo,r(r(r(r(r(r(r(r(r(r(Ho={},Dn.FRAGMENT,null),Dn.CIRCLE,new Eo),Dn.ELLIPSE,new xo),Dn.RECT,Wo),Dn.IMAGE,Wo),Dn.GROUP,new Po),Dn.LINE,new bo),Dn.TEXT,new No(Es)),Dn.POLYLINE,qo),Dn.POLYGON,qo),r(r(r(Ho,Dn.PATH,new To),Dn.HTML,new So),Dn.MESH,null)),bs=function(t){var e=new Ea,n=new Ta;return r(r(r(r(r(r(r(r(r(r(t={},Pr.PERCENTAGE,null),Pr.NUMBER,new Pa),Pr.ANGLE,new ga),Pr.DEFINED_PATH,new ka),Pr.PAINT,e),Pr.COLOR,e),Pr.FILTER,new xa),Pr.LENGTH,n),Pr.LENGTH_PERCENTAGE,n),Pr.LENGTH_PERCENTAGE_12,new Ma),r(r(r(r(r(r(r(r(r(r(t,Pr.LENGTH_PERCENTAGE_14,new wa),Pr.COORDINATE,new Ta),Pr.OFFSET_DISTANCE,new Sa),Pr.OPACITY_VALUE,new Aa),Pr.PATH,new Ca),Pr.LIST_OF_POINTS,new Ra),Pr.SHADOW_BLUR,new Oa),Pr.TEXT,new La),Pr.TEXT_TRANSFORM,new Ia),Pr.TRANSFORM,new yo),r(r(r(t,Pr.TRANSFORM_ORIGIN,new go),Pr.Z_INDEX,new ko),Pr.MARKER,new Na)}();Es.CameraContribution=Tr,Es.AnimationTimeline=null,Es.EasingFunction=null,Es.offscreenCanvasCreator=new Go,Es.sceneGraphSelector=new Uo,Es.sceneGraphService=new vs(Es),Es.textService=new ks(Es),Es.geometryUpdaterFactory=xs,Es.CSSPropertySyntaxFactory=bs,Es.styleValueRegistry=new ya(Es),Es.layoutRegistry=null,Es.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Es.enableStyleSyntax=!0,Es.enableSizeAttenuation=!1;var Ts=0;var Ms=new jo(zo.INSERTED,null,"","","",0,"",""),ws=new jo(zo.REMOVED,null,"","","",0,"",""),Ns=new Lo(zo.DESTROY),Ps=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).entity=Ts++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:Mr.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return y(e,t),u(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(Qn)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Es.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(ja(this)||t.nodeName!==Dn.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Ms.relatedNode=this,t.dispatchEvent(Ms)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return ws.relatedNode=this,t.dispatchEvent(ws),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Es.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Es.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Es.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Es.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Es.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Es.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Es.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Es.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Es.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,h(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(Ns),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Es.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Es.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Es.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Es.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Es.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(Qn)}},{key:"getAttributeNode",value:function(t){throw Error(Qn)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(Qn)}},{key:"hasAttributeNS",value:function(t,e){throw Error(Qn)}},{key:"removeAttributeNS",value:function(t,e){throw Error(Qn)}},{key:"removeAttributeNode",value:function(t){throw Error(Qn)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(Qn)}},{key:"setAttributeNode",value:function(t){throw Error(Qn)}},{key:"setAttributeNodeNS",value:function(t){throw Error(Qn)}},{key:"toggleAttribute",value:function(t,e){throw Error(Qn)}}])}(Do);function Ss(t){return!(null==t||!t.nodeName)}var As=Es.globalThis.Proxy?Es.globalThis.Proxy:function(){},Cs=new jo(zo.ATTR_MODIFIED,null,null,null,null,jo.MODIFICATION,null,null),Rs=nt(),Os=Tt(),Ls=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||Dn.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Es.enableStyleSyntax&&(n.style=new As({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return y(e,t),u(e,[{key:"destroy",value:function(){Ie(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var r in n){var i=n[r];Ss(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o}},{key:"initAttributes",value:function(){Es.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];qt(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),Ie(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.renderable,a=this.attributes[t],o=this.parsedStyle[t];Es.styleValueRegistry.processProperties(this,r({},t,e),n),i.dirty=!0;var s,u=this.parsedStyle[t];(this.isConnected&&(Cs.relatedNode=this,Cs.prevValue=a,Cs.newValue=e,Cs.attrName=t,Cs.prevParsedValue=o,Cs.newParsedValue=u,this.isMutationObserved?this.dispatchEvent(Cs):(Cs.target=this,this.ownerDocument.defaultView.dispatchEvent(Cs,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(s=this.attributeChangedCallback)||void 0===s||s.call(this,t,a,e,o,u))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=g(t.getMin(),2),n=e[0],r=e[1],i=g(t.getMax(),2);return new $n(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return Es.sceneGraphService.setOrigin(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return Es.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return Es.sceneGraphService.setPosition(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(t){return Es.sceneGraphService.setLocalPosition(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(t){return Es.sceneGraphService.translate(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(t){return Es.sceneGraphService.translateLocal(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return Es.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Es.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=nr(t,e=e||t,n=n||t,!1)),Es.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=nr(t,e=e||t,n=n||t,!1)),Es.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Es.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Es.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return or(g(lr(Rs,Es.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return or(g(lr(Rs,Es.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Es.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Es.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return _t(e)&&_t(n)?Es.sceneGraphService.rotateLocal(this,0,0,t):Es.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return _t(e)&&_t(n)?Es.sceneGraphService.rotate(this,0,0,t):Es.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Es.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Es.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Es.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Es.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Es.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Es.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Es.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Es.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Es.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Es.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,h(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,h(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=g(z(Rs,e),2),r=n[0],i=n[1],a=g(j(Rs,e),2),o=a[0],s=a[1],u=X(Os,e),l=g(lr(Rs,u),3);return cr(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=g(hr(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=g(hr(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Ps);Ls.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Is=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.CIRCLE},t)])}return y(e,t),u(e)}(Ls);Is.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var _s=["style"],Ds=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,_s);return o(this,e),(t=p(this,e,[a({style:r},i)])).isCustomElement=!0,t}return y(e,t),u(e)}(Ls),Fs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.ELLIPSE},t)])}return y(e,t),u(e)}(Ls);Fs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Gs=function(t){function e(){return o(this,e),p(this,e,[{type:Dn.FRAGMENT}])}return y(e,t),u(e)}(Ls),Bs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.GROUP},t)])}return y(e,t),u(e)}(Ls);Bs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["width","height"]));var Vs=["style"],Ys=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,Vs);return o(this,e),(t=p(this,e,[a({type:Dn.HTML,style:r},i)])).cullable.enable=!1,t}return y(e,t),u(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=C(M(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Hn.isEmpty(e)){var n=new Hn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ls);Ys.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Us=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.IMAGE},t)])}return y(e,t),u(e)}(Ls);Us.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var zs=["style"],js=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,zs);o(this,e),(t=p(this,e,[a({type:Dn.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&Ss(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),l&&Ss(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ss(r)&&(this.markerStartAngle=0,r.remove()),i&&Ss(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Ss(r)&&(this.markerEndAngle=0,r.remove()),i&&Ss(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&Ss(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=xn(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=pt(nt(),at(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Kn(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return En(t.x1,t.y1,t.x2,t.y2)}}])}(Ls);js.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Xs=["style"],Hs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,Xs);o(this,e),(t=p(this,e,[a({type:Dn.PATH,style:r,initialParsedStyle:{miterLimit:4,d:a({},Nr)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Ss(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Ss(c)&&t.placeMarkerMid(c),l&&Ss(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ss(r)&&(this.markerStartAngle=0,r.remove()),i&&Ss(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Ss(r)&&(this.markerEndAngle=0,r.remove()),i&&Ss(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&Ss(i)){var a,o,s,u,l,c,h;if(t){var f=g(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=g(this.getEndTangent(),2),m=p[0],y=p[1];u=y[0],l=y[1],o=m[0]-y[0],s=m[1]-y[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Ss(t))for(var n=1;e.length-1>n;n++){var r=g(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Oi(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Ae(t,e,Zt(Zt({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=pt(nt(),at(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Kn(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Oi(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Ls);Hs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ws=["style"],qs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,Ws);o(this,e),(t=p(this,e,[a({type:Dn.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Ss(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Ss(c)&&t.placeMarkerMid(c),l&&Ss(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ss(r)&&(this.markerStartAngle=0,r.remove()),i&&Ss(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Ss(r)&&(this.markerEndAngle=0,r.remove()),i&&Ss(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&Ss(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Ss(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Ls);qs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Zs=["style"],Ks=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Ln(t,Zs);return o(this,e),p(this,e,[a({type:Dn.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return y(e,t),u(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=wn(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=En(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))})),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)}));var c=xn(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=pt(nt(),at(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new Kn(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(qs);Ks.PARSED_STYLE_LIST=new Set([].concat(h(qs.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var $s=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.RECT},t)])}return y(e,t),u(e)}(Ls);$s.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Qs=["style"],Js=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Ln(t,Qs);return o(this,e),p(this,e,[a({type:Dn.TEXT,style:a({fill:"black"},n)},r)])}return y(e,t),u(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ls);Js.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var tu=function(){return u((function t(){o(this,t),this.registry={},this.define(Dn.CIRCLE,Is),this.define(Dn.ELLIPSE,Fs),this.define(Dn.RECT,$s),this.define(Dn.IMAGE,Us),this.define(Dn.LINE,js),this.define(Dn.GROUP,Bs),this.define(Dn.PATH,Hs),this.define(Dn.POLYGON,qs),this.define(Dn.POLYLINE,Ks),this.define(Dn.TEXT,Js),this.define(Dn.HTML,Ys)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),eu={number:function(t){return new jr(t)},percent:function(t){return new jr(t,"%")},px:function(t){return new jr(t,"px")},em:function(t){return new jr(t,"em")},rem:function(t){return new jr(t,"rem")},deg:function(t){return new jr(t,"deg")},grad:function(t){return new jr(t,"grad")},rad:function(t){return new jr(t,"rad")},turn:function(t){return new jr(t,"turn")},s:function(t){return new jr(t,"s")},ms:function(t){return new jr(t,"ms")},registerProperty:function(t){Es.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Es.layoutRegistry.registerLayout(t,e)}},nu=function(t){function e(){var t;o(this,e),(t=p(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Es.AnimationTimeline(t)}catch(t){}var n={};return va.forEach((function(t){var e=t.d;t.inh&&e&&(n[t.n]=It(e)?e(Dn.GROUP):e)})),t.documentElement=new Bs({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return y(e,t),u(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Js:Bs);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(Qn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=Rn(An().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return An().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=Rn(An().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return An().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Jn)}},{key:"insertBefore",value:function(t,e){throw Error(Jn)}},{key:"removeChild",value:function(t,e){throw Error(Jn)}},{key:"replaceChild",value:function(t,e,n){throw Error(Jn)}},{key:"append",value:function(){throw Error(Jn)}},{key:"prepend",value:function(){throw Error(Jn)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Do),ru=function(){function t(e){o(this,t),this.strategies=e}return u(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return e.visible=0===a.length?i.unculledEntities.indexOf(t.entity)>-1:a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Lo(zo.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();ru.tag="Culling";var iu=function(){function t(){var e=this;o(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Ro(null),this.rootWheelEvent=new Oo(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=On(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=On(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return u(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=On(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=On(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=On(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Ua[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=za.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];qt(i.button)&&(i.button=0),qt(i.buttons)&&(i.buttons=1),qt(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),qt(i.width)&&(i.width=i.radiusX||1),qt(i.height)&&(i.height=i.radiusY||1),qt(i.tiltX)&&(i.tiltX=0),qt(i.tiltY)&&(i.tiltY=0),qt(i.pointerType)&&(i.pointerType="touch"),qt(i.pointerId)&&(i.pointerId=i.identifier||0),qt(i.pressure)&&(i.pressure=i.force||.5),qt(i.twist)&&(i.twist=0),qt(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;qt(a.isPrimary)&&(a.isPrimary=!0),qt(a.width)&&(a.width=1),qt(a.height)&&(a.height=1),qt(a.tiltX)&&(a.tiltX=0),qt(a.tiltY)&&(a.tiltY=0),qt(a.pointerType)&&(a.pointerType="mouse"),qt(a.pointerId)&&(a.pointerId=1),qt(a.pressure)&&(a.pressure=.5),qt(a.twist)&&(a.twist=0),qt(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();iu.tag="Event";var au=[Dn.CIRCLE,Dn.ELLIPSE,Dn.IMAGE,Dn.RECT,Dn.LINE,Dn.POLYLINE,Dn.POLYGON,Dn.TEXT,Dn.PATH,Dn.HTML],ou=function(){return u((function t(){o(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Hn.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||qn.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==qn.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===qn.OUTSIDE||n===qn.INSIDE)return n;for(var i=qn.INSIDE,a=au.indexOf(t.nodeName)>-1,o=0,s=r.length;s>o;++o){var u=1<<o;if(0!=(n&u)&&(!a||4!==o&&5!==o)){var l=r[o],c=l.normal,h=l.distance;if(0>ft(c,e.getPositiveFarPoint(r[o]))+h)return qn.OUTSIDE;0>ft(c,e.getNegativeFarPoint(r[o]))+h&&(i|=u)}}return i}}])}(),su=function(){function t(){o(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return u(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){Es.enableSizeAttenuation&&Es.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),Es.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){a.addEventListener(zo.MOUNTED,u),a.addEventListener(zo.UNMOUNTED,l),a.addEventListener(zo.ATTR_MODIFIED,o),a.addEventListener(zo.BOUNDS_CHANGED,s)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(zo.MOUNTED,u),a.removeEventListener(zo.UNMOUNTED,l),a.removeEventListener(zo.ATTR_MODIFIED,o),a.removeEventListener(zo.BOUNDS_CHANGED,s),r.syncTasks.clear()}));var c=null!==(n=Es.globalThis.requestIdleCallback)&&void 0!==n?n:to.bind(Es.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,c((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Hn),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=g(r.getMin(),2),o=a[0],s=a[1],u=g(r.getMax(),2),l=u[0],c=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=c}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();su.tag="Prepare";var uu=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),lu=new Lo(zo.MOUNTED),cu=new Lo(zo.UNMOUNTED),hu=new Lo(uu.BEFORE_RENDER),fu=new Lo(uu.RERENDER),du=new Lo(uu.AFTER_RENDER),vu=function(t){function e(t){var n;o(this,e),(n=p(this,e)).Element=Ls,n.inited=!1,n.context={},n.document=new nu,n.document.defaultView=n,n.customElements=new tu;var r=t.container,i=t.canvas,a=t.offscreenCanvas,s=t.width,u=t.height,l=t.devicePixelRatio,c=t.renderer,h=t.background,f=t.cursor,d=t.document,v=t.requestAnimationFrame,m=t.cancelAnimationFrame,y=t.createImage,g=t.enableLargeImageOptimization,k=t.supportsPointerEvents,E=t.supportsTouchEvents,x=t.supportsCSSTransform,b=t.cleanUpOnDestroy,T=void 0===b||b,M=t.useNativeClickEvent,w=t.alwaysTriggerPointerEventOnCanvas,N=t.isTouchEvent,P=t.isMouseEvent,S=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||Da(r,n,T);var A=s,C=u,R=l;return i&&(R=1>(R=l||Fa&&window.devicePixelRatio||1)?1:Math.ceil(R),A=s||function(t){var e=Ya(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/R,C=u||function(t){var e=Ya(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/R),a&&(Es.offscreenCanvas=a),n.devicePixelRatio=R,n.requestAnimationFrame=null!=v?v:to.bind(Es.globalThis),n.cancelAnimationFrame=null!=m?m:eo.bind(Es.globalThis),n.supportsTouchEvents=null!=E?E:"ontouchstart"in Es.globalThis,n.supportsPointerEvents=null!=k?k:!!Es.globalThis.PointerEvent,n.isTouchEvent=null!=N?N:function(t){return n.supportsTouchEvents&&t instanceof Es.globalThis.TouchEvent},n.isMouseEvent=null!=P?P:function(t){return!Es.globalThis.MouseEvent||t instanceof Es.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Es.globalThis.PointerEvent))},n.dblClickSpeed=null!=S?S:200,n.initRenderingContext({container:r,canvas:i,width:A,height:C,renderer:c,offscreenCanvas:a,devicePixelRatio:R,cursor:f||"default",background:h||"transparent",createImage:y,enableLargeImageOptimization:g,document:d,supportsCSSTransform:x,useNativeClickEvent:M,cleanUpOnDestroy:T,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(A,C,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return y(e,t),u(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Es.CameraContribution;i.clipSpaceNearZ=n,i.setType(gr.EXPLORING,kr.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(xr.UPDATED,(function(){r.context.renderingContext.renderReasons.add(Bo.CAMERA_CHANGED),Es.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){Es.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;void 0===e&&(e=this.getConfig().fastCleanExistingCanvas),e||this.dispatchEvent(new Lo(uu.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new Lo(uu.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(lu),r(cu),r(hu),r(fu),r(du),r(Cs),r(Ms),r(ws),r(Ns)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Er.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Lo(uu.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(hu.detail=t,du.detail=t),this.dispatchEvent(hu),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(fu)})),this.dispatchEvent(du)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new _n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new iu,new su,new ru([new ou])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(a(a({},Es),this.context)),this.context.renderingService=new Vo(Es,this.context),this.context.eventService=new Fo(Es,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new Lo(uu.READY))})):e.dispatchEvent(new Lo(uu.READY)):e.dispatchEvent(new Lo(uu.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Es)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),h((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(Es)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(cu):(cu.target=t,this.dispatchEvent(cu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ja(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(lu):(lu.target=t,this.dispatchEvent(lu,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(_o),pu=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).landmarks=[],t}return y(e,t),u(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=tr(e),this.relAzimuth=tr(t),this.relRoll=tr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===gr.EXPLORING){var r=Mt(Tt(),[1,0,0],ir((this.rotateWorld?1:-1)*this.relElevation)),i=Mt(Tt(),[0,1,0],ir((this.rotateWorld?1:-1)*this.relAzimuth)),a=Mt(Tt(),[0,0,1],ir(this.relRoll)),o=wt(Tt(),i,r);o=wt(Tt(),o,a);var s=W(M(),o);L(this.matrix,this.matrix,[0,0,-this.distance]),O(this.matrix,this.matrix,s),L(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=nr(t,e,0),r=rt(this.position);return ut(r,r,ct(nt(),this.right,n[0])),ut(r,r,ct(nt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e,n=this.forward,r=rt(this.position);return r[0]+=(e=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*n[0],r[1]+=e*n[1],r[2]+=e*n[2],this._setPosition(r),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getDistance():this.type===gr.TRACKING&&ut(this.focalPoint,r,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,u=a.focalPoint,l=void 0===u?this.focalPoint:u,c=a.roll,h=a.zoom,f=new Es.CameraContribution;f.setType(this.type,void 0),f.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),f.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),f.setRoll(null!=c?c:this.roll),f.setZoom(null!=h?h:this.zoom);var d={name:t,matrix:w(f.getWorldTransform()),right:rt(f.right),up:rt(f.up),forward:rt(f.forward),position:rt(f.getPosition()),focalPoint:rt(f.getFocalPoint()),distanceVector:rt(f.getDistanceVector()),distance:f.getDistance(),dollyingStep:f.getDollyingStep(),azimuth:f.getAzimuth(),elevation:f.getElevation(),roll:f.getRoll(),relAzimuth:f.relAzimuth,relElevation:f.relElevation,relRoll:f.relRoll,zoom:f.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Yt(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=zt(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,u=void 0===s?100:s,l=i.easingFunction,c=void 0===l?void 0:l,h=i.onfinish,f=void 0===h?void 0:h,d=i.onframe,v=void 0===d?void 0:d;this.cancelLandmarkAnimation();var p,m=r.position,y=r.focalPoint,g=r.zoom,k=r.roll,E=c||Es.EasingFunction(o),x=function(){e.setFocalPoint(y),e.setPosition(m),e.setRoll(k),e.setZoom(g),e.computeMatrix(),e.triggerUpdate(),null==f||f()};if(0===u)return x();var b=function(t){void 0===p&&(p=t);var n=t-p;if(u>n){var r,i,a=E(n/u),o=nt(),s=nt();if(vt(o,e.focalPoint,y,a),vt(s,e.position,m,a),i=e.roll*(1-a)+k*a,r=e.zoom*(1-a)+g*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),.01>=gt(o,y)+gt(s,m)&&void 0===g&&void 0===k)return x();e.computeMatrix(),e.triggerUpdate(),u>n&&(null==v||v(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(b))}else x()};this.canvas.requestAnimationFrame(b)}}}])}(Tr);Es.CameraContribution=pu;
|
|
17
|
+
*/function pn(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function mn(t,e){var n=Math.min.apply(Math,h(t)),r=Math.min.apply(Math,h(e));return{x:n,y:r,width:Math.max.apply(Math,h(t))-n,height:Math.max.apply(Math,h(e))-r}}function yn(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function gn(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function kn(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=yn(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,g=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var E=p+k;o>a?E>a&&o>E&&g.push(E):E>o&&a>E&&g.push(E)}for(var x=0;g.length>x;x++){var b=gn(0,e,n,r,i,g[x]);m>b&&(m=b),b>y&&(y=b)}return{x:u,y:m,width:l-u,height:y-m}}function En(t,e,n,r){return pn(t,e,n,r)}function xn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function bn(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Tn(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(Xt(s,0))Xt(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;Xt(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function Mn(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=Tn(t,n,i,o),h=Tn(e,r,a,s),f=0;c.length>f;f++)u.push(bn(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(bn(e,r,a,s,h[d]));return mn(u,l)}function wn(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=pn(r[0],r[1],i[0],i[1])}return e}(t)}function Nn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Pn(t,e,n){var r=t+n-2*e;if(Xt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Sn(t,e,n,r,i,a){var o=Pn(t,n,i)[0],s=Pn(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(Nn(t,n,i,o)),void 0!==s&&l.push(Nn(e,r,a,s)),mn(u,l)}function An(){An=function(){return n};var t,n={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=Object.create((e&&e.prototype instanceof g?e:g).prototype),o=new R(r||[]);return a(i,"_invoke",{value:P(t,n,o)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var d="suspendedStart",v="suspendedYield",p="executing",m="completed",y={};function g(){}function k(){}function E(){}var x={};c(x,s,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(O([])));T&&T!==r&&i.call(T,s)&&(x=T);var M=E.prototype=g.prototype=Object.create(x);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,n){function r(a,o,s,u){var l=f(t[a],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==e(h)&&i.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new n((function(n,i){r(t,e,n,i)}))}return o=o?o.then(i,i):i()}})}function P(e,n,r){var i=d;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=S(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?m:v,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=m,r.method="throw",r.arg=l.arg)}}}function S(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function O(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var a=-1,o=function e(){for(;++a<n.length;)if(i.call(n,a))return e.value=n[a],e.done=!1,e;return e.value=t,e.done=!0,e};return o.next=o}}throw new TypeError(e(n)+" is not iterable")}return k.prototype=E,a(M,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:k,configurable:!0}),k.displayName=c(E,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},n.awrap=function(t){return{__await:t}},w(N.prototype),c(N.prototype,u,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,r,i,a){void 0===a&&(a=Promise);var o=new N(h(t,e,r,i),a);return n.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},w(M),c(M,l,"Generator"),c(M,s,(function(){return this})),c(M,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=O,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var u=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(u&&l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&i.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var a=r;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}function Cn(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Rn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){Cn(a,r,i,o,s,"next",t)}function s(t){Cn(a,r,i,o,s,"throw",t)}o(void 0)}))}}function On(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ln(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)e.includes(n=a[r])||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}_e(Fe,Je,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$e,formatHex:$e,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return cn(this).formatHsl()},formatRgb:Qe,toString:Qe}),_e(nn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Fe||(i=Je(i)),i?new nn((i=i.rgb()).r,i.g,i.b,i.opacity):new nn):new nn(t,e,n,null==r?1:r);var i}),De(Fe,{brighter(t){return new nn(this.r*(t=null==t?Be:Math.pow(Be,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new nn(this.r*(t=null==t?Ge:Math.pow(Ge,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new nn(sn(this.r),sn(this.g),sn(this.b),on(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:rn,formatHex:rn,formatHex8:function(){return`#${un(this.r)}${un(this.g)}${un(this.b)}${un(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:an,toString:an})),_e(hn,(function(t,e,n,r){return 1===arguments.length?cn(t):new hn(t,e,n,null==r?1:r)}),De(Fe,{brighter(t){return new hn(this.h,this.s,this.l*(t=null==t?Be:Math.pow(Be,t)),this.opacity)},darker(t){return new hn(this.h,this.s,this.l*(t=null==t?Ge:Math.pow(Ge,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new nn(vn(240>t?t+120:t-240,r,n),vn(t,r,n),vn(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new hn(fn(this.h),dn(this.s),dn(this.l),on(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=on(this.opacity);return`${1===t?"hsl(":"hsla("}${fn(this.h)}, ${100*dn(this.s)}%, ${100*dn(this.l)}%${1===t?")":`, ${t})`}`}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var In={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(a,Math.floor(r+(s-u)*c/s+h)),o)}var f=t[r],d=i,v=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);v>d;){for(n(t,d,v),d++,v--;0>o(t[d],f);)d++;for(;o(t[v],f)>0;)v--}0===o(t[i],f)?n(t,i,v):n(t,++v,a),v>r||(i=v+1),r>v||(a=v-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;n>a;a++){var o=t.children[a];u(i,t.leaf?r(o):o)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function v(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function p(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,a){for(var o=[n,r];o.length;)if((r=o.pop())-(n=o.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;e.children.length>a;a++){var o=e.children[a],s=e.leaf?r(o):o;m(t,s)&&(e.leaf?n.push(o):p(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(m(t,a)){if(e.leaf||p(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),u=[],l=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),o.leaf){var c=a(t,o.children,e);if(-1!==c)return o.children.splice(c,1),u.push(o),this._condense(u),this}i||o.leaf||!p(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(u.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(s>=a)return o(i=y(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(a/Math.pow(s,(r=Math.ceil(Math.log(a)/Math.log(s)))-1))),(i=y([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));g(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);g(t,c,h,u,this.compareMinY);for(var f=c;h>=f;f+=u)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=d(t,u)-l;a>c?(a=c,i=i>l?l:i,o=u):c===a&&i>l&&(i=l,o=u)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),u(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=y(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;n-e>=o;o++){var u=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),c=v(u,l),f=h(u)+h(l);i>c?(i=c,r=o,a=a>f?f:a):c===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>a&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=f(a)+f(o),c=e;n-e>c;c++){var h=t.children[c];u(a,t.leaf?i(h):h),l+=f(a)}for(var d=n-e-1;d>=e;d--){var v=t.children[d];u(o,t.leaf?i(v):v),l+=f(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}(In);var _n=In.exports,Dn=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),Fn=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),Gn=function(){return u((function t(){o(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))}}])}(),Bn=function(){return u((function t(e){o(this,t),this.clipSpaceNearZ=Fn.NEGATIVE_ONE,this.plugins=[],this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),Vn=ut,Yn=ot,Un=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},zn=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},jn=ct,Xn=yt,Hn=function(){function t(){o(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return u(t,[{key:"update",value:function(t,e){Yn(this.center,t),Yn(this.halfExtents,e),Xn(this.min,this.center,this.halfExtents),Vn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Vn(this.center,e,t),jn(this.center,this.center,.5),Xn(this.halfExtents,e,t),jn(this.halfExtents,this.halfExtents,.5),Yn(this.min,t),Yn(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,v=a-l,p=a+l,m=e.center,y=m[0],g=m[1],k=m[2],E=e.halfExtents,x=E[0],b=E[1],T=E[2],M=y-x,w=y+x,N=g-b,P=g+b,S=k-T,A=k+T;c>M&&(c=M),w>h&&(h=w),f>N&&(f=N),P>d&&(d=P),v>S&&(v=S),A>p&&(p=A),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(v+p),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(p-v),this.min[0]=c,this.min[1]=f,this.min[2]=v,this.max[0]=h,this.max[1]=d,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],v=e[10],p=Math.abs(o),m=Math.abs(s),y=Math.abs(u),g=Math.abs(l),k=Math.abs(c),E=Math.abs(h),x=Math.abs(f),b=Math.abs(d),T=Math.abs(v);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+v*i[2],r[0]=p*a[0]+m*a[1]+y*a[2],r[1]=g*a[0]+k*a[1]+E*a[2],r[2]=x*a[0]+b*a[1]+T*a[2],Xn(this.min,n,r),Vn(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=Un([0,0,0],this.getMin(),e.getMin()),i=zn([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Yn([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Yn([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Wn=function(){return u((function t(e,n){o(this,t),this.distance=e||0,this.normal=n||at(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ft(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/kt(this.normal);ct(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&vt(n,t,e,i),a}}])}(),qn=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Zn=function(){return u((function t(e){if(o(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new Wn)}),[{key:"extractFromVPMatrix",value:function(t){var e=g(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],m=e[14],y=e[15];st(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=y-v,st(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=y+v,st(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=y+p,st(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=y-p,st(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=y-m,st(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Kn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),$n=function(){function t(e,n,r,i){o(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return u(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=xt(e.x,e.y,0,1),i=xt(e.x+e.width,e.y,0,1),a=xt(e.x,e.y+e.height,0,1),o=xt(e.x+e.width,e.y+e.height,0,1),s=Et(),u=Et(),l=Et(),c=Et();bt(s,r,n),bt(u,i,n),bt(l,a,n),bt(c,o,n);var h=Math.min(s[0],u[0],l[0],c[0]),f=Math.min(s[1],u[1],l[1],c[1]);return t.fromRect({x:h,y:f,width:Math.max(s[0],u[0],l[0],c[0])-h,height:Math.max(s[1],u[1],l[1],c[1])-f})}}])}(),Qn="Method not implemented.",Jn="Use document.documentElement instead.";function tr(t){return void 0===t?0:t>360||-360>t?t%360:t}var er=nt();function nr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?r?rt(t):ot(er,t):zt(t)?r?at(t,e,n):st(er,t,e,n):r?at(t[0],t[1]||e,t[2]||n):st(er,t[0],t[1]||e,t[2]||n)}var rr=Math.PI/180;function ir(t){return t*rr}var ar=180/Math.PI;function or(t){return t*ar}function sr(t){return 360*t}var ur=Math.PI/2;function lr(t,e){return 16===e.length?function(t,e){var n,r,i=g(j(nt(),e),3),a=i[0],o=i[1],s=i[2],u=Math.asin(-e[2]/a);return ur>u?u>-ur?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=ur,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-ur,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function cr(t,e,n,r,i){var a,o,s,u,l,c,h,f,d,v,p=Math.cos(t),m=Math.sin(t);return a=r*p,o=i*m,s=0,u=-r*m,l=i*p,c=0,h=e,f=n,d=1,(v=new b(9))[0]=a,v[1]=o,v[2]=s,v[3]=u,v[4]=l,v[5]=c,v[6]=h,v[7]=f,v[8]=d,v}function hr(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var u=1/o;r*=u,i*=u}var l=or(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var fr=M(),dr=M(),vr=Et(),pr=[nt(),nt(),nt()],mr=nt();function yr(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var gr=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),kr=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Er=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),xr={UPDATED:"updated"},br=2e-4,Tr=function(){return u((function t(){o(this,t),this.clipSpaceNearZ=Fn.NEGATIVE_ONE,this.eventEmitter=new E,this.matrix=M(),this.right=at(1,0,0),this.up=at(0,1,0),this.forward=at(0,0,1),this.position=at(0,0,1),this.focalPoint=at(0,0,0),this.distanceVector=at(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=M(),this.projectionMatrixInverse=M(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=gr.EXPLORING,this.trackingMode=kr.DEFAULT,this.projectionMode=Er.PERSPECTIVE,this.frustum=new Zn,this.orthoMatrix=M()}),[{key:"isOrtho",value:function(){return this.projectionMode===Er.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.setWorldRotation(this.type===gr.EXPLORING),this._getAngles(),this.type===gr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==gr.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return C(M(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=D(M(),[t,e,0]);this.jitteredProjectionMatrix=O(M(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Er.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Er.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Er.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Er.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Er.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Er.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=at(o.x-r,o.y-i,0),u=ft(s,this.right)/it(this.right),l=ft(s,this.up)/it(this.up),c=g(this.getPosition(),2),h=c[0],f=c[1],d=g(this.getFocalPoint(),2),v=d[0],p=d[1];return this.setPosition(h-u,f-l),this.setFocalPoint(v-u,p-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=Er.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(ir(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,u=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*s/l,a-=this.view.offsetY*o/c,s*=this.view.width/l,o*=this.view.height/c}return function(t,e,n,r,i,a,o){var s,u,l=2*a,c=n-e,h=r-i,f=l/h,d=(n+e)/c,v=(r+i)/h,p=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/p,u=-m/p):(s=-(o+a)/p,u=-2*m/p),t[0]=l/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=v,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0}(this.projectionMatrix,u,u+s,a-o,a,t,this.far,this.clipSpaceNearZ===Fn.ZERO),C(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=Er.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=l-s,f=l+s,d=c+u,v=c-u;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(h+=p*this.view.offsetX)+p*this.view.width,v=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===Fn.NEGATIVE_ONE?K(this.projectionMatrix,h,f,d,v,i,a):$(this.projectionMatrix,h,f,d,v,i,a),C(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=at(0,1,0);if(this.focalPoint=nr(t,e,n),this.trackingMode===kr.CINEMATIC){var i=lt(nt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=it(i),o=or(Math.asin(e/a)),s=90+or(Math.atan2(n,t)),u=M();_(u,u,ir(s)),I(u,u,ir(o)),r=pt(nt(),[0,1,0],u)}return C(this.matrix,Q(M(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||0>t)return this;this.distance=t,br>this.distance&&(this.distance=br),this.dollyingStep=this.distance/100;var e=nt(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=tr(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=tr(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=tr(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Mt(Tt(),[0,0,1],ir(this.roll));S(this.matrix);var e=Mt(Tt(),[1,0,0],ir((this.rotateWorld&&this.type!==gr.TRACKING||this.type===gr.TRACKING?1:-1)*this.elevation)),n=Mt(Tt(),[0,1,0],ir((this.rotateWorld&&this.type!==gr.TRACKING||this.type===gr.TRACKING?1:-1)*this.azimuth)),r=wt(Tt(),n,e);r=wt(Tt(),r,t);var i=W(M(),r);this.type===gr.ORBITING||this.type===gr.EXPLORING?(L(this.matrix,this.matrix,this.focalPoint),O(this.matrix,this.matrix,i),L(this.matrix,this.matrix,[0,0,this.distance])):this.type===gr.TRACKING&&(L(this.matrix,this.matrix,this.position),O(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=nr(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ot(this.right,nr(bt(Et(),[1,0,0,0],this.matrix))),ot(this.up,nr(bt(Et(),[0,1,0,0],this.matrix))),ot(this.forward,nr(bt(Et(),[0,0,1,0],this.matrix))),ht(this.right,this.right),ht(this.up,this.up),ht(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=it(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===gr.TRACKING||this.rotateWorld?(this.elevation=or(Math.asin(e/r)),this.azimuth=or(Math.atan2(-t,-n))):(this.elevation=-or(Math.asin(e/r)),this.azimuth=-or(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ot(this.position,nr(bt(Et(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=T(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ut(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=lt(nt(),this.focalPoint,this.position),this.distance=it(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Er.ORTHOGRAPHIC){var t=this.position,e=Mt(Tt(),[0,0,1],-this.roll*Math.PI/180);H(this.orthoMatrix,e,at((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),at(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=O(M(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(xr.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(Qn)}},{key:"pan",value:function(t,e){throw Error(Qn)}},{key:"dolly",value:function(t){throw Error(Qn)}},{key:"createLandmark",value:function(t,e){throw Error(Qn)}},{key:"gotoLandmark",value:function(t,e){throw Error(Qn)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(Qn)}}])}(),Mr=function(t){return t[t.Standard=0]="Standard",t}({}),wr=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Nr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new $n(0,0,0,0)},Pr=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function Sr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(Sr.Cache||Map),n}Sr.Cache=Map;var Ar=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Cr=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Rr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Or=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Lr=[{name:"em",unit_type:Ar.kEms},{name:"px",unit_type:Ar.kPixels},{name:"deg",unit_type:Ar.kDegrees},{name:"rad",unit_type:Ar.kRadians},{name:"grad",unit_type:Ar.kGradians},{name:"ms",unit_type:Ar.kMilliseconds},{name:"s",unit_type:Ar.kSeconds},{name:"rem",unit_type:Ar.kRems},{name:"turn",unit_type:Ar.kTurns}],Ir=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),_r=function(t){return t?"number"===t?Ar.kNumber:"percent"===t||"%"===t?Ar.kPercentage:function(t){return Lr.find((function(e){return e.name===t})).unit_type}(t):Ar.kUnknown},Dr=function(t){var e=1;switch(t){case Ar.kPixels:case Ar.kDegrees:case Ar.kSeconds:break;case Ar.kMilliseconds:e=.001;break;case Ar.kRadians:e=180/Math.PI;break;case Ar.kGradians:e=.9;break;case Ar.kTurns:e=360}return e},Fr=function(t){switch(t){case Ar.kNumber:case Ar.kInteger:return"";case Ar.kPercentage:return"%";case Ar.kEms:return"em";case Ar.kRems:return"rem";case Ar.kPixels:return"px";case Ar.kDegrees:return"deg";case Ar.kRadians:return"rad";case Ar.kGradians:return"grad";case Ar.kMilliseconds:return"ms";case Ar.kSeconds:return"s";case Ar.kTurns:return"turn"}return""},Gr=function(){return u((function t(){o(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Rr.kNo,Or.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Ir.kUnitType&&this.getType()<=Ir.kClampType}}],[{key:"isAngle",value:function(t){return t===Ar.kDegrees||t===Ar.kRadians||t===Ar.kGradians||t===Ar.kTurns}},{key:"isLength",value:function(t){return t>=Ar.kEms&&Ar.kDegrees>t}},{key:"isRelativeUnit",value:function(t){return t===Ar.kPercentage||t===Ar.kEms||t===Ar.kRems}},{key:"isTime",value:function(t){return t===Ar.kSeconds||t===Ar.kMilliseconds}}])}(),Br=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).colorSpace=t,n}return y(e,t),u(e,[{key:"getType",value:function(){return Ir.kColorType}},{key:"to",value:function(t){return this}}])}(Gr),Vr=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Yr=function(t){function e(t,n){var r;return o(this,e),(r=p(this,e)).type=t,r.value=n,r}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Ir.kColorType}}])}(Gr),Ur=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).value=t,n}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Ir.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Gr),zr=function(t){return function(t){switch(t){case Cr.kUNumber:return Ar.kNumber;case Cr.kULength:return Ar.kPixels;case Cr.kUPercent:return Ar.kPercentage;case Cr.kUTime:return Ar.kSeconds;case Cr.kUAngle:return Ar.kDegrees;default:return Ar.kUnknown}}(function(t){switch(t){case Ar.kNumber:case Ar.kInteger:return Cr.kUNumber;case Ar.kPercentage:return Cr.kUPercent;case Ar.kPixels:return Cr.kULength;case Ar.kMilliseconds:case Ar.kSeconds:return Cr.kUTime;case Ar.kDegrees:case Ar.kRadians:case Ar.kGradians:case Ar.kTurns:return Cr.kUAngle;default:return Cr.kUOther}}(t))},jr=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ar.kNumber;return o(this,e),n=p(this,e),r="string"==typeof i?_r(i):i,n.unit=r,n.value=t,n}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return Ir.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=zr(this.unit);if(n!==zr(t)||n===Ar.kUnknown)return null;var r=Dr(this.unit)/Dr(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case Ar.kUnknown:break;case Ar.kInteger:r=Number(this.value).toFixed(0);break;case Ar.kNumber:case Ar.kPercentage:case Ar.kEms:case Ar.kRems:case Ar.kPixels:case Ar.kDegrees:case Ar.kRadians:case Ar.kGradians:case Ar.kMilliseconds:case Ar.kSeconds:case Ar.kTurns:var i=this.value,a=Fr(this.unit);if(-999999>i||i>999999){var o=Fr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Gr),Xr=new jr(0,"px");new jr(1,"px");var Hr=new jr(0,"deg"),Wr=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o(this,e),(i=p(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=s,i}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Br),qr=new Ur("unset"),Zr={"":qr,unset:qr,initial:new Ur("initial"),inherit:new Ur("inherit")},Kr=new Wr(0,0,0,0,!0),$r=new Wr(0,0,0,0),Qr=Sr((function(t,e,n,r){return new Wr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Jr=function(t){return new jr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ar.kNumber)};function ti(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new jr(50,"%");var ei=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-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/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error("".concat(e,": ").concat(t))}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return a("linear-gradient",t.linearGradient,s)||a("repeating-linear-gradient",t.repeatingLinearGradient,s)||a("radial-gradient",t.radialGradient,u)||a("repeating-radial-gradient",t.repeatingRadialGradient,u)||a("conic-gradient",t.conicGradient,u)}function a(e,r,i){return o(r,(function(r){var a=i();return a&&(k(t.comma)||n("Missing comma before color stops")),{type:e,orientation:a,colorStops:d(v)}}))}function o(e,r){var i=k(e);if(i){k(t.startCall)||n("Missing (");var a=r(i);return k(t.endCall)||n("Missing )"),a}}function s(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,k(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=g("shape",/^(circle)/i,0);t&&(t.style=y()||c());return t}()||function(){var t=g("shape",/^(ellipse)/i,0);t&&(t.style=m()||c());return t}();if(t)t.at=h();else{var e=c();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=f();r&&(t={type:"default-radial",at:r})}}return t}function c(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);k(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function v(){var e=g("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:d(p)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:d(p)}}))||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function p(){return k(t.number)[1]}function m(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||y()}function y(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,n){var r=k(e);if(r)return{type:t,value:r[n]}}function k(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();var ni=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ri=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ii=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ai=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var oi={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},si=Sr((function(t){return Jr("angular"===t.type?Number(t.value):oi[t.value]||0,"deg")})),ui=Sr((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Jr(e,r),cy:Jr(n,i)}})),li=Sr((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return ei(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!_t(u)&&!_t(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(r);var i,a=r.map((function(t){return{offset:Jr(Number(t.length.value),"%"),color:ti(t)}}));if("linear-gradient"===e)return new Yr(Vr.LinearGradient,{angle:n?si(n):Hr,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=ui(n[0].at),u=s.cx,l=s.cy;if(n[0].style){var c=n[0].style,h=c.type,f=c.value;"extent-keyword"===h?(Zr[i=f]||(Zr[i]=new Ur(i)),o=Zr[i]):o=Jr(f,h)}return new Yr(Vr.RadialGradient,{cx:u,cy:l,size:o,steps:a})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=ni.exec(t);if(n){var r,i=(null===(r=n[2].match(ai))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new Yr(Vr.LinearGradient,{angle:Jr(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=g(t,2),n=e[1];return{offset:Jr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===e){var a=function(t){var e=ri.exec(t);if(e){var n,r=(null===(n=e[4].match(ai))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Jr(50,"%"),cy:Jr(50,"%"),steps:r.map((function(t){var e=g(t,2),n=e[1];return{offset:Jr(100*Number(e[0]),"%"),color:n}}))}}return null}(t);if(a){if(!Yt(a))return[new Yr(Vr.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=ii.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function ci(t){return t&&!!t.image}function hi(t){return t&&!_t(t.r)&&!_t(t.g)&&!_t(t.b)}var fi=Sr((function(t){if(ci(t))return a({repetition:"repeat"},t);if(_t(t)&&(t=""),"transparent"===t)return $r;if("currentColor"===t)t="black";else if("none"===t)return Kr;var e=li(t);if(e)return e;var n=Je(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Qr.apply(void 0,r)}));function di(t,e){if(hi(t)&&hi(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Ut(e[n],0,255));return e[3]=Ut(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function vi(t,e){if(_t(e))return Jr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Jr(Number(e),"px");if("deg".search(t)>=0)return Jr(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return Jr(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var pi=function(t){return vi(/px/g,t)},mi=Sr(pi);Sr((function(t){return vi(RegExp("%","g"),t)}));var yi=function(t){return zt(t)||isFinite(Number(t))?Jr(Number(t)||0,"px"):vi(RegExp("px|%|em|rem","g"),t)},gi=Sr(yi),ki=function(t){return vi(/deg|rad|grad|turn/g,t)},Ei=Sr(ki);function xi(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=zr(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=Fr(t.unit)):(jr.isLength(t.unit)||jr.isLength(e.unit))&&(o=Mi(t,i,n),s=Mi(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function bi(t){var e=0;return t.unit===Ar.kDegrees?e=t.value:t.unit===Ar.kRadians?e=or(Number(t.value)):t.unit===Ar.kTurns?e=sr(Number(t.value)):t.value&&(e=t.value),e}function Ti(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):Yt(t)?n=t.split(" ").map((function(t){return Number(t)})):zt(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Mi(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Ar.kPixels)return Number(t.value);if(t.unit===Ar.kPercentage&&n){var i=n.nodeName===Dn.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var wi=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ni(t){return""+t}var Pi=function(t){return Jr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},Si=Sr(Pi);function Ai(t,e){return[t,e,Ni]}function Ci(t,e){return function(n,r){return[n,r,function(n){return Ni(Ut(n,t,e))}]}}function Ri(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Oi(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ae(t.parsedStyle.d.absolutePath,void 0,Zt(Zt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Li(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ii(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((a+o-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(a)*Math.sqrt(o)));if(!s||0===Math.sin(s)||Xt(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function _i(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Sr((function(t){return Yt(t)?t.split(" ").map(Si):t.map(Si)}));var Di=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Fi=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=ir(r=Ht(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),v=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),m=v*(-n*h.x/e),y={x:Math.cos(u)*p-Math.sin(u)*m+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*m+(t.y+o.y)/2},g={x:(h.x-p)/e,y:(h.y-m)/n},k=Di({x:1,y:0},g),E=Di(g,{x:(-h.x-p)/e,y:(-h.y-m)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var x=k+(E%=2*Math.PI)*s,b=e*Math.cos(x),T=n*Math.sin(x);return{x:Math.cos(u)*b-Math.sin(u)*T+y.x,y:Math.sin(u)*b+Math.cos(u)*T+y.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+E,ellipticalArcAngle:x,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Gi(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Fi({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Fi({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function Bi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Vi(t,e){return Bi(t)*Bi(e)?(t[0]*e[0]+t[1]*e[1])/(Bi(t)*Bi(e)):1}function Yi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Vi(t,e))}function Ui(t,e){var n=e[1],r=e[2],i=Ht(ir(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var m=r?p*n*f/r:0,y=n?p*-r*h/n:0,g=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,k=(u+c)/2+Math.sin(i)*m+Math.cos(i)*y,E=[(h-m)/n,(f-y)/r],x=[(-1*h-m)/n,(-1*f-y)/r],b=Yi([1,0],E),T=Yi(E,x);return Vi(E,x)>-1||(T=Math.PI),1>Vi(E,x)||(T=0),0===o&&T>0&&(T-=2*Math.PI),1===o&&0>T&&(T+=2*Math.PI),{cx:g,cy:k,rx:Li(t,[l,c])?0:n,ry:Li(t,[l,c])?0:r,startAngle:b,endAngle:b+T,xRotation:i,arcFlag:a,sweepFlag:o}}function zi(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var ji=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=de(t)}catch(n){e=de(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Li([r[1],r[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=Ui(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Li(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],m=_i(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var y=[u[1],u[2]],g=[u[3],u[4]];c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[y[0]-g[0],y[1]-g[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===l){var k=e[s-1],E=_i(k.currentPoint,d),x=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]]):(c.command="SQ",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]])}else if("A"===l){var b=Gi(c,0),T=b.x,M=b.y,w=Gi(c,1,!1),N=w.x,P=w.y;c.startTangent=[T,M],c.endTangent=[N,P]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Sn(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=Mn(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=kn(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=Vt(n),d=Vt(r),v=Bt(n),p=Bt(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var m=0;i.length>m;m++){var y=i[m],g=y.currentPoint;g[0]===f?f-=Ii(y,e).xExtra:g[0]===v&&(v+=Ii(y,e).xExtra),g[1]===d?d-=Ii(y,e).yExtra:g[1]===p&&(p+=Ii(y,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Xi=Sr(ji);function Hi(t){return Yt(t)?Xi(t):ji(t)}function Wi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ke(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ke(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Oe(r,i));var o,s,u,l,c,h,f,d,v=Ce(a[0])!==Ce(a[1])?(s=(o=a[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Ee(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function qi(t,e){return[t.points,e.points,function(t){return t}]}var Zi=null,Ki=/\s*(\w+)\(([^)]*)\)/g;function $i(t){return function(e){var n=0;return t.map((function(t){return t===Zi?e[n++]:t}))}}function Qi(t){return t}var Ji={matrix:["NNNNNN",[Zi,Zi,0,0,Zi,Zi,0,0,0,0,1,0,Zi,Zi,0,1],Qi],matrix3d:["NNNNNNNNNNNNNNNN",Qi],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",$i([Zi,Zi,new jr(1)]),Qi],scaleX:["N",$i([Zi,new jr(1),new jr(1)]),$i([Zi,new jr(1)])],scaleY:["N",$i([new jr(1),Zi,new jr(1)]),$i([new jr(1),Zi])],scaleZ:["N",$i([new jr(1),new jr(1),Zi])],scale3d:["NNN",Qi],skew:["Aa",null,Qi],skewX:["A",null,$i([Zi,Hr])],skewY:["A",null,$i([Hr,Zi])],translate:["Tt",$i([Zi,Zi,Xr]),Qi],translateX:["T",$i([Zi,Xr,Xr]),$i([Zi,Xr])],translateY:["T",$i([Xr,Zi,Xr]),$i([Xr,Zi])],translateZ:["L",$i([Xr,Xr,Zi])],translate3d:["TTL",Qi]};function ta(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!Ji[a])return[];var s=o.map((function(t){return Jr(t)}));e.push({t:a,d:s})}return e}function ea(t){if(Array.isArray(t))return ta(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Ki.lastIndex=0;e=Ki.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?Hr:Ei(t)},N:Si,T:gi,L:mi}[h.toUpperCase()](c):{a:Hr,n:u[0],t:Xr}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Ki.lastIndex===t.length)return n}return[]}function na(t){if(Array.isArray(t))return ta(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Ki.lastIndex=0;e=Ki.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?Hr:ki(t)},N:Pi,T:yi,L:pi}[h.toUpperCase()](c):{a:Hr,n:u[0],t:Xr}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Ki.lastIndex===t.length)return n}return[]}function ra(t){var e,n,r,i;switch(t.t){case"rotateX":return i=ir(bi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=ir(bi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=ir(bi(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=ir(bi(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=ir(bi(t.d[0])),h=ir(bi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=ir(bi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=ir(bi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Mi(t.d[0],0,null)||0,n=Mi(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Mi(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Mi(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Mi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Mi(t.d[0],0,null)||0,n=Mi(t.d[1],0,null)||0,r=Mi(t.d[2],0,null)||0,1];case"perspective":var f=Mi(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function ia(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function aa(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(fr,t))return!1;if(N(dr,fr),dr[3]=0,dr[7]=0,dr[11]=0,dr[15]=1,1e-8>Math.abs(R(dr)))return!1;var o,s,u=fr[3],l=fr[7],c=fr[11],h=fr[12],f=fr[13],d=fr[14],v=fr[15];if(0!==u||0!==l||0!==c){if(vr[0]=u,vr[1]=l,vr[2]=c,vr[3]=v,!C(dr,dr))return!1;A(dr,dr),bt(i,vr,dr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=pr)[0][0]=(s=fr)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=it(pr[0]),ht(pr[0],pr[0]),r[0]=ft(pr[0],pr[1]),yr(pr[1],pr[1],pr[0],1,-r[0]),n[1]=it(pr[1]),ht(pr[1],pr[1]),r[0]/=n[1],r[1]=ft(pr[0],pr[2]),yr(pr[2],pr[2],pr[0],1,-r[1]),r[2]=ft(pr[1],pr[2]),yr(pr[2],pr[2],pr[1],1,-r[2]),n[2]=it(pr[2]),ht(pr[2],pr[2]),r[1]/=n[2],r[2]/=n[2],dt(mr,pr[1],pr[2]),0>ft(pr[0],mr))for(var p=0;3>p;p++)n[p]*=-1,pr[p][0]*=-1,pr[p][1]*=-1,pr[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+pr[0][0]-pr[1][1]-pr[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-pr[0][0]+pr[1][1]-pr[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-pr[0][0]-pr[1][1]+pr[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+pr[0][0]+pr[1][1]+pr[2][2],0)),pr[2][1]>pr[1][2]&&(a[0]=-a[0]),pr[0][2]>pr[2][0]&&(a[1]=-a[1]),pr[1][0]>pr[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ra).reduce(ia)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var oa=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(m[2][1]=r[2],o=t(o,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],o=t(o,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],o=t(o,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)o[y][g]*=n[y];return 0===(p=o)[0][2]&&0===p[0][3]&&0===p[1][2]&&0===p[1][3]&&0===p[2][0]&&0===p[2][1]&&1===p[2][2]&&0===p[2][3]&&0===p[3][2]&&1===p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function sa(t){return t.toFixed(6).replace(".000000","")}function ua(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=aa(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=aa(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=Ut(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return oa(t[0],t[1],t[2],e,t[4]).map(sa).join(",")}])}function la(t){return t.replace(/[XY]/,"")}function ca(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function ha(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Jr(o):Jr(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=ua(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,v=e[f].t,p=t[f].d,m=e[f].d,y=Ji[d],g=Ji[v],k=void 0;if(s=v,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var E=ua([t[f]],[e[f]]);u.push(E[0]),l.push(E[1]),c.push(["matrix",[E[2]]])}else{if(d===v)k=d;else if(y[2]&&g[2]&&la(d)===la(v))k=la(d),p=y[2](p),m=g[2](m);else{if(!y[1]||!g[1]||ca(d)!==ca(v)){var x=ua(t,e);u=[x[0]],l=[x[1]],c=[["matrix",[x[2]]]];break}k=ca(d),p=y[1](p),m=g[1](m)}for(var b=[],T=[],M=[],w=0;p.length>w;w++){var N=xi(p[w],m[w],n,!1,w);b[w]=N[0],T[w]=N[1],M.push(N[2])}u.push(b),l.push(T),c.push([k,M])}}if(r){var P=u;u=l,l=P}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(n,")")})).join(" ")}]}var fa=Sr((function(t){if(Yt(t)){if("text-anchor"===t)return[Jr(0,"px"),Jr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[gi(da(e[0])),gi(da(e[1]))]}return[Jr(t[0]||0,"px"),Jr(t[1]||0,"px")]}));function da(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var va=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Pr.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Pr.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Pr.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Pr.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Pr.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Pr.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Pr.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Pr.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Pr.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Pr.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Pr.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Pr.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Pr.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Pr.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Pr.FILTER},{n:"clipPath",syntax:Pr.DEFINED_PATH},{n:"textPath",syntax:Pr.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Pr.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Pr.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Pr.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pr.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Pr.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Pr.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Pr.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Pr.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Pr.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Pr.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Pr.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Pr.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Pr.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Pr.NUMBER,d:function(t){return t===Dn.PATH||t===Dn.POLYGON||t===Dn.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Pr.MARKER},{n:"markerEnd",syntax:Pr.MARKER},{n:"markerMid",syntax:Pr.MARKER},{n:"markerStartOffset",syntax:Pr.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Pr.LENGTH,l:!0,int:!0,d:"0"}],pa=new Set(va.filter((function(t){return!!t.l})).map((function(t){return t.n}))),ma={},ya=function(){return u((function t(e){var n=this;o(this,t),this.runtime=e,va.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(h(t.a||[])).forEach((function(e){ma[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){if(!Es.enableMassiveParsedStyleAssignOptimization)return void Object.assign(t.parsedStyle,e);var n=t.constructor.PARSED_STYLE_LIST;for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var o,s=!!n.forceUpdateGeometry;if(!s)for(var u in e)if(pa.has(u)){s=!0;break}e.fill&&(t.parsedStyle.fill=fi(e.fill)),e.stroke&&(t.parsedStyle.stroke=fi(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=fi(e.shadowColor)),e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,wi.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return vi(/deg|rad|grad|turn|px|%/g,t)||fi(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),_t(e.radius)||(t.parsedStyle.radius=Ti(e.radius,4)),_t(e.lineDash)||(t.parsedStyle.lineDash=Ti(e.lineDash,2)),e.points&&(t.parsedStyle.points={points:Yt(o=e.points)?o.split(" ").map((function(t){var e=g(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):o,totalLength:0,segments:[]}),""===e.d&&(t.parsedStyle.d=a({},Nr)),e.d&&(t.parsedStyle.d=Hi(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Pr.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),qt(e.clipPath)||this.runtime.CSSPropertySyntaxFactory[Pr.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Pr.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=ea(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=fa(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Pr.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Pr.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Pr.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),_t(e.zIndex)||this.runtime.CSSPropertySyntaxFactory[Pr.Z_INDEX].postProcessor(t),_t(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[Pr.OFFSET_DISTANCE].postProcessor(t),e.transform&&this.runtime.CSSPropertySyntaxFactory[Pr.TRANSFORM].postProcessor(t),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Pr.TRANSFORM_ORIGIN].postProcessor(t),s&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Hn),r.renderBounds||(r.renderBounds=new Hn);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,u=a.cy,l=void 0===u?0:u,c=a.cz,h=void 0===c?0:c,f=a.hwidth,d=void 0===f?0:f,v=a.hheight,p=void 0===v?0:v,m=a.hdepth,y=void 0===m?0:m,g=[Math.abs(d),Math.abs(p),y],k=i.stroke,E=i.lineWidth,x=void 0===E?1:E,b=i.increasedLineWidthForHitTesting,T=void 0===b?0:b,M=i.shadowType,w=void 0===M?"outer":M,N=i.shadowColor,P=i.filter,S=void 0===P?[]:P,A=i.transformOrigin,C=[s,l,h];if(r.contentBounds.update(C,g),k&&!k.isNone){var R=((x||0)+(T||0))*(e===Dn.POLYLINE||e===Dn.POLYGON||e===Dn.PATH?Math.SQRT2:.5);g[0]+=R,g[1]+=R}if(r.renderBounds.update(C,g),N&&w&&"inner"!==w){var O=r.renderBounds,L=O.min,I=O.max,_=i.shadowBlur||0,D=i.shadowOffsetX||0,F=i.shadowOffsetY||0,G=I[0]+_+D,B=L[1]-_+F,V=I[1]+_+F;L[0]=Math.min(L[0],L[0]-_+D),I[0]=Math.max(I[0],G),L[1]=Math.min(L[1],B),I[1]=Math.max(I[1],V),r.renderBounds.setMinMax(L,I)}S.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ut(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),r.renderBounds.setMinMax(l,c)}})),t.geometry.dirty=!1;var Y=0>p,U=(0>d?-1:1)*(A?Mi(A[0],0,t,!0):0),z=(Y?-1:1)*(A?Mi(A[1],1,t,!0):0);(U||z)&&t.setOrigin(U,z)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===Dn.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Dn.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();var ga=function(){return u((function t(){o(this,t),this.mixer=Ai}),[{key:"calculator",value:function(t,e,n,r){return bi(n)}}])}(),ka=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Ur&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),Ea=function(){return u((function t(){o(this,t),this.parser=fi,this.mixer=di}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ur?"none"===n.value?Kr:$r:n}}])}(),xa=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof Ur?[]:n}}])}();function ba(t){var e=t.parsedStyle.fontSize;return _t(e)?null:e}var Ta=function(){return u((function t(){o(this,t),this.mixer=Ai}),[{key:"calculator",value:function(t,e,n,r,i){if(zt(n))return n;if(!jr.isRelativeUnit(n.unit))return n.value;if(n.unit===Ar.kPercentage)return 0;if(n.unit===Ar.kEms){if(r.parentNode){var a=ba(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===Ar.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=ba(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Ma=function(){return u((function t(){o(this,t),this.mixer=Ri}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),wa=function(){return u((function t(){o(this,t),this.mixer=Ri}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Na=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Ur&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Pa=function(){return u((function t(){o(this,t),this.mixer=Ai}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Sa=function(){return u((function t(){o(this,t),this.mixer=Ci(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===Dn.LINE||r===Dn.PATH||r===Dn.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}])}(),Aa=function(){return u((function t(){o(this,t),this.mixer=Ci(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ca=function(){return u((function t(){o(this,t),this.parser=Hi,this.mixer=Wi}),[{key:"calculator",value:function(t,e,n){return n instanceof Ur&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new $n(0,0,0,0)}:n}}])}(),Ra=u((function t(){o(this,t),this.mixer=qi})),Oa=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).mixer=Ci(0,1/0),t}return y(e,t),u(e)}(Ta),La=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ur?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ia=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),_a=new WeakMap;function Da(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;_a.has(r)&&_a.get(r).destroy(n),_a.set(r,e)}}var Fa="undefined"!=typeof window&&void 0!==window.document;function Ga(t){return!!t.getAttribute}function Ba(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Va(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Ya(t,e){if(Fa)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Ua={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},za="object"==typeof performance&&performance.now?performance:Date;function ja(t){return t.nodeName===Dn.FRAGMENT||t.getRootNode().nodeName===Dn.FRAGMENT}var Xa=1,Ha="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},Wa=Date.now(),qa={},Za=Date.now(),Ka=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Za,r=n>16?0:16-n,i=Xa++;return qa[i]=t,Object.keys(qa).length>1||setTimeout((function(){Za=e;var t=qa;qa={},Object.keys(t).forEach((function(e){return t[e](Ha.performance&&"function"==typeof Ha.performance.now?Ha.performance.now():Date.now()-Wa)}))}),r),i},$a=function(t){delete qa[t]},Qa=function(t){return"string"!=typeof t?Ka:""===t?Ha.requestAnimationFrame:Ha["".concat(t,"RequestAnimationFrame")]},Ja=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Qa(t)})),to=Qa(Ja),eo=function(t){return"string"!=typeof t?$a:""===t?Ha.cancelAnimationFrame:Ha["".concat(t,"CancelAnimationFrame")]||Ha["".concat(t,"CancelRequestAnimationFrame")]}(Ja);Ha.requestAnimationFrame=to,Ha.cancelAnimationFrame=eo;var no=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),ro=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Rn(An().mark((function t(){var e,n,r,i,a=arguments;return An().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(r>=this.callbacks.length-1){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),io=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),ao=function(){return u((function t(){o(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=this.callbacks[0].apply(void 0,arguments),i=0;this.callbacks.length-1>i;i++){r=(0,this.callbacks[i])(r)}return r}return null}}])}(),oo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],so=/([\"\'])[^\'\"]+\1/;function uo(t,e,n){return S(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var lo=M(),co=M(),ho={scale:function(t){F(lo,[t[0].value,t[1].value,1])},scaleX:function(t){F(lo,[t[0].value,1,1])},scaleY:function(t){F(lo,[1,t[0].value,1])},scaleZ:function(t){F(lo,[1,1,t[0].value])},scale3d:function(t){F(lo,[t[0].value,t[1].value,t[2].value])},translate:function(t){D(lo,[t[0].value,t[1].value,0])},translateX:function(t){D(lo,[t[0].value,0,0])},translateY:function(t){D(lo,[0,t[0].value,0])},translateZ:function(t){D(lo,[0,0,t[0].value])},translate3d:function(t){D(lo,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Y(lo,ir(bi(t[0])))},rotateX:function(t){B(lo,ir(bi(t[0])))},rotateY:function(t){V(lo,ir(bi(t[0])))},rotateZ:function(t){Y(lo,ir(bi(t[0])))},rotate3d:function(t){G(lo,ir(bi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){uo(lo,ir(t[0].value),ir(t[1].value))},skewX:function(t){uo(lo,ir(t[0].value),0)},skewY:function(t){uo(lo,0,ir(t[0].value))},matrix:function(t){P(lo,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){P.apply(et,[lo].concat(h(t.map((function(t){return t.value})))))}},fo=at(1,1,1),vo=nt(),po={translate:function(t,e){Es.sceneGraphService.setLocalScale(t,fo,!1),Es.sceneGraphService.setLocalEulerAngles(t,vo,void 0,void 0,!1),Es.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Es.sceneGraphService.dirtifyLocal(t,t.transformable)}};function mo(t,e){if(t.length){if(1===t.length&&po[t[0].t])return void po[t[0].t](e,t[0].d);for(var n=S(co),r=0;t.length>r;r++){var i=t[r],a=ho[i.t];a&&(a(i.d),tt(n,n,lo))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var yo=function(){return u((function t(){o(this,t),this.parser=na,this.mixer=ha}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ur?[]:n}},{key:"postProcessor",value:function(t){mo(t.parsedStyle.transform,t)}}])}(),go=function(){return u((function t(){o(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Ar.kPixels&&e[1].unit===Ar.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),ko=function(){return u((function t(){o(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=wr.Z_INDEX_CHANGED)}}}])}(),Eo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),xo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),bo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),To=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),Mo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t){if(t.points&&Gt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,h(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,h(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,h(e.map((function(t){return t[1]})))),a=(r-n)/2,o=(Math.max.apply(Math,h(e.map((function(t){return t[1]}))))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),wo=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!Yt(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),No=function(){return u((function t(e){o(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,m=t.y,y=void 0===m?0:m;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var g=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(r,t,g.offscreenCanvas);t.metrics=k;var E=k.width/2,x=k.height/2,b=p+E;"center"===a||"middle"===a?b+=s/2-E:"right"!==a&&"end"!==a||(b+=s-2*E);var T=y-x;return"middle"===l?T+=x:"top"===l||"hanging"===l?T+=2*x:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(T+=0),h&&(b+=h),d&&(T+=d),{cx:b,cy:T,hwidth:E,hheight:x}}}])}(),Po=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),So=function(){return u((function t(){o(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}();var Ao=function(){return u((function t(e){o(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Kn,this.page=new Kn,this.canvas=new Kn,this.viewport=new Kn,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(Qn)}}])}(),Co=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).client=new Kn,t.movement=new Kn,t.offset=new Kn,t.global=new Kn,t.screen=new Kn,t}return y(e,t),u(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(Qn)}}])}(Ao),Ro=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return y(e,t),u(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Co),Oo=function(t){function e(){return o(this,e),p(this,e,arguments)}return y(e,t),u(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Co),Lo=function(t){function e(t,n){var r;return o(this,e),(r=p(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return y(e,t),u(e)}(Ao),Io=new WeakMap,_o=function(){return u((function t(){o(this,t),this.emitter=new E}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(Wt(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=It(e)?e:e.handleEvent;var s=It(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(Wt(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=It(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=It(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Lo(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Io.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Io.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Do=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return y(e,t),u(e,[{key:"textContent",get:function(){var t="";this.nodeName===Dn.TEXT&&(t+=this.style.text);var e,n=On(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===Dn.TEXT?r.nodeValue:r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Dn.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(Qn)}},{key:"lookupNamespaceURI",value:function(t){throw Error(Qn)}},{key:"lookupPrefix",value:function(t){throw Error(Qn)}},{key:"normalize",value:function(){throw Error(Qn)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(_o);Do.DOCUMENT_POSITION_DISCONNECTED=1,Do.DOCUMENT_POSITION_PRECEDING=2,Do.DOCUMENT_POSITION_FOLLOWING=4,Do.DOCUMENT_POSITION_CONTAINS=8,Do.DOCUMENT_POSITION_CONTAINED_BY=16,Do.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Fo=function(){return u((function t(e,n){var r=this;o(this,t),this.emitter=new E,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=M(),this.tmpVec3=nt(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=za.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Do.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&r.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>e-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Do.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Do.isNode(a)&&a.parentNode;l&&l!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Do.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Do.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Do.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Do.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Do.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new Kn((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new Kn((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=O(this.tmpMatrix,u,s),c=st(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return pt(c,c,l),new Kn(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=O(this.tmpMatrix,n,r),a=st(this.tmpVec3,t.x,t.y,0);pt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new Kn((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Do.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var r=this.nativeHTMLMap.get(n[e]);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Ro);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Oo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Oo);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Ro);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=za.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Do.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ga(e)&&e.getAttribute("cursor");if(n)return n;e=Do.isNode(e)&&e.parentNode}}}])}(),Go=function(){return u((function t(){o(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Es.offscreenCanvas)this.canvas=t||Es.offscreenCanvas,this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Bo=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Vo=function(){return u((function t(e,n){o(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new io,initAsync:new no,dirtycheck:new ao,cull:new ao,beginFrame:new io,beforeRender:new io,render:new io,afterRender:new io,endFrame:new io,destroy:new io,pick:new ro,pickSync:new ao,pointerDown:new io,pointerUp:new io,pointerMove:new io,pointerOut:new io,pointerOver:new io,pointerWheel:new io,pointerCancel:new io,click:new io},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=a(a({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Bo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Bo.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=o?r.hooks.cull.call(s,r.context.camera):s;u&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(u))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l=u.pop();s(l);for(var c=l.sortable.sorted||l.childNodes,h=c.length-1;h>=0;h--)u.push(c[h])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==wr.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);0>r||e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Ba(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Ba)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Bo.DISPLAY_OBJECT_CHANGED)}}])}(),Yo=/\[\s*(.*)=(.*)\s*\]/,Uo=function(){return u((function t(){o(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Yo),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return _t(n)?"":n.toString?""+n:""}}])}(),zo=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),jo=function(t){function e(t,n,r,i,a,s,u,l){var c;return o(this,e),(c=p(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return y(e,t),u(e)}(Ao);function Xo(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}jo.ADDITION=2,jo.MODIFICATION=1,jo.REMOVAL=3;var Ho,Wo,qo,Zo=new jo(zo.REPARENT,null,"","","",0,"",""),Ko=Lt(),$o=nt(),Qo=at(1,1,1),Jo=M(),ts=Lt(),es=nt(),ns=M(),rs=Tt(),is=nt(),as=Tt(),os=nt(),ss=nt(),us=nt(),ls=M(),cs=Tt(),hs=Tt(),fs=Tt(),ds={affectChildren:!0},vs=function(){return u((function t(e){o(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Lo(zo.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===Dn.FRAGMENT,o=ja(e);t.parentNode=e;var s=a?t.childNodes:[t];zt(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var u=e.sortable;if((null!=u&&null!==(r=u.sorted)&&void 0!==r&&r.length||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=wr.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(Zo)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=wr.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=rs;Pt(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);At(fs,a),Nt(fs,fs),wt(r,fs,r),wt(n.localRotation,r,i),Ot(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Pt(hs,e[0],e[1],e[2]),Rt(n.localRotation,n.localRotation,hs),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Pt(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);At(cs,Nt(rs,r)),Rt(n.localRotation,n.localRotation,cs),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Pt(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;mt(e,$o)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,v=r*c-i*l,p=2*n[3];c*=p,h*=p,d*=2,v*=2,t[0]=o+(l*=p)+(f*=2),t[1]=s+c+d,t[2]=u+h+v}(e,e,n.localRotation),ut(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(us[0]=e[0],us[1]=e[1],us[2]=null!==(n=e[2])&&void 0!==n?n:0,!mt(this.getPosition(t),us)){if(ot(r.position,us),null!==t.parentNode&&t.parentNode.transformable)N(ls,t.parentNode.transformable.worldTransform),C(ls,ls),pt(r.localPosition,us,ls);else ot(r.localPosition,us);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ss[0]=e[0],ss[1]=e[1],ss[2]=null!==(n=e[2])&&void 0!==n?n:0,mt(i.localPosition,ss)||(ot(i.localPosition,ss),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=st(es,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtifyLocal(t,o)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;st(es,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),mt(es,i.localScale)||(ot(i.localScale,es),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=st(es,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),mt(e,$o)||(ut(es,this.getPosition(t),e),this.setPosition(t,es))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=St(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);At(rs,o),Nt(rs,rs),wt(a.localRotation,rs,e),Ot(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ct(rs,e,n,r,i));var o=t.transformable;At(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(ts,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){ja(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;r>i;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===Dn.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==Dn.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==Dn.FRAGMENT&&(ds.affectChildren=t,t?e.forEach((function(t){n(t,ds)})):n(e,ds))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Xo(n),n=n.parentNode;e&&t.forEach((function(t){Xo(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new jo(zo.ATTR_MODIFIED,n,e,e,t,jo.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return z(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return X(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return j(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){H(t.localTransform,t.localRotation,t.localPosition,at(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(S(ns),ns[4]=Math.tan(t.localSkew[0]),ns[1]=Math.tan(t.localSkew[1]),O(t.localTransform,t.localTransform,ns));var e=H(ns,Ct(rs,0,0,0,1),st(es,1,1,1),t.localScale,t.origin);O(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?H(n,i,r,a,o):s?D(n,r):S(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=z(is,e),r=X(as,e),i=j(os,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Qo,!1),this.setLocalPosition(t,$o,!1),this.setLocalEulerAngles(t,$o,void 0,void 0,!1),this.setLocalSkew(t,Ko,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!Hn.isEmpty(n)){var r=e||new Hn;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Es.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Hn}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Hn).update(r.center,r.halfExtents))})),a||(a=new Hn),n){var o=Va(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Jo;t.parentNode.transformable&&(e=C(ns,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Hn.isEmpty(n)){var r=new Hn;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Hn.isEmpty(r)||(n=new Hn).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=g(n.getMin(),2),o=a[0],s=a[1],u=g(n.getMax(),2);return new $n(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new $n((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?O(e.worldTransform,r.worldTransform,e.localTransform):N(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),ps={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},ms=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ys=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),gs=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ks=function(){return u((function t(e){var n=this;o(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!gs.exec(e)&&!ys.exec(t))},this.trimByKinsokuShorui=function(t){var e=h(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=ps.MetricsString+ps.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ps.BaselineSymbol).width),u=ps.HeightMultiplier*s;s=s*ps.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==l[d+m]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,m=e.textPath,y=e.leading,g=void 0===y?0:y,k=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,u=void 0===s?"normal":s,l=t.fontWeight,c=void 0===l?"normal":l,h=zt(n)&&"".concat(n,"px")||"16px",f=i.split(","),d=f.length-1;d>=0;d--){var v=f[d].trim();!so.test(v)&&0>oo.indexOf(v)&&(v='"'.concat(v,'"')),f[d]=v}return"".concat(o," ").concat(u," ").concat(c," ").concat(h," ").concat(f.join(","))}(e),E=this.measureFont(k,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var x=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);x.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),T=Array(b.length),M=0;if(!m){for(var w=0;b.length>w;w++){var N=x.measureText(b[w]).width+(b[w].length-1)*p;T[w]=N,M=Math.max(M,N)}var P=M+l,S=s||E.fontSize+l,A=Math.max(S,E.fontSize+l)+(b.length-1)*(S+g),C=0;return"middle"===h?C=-A/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?C=-A:"top"!==h&&"hanging"!==h||(C=0),{font:k,width:P,height:A,lines:b,lineWidths:T,lineHeight:S+=g,maxLineWidth:M,fontProperties:E,lineMetrics:T.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new $n(n-l/2,C+e*S,t+l,S)}))}}m.getTotalLength();for(var R=0;b.length>R;R++)x.measureText(b[R])}},{key:"wordWrap",value:function(t,e,n){var r=this,i=e.wordWrapWidth,a=void 0===i?0:i,o=e.letterSpacing,s=void 0===o?0:o,u=e.maxLines,l=void 0===u?1/0:u,c=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),f=a+s,d="";"ellipsis"===c?d="...":c&&"clip"!==c&&(d=c);var v=[],p=0,m=0,y={},g=function(t){return r.getFromCache(t,s,y,h)},k=Array.from(d).reduce((function(t,e){return t+g(e)}),0);function E(t){if(k>0&&f>=k){for(var e=v[t].length,n=0,r=e,i=0;e>i;i++){var a=g(v[t][i]);if(n+a+k>f){r=i;break}n+=a}v[t]=(v[t]||"").slice(0,r)+d}}for(var x=Array.from(t),b=0;x.length>b;b++){var T=x[b],M=t[b-1],w=t[b+1],N=g(T);if(this.isNewline(T)){if(++p>=l){e.isOverflowing=!0,x.length-1>b&&E(p-1);break}m=0,v[p]=""}else{if(m>0&&m+N>f){if(p+1>=l){e.isOverflowing=!0,E(p);break}if(p++,m=0,v[p]="",this.isBreakingSpace(T))continue;this.canBreakInLastChar(T)||(v=this.trimToBreakable(v),m=this.sumTextWidthByCache(v[p]||"",y)),this.shouldBreakByKinsokuShorui(T,w)&&(v=this.trimByKinsokuShorui(v),m+=g(M||""))}m+=N,v[p]=(v[p]||"")+T}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ps.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ps.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=h(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!ms.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!ms.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n[t]=i}return i}}])}(),Es={},xs=(Wo=new wo,qo=new Mo,r(r(r(r(r(r(r(r(r(r(Ho={},Dn.FRAGMENT,null),Dn.CIRCLE,new Eo),Dn.ELLIPSE,new xo),Dn.RECT,Wo),Dn.IMAGE,Wo),Dn.GROUP,new Po),Dn.LINE,new bo),Dn.TEXT,new No(Es)),Dn.POLYLINE,qo),Dn.POLYGON,qo),r(r(r(Ho,Dn.PATH,new To),Dn.HTML,new So),Dn.MESH,null)),bs=function(t){var e=new Ea,n=new Ta;return r(r(r(r(r(r(r(r(r(r(t={},Pr.PERCENTAGE,null),Pr.NUMBER,new Pa),Pr.ANGLE,new ga),Pr.DEFINED_PATH,new ka),Pr.PAINT,e),Pr.COLOR,e),Pr.FILTER,new xa),Pr.LENGTH,n),Pr.LENGTH_PERCENTAGE,n),Pr.LENGTH_PERCENTAGE_12,new Ma),r(r(r(r(r(r(r(r(r(r(t,Pr.LENGTH_PERCENTAGE_14,new wa),Pr.COORDINATE,new Ta),Pr.OFFSET_DISTANCE,new Sa),Pr.OPACITY_VALUE,new Aa),Pr.PATH,new Ca),Pr.LIST_OF_POINTS,new Ra),Pr.SHADOW_BLUR,new Oa),Pr.TEXT,new La),Pr.TEXT_TRANSFORM,new Ia),Pr.TRANSFORM,new yo),r(r(r(t,Pr.TRANSFORM_ORIGIN,new go),Pr.Z_INDEX,new ko),Pr.MARKER,new Na)}();Es.CameraContribution=Tr,Es.AnimationTimeline=null,Es.EasingFunction=null,Es.offscreenCanvasCreator=new Go,Es.sceneGraphSelector=new Uo,Es.sceneGraphService=new vs(Es),Es.textService=new ks(Es),Es.geometryUpdaterFactory=xs,Es.CSSPropertySyntaxFactory=bs,Es.styleValueRegistry=new ya(Es),Es.layoutRegistry=null,Es.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Es.enableStyleSyntax=!0,Es.enableSizeAttenuation=!1;var Ts=0;var Ms=new jo(zo.INSERTED,null,"","","",0,"",""),ws=new jo(zo.REMOVED,null,"","","",0,"",""),Ns=new Lo(zo.DESTROY),Ps=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).entity=Ts++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:Mr.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return y(e,t),u(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(Qn)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Es.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(ja(this)||t.nodeName!==Dn.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Ms.relatedNode=this,t.dispatchEvent(Ms)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return ws.relatedNode=this,t.dispatchEvent(ws),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Es.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Es.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Es.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Es.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Es.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Es.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Es.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Es.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Es.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,h(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(Ns),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Es.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Es.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Es.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Es.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Es.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(Qn)}},{key:"getAttributeNode",value:function(t){throw Error(Qn)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(Qn)}},{key:"hasAttributeNS",value:function(t,e){throw Error(Qn)}},{key:"removeAttributeNS",value:function(t,e){throw Error(Qn)}},{key:"removeAttributeNode",value:function(t){throw Error(Qn)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(Qn)}},{key:"setAttributeNode",value:function(t){throw Error(Qn)}},{key:"setAttributeNodeNS",value:function(t){throw Error(Qn)}},{key:"toggleAttribute",value:function(t,e){throw Error(Qn)}}])}(Do);function Ss(t){return!(null==t||!t.nodeName)}var As=Es.globalThis.Proxy?Es.globalThis.Proxy:function(){},Cs=new jo(zo.ATTR_MODIFIED,null,null,null,null,jo.MODIFICATION,null,null),Rs=nt(),Os=Tt(),Ls=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||Dn.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Es.enableStyleSyntax&&(n.style=new As({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return y(e,t),u(e,[{key:"destroy",value:function(){Ie(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var r in n){var i=n[r];Ss(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor(a(a({},this.config),{},{style:n}));return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o}},{key:"initAttributes",value:function(){Es.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];qt(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),Ie(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.renderable,a=this.attributes[t],o=this.parsedStyle[t];Es.styleValueRegistry.processProperties(this,r({},t,e),n),i.dirty=!0;var s,u=this.parsedStyle[t];(this.isConnected&&(Cs.relatedNode=this,Cs.prevValue=a,Cs.newValue=e,Cs.attrName=t,Cs.prevParsedValue=o,Cs.newParsedValue=u,this.isMutationObserved?this.dispatchEvent(Cs):(Cs.target=this,this.ownerDocument.defaultView.dispatchEvent(Cs,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(s=this.attributeChangedCallback)||void 0===s||s.call(this,t,a,e,o,u))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=g(t.getMin(),2),n=e[0],r=e[1],i=g(t.getMax(),2);return new $n(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return Es.sceneGraphService.setOrigin(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return Es.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return Es.sceneGraphService.setPosition(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(t){return Es.sceneGraphService.setLocalPosition(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(t){return Es.sceneGraphService.translate(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(t){return Es.sceneGraphService.translateLocal(this,nr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return Es.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Es.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=nr(t,e=e||t,n=n||t,!1)),Es.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=nr(t,e=e||t,n=n||t,!1)),Es.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Es.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Es.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return or(g(lr(Rs,Es.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return or(g(lr(Rs,Es.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Es.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Es.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return _t(e)&&_t(n)?Es.sceneGraphService.rotateLocal(this,0,0,t):Es.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return _t(e)&&_t(n)?Es.sceneGraphService.rotate(this,0,0,t):Es.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Es.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Es.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Es.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Es.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Es.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Es.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Es.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Es.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Es.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Es.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,h(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,h(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=g(z(Rs,e),2),r=n[0],i=n[1],a=g(j(Rs,e),2),o=a[0],s=a[1],u=X(Os,e),l=g(lr(Rs,u),3);return cr(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=g(hr(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=g(hr(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Ps);Ls.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Is=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.CIRCLE},t)])}return y(e,t),u(e)}(Ls);Is.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var _s=["style"],Ds=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,_s);return o(this,e),(t=p(this,e,[a({style:r},i)])).isCustomElement=!0,t}return y(e,t),u(e)}(Ls),Fs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.ELLIPSE},t)])}return y(e,t),u(e)}(Ls);Fs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Gs=function(t){function e(){return o(this,e),p(this,e,[{type:Dn.FRAGMENT}])}return y(e,t),u(e)}(Ls),Bs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.GROUP},t)])}return y(e,t),u(e)}(Ls);Bs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["width","height"]));var Vs=["style"],Ys=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,Vs);return o(this,e),(t=p(this,e,[a({type:Dn.HTML,style:r},i)])).cullable.enable=!1,t}return y(e,t),u(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=C(M(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Hn.isEmpty(e)){var n=new Hn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ls);Ys.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Us=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.IMAGE},t)])}return y(e,t),u(e)}(Ls);Us.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var zs=["style"],js=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,zs);o(this,e),(t=p(this,e,[a({type:Dn.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&Ss(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),l&&Ss(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ss(r)&&(this.markerStartAngle=0,r.remove()),i&&Ss(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Ss(r)&&(this.markerEndAngle=0,r.remove()),i&&Ss(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&Ss(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=xn(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=pt(nt(),at(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Kn(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return En(t.x1,t.y1,t.x2,t.y2)}}])}(Ls);js.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Xs=["style"],Hs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,Xs);o(this,e),(t=p(this,e,[a({type:Dn.PATH,style:r,initialParsedStyle:{miterLimit:4,d:a({},Nr)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Ss(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Ss(c)&&t.placeMarkerMid(c),l&&Ss(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ss(r)&&(this.markerStartAngle=0,r.remove()),i&&Ss(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Ss(r)&&(this.markerEndAngle=0,r.remove()),i&&Ss(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&Ss(i)){var a,o,s,u,l,c,h;if(t){var f=g(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=g(this.getEndTangent(),2),m=p[0],y=p[1];u=y[0],l=y[1],o=m[0]-y[0],s=m[1]-y[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Ss(t))for(var n=1;e.length-1>n;n++){var r=g(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Oi(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Ae(t,e,Zt(Zt({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=pt(nt(),at(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Kn(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Oi(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Ls);Hs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ws=["style"],qs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Ln(n,Ws);o(this,e),(t=p(this,e,[a({type:Dn.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Ss(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Ss(c)&&t.placeMarkerMid(c),l&&Ss(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ss(r)&&(this.markerStartAngle=0,r.remove()),i&&Ss(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Ss(r)&&(this.markerEndAngle=0,r.remove()),i&&Ss(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&Ss(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Ss(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Ls);qs.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Zs=["style"],Ks=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Ln(t,Zs);return o(this,e),p(this,e,[a({type:Dn.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return y(e,t),u(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=wn(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=En(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))})),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)}));var c=xn(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=pt(nt(),at(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new Kn(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(qs);Ks.PARSED_STYLE_LIST=new Set([].concat(h(qs.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var $s=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:Dn.RECT},t)])}return y(e,t),u(e)}(Ls);$s.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Qs=["style"],Js=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Ln(t,Qs);return o(this,e),p(this,e,[a({type:Dn.TEXT,style:a({fill:"black"},n)},r)])}return y(e,t),u(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ls);Js.PARSED_STYLE_LIST=new Set([].concat(h(Ls.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var tu=function(){return u((function t(){o(this,t),this.registry={},this.define(Dn.CIRCLE,Is),this.define(Dn.ELLIPSE,Fs),this.define(Dn.RECT,$s),this.define(Dn.IMAGE,Us),this.define(Dn.LINE,js),this.define(Dn.GROUP,Bs),this.define(Dn.PATH,Hs),this.define(Dn.POLYGON,qs),this.define(Dn.POLYLINE,Ks),this.define(Dn.TEXT,Js),this.define(Dn.HTML,Ys)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),eu={number:function(t){return new jr(t)},percent:function(t){return new jr(t,"%")},px:function(t){return new jr(t,"px")},em:function(t){return new jr(t,"em")},rem:function(t){return new jr(t,"rem")},deg:function(t){return new jr(t,"deg")},grad:function(t){return new jr(t,"grad")},rad:function(t){return new jr(t,"rad")},turn:function(t){return new jr(t,"turn")},s:function(t){return new jr(t,"s")},ms:function(t){return new jr(t,"ms")},registerProperty:function(t){Es.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Es.layoutRegistry.registerLayout(t,e)}},nu=function(t){function e(){var t;o(this,e),(t=p(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Es.AnimationTimeline(t)}catch(t){}var n={};return va.forEach((function(t){var e=t.d;t.inh&&e&&(n[t.n]=It(e)?e(Dn.GROUP):e)})),t.documentElement=new Bs({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return y(e,t),u(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Js:Bs);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(Qn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=Rn(An().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return An().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=Rn(An().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return An().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Jn)}},{key:"insertBefore",value:function(t,e){throw Error(Jn)}},{key:"removeChild",value:function(t,e){throw Error(Jn)}},{key:"replaceChild",value:function(t,e,n){throw Error(Jn)}},{key:"append",value:function(){throw Error(Jn)}},{key:"prepend",value:function(){throw Error(Jn)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Do),ru=function(){function t(e){o(this,t),this.strategies=e}return u(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return e.visible=0===a.length?i.unculledEntities.indexOf(t.entity)>-1:a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Lo(zo.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();ru.tag="Culling";var iu=function(){function t(){var e=this;o(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Ro(null),this.rootWheelEvent=new Oo(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=On(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=On(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return u(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=On(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=On(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=On(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Ua[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=za.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];qt(i.button)&&(i.button=0),qt(i.buttons)&&(i.buttons=1),qt(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),qt(i.width)&&(i.width=i.radiusX||1),qt(i.height)&&(i.height=i.radiusY||1),qt(i.tiltX)&&(i.tiltX=0),qt(i.tiltY)&&(i.tiltY=0),qt(i.pointerType)&&(i.pointerType="touch"),qt(i.pointerId)&&(i.pointerId=i.identifier||0),qt(i.pressure)&&(i.pressure=i.force||.5),qt(i.twist)&&(i.twist=0),qt(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;qt(a.isPrimary)&&(a.isPrimary=!0),qt(a.width)&&(a.width=1),qt(a.height)&&(a.height=1),qt(a.tiltX)&&(a.tiltX=0),qt(a.tiltY)&&(a.tiltY=0),qt(a.pointerType)&&(a.pointerType="mouse"),qt(a.pointerId)&&(a.pointerId=1),qt(a.pressure)&&(a.pressure=.5),qt(a.twist)&&(a.twist=0),qt(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();iu.tag="Event";var au=[Dn.CIRCLE,Dn.ELLIPSE,Dn.IMAGE,Dn.RECT,Dn.LINE,Dn.POLYLINE,Dn.POLYGON,Dn.TEXT,Dn.PATH,Dn.HTML],ou=function(){return u((function t(){o(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Hn.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||qn.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==qn.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===qn.OUTSIDE||n===qn.INSIDE)return n;for(var i=qn.INSIDE,a=au.indexOf(t.nodeName)>-1,o=0,s=r.length;s>o;++o){var u=1<<o;if(0!=(n&u)&&(!a||4!==o&&5!==o)){var l=r[o],c=l.normal,h=l.distance;if(0>ft(c,e.getPositiveFarPoint(r[o]))+h)return qn.OUTSIDE;0>ft(c,e.getNegativeFarPoint(r[o]))+h&&(i|=u)}}return i}}])}(),su=function(){function t(){o(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return u(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){Es.enableSizeAttenuation&&Es.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),Es.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){a.addEventListener(zo.MOUNTED,u),a.addEventListener(zo.UNMOUNTED,l),a.addEventListener(zo.ATTR_MODIFIED,o),a.addEventListener(zo.BOUNDS_CHANGED,s)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(zo.MOUNTED,u),a.removeEventListener(zo.UNMOUNTED,l),a.removeEventListener(zo.ATTR_MODIFIED,o),a.removeEventListener(zo.BOUNDS_CHANGED,s),r.syncTasks.clear()}));var c=null!==(n=Es.globalThis.requestIdleCallback)&&void 0!==n?n:to.bind(Es.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,c((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Hn),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=g(r.getMin(),2),o=a[0],s=a[1],u=g(r.getMax(),2),l=u[0],c=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=c}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();su.tag="Prepare";var uu=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),lu=new Lo(zo.MOUNTED),cu=new Lo(zo.UNMOUNTED),hu=new Lo(uu.BEFORE_RENDER),fu=new Lo(uu.RERENDER),du=new Lo(uu.AFTER_RENDER),vu=function(t){function e(t){var n;o(this,e),(n=p(this,e)).Element=Ls,n.inited=!1,n.context={},n.document=new nu,n.document.defaultView=n,n.customElements=new tu;var r=t.container,i=t.canvas,a=t.offscreenCanvas,s=t.width,u=t.height,l=t.devicePixelRatio,c=t.renderer,h=t.background,f=t.cursor,d=t.document,v=t.requestAnimationFrame,m=t.cancelAnimationFrame,y=t.createImage,g=t.enableLargeImageOptimization,k=t.supportsPointerEvents,E=t.supportsTouchEvents,x=t.supportsCSSTransform,b=t.cleanUpOnDestroy,T=void 0===b||b,M=t.useNativeClickEvent,w=t.alwaysTriggerPointerEventOnCanvas,N=t.isTouchEvent,P=t.isMouseEvent,S=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||Da(r,n,T);var A=s,C=u,R=l;return i&&(R=1>(R=l||Fa&&window.devicePixelRatio||1)?1:Math.ceil(R),A=s||function(t){var e=Ya(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/R,C=u||function(t){var e=Ya(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/R),a&&(Es.offscreenCanvas=a),n.devicePixelRatio=R,n.requestAnimationFrame=null!=v?v:to.bind(Es.globalThis),n.cancelAnimationFrame=null!=m?m:eo.bind(Es.globalThis),n.supportsTouchEvents=null!=E?E:"ontouchstart"in Es.globalThis,n.supportsPointerEvents=null!=k?k:!!Es.globalThis.PointerEvent,n.isTouchEvent=null!=N?N:function(t){return n.supportsTouchEvents&&t instanceof Es.globalThis.TouchEvent},n.isMouseEvent=null!=P?P:function(t){return!Es.globalThis.MouseEvent||t instanceof Es.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Es.globalThis.PointerEvent))},n.dblClickSpeed=null!=S?S:200,n.initRenderingContext({container:r,canvas:i,width:A,height:C,renderer:c,offscreenCanvas:a,devicePixelRatio:R,cursor:f||"default",background:h||"transparent",createImage:y,enableLargeImageOptimization:g,document:d,supportsCSSTransform:x,useNativeClickEvent:M,cleanUpOnDestroy:T,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(A,C,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return y(e,t),u(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Es.CameraContribution;i.clipSpaceNearZ=n,i.setType(gr.EXPLORING,kr.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(xr.UPDATED,(function(){r.context.renderingContext.renderReasons.add(Bo.CAMERA_CHANGED),Es.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){Es.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;void 0===e&&(e=this.getConfig().fastCleanExistingCanvas),e||this.dispatchEvent(new Lo(uu.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new Lo(uu.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(lu),r(cu),r(hu),r(fu),r(du),r(Cs),r(Ms),r(ws),r(Ns)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Er.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Lo(uu.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(hu.detail=t,du.detail=t),this.dispatchEvent(hu),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(fu)})),this.dispatchEvent(du)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new _n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new iu,new su,new ru([new ou])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(a(a({},Es),this.context)),this.context.renderingService=new Vo(Es,this.context),this.context.eventService=new Fo(Es,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new Lo(uu.READY))})):e.dispatchEvent(new Lo(uu.READY)):e.dispatchEvent(new Lo(uu.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Es)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),h((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(Es)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(cu):(cu.target=t,this.dispatchEvent(cu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ja(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(lu):(lu.target=t,this.dispatchEvent(lu,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(_o),pu=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).landmarks=[],t}return y(e,t),u(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=tr(e),this.relAzimuth=tr(t),this.relRoll=tr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===gr.EXPLORING){var r=Mt(Tt(),[1,0,0],ir((this.rotateWorld?1:-1)*this.relElevation)),i=Mt(Tt(),[0,1,0],ir((this.rotateWorld?1:-1)*this.relAzimuth)),a=Mt(Tt(),[0,0,1],ir(this.relRoll)),o=wt(Tt(),i,r);o=wt(Tt(),o,a);var s=W(M(),o);L(this.matrix,this.matrix,[0,0,-this.distance]),O(this.matrix,this.matrix,s),L(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=nr(t,e,0),r=rt(this.position);return ut(r,r,ct(nt(),this.right,n[0])),ut(r,r,ct(nt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e,n=this.forward,r=rt(this.position);return r[0]+=(e=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*n[0],r[1]+=e*n[1],r[2]+=e*n[2],this._setPosition(r),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getDistance():this.type===gr.TRACKING&&ut(this.focalPoint,r,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,u=a.focalPoint,l=void 0===u?this.focalPoint:u,c=a.roll,h=a.zoom,f=new Es.CameraContribution;f.setType(this.type,void 0),f.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),f.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),f.setRoll(null!=c?c:this.roll),f.setZoom(null!=h?h:this.zoom);var d={name:t,matrix:w(f.getWorldTransform()),right:rt(f.right),up:rt(f.up),forward:rt(f.forward),position:rt(f.getPosition()),focalPoint:rt(f.getFocalPoint()),distanceVector:rt(f.getDistanceVector()),distance:f.getDistance(),dollyingStep:f.getDollyingStep(),azimuth:f.getAzimuth(),elevation:f.getElevation(),roll:f.getRoll(),relAzimuth:f.relAzimuth,relElevation:f.relElevation,relRoll:f.relRoll,zoom:f.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Yt(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=zt(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,u=void 0===s?100:s,l=i.easingFunction,c=void 0===l?void 0:l,h=i.onfinish,f=void 0===h?void 0:h,d=i.onframe,v=void 0===d?void 0:d;this.cancelLandmarkAnimation();var p,m=r.position,y=r.focalPoint,g=r.zoom,k=r.roll,E=c||Es.EasingFunction(o),x=function(){e.setFocalPoint(y),e.setPosition(m),e.setRoll(k),e.setZoom(g),e.computeMatrix(),e.triggerUpdate(),null==f||f()};if(0===u)return x();var b=function(t){void 0===p&&(p=t);var n=t-p;if(u>n){var r,i,a=E(n/u),o=nt(),s=nt();if(vt(o,e.focalPoint,y,a),vt(s,e.position,m,a),i=e.roll*(1-a)+k*a,r=e.zoom*(1-a)+g*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),.01>=gt(o,y)+gt(s,m)&&void 0===g&&void 0===k)return x();e.computeMatrix(),e.triggerUpdate(),u>n&&(null==v||v(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(b))}else x()};this.canvas.requestAnimationFrame(b)}}}])}(Tr);Es.CameraContribution=pu;
|
|
18
18
|
/*!
|
|
19
19
|
* @antv/g-dom-mutation-observer-api
|
|
20
20
|
* @description A simple implementation of DOM MutationObserver API.
|
|
21
|
-
* @version 2.0.
|
|
22
|
-
* @date 11/
|
|
21
|
+
* @version 2.0.20
|
|
22
|
+
* @date 11/15/2024, 6:17:02 AM
|
|
23
23
|
* @author AntVis
|
|
24
24
|
* @docs https://g.antv.antgroup.com/
|
|
25
25
|
*/
|
|
@@ -27,8 +27,8 @@ var mu,yu,gu=function(){function t(e,n){o(this,t),this.addedNodes=[],this.attrib
|
|
|
27
27
|
/*!
|
|
28
28
|
* @antv/g-web-animations-api
|
|
29
29
|
* @description A simple implementation of Web Animations API.
|
|
30
|
-
* @version 2.1.
|
|
31
|
-
* @date 11/
|
|
30
|
+
* @version 2.1.9
|
|
31
|
+
* @date 11/15/2024, 6:18:32 AM
|
|
32
32
|
* @author AntVis
|
|
33
33
|
* @docs https://g.antv.antgroup.com/
|
|
34
34
|
*/var Su=function(t){function e(t,n,r,i){var a;return o(this,e),(a=p(this,e,[t])).currentTime=r,a.timelineTime=i,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=r,a.timelineTime=i,a}return y(e,t),u(e)}(Ao),Au=0,Cu=function(){return u((function t(e,n){var r;o(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Au++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(!isNaN(t=Number(t))){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Su(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0}},{key:"persist",value:function(){throw Error(Qn)}},{key:"addEventListener",value:function(t,e,n){throw Error(Qn)}},{key:"removeEventListener",value:function(t,e,n){throw Error(Qn)}},{key:"dispatchEvent",value:function(t){throw Error(Qn)}},{key:"commitStyles",value:function(){throw Error(Qn)}},{key:"ensureAlive",value:function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Su(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Su(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),Ru=.1,Ou="function"==typeof Float32Array,Lu=function(t,e){return 1-3*e+3*t},Iu=function(t,e){return 3*e-6*t},_u=function(t){return 3*t},Du=function(t,e,n){return((Lu(e,n)*t+Iu(e,n))*t+_u(e))*t},Fu=function(t,e,n){return 3*Lu(e,n)*t*t+2*Iu(e,n)*t+_u(e)},Gu=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Ou?new Float32Array(11):[,,,,,,,,,,,],a=0;11>a;++a)i[a]=Du(a*Ru,t,n);var o=function(e){for(var r=0,a=1;10!==a&&e>=i[a];++a)r+=Ru;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*Ru,s=Fu(o,t,n);return.001>s?0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=Du(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&10>++s);return o}(e,r,r+Ru,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var a=Fu(e,n,r);if(0===a)return e;e-=(Du(e,n,r)-t)/a}return e}(e,o,t,n)};return function(t){return 0===t||1===t?t:Du(o(t),e,r)}},Bu=function(t){return Math.pow(t,2)},Vu=function(t){return Math.pow(t,3)},Yu=function(t){return Math.pow(t,4)},Uu=function(t){return Math.pow(t,5)},zu=function(t){return Math.pow(t,6)},ju=function(t){return 1-Math.cos(t*Math.PI/2)},Xu=function(t){return 1-Math.sqrt(1-t*t)},Hu=function(t){return t*t*(3*t-2)},Wu=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},qu=function(t){var e=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=e[1],i=void 0===r?.5:r,a=Ut(Number(void 0===n?1:n),1,10),o=Ut(Number(i),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-o/(2*Math.PI)*Math.asin(1/a))/o)},Zu=function(t){var e=arguments.length>2?arguments[2]:void 0,n=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,a=n[1],o=void 0===a?100:a,s=n[2],u=void 0===s?10:s,l=n[3],c=void 0===l?0:l;i=Ut(i,.1,1e3),o=Ut(o,.1,1e3),u=Ut(u,.1,1e3),c=Ut(c,.1,1e3);var h=Math.sqrt(o/i),f=u/(2*Math.sqrt(o*i)),d=1>f?h*Math.sqrt(1-f*f):0,v=1>f?(f*h-c)/d:-c+h,p=e?e*t/1e3:t;return p=1>f?Math.exp(-p*f*h)*(1*Math.cos(d*p)+v*Math.sin(d*p)):(1+v*p)*Math.exp(-p*h),0===t||1===t?t:1-p},Ku=function(t){var e=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(Ut(t,0,1)*r)/r},$u=function(t){var e=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4);return Gu(e[0],e[1],e[2],e[3])(t)},Qu=Gu(.42,0,1,1),Ju=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},tl=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},el=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},nl={steps:Ku,"step-start":function(t){return Ku(t,[1,"start"])},"step-end":function(t){return Ku(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":$u,ease:function(t){return $u(t,[.25,.1,.25,1])},in:Qu,out:Ju(Qu),"in-out":tl(Qu),"out-in":el(Qu),"in-quad":Bu,"out-quad":Ju(Bu),"in-out-quad":tl(Bu),"out-in-quad":el(Bu),"in-cubic":Vu,"out-cubic":Ju(Vu),"in-out-cubic":tl(Vu),"out-in-cubic":el(Vu),"in-quart":Yu,"out-quart":Ju(Yu),"in-out-quart":tl(Yu),"out-in-quart":el(Yu),"in-quint":Uu,"out-quint":Ju(Uu),"in-out-quint":tl(Uu),"out-in-quint":el(Uu),"in-expo":zu,"out-expo":Ju(zu),"in-out-expo":tl(zu),"out-in-expo":el(zu),"in-sine":ju,"out-sine":Ju(ju),"in-out-sine":tl(ju),"out-in-sine":el(ju),"in-circ":Xu,"out-circ":Ju(Xu),"in-out-circ":tl(Xu),"out-in-circ":el(Xu),"in-back":Hu,"out-back":Ju(Hu),"in-out-back":tl(Hu),"out-in-back":el(Hu),"in-bounce":Wu,"out-bounce":Ju(Wu),"in-out-bounce":tl(Wu),"out-in-bounce":el(Wu),"in-elastic":qu,"out-elastic":Ju(qu),"in-out-elastic":tl(qu),"out-in-elastic":el(qu),spring:Zu,"spring-in":Zu,"spring-out":Ju(Zu),"spring-in-out":tl(Zu),"spring-out-in":el(Zu)},rl=function(t){return nl[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||nl.linear},il=function(t){return t},al=1,ol=.5,sl=0;function ul(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var ll="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",cl=RegExp("cubic-bezier\\(".concat(ll,",").concat(ll,",").concat(ll,",").concat(ll,"\\)")),hl=/steps\(\s*(\d+)\s*\)/,fl=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function dl(t){var e=cl.exec(t);if(e)return Gu.apply(void 0,h(e.slice(1).map(Number)));var n=hl.exec(t);if(n)return ul(Number(n[1]),sl);var r=fl.exec(t);return r?ul(Number(r[1]),{start:al,middle:ol,end:sl}[r[2]]):rl(t)}function vl(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var pl=0,ml=1,yl=2,gl=3;function kl(t,e,n){var r=function(t,e,n){if(null===e)return pl;var r=n.endTime;return Math.min(n.delay,r)>e?ml:Math.min(n.delay+t+n.endDelay,r)>e?gl:yl}(t,e,n),i=function(t,e,n,r,i){switch(r){case ml:return"backwards"===e||"both"===e?0:null;case gl:return n-i;case yl:return"forwards"===e||"both"===e?t:null;case pl:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?e!==ml&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||n!==yl||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),u=function(t,e,n,r){return t===yl&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=l,n.easingFunction(l)}function El(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(xl(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:dl(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;i.length-1>a;a++){var o=a,s=a+1,u=i[o].computedOffset,l=i[s].computedOffset,c=u,h=l;0===a&&(c=-1/0,0===l&&(s=o)),a===i.length-2&&(h=1/0,1===u&&(o=s)),n.push({applyFrom:c,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:Tl(r,i[o].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset;t.setAttribute(n.property,n.interpolation(0===r?0:(e-n.startOffset)/r),!1,!1)}));else for(var n in r)xl(n)&&t.setAttribute(n,null)}}function xl(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var bl=function(t,e,n){return function(r){var i=Ml(t,e,r);return zt(i)?i:n(i)}};function Tl(t,e,n,r){var i=ma[t];if(i&&i.syntax&&i.int){var a=Es.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o=a.parser,s=o?o(e,r):e,u=o?o(n,r):n,l=a.mixer(s,u,r);if(l){var c=bl.apply(void 0,h(l));return function(t){return 0===t?e:1===t?n:c(t)}}}}return bl(!1,!0,(function(t){return t?n:e}))}function Ml(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;a>s;s++)o.push(Ml(t[r>s?s:r-1],e[i>s?s:i-1],n));return o}throw Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var wl=function(){return u((function t(){o(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=il,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=dl(t),this._easing=t}}])}();function Nl(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;i>a;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}null!=r[a]&&(e[a][n]=r[a])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,a=0;n.length>a;a++){var o=n[a].offset;if(_t(o))r=!1;else{if(i>o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,a=Number(n[0].computedOffset),o=1;r>o;o++){var s=n[o].computedOffset;if(!_t(s)&&!_t(a)){for(var u=1;o-i>u;u++)n[i+u].computedOffset=a+(Number(s)-a)*u/(o-i);i=o,a=Number(s)}}}(),n}var Pl="backwards|forwards|both|none".split("|"),Sl="reverse|alternate|alternate-reverse".split("|");function Al(t,e){var n=new wl;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Pl.indexOf(t[e]))return;if("direction"===e&&-1===Sl.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Cl(t,e){var n;return Al(t=Rl(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function Rl(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var Ol=function(){return u((function t(e,n,r){var i=this;o(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=Cl(r,!1),this.timing.effect=this,this.timing.activeDuration=vl(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Nl(n,this.timing),this.interpolations=El(this.normalizedKeyframes,this.timing,this.target);var a=Es.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=kl(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=Nl(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function Ll(t,e){return Number(t.id)-Number(e.id)}var Il=function(){return u((function t(e){var n=this;o(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],Number(n.currentTime)>t&&(t=Number(n.currentTime)),n.animations.sort(Ll),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new Ol(t,e,n),i=new Cu(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Ll),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value:function(t,e,n){var r,i,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],u=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,l]}}])}();Es.EasingFunction=dl,Es.AnimationTimeline=Il,t.AABB=Hn,t.AbstractRenderer=Bn,t.AbstractRendererPlugin=Gn,t.AdvancedCamera=pu,t.Animation=Cu,t.AnimationEvent=Su,t.AnimationTimeline=Il,t.BUILT_IN_PROPERTIES=va,t.CSS=eu,t.CSSGradientValue=Yr,t.CSSKeywordValue=Ur,t.CSSRGB=Wr,t.CSSStyleValue=Gr,t.CSSUnitValue=jr,t.Camera=Tr,t.CameraEvent=xr,t.CameraProjectionMode=Er,t.CameraTrackingMode=kr,t.CameraType=gr,t.Canvas=vu,t.CanvasEvent=uu,t.Circle=Is,t.CircleUpdater=Eo,t.ClipSpaceNearZ=Fn,t.CustomElement=Ds,t.CustomElementRegistry=tu,t.CustomEvent=Lo,t.DefaultSceneGraphSelector=Uo,t.DefaultSceneGraphService=vs,t.DisplayObject=Ls,t.Document=nu,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Qn,t.EasingFunctions=nl,t.Element=Ps,t.ElementEvent=zo,t.Ellipse=Fs,t.EllipseUpdater=xo,t.EventService=Fo,t.EventTarget=_o,t.FederatedEvent=Ao,t.FederatedMouseEvent=Co,t.FederatedPointerEvent=Ro,t.FederatedWheelEvent=Oo,t.Fragment=Gs,t.Frustum=Zn,t.GradientType=Vr,t.Group=Bs,t.GroupUpdater=Po,t.HTML=Ys,t.HTMLUpdater=So,t.Image=Us,t.KeyframeEffect=Ol,t.Line=js,t.LineUpdater=bo,t.Mask=qn,t.MutationEvent=jo,t.MutationObserver=bu,t.MutationRecord=gu,t.Node=Do,t.OffscreenCanvasCreator=Go,t.Path=Hs,t.PathUpdater=To,t.Plane=Wn,t.Point=Kn,t.Polygon=qs,t.Polyline=Ks,t.PolylineUpdater=Mo,t.PropertySyntax=Pr,t.RBush=_n,t.Rect=$s,t.RectUpdater=wo,t.Rectangle=$n,t.Registration=xu,t.RenderReason=Bo,t.RenderingService=Vo,t.Shape=Dn,t.SortReason=wr,t.Strategy=Mr,t.Text=Js,t.TextService=ks,t.TextUpdater=No,t.UnitType=Ar,t.attrModifiedEvent=Cs,t.compareAnimations=Ll,t.computeLinearGradient=function(t,e,n,r){var i=ir(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}},t.computeRadialGradient=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===Ar.kPercentage&&(o=r.value/100*e),i.unit===Ar.kPercentage&&(s=i.value/100*n);var u=Math.max(Ee([0,0],[o,s]),Ee([0,n],[o,s]),Ee([e,n],[o,s]),Ee([e,0],[o,s]));return a&&(a instanceof jr?u=a.value:a instanceof Ur&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(Ee([0,0],[o,s]),Ee([0,n],[o,s]),Ee([e,n],[o,s]),Ee([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:u}},t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case Dn.LINE:var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===i?0:i,void 0===a?0:a,void 0===o?0:o,void 0===s?0:s);break;case Dn.CIRCLE:var u=t.parsedStyle,l=u.r,c=void 0===l?0:l,f=u.cx,d=u.cy;n=zi(c,c,void 0===f?0:f,void 0===d?0:d);break;case Dn.ELLIPSE:var v=t.parsedStyle,p=v.rx,m=v.ry,y=v.cx,k=v.cy;n=zi(void 0===p?0:p,void 0===m?0:m,void 0===y?0:y,void 0===k?0:k);break;case Dn.POLYLINE:case Dn.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===Dn.POLYGON);break;case Dn.RECT:var E=t.parsedStyle,x=E.width,b=void 0===x?0:x,T=E.height,M=void 0===T?0:T,w=E.x,N=void 0===w?0:w,P=E.y,S=void 0===P?0:P,A=E.radius,C=A&&A.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var a=g(i,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,f,n,e+r-h*l]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(b,M,N,S,C&&A.map((function(t){return Ut(t,0,Math.min(Math.abs(b)/2,Math.abs(M)/2))})));break;case Dn.PATH:n=h(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=at(e[1],e[2],0);n&&pt(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=at(e[1],e[2],0),o=at(e[3],e[4],0),s=at(e[5],e[6],0);n&&(pt(a,a,n),pt(o,o,n),pt(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=at(e[6],e[7],0);n&&pt(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else if("Q"===e[0]){var l=at(e[1],e[2],0),c=at(e[3],e[4],0);n&&(pt(l,l,n),pt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)},t.createVec3=nr,t.decompose=hr,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==g(t,2)[1]})))},t.deg2rad=ir,t.deg2turn=function(t){return t/360},t.destroyEvent=Ns,t.findClosestClipPathTarget=Va,t.fromRotationTranslationScale=cr,t.getAngle=tr,t.getEuler=lr,t.getOrCalculatePathTotalLength=Oi,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.insertedEvent=Ms,t.isBrowser=Fa,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=hi,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Ss,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=ci,t.makeTiming=Al,t.mergeColors=di,t.normalizeKeyframes=Nl,t.normalizeTimingInput=Cl,t.numericTimingToObject=Rl,t.parseColor=fi,t.parseLength=mi,t.parsePath=Hi,t.parseTransform=ea,t.parsedTransformToMat4=mo,t.propertyMetadataCache=ma,t.rad2deg=or,t.removedEvent=ws,t.resetEntityCounter=function(){Ts=0},t.runtime=Es,t.setDOMSize=function(t,e,n){Fa&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map((function(a,o){var s=a[0],u=t[o+1],l=(o===t.length-1||u&&("M"===u[0]||"Z"===u[0]))&&0!==r&&0!==i,c=g(0===o&&(0!==e||0!==n)?[e,n]:[0,0],2),h=c[0],f=c[1],d=g(l?[r,i]:[0,0],2),v=d[0],p=d[1];switch(s){case"M":return"M ".concat(a[1]+h,",").concat(a[2]+f);case"L":return"L ".concat(a[1]+v,",").concat(a[2]+p);case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]+v," ").concat(a[4]+p);case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]+v," ").concat(a[6]+p);case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]+v," ").concat(a[7]+p);case"Z":return"Z";default:return null}})).filter((function(t){return null!==t})).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=sr}));
|