@antv/g-lite 1.0.60 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var n,r=e((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=g(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 y(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(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(!y(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;y(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(!y(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(y(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=g([]),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=g(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=g([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));m(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);m(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=g(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=g([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}()}));function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(){o=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var a=Object.create((e&&e.prototype instanceof d?e:d).prototype),o=new P(i||[]);return r(a,"_invoke",{value:b(t,n,o)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function d(){}function v(){}function p(){}var y={};l(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(w([])));m&&m!==e&&n.call(m,a)&&(y=m);var x=p.prototype=d.prototype=Object.create(y);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,a,o,s){var u=h(t[r],t,a);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(c).then((function(t){l.value=t,o(l)}),(function(t){return i("throw",t,o,s)}))}s(u.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function b(t,e,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return N()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=h(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function M(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function w(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=p,r(x,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:v,configurable:!0}),v.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.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}},t.values=w,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(this.prev>=a.tryLoc){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(a.catchLoc>this.prev)return r(a.catchLoc,!0);if(a.finallyLoc>this.prev)return r(a.finallyLoc)}else if(s){if(a.catchLoc>this.prev)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(a.finallyLoc>this.prev)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var a=i;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,f):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),f},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),T(n),f}},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;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function u(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 l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){u(a,r,i,o,s,"next",t)}function s(t){u(a,r,i,o,s,"throw",t)}o(void 0)}))}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,P(r.key),r)}}function f(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,n){return(e=P(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function g(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}(this,n)}}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},k.apply(this,arguments)}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||S(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return M(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||S(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(t,e){if(t){if("string"==typeof t)return M(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(t,e):void 0}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function T(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=S(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 P(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(n=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>";var w=1e-6,N="undefined"!=typeof Float32Array?Float32Array:Array;function C(){var t=new N(9);return N!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function A(){var t=new N(16);return N!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function O(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function L(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=v,t[14]=p,t[15]=y,t}function R(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function I(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function D(t,e){var 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],y=e[14],g=e[15],m=n*s-r*o,x=n*u-i*o,k=n*l-a*o,E=r*u-i*s,b=r*l-a*s,S=i*l-a*u,M=c*p-h*v,T=c*y-f*v,P=c*g-d*v,w=h*y-f*p,N=h*g-d*p,C=f*g-d*y,A=m*C-x*N+k*w+E*P-b*T+S*M;return A?(t[0]=(s*C-u*N+l*w)*(A=1/A),t[1]=(i*N-r*C-a*w)*A,t[2]=(p*S-y*b+g*E)*A,t[3]=(f*b-h*S-d*E)*A,t[4]=(u*P-o*C-l*T)*A,t[5]=(n*C-i*P+a*T)*A,t[6]=(y*k-v*S-g*x)*A,t[7]=(c*S-f*k+d*x)*A,t[8]=(o*N-s*P+l*M)*A,t[9]=(r*P-n*N-a*M)*A,t[10]=(v*b-p*k+g*m)*A,t[11]=(h*k-c*b-d*m)*A,t[12]=(s*T-o*w-u*M)*A,t[13]=(n*w-r*T+i*M)*A,t[14]=(p*x-v*E-y*m)*A,t[15]=(c*E-h*x+f*m)*A,t):null}function _(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],d=t[12],v=t[13],p=t[14],y=t[15];return(e*o-n*a)*(h*y-f*p)-(e*s-r*a)*(c*y-f*v)+(e*u-i*a)*(c*p-h*v)+(n*s-r*o)*(l*y-f*d)-(n*u-i*o)*(l*p-h*d)+(r*u-i*s)*(l*v-c*d)}function G(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],x=n[0],k=n[1],E=n[2],b=n[3];return t[0]=x*r+k*s+E*h+b*p,t[1]=x*i+k*u+E*f+b*y,t[2]=x*a+k*l+E*d+b*g,t[3]=x*o+k*c+E*v+b*m,t[4]=(x=n[4])*r+(k=n[5])*s+(E=n[6])*h+(b=n[7])*p,t[5]=x*i+k*u+E*f+b*y,t[6]=x*a+k*l+E*d+b*g,t[7]=x*o+k*c+E*v+b*m,t[8]=(x=n[8])*r+(k=n[9])*s+(E=n[10])*h+(b=n[11])*p,t[9]=x*i+k*u+E*f+b*y,t[10]=x*a+k*l+E*d+b*g,t[11]=x*o+k*c+E*v+b*m,t[12]=(x=n[12])*r+(k=n[13])*s+(E=n[14])*h+(b=n[15])*p,t[13]=x*i+k*u+E*f+b*y,t[14]=x*a+k*l+E*d+b*g,t[15]=x*o+k*c+E*v+b*m,t}function U(t,e,n){var r,i,a,o,s,u,l,c,h,f,d,v,p=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*g+e[12],t[13]=e[1]*p+e[5]*y+e[9]*g+e[13],t[14]=e[2]*p+e[6]*y+e[10]*g+e[14],t[15]=e[3]*p+e[7]*y+e[11]*g+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=v,t[12]=r*p+s*y+h*g+e[12],t[13]=i*p+u*y+f*g+e[13],t[14]=a*p+l*y+d*g+e[14],t[15]=o*p+c*y+v*g+e[15]),t}function B(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function F(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function V(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function j(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Y(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,d=i*u,v=i*l,p=a*l,y=o*s,g=o*u,m=o*l;return t[0]=1-(d+p),t[1]=h+m,t[2]=f-g,t[3]=0,t[4]=h-m,t[5]=1-(c+p),t[6]=v+y,t[7]=0,t[8]=f+g,t[9]=v-y,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function X(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function H(t,e){var n=e[4],r=e[5],i=e[6],a=e[8],o=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(a,o,s),t}function W(t,e){var n=new N(3);H(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,u=e[2]*a,l=e[4]*r,c=e[5]*i,h=e[6]*a,f=e[8]*r,d=e[9]*i,v=e[10]*a,p=o+c+v,y=0;return p>0?(t[3]=.25*(y=2*Math.sqrt(p+1)),t[0]=(h-d)/y,t[1]=(f-u)/y,t[2]=(s-l)/y):o>c&&o>v?(t[3]=(h-d)/(y=2*Math.sqrt(1+o-c-v)),t[0]=.25*y,t[1]=(s+l)/y,t[2]=(f+u)/y):c>v?(t[3]=(f-u)/(y=2*Math.sqrt(1+c-o-v)),t[0]=(s+l)/y,t[1]=.25*y,t[2]=(h+d)/y):(t[3]=(s-l)/(y=2*Math.sqrt(1+v-o-c)),t[0]=(f+u)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function z(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,d=a*c,v=a*h,p=o*c,y=o*h,g=s*h,m=u*l,x=u*c,k=u*h,E=r[0],b=r[1],S=r[2],M=i[0],T=i[1],P=i[2],w=(1-(p+g))*E,N=(d+k)*E,C=(v-x)*E,A=(d-k)*b,O=(1-(f+g))*b,L=(y+m)*b,R=(v+x)*S,I=(y-m)*S,D=(1-(f+p))*S;return t[0]=w,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=L,t[7]=0,t[8]=R,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+M-(w*M+A*T+R*P),t[13]=n[1]+T-(N*M+O*T+I*P),t[14]=n[2]+P-(C*M+L*T+D*P),t[15]=1,t}function q(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,d=i*s,v=i*u,p=a*o,y=a*s,g=a*u;return t[0]=1-h-v,t[1]=c+g,t[2]=f-y,t[3]=0,t[4]=c-g,t[5]=1-l-v,t[6]=d+p,t[7]=0,t[8]=f+y,t[9]=d-p,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function K(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(a=1/(r-i)),t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}function Z(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Q=Z;function $(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v=e[0],p=e[1],y=e[2],g=r[0],m=r[1],x=r[2],k=n[0],E=n[1],b=n[2];return w>Math.abs(v-k)&&w>Math.abs(p-E)&&w>Math.abs(y-b)?R(t):(d=1/Math.hypot(c=v-k,h=p-E,f=y-b),(d=Math.hypot(i=m*(f*=d)-x*(h*=d),a=x*(c*=d)-g*f,o=g*h-m*c))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),(d=Math.hypot(s=h*o-f*a,u=f*i-c*o,l=c*a-h*i))?(s*=d=1/d,u*=d,l*=d):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=f,t[11]=0,t[12]=-(i*v+a*p+o*y),t[13]=-(s*v+u*p+l*y),t[14]=-(c*v+h*p+f*y),t[15]=1,t)}function J(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var tt=Object.freeze({__proto__:null,create:A,clone:function(t){var e=new N(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:O,fromValues:function(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p){var y=new N(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=u,y[9]=l,y[10]=c,y[11]=h,y[12]=f,y[13]=d,y[14]=v,y[15]=p,y},set:L,identity:R,transpose:I,invert:D,adjoint:function(t,e){var 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],y=e[14],g=e[15];return t[0]=s*(f*g-d*y)-h*(u*g-l*y)+p*(u*d-l*f),t[1]=-(r*(f*g-d*y)-h*(i*g-a*y)+p*(i*d-a*f)),t[2]=r*(u*g-l*y)-s*(i*g-a*y)+p*(i*l-a*u),t[3]=-(r*(u*d-l*f)-s*(i*d-a*f)+h*(i*l-a*u)),t[4]=-(o*(f*g-d*y)-c*(u*g-l*y)+v*(u*d-l*f)),t[5]=n*(f*g-d*y)-c*(i*g-a*y)+v*(i*d-a*f),t[6]=-(n*(u*g-l*y)-o*(i*g-a*y)+v*(i*l-a*u)),t[7]=n*(u*d-l*f)-o*(i*d-a*f)+c*(i*l-a*u),t[8]=o*(h*g-d*p)-c*(s*g-l*p)+v*(s*d-l*h),t[9]=-(n*(h*g-d*p)-c*(r*g-a*p)+v*(r*d-a*h)),t[10]=n*(s*g-l*p)-o*(r*g-a*p)+v*(r*l-a*s),t[11]=-(n*(s*d-l*h)-o*(r*d-a*h)+c*(r*l-a*s)),t[12]=-(o*(h*y-f*p)-c*(s*y-u*p)+v*(s*f-u*h)),t[13]=n*(h*y-f*p)-c*(r*y-i*p)+v*(r*f-i*h),t[14]=-(n*(s*y-u*p)-o*(r*y-i*p)+v*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+c*(r*u-i*s),t},determinant:_,multiply:G,translate:U,scale:B,rotate:function(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v,p,y,g,m,x,k,E,b,S,M,T,P,N,C=r[0],A=r[1],O=r[2],L=Math.hypot(C,A,O);return w>L?null:(C*=L=1/L,A*=L,O*=L,i=Math.sin(n),u=e[1],l=e[2],c=e[3],f=e[5],d=e[6],v=e[7],y=e[9],g=e[10],m=e[11],b=C*A*(o=1-(a=Math.cos(n)))-O*i,S=A*A*o+a,M=O*A*o+C*i,T=C*O*o+A*i,P=A*O*o-C*i,N=O*O*o+a,t[0]=(s=e[0])*(x=C*C*o+a)+(h=e[4])*(k=A*C*o+O*i)+(p=e[8])*(E=O*C*o-A*i),t[1]=u*x+f*k+y*E,t[2]=l*x+d*k+g*E,t[3]=c*x+v*k+m*E,t[4]=s*b+h*S+p*M,t[5]=u*b+f*S+y*M,t[6]=l*b+d*S+g*M,t[7]=c*b+v*S+m*M,t[8]=s*T+h*P+p*N,t[9]=u*T+f*P+y*N,t[10]=l*T+d*P+g*N,t[11]=c*T+v*P+m*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:F,rotateY:V,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:j,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,a,o=n[0],s=n[1],u=n[2],l=Math.hypot(o,s,u);return w>l?null:(o*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=o*o*(a=1-(i=Math.cos(e)))+i,t[1]=s*o*a+u*r,t[2]=u*o*a-s*r,t[3]=0,t[4]=o*s*a-u*r,t[5]=s*s*a+i,t[6]=u*s*a+o*r,t[7]=0,t[8]=o*u*a+s*r,t[9]=s*u*a-o*r,t[10]=u*u*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:Y,fromQuat2:function(t,e){var n=new N(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+a*a+o*o;return h>0?(n[0]=2*(s*o+c*r+u*a-l*i)/h,n[1]=2*(u*o+c*i+l*r-s*a)/h,n[2]=2*(l*o+c*a+s*i-u*r)/h):(n[0]=2*(s*o+c*r+u*a-l*i),n[1]=2*(u*o+c*i+l*r-s*a),n[2]=2*(l*o+c*a+s*i-u*r)),Y(t,e,n),t},getTranslation:X,getScaling:H,getRotation:W,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,d=i*c,v=a*l,p=a*c,y=o*c,g=s*u,m=s*l,x=s*c,k=r[0],E=r[1],b=r[2];return t[0]=(1-(v+y))*k,t[1]=(f+x)*k,t[2]=(d-m)*k,t[3]=0,t[4]=(f-x)*E,t[5]=(1-(h+y))*E,t[6]=(p+g)*E,t[7]=0,t[8]=(d+m)*b,t[9]=(p-g)*b,t[10]=(1-(h+v))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:z,fromQuat:q,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:K,perspective:K,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(a=1/(r-i)),t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Z,ortho:Q,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*l,t[15]=1,t},lookAt:$,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=a-n[1],f=o-n[2],d=c*c+h*h+f*f;d>0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var v=u*f-l*h,p=l*c-s*f,y=s*h-u*c;return(d=v*v+p*p+y*y)>0&&(v*=d=1/Math.sqrt(d),p*=d,y*=d),t[0]=v,t[1]=p,t[2]=y,t[3]=0,t[4]=h*y-f*p,t[5]=f*v-c*y,t[6]=c*p-h*v,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:J,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],f=t[10],d=t[11],v=t[12],p=t[13],y=t[14],g=t[15],m=e[0],x=e[1],k=e[2],E=e[3],b=e[4],S=e[5],M=e[6],T=e[7],P=e[8],N=e[9],C=e[10],A=e[11],O=e[12],L=e[13],R=e[14],I=e[15];return!(Math.abs(n-m)>w*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-x)>w*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(i-k)>w*Math.max(1,Math.abs(i),Math.abs(k))||Math.abs(a-E)>w*Math.max(1,Math.abs(a),Math.abs(E))||Math.abs(o-b)>w*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(s-S)>w*Math.max(1,Math.abs(s),Math.abs(S))||Math.abs(u-M)>w*Math.max(1,Math.abs(u),Math.abs(M))||Math.abs(l-T)>w*Math.max(1,Math.abs(l),Math.abs(T))||Math.abs(c-P)>w*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(h-N)>w*Math.max(1,Math.abs(h),Math.abs(N))||Math.abs(f-C)>w*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>w*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(v-O)>w*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(p-L)>w*Math.max(1,Math.abs(p),Math.abs(L))||Math.abs(y-R)>w*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(g-I)>w*Math.max(1,Math.abs(g),Math.abs(I)))},mul:G,sub:J});function et(){var t=new N(3);return N!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function nt(t){return Math.hypot(t[0],t[1],t[2])}function rt(t,e,n){var r=new N(3);return r[0]=t,r[1]=e,r[2]=n,r}function it(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function at(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ot(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function st(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ut(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function lt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ct(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function ht(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function ft(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return w*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&w*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)&&w*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var dt,vt=nt;dt=et();function pt(){var t=new N(4);return N!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function yt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}!function(){var t=pt()}();function gt(){var t=new N(4);return N!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function mt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function xt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function kt(t,e,n,r){var i,a,o,s,u,l=e[0],c=e[1],h=e[2],f=e[3],d=n[0],v=n[1],p=n[2],y=n[3];return 0>(a=l*d+c*v+h*p+f*y)&&(a=-a,d=-d,v=-v,p=-p,y=-y),1-a>w?(o=Math.sin(i=Math.acos(a)),s=Math.sin((1-r)*i)/o,u=Math.sin(r*i)/o):(s=1-r,u=r),t[0]=s*l+u*d,t[1]=s*c+u*v,t[2]=s*h+u*p,t[3]=s*f+u*y,t}function Et(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function bt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var a=Math.sin(e*=i),o=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=a*u*c-o*s*l,t[1]=o*s*c+a*u*l,t[2]=o*u*l-a*s*c,t[3]=o*u*c+a*s*l,t}var St,Mt,Tt,Pt,wt,Nt,Ct=function(t,e,n,r){var i=new N(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},At=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ot=xt,Lt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};St=et(),Mt=rt(1,0,0),Tt=rt(0,1,0),Pt=gt(),wt=gt(),Nt=C();!function(){var t,e=(t=new N(2),N!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Rt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var It=function(){return It=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},It.apply(this,arguments)},Dt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function _t(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Gt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ut(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Gt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Bt(t){return Ut(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Ft(t){return Bt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Vt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Gt[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Gt[n]))),Gt[n]););}function jt(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Yt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Xt(t){return t>=48&&57>=t}function Ht(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Xt(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Xt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>a&&Xt(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Xt(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid float exponent');if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!Xt(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid integer exponent');for(;n>a&&Xt(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+a+', "pathValue" is missing param'}function Wt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function zt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=Gt[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Wt(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?Ht(t):jt(t),t.err.length)return;t.data.push(t.param),Wt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Wt(t))}if(t.index>=t.max)break;if(!Yt(n.charCodeAt(t.index)))break}Vt(t)}else Vt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var qt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Kt(t){if(Bt(t))return Rt(t);var e=function(t){if(Ut(t))return Rt(t);var e=new qt(t);for(Wt(e);e.max>e.index&&!e.err.length;)zt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e}))}function Zt(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var d=s[1];e.qx=s[0],e.qy=d}return u}function Qt(t){if(Ft(t))return Rt(t);for(var e=Kt(t),n=It({},Dt),r=0;e.length>r;r+=1){e[r]=Zt(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function $t(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Jt(t,e,n,r,i,a,o,s,u,l){var c,h,f,d,v,p=t,y=e,g=n,m=r,x=s,k=u,E=120*Math.PI/180,b=Math.PI/180*(+i||0),S=[];if(l)h=l[0],f=l[1],d=l[2],v=l[3];else{y=(c=$t(p,y,-b)).y;var M=((p=c.x)-(x=(c=$t(x,k,-b)).x))/2,T=(y-(k=c.y))/2,P=M*M/(g*g)+T*T/(m*m);P>1&&(g*=P=Math.sqrt(P),m*=P);var w=g*g,N=m*m,C=(a===o?-1:1)*Math.sqrt(Math.abs((w*N-w*T*T-N*M*M)/(w*T*T+N*M*M)));d=C*g*T/m+(p+x)/2,h=Math.asin(((y-(v=C*-m*M/g+(y+k)/2))/m*1e9>>0)/1e9),f=Math.asin(((k-v)/m*1e9>>0)/1e9),0>(h=d>p?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>x?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>E){var O=f,L=x,R=k;S=Jt(x=d+g*Math.cos(f=h+E*(o&&f>h?1:-1)),k=v+m*Math.sin(f),g,m,i,0,o,L,R,[f,O,d,v])}A=f-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(f),G=Math.sin(f),U=Math.tan(A/4),B=4/3*g*U,F=4/3*m*U,V=[p,y],j=[p+B*D,y-F*I],Y=[x+B*G,k-F*_],X=[x,k];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],l)return j.concat(Y,X,S);for(var H=[],W=0,z=(S=j.concat(Y,X,S)).length;z>W;W+=1)H[W]=W%2?$t(S[W-1],S[W],b).y:$t(S[W],S[W+1],b).x;return H}function te(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ee(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ne(t,e,n,r,i){var a=ee([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=te([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function re(t,e,n,r){var i=.5,a=[t,e],o=[n,r],s=te(a,o,i),u=te(o,s,i),l=te(s,u,i),c=te(u,l,i),h=te(l,c,i),f=ne(a[0],a[1],s[0],s[1],l[0]).point,d=ne(h[0],h[1],c[0],c[1],u[0]).point;return[f.x,f.y,d.x,d.y,n,r]}function ie(t,e){var n,r,i,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],d=e.x1,v=e.y1,p=e.x,y=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,v].concat(c),["C"].concat(Jt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[d,v].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(re(d,v,h,f));case"Z":return d===p&&v===y?["C",d,v,p,y,p,y]:["C"].concat(re(d,v,p,y))}return t}function ae(t,e){if(void 0===e&&(e=!1),function(t){return Ft(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=Rt(t);return e?[n,[]]:n}for(var r,i,a=Qt(t),o=It({},Dt),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=ie(a[h],o);a[h]=f,_t(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function oe(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function se(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=c(n),y=c(r),g=(i%360+360)%360*(v/180);if(t===s&&e===u)return{x:t,y:e};if(0===p||0===y)return ne(t,e,s,u,l).point;var m=(t-s)/2,x=(e-u)/2,k={x:f(g)*m+h(g)*x,y:-h(g)*m+f(g)*x},E=Math.pow(k.x,2)/Math.pow(p,2)+Math.pow(k.y,2)/Math.pow(y,2);E>1&&(p*=d(E),y*=d(E));var b=(Math.pow(p,2)*Math.pow(y,2)-Math.pow(p,2)*Math.pow(k.y,2)-Math.pow(y,2)*Math.pow(k.x,2))/(Math.pow(p,2)*Math.pow(k.y,2)+Math.pow(y,2)*Math.pow(k.x,2)),S=(a!==o?1:-1)*d(b=0>b?0:b),M=S*(p*k.y/y),T=S*(-y*k.x/p),P=f(g)*M-h(g)*T+(t+s)/2,w=h(g)*M+f(g)*T+(e+u)/2,N={x:(k.x-M)/p,y:(k.y-T)/y},C=oe({x:1,y:0},N),A=oe(N,{x:(-k.x-M)/p,y:(-k.y-T)/y});!o&&A>0?A-=2*v:o&&0>A&&(A+=2*v);var O=C+(A%=2*v)*l,L=p*f(O),R=y*h(O);return{x:f(g)*L-h(g)*R+P,y:h(g)*L+f(g)*R+w}}function ue(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,v=c.length,p=void 0===v||v,y=c.sampleSize,g=void 0===y?30:y,m="number"==typeof l,x=t,k=e,E=0,b=[x,k,E],S=[x,k],M={x:0,y:0},T=[{x:x,y:k}];m&&0>=l&&(M={x:x,y:k});for(var P=0;g>=P;P+=1){if(x=(h=se(t,e,n,r,i,a,o,s,u,P/g)).x,k=h.y,d&&T.push({x:x,y:k}),p&&(E+=ee(S,[x,k])),S=[x,k],m&&E>=l&&l>b[2]){var w=(E-l)/(E-b[2]);M={x:S[0]*(1-w)+b[0]*w,y:S[1]*(1-w)+b[1]*w}}b=[x,k,E]}return m&&l>=E&&(M={x:s,y:u}),{length:E,point:M,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function le(t,e,n,r,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function ce(t,e,n,r,i,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,d=l.length,v=void 0===d||d,p=l.sampleSize,y=void 0===p?10:p,g="number"==typeof u,m=t,x=e,k=0,E=[m,x,k],b=[m,x],S={x:0,y:0},M=[{x:m,y:x}];g&&0>=u&&(S={x:m,y:x});for(var T=0;y>=T;T+=1){if(m=(c=le(t,e,n,r,i,a,o,s,T/y)).x,x=c.y,f&&M.push({x:m,y:x}),v&&(k+=ee(b,[m,x])),b=[m,x],g&&k>=u&&u>E[2]){var P=(k-u)/(k-E[2]);S={x:b[0]*(1-P)+E[0]*P,y:b[1]*(1-P)+E[1]*P}}E=[m,x,k]}return g&&u>=k&&(S={x:o,y:s}),{length:k,point:S,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function he(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function fe(t,e,n,r,i,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,d=s.sampleSize,v=void 0===d?10:d,p="number"==typeof o,y=t,g=e,m=0,x=[y,g,m],k=[y,g],E={x:0,y:0},b=[{x:y,y:g}];p&&0>=o&&(E={x:y,y:g});for(var S=0;v>=S;S+=1){if(y=(u=he(t,e,n,r,i,a,S/v)).x,g=u.y,c&&b.push({x:y,y:g}),f&&(m+=ee(k,[y,g])),k=[y,g],p&&m>=o&&o>x[2]){var M=(m-o)/(m-x[2]);E={x:k[0]*(1-M)+x[0]*M,y:k[1]*(1-M)+x[1]*M}}x=[y,g,m]}return p&&o>=m&&(E={x:i,y:a}),{length:m,point:E,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}function de(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=Qt(t),d="number"==typeof e,v=[],p=0,y=0,g=0,m=0,x=[],k=[],E=0,b={x:0,y:0},S=b,M=b,T=b,P=0,w=0,N=f.length;N>w;w+=1)v=(l="M"===(c=(h=f[w])[0]))?v:[p,y].concat(h.slice(1)),l?(S=b={x:g=h[1],y:m=h[2]},E=0,d&&.001>e&&(T=b)):"L"===c?(E=(r=ne(v[0],v[1],v[2],v[3],(e||0)-P)).length,b=r.min,S=r.max,M=r.point):"A"===c?(E=(i=ue(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-P,n||{})).length,b=i.min,S=i.max,M=i.point):"C"===c?(E=(a=ce(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-P,n||{})).length,b=a.min,S=a.max,M=a.point):"Q"===c?(E=(o=fe(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-P,n||{})).length,b=o.min,S=o.max,M=o.point):"Z"===c&&(E=(s=ne((v=[p,y,g,m])[0],v[1],v[2],v[3],(e||0)-P)).length,b=s.min,S=s.max,M=s.point),d&&e>P&&P+E>=e&&(T=M),k.push(S),x.push(b),P+=E,p=(u="Z"!==c?h.slice(-2):[g,m])[0],y=u[1];return d&&e>=P&&(T={x:p,y:y}),{length:P,point:T,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function ve(t){return function(t){var e=0,n=0,r=0;return ae(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,d=t.slice(1);return r=3*(((f=d[5])-(o=n))*((s=d[0])+(l=d[2]))-((h=d[4])-(a=e))*((u=d[1])+(c=d[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function pe(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?ce(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=te(n,r,e),s=te(r,i,e),u=te(i,a,e),l=te(o,s,e),c=te(s,u,e),h=te(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}}))}function ye(t,e,n){var r=pe(t),i=pe(e),a=r.length,o=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(a,o),f=[l,c],d=[h-a,h-o],v=0,p=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return d[e]-=(v=n&&d[e]&&t.l>=f[e])?1:0,v?t.ss:[t.s]})).flat()}));return p[0].length===p[1].length?p:ye(p[0],p[1],h)}var ge=function(t){return null==t},me={}.toString,xe=function(t,e){return me.call(t)==="[object "+e+"]"},ke=function(t){return Array.isArray?Array.isArray(t):xe(t,"Array")},Ee=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},be=function(t){if(ke(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Se=function(t){if(ke(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},Me=function(t){return xe(t,"String")},Te=function(t,e,n){return e>t?e:t>n?n:t},Pe=function(t){return xe(t,"Number")},we=1e-5;var Ne,Ce,Ae,Oe,Le,Re=function(t,e){return(t%e+e)%e},Ie=function(t){return xe(t,"Boolean")},De=function(t){return void 0===t};(Ne=t.UnitType||(t.UnitType={}))[Ne.kUnknown=0]="kUnknown",Ne[Ne.kNumber=1]="kNumber",Ne[Ne.kPercentage=2]="kPercentage",Ne[Ne.kEms=3]="kEms",Ne[Ne.kPixels=4]="kPixels",Ne[Ne.kRems=5]="kRems",Ne[Ne.kDegrees=6]="kDegrees",Ne[Ne.kRadians=7]="kRadians",Ne[Ne.kGradians=8]="kGradians",Ne[Ne.kTurns=9]="kTurns",Ne[Ne.kMilliseconds=10]="kMilliseconds",Ne[Ne.kSeconds=11]="kSeconds",Ne[Ne.kInteger=12]="kInteger",function(t){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"}(Ce||(Ce={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Ae||(Ae={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Oe||(Oe={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Le||(Le={}));var _e,Ge=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){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"}(_e||(_e={}));var Ue,Be=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Ge.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Fe=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},Ve=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},je=function(){function e(){c(this,e)}return f(e,[{key:"toString",value:function(){return this.buildCSSText(Oe.kNo,Le.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=_e.kUnitType&&this.getType()<=_e.kClampType}}],[{key:"isAngle",value:function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns}},{key:"isLength",value:function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e}},{key:"isRelativeUnit",value:function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems}},{key:"isTime",value:function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds}}]),e}(),Ye=function(t){v(n,t);var e=x(n);function n(t){var r;return c(this,n),(r=e.call(this)).colorSpace=void 0,r.colorSpace=t,r}return f(n,[{key:"getType",value:function(){return _e.kColorType}},{key:"to",value:function(t){return this}}]),n}(je);(Ue=t.GradientType||(t.GradientType={}))[Ue.Constant=0]="Constant",Ue[Ue.LinearGradient=1]="LinearGradient",Ue[Ue.RadialGradient=2]="RadialGradient";var Xe=function(t){v(n,t);var e=x(n);function n(t,r){var i;return c(this,n),(i=e.call(this)).type=void 0,i.value=void 0,i.type=t,i.value=r,i}return f(n,[{key:"clone",value:function(){return new n(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return _e.kColorType}}]),n}(je),He=function(t){v(n,t);var e=x(n);function n(t){var r;return c(this,n),(r=e.call(this)).value=void 0,r.value=t,r}return f(n,[{key:"clone",value:function(){return new n(this.value)}},{key:"getType",value:function(){return _e.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}]),n}(je);function We(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){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(We.Cache||Map),n}We.Cache=Map;var ze=We((function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),qe=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Ke(t){return"function"==typeof t}var Ze={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Qe=We((function(t){var e=ze(t),n=Ze[e];return e=(null==n?void 0:n.alias)||e})),$e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Je=function(e){return function(e){switch(e){case Ce.kUNumber:return t.UnitType.kNumber;case Ce.kULength:return t.UnitType.kPixels;case Ce.kUPercent:return t.UnitType.kPercentage;case Ce.kUTime:return t.UnitType.kSeconds;case Ce.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Ce.kUNumber;case t.UnitType.kPercentage:return Ce.kUPercent;case t.UnitType.kPixels:return Ce.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Ce.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Ce.kUAngle;default:return Ce.kUOther}}(e))},tn=function(e){v(r,e);var n=x(r);function r(e){var i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.UnitType.kNumber;return c(this,r),(i=n.call(this)).unit=void 0,i.value=void 0,a="string"==typeof o?Be(o):o,i.unit=a,i.value=e,i}return f(r,[{key:"clone",value:function(){return new r(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return _e.kUnitType}},{key:"convertTo",value:function(e){if(this.unit===e)return new r(this.value,this.unit);var n=Je(this.unit);if(n!==Je(e)||n===t.UnitType.kUnknown)return null;var i=Fe(this.unit)/Fe(e);return new r(this.value*i,e)}},{key:"buildCSSText",value:function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var a=this.value,o=Ve(this.unit);if(-999999>a||a>999999){var s=Ve(this.unit);i=!Number.isFinite(a)||Number.isNaN(a)?$e(a,s):a+(s||"")}else i="".concat(a).concat(o)}return r+=i}}]),r}(je),en=new tn(0,"px"),nn=(new tn(1,"px"),new tn(0,"deg")),rn=function(t){v(n,t);var e=x(n);function n(t,r,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return c(this,n),(a=e.call(this,"rgb")).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=t,a.g=r,a.b=i,a.alpha=o,a.isNone=s,a}return f(n,[{key:"clone",value:function(){return new n(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}]),n}(Ye),an={number:function(t){return new tn(t)},percent:function(t){return new tn(t,"%")},px:function(t){return new tn(t,"px")},em:function(t){return new tn(t,"em")},rem:function(t){return new tn(t,"rem")},deg:function(t){return new tn(t,"deg")},grad:function(t){return new tn(t,"grad")},rad:function(t){return new tn(t,"rad")},turn:function(t){return new tn(t,"turn")},s:function(t){return new tn(t,"s")},ms:function(t){return new tn(t,"ms")},registerProperty:function(t){ms.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){ms.layoutRegistry.registerLayout(t,e)}},on=new He("unset"),sn=new He("initial"),un=new He("inherit"),ln={"":on,unset:on,initial:sn,inherit:un},cn=function(t){return ln[t]||(ln[t]=new He(t)),ln[t]},hn=new rn(0,0,0,0,!0),fn=new rn(0,0,0,0),dn=We((function(t,e,n,r){return new rn(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),vn=function(e){return new tn(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.UnitType.kNumber)},pn=new tn(50,"%");function yn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function gn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function mn(){}var xn=.7,kn=1/xn,En="\\s*([+-]?\\d+)\\s*",bn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mn=/^#([0-9a-f]{3,8})$/,Tn=RegExp("^rgb\\("+[En,En,En]+"\\)$"),Pn=RegExp("^rgb\\("+[Sn,Sn,Sn]+"\\)$"),wn=RegExp("^rgba\\("+[En,En,En,bn]+"\\)$"),Nn=RegExp("^rgba\\("+[Sn,Sn,Sn,bn]+"\\)$"),Cn=RegExp("^hsl\\("+[bn,Sn,Sn]+"\\)$"),An=RegExp("^hsla\\("+[bn,Sn,Sn,bn]+"\\)$"),On={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ln(){return this.rgb().formatHex()}function Rn(){return this.rgb().formatRgb()}function In(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Mn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Dn(e):3===n?new Gn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?_n(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?_n(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Tn.exec(t))?new Gn(e[1],e[2],e[3],1):(e=Pn.exec(t))?new Gn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=wn.exec(t))?_n(e[1],e[2],e[3],e[4]):(e=Nn.exec(t))?_n(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Cn.exec(t))?Vn(e[1],e[2]/100,e[3]/100,1):(e=An.exec(t))?Vn(e[1],e[2]/100,e[3]/100,e[4]):On.hasOwnProperty(t)?Dn(On[t]):"transparent"===t?new Gn(NaN,NaN,NaN,0):null}function Dn(t){return new Gn(t>>16&255,t>>8&255,255&t,1)}function _n(t,e,n,r){return r>0||(t=e=n=NaN),new Gn(t,e,n,r)}function Gn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Un(){return"#"+Fn(this.r)+Fn(this.g)+Fn(this.b)}function Bn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Fn(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Vn(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Yn(t,e,n,r)}function jn(t){if(t instanceof Yn)return new Yn(t.h,t.s,t.l,t.opacity);if(t instanceof mn||(t=In(t)),!t)return new Yn;if(t instanceof Yn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new Yn(o,s,u,t.opacity)}function Yn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Xn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}yn(mn,In,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ln,formatHex:Ln,formatHsl:function(){return jn(this).formatHsl()},formatRgb:Rn,toString:Rn}),yn(Gn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof mn||(i=In(i)),i?new Gn((i=i.rgb()).r,i.g,i.b,i.opacity):new Gn):new Gn(t,e,n,null==r?1:r);var i}),gn(mn,{brighter:function(t){return new Gn(this.r*(t=null==t?kn:Math.pow(kn,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Gn(this.r*(t=null==t?xn:Math.pow(xn,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Un,formatHex:Un,formatRgb:Bn,toString:Bn})),yn(Yn,(function(t,e,n,r){return 1===arguments.length?jn(t):new Yn(t,e,n,null==r?1:r)}),gn(mn,{brighter:function(t){return new Yn(this.h,this.s,this.l*(t=null==t?kn:Math.pow(kn,t)),this.opacity)},darker:function(t){return new Yn(this.h,this.s,this.l*(t=null==t?xn:Math.pow(xn,t)),this.opacity)},rgb:function(){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 Gn(Xn(240>t?t+120:t-240,r,n),Xn(t,r,n),Xn(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Hn={},Wn=0;var zn="undefined"!=typeof window&&void 0!==window.document;function qn(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Kn(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 Zn(t,e){if(zn)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Qn="Method not implemented.",$n="Use document.documentElement instead.",Jn={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function tr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function er(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function nr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function rr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function ir(t){return void 0===t?0:t>360||-360>t?t%360:t}function ar(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Array.isArray(t)&&3===t.length?(e=t,(n=new N(3))[0]=e[0],n[1]=e[1],n[2]=e[2],n):Pe(t)?rt(t,r,i):rt(t[0],t[1]||r,t[2]||i)}function or(t){return t*(Math.PI/180)}function sr(t){return t*(180/Math.PI)}function ur(t){return 360*t}function lr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,a=E(H(et(),e),3),o=a[0],s=a[1],u=a[2],l=Math.asin(-e[2]/o);return i>l?l>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,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]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-Math.PI/2,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),y=Math.sin(t);return a=r*p,o=i*y,s=0,u=-r*y,l=i*p,c=0,h=e,f=n,d=1,(v=new N(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);0>e*i-n*r&&(i>e?a=-a:o=-o),a&&(e*=1/a,n*=1/a),o&&(r*=1/o,i*=1/o);var s=sr(Math.atan2(n,e));return[t[6],t[7],a,o,s]}var fr=A(),dr=A(),vr=pt(),pr=[et(),et(),et()],yr=et();function gr(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 mr=A();function xr(t,e){if(t&&t.length){var n=0,r=0;e?(n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0,e.resetLocalTransform(),e.setLocalPosition(n,r)):e=new vo({}),t.forEach((function(t){var i=t.t,a=t.d;if("scale"===i){var o=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];e.scaleLocal(o[0],o[1],1)}else if("scalex"===i){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(s[0],1,1)}else if("scaley"===i){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,u[0],1)}else if("scalez"===i){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,l[0])}else if("scale3d"===i){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(c[0],c[1],c[2])}else if("translate"===i){var h=a||[en,en];e.translateLocal(h[0].value,h[1].value,0)}else if("translatex"===i){e.translateLocal((a||[en])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(a||[en])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(a||[en])[0].value)}else if("translate3d"===i){var f=a||[en,en,en];e.translateLocal(f[0].value,f[1].value,f[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Li((a||[nn])[0]))}else if("rotatex"===i){e.rotateLocal(Li((a||[nn])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Li((a||[nn])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Li((a||[nn])[0]))}else if("rotate3d"===i);else if("skew"===i){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];e.setLocalSkew(or(d[0]),or(d[1]))}else if("skewx"===i){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(or(v[0]),e.getLocalSkew()[1])}else if("skewy"===i){var p=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],or(p[0]))}else if("matrix"===i){var y=E(a.map((function(t){return t.value})),6);e.setLocalTransform(L(mr,y[0],y[1],0,0,y[2],y[3],0,0,0,0,1,0,y[4]+n,y[5]+r,0,1))}else"matrix3d"===i&&(L.apply(tt,[mr].concat(b(a.map((function(t){return t.value}))))),mr[12]+=n,mr[13]+=r,e.setLocalTransform(mr))}))}return e.getLocalTransform()}function kr(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(","),")")}var Er=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(e+": "+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&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:a,colorStops:d(v)}}))}function o(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var a=r(i);return x(t.endCall)||n("Missing )"),a}}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=m("shape",/^(circle)/i,0);t&&(t.style=g()||c());return t}()||function(){var t=m("shape",/^(ellipse)/i,0);t&&(t.style=y()||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 m("extent-keyword",t.extentKeywords,1)}function h(){if(m("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:y(),y:y()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function v(){var e=m("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:d(p)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:d(p)}}))||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=y(),e}function p(){return x(t.number)[1]}function y(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&k(n[0].length);var r=t.exec(e);return r&&k(r[0].length),r}function k(t){e=e.substring(t)}return function(t){return e=t,r()}}();function br(t){return function(t){if(Array.isArray(t))return Mr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Sr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(t,e){if(t){if("string"==typeof t)return Mr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(t,e):void 0}}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function Tr(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function Pr(t,e){return.001>Math.abs(t-e)}function wr(t,e){var n=Math.min.apply(Math,br(t)),r=Math.min.apply(Math,br(e));return{x:n,y:r,width:Math.max.apply(Math,br(t))-n,height:Math.max.apply(Math,br(e))-r}}var Nr={box:function(t,e,n,r){return wr([t,n],[e,r])},length:function(t,e,n,r){return Tr(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return 0>o?Tr(t,e,i,a):o>(n-t)*(n-t)+(r-e)*(r-e)?Tr(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,a-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Cr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ar(t,e,n){var r=t+n-2*e;if(Pr(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var Or=function(t,e,n,r,i,a){var o=Ar(t,n,i)[0],s=Ar(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(Cr(t,n,i,o)),void 0!==s&&l.push(Cr(e,r,a,s)),wr(u,l)};function Lr(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 Rr(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(Pr(s,0))Pr(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;Pr(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}var Ir=function(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=Rr(t,n,i,o),h=Rr(e,r,a,s),f=0;c.length>f;f++)u.push(Lr(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(Lr(e,r,a,s,h[d]));return wr(u,l)};function Dr(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function _r(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}var Gr=function(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=Dr(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),y=1/0,g=-1/0,m=[a,o],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var k=p+x;o>a?k>a&&o>k&&m.push(k):k>o&&a>k&&m.push(k)}for(var E=0;m.length>E;E++){var b=_r(0,e,n,r,i,m[E]);y>b&&(y=b),b>g&&(g=b)}return{x:u,y:y,width:l-u,height:g-y}};var Ur,Br=function(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+=Tr(r[0],r[1],i[0],i[1])}return e}(t)};function Fr(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=de(t.parsedStyle.path.absolutePath,void 0,It(It({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Vr(t,e){return t[0]===e[0]&&t[1]===e[1]}function jr(t,e){var n,r=t.prePoint,i=t.currentPoint,a=t.nextPoint,o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2),u=Math.acos((o+s-(Math.pow(r[0]-a[0],2)+Math.pow(r[1]-a[1],2)))/(2*Math.sqrt(o)*Math.sqrt(s)));if(!u||0===Math.sin(u)||(void 0===n&&(n=we),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(a[1]-i[1],a[0]-i[0])),c=Math.abs(Math.atan2(a[0]-i[0],a[1]-i[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-(l=l>Math.PI/2?Math.PI-l:l))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function Yr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(Ur=t.Shape||(t.Shape={})).GROUP="g",Ur.CIRCLE="circle",Ur.ELLIPSE="ellipse",Ur.IMAGE="image",Ur.RECT="rect",Ur.LINE="line",Ur.POLYLINE="polyline",Ur.POLYGON="polygon",Ur.TEXT="text",Ur.PATH="path",Ur.HTML="html",Ur.MESH="mesh";var Xr=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))))},Hr=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=or(r=Re(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),y=v*(-n*h.x/e),g={x:Math.cos(u)*p-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*y+(t.y+o.y)/2},m={x:(h.x-p)/e,y:(h.y-y)/n},x=Xr({x:1,y:0},m),k=Xr(m,{x:(-h.x-p)/e,y:(-h.y-y)/n});!a&&k>0?k-=2*Math.PI:a&&0>k&&(k+=2*Math.PI);var E=x+(k%=2*Math.PI)*s,b=e*Math.cos(E),S=n*Math.sin(E);return{x:Math.cos(u)*b-Math.sin(u)*S+g.x,y:Math.sin(u)*b+Math.cos(u)*S+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+k,ellipticalArcAngle:E,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Wr(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=Hr({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Hr({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 zr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qr(t,e){return zr(t)*zr(e)?(t[0]*e[0]+t[1]*e[1])/(zr(t)*zr(e)):1}function Kr(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(qr(t,e))}function Zr(t,e){var n=e[1],r=e[2],i=Re(or(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 y=r?p*n*f/r:0,g=n?p*-r*h/n:0,m=(s+l)/2+Math.cos(i)*y-Math.sin(i)*g,x=(u+c)/2+Math.sin(i)*y+Math.cos(i)*g,k=[(h-y)/n,(f-g)/r],E=[(-1*h-y)/n,(-1*f-g)/r],b=Kr([1,0],k),S=Kr(k,E);return qr(k,E)>-1||(S=Math.PI),1>qr(k,E)||(S=0),0===o&&S>0&&(S-=2*Math.PI),1===o&&0>S&&(S+=2*Math.PI),{cx:m,cy:x,rx:Vr(t,[l,c])?0:n,ry:Vr(t,[l,c])?0:r,startAngle:b,endAngle:b+S,xRotation:i,arcFlag:a,sweepFlag:o}}function Qr(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 $r=function(){function t(){c(this,t),this.callbacks=[]}return f(t,[{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)})))}}]),t}(),Jr=function(){function t(){c(this,t),this.callbacks=[]}var e;return f(t,[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(e=l(o().mark((function t(){var e,n,r,i,a=arguments;return o().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 e.apply(this,arguments)})}]),t}(),ti=function(){function t(){c(this,t),this.callbacks=[]}return f(t,[{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];this.callbacks.forEach((function(t){t.apply(void 0,e)}))}}]),t}(),ei=function(){function t(){c(this,t),this.callbacks=[]}return f(t,[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){if(this.callbacks.length){for(var t,e=(t=this.callbacks)[0].apply(t,arguments),n=0;this.callbacks.length-1>n;n++){e=(0,this.callbacks[n])(e)}return e}return null}}]),t}(),ni=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ri=/([\"\'])[^\'\"]+\1/;var ii=1,ai="object"===("undefined"==typeof self?"undefined":s(self))&&self.self==self?self:"object"===("undefined"==typeof global?"undefined":s(global))&&global.global==global?global:{},oi=Date.now(),si={},ui=Date.now(),li=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-ui,r=n>16?0:16-n,i=ii++;return si[i]=t,Object.keys(si).length>1||setTimeout((function(){ui=e;var t=si;si={},Object.keys(t).forEach((function(e){return t[e](ai.performance&&"function"==typeof ai.performance.now?ai.performance.now():Date.now()-oi)}))}),r),i},ci=function(t){delete si[t]},hi=function(t){return"string"!=typeof t?li:""===t?ai.requestAnimationFrame:ai[t+"RequestAnimationFrame"]},fi=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!!hi(t)})),di=hi(fi),vi=function(t){return"string"!=typeof t?ci:""===t?ai.cancelAnimationFrame:ai[t+"CancelAnimationFrame"]||ai[t+"CancelRequestAnimationFrame"]}(fi);ai.requestAnimationFrame=di,ai.cancelAnimationFrame=vi;var pi=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,yi=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,gi=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,mi=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var xi={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},ki=We((function(t){return vn("angular"===t.type?Number(t.value):xi[t.value]||0,"deg")})),Ei=We((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:vn(e,r),cy:vn(n,i)}})),bi=We((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Er(e).map((function(e){var n=e.type,r=e.orientation,i=e.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(!ge(u)&&!ge(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)}}}(i);var a=i.map((function(t){return{offset:vn(Number(t.length.value),"%"),color:kr(t)}}));if("linear-gradient"===n)return new Xe(t.GradientType.LinearGradient,{angle:r?ki(r):nn,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var o,s=Ei(r[0].at),u=s.cx,l=s.cy;if(r[0].style){var c=r[0].style,h=c.type,f=c.value;o="extent-keyword"===h?cn(f):vn(f,h)}return new Xe(t.GradientType.RadialGradient,{cx:u,cy:l,size:o,steps:a})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=pi.exec(e);if(r){var i,a=(null===(i=r[2].match(mi))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Xe(t.GradientType.LinearGradient,{angle:vn(parseFloat(r[1]),"deg"),steps:a.map((function(t){var e=E(t,2),n=e[1];return{offset:vn(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===n){var o=function(t){var e=yi.exec(t);if(e){var n,r=(null===(n=e[4].match(mi))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:vn(50,"%"),cy:vn(50,"%"),steps:r.map((function(t){var e=E(t,2),n=e[1];return{offset:vn(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(o){if(!Me(o))return[new Xe(t.GradientType.RadialGradient,o)];e=o}}else if("p"===n)return function(t){var e=gi.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}(e)}));function Si(t){return t&&!!t.image}function Mi(t){return t&&!ge(t.r)&&!ge(t.g)&&!ge(t.b)}var Ti=We((function(t){if(Si(t))return a({repetition:"repeat"},t);if(ge(t)&&(t=""),"transparent"===t)return fn;"currentColor"===t&&(t="black");var e=bi(t);if(e)return e;var n=In(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),dn.apply(void 0,r)}));function Pi(t,e){if(Mi(t)&&Mi(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(Te(e[n],0,255));return e[3]=Te(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function wi(t,e){if(ge(e))return vn(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return vn(Number(e),"px");if("deg".search(t)>=0)return vn(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return vn(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Ni=We((function(t){return wi(/px/g,t)})),Ci=(We((function(t){return wi(RegExp("%","g"),t)})),function(t){return Pe(t)||isFinite(Number(t))?vn(Number(t)||0,"px"):wi(RegExp("px|%|em|rem","g"),t)}),Ai=We((function(t){return wi(/deg|rad|grad|turn/g,t)}));function Oi(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=Je(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=Ve(t.unit)):(tn.isLength(t.unit)||tn.isLength(e.unit))&&(o=Di(t,i,n),s=Di(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Li(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=sr(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=ur(Number(e.value))),n}function Ri(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):Me(t)?n=t.split(" ").map((function(t){return Number(t)})):Pe(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 Ii(t){return Me(t)?t.split(" ").map((function(t){return Ci(t)})):t.map((function(t){return Ci(""+t)}))}function Di(e,n,r){if(0===e.value)return 0;if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var _i=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Gi(){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,_i.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return wi(/deg|rad|grad|turn|px|%/g,t)||Ti(t)}))}),n.lastIndex===t.length)return r}return[]}function Ui(t){return""+t}var Bi=We((function(t){return vn("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));We((function(t){return Me(t)?t.split(" ").map(Bi):t.map(Bi)}));function Fi(t,e){return[t,e,Ui]}function Vi(t,e){return function(n,r){return[n,r,function(n){return Ui(Te(n,t,e))}]}}function ji(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Yi=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=Qt(t)}catch(n){e=Qt(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}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=Zr(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]&&Vr(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],y=Yr(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[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 g=[u[1],u[2]],m=[u[3],u[4]];c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-m[0],g[1]-m[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[m[0]-g[0],m[1]-g[1]])}else if("S"===l){var x=e[s-1],k=Yr(x.currentPoint,d),E=[u[1],u[2]];"C"===x.command?(c.command="C",c.startTangent=[d[0]-k[0],d[1]-k[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]]):(c.command="SQ",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]])}else if("A"===l){var b=Wr(c,0),S=b.x,M=b.y,T=Wr(c,1,!1),P=T.x,w=T.y;c.startTangent=[S,M],c.endTangent=[P,w]}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=Or(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=Ir(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=Gr(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=Se(n),d=Se(r),v=be(n),p=be(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var y=0;i.length>y;y++){var g=i[y],m=g.currentPoint;m[0]===f?f-=jr(g,e).xExtra:m[0]===v&&(v+=jr(g,e).xExtra),m[1]===d?d-=jr(g,e).yExtra:m[1]===p&&(p+=jr(g,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=We(Yi);function Hi(t,e){var n=Me(t)?Xi(t):Yi(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Wi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ae(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ae(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=ye(r,i));var o,s,u,l,c,h,f,d,v=ve(a[0])!==ve(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))})))):Rt(a[0]);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 zi(t,e){var n;n=Me(t)?t.split(" ").map((function(t){var e=E(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,a=[],o=0,s=Br(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=Nr.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}));var u=Math.min.apply(Math,b(n.map((function(t){return t[0]})))),l=Math.min.apply(Math,b(n.map((function(t){return t[1]}))));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:a}}function qi(t,e){return[t.points,e.points,function(t){return t}]}var Ki=null;function Zi(t){return function(e){var n=0;return t.map((function(t){return t===Ki?e[n++]:t}))}}function Qi(t){return t}var $i={matrix:["NNNNNN",[Ki,Ki,0,0,Ki,Ki,0,0,0,0,1,0,Ki,Ki,0,1],Qi],matrix3d:["NNNNNNNNNNNNNNNN",Qi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Zi([Ki,Ki,new tn(1)]),Qi],scalex:["N",Zi([Ki,new tn(1),new tn(1)]),Zi([Ki,new tn(1)])],scaley:["N",Zi([new tn(1),Ki,new tn(1)]),Zi([new tn(1),Ki])],scalez:["N",Zi([new tn(1),new tn(1),Ki])],scale3d:["NNN",Qi],skew:["Aa",null,Qi],skewx:["A",null,Zi([Ki,nn])],skewy:["A",null,Zi([nn,Ki])],translate:["Tt",Zi([Ki,Ki,en]),Qi],translatex:["T",Zi([Ki,en,en]),Zi([Ki,en])],translatey:["T",Zi([en,Ki,en]),Zi([en,Ki])],translatez:["L",Zi([en,en,Ki])],translate3d:["TTL",Qi]};function Ji(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var a=e[1],o=$i[a];if(!o)return[];var s=e[2].split(","),u=o[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],f=u[c],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?nn:Ai(t)},N:Bi,T:Ci,L:Ni}[f.toUpperCase()](h):{a:nn,n:l[0],t:en}[f]))return[];l.push(d)}if(r.push({t:a,d:l}),n.lastIndex===t.length)return r}return[]}function ta(t){var e,n,r,i;switch(t.t){case"rotatex":return i=or(Li(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=or(Li(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=or(Li(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=or(Li(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=or(Li(t.d[0])),h=or(Li(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=or(Li(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=or(Li(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=Di(t.d[0],0,null)||0,n=Di(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Di(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=Di(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=Di(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Di(t.d[0],0,null)||0,n=Di(t.d[1],0,null)||0,r=Di(t.d[2],0,null)||0,1];case"perspective":var f=Di(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 ea(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 na(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(O(dr,fr),dr[3]=0,dr[7]=0,dr[11]=0,dr[15]=1,1e-8>Math.abs(_(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,!D(dr,dr))return!1;I(dr,dr),yt(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]=nt(pr[0]),ut(pr[0],pr[0]),r[0]=lt(pr[0],pr[1]),gr(pr[1],pr[1],pr[0],1,-r[0]),n[1]=nt(pr[1]),ut(pr[1],pr[1]),r[0]/=n[1],r[1]=lt(pr[0],pr[2]),gr(pr[2],pr[2],pr[0],1,-r[1]),r[2]=lt(pr[1],pr[2]),gr(pr[2],pr[2],pr[1],1,-r[2]),n[2]=nt(pr[2]),ut(pr[2],pr[2]),r[1]/=n[2],r[2]/=n[2],ct(yr,pr[1],pr[2]),0>lt(pr[0],yr))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(ta).reduce(ea)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var ra=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,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],o=t(o,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],o=t(o,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],o=t(o,y));for(var g=0;3>g;g++)for(var m=0;3>m;m++)o[g][m]*=n[g];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 ia(t){return t.toFixed(6).replace(".000000","")}function aa(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=na(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=na(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=Te(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 ra(t[0],t[1],t[2],e,t[4]).map(ia).join(",")}])}function oa(t){return t.replace(/[xy]/,"")}function sa(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function ua(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?vn(o):vn(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=aa(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,y=e[f].d,g=$i[d],m=$i[v],x=void 0;if(s=v,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var k=aa([t[f]],[e[f]]);u.push(k[0]),l.push(k[1]),c.push(["matrix",[k[2]]])}else{if(d===v)x=d;else if(g[2]&&m[2]&&oa(d)===oa(v))x=oa(d),p=g[2](p),y=m[2](y);else{if(!g[1]||!m[1]||sa(d)!==sa(v)){var E=aa(t,e);u=[E[0]],l=[E[1]],c=[["matrix",[E[2]]]];break}x=sa(d),p=g[1](p),y=m[1](y)}for(var b=[],S=[],M=[],T=0;p.length>T;T++){var P=Oi(p[T],y[T],n,!1,T);b[T]=P[0],S[T]=P[1],M.push(P[2])}u.push(b),l.push(S),c.push([x,M])}}if(r){var w=u;u=l,l=w}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"),c[e][0]+"("+n+")"})).join(" ")}]}var la=We((function(t){if(Me(t)){if("text-anchor"===t)return[vn(0,"px"),vn(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:[Ci(ca(e[0])),Ci(ca(e[1]))]}return[vn(t[0]||0,"px"),vn(t[1]||0,"px")]}));function ca(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var ha=function(){function t(){c(this,t),this.parser=Ai,this.parserWithCSSDisabled=null,this.mixer=Fi}return f(t,[{key:"calculator",value:function(t,e,n,r){return Li(n)}}]),t}(),fa=function(){function t(){c(this,t)}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof He&&(n=null),ms.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&ms.sceneGraphService.dirtifyToRoot(t)})),n}}]),t}(),da=function(){function t(){c(this,t),this.parser=Ti,this.parserWithCSSDisabled=Ti,this.mixer=Pi}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof He?"none"===n.value?hn:fn:n}}]),t}(),va=function(){function t(){c(this,t),this.parser=Gi}return f(t,[{key:"calculator",value:function(t,e,n){return n instanceof He?[]:n}}]),t}();function pa(t){var e=t.parsedStyle.fontSize;return ge(e)?null:e}var ya,ga=function(){function e(){c(this,e),this.parser=Ci,this.parserWithCSSDisabled=null,this.mixer=Fi}return f(e,[{key:"calculator",value:function(e,n,r,i,a){if(Pe(r))return r;if(!tn.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var o=pa(i.parentNode);if(o)return o*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=pa(i.ownerDocument.documentElement);if(u)return u*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}}}]),e}(),ma=function(){function t(){c(this,t),this.mixer=ji}return f(t,[{key:"parser",value:function(t){var e=Ii(Pe(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]}},{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}]),t}(),xa=function(){function t(){c(this,t),this.mixer=ji}return f(t,[{key:"parser",value:function(t){var e=Ii(Pe(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]}},{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}]),t}(),ka=function(e){v(r,e);var n=x(r);function r(){return c(this,r),n.apply(this,arguments)}return f(r,[{key:"postProcessor",value:function(e,n){var r,i,a;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,s=o.cx,u=o.cy;ge(s)||(r=s),ge(u)||(i=u);break;case t.Shape.LINE:var l=e.parsedStyle,c=l.y1,h=l.y2;r=Math.min(l.x1,l.x2),i=Math.min(c,h),a=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:ge(e.parsedStyle.x)||(r=e.parsedStyle.x),ge(e.parsedStyle.y)||(i=e.parsedStyle.y),ge(e.parsedStyle.z)||(a=e.parsedStyle.z)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!ge(r)||!ge(i)||!ge(a))&&-1===n.indexOf("transform")){var f=e.parsedStyle.transform;if(f&&f.length)xr(f,e);else{var d=E(e.getLocalPosition(),3),v=d[0],p=d[1],y=d[2];e.setLocalPosition(ge(r)?v:r,ge(i)?p:i,ge(a)?y:a)}}}}]),r}(ga),Ea=function(){function t(){c(this,t)}return f(t,[{key:"calculator",value:function(t,e,n,r){var i;n instanceof He&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}]),t}(),ba=function(){function t(){c(this,t),this.mixer=Fi,this.parser=Bi,this.parserWithCSSDisabled=null}return f(t,[{key:"calculator",value:function(t,e,n){return n.value}}]),t}(),Sa=function(){function e(){c(this,e),this.parser=Bi,this.parserWithCSSDisabled=null,this.mixer=Vi(0,1)}return f(e,[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var a=r.getPoint(n.offsetDistance);a&&(e.parsedStyle.defX=a.x,e.parsedStyle.defY=a.y,e.setLocalPosition(a.x,a.y))}}}}]),e}(),Ma=function(){function t(){c(this,t),this.parser=Bi,this.parserWithCSSDisabled=null,this.mixer=Vi(0,1)}return f(t,[{key:"calculator",value:function(t,e,n){return n.value}}]),t}(),Ta=function(){function t(){c(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return f(t,[{key:"update",value:function(t,e){tr(this.center,t),tr(this.halfExtents,e),er(this.min,this.center,this.halfExtents),nr(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){nr(this.center,e,t),rr(this.center,this.center,.5),er(this.halfExtents,e,t),rr(this.halfExtents,this.halfExtents,.5),tr(this.min,t),tr(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,y=e.center,g=y[0],m=y[1],x=y[2],k=e.halfExtents,E=k[0],b=k[1],S=k[2],M=g-E,T=g+E,P=m-b,w=m+b,N=x-S,C=x+S;c>M&&(c=M),T>h&&(h=T),f>P&&(f=P),w>d&&(d=w),v>N&&(v=N),C>p&&(p=C),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),y=Math.abs(s),g=Math.abs(u),m=Math.abs(l),x=Math.abs(c),k=Math.abs(h),E=Math.abs(f),b=Math.abs(d),S=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]+y*a[1]+g*a[2],r[1]=m*a[0]+x*a[1]+k*a[2],r[2]=E*a[0]+b*a[1]+S*a[2],er(this.min,n,r),nr(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,r,i,a=new t,o=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=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}([0,0,0],this.getMax(),e.getMax());return a.setMinMax(o,s),a}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?tr([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?tr([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]}}]),t}(),Pa=function(){function t(e,n){c(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||rt(0,1,0),this.updatePNVertexFlag()}return f(t,[{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 lt(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t,e,n,r=1/vt(this.normal);(t=this.normal)[0]=(e=this.normal)[0]*(n=r),t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r}},{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&&function(t,e,n,r){var i=e[0],a=e[1],o=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o)}(n,t,e,i),a}}]),t}();(ya=t.Mask||(t.Mask={}))[ya.OUTSIDE=4294967295]="OUTSIDE",ya[ya.INSIDE=0]="INSIDE",ya[ya.INDETERMINATE=2147483647]="INDETERMINATE";var wa=function(){function t(e){if(c(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new Pa)}return f(t,[{key:"extractFromVPMatrix",value:function(t){var e=E(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],y=e[14],g=e[15];at(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=g-v,at(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=g+v,at(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=g+p,at(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=g-p,at(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=g-y,at(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=g+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}(),Na=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;c(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return f(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}}]),t}(),Ca=function(){function t(e,n,r,i){c(this,t),this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,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 f(t,[{key:"toJSON",value:function(){}}]),t}(),Aa=function(){function e(){c(this,e),this.parser=Hi,this.parserWithCSSDisabled=Hi,this.mixer=Wi}return f(e,[{key:"calculator",value:function(t,e,n){return n instanceof He&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ca(0,0,0,0)}:n}},{key:"postProcessor",value:function(e,n){if(e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,a=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===a?0:a)}}}]),e}(),Oa=function(){function e(){c(this,e),this.parser=zi,this.mixer=qi}return f(e,[{key:"postProcessor",value:function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}}}]),e}(),La=function(t){v(n,t);var e=x(n);function n(){var t;c(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).mixer=Vi(0,1/0),t}return f(n)}(ga),Ra=function(){function t(){c(this,t)}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof He?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}]),t}(),Ia=function(){function t(){c(this,t)}return f(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}}]),t}(),Da=function(){function t(){c(this,t),this.parser=Ji,this.parserWithCSSDisabled=Ji,this.mixer=ua}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof He?[]:n}},{key:"postProcessor",value:function(t){xr(t.parsedStyle.transform,t)}}]),t}(),_a=f((function t(){c(this,t),this.parser=la})),Ga=function(){function t(){c(this,t),this.parser=Bi}return f(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)}}}]),t}(),Ua=function(){function e(){c(this,e),this.registry={},this.define(t.Shape.CIRCLE,yo),this.define(t.Shape.ELLIPSE,ko),this.define(t.Shape.RECT,Go),this.define(t.Shape.IMAGE,Po),this.define(t.Shape.LINE,No),this.define(t.Shape.GROUP,bo),this.define(t.Shape.PATH,Oo),this.define(t.Shape.POLYGON,Ro),this.define(t.Shape.POLYLINE,Do),this.define(t.Shape.TEXT,Bo),this.define(t.Shape.HTML,Mo)}return f(e,[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}]),e}();function Ba(t){return!!t.type}var Fa=function(){function t(e){c(this,t),this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Na,this.page=new Na,this.canvas=new Na,this.viewport=new Na,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return f(t,[{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)}}]),t}(),Va=function(t){v(n,t);var e=x(n);function n(t,r){var i;return c(this,n),(i=e.call(this,null)).type=t,i.detail=r,Object.assign(m(i),r),i}return f(n)}(Fa),ja=e((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,a=Array(i);i>r;r++)a[r]=e[r].fn;return a},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,d=c.length;for(l=0;d>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s})),Ya=function(){function t(){c(this,t),this.emitter=new ja}return f(t,[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=Ie(n)&&n||Ee(n)&&n.capture,i=Ee(n)&&n.once,a=Ke(e)?void 0:e,o=!1,s="";if(t.indexOf(":")>-1){var u=E(t.split(":"),2);t=u[1],s=u[0],o=!0}if(t=r?"".concat(t,"capture"):t,e=Ke(e)?e:e.handleEvent,o){var l=e;e=function(){for(var t,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&l.apply(void 0,n)}}return i?this.emitter.once(t,e,a):this.emitter.on(t,e,a),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){this.emitter.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r,i=Ie(n)&&n||Ee(n)&&n.capture,a=Ke(e)?void 0:e;return t=i?"".concat(t,"capture"):t,e=Ke(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,a),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Va(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Ba(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(e){var i;if(t.manager=e.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],n||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,n)}return!t.defaultPrevented}}]),t}(),Xa=function(e){v(r,e);var n=x(r);function r(){var t;c(this,r);for(var e=arguments.length,i=Array(e),a=0;e>a;a++)i[a]=arguments[a];return(t=n.call.apply(n,[this].concat(i))).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 f(r,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);var n,r=T(this.childNodes);try{for(r.s();!(n=r.n()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}}catch(t){r.e(t)}finally{r.f()}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text="".concat(e))}},{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 e=t,n=this,i=[e],a=[n];null!==(o=e.parentNode)&&void 0!==o?o:n.parentNode;){var o;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,n=n.parentNode?(a.push(n.parentNode),n.parentNode):n}if(e!==n)return r.DOCUMENT_POSITION_DISCONNECTED|r.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|r.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?r.DOCUMENT_POSITION_CONTAINED_BY|r.DOCUMENT_POSITION_FOLLOWING:r.DOCUMENT_POSITION_CONTAINS|r.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?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING:s===i?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING}}return r.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){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))}}],[{key:"isNode",value:function(t){return!!t.childNodes}}]),r}(Ya);Xa.DOCUMENT_POSITION_DISCONNECTED=1,Xa.DOCUMENT_POSITION_PRECEDING=2,Xa.DOCUMENT_POSITION_FOLLOWING=4,Xa.DOCUMENT_POSITION_CONTAINS=8,Xa.DOCUMENT_POSITION_CONTAINED_BY=16,Xa.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Ha,Wa,za=function(e){v(a,e);var n,r,i=x(a);function a(){var e;c(this,a),(e=i.call(this)).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new ms.AnimationTimeline(m(e))}catch(t){}var n={};return Fo.forEach((function(e){var r=e.d;e.inh&&r&&(n[e.n]=Ke(r)?r(t.Shape.GROUP):r)})),e.documentElement=new bo({id:"g-root",style:n}),e.documentElement.ownerDocument=m(e),e.documentElement.parentNode=m(e),e.childNodes=[e.documentElement],e}return f(a,[{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?Bo:bo);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=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&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=l(o().mark((function t(e,n){var r,i,a,s,u,l,c,h,f,d;return o().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,s=this.defaultView.getConfig(),u=s.width,l=s.height,!(0>i||0>a||i>u||a>l)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:a}),h=c.x,f=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:h,clientY:f},picked:[]});case 7:return t.abrupt("return",(d=t.sent.picked)&&d[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=l(o().mark((function t(e,n){var r,i,a,s,u,l,c,h,f,d;return o().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,s=this.defaultView.getConfig(),u=s.width,l=s.height,!(0>i||0>a||i>u||a>l)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:a}),h=c.x,f=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:h,clientY:f},picked:[]});case 7:return(d=t.sent.picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),t.abrupt("return",d);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($n)}},{key:"insertBefore",value:function(t,e){throw Error($n)}},{key:"removeChild",value:function(t,e){throw Error($n)}},{key:"replaceChild",value:function(t,e,n){throw Error($n)}},{key:"append",value:function(){throw Error($n)}},{key:"prepend",value:function(){throw Error($n)}},{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)}}]),a}(Xa);(Ha=t.Strategy||(t.Strategy={}))[Ha.Standard=0]="Standard",(Wa=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",Wa.DESTROY="destroy",Wa.ATTR_MODIFIED="DOMAttrModified",Wa.INSERTED="DOMNodeInserted",Wa.REMOVED="removed",Wa.MOUNTED="DOMNodeInsertedIntoDocument",Wa.UNMOUNTED="DOMNodeRemovedFromDocument",Wa.BOUNDS_CHANGED="bounds-changed",Wa.RENDER_ORDER_CHANGED="render-order-changed",Wa.CULLED="culled";var qa=function(t){v(n,t);var e=x(n);function n(t,r,i,a,o,s,u,l){var h;return c(this,n),(h=e.call(this,null)).relatedNode=void 0,h.prevValue=void 0,h.newValue=void 0,h.attrName=void 0,h.attrChange=void 0,h.prevParsedValue=void 0,h.newParsedValue=void 0,h.relatedNode=r,h.prevValue=i,h.newValue=a,h.attrName=o,h.attrChange=s,h.prevParsedValue=u,h.newParsedValue=l,h.type=t,h}return f(n)}(Fa);qa.ADDITION=2,qa.MODIFICATION=1,qa.REMOVAL=3;var Ka=0;var Za=new qa(t.ElementEvent.INSERTED,null,"","","",0,"",""),Qa=new qa(t.ElementEvent.REMOVED,null,"","","",0,"",""),$a=new Va(t.ElementEvent.DESTROY),Ja=function(e){v(r,e);var n=x(r);function r(){var e;c(this,r);for(var i=arguments.length,a=Array(i),o=0;i>o;o++)a[o]=arguments[o];return(e=n.call.apply(n,[this].concat(a))).entity=Ka++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},e.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.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]},e.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.id=void 0,e.name=void 0,e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=ms.enableCSSParsing?{anchor:on,opacity:on,fillOpacity:on,strokeOpacity:on,fill:on,stroke:on,transform:on,transformOrigin:on,visibility:on,pointerEvents:on,lineWidth:on,lineCap:on,lineJoin:on,increasedLineWidthForHitTesting:on,fontSize:on,fontFamily:on,fontStyle:on,fontWeight:on,fontVariant:on,textAlign:on,textBaseline:on,textTransform:on,zIndex:on,filter:on,shadowType:on}:null,e.parsedStyle={},e.attributes={},e}return f(r,[{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 ms.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Za.relatedNode=this,t.dispatchEvent(Za),t}},{key:"insertBefore",value:function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}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 Qa.relatedNode=this,t.dispatchEvent(Qa),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),ms.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&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return ms.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return ms.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return ms.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return ms.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return ms.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return ms.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return ms.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(ms.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,!0)})),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=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,b(a))}}},{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.dispatchEvent($a),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return ms.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return ms.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return ms.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return ms.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return ms.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(function(t){return"symbol"===s(t)}(t))return ms.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Qe(t);return e=this.attributes[n],ms.enableCSSParsing&&ge(e)?null:e}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){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)}}],[{key:"isElement",value:function(t){return!!t.getAttribute}}]),r}(Xa),to=function(t){v(n,t);var e=x(n);function n(){var t;c(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).altKey=void 0,t.button=void 0,t.buttons=void 0,t.ctrlKey=void 0,t.metaKey=void 0,t.relatedTarget=void 0,t.shiftKey=void 0,t.client=new Na,t.movement=new Na,t.offset=new Na,t.global=new Na,t.screen=new Na,t}return f(n,[{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)}}]),n}(Fa),eo=function(t){v(n,t);var e=x(n);function n(){var t;c(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).pointerId=void 0,t.width=0,t.height=0,t.isPrimary=!1,t.pointerType=void 0,t.pressure=void 0,t.tangentialPressure=void 0,t.tiltX=void 0,t.tiltY=void 0,t.twist=void 0,t}return f(n,[{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)}}]),n}(to),no=function(t){v(n,t);var e=x(n);function n(){var t;c(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).deltaMode=void 0,t.deltaX=void 0,t.deltaY=void 0,t.deltaZ=void 0,t.DOM_DELTA_LINE=0,t.DOM_DELTA_PAGE=1,t.DOM_DELTA_PIXEL=2,t}return f(n,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}]),n}(to);function ro(t){return!!(null==t?void 0:t.nodeName)}var io,ao,oo,so=new qa(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,qa.MODIFICATION,null,null),uo={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},lo={anchor:[0,0],fill:hn,stroke:hn,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},co=a(a({},lo),{},{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),ho=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),fo="data-",vo=function(e){v(r,e);var n=x(r);function r(e){var i,a;c(this,r),(a=n.call(this)).config=void 0,a.isCustomElement=!1,a.isMutationObserved=!1,a.activeAnimations=[],a.dataset=void 0,a.getClip=function(){return this.style.clipPath||null},a.config=e,a.config.interactive=null!==(i=a.config.capture)&&void 0!==i?i:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=a.config.style||a.config.attrs||{},Object.assign(a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),Object.assign(a.parsedStyle,ms.enableCSSParsing?lo:co,a.config.initialParsedStyle),ms.enableCSSParsing&&Object.assign(a.attributes,uo),a.initAttributes(a.config.style);var o=ms.globalThis.Proxy?ms.globalThis.Proxy:function(){};return ms.enableDataset&&(a.dataset=new o({},{get:function(t,e){var n="".concat(fo).concat(qe(e));return void 0!==t[n]?t[n]:a.getAttribute(n)},set:function(t,e,n){return a.setAttribute("".concat(fo).concat(qe(e)),n),!0}})),ms.enableStyleSyntax&&(a.style=new o({setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}})),a}return f(r,[{key:"destroy",value:function(){k(p(r.prototype),"destroy",this).call(this),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];ro(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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.renderable,n={forceUpdateGeometry:!0};ms.enableCSSParsing&&(n.usedAttributes=ho);var r={};for(var i in t){r[Qe(i)]=t[i]}ms.styleValueRegistry.processProperties(this,r,n),e.dirty=!0}},{key:"setAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Qe(t);De(e)||(n||e!==this.attributes[i])&&(this.internalSetAttribute(i,e),k(p(r.prototype),"setAttribute",this).call(this,i,e))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t];ms.styleValueRegistry.processProperties(this,d({},t,e),n),r.dirty=!0;var o=this.parsedStyle[t];this.isConnected&&(so.relatedNode=this,so.prevValue=i,so.newValue=e,so.attrName=t,so.prevParsedValue=a,so.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(so):(so.target=this,this.ownerDocument.defaultView.dispatchEvent(so,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)}},{key:"getBBox",value:function(){var t=this.getBounds(),e=E(t.getMin(),2),n=e[0],r=e[1],i=E(t.getMax(),2);return new Ca(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return ms.sceneGraphService.setOrigin(this,ar(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"getOrigin",value:function(){return ms.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return ms.sceneGraphService.setPosition(this,ar(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"setLocalPosition",value:function(t){return ms.sceneGraphService.setLocalPosition(this,ar(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"translate",value:function(t){return ms.sceneGraphService.translate(this,ar(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"translateLocal",value:function(t){return ms.sceneGraphService.translateLocal(this,ar(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"getPosition",value:function(){return ms.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return ms.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=ar(t,e=e||t,n=n||t)),ms.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=ar(t,e=e||t,n=n||t)),ms.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return ms.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return ms.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return sr(E(lr(et(),ms.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return sr(E(lr(et(),ms.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return ms.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return ms.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return ge(e)&&ge(n)?ms.sceneGraphService.rotateLocal(this,0,0,t):ms.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return ge(e)&&ge(n)?ms.sceneGraphService.rotate(this,0,0,t):ms.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return ms.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return ms.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return ms.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return ms.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return ms.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return ms.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return ms.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return ms.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return ms.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){ms.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"visible"===(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,b(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,b(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?Ee(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=E(X(et(),e),2),r=n[0],i=n[1],a=E(H(et(),e),2),o=a[0],s=a[1],u=W(gt(),e),l=E(lr(et(),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=E(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=E(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(){ms.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){ms.enableCSSParsing?this.style.visibility="hidden":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:"setClip",value:function(t){this.style.clipPath=t}},{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}}]),r}(Ja),po=["style"],yo=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,po);return c(this,r),n.call(this,a({type:t.Shape.CIRCLE,style:a(ms.enableCSSParsing?{cx:"",cy:"",r:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:ms.enableCSSParsing?null:[pn,pn]}},o))}return f(r)}(vo),go=["style"],mo=function(t){v(n,t);var e=x(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.style,o=g(r,go);return c(this,n),(t=e.call(this,a({style:a(ms.enableCSSParsing?{x:"",y:""}:{},i)},o))).isCustomElement=!0,t}return f(n)}(vo),xo=["style"],ko=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,xo);return c(this,r),n.call(this,a({type:t.Shape.ELLIPSE,style:a(ms.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:ms.enableCSSParsing?null:[pn,pn]}},o))}return f(r)}(vo),Eo=["style"],bo=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,Eo);return c(this,r),n.call(this,a({type:t.Shape.GROUP,style:a(ms.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},i)},o))}return f(r)}(vo),So=["style"],Mo=function(e){v(r,e);var n=x(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.style,s=g(i,So);return c(this,r),(e=n.call(this,a({type:t.Shape.HTML,style:a(ms.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},o)},s))).cullable.enable=!1,e}return f(r,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getBoundingClientRect",value:function(){return this.parsedStyle.$el.getBoundingClientRect()}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getBounds",value:function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,a=n.top-r.top,o=new Ta;return o.setMinMax([i,a,0],[i+n.width,a+n.height,0]),o}return null}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=D(A(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ta.isEmpty(e)){var n=new Ta;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}]),r}(vo),To=["style"],Po=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,To);return c(this,r),n.call(this,a({type:t.Shape.IMAGE,style:a(ms.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},i)},o))}return f(r)}(vo),wo=["style"],No=function(e){v(r,e);var n=x(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.style,s=g(i,wo);c(this,r),(e=n.call(this,a({type:t.Shape.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},s))).markerStartAngle=0,e.markerEndAngle=0;var u=e.parsedStyle,l=u.markerStart,h=u.markerEnd;return l&&ro(l)&&(e.markerStartAngle=l.getLocalEulerAngles(),e.appendChild(l)),h&&ro(h)&&(e.markerEndAngle=h.getLocalEulerAngles(),e.appendChild(h)),e.transformMarker(!0),e.transformMarker(!1),e}return f(r,[{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&&ro(r)&&(this.markerStartAngle=0,r.remove()),i&&ro(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&ro(r)&&(this.markerEndAngle=0,r.remove()),i&&ro(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=e.defX,l=e.defY,c=t?e.markerStart:e.markerEnd;if(c&&ro(c)){var h,f,d,v,p,y,g;t?(v=i-u,p=o-l,f=a-i,d=s-o,y=n||0,g=this.markerStartAngle):(v=a-u,p=s-l,f=i-a,d=o-s,y=r||0,g=this.markerEndAngle),c.setLocalEulerAngles(180*(h=Math.atan2(d,f))/Math.PI+g),c.setLocalPosition(v+Math.cos(h)*y,p+Math.sin(h)*y)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.defX,i=n.defY,a=Nr.pointAt(n.x1,n.y1,n.x2,n.y2,t),o=a.x,s=a.y,u=ht(et(),rt(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Na(u[0],u[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 Nr.length(t.x1,t.y1,t.x2,t.y2)}}]),r}(vo),Co=["style"],Ao={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ca(0,0,0,0)},Oo=function(e){v(r,e);var n=x(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.style,s=g(i,Co);c(this,r),(e=n.call(this,a({type:t.Shape.PATH,style:a(ms.enableCSSParsing?{path:"",miterLimit:""}:{},o),initialParsedStyle:ms.enableCSSParsing?null:{miterLimit:4,path:a({},Ao)}},s))).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var u=e.parsedStyle,l=u.markerStart,h=u.markerEnd,f=u.markerMid;return l&&ro(l)&&(e.markerStartAngle=l.getLocalEulerAngles(),e.appendChild(l)),f&&ro(f)&&e.placeMarkerMid(f),h&&ro(h)&&(e.markerEndAngle=h.getLocalEulerAngles(),e.appendChild(h)),e.transformMarker(!0),e.transformMarker(!1),e}return f(r,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"path"===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&&ro(r)&&(this.markerStartAngle=0,r.remove()),i&&ro(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ro(r)&&(this.markerEndAngle=0,r.remove()),i&&ro(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.defX,a=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&ro(o)){var s,u,l,c,h,f,d;if(t){var v=E(this.getStartTangent(),2),p=v[0],y=v[1];c=y[0]-i,h=y[1]-a,u=p[0]-y[0],l=p[1]-y[1],f=n||0,d=this.markerStartAngle}else{var g=E(this.getEndTangent(),2),m=g[0],x=g[1];c=x[0]-i,h=x[1]-a,u=m[0]-x[0],l=m[1]-x[1],f=r||0,d=this.markerEndAngle}o.setLocalEulerAngles(180*(s=Math.atan2(l,u))/Math.PI+d),o.setLocalPosition(c+Math.cos(s)*f,h+Math.sin(s)*f)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&ro(t))for(var a=1;n.length-1>a;a++){var o=E(n[a].currentPoint,2),s=o[0],u=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,u-i)}}},{key:"getTotalLength",value:function(){return Fr(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.defX,i=n.defY,a=function(t,e,n){return de(t,e,It(It({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),o=a.x,s=a.y,u=ht(et(),rt(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Na(u[0],u[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Fr(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.path.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.path.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}}]),r}(vo),Lo=["style"],Ro=function(e){v(r,e);var n=x(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.style,s=g(i,Lo);c(this,r),(e=n.call(this,a({type:t.Shape.POLYGON,style:a(ms.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},o),initialParsedStyle:ms.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},s))).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var u=e.parsedStyle,l=u.markerStart,h=u.markerEnd,f=u.markerMid;return l&&ro(l)&&(e.markerStartAngle=l.getLocalEulerAngles(),e.appendChild(l)),f&&ro(f)&&e.placeMarkerMid(f),h&&ro(h)&&(e.markerEndAngle=h.getLocalEulerAngles(),e.appendChild(h)),e.transformMarker(!0),e.transformMarker(!1),e}return f(r,[{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&&ro(r)&&(this.markerStartAngle=0,r.remove()),i&&ro(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ro(r)&&(this.markerEndAngle=0,r.remove()),i&&ro(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=e.defX,o=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&ro(s)){var u,l,c,h,f,d,v;if(h=i[0][0]-a,f=i[0][1]-o,t)l=i[1][0]-i[0][0],c=i[1][1]-i[0][1],d=n||0,v=this.markerStartAngle;else{var p=i.length;this.parsedStyle.isClosed?(l=i[p-1][0]-i[0][0],c=i[p-1][1]-i[0][1]):(h=i[p-1][0]-a,f=i[p-1][1]-o,l=i[p-2][0]-i[p-1][0],c=i[p-2][1]-i[p-1][1]),d=r||0,v=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(c,l))/Math.PI+v),s.setLocalPosition(h+Math.cos(u)*d,f+Math.sin(u)*d)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&ro(t))for(var a=1;(this.parsedStyle.isClosed?n.length:n.length-1)>a;a++){var o=n[a][0]-r,s=n[a][1]-i,u=1===a?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,s)}}}]),r}(vo),Io=["style"],Do=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,Io);return c(this,r),n.call(this,a({type:t.Shape.POLYLINE,style:a(ms.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},i),initialParsedStyle:ms.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},o))}return f(r,[{key:"getTotalLength",value:function(){return this.parsedStyle.points.totalLength}},{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,r=n.defX,i=n.defY,a=n.points,o=a.points,s=0,u=0;a.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var l=Nr.pointAt(o[u][0],o[u][1],o[u+1][0],o[u+1][1],s),c=l.x,h=l.y,f=ht(et(),rt(c-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Na(f[0],f[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}}]),r}(Ro),_o=["style"],Go=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,_o);return c(this,r),n.call(this,a({type:t.Shape.RECT,style:a(ms.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},i)},o))}return f(r)}(vo),Uo=["style"],Bo=function(e){v(r,e);var n=x(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,o=g(e,Uo);return c(this,r),n.call(this,a({type:t.Shape.TEXT,style:a(ms.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0}:{fill:"black"},i),initialParsedStyle:ms.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},o))}return f(r,[{key:"getComputedTextLength",value:function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return!!this.parsedStyle.isOverflowing}}]),r}(vo),Fo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.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:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.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:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],Vo=Fo.filter((function(t){return!!t.l})).map((function(t){return t.n})),jo={},Yo=new WeakMap,Xo=function(){function e(){var t=this;c(this,e),Fo.forEach((function(e){t.registerMetadata(e)}))}return f(e,[{key:"registerMetadata",value:function(t){[t.n].concat(b(t.a||[])).forEach((function(e){jo[e]=t}))}},{key:"unregisterMetadata",value:function(t){delete jo[t]}},{key:"getPropertySyntax",value:function(t){return ms.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]};if(!ms.enableCSSParsing){Object.assign(e.attributes,n);var o=Object.keys(n),s=e.parsedStyle.clipPath,u=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var l=!!i.forceUpdateGeometry;if(!l)for(var c=0;Vo.length>c;c++)if(Vo[c]in n){l=!0;break}return n.fill&&(e.parsedStyle.fill=Ti(n.fill)),n.stroke&&(e.parsedStyle.stroke=Ti(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Ti(n.shadowColor)),n.filter&&(e.parsedStyle.filter=Gi(n.filter)),ge(n.radius)||(e.parsedStyle.radius=Ri(n.radius,4)),ge(n.lineDash)||(e.parsedStyle.lineDash=Ri(n.lineDash,2)),n.points&&(e.parsedStyle.points=zi(n.points,e)),""===n.path&&(e.parsedStyle.path=a({},Ao)),n.path&&(e.parsedStyle.path=Hi(n.path,e)),n.textTransform&&ms.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&ms.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",s,n.clipPath,e,this),n.offsetPath&&ms.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",u,n.offsetPath,e,this),n.anchor&&(e.parsedStyle.anchor=Ri(n.anchor,2)),n.transform&&(e.parsedStyle.transform=Ji(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=la(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=ms.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=ms.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=ms.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||ge(n.cx)&&ge(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||ge(n.x)&&ge(n.y)&&ge(n.z))&&(e.nodeName!==t.Shape.LINE||ge(n.x1)&&ge(n.y1)&&ge(n.z1)&&ge(n.x2)&&ge(n.y2)&&ge(n.z2))||ms.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,o),ge(n.zIndex)||ms.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,o),n.path&&ms.CSSPropertySyntaxFactory["<path>"].postProcessor(e,o),n.points&&ms.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,o),ge(n.offsetDistance)||ms.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,o),n.transform&&ms.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,o),void(l&&this.updateGeometry(e))}var h=i.skipUpdateAttribute,f=i.skipParse,d=i.usedAttributes,v=i.forceUpdateGeometry,p=Object.keys(n);p.forEach((function(t){var r;h||(e.attributes[t]=n[t]),!v&&(null===(r=jo[t])||void 0===r?void 0:r.l)&&(v=!0)})),f||p.forEach((function(t){e.computedStyle[t]=r.parseProperty(t,e.attributes[t],e)})),(null==d?void 0:d.length)&&(p=Array.from(new Set(p.concat(d)))),p.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=r.computeProperty(t,e.computedStyle[t],e))})),v&&this.updateGeometry(e),p.forEach((function(t){t in e.parsedStyle&&r.postProcessProperty(t,e,p)})),ms.enableCSSParsing&&e.children.length&&p.forEach((function(t){t in e.parsedStyle&&r.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))}},{key:"parseProperty",value:function(t,e,n){var r=jo[t],i=e;if((""===e||ge(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=cn(e);else if(r){var a=r.k,o=r.syntax,s=o&&this.getPropertySyntax(o);a&&a.indexOf(e)>-1?i=cn(e):s&&s.parser&&(i=s.parser(e,n))}return i}},{key:"computeProperty",value:function(t,e,n){var r=jo[t],i=e;if(r){var a=r.syntax,o=r.d;if(e instanceof He){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)ge(o)||(e=this.parseProperty(t,Ke(o)?o(n.nodeName):o,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return ge(u)?void this.addUnresolveProperty(n,t):u}}var l=a&&this.getPropertySyntax(a);if(l&&l.calculator)i=l.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof He?e.value:e}return i}},{key:"postProcessProperty",value:function(t,e,n){var r=jo[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}}},{key:"addUnresolveProperty",value:function(t,e){var n=Yo.get(t);n||(Yo.set(t,[]),n=Yo.get(t)),-1===n.indexOf(e)&&n.push(e)}},{key:"tryToResolveProperty",value:function(t,e){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).inherited&&t.parentElement&&function(t,e){var n=Yo.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var n=t.parentElement.parsedStyle[e];if("unset"===n||"initial"===n||"inherit"===n)return;return n}}},{key:"recalc",value:function(t){var e=Yo.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Yo.delete(t)}}},{key:"updateGeometry",value:function(e){var n=e.nodeName,r=ms.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Ta),i.renderBounds||(i.renderBounds=new Ta);var a=e.parsedStyle,o=r.update(a,e),s=o.width,u=o.height,l=o.depth,c=void 0===l?0:l,h=o.offsetX,f=void 0===h?0:h,d=o.offsetY,v=void 0===d?0:d,p=o.offsetZ,y=void 0===p?0:p,g=[Math.abs(s)/2,Math.abs(u)/2,c/2],m=a.stroke,x=a.lineWidth,k=a.increasedLineWidthForHitTesting,E=a.shadowType,b=a.shadowColor,S=a.filter,M=void 0===S?[]:S,T=a.transformOrigin,P=a.anchor;n===t.Shape.TEXT&&delete a.anchor;var w=[(1-2*(P&&P[0]||0))*s/2+f,(1-2*(P&&P[1]||0))*u/2+v,(1-2*(P&&P[2]||0))*g[2]+y];if(i.contentBounds.update(w,g),m&&!m.isNone){var N=((x||0)+(k||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);g[0]+=N,g[1]+=N}if(i.renderBounds.update(w,g),b&&E&&"inner"!==E){var C=i.renderBounds,A=C.min,O=C.max,L=a.shadowBlur||0,R=a.shadowOffsetX||0,I=a.shadowOffsetY||0,D=O[0]+L+R,_=A[1]-L+I,G=O[1]+L+I;A[0]=Math.min(A[0],A[0]-L+R),O[0]=Math.max(O[0],D),A[1]=Math.min(A[1],_),O[1]=Math.max(O[1],G),i.renderBounds.setMinMax(A,O)}M.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,nr(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=i.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),i.renderBounds.setMinMax(l,c)}})),P=a.anchor;var U=0>s,B=0>u,F=(U?-1:1)*(T?Di(T[0],0,e):0),V=(B?-1:1)*(T?Di(T[1],1,e):0);e.setOrigin(F-=(U?-1:1)*(P&&P[0]||0)*i.contentBounds.halfExtents[0]*2,V-=(B?-1:1)*(P&&P[1]||0)*i.contentBounds.halfExtents[1]*2),ms.sceneGraphService.dirtifyToRoot(e)}}},{key:"isPropertyInheritable",value:function(t){var e=jo[t];return!!e&&e.inh}}]),e}();(io=t.CameraType||(t.CameraType={}))[io.ORBITING=0]="ORBITING",io[io.EXPLORING=1]="EXPLORING",io[io.TRACKING=2]="TRACKING",(ao=t.CameraTrackingMode||(t.CameraTrackingMode={}))[ao.DEFAULT=0]="DEFAULT",ao[ao.ROTATIONAL=1]="ROTATIONAL",ao[ao.TRANSLATIONAL=2]="TRANSLATIONAL",ao[ao.CINEMATIC=3]="CINEMATIC",(oo=t.CameraProjectionMode||(t.CameraProjectionMode={}))[oo.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",oo[oo.PERSPECTIVE=1]="PERSPECTIVE";var Ho,Wo={UPDATED:"updated"},zo=2e-4,qo=function(){function e(){c(this,e),this.canvas=void 0,this.eventEmitter=new ja,this.matrix=A(),this.right=rt(1,0,0),this.up=rt(0,1,0),this.forward=rt(0,0,1),this.position=rt(0,0,1),this.focalPoint=rt(0,0,0),this.distanceVector=rt(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.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=A(),this.projectionMatrixInverse=A(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new wa,this.orthoMatrix=A()}return f(e,[{key:"isOrtho",value:function(){return this.projectionMode===t.CameraProjectionMode.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(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return D(A(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=j(A(),[t,e,0]);this.jitteredProjectionMatrix=G(A(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{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(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this}},{key:"setFar",value:function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this}},{key:"setViewOffset",value:function(e,n,r,i,a,o){return this.aspect=e/n,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=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.projectionMode===t.CameraProjectionMode.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===t.CameraProjectionMode.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(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.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=rt(o.x-r,o.y-i,0),u=lt(s,this.right)/nt(this.right),l=lt(s,this.up)/nt(this.up);return this.pan(-u,-l),this}},{key:"setPerspective",value:function(e,n,r,i){var a;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var o=this.near*Math.tan(or(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,l=-.5*u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var c=this.view.fullWidth,h=this.view.fullHeight;l+=this.view.offsetX*u/c,o-=this.view.offsetY*s/h,u*=this.view.width/c,s*=this.view.height/h}return function(t,e,n,r,i,a,o){var s=2*a/(r-i),u=(n+e)/(n-e),l=(r+i)/(r-i),c=-(o+a)/(o-a),h=-2*o*a/(o-a);t[0]=2*a/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=l,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,l,l+u,o,o-s,e,this.far),B(this.projectionMatrix,this.projectionMatrix,rt(1,-1,1)),D(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(e,n,r,i,a,o){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=a,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=c-u,d=c+u,v=h+l,p=h-l;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=y*this.view.offsetX)+y*this.view.width,p=(v-=g*this.view.offsetY)-g*this.view.height}return Q(this.projectionMatrix,f,d,p,v,a,o),B(this.projectionMatrix,this.projectionMatrix,rt(1,-1,1)),D(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=ar(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(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],i=rt(0,1,0);if(this.focalPoint=ar(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=st(et(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=nt(a),s=sr(Math.asin(n/o)),u=90+sr(Math.atan2(r,e)),l=A();V(l,l,or(u)),F(l,l,or(s)),i=ht(et(),[0,1,0],l)}return D(this.matrix,$(A(),this.position,this.focalPoint,i)),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,zo>this.distance&&(this.distance=zo),this.dollyingStep=this.distance/100;var e=et(),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(e){return this.azimuth=ir(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(e){return this.elevation=ir(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(e){return this.roll=ir(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.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 e=mt(gt(),[0,0,1],or(this.roll));R(this.matrix);var n=mt(gt(),[1,0,0],or((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=mt(gt(),[0,1,0],or((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=xt(gt(),r,n);i=xt(gt(),i,e);var a=q(A(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(U(this.matrix,this.matrix,this.focalPoint),G(this.matrix,this.matrix,a),U(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(U(this.matrix,this.matrix,this.position),G(this.matrix,this.matrix,a))}},{key:"_setPosition",value:function(t,e,n){this.position=ar(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(){it(this.right,ar(yt(pt(),[1,0,0,0],this.matrix))),it(this.up,ar(yt(pt(),[0,1,0,0],this.matrix))),it(this.forward,ar(yt(pt(),[0,0,1,0],this.matrix))),ut(this.right,this.right),ut(this.up,this.up),ut(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=nt(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=sr(Math.asin(n/i)),this.azimuth=sr(Math.atan2(-e,-r))):(this.elevation=-sr(Math.asin(n/i)),this.azimuth=-sr(Math.atan2(-e,-r)))}},{key:"_getPosition",value:function(){it(this.position,ar(yt(pt(),[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=C(),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)),ot(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=st(et(),this.focalPoint,this.position),this.distance=nt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=mt(gt(),[0,0,1],-this.roll*Math.PI/180);z(this.orthoMatrix,n,rt((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),rt(this.zoom,this.zoom,1),e)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=G(A(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Wo.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)}}]),e}(),Ko=function(){function t(){c(this,t)}return f(t,[{key:"update",value:function(t,e){var n=t.r;return{width:2*n,height:2*n}}}]),t}(),Zo=function(){function t(){c(this,t)}return f(t,[{key:"update",value:function(t,e){return{width:2*t.rx,height:2*t.ry}}}]),t}(),Qo=function(){function t(){c(this,t)}return f(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);return{width:o-a,height:Math.max(n,i)-s}}}]),t}(),$o=function(){function t(){c(this,t)}return f(t,[{key:"update",value:function(t){var e=t.path.rect;return{width:e.width,height:e.height}}}]),t}(),Jo=function(){function t(){c(this,t)}return f(t,[{key:"update",value:function(t){var e=t.points.points,n=Math.min.apply(Math,b(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,b(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,b(e.map((function(t){return t[1]}))));return{width:r-n,height:Math.max.apply(Math,b(e.map((function(t){return t[1]}))))-i}}}]),t}(),ts=function(){function t(){c(this,t)}return f(t,[{key:"update",value:function(t,e){var n=t.img,r=t.width,i=t.height,a=void 0===r?0:r,o=void 0===i?0:i;return n&&!Me(n)&&(a||(t.width=a=n.width),o||(t.height=o=n.height)),{width:a,height:o}}}]),t}(),es=function(){function t(e){c(this,t),this.globalRuntime=void 0,this.globalRuntime=e}return f(t,[{key:"isReadyToMeasure",value:function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!ge(t.lineWidth)}},{key:"update",value:function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy,c=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;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:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,c);t.metrics=h;var f=[h.width/2,h.height/2,0],d=[0,1],v=0;"center"===a||"middle"===a?(v=o/2,d=[.5,1]):"right"!==a&&"end"!==a||(v=o,d=[1,1]);var p=0;return"middle"===s?p=f[1]:"top"===s||"hanging"===s?p=2*f[1]:"alphabetic"===s?p=ms.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(p=0),u&&(v+=u),l&&(p+=l),t.anchor=[d[0],d[1],0],{width:2*f[0],height:2*f[1],offsetX:v,offsetY:p}}}]),t}(),ns=function(){function t(e,n){var r=this;c(this,t),this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new ja,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=A(),this.tmpVec3=et(),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=performance.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")}Xa.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&&200>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?void 0: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"),Xa.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&&Xa.isNode(a)&&a.parentNode;l&&l!==(Xa.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Xa.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!==(Xa.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Xa.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!==(Xa.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Xa.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!==(Xa.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Xa.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"),Xa.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}return f(t,[{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:"client2Viewport",value:function(t){var e=this.context.contextService.getBoundingClientRect();return new Na(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))}},{key:"viewport2Client",value:function(t){var e=this.context.contextService.getBoundingClientRect();return new Na(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))}},{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=G(this.tmpMatrix,u,s),c=at(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return ht(c,c,l),new Na(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=G(this.tmpMatrix,n,r),a=at(this.tmpVec3,t.x,t.y,0);ht(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new Na((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++)Xa.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:this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath){var e,n=T(t.nativeEvent.composedPath());try{for(n.s();!(e=n.n()).done;){var r=ms.nativeHTMLMap.get(e.value);if(r)return r}}catch(t){n.e(t)}finally{n.f()}}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(eo);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i);return i.target=null!=n?n:a||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(no);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&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(no);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(eo);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=performance.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||Xa.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ja.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Xa.isNode(e)&&e.parentNode}}}]),t}(),rs=function(){function t(){c(this,t),this.canvas=void 0,this.context=void 0}return f(t,[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",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",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}}]),t}();(Ho=t.RenderReason||(t.RenderReason={}))[Ho.CAMERA_CHANGED=0]="CAMERA_CHANGED",Ho[Ho.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Ho[Ho.NONE=2]="NONE";var is=function(){function e(n,r){c(this,e),this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new Va(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new $r,dirtycheck:new ei,cull:new ei,beginFrame:new ti,beforeRender:new ti,render:new ti,afterRender:new ti,endFrame:new ti,destroy:new ti,pick:new Jr,pickSync:new ei,pointerDown:new ti,pointerUp:new ti,pointerMove:new ti,pointerOut:new ti,pointerOver:new ti,pointerWheel:new ti,pointerCancel:new ti,click:new ti},this.globalRuntime=n,this.context=r}var n;return f(e,[{key:"init",value:(n=l(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a(a({},this.globalRuntime),this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e,ms)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)}},{key:"render",value:function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=a?this.hooks.dirtycheck.call(t):t;if(s){var u=o?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var l=t.sortable,c=!1;l.dirty&&(l.sorted=t.childNodes.slice().sort(qn),c=!0,l.dirty=!1),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),c&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)}}]),e}(),as=/\[\s*(.*)=(.*)\s*\]/,os=function(){function t(){c(this,t)}return f(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(as),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 ge(n)?"":n.toString?""+n:""}}]),t}();function ss(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var us,ls,cs,hs=new qa(t.ElementEvent.REPARENT,null,"","","",0,"",""),fs=function(){function e(n){var r,i,a,o,s,u,l,h,f=this;c(this,e),this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Va(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(r=gt(),function(t,e){"number"==typeof e&&(e=rt(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 i=gt();bt(i,e[0],e[1],e[2]);var a=f.getRotation(t),o=f.getRotation(t.parentNode);At(r,o),Et(r,r),xt(i,r,i),xt(n.localRotation,i,a),Lt(n.localRotation,n.localRotation),f.dirtifyLocal(t,n)}else f.rotateLocal(t,e)}),this.rotateLocal=(i=gt(),function(t,e){"number"==typeof e&&(e=rt(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;bt(i,e[0],e[1],e[2]),Ot(n.localRotation,n.localRotation,i),f.dirtifyLocal(t,n)}),this.setEulerAngles=(a=gt(),function(t,e){"number"==typeof e&&(e=rt(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){bt(n.localRotation,e[0],e[1],e[2]);var r=f.getRotation(t.parentNode);At(a,Et(gt(),r)),Ot(n.localRotation,n.localRotation,a),f.dirtifyLocal(t,n)}else f.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e){"number"==typeof e&&(e=rt(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;ft(e,et())||(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),ot(n.localPosition,n.localPosition,e),f.dirtifyLocal(t,n))},this.setPosition=(o=A(),s=et(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,ft(f.getPosition(t),s)||(it(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(O(o,t.parentNode.transformable.worldTransform),D(o,o),ht(n.localPosition,s,o)):it(n.localPosition,s),f.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=et();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,ft(r.localPosition,t)||(it(r.localPosition,t),f.dirtifyLocal(e,r))}}(),this.translate=(u=et(),l=et(),h=et(),function(t,e){"number"==typeof e&&(e=at(l,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),ft(e,u)||(ot(h,f.getPosition(t),e),f.setPosition(t,h))}),this.setRotation=function(){var t=gt();return function(e,n,r,i,a){var o=e.transformable;if("number"==typeof n&&(n=Ct(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var s=f.getRotation(e.parentNode);At(t,s),Et(t,t),xt(o.localRotation,t,n),Lt(o.localRotation,o.localRotation),f.dirtifyLocal(e,o)}else f.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=A(),e=et(),n=Ct(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(z(r.localTransform,r.localRotation,r.localPosition,rt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=R(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),G(r.localTransform,r.localTransform,i)}var a=z(t,n,e,r.localScale,r.origin);G(r.localTransform,r.localTransform,a)}else z(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=n}return f(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,a=!1;t.parentNode&&(a=t.parentNode!==e,this.detach(t)),t.parentNode=e,ge(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null==o||null===(r=o.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(o.dirty=!0);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),a&&t.dispatchEvent(hs)}},{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?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);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.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:"setLocalEulerAngles",value:function(t,e){"number"==typeof e&&(e=rt(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;bt(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)}},{key:"scaleLocal",value:function(t,e){var n,r,i,a=t.transformable;n=a.localScale,r=a.localScale,i=rt(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,a)}},{key:"setLocalScale",value:function(t,e){var n=t.transformable,r=rt(e[0],e[1],e[2]||n.localScale[2]);ft(r,n.localScale)||(it(n.localScale,r),this.dirtifyLocal(t,n))}},{key:"setLocalRotation",value:function(t,e,n,r,i){"number"==typeof e&&(e=Ct(e,n,r,i));var a=t.transformable;At(a.localRotation,e),this.dirtifyLocal(t,a)}},{key:"setLocalSkew",value:function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new N(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,a=t.transformable;(r=a.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,a)}},{key:"dirtifyLocal",value:function(t,e){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:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=E(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()}},{key:"clearPendingEvents",value:function(){this.pendingEvents=[]}},{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;)ss(n),n=n.parentNode;e&&t.forEach((function(t){ss(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren: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(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new qa(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,qa.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return X(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return W(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return H(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:"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=X(et(),e),r=W(gt(),e),i=H(et(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])}},{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(Ta.isEmpty(n))return null;var r=e||new Ta;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}},{key:"getGeometryBounds",value:function(t){var e=t.geometry;return(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e.renderBounds:e.contentBounds||null)||new Ta}},{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 Ta).update(r.center,r.halfExtents))})),n){var o=Kn(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a=s}}return a||(a=new Ta),a&&(n?r.renderBounds=a:r.bounds=a),n?r.renderBoundsDirty=!1:r.boundsDirty=!1,a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=A();t.parentNode.transformable&&(e=D(A(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ta.isEmpty(n)){var r=new Ta;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r,i=this.getGeometryBounds(t);Ta.isEmpty(i)||(r=new Ta).setFromTransformedAABB(i,this.getWorldTransform(t));var a=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var o=E(r.getMin(),2),s=o[0],u=o[1],l=E(r.getMax(),2);return new Ca(s+((null==a?void 0:a.left)||0),u+((null==a?void 0:a.top)||0),l[0]-s,l[1]-u)}return new Ca((null==a?void 0:a.left)||0,(null==a?void 0:a.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?G(e.worldTransform,r.worldTransform,e.localTransform):O(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}}}]),e}(),ds={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]},vs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ps=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),ys=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),gs=function(){function t(e){var n=this;c(this,t),this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!ys.exec(e)&&!ps.exec(t))},this.trimByKinsokuShorui=function(t){var e=b(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}return f(t,[{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.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e);i.font=t;var a=ds.MetricsString+ds.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ds.BaselineSymbol).width),u=ds.HeightMultiplier*s;s=s*ds.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 y=0;h>y;y+=4)if(255!==l[d+y]){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=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath,h=e.leading,f=void 0===h?0:h,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=Pe(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!ri.test(l)&&0>ni.indexOf(l)&&(l='"'.concat(l,'"')),s[u]=l}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))}(e),v=this.measureFont(d,n);0===v.fontSize&&(v.fontSize=r,v.ascent=r);var p=this.runtime.offscreenCanvas.getOrCreateContext(n);p.font=d,e.isOverflowing=!1;var y=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),g=Array(y.length),m=0;if(!c){for(var x=0;y.length>x;x++){var k=p.measureText(y[x]).width+(y[x].length-1)*l;g[x]=k,m=Math.max(m,k)}var E=m+o,b=a||v.fontSize+o,S=Math.max(b,v.fontSize+o)+(y.length-1)*(b+f),M=0;return"middle"===s?M=-S/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?M=-S:"top"!==s&&"hanging"!==s||(M=0),{font:d,width:E,height:S,lines:y,lineWidths:g,lineHeight:b+=f,maxLineWidth:m,fontProperties:v,lineMetrics:g.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Ca(n-o/2,M+e*b,t+o,b)}))}}c.getTotalLength();for(var T=0;y.length>T;T++)p.measureText(y[T])}},{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=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvas.getOrCreateContext(n),h=a+o,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],v=0,p=0,y={},g=function(t){return r.getFromCache(t,o,y,c)},m=Array.from(f).reduce((function(t,e){return t+g(e)}),0),x=Array.from(t),k=0;x.length>k;k++){var E=x[k],b=t[k-1],S=t[k+1],M=g(E);if(this.isNewline(E)){if(++v>=u){e.isOverflowing=!0;break}p=0,d[v]=""}else{if(p>0&&p+M>h){if(v+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var T=d[v].length,P=0,w=T,N=0;T>N;N++){var C=g(d[v][N]);if(P+C+m>h){w=N;break}P+=C}d[v]=(d[v]||"").slice(0,w)+f}break}if(p=0,d[++v]="",this.isBreakingSpace(E))continue;this.canBreakInLastChar(E)||(d=this.trimToBreakable(d),p=this.sumTextWidthByCache(d[v]||"",y)),this.shouldBreakByKinsokuShorui(E,S)&&(d=this.trimByKinsokuShorui(d),p+=g(b||""))}p+=M,d[v]=(d[v]||"")+E}}return d.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ds.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ds.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=b(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||!vs.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(!vs.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}}]),t}(),ms={},xs=(ls=new ts,cs=new Jo,d(us={},t.Shape.CIRCLE,new Ko),d(us,t.Shape.ELLIPSE,new Zo),d(us,t.Shape.RECT,ls),d(us,t.Shape.IMAGE,ls),d(us,t.Shape.GROUP,ls),d(us,t.Shape.LINE,new Qo),d(us,t.Shape.TEXT,new es(ms)),d(us,t.Shape.POLYLINE,cs),d(us,t.Shape.POLYGON,cs),d(us,t.Shape.PATH,new $o),d(us,t.Shape.HTML,null),d(us,t.Shape.MESH,null),us),ks=function(){var e,n=new da,r=new ga;return d(e={},t.PropertySyntax.PERCENTAGE,null),d(e,t.PropertySyntax.NUMBER,new ba),d(e,t.PropertySyntax.ANGLE,new ha),d(e,t.PropertySyntax.DEFINED_PATH,new fa),d(e,t.PropertySyntax.PAINT,n),d(e,t.PropertySyntax.COLOR,n),d(e,t.PropertySyntax.FILTER,new va),d(e,t.PropertySyntax.LENGTH,r),d(e,t.PropertySyntax.LENGTH_PERCENTAGE,r),d(e,t.PropertySyntax.LENGTH_PERCENTAGE_12,new ma),d(e,t.PropertySyntax.LENGTH_PERCENTAGE_14,new xa),d(e,t.PropertySyntax.COORDINATE,new ka),d(e,t.PropertySyntax.OFFSET_DISTANCE,new Sa),d(e,t.PropertySyntax.OPACITY_VALUE,new Ma),d(e,t.PropertySyntax.PATH,new Aa),d(e,t.PropertySyntax.LIST_OF_POINTS,new Oa),d(e,t.PropertySyntax.SHADOW_BLUR,new La),d(e,t.PropertySyntax.TEXT,new Ra),d(e,t.PropertySyntax.TEXT_TRANSFORM,new Ia),d(e,t.PropertySyntax.TRANSFORM,new Da),d(e,t.PropertySyntax.TRANSFORM_ORIGIN,new _a),d(e,t.PropertySyntax.Z_INDEX,new Ga),d(e,t.PropertySyntax.MARKER,new Ea),e}();ms.CameraContribution=qo,ms.AnimationTimeline=null,ms.EasingFunction=null,ms.offscreenCanvas=new rs,ms.nativeHTMLMap=new WeakMap,ms.sceneGraphSelector=new os,ms.sceneGraphService=new fs(ms),ms.textService=new gs(ms),ms.geometryUpdaterFactory=xs,ms.CSSPropertySyntaxFactory=ks,ms.styleValueRegistry=new Xo,ms.layoutRegistry=null,ms.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("Unable to locate global `this`")}(),ms.enableCSSParsing=!0,ms.enableDataset=!1,ms.enableStyleSyntax=!0;var Es=function(){function t(){c(this,t),this.context=void 0,this.plugins=[]}return f(t,[{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)}))}}]),t}(),bs=function(){function t(e){c(this,t),this.plugins=[],this.config=void 0,this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},e)}return f(t,[{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)}}]),t}(),Ss=function(){function e(t){c(this,e),this.strategies=void 0,this.strategies=t}return f(e,[{key:"apply",value:function(n){var r=n.camera,i=n.renderingService,a=n.renderingContext,o=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===o.length?a.unculledEntities.indexOf(e.entity)>-1:o.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Va(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}]),e}();Ss.tag="Culling";var Ms=function(){function t(){c(this,t)}return f(t,[{key:"apply",value:function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))}}]),t}();Ms.tag="DirtyCheck";var Ts=function(){function t(){var e=this;c(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new eo(null),this.rootWheelEvent=new no(null),this.context=void 0,this.onPointerMove=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var a,o=T(e.normalizeToPointerEvent(t,i));try{for(o.s();!(a=o.n()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,a.value,i,t);e.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}e.setCursor(e.context.eventService.cursor)}}}return f(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=T(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=n.context.contextService.getDomElement(),r="outside";try{r=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}var a,o=T(n.normalizeToPointerEvent(t,i));try{for(o.s();!(a=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,a.value,i,t);s.type+=r,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.onPointerMove),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=T(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:"getViewportXY",value:function(t){var e,n,r=t.offsetX,i=t.offsetY,a=t.clientX,o=t.clientY;if(!this.context.config.supportsCSSTransform||ge(r)||ge(i)){var s=this.context.eventService.client2Viewport(new Na(a,o));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}}},{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.getViewportXY(e),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=Jn[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.getViewportXY(t),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=performance.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];De(i.button)&&(i.button=0),De(i.buttons)&&(i.buttons=1),De(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),De(i.width)&&(i.width=i.radiusX||1),De(i.height)&&(i.height=i.radiusY||1),De(i.tiltX)&&(i.tiltX=0),De(i.tiltY)&&(i.tiltY=0),De(i.pointerType)&&(i.pointerType="touch"),De(i.pointerId)&&(i.pointerId=i.identifier||0),De(i.pressure)&&(i.pressure=i.force||.5),De(i.twist)&&(i.twist=0),De(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;De(a.isPrimary)&&(a.isPrimary=!0),De(a.width)&&(a.width=1),De(a.height)&&(a.height=1),De(a.tiltX)&&(a.tiltX=0),De(a.tiltY)&&(a.tiltY=0),De(a.pointerType)&&(a.pointerType="mouse"),De(a.pointerId)&&(a.pointerId=1),De(a.pressure)&&(a.pressure=.5),De(a.twist)&&(a.twist=0),De(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}]),t}();Ts.tag="Event";var Ps,ws=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],Ns=function(){function e(){c(this,e)}return f(e,[{key:"isVisible",value:function(e,n){var r,i,a=n.cullable;if(!a.enable)return!0;var o=n.getRenderBounds();if(Ta.isEmpty(o))return!1;var s=e.getFrustum(),u=null===(r=n.parentNode)||void 0===r||null===(i=r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,o,u||t.Mask.INDETERMINATE,s.planes),a.visible=a.visibilityPlaneMask!==t.Mask.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var a=t.Mask.INSIDE,o=ws.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var l=1<<s;if(0!=(r&l)&&(!o||4!==s&&5!==s)){var c=i[s],h=c.normal,f=c.distance;if(0>lt(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>lt(h,n.getNegativeFarPoint(i[s]))+f&&(a|=l)}}return a}}]),e}(),Cs=function(){function e(){c(this,e),this.rBush=void 0,this.toSync=new Set}return f(e,[{key:"apply",value:function(n){var r=this,i=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var s=function(t){t.target.renderable.dirty=!0,i.dirtify()},u=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},c=function(t){var e=t.target;ms.enableCSSParsing&&ms.styleValueRegistry.recalc(e),ms.sceneGraphService.dirtifyToRoot(e),i.dirtify()},h=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),ms.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,l(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.addEventListener(t.ElementEvent.MOUNTED,c),a.addEventListener(t.ElementEvent.UNMOUNTED,h),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,u);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,c),a.removeEventListener(t.ElementEvent.UNMOUNTED,h),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,u),r.toSync.clear()})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))}},{key:"syncRTree",value:function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var a=E(i.getMin(),2),o=a[0],s=a[1],u=E(i.getMax(),2),l=u[0],c=u[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=o,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=c}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()}}]),e}();Cs.tag="Prepare",(Ps=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Ps.BEFORE_RENDER="beforerender",Ps.RERENDER="rerender",Ps.AFTER_RENDER="afterrender",Ps.BEFORE_DESTROY="beforedestroy",Ps.AFTER_DESTROY="afterdestroy",Ps.RESIZE="resize",Ps.DIRTY_RECTANGLE="dirtyrectangle";var As=new Va(t.ElementEvent.MOUNTED),Os=new Va(t.ElementEvent.UNMOUNTED),Ls=new Va(t.CanvasEvent.BEFORE_RENDER),Rs=new Va(t.CanvasEvent.RERENDER),Is=new Va(t.CanvasEvent.AFTER_RENDER),Ds=function(e){v(u,e);var n,i,s=x(u);function u(e){var n;c(this,u),(n=s.call(this)).document=void 0,n.customElements=void 0,n.requestAnimationFrame=void 0,n.cancelAnimationFrame=void 0,n.devicePixelRatio=void 0,n.supportsPointerEvents=void 0,n.supportsTouchEvents=void 0,n.isTouchEvent=void 0,n.isMouseEvent=void 0,n.Element=vo,n.frameId=void 0,n.inited=!1,n.readyPromise=void 0,n.resolveReadyPromise=void 0,n.context={},n.document=new za,n.document.defaultView=m(n),n.customElements=new Ua;var r=e.container,i=e.canvas,a=e.offscreenCanvas,h=e.width,f=e.height,d=e.devicePixelRatio,v=e.renderer,p=e.background,y=e.cursor,g=e.document,x=e.requestAnimationFrame,k=e.cancelAnimationFrame,E=e.createImage,b=e.supportsPointerEvents,S=e.supportsTouchEvents,M=e.supportsCSSTransform,T=e.useNativeClickEvent,P=e.alwaysTriggerPointerEventOnCanvas,w=e.isTouchEvent,N=e.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||Wn++;Hn[n]&&Hn[n].destroy(),Hn[n]=e}}(r,m(n));var C=h,A=f,O=d;return i&&(O=1>(O=d||zn&&window.devicePixelRatio||1)?1:Math.ceil(O),C=h||function(t){var e=Zn(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/O,A=f||function(t){var e=Zn(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/O),n.devicePixelRatio=O,n.requestAnimationFrame=null!=x?x:di.bind(ms.globalThis),n.cancelAnimationFrame=null!=k?k:vi.bind(ms.globalThis),n.supportsTouchEvents=null!=S?S:"ontouchstart"in ms.globalThis,n.supportsPointerEvents=null!=b?b:!!ms.globalThis.PointerEvent,n.isTouchEvent=null!=w?w:function(t){return n.supportsTouchEvents&&t instanceof ms.globalThis.TouchEvent},n.isMouseEvent=null!=N?N:function(t){return!ms.globalThis.MouseEvent||t instanceof ms.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof ms.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:C,height:A,renderer:v,offscreenCanvas:a,devicePixelRatio:O,cursor:y||"default",background:p||"transparent",createImage:E,document:g,supportsCSSTransform:M,useNativeClickEvent:T,alwaysTriggerPointerEventOnCanvas:P}),n.initDefaultCamera(C,A),l(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.initRenderer(v);case 2:n.dispatchEvent(new Va(t.CanvasEvent.READY)),n.readyPromise&&n.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),n}return f(u,[{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(e,n){var r=this,i=new ms.CameraContribution;i.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Wo.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i}},{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 e=0>=arguments.length||void 0===arguments[0]||arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(n||this.dispatchEvent(new Va(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new Va(t.CanvasEvent.AFTER_DESTROY))}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),a===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Va(t.CanvasEvent.RESIZE,{width:e,height:n}))}},{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(){var t=this;this.dispatchEvent(Ls),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(Rs)})),this.dispatchEvent(Is)}},{key:"run",value:function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()}},{key:"initRenderer",value:(i=l(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new r,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Ts,new Cs,new Ms,new Ss([new Ns])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(a(a({},ms),this.context)),this.context.renderingService=new is(ms,this.context),this.context.eventService=new ns(ms,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(ms)}))}},{key:"setRenderer",value:(n=l(o().mark((function t(e){var n,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),b(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(ms)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{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(Os):(Os.target=t,this.dispatchEvent(Os,!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;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(As):(As.target=t,this.dispatchEvent(As,!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)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{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})}}]),u}(Ya);t.AABB=Ta,t.AbstractRenderer=bs,t.AbstractRendererPlugin=Es,t.BUILT_IN_PROPERTIES=Fo,t.CSS=an,t.CSSGradientValue=Xe,t.CSSKeywordValue=He,t.CSSRGB=rn,t.CSSStyleValue=je,t.CSSUnitValue=tn,t.Camera=qo,t.CameraEvent=Wo,t.Canvas=Ds,t.Circle=yo,t.CircleUpdater=Ko,t.CustomElement=mo,t.CustomElementRegistry=Ua,t.CustomEvent=Va,t.DefaultSceneGraphSelector=os,t.DefaultSceneGraphService=fs,t.DisplayObject=vo,t.Document=za,t.EMPTY_PARSED_PATH=Ao,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Qn,t.Element=Ja,t.Ellipse=ko,t.EllipseUpdater=Zo,t.EventService=ns,t.EventTarget=Ya,t.FederatedEvent=Fa,t.FederatedMouseEvent=to,t.FederatedPointerEvent=eo,t.FederatedWheelEvent=no,t.Frustum=wa,t.Group=bo,t.HTML=Mo,t.Image=Po,t.Line=No,t.LineUpdater=Qo,t.MutationEvent=qa,t.Node=Xa,t.OffscreenCanvasCreator=rs,t.Path=Oo,t.PathUpdater=$o,t.Plane=Pa,t.Point=Na,t.Polygon=Ro,t.Polyline=Do,t.PolylineUpdater=Jo,t.RBush=r,t.Rect=Go,t.RectUpdater=ts,t.Rectangle=Ca,t.RenderingService=is,t.Text=Bo,t.TextService=gs,t.TextUpdater=es,t.computeLinearGradient=function(t,e,n){var r=or(n.value),i=0+t/2,a=0+e/2,o=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*o/2,y1:a-Math.sin(r)*o/2,x2:i+Math.cos(r)*o/2,y2:a+Math.sin(r)*o/2}},t.computeRadialGradient=function(e,n,r,i,a){var o=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(o=r.value/100*e),i.unit===t.UnitType.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 tn?u=a.value:a instanceof He&&("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,y:s,r:u}},t.convertToPath=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.getLocalTransform(),r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var a=e.parsedStyle,o=a.r;r=Qr(o,o,a.cx,a.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Qr(s.rx,s.ry,s.cx,s.cy);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=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}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,l=u.width,c=u.height,h=u.x,f=u.y,d=u.radius,v=d&&d.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var a=E(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"]]}(l,c,h,f,v&&d.map((function(t){return Te(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))})));break;case t.Shape.PATH:r=b(e.parsedStyle.path.absolutePath)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,a=void 0===i?0:i,o=r.defY,s=void 0===o?0:o;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=rt(e[1]-a,e[2]-s,0);n&&ht(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 o=rt(e[1]-a,e[2]-s,0),u=rt(e[3]-a,e[4]-s,0),l=rt(e[5]-a,e[6]-s,0);n&&(ht(o,o,n),ht(u,u,n),ht(l,l,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(u[0],",").concat(u[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var c=rt(e[6]-a,e[7]-s,0);n&&ht(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else if("Q"===e[0]){var h=rt(e[1]-a,e[2]-s,0),f=rt(e[3]-a,e[4]-s,0);n&&(ht(h,h,n),ht(f,f,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(r,e,n)},t.createVec3=ar,t.decompose=hr,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==E(t,2)[1]})))},t.deg2rad=or,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Kn,t.fromRotationTranslationScale=cr,t.getAngle=ir,t.getEuler=lr,t.getOrCalculatePathTotalLength=Fr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=zn,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Mi,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=ro,t.isFederatedEvent=Ba,t.isFillOrStrokeAffected=function(t,e,n){var 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=Si,t.mergeColors=Pi,t.parseColor=Ti,t.parseLength=Ni,t.parsePath=Hi,t.parseTransform=Ji,t.parsedTransformToMat4=xr,t.propertyMetadataCache=jo,t.rad2deg=sr,t.resetEntityCounter=function(){Ka=0},t.runtime=ms,t.setDOMSize=function(t,e,n){zn&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=t.map((function(s,u){var l=t[u+1],c=0===u&&(0!==r||0!==i),h=(u===t.length-1||l&&("M"===l[0]||"Z"===l[0]))&&0!==a&&0!==o;switch(s[0]){case"M":return c?"M ".concat(s[1]-e+r,",").concat(s[2]-n+i," L ").concat(s[1]-e,",").concat(s[2]-n):"M ".concat(s[1]-e,",").concat(s[2]-n);case"L":return"L ".concat(s[1]-e+(h?a:0),",").concat(s[2]-n+(h?o:0));case"Q":return"Q ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n)+(h?" L ".concat(s[3]-e+a,",").concat(s[4]-n+o):"");case"C":return"C ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n,",").concat(s[5]-e," ").concat(s[6]-n)+(h?" L ".concat(s[5]-e+a,",").concat(s[6]-n+o):"");case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]-e," ").concat(s[7]-n)+(h?" L ".concat(s[6]-e+a,",").concat(s[7]-n+o):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=ur,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var n,r=e((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],p=i,d=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);d>p;){for(n(t,p,d),p++,d--;0>o(t[p],f);)p++;for(;o(t[d],f)>0;)d--}0===o(t[i],f)?n(t,i,d):n(t,++d,a),d>r||(i=d+1),r>d||(a=d-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 p(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 d(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 v(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function g(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 m(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(!g(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;g(t,s)&&(e.leaf?n.push(o):v(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!g(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(g(t,a)){if(e.leaf||v(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||!v(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));m(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);m(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=p(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=d(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 p=n-e-1;p>=e;p--){var d=t.children[p];u(o,t.leaf?i(d):d),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}()}));function i(){i=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var a=Object.create((e&&e.prototype instanceof p?e:p).prototype),o=new w(i||[]);return r(a,"_invoke",{value:M(t,n,o)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function p(){}function d(){}function v(){}var g={};l(g,o,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(N([])));m&&m!==e&&n.call(m,o)&&(g=m);var x=v.prototype=p.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,a,o,s){var u=h(t[r],t,a);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(c).then((function(t){l.value=t,o(l)}),(function(t){return i("throw",t,o,s)}))}s(u.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function M(t,e,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return k()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=h(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function N(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=v,r(x,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:d,configurable:!0}),d.displayName=l(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(b.prototype),l(b.prototype,s,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new b(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},E(x),l(x,u,"Generator"),l(x,o,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.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}},t.values=N,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(this.prev>=a.tryLoc){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(a.catchLoc>this.prev)return r(a.catchLoc,!0);if(a.finallyLoc>this.prev)return r(a.finallyLoc)}else if(s){if(a.catchLoc>this.prev)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(a.finallyLoc>this.prev)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var a=i;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,f):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),f},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),P(n),f}},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;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function a(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 o(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,u,"next",t)}function u(t){a(o,r,i,s,u,"throw",t)}s(void 0)}))}}function s(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(){return l=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},l.apply(this,arguments)}function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function f(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&(i[n]=t[n]);return i}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function v(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>";var g=1e-6,y="undefined"!=typeof Float32Array?Float32Array:Array;function m(){var t=new y(9);return y!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function x(){var t=new y(16);return y!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function b(t,e,n,r,i,a,o,s,u,l,c,h,f,p,d,v,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=v,t[15]=g,t}function M(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function S(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function T(t,e){var 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],p=e[11],d=e[12],v=e[13],g=e[14],y=e[15],m=n*s-r*o,x=n*u-i*o,E=n*l-a*o,b=r*u-i*s,M=r*l-a*s,S=i*l-a*u,T=c*v-h*d,P=c*g-f*d,w=c*y-p*d,N=h*g-f*v,k=h*y-p*v,C=f*y-p*g,A=m*C-x*k+E*N+b*w-M*P+S*T;return A?(t[0]=(s*C-u*k+l*N)*(A=1/A),t[1]=(i*k-r*C-a*N)*A,t[2]=(v*S-g*M+y*b)*A,t[3]=(f*M-h*S-p*b)*A,t[4]=(u*w-o*C-l*P)*A,t[5]=(n*C-i*w+a*P)*A,t[6]=(g*E-d*S-y*x)*A,t[7]=(c*S-f*E+p*x)*A,t[8]=(o*k-s*w+l*T)*A,t[9]=(r*w-n*k-a*T)*A,t[10]=(d*M-v*E+y*m)*A,t[11]=(h*E-c*M-p*m)*A,t[12]=(s*P-o*N-u*T)*A,t[13]=(n*N-r*P+i*T)*A,t[14]=(v*x-d*b-g*m)*A,t[15]=(c*b-h*x+f*m)*A,t):null}function P(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],g=t[15];return(e*o-n*a)*(h*g-f*v)-(e*s-r*a)*(c*g-f*d)+(e*u-i*a)*(c*v-h*d)+(n*s-r*o)*(l*g-f*p)-(n*u-i*o)*(l*v-h*p)+(r*u-i*s)*(l*d-c*p)}function w(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],v=e[12],g=e[13],y=e[14],m=e[15],x=n[0],E=n[1],b=n[2],M=n[3];return t[0]=x*r+E*s+b*h+M*v,t[1]=x*i+E*u+b*f+M*g,t[2]=x*a+E*l+b*p+M*y,t[3]=x*o+E*c+b*d+M*m,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(M=n[7])*v,t[5]=x*i+E*u+b*f+M*g,t[6]=x*a+E*l+b*p+M*y,t[7]=x*o+E*c+b*d+M*m,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(M=n[11])*v,t[9]=x*i+E*u+b*f+M*g,t[10]=x*a+E*l+b*p+M*y,t[11]=x*o+E*c+b*d+M*m,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(M=n[15])*v,t[13]=x*i+E*u+b*f+M*g,t[14]=x*a+E*l+b*p+M*y,t[15]=x*o+E*c+b*d+M*m,t}function N(t,e,n){var r,i,a,o,s,u,l,c,h,f,p,d,v=n[0],g=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*y+e[12],t[13]=e[1]*v+e[5]*g+e[9]*y+e[13],t[14]=e[2]*v+e[6]*g+e[10]*y+e[14],t[15]=e[3]*v+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*v+s*g+h*y+e[12],t[13]=i*v+u*g+f*y+e[13],t[14]=a*v+l*g+p*y+e[14],t[15]=o*v+c*g+d*y+e[15]),t}function k(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function C(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function A(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function O(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function L(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,p=i*u,d=i*l,v=a*l,g=o*s,y=o*u,m=o*l;return t[0]=1-(p+v),t[1]=h+m,t[2]=f-y,t[3]=0,t[4]=h-m,t[5]=1-(c+v),t[6]=d+g,t[7]=0,t[8]=f+y,t[9]=d-g,t[10]=1-(c+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function R(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function I(t,e){var n=e[4],r=e[5],i=e[6],a=e[8],o=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(a,o,s),t}function D(t,e){var n=new y(3);I(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,u=e[2]*a,l=e[4]*r,c=e[5]*i,h=e[6]*a,f=e[8]*r,p=e[9]*i,d=e[10]*a,v=o+c+d,g=0;return v>0?(t[3]=.25*(g=2*Math.sqrt(v+1)),t[0]=(h-p)/g,t[1]=(f-u)/g,t[2]=(s-l)/g):o>c&&o>d?(t[3]=(h-p)/(g=2*Math.sqrt(1+o-c-d)),t[0]=.25*g,t[1]=(s+l)/g,t[2]=(f+u)/g):c>d?(t[3]=(f-u)/(g=2*Math.sqrt(1+c-o-d)),t[0]=(s+l)/g,t[1]=.25*g,t[2]=(h+p)/g):(t[3]=(s-l)/(g=2*Math.sqrt(1+d-o-c)),t[0]=(f+u)/g,t[1]=(h+p)/g,t[2]=.25*g),t}function _(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,p=a*c,d=a*h,v=o*c,g=o*h,y=s*h,m=u*l,x=u*c,E=u*h,b=r[0],M=r[1],S=r[2],T=i[0],P=i[1],w=i[2],N=(1-(v+y))*b,k=(p+E)*b,C=(d-x)*b,A=(p-E)*M,O=(1-(f+y))*M,L=(g+m)*M,R=(d+x)*S,I=(g-m)*S,D=(1-(f+v))*S;return t[0]=N,t[1]=k,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=L,t[7]=0,t[8]=R,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+T-(N*T+A*P+R*w),t[13]=n[1]+P-(k*T+O*P+I*w),t[14]=n[2]+w-(C*T+L*P+D*w),t[15]=1,t}function G(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,p=i*s,d=i*u,v=a*o,g=a*s,y=a*u;return t[0]=1-h-d,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-l-d,t[6]=p+v,t[7]=0,t[8]=f+g,t[9]=p-v,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function U(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(a=1/(r-i)),t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}function B(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var F=B;function V(t,e,n,r){var i,a,o,s,u,l,c,h,f,p,d=e[0],v=e[1],y=e[2],m=r[0],x=r[1],E=r[2],b=n[0],S=n[1],T=n[2];return g>Math.abs(d-b)&&g>Math.abs(v-S)&&g>Math.abs(y-T)?M(t):(p=1/Math.hypot(c=d-b,h=v-S,f=y-T),(p=Math.hypot(i=x*(f*=p)-E*(h*=p),a=E*(c*=p)-m*f,o=m*h-x*c))?(i*=p=1/p,a*=p,o*=p):(i=0,a=0,o=0),(p=Math.hypot(s=h*o-f*a,u=f*i-c*o,l=c*a-h*i))?(s*=p=1/p,u*=p,l*=p):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=f,t[11]=0,t[12]=-(i*d+a*v+o*y),t[13]=-(s*d+u*v+l*y),t[14]=-(c*d+h*v+f*y),t[15]=1,t)}function Y(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var j=Object.freeze({__proto__:null,create:x,clone:function(t){var e=new y(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:E,fromValues:function(t,e,n,r,i,a,o,s,u,l,c,h,f,p,d,v){var g=new y(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=l,g[10]=c,g[11]=h,g[12]=f,g[13]=p,g[14]=d,g[15]=v,g},set:b,identity:M,transpose:S,invert:T,adjoint:function(t,e){var 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],p=e[11],d=e[12],v=e[13],g=e[14],y=e[15];return t[0]=s*(f*y-p*g)-h*(u*y-l*g)+v*(u*p-l*f),t[1]=-(r*(f*y-p*g)-h*(i*y-a*g)+v*(i*p-a*f)),t[2]=r*(u*y-l*g)-s*(i*y-a*g)+v*(i*l-a*u),t[3]=-(r*(u*p-l*f)-s*(i*p-a*f)+h*(i*l-a*u)),t[4]=-(o*(f*y-p*g)-c*(u*y-l*g)+d*(u*p-l*f)),t[5]=n*(f*y-p*g)-c*(i*y-a*g)+d*(i*p-a*f),t[6]=-(n*(u*y-l*g)-o*(i*y-a*g)+d*(i*l-a*u)),t[7]=n*(u*p-l*f)-o*(i*p-a*f)+c*(i*l-a*u),t[8]=o*(h*y-p*v)-c*(s*y-l*v)+d*(s*p-l*h),t[9]=-(n*(h*y-p*v)-c*(r*y-a*v)+d*(r*p-a*h)),t[10]=n*(s*y-l*v)-o*(r*y-a*v)+d*(r*l-a*s),t[11]=-(n*(s*p-l*h)-o*(r*p-a*h)+c*(r*l-a*s)),t[12]=-(o*(h*g-f*v)-c*(s*g-u*v)+d*(s*f-u*h)),t[13]=n*(h*g-f*v)-c*(r*g-i*v)+d*(r*f-i*h),t[14]=-(n*(s*g-u*v)-o*(r*g-i*v)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+c*(r*u-i*s),t},determinant:P,multiply:w,translate:N,scale:k,rotate:function(t,e,n,r){var i,a,o,s,u,l,c,h,f,p,d,v,y,m,x,E,b,M,S,T,P,w,N,k,C=r[0],A=r[1],O=r[2],L=Math.hypot(C,A,O);return g>L?null:(C*=L=1/L,A*=L,O*=L,i=Math.sin(n),u=e[1],l=e[2],c=e[3],f=e[5],p=e[6],d=e[7],y=e[9],m=e[10],x=e[11],S=C*A*(o=1-(a=Math.cos(n)))-O*i,T=A*A*o+a,P=O*A*o+C*i,w=C*O*o+A*i,N=A*O*o-C*i,k=O*O*o+a,t[0]=(s=e[0])*(E=C*C*o+a)+(h=e[4])*(b=A*C*o+O*i)+(v=e[8])*(M=O*C*o-A*i),t[1]=u*E+f*b+y*M,t[2]=l*E+p*b+m*M,t[3]=c*E+d*b+x*M,t[4]=s*S+h*T+v*P,t[5]=u*S+f*T+y*P,t[6]=l*S+p*T+m*P,t[7]=c*S+d*T+x*P,t[8]=s*w+h*N+v*k,t[9]=u*w+f*N+y*k,t[10]=l*w+p*N+m*k,t[11]=c*w+d*N+x*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:C,rotateY:A,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:O,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,a,o=n[0],s=n[1],u=n[2],l=Math.hypot(o,s,u);return g>l?null:(o*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=o*o*(a=1-(i=Math.cos(e)))+i,t[1]=s*o*a+u*r,t[2]=u*o*a-s*r,t[3]=0,t[4]=o*s*a-u*r,t[5]=s*s*a+i,t[6]=u*s*a+o*r,t[7]=0,t[8]=o*u*a+s*r,t[9]=s*u*a-o*r,t[10]=u*u*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:L,fromQuat2:function(t,e){var n=new y(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+a*a+o*o;return h>0?(n[0]=2*(s*o+c*r+u*a-l*i)/h,n[1]=2*(u*o+c*i+l*r-s*a)/h,n[2]=2*(l*o+c*a+s*i-u*r)/h):(n[0]=2*(s*o+c*r+u*a-l*i),n[1]=2*(u*o+c*i+l*r-s*a),n[2]=2*(l*o+c*a+s*i-u*r)),L(t,e,n),t},getTranslation:R,getScaling:I,getRotation:D,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,p=i*c,d=a*l,v=a*c,g=o*c,y=s*u,m=s*l,x=s*c,E=r[0],b=r[1],M=r[2];return t[0]=(1-(d+g))*E,t[1]=(f+x)*E,t[2]=(p-m)*E,t[3]=0,t[4]=(f-x)*b,t[5]=(1-(h+g))*b,t[6]=(v+y)*b,t[7]=0,t[8]=(p+m)*M,t[9]=(v-y)*M,t[10]=(1-(h+d))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:_,fromQuat:G,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:U,perspective:U,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(a=1/(r-i)),t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:B,ortho:F,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*l,t[15]=1,t},lookAt:V,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=a-n[1],f=o-n[2],p=c*c+h*h+f*f;p>0&&(c*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-l*h,v=l*c-s*f,g=s*h-u*c;return(p=d*d+v*v+g*g)>0&&(d*=p=1/Math.sqrt(p),v*=p,g*=p),t[0]=d,t[1]=v,t[2]=g,t[3]=0,t[4]=h*g-f*v,t[5]=f*d-c*g,t[6]=c*v-h*d,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Y,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],f=t[10],p=t[11],d=t[12],v=t[13],y=t[14],m=t[15],x=e[0],E=e[1],b=e[2],M=e[3],S=e[4],T=e[5],P=e[6],w=e[7],N=e[8],k=e[9],C=e[10],A=e[11],O=e[12],L=e[13],R=e[14],I=e[15];return!(Math.abs(n-x)>g*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(r-E)>g*Math.max(1,Math.abs(r),Math.abs(E))||Math.abs(i-b)>g*Math.max(1,Math.abs(i),Math.abs(b))||Math.abs(a-M)>g*Math.max(1,Math.abs(a),Math.abs(M))||Math.abs(o-S)>g*Math.max(1,Math.abs(o),Math.abs(S))||Math.abs(s-T)>g*Math.max(1,Math.abs(s),Math.abs(T))||Math.abs(u-P)>g*Math.max(1,Math.abs(u),Math.abs(P))||Math.abs(l-w)>g*Math.max(1,Math.abs(l),Math.abs(w))||Math.abs(c-N)>g*Math.max(1,Math.abs(c),Math.abs(N))||Math.abs(h-k)>g*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-C)>g*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(p-A)>g*Math.max(1,Math.abs(p),Math.abs(A))||Math.abs(d-O)>g*Math.max(1,Math.abs(d),Math.abs(O))||Math.abs(v-L)>g*Math.max(1,Math.abs(v),Math.abs(L))||Math.abs(y-R)>g*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(m-I)>g*Math.max(1,Math.abs(m),Math.abs(I)))},mul:w,sub:Y});function X(){var t=new y(3);return y!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function H(t){return Math.hypot(t[0],t[1],t[2])}function W(t,e,n){var r=new y(3);return r[0]=t,r[1]=e,r[2]=n,r}function z(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function q(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function K(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Z(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Q(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function tt(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function et(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return g*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&g*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)&&g*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var nt,rt=H;nt=X();function it(){var t=new y(4);return y!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function at(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}!function(){var t=it()}();function ot(){var t=new y(4);return y!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function st(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ut(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function lt(t,e,n,r){var i,a,o,s,u,l=e[0],c=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],y=n[3];return 0>(a=l*p+c*d+h*v+f*y)&&(a=-a,p=-p,d=-d,v=-v,y=-y),1-a>g?(o=Math.sin(i=Math.acos(a)),s=Math.sin((1-r)*i)/o,u=Math.sin(r*i)/o):(s=1-r,u=r),t[0]=s*l+u*p,t[1]=s*c+u*d,t[2]=s*h+u*v,t[3]=s*f+u*y,t}function ct(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function ht(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var a=Math.sin(e*=i),o=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=a*u*c-o*s*l,t[1]=o*s*c+a*u*l,t[2]=o*u*l-a*s*c,t[3]=o*u*c+a*s*l,t}var ft,pt,dt,vt,gt,yt,mt=function(t,e,n,r){var i=new y(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},xt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Et=ut,bt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};ft=X(),pt=W(1,0,0),dt=W(0,1,0),vt=ot(),gt=ot(),yt=m();!function(){var t,e=(t=new y(2),y!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Mt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var St=function(){return St=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},St.apply(this,arguments)},Tt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Pt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var wt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Nt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return wt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function kt(t){return Nt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Ct(t){return kt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function At(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=wt[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,wt[n]))),wt[n]););}function Ot(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Lt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Rt(t){return t>=48&&57>=t}function It(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Rt(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Rt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>a&&Rt(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Rt(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid float exponent');if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!Rt(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid integer exponent');for(;n>a&&Rt(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+a+', "pathValue" is missing param'}function Dt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function _t(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=wt[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Dt(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?It(t):Ot(t),t.err.length)return;t.data.push(t.param),Dt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Dt(t))}if(t.index>=t.max)break;if(!Lt(n.charCodeAt(t.index)))break}At(t)}else At(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Gt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Ut(t){if(kt(t))return Mt(t);var e=function(t){if(Nt(t))return Mt(t);var e=new Gt(t);for(Dt(e);e.max>e.index&&!e.err.length;)_t(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e}))}function Bt(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var p=s[1];e.qx=s[0],e.qy=p}return u}function Ft(t){if(Ct(t))return Mt(t);for(var e=Ut(t),n=St({},Tt),r=0;e.length>r;r+=1){e[r]=Bt(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function Vt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Yt(t,e,n,r,i,a,o,s,u,l){var c,h,f,p,d,v=t,g=e,y=n,m=r,x=s,E=u,b=120*Math.PI/180,M=Math.PI/180*(+i||0),S=[];if(l)h=l[0],f=l[1],p=l[2],d=l[3];else{g=(c=Vt(v,g,-M)).y;var T=((v=c.x)-(x=(c=Vt(x,E,-M)).x))/2,P=(g-(E=c.y))/2,w=T*T/(y*y)+P*P/(m*m);w>1&&(y*=w=Math.sqrt(w),m*=w);var N=y*y,k=m*m,C=(a===o?-1:1)*Math.sqrt(Math.abs((N*k-N*P*P-k*T*T)/(N*P*P+k*T*T)));p=C*y*P/m+(v+x)/2,h=Math.asin(((g-(d=C*-m*T/y+(g+E)/2))/m*1e9>>0)/1e9),f=Math.asin(((E-d)/m*1e9>>0)/1e9),0>(h=p>v?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=p>x?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>b){var O=f,L=x,R=E;S=Yt(x=p+y*Math.cos(f=h+b*(o&&f>h?1:-1)),E=d+m*Math.sin(f),y,m,i,0,o,L,R,[f,O,p,d])}A=f-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(f),G=Math.sin(f),U=Math.tan(A/4),B=4/3*y*U,F=4/3*m*U,V=[v,g],Y=[v+B*D,g-F*I],j=[x+B*G,E-F*_],X=[x,E];if(Y[0]=2*V[0]-Y[0],Y[1]=2*V[1]-Y[1],l)return Y.concat(j,X,S);for(var H=[],W=0,z=(S=Y.concat(j,X,S)).length;z>W;W+=1)H[W]=W%2?Vt(S[W-1],S[W],M).y:Vt(S[W],S[W+1],M).x;return H}function jt(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Xt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ht(t,e,n,r,i){var a=Xt([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=jt([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Wt(t,e,n,r){var i=.5,a=[t,e],o=[n,r],s=jt(a,o,i),u=jt(o,s,i),l=jt(s,u,i),c=jt(u,l,i),h=jt(l,c,i),f=Ht(a[0],a[1],s[0],s[1],l[0]).point,p=Ht(h[0],h[1],c[0],c[1],u[0]).point;return[f.x,f.y,p.x,p.y,n,r]}function zt(t,e){var n,r,i,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],p=e.x1,d=e.y1,v=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[p,d].concat(c),["C"].concat(Yt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[p,d].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(Wt(p,d,h,f));case"Z":return p===v&&d===g?["C",p,d,v,g,v,g]:["C"].concat(Wt(p,d,v,g))}return t}function qt(t,e){if(void 0===e&&(e=!1),function(t){return Ct(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=Mt(t);return e?[n,[]]:n}for(var r,i,a=Ft(t),o=St({},Tt),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=zt(a[h],o);a[h]=f,Pt(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function Kt(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function Zt(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,p=Math.sqrt,d=Math.PI,v=c(n),g=c(r),y=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===g)return Ht(t,e,s,u,l).point;var m=(t-s)/2,x=(e-u)/2,E={x:f(y)*m+h(y)*x,y:-h(y)*m+f(y)*x},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(g,2);b>1&&(v*=p(b),g*=p(b));var M=(Math.pow(v,2)*Math.pow(g,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(g,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(g,2)*Math.pow(E.x,2)),S=(a!==o?1:-1)*p(M=0>M?0:M),T=S*(v*E.y/g),P=S*(-g*E.x/v),w=f(y)*T-h(y)*P+(t+s)/2,N=h(y)*T+f(y)*P+(e+u)/2,k={x:(E.x-T)/v,y:(E.y-P)/g},C=Kt({x:1,y:0},k),A=Kt(k,{x:(-E.x-T)/v,y:(-E.y-P)/g});!o&&A>0?A-=2*d:o&&0>A&&(A+=2*d);var O=C+(A%=2*d)*l,L=v*f(O),R=g*h(O);return{x:f(y)*L-h(y)*R+w,y:h(y)*L+f(y)*R+N}}function Qt(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,p=void 0===f||f,d=c.length,v=void 0===d||d,g=c.sampleSize,y=void 0===g?30:g,m="number"==typeof l,x=t,E=e,b=0,M=[x,E,b],S=[x,E],T={x:0,y:0},P=[{x:x,y:E}];m&&0>=l&&(T={x:x,y:E});for(var w=0;y>=w;w+=1){if(x=(h=Zt(t,e,n,r,i,a,o,s,u,w/y)).x,E=h.y,p&&P.push({x:x,y:E}),v&&(b+=Xt(S,[x,E])),S=[x,E],m&&b>=l&&l>M[2]){var N=(b-l)/(b-M[2]);T={x:S[0]*(1-N)+M[0]*N,y:S[1]*(1-N)+M[1]*N}}M=[x,E,b]}return m&&l>=b&&(T={x:s,y:u}),{length:b,point:T,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function $t(t,e,n,r,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function Jt(t,e,n,r,i,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,p=l.length,d=void 0===p||p,v=l.sampleSize,g=void 0===v?10:v,y="number"==typeof u,m=t,x=e,E=0,b=[m,x,E],M=[m,x],S={x:0,y:0},T=[{x:m,y:x}];y&&0>=u&&(S={x:m,y:x});for(var P=0;g>=P;P+=1){if(m=(c=$t(t,e,n,r,i,a,o,s,P/g)).x,x=c.y,f&&T.push({x:m,y:x}),d&&(E+=Xt(M,[m,x])),M=[m,x],y&&E>=u&&u>b[2]){var w=(E-u)/(E-b[2]);S={x:M[0]*(1-w)+b[0]*w,y:M[1]*(1-w)+b[1]*w}}b=[m,x,E]}return y&&u>=E&&(S={x:o,y:s}),{length:E,point:S,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function te(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function ee(t,e,n,r,i,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,p=s.sampleSize,d=void 0===p?10:p,v="number"==typeof o,g=t,y=e,m=0,x=[g,y,m],E=[g,y],b={x:0,y:0},M=[{x:g,y:y}];v&&0>=o&&(b={x:g,y:y});for(var S=0;d>=S;S+=1){if(g=(u=te(t,e,n,r,i,a,S/d)).x,y=u.y,c&&M.push({x:g,y:y}),f&&(m+=Xt(E,[g,y])),E=[g,y],v&&m>=o&&o>x[2]){var T=(m-o)/(m-x[2]);b={x:E[0]*(1-T)+x[0]*T,y:E[1]*(1-T)+x[1]*T}}x=[g,y,m]}return v&&o>=m&&(b={x:i,y:a}),{length:m,point:b,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function ne(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=Ft(t),p="number"==typeof e,d=[],v=0,g=0,y=0,m=0,x=[],E=[],b=0,M={x:0,y:0},S=M,T=M,P=M,w=0,N=0,k=f.length;k>N;N+=1)d=(l="M"===(c=(h=f[N])[0]))?d:[v,g].concat(h.slice(1)),l?(S=M={x:y=h[1],y:m=h[2]},b=0,p&&.001>e&&(P=M)):"L"===c?(b=(r=Ht(d[0],d[1],d[2],d[3],(e||0)-w)).length,M=r.min,S=r.max,T=r.point):"A"===c?(b=(i=Qt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-w,n||{})).length,M=i.min,S=i.max,T=i.point):"C"===c?(b=(a=Jt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,M=a.min,S=a.max,T=a.point):"Q"===c?(b=(o=ee(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,M=o.min,S=o.max,T=o.point):"Z"===c&&(b=(s=Ht((d=[v,g,y,m])[0],d[1],d[2],d[3],(e||0)-w)).length,M=s.min,S=s.max,T=s.point),p&&e>w&&w+b>=e&&(P=T),E.push(S),x.push(M),w+=b,v=(u="Z"!==c?h.slice(-2):[y,m])[0],g=u[1];return p&&e>=w&&(P={x:v,y:g}),{length:w,point:P,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function re(t){return function(t){var e=0,n=0,r=0;return qt(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,p=t.slice(1);return r=3*(((f=p[5])-(o=n))*((s=p[0])+(l=p[2]))-((h=p[4])-(a=e))*((u=p[1])+(c=p[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function ie(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Jt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=jt(n,r,e),s=jt(r,i,e),u=jt(i,a,e),l=jt(o,s,e),c=jt(s,u,e),h=jt(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}}))}function ae(t,e,n){var r=ie(t),i=ie(e),a=r.length,o=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(a,o),f=[l,c],p=[h-a,h-o],d=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p[e]-=(d=n&&p[e]&&t.l>=f[e])?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:ae(v[0],v[1],h)}var oe=function(t){return null==t},se={}.toString,ue=function(t,e){return se.call(t)==="[object "+e+"]"},le=function(t){return Array.isArray?Array.isArray(t):ue(t,"Array")},ce=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},he=function(t){if(le(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},fe=function(t){if(le(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},pe=function(t){return ue(t,"String")},de=function(t,e,n){return e>t?e:t>n?n:t},ve=function(t){return ue(t,"Number")},ge=1e-5;var ye,me,xe,Ee,be,Me=function(t,e){return(t%e+e)%e},Se=function(t){return ue(t,"Boolean")},Te=function(t){return void 0===t};(ye=t.UnitType||(t.UnitType={}))[ye.kUnknown=0]="kUnknown",ye[ye.kNumber=1]="kNumber",ye[ye.kPercentage=2]="kPercentage",ye[ye.kEms=3]="kEms",ye[ye.kPixels=4]="kPixels",ye[ye.kRems=5]="kRems",ye[ye.kDegrees=6]="kDegrees",ye[ye.kRadians=7]="kRadians",ye[ye.kGradians=8]="kGradians",ye[ye.kTurns=9]="kTurns",ye[ye.kMilliseconds=10]="kMilliseconds",ye[ye.kSeconds=11]="kSeconds",ye[ye.kInteger=12]="kInteger",function(t){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"}(me||(me={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(xe||(xe={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Ee||(Ee={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(be||(be={}));var Pe,we=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){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"}(Pe||(Pe={}));var Ne,ke=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return we.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Ce=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},Ae=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},Oe=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(Ee.kNo,be.kNo,"")},n.isNumericValue=function(){return this.getType()>=Pe.kUnitType&&this.getType()<=Pe.kClampType},e}(),Le=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}c(e,t);var n=e.prototype;return n.getType=function(){return Pe.kColorType},n.to=function(t){return this},e}(Oe);(Ne=t.GradientType||(t.GradientType={}))[Ne.Constant=0]="Constant",Ne[Ne.LinearGradient=1]="LinearGradient",Ne[Ne.RadialGradient=2]="RadialGradient";var Re=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}c(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return Pe.kColorType},e}(Oe),Ie=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}c(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return Pe.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(Oe);function De(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){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(De.Cache||Map),n}De.Cache=Map;var _e=De((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Ge=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t})).join("")};function Ue(t){return"function"==typeof t}var Be={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Fe=De((function(t){var e=_e(t),n=Be[e];return e=(null==n?void 0:n.alias)||e})),Ve=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Ye=function(e){return function(e){switch(e){case me.kUNumber:return t.UnitType.kNumber;case me.kULength:return t.UnitType.kPixels;case me.kUPercent:return t.UnitType.kPercentage;case me.kUTime:return t.UnitType.kSeconds;case me.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return me.kUNumber;case t.UnitType.kPercentage:return me.kUPercent;case t.UnitType.kPixels:return me.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return me.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return me.kUAngle;default:return me.kUOther}}(e))},je=function(e){function n(n,r){var i,a;return void 0===r&&(r=t.UnitType.kNumber),(i=e.call(this)||this).unit=void 0,i.value=void 0,a="string"==typeof r?ke(r):r,i.unit=a,i.value=n,i}c(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return Pe.kUnitType},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=Ye(this.unit);if(r!==Ye(e)||r===t.UnitType.kUnknown)return null;var i=Ce(this.unit)/Ce(e);return new n(this.value*i,e)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var a=this.value,o=Ae(this.unit);if(-999999>a||a>999999){var s=Ae(this.unit);i=!Number.isFinite(a)||Number.isNaN(a)?Ve(a,s):a+(s||"")}else i=""+a+o}return r+=i},n}(Oe),Xe=new je(0,"px"),He=(new je(1,"px"),new je(0,"deg")),We=function(t){function e(e,n,r,i,a){var o;return void 0===i&&(i=1),void 0===a&&(a=!1),(o=t.call(this,"rgb")||this).r=void 0,o.g=void 0,o.b=void 0,o.alpha=void 0,o.isNone=void 0,o.r=e,o.g=n,o.b=r,o.alpha=i,o.isNone=a,o}c(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(Le),ze={number:function(t){return new je(t)},percent:function(t){return new je(t,"%")},px:function(t){return new je(t,"px")},em:function(t){return new je(t,"em")},rem:function(t){return new je(t,"rem")},deg:function(t){return new je(t,"deg")},grad:function(t){return new je(t,"grad")},rad:function(t){return new je(t,"rad")},turn:function(t){return new je(t,"turn")},s:function(t){return new je(t,"s")},ms:function(t){return new je(t,"ms")},registerProperty:function(t){is.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){is.layoutRegistry.registerLayout(t,e)}},qe=new Ie("unset"),Ke=new Ie("initial"),Ze=new Ie("inherit"),Qe={"":qe,unset:qe,initial:Ke,inherit:Ze},$e=function(t){return Qe[t]||(Qe[t]=new Ie(t)),Qe[t]},Je=new We(0,0,0,0,!0),tn=new We(0,0,0,0),en=De((function(t,e,n,r){return new We(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),nn=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new je(e,n)},rn=new je(50,"%");function an(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function on(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function sn(){}var un=.7,ln=1/un,cn="\\s*([+-]?\\d+)\\s*",hn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pn=/^#([0-9a-f]{3,8})$/,dn=RegExp("^rgb\\("+[cn,cn,cn]+"\\)$"),vn=RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),gn=RegExp("^rgba\\("+[cn,cn,cn,hn]+"\\)$"),yn=RegExp("^rgba\\("+[fn,fn,fn,hn]+"\\)$"),mn=RegExp("^hsl\\("+[hn,fn,fn]+"\\)$"),xn=RegExp("^hsla\\("+[hn,fn,fn,hn]+"\\)$"),En={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function bn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function Sn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=pn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Tn(e):3===n?new wn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Pn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Pn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dn.exec(t))?new wn(e[1],e[2],e[3],1):(e=vn.exec(t))?new wn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gn.exec(t))?Pn(e[1],e[2],e[3],e[4]):(e=yn.exec(t))?Pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mn.exec(t))?An(e[1],e[2]/100,e[3]/100,1):(e=xn.exec(t))?An(e[1],e[2]/100,e[3]/100,e[4]):En.hasOwnProperty(t)?Tn(En[t]):"transparent"===t?new wn(NaN,NaN,NaN,0):null}function Tn(t){return new wn(t>>16&255,t>>8&255,255&t,1)}function Pn(t,e,n,r){return r>0||(t=e=n=NaN),new wn(t,e,n,r)}function wn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Nn(){return"#"+Cn(this.r)+Cn(this.g)+Cn(this.b)}function kn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Cn(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function An(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Ln(t,e,n,r)}function On(t){if(t instanceof Ln)return new Ln(t.h,t.s,t.l,t.opacity);if(t instanceof sn||(t=Sn(t)),!t)return new Ln;if(t instanceof Ln)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new Ln(o,s,u,t.opacity)}function Ln(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Rn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}an(sn,Sn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bn,formatHex:bn,formatHsl:function(){return On(this).formatHsl()},formatRgb:Mn,toString:Mn}),an(wn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof sn||(i=Sn(i)),i?new wn((i=i.rgb()).r,i.g,i.b,i.opacity):new wn):new wn(t,e,n,null==r?1:r);var i}),on(sn,{brighter:function(t){return new wn(this.r*(t=null==t?ln:Math.pow(ln,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new wn(this.r*(t=null==t?un:Math.pow(un,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Nn,formatHex:Nn,formatRgb:kn,toString:kn})),an(Ln,(function(t,e,n,r){return 1===arguments.length?On(t):new Ln(t,e,n,null==r?1:r)}),on(sn,{brighter:function(t){return new Ln(this.h,this.s,this.l*(t=null==t?ln:Math.pow(ln,t)),this.opacity)},darker:function(t){return new Ln(this.h,this.s,this.l*(t=null==t?un:Math.pow(un,t)),this.opacity)},rgb:function(){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 wn(Rn(240>t?t+120:t-240,r,n),Rn(t,r,n),Rn(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var In={},Dn=0;var _n="undefined"!=typeof window&&void 0!==window.document;function Gn(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Un(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 Bn(t,e){if(_n)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Fn="Method not implemented.",Vn="Use document.documentElement instead.",Yn={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function jn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Hn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Wn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function zn(t){return void 0===t?0:t>360||-360>t?t%360:t}function qn(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?(r=t,(i=new y(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):ve(t)?W(t,e,n):W(t[0],t[1]||e,t[2]||n);var r,i}function Kn(t){return t*(Math.PI/180)}function Zn(t){return t*(180/Math.PI)}function Qn(t){return 360*t}function $n(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,a=I(X(),e),o=a[0],s=a[1],u=a[2],l=Math.asin(-e[2]/o);return i>l?l>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,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]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-Math.PI/2,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 Jn(t,e,n,r,i){var a,o,s,u,l,c,h,f,p,d,v=Math.cos(t),g=Math.sin(t);return a=r*v,o=i*g,s=0,u=-r*g,l=i*v,c=0,h=e,f=n,p=1,(d=new y(9))[0]=a,d[1]=o,d[2]=s,d[3]=u,d[4]=l,d[5]=c,d[6]=h,d[7]=f,d[8]=p,d}function tr(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);0>e*i-n*r&&(i>e?a=-a:o=-o),a&&(e*=1/a,n*=1/a),o&&(r*=1/o,i*=1/o);var s=Zn(Math.atan2(n,e));return[t[6],t[7],a,o,s]}var er=x(),nr=x(),rr=it(),ir=[X(),X(),X()],ar=X();function or(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 sr=x();function ur(t,e){if(t&&t.length){var n=0,r=0;e?(n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0,e.resetLocalTransform(),e.setLocalPosition(n,r)):e=new Ja({}),t.forEach((function(t){var i=t.t,a=t.d;if("scale"===i){var o=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];e.scaleLocal(o[0],o[1],1)}else if("scalex"===i){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(s[0],1,1)}else if("scaley"===i){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,u[0],1)}else if("scalez"===i){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,l[0])}else if("scale3d"===i){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(c[0],c[1],c[2])}else if("translate"===i){var h=a||[Xe,Xe];e.translateLocal(h[0].value,h[1].value,0)}else if("translatex"===i){e.translateLocal((a||[Xe])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(a||[Xe])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(a||[Xe])[0].value)}else if("translate3d"===i){var f=a||[Xe,Xe,Xe];e.translateLocal(f[0].value,f[1].value,f[2].value)}else if("rotate"===i){e.rotateLocal(0,0,mi((a||[He])[0]))}else if("rotatex"===i){e.rotateLocal(mi((a||[He])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,mi((a||[He])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,mi((a||[He])[0]))}else if("rotate3d"===i);else if("skew"===i){var p=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];e.setLocalSkew(Kn(p[0]),Kn(p[1]))}else if("skewx"===i){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(Kn(d[0]),e.getLocalSkew()[1])}else if("skewy"===i){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],Kn(v[0]))}else if("matrix"===i){var g=a.map((function(t){return t.value}));e.setLocalTransform(b(sr,g[0],g[1],0,0,g[2],g[3],0,0,0,0,1,0,g[4]+n,g[5]+r,0,1))}else"matrix3d"===i&&(b.apply(j,[sr].concat(a.map((function(t){return t.value})))),sr[12]+=n,sr[13]+=r,e.setLocalTransform(sr))}))}return e.getLocalTransform()}function lr(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var cr=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(e+": "+t)}function r(){var t=p(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&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:a,colorStops:p(d)}}))}function o(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var a=r(i);return x(t.endCall)||n("Missing )"),a}}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=m("shape",/^(circle)/i,0);t&&(t.style=y()||c());return t}()||function(){var t=m("shape",/^(ellipse)/i,0);t&&(t.style=g()||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 m("extent-keyword",t.extentKeywords,1)}function h(){if(m("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function p(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function d(){var e=m("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:p(v)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:p(v)}}))||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=g(),e}function v(){return x(t.number)[1]}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||y()}function y(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(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()}}();function hr(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function fr(t,e){return.001>Math.abs(t-e)}function pr(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}var dr={box:function(t,e,n,r){return pr([t,n],[e,r])},length:function(t,e,n,r){return hr(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return 0>o?hr(t,e,i,a):o>(n-t)*(n-t)+(r-e)*(r-e)?hr(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,a-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function vr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function gr(t,e,n){var r=t+n-2*e;if(fr(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var yr=function(t,e,n,r,i,a){var o=gr(t,n,i)[0],s=gr(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(vr(t,n,i,o)),void 0!==s&&l.push(vr(e,r,a,s)),pr(u,l)};function mr(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 xr(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(fr(s,0))fr(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;fr(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}var Er=function(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=xr(t,n,i,o),h=xr(e,r,a,s),f=0;c.length>f;f++)u.push(mr(t,n,i,o,c[f]));for(var p=0;h.length>p;p++)l.push(mr(e,r,a,s,h[p]));return pr(u,l)};function br(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function Mr(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}var Sr=function(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 p=0;c.length>p;p++){var d=br(t,0,n,r,i,c[p]);u>d&&(u=d),d>l&&(l=d)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,y=-1/0,m=[a,o],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=v+x;o>a?E>a&&o>E&&m.push(E):E>o&&a>E&&m.push(E)}for(var b=0;m.length>b;b++){var M=Mr(0,e,n,r,i,m[b]);g>M&&(g=M),M>y&&(y=M)}return{x:u,y:g,width:l-u,height:y-g}};var Tr,Pr=function(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+=hr(r[0],r[1],i[0],i[1])}return e}(t)};function wr(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=ne(t.parsedStyle.path.absolutePath,void 0,St(St({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Nr(t,e){return t[0]===e[0]&&t[1]===e[1]}function kr(t,e){var n,r=t.prePoint,i=t.currentPoint,a=t.nextPoint,o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2),u=Math.acos((o+s-(Math.pow(r[0]-a[0],2)+Math.pow(r[1]-a[1],2)))/(2*Math.sqrt(o)*Math.sqrt(s)));if(!u||0===Math.sin(u)||(void 0===n&&(n=ge),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(a[1]-i[1],a[0]-i[0])),c=Math.abs(Math.atan2(a[0]-i[0],a[1]-i[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-(l=l>Math.PI/2?Math.PI-l:l))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function Cr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(Tr=t.Shape||(t.Shape={})).GROUP="g",Tr.CIRCLE="circle",Tr.ELLIPSE="ellipse",Tr.IMAGE="image",Tr.RECT="rect",Tr.LINE="line",Tr.POLYLINE="polyline",Tr.POLYGON="polygon",Tr.TEXT="text",Tr.PATH="path",Tr.HTML="html",Tr.MESH="mesh";var Ar=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))))},Or=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=Kn(r=Me(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 p=(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)),d=(i!==a?1:-1)*Math.sqrt(p=0>p?0:p),v=d*(e*h.y/n),g=d*(-n*h.x/e),y={x:Math.cos(u)*v-Math.sin(u)*g+(t.x+o.x)/2,y:Math.sin(u)*v+Math.cos(u)*g+(t.y+o.y)/2},m={x:(h.x-v)/e,y:(h.y-g)/n},x=Ar({x:1,y:0},m),E=Ar(m,{x:(-h.x-v)/e,y:(-h.y-g)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,M=e*Math.cos(b),S=n*Math.sin(b);return{x:Math.cos(u)*M-Math.sin(u)*S+y.x,y:Math.sin(u)*M+Math.cos(u)*S+y.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Lr(t,e,n){void 0===n&&(n=!0);var 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=Or({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Or({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),p=f.x-h.x,d=f.y-h.y,v=Math.sqrt(p*p+d*d);return{x:-p/v,y:-d/v}}function Rr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ir(t,e){return Rr(t)*Rr(e)?(t[0]*e[0]+t[1]*e[1])/(Rr(t)*Rr(e)):1}function Dr(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ir(t,e))}function _r(t,e){var n=e[1],r=e[2],i=Me(Kn(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,p=h*h/(n*n)+f*f/(r*r);p>1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var d=n*n*(f*f)+r*r*(h*h),v=d?Math.sqrt((n*n*(r*r)-d)/d):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*f/r:0,y=n?v*-r*h/n:0,m=(s+l)/2+Math.cos(i)*g-Math.sin(i)*y,x=(u+c)/2+Math.sin(i)*g+Math.cos(i)*y,E=[(h-g)/n,(f-y)/r],b=[(-1*h-g)/n,(-1*f-y)/r],M=Dr([1,0],E),S=Dr(E,b);return Ir(E,b)>-1||(S=Math.PI),1>Ir(E,b)||(S=0),0===o&&S>0&&(S-=2*Math.PI),1===o&&0>S&&(S+=2*Math.PI),{cx:m,cy:x,rx:Nr(t,[l,c])?0:n,ry:Nr(t,[l,c])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:a,sweepFlag:o}}function Gr(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 Ur=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tapPromise=function(t,e){this.callbacks.push(e)},e.promise=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)})))},t}(),Br=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tapPromise=function(t,e){this.callbacks.push(e)},e.promise=function(){var t=o(i().mark((function t(){var e,n,r,a,o=arguments;return i().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,o);case 3:n=t.sent,r=0;case 5:if(this.callbacks.length-1<=r){t.next=13;break}return a=this.callbacks[r],t.next=9,a(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)})));return function(){return t.apply(this,arguments)}}(),t}(),Fr=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tap=function(t,e){this.callbacks.push(e)},e.call=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];this.callbacks.forEach((function(t){t.apply(void 0,e)}))},t}(),Vr=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tap=function(t,e){this.callbacks.push(e)},e.call=function(){if(this.callbacks.length){for(var t,e=(t=this.callbacks)[0].apply(t,arguments),n=0;this.callbacks.length-1>n;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),Yr=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],jr=/([\"\'])[^\'\"]+\1/;var Xr=1,Hr="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Wr=Date.now(),zr={},qr=Date.now(),Kr=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-qr,r=n>16?0:16-n,i=Xr++;return zr[i]=t,Object.keys(zr).length>1||setTimeout((function(){qr=e;var t=zr;zr={},Object.keys(t).forEach((function(e){return t[e](Hr.performance&&"function"==typeof Hr.performance.now?Hr.performance.now():Date.now()-Wr)}))}),r),i},Zr=function(t){delete zr[t]},Qr=function(t){return"string"!=typeof t?Kr:""===t?Hr.requestAnimationFrame:Hr[t+"RequestAnimationFrame"]},$r=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!!Qr(t)})),Jr=Qr($r),ti=function(t){return"string"!=typeof t?Zr:""===t?Hr.cancelAnimationFrame:Hr[t+"CancelAnimationFrame"]||Hr[t+"CancelRequestAnimationFrame"]}($r);Hr.requestAnimationFrame=Jr,Hr.cancelAnimationFrame=ti;var ei=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ni=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ri=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ii=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ai={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},oi=De((function(t){return nn("angular"===t.type?Number(t.value):ai[t.value]||0,"deg")})),si=De((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:nn(e,r),cy:nn(n,i)}})),ui=De((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return cr(e).map((function(e){var n=e.type,r=e.orientation,i=e.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(!oe(u)&&!oe(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:""+(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(i);var a=i.map((function(t){return{offset:nn(Number(t.length.value),"%"),color:lr(t)}}));if("linear-gradient"===n)return new Re(t.GradientType.LinearGradient,{angle:r?oi(r):He,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var o,s=si(r[0].at),u=s.cx,l=s.cy;if(r[0].style){var c=r[0].style,h=c.type,f=c.value;o="extent-keyword"===h?$e(f):nn(f,h)}return new Re(t.GradientType.RadialGradient,{cx:u,cy:l,size:o,steps:a})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=ei.exec(e);if(r){var i,a=(null===(i=r[2].match(ii))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Re(t.GradientType.LinearGradient,{angle:nn(parseFloat(r[1]),"deg"),steps:a.map((function(t){var e=t[1];return{offset:nn(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var o=function(t){var e=ni.exec(t);if(e){var n,r=(null===(n=e[4].match(ii))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:nn(50,"%"),cy:nn(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:nn(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(o){if(!pe(o))return[new Re(t.GradientType.RadialGradient,o)];e=o}}else if("p"===n)return function(t){var e=ri.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}(e)}));function li(t){return t&&!!t.image}function ci(t){return t&&!oe(t.r)&&!oe(t.g)&&!oe(t.b)}var hi=De((function(t){if(li(t))return l({repetition:"repeat"},t);if(oe(t)&&(t=""),"transparent"===t)return tn;"currentColor"===t&&(t="black");var e=ui(t);if(e)return e;var n=Sn(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),en.apply(void 0,r)}));function fi(t,e){if(ci(t)&&ci(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(de(e[n],0,255));return e[3]=de(e[3],0,1),"rgba("+e.join(",")+")"}]}function pi(t,e){if(oe(e))return nn(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return nn(Number(e),"px");if("deg".search(t)>=0)return nn(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return nn(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var di=De((function(t){return pi(/px/g,t)})),vi=(De((function(t){return pi(RegExp("%","g"),t)})),function(t){return ve(t)||isFinite(Number(t))?nn(Number(t)||0,"px"):pi(RegExp("px|%|em|rem","g"),t)}),gi=De((function(t){return pi(/deg|rad|grad|turn/g,t)}));function yi(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,u=Ye(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=Ae(t.unit)):(je.isLength(t.unit)||je.isLength(e.unit))&&(o=bi(t,i,n),s=bi(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function mi(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Zn(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Qn(Number(e.value))),n}function xi(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):pe(t)?n=t.split(" ").map((function(t){return Number(t)})):ve(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 Ei(t){return pe(t)?t.split(" ").map((function(t){return vi(t)})):t.map((function(t){return vi(""+t)}))}function bi(e,n,r){if(0===e.value)return 0;if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var Mi=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Si(t){if(void 0===t&&(t=""),"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,Mi.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return pi(/deg|rad|grad|turn|px|%/g,t)||hi(t)}))}),n.lastIndex===t.length)return r}return[]}function Ti(t){return""+t}var Pi=De((function(t){return nn("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));De((function(t){return pe(t)?t.split(" ").map(Pi):t.map(Pi)}));function wi(t,e){return[t,e,Ti]}function Ni(t,e){return function(n,r){return[n,r,function(n){return Ti(de(n,t,e))}]}}function ki(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Ci=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=Ft(t)}catch(n){e=Ft(""),console.error("[g]: Invalid SVG Path definition: "+t)}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=_r(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]&&Nr(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var p=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[p[0]-n[0],p[1]-n[1]],c.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var d=[u[1],u[2]];c.startTangent=[p[0]-d[0],p[1]-d[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===l){var v=e[s-1],g=Cr(v.currentPoint,p);"Q"===v.command?(c.command="Q",c.startTangent=[p[0]-g[0],p[1]-g[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]]):(c.command="TL",c.startTangent=[p[0]-n[0],p[1]-n[1]],c.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===l){var y=[u[1],u[2]],m=[u[3],u[4]];c.startTangent=[p[0]-y[0],p[1]-y[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[y[0]-m[0],y[1]-m[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[m[0]-y[0],m[1]-y[1]])}else if("S"===l){var x=e[s-1],E=Cr(x.currentPoint,p),b=[u[1],u[2]];"C"===x.command?(c.command="C",c.startTangent=[p[0]-E[0],p[1]-E[1]],c.endTangent=[n[0]-b[0],n[1]-b[1]]):(c.command="SQ",c.startTangent=[p[0]-b[0],p[1]-b[1]],c.endTangent=[n[0]-b[0],n[1]-b[1]])}else if("A"===l){var M=Lr(c,0),S=M.x,T=M.y,P=Lr(c,1,!1),w=P.x,N=P.y;c.startTangent=[S,T],c.endTangent=[w,N]}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=yr(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=Er(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=Sr(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=fe(n),p=fe(r),d=he(n),v=he(r);if(0===i.length)return{x:f,y:p,width:d-f,height:v-p};for(var g=0;i.length>g;g++){var y=i[g],m=y.currentPoint;m[0]===f?f-=kr(y,e).xExtra:m[0]===d&&(d+=kr(y,e).xExtra),m[1]===p?p-=kr(y,e).yExtra:m[1]===v&&(v+=kr(y,e).yExtra)}return{x:f,y:p,width:d-f,height:v-p}}(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}}},Ai=De(Ci);function Oi(t,e){var n=pe(t)?Ai(t):Ci(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Li(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=qt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=qt(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=ae(r,i));var o,s,u,l,c,h,f,p,d=re(a[0])!==re(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))})))):Mt(a[0]);return[d,(u=a[1],l=d,c=u.length-1,h=[],f=0,p=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),p.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Xt(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),p[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Ri(t,e){var n;n=pe(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,a=[],o=0,s=Pr(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=dr.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),l=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:a}}function Ii(t,e){return[t.points,e.points,function(t){return t}]}var Di=null;function _i(t){return function(e){var n=0;return t.map((function(t){return t===Di?e[n++]:t}))}}function Gi(t){return t}var Ui={matrix:["NNNNNN",[Di,Di,0,0,Di,Di,0,0,0,0,1,0,Di,Di,0,1],Gi],matrix3d:["NNNNNNNNNNNNNNNN",Gi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",_i([Di,Di,new je(1)]),Gi],scalex:["N",_i([Di,new je(1),new je(1)]),_i([Di,new je(1)])],scaley:["N",_i([new je(1),Di,new je(1)]),_i([new je(1),Di])],scalez:["N",_i([new je(1),new je(1),Di])],scale3d:["NNN",Gi],skew:["Aa",null,Gi],skewx:["A",null,_i([Di,He])],skewy:["A",null,_i([He,Di])],translate:["Tt",_i([Di,Di,Xe]),Gi],translatex:["T",_i([Di,Xe,Xe]),_i([Di,Xe])],translatey:["T",_i([Xe,Di,Xe]),_i([Xe,Di])],translatez:["L",_i([Xe,Xe,Di])],translate3d:["TTL",Gi]};function Bi(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var a=e[1],o=Ui[a];if(!o)return[];var s=e[2].split(","),u=o[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],f=u[c],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?He:gi(t)},N:Pi,T:vi,L:di}[f.toUpperCase()](h):{a:He,n:l[0],t:Xe}[f]))return[];l.push(p)}if(r.push({t:a,d:l}),n.lastIndex===t.length)return r}return[]}function Fi(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Kn(mi(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=Kn(mi(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=Kn(mi(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=Kn(mi(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=Kn(mi(t.d[0])),h=Kn(mi(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=Kn(mi(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=Kn(mi(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=bi(t.d[0],0,null)||0,n=bi(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=bi(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=bi(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=bi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=bi(t.d[0],0,null)||0,n=bi(t.d[1],0,null)||0,r=bi(t.d[2],0,null)||0,1];case"perspective":var f=bi(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 Vi(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 Yi(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}(er,t))return!1;if(E(nr,er),nr[3]=0,nr[7]=0,nr[11]=0,nr[15]=1,1e-8>Math.abs(P(nr)))return!1;var o,s,u=er[3],l=er[7],c=er[11],h=er[12],f=er[13],p=er[14],d=er[15];if(0!==u||0!==l||0!==c){if(rr[0]=u,rr[1]=l,rr[2]=c,rr[3]=d,!T(nr,nr))return!1;S(nr,nr),at(i,rr,nr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=p,(o=ir)[0][0]=(s=er)[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]=H(ir[0]),Q(ir[0],ir[0]),r[0]=$(ir[0],ir[1]),or(ir[1],ir[1],ir[0],1,-r[0]),n[1]=H(ir[1]),Q(ir[1],ir[1]),r[0]/=n[1],r[1]=$(ir[0],ir[2]),or(ir[2],ir[2],ir[0],1,-r[1]),r[2]=$(ir[1],ir[2]),or(ir[2],ir[2],ir[1],1,-r[2]),n[2]=H(ir[2]),Q(ir[2],ir[2]),r[1]/=n[2],r[2]/=n[2],J(ar,ir[1],ir[2]),0>$(ir[0],ar))for(var v=0;3>v;v++)n[v]*=-1,ir[v][0]*=-1,ir[v][1]*=-1,ir[v][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+ir[0][0]-ir[1][1]-ir[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-ir[0][0]+ir[1][1]-ir[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-ir[0][0]-ir[1][1]+ir[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+ir[0][0]+ir[1][1]+ir[2][2],0)),ir[2][1]>ir[1][2]&&(a[0]=-a[0]),ir[0][2]>ir[2][0]&&(a[1]=-a[1]),ir[1][0]>ir[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(Fi).reduce(Vi)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var ji=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],p=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(h*h+f*f),d[0][1]=2*(c*h-f*p),d[0][2]=2*(c*f+h*p),d[1][0]=2*(c*h+f*p),d[1][1]=1-2*(c*c+f*f),d[1][2]=2*(h*f-c*p),d[2][0]=2*(c*f-h*p),d[2][1]=2*(h*f+c*p),d[2][2]=1-2*(c*c+h*h),o=t(o,d);var v,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(g[2][1]=r[2],o=t(o,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],o=t(o,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],o=t(o,g));for(var y=0;3>y;y++)for(var m=0;3>m;m++)o[y][m]*=n[y];return 0==(v=o)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[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 Xi(t){return t.toFixed(6).replace(".000000","")}function Hi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Yi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Yi(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=de(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 ji(t[0],t[1],t[2],e,t[4]).map(Xi).join(",")}])}function Wi(t){return t.replace(/[xy]/,"")}function zi(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function qi(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?nn(o):nn(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=Hi(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var p=t[f].t,d=e[f].t,v=t[f].d,g=e[f].d,y=Ui[p],m=Ui[d],x=void 0;if(s=d,"perspective"===(o=p)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var E=Hi([t[f]],[e[f]]);u.push(E[0]),l.push(E[1]),c.push(["matrix",[E[2]]])}else{if(p===d)x=p;else if(y[2]&&m[2]&&Wi(p)===Wi(d))x=Wi(p),v=y[2](v),g=m[2](g);else{if(!y[1]||!m[1]||zi(p)!==zi(d)){var b=Hi(t,e);u=[b[0]],l=[b[1]],c=[["matrix",[b[2]]]];break}x=zi(p),v=y[1](v),g=m[1](g)}for(var M=[],S=[],T=[],P=0;v.length>P;P++){var w=yi(v[P],g[P],n,!1,P);M[P]=w[0],S[P]=w[1],T.push(w[2])}u.push(M),l.push(S),c.push([x,T])}}if(r){var N=u;u=l,l=N}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"),c[e][0]+"("+n+")"})).join(" ")}]}var Ki=De((function(t){if(pe(t)){if("text-anchor"===t)return[nn(0,"px"),nn(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:[vi(Zi(e[0])),vi(Zi(e[1]))]}return[nn(t[0]||0,"px"),nn(t[1]||0,"px")]}));function Zi(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Qi=function(){function t(){this.parser=gi,this.parserWithCSSDisabled=null,this.mixer=wi}return t.prototype.calculator=function(t,e,n,r){return mi(n)},t}(),$i=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ie&&(n=null),is.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&is.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Ji=function(){function t(){this.parser=hi,this.parserWithCSSDisabled=hi,this.mixer=fi}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ie?"none"===n.value?Je:tn:n},t}(),ta=function(){function t(){this.parser=Si}return t.prototype.calculator=function(t,e,n){return n instanceof Ie?[]:n},t}();function ea(t){var e=t.parsedStyle.fontSize;return oe(e)?null:e}var na,ra=function(){function e(){this.parser=vi,this.parserWithCSSDisabled=null,this.mixer=wi}return e.prototype.calculator=function(e,n,r,i,a){if(ve(r))return r;if(!je.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var o=ea(i.parentNode);if(o)return o*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=ea(i.ownerDocument.documentElement);if(u)return u*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}},e}(),ia=function(){function t(){this.mixer=ki}var e=t.prototype;return e.parser=function(t){var e=Ei(ve(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),aa=function(){function t(){this.mixer=ki}var e=t.prototype;return e.parser=function(t){var e=Ei(ve(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),oa=function(e){function n(){return e.apply(this,arguments)||this}return c(n,e),n.prototype.postProcessor=function(e,n){var r,i,a;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,s=o.cx,u=o.cy;oe(s)||(r=s),oe(u)||(i=u);break;case t.Shape.LINE:var l=e.parsedStyle,c=l.y1,h=l.y2;r=Math.min(l.x1,l.x2),i=Math.min(c,h),a=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:oe(e.parsedStyle.x)||(r=e.parsedStyle.x),oe(e.parsedStyle.y)||(i=e.parsedStyle.y),oe(e.parsedStyle.z)||(a=e.parsedStyle.z)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!oe(r)||!oe(i)||!oe(a))&&-1===n.indexOf("transform")){var f=e.parsedStyle.transform;if(f&&f.length)ur(f,e);else{var p=e.getLocalPosition(),d=p[0],v=p[1],g=p[2];e.setLocalPosition(oe(r)?d:r,oe(i)?v:i,oe(a)?g:a)}}},n}(ra),sa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof Ie&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a},t}(),ua=function(){function t(){this.mixer=wi,this.parser=Pi,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),la=function(){function e(){this.parser=Pi,this.parserWithCSSDisabled=null,this.mixer=Ni(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var a=r.getPoint(n.offsetDistance);a&&(e.parsedStyle.defX=a.x,e.parsedStyle.defY=a.y,e.setLocalPosition(a.x,a.y))}}},e}(),ca=function(){function t(){this.parser=Pi,this.parserWithCSSDisabled=null,this.mixer=Ni(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ha=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){jn(this.center,t),jn(this.halfExtents,e),Xn(this.min,this.center,this.halfExtents),Hn(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){Hn(this.center,e,t),Wn(this.center,this.center,.5),Xn(this.halfExtents,e,t),Wn(this.halfExtents,this.halfExtents,.5),jn(this.min,t),jn(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=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,p=i+u,d=a-l,v=a+l,g=e.center,y=g[0],m=g[1],x=g[2],E=e.halfExtents,b=E[0],M=E[1],S=E[2],T=y-b,P=y+b,w=m-M,N=m+M,k=x-S,C=x+S;c>T&&(c=T),P>h&&(h=P),f>w&&(f=w),N>p&&(p=N),d>k&&(d=k),C>v&&(v=C),n[0]=.5*(c+h),n[1]=.5*(f+p),n[2]=.5*(d+v),o[0]=.5*(h-c),o[1]=.5*(p-f),o[2]=.5*(v-d),this.min[0]=c,this.min[1]=f,this.min[2]=d,this.max[0]=h,this.max[1]=p,this.max[2]=v}},e.setFromTransformedAABB=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],p=e[6],d=e[10],v=Math.abs(o),g=Math.abs(s),y=Math.abs(u),m=Math.abs(l),x=Math.abs(c),E=Math.abs(h),b=Math.abs(f),M=Math.abs(p),S=Math.abs(d);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]+p*i[1]+d*i[2],r[0]=v*a[0]+g*a[1]+y*a[2],r[1]=m*a[0]+x*a[1]+E*a[2],r[2]=b*a[0]+M*a[1]+S*a[2],Xn(this.min,n,r),Hn(this.max,n,r)},e.intersects=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])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,a=new t,o=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=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}([0,0,0],this.getMax(),e.getMax());return a.setMinMax(o,s),a},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?jn([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]]},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?jn([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]]},t}(),fa=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||W(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return $(t,this.normal)-this.distance},e.normalize=function(){var t,e,n,r=1/rt(this.normal);(t=this.normal)[0]=(e=this.normal)[0]*(n=r),t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&function(t,e,n,r){var i=e[0],a=e[1],o=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o)}(n,t,e,i),a},t}();(na=t.Mask||(t.Mask={}))[na.OUTSIDE=4294967295]="OUTSIDE",na[na.INSIDE=0]="INSIDE",na[na.INDETERMINATE=2147483647]="INDETERMINATE";var pa=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new fa)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],g=t[15];q(this.planes[0].normal,i-e,u-a,f-l),this.planes[0].distance=g-p,q(this.planes[1].normal,i+e,u+a,f+l),this.planes[1].distance=g+p,q(this.planes[2].normal,i+n,u+o,f+c),this.planes[2].distance=g+d,q(this.planes[3].normal,i-n,u-o,f-c),this.planes[3].distance=g-d,q(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=g-v,q(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=g+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),da=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),va=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),ga=function(){function e(){this.parser=Oi,this.parserWithCSSDisabled=Oi,this.mixer=Li}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Ie&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new va(0,0,0,0)}:n},n.postProcessor=function(e,n){if(e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,a=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===a?0:a)}},e}(),ya=function(){function e(){this.parser=Ri,this.mixer=Ii}return e.prototype.postProcessor=function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}},e}(),ma=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=Ni(0,1/0),e}return c(e,t),e}(ra),xa=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Ie?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),Ea=function(){function t(){}return t.prototype.calculator=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},t}(),ba=function(){function t(){this.parser=Bi,this.parserWithCSSDisabled=Bi,this.mixer=qi}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Ie?[]:n},e.postProcessor=function(t){ur(t.parsedStyle.transform,t)},t}(),Ma=function(){this.parser=Ki},Sa=function(){function t(){this.parser=Pi}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}(),Ta=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,eo),this.define(t.Shape.ELLIPSE,ao),this.define(t.Shape.RECT,So),this.define(t.Shape.IMAGE,ho),this.define(t.Shape.LINE,po),this.define(t.Shape.GROUP,so),this.define(t.Shape.PATH,yo),this.define(t.Shape.POLYGON,xo),this.define(t.Shape.POLYLINE,bo),this.define(t.Shape.TEXT,Po),this.define(t.Shape.HTML,lo)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}();function Pa(t){return!!t.type}var wa=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new da,this.page=new da,this.canvas=new da,this.viewport=new da,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},e.clone=function(){throw Error(Fn)},u(t,[{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:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Na=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(p(r),n),r}return c(e,t),e}(wa),ka=e((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,a=Array(i);i>r;r++)a[r]=e[r].fn;return a},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,p=c.length;for(l=0;p>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s})),Ca=function(){function t(){this.emitter=new ka}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=Se(n)&&n||ce(n)&&n.capture,i=ce(n)&&n.once,a=Ue(e)?void 0:e,o=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],o=!0}if(t=r?t+"capture":t,e=Ue(e)?e:e.handleEvent,o){var l=e;e=function(){for(var t,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&l.apply(void 0,n)}}return i?this.emitter.once(t,e,a):this.emitter.on(t,e,a),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=Se(n)&&n||ce(n)&&n.capture,a=Ue(e)?void 0:e;return t=i?t+"capture":t,e=Ue(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,a),this},e.emit=function(t,e){this.dispatchEvent(new Na(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!Pa(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(this.document)n=this;else if(this.defaultView)n=this.defaultView;else{var r;n=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(n){var i;if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),Aa=function(e){function n(){for(var t,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}c(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw Error(Fn)},r.lookupNamespaceURI=function(t){throw Error(Fn)},r.lookupPrefix=function(t){throw Error(Fn)},r.normalize=function(){throw Error(Fn)},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;for(var e=t,r=this,i=[e],a=[r];null!==(o=e.parentNode)&&void 0!==o?o:r.parentNode;){var o;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.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?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.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 p=h.parentNode.childNodes;return p.indexOf(h)<p.indexOf(f)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},u(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=v(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{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}}]),n}(Ca);Aa.DOCUMENT_POSITION_DISCONNECTED=1,Aa.DOCUMENT_POSITION_PRECEDING=2,Aa.DOCUMENT_POSITION_FOLLOWING=4,Aa.DOCUMENT_POSITION_CONTAINS=8,Aa.DOCUMENT_POSITION_CONTAINED_BY=16,Aa.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Oa,La,Ra=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new is.AnimationTimeline(p(n))}catch(t){}var r={};return wo.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Ue(n)?n(t.Shape.GROUP):n)})),n.documentElement=new so({id:"g-root",style:r}),n.documentElement.ownerDocument=p(n),n.documentElement.parentNode=p(n),n.childNodes=[n.documentElement],n}c(n,e);var r=n.prototype;return r.createElement=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?Po:so);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw Error(Fn)},r.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=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=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a},r.elementFromPointSync=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},r.elementFromPoint=function(){var t=o(i().mark((function t(e,n){var r,a,o,s,u,l,c,h,f,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),a=r.x,o=r.y,s=this.defaultView.getConfig(),u=s.width,l=s.height,!(0>a||0>o||a>u||o>l)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:a,y:o}),h=c.x,f=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:a,viewportY:o,clientX:h,clientY:f},picked:[]});case 7:return t.abrupt("return",(p=t.sent.picked)&&p[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=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},r.elementsFromPoint=function(){var t=o(i().mark((function t(e,n){var r,a,o,s,u,l,c,h,f,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),a=r.x,o=r.y,s=this.defaultView.getConfig(),u=s.width,l=s.height,!(0>a||0>o||a>u||o>l)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:a,y:o}),h=c.x,f=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:a,viewportY:o,clientX:h,clientY:f},picked:[]});case 7:return(p=t.sent.picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),t.abrupt("return",p);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw Error(Vn)},r.insertBefore=function(t,e){throw Error(Vn)},r.removeChild=function(t,e){throw Error(Vn)},r.replaceChild=function(t,e,n){throw Error(Vn)},r.append=function(){throw Error(Vn)},r.prepend=function(){throw Error(Vn)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},u(n,[{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}}]),n}(Aa);(Oa=t.Strategy||(t.Strategy={}))[Oa.Standard=0]="Standard",(La=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",La.DESTROY="destroy",La.ATTR_MODIFIED="DOMAttrModified",La.INSERTED="DOMNodeInserted",La.REMOVED="removed",La.MOUNTED="DOMNodeInsertedIntoDocument",La.UNMOUNTED="DOMNodeRemovedFromDocument",La.BOUNDS_CHANGED="bounds-changed",La.RENDER_ORDER_CHANGED="render-order-changed",La.CULLED="culled";var Ia=function(t){function e(e,n,r,i,a,o,s,u){var l;return(l=t.call(this,null)||this).relatedNode=void 0,l.prevValue=void 0,l.newValue=void 0,l.attrName=void 0,l.attrChange=void 0,l.prevParsedValue=void 0,l.newParsedValue=void 0,l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=a,l.attrChange=o,l.prevParsedValue=s,l.newParsedValue=u,l.type=e,l}return c(e,t),e}(wa);Ia.ADDITION=2,Ia.MODIFICATION=1,Ia.REMOVAL=3;var Da=0;var _a=new Ia(t.ElementEvent.INSERTED,null,"","","",0,"",""),Ga=new Ia(t.ElementEvent.REMOVED,null,"","","",0,"",""),Ua=new Na(t.ElementEvent.DESTROY),Ba=function(e){function n(){for(var n,r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(n=e.call.apply(e,[this].concat(i))||this).entity=Da++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.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]},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=is.enableCSSParsing?{anchor:qe,opacity:qe,fillOpacity:qe,strokeOpacity:qe,fill:qe,stroke:qe,transform:qe,transformOrigin:qe,visibility:qe,pointerEvents:qe,lineWidth:qe,lineCap:qe,lineJoin:qe,increasedLineWidthForHitTesting:qe,fontSize:qe,fontFamily:qe,fontStyle:qe,fontWeight:qe,fontVariant:qe,textAlign:qe,textBaseline:qe,textTransform:qe,zIndex:qe,filter:qe,shadowType:qe}:null,n.parsedStyle={},n.attributes={},n}c(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw Error(Fn)},r.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return is.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),_a.relatedNode=this,t.dispatchEvent(_a),t},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){var e;return Ga.relatedNode=this,t.dispatchEvent(Ga),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),is.sceneGraphService.detach(t),t},r.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},r.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},r.matches=function(t){return is.sceneGraphService.matches(t,this)},r.getElementById=function(t){return is.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return is.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return is.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return is.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return is.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return is.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(is.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=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)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,a)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=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)}))},r.prepend=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)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(Ua),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return is.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return is.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return is.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return is.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return is.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return is.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Fe(t);return e=this.attributes[n],is.enableCSSParsing&&oe(e)?null:e}return e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw Error(Fn)},r.getAttributeNode=function(t){throw Error(Fn)},r.getAttributeNodeNS=function(t,e){throw Error(Fn)},r.hasAttributeNS=function(t,e){throw Error(Fn)},r.removeAttributeNS=function(t,e){throw Error(Fn)},r.removeAttributeNode=function(t){throw Error(Fn)},r.setAttributeNS=function(t,e,n){throw Error(Fn)},r.setAttributeNode=function(t){throw Error(Fn)},r.setAttributeNodeNS=function(t){throw Error(Fn)},r.toggleAttribute=function(t,e){throw Error(Fn)},u(n,[{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}}]),n}(Aa),Fa=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new da,e.movement=new da,e.offset=new da,e.global=new da,e.screen=new da,e}c(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw Error(Fn)},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}}]),e}(wa),Va=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}c(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(Fa),Ya=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return c(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Fa);function ja(t){return!!(null==t?void 0:t.nodeName)}var Xa,Ha,Wa,za=new Ia(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ia.MODIFICATION,null,null),qa={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ka={anchor:[0,0],fill:Je,stroke:Je,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Za=l({},Ka,{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Qa=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),$a="data-",Ja=function(e){function n(n){var r,i;(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.dataset=void 0,i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=i.config.style||i.config.attrs||{},Object.assign(i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,is.enableCSSParsing?Ka:Za,i.config.initialParsedStyle),is.enableCSSParsing&&Object.assign(i.attributes,qa),i.initAttributes(i.config.style);var a=is.globalThis.Proxy?is.globalThis.Proxy:function(){};return is.enableDataset&&(i.dataset=new a({},{get:function(t,e){var n=""+$a+Ge(e);return void 0!==t[n]?t[n]:i.getAttribute(n)},set:function(t,e,n){return i.setAttribute(""+$a+Ge(e),n),!0}})),is.enableStyleSyntax&&(i.style=new a({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}})),i}c(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var n=l({},this.attributes);for(var r in n){var i=n[r];ja(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};is.enableCSSParsing&&(n.usedAttributes=Qa);var r={};for(var i in t){r[Fe(i)]=t[i]}is.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Fe(t);Te(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,n))},r.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,a=this.attributes[t],o=this.parsedStyle[t];is.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(za.relatedNode=this,za.prevValue=a,za.newValue=e,za.attrName=t,za.prevParsedValue=o,za.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(za):(za.target=this,this.ownerDocument.defaultView.dispatchEvent(za,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,a,e,o,s)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new va(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),is.sceneGraphService.setOrigin(this,qn(t,e,n)),this},r.getOrigin=function(){return is.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),is.sceneGraphService.setPosition(this,qn(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),is.sceneGraphService.setLocalPosition(this,qn(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),is.sceneGraphService.translate(this,qn(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),is.sceneGraphService.translateLocal(this,qn(t,e,n)),this},r.getPosition=function(){return is.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return is.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=qn(t,e=e||t,n=n||t)),is.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=qn(t,e=e||t,n=n||t)),is.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return is.sceneGraphService.getLocalScale(this)},r.getScale=function(){return is.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return Zn($n(X(),is.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return Zn($n(X(),is.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return is.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return is.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return oe(e)&&oe(n)?is.sceneGraphService.rotateLocal(this,0,0,t):is.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return oe(e)&&oe(n)?is.sceneGraphService.rotate(this,0,0,t):is.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return is.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return is.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return is.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return is.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return is.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return is.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return is.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return is.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return is.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){is.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=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},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getConfig=function(){return this.config},r.attr=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?ce(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},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=R(X(),e),r=n[0],i=n[1],a=I(X(),e),o=a[0],s=a[1],u=D(ot(),e),l=$n(X(),u);return Jn(l[0]||l[2],r,i,o,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=tr(t),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)},r.setLocalMatrix=function(t){var e=tr(t),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)},r.show=function(){is.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},r.hide=function(){is.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},u(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Ba),to=["style"],eo=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,to);return e.call(this,l({type:t.Shape.CIRCLE,style:l(is.enableCSSParsing?{cx:"",cy:"",r:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:is.enableCSSParsing?null:[rn,rn]}},a))||this}return c(n,e),n}(Ja),no=["style"],ro=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,a=f(r,no);return(n=t.call(this,l({style:l(is.enableCSSParsing?{x:"",y:""}:{},i)},a))||this).isCustomElement=!0,n}return c(e,t),e}(Ja),io=["style"],ao=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,io);return e.call(this,l({type:t.Shape.ELLIPSE,style:l(is.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:is.enableCSSParsing?null:[rn,rn]}},a))||this}return c(n,e),n}(Ja),oo=["style"],so=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,oo);return e.call(this,l({type:t.Shape.GROUP,style:l(is.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},i)},a))||this}return c(n,e),n}(Ja),uo=["style"],lo=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=f(i,uo);return(r=e.call(this,l({type:t.Shape.HTML,style:l(is.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},a)},o))||this).cullable.enable=!1,r}c(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,a=n.top-r.top,o=new ha;return o.setMinMax([i,a,0],[i+n.width,a+n.height,0]),o}return null},r.getLocalBounds=function(){if(this.parentNode){var t=T(x(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ha.isEmpty(e)){var n=new ha;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(Ja),co=["style"],ho=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,co);return e.call(this,l({type:t.Shape.IMAGE,style:l(is.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},i)},a))||this}return c(n,e),n}(Ja),fo=["style"],po=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=f(i,fo);(r=e.call(this,l({type:t.Shape.LINE,style:l({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},a)},o))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&ja(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&ja(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}c(n,e);var r=n.prototype;return r.attributeChangedCallback=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&&ja(r)&&(this.markerStartAngle=0,r.remove()),i&&ja(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&ja(r)&&(this.markerEndAngle=0,r.remove()),i&&ja(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=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=e.defX,l=e.defY,c=t?e.markerStart:e.markerEnd;if(c&&ja(c)){var h,f,p,d,v,g,y;t?(d=i-u,v=o-l,f=a-i,p=s-o,g=n||0,y=this.markerStartAngle):(d=a-u,v=s-l,f=i-a,p=o-s,g=r||0,y=this.markerEndAngle),c.setLocalEulerAngles(180*(h=Math.atan2(p,f))/Math.PI+y),c.setLocalPosition(d+Math.cos(h)*g,v+Math.sin(h)*g)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,a=dr.pointAt(n.x1,n.y1,n.x2,n.y2,t),o=a.x,s=a.y,u=tt(X(),W(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new da(u[0],u[1])},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getTotalLength=function(){var t=this.parsedStyle;return dr.length(t.x1,t.y1,t.x2,t.y2)},n}(Ja),vo=["style"],go={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new va(0,0,0,0)},yo=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=f(i,vo);(r=e.call(this,l({type:t.Shape.PATH,style:l(is.enableCSSParsing?{path:"",miterLimit:""}:{},a),initialParsedStyle:is.enableCSSParsing?null:{miterLimit:4,path:l({},go)}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,h=s.markerMid;return u&&ja(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),h&&ja(h)&&r.placeMarkerMid(h),c&&ja(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}c(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===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&&ja(r)&&(this.markerStartAngle=0,r.remove()),i&&ja(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ja(r)&&(this.markerEndAngle=0,r.remove()),i&&ja(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,a=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&ja(o)){var s,u,l,c,h,f,p;if(t){var d=this.getStartTangent(),v=d[0],g=d[1];c=g[0]-i,h=g[1]-a,u=v[0]-g[0],l=v[1]-g[1],f=n||0,p=this.markerStartAngle}else{var y=this.getEndTangent(),m=y[0],x=y[1];c=x[0]-i,h=x[1]-a,u=m[0]-x[0],l=m[1]-x[1],f=r||0,p=this.markerEndAngle}o.setLocalEulerAngles(180*(s=Math.atan2(l,u))/Math.PI+p),o.setLocalPosition(c+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&ja(t))for(var a=1;n.length-1>a;a++){var o=n[a].currentPoint,s=o[0],u=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return wr(this)},r.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,a=function(t,e,n){return ne(t,e,St(St({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),o=a.x,s=a.y,u=tt(X(),W(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new da(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*wr(this),e)},r.getStartTangent=function(){var t=this.parsedStyle.path.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},r.getEndTangent=function(){var t=this.parsedStyle.path.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},n}(Ja),mo=["style"],xo=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=f(i,mo);(r=e.call(this,l({type:t.Shape.POLYGON,style:l(is.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},a),initialParsedStyle:is.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,h=s.markerMid;return u&&ja(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),h&&ja(h)&&r.placeMarkerMid(h),c&&ja(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}c(n,e);var r=n.prototype;return r.attributeChangedCallback=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&&ja(r)&&(this.markerStartAngle=0,r.remove()),i&&ja(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ja(r)&&(this.markerEndAngle=0,r.remove()),i&&ja(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.points.points,a=e.defX,o=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&ja(s)){var u,l,c,h,f,p,d;if(h=i[0][0]-a,f=i[0][1]-o,t)l=i[1][0]-i[0][0],c=i[1][1]-i[0][1],p=n||0,d=this.markerStartAngle;else{var v=i.length;this.parsedStyle.isClosed?(l=i[v-1][0]-i[0][0],c=i[v-1][1]-i[0][1]):(h=i[v-1][0]-a,f=i[v-1][1]-o,l=i[v-2][0]-i[v-1][0],c=i[v-2][1]-i[v-1][1]),p=r||0,d=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(c,l))/Math.PI+d),s.setLocalPosition(h+Math.cos(u)*p,f+Math.sin(u)*p)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&ja(t))for(var a=1;(this.parsedStyle.isClosed?n.length:n.length-1)>a;a++){var o=n[a][0]-r,s=n[a][1]-i,u=1===a?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,s)}},n}(Ja),Eo=["style"],bo=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,Eo);return e.call(this,l({type:t.Shape.POLYLINE,style:l(is.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},i),initialParsedStyle:is.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},a))||this}c(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,a=n.points,o=a.points,s=0,u=0;a.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var l=dr.pointAt(o[u][0],o[u][1],o[u+1][0],o[u+1][1],s),c=l.x,h=l.y,f=tt(X(),W(c-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new da(f[0],f[1])},r.getStartTangent=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},r.getEndTangent=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},n}(xo),Mo=["style"],So=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,Mo);return e.call(this,l({type:t.Shape.RECT,style:l(is.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},i)},a))||this}return c(n,e),n}(Ja),To=["style"],Po=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=f(r,To);return e.call(this,l({type:t.Shape.TEXT,style:l(is.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0}:{fill:"black"},i),initialParsedStyle:is.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},a))||this}c(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(Ja),wo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.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:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.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:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],No=wo.filter((function(t){return!!t.l})).map((function(t){return t.n})),ko={},Co=new WeakMap,Ao=function(){function e(){var t=this;wo.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){ko[e]=t}))},n.unregisterMetadata=function(t){delete ko[t]},n.getPropertySyntax=function(t){return is.CSSPropertySyntaxFactory[t]},n.processProperties=function(e,n,r){var i=this;if(void 0===r&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!is.enableCSSParsing){Object.assign(e.attributes,n);var a=Object.keys(n),o=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var u=!!r.forceUpdateGeometry;if(!u)for(var c=0;No.length>c;c++)if(No[c]in n){u=!0;break}return n.fill&&(e.parsedStyle.fill=hi(n.fill)),n.stroke&&(e.parsedStyle.stroke=hi(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=hi(n.shadowColor)),n.filter&&(e.parsedStyle.filter=Si(n.filter)),oe(n.radius)||(e.parsedStyle.radius=xi(n.radius,4)),oe(n.lineDash)||(e.parsedStyle.lineDash=xi(n.lineDash,2)),n.points&&(e.parsedStyle.points=Ri(n.points,e)),""===n.path&&(e.parsedStyle.path=l({},go)),n.path&&(e.parsedStyle.path=Oi(n.path,e)),n.textTransform&&is.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&is.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,n.clipPath,e,this),n.offsetPath&&is.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this),n.anchor&&(e.parsedStyle.anchor=xi(n.anchor,2)),n.transform&&(e.parsedStyle.transform=Bi(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=Ki(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=is.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=is.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=is.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||oe(n.cx)&&oe(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||oe(n.x)&&oe(n.y)&&oe(n.z))&&(e.nodeName!==t.Shape.LINE||oe(n.x1)&&oe(n.y1)&&oe(n.z1)&&oe(n.x2)&&oe(n.y2)&&oe(n.z2))||is.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,a),oe(n.zIndex)||is.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,a),n.path&&is.CSSPropertySyntaxFactory["<path>"].postProcessor(e,a),n.points&&is.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,a),oe(n.offsetDistance)||is.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,a),n.transform&&is.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,a),void(u&&this.updateGeometry(e))}var h=r.skipUpdateAttribute,f=r.skipParse,p=r.usedAttributes,d=r.forceUpdateGeometry,v=Object.keys(n);v.forEach((function(t){var r;h||(e.attributes[t]=n[t]),!d&&(null===(r=ko[t])||void 0===r?void 0:r.l)&&(d=!0)})),f||v.forEach((function(t){e.computedStyle[t]=i.parseProperty(t,e.attributes[t],e)})),(null==p?void 0:p.length)&&(v=Array.from(new Set(v.concat(p)))),v.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=i.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),v.forEach((function(t){t in e.parsedStyle&&i.postProcessProperty(t,e,v)})),is.enableCSSParsing&&e.children.length&&v.forEach((function(t){t in e.parsedStyle&&i.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=ko[t],i=e;if((""===e||oe(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=$e(e);else if(r){var a=r.k,o=r.syntax,s=o&&this.getPropertySyntax(o);a&&a.indexOf(e)>-1?i=$e(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=ko[t],i=e;if(r){var a=r.syntax,o=r.d;if(e instanceof Ie){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)oe(o)||(e=this.parseProperty(t,Ue(o)?o(n.nodeName):o,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return oe(u)?void this.addUnresolveProperty(n,t):u}}var l=a&&this.getPropertySyntax(a);if(l&&l.calculator)i=l.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof Ie?e.value:e}return i},n.postProcessProperty=function(t,e,n){var r=ko[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},n.addUnresolveProperty=function(t,e){var n=Co.get(t);n||(Co.set(t,[]),n=Co.get(t)),-1===n.indexOf(e)&&n.push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Co.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=Co.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Co.delete(t)}},n.updateGeometry=function(e){var n=e.nodeName,r=is.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new ha),i.renderBounds||(i.renderBounds=new ha);var a=e.parsedStyle,o=r.update(a,e),s=o.width,u=o.height,l=o.depth,c=void 0===l?0:l,h=o.offsetX,f=void 0===h?0:h,p=o.offsetY,d=void 0===p?0:p,v=o.offsetZ,g=void 0===v?0:v,y=[Math.abs(s)/2,Math.abs(u)/2,c/2],m=a.stroke,x=a.lineWidth,E=a.increasedLineWidthForHitTesting,b=a.shadowType,M=a.shadowColor,S=a.filter,T=void 0===S?[]:S,P=a.transformOrigin,w=a.anchor;n===t.Shape.TEXT&&delete a.anchor;var N=[(1-2*(w&&w[0]||0))*s/2+f,(1-2*(w&&w[1]||0))*u/2+d,(1-2*(w&&w[2]||0))*y[2]+g];if(i.contentBounds.update(N,y),m&&!m.isNone){var k=((x||0)+(E||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);y[0]+=k,y[1]+=k}if(i.renderBounds.update(N,y),M&&b&&"inner"!==b){var C=i.renderBounds,A=C.min,O=C.max,L=a.shadowBlur||0,R=a.shadowOffsetX||0,I=a.shadowOffsetY||0,D=O[0]+L+R,_=A[1]-L+I,G=O[1]+L+I;A[0]=Math.min(A[0],A[0]-L+R),O[0]=Math.max(O[0],D),A[1]=Math.min(A[1],_),O[1]=Math.max(O[1],G),i.renderBounds.setMinMax(A,O)}T.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,Hn(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=i.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,p=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],p),i.renderBounds.setMinMax(l,c)}})),w=a.anchor;var U=0>s,B=0>u,F=(U?-1:1)*(P?bi(P[0],0,e):0),V=(B?-1:1)*(P?bi(P[1],1,e):0);e.setOrigin(F-=(U?-1:1)*(w&&w[0]||0)*i.contentBounds.halfExtents[0]*2,V-=(B?-1:1)*(w&&w[1]||0)*i.contentBounds.halfExtents[1]*2),is.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=ko[t];return!!e&&e.inh},e}();(Xa=t.CameraType||(t.CameraType={}))[Xa.ORBITING=0]="ORBITING",Xa[Xa.EXPLORING=1]="EXPLORING",Xa[Xa.TRACKING=2]="TRACKING",(Ha=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Ha.DEFAULT=0]="DEFAULT",Ha[Ha.ROTATIONAL=1]="ROTATIONAL",Ha[Ha.TRANSLATIONAL=2]="TRANSLATIONAL",Ha[Ha.CINEMATIC=3]="CINEMATIC",(Wa=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Wa.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Wa[Wa.PERSPECTIVE=1]="PERSPECTIVE";var Oo,Lo={UPDATED:"updated"},Ro=2e-4,Io=function(){function e(){this.canvas=void 0,this.eventEmitter=new ka,this.matrix=x(),this.right=W(1,0,0),this.up=W(0,1,0),this.forward=W(0,0,1),this.position=W(0,0,1),this.focalPoint=W(0,0,0),this.distanceVector=W(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.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=x(),this.projectionMatrixInverse=x(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new pa,this.orthoMatrix=x()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return T(x(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=O(x(),[t,e,0]);this.jitteredProjectionMatrix=w(x(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},n.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},n.setViewOffset=function(e,n,r,i,a,o){return this.aspect=e/n,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=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.projectionMode===t.CameraProjectionMode.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},n.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.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},n.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},n.setZoomByViewportPoint=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=W(o.x-r,o.y-i,0),u=$(s,this.right)/H(this.right),l=$(s,this.up)/H(this.up);return this.pan(-u,-l),this},n.setPerspective=function(e,n,r,i){var a;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var o=this.near*Math.tan(Kn(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,l=-.5*u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var c=this.view.fullWidth,h=this.view.fullHeight;l+=this.view.offsetX*u/c,o-=this.view.offsetY*s/h,u*=this.view.width/c,s*=this.view.height/h}return function(t,e,n,r,i,a,o){var s=2*a/(r-i),u=(n+e)/(n-e),l=(r+i)/(r-i),c=-(o+a)/(o-a),h=-2*o*a/(o-a);t[0]=2*a/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=l,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,l,l+u,o,o-s,e,this.far),k(this.projectionMatrix,this.projectionMatrix,W(1,-1,1)),T(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.setOrthographic=function(e,n,r,i,a,o){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=a,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=c-u,p=c+u,d=h+l,v=h-l;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(f+=g*this.view.offsetX)+g*this.view.width,v=(d-=y*this.view.offsetY)-y*this.view.height}return F(this.projectionMatrix,f,p,v,d,a,o),k(this.projectionMatrix,this.projectionMatrix,W(1,-1,1)),T(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=qn(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=W(0,1,0);if(this.focalPoint=qn(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=Z(X(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=H(a),s=Zn(Math.asin(n/o)),u=90+Zn(Math.atan2(r,e)),l=x();A(l,l,Kn(u)),C(l,l,Kn(s)),i=tt(X(),[0,1,0],l)}return T(this.matrix,V(x(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Ro>this.distance&&(this.distance=Ro),this.dollyingStep=this.distance/100;var e=X(),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},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=zn(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=zn(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=zn(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=st(ot(),[0,0,1],Kn(this.roll));M(this.matrix);var n=st(ot(),[1,0,0],Kn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=st(ot(),[0,1,0],Kn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=ut(ot(),r,n);i=ut(ot(),i,e);var a=G(x(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(N(this.matrix,this.matrix,this.focalPoint),w(this.matrix,this.matrix,a),N(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(N(this.matrix,this.matrix,this.position),w(this.matrix,this.matrix,a))},n._setPosition=function(t,e,n){this.position=qn(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()},n._getAxes=function(){z(this.right,qn(at(it(),[1,0,0,0],this.matrix))),z(this.up,qn(at(it(),[0,1,0,0],this.matrix))),z(this.forward,qn(at(it(),[0,0,1,0],this.matrix))),Q(this.right,this.right),Q(this.up,this.up),Q(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=H(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Zn(Math.asin(n/i)),this.azimuth=Zn(Math.atan2(-e,-r))):(this.elevation=-Zn(Math.asin(n/i)),this.azimuth=-Zn(Math.atan2(-e,-r)))},n._getPosition=function(){z(this.position,qn(at(it(),[0,0,0,1],this.matrix))),this._getDistance()},n._getFocalPoint=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=m(),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)),K(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=Z(X(),this.focalPoint,this.position),this.distance=H(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=st(ot(),[0,0,1],-this.roll*Math.PI/180);_(this.orthoMatrix,n,W((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),W(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=w(x(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Lo.UPDATED)}},n.rotate=function(t,e,n){throw Error(Fn)},n.pan=function(t,e){throw Error(Fn)},n.dolly=function(t){throw Error(Fn)},n.createLandmark=function(t,e){throw Error(Fn)},n.gotoLandmark=function(t,e){throw Error(Fn)},n.cancelLandmarkAnimation=function(){throw Error(Fn)},e}(),Do=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),_o=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Go=function(){function t(){}return t.prototype.update=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);return{width:o-a,height:Math.max(n,i)-s}},t}(),Uo=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Bo=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),Fo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,a=void 0===r?0:r,o=void 0===i?0:i;return n&&!pe(n)&&(a||(t.width=a=n.width),o||(t.height=o=n.height)),{width:a,height:o}},t}(),Vo=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!oe(t.lineWidth)},e.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy,c=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;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:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,c);t.metrics=h;var f=[h.width/2,h.height/2,0],p=[0,1],d=0;"center"===a||"middle"===a?(d=o/2,p=[.5,1]):"right"!==a&&"end"!==a||(d=o,p=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=is.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(d+=u),l&&(v+=l),t.anchor=[p[0],p[1],0],{width:2*f[0],height:2*f[1],offsetX:d,offsetY:v}},t}(),Yo=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new ka,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=x(),this.tmpVec3=X(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e=performance.now(),r=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)n.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){n.dispatchEvent(r,2===r.button?"rightup":"mouseup")}var i=n.trackingData(t.pointerId),a=n.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!r.composedPath().includes(a)){for(var s=a;s&&!r.composedPath().includes(s);){if(r.currentTarget=s,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)n.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){n.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside")}Aa.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=n.clonePointerEvent(r,"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&&200>e-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,(null===(u=r.detail)||void 0===u?void 0:u.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)}n.freeEvent(r)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),a=n.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(n.dispatchEvent(o,"pointerout"),r&&n.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=n.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),Aa.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(o)}if(a!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var l=a&&Aa.isNode(a)&&a.parentNode;l&&l!==(Aa.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Aa.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var c=n.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Aa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseenter"),Aa.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),a=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(a),r&&n.dispatchEvent(a,"mouseout");var o=n.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Aa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),r&&n.notifyTarget(o,"mouseleave"),Aa.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,n.freeEvent(a),n.freeEvent(o)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var a=n.clonePointerEvent(r,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Aa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),i&&n.notifyTarget(a,"mouseenter"),Aa.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(a)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var a=r;a;)i.currentTarget=a,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Aa.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)},this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=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)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new da(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new da(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=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=w(this.tmpMatrix,u,s),c=q(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return tt(c,c,l),new da(c[0],c[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=w(this.tmpMatrix,n,r),a=q(this.tmpVec3,t.x,t.y,0);tt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new da((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=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}))},e.mapEvent=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 "+t.type)}},e.dispatchEvent=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)},e.propagate=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}}},e.propagationPath=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++)Aa.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=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:this.pickHandler(t)||this.rootTarget||null},e.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=v(t.nativeEvent.composedPath());!(e=n()).done;){var r=is.nativeHTMLMap.get(e.value);if(r)return r}return null},e.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(Va);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i);return i.target=null!=n?n:a||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},e.createWheelEvent=function(t){var e=this.allocateEvent(Ya);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(Ya);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},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Va);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},e.copyPointerData=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},e.copyMouseData=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)},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=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},e.freeEvent=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)},e.notifyTarget=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?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=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)},e.findMountedTarget=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||Aa.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=Ba.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Aa.isNode(e)&&e.parentNode}},t}(),jo=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",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",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();(Oo=t.RenderReason||(t.RenderReason={}))[Oo.CAMERA_CHANGED=0]="CAMERA_CHANGED",Oo[Oo.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Oo[Oo.NONE=2]="NONE";var Xo=function(){function e(e,n){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new Na(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new Ur,dirtycheck:new Vr,cull:new Vr,beginFrame:new Fr,beforeRender:new Fr,render:new Fr,afterRender:new Fr,endFrame:new Fr,destroy:new Fr,pick:new Br,pickSync:new Vr,pointerDown:new Fr,pointerUp:new Fr,pointerMove:new Fr,pointerOut:new Fr,pointerOver:new Fr,pointerWheel:new Fr,pointerCancel:new Fr,click:new Fr},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=o(i().mark((function t(){var e;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=l({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e,is)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=a?this.hooks.dirtycheck.call(t):t;if(s){var u=o?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var l=t.sortable,c=!1;l.dirty&&(l.sorted=t.childNodes.slice().sort(Gn),c=!0,l.dirty=!1),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),c&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Ho=/\[\s*(.*)=(.*)\s*\]/,Wo=function(){function t(){}var e=t.prototype;return e.selectOne=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}))},e.selectAll=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}))},e.is=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},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(Ho),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return oe(n)?"":n.toString?""+n:""},t}();function zo(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var qo,Ko,Zo,Qo=new Ia(t.ElementEvent.REPARENT,null,"","","",0,"",""),$o=function(){function e(e){var n,r,i,a,o,s,u,l,c=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Na(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=ot(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=W(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=ot();ht(o,e[0],e[1],e[2]);var s=c.getRotation(t),u=c.getRotation(t.parentNode);xt(n,u),ct(n,n),ut(o,n,o),ut(a.localRotation,o,s),bt(a.localRotation,a.localRotation),c.dirtifyLocal(t,a)}else c.rotateLocal(t,e)}),this.rotateLocal=(r=ot(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=W(e,n,i));var a=t.transformable;ht(r,e[0],e[1],e[2]),Et(a.localRotation,a.localRotation,r),c.dirtifyLocal(t,a)}),this.setEulerAngles=(i=ot(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=W(e,n,r));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ht(a.localRotation,e[0],e[1],e[2]);var o=c.getRotation(t.parentNode);xt(i,ct(ot(),o)),Et(a.localRotation,a.localRotation,i),c.dirtifyLocal(t,a)}else c.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=W(e,n,r));var i=t.transformable;et(e,X())||(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,p=a*l-r*h,d=r*c-i*l,v=2*n[3];c*=v,h*=v,p*=2,d*=2,t[0]=o+(l*=v)+(f*=2),t[1]=s+c+p,t[2]=u+h+d}(e,e,i.localRotation),K(i.localPosition,i.localPosition,e),c.dirtifyLocal(t,i))},this.setPosition=(a=x(),o=X(),function(t,e){var n=t.transformable;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,et(c.getPosition(t),o)||(z(n.position,o),null!==t.parentNode&&t.parentNode.transformable?(E(a,t.parentNode.transformable.worldTransform),T(a,a),tt(n.localPosition,o,a)):z(n.localPosition,o),c.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=X();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,et(r.localPosition,t)||(z(r.localPosition,t),c.dirtifyLocal(e,r))}}(),this.translate=(s=X(),u=X(),l=X(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=q(u,e,n,r)),et(e,s)||(K(l,c.getPosition(t),e),c.setPosition(t,l))}),this.setRotation=function(){var t=ot();return function(e,n,r,i,a){var o=e.transformable;if("number"==typeof n&&(n=mt(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var s=c.getRotation(e.parentNode);xt(t,s),ct(t,t),ut(o.localRotation,t,n),bt(o.localRotation,o.localRotation),c.dirtifyLocal(e,o)}else c.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=x(),e=X(),n=mt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(_(r.localTransform,r.localRotation,r.localPosition,W(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=M(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),w(r.localTransform,r.localTransform,i)}var a=_(t,n,e,r.localScale,r.origin);w(r.localTransform,r.localTransform,a)}else _(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=e}var n=e.prototype;return n.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},n.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},n.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},n.attach=function(t,e,n){var r,i,a=!1;t.parentNode&&(a=t.parentNode!==e,this.detach(t)),t.parentNode=e,oe(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null==o||null===(r=o.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(o.dirty=!0);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),a&&t.dispatchEvent(Qo)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var a=i.origin;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=W(e,n,r));var i=t.transformable;ht(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,a=t.transformable;n=a.localScale,r=a.localScale,i=W(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,a)},n.setLocalScale=function(t,e){var n=t.transformable,r=W(e[0],e[1],e[2]||n.localScale[2]);et(r,n.localScale)||(z(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=mt(e,n,r,i));var a=t.transformable;xt(a.localRotation,e),this.dirtifyLocal(t,a)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new y(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,a=t.transformable;(r=a.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,a)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.clearPendingEvents(),e.clear()},n.clearPendingEvents=function(){this.pendingEvents=[]},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)zo(n),n=n.parentNode;e&&t.forEach((function(t){zo(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},n.updateDisplayObjectDependency=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)}},n.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new Ia(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Ia.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return R(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return D(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return I(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=R(X(),e),r=D(ot(),e),i=I(X(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(ha.isEmpty(r))return null;var i=n||new ha;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new ha},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(a?a.add(r):(a=i||new ha).update(r.center,r.halfExtents))})),e){var o=Un(t);if(o){var s=o.parsedStyle.clipPath.getBounds(e);a?s&&(a=s.intersection(a)):a=s}}return a||(a=new ha),a&&(e?r.renderBounds=a:r.bounds=a),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,a},n.getLocalBounds=function(t){if(t.parentNode){var e=x();t.parentNode.transformable&&(e=T(x(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!ha.isEmpty(n)){var r=new ha;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ha.isEmpty(i)||(r=new ha).setFromTransformedAABB(i,this.getWorldTransform(t));var a=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var o=r.getMin(),s=o[0],u=o[1],l=r.getMax();return new va(s+((null==a?void 0:a.left)||0),u+((null==a?void 0:a.top)||0),l[0]-s,l[1]-u)}return new va((null==a?void 0:a.left)||0,(null==a?void 0:a.top)||0,0,0)},n.dirtifyWorldInternal=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)}},n.syncHierarchy=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])}},n.sync=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?w(e.worldTransform,r.worldTransform,e.localTransform):E(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),Jo={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]},ts=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,es=RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),ns=RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),rs=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ns.exec(n)&&!es.exec(t))},this.trimByKinsokuShorui=function(t){var e=[].concat(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=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e);i.font=t;var a=Jo.MetricsString+Jo.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(Jo.BaselineSymbol).width),u=Jo.HeightMultiplier*s;s=s*Jo.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,p=0,d=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==l[p+v]){d=!0;break}if(d)break;p+=h}for(n.ascent=s-f,p=c-h,d=!1,f=u;f>s;--f){for(var g=0;h>g;g+=4)if(255!==l[p+g]){d=!0;break}if(d)break;p-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath,h=e.leading,f=void 0===h?0:h,p=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=ve(e)&&e+"px"||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!jr.test(l)&&0>Yr.indexOf(l)&&(l='"'+l+'"'),s[u]=l}return r+" "+i+" "+a+" "+o+" "+s.join(",")}(e),d=this.measureFont(p,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var v=this.runtime.offscreenCanvas.getOrCreateContext(n);v.font=p,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=Array(g.length),m=0;if(!c){for(var x=0;g.length>x;x++){var E=v.measureText(g[x]).width+(g[x].length-1)*l;y[x]=E,m=Math.max(m,E)}var b=m+o,M=a||d.fontSize+o,S=Math.max(M,d.fontSize+o)+(g.length-1)*(M+f),T=0;return"middle"===s?T=-S/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?T=-S:"top"!==s&&"hanging"!==s||(T=0),{font:p,width:b,height:S,lines:g,lineWidths:y,lineHeight:M+=f,maxLineWidth:m,fontProperties:d,lineMetrics:y.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new va(n-o/2,T+e*M,t+o,M)}))}}c.getTotalLength();for(var P=0;g.length>P;P++)v.measureText(g[P])},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,a=void 0===i?0:i,o=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvas.getOrCreateContext(n),h=a+o,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var p=[],d=0,v=0,g={},y=function(t){return r.getFromCache(t,o,g,c)},m=Array.from(f).reduce((function(t,e){return t+y(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],M=t[E-1],S=t[E+1],T=y(b);if(this.isNewline(b)){if(++d>=u){e.isOverflowing=!0;break}v=0,p[d]=""}else{if(v>0&&v+T>h){if(d+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var P=p[d].length,w=0,N=P,k=0;P>k;k++){var C=y(p[d][k]);if(w+C+m>h){N=k;break}w+=C}p[d]=(p[d]||"").slice(0,N)+f}break}if(v=0,p[++d]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[d]||"",g)),this.shouldBreakByKinsokuShorui(b,S)&&(p=this.trimByKinsokuShorui(p),v+=y(M||""))}v+=T,p[d]=(p[d]||"")+b}}return p.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&Jo.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&Jo.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(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},e.canBreakInLastChar=function(t){return!t||!ts.test(t)},e.sumTextWidthByCache=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)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!ts.test(t[e]))return e;return-1},e.getFromCache=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},t}(),is={},as=(Ko=new Fo,Zo=new Bo,(qo={})[t.Shape.CIRCLE]=new Do,qo[t.Shape.ELLIPSE]=new _o,qo[t.Shape.RECT]=Ko,qo[t.Shape.IMAGE]=Ko,qo[t.Shape.GROUP]=Ko,qo[t.Shape.LINE]=new Go,qo[t.Shape.TEXT]=new Vo(is),qo[t.Shape.POLYLINE]=Zo,qo[t.Shape.POLYGON]=Zo,qo[t.Shape.PATH]=new Uo,qo[t.Shape.HTML]=null,qo[t.Shape.MESH]=null,qo),os=function(){var e,n=new Ji,r=new ra;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new ua,e[t.PropertySyntax.ANGLE]=new Qi,e[t.PropertySyntax.DEFINED_PATH]=new $i,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new ta,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new ia,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new aa,e[t.PropertySyntax.COORDINATE]=new oa,e[t.PropertySyntax.OFFSET_DISTANCE]=new la,e[t.PropertySyntax.OPACITY_VALUE]=new ca,e[t.PropertySyntax.PATH]=new ga,e[t.PropertySyntax.LIST_OF_POINTS]=new ya,e[t.PropertySyntax.SHADOW_BLUR]=new ma,e[t.PropertySyntax.TEXT]=new xa,e[t.PropertySyntax.TEXT_TRANSFORM]=new Ea,e[t.PropertySyntax.TRANSFORM]=new ba,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Ma,e[t.PropertySyntax.Z_INDEX]=new Sa,e[t.PropertySyntax.MARKER]=new sa,e}();is.CameraContribution=Io,is.AnimationTimeline=null,is.EasingFunction=null,is.offscreenCanvas=new jo,is.nativeHTMLMap=new WeakMap,is.sceneGraphSelector=new Wo,is.sceneGraphService=new $o(is),is.textService=new rs(is),is.geometryUpdaterFactory=as,is.CSSPropertySyntaxFactory=os,is.styleValueRegistry=new Ao,is.layoutRegistry=null,is.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("Unable to locate global `this`")}(),is.enableCSSParsing=!0,is.enableDataset=!1,is.enableStyleSyntax=!0;var ss=function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),us=function(){function t(t){this.plugins=[],this.config=void 0,this.config=l({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),ls=function(){function e(t){this.strategies=void 0,this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,a=n.renderingContext,o=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===o.length?a.unculledEntities.indexOf(e.entity)>-1:o.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Na(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();ls.tag="Culling";var cs=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t}();cs.tag="DirtyCheck";var hs=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Va(null),this.rootWheelEvent=new Ya(null),this.context=void 0,this.onPointerMove=function(e){var n,r,i=null===(n=t.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var a,o=v(t.normalizeToPointerEvent(e,i));!(a=o()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,a.value,i,e);t.context.eventService.mapEvent(s)}t.setCursor(t.context.eventService.cursor)}}}var e=t.prototype;return e.apply=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();for(var r,a=v(e);!(r=a()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.context.contextService.getDomElement(),r="outside";try{r=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var a,o=v(n.normalizeToPointerEvent(t,i));!(a=o()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,a.value,i,t);s.type+=r,n.context.eventService.mapEvent(s)}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.onPointerMove),r.hooks.pointerCancel.tap(t.tag,(function(t){for(var e,r=v(n.normalizeToPointerEvent(t,i));!(e=r()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}n.setCursor(n.context.eventService.cursor)}))},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,a=t.clientX,o=t.clientY;if(!this.context.config.supportsCSSTransform||oe(r)||oe(i)){var s=this.context.eventService.client2Viewport(new da(a,o));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=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.getViewportXY(e),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=Yn[t.type]||t.type),t},e.normalizeWheelEvent=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.getViewportXY(t),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},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.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},e.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Te(i.button)&&(i.button=0),Te(i.buttons)&&(i.buttons=1),Te(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Te(i.width)&&(i.width=i.radiusX||1),Te(i.height)&&(i.height=i.radiusY||1),Te(i.tiltX)&&(i.tiltX=0),Te(i.tiltY)&&(i.tiltY=0),Te(i.pointerType)&&(i.pointerType="touch"),Te(i.pointerId)&&(i.pointerId=i.identifier||0),Te(i.pressure)&&(i.pressure=i.force||.5),Te(i.twist)&&(i.twist=0),Te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;Te(a.isPrimary)&&(a.isPrimary=!0),Te(a.width)&&(a.width=1),Te(a.height)&&(a.height=1),Te(a.tiltX)&&(a.tiltX=0),Te(a.tiltY)&&(a.tiltY=0),Te(a.pointerType)&&(a.pointerType="mouse"),Te(a.pointerId)&&(a.pointerId=1),Te(a.pressure)&&(a.pressure=.5),Te(a.twist)&&(a.twist=0),Te(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n},t}();hs.tag="Event";var fs,ps=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],ds=function(){function e(){}var n=e.prototype;return n.isVisible=function(e,n){var r,i,a=n.cullable;if(!a.enable)return!0;var o=n.getRenderBounds();if(ha.isEmpty(o))return!1;var s=e.getFrustum(),u=null===(r=n.parentNode)||void 0===r||null===(i=r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,o,u||t.Mask.INDETERMINATE,s.planes),a.visible=a.visibilityPlaneMask!==t.Mask.OUTSIDE,a.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var a=t.Mask.INSIDE,o=ps.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var l=1<<s;if(0!=(r&l)&&(!o||4!==s&&5!==s)){var c=i[s],h=c.normal,f=c.distance;if(0>$(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>$(h,n.getNegativeFarPoint(i[s]))+f&&(a|=l)}}return a},e}(),vs=function(){function e(){this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.apply=function(n){var r=this,a=n.renderingService,s=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var u=function(t){t.target.renderable.dirty=!0,a.dirtify()},l=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;a.dirtify()},c=function(t){var e=t.target;is.enableCSSParsing&&is.styleValueRegistry.recalc(e),is.sceneGraphService.dirtifyToRoot(e),a.dirtify()},h=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),is.sceneGraphService.dirtifyToRoot(e),a.dirtify()};a.hooks.init.tapPromise(e.tag,o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.addEventListener(t.ElementEvent.MOUNTED,c),s.addEventListener(t.ElementEvent.UNMOUNTED,h),s.addEventListener(t.ElementEvent.ATTR_MODIFIED,u),s.addEventListener(t.ElementEvent.BOUNDS_CHANGED,l);case 4:case"end":return e.stop()}}),e)})))),a.hooks.destroy.tap(e.tag,(function(){s.removeEventListener(t.ElementEvent.MOUNTED,c),s.removeEventListener(t.ElementEvent.UNMOUNTED,h),s.removeEventListener(t.ElementEvent.ATTR_MODIFIED,u),s.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,l),r.toSync.clear()})),a.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var a=i.getMin(),o=a[0],s=a[1],u=i.getMax(),l=u[0],c=u[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=o,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=c}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}();vs.tag="Prepare",(fs=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",fs.BEFORE_RENDER="beforerender",fs.RERENDER="rerender",fs.AFTER_RENDER="afterrender",fs.BEFORE_DESTROY="beforedestroy",fs.AFTER_DESTROY="afterdestroy",fs.RESIZE="resize",fs.DIRTY_RECTANGLE="dirtyrectangle";var gs=new Na(t.ElementEvent.MOUNTED),ys=new Na(t.ElementEvent.UNMOUNTED),ms=new Na(t.CanvasEvent.BEFORE_RENDER),xs=new Na(t.CanvasEvent.RERENDER),Es=new Na(t.CanvasEvent.AFTER_RENDER),bs=function(e){function n(n){var r;(r=e.call(this)||this).document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=Ja,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new Ra,r.document.defaultView=p(r),r.customElements=new Ta;var a=n.container,s=n.canvas,u=n.offscreenCanvas,l=n.width,c=n.height,h=n.devicePixelRatio,f=n.renderer,d=n.background,v=n.cursor,g=n.document,y=n.requestAnimationFrame,m=n.cancelAnimationFrame,x=n.createImage,E=n.supportsPointerEvents,b=n.supportsTouchEvents,M=n.supportsCSSTransform,S=n.useNativeClickEvent,T=n.alwaysTriggerPointerEventOnCanvas,P=n.isTouchEvent,w=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||Dn++;In[n]&&In[n].destroy(),In[n]=e}}(a,p(r));var N=l,k=c,C=h;return s&&(C=1>(C=h||_n&&window.devicePixelRatio||1)?1:Math.ceil(C),N=l||function(t){var e=Bn(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(s)||s.width/C,k=c||function(t){var e=Bn(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(s)||s.height/C),r.devicePixelRatio=C,r.requestAnimationFrame=null!=y?y:Jr.bind(is.globalThis),r.cancelAnimationFrame=null!=m?m:ti.bind(is.globalThis),r.supportsTouchEvents=null!=b?b:"ontouchstart"in is.globalThis,r.supportsPointerEvents=null!=E?E:!!is.globalThis.PointerEvent,r.isTouchEvent=null!=P?P:function(t){return r.supportsTouchEvents&&t instanceof is.globalThis.TouchEvent},r.isMouseEvent=null!=w?w:function(t){return!is.globalThis.MouseEvent||t instanceof is.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof is.globalThis.PointerEvent))},r.initRenderingContext({container:a,canvas:s,width:N,height:k,renderer:f,offscreenCanvas:u,devicePixelRatio:C,cursor:v||"default",background:d||"transparent",createImage:x,document:g,supportsCSSTransform:M,useNativeClickEvent:S,alwaysTriggerPointerEventOnCanvas:T}),r.initDefaultCamera(N,k),o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(f);case 2:r.dispatchEvent(new Na(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}c(n,e);var a=n.prototype;return a.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},a.initDefaultCamera=function(e,n){var r=this,i=new is.CameraContribution;i.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Lo.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},a.getConfig=function(){return this.context.config},a.getRoot=function(){return this.document.documentElement},a.getCamera=function(){return this.context.camera},a.getContextService=function(){return this.context.contextService},a.getEventService=function(){return this.context.eventService},a.getRenderingService=function(){return this.context.renderingService},a.getRenderingContext=function(){return this.context.renderingContext},a.getStats=function(){return this.getRenderingService().getStats()},a.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Na(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new Na(t.CanvasEvent.AFTER_DESTROY))},a.changeSize=function(t,e){this.resize(t,e)},a.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),a===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Na(t.CanvasEvent.RESIZE,{width:e,height:n}))},a.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},a.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},a.removeChild=function(t){return this.document.documentElement.removeChild(t)},a.removeChildren=function(){this.document.documentElement.removeChildren()},a.destroyChildren=function(){this.document.documentElement.destroyChildren()},a.render=function(){var t=this;this.dispatchEvent(ms),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(xs)})),this.dispatchEvent(Es)},a.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},a.initRenderer=function(){var t=o(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new r,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new hs,new vs,new cs,new ls([new ds])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(l({},is,this.context)),this.context.renderingService=new Xo(is,this.context),this.context.eventService=new Yo(is,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),a.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(is)}))},a.setRenderer=function(){var t=o(i().mark((function t(e){var n,r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(is)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),a.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},a.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(ys):(ys.target=t,this.dispatchEvent(ys,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},a.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(gs):(gs.target=t,this.dispatchEvent(gs,!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)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},a.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},a.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},a.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},a.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},a.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},a.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},u(n,[{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}}]),n}(Ca);t.AABB=ha,t.AbstractRenderer=us,t.AbstractRendererPlugin=ss,t.BUILT_IN_PROPERTIES=wo,t.CSS=ze,t.CSSGradientValue=Re,t.CSSKeywordValue=Ie,t.CSSRGB=We,t.CSSStyleValue=Oe,t.CSSUnitValue=je,t.Camera=Io,t.CameraEvent=Lo,t.Canvas=bs,t.Circle=eo,t.CircleUpdater=Do,t.CustomElement=ro,t.CustomElementRegistry=Ta,t.CustomEvent=Na,t.DefaultSceneGraphSelector=Wo,t.DefaultSceneGraphService=$o,t.DisplayObject=Ja,t.Document=Ra,t.EMPTY_PARSED_PATH=go,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Fn,t.Element=Ba,t.Ellipse=ao,t.EllipseUpdater=_o,t.EventService=Yo,t.EventTarget=Ca,t.FederatedEvent=wa,t.FederatedMouseEvent=Fa,t.FederatedPointerEvent=Va,t.FederatedWheelEvent=Ya,t.Frustum=pa,t.Group=so,t.HTML=lo,t.Image=ho,t.Line=po,t.LineUpdater=Go,t.MutationEvent=Ia,t.Node=Aa,t.OffscreenCanvasCreator=jo,t.Path=yo,t.PathUpdater=Uo,t.Plane=fa,t.Point=da,t.Polygon=xo,t.Polyline=bo,t.PolylineUpdater=Bo,t.RBush=r,t.Rect=So,t.RectUpdater=Fo,t.Rectangle=va,t.RenderingService=Xo,t.Text=Po,t.TextService=rs,t.TextUpdater=Vo,t.computeLinearGradient=function(t,e,n){var r=Kn(n.value),i=0+t/2,a=0+e/2,o=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*o/2,y1:a-Math.sin(r)*o/2,x2:i+Math.cos(r)*o/2,y2:a+Math.sin(r)*o/2}},t.computeRadialGradient=function(e,n,r,i,a){var o=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(o=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Xt([0,0],[o,s]),Xt([0,n],[o,s]),Xt([e,n],[o,s]),Xt([e,0],[o,s]));return a&&(a instanceof je?u=a.value:a instanceof Ie&&("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(Xt([0,0],[o,s]),Xt([0,n],[o,s]),Xt([e,n],[o,s]),Xt([e,0],[o,s]))))),{x:o,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var a=e.parsedStyle,o=a.r;r=Gr(o,o,a.cx,a.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Gr(s.rx,s.ry,s.cx,s.cy);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=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}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,l=u.width,c=u.height,h=u.x,f=u.y,p=u.radius,d=p&&p.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var a=i[0],o=i[1],s=i[2],u=i[3],l=t>0?1:-1,c=e>0?1:-1,h=l+c!==0?1:0;return[["M",l*a+n,r],["L",t-l*o+n,r],o?["A",o,o,0,0,h,t+n,c*o+r]:null,["L",t+n,e-c*s+r],s?["A",s,s,0,0,h,t+n-l*s,e+r]:null,["L",n+l*u,e+r],u?["A",u,u,0,0,h,n,e+r-c*u]:null,["L",n,c*a+r],a?["A",a,a,0,0,h,l*a+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"]]}(l,c,h,f,d&&p.map((function(t){return de(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))})));break;case t.Shape.PATH:r=[].concat(e.parsedStyle.path.absolutePath)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,a=void 0===i?0:i,o=r.defY,s=void 0===o?0:o;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=W(e[1]-a,e[2]-s,0);n&&tt(i,i,n),r=""+e[0]+i[0]+","+i[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=W(e[1]-a,e[2]-s,0),u=W(e[3]-a,e[4]-s,0),l=W(e[5]-a,e[6]-s,0);n&&(tt(o,o,n),tt(u,u,n),tt(l,l,n)),r=""+e[0]+o[0]+","+o[1]+","+u[0]+","+u[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var c=W(e[6]-a,e[7]-s,0);n&&tt(c,c,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+c[0]+","+c[1]}else if("Q"===e[0]){var h=W(e[1]-a,e[2]-s,0),f=W(e[3]-a,e[4]-s,0);n&&(tt(h,h,n),tt(f,f,n)),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"}return t+r}),"")}(r,e,n)},t.createVec3=qn,t.decompose=tr,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=Kn,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Un,t.fromRotationTranslationScale=Jn,t.getAngle=zn,t.getEuler=$n,t.getOrCalculatePathTotalLength=wr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=_n,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=ci,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=ja,t.isFederatedEvent=Pa,t.isFillOrStrokeAffected=function(t,e,n){var 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=li,t.mergeColors=fi,t.parseColor=hi,t.parseLength=di,t.parsePath=Oi,t.parseTransform=Bi,t.parsedTransformToMat4=ur,t.propertyMetadataCache=ko,t.rad2deg=Zn,t.resetEntityCounter=function(){Da=0},t.runtime=is,t.setDOMSize=function(t,e,n){_n&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,a,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===o&&(o=0);var s=t.map((function(s,u){var l=t[u+1],c=0===u&&(0!==r||0!==i),h=(u===t.length-1||l&&("M"===l[0]||"Z"===l[0]))&&0!==a&&0!==o;switch(s[0]){case"M":return c?"M "+(s[1]-e+r)+","+(s[2]-n+i)+" L "+(s[1]-e)+","+(s[2]-n):"M "+(s[1]-e)+","+(s[2]-n);case"L":return"L "+(s[1]-e+(h?a:0))+","+(s[2]-n+(h?o:0));case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+(h?" L "+(s[3]-e+a)+","+(s[4]-n+o):"");case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e)+" "+(s[6]-n)+(h?" L "+(s[5]-e+a)+","+(s[6]-n+o):"");case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e)+" "+(s[7]-n)+(h?" L "+(s[6]-e+a)+","+(s[7]-n+o):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=Qn,Object.defineProperty(t,"__esModule",{value:!0})}));