@antv/g-lite 1.0.21 → 1.0.23

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,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(a,Math.floor(r+(s-u)*l/s+h)),o)}var f=t[r],v=i,p=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);p>v;){for(n(t,v,p),v++,p--;0>o(t[v],f);)v++;for(;o(t[p],f)>0;)p--}0===o(t[i],f)?n(t,i,p):n(t,++p,a),p>r||(i=p+1),r>p||(a=p-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 c(t,e){return t.minX-e.minX}function l(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 v(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 p(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 d(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):d(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||d(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=[],c=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),o.leaf){var l=a(t,o.children,e);if(-1!==l)return o.children.splice(l,1),u.push(o),this._condense(u),this}i||o.leaf||!d(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(u.push(o),c.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),c=u*Math.ceil(Math.sqrt(s));m(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);m(t,l,h,u,this.compareMinY);for(var f=l;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],c=h(u),l=v(t,u)-c;a>l?(a=l,i=i>c?c:i,o=u):l===a&&i>c&&(i=c,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),c=s(t,o,n,this.toBBox),l=p(u,c),f=h(u)+h(c);i>l?(i=l,r=o,a=a>f?f:a):l===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,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),c=f(a)+f(o),l=e;n-e>l;l++){var h=t.children[l];u(a,t.leaf?i(h):h),c+=f(a)}for(var v=n-e-1;v>=e;v--){var p=t.children[v];u(o,t.leaf?i(p):p),c+=f(o)}return c},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){v(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 c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var a=Object.create((e&&e.prototype instanceof v?e:v).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=l;var f={};function v(){}function p(){}function d(){}var y={};c(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var k=d.prototype=v.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){c(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 c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(l).then((function(t){c.value=t,o(c)}),(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=T(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 T(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,T(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 w(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 S(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 p.prototype=d,r(k,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:p,configurable:!0}),p.displayName=c(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},x(E.prototype),c(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(l(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(k),c(k,u,"Generator"),c(k,a,(function(){return this})),c(k,"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=S,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(w),!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),w(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;w(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(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 c(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 l(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,N(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 v(t,e,n){return(e=N(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(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 d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(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 k(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)}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=d(t);if(e){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return k(this,n)}}function E(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=d(t)););return t}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=E(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},b.apply(this,arguments)}function T(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,c=!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){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(t,e)||w(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 M(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||w(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 w(t,e){if(t){if("string"==typeof t)return P(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)?P(t,e):void 0}}function P(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 S(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=w(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 N(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 C=1e-6,A="undefined"!=typeof Float32Array?Float32Array:Array;function O(){var t=new A(9);return A!=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 R(){var t=new A(16);return A!=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 L(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 I(t,e,n,r,i,a,o,s,u,c,l,h,f,v,p,d,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]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=v,t[13]=p,t[14]=d,t[15]=y,t}function _(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 D(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 U(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],v=e[11],p=e[12],d=e[13],y=e[14],g=e[15],m=n*s-r*o,k=n*u-i*o,x=n*c-a*o,E=r*u-i*s,b=r*c-a*s,T=i*c-a*u,M=l*d-h*p,w=l*y-f*p,P=l*g-v*p,S=h*y-f*d,N=h*g-v*d,C=f*g-v*y,A=m*C-k*N+x*S+E*P-b*w+T*M;return A?(t[0]=(s*C-u*N+c*S)*(A=1/A),t[1]=(i*N-r*C-a*S)*A,t[2]=(d*T-y*b+g*E)*A,t[3]=(f*b-h*T-v*E)*A,t[4]=(u*P-o*C-c*w)*A,t[5]=(n*C-i*P+a*w)*A,t[6]=(y*x-p*T-g*k)*A,t[7]=(l*T-f*x+v*k)*A,t[8]=(o*N-s*P+c*M)*A,t[9]=(r*P-n*N-a*M)*A,t[10]=(p*b-d*x+g*m)*A,t[11]=(h*x-l*b-v*m)*A,t[12]=(s*w-o*S-u*M)*A,t[13]=(n*S-r*w+i*M)*A,t[14]=(d*k-p*E-y*m)*A,t[15]=(l*E-h*k+f*m)*A,t):null}function G(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],c=t[8],l=t[9],h=t[10],f=t[11],v=t[12],p=t[13],d=t[14],y=t[15];return(e*o-n*a)*(h*y-f*d)-(e*s-r*a)*(l*y-f*p)+(e*u-i*a)*(l*d-h*p)+(n*s-r*o)*(c*y-f*v)-(n*u-i*o)*(c*d-h*v)+(r*u-i*s)*(c*p-l*v)}function B(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],v=e[10],p=e[11],d=e[12],y=e[13],g=e[14],m=e[15],k=n[0],x=n[1],E=n[2],b=n[3];return t[0]=k*r+x*s+E*h+b*d,t[1]=k*i+x*u+E*f+b*y,t[2]=k*a+x*c+E*v+b*g,t[3]=k*o+x*l+E*p+b*m,t[4]=(k=n[4])*r+(x=n[5])*s+(E=n[6])*h+(b=n[7])*d,t[5]=k*i+x*u+E*f+b*y,t[6]=k*a+x*c+E*v+b*g,t[7]=k*o+x*l+E*p+b*m,t[8]=(k=n[8])*r+(x=n[9])*s+(E=n[10])*h+(b=n[11])*d,t[9]=k*i+x*u+E*f+b*y,t[10]=k*a+x*c+E*v+b*g,t[11]=k*o+x*l+E*p+b*m,t[12]=(k=n[12])*r+(x=n[13])*s+(E=n[14])*h+(b=n[15])*d,t[13]=k*i+x*u+E*f+b*y,t[14]=k*a+x*c+E*v+b*g,t[15]=k*o+x*l+E*p+b*m,t}function F(t,e,n){var r,i,a,o,s,u,c,l,h,f,v,p,d=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*d+e[4]*y+e[8]*g+e[12],t[13]=e[1]*d+e[5]*y+e[9]*g+e[13],t[14]=e[2]*d+e[6]*y+e[10]*g+e[14],t[15]=e[3]*d+e[7]*y+e[11]*g+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],v=e[10],p=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=v,t[11]=p,t[12]=r*d+s*y+h*g+e[12],t[13]=i*d+u*y+f*g+e[13],t[14]=a*d+c*y+v*g+e[14],t[15]=o*d+l*y+p*g+e[15]),t}function V(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 j(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=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+c*r,t[5]=o*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-a*r,t[9]=l*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function Y(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],c=e[8],l=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-c*r,t[1]=o*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+c*i,t[9]=o*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function H(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 X(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,c=a+a,l=r*s,h=r*u,f=r*c,v=i*u,p=i*c,d=a*c,y=o*s,g=o*u,m=o*c;return t[0]=1-(v+d),t[1]=h+m,t[2]=f-g,t[3]=0,t[4]=h-m,t[5]=1-(l+d),t[6]=p+y,t[7]=0,t[8]=f+g,t[9]=p-y,t[10]=1-(l+v),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function W(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function z(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 q(t,e){var n=new A(3);z(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,c=e[4]*r,l=e[5]*i,h=e[6]*a,f=e[8]*r,v=e[9]*i,p=e[10]*a,d=o+l+p,y=0;return d>0?(t[3]=.25*(y=2*Math.sqrt(d+1)),t[0]=(h-v)/y,t[1]=(f-u)/y,t[2]=(s-c)/y):o>l&&o>p?(t[3]=(h-v)/(y=2*Math.sqrt(1+o-l-p)),t[0]=.25*y,t[1]=(s+c)/y,t[2]=(f+u)/y):l>p?(t[3]=(f-u)/(y=2*Math.sqrt(1+l-o-p)),t[0]=(s+c)/y,t[1]=.25*y,t[2]=(h+v)/y):(t[3]=(s-c)/(y=2*Math.sqrt(1+p-o-l)),t[0]=(f+u)/y,t[1]=(h+v)/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],c=a+a,l=o+o,h=s+s,f=a*c,v=a*l,p=a*h,d=o*l,y=o*h,g=s*h,m=u*c,k=u*l,x=u*h,E=r[0],b=r[1],T=r[2],M=i[0],w=i[1],P=i[2],S=(1-(d+g))*E,N=(v+x)*E,C=(p-k)*E,A=(v-x)*b,O=(1-(f+g))*b,R=(y+m)*b,L=(p+k)*T,I=(y-m)*T,_=(1-(f+d))*T;return t[0]=S,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=_,t[11]=0,t[12]=n[0]+M-(S*M+A*w+L*P),t[13]=n[1]+w-(N*M+O*w+I*P),t[14]=n[2]+P-(C*M+R*w+_*P),t[15]=1,t}function K(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,c=n*o,l=r*o,h=r*s,f=i*o,v=i*s,p=i*u,d=a*o,y=a*s,g=a*u;return t[0]=1-h-p,t[1]=l+g,t[2]=f-y,t[3]=0,t[4]=l-g,t[5]=1-c-p,t[6]=v+d,t[7]=0,t[8]=f+y,t[9]=v-d,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Q(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 J(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),c=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*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*c,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 $=J;function tt(t,e,n,r){var i,a,o,s,u,c,l,h,f,v,p=e[0],d=e[1],y=e[2],g=r[0],m=r[1],k=r[2],x=n[0],E=n[1],b=n[2];return C>Math.abs(p-x)&&C>Math.abs(d-E)&&C>Math.abs(y-b)?_(t):(v=1/Math.hypot(l=p-x,h=d-E,f=y-b),(v=Math.hypot(i=m*(f*=v)-k*(h*=v),a=k*(l*=v)-g*f,o=g*h-m*l))?(i*=v=1/v,a*=v,o*=v):(i=0,a=0,o=0),(v=Math.hypot(s=h*o-f*a,u=f*i-l*o,c=l*a-h*i))?(s*=v=1/v,u*=v,c*=v):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*p+a*d+o*y),t[13]=-(s*p+u*d+c*y),t[14]=-(l*p+h*d+f*y),t[15]=1,t)}function et(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 nt=Object.freeze({__proto__:null,create:R,clone:function(t){var e=new A(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:L,fromValues:function(t,e,n,r,i,a,o,s,u,c,l,h,f,v,p,d){var y=new A(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]=c,y[10]=l,y[11]=h,y[12]=f,y[13]=v,y[14]=p,y[15]=d,y},set:I,identity:_,transpose:D,invert:U,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],c=e[7],l=e[8],h=e[9],f=e[10],v=e[11],p=e[12],d=e[13],y=e[14],g=e[15];return t[0]=s*(f*g-v*y)-h*(u*g-c*y)+d*(u*v-c*f),t[1]=-(r*(f*g-v*y)-h*(i*g-a*y)+d*(i*v-a*f)),t[2]=r*(u*g-c*y)-s*(i*g-a*y)+d*(i*c-a*u),t[3]=-(r*(u*v-c*f)-s*(i*v-a*f)+h*(i*c-a*u)),t[4]=-(o*(f*g-v*y)-l*(u*g-c*y)+p*(u*v-c*f)),t[5]=n*(f*g-v*y)-l*(i*g-a*y)+p*(i*v-a*f),t[6]=-(n*(u*g-c*y)-o*(i*g-a*y)+p*(i*c-a*u)),t[7]=n*(u*v-c*f)-o*(i*v-a*f)+l*(i*c-a*u),t[8]=o*(h*g-v*d)-l*(s*g-c*d)+p*(s*v-c*h),t[9]=-(n*(h*g-v*d)-l*(r*g-a*d)+p*(r*v-a*h)),t[10]=n*(s*g-c*d)-o*(r*g-a*d)+p*(r*c-a*s),t[11]=-(n*(s*v-c*h)-o*(r*v-a*h)+l*(r*c-a*s)),t[12]=-(o*(h*y-f*d)-l*(s*y-u*d)+p*(s*f-u*h)),t[13]=n*(h*y-f*d)-l*(r*y-i*d)+p*(r*f-i*h),t[14]=-(n*(s*y-u*d)-o*(r*y-i*d)+p*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+l*(r*u-i*s),t},determinant:G,multiply:B,translate:F,scale:V,rotate:function(t,e,n,r){var i,a,o,s,u,c,l,h,f,v,p,d,y,g,m,k,x,E,b,T,M,w,P,S,N=r[0],A=r[1],O=r[2],R=Math.hypot(N,A,O);return C>R?null:(N*=R=1/R,A*=R,O*=R,i=Math.sin(n),u=e[1],c=e[2],l=e[3],f=e[5],v=e[6],p=e[7],y=e[9],g=e[10],m=e[11],b=N*A*(o=1-(a=Math.cos(n)))-O*i,T=A*A*o+a,M=O*A*o+N*i,w=N*O*o+A*i,P=A*O*o-N*i,S=O*O*o+a,t[0]=(s=e[0])*(k=N*N*o+a)+(h=e[4])*(x=A*N*o+O*i)+(d=e[8])*(E=O*N*o-A*i),t[1]=u*k+f*x+y*E,t[2]=c*k+v*x+g*E,t[3]=l*k+p*x+m*E,t[4]=s*b+h*T+d*M,t[5]=u*b+f*T+y*M,t[6]=c*b+v*T+g*M,t[7]=l*b+p*T+m*M,t[8]=s*w+h*P+d*S,t[9]=u*w+f*P+y*S,t[10]=c*w+v*P+g*S,t[11]=l*w+p*P+m*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:j,rotateY:Y,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],c=e[4],l=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+c*r,t[1]=o*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-a*r,t[5]=l*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:H,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],c=Math.hypot(o,s,u);return C>c?null:(o*=c=1/c,s*=c,u*=c,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:X,fromQuat2:function(t,e){var n=new A(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=r*r+i*i+a*a+o*o;return h>0?(n[0]=2*(s*o+l*r+u*a-c*i)/h,n[1]=2*(u*o+l*i+c*r-s*a)/h,n[2]=2*(c*o+l*a+s*i-u*r)/h):(n[0]=2*(s*o+l*r+u*a-c*i),n[1]=2*(u*o+l*i+c*r-s*a),n[2]=2*(c*o+l*a+s*i-u*r)),X(t,e,n),t},getTranslation:W,getScaling:z,getRotation:q,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,c=a+a,l=o+o,h=i*u,f=i*c,v=i*l,p=a*c,d=a*l,y=o*l,g=s*u,m=s*c,k=s*l,x=r[0],E=r[1],b=r[2];return t[0]=(1-(p+y))*x,t[1]=(f+k)*x,t[2]=(v-m)*x,t[3]=0,t[4]=(f-k)*E,t[5]=(1-(h+y))*E,t[6]=(d+g)*E,t[7]=0,t[8]=(v+m)*b,t[9]=(d-g)*b,t[10]=(1-(h+p))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Z,fromQuat:K,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),c=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)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Q,perspective:Q,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),c=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*c*.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:J,ortho:$,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),c=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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*c,t[15]=1,t},lookAt:tt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=a-n[1],f=o-n[2],v=l*l+h*h+f*f;v>0&&(l*=v=1/Math.sqrt(v),h*=v,f*=v);var p=u*f-c*h,d=c*l-s*f,y=s*h-u*l;return(v=p*p+d*d+y*y)>0&&(p*=v=1/Math.sqrt(v),d*=v,y*=v),t[0]=p,t[1]=d,t[2]=y,t[3]=0,t[4]=h*y-f*d,t[5]=f*p-l*y,t[6]=l*d-h*p,t[7]=0,t[8]=l,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:et,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],c=t[7],l=t[8],h=t[9],f=t[10],v=t[11],p=t[12],d=t[13],y=t[14],g=t[15],m=e[0],k=e[1],x=e[2],E=e[3],b=e[4],T=e[5],M=e[6],w=e[7],P=e[8],S=e[9],N=e[10],A=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-m)>C*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-k)>C*Math.max(1,Math.abs(r),Math.abs(k))||Math.abs(i-x)>C*Math.max(1,Math.abs(i),Math.abs(x))||Math.abs(a-E)>C*Math.max(1,Math.abs(a),Math.abs(E))||Math.abs(o-b)>C*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(s-T)>C*Math.max(1,Math.abs(s),Math.abs(T))||Math.abs(u-M)>C*Math.max(1,Math.abs(u),Math.abs(M))||Math.abs(c-w)>C*Math.max(1,Math.abs(c),Math.abs(w))||Math.abs(l-P)>C*Math.max(1,Math.abs(l),Math.abs(P))||Math.abs(h-S)>C*Math.max(1,Math.abs(h),Math.abs(S))||Math.abs(f-N)>C*Math.max(1,Math.abs(f),Math.abs(N))||Math.abs(v-A)>C*Math.max(1,Math.abs(v),Math.abs(A))||Math.abs(p-O)>C*Math.max(1,Math.abs(p),Math.abs(O))||Math.abs(d-R)>C*Math.max(1,Math.abs(d),Math.abs(R))||Math.abs(y-L)>C*Math.max(1,Math.abs(y),Math.abs(L))||Math.abs(g-I)>C*Math.max(1,Math.abs(g),Math.abs(I)))},mul:B,sub:et});function rt(){var t=new A(3);return A!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function it(t){var e=new A(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function at(t){return Math.hypot(t[0],t[1],t[2])}function ot(t,e,n){var r=new A(3);return r[0]=t,r[1]=e,r[2]=n,r}function st(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ut(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ct(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function lt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ht(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function ft(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 vt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pt(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 dt(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 yt(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],c=i*u-a*s,l=a*o-r*u,h=r*s-i*o,f=i*h-a*l,v=a*c-r*h,p=r*l-i*c,d=2*n[3];return l*=d,h*=d,v*=2,p*=2,t[0]=o+(c*=d)+(f*=2),t[1]=s+l+v,t[2]=u+h+p,t}function gt(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return C*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&C*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)&&C*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var mt,kt=lt,xt=at;mt=rt();function Et(){var t=new A(4);return A!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function bt(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=Et()}();function Tt(){var t=new A(4);return A!=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 wt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+o*s+i*c-a*u,t[1]=i*l+o*u+a*s-r*c,t[2]=a*l+o*c+r*u-i*s,t[3]=o*l-r*s-i*u-a*c,t}function Pt(t,e,n,r){var i,a,o,s,u,c=e[0],l=e[1],h=e[2],f=e[3],v=n[0],p=n[1],d=n[2],y=n[3];return 0>(a=c*v+l*p+h*d+f*y)&&(a=-a,v=-v,p=-p,d=-d,y=-y),1-a>C?(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*c+u*v,t[1]=s*l+u*p,t[2]=s*h+u*d,t[3]=s*f+u*y,t}function St(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 Nt(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),c=Math.sin(r),l=Math.cos(r);return t[0]=a*u*l-o*s*c,t[1]=o*s*l+a*u*c,t[2]=o*u*c-a*s*l,t[3]=o*u*l+a*s*c,t}var Ct,At,Ot,Rt,Lt,It,_t=function(t,e,n,r){var i=new A(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Dt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ut=wt,Gt=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};Ct=rt(),At=ot(1,0,0),Ot=ot(0,1,0),Rt=Tt(),Lt=Tt(),It=O();function Bt(t,e){var n=new A(2);return n[0]=t,n[1]=e,n}!function(){var t,e=(t=new A(2),A!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Ft(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var Vt=function(){return Vt=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},Vt.apply(this,arguments)},jt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Yt(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 Ht={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ht[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Wt(t){return Xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function zt(t){return Wt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function qt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ht[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,Ht[n]))),Ht[n]););}function Zt(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 Kt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Qt(t){return t>=48&&57>=t}function Jt(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,c=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Qt(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Qt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>a&&Qt(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(c=!0,a+=1;Qt(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(c&&!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||!Qt(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid integer exponent');for(;n>a&&Qt(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 $t(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 te(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=Ht[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,$t(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?Jt(t):Zt(t),t.err.length)return;t.data.push(t.param),$t(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,$t(t))}if(t.index>=t.max)break;if(!Kt(n.charCodeAt(t.index)))break}qt(t)}else qt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var ee=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 ne(t){if(Wt(t))return Ft(t);var e=function(t){if(Xt(t))return Ft(t);var e=new ee(t);for($t(e);e.max>e.index&&!e.err.length;)te(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 c=o.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(o);var l=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[l-2],r=e[l-1],"M"===u&&(i=n,a=r)}return e}))}function re(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 c=2*r-a,l=2*i-o;e.x1=c,e.y1=l,u=["C",c,l].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 v=s[1];e.qx=s[0],e.qy=v}return u}function ie(t){if(zt(t))return Ft(t);for(var e=ne(t),n=Vt({},jt),r=0;e.length>r;r+=1){e[r]=re(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 ae(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function oe(t,e,n,r,i,a,o,s,u,c){var l,h,f,v,p,d=t,y=e,g=n,m=r,k=s,x=u,E=120*Math.PI/180,b=Math.PI/180*(+i||0),T=[];if(c)h=c[0],f=c[1],v=c[2],p=c[3];else{y=(l=ae(d,y,-b)).y;var M=((d=l.x)-(k=(l=ae(k,x,-b)).x))/2,w=(y-(x=l.y))/2,P=M*M/(g*g)+w*w/(m*m);P>1&&(g*=P=Math.sqrt(P),m*=P);var S=g*g,N=m*m,C=(a===o?-1:1)*Math.sqrt(Math.abs((S*N-S*w*w-N*M*M)/(S*w*w+N*M*M)));v=C*g*w/m+(d+k)/2,h=Math.asin(((y-(p=C*-m*M/g+(y+x)/2))/m*1e9>>0)/1e9),f=Math.asin(((x-p)/m*1e9>>0)/1e9),0>(h=v>d?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=v>k?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,R=k,L=x;T=oe(k=v+g*Math.cos(f=h+E*(o&&f>h?1:-1)),x=p+m*Math.sin(f),g,m,i,0,o,R,L,[f,O,v,p])}A=f-h;var I=Math.cos(h),_=Math.sin(h),D=Math.cos(f),U=Math.sin(f),G=Math.tan(A/4),B=4/3*g*G,F=4/3*m*G,V=[d,y],j=[d+B*_,y-F*I],Y=[k+B*U,x-F*D],H=[k,x];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,H,T);for(var X=[],W=0,z=(T=j.concat(Y,H,T)).length;z>W;W+=1)X[W]=W%2?ae(T[W-1],T[W],b).y:ae(T[W],T[W+1],b).x;return X}function se(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ue(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ce(t,e,n,r,i){var a=ue([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=se([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 le(t,e,n,r){var i=.5,a=[t,e],o=[n,r],s=se(a,o,i),u=se(o,s,i),c=se(s,u,i),l=se(u,c,i),h=se(c,l,i),f=ce(a[0],a[1],s[0],s[1],c[0]).point,v=ce(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,v.x,v.y,n,r]}function he(t,e){var n,r,i,a,o,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],v=e.x1,p=e.y1,d=e.x,y=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[v,p].concat(l),["C"].concat(oe(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=[v,p].concat(l),["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(le(v,p,h,f));case"Z":return v===d&&p===y?["C",v,p,d,y,d,y]:["C"].concat(le(v,p,d,y))}return t}function fe(t,e){if(void 0===e&&(e=!1),function(t){return zt(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=Ft(t);return e?[n,[]]:n}for(var r,i,a=ie(t),o=Vt({},jt),s=[],u="",c=a.length,l=[],h=0;c>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=he(a[h],o);a[h]=f,Yt(a,s,h),c=a.length,"Z"===u&&l.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,l]:a}function ve(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 pe(t,e,n,r,i,a,o,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,v=Math.sqrt,p=Math.PI,d=l(n),y=l(r),g=(i%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===d||0===y)return ce(t,e,s,u,c).point;var m=(t-s)/2,k=(e-u)/2,x={x:f(g)*m+h(g)*k,y:-h(g)*m+f(g)*k},E=Math.pow(x.x,2)/Math.pow(d,2)+Math.pow(x.y,2)/Math.pow(y,2);E>1&&(d*=v(E),y*=v(E));var b=(Math.pow(d,2)*Math.pow(y,2)-Math.pow(d,2)*Math.pow(x.y,2)-Math.pow(y,2)*Math.pow(x.x,2))/(Math.pow(d,2)*Math.pow(x.y,2)+Math.pow(y,2)*Math.pow(x.x,2)),T=(a!==o?1:-1)*v(b=0>b?0:b),M=T*(d*x.y/y),w=T*(-y*x.x/d),P=f(g)*M-h(g)*w+(t+s)/2,S=h(g)*M+f(g)*w+(e+u)/2,N={x:(x.x-M)/d,y:(x.y-w)/y},C=ve({x:1,y:0},N),A=ve(N,{x:(-x.x-M)/d,y:(-x.y-w)/y});!o&&A>0?A-=2*p:o&&0>A&&(A+=2*p);var O=C+(A%=2*p)*c,R=d*f(O),L=y*h(O);return{x:f(g)*R-h(g)*L+P,y:h(g)*R+f(g)*L+S}}function de(t,e,n,r,i,a,o,s,u,c,l){var h,f=l.bbox,v=void 0===f||f,p=l.length,d=void 0===p||p,y=l.sampleSize,g=void 0===y?30:y,m="number"==typeof c,k=t,x=e,E=0,b=[k,x,E],T=[k,x],M={x:0,y:0},w=[{x:k,y:x}];m&&0>=c&&(M={x:k,y:x});for(var P=0;g>=P;P+=1){if(k=(h=pe(t,e,n,r,i,a,o,s,u,P/g)).x,x=h.y,v&&w.push({x:k,y:x}),d&&(E+=ue(T,[k,x])),T=[k,x],m&&E>=c&&c>b[2]){var S=(E-c)/(E-b[2]);M={x:T[0]*(1-S)+b[0]*S,y:T[1]*(1-S)+b[1]*S}}b=[k,x,E]}return m&&c>=E&&(M={x:s,y:u}),{length:E,point:M,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function ye(t,e,n,r,i,a,o,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*a+Math.pow(u,3)*s}}function ge(t,e,n,r,i,a,o,s,u,c){var l,h=c.bbox,f=void 0===h||h,v=c.length,p=void 0===v||v,d=c.sampleSize,y=void 0===d?10:d,g="number"==typeof u,m=t,k=e,x=0,E=[m,k,x],b=[m,k],T={x:0,y:0},M=[{x:m,y:k}];g&&0>=u&&(T={x:m,y:k});for(var w=0;y>=w;w+=1){if(m=(l=ye(t,e,n,r,i,a,o,s,w/y)).x,k=l.y,f&&M.push({x:m,y:k}),p&&(x+=ue(b,[m,k])),b=[m,k],g&&x>=u&&u>E[2]){var P=(x-u)/(x-E[2]);T={x:b[0]*(1-P)+E[0]*P,y:b[1]*(1-P)+E[1]*P}}E=[m,k,x]}return g&&u>=x&&(T={x:o,y:s}),{length:x,point:T,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 me(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 ke(t,e,n,r,i,a,o,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,v=s.sampleSize,p=void 0===v?10:v,d="number"==typeof o,y=t,g=e,m=0,k=[y,g,m],x=[y,g],E={x:0,y:0},b=[{x:y,y:g}];d&&0>=o&&(E={x:y,y:g});for(var T=0;p>=T;T+=1){if(y=(u=me(t,e,n,r,i,a,T/p)).x,g=u.y,l&&b.push({x:y,y:g}),f&&(m+=ue(x,[y,g])),x=[y,g],d&&m>=o&&o>k[2]){var M=(m-o)/(m-k[2]);E={x:x[0]*(1-M)+k[0]*M,y:x[1]*(1-M)+k[1]*M}}k=[y,g,m]}return d&&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 xe(t,e,n){for(var r,i,a,o,s,u,c,l,h,f=ie(t),v="number"==typeof e,p=[],d=0,y=0,g=0,m=0,k=[],x=[],E=0,b={x:0,y:0},T=b,M=b,w=b,P=0,S=0,N=f.length;N>S;S+=1)p=(c="M"===(l=(h=f[S])[0]))?p:[d,y].concat(h.slice(1)),c?(T=b={x:g=h[1],y:m=h[2]},E=0,v&&.001>e&&(w=b)):"L"===l?(E=(r=ce(p[0],p[1],p[2],p[3],(e||0)-P)).length,b=r.min,T=r.max,M=r.point):"A"===l?(E=(i=de(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-P,n||{})).length,b=i.min,T=i.max,M=i.point):"C"===l?(E=(a=ge(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-P,n||{})).length,b=a.min,T=a.max,M=a.point):"Q"===l?(E=(o=ke(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-P,n||{})).length,b=o.min,T=o.max,M=o.point):"Z"===l&&(E=(s=ce((p=[d,y,g,m])[0],p[1],p[2],p[3],(e||0)-P)).length,b=s.min,T=s.max,M=s.point),v&&e>P&&P+E>=e&&(w=M),x.push(T),k.push(b),P+=E,d=(u="Z"!==l?h.slice(-2):[g,m])[0],y=u[1];return v&&e>=P&&(w={x:d,y:y}),{length:P,point:w,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Ee(t){return function(t){var e=0,n=0,r=0;return fe(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,c,l,h,f,v=t.slice(1);return r=3*(((f=v[5])-(o=n))*((s=v[0])+(c=v[2]))-((h=v[4])-(a=e))*((u=v[1])+(l=v[3]))+u*(a-c)-s*(o-l)+f*(c+a/3)-h*(l+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 be(t,e,n){return xe(t,e,Vt(Vt({},n),{bbox:!1,length:!0})).point}function Te(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?ge(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=se(n,r,e),s=se(r,i,e),u=se(i,a,e),c=se(o,s,e),l=se(s,u,e),h=se(c,l,e);return[["C"].concat(o,c,h),["C"].concat(l,u,a)]}(r):[t,t]:[t],l:i}}))}function Me(t,e,n){var r=Te(t),i=Te(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,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=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=[c,l],v=[h-a,h-o],p=0,d=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return v[e]-=(p=n&&v[e]&&t.l>=f[e])?1:0,p?t.ss:[t.s]})).flat()}));return d[0].length===d[1].length?d:Me(d[0],d[1],h)}var we=function(t){return null==t},Pe={}.toString,Se=function(t,e){return Pe.call(t)==="[object "+e+"]"},Ne=function(t){return Array.isArray?Array.isArray(t):Se(t,"Array")},Ce=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},Ae=function(t){if(Ne(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Oe=function(t){if(Ne(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},Re=function(t){return Se(t,"String")},Le=function(t,e,n){return e>t?e:t>n?n:t},Ie=function(t){return Se(t,"Number")};var _e,De=function(t,e){return(t%e+e)%e},Ue=function(t){return Se(t,"Boolean")},Ge=function(t){return void 0===t},Be=function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var a=e?e.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=t.apply(this,r);return o.set(a,s),s};return n.cache=new Map,n},Fe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];l(this,t),this.center=rt(),this.halfExtents=rt(),this.min=rt(),this.max=rt(),this.update(e,n)}return f(t,[{key:"update",value:function(t,e){st(this.center,t),st(this.halfExtents,e),kt(this.min,this.center,this.halfExtents),ct(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){ct(this.center,e,t),ht(this.center,this.center,.5),kt(this.halfExtents,e,t),ht(this.halfExtents,this.halfExtents,.5),st(this.min,t),st(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],c=o[2],l=r-s,h=r+s,f=i-u,v=i+u,p=a-c,d=a+c,y=e.center,g=y[0],m=y[1],k=y[2],x=e.halfExtents,E=x[0],b=x[1],T=x[2],M=g-E,w=g+E,P=m-b,S=m+b,N=k-T,C=k+T;l>M&&(l=M),w>h&&(h=w),f>P&&(f=P),S>v&&(v=S),p>N&&(p=N),C>d&&(d=C),n[0]=.5*(l+h),n[1]=.5*(f+v),n[2]=.5*(p+d),o[0]=.5*(h-l),o[1]=.5*(v-f),o[2]=.5*(d-p),this.min[0]=l,this.min[1]=f,this.min[2]=p,this.max[0]=h,this.max[1]=v,this.max[2]=d}}},{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],c=e[1],l=e[5],h=e[9],f=e[2],v=e[6],p=e[10],d=Math.abs(o),y=Math.abs(s),g=Math.abs(u),m=Math.abs(c),k=Math.abs(l),x=Math.abs(h),E=Math.abs(f),b=Math.abs(v),T=Math.abs(p);ut(n,e[12]+o*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+f*i[0]+v*i[1]+p*i[2]),ut(r,d*a[0]+y*a[1]+g*a[2],m*a[0]+k*a[1]+x*a[2],E*a[0]+b*a[1]+T*a[2]),this.min=kt(this.min,n,r),this.max=ct(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=rt(),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}(rt(),this.getMax(),e.getMax());return a.setMinMax(o,s),a}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?st(rt(),this.min):272===t.pnVertexFlag?ot(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?ot(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?ot(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?ot(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?ot(this.max[0],this.min[1],this.max[2]):ot(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?st(rt(),this.max):272===t.pnVertexFlag?ot(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?ot(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?ot(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?ot(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?ot(this.min[0],this.max[1],this.min[2]):ot(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}]),t}(),Ve=function(){function t(e,n){l(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||ot(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 vt(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/xt(this.normal);ht(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&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}();(_e=t.Mask||(t.Mask={}))[_e.OUTSIDE=4294967295]="OUTSIDE",_e[_e.INSIDE=0]="INSIDE",_e[_e.INDETERMINATE=2147483647]="INDETERMINATE";var je,Ye=function(){function t(e){if(l(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new Ve)}return f(t,[{key:"extractFromVPMatrix",value:function(t){var e=T(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],v=e[11],p=e[12],d=e[13],y=e[14],g=e[15];ut(this.planes[0].normal,a-n,c-o,v-l),this.planes[0].distance=g-p,ut(this.planes[1].normal,a+n,c+o,v+l),this.planes[1].distance=g+p,ut(this.planes[2].normal,a+r,c+s,v+h),this.planes[2].distance=g+d,ut(this.planes[3].normal,a-r,c-s,v-h),this.planes[3].distance=g-d,ut(this.planes[4].normal,a-i,c-u,v-f),this.planes[4].distance=g-y,ut(this.planes[5].normal,a+i,c+u,v+f),this.planes[5].distance=g+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}(),He=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;l(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}(),Xe=function(){function t(e,n,r,i){l(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}();(je=t.Shape||(t.Shape={})).GROUP="g",je.CIRCLE="circle",je.ELLIPSE="ellipse",je.IMAGE="image",je.RECT="rect",je.LINE="line",je.POLYLINE="polyline",je.POLYGON="polygon",je.TEXT="text",je.PATH="path",je.HTML="html",je.MESH="mesh";var We=Be((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}));function ze(t){if(!t)throw Error()}function qe(t,e){if(t===e)throw Error()}function Ze(t){return"function"==typeof t}var Ke={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Qe=Be((function(t){var e=We(t),n=Ke[e];return e=(null==n?void 0:n.alias)||e})),Je={},$e=0;var tn="undefined"!=typeof window&&void 0!==window.document;function en(t,e){var n=Number(t.style.zIndex),r=Number(e.style.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 nn(t){var e=t;do{var n;if(null===(n=e.style)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function rn(t,e){if(tn)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var an,on,sn,un,cn,ln="Method not implemented.",hn="Use document.documentElement instead.",fn={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};(an=t.UnitType||(t.UnitType={}))[an.kUnknown=0]="kUnknown",an[an.kNumber=1]="kNumber",an[an.kPercentage=2]="kPercentage",an[an.kEms=3]="kEms",an[an.kPixels=4]="kPixels",an[an.kRems=5]="kRems",an[an.kDegrees=6]="kDegrees",an[an.kRadians=7]="kRadians",an[an.kGradians=8]="kGradians",an[an.kTurns=9]="kTurns",an[an.kMilliseconds=10]="kMilliseconds",an[an.kSeconds=11]="kSeconds",an[an.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"}(on||(on={})),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"}(sn||(sn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(un||(un={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(cn||(cn={}));var vn,pn=[{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"}(vn||(vn={}));var dn,yn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return pn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},gn=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},mn=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""},kn=function(){function e(){l(this,e)}return f(e,[{key:"toString",value:function(){return this.buildCSSText(un.kNo,cn.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=vn.kUnitType&&this.getType()<=vn.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}(),xn=function(t){p(n,t);var e=x(n);function n(t){var r;return l(this,n),(r=e.call(this)).colorSpace=void 0,r.colorSpace=t,r}return f(n,[{key:"getType",value:function(){return vn.kColorType}},{key:"to",value:function(t){return this}}]),n}(kn);(dn=t.GradientType||(t.GradientType={}))[dn.Constant=0]="Constant",dn[dn.LinearGradient=1]="LinearGradient",dn[dn.RadialGradient=2]="RadialGradient";var En,bn,Tn=function(t){p(n,t);var e=x(n);function n(t,r){var i;return l(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 vn.kColorType}}]),n}(kn),Mn=function(t){p(n,t);var e=x(n);function n(t){var r;return l(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 vn.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}]),n}(kn);function wn(e){switch(qe(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kPixels:case t.UnitType.kRems:return bn.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return bn.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return bn.kAngle;case t.UnitType.kPercentage:return bn.kPercent;default:return bn.kLength}}!function(t){t.kAdd="+",t.kSubtract="-",t.kMultiply="*",t.kDivide="/",t.kMin="min",t.kMax="max",t.kClamp="clamp",t.kInvalid=""}(En||(En={})),function(t){t[t.kLength=0]="kLength",t[t.kAngle=1]="kAngle",t[t.kTime=2]="kTime",t[t.kFrequency=3]="kFrequency",t[t.kResolution=4]="kResolution",t[t.kFlex=5]="kFlex",t[t.kPercent=6]="kPercent",t[t.kNumBaseTypes=7]="kNumBaseTypes"}(bn||(bn={}));var Pn=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.UnitType.kNumber,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;l(this,e),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=bn.kPercent,this.hasPercentHint=!1,this.exponents=Array(bn.kNumBaseTypes).fill(0),n!==t.UnitType.kNumber&&this.setExponent(wn(n),r)}return f(e,[{key:"applyPercentHint",value:function(t){qe(t,bn.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(bn.kPercent)),this.setExponent(bn.kPercent,0),this.percentHint=t,this.hasPercentHint=!0}},{key:"hasNonZeroEntries",value:function(){return this.numNonZeroEntries>0}},{key:"isOnlyNonZeroEntry",value:function(t,e){return qe(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e}},{key:"exponent",value:function(t){return this.exponents[t]}},{key:"setExponent",value:function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e}},{key:"matchesBaseType",value:function(t){return qe(t,bn.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint}},{key:"matchesPercentage",value:function(){return this.isOnlyNonZeroEntry(bn.kPercent,1)}},{key:"matchesBaseTypePercentage",value:function(t){return qe(t,bn.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(bn.kPercent,1)}},{key:"matchesNumber",value:function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint}},{key:"matchesNumberPercentage",value:function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(bn.kPercent,1)}}],[{key:"negateExponents",value:function(t){return t.exponents.forEach((function(t){return-1*t})),t}},{key:"add",value:function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint),function(t,e){if(t!==e)throw Error()}(t.percentHint,e.percentHint);for(var r=0;bn.kNumBaseTypes>r;++r){var i=r;if(t.exponents[r]!==e.exponents[r]&&(i!==bn.kPercent&&(t.applyPercentHint(i),e.applyPercentHint(i)),t.exponents[r]!==e.exponents[r]))return t}return t}},{key:"multiply",value:function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;bn.kNumBaseTypes>r;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}return t}}]),e}(),Sn=function(e){return"number"==typeof e?new _n(e,t.UnitType.kNumber):e},Nn=function(e){p(r,e);var n=x(r);function r(t){var e;return l(this,r),(e=n.call(this)).type_=void 0,e.type_=t,e}return f(r,[{key:"getType",value:function(){return vn.kUnknownType}},{key:"equals",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Cn(n);return i.every((function(e){return t.equals(e)}))}},{key:"add",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Cn(e);An(vn.kSumType,r,this);var i=Rn(r,En.kAdd);return i||Yn.create(r)}},{key:"sub",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Cn(e);r=r.map((function(t){return t.negate()})),An(vn.kSumType,r,this);var i=Rn(r,En.kAdd);return i||Yn.create(r)}},{key:"mul",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Cn(e);An(vn.kProductType,r,this);var i=Ln(r);return i||Hn.create(r)}},{key:"div",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Cn(e);r=r.map((function(t){return t.invert()})),An(vn.kProductType,r,this);var i=Ln(r);return i||Hn.create(r)}},{key:"min",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Cn(e);An(vn.kMinType,r,this);var i=Rn(r,En.kMin);return i||Vn.create(r)}},{key:"max",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Cn(e);An(vn.kMaxType,r,this);var i=Rn(r,En.kMax);return i||jn.create(r)}},{key:"to",value:function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=On(e[0]);return r?(n="string"==typeof t?yn(t):t,r.convertTo(n)):null}},{key:"toSum",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];for(var i=0,a=e;a.length>i;i++){var o=a[i];if(!r.isValidUnit(yn(o)))return null}var s=this.sumValue();if(!s.length)return null;var u,c=[],l=S(s);try{for(l.s();!(u=l.n()).done;){var h=u.value,f=On(h);if(!f)return null;c.push(f)}}catch(t){l.e(t)}finally{l.f()}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var v=Yn.create(c);return ze(!!v),v}for(var p=[],d=function(){var t=yn(g[y]);ze(r.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);p.push(new _n(e,t))},y=0,g=e;g.length>y;y++)d();if(c.some((function(t){return!!t})))throw Error("There were leftover terms that were not converted");return Yn.create(p)}},{key:"type",value:function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(bn.kLength);return e&&(t.length=e),(e=this.type_.exponent(bn.kAngle))&&(t.angle=e),(e=this.type_.exponent(bn.kTime))&&(t.time=e),(e=this.type_.exponent(bn.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(bn.kResolution))&&(t.resolution=e),(e=this.type_.exponent(bn.kFlex))&&(t.flex=e),(e=this.type_.exponent(bn.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case bn.kLength:return"length";case bn.kAngle:return"angle";case bn.kTime:return"time";case bn.kFrequency:return"frequency";case bn.kResolution:return"resolution";case bn.kFlex:return"flex";case bn.kPercent:return"percent"}return""}(this.type_.percentHint)),t}},{key:"negate",value:function(){return Gn.create(this)}},{key:"invert",value:function(){return Un.create(this)}}],[{key:"isValidUnit",value:function(e){return!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e))}}]),r}(kn);function Cn(t){return t.map(Sn)}function An(t,e,n){ze(!!n),n.getType()===t?e.unshift.apply(e,M(n.numericValues())):e.unshift(n)}function On(t){return 0===Object.keys(t.units).length?new _n(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new _n(t.value,Number(Object.keys(t.units)[0])):null}function Rn(t,e){ze(!!t.length);var n=t[0]instanceof _n?t[0]:null;if(!n)return null;for(var r=n.value,i=1;t.length>i;i++){var a=t[i]instanceof _n?t[i]:null;if(!a||a.unit!==n.unit)return null;e===En.kAdd?r+=a.value:e===En.kMax?r=Math.max(r,a.value):e===En.kMin&&(r=Math.min(r,a.value))}return new _n(r,n.unit)}function Ln(e){ze(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var a=e[i]instanceof _n?e[i]:null;if(!a)return null;if(a.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=a.unit}r*=a.value}return new _n(r,n)}var In=function(e){return function(e){switch(e){case on.kUNumber:return t.UnitType.kNumber;case on.kULength:return t.UnitType.kPixels;case on.kUPercent:return t.UnitType.kPercentage;case on.kUTime:return t.UnitType.kSeconds;case on.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return on.kUNumber;case t.UnitType.kPercentage:return on.kUPercent;case t.UnitType.kPixels:return on.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return on.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return on.kUAngle;default:return on.kUOther}}(e))},_n=function(e){p(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 l(this,r),a="string"==typeof o?yn(o):o,(i=n.call(this,new Pn(a))).unit=void 0,i.value=void 0,i.unit=a,i.value=e,i}return f(r,[{key:"clone",value:function(){return new r(this.value,this.unit)}},{key:"convertTo",value:function(e){if(this.unit===e)return new r(this.value,this.unit);var n=In(this.unit);if(n!==In(e)||n===t.UnitType.kUnknown)return null;var i=gn(this.unit)/gn(e);return new r(this.value*i,e)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return vn.kUnitType}},{key:"sumValue",value:function(){var e,n,r=[],i={};return this.unit!==t.UnitType.kNumber&&(i[(e=this.unit,n=In(e),n===t.UnitType.kUnknown?e:n)]=1),r.push({value:this.value*gn(this.unit),units:i}),r}},{key:"negate",value:function(){return new r(-this.value,this.unit)}},{key:"invert",value:function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new r(1/this.value,this.unit):Un.create(this)}},{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=mn(this.unit);if(-999999>a||a>999999){var s=mn(this.unit);i=!Number.isFinite(a)||Number.isNaN(a)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";return Number.isFinite(t)?(ze(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(a,s):a+(s||"")}else i="".concat(a).concat(o)}return r+=i}}]),r}(Nn),Dn=function(t){p(n,t);var e=x(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"isUnitValue",value:function(){return!1}}]),n}(Nn),Un=function(t){p(n,t);var e=x(n);function n(t,r){var i;return l(this,n),(i=e.call(this,r)).value=void 0,i.operator="invert",i.value=t,i}return f(n,[{key:"clone",value:function(){return new n(this.value,this.type_)}},{key:"getType",value:function(){return vn.kInvertType}},{key:"equals",value:function(t){return t.getType()===vn.kInvertType&&this.value.equals(t.value)}},{key:"sumValue",value:function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)}},{key:"buildCSSText",value:function(t,e,n){return e==cn.kNo&&(n+=t===un.kYes?"(":"calc("),n=this.value.buildCSSText(un.kYes,cn.kNo,n+="1 / "),e===cn.kNo&&(n+=")"),n}}],[{key:"create",value:function(t){return new n(t,Pn.negateExponents(t.type_))}}]),n}(Dn),Gn=function(t){p(n,t);var e=x(n);function n(t,r){var i;return l(this,n),(i=e.call(this,r)).value=void 0,i.operator="negate",i.value=t,i}return f(n,[{key:"clone",value:function(){return new n(this.value,this.type_)}},{key:"getType",value:function(){return vn.kNegateType}},{key:"equals",value:function(t){return t.getType()===vn.kNegateType&&this.value.equals(t.value)}},{key:"sumValue",value:function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)}},{key:"buildCSSText",value:function(t,e,n){return e==cn.kNo&&(n+=t===un.kYes?"(":"calc("),n=this.value.buildCSSText(un.kYes,cn.kNo,n+="-"),e===cn.kNo&&(n+=")"),n}}],[{key:"create",value:function(t){return new n(t,t.type_)}}]),n}(Dn);function Bn(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var Fn=function(t){p(n,t);var e=x(n);function n(t,r){var i;return l(this,n),(i=e.call(this,r)).values=void 0,i.values=t,i}return f(n,[{key:"numericValues",value:function(){return this.values}},{key:"equals",value:function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))}}]),n}(Dn),Vn=function(t){p(n,t);var e=x(n);function n(){var t;l(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))).operator="min",t}return f(n,[{key:"clone",value:function(){return new n(this.values,this.type_)}},{key:"getType",value:function(){return vn.kMinType}},{key:"sumValue",value:function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;var e,n=S(this.numericValues());try{for(n.s();!(e=n.n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}}catch(t){n.e(t)}finally{n.f()}return t}},{key:"buildCSSText",value:function(t,e,n){n+="min(";var r,i=!0,a=S(this.numericValues());try{for(a.s();!(r=a.n()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(un.kYes,cn.kYes,n)}}catch(t){a.e(t)}finally{a.f()}return n+=")"}}],[{key:"create",value:function(t){return new n(t,Bn(t,Pn.add))}}]),n}(Fn),jn=function(t){p(n,t);var e=x(n);function n(){var t;l(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))).operator="max",t}return f(n,[{key:"clone",value:function(){return new n(this.values,this.type_)}},{key:"getType",value:function(){return vn.kMaxType}},{key:"sumValue",value:function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;var e,n=S(this.numericValues());try{for(n.s();!(e=n.n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}}catch(t){n.e(t)}finally{n.f()}return t}},{key:"buildCSSText",value:function(t,e,n){n+="max(";var r,i=!0,a=S(this.numericValues());try{for(a.s();!(r=a.n()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(un.kYes,cn.kYes,n)}}catch(t){a.e(t)}finally{a.f()}return n+=")"}}],[{key:"create",value:function(t){return new n(t,Bn(t,Pn.add))}}]),n}(Fn),Yn=function(t){p(n,t);var e=x(n);function n(){var t;l(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))).operator="sum",t}return f(n,[{key:"clone",value:function(){return new n(this.values,this.type_)}},{key:"getType",value:function(){return vn.kSumType}},{key:"sumValue",value:function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(a({},e)):t[n].value+=e.value}))})),n.canCreateNumericTypeFromSumValue(t)?t:null}},{key:"buildCSSText",value:function(t,e,n){e==cn.kNo&&(n+=t===un.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(un.kYes,cn.kNo,n);for(var i=1;r.length>i;i++){var a=r[i];n=a.getType()===vn.kNegateType?a.value.buildCSSText(un.kYes,cn.kNo,n+=" - "):a.buildCSSText(un.kYes,cn.kNo,n+=" + ")}return e===cn.kNo&&(n+=")"),n}}],[{key:"create",value:function(t){return new n(t,Bn(t,Pn.add))}},{key:"numericTypeFromUnitMap",value:function(t){var e=new Pn;return Object.keys(t).forEach((function(n){var r=t[n];e=Pn.multiply(e,new Pn(Number(n),r),false),ze(!0)})),e}},{key:"canCreateNumericTypeFromSumValue",value:function(t){var e=this;ze(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Pn.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))}}]),n}(Fn),Hn=function(t){p(n,t);var e=x(n);function n(){var t;l(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))).operator="product",t}return f(n,[{key:"clone",value:function(){return new n(this.values,this.type_)}},{key:"getType",value:function(){return vn.kProductType}},{key:"sumValue",value:function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(e){var r=e.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(e){i.push({value:t.value*e.value,units:n.multiplyUnitMaps(t.units,e.units)})}))})),t=i})),t}},{key:"buildCSSText",value:function(t,e,n){e==cn.kNo&&(n+=t===un.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(un.kYes,cn.kNo,n);for(var i=1;r.length>i;i++){var a=r[i];n=a.getType()===vn.kInvertType?a.value.buildCSSText(un.kYes,cn.kNo,n+=" / "):a.buildCSSText(un.kYes,cn.kNo,n+=" * ")}return e===cn.kNo&&(n+=")"),n}}],[{key:"create",value:function(t){return new n(t,Bn(t,Pn.multiply))}},{key:"multiplyUnitMaps",value:function(t,e){return Object.keys(e).forEach((function(n){qe(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t}}]),n}(Fn),Xn=new _n(0,"px"),Wn=(new _n(1,"px"),new _n(0,"deg")),zn=function(t){p(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 l(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}(xn),qn={number:function(t){return new _n(t)},percent:function(t){return new _n(t,"%")},px:function(t){return new _n(t,"px")},em:function(t){return new _n(t,"em")},rem:function(t){return new _n(t,"rem")},deg:function(t){return new _n(t,"deg")},grad:function(t){return new _n(t,"grad")},rad:function(t){return new _n(t,"rad")},turn:function(t){return new _n(t,"turn")},s:function(t){return new _n(t,"s")},ms:function(t){return new _n(t,"ms")},registerProperty:function(t){hu.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){hu.layoutRegistry.registerLayout(t,e)}},Zn=new Mn("unset"),Kn=new Mn("initial"),Qn=new Mn("inherit"),Jn={"":Zn,unset:Zn,initial:Kn,inherit:Qn},$n=function(t){return Jn[t]||(Jn[t]=new Mn(t)),Jn[t]},tr=new zn(0,0,0,0,!0),er=new zn(0,0,0,0),nr=Be((function(t,e,n,r){return new zn(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),rr=Be((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.UnitType.kNumber;return new _n(e,n)}),(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.UnitType.kNumber;return"".concat(e).concat(n)}));function ir(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ar(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function or(){}var sr=.7,ur=1/sr,cr="\\s*([+-]?\\d+)\\s*",lr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",hr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fr=/^#([0-9a-f]{3,8})$/,vr=RegExp("^rgb\\("+[cr,cr,cr]+"\\)$"),pr=RegExp("^rgb\\("+[hr,hr,hr]+"\\)$"),dr=RegExp("^rgba\\("+[cr,cr,cr,lr]+"\\)$"),yr=RegExp("^rgba\\("+[hr,hr,hr,lr]+"\\)$"),gr=RegExp("^hsl\\("+[lr,hr,hr]+"\\)$"),mr=RegExp("^hsla\\("+[lr,hr,hr,lr]+"\\)$"),kr={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 xr(){return this.rgb().formatHex()}function Er(){return this.rgb().formatRgb()}function br(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=fr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Tr(e):3===n?new Pr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Mr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Mr(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=vr.exec(t))?new Pr(e[1],e[2],e[3],1):(e=pr.exec(t))?new Pr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=dr.exec(t))?Mr(e[1],e[2],e[3],e[4]):(e=yr.exec(t))?Mr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=gr.exec(t))?Ar(e[1],e[2]/100,e[3]/100,1):(e=mr.exec(t))?Ar(e[1],e[2]/100,e[3]/100,e[4]):kr.hasOwnProperty(t)?Tr(kr[t]):"transparent"===t?new Pr(NaN,NaN,NaN,0):null}function Tr(t){return new Pr(t>>16&255,t>>8&255,255&t,1)}function Mr(t,e,n,r){return r>0||(t=e=n=NaN),new Pr(t,e,n,r)}function wr(t){return t instanceof or||(t=br(t)),t?new Pr((t=t.rgb()).r,t.g,t.b,t.opacity):new Pr}function Pr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Sr(){return"#"+Cr(this.r)+Cr(this.g)+Cr(this.b)}function Nr(){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 Cr(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Ar(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Rr(t,e,n,r)}function Or(t){if(t instanceof Rr)return new Rr(t.h,t.s,t.l,t.opacity);if(t instanceof or||(t=br(t)),!t)return new Rr;if(t instanceof Rr)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 Rr(o,s,u,t.opacity)}function Rr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Lr(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}ir(or,br,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xr,formatHex:xr,formatHsl:function(){return Or(this).formatHsl()},formatRgb:Er,toString:Er}),ir(Pr,(function(t,e,n,r){return 1===arguments.length?wr(t):new Pr(t,e,n,null==r?1:r)}),ar(or,{brighter:function(t){return new Pr(this.r*(t=null==t?ur:Math.pow(ur,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Pr(this.r*(t=null==t?sr:Math.pow(sr,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:Sr,formatHex:Sr,formatRgb:Nr,toString:Nr})),ir(Rr,(function(t,e,n,r){return 1===arguments.length?Or(t):new Rr(t,e,n,null==r?1:r)}),ar(or,{brighter:function(t){return new Rr(this.h,this.s,this.l*(t=null==t?ur:Math.pow(ur,t)),this.opacity)},darker:function(t){return new Rr(this.h,this.s,this.l*(t=null==t?sr:Math.pow(sr,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 Pr(Lr(240>t?t+120:t-240,r,n),Lr(t,r,n),Lr(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 Ir=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_r=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Dr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ur=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Gr={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},Br=Be((function(t){return rr("angular"===t.type?Number(t.value):Gr[t.value]||0,"deg")})),Fr=Be((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:rr(e,r),cy:rr(n,i)}})),Vr=Be((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Po(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(!we(u)&&!we(a)){for(var c=1;o-i>c;c++)t[i+c].length={type:"%",value:"".concat(a+(Number(u)-a)*c/(o-i))};i=o,a=Number(u)}}}(i);var a=i.map((function(t){return{offset:rr(t.length.value,"%"),color:wo(t)}}));if("linear-gradient"===n)return new Tn(t.GradientType.LinearGradient,{angle:r?Br(r):Wn,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var o,s=Fr(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;o="extent-keyword"===h?$n(f):rr(f,h)}return new Tn(t.GradientType.RadialGradient,{cx:u,cy:c,size:o,steps:a})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=Ir.exec(e);if(r){var i,a=(null===(i=r[2].match(Ur))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Tn(t.GradientType.LinearGradient,{angle:rr(parseFloat(r[1]),"deg"),steps:a.map((function(t){var e=T(t,2),n=e[1];return{offset:rr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===n){var o=function(t){var e=_r.exec(t);if(e){var n,r=(null===(n=e[4].match(Ur))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:rr(50,"%"),cy:rr(50,"%"),steps:r.map((function(t){var e=T(t,2),n=e[1];return{offset:rr(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(o){if(!Re(o))return[new Tn(t.GradientType.RadialGradient,o)];e=o}}else if("p"===n)return function(t){var e=Dr.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 jr(t){return Ce(t)&&!!t.image}var Yr=Be((function(t){if(jr(t))return a({repetition:"repeat"},t);if(we(t)&&(t=""),"transparent"===t)return er;"currentColor"===t&&(t="black");var e=Vr(t);if(e)return e;var n=br(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),nr.apply(void 0,r)}));function Hr(t,e){if(t instanceof zn&&e instanceof zn)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(Le(e[n],0,255));return e[3]=Le(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Xr(t,e){if(we(e))return rr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return rr(Number(e),"px");if("deg".search(t)>=0)return rr(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 rr(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Wr=Be((function(t){return Xr(/px/g,t)})),zr=(Be((function(t){return Xr(RegExp("%","g"),t)})),Be((function(t){return Ie(t)||isFinite(Number(t))?rr(Number(t),"px"):Xr(RegExp("px|%|em|rem","g"),t)}))),qr=Be((function(t){return Xr(/deg|rad|grad|turn/g,t)}));function Zr(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=In(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(o=c.value,s=l.value,a=mn(t.unit)):(_n.isLength(t.unit)||_n.isLength(e.unit))&&(o=Jr(t,i,n),s=Jr(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Kr(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=ho(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=fo(Number(e.value))),n}function Qr(t){return Re(t)?t.split(" ").map((function(t){return zr(t)})):t.map((function(t){return zr(""+t)}))}function Jr(e,n,r){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.getGeometryBounds(),a=0;return Fe.isEmpty(i)||(a=2*i.halfExtents[n]),Number(e.value)/100*a}return 0}var $r=function(t){return Xr(/deg|rad|grad|turn|px|%/g,t)},ti=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ei(){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,ti.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return $r(t)||Yr(t)}))}),n.lastIndex===t.length)return r}return[]}function ni(t){return""+t}var ri=Be((function(t){return rr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));Be((function(t){return Re(t)?t.split(" ").map(ri):t.map(ri)}));function ii(t,e){return[t,e,ni]}function ai(t,e){return function(n,r){return[n,r,function(n){return ni(Le(n,t,e))}]}}function oi(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var si=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=ie(t)}catch(n){e=ie(""),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]])}r.length>0&&n.push(r);return{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 c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=Uo(n,u);l.arcParams=h}if("Z"===c)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)),l.currentPoint=n,e[a]&&No(n,e[a].currentPoint)&&(e[a].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var v=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[v[0]-n[0],v[1]-n[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]];else if("Q"===c){var p=[u[1],u[2]];l.startTangent=[v[0]-p[0],v[1]-p[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]]}else if("T"===c){var d=e[s-1],y=Ao(d.currentPoint,v);"Q"===d.command?(l.command="Q",l.startTangent=[v[0]-y[0],v[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="TL",l.startTangent=[v[0]-n[0],v[1]-n[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]])}else if("C"===c){var g=[u[1],u[2]],m=[u[3],u[4]];l.startTangent=[v[0]-g[0],v[1]-g[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-m[0],g[1]-m[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[m[0]-g[0],m[1]-g[1]])}else if("S"===c){var k=e[s-1],x=Ao(k.currentPoint,v),E=[u[1],u[2]];"C"===k.command?(l.command="C",l.startTangent=[v[0]-x[0],v[1]-x[1]],l.endTangent=[n[0]-E[0],n[1]-E[1]]):(l.command="SQ",l.startTangent=[v[0]-E[0],v[1]-E[1]],l.endTangent=[n[0]-E[0],n[1]-E[1]])}else if("A"===c){var b=Lo(l,0),T=b.x,M=b.y,w=Lo(l,1,!1),P=w.x,S=w.y;l.startTangent=[T,M],l.endTangent=[P,S]}e.push(l)}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,c=o.prePoint,l=void 0;switch(o.command){case"Q":l=xi(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=Ti(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;l=Pi(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}l&&(o.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.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=Oe(n),v=Oe(r),p=Ae(n),d=Ae(r);if(0===i.length)return{x:f,y:v,width:p-f,height:d-v};for(var y=0;i.length>y;y++){var g=i[y],m=g.currentPoint;m[0]===f?f-=Co(g,e).xExtra:m[0]===p&&(p+=Co(g,e).xExtra),m[1]===v?v-=Co(g,e).yExtra:m[1]===d&&(d+=Co(g,e).yExtra)}return{x:f,y:v,width:p-f,height:d-v}}(o,0),u=s.x,c=s.y,l=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(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},ui=Be(si);function ci(t,e){var n=Re(t)?ui(t):si(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=fe(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=fe(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Me(r,i));var o,s,u,c,l,h,f,v,p=Ee(a[0])!==Ee(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))})))):Ft(a[0]);return[p,(u=a[1],c=p,l=u.length-1,h=[],f=0,v=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),v.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=ue(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),v[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function hi(t){return function(t){if(Array.isArray(t))return vi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||fi(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 fi(t,e){if(t){if("string"==typeof t)return vi(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)?vi(t,e):void 0}}function vi(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 pi(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function di(t,e){return.001>Math.abs(t-e)}function yi(t,e){var n=Math.min.apply(Math,hi(t)),r=Math.min.apply(Math,hi(e));return{x:n,y:r,width:Math.max.apply(Math,hi(t))-n,height:Math.max.apply(Math,hi(e))-r}}var gi={box:function(t,e,n,r){return yi([t,n],[e,r])},length:function(t,e,n,r){return pi(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?pi(t,e,i,a):o>(n-t)*(n-t)+(r-e)*(r-e)?pi(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 mi(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function ki(t,e,n){var r=t+n-2*e;if(di(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var xi=function(t,e,n,r,i,a){var o=ki(t,n,i)[0],s=ki(e,r,a)[0],u=[t,i],c=[e,a];return void 0!==o&&u.push(mi(t,n,i,o)),void 0!==s&&c.push(mi(e,r,a,s)),yi(u,c)};function Ei(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 bi(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(di(s,0))di(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;di(h,0)?l.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||l.push(i),0>a||a>1||l.push(a))}return l}var Ti=function(t,e,n,r,i,a,o,s){for(var u=[t,o],c=[e,s],l=bi(t,n,i,o),h=bi(e,r,a,s),f=0;l.length>f;f++)u.push(Ei(t,n,i,o,l[f]));for(var v=0;h.length>v;v++)c.push(Ei(e,r,a,s,h[v]));return yi(u,c)};function Mi(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function wi(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}var Pi=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,c=-1/0,l=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&l.push(f):f>o&&a>f&&l.push(f)}for(var v=0;l.length>v;v++){var p=Mi(t,0,n,r,i,l[v]);u>p&&(u=p),p>c&&(c=p)}for(var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,g=-1/0,m=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var x=d+k;o>a?x>a&&o>x&&m.push(x):x>o&&a>x&&m.push(x)}for(var E=0;m.length>E;E++){var b=wi(0,e,n,r,i,m[E]);y>b&&(y=b),b>g&&(g=b)}return{x:u,y:y,width:c-u,height:g-y}};var Si=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+=pi(r[0],r[1],i[0],i[1])}return e}(t)};function Ni(t,e){var n;n=Re(t)?t.split(" ").map((function(t){var e=T(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,a=[],o=0,s=Si(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=gi.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,M(n.map((function(t){return t[0]})))),c=Math.min.apply(Math,M(n.map((function(t){return t[1]}))));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:a}}var Ci=null;function Ai(t){return function(e){var n=0;return t.map((function(t){return t===Ci?e[n++]:t}))}}function Oi(t){return t}var Ri={matrix:["NNNNNN",[Ci,Ci,0,0,Ci,Ci,0,0,0,0,1,0,Ci,Ci,0,1],Oi],matrix3d:["NNNNNNNNNNNNNNNN",Oi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ai([Ci,Ci,new _n(1)]),Oi],scalex:["N",Ai([Ci,new _n(1),new _n(1)]),Ai([Ci,new _n(1)])],scaley:["N",Ai([new _n(1),Ci,new _n(1)]),Ai([new _n(1),Ci])],scalez:["N",Ai([new _n(1),new _n(1),Ci])],scale3d:["NNN",Oi],skew:["Aa",null,Oi],skewx:["A",null,Ai([Ci,Wn])],skewy:["A",null,Ai([Wn,Ci])],translate:["Tt",Ai([Ci,Ci,Xn]),Oi],translatex:["T",Ai([Ci,Xn,Xn]),Ai([Ci,Xn])],translatey:["T",Ai([Xn,Ci,Xn]),Ai([Xn,Ci])],translatez:["L",Ai([Xn,Xn,Ci])],translate3d:["TTL",Oi]};function Li(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=Ri[a];if(!o)return[];var s=e[2].split(","),u=o[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],v=void 0;if(void 0===(v=h?{A:function(t){return"0"===t.trim()?Wn:qr(t)},N:ri,T:zr,L:Wr}[f.toUpperCase()](h):{a:Wn,n:c[0],t:Xn}[f]))return[];c.push(v)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function Ii(t){var e,n,r,i;switch(t.t){case"rotatex":return i=lo(Kr(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=lo(Kr(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=lo(Kr(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=lo(Kr(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),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,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 l=lo(Kr(t.d[0])),h=lo(Kr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=lo(Kr(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=lo(Kr(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=Jr(t.d[0],0,null)||0,n=Jr(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Jr(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=Jr(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=Jr(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Jr(t.d[0],0,null)||0,n=Jr(t.d[1],0,null)||0,r=Jr(t.d[2],0,null)||0,1];case"perspective":var f=Jr(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 _i(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 Di(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}(go,t))return!1;if(L(mo,go),mo[3]=0,mo[7]=0,mo[11]=0,mo[15]=1,1e-8>Math.abs(G(mo)))return!1;var o=go[3],s=go[7],u=go[11],c=go[12],l=go[13],h=go[14],f=go[15];if(0!==o||0!==s||0!==u){if(ko[0]=o,ko[1]=s,ko[2]=u,ko[3]=f,!U(mo,mo))return!1;D(mo,mo),bt(i,ko,mo)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=c,e[1]=l,e[2]=h,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(xo,go),n[0]=at(xo[0]),ft(xo[0],xo[0]),r[0]=vt(xo[0],xo[1]),bo(xo[1],xo[1],xo[0],1,-r[0]),n[1]=at(xo[1]),ft(xo[1],xo[1]),r[0]/=n[1],r[1]=vt(xo[0],xo[2]),bo(xo[2],xo[2],xo[0],1,-r[1]),r[2]=vt(xo[1],xo[2]),bo(xo[2],xo[2],xo[1],1,-r[2]),n[2]=at(xo[2]),ft(xo[2],xo[2]),r[1]/=n[2],r[2]/=n[2],pt(Eo,xo[1],xo[2]),0>vt(xo[0],Eo))for(var v=0;3>v;v++)n[v]*=-1,xo[v][0]*=-1,xo[v][1]*=-1,xo[v][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+xo[0][0]-xo[1][1]-xo[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-xo[0][0]+xo[1][1]-xo[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-xo[0][0]-xo[1][1]+xo[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+xo[0][0]+xo[1][1]+xo[2][2],0)),xo[2][1]>xo[1][2]&&(a[0]=-a[0]);xo[0][2]>xo[2][0]&&(a[1]=-a[1]);xo[1][0]>xo[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(Ii).reduce(_i)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var Ui=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 c=0;3>c;c++)o[3][u]+=e[c]*o[c][u];var l=i[0],h=i[1],f=i[2],v=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+f*f),p[0][1]=2*(l*h-f*v),p[0][2]=2*(l*f+h*v),p[1][0]=2*(l*h+f*v),p[1][1]=1-2*(l*l+f*f),p[1][2]=2*(h*f-l*v),p[2][0]=2*(l*f-h*v),p[2][1]=2*(h*f+l*v),p[2][2]=1-2*(l*l+h*h),o=t(o,p);var d,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==(d=o)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[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 Gi(t){return t.toFixed(6).replace(".000000","")}function Bi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Di(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Di(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=Le(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 Ui(t[0],t[1],t[2],e,t[4]).map(Gi).join(",")}])}function Fi(t){return t.replace(/[xy]/,"")}function Vi(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function ji(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,a=r.d,o="scale"===i.substring(0,5)?1:0;e.push({t:i,d:a.map((function(t){return"number"==typeof t?rr(o):rr(o,t.unit)}))})},a=0;t.length>a;a++)i(a)}var o,s,u=[],c=[],l=[];if(t.length!==e.length){var h=Bi(t,e);u=[h[0]],c=[h[1]],l=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var v=t[f].t,p=e[f].t,d=t[f].d,y=e[f].d,g=Ri[v],m=Ri[p],k=void 0;if(s=p,"perspective"===(o=v)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var x=Bi([t[f]],[e[f]]);u.push(x[0]),c.push(x[1]),l.push(["matrix",[x[2]]])}else{if(v===p)k=v;else if(g[2]&&m[2]&&Fi(v)===Fi(p))k=Fi(v),d=g[2](d),y=m[2](y);else{if(!g[1]||!m[1]||Vi(v)!==Vi(p)){var E=Bi(t,e);u=[E[0]],c=[E[1]],l=[["matrix",[E[2]]]];break}k=Vi(v),d=g[1](d),y=m[1](y)}for(var b=[],T=[],M=[],w=0;d.length>w;w++){var P=Zr(d[w],y[w],n,!1,w);b[w]=P[0],T[w]=P[1],M.push(P[2])}u.push(b),c.push(T),l.push([k,M])}}if(r){var S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var Yi=Be((function(t){if(Re(t)){if("text-anchor"===t)return[rr(0,"px"),rr(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:[zr(Hi(e[0])),zr(Hi(e[1]))]}return[rr(t[0]||0,"px"),rr(t[1]||0,"px")]}));function Hi(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Xi=function(){function t(){l(this,t),this.parser=qr,this.mixer=ii}return f(t,[{key:"calculator",value:function(t,e,n,r){return Kr(n)}}]),t}(),Wi=function(){function t(){l(this,t)}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Mn&&(n=null),hu.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&hu.sceneGraphService.dirtifyToRoot(t)})),n}}]),t}(),zi=function(){function t(){l(this,t),this.parser=Yr,this.mixer=Hr}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Mn?"none"===n.value?tr:er:n}}]),t}(),qi=function(){function t(){l(this,t),this.parser=ei}return f(t,[{key:"calculator",value:function(t,e,n){return n instanceof Mn?[]:n}}]),t}();function Zi(t){var e=t.parsedStyle.fontSize;return we(e)?null:e}var Ki=function(){function e(){l(this,e),this.parser=zr,this.mixer=ii}return f(e,[{key:"calculator",value:function(e,n,r,i,a){if(!_n.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=Zi(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=Zi(i.ownerDocument.documentElement);if(u)return u*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}}}]),e}(),Qi=function(){function t(){l(this,t),this.mixer=oi}return f(t,[{key:"parser",value:function(t){var e=Qr(Ie(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}(),Ji=function(){function t(){l(this,t),this.mixer=oi}return f(t,[{key:"parser",value:function(t){var e=Qr(Ie(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}(),$i=function(e){p(r,e);var n=x(r);function r(){return l(this,r),n.apply(this,arguments)}return f(r,[{key:"postProcessor",value:function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var a=e.parsedStyle,o=a.cx,s=a.cy;we(o)||(n=o),we(s)||(r=s);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1,u.x2),r=Math.min(c,l),i=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:we(e.parsedStyle.x)||(n=e.parsedStyle.x),we(e.parsedStyle.y)||(r=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0),!we(n)||!we(r)||!we(i)){var h=T(e.getLocalPosition(),3),f=h[0],v=h[1],p=h[2];e.setLocalPosition(we(n)?f:n,we(r)?v:r,we(i)?p:i)}}}]),r}(Ki),ta=function(){function t(){l(this,t)}return f(t,[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Mn&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}]),t}(),ea=function(){function t(){l(this,t),this.mixer=ii,this.parser=ri}return f(t,[{key:"calculator",value:function(t,e,n){return n.value}}]),t}(),na=function(){function e(){l(this,e),this.parser=ri,this.mixer=ai(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}(),ra=function(){function t(){l(this,t),this.parser=ri,this.mixer=ai(0,1)}return f(t,[{key:"calculator",value:function(t,e,n){return n.value}}]),t}(),ia=function(){function e(){l(this,e),this.parser=ci,this.mixer=li}return f(e,[{key:"calculator",value:function(t,e,n){return n instanceof Mn&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Xe(0,0,0,0)}:n}},{key:"postProcessor",value:function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}}}]),e}(),aa=function(){function e(){l(this,e),this.parser=Ni}return f(e,[{key:"postProcessor",value:function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}}}]),e}(),oa=function(t){p(n,t);var e=x(n);function n(){var t;l(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=ai(0,1/0),t}return f(n)}(Ki),sa=function(){function t(){l(this,t)}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Mn?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}]),t}(),ua=function(){function t(){l(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}(),ca=function(){function t(){l(this,t),this.parser=Li,this.mixer=ji}return f(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Mn?[]:n}},{key:"postProcessor",value:function(t){Mo(t.parsedStyle.transform,t)}}]),t}(),la=f((function t(){l(this,t),this.parser=Yi})),ha=function(){function t(){l(this,t),this.parser=ri}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}(),fa=function(){function e(){l(this,e),this.registry={},this.define(t.Shape.CIRCLE,Da),this.define(t.Shape.ELLIPSE,Ya),this.define(t.Shape.RECT,ao),this.define(t.Shape.IMAGE,Za),this.define(t.Shape.LINE,Qa),this.define(t.Shape.GROUP,Xa),this.define(t.Shape.PATH,$a),this.define(t.Shape.POLYGON,eo),this.define(t.Shape.POLYLINE,ro),this.define(t.Shape.TEXT,so),this.define(t.Shape.HTML,za)}return f(e,[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}]),e}(),va=function(){function t(e){l(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 He,this.page=new He,this.canvas=new He,this.viewport=new He,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(ln)}}]),t}(),pa=function(t){p(n,t);var e=x(n);function n(t,r){var i;return l(this,n),(i=e.call(this,null)).type=t,i.detail=r,Object.assign(m(i),r),i}return f(n)}(va),da=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,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,a),!0;case 6:return l.fn.call(l.context,e,r,i,a,o),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,v=l.length;for(c=0;v>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].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,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[a]=1===c.length?c[0]:c: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(){l(this,t),this.emitter=new da}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=Ue(n)&&n||Ce(n)&&n.capture,i=Ce(n)&&n.once,a=Ze(e)?void 0:e,o=!1,s="";if(t.indexOf(":")>-1){var u=T(t.split(":"),2);t=u[1],s=u[0],o=!0}if(t=r?"".concat(t,"capture"):t,e=Ze(e)?e:e.handleEvent,o){var c=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&&c.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=Ue(n)&&n||Ce(n)&&n.capture,a=Ze(e)?void 0:e;return t=i?"".concat(t,"capture"):t,e=Ze(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 pa(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(t instanceof va))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}(),ga=function(e){p(r,e);var n=x(r);function r(){var t;l(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=S(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(ln)}},{key:"lookupNamespaceURI",value:function(t){throw Error(ln)}},{key:"lookupPrefix",value:function(t){throw Error(ln)}},{key:"normalize",value:function(){throw Error(ln)}},{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;if(!(t instanceof r))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");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 c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];if(f!==h){var v=h.parentNode.childNodes;return v.indexOf(h)<v.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){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))}}],[{key:"isNode",value:function(t){return!!t.childNodes}}]),r}(ya);ga.DOCUMENT_POSITION_DISCONNECTED=1,ga.DOCUMENT_POSITION_PRECEDING=2,ga.DOCUMENT_POSITION_FOLLOWING=4,ga.DOCUMENT_POSITION_CONTAINS=8,ga.DOCUMENT_POSITION_CONTAINED_BY=16,ga.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ma,ka,xa=function(e){p(a,e);var n,r,i=x(a);function a(){var e;l(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 hu.AnimationTimeline(m(e))}catch(t){}var n={};return As.forEach((function(e){var r=e.d;e.inh&&r&&(n[e.n]=Ze(r)?r(t.Shape.GROUP):r)})),e.documentElement=new Xa({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?so:Xa);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(ln)}},{key:"destroy",value:function(){try{this.documentElement.destroy(),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=hu.displayObjectPool.getByEntity(t.id),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,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement}},{key:"elementFromPoint",value:(r=c(o().mark((function t(e,n){var r,i,a,s,u,c,l,h,f,v;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,c=s.height,!(0>i||0>a||i>u||a>c)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),h=l.x,f=l.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",(v=t.sent.picked)&&v[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,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c}},{key:"elementsFromPoint",value:(n=c(o().mark((function t(e,n){var r,i,a,s,u,c,l,h,f,v;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,c=s.height,!(0>i||0>a||i>u||a>c)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),h=l.x,f=l.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(v=t.sent.picked)[v.length-1]!==this.documentElement&&v.push(this.documentElement),t.abrupt("return",v);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(hn)}},{key:"insertBefore",value:function(t,e){throw Error(hn)}},{key:"removeChild",value:function(t,e){throw Error(hn)}},{key:"replaceChild",value:function(t,e,n){throw Error(hn)}},{key:"append",value:function(){throw Error(hn)}},{key:"prepend",value:function(){throw Error(hn)}},{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}(ga);(ma=t.Strategy||(t.Strategy={}))[ma.Standard=0]="Standard",(ka=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",ka.ATTR_MODIFIED="DOMAttrModified",ka.INSERTED="DOMNodeInserted",ka.REMOVED="removed",ka.MOUNTED="DOMNodeInsertedIntoDocument",ka.UNMOUNTED="DOMNodeRemovedFromDocument",ka.BOUNDS_CHANGED="bounds-changed",ka.RENDER_ORDER_CHANGED="render-order-changed",ka.CULLED="culled";var Ea=function(t){p(n,t);var e=x(n);function n(t,r,i,a,o,s,u,c){var h;return l(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=c,h.type=t,h}return f(n)}(va);Ea.ADDITION=2,Ea.MODIFICATION=1,Ea.REMOVAL=3;var ba=0;var Ta=new Ea(t.ElementEvent.INSERTED,null,"","","",0,"",""),Ma=new Ea(t.ElementEvent.REMOVED,null,"","","",0,"",""),wa=new pa(t.ElementEvent.DESTROY),Pa=function(e){p(r,e);var n=x(r);function r(){var e;l(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=ba++,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:ot(0,0,0),localRotation:_t(0,0,0,1),localScale:ot(1,1,1),localTransform:R(),localSkew:Bt(0,0),position:ot(0,0,0),rotation:_t(0,0,0,1),scaling:ot(1,1,1),worldTransform:R(),origin:ot(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={anchor:Zn,opacity:Zn,fillOpacity:Zn,strokeOpacity:Zn,fill:Zn,stroke:Zn,transform:Zn,transformOrigin:Zn,visibility:Zn,pointerEvents:Zn,lineWidth:Zn,lineCap:Zn,lineJoin:Zn,increasedLineWidthForHitTesting:Zn,fontSize:Zn,fontFamily:Zn,fontStyle:Zn,fontWeight:Zn,fontVariant:Zn,textAlign:Zn,textBaseline:Zn,textTransform:Zn,zIndex:Zn,filter:Zn,shadowType:Zn},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(ln)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return hu.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Ta.relatedNode=this,t.dispatchEvent(Ta),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 Ma.relatedNode=this,t.dispatchEvent(Ma),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),hu.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){var t=this;this.childNodes.slice().forEach((function(e){t.removeChild(e)}))}},{key:"destroyChildren",value:function(){this.childNodes.slice().forEach((function(t){t.destroyChildren(),t.destroy()}))}},{key:"matches",value:function(t){return hu.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return hu.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return hu.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return hu.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return hu.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return hu.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return hu.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(hu.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,M(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(wa),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return hu.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return hu.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return hu.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return hu.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return hu.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){var e=this.attributes[t];if(void 0===e){var n=Qe(t);return we(e=this.attributes[n])?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(ln)}},{key:"getAttributeNode",value:function(t){throw Error(ln)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(ln)}},{key:"hasAttributeNS",value:function(t,e){throw Error(ln)}},{key:"removeAttributeNS",value:function(t,e){throw Error(ln)}},{key:"removeAttributeNode",value:function(t){throw Error(ln)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(ln)}},{key:"setAttributeNode",value:function(t){throw Error(ln)}},{key:"setAttributeNodeNS",value:function(t){throw Error(ln)}},{key:"toggleAttribute",value:function(t,e){throw Error(ln)}}],[{key:"isElement",value:function(t){return!!t.getAttribute}}]),r}(ga),Sa=function(t){p(n,t);var e=x(n);function n(){var t;l(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 He,t.movement=new He,t.offset=new He,t.global=new He,t.screen=new He,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(ln)}}]),n}(va),Na=function(t){p(n,t);var e=x(n);function n(){var t;l(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}(Sa),Ca=function(t){p(n,t);var e=x(n);function n(){var t;l(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}(Sa),Aa=new Ea(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ea.MODIFICATION,null,null),Oa={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:""},Ra={anchor:[0,0],fill:tr,stroke:tr,transform:[],zIndex:0,filter:[],shadowType:"outer"},La=["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],Ia=function(e){p(r,e);var n=x(r);function r(e){var i,o;return l(this,r),(o=n.call(this)).config=void 0,o.isCustomElement=!1,o.isMutationObserved=!1,o.activeAnimations=[],o.getClip=function(){return this.style.clipPath||null},o.config=e,o.config.interactive=null!==(i=o.config.capture)&&void 0!==i?i:o.config.interactive,o.id=o.config.id||"",o.name=o.config.name||"",(o.config.className||o.config.class)&&(o.className=o.config.className||o.config.class),o.nodeName=o.config.type||t.Shape.GROUP,o.config.style=a(a({},o.config.style),o.config.attrs),null!=o.config.visible&&(o.config.style.visibility=!1===o.config.visible?"hidden":"visible"),null!=o.config.interactive&&(o.config.style.pointerEvents=!1===o.config.interactive?"none":"auto"),Object.assign(o.parsedStyle,Ra,o.config.initialParsedStyle),Object.assign(o.attributes,Oa),o.initAttributes(o.config.style),o.style=new Proxy({setProperty:function(t,e){o.setAttribute(t,e)},getPropertyValue:function(t){return o.getAttribute(t)},removeProperty:function(t){o.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:o.getAttribute(e)},set:function(t,e,n){return o.setAttribute(e,n),!0}}),hu.displayObjectPool.add(o.entity,m(o)),o}return f(r,[{key:"destroy",value:function(){b(d(r.prototype),"destroy",this).call(this),hu.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var i in n){var o=n[i];o instanceof r&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(n[i]=o.cloneNode(t)),e&&(n[i]=e(i,o))}var s=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return s.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);s.appendChild(n)}})),s}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.renderable;hu.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0,usedAttributes:La}),e.dirty=!0}},{key:"setAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Qe(t);Ge(e)||(n||e!==this.attributes[i])&&(this.internalSetAttribute(i,e),b(d(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];hu.styleValueRegistry.processProperties(this,v({},t,e),n),r.dirty=!0;var o=this.parsedStyle[t];this.isConnected&&(Aa.relatedNode=this,Aa.prevValue=i,Aa.newValue=e,Aa.attrName=t,Aa.prevParsedValue=a,Aa.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Aa):(Aa.target=this,this.ownerDocument.defaultView.dispatchEvent(Aa,!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=T(t.getMin(),2),n=e[0],r=e[1],i=T(t.getMax(),2);return new Xe(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return hu.sceneGraphService.setOrigin(this,co(t,e,n)),this}},{key:"getOrigin",value:function(){return hu.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return hu.sceneGraphService.setPosition(this,co(t,e,n)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return hu.sceneGraphService.setLocalPosition(this,co(t,e,n)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return hu.sceneGraphService.translate(this,co(t,e,n)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return hu.sceneGraphService.translateLocal(this,co(t,e,n)),this}},{key:"getPosition",value:function(){return hu.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return hu.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=co(t,e=e||t,n=n||t)),hu.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=co(t,e=e||t,n=n||t)),hu.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return hu.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return hu.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return ho(T(vo(rt(),hu.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return ho(T(vo(rt(),hu.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return hu.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return hu.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return we(e)&&we(n)?hu.sceneGraphService.rotateLocal(this,0,0,t):hu.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return we(e)&&we(n)?hu.sceneGraphService.rotate(this,0,0,t):hu.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return hu.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return hu.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return hu.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return hu.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return hu.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return hu.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return hu.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return hu.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return hu.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){hu.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,M(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,M(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?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}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=T(W(rt(),e),2),r=n[0],i=n[1],a=T(z(rt(),e),2),o=a[0],s=a[1],u=q(Tt(),e),c=T(vo(rt(),u),3);return po(c[0]||c[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=T(yo(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=T(yo(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.style.visibility="visible"}},{key:"hide",value:function(){this.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){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}]),r}(Pa),_a=["style"],Da=function(e){p(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,_a);return l(this,r),n.call(this,a({type:t.Shape.CIRCLE,style:a({cx:"",cy:"",r:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))}return f(r)}(Ia),Ua=["style"],Ga=function(t){p(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,Ua);return l(this,n),(t=e.call(this,a({style:a({x:"",y:""},i)},o))).isCustomElement=!0,t}return f(n)}(Ia),Ba={},Fa=[],Va=function(){function e(){l(this,e)}return f(e,[{key:"getByEntity",value:function(t){return Ba[t]}},{key:"getAll",value:function(){return Object.keys(Ba).map((function(t){return Ba[t]}))}},{key:"add",value:function(e,n){Ba[e]=n,n.nodeName===t.Shape.HTML&&Fa.push(n)}},{key:"remove",value:function(e){var n=Ba[e];if(n&&(delete Ba[e],n.nodeName===t.Shape.HTML)){var r=Fa.indexOf(n);Fa.splice(r,1)}}},{key:"getHTMLs",value:function(){return Fa}}]),e}(),ja=["style"],Ya=function(e){p(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,ja);return l(this,r),n.call(this,a({type:t.Shape.ELLIPSE,style:a({cx:"",cy:"",rx:"",ry:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))}return f(r)}(Ia),Ha=["style"],Xa=function(e){p(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,Ha);return l(this,r),n.call(this,a({type:t.Shape.GROUP,style:a({x:"",y:"",width:"",height:""},i)},o))}return f(r)}(Ia),Wa=["style"],za=function(e){p(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,Wa);return l(this,r),(e=n.call(this,a({type:t.Shape.HTML,style:a({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 Fe;return o.setMinMax(ot(i,a,0),ot(i+n.width,a+n.height,0)),o}return null}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=U(R(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Fe.isEmpty(e)){var n=new Fe;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}]),r}(Ia),qa=["style"],Za=function(e){p(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,qa);return l(this,r),n.call(this,a({type:t.Shape.IMAGE,style:a({x:"",y:"",img:"",width:"",height:""},i)},o))}return f(r)}(Ia),Ka=["style"],Qa=function(e){p(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,Ka);l(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,c=u.markerStart,h=u.markerEnd;return c&&c instanceof Ia&&(e.markerStartAngle=c.getLocalEulerAngles(),e.appendChild(c)),h&&h instanceof Ia&&(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&&r instanceof Ia&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ia&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&r instanceof Ia&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ia&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.defX,s=e.defY,u=t?e.markerStart:e.markerEnd;if(u&&u instanceof Ia){var c,l,h,f,v,p,d;t?(f=n-o,v=i-s,l=r-n,h=a-i,p=e.markerStartOffset||0,d=this.markerStartAngle):(f=r-o,v=a-s,l=n-r,h=i-a,p=e.markerEndOffset||0,d=this.markerEndAngle),u.setLocalEulerAngles(180*(c=Math.atan2(h,l))/Math.PI+d),u.setLocalPosition(f+Math.cos(c)*p,v+Math.sin(c)*p)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,u=n.defY,c=gi.pointAt(r,i,a,o,t),l=c.x,h=c.y,f=dt(rt(),ot(l-s,h-u,0),e?this.getWorldTransform():this.getLocalTransform());return new He(f[0],f[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 gi.length(t.x1,t.y1,t.x2,t.y2)}}]),r}(Ia),Ja=["style"],$a=function(e){p(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,Ja);l(this,r),(e=n.call(this,a({type:t.Shape.PATH,style:a({path:"",miterLimit:""},o)},s))).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var u=e.parsedStyle,c=u.markerStart,h=u.markerEnd,f=u.markerMid;return c&&c instanceof Ia&&(e.markerStartAngle=c.getLocalEulerAngles(),e.appendChild(c)),f&&f instanceof Ia&&e.placeMarkerMid(f),h&&h instanceof Ia&&(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&&r instanceof Ia&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ia&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Ia&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ia&&(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&&o instanceof Ia){var s,u,c,l,h,f,v;if(t){var p=T(this.getStartTangent(),2),d=p[0],y=p[1];l=y[0]-i,h=y[1]-a,u=d[0]-y[0],c=d[1]-y[1],f=n||0,v=this.markerStartAngle}else{var g=T(this.getEndTangent(),2),m=g[0],k=g[1];l=k[0]-i,h=k[1]-a,u=m[0]-k[0],c=m[1]-k[1],f=r||0,v=this.markerEndAngle}o.setLocalEulerAngles(180*(s=Math.atan2(c,u))/Math.PI+v),o.setLocalPosition(l+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&&t instanceof Ia)for(var a=1;n.length-1>a;a++){var o=T(n[a].currentPoint,2),s=o[0],u=o[1],c=1===a?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}}},{key:"getTotalLength",value:function(){return So(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=n.path.absolutePath,o=be(a,t),s=o.x,u=o.y,c=dt(rt(),ot(s-r,u-i,0),e?this.getWorldTransform():this.getLocalTransform());return new He(c[0],c[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*So(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}(Ia),to=["style"],eo=function(e){p(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,to);l(this,r),(e=n.call(this,a({type:t.Shape.POLYGON,style:a({points:"",miterLimit:"",isClosed:!0},o)},s))).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var u=e.parsedStyle,c=u.markerStart,h=u.markerEnd,f=u.markerMid;return c&&c instanceof Ia&&(e.markerStartAngle=c.getLocalEulerAngles(),e.appendChild(c)),f&&f instanceof Ia&&e.placeMarkerMid(f),h&&h instanceof Ia&&(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&&r instanceof Ia&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Ia&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Ia&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Ia&&(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.points.points,r=e.defX,i=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&a instanceof Ia){var o,s,u,c,l,h,f;if(c=n[0][0]-r,l=n[0][1]-i,t)s=n[1][0]-n[0][0],u=n[1][1]-n[0][1],h=e.markerStartOffset||0,f=this.markerStartAngle;else{var v=n.length;this.style.isClosed?(s=n[v-1][0]-n[0][0],u=n[v-1][1]-n[0][1]):(c=n[v-1][0]-r,l=n[v-1][1]-i,s=n[v-2][0]-n[v-1][0],u=n[v-2][1]-n[v-1][1]),h=e.markerEndOffset||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(c+Math.cos(o)*h,l+Math.sin(o)*h)}}},{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&&t instanceof Ia)for(var a=1;(this.style.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}(Ia),no=["style"],ro=function(e){p(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,no);return l(this,r),n.call(this,a({type:t.Shape.POLYLINE,style:a({points:"",miterLimit:"",isClosed:!1},i)},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=a.segments,u=0,c=0;s.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),c=n)}));var l=gi.pointAt(o[c][0],o[c][1],o[c+1][0],o[c+1][1],u),h=l.x,f=l.y,v=dt(rt(),ot(h-r,f-i,0),e?this.getWorldTransform():this.getLocalTransform());return new He(v[0],v[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}(eo),io=["style"],ao=function(e){p(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 l(this,r),n.call(this,a({type:t.Shape.RECT,style:a({x:"",y:"",width:"",height:"",radius:""},i)},o))}return f(r)}(Ia),oo=["style"],so=function(e){p(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,oo);return l(this,r),n.call(this,a({type:t.Shape.TEXT,style:a({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},i)},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}(Ia);function uo(t){return void 0===t?0:t>360||-360>t?t%360:t}function co(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Ie(t)?ot(t,e,n):Array.isArray(t)&&3===t.length?it(t):ot(t[0],t[1]||e,t[2]||n)}function lo(t){return t*(Math.PI/180)}function ho(t){return t*(180/Math.PI)}function fo(t){return 360*t}function vo(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,a=T(z(rt(),e),3),o=a[0],s=a[1],u=a[2],c=Math.asin(-e[2]/o);return i>c?c>-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]=c,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,c=n*n+o+s+u,l=n*a-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(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 po(t,e,n,r,i){var a,o,s,u,c,l,h,f,v,p,d=Math.cos(t),y=Math.sin(t);return a=r*d,o=i*y,s=0,u=-r*y,c=i*d,l=0,h=e,f=n,v=1,(p=new A(9))[0]=a,p[1]=o,p[2]=s,p[3]=u,p[4]=c,p[5]=l,p[6]=h,p[7]=f,p[8]=v,p}function yo(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=ho(Math.atan2(n,e));return[t[6],t[7],a,o,s]}var go=R(),mo=R(),ko=Et(),xo=[rt(),rt(),rt()],Eo=rt();function bo(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 To=R();function Mo(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 Ia({}),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 c=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,c[0])}else if("scale3d"===i){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(l[0],l[1],l[2])}else if("translate"===i){var h=a||[Xn,Xn];e.translateLocal(h[0].value,h[1].value,0)}else if("translatex"===i){e.translateLocal((a||[Xn])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(a||[Xn])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(a||[Xn])[0].value)}else if("translate3d"===i){var f=a||[Xn,Xn,Xn];e.translateLocal(f[0].value,f[1].value,f[2].value)}else if("rotate"===i){e.rotateLocal(0,0,(a||[Wn])[0].value)}else if("rotatex"===i){e.rotateLocal((a||[Wn])[0].value,0,0)}else if("rotatey"===i){e.rotateLocal(0,(a||[Wn])[0].value,0)}else if("rotatez"===i){e.rotateLocal(0,0,(a||[Wn])[0].value)}else if("rotate3d"===i);else if("skew"===i){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];e.setLocalSkew(lo(v[0]),lo(v[1]))}else if("skewx"===i){var p=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(lo(p[0]),e.getLocalSkew()[1])}else if("skewy"===i){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],lo(d[0]))}else if("matrix"===i){var y=T(a.map((function(t){return t.value})),6);e.setLocalTransform(I(To,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&&(I.apply(nt,[To].concat(M(a.map((function(t){return t.value}))))),To[12]+=n,To[13]+=r,e.setLocalTransform(To))}))}return e.getLocalTransform()}function wo(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 Po=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,v=/^\)/,p=/^,/,d=/^\#([0-9a-fA-F]+)/,y=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,k=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function E(t){throw Error(x+": "+t)}function b(){var t=R(T);return x.length>0&&E("Invalid input not EOF"),t}function T(){return M("linear-gradient",t,P)||M("repeating-linear-gradient",e,P)||M("radial-gradient",n,S)||M("repeating-radial-gradient",r,S)||M("conic-gradient",i,S)}function M(t,e,n){return w(e,(function(e){var r=n();return r&&(G(p)||E("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(L)}}))}function w(t,e){var n=G(t);if(n){G(f)||E("Missing (");var r=e(n);return G(v)||E("Missing )"),r}}function P(){return U("directional",a,1)||U("angular",h,1)}function S(){var t,e,n=N();return n&&((t=[]).push(n),e=x,G(p)&&((n=N())?t.push(n):x=e)),t}function N(){var t=function(){var t=U("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=U("shape",/^(ellipse)/i,0);t&&(t.style=_()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return U("extent-keyword",o,1)}function A(){if(U("position",/^at/,0)){var t=O();return t||E("Missing positioning value"),t}}function O(){var t={x:_(),y:_()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);G(p);)(e=t())?n.push(e):E("One extra comma");return n}function L(){var t=U("hex",d,1)||w(m,(function(){return{type:"rgba",value:R(I)}}))||w(g,(function(){return{type:"rgb",value:R(I)}}))||U("literal",y,0);return t||E("Expected color definition"),t.length=_(),t}function I(){return G(k)[1]}function _(){return U("%",c,1)||U("position-keyword",s,1)||D()}function D(){return U("px",u,1)||U("em",l,1)}function U(t,e,n){var r=G(e);if(r)return{type:t,value:r[n]}}function G(t){var e=/^[\n\r\t\s]+/.exec(x);e&&B(e[0].length);var n=t.exec(x);return n&&B(n[0].length),n}function B(t){x=x.substring(t)}return function(t){return x=t,b()}}();function So(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=xe(t.parsedStyle.path.absolutePath,void 0,Vt(Vt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function No(t,e){return t[0]===e[0]&&t[1]===e[1]}function Co(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=1e-5),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(a[1]-i[1],a[0]-i[0])),l=Math.abs(Math.atan2(a[0]-i[0],a[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-(c=c>Math.PI/2?Math.PI-c:c))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function Ao(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var Oo=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))))},Ro=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=lo(r=De(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 c=(t.x-o.x)/2,l=(t.y-o.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},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 v=(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)),p=(i!==a?1:-1)*Math.sqrt(v=0>v?0:v),d=p*(e*h.y/n),y=p*(-n*h.x/e),g={x:Math.cos(u)*d-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*d+Math.cos(u)*y+(t.y+o.y)/2},m={x:(h.x-d)/e,y:(h.y-y)/n},k=Oo({x:1,y:0},m),x=Oo(m,{x:(-h.x-d)/e,y:(-h.y-y)/n});!a&&x>0?x-=2*Math.PI:a&&0>x&&(x+=2*Math.PI);var E=k+(x%=2*Math.PI)*s,b=e*Math.cos(E),T=n*Math.sin(E);return{x:Math.cos(u)*b-Math.sin(u)*T+g.x,y:Math.sin(u)*b+Math.cos(u)*T+g.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+x,ellipticalArcAngle:E,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Lo(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,c=r.arcFlag,l=r.sweepFlag,h=Ro({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Ro({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),v=f.x-h.x,p=f.y-h.y,d=Math.sqrt(v*v+p*p);return{x:-v/d,y:-p/d}}function Io(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function _o(t,e){return Io(t)*Io(e)?(t[0]*e[0]+t[1]*e[1])/(Io(t)*Io(e)):1}function Do(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(_o(t,e))}function Uo(t,e){var n=e[1],r=e[2],i=De(lo(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,v=h*h/(n*n)+f*f/(r*r);v>1&&(n*=Math.sqrt(v),r*=Math.sqrt(v));var p=n*n*(f*f)+r*r*(h*h),d=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(d*=-1),isNaN(d)&&(d=0);var y=r?d*n*f/r:0,g=n?d*-r*h/n:0,m=(s+c)/2+Math.cos(i)*y-Math.sin(i)*g,k=(u+l)/2+Math.sin(i)*y+Math.cos(i)*g,x=[(h-y)/n,(f-g)/r],E=[(-1*h-y)/n,(-1*f-g)/r],b=Do([1,0],x),T=Do(x,E);return _o(x,E)>-1||(T=Math.PI),1>_o(x,E)||(T=0),0===o&&T>0&&(T-=2*Math.PI),1===o&&0>T&&(T+=2*Math.PI),{cx:m,cy:k,rx:No(t,[c,l])?0:n,ry:No(t,[c,l])?0:r,startAngle:b,endAngle:b+T,xRotation:i,arcFlag:a,sweepFlag:o}}function Go(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=ot(e[1]-a,e[2]-s,0);n&&dt(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=ot(e[1]-a,e[2]-s,0),u=ot(e[3]-a,e[4]-s,0),c=ot(e[5]-a,e[6]-s,0);n&&(dt(o,o,n),dt(u,u,n),dt(c,c,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(u[0],",").concat(u[1],",").concat(c[0],",").concat(c[1])}else if("A"===e[0]){var l=ot(e[6]-a,e[7]-s,0);n&&dt(l,l,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(l[0],",").concat(l[1])}else if("Q"===e[0]){var h=ot(e[1]-a,e[2]-s,0),f=ot(e[3]-a,e[4]-s,0);n&&(dt(h,h,n),dt(f,f,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}function Bo(t,e,n,r){return[["M",t,e],["L",n,r]]}function Fo(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-o,n-a,c,n,c],["C",n+a,c,u,r-o,u,r],["C",u,r+o,n+a,l,n,l],["C",n-a,l,s,r+o,s,r],["Z"]]}function Vo(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}function jo(t,e,n,r,i){if(i){var a=T(i,4),o=a[0],s=a[1],u=a[2],c=a[3],l=t>0?1:-1,h=e>0?1:-1,f=l+h!==0?1:0;return[["M",l*o+n,r],["L",t-l*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-l*u,e+r]:null,["L",n+l*c,e+r],c?["A",c,c,0,0,f,n,e+r-h*c]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,l*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"]]}var Yo=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},Ho=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Xo=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Wo=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;l(this,t),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=e,this.name=n,this.taps=[],this.interceptors=[],this._call=Yo,this.call=Yo,this._callAsync=Ho,this.callAsync=Ho,this._promise=Xo,this.promise=Xo,this._x=void 0}return f(t,[{key:"compile",value:function(t){throw Error("Abstract: should be overridden")}},{key:"_createCall",value:function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})}},{key:"_tap",value:function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!==s(e)||null===e)throw Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)}},{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"tapAsync",value:function(t,e){this._tap("async",t,e)}},{key:"tapPromise",value:function(t,e){this._tap("promise",t,e)}},{key:"_runRegisterInterceptors",value:function(t){var e,n=S(this.interceptors);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}}catch(t){n.e(t)}finally{n.f()}return t}},{key:"withOptions",value:function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}}},{key:"isUsed",value:function(){return this.taps.length>0||this.interceptors.length>0}},{key:"_resetCompilation",value:function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise}},{key:"_insert",value:function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var a=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=a){r++;break}}this.taps[r]=t}}]),t}(),zo=function(){function t(e){l(this,t),this.config=e,this.options=void 0,this._args=void 0}return f(t,[{key:"create",value:function(t){var e;switch(this.init(t),this.options.type){case"sync":e=Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw ".concat(t,";\n")},onResult:function(t){return"return ".concat(t,";\n")},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback(".concat(t,");\n")},onResult:function(t){return"_callback(null, ".concat(t,");\n")},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error(".concat(t,");\n")},onResult:function(t){return"_resolve(".concat(t,");\n")},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=Function(this.args(),i)}return this.deinit(),e}},{key:"setup",value:function(t,e){t._x=e.taps.map((function(t){return t.fn}))}},{key:"init",value:function(t){this.options=t,this._args=t.args.slice()}},{key:"deinit",value:function(){this.options=void 0,this._args=void 0}},{key:"contentWithInterceptors",value:function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,a="",o=0;this.options.interceptors.length>o;o++){var s=this.options.interceptors[o];s.call&&(a+="".concat(this.getInterceptor(o),".call(").concat(this.args({before:s.context?"_context":void 0}),");\n"))}return a+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+="".concat(e.getInterceptor(i),".error(").concat(t,");\n"))}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+="".concat(e.getInterceptor(i),".result(").concat(t,");\n"))}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+="".concat(e.getInterceptor(n),".done();\n"))}return t+=i()}}))}return this.content(t)}},{key:"header",value:function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t}},{key:"needContext",value:function(){var t,e=S(this.options.taps);try{for(e.s();!(t=e.n()).done;){if(t.value.context)return!0}}catch(t){e.e(t)}finally{e.f()}return!1}},{key:"callTap",value:function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,a=e.rethrowIfPossible,o="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(o+="var _tap".concat(t," = ").concat(this.getTap(t),";\n"),s=!0),o+="".concat(this.getInterceptor(u),".tap(").concat(c.context?"_context, ":"","_tap").concat(t,");\n"))}o+="var _fn".concat(t," = ").concat(this.getTapFn(t),";\n");var l=this.options.taps[t];switch(l.type){case"sync":a||(o+="var _hasError".concat(t," = false;\n"),o+="try {\n"),o+=r?"var _result".concat(t," = _fn").concat(t,"(").concat(this.args({before:l.context?"_context":void 0}),");\n"):"_fn".concat(t,"(").concat(this.args({before:l.context?"_context":void 0}),");\n"),a||(o+="} catch(_err) {\n",o+="_hasError".concat(t," = true;\n"),o+=n("_err"),o+="}\n",o+="if(!_hasError".concat(t,") {\n")),r&&(o+=r("_result".concat(t))),i&&(o+=i()),a||(o+="}\n");break;case"async":var h="";h+=r?"(function(_err".concat(t,", _result").concat(t,") {\n"):"(function(_err".concat(t,") {\n"),h+="if(_err".concat(t,") {\n"),h+=n("_err".concat(t)),h+="} else {\n",r&&(h+=r("_result".concat(t))),i&&(h+=i()),h+="}\n",h+="})",o+="_fn".concat(t,"(").concat(this.args({before:l.context?"_context":void 0,after:h}),");\n");break;case"promise":o+="var _hasResult".concat(t," = false;\n"),o+="var _promise".concat(t," = _fn").concat(t,"(").concat(this.args({before:l.context?"_context":void 0}),");\n"),o+="if (!_promise".concat(t," || !_promise").concat(t,".then)\n"),o+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise".concat(t," + ')');\n"),o+="_promise".concat(t,".then((function(_result").concat(t,") {\n"),o+="_hasResult".concat(t," = true;\n"),r&&(o+=r("_result".concat(t))),i&&(o+=i()),o+="}), function(_err".concat(t,") {\n"),o+="if(_hasResult".concat(t,") throw _err").concat(t,";\n"),o+=n("_err".concat(t)),o+="});\n"}return o}},{key:"callTapsSeries",value:function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,a=t.onDone,o=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return a();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||o,l="",h=a,f=0,v=function(t){var i=t;h!==a&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next".concat(i,"() {\n"),l+=h(),l+="}\n",h=function(){return"".concat(c?"return ":"","_next").concat(i,"();\n")});var o=h,v=function(t){return t?"":a()},p=e.callTap(i,{onError:function(t){return n(i,t,o,v)},onResult:r&&function(t){return r(i,t,o,v)},onDone:!r&&o,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return p}},p=this.options.taps.length-1;p>=0;p--)v(p);return l+=h()}},{key:"callTapsLooping",value:function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),a="";i||(a+="var _looper = (function() {\n",a+="var _loopAsync = false;\n"),a+="var _loop;\n",a+="do {\n",a+="_loop = false;\n";for(var o=0;this.options.interceptors.length>o;o++){var s=this.options.interceptors[o];s.loop&&(a+="".concat(this.getInterceptor(o),".loop(").concat(this.args({before:s.context?"_context":void 0}),");\n"))}return a+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var a="";return a+="if(".concat(e," !== undefined) {\n"),a+="_loop = true;\n",i||(a+="if(_loopAsync) _looper();\n"),a+=r(!0),a+="} else {\n",a+=n(),a+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),a+="} while(_loop);\n",i||(a+="_loopAsync = true;\n",a+="});\n",a+="_looper();\n"),a}},{key:"callTapsParallel",value:function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,a=t.rethrowIfPossible,o=t.onTap,s=void 0===o?function(t,e){return e()}:o;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:a});var u="";u+="do {\n",u+="var _counter = ".concat(this.options.taps.length,";\n"),i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var o=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,o,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,o,c),n+="}\n"},onDone:!r&&function(){return o()},rethrowIfPossible:a})}),o,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"}},{key:"args",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.before,n=t.after,r=this._args;return e&&(r=[e].concat(r)),n&&(r=r.concat(n)),0===r.length?"":r.join(", ")}},{key:"getTapFn",value:function(t){return"_x[".concat(t,"]")}},{key:"getTap",value:function(t){return"_taps[".concat(t,"]")}},{key:"getInterceptor",value:function(t){return"_interceptors[".concat(t,"]")}}]),t}(),qo=function(t){p(n,t);var e=x(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"content",value:function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})}}]),n}(zo),Zo=new qo,Ko=function(t){return Zo.setup(this,t),Zo.create(t)},Qo=function(t){p(n,t);var e=x(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return l(this,n),(t=e.call(this,r,i)).compile=Ko,t._call=void 0,t.call=void 0,t}return f(n)}(Wo),Jo=function(t){p(n,t);var e=x(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"content",value:function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if(".concat(n," !== undefined) {\n"),i+="".concat(e._args[0]," = ").concat(n,";\n"),i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})}}]),n}(zo),$o=new Jo,ts=function(t){return $o.setup(this,t),$o.create(t)},es=function(t){p(n,t);var e=x(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return l(this,n),(t=e.call(this,r,i)).compile=ts,t._call=void 0,t.call=void 0,t}return f(n)}(Wo),ns=function(t){p(n,t);var e=x(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"content",value:function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})}}]),n}(zo),rs=new ns,is=function(){throw Error("tapAsync is not supported on a SyncHook")},as=function(){throw Error("tapPromise is not supported on a SyncHook")},os=function(t){return rs.setup(this,t),rs.create(t)},ss=function(t){p(n,t);var e=x(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return l(this,n),(t=e.call(this,r,i)).tapAsync=is,t.tapPromise=as,t.compile=os,t}return f(n)}(Wo),us=function(t){p(n,t);var e=x(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"content",value:function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if(".concat(n," !== undefined) {\n"),i+="".concat(e._args[0]," = ").concat(n,";\n"),i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})}}]),n}(zo),cs=new us,ls=function(){throw Error("tapAsync is not supported on a SyncWaterfallHook")},hs=function(){throw Error("tapPromise is not supported on a SyncWaterfallHook")},fs=function(t){return cs.setup(this,t),cs.create(t)},vs=function(t){p(n,t);var e=x(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return l(this,n),(t=e.call(this,r,i)).tapAsync=ls,t.tapPromise=hs,t.compile=fs,t}return f(n)}(ss),ps=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ds=/([\"\'])[^\'\"]+\1/;var ys=1,gs="object"===("undefined"==typeof self?"undefined":s(self))&&self.self==self?self:"object"===("undefined"==typeof global?"undefined":s(global))&&global.global==global?global:{},ms=Date.now(),ks={},xs=Date.now(),Es=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-xs,r=n>16?0:16-n,i=ys++;return ks[i]=t,Object.keys(ks).length>1||setTimeout((function(){xs=e;var t=ks;ks={},Object.keys(t).forEach((function(e){return t[e](gs.performance&&"function"==typeof gs.performance.now?gs.performance.now():Date.now()-ms)}))}),r),i},bs=function(t){delete ks[t]},Ts=function(t){return"string"!=typeof t?Es:""===t?gs.requestAnimationFrame:gs[t+"RequestAnimationFrame"]},Ms=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!!Ts(t)})),ws=Ts(Ms),Ps=function(t){return"string"!=typeof t?bs:""===t?gs.cancelAnimationFrame:gs[t+"CancelAnimationFrame"]||gs[t+"CancelRequestAnimationFrame"]}(Ms);gs.requestAnimationFrame=ws,gs.cancelAnimationFrame=Ps;var Ss,Ns,Cs,As=[{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},{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",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"}],Os={},Rs=new WeakMap,Ls={},Is=Be((function(t){return t.sort((function(t,e){return Ls[t]-Ls[e]}))})),_s=rt(),Ds=rt(),Us=rt(),Gs=function(t,e){var n=Rs.get(t);return!n||0===n.length||n.includes(e)},Bs=function(){function e(){var t=this;l(this,e),As.forEach((function(e){t.registerMetadata(e)}))}return f(e,[{key:"registerMetadata",value:function(t){[t.n].concat(M(t.a||[])).forEach((function(e){Os[e]=t,Ls[e]=t.p||0}))}},{key:"unregisterMetadata",value:function(t){delete Os[t]}},{key:"getPropertySyntax",value:function(t){return hu.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]},i=r.skipUpdateAttribute,a=r.skipParse,o=r.forceUpdateGeometry,s=r.usedAttributes,u=o,c=Object.keys(e);c.forEach((function(n){var r,a=Qe(n);i||(t.attributes[a]=e[n]),!u&&(null===(r=Os[a])||void 0===r?void 0:r.l)&&(u=!0)})),a||c.forEach((function(e){t.computedStyle[e]=n.parseProperty(e,t.attributes[e],t)})),(c=Is((null==s?void 0:s.length)?Array.from(new Set(c.concat(s))):c)).forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=n.computeProperty(e,t.computedStyle[e],t))})),u&&this.updateGeometry(t),c.forEach((function(e){e in t.parsedStyle&&n.postProcessProperty(e,t)})),t.children.length&&c.forEach((function(e){e in t.parsedStyle&&n.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))}},{key:"parseProperty",value:function(t,e,n){var r=Os[t],i=e;if((""===e||we(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=$n(e);else if(r){var a=r.k,o=r.syntax,s=o&&this.getPropertySyntax(o);a&&a.indexOf(e)>-1?i=$n(e):s&&s.parser&&(i=s.parser(e,n))}return i}},{key:"computeProperty",value:function(t,e,n){var r=Os[t],i=e;if(r){var a=r.syntax,o=r.d;if(e instanceof Mn){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)we(o)||(e=this.parseProperty(t,Ze(o)?o(n.nodeName):o,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return we(u)?void this.addUnresolveProperty(n,t):u}}var c=a&&this.getPropertySyntax(a);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof Mn?e.value:e}return i}},{key:"postProcessProperty",value:function(t,e){var n=Os[t];if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}}},{key:"addUnresolveProperty",value:function(t,e){var n=Rs.get(t);n||(Rs.set(t,[]),n=Rs.get(t)),-1===n.indexOf(e)&&n.push(e)}},{key:"tryToResolveProperty",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.inherited;if(r&&t.parentElement&&Gs(t.parentElement,e)){var i=t.parentElement.parsedStyle[e];if("unset"===i||"initial"===i||"inherit"===i)return;return i}}},{key:"recalc",value:function(t){var e=Rs.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Rs.delete(t)}}},{key:"updateGeometry",value:function(e){var n=hu.geometryUpdaterFactory[e.nodeName];if(n){var r=e.geometry;r.contentBounds||(r.contentBounds=new Fe),r.renderBounds||(r.renderBounds=new Fe);var i=e.parsedStyle,a=n.update(i,e),o=a.width,s=a.height,u=a.depth,c=void 0===u?0:u,l=a.offsetX,h=void 0===l?0:l,f=a.offsetY,v=void 0===f?0:f,p=a.offsetZ,d=void 0===p?0:p,y=0>o,g=0>s,m=ut(_s,Math.abs(o)/2,Math.abs(s)/2,c/2),k=i.stroke,x=i.lineWidth,E=i.increasedLineWidthForHitTesting,b=i.shadowType,T=i.shadowColor,M=i.filter,w=void 0===M?[]:M,P=i.transformOrigin,S=i.anchor;e.nodeName===t.Shape.TEXT&&delete i.anchor;var N=ut(Ds,(1-2*(S&&S[0]||0))*o/2+h,(1-2*(S&&S[1]||0))*s/2+v,(1-2*(S&&S[2]||0))*m[2]+d);if(r.contentBounds.update(N,m),k&&!k.isNone){var C=((x||0)+(E||0))*(e.nodeName===t.Shape.POLYLINE||e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.PATH?Math.SQRT2:.5);ct(m,m,ut(Us,C,C,0))}if(r.renderBounds.update(N,m),T&&b&&"inner"!==b){var A=r.renderBounds,O=A.min,R=A.max,L=i.shadowBlur||0,I=i.shadowOffsetX||0,_=i.shadowOffsetY||0,D=R[0]+L+I,U=O[1]-L+_,G=R[1]+L+_;O[0]=Math.min(O[0],O[0]-L+I),R[0]=Math.max(R[0],D),O[1]=Math.min(O[1],U),R[1]=Math.max(R[1],G),r.renderBounds.setMinMax(O,R)}w.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ct(r.renderBounds.halfExtents,r.renderBounds.halfExtents,ot(i,i,0)))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,c=u.min,l=u.max,h=l[0]+s+a,f=c[1]-s+o,v=l[1]+s+o;c[0]=Math.min(c[0],c[0]-s+a),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],v),r.renderBounds.setMinMax(c,l)}})),S=i.anchor;var B=(y?-1:1)*Jr(P[0],0,e),F=(g?-1:1)*Jr(P[1],1,e);e.setOrigin(B-=(y?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,F-=(g?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2),hu.sceneGraphService.dirtifyToRoot(e)}}},{key:"isPropertyInheritable",value:function(t){var e=Os[t];return!!e&&e.inh}}]),e}();(Ss=t.CameraType||(t.CameraType={}))[Ss.ORBITING=0]="ORBITING",Ss[Ss.EXPLORING=1]="EXPLORING",Ss[Ss.TRACKING=2]="TRACKING",(Ns=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Ns.DEFAULT=0]="DEFAULT",Ns[Ns.ROTATIONAL=1]="ROTATIONAL",Ns[Ns.TRANSLATIONAL=2]="TRANSLATIONAL",Ns[Ns.CINEMATIC=3]="CINEMATIC",(Cs=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Cs.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Cs[Cs.PERSPECTIVE=1]="PERSPECTIVE";var Fs,Vs={UPDATED:"updated"},js=2e-4,Ys=function(){function e(){l(this,e),this.canvas=void 0,this.eventEmitter=new da,this.matrix=R(),this.right=ot(1,0,0),this.up=ot(0,1,0),this.forward=ot(0,0,1),this.position=ot(0,0,1),this.focalPoint=ot(0,0,0),this.distanceVector=ot(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=R(),this.projectionMatrixInverse=R(),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 Ye,this.orthoMatrix=R()}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 U(R(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=H(R(),[t,e,0]);this.jitteredProjectionMatrix=B(R(),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=ot(o.x-r,o.y-i,0),u=vt(s,this.right)/at(this.right),c=vt(s,this.up)/at(this.up);return this.pan(-u,-c),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(lo(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,c=-.5*u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,o-=this.view.offsetY*s/h,u*=this.view.width/l,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),c=(r+i)/(r-i),l=-(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]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,c,c+u,o,o-s,e,this.far),V(this.projectionMatrix,this.projectionMatrix,ot(1,-1,1)),U(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),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=l-u,v=l+u,p=h+c,d=h-c;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;v=(f+=y*this.view.offsetX)+y*this.view.width,d=(p-=g*this.view.offsetY)-g*this.view.height}return $(this.projectionMatrix,f,v,d,p,a,o),V(this.projectionMatrix,this.projectionMatrix,ot(1,-1,1)),U(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2],r=co(t,e,n);return this._setPosition(r),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=ot(0,1,0);if(this.focalPoint=co(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=lt(rt(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=at(a),s=ho(Math.asin(n/o)),u=90+ho(Math.atan2(r,e)),c=R();Y(c,c,lo(u)),j(c,c,lo(s)),i=dt(rt(),[0,1,0],c)}return U(this.matrix,tt(R(),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,js>this.distance&&(this.distance=js),this.dollyingStep=this.distance/100;var e=rt(),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=uo(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=uo(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=uo(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(Tt(),[0,0,1],lo(this.roll));_(this.matrix);var n=Mt(Tt(),[1,0,0],lo((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=Mt(Tt(),[0,1,0],lo((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=wt(Tt(),r,n);i=wt(Tt(),i,e);var a=K(R(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(F(this.matrix,this.matrix,this.focalPoint),B(this.matrix,this.matrix,a),F(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(F(this.matrix,this.matrix,this.position),B(this.matrix,this.matrix,a))}},{key:"_setPosition",value:function(t,e,n){this.position=co(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(){st(this.right,co(bt(Et(),[1,0,0,0],this.matrix))),st(this.up,co(bt(Et(),[0,1,0,0],this.matrix))),st(this.forward,co(bt(Et(),[0,0,1,0],this.matrix))),ft(this.right,this.right),ft(this.up,this.up),ft(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=at(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=ho(Math.asin(n/i)),this.azimuth=ho(Math.atan2(-e,-r))):(this.elevation=-ho(Math.asin(n/i)),this.azimuth=-ho(Math.atan2(-e,-r)))}},{key:"_getPosition",value:function(){st(this.position,co(bt(Et(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=O(),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)),ct(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=lt(rt(),this.focalPoint,this.position),this.distance=at(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=Mt(Tt(),[0,0,1],-this.roll*Math.PI/180);Z(this.orthoMatrix,n,ot((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),ot(this.zoom,this.zoom,1),e)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=B(R(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Vs.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(ln)}},{key:"pan",value:function(t,e){throw Error(ln)}},{key:"dolly",value:function(t){throw Error(ln)}},{key:"createLandmark",value:function(t,e){throw Error(ln)}},{key:"gotoLandmark",value:function(t,e){throw Error(ln)}}]),e}(),Hs=function(){function t(){l(this,t)}return f(t,[{key:"update",value:function(t,e){var n=t.r;return{width:2*n,height:2*n}}}]),t}(),Xs=function(){function t(){l(this,t)}return f(t,[{key:"update",value:function(t,e){return{width:2*t.rx,height:2*t.ry}}}]),t}(),Ws=function(){function t(){l(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}(),zs=function(){function t(){l(this,t)}return f(t,[{key:"update",value:function(t){var e=t.path.rect;return{width:e.width,height:e.height}}}]),t}(),qs=function(){function t(){l(this,t)}return f(t,[{key:"update",value:function(t){var e=t.points.points,n=Math.min.apply(Math,M(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,M(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,M(e.map((function(t){return t[1]}))));return{width:r-n,height:Math.max.apply(Math,M(e.map((function(t){return t[1]}))))-i}}}]),t}(),Zs=function(){function t(){l(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&&!Re(n)&&(a||(t.width=a=n.width),o||(t.height=o=n.height)),{width:a,height:o}}}]),t}(),Ks=function(){function t(e){l(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&&!we(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,c=t.dy,l=((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,l);t.metrics=h;var f=[h.width/2,h.height/2,0],v=[0,1],p=0;"center"===a||"middle"===a?(p=o/2,v=[.5,1]):"right"!==a&&"end"!==a||(p=o,v=[1,1]);var d=0;return"middle"===s?d=f[1]:"top"===s||"hanging"===s?d=2*f[1]:"alphabetic"===s?d=h.lineHeight-h.fontProperties.ascent:"bottom"!==s&&"ideographic"!==s||(d=0),u&&(p+=u),c&&(d+=c),t.anchor=[v[0],v[1],0],{width:2*f[0],height:2*f[1],offsetX:p,offsetY:d}}}]),t}(),Qs=function(){function t(e,n){var r=this;l(this,t),this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new da,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=R(),this.tmpVec3=rt(),this.onPointerDown=function(){var t=c(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Na){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,r.createPointerEvent(e);case 4:r.dispatchEvent(n=t.sent,"pointerdown"),"touch"===n.pointerType?r.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||r.dispatchEvent(n,2===n.button?"rightdown":"mousedown"),r.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),r.freeEvent(n);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=c(o().mark((function t(e){var n,i,a,s,u,c,l,h,f;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Na){t.next=2;break}return t.abrupt("return");case 2:return n=performance.now(),t.next=5,r.createPointerEvent(e);case 5:if(r.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?r.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.dispatchEvent(i,2===i.button?"rightup":"mouseup"),a=r.trackingData(e.pointerId),s=r.findMountedTarget(a.pressTargetsByButton[e.button]),u=s,s&&!i.composedPath().includes(s)){for(c=s;c&&!i.composedPath().includes(c);)i.currentTarget=c,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?r.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),ga.isNode(c)&&(c=c.parentNode);delete a.pressTargetsByButton[e.button],u=c}u&&((h=r.clonePointerEvent(i,"click")).target=u,h.path=[],a.clicksByButton[e.button]||(a.clicksByButton[e.button]={clickCount:0,target:h.target,timeStamp:n}),(f=a.clicksByButton[e.button]).target===h.target&&200>n-f.timeStamp?++f.clickCount:f.clickCount=1,f.target=h.target,f.timeStamp=n,h.detail=f.clickCount,(null===(l=i.detail)||void 0===l?void 0:l.preventClick)||("mouse"!==h.pointerType&&"touch"!==h.pointerType||r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)),r.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=c(o().mark((function t(e){var n,i,a,s,u,c,l,h,f,v;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Na){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,r.createPointerEvent(e);case 4:if(i="mouse"===(n=t.sent).pointerType||"pen"===n.pointerType,a=r.trackingData(e.pointerId),s=r.findMountedTarget(a.overTargets),!a.overTargets||s===n.target){t.next=23;break}return u="mousemove"===e.type?"mouseout":"pointerout",t.next=12,r.createPointerEvent(e,u,s||void 0);case 12:if(r.dispatchEvent(c=t.sent,"pointerout"),i&&r.dispatchEvent(c,"mouseout"),n.composedPath().includes(s)){t.next=22;break}return t.next=18,r.createPointerEvent(e,"pointerleave",s||void 0);case 18:for((l=t.sent).eventPhase=l.AT_TARGET;l.target&&!n.composedPath().includes(l.target);)l.currentTarget=l.target,r.notifyTarget(l),i&&r.notifyTarget(l,"mouseleave"),ga.isNode(l.target)&&(l.target=l.target.parentNode);r.freeEvent(l);case 22:r.freeEvent(c);case 23:if(s===n.target){t.next=38;break}h=r.clonePointerEvent(n,"mousemove"===e.type?"mouseover":"pointerover"),r.dispatchEvent(h,"pointerover"),i&&r.dispatchEvent(h,"mouseover"),f=s&&ga.isNode(s)&&s.parentNode;case 29:if(!f||f===(ga.isNode(r.rootTarget)&&r.rootTarget.parentNode)){t.next=35;break}if(f!==n.target){t.next=32;break}return t.abrupt("break",35);case 32:f=f.parentNode,t.next=29;break;case 35:if(!f||f===(ga.isNode(r.rootTarget)&&r.rootTarget.parentNode)){for((v=r.clonePointerEvent(n,"pointerenter")).eventPhase=v.AT_TARGET;v.target&&v.target!==s&&v.target!==(ga.isNode(r.rootTarget)&&r.rootTarget.parentNode);)v.currentTarget=v.target,r.notifyTarget(v),i&&r.notifyTarget(v,"mouseenter"),ga.isNode(v.target)&&(v.target=v.target.parentNode);r.freeEvent(v)}r.freeEvent(h);case 38:r.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&r.dispatchEvent(n,"touchmove"),i&&(r.dispatchEvent(n,"mousemove"),r.cursor=r.getCursor(n.target)),a.overTargets=n.composedPath(),r.freeEvent(n);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=c(o().mark((function t(e){var n,i,a,s,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Na){t.next=2;break}return t.abrupt("return");case 2:if(!(n=r.trackingData(e.pointerId)).overTargets){t.next=19;break}return i="mouse"===e.pointerType||"pen"===e.pointerType,a=r.findMountedTarget(n.overTargets),t.next=8,r.createPointerEvent(e,"pointerout",a||void 0);case 8:return r.dispatchEvent(s=t.sent),i&&r.dispatchEvent(s,"mouseout"),t.next=13,r.createPointerEvent(e,"pointerleave",a||void 0);case 13:for((u=t.sent).eventPhase=u.AT_TARGET;u.target&&u.target!==(ga.isNode(r.rootTarget)&&r.rootTarget.parentNode);)u.currentTarget=u.target,r.notifyTarget(u),i&&r.notifyTarget(u,"mouseleave"),ga.isNode(u.target)&&(u.target=u.target.parentNode);n.overTargets=null,r.freeEvent(s),r.freeEvent(u);case 19:r.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=c(o().mark((function t(e){var n,i,a,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Na){t.next=2;break}return t.abrupt("return");case 2:return n=r.trackingData(e.pointerId),t.next=5,r.createPointerEvent(e);case 5:for(a="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,r.dispatchEvent(i,"pointerover"),a&&r.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(r.cursor=r.getCursor(i.target)),(s=r.clonePointerEvent(i,"pointerenter")).eventPhase=s.AT_TARGET;s.target&&s.target!==(ga.isNode(r.rootTarget)&&r.rootTarget.parentNode);)s.currentTarget=s.target,r.notifyTarget(s),a&&r.notifyTarget(s,"mouseenter"),ga.isNode(s.target)&&(s.target=s.target.parentNode);n.overTargets=i.composedPath(),r.freeEvent(i),r.freeEvent(s);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=c(o().mark((function t(e){var n,i,a,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Na){t.next=2;break}return t.abrupt("return");case 2:return n=r.trackingData(e.pointerId),i=r.findMountedTarget(n.pressTargetsByButton[e.button]),t.next=6,r.createPointerEvent(e);case 6:if(a=t.sent,i){for(s=i;s;)a.currentTarget=s,r.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType||"mouse"!==a.pointerType&&"pen"!==a.pointerType||r.notifyTarget(a,2===a.button?"rightupoutside":"mouseupoutside"),ga.isNode(s)&&(s=s.parentNode);delete n.pressTargetsByButton[e.button]}r.freeEvent(a);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=c(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ca){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,r.createWheelEvent(e);case 4:r.dispatchEvent(n=t.sent),r.freeEvent(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.globalRuntime=e,this.context=n}var e,n,r,i;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("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}},{key:"client2Viewport",value:function(t){var e=this.context.contextService.getBoundingClientRect();return new He(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 He(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(),c=B(this.tmpMatrix,u,s),l=ut(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return dt(l,l,c),new He(l[0],l[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=B(this.tmpMatrix,n,r),a=ut(this.tmpVec3,t.x,t.y,0);dt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new He((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++)ga.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:(i=c(o().mark((function t(e){var n,r,i,a,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,a=(i=this.context.config).width,s=i.height,!(0>(n=e.viewportX)||0>r||n>a||r>s)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{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=S(this.globalRuntime.displayObjectPool.getHTMLs());try{for(n.s();!(e=n.n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}}catch(t){n.e(t)}finally{n.f()}}return null}},{key:"pickTarget",value:(r=c(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"createPointerEvent",value:(n=c(o().mark((function t(e,n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(Na),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,a=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=a,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return n.apply(this,arguments)})},{key:"createWheelEvent",value:(e=c(o().mark((function t(e){var n,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Ca),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{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(Ca);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(Na);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){t instanceof Na&&e instanceof Na&&(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){t instanceof Sa&&e instanceof Sa&&(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||ga.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Pa.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=ga.isNode(e)&&e.parentNode}}}]),t}(),Js=function(){function t(){l(this,t),this.canvas=void 0,this.context=void 0}return f(t,[{key:"getOrCreateCanvas",value:function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),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")}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t){return this.context||this.getOrCreateCanvas(t),this.context}}]),t}();(Fs=t.RenderReason||(t.RenderReason={}))[Fs.CAMERA_CHANGED=0]="CAMERA_CHANGED",Fs[Fs.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Fs[Fs.NONE=2]="NONE";var $s,tu,eu,nu=function(){function e(n,r){l(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 pa(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new Qo,dirtycheck:new vs(["object"]),cull:new vs(["object","camera"]),beginFrame:new ss([]),beforeRender:new ss(["objectToRender"]),render:new ss(["objectToRender"]),afterRender:new ss(["objectToRender"]),endFrame:new ss([]),destroy:new ss([]),pick:new es(["result"]),pickSync:new vs(["result"]),pointerDown:new ss(["event"]),pointerUp:new ss(["event"]),pointerMove:new ss(["event"]),pointerOut:new ss(["event"]),pointerOver:new ss(["event"]),pointerWheel:new ss(["event"]),pointerCancel:new ss(["event"])},this.globalRuntime=n,this.context=r}var n;return f(e,[{key:"init",value:(n=c(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)})),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){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var n=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(n.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),n.renderReasons.size&&this.inited&&(this.renderDisplayObject(n.root,t,n),this.hooks.beginFrame.call(),n.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),n.renderListCurrentFrame=[],n.renderReasons.clear())}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;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 c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(en),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),l&&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()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)}}]),e}(),ru=/\[\s*(.*)=(.*)\s*\]/,iu=function(){function t(){l(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(ru),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 we(n)?"":n.toString?""+n:""}}]),t}(),au=function(){function e(n){var r,i,a,o,s,u,c,h,f=this;l(this,e),this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new pa(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(r=Tt(),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ot(e,n,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=Tt();Nt(o,e[0],e[1],e[2]);var s=f.getRotation(t),u=f.getRotation(t.parentNode);Dt(r,u),St(r,r),wt(o,r,o),wt(a.localRotation,o,s),Gt(a.localRotation,a.localRotation),f.dirtifyLocal(t,a)}else f.rotateLocal(t,e)}),this.rotateLocal=(i=Tt(),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ot(e,n,r));var a=t.transformable;Nt(i,e[0],e[1],e[2]),Ut(a.localRotation,a.localRotation,i),f.dirtifyLocal(t,a)}),this.setEulerAngles=(a=Tt(),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ot(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Nt(i.localRotation,e[0],e[1],e[2]);var o=f.getRotation(t.parentNode);Dt(a,St(Tt(),o)),Ut(i.localRotation,i.localRotation,a),f.dirtifyLocal(t,i)}else f.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ot(e,n,r));var i=t.transformable;gt(e,rt())||(yt(e,e,i.localRotation),ct(i.localPosition,i.localPosition,e),f.dirtifyLocal(t,i))},this.setPosition=(o=R(),s=rt(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,gt(f.getPosition(t),s)||(st(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(L(o,t.parentNode.transformable.worldTransform),U(o,o),dt(n.localPosition,s,o)):st(n.localPosition,s),f.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=rt();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,gt(r.localPosition,t)||(st(r.localPosition,t),f.dirtifyLocal(e,r))}}(),this.translate=(u=rt(),c=rt(),h=rt(),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ut(c,e,n,r)),gt(e,u)||(ct(h,f.getPosition(t),e),f.setPosition(t,h))}),this.setRotation=function(){var t=Tt();return function(e,n,r,i,a){var o=e.transformable;if("number"==typeof n&&(n=_t(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var s=f.getRotation(e.parentNode);Dt(t,s),St(t,t),wt(o.localRotation,t,n),Gt(o.localRotation,o.localRotation),f.dirtifyLocal(e,o)}else f.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=R(),e=rt(),n=_t(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Z(r.localTransform,r.localRotation,r.localPosition,ot(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=_(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),B(r.localTransform,r.localTransform,i)}var a=Z(t,n,e,r.localScale,r.origin);B(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;t.parentNode&&this.detach(t),t.parentNode=e,we(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null==a||null===(r=a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(a.dirty=!0);var o=t.transformable;o&&this.dirtifyWorld(t,o),o.frozen&&this.unfreezeParentToRoot(t)}},{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){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ot(e,n,r));var i=t.transformable;if(!gt(e,i.origin)){var a=i.origin;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,this.dirtifyLocal(t,i)}}},{key:"setLocalEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=ot(e,n,r));var i=t.transformable;Nt(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)}},{key:"scaleLocal",value:function(t,e){var n,r,i,a=t.transformable;n=a.localScale,r=a.localScale,i=ot(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=ot(e[0],e[1],e[2]||n.localScale[2]);gt(r,n.localScale)||(st(n.localScale,r),this.dirtifyLocal(t,n))}},{key:"setLocalRotation",value:function(t,e,n,r,i){"number"==typeof e&&(e=_t(e,n,r,i));var a=t.transformable;Dt(a.localRotation,e),this.dirtifyLocal(t,a)}},{key:"setLocalSkew",value:function(t,e,n){"number"==typeof e&&(e=Bt(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.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=T(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.pendingEvents=[],e.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;){var r=n.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0),n=n.parentNode}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),r.dispatchEvent(new Ea(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Ea.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return W(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return q(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return z(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=W(rt(),e),r=q(Tt(),e),i=z(rt(),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>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(Fe.isEmpty(r))return null;var i=n||new Fe;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry,r=e?n.renderBounds:n.contentBounds||null;return r||new Fe}},{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),o=t.childNodes;if(o.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Fe).update(r.center,r.halfExtents))})),n){var s=nn(t);if(s){var u=s.style.clipPath.getBounds(n);a?u&&(a=u.intersection(a)):a=u}}return a||(a=new Fe),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=R();t.parentNode.transformable&&(e=U(R(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Fe.isEmpty(n)){var r=new Fe;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r,i=this.getGeometryBounds(t);Fe.isEmpty(i)||(r=new Fe).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=T(r.getMin(),2),s=o[0],u=o[1],c=T(r.getMax(),2);return new Xe(s+((null==a?void 0:a.left)||0),u+((null==a?void 0:a.top)||0),c[0]-s,c[1]-u)}return new Xe((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?B(e.worldTransform,r.worldTransform,e.localTransform):L(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}(),ou={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]},su=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,uu=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),cu=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),lu=function(){function t(e){var n=this;l(this,t),this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!cu.exec(e)&&!uu.exec(t))},this.trimByKinsokuShorui=function(t){var e=M(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=ou.MetricsString+ou.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ou.BaselineSymbol).width),u=ou.HeightMultiplier*s;s=s*ou.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 c=i.getImageData(0,0,o||1,u||1).data,l=c.length,h=4*o,f=0,v=0,p=!1;for(f=0;s>f;++f){for(var d=0;h>d;d+=4)if(255!==c[v+d]){p=!0;break}if(p)break;v+=h}for(n.ascent=s-f,v=l-h,p=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==c[v+y]){p=!0;break}if(p)break;v-=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,c=e.letterSpacing,l=e.textPath,h=e.leading,f=void 0===h?0:h,v=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=Ie(e)&&"".concat(e,"px")||"16px",s=Re(n)?n.split(","):[n],u=s.length-1;u>=0;u--){var c=s[u].trim();!ds.test(c)&&0>ps.indexOf(c)&&(c='"'.concat(c,'"')),s[u]=c}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))}(e),p=this.measureFont(v,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var d=this.runtime.offscreenCanvas.getOrCreateContext(n);d.font=v,e.isOverflowing=!1;var y=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),g=Array(y.length),m=0;if(!l){for(var k=0;y.length>k;k++){var x=d.measureText(y[k]).width+(y[k].length-1)*c;g[k]=x,m=Math.max(m,x)}var E=m+o,b=a||p.fontSize+o,T=Math.max(b,p.fontSize+o)+(y.length-1)*(b+f),M=0;return"middle"===s?M=-T/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?M=-T:"top"!==s&&"hanging"!==s||(M=0),{font:v,width:E,height:T,lines:y,lineWidths:g,lineHeight:b+=f,maxLineWidth:m,fontProperties:p,lineMetrics:g.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Xe(n-o/2,M+e*b,t+o,b)}))}}l.getTotalLength(),l.getPoint(0);for(var w=0;y.length>w;w++)d.measureText(y[w])}},{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,c=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),h=a+o,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var v=[],p=0,d=0,y={},g=function(t){return r.getFromCache(t,o,y,l)},m=Array.from(f).reduce((function(t,e){return t+g(e)}),0),k=Array.from(t),x=0;k.length>x;x++){var E=k[x],b=t[x-1],T=t[x+1],M=g(E);if(this.isNewline(E)){if(++p>=u){e.isOverflowing=!0;break}d=0,v[p]=""}else{if(d>0&&d+M>h){if(p+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var w=v[p].length,P=0,S=w,N=0;w>N;N++){var C=g(v[p][N]);if(P+C+m>h){S=N;break}P+=C}v[p]=(v[p]||"").slice(0,S)+f}break}if(d=0,v[++p]="",this.isBreakingSpace(E))continue;this.canBreakInLastChar(E)||(v=this.trimToBreakable(v),d=this.sumTextWidthByCache(v[p]||"",y)),this.shouldBreakByKinsokuShorui(E,T)&&(v=this.trimByKinsokuShorui(v),d+=g(b||""))}d+=M,v[p]=(v[p]||"")+E}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ou.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ou.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=M(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||!su.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(!su.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}(),hu={},fu=(tu=new Zs,eu=new qs,v($s={},t.Shape.CIRCLE,new Hs),v($s,t.Shape.ELLIPSE,new Xs),v($s,t.Shape.RECT,tu),v($s,t.Shape.IMAGE,tu),v($s,t.Shape.GROUP,tu),v($s,t.Shape.LINE,new Ws),v($s,t.Shape.TEXT,new Ks(hu)),v($s,t.Shape.POLYLINE,eu),v($s,t.Shape.POLYGON,eu),v($s,t.Shape.PATH,new zs),v($s,t.Shape.HTML,null),v($s,t.Shape.MESH,null),$s),vu=function(){var e,n=new zi,r=new Ki;return v(e={},t.PropertySyntax.PERCENTAGE,null),v(e,t.PropertySyntax.NUMBER,new ea),v(e,t.PropertySyntax.ANGLE,new Xi),v(e,t.PropertySyntax.DEFINED_PATH,new Wi),v(e,t.PropertySyntax.PAINT,n),v(e,t.PropertySyntax.COLOR,n),v(e,t.PropertySyntax.FILTER,new qi),v(e,t.PropertySyntax.LENGTH,r),v(e,t.PropertySyntax.LENGTH_PERCENTAGE,r),v(e,t.PropertySyntax.LENGTH_PERCENTAGE_12,new Qi),v(e,t.PropertySyntax.LENGTH_PERCENTAGE_14,new Ji),v(e,t.PropertySyntax.COORDINATE,new $i),v(e,t.PropertySyntax.OFFSET_DISTANCE,new na),v(e,t.PropertySyntax.OPACITY_VALUE,new ra),v(e,t.PropertySyntax.PATH,new ia),v(e,t.PropertySyntax.LIST_OF_POINTS,new aa),v(e,t.PropertySyntax.SHADOW_BLUR,new oa),v(e,t.PropertySyntax.TEXT,new sa),v(e,t.PropertySyntax.TEXT_TRANSFORM,new ua),v(e,t.PropertySyntax.TRANSFORM,new ca),v(e,t.PropertySyntax.TRANSFORM_ORIGIN,new la),v(e,t.PropertySyntax.Z_INDEX,new ha),v(e,t.PropertySyntax.MARKER,new ta),e}();hu.CameraContribution=Ys,hu.AnimationTimeline=null,hu.EasingFunction=null,hu.offscreenCanvas=new Js,hu.displayObjectPool=new Va,hu.sceneGraphSelector=new iu,hu.sceneGraphService=new au(hu),hu.textService=new lu(hu),hu.geometryUpdaterFactory=fu,hu.CSSPropertySyntaxFactory=vu,hu.styleValueRegistry=new Bs,hu.layoutRegistry=null;var pu=function(){function t(){l(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}(),du=function(){function t(e){l(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}(),yu=function(){function e(t){l(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 pa(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}]),e}();yu.tag="Culling";var gu=function(){function t(){l(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}();gu.tag="DirtyCheck";var mu=function(){function t(){var e=this;l(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Na(null),this.rootWheelEvent=new Ca(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=S(e.normalizeToPointerEvent(t,i));try{for(o.s();!(a=o.n()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,a.value,i);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(){var t=c(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),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=S(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i);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=S(n.normalizeToPointerEvent(t,i));try{for(o.s();!(a=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,a.value,i);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)}},{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||we(r)||we(i)){var s=this.context.eventService.client2Viewport(new He(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){t.view=n,t.originalEvent=null,t.nativeEvent=e,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 r=this.getViewportXY(e),i=r.y;t.viewport.x=r.x,t.viewport.y=i;var a=this.context.eventService.viewport2Canvas(t.viewport),o=a.y;return t.canvas.x=a.x,t.canvas.y=o,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=fn[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];Ge(i.button)&&(i.button=0),Ge(i.buttons)&&(i.buttons=1),Ge(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ge(i.width)&&(i.width=i.radiusX||1),Ge(i.height)&&(i.height=i.radiusY||1),Ge(i.tiltX)&&(i.tiltX=0),Ge(i.tiltY)&&(i.tiltY=0),Ge(i.pointerType)&&(i.pointerType="touch"),Ge(i.pointerId)&&(i.pointerId=i.identifier||0),Ge(i.pressure)&&(i.pressure=i.force||.5),Ge(i.twist)&&(i.twist=0),Ge(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;Ge(a.isPrimary)&&(a.isPrimary=!0),Ge(a.width)&&(a.width=1),Ge(a.height)&&(a.height=1),Ge(a.tiltX)&&(a.tiltX=0),Ge(a.tiltY)&&(a.tiltY=0),Ge(a.pointerType)&&(a.pointerType="mouse"),Ge(a.pointerId)&&(a.pointerId=1),Ge(a.pressure)&&(a.pressure=.5),Ge(a.twist)&&(a.twist=0),Ge(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}]),t}();mu.tag="Event";var ku,xu=[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],Eu=function(){function e(){l(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(Fe.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=xu.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!o||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>vt(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>vt(h,n.getNegativeFarPoint(i[s]))+f&&(a|=c)}}return a}}]),e}(),bu=function(){function e(){l(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()},l=function(t){var e=t.target;hu.styleValueRegistry.recalc(e),hu.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),hu.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,c(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.addEventListener(t.ElementEvent.MOUNTED,l),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,l),a.removeEventListener(t.ElementEvent.UNMOUNTED,h),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,u)})),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=T(i.getMin(),2),o=a[0],s=a[1],u=T(i.getMax(),2),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=o,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}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}();bu.tag="Prepare",(ku=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",ku.BEFORE_RENDER="beforerender",ku.AFTER_RENDER="afterrender",ku.BEFORE_DESTROY="beforedestroy",ku.AFTER_DESTROY="afterdestroy",ku.RESIZE="resize",ku.DIRTY_RECTANGLE="dirtyrectangle";var Tu=new pa(t.ElementEvent.MOUNTED),Mu=new pa(t.ElementEvent.UNMOUNTED),wu=new pa(t.CanvasEvent.BEFORE_RENDER),Pu=new pa(t.CanvasEvent.AFTER_RENDER),Su=function(e){p(u,e);var n,i,s=x(u);function u(e){var n;l(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=Ia,n.frameId=void 0,n.inited=!1,n.readyPromise=void 0,n.resolveReadyPromise=void 0,n.context={},n.document=new xa,n.document.defaultView=m(n),n.customElements=new fa;var r=e.container,i=e.canvas,a=e.offscreenCanvas,h=e.width,f=e.height,v=e.devicePixelRatio,p=e.renderer,d=e.background,y=e.cursor,g=e.document,k=e.requestAnimationFrame,x=e.cancelAnimationFrame,E=e.createImage,b=e.supportsPointerEvents,T=e.supportsTouchEvents,M=e.supportsCSSTransform,w=e.isTouchEvent,P=e.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||$e++;Je[n]&&Je[n].destroy(),Je[n]=e}}(r,m(n));var S=h,N=f,C=v;return i&&(C=1>(C=v||tn&&window.devicePixelRatio||1)?1:Math.ceil(C),S=h||function(t){var e=rn(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/C,N=f||function(t){var e=rn(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/C),n.devicePixelRatio=C,n.requestAnimationFrame=null!=k?k:ws.bind(globalThis),n.cancelAnimationFrame=null!=x?x:Ps.bind(globalThis),n.supportsTouchEvents=null!=T?T:"ontouchstart"in globalThis,n.supportsPointerEvents=null!=b?b:!!globalThis.PointerEvent,n.isTouchEvent=null!=w?w:function(t){return n.supportsTouchEvents&&t instanceof globalThis.TouchEvent},n.isMouseEvent=null!=P?P:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:S,height:N,renderer:p,offscreenCanvas:a,devicePixelRatio:C,cursor:y||"default",background:d||"transparent",createImage:E,document:g,supportsCSSTransform:M}),n.initDefaultCamera(S,N),c(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.initRenderer(p);case 2:n.dispatchEvent(new pa(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 hu.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(Vs.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];if(n||this.dispatchEvent(new pa(t.CanvasEvent.BEFORE_DESTROY)),this.frameId){var r=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;r(this.frameId)}var i=this.getRoot();this.unmountChildren(i),e&&this.document.destroy(),this.getRenderingService().destroy(),this.getContextService().destroy(),n||this.dispatchEvent(new pa(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 pa(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(){this.dispatchEvent(wu),this.getRenderingService().render(this.getConfig()),this.dispatchEvent(Pu)}},{key:"run",value:function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()}},{key:"initRenderer",value:(i=c(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 mu,new bu,new gu,new yu([new Eu])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(a(a({},hu),this.context)),this.context.renderingService=new nu(hu,this.context),this.context.eventService=new Qs(hu,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()}))}},{key:"setRenderer",value:(n=c(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),M(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy()})),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(Mu):(Mu.target=t,this.dispatchEvent(Mu,!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(Tu):(Tu.target=t,this.dispatchEvent(Tu,!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=Fe,t.AbstractRenderer=du,t.AbstractRendererPlugin=pu,t.BUILT_IN_PROPERTIES=As,t.CSS=qn,t.CSSGradientValue=Tn,t.CSSKeywordValue=Mn,t.CSSRGB=zn,t.CSSStyleValue=kn,t.CSSUnitValue=_n,t.Camera=Ys,t.CameraEvent=Vs,t.Canvas=Su,t.Circle=Da,t.CircleUpdater=Hs,t.CustomElement=Ga,t.CustomElementRegistry=fa,t.CustomEvent=pa,t.DefaultSceneGraphSelector=iu,t.DefaultSceneGraphService=au,t.DisplayObject=Ia,t.DisplayObjectPool=Va,t.Document=xa,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=ln,t.Element=Pa,t.Ellipse=Ya,t.EllipseUpdater=Xs,t.EventService=Qs,t.EventTarget=ya,t.FederatedEvent=va,t.FederatedMouseEvent=Sa,t.FederatedPointerEvent=Na,t.FederatedWheelEvent=Ca,t.Frustum=Ye,t.Group=Xa,t.HTML=za,t.Image=Za,t.Line=Qa,t.LineUpdater=Ws,t.MutationEvent=Ea,t.Node=ga,t.OffscreenCanvasCreator=Js,t.Path=$a,t.PathUpdater=zs,t.Plane=Ve,t.Point=He,t.Polygon=eo,t.Polyline=ro,t.PolylineUpdater=qs,t.RBush=r,t.Rect=ao,t.RectUpdater=Zs,t.Rectangle=Xe,t.RenderingService=nu,t.Text=so,t.TextService=lu,t.TextUpdater=Ks,t.computeLinearGradient=function(t,e,n){var r=lo(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(ue([0,0],[o,s]),ue([0,n],[o,s]),ue([e,n],[o,s]),ue([e,0],[o,s]));return a&&(a instanceof _n?u=a.value:a instanceof Mn&&("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(ue([0,0],[o,s]),ue([0,n],[o,s]),ue([e,n],[o,s]),ue([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,a=i.x1,o=i.y1,s=i.x2,u=i.y2;r=Bo(a,o,s,u);break;case t.Shape.CIRCLE:var c=e.parsedStyle,l=c.r,h=c.cx,f=c.cy;r=Fo(l,l,h,f);break;case t.Shape.ELLIPSE:var v=e.parsedStyle,p=v.rx,d=v.ry,y=v.cx,g=v.cy;r=Fo(p,d,y,g);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:var m=e.parsedStyle.points;r=Vo(m.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var k=e.parsedStyle,x=k.width,E=k.height,b=k.x,T=k.y,w=k.radius,P=w&&w.some((function(t){return 0!==t}));r=jo(x,E,b,T,P&&w.map((function(t){return Le(t,0,Math.min(Math.abs(x)/2,Math.abs(E)/2))})));break;case t.Shape.PATH:var S=e.parsedStyle.path.absolutePath;r=M(S)}if(r.length)return Go(r,e,n)},t.createVec3=co,t.decompose=yo,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==T(t,2)[1]})))},t.deg2rad=lo,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=nn,t.fromRotationTranslationScale=po,t.getAngle=uo,t.getEuler=vo,t.getOrCalculatePathTotalLength=So,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=tn,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=jr,t.mergeColors=Hr,t.parseColor=Yr,t.parseLength=Wr,t.parsePath=ci,t.parseTransform=Li,t.parsedTransformToMat4=Mo,t.propertyMetadataCache=Os,t.rad2deg=ho,t.resetEntityCounter=function(){ba=0},t.runtime=hu,t.setDOMSize=function(t,e,n){tn&&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 c=t[u+1],l=0===u&&(0!==r||0!==i),h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==a&&0!==o;switch(s[0]){case"M":return l?"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=fo,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,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(a,Math.floor(r+(s-u)*l/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=m(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 c(t,e){return t.minX-e.minX}function l(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 y(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,a){for(var o=[n,r];o.length;)if((r=o.pop())-(n=o.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!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):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(!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||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=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),u=[],c=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),o.leaf){var l=a(t,o.children,e);if(-1!==l)return o.children.splice(l,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),c.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=m(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=m([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),c=u*Math.ceil(Math.sqrt(s));g(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);g(t,l,h,u,this.compareMinY);for(var f=l;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],c=h(u),l=p(t,u)-c;a>l?(a=l,i=i>c?c:i,o=u):l===a&&i>c&&(i=c,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=m(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=m([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),c=s(t,o,n,this.toBBox),l=d(u,c),f=h(u)+h(c);i>l?(i=l,r=o,a=a>f?f:a):l===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,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),c=f(a)+f(o),l=e;n-e>l;l++){var h=t.children[l];u(a,t.leaf?i(h):h),c+=f(a)}for(var p=n-e-1;p>=e;p--){var d=t.children[p];u(o,t.leaf?i(d):d),c+=f(o)}return c},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}()}));(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 i=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array;function o(){var t=new a(9);return a!=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 s(){var t=new a(16);return a!=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 u(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 c(t,e,n,r,i,a,o,s,u,c,l,h,f,p,d,v,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]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=v,t[15]=y,t}function l(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 h(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 f(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],y=e[14],m=e[15],g=n*s-r*o,x=n*u-i*o,E=n*c-a*o,b=r*u-i*s,T=r*c-a*s,M=i*c-a*u,w=l*v-h*d,k=l*y-f*d,P=l*m-p*d,S=h*y-f*v,N=h*m-p*v,C=f*m-p*y,A=g*C-x*N+E*S+b*P-T*k+M*w;return A?(t[0]=(s*C-u*N+c*S)*(A=1/A),t[1]=(i*N-r*C-a*S)*A,t[2]=(v*M-y*T+m*b)*A,t[3]=(f*T-h*M-p*b)*A,t[4]=(u*P-o*C-c*k)*A,t[5]=(n*C-i*P+a*k)*A,t[6]=(y*E-d*M-m*x)*A,t[7]=(l*M-f*E+p*x)*A,t[8]=(o*N-s*P+c*w)*A,t[9]=(r*P-n*N-a*w)*A,t[10]=(d*T-v*E+m*g)*A,t[11]=(h*E-l*T-p*g)*A,t[12]=(s*k-o*S-u*w)*A,t[13]=(n*S-r*k+i*w)*A,t[14]=(v*x-d*b-y*g)*A,t[15]=(l*b-h*x+f*g)*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],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],y=t[15];return(e*o-n*a)*(h*y-f*v)-(e*s-r*a)*(l*y-f*d)+(e*u-i*a)*(l*v-h*d)+(n*s-r*o)*(c*y-f*p)-(n*u-i*o)*(c*v-h*p)+(r*u-i*s)*(c*d-l*p)}function d(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],v=e[12],y=e[13],m=e[14],g=e[15],x=n[0],E=n[1],b=n[2],T=n[3];return t[0]=x*r+E*s+b*h+T*v,t[1]=x*i+E*u+b*f+T*y,t[2]=x*a+E*c+b*p+T*m,t[3]=x*o+E*l+b*d+T*g,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(T=n[7])*v,t[5]=x*i+E*u+b*f+T*y,t[6]=x*a+E*c+b*p+T*m,t[7]=x*o+E*l+b*d+T*g,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(T=n[11])*v,t[9]=x*i+E*u+b*f+T*y,t[10]=x*a+E*c+b*p+T*m,t[11]=x*o+E*l+b*d+T*g,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(T=n[15])*v,t[13]=x*i+E*u+b*f+T*y,t[14]=x*a+E*c+b*p+T*m,t[15]=x*o+E*l+b*d+T*g,t}function v(t,e,n){var r,i,a,o,s,u,c,l,h,f,p,d,v=n[0],y=n[1],m=n[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*m+e[12],t[13]=e[1]*v+e[5]*y+e[9]*m+e[13],t[14]=e[2]*v+e[6]*y+e[10]*m+e[14],t[15]=e[3]*v+e[7]*y+e[11]*m+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=e[6],l=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]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*v+s*y+h*m+e[12],t[13]=i*v+u*y+f*m+e[13],t[14]=a*v+c*y+p*m+e[14],t[15]=o*v+l*y+d*m+e[15]),t}function y(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 m(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=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+c*r,t[5]=o*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-a*r,t[9]=l*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function g(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],c=e[8],l=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-c*r,t[1]=o*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+c*i,t[9]=o*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function x(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 E(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,c=a+a,l=r*s,h=r*u,f=r*c,p=i*u,d=i*c,v=a*c,y=o*s,m=o*u,g=o*c;return t[0]=1-(p+v),t[1]=h+g,t[2]=f-m,t[3]=0,t[4]=h-g,t[5]=1-(l+v),t[6]=d+y,t[7]=0,t[8]=f+m,t[9]=d-y,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function b(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function T(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 M(t,e){var n=new a(3);T(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],s=e[0]*r,u=e[1]*i,c=e[2]*o,l=e[4]*r,h=e[5]*i,f=e[6]*o,p=e[8]*r,d=e[9]*i,v=e[10]*o,y=s+h+v,m=0;return y>0?(t[3]=.25*(m=2*Math.sqrt(y+1)),t[0]=(f-d)/m,t[1]=(p-c)/m,t[2]=(u-l)/m):s>h&&s>v?(t[3]=(f-d)/(m=2*Math.sqrt(1+s-h-v)),t[0]=.25*m,t[1]=(u+l)/m,t[2]=(p+c)/m):h>v?(t[3]=(p-c)/(m=2*Math.sqrt(1+h-s-v)),t[0]=(u+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(t[3]=(u-l)/(m=2*Math.sqrt(1+v-s-h)),t[0]=(p+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function w(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],c=a+a,l=o+o,h=s+s,f=a*c,p=a*l,d=a*h,v=o*l,y=o*h,m=s*h,g=u*c,x=u*l,E=u*h,b=r[0],T=r[1],M=r[2],w=i[0],k=i[1],P=i[2],S=(1-(v+m))*b,N=(p+E)*b,C=(d-x)*b,A=(p-E)*T,O=(1-(f+m))*T,R=(y+g)*T,L=(d+x)*M,I=(y-g)*M,_=(1-(f+v))*M;return t[0]=S,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=_,t[11]=0,t[12]=n[0]+w-(S*w+A*k+L*P),t[13]=n[1]+k-(N*w+O*k+I*P),t[14]=n[2]+P-(C*w+R*k+_*P),t[15]=1,t}function k(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,c=n*o,l=r*o,h=r*s,f=i*o,p=i*s,d=i*u,v=a*o,y=a*s,m=a*u;return t[0]=1-h-d,t[1]=l+m,t[2]=f-y,t[3]=0,t[4]=l-m,t[5]=1-c-d,t[6]=p+v,t[7]=0,t[8]=f+y,t[9]=p-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function P(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 S(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),c=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*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*c,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 N=S;function C(t,e,n,r){var a,o,s,u,c,h,f,p,d,v,y=e[0],m=e[1],g=e[2],x=r[0],E=r[1],b=r[2],T=n[0],M=n[1],w=n[2];return i>Math.abs(y-T)&&i>Math.abs(m-M)&&i>Math.abs(g-w)?l(t):(v=1/Math.hypot(f=y-T,p=m-M,d=g-w),(v=Math.hypot(a=E*(d*=v)-b*(p*=v),o=b*(f*=v)-x*d,s=x*p-E*f))?(a*=v=1/v,o*=v,s*=v):(a=0,o=0,s=0),(v=Math.hypot(u=p*s-d*o,c=d*a-f*s,h=f*o-p*a))?(u*=v=1/v,c*=v,h*=v):(u=0,c=0,h=0),t[0]=a,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=p,t[7]=0,t[8]=s,t[9]=h,t[10]=d,t[11]=0,t[12]=-(a*y+o*m+s*g),t[13]=-(u*y+c*m+h*g),t[14]=-(f*y+p*m+d*g),t[15]=1,t)}function A(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 O=Object.freeze({__proto__:null,create:s,clone:function(t){var e=new a(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:u,fromValues:function(t,e,n,r,i,o,s,u,c,l,h,f,p,d,v,y){var m=new a(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=s,m[7]=u,m[8]=c,m[9]=l,m[10]=h,m[11]=f,m[12]=p,m[13]=d,m[14]=v,m[15]=y,m},set:c,identity:l,transpose:h,invert:f,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],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],y=e[14],m=e[15];return t[0]=s*(f*m-p*y)-h*(u*m-c*y)+v*(u*p-c*f),t[1]=-(r*(f*m-p*y)-h*(i*m-a*y)+v*(i*p-a*f)),t[2]=r*(u*m-c*y)-s*(i*m-a*y)+v*(i*c-a*u),t[3]=-(r*(u*p-c*f)-s*(i*p-a*f)+h*(i*c-a*u)),t[4]=-(o*(f*m-p*y)-l*(u*m-c*y)+d*(u*p-c*f)),t[5]=n*(f*m-p*y)-l*(i*m-a*y)+d*(i*p-a*f),t[6]=-(n*(u*m-c*y)-o*(i*m-a*y)+d*(i*c-a*u)),t[7]=n*(u*p-c*f)-o*(i*p-a*f)+l*(i*c-a*u),t[8]=o*(h*m-p*v)-l*(s*m-c*v)+d*(s*p-c*h),t[9]=-(n*(h*m-p*v)-l*(r*m-a*v)+d*(r*p-a*h)),t[10]=n*(s*m-c*v)-o*(r*m-a*v)+d*(r*c-a*s),t[11]=-(n*(s*p-c*h)-o*(r*p-a*h)+l*(r*c-a*s)),t[12]=-(o*(h*y-f*v)-l*(s*y-u*v)+d*(s*f-u*h)),t[13]=n*(h*y-f*v)-l*(r*y-i*v)+d*(r*f-i*h),t[14]=-(n*(s*y-u*v)-o*(r*y-i*v)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+l*(r*u-i*s),t},determinant:p,multiply:d,translate:v,scale:y,rotate:function(t,e,n,r){var a,o,s,u,c,l,h,f,p,d,v,y,m,g,x,E,b,T,M,w,k,P,S,N,C=r[0],A=r[1],O=r[2],R=Math.hypot(C,A,O);return i>R?null:(C*=R=1/R,A*=R,O*=R,a=Math.sin(n),c=e[1],l=e[2],h=e[3],p=e[5],d=e[6],v=e[7],m=e[9],g=e[10],x=e[11],M=C*A*(s=1-(o=Math.cos(n)))-O*a,w=A*A*s+o,k=O*A*s+C*a,P=C*O*s+A*a,S=A*O*s-C*a,N=O*O*s+o,t[0]=(u=e[0])*(E=C*C*s+o)+(f=e[4])*(b=A*C*s+O*a)+(y=e[8])*(T=O*C*s-A*a),t[1]=c*E+p*b+m*T,t[2]=l*E+d*b+g*T,t[3]=h*E+v*b+x*T,t[4]=u*M+f*w+y*k,t[5]=c*M+p*w+m*k,t[6]=l*M+d*w+g*k,t[7]=h*M+v*w+x*k,t[8]=u*P+f*S+y*N,t[9]=c*P+p*S+m*N,t[10]=l*P+d*S+g*N,t[11]=h*P+v*S+x*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:m,rotateY:g,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],c=e[4],l=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+c*r,t[1]=o*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-a*r,t[5]=l*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:x,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,a,o,s=n[0],u=n[1],c=n[2],l=Math.hypot(s,u,c);return i>l?null:(s*=l=1/l,u*=l,c*=l,r=Math.sin(e),t[0]=s*s*(o=1-(a=Math.cos(e)))+a,t[1]=u*s*o+c*r,t[2]=c*s*o-u*r,t[3]=0,t[4]=s*u*o-c*r,t[5]=u*u*o+a,t[6]=c*u*o+s*r,t[7]=0,t[8]=s*c*o+u*r,t[9]=u*c*o-s*r,t[10]=c*c*o+a,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:E,fromQuat2:function(t,e){var n=new a(3),r=-e[0],i=-e[1],o=-e[2],s=e[3],u=e[4],c=e[5],l=e[6],h=e[7],f=r*r+i*i+o*o+s*s;return f>0?(n[0]=2*(u*s+h*r+c*o-l*i)/f,n[1]=2*(c*s+h*i+l*r-u*o)/f,n[2]=2*(l*s+h*o+u*i-c*r)/f):(n[0]=2*(u*s+h*r+c*o-l*i),n[1]=2*(c*s+h*i+l*r-u*o),n[2]=2*(l*s+h*o+u*i-c*r)),E(t,e,n),t},getTranslation:b,getScaling:T,getRotation:M,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,c=a+a,l=o+o,h=i*u,f=i*c,p=i*l,d=a*c,v=a*l,y=o*l,m=s*u,g=s*c,x=s*l,E=r[0],b=r[1],T=r[2];return t[0]=(1-(d+y))*E,t[1]=(f+x)*E,t[2]=(p-g)*E,t[3]=0,t[4]=(f-x)*b,t[5]=(1-(h+y))*b,t[6]=(v+m)*b,t[7]=0,t[8]=(p+g)*T,t[9]=(v-m)*T,t[10]=(1-(h+d))*T,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:w,fromQuat:k,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),c=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)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:P,perspective:P,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),c=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*c*.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:S,ortho:N,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),c=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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*c,t[15]=1,t},lookAt:C,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=a-n[1],f=o-n[2],p=l*l+h*h+f*f;p>0&&(l*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-c*h,v=c*l-s*f,y=s*h-u*l;return(p=d*d+v*v+y*y)>0&&(d*=p=1/Math.sqrt(p),v*=p,y*=p),t[0]=d,t[1]=v,t[2]=y,t[3]=0,t[4]=h*y-f*v,t[5]=f*d-l*y,t[6]=l*v-h*d,t[7]=0,t[8]=l,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:A,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],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],p=t[10],d=t[11],v=t[12],y=t[13],m=t[14],g=t[15],x=e[0],E=e[1],b=e[2],T=e[3],M=e[4],w=e[5],k=e[6],P=e[7],S=e[8],N=e[9],C=e[10],A=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-x)>i*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(r-E)>i*Math.max(1,Math.abs(r),Math.abs(E))||Math.abs(a-b)>i*Math.max(1,Math.abs(a),Math.abs(b))||Math.abs(o-T)>i*Math.max(1,Math.abs(o),Math.abs(T))||Math.abs(s-M)>i*Math.max(1,Math.abs(s),Math.abs(M))||Math.abs(u-w)>i*Math.max(1,Math.abs(u),Math.abs(w))||Math.abs(c-k)>i*Math.max(1,Math.abs(c),Math.abs(k))||Math.abs(l-P)>i*Math.max(1,Math.abs(l),Math.abs(P))||Math.abs(h-S)>i*Math.max(1,Math.abs(h),Math.abs(S))||Math.abs(f-N)>i*Math.max(1,Math.abs(f),Math.abs(N))||Math.abs(p-C)>i*Math.max(1,Math.abs(p),Math.abs(C))||Math.abs(d-A)>i*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(v-O)>i*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(y-R)>i*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(m-L)>i*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(g-I)>i*Math.max(1,Math.abs(g),Math.abs(I)))},mul:d,sub:A});function R(){var t=new a(3);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function L(t){return Math.hypot(t[0],t[1],t[2])}function I(t,e,n){var r=new a(3);return r[0]=t,r[1]=e,r[2]=n,r}function _(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function D(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function U(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function G(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function B(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function F(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 V(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Y(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 H(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 j(t,e){var n=t[0],r=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return i*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&i*Math.max(1,Math.abs(r),Math.abs(s))>=Math.abs(r-s)&&i*Math.max(1,Math.abs(a),Math.abs(u))>=Math.abs(a-u)}var X,W=G,z=L;X=R();function q(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Z(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=q()}();function K(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Q(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 J(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+o*s+i*c-a*u,t[1]=i*l+o*u+a*s-r*c,t[2]=a*l+o*c+r*u-i*s,t[3]=o*l-r*s-i*u-a*c,t}function $(t,e,n,r){var a,o,s,u,c,l=e[0],h=e[1],f=e[2],p=e[3],d=n[0],v=n[1],y=n[2],m=n[3];return 0>(o=l*d+h*v+f*y+p*m)&&(o=-o,d=-d,v=-v,y=-y,m=-m),1-o>i?(s=Math.sin(a=Math.acos(o)),u=Math.sin((1-r)*a)/s,c=Math.sin(r*a)/s):(u=1-r,c=r),t[0]=u*l+c*d,t[1]=u*h+c*v,t[2]=u*f+c*y,t[3]=u*p+c*m,t}function tt(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 et(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),c=Math.sin(r),l=Math.cos(r);return t[0]=a*u*l-o*s*c,t[1]=o*s*l+a*u*c,t[2]=o*u*c-a*s*l,t[3]=o*u*l+a*s*c,t}var nt,rt,it,at,ot,st,ut=function(t,e,n,r){var i=new a(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ct=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},lt=J,ht=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};nt=R(),rt=I(1,0,0),it=I(0,1,0),at=K(),ot=K(),st=o();function ft(t,e){var n=new a(2);return n[0]=t,n[1]=e,n}!function(){var t,e=(t=new a(2),a!=Float32Array&&(t[0]=0,t[1]=0),t)}();function pt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var dt=function(){return dt=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},dt.apply(this,arguments)},vt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function yt(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 mt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function gt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return mt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function xt(t){return gt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Et(t){return xt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function bt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=mt[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,mt[n]))),mt[n]););}function Tt(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 Mt(t){return t>=48&&57>=t||43===t||45===t||46===t}function wt(t){return t>=48&&57>=t}function kt(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,c=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),wt(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&wt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>a&&wt(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(c=!0,a+=1;wt(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(c&&!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||!wt(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid integer exponent');for(;n>a&&wt(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 Pt(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 St(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=mt[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,Pt(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?kt(t):Tt(t),t.err.length)return;t.data.push(t.param),Pt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Pt(t))}if(t.index>=t.max)break;if(!Mt(n.charCodeAt(t.index)))break}bt(t)}else bt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Nt=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 Ct(t){if(xt(t))return pt(t);var e=function(t){if(gt(t))return pt(t);var e=new Nt(t);for(Pt(e);e.max>e.index&&!e.err.length;)St(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 c=o.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(o);var l=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[l-2],r=e[l-1],"M"===u&&(i=n,a=r)}return e}))}function At(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 c=2*r-a,l=2*i-o;e.x1=c,e.y1=l,u=["C",c,l].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 Ot(t){if(Et(t))return pt(t);for(var e=Ct(t),n=dt({},vt),r=0;e.length>r;r+=1){e[r]=At(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 Rt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Lt(t,e,n,r,i,a,o,s,u,c){var l,h,f,p,d,v=t,y=e,m=n,g=r,x=s,E=u,b=120*Math.PI/180,T=Math.PI/180*(+i||0),M=[];if(c)h=c[0],f=c[1],p=c[2],d=c[3];else{y=(l=Rt(v,y,-T)).y;var w=((v=l.x)-(x=(l=Rt(x,E,-T)).x))/2,k=(y-(E=l.y))/2,P=w*w/(m*m)+k*k/(g*g);P>1&&(m*=P=Math.sqrt(P),g*=P);var S=m*m,N=g*g,C=(a===o?-1:1)*Math.sqrt(Math.abs((S*N-S*k*k-N*w*w)/(S*k*k+N*w*w)));p=C*m*k/g+(v+x)/2,h=Math.asin(((y-(d=C*-g*w/m+(y+E)/2))/g*1e9>>0)/1e9),f=Math.asin(((E-d)/g*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,R=x,L=E;M=Lt(x=p+m*Math.cos(f=h+b*(o&&f>h?1:-1)),E=d+g*Math.sin(f),m,g,i,0,o,R,L,[f,O,p,d])}A=f-h;var I=Math.cos(h),_=Math.sin(h),D=Math.cos(f),U=Math.sin(f),G=Math.tan(A/4),B=4/3*m*G,F=4/3*g*G,V=[v,y],Y=[v+B*_,y-F*I],H=[x+B*U,E-F*D],j=[x,E];if(Y[0]=2*V[0]-Y[0],Y[1]=2*V[1]-Y[1],c)return Y.concat(H,j,M);for(var X=[],W=0,z=(M=Y.concat(H,j,M)).length;z>W;W+=1)X[W]=W%2?Rt(M[W-1],M[W],T).y:Rt(M[W],M[W+1],T).x;return X}function It(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function _t(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Dt(t,e,n,r,i){var a=_t([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=It([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 Ut(t,e,n,r){var i=.5,a=[t,e],o=[n,r],s=It(a,o,i),u=It(o,s,i),c=It(s,u,i),l=It(u,c,i),h=It(c,l,i),f=Dt(a[0],a[1],s[0],s[1],c[0]).point,p=Dt(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,p.x,p.y,n,r]}function Gt(t,e){var n,r,i,a,o,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],p=e.x1,d=e.y1,v=e.x,y=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[p,d].concat(l),["C"].concat(Lt(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(l),["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(Ut(p,d,h,f));case"Z":return p===v&&d===y?["C",p,d,v,y,v,y]:["C"].concat(Ut(p,d,v,y))}return t}function Bt(t,e){if(void 0===e&&(e=!1),function(t){return Et(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=pt(t);return e?[n,[]]:n}for(var r,i,a=Ot(t),o=dt({},vt),s=[],u="",c=a.length,l=[],h=0;c>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=Gt(a[h],o);a[h]=f,yt(a,s,h),c=a.length,"Z"===u&&l.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,l]:a}function Ft(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 Vt(t,e,n,r,i,a,o,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,p=Math.sqrt,d=Math.PI,v=l(n),y=l(r),m=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===y)return Dt(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,E={x:f(m)*g+h(m)*x,y:-h(m)*g+f(m)*x},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(y,2);b>1&&(v*=p(b),y*=p(b));var T=(Math.pow(v,2)*Math.pow(y,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(y,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(y,2)*Math.pow(E.x,2)),M=(a!==o?1:-1)*p(T=0>T?0:T),w=M*(v*E.y/y),k=M*(-y*E.x/v),P=f(m)*w-h(m)*k+(t+s)/2,S=h(m)*w+f(m)*k+(e+u)/2,N={x:(E.x-w)/v,y:(E.y-k)/y},C=Ft({x:1,y:0},N),A=Ft(N,{x:(-E.x-w)/v,y:(-E.y-k)/y});!o&&A>0?A-=2*d:o&&0>A&&(A+=2*d);var O=C+(A%=2*d)*c,R=v*f(O),L=y*h(O);return{x:f(m)*R-h(m)*L+P,y:h(m)*R+f(m)*L+S}}function Yt(t,e,n,r,i,a,o,s,u,c,l){var h,f=l.bbox,p=void 0===f||f,d=l.length,v=void 0===d||d,y=l.sampleSize,m=void 0===y?30:y,g="number"==typeof c,x=t,E=e,b=0,T=[x,E,b],M=[x,E],w={x:0,y:0},k=[{x:x,y:E}];g&&0>=c&&(w={x:x,y:E});for(var P=0;m>=P;P+=1){if(x=(h=Vt(t,e,n,r,i,a,o,s,u,P/m)).x,E=h.y,p&&k.push({x:x,y:E}),v&&(b+=_t(M,[x,E])),M=[x,E],g&&b>=c&&c>T[2]){var S=(b-c)/(b-T[2]);w={x:M[0]*(1-S)+T[0]*S,y:M[1]*(1-S)+T[1]*S}}T=[x,E,b]}return g&&c>=b&&(w={x:s,y:u}),{length:b,point:w,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.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 Ht(t,e,n,r,i,a,o,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*a+Math.pow(u,3)*s}}function jt(t,e,n,r,i,a,o,s,u,c){var l,h=c.bbox,f=void 0===h||h,p=c.length,d=void 0===p||p,v=c.sampleSize,y=void 0===v?10:v,m="number"==typeof u,g=t,x=e,E=0,b=[g,x,E],T=[g,x],M={x:0,y:0},w=[{x:g,y:x}];m&&0>=u&&(M={x:g,y:x});for(var k=0;y>=k;k+=1){if(g=(l=Ht(t,e,n,r,i,a,o,s,k/y)).x,x=l.y,f&&w.push({x:g,y:x}),d&&(E+=_t(T,[g,x])),T=[g,x],m&&E>=u&&u>b[2]){var P=(E-u)/(E-b[2]);M={x:T[0]*(1-P)+b[0]*P,y:T[1]*(1-P)+b[1]*P}}b=[g,x,E]}return m&&u>=E&&(M={x:o,y:s}),{length:E,point:M,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function Xt(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 Wt(t,e,n,r,i,a,o,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,p=s.sampleSize,d=void 0===p?10:p,v="number"==typeof o,y=t,m=e,g=0,x=[y,m,g],E=[y,m],b={x:0,y:0},T=[{x:y,y:m}];v&&0>=o&&(b={x:y,y:m});for(var M=0;d>=M;M+=1){if(y=(u=Xt(t,e,n,r,i,a,M/d)).x,m=u.y,l&&T.push({x:y,y:m}),f&&(g+=_t(E,[y,m])),E=[y,m],v&&g>=o&&o>x[2]){var w=(g-o)/(g-x[2]);b={x:E[0]*(1-w)+x[0]*w,y:E[1]*(1-w)+x[1]*w}}x=[y,m,g]}return v&&o>=g&&(b={x:i,y:a}),{length:g,point:b,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 zt(t,e,n){for(var r,i,a,o,s,u,c,l,h,f=Ot(t),p="number"==typeof e,d=[],v=0,y=0,m=0,g=0,x=[],E=[],b=0,T={x:0,y:0},M=T,w=T,k=T,P=0,S=0,N=f.length;N>S;S+=1)d=(c="M"===(l=(h=f[S])[0]))?d:[v,y].concat(h.slice(1)),c?(M=T={x:m=h[1],y:g=h[2]},b=0,p&&.001>e&&(k=T)):"L"===l?(b=(r=Dt(d[0],d[1],d[2],d[3],(e||0)-P)).length,T=r.min,M=r.max,w=r.point):"A"===l?(b=(i=Yt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-P,n||{})).length,T=i.min,M=i.max,w=i.point):"C"===l?(b=(a=jt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-P,n||{})).length,T=a.min,M=a.max,w=a.point):"Q"===l?(b=(o=Wt(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-P,n||{})).length,T=o.min,M=o.max,w=o.point):"Z"===l&&(b=(s=Dt((d=[v,y,m,g])[0],d[1],d[2],d[3],(e||0)-P)).length,T=s.min,M=s.max,w=s.point),p&&e>P&&P+b>=e&&(k=w),E.push(M),x.push(T),P+=b,v=(u="Z"!==l?h.slice(-2):[m,g])[0],y=u[1];return p&&e>=P&&(k={x:v,y:y}),{length:P,point:k,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 qt(t){return function(t){var e=0,n=0,r=0;return Bt(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,c,l,h,f,p=t.slice(1);return r=3*(((f=p[5])-(o=n))*((s=p[0])+(c=p[2]))-((h=p[4])-(a=e))*((u=p[1])+(l=p[3]))+u*(a-c)-s*(o-l)+f*(c+a/3)-h*(l+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 Zt(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=It(n,r,e),s=It(r,i,e),u=It(i,a,e),c=It(o,s,e),l=It(s,u,e),h=It(c,l,e);return[["C"].concat(o,c,h),["C"].concat(l,u,a)]}(r):[t,t]:[t],l:i}}))}function Kt(t,e,n){var r=Zt(t),i=Zt(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,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=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=[c,l],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:Kt(v[0],v[1],h)}var Qt=function(t){return null==t},Jt={}.toString,$t=function(t,e){return Jt.call(t)==="[object "+e+"]"},te=function(t){return Array.isArray?Array.isArray(t):$t(t,"Array")},ee=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},ne=function(t){if(te(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},re=function(t){if(te(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},ie=function(t){return $t(t,"String")},ae=function(t,e,n){return e>t?e:t>n?n:t},oe=function(t){return $t(t,"Number")};var se,ue=function(t,e){return(t%e+e)%e},ce=function(t){return $t(t,"Boolean")},le=function(t){return void 0===t},he=function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var a=e?e.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=t.apply(this,r);return o.set(a,s),s};return n.cache=new Map,n},fe=function(){function t(t,e){void 0===t&&(t=[0,0,0]),void 0===e&&(e=[0,0,0]),this.center=R(),this.halfExtents=R(),this.min=R(),this.max=R(),this.update(t,e)}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){_(this.center,t),_(this.halfExtents,e),W(this.min,this.center,this.halfExtents),U(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){U(this.center,e,t),B(this.center,this.center,.5),W(this.halfExtents,e,t),B(this.halfExtents,this.halfExtents,.5),_(this.min,t),_(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],c=o[2],l=r-s,h=r+s,f=i-u,p=i+u,d=a-c,v=a+c,y=e.center,m=y[0],g=y[1],x=y[2],E=e.halfExtents,b=E[0],T=E[1],M=E[2],w=m-b,k=m+b,P=g-T,S=g+T,N=x-M,C=x+M;l>w&&(l=w),k>h&&(h=k),f>P&&(f=P),S>p&&(p=S),d>N&&(d=N),C>v&&(v=C),n[0]=.5*(l+h),n[1]=.5*(f+p),n[2]=.5*(d+v),o[0]=.5*(h-l),o[1]=.5*(p-f),o[2]=.5*(v-d),this.min[0]=l,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],c=e[1],l=e[5],h=e[9],f=e[2],p=e[6],d=e[10],v=Math.abs(o),y=Math.abs(s),m=Math.abs(u),g=Math.abs(c),x=Math.abs(l),E=Math.abs(h),b=Math.abs(f),T=Math.abs(p),M=Math.abs(d);D(n,e[12]+o*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+f*i[0]+p*i[1]+d*i[2]),D(r,v*a[0]+y*a[1]+m*a[2],g*a[0]+x*a[1]+E*a[2],b*a[0]+T*a[1]+M*a[2]),this.min=W(this.min,n,r),this.max=U(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=R(),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}(R(),this.getMax(),e.getMax());return a.setMinMax(o,s),a},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?_(R(),this.min):272===t.pnVertexFlag?I(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?I(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?I(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?I(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?I(this.max[0],this.min[1],this.max[2]):I(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?_(R(),this.max):272===t.pnVertexFlag?I(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?I(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?I(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?I(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?I(this.min[0],this.max[1],this.min[2]):I(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),pe=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||I(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 V(t,this.normal)-this.distance},e.normalize=function(){var t=1/z(this.normal);B(this.normal,this.normal,t),this.distance*=t},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}();(se=t.Mask||(t.Mask={}))[se.OUTSIDE=4294967295]="OUTSIDE",se[se.INSIDE=0]="INSIDE",se[se.INDETERMINATE=2147483647]="INDETERMINATE";var de,ve=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new pe)}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],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],y=t[15];D(this.planes[0].normal,i-e,u-a,f-c),this.planes[0].distance=y-p,D(this.planes[1].normal,i+e,u+a,f+c),this.planes[1].distance=y+p,D(this.planes[2].normal,i+n,u+o,f+l),this.planes[2].distance=y+d,D(this.planes[3].normal,i-n,u-o,f-l),this.planes[3].distance=y-d,D(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=y-v,D(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),ye=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}(),me=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}();(de=t.Shape||(t.Shape={})).GROUP="g",de.CIRCLE="circle",de.ELLIPSE="ellipse",de.IMAGE="image",de.RECT="rect",de.LINE="line",de.POLYLINE="polyline",de.POLYGON="polygon",de.TEXT="text",de.PATH="path",de.HTML="html",de.MESH="mesh";var ge=he((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}));function xe(t){if(!t)throw Error()}function Ee(t,e){if(t===e)throw Error()}function be(t){return"function"==typeof t}var Te={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Me=he((function(t){var e=ge(t),n=Te[e];return e=(null==n?void 0:n.alias)||e})),we={},ke=0;var Pe="undefined"!=typeof window&&void 0!==window.document;function Se(t,e){var n=Number(t.style.zIndex),r=Number(e.style.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 Ne(t){var e=t;do{var n;if(null===(n=e.style)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Ce(t,e){if(Pe)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Ae,Oe,Re,Le,Ie,_e="Method not implemented.",De="Use document.documentElement instead.",Ue={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Ge(){Ge=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",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var a=Object.create((e&&e.prototype instanceof f?e:f).prototype),o=new k(i||[]);return r(a,"_invoke",{value:b(t,n,o)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h={};function f(){}function p(){}function d(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(P([])));m&&m!==e&&n.call(m,a)&&(v=m);var g=d.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,a,o,s){var u=l(t[r],t,a);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(h).then((function(t){c.value=t,o(c)}),(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 S()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=T(o,n);if(s){if(s===h)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=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(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,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;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,h):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}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 w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function P(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:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,r(g,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,o,(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()}))},x(g),u(g,s,"Generator"),u(g,a,(function(){return this})),u(g,"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=P,k.prototype={constructor:k,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(w),!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,h):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),h},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),w(n),h}},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;w(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function Be(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 Fe(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){Be(a,r,i,o,s,"next",t)}function s(t){Be(a,r,i,o,s,"throw",t)}o(void 0)}))}}function Ve(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 Ye(t,e,n){return e&&Ve(t.prototype,e),n&&Ve(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function He(){return He=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},He.apply(this,arguments)}function je(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Xe(t,e)}function Xe(t,e){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xe(t,e)}function We(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 ze(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(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 Ze(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 qe(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)?qe(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.")}(Ae=t.UnitType||(t.UnitType={}))[Ae.kUnknown=0]="kUnknown",Ae[Ae.kNumber=1]="kNumber",Ae[Ae.kPercentage=2]="kPercentage",Ae[Ae.kEms=3]="kEms",Ae[Ae.kPixels=4]="kPixels",Ae[Ae.kRems=5]="kRems",Ae[Ae.kDegrees=6]="kDegrees",Ae[Ae.kRadians=7]="kRadians",Ae[Ae.kGradians=8]="kGradians",Ae[Ae.kTurns=9]="kTurns",Ae[Ae.kMilliseconds=10]="kMilliseconds",Ae[Ae.kSeconds=11]="kSeconds",Ae[Ae.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"}(Oe||(Oe={})),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"}(Re||(Re={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Le||(Le={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Ie||(Ie={}));var Ke,Qe=[{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"}(Ke||(Ke={}));var Je,$e=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Qe.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},tn=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},en=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""},nn=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(Le.kNo,Ie.kNo,"")},n.isNumericValue=function(){return this.getType()>=Ke.kUnitType&&this.getType()<=Ke.kClampType},e}(),rn=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}je(e,t);var n=e.prototype;return n.getType=function(){return Ke.kColorType},n.to=function(t){return this},e}(nn);(Je=t.GradientType||(t.GradientType={}))[Je.Constant=0]="Constant",Je[Je.LinearGradient=1]="LinearGradient",Je[Je.RadialGradient=2]="RadialGradient";var an,on,sn=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}je(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 Ke.kColorType},e}(nn),un=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}je(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return Ke.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(nn);!function(t){t.kAdd="+",t.kSubtract="-",t.kMultiply="*",t.kDivide="/",t.kMin="min",t.kMax="max",t.kClamp="clamp",t.kInvalid=""}(an||(an={})),function(t){t[t.kLength=0]="kLength",t[t.kAngle=1]="kAngle",t[t.kTime=2]="kTime",t[t.kFrequency=3]="kFrequency",t[t.kResolution=4]="kResolution",t[t.kFlex=5]="kFlex",t[t.kPercent=6]="kPercent",t[t.kNumBaseTypes=7]="kNumBaseTypes"}(on||(on={}));var cn=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=on.kPercent,this.hasPercentHint=!1,this.exponents=Array(on.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(function(e){switch(Ee(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kPixels:case t.UnitType.kRems:return on.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return on.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return on.kAngle;case t.UnitType.kPercentage:return on.kPercent;default:return on.kLength}}(e),n)}var n=e.prototype;return n.applyPercentHint=function(t){Ee(t,on.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(on.kPercent)),this.setExponent(on.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return Ee(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(t){return Ee(t,on.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(on.kPercent,1)},n.matchesBaseTypePercentage=function(t){return Ee(t,on.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(on.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(on.kPercent,1)},e.add=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint),function(t,e){if(t!==e)throw Error()}(t.percentHint,e.percentHint);for(var r=0;on.kNumBaseTypes>r;++r){var i=r;if(t.exponents[r]!==e.exponents[r]&&(i!==on.kPercent&&(t.applyPercentHint(i),e.applyPercentHint(i)),t.exponents[r]!==e.exponents[r]))return t}return t},e.multiply=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;on.kNumBaseTypes>r;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}return t},e}(),ln=function(e){return"number"==typeof e?new gn(e,t.UnitType.kNumber):e},hn=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}je(n,e);var r=n.prototype;return r.getType=function(){return Ke.kUnknownType},r.equals=function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=fn(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=fn(e);pn(Ke.kSumType,r,this);var i=vn(r,an.kAdd);return i||Pn.create(r)},r.sub=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=fn(e);r=r.map((function(t){return t.negate()})),pn(Ke.kSumType,r,this);var i=vn(r,an.kAdd);return i||Pn.create(r)},r.mul=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=fn(e);pn(Ke.kProductType,r,this);var i=yn(r);return i||Sn.create(r)},r.div=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=fn(e);r=r.map((function(t){return t.invert()})),pn(Ke.kProductType,r,this);var i=yn(r);return i||Sn.create(r)},r.min=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=fn(e);pn(Ke.kMinType,r,this);var i=vn(r,an.kMin);return i||wn.create(r)},r.max=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=fn(e);pn(Ke.kMaxType,r,this);var i=vn(r,an.kMax);return i||kn.create(r)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=dn(e[0]);return r?(n="string"==typeof t?$e(t):t,r.convertTo(n)):null},r.toSum=function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=0,a=e;a.length>i;i++){var o=a[i];if(!n.isValidUnit($e(o)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=Ze(s);!(u=l()).done;){var h=u.value,f=dn(h);if(!f)return null;c.push(f)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var p=Pn.create(c);return xe(!!p),p}for(var d=[],v=function(){var t=$e(m[y]);xe(n.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);d.push(new gn(e,t))},y=0,m=e;m.length>y;y++)v();if(c.some((function(t){return!!t})))throw Error("There were leftover terms that were not converted");return Pn.create(d)},r.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(on.kLength);return e&&(t.length=e),(e=this.type_.exponent(on.kAngle))&&(t.angle=e),(e=this.type_.exponent(on.kTime))&&(t.time=e),(e=this.type_.exponent(on.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(on.kResolution))&&(t.resolution=e),(e=this.type_.exponent(on.kFlex))&&(t.flex=e),(e=this.type_.exponent(on.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case on.kLength:return"length";case on.kAngle:return"angle";case on.kTime:return"time";case on.kFrequency:return"frequency";case on.kResolution:return"resolution";case on.kFlex:return"flex";case on.kPercent:return"percent"}return""}(this.type_.percentHint)),t},n.isValidUnit=function(e){return!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e))},r.negate=function(){return bn.create(this)},r.invert=function(){return En.create(this)},n}(nn);function fn(t){return t.map(ln)}function pn(t,e,n){xe(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function dn(t){return 0===Object.keys(t.units).length?new gn(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new gn(t.value,Number(Object.keys(t.units)[0])):null}function vn(t,e){xe(!!t.length);var n=t[0]instanceof gn?t[0]:null;if(!n)return null;for(var r=n.value,i=1;t.length>i;i++){var a=t[i]instanceof gn?t[i]:null;if(!a||a.unit!==n.unit)return null;e===an.kAdd?r+=a.value:e===an.kMax?r=Math.max(r,a.value):e===an.kMin&&(r=Math.min(r,a.value))}return new gn(r,n.unit)}function yn(e){xe(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var a=e[i]instanceof gn?e[i]:null;if(!a)return null;if(a.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=a.unit}r*=a.value}return new gn(r,n)}var mn=function(e){return function(e){switch(e){case Oe.kUNumber:return t.UnitType.kNumber;case Oe.kULength:return t.UnitType.kPixels;case Oe.kUPercent:return t.UnitType.kPercentage;case Oe.kUTime:return t.UnitType.kSeconds;case Oe.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Oe.kUNumber;case t.UnitType.kPercentage:return Oe.kUPercent;case t.UnitType.kPixels:return Oe.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Oe.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Oe.kUAngle;default:return Oe.kUOther}}(e))},gn=function(e){function n(n,r){var i,a;return void 0===r&&(r=t.UnitType.kNumber),a="string"==typeof r?$e(r):r,(i=e.call(this,new cn(a))||this).unit=void 0,i.value=void 0,i.unit=a,i.value=n,i}je(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=mn(this.unit);if(r!==mn(e)||r===t.UnitType.kUnknown)return null;var i=tn(this.unit)/tn(e);return new n(this.value*i,e)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return Ke.kUnitType},r.sumValue=function(){var e,n,r=[],i={};return this.unit!==t.UnitType.kNumber&&(i[(e=this.unit,n=mn(e),n===t.UnitType.kUnknown?e:n)]=1),r.push({value:this.value*tn(this.unit),units:i}),r},r.negate=function(){return new n(-this.value,this.unit)},r.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):En.create(this)},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=en(this.unit);if(-999999>a||a>999999){var s=en(this.unit);i=!Number.isFinite(a)||Number.isNaN(a)?function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(xe(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(a,s):a+(s||"")}else i=""+a+o}return r+=i},n}(hn),xn=function(t){function e(){return t.apply(this,arguments)||this}return je(e,t),e.prototype.isUnitValue=function(){return!1},e}(hn),En=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="invert",r.value=e,r}je(e,t),e.create=function(t){return new e(t,cn.negateExponents(t.type_))};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return Ke.kInvertType},n.equals=function(t){return t.getType()===Ke.kInvertType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},n.buildCSSText=function(t,e,n){return e==Ie.kNo&&(n+=t===Le.kYes?"(":"calc("),n=this.value.buildCSSText(Le.kYes,Ie.kNo,n+="1 / "),e===Ie.kNo&&(n+=")"),n},e}(xn),bn=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="negate",r.value=e,r}je(e,t),e.create=function(t){return new e(t,t.type_)};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return Ke.kNegateType},n.equals=function(t){return t.getType()===Ke.kNegateType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},n.buildCSSText=function(t,e,n){return e==Ie.kNo&&(n+=t===Le.kYes?"(":"calc("),n=this.value.buildCSSText(Le.kYes,Ie.kNo,n+="-"),e===Ie.kNo&&(n+=")"),n},e}(xn);function Tn(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var Mn=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}je(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(xn),wn=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).operator="min",e}je(e,t),e.create=function(t){return new e(t,Tn(t,cn.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Ke.kMinType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=Ze(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},n.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,a=Ze(this.numericValues());!(r=a()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Le.kYes,Ie.kYes,n)}return n+=")"},e}(Mn),kn=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).operator="max",e}je(e,t),e.create=function(t){return new e(t,Tn(t,cn.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Ke.kMaxType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=Ze(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},n.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,a=Ze(this.numericValues());!(r=a()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Le.kYes,Ie.kYes,n)}return n+=")"},e}(Mn),Pn=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).operator="sum",e}je(e,t),e.create=function(t){return new e(t,Tn(t,cn.add))},e.numericTypeFromUnitMap=function(t){var e=new cn;return Object.keys(t).forEach((function(n){var r=t[n];e=cn.multiply(e,new cn(Number(n),r),false),xe(!0)})),e},e.canCreateNumericTypeFromSumValue=function(t){var e=this;xe(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return cn.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Ke.kSumType},n.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(He({},e)):t[n].value+=e.value}))})),e.canCreateNumericTypeFromSumValue(t)?t:null},n.buildCSSText=function(t,e,n){e==Ie.kNo&&(n+=t===Le.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Le.kYes,Ie.kNo,n);for(var i=1;r.length>i;i++){var a=r[i];n=a.getType()===Ke.kNegateType?a.value.buildCSSText(Le.kYes,Ie.kNo,n+=" - "):a.buildCSSText(Le.kYes,Ie.kNo,n+=" + ")}return e===Ie.kNo&&(n+=")"),n},e}(Mn),Sn=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).operator="product",e}je(e,t),e.create=function(t){return new e(t,Tn(t,cn.multiply))},e.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){Ee(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Ke.kProductType},n.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(n){var r=n.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(n){i.push({value:t.value*n.value,units:e.multiplyUnitMaps(t.units,n.units)})}))})),t=i})),t},n.buildCSSText=function(t,e,n){e==Ie.kNo&&(n+=t===Le.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Le.kYes,Ie.kNo,n);for(var i=1;r.length>i;i++){var a=r[i];n=a.getType()===Ke.kInvertType?a.value.buildCSSText(Le.kYes,Ie.kNo,n+=" / "):a.buildCSSText(Le.kYes,Ie.kNo,n+=" * ")}return e===Ie.kNo&&(n+=")"),n},e}(Mn),Nn=new gn(0,"px"),Cn=(new gn(1,"px"),new gn(0,"deg")),An=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}je(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}(rn),On={number:function(t){return new gn(t)},percent:function(t){return new gn(t,"%")},px:function(t){return new gn(t,"px")},em:function(t){return new gn(t,"em")},rem:function(t){return new gn(t,"rem")},deg:function(t){return new gn(t,"deg")},grad:function(t){return new gn(t,"grad")},rad:function(t){return new gn(t,"rad")},turn:function(t){return new gn(t,"turn")},s:function(t){return new gn(t,"s")},ms:function(t){return new gn(t,"ms")},registerProperty:function(t){Vs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Vs.layoutRegistry.registerLayout(t,e)}},Rn=new un("unset"),Ln=new un("initial"),In=new un("inherit"),_n={"":Rn,unset:Rn,initial:Ln,inherit:In},Dn=function(t){return _n[t]||(_n[t]=new un(t)),_n[t]},Un=new An(0,0,0,0,!0),Gn=new An(0,0,0,0),Bn=he((function(t,e,n,r){return new An(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),Fn=he((function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new gn(e,n)}),(function(e,n){return void 0===n&&(n=t.UnitType.kNumber),""+e+n}));function Vn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Yn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Hn(){}var jn=.7,Xn=1/jn,Wn="\\s*([+-]?\\d+)\\s*",zn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",qn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zn=/^#([0-9a-f]{3,8})$/,Kn=RegExp("^rgb\\("+[Wn,Wn,Wn]+"\\)$"),Qn=RegExp("^rgb\\("+[qn,qn,qn]+"\\)$"),Jn=RegExp("^rgba\\("+[Wn,Wn,Wn,zn]+"\\)$"),$n=RegExp("^rgba\\("+[qn,qn,qn,zn]+"\\)$"),tr=RegExp("^hsl\\("+[zn,qn,qn]+"\\)$"),er=RegExp("^hsla\\("+[zn,qn,qn,zn]+"\\)$"),nr={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 rr(){return this.rgb().formatHex()}function ir(){return this.rgb().formatRgb()}function ar(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Zn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?or(e):3===n?new cr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?sr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?sr(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=Kn.exec(t))?new cr(e[1],e[2],e[3],1):(e=Qn.exec(t))?new cr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Jn.exec(t))?sr(e[1],e[2],e[3],e[4]):(e=$n.exec(t))?sr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=tr.exec(t))?pr(e[1],e[2]/100,e[3]/100,1):(e=er.exec(t))?pr(e[1],e[2]/100,e[3]/100,e[4]):nr.hasOwnProperty(t)?or(nr[t]):"transparent"===t?new cr(NaN,NaN,NaN,0):null}function or(t){return new cr(t>>16&255,t>>8&255,255&t,1)}function sr(t,e,n,r){return r>0||(t=e=n=NaN),new cr(t,e,n,r)}function ur(t){return t instanceof Hn||(t=ar(t)),t?new cr((t=t.rgb()).r,t.g,t.b,t.opacity):new cr}function cr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function lr(){return"#"+fr(this.r)+fr(this.g)+fr(this.b)}function hr(){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 fr(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function pr(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new vr(t,e,n,r)}function dr(t){if(t instanceof vr)return new vr(t.h,t.s,t.l,t.opacity);if(t instanceof Hn||(t=ar(t)),!t)return new vr;if(t instanceof vr)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 vr(o,s,u,t.opacity)}function vr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function yr(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Vn(Hn,ar,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:rr,formatHex:rr,formatHsl:function(){return dr(this).formatHsl()},formatRgb:ir,toString:ir}),Vn(cr,(function(t,e,n,r){return 1===arguments.length?ur(t):new cr(t,e,n,null==r?1:r)}),Yn(Hn,{brighter:function(t){return new cr(this.r*(t=null==t?Xn:Math.pow(Xn,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new cr(this.r*(t=null==t?jn:Math.pow(jn,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:lr,formatHex:lr,formatRgb:hr,toString:hr})),Vn(vr,(function(t,e,n,r){return 1===arguments.length?dr(t):new vr(t,e,n,null==r?1:r)}),Yn(Hn,{brighter:function(t){return new vr(this.h,this.s,this.l*(t=null==t?Xn:Math.pow(Xn,t)),this.opacity)},darker:function(t){return new vr(this.h,this.s,this.l*(t=null==t?jn:Math.pow(jn,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 cr(yr(240>t?t+120:t-240,r,n),yr(t,r,n),yr(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 mr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,gr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,xr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Er=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var br={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},Tr=he((function(t){return Fn("angular"===t.type?Number(t.value):br[t.value]||0,"deg")})),Mr=he((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:Fn(e,r),cy:Fn(n,i)}})),wr=he((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return ao(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(!Qt(u)&&!Qt(a)){for(var c=1;o-i>c;c++)t[i+c].length={type:"%",value:""+(a+(Number(u)-a)*c/(o-i))};i=o,a=Number(u)}}}(i);var a=i.map((function(t){return{offset:Fn(t.length.value,"%"),color:io(t)}}));if("linear-gradient"===n)return new sn(t.GradientType.LinearGradient,{angle:r?Tr(r):Cn,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var o,s=Mr(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;o="extent-keyword"===h?Dn(f):Fn(f,h)}return new sn(t.GradientType.RadialGradient,{cx:u,cy:c,size:o,steps:a})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=mr.exec(e);if(r){var i,a=(null===(i=r[2].match(Er))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new sn(t.GradientType.LinearGradient,{angle:Fn(parseFloat(r[1]),"deg"),steps:a.map((function(t){var e=t[1];return{offset:Fn(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var o=function(t){var e=gr.exec(t);if(e){var n,r=(null===(n=e[4].match(Er))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Fn(50,"%"),cy:Fn(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:Fn(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(o){if(!ie(o))return[new sn(t.GradientType.RadialGradient,o)];e=o}}else if("p"===n)return function(t){var e=xr.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 kr(t){return ee(t)&&!!t.image}var Pr=he((function(t){if(kr(t))return He({repetition:"repeat"},t);if(Qt(t)&&(t=""),"transparent"===t)return Gn;"currentColor"===t&&(t="black");var e=wr(t);if(e)return e;var n=ar(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),Bn.apply(void 0,r)}));function Sr(t,e){if(t instanceof An&&e instanceof An)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(ae(e[n],0,255));return e[3]=ae(e[3],0,1),"rgba("+e.join(",")+")"}]}function Nr(t,e){if(Qt(e))return Fn(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Fn(Number(e),"px");if("deg".search(t)>=0)return Fn(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 Fn(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Cr=he((function(t){return Nr(/px/g,t)})),Ar=(he((function(t){return Nr(RegExp("%","g"),t)})),he((function(t){return oe(t)||isFinite(Number(t))?Fn(Number(t),"px"):Nr(RegExp("px|%|em|rem","g"),t)}))),Or=he((function(t){return Nr(/deg|rad|grad|turn/g,t)}));function Rr(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,u=mn(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(o=c.value,s=l.value,a=en(t.unit)):(gn.isLength(t.unit)||gn.isLength(e.unit))&&(o=_r(t,i,n),s=_r(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Lr(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Xa(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Wa(Number(e.value))),n}function Ir(t){return ie(t)?t.split(" ").map((function(t){return Ar(t)})):t.map((function(t){return Ar(""+t)}))}function _r(e,n,r){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.getGeometryBounds(),a=0;return fe.isEmpty(i)||(a=2*i.halfExtents[n]),Number(e.value)/100*a}return 0}var Dr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ur(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,Dr.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Nr(/deg|rad|grad|turn|px|%/g,t)||Pr(t)}))}),n.lastIndex===t.length)return r}return[]}function Gr(t){return""+t}var Br=he((function(t){return Fn("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));he((function(t){return ie(t)?t.split(" ").map(Br):t.map(Br)}));function Fr(t,e){return[t,e,Gr]}function Vr(t,e){return function(n,r){return[n,r,function(n){return Gr(ae(n,t,e))}]}}function Yr(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Hr=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=Ot(t)}catch(n){e=Ot(""),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]])}r.length>0&&n.push(r);return{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 c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=mo(n,u);l.arcParams=h}if("Z"===c)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)),l.currentPoint=n,e[a]&&so(n,e[a].currentPoint)&&(e[a].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var p=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[p[0]-n[0],p[1]-n[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var d=[u[1],u[2]];l.startTangent=[p[0]-d[0],p[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var v=e[s-1],y=co(v.currentPoint,p);"Q"===v.command?(l.command="Q",l.startTangent=[p[0]-y[0],p[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="TL",l.startTangent=[p[0]-n[0],p[1]-n[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var m=[u[1],u[2]],g=[u[3],u[4]];l.startTangent=[p[0]-m[0],p[1]-m[1]],l.endTangent=[n[0]-g[0],n[1]-g[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[m[0]-g[0],m[1]-g[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[g[0]-m[0],g[1]-m[1]])}else if("S"===c){var x=e[s-1],E=co(x.currentPoint,p),b=[u[1],u[2]];"C"===x.command?(l.command="C",l.startTangent=[p[0]-E[0],p[1]-E[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]]):(l.command="SQ",l.startTangent=[p[0]-b[0],p[1]-b[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]])}else if("A"===c){var T=fo(l,0),M=T.x,w=T.y,k=fo(l,1,!1),P=k.x,S=k.y;l.startTangent=[M,w],l.endTangent=[P,S]}e.push(l)}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,c=o.prePoint,l=void 0;switch(o.command){case"Q":l=$r(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=ni(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;l=ai(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}l&&(o.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.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=re(n),p=re(r),d=ne(n),v=ne(r);if(0===i.length)return{x:f,y:p,width:d-f,height:v-p};for(var y=0;i.length>y;y++){var m=i[y],g=m.currentPoint;g[0]===f?f-=uo(m,e).xExtra:g[0]===d&&(d+=uo(m,e).xExtra),g[1]===p?p-=uo(m,e).yExtra:g[1]===v&&(v+=uo(m,e).yExtra)}return{x:f,y:p,width:d-f,height:v-p}}(o,0),u=s.x,c=s.y,l=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(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},jr=he(Hr);function Xr(t,e){var n=ie(t)?jr(t):Hr(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Wr(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Bt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Bt(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Kt(r,i));var o,s,u,c,l,h,f,p,d=qt(a[0])!==qt(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))})))):pt(a[0]);return[d,(u=a[1],c=d,l=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+=_t(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),p[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function zr(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function qr(t,e){return.001>Math.abs(t-e)}function Zr(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 Kr={box:function(t,e,n,r){return Zr([t,n],[e,r])},length:function(t,e,n,r){return zr(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?zr(t,e,i,a):o>(n-t)*(n-t)+(r-e)*(r-e)?zr(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 Qr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Jr(t,e,n){var r=t+n-2*e;if(qr(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var $r=function(t,e,n,r,i,a){var o=Jr(t,n,i)[0],s=Jr(e,r,a)[0],u=[t,i],c=[e,a];return void 0!==o&&u.push(Qr(t,n,i,o)),void 0!==s&&c.push(Qr(e,r,a,s)),Zr(u,c)};function ti(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 ei(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(qr(s,0))qr(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;qr(h,0)?l.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||l.push(i),0>a||a>1||l.push(a))}return l}var ni=function(t,e,n,r,i,a,o,s){for(var u=[t,o],c=[e,s],l=ei(t,n,i,o),h=ei(e,r,a,s),f=0;l.length>f;f++)u.push(ti(t,n,i,o,l[f]));for(var p=0;h.length>p;p++)c.push(ti(e,r,a,s,h[p]));return Zr(u,c)};function ri(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function ii(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}var ai=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,c=-1/0,l=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&l.push(f):f>o&&a>f&&l.push(f)}for(var p=0;l.length>p;p++){var d=ri(t,0,n,r,i,l[p]);u>d&&(u=d),d>c&&(c=d)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,m=-1/0,g=[a,o],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=v+x;o>a?E>a&&o>E&&g.push(E):E>o&&a>E&&g.push(E)}for(var b=0;g.length>b;b++){var T=ii(0,e,n,r,i,g[b]);y>T&&(y=T),T>m&&(m=T)}return{x:u,y:y,width:c-u,height:m-y}};var oi=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+=zr(r[0],r[1],i[0],i[1])}return e}(t)};function si(t,e){var n;n=ie(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=oi(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=Kr.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]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:a}}var ui=null;function ci(t){return function(e){var n=0;return t.map((function(t){return t===ui?e[n++]:t}))}}function li(t){return t}var hi={matrix:["NNNNNN",[ui,ui,0,0,ui,ui,0,0,0,0,1,0,ui,ui,0,1],li],matrix3d:["NNNNNNNNNNNNNNNN",li],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ci([ui,ui,new gn(1)]),li],scalex:["N",ci([ui,new gn(1),new gn(1)]),ci([ui,new gn(1)])],scaley:["N",ci([new gn(1),ui,new gn(1)]),ci([new gn(1),ui])],scalez:["N",ci([new gn(1),new gn(1),ui])],scale3d:["NNN",li],skew:["Aa",null,li],skewx:["A",null,ci([ui,Cn])],skewy:["A",null,ci([Cn,ui])],translate:["Tt",ci([ui,ui,Nn]),li],translatex:["T",ci([ui,Nn,Nn]),ci([ui,Nn])],translatey:["T",ci([Nn,ui,Nn]),ci([Nn,ui])],translatez:["L",ci([Nn,Nn,ui])],translate3d:["TTL",li]};function fi(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=hi[a];if(!o)return[];var s=e[2].split(","),u=o[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?Cn:Or(t)},N:Br,T:Ar,L:Cr}[f.toUpperCase()](h):{a:Cn,n:c[0],t:Nn}[f]))return[];c.push(p)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function pi(t){var e,n,r,i;switch(t.t){case"rotatex":return i=ja(Lr(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=ja(Lr(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=ja(Lr(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=ja(Lr(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),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,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 l=ja(Lr(t.d[0])),h=ja(Lr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=ja(Lr(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=ja(Lr(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=_r(t.d[0],0,null)||0,n=_r(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=_r(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=_r(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=_r(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=_r(t.d[0],0,null)||0,n=_r(t.d[1],0,null)||0,r=_r(t.d[2],0,null)||0,1];case"perspective":var f=_r(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 di(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 vi(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}(Ka,t))return!1;if(u(Qa,Ka),Qa[3]=0,Qa[7]=0,Qa[11]=0,Qa[15]=1,1e-8>Math.abs(p(Qa)))return!1;var o=Ka[3],s=Ka[7],c=Ka[11],l=Ka[12],d=Ka[13],v=Ka[14],y=Ka[15];if(0!==o||0!==s||0!==c){if(Ja[0]=o,Ja[1]=s,Ja[2]=c,Ja[3]=y,!f(Qa,Qa))return!1;h(Qa,Qa),Z(i,Ja,Qa)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=d,e[2]=v,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}($a,Ka),n[0]=L($a[0]),F($a[0],$a[0]),r[0]=V($a[0],$a[1]),eo($a[1],$a[1],$a[0],1,-r[0]),n[1]=L($a[1]),F($a[1],$a[1]),r[0]/=n[1],r[1]=V($a[0],$a[2]),eo($a[2],$a[2],$a[0],1,-r[1]),r[2]=V($a[1],$a[2]),eo($a[2],$a[2],$a[1],1,-r[2]),n[2]=L($a[2]),F($a[2],$a[2]),r[1]/=n[2],r[2]/=n[2],Y(to,$a[1],$a[2]),0>V($a[0],to))for(var m=0;3>m;m++)n[m]*=-1,$a[m][0]*=-1,$a[m][1]*=-1,$a[m][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+$a[0][0]-$a[1][1]-$a[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-$a[0][0]+$a[1][1]-$a[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-$a[0][0]-$a[1][1]+$a[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+$a[0][0]+$a[1][1]+$a[2][2],0)),$a[2][1]>$a[1][2]&&(a[0]=-a[0]);$a[0][2]>$a[2][0]&&(a[1]=-a[1]);$a[1][0]>$a[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(pi).reduce(di)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var yi=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 c=0;3>c;c++)o[3][u]+=e[c]*o[c][u];var l=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*(l*h-f*p),d[0][2]=2*(l*f+h*p),d[1][0]=2*(l*h+f*p),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(h*f-l*p),d[2][0]=2*(l*f-h*p),d[2][1]=2*(h*f+l*p),d[2][2]=1-2*(l*l+h*h),o=t(o,d);var v,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 m=0;3>m;m++)for(var g=0;3>g;g++)o[m][g]*=n[m];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 mi(t){return t.toFixed(6).replace(".000000","")}function gi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=vi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=vi(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=ae(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 yi(t[0],t[1],t[2],e,t[4]).map(mi).join(",")}])}function xi(t){return t.replace(/[xy]/,"")}function Ei(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function bi(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,a=r.d,o="scale"===i.substring(0,5)?1:0;e.push({t:i,d:a.map((function(t){return"number"==typeof t?Fn(o):Fn(o,t.unit)}))})},a=0;t.length>a;a++)i(a)}var o,s,u=[],c=[],l=[];if(t.length!==e.length){var h=gi(t,e);u=[h[0]],c=[h[1]],l=[["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,y=e[f].d,m=hi[p],g=hi[d],x=void 0;if(s=d,"perspective"===(o=p)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var E=gi([t[f]],[e[f]]);u.push(E[0]),c.push(E[1]),l.push(["matrix",[E[2]]])}else{if(p===d)x=p;else if(m[2]&&g[2]&&xi(p)===xi(d))x=xi(p),v=m[2](v),y=g[2](y);else{if(!m[1]||!g[1]||Ei(p)!==Ei(d)){var b=gi(t,e);u=[b[0]],c=[b[1]],l=[["matrix",[b[2]]]];break}x=Ei(p),v=m[1](v),y=g[1](y)}for(var T=[],M=[],w=[],k=0;v.length>k;k++){var P=Rr(v[k],y[k],n,!1,k);T[k]=P[0],M[k]=P[1],w.push(P[2])}u.push(T),c.push(M),l.push([x,w])}}if(r){var S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var Ti=he((function(t){if(ie(t)){if("text-anchor"===t)return[Fn(0,"px"),Fn(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:[Ar(Mi(e[0])),Ar(Mi(e[1]))]}return[Fn(t[0]||0,"px"),Fn(t[1]||0,"px")]}));function Mi(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var wi=function(){function t(){this.parser=Or,this.mixer=Fr}return t.prototype.calculator=function(t,e,n,r){return Lr(n)},t}(),ki=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof un&&(n=null),Vs.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&Vs.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Pi=function(){function t(){this.parser=Pr,this.mixer=Sr}return t.prototype.calculator=function(t,e,n,r){return n instanceof un?"none"===n.value?Un:Gn:n},t}(),Si=function(){function t(){this.parser=Ur}return t.prototype.calculator=function(t,e,n){return n instanceof un?[]:n},t}();function Ni(t){var e=t.parsedStyle.fontSize;return Qt(e)?null:e}var Ci=function(){function e(){this.parser=Ar,this.mixer=Fr}return e.prototype.calculator=function(e,n,r,i,a){if(!gn.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=Ni(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=Ni(i.ownerDocument.documentElement);if(u)return u*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}},e}(),Ai=function(){function t(){this.mixer=Yr}var e=t.prototype;return e.parser=function(t){var e=Ir(oe(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}(),Oi=function(){function t(){this.mixer=Yr}var e=t.prototype;return e.parser=function(t){var e=Ir(oe(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}(),Ri=function(e){function n(){return e.apply(this,arguments)||this}return je(n,e),n.prototype.postProcessor=function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var a=e.parsedStyle,o=a.cx,s=a.cy;Qt(o)||(n=o),Qt(s)||(r=s);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1,u.x2),r=Math.min(c,l),i=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:Qt(e.parsedStyle.x)||(n=e.parsedStyle.x),Qt(e.parsedStyle.y)||(r=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0),!Qt(n)||!Qt(r)||!Qt(i)){var h=e.getLocalPosition(),f=h[0],p=h[1],d=h[2];e.setLocalPosition(Qt(n)?f:n,Qt(r)?p:r,Qt(i)?d:i)}},n}(Ci),Li=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof un&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a},t}(),Ii=function(){function t(){this.mixer=Fr,this.parser=Br}return t.prototype.calculator=function(t,e,n){return n.value},t}(),_i=function(){function e(){this.parser=Br,this.mixer=Vr(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}(),Di=function(){function t(){this.parser=Br,this.mixer=Vr(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Ui=function(){function e(){this.parser=Xr,this.mixer=Wr}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof un&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new me(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},e}(),Gi=function(){function e(){this.parser=si}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),Bi=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=Vr(0,1/0),e}return je(e,t),e}(Ci),Fi=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof un?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),Vi=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}(),Yi=function(){function t(){this.parser=fi,this.mixer=bi}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof un?[]:n},e.postProcessor=function(t){ro(t.parsedStyle.transform,t)},t}(),Hi=function(){this.parser=Ti},ji=function(){function t(){this.parser=Br}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}(),Xi=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,ya),this.define(t.Shape.ELLIPSE,Ma),this.define(t.Shape.RECT,Ba),this.define(t.Shape.IMAGE,Ca),this.define(t.Shape.LINE,Oa),this.define(t.Shape.GROUP,ka),this.define(t.Shape.PATH,La),this.define(t.Shape.POLYGON,_a),this.define(t.Shape.POLYLINE,Ua),this.define(t.Shape.TEXT,Va),this.define(t.Shape.HTML,Sa)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Wi=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 ye,this.page=new ye,this.canvas=new ye,this.viewport=new ye,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(_e)},Ye(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}(),zi=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(ze(r),n),r}return je(e,t),e}(Wi),qi=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,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,a),!0;case 6:return l.fn.call(l.context,e,r,i,a,o),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,p=l.length;for(c=0;p>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].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,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[a]=1===c.length?c[0]:c: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})),Zi=function(){function t(){this.emitter=new qi}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=ce(n)&&n||ee(n)&&n.capture,i=ee(n)&&n.once,a=be(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=be(e)?e:e.handleEvent,o){var c=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&&c.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=ce(n)&&n||ee(n)&&n.capture,a=be(e)?void 0:e;return t=i?t+"capture":t,e=be(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 zi(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!(t instanceof Wi))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}(),Ki=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}je(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(_e)},r.lookupNamespaceURI=function(t){throw Error(_e)},r.lookupPrefix=function(t){throw Error(_e)},r.normalize=function(){throw Error(_e)},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");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 c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];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){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},Ye(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=Ze(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}(Zi);Ki.DOCUMENT_POSITION_DISCONNECTED=1,Ki.DOCUMENT_POSITION_PRECEDING=2,Ki.DOCUMENT_POSITION_FOLLOWING=4,Ki.DOCUMENT_POSITION_CONTAINS=8,Ki.DOCUMENT_POSITION_CONTAINED_BY=16,Ki.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Qi,Ji,$i=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 Vs.AnimationTimeline(ze(n))}catch(t){}var r={};return os.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=be(n)?n(t.Shape.GROUP):n)})),n.documentElement=new ka({id:"g-root",style:r}),n.documentElement.ownerDocument=ze(n),n.documentElement.parentNode=ze(n),n.childNodes=[n.documentElement],n}je(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?Va:ka);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(_e)},r.destroy=function(){try{this.documentElement.destroy(),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=Vs.displayObjectPool.getByEntity(t.id),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,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=Fe(Ge().mark((function t(e,n){var r,i,a,o,s,u,c,l,h,f;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:a}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));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,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=Fe(Ge().mark((function t(e,n){var r,i,a,o,s,u,c,l,h,f;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:a}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:l,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw Error(De)},r.insertBefore=function(t,e){throw Error(De)},r.removeChild=function(t,e){throw Error(De)},r.replaceChild=function(t,e,n){throw Error(De)},r.append=function(){throw Error(De)},r.prepend=function(){throw Error(De)},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)},Ye(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}(Ki);(Qi=t.Strategy||(t.Strategy={}))[Qi.Standard=0]="Standard",(Ji=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Ji.ATTR_MODIFIED="DOMAttrModified",Ji.INSERTED="DOMNodeInserted",Ji.REMOVED="removed",Ji.MOUNTED="DOMNodeInsertedIntoDocument",Ji.UNMOUNTED="DOMNodeRemovedFromDocument",Ji.BOUNDS_CHANGED="bounds-changed",Ji.RENDER_ORDER_CHANGED="render-order-changed",Ji.CULLED="culled";var ta=function(t){function e(e,n,r,i,a,o,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return je(e,t),e}(Wi);ta.ADDITION=2,ta.MODIFICATION=1,ta.REMOVAL=3;var ea=0;var na=new ta(t.ElementEvent.INSERTED,null,"","","",0,"",""),ra=new ta(t.ElementEvent.REMOVED,null,"","","",0,"",""),ia=new zi(t.ElementEvent.DESTROY),aa=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=ea++,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:I(0,0,0),localRotation:ut(0,0,0,1),localScale:I(1,1,1),localTransform:s(),localSkew:ft(0,0),position:I(0,0,0),rotation:ut(0,0,0,1),scaling:I(1,1,1),worldTransform:s(),origin:I(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={anchor:Rn,opacity:Rn,fillOpacity:Rn,strokeOpacity:Rn,fill:Rn,stroke:Rn,transform:Rn,transformOrigin:Rn,visibility:Rn,pointerEvents:Rn,lineWidth:Rn,lineCap:Rn,lineJoin:Rn,increasedLineWidthForHitTesting:Rn,fontSize:Rn,fontFamily:Rn,fontStyle:Rn,fontWeight:Rn,fontVariant:Rn,textAlign:Rn,textBaseline:Rn,textTransform:Rn,zIndex:Rn,filter:Rn,shadowType:Rn},n.parsedStyle={},n.attributes={},n}je(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw Error(_e)},r.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Vs.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),na.relatedNode=this,t.dispatchEvent(na),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 ra.relatedNode=this,t.dispatchEvent(ra),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Vs.sceneGraphService.detach(t),t},r.removeChildren=function(){var t=this;this.childNodes.slice().forEach((function(e){t.removeChild(e)}))},r.destroyChildren=function(){this.childNodes.slice().forEach((function(t){t.destroyChildren(),t.destroy()}))},r.matches=function(t){return Vs.sceneGraphService.matches(t,this)},r.getElementById=function(t){return Vs.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return Vs.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return Vs.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return Vs.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return Vs.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return Vs.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(Vs.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(ia),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return Vs.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return Vs.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return Vs.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return Vs.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return Vs.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){var e=this.attributes[t];if(void 0===e){var n=Me(t);return Qt(e=this.attributes[n])?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(_e)},r.getAttributeNode=function(t){throw Error(_e)},r.getAttributeNodeNS=function(t,e){throw Error(_e)},r.hasAttributeNS=function(t,e){throw Error(_e)},r.removeAttributeNS=function(t,e){throw Error(_e)},r.removeAttributeNode=function(t){throw Error(_e)},r.setAttributeNS=function(t,e,n){throw Error(_e)},r.setAttributeNode=function(t){throw Error(_e)},r.setAttributeNodeNS=function(t){throw Error(_e)},r.toggleAttribute=function(t,e){throw Error(_e)},Ye(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}(Ki),oa=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 ye,e.movement=new ye,e.offset=new ye,e.global=new ye,e.screen=new ye,e}je(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(_e)},Ye(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}(Wi),sa=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}je(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}(oa),ua=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 je(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(oa),ca=new ta(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,ta.MODIFICATION,null,null),la={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:""},ha={anchor:[0,0],fill:Un,stroke:Un,transform:[],zIndex:0,filter:[],shadowType:"outer"},fa=["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],pa=[].concat(fa,["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),da=function(e){function n(n){var r,i;return(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],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=He({},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,ha,i.config.initialParsedStyle),Object.assign(i.attributes,la),i.initAttributes(i.config.style),i.style=new Proxy({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}}),Vs.displayObjectPool.add(i.entity,ze(i)),i}je(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Vs.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var r=He({},this.attributes);for(var i in r){var a=r[i];a instanceof n&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(r[i]=a.cloneNode(t)),e&&(r[i]=e(i,a))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},r.initAttributes=function(e){void 0===e&&(e={});var n=this.renderable;Vs.styleValueRegistry.processProperties(this,e,{forceUpdateGeometry:!0,usedAttributes:this.tagName===t.Shape.GROUP||this.tagName===t.Shape.TEXT?pa:fa}),n.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Me(t);le(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];Vs.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(ca.relatedNode=this,ca.prevValue=a,ca.newValue=e,ca.attrName=t,ca.prevParsedValue=o,ca.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(ca):(ca.target=this,this.ownerDocument.defaultView.dispatchEvent(ca,!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 me(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),Vs.sceneGraphService.setOrigin(this,Ha(t,e,n)),this},r.getOrigin=function(){return Vs.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Vs.sceneGraphService.setPosition(this,Ha(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Vs.sceneGraphService.setLocalPosition(this,Ha(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Vs.sceneGraphService.translate(this,Ha(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Vs.sceneGraphService.translateLocal(this,Ha(t,e,n)),this},r.getPosition=function(){return Vs.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return Vs.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=Ha(t,e=e||t,n=n||t)),Vs.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Ha(t,e=e||t,n=n||t)),Vs.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return Vs.sceneGraphService.getLocalScale(this)},r.getScale=function(){return Vs.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return Xa(za(R(),Vs.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return Xa(za(R(),Vs.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return Vs.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return Vs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return Qt(e)&&Qt(n)?Vs.sceneGraphService.rotateLocal(this,0,0,t):Vs.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return Qt(e)&&Qt(n)?Vs.sceneGraphService.rotate(this,0,0,t):Vs.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return Vs.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return Vs.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return Vs.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return Vs.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return Vs.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return Vs.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return Vs.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return Vs.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return Vs.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){Vs.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?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},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=b(R(),e),r=n[0],i=n[1],a=T(R(),e),o=a[0],s=a[1],u=M(K(),e),c=za(R(),u);return qa(c[0]||c[2],r,i,o,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=Za(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=Za(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(){this.style.visibility="visible"},r.hide=function(){this.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},Ye(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(aa),va=["style"],ya=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,va);return e.call(this,He({type:t.Shape.CIRCLE,style:He({cx:"",cy:"",r:""},i),initialParsedStyle:{anchor:[.5,.5]}},a))||this}return je(n,e),n}(da),ma=["style"],ga=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,a=We(r,ma);return(n=t.call(this,He({style:He({x:"",y:""},i)},a))||this).isCustomElement=!0,n}return je(e,t),e}(da),xa={},Ea=[],ba=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return xa[t]},n.getAll=function(){return Object.keys(xa).map((function(t){return xa[t]}))},n.add=function(e,n){xa[e]=n,n.nodeName===t.Shape.HTML&&Ea.push(n)},n.remove=function(e){var n=xa[e];if(n&&(delete xa[e],n.nodeName===t.Shape.HTML)){var r=Ea.indexOf(n);Ea.splice(r,1)}},n.getHTMLs=function(){return Ea},e}(),Ta=["style"],Ma=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,Ta);return e.call(this,He({type:t.Shape.ELLIPSE,style:He({cx:"",cy:"",rx:"",ry:""},i),initialParsedStyle:{anchor:[.5,.5]}},a))||this}return je(n,e),n}(da),wa=["style"],ka=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,wa);return e.call(this,He({type:t.Shape.GROUP,style:He({x:"",y:"",width:"",height:""},i)},a))||this}return je(n,e),n}(da),Pa=["style"],Sa=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=We(i,Pa);return(r=e.call(this,He({type:t.Shape.HTML,style:He({x:"",y:"",width:"auto",height:"auto",innerHTML:""},a)},o))||this).cullable.enable=!1,r}je(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 fe;return o.setMinMax(I(i,a,0),I(i+n.width,a+n.height,0)),o}return null},r.getLocalBounds=function(){if(this.parentNode){var t=f(s(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!fe.isEmpty(e)){var n=new fe;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(da),Na=["style"],Ca=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,Na);return e.call(this,He({type:t.Shape.IMAGE,style:He({x:"",y:"",img:"",width:"",height:""},i)},a))||this}return je(n,e),n}(da),Aa=["style"],Oa=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=We(i,Aa);(r=e.call(this,He({type:t.Shape.LINE,style:He({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&&u instanceof da&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&c instanceof da&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}je(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&&r instanceof da&&(this.markerStartAngle=0,r.remove()),i&&i instanceof da&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&r instanceof da&&(this.markerEndAngle=0,r.remove()),i&&i instanceof da&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.defX,s=e.defY,u=t?e.markerStart:e.markerEnd;if(u&&u instanceof da){var c,l,h,f,p,d,v;t?(f=n-o,p=i-s,l=r-n,h=a-i,d=e.markerStartOffset||0,v=this.markerStartAngle):(f=r-o,p=a-s,l=n-r,h=i-a,d=e.markerEndOffset||0,v=this.markerEndAngle),u.setLocalEulerAngles(180*(c=Math.atan2(h,l))/Math.PI+v),u.setLocalPosition(f+Math.cos(c)*d,p+Math.sin(c)*d)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,a=Kr.pointAt(n.x1,n.y1,n.x2,n.y2,t),o=a.x,s=a.y,u=H(R(),I(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ye(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 Kr.length(t.x1,t.y1,t.x2,t.y2)},n}(da),Ra=["style"],La=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=We(i,Ra);(r=e.call(this,He({type:t.Shape.PATH,style:He({path:"",miterLimit:""},a)},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof da&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof da&&r.placeMarkerMid(l),c&&c instanceof da&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}je(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&&r instanceof da&&(this.markerStartAngle=0,r.remove()),i&&i instanceof da&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof da&&(this.markerEndAngle=0,r.remove()),i&&i instanceof da&&(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&&o instanceof da){var s,u,c,l,h,f,p;if(t){var d=this.getStartTangent(),v=d[0],y=d[1];l=y[0]-i,h=y[1]-a,u=v[0]-y[0],c=v[1]-y[1],f=n||0,p=this.markerStartAngle}else{var m=this.getEndTangent(),g=m[0],x=m[1];l=x[0]-i,h=x[1]-a,u=g[0]-x[0],c=g[1]-x[1],f=r||0,p=this.markerEndAngle}o.setLocalEulerAngles(180*(s=Math.atan2(c,u))/Math.PI+p),o.setLocalPosition(l+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&&t instanceof da)for(var a=1;n.length-1>a;a++){var o=n[a].currentPoint,s=o[0],u=o[1],c=1===a?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return oo(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 zt(t,e,dt(dt({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),o=a.x,s=a.y,u=H(R(),I(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ye(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*oo(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}(da),Ia=["style"],_a=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=We(i,Ia);(r=e.call(this,He({type:t.Shape.POLYGON,style:He({points:"",miterLimit:"",isClosed:!0},a)},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof da&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof da&&r.placeMarkerMid(l),c&&c instanceof da&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}je(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&&r instanceof da&&(this.markerStartAngle=0,r.remove()),i&&i instanceof da&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof da&&(this.markerEndAngle=0,r.remove()),i&&i instanceof da&&(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.points.points,r=e.defX,i=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&a instanceof da){var o,s,u,c,l,h,f;if(c=n[0][0]-r,l=n[0][1]-i,t)s=n[1][0]-n[0][0],u=n[1][1]-n[0][1],h=e.markerStartOffset||0,f=this.markerStartAngle;else{var p=n.length;this.style.isClosed?(s=n[p-1][0]-n[0][0],u=n[p-1][1]-n[0][1]):(c=n[p-1][0]-r,l=n[p-1][1]-i,s=n[p-2][0]-n[p-1][0],u=n[p-2][1]-n[p-1][1]),h=e.markerEndOffset||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(c+Math.cos(o)*h,l+Math.sin(o)*h)}},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&&t instanceof da)for(var a=1;(this.style.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}(da),Da=["style"],Ua=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,Da);return e.call(this,He({type:t.Shape.POLYLINE,style:He({points:"",miterLimit:"",isClosed:!1},i)},a))||this}je(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 c=Kr.pointAt(o[u][0],o[u][1],o[u+1][0],o[u+1][1],s),l=c.x,h=c.y,f=H(R(),I(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ye(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}(_a),Ga=["style"],Ba=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,Ga);return e.call(this,He({type:t.Shape.RECT,style:He({x:"",y:"",width:"",height:"",radius:""},i)},a))||this}return je(n,e),n}(da),Fa=["style"],Va=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=We(r,Fa);return e.call(this,He({type:t.Shape.TEXT,style:He({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},i)},a))||this}je(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}(da);function Ya(t){return void 0===t?0:t>360||-360>t?t%360:t}function Ha(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),oe(t)?I(t,e,n):Array.isArray(t)&&3===t.length?(r=t,(i=new a(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):I(t[0],t[1]||e,t[2]||n);var r,i}function ja(t){return t*(Math.PI/180)}function Xa(t){return t*(180/Math.PI)}function Wa(t){return 360*t}function za(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,a=T(R(),e),o=a[0],s=a[1],u=a[2],c=Math.asin(-e[2]/o);return i>c?c>-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]=c,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,c=n*n+o+s+u,l=n*a-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(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 qa(t,e,n,r,i){var o,s,u,c,l,h,f,p,d,v,y=Math.cos(t),m=Math.sin(t);return o=r*y,s=i*m,u=0,c=-r*m,l=i*y,h=0,f=e,p=n,d=1,(v=new a(9))[0]=o,v[1]=s,v[2]=u,v[3]=c,v[4]=l,v[5]=h,v[6]=f,v[7]=p,v[8]=d,v}function Za(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=Xa(Math.atan2(n,e));return[t[6],t[7],a,o,s]}var Ka=s(),Qa=s(),Ja=q(),$a=[R(),R(),R()],to=R();function eo(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 no=s();function ro(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 da({}),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 h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(h[0],h[1],h[2])}else if("translate"===i){var f=a||[Nn,Nn];e.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===i){e.translateLocal((a||[Nn])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(a||[Nn])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(a||[Nn])[0].value)}else if("translate3d"===i){var p=a||[Nn,Nn,Nn];e.translateLocal(p[0].value,p[1].value,p[2].value)}else if("rotate"===i){e.rotateLocal(0,0,(a||[Cn])[0].value)}else if("rotatex"===i){e.rotateLocal((a||[Cn])[0].value,0,0)}else if("rotatey"===i){e.rotateLocal(0,(a||[Cn])[0].value,0)}else if("rotatez"===i){e.rotateLocal(0,0,(a||[Cn])[0].value)}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(ja(d[0]),ja(d[1]))}else if("skewx"===i){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(ja(v[0]),e.getLocalSkew()[1])}else if("skewy"===i){var y=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],ja(y[0]))}else if("matrix"===i){var m=a.map((function(t){return t.value}));e.setLocalTransform(c(no,m[0],m[1],0,0,m[2],m[3],0,0,0,0,1,0,m[4]+n,m[5]+r,0,1))}else"matrix3d"===i&&(c.apply(O,[no].concat(a.map((function(t){return t.value})))),no[12]+=n,no[13]+=r,e.setLocalTransform(no))}))}return e.getLocalTransform()}function io(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var ao=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,p=/^\)/,d=/^,/,v=/^\#([0-9a-fA-F]+)/,y=/^([a-zA-Z]+)/,m=/^rgb/i,g=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function b(t){throw Error(E+": "+t)}function T(){var t=R(M);return E.length>0&&b("Invalid input not EOF"),t}function M(){return w("linear-gradient",t,P)||w("repeating-linear-gradient",e,P)||w("radial-gradient",n,S)||w("repeating-radial-gradient",r,S)||w("conic-gradient",i,S)}function w(t,e,n){return k(e,(function(e){var r=n();return r&&(G(d)||b("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(L)}}))}function k(t,e){var n=G(t);if(n){G(f)||b("Missing (");var r=e(n);return G(p)||b("Missing )"),r}}function P(){return U("directional",a,1)||U("angular",h,1)}function S(){var t,e,n=N();return n&&((t=[]).push(n),e=E,G(d)&&((n=N())?t.push(n):E=e)),t}function N(){var t=function(){var t=U("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=U("shape",/^(ellipse)/i,0);t&&(t.style=_()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return U("extent-keyword",o,1)}function A(){if(U("position",/^at/,0)){var t=O();return t||b("Missing positioning value"),t}}function O(){var t={x:_(),y:_()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);G(d);)(e=t())?n.push(e):b("One extra comma");return n}function L(){var t=U("hex",v,1)||k(g,(function(){return{type:"rgba",value:R(I)}}))||k(m,(function(){return{type:"rgb",value:R(I)}}))||U("literal",y,0);return t||b("Expected color definition"),t.length=_(),t}function I(){return G(x)[1]}function _(){return U("%",c,1)||U("position-keyword",s,1)||D()}function D(){return U("px",u,1)||U("em",l,1)}function U(t,e,n){var r=G(e);if(r)return{type:t,value:r[n]}}function G(t){var e=/^[\n\r\t\s]+/.exec(E);e&&B(e[0].length);var n=t.exec(E);return n&&B(n[0].length),n}function B(t){E=E.substring(t)}return function(t){return E=t,T()}}();function oo(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=zt(t.parsedStyle.path.absolutePath,void 0,dt(dt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function so(t,e){return t[0]===e[0]&&t[1]===e[1]}function uo(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=1e-5),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(a[1]-i[1],a[0]-i[0])),l=Math.abs(Math.atan2(a[0]-i[0],a[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-(c=c>Math.PI/2?Math.PI-c:c))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function co(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var lo=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))))},ho=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=ja(r=ue(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 c=(t.x-o.x)/2,l=(t.y-o.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},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),y=d*(-n*h.x/e),m={x:Math.cos(u)*v-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*v+Math.cos(u)*y+(t.y+o.y)/2},g={x:(h.x-v)/e,y:(h.y-y)/n},x=lo({x:1,y:0},g),E=lo(g,{x:(-h.x-v)/e,y:(-h.y-y)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,T=e*Math.cos(b),M=n*Math.sin(b);return{x:Math.cos(u)*T-Math.sin(u)*M+m.x,y:Math.sin(u)*T+Math.cos(u)*M+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function fo(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,c=r.arcFlag,l=r.sweepFlag,h=ho({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=ho({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!c,!!l,{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 po(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function vo(t,e){return po(t)*po(e)?(t[0]*e[0]+t[1]*e[1])/(po(t)*po(e)):1}function yo(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(vo(t,e))}function mo(t,e){var n=e[1],r=e[2],i=ue(ja(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/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 y=r?v*n*f/r:0,m=n?v*-r*h/n:0,g=(s+c)/2+Math.cos(i)*y-Math.sin(i)*m,x=(u+l)/2+Math.sin(i)*y+Math.cos(i)*m,E=[(h-y)/n,(f-m)/r],b=[(-1*h-y)/n,(-1*f-m)/r],T=yo([1,0],E),M=yo(E,b);return vo(E,b)>-1||(M=Math.PI),1>vo(E,b)||(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&0>M&&(M+=2*Math.PI),{cx:g,cy:x,rx:so(t,[c,l])?0:n,ry:so(t,[c,l])?0:r,startAngle:T,endAngle:T+M,xRotation:i,arcFlag:a,sweepFlag:o}}function go(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-o,n-a,c,n,c],["C",n+a,c,u,r-o,u,r],["C",u,r+o,n+a,l,n,l],["C",n-a,l,s,r+o,s,r],["Z"]]}var xo=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},Eo=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},bo=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},To=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=xo,this.call=xo,this._callAsync=Eo,this.callAsync=Eo,this._promise=bo,this.promise=bo,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=Ze(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var a=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=a){r++;break}}this.taps[r]=t},t}(),Mo=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,a="",o=0;this.options.interceptors.length>o;o++){var s=this.options.interceptors[o];s.call&&(a+=this.getInterceptor(o)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return a+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=Ze(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,a=e.rethrowIfPossible,o="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(o+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),o+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}o+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":a||(o+="var _hasError"+t+" = false;\n",o+="try {\n"),o+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a||(o+="} catch(_err) {\n",o+="_hasError"+t+" = true;\n",o+=n("_err"),o+="}\n",o+="if(!_hasError"+t+") {\n"),r&&(o+=r("_result"+t)),i&&(o+=i()),a||(o+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",o+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":o+="var _hasResult"+t+" = false;\n",o+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o+="if (!_promise"+t+" || !_promise"+t+".then)\n",o+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",o+="_promise"+t+".then((function(_result"+t+") {\n",o+="_hasResult"+t+" = true;\n",r&&(o+=r("_result"+t)),i&&(o+=i()),o+="}), function(_err"+t+") {\n",o+="if(_hasResult"+t+") throw _err"+t+";\n",o+=n("_err"+t),o+="});\n"}return o},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,a=t.onDone,o=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return a();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||o,l="",h=a,f=0,p=function(t){var i=t;h!==a&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var o=h,p=function(t){return t?"":a()},d=e.callTap(i,{onError:function(t){return n(i,t,o,p)},onResult:r&&function(t){return r(i,t,o,p)},onDone:!r&&o,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)p(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),a="";i||(a+="var _looper = (function() {\n",a+="var _loopAsync = false;\n"),a+="var _loop;\n",a+="do {\n",a+="_loop = false;\n";for(var o=0;this.options.interceptors.length>o;o++){var s=this.options.interceptors[o];s.loop&&(a+=this.getInterceptor(o)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return a+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var a="";return a+="if("+e+" !== undefined) {\n",a+="_loop = true;\n",i||(a+="if(_loopAsync) _looper();\n"),a+=r(!0),a+="} else {\n",a+=n(),a+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),a+="} while(_loop);\n",i||(a+="_loopAsync = true;\n",a+="});\n",a+="_looper();\n"),a},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,a=t.rethrowIfPossible,o=t.onTap,s=void 0===o?function(t,e){return e()}:o;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:a});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var o=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,o,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,o,c),n+="}\n"},onDone:!r&&function(){return o()},rethrowIfPossible:a})}),o,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),wo=function(t){function e(){return t.apply(this,arguments)||this}return je(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(Mo),ko=new wo,Po=function(t){return ko.setup(this,t),ko.create(t)},So=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Po,r._call=void 0,r.call=void 0,r}return je(e,t),e}(To),No=function(t){function e(){return t.apply(this,arguments)||this}return je(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(Mo),Co=new No,Ao=function(t){return Co.setup(this,t),Co.create(t)},Oo=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Ao,r._call=void 0,r.call=void 0,r}return je(e,t),e}(To),Ro=function(t){function e(){return t.apply(this,arguments)||this}return je(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(Mo),Lo=new Ro,Io=function(){throw Error("tapAsync is not supported on a SyncHook")},_o=function(){throw Error("tapPromise is not supported on a SyncHook")},Do=function(t){return Lo.setup(this,t),Lo.create(t)},Uo=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Io,r.tapPromise=_o,r.compile=Do,r}return je(e,t),e}(To),Go=function(t){function e(){return t.apply(this,arguments)||this}return je(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(Mo),Bo=new Go,Fo=function(){throw Error("tapAsync is not supported on a SyncWaterfallHook")},Vo=function(){throw Error("tapPromise is not supported on a SyncWaterfallHook")},Yo=function(t){return Bo.setup(this,t),Bo.create(t)},Ho=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Fo,r.tapPromise=Vo,r.compile=Yo,r}return je(e,t),e}(Uo),jo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Xo=/([\"\'])[^\'\"]+\1/;var Wo=1,zo="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},qo=Date.now(),Zo={},Ko=Date.now(),Qo=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Ko,r=n>16?0:16-n,i=Wo++;return Zo[i]=t,Object.keys(Zo).length>1||setTimeout((function(){Ko=e;var t=Zo;Zo={},Object.keys(t).forEach((function(e){return t[e](zo.performance&&"function"==typeof zo.performance.now?zo.performance.now():Date.now()-qo)}))}),r),i},Jo=function(t){delete Zo[t]},$o=function(t){return"string"!=typeof t?Qo:""===t?zo.requestAnimationFrame:zo[t+"RequestAnimationFrame"]},ts=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!!$o(t)})),es=$o(ts),ns=function(t){return"string"!=typeof t?Jo:""===t?zo.cancelAnimationFrame:zo[t+"CancelAnimationFrame"]||zo[t+"CancelRequestAnimationFrame"]}(ts);zo.requestAnimationFrame=es,zo.cancelAnimationFrame=ns;var rs,is,as,os=[{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},{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",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"}],ss={},us=new WeakMap,cs={},ls=he((function(t){return t.sort((function(t,e){return cs[t]-cs[e]}))})),hs=R(),fs=R(),ps=R(),ds=function(){function e(){var t=this;os.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){ss[e]=t,cs[e]=t.p||0}))},n.unregisterMetadata=function(t){delete ss[t]},n.getPropertySyntax=function(t){return Vs.CSSPropertySyntaxFactory[t]},n.processProperties=function(t,e,n){var r=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]});var i=n.skipUpdateAttribute,a=n.skipParse,o=n.usedAttributes,s=n.forceUpdateGeometry,u=Object.keys(e);u.forEach((function(n){var r,a=Me(n);i||(t.attributes[a]=e[n]),!s&&(null===(r=ss[a])||void 0===r?void 0:r.l)&&(s=!0)})),a||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(u=ls((null==o?void 0:o.length)?Array.from(new Set(u.concat(o))):u)).forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),s&&this.updateGeometry(t),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),t.children.length&&u.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=ss[t],i=e;if((""===e||Qt(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=Dn(e);else if(r){var a=r.k,o=r.syntax,s=o&&this.getPropertySyntax(o);a&&a.indexOf(e)>-1?i=Dn(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=ss[t],i=e;if(r){var a=r.syntax,o=r.d;if(e instanceof un){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)Qt(o)||(e=this.parseProperty(t,be(o)?o(n.nodeName):o,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return Qt(u)?void this.addUnresolveProperty(n,t):u}}var c=a&&this.getPropertySyntax(a);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof un?e.value:e}return i},n.postProcessProperty=function(t,e){var n=ss[t];if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.addUnresolveProperty=function(t,e){var n=us.get(t);n||(us.set(t,[]),n=us.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=us.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=us.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),us.delete(t)}},n.updateGeometry=function(e){var n=Vs.geometryUpdaterFactory[e.nodeName];if(n){var r=e.geometry;r.contentBounds||(r.contentBounds=new fe),r.renderBounds||(r.renderBounds=new fe);var i=e.parsedStyle,a=n.update(i,e),o=a.width,s=a.height,u=a.depth,c=void 0===u?0:u,l=a.offsetX,h=void 0===l?0:l,f=a.offsetY,p=void 0===f?0:f,d=a.offsetZ,v=void 0===d?0:d,y=0>o,m=0>s,g=D(hs,Math.abs(o)/2,Math.abs(s)/2,c/2),x=i.stroke,E=i.lineWidth,b=i.increasedLineWidthForHitTesting,T=i.shadowType,M=i.shadowColor,w=i.filter,k=void 0===w?[]:w,P=i.transformOrigin,S=i.anchor;e.nodeName===t.Shape.TEXT&&delete i.anchor;var N=D(fs,(1-2*(S&&S[0]||0))*o/2+h,(1-2*(S&&S[1]||0))*s/2+p,(1-2*(S&&S[2]||0))*g[2]+v);if(r.contentBounds.update(N,g),x&&!x.isNone){var C=((E||0)+(b||0))*(e.nodeName===t.Shape.POLYLINE||e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.PATH?Math.SQRT2:.5);U(g,g,D(ps,C,C,0))}if(r.renderBounds.update(N,g),M&&T&&"inner"!==T){var A=r.renderBounds,O=A.min,R=A.max,L=i.shadowBlur||0,_=i.shadowOffsetX||0,G=i.shadowOffsetY||0,B=R[0]+L+_,F=O[1]-L+G,V=R[1]+L+G;O[0]=Math.min(O[0],O[0]-L+_),R[0]=Math.max(R[0],B),O[1]=Math.min(O[1],F),R[1]=Math.max(R[1],V),r.renderBounds.setMinMax(O,R)}k.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,U(r.renderBounds.halfExtents,r.renderBounds.halfExtents,I(i,i,0)))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,c=u.min,l=u.max,h=l[0]+s+a,f=c[1]-s+o,p=l[1]+s+o;c[0]=Math.min(c[0],c[0]-s+a),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],p),r.renderBounds.setMinMax(c,l)}})),S=i.anchor;var Y=(y?-1:1)*_r(P[0],0,e),H=(m?-1:1)*_r(P[1],1,e);e.setOrigin(Y-=(y?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,H-=(m?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2),Vs.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=ss[t];return!!e&&e.inh},e}();(rs=t.CameraType||(t.CameraType={}))[rs.ORBITING=0]="ORBITING",rs[rs.EXPLORING=1]="EXPLORING",rs[rs.TRACKING=2]="TRACKING",(is=t.CameraTrackingMode||(t.CameraTrackingMode={}))[is.DEFAULT=0]="DEFAULT",is[is.ROTATIONAL=1]="ROTATIONAL",is[is.TRANSLATIONAL=2]="TRANSLATIONAL",is[is.CINEMATIC=3]="CINEMATIC",(as=t.CameraProjectionMode||(t.CameraProjectionMode={}))[as.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",as[as.PERSPECTIVE=1]="PERSPECTIVE";var vs,ys={UPDATED:"updated"},ms=2e-4,gs=function(){function e(){this.canvas=void 0,this.eventEmitter=new qi,this.matrix=s(),this.right=I(1,0,0),this.up=I(0,1,0),this.forward=I(0,0,1),this.position=I(0,0,1),this.focalPoint=I(0,0,0),this.distanceVector=I(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=s(),this.projectionMatrixInverse=s(),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 ve,this.orthoMatrix=s()}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 f(s(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=x(s(),[t,e,0]);this.jitteredProjectionMatrix=d(s(),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=I(o.x-r,o.y-i,0),u=V(s,this.right)/L(this.right),c=V(s,this.up)/L(this.up);return this.pan(-u,-c),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(ja(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,c=-.5*u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,o-=this.view.offsetY*s/h,u*=this.view.width/l,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),c=(r+i)/(r-i),l=-(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]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,c,c+u,o,o-s,e,this.far),y(this.projectionMatrix,this.projectionMatrix,I(1,-1,1)),f(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),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,d=l+u,v=h+c,m=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,x=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(p+=g*this.view.offsetX)+g*this.view.width,m=(v-=x*this.view.offsetY)-x*this.view.height}return N(this.projectionMatrix,p,d,m,v,a,o),y(this.projectionMatrix,this.projectionMatrix,I(1,-1,1)),f(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=Ha(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=I(0,1,0);if(this.focalPoint=Ha(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=G(R(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=L(a),u=Xa(Math.asin(n/o)),c=90+Xa(Math.atan2(r,e)),l=s();g(l,l,ja(c)),m(l,l,ja(u)),i=H(R(),[0,1,0],l)}return f(this.matrix,C(s(),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,ms>this.distance&&(this.distance=ms),this.dollyingStep=this.distance/100;var e=R(),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=Ya(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=Ya(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=Ya(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=Q(K(),[0,0,1],ja(this.roll));l(this.matrix);var n=Q(K(),[1,0,0],ja((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=Q(K(),[0,1,0],ja((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=J(K(),r,n);i=J(K(),i,e);var a=k(s(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(v(this.matrix,this.matrix,this.focalPoint),d(this.matrix,this.matrix,a),v(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(v(this.matrix,this.matrix,this.position),d(this.matrix,this.matrix,a))},n._setPosition=function(t,e,n){this.position=Ha(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(){_(this.right,Ha(Z(q(),[1,0,0,0],this.matrix))),_(this.up,Ha(Z(q(),[0,1,0,0],this.matrix))),_(this.forward,Ha(Z(q(),[0,0,1,0],this.matrix))),F(this.right,this.right),F(this.up,this.up),F(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=L(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Xa(Math.asin(n/i)),this.azimuth=Xa(Math.atan2(-e,-r))):(this.elevation=-Xa(Math.asin(n/i)),this.azimuth=-Xa(Math.atan2(-e,-r)))},n._getPosition=function(){_(this.position,Ha(Z(q(),[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=o(),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)),U(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=G(R(),this.focalPoint,this.position),this.distance=L(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=Q(K(),[0,0,1],-this.roll*Math.PI/180);w(this.orthoMatrix,n,I((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),I(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=d(s(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(ys.UPDATED)}},n.rotate=function(t,e,n){throw Error(_e)},n.pan=function(t,e){throw Error(_e)},n.dolly=function(t){throw Error(_e)},n.createLandmark=function(t,e){throw Error(_e)},n.gotoLandmark=function(t,e){throw Error(_e)},e}(),xs=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Es=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),bs=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}(),Ts=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Ms=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}(),ws=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&&!ie(n)&&(a||(t.width=a=n.width),o||(t.height=o=n.height)),{width:a,height:o}},t}(),ks=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&&!Qt(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,c=t.dy,l=((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,l);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=h.lineHeight-h.fontProperties.ascent:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(d+=u),c&&(v+=c),t.anchor=[p[0],p[1],0],{width:2*f[0],height:2*f[1],offsetX:d,offsetY:v}},t}(),Ps=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new qi,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=s(),this.tmpVec3=R(),this.onPointerDown=function(){var t=Fe(Ge().mark((function t(e){var r;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof sa){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createPointerEvent(e);case 4:n.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?n.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||n.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),n.trackingData(e.pointerId).pressTargetsByButton[e.button]=r.composedPath(),n.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=Fe(Ge().mark((function t(e){var r,i,a,o,s,u,c,l,h;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof sa){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,n.createPointerEvent(e);case 5:if(n.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?n.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.dispatchEvent(i,2===i.button?"rightup":"mouseup"),a=n.trackingData(e.pointerId),o=n.findMountedTarget(a.pressTargetsByButton[e.button]),s=o,o&&!i.composedPath().includes(o)){for(u=o;u&&!i.composedPath().includes(u);)i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?n.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ki.isNode(u)&&(u=u.parentNode);delete a.pressTargetsByButton[e.button],s=u}s&&((l=n.clonePointerEvent(i,"click")).target=s,l.path=[],a.clicksByButton[e.button]||(a.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:r}),(h=a.clicksByButton[e.button]).target===l.target&&200>r-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=r,l.detail=h.clickCount,(null===(c=i.detail)||void 0===c?void 0:c.preventClick)||("mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)),n.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=Fe(Ge().mark((function t(e){var r,i,a,o,s,u,c,l,h,f;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof sa){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createPointerEvent(e);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,a=n.trackingData(e.pointerId),o=n.findMountedTarget(a.overTargets),!a.overTargets||o===r.target){t.next=23;break}return s="mousemove"===e.type?"mouseout":"pointerout",t.next=12,n.createPointerEvent(e,s,o||void 0);case 12:if(n.dispatchEvent(u=t.sent,"pointerout"),i&&n.dispatchEvent(u,"mouseout"),r.composedPath().includes(o)){t.next=22;break}return t.next=18,n.createPointerEvent(e,"pointerleave",o||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),i&&n.notifyTarget(c,"mouseleave"),Ki.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c);case 22:n.freeEvent(u);case 23:if(o===r.target){t.next=38;break}l=n.clonePointerEvent(r,"mousemove"===e.type?"mouseover":"pointerover"),n.dispatchEvent(l,"pointerover"),i&&n.dispatchEvent(l,"mouseover"),h=o&&Ki.isNode(o)&&o.parentNode;case 29:if(!h||h===(Ki.isNode(n.rootTarget)&&n.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(Ki.isNode(n.rootTarget)&&n.rootTarget.parentNode)){for((f=n.clonePointerEvent(r,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==o&&f.target!==(Ki.isNode(n.rootTarget)&&n.rootTarget.parentNode);)f.currentTarget=f.target,n.notifyTarget(f),i&&n.notifyTarget(f,"mouseenter"),Ki.isNode(f.target)&&(f.target=f.target.parentNode);n.freeEvent(f)}n.freeEvent(l);case 38:n.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&n.dispatchEvent(r,"touchmove"),i&&(n.dispatchEvent(r,"mousemove"),n.cursor=n.getCursor(r.target)),a.overTargets=r.composedPath(),n.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=Fe(Ge().mark((function t(e){var r,i,a,o,s;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof sa){t.next=2;break}return t.abrupt("return");case 2:if(!(r=n.trackingData(e.pointerId)).overTargets){t.next=19;break}return i="mouse"===e.pointerType||"pen"===e.pointerType,a=n.findMountedTarget(r.overTargets),t.next=8,n.createPointerEvent(e,"pointerout",a||void 0);case 8:return n.dispatchEvent(o=t.sent),i&&n.dispatchEvent(o,"mouseout"),t.next=13,n.createPointerEvent(e,"pointerleave",a||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(Ki.isNode(n.rootTarget)&&n.rootTarget.parentNode);)s.currentTarget=s.target,n.notifyTarget(s),i&&n.notifyTarget(s,"mouseleave"),Ki.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,n.freeEvent(o),n.freeEvent(s);case 19:n.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=Fe(Ge().mark((function t(e){var r,i,a,o;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof sa){t.next=2;break}return t.abrupt("return");case 2:return r=n.trackingData(e.pointerId),t.next=5,n.createPointerEvent(e);case 5:for(a="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,n.dispatchEvent(i,"pointerover"),a&&n.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(n.cursor=n.getCursor(i.target)),(o=n.clonePointerEvent(i,"pointerenter")).eventPhase=o.AT_TARGET;o.target&&o.target!==(Ki.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),a&&n.notifyTarget(o,"mouseenter"),Ki.isNode(o.target)&&(o.target=o.target.parentNode);r.overTargets=i.composedPath(),n.freeEvent(i),n.freeEvent(o);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=Fe(Ge().mark((function t(e){var r,i,a,o;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof sa){t.next=2;break}return t.abrupt("return");case 2:return r=n.trackingData(e.pointerId),i=n.findMountedTarget(r.pressTargetsByButton[e.button]),t.next=6,n.createPointerEvent(e);case 6:if(a=t.sent,i){for(o=i;o;)a.currentTarget=o,n.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType||"mouse"!==a.pointerType&&"pen"!==a.pointerType||n.notifyTarget(a,2===a.button?"rightupoutside":"mouseupoutside"),Ki.isNode(o)&&(o=o.parentNode);delete r.pressTargetsByButton[e.button]}n.freeEvent(a);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=Fe(Ge().mark((function t(e){var r;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof ua){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createWheelEvent(e);case 4:n.dispatchEvent(r=t.sent),n.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),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("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new ye(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 ye(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(),c=d(this.tmpMatrix,u,s),l=D(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return H(l,l,c),new ye(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=d(this.tmpMatrix,n,r),a=D(this.tmpVec3,t.x,t.y,0);H(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new ye((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++)Ki.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(){var t=Fe(Ge().mark((function t(e){var n,r,i,a,o;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,a=(i=this.context.config).width,o=i.height,!(0>(n=e.viewportX)||0>r||n>a||r>o)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),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=Ze(this.globalRuntime.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(){var t=Fe(Ge().mark((function t(e){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.createPointerEvent=function(){var t=Fe(Ge().mark((function t(e,n,r){var i,a;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(sa),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,a=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=a,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.createWheelEvent=function(){var t=Fe(Ge().mark((function t(e){var n,r;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(ua),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),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(ua);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(sa);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){t instanceof sa&&e instanceof sa&&(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){t instanceof oa&&e instanceof oa&&(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||Ki.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=aa.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Ki.isNode(e)&&e.parentNode}},t}(),Ss=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),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")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}();(vs=t.RenderReason||(t.RenderReason={}))[vs.CAMERA_CHANGED=0]="CAMERA_CHANGED",vs[vs.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",vs[vs.NONE=2]="NONE";var Ns=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 zi(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new So,dirtycheck:new Ho(["object"]),cull:new Ho(["object","camera"]),beginFrame:new Uo([]),beforeRender:new Uo(["objectToRender"]),render:new Uo(["objectToRender"]),afterRender:new Uo(["objectToRender"]),endFrame:new Uo([]),destroy:new Uo([]),pick:new Oo(["result"]),pickSync:new Ho(["result"]),pointerDown:new Uo(["event"]),pointerUp:new Uo(["event"]),pointerMove:new Uo(["event"]),pointerOut:new Uo(["event"]),pointerOver:new Uo(["event"]),pointerWheel:new Uo(["event"]),pointerCancel:new Uo(["event"])},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=Fe(Ge().mark((function t(){var e;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=He({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e)})),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){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var n=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(n.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),n.renderReasons.size&&this.inited&&(this.renderDisplayObject(n.root,t,n),this.hooks.beginFrame.call(),n.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),n.renderListCurrentFrame=[],n.renderReasons.clear())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;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 c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(Se),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),l&&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()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Cs=/\[\s*(.*)=(.*)\s*\]/,As=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(Cs),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 Qt(n)?"":n.toString?""+n:""},t}();function Os(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var Rs,Ls,Is,_s=function(){function e(e){var n,r,i,a,o,c,h,p,v=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new zi(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=K(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=I(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=K();et(o,e[0],e[1],e[2]);var s=v.getRotation(t),u=v.getRotation(t.parentNode);ct(n,u),tt(n,n),J(o,n,o),J(a.localRotation,o,s),ht(a.localRotation,a.localRotation),v.dirtifyLocal(t,a)}else v.rotateLocal(t,e)}),this.rotateLocal=(r=K(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=I(e,n,i));var a=t.transformable;et(r,e[0],e[1],e[2]),lt(a.localRotation,a.localRotation,r),v.dirtifyLocal(t,a)}),this.setEulerAngles=(i=K(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){et(a.localRotation,e[0],e[1],e[2]);var o=v.getRotation(t.parentNode);ct(i,tt(K(),o)),lt(a.localRotation,a.localRotation,i),v.dirtifyLocal(t,a)}else v.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var i=t.transformable;j(e,R())||(function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],c=i*u-a*s,l=a*o-r*u,h=r*s-i*o,f=i*h-a*l,p=a*c-r*h,d=r*l-i*c,v=2*n[3];l*=v,h*=v,p*=2,d*=2,t[0]=o+(c*=v)+(f*=2),t[1]=s+l+p,t[2]=u+h+d}(e,e,i.localRotation),U(i.localPosition,i.localPosition,e),v.dirtifyLocal(t,i))},this.setPosition=(a=s(),o=R(),function(t,e){var n=t.transformable;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,j(v.getPosition(t),o)||(_(n.position,o),null!==t.parentNode&&t.parentNode.transformable?(u(a,t.parentNode.transformable.worldTransform),f(a,a),H(n.localPosition,o,a)):_(n.localPosition,o),v.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=R();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,j(r.localPosition,t)||(_(r.localPosition,t),v.dirtifyLocal(e,r))}}(),this.translate=(c=R(),h=R(),p=R(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=D(h,e,n,r)),j(e,c)||(U(p,v.getPosition(t),e),v.setPosition(t,p))}),this.setRotation=function(){var t=K();return function(e,n,r,i,a){var o=e.transformable;if("number"==typeof n&&(n=ut(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var s=v.getRotation(e.parentNode);ct(t,s),tt(t,t),J(o.localRotation,t,n),ht(o.localRotation,o.localRotation),v.dirtifyLocal(e,o)}else v.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=s(),e=R(),n=ut(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(w(r.localTransform,r.localRotation,r.localPosition,I(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=l(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),d(r.localTransform,r.localTransform,i)}var a=w(t,n,e,r.localScale,r.origin);d(r.localTransform,r.localTransform,a)}else w(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;t.parentNode&&this.detach(t),t.parentNode=e,Qt(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null==a||null===(r=a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(a.dirty=!0);var o=t.transformable;o&&this.dirtifyWorld(t,o),o.frozen&&this.unfreezeParentToRoot(t)},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=I(e,n,r));var i=t.transformable;if(!j(e,i.origin)){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=I(e,n,r));var i=t.transformable;et(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=I(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=I(e[0],e[1],e[2]||n.localScale[2]);j(r,n.localScale)||(_(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=ut(e,n,r,i));var a=t.transformable;ct(a.localRotation,e),this.dirtifyLocal(t,a)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=ft(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.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.pendingEvents=[],e.clear()},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Os(n),n=n.parentNode;e&&t.forEach((function(t){Os(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 ta(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,ta.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return b(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return M(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return T(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=b(R(),e),r=M(K(),e),i=T(R(),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(fe.isEmpty(r))return null;var i=n||new fe;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 fe},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 fe).update(r.center,r.halfExtents))})),e){var o=Ne(t);if(o){var s=o.style.clipPath.getBounds(e);a?s&&(a=s.intersection(a)):a=s}}return a||(a=new fe),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=s();t.parentNode.transformable&&(e=f(s(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!fe.isEmpty(n)){var r=new fe;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);fe.isEmpty(i)||(r=new fe).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],c=r.getMax();return new me(s+((null==a?void 0:a.left)||0),u+((null==a?void 0:a.top)||0),c[0]-s,c[1]-u)}return new me((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?d(e.worldTransform,r.worldTransform,e.localTransform):u(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}(),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]},Us=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Gs=RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),Bs=RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Fs=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Bs.exec(n)&&!Gs.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=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 c=i.getImageData(0,0,o||1,u||1).data,l=c.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!==c[p+v]){d=!0;break}if(d)break;p+=h}for(n.ascent=s-f,p=l-h,d=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==c[p+y]){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,c=e.letterSpacing,l=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=oe(e)&&e+"px"||"16px",s=ie(n)?n.split(","):[n],u=s.length-1;u>=0;u--){var c=s[u].trim();!Xo.test(c)&&0>jo.indexOf(c)&&(c='"'+c+'"'),s[u]=c}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 y=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=Array(y.length),g=0;if(!l){for(var x=0;y.length>x;x++){var E=v.measureText(y[x]).width+(y[x].length-1)*c;m[x]=E,g=Math.max(g,E)}var b=g+o,T=a||d.fontSize+o,M=Math.max(T,d.fontSize+o)+(y.length-1)*(T+f),w=0;return"middle"===s?w=-M/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-M:"top"!==s&&"hanging"!==s||(w=0),{font:p,width:b,height:M,lines:y,lineWidths:m,lineHeight:T+=f,maxLineWidth:g,fontProperties:d,lineMetrics:m.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new me(n-o/2,w+e*T,t+o,T)}))}}l.getTotalLength(),l.getPoint(0);for(var k=0;y.length>k;k++)v.measureText(y[k])},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,c=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),h=a+o,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var p=[],d=0,v=0,y={},m=function(t){return r.getFromCache(t,o,y,l)},g=Array.from(f).reduce((function(t,e){return t+m(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],T=t[E-1],M=t[E+1],w=m(b);if(this.isNewline(b)){if(++d>=u){e.isOverflowing=!0;break}v=0,p[d]=""}else{if(v>0&&v+w>h){if(d+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var k=p[d].length,P=0,S=k,N=0;k>N;N++){var C=m(p[d][N]);if(P+C+g>h){S=N;break}P+=C}p[d]=(p[d]||"").slice(0,S)+f}break}if(v=0,p[++d]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[d]||"",y)),this.shouldBreakByKinsokuShorui(b,M)&&(p=this.trimByKinsokuShorui(p),v+=m(T||""))}v+=w,p[d]=(p[d]||"")+b}}return p.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&Ds.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&Ds.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||!Us.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(!Us.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}(),Vs={},Ys=(Ls=new ws,Is=new Ms,(Rs={})[t.Shape.CIRCLE]=new xs,Rs[t.Shape.ELLIPSE]=new Es,Rs[t.Shape.RECT]=Ls,Rs[t.Shape.IMAGE]=Ls,Rs[t.Shape.GROUP]=Ls,Rs[t.Shape.LINE]=new bs,Rs[t.Shape.TEXT]=new ks(Vs),Rs[t.Shape.POLYLINE]=Is,Rs[t.Shape.POLYGON]=Is,Rs[t.Shape.PATH]=new Ts,Rs[t.Shape.HTML]=null,Rs[t.Shape.MESH]=null,Rs),Hs=function(){var e,n=new Pi,r=new Ci;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new Ii,e[t.PropertySyntax.ANGLE]=new wi,e[t.PropertySyntax.DEFINED_PATH]=new ki,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new Si,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new Ai,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new Oi,e[t.PropertySyntax.COORDINATE]=new Ri,e[t.PropertySyntax.OFFSET_DISTANCE]=new _i,e[t.PropertySyntax.OPACITY_VALUE]=new Di,e[t.PropertySyntax.PATH]=new Ui,e[t.PropertySyntax.LIST_OF_POINTS]=new Gi,e[t.PropertySyntax.SHADOW_BLUR]=new Bi,e[t.PropertySyntax.TEXT]=new Fi,e[t.PropertySyntax.TEXT_TRANSFORM]=new Vi,e[t.PropertySyntax.TRANSFORM]=new Yi,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Hi,e[t.PropertySyntax.Z_INDEX]=new ji,e[t.PropertySyntax.MARKER]=new Li,e}();Vs.CameraContribution=gs,Vs.AnimationTimeline=null,Vs.EasingFunction=null,Vs.offscreenCanvas=new Ss,Vs.displayObjectPool=new ba,Vs.sceneGraphSelector=new As,Vs.sceneGraphService=new _s(Vs),Vs.textService=new Fs(Vs),Vs.geometryUpdaterFactory=Ys,Vs.CSSPropertySyntaxFactory=Hs,Vs.styleValueRegistry=new ds,Vs.layoutRegistry=null,Vs.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`")}();var js=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}(),Xs=function(){function t(t){this.plugins=[],this.config=void 0,this.config=He({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}(),Ws=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 zi(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();Ws.tag="Culling";var zs=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}();zs.tag="DirtyCheck";var qs=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new sa(null),this.rootWheelEvent=new ua(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=Ze(t.normalizeToPointerEvent(e,i));!(a=o()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,a.value,i);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(){var t=Fe(Ge().mark((function t(e){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),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=Ze(e);!(r=a()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i);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=Ze(n.normalizeToPointerEvent(t,i));!(a=o()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,a.value,i);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)},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,a=t.clientX,o=t.clientY;if(!this.context.config.supportsCSSTransform||Qt(r)||Qt(i)){var s=this.context.eventService.client2Viewport(new ye(a,o));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,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 r=this.getViewportXY(e),i=r.y;t.viewport.x=r.x,t.viewport.y=i;var a=this.context.eventService.viewport2Canvas(t.viewport),o=a.y;return t.canvas.x=a.x,t.canvas.y=o,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Ue[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];le(i.button)&&(i.button=0),le(i.buttons)&&(i.buttons=1),le(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),le(i.width)&&(i.width=i.radiusX||1),le(i.height)&&(i.height=i.radiusY||1),le(i.tiltX)&&(i.tiltX=0),le(i.tiltY)&&(i.tiltY=0),le(i.pointerType)&&(i.pointerType="touch"),le(i.pointerId)&&(i.pointerId=i.identifier||0),le(i.pressure)&&(i.pressure=i.force||.5),le(i.twist)&&(i.twist=0),le(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;le(a.isPrimary)&&(a.isPrimary=!0),le(a.width)&&(a.width=1),le(a.height)&&(a.height=1),le(a.tiltX)&&(a.tiltX=0),le(a.tiltY)&&(a.tiltY=0),le(a.pointerType)&&(a.pointerType="mouse"),le(a.pointerId)&&(a.pointerId=1),le(a.pressure)&&(a.pressure=.5),le(a.twist)&&(a.twist=0),le(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n},t}();qs.tag="Event";var Zs,Ks=[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],Qs=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(fe.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=Ks.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!o||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>V(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>V(h,n.getNegativeFarPoint(i[s]))+f&&(a|=c)}}return a},e}(),Js=function(){function e(){this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.apply=function(n){var r=this,i=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=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()},u=function(t){var e=t.target;Vs.styleValueRegistry.recalc(e),Vs.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Vs.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,Fe(Ge().mark((function e(){return Ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.addEventListener(t.ElementEvent.MOUNTED,u),a.addEventListener(t.ElementEvent.UNMOUNTED,c),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,o),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,u),a.removeEventListener(t.ElementEvent.UNMOUNTED,c),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,o),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s)})),i.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(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=o,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}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}();Js.tag="Prepare",(Zs=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Zs.BEFORE_RENDER="beforerender",Zs.AFTER_RENDER="afterrender",Zs.BEFORE_DESTROY="beforedestroy",Zs.AFTER_DESTROY="afterdestroy",Zs.RESIZE="resize",Zs.DIRTY_RECTANGLE="dirtyrectangle";var $s=new zi(t.ElementEvent.MOUNTED),tu=new zi(t.ElementEvent.UNMOUNTED),eu=new zi(t.CanvasEvent.BEFORE_RENDER),nu=new zi(t.CanvasEvent.AFTER_RENDER),ru=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=da,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new $i,r.document.defaultView=ze(r),r.customElements=new Xi;var i=n.container,a=n.canvas,o=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,p=n.document,d=n.requestAnimationFrame,v=n.cancelAnimationFrame,y=n.createImage,m=n.supportsPointerEvents,g=n.supportsTouchEvents,x=n.supportsCSSTransform,E=n.isTouchEvent,b=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||ke++;we[n]&&we[n].destroy(),we[n]=e}}(i,ze(r));var T=s,M=u,w=c;return a&&(w=1>(w=c||Pe&&window.devicePixelRatio||1)?1:Math.ceil(w),T=s||function(t){var e=Ce(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(a)||a.width/w,M=u||function(t){var e=Ce(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(a)||a.height/w),r.devicePixelRatio=w,r.requestAnimationFrame=null!=d?d:es.bind(Vs.globalThis),r.cancelAnimationFrame=null!=v?v:ns.bind(Vs.globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in Vs.globalThis,r.supportsPointerEvents=null!=m?m:!!Vs.globalThis.PointerEvent,r.isTouchEvent=null!=E?E:function(t){return r.supportsTouchEvents&&t instanceof Vs.globalThis.TouchEvent},r.isMouseEvent=null!=b?b:function(t){return!Vs.globalThis.MouseEvent||t instanceof Vs.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof Vs.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:a,width:T,height:M,renderer:l,offscreenCanvas:o,devicePixelRatio:w,cursor:f||"default",background:h||"transparent",createImage:y,document:p,supportsCSSTransform:x}),r.initDefaultCamera(T,M),Fe(Ge().mark((function e(){return Ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new zi(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}je(n,e);var i=n.prototype;return i.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},i.initDefaultCamera=function(e,n){var r=this,i=new Vs.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(ys.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},i.getConfig=function(){return this.context.config},i.getRoot=function(){return this.document.documentElement},i.getCamera=function(){return this.context.camera},i.getContextService=function(){return this.context.contextService},i.getEventService=function(){return this.context.eventService},i.getRenderingService=function(){return this.context.renderingService},i.getRenderingContext=function(){return this.context.renderingContext},i.getStats=function(){return this.getRenderingService().getStats()},i.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new zi(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getRenderingService().destroy(),this.getContextService().destroy(),n||this.dispatchEvent(new zi(t.CanvasEvent.AFTER_DESTROY))},i.changeSize=function(t,e){this.resize(t,e)},i.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 zi(t.CanvasEvent.RESIZE,{width:e,height:n}))},i.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.removeChild=function(t){return this.document.documentElement.removeChild(t)},i.removeChildren=function(){this.document.documentElement.removeChildren()},i.destroyChildren=function(){this.document.documentElement.destroyChildren()},i.render=function(){this.dispatchEvent(eu),this.getRenderingService().render(this.getConfig()),this.dispatchEvent(nu)},i.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},i.initRenderer=function(){var t=Fe(Ge().mark((function t(e){return Ge().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 qs,new Js,new zs,new Ws([new Qs])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(He({},Vs,this.context)),this.context.renderingService=new Ns(Vs,this.context),this.context.eventService=new Ps(Vs,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)}}(),i.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init()}))},i.setRenderer=function(){var t=Fe(Ge().mark((function t(e){var n,r;return Ge().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()})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},i.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(tu):(tu.target=t,this.dispatchEvent(tu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},i.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent($s):($s.target=t,this.dispatchEvent($s,!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()},i.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},Ye(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}(Zi);t.AABB=fe,t.AbstractRenderer=Xs,t.AbstractRendererPlugin=js,t.BUILT_IN_PROPERTIES=os,t.CSS=On,t.CSSGradientValue=sn,t.CSSKeywordValue=un,t.CSSRGB=An,t.CSSStyleValue=nn,t.CSSUnitValue=gn,t.Camera=gs,t.CameraEvent=ys,t.Canvas=ru,t.Circle=ya,t.CircleUpdater=xs,t.CustomElement=ga,t.CustomElementRegistry=Xi,t.CustomEvent=zi,t.DefaultSceneGraphSelector=As,t.DefaultSceneGraphService=_s,t.DisplayObject=da,t.DisplayObjectPool=ba,t.Document=$i,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=_e,t.Element=aa,t.Ellipse=Ma,t.EllipseUpdater=Es,t.EventService=Ps,t.EventTarget=Zi,t.FederatedEvent=Wi,t.FederatedMouseEvent=oa,t.FederatedPointerEvent=sa,t.FederatedWheelEvent=ua,t.Frustum=ve,t.Group=ka,t.HTML=Sa,t.Image=Ca,t.Line=Oa,t.LineUpdater=bs,t.MutationEvent=ta,t.Node=Ki,t.OffscreenCanvasCreator=Ss,t.Path=La,t.PathUpdater=Ts,t.Plane=pe,t.Point=ye,t.Polygon=_a,t.Polyline=Ua,t.PolylineUpdater=Ms,t.RBush=r,t.Rect=Ba,t.RectUpdater=ws,t.Rectangle=me,t.RenderingService=Ns,t.Text=Va,t.TextService=Fs,t.TextUpdater=ks,t.computeLinearGradient=function(t,e,n){var r=ja(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(_t([0,0],[o,s]),_t([0,n],[o,s]),_t([e,n],[o,s]),_t([e,0],[o,s]));return a&&(a instanceof gn?u=a.value:a instanceof un&&("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(_t([0,0],[o,s]),_t([0,n],[o,s]),_t([e,n],[o,s]),_t([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=go(o,o,a.cx,a.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=go(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,c=u.width,l=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],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*a+n,r],["L",t-c*o+n,r],o?["A",o,o,0,0,h,t+n,l*o+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*a+r],a?["A",a,a,0,0,h,c*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"]]}(c,l,h,f,d&&p.map((function(t){return ae(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/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=I(e[1]-a,e[2]-s,0);n&&H(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=I(e[1]-a,e[2]-s,0),u=I(e[3]-a,e[4]-s,0),c=I(e[5]-a,e[6]-s,0);n&&(H(o,o,n),H(u,u,n),H(c,c,n)),r=""+e[0]+o[0]+","+o[1]+","+u[0]+","+u[1]+","+c[0]+","+c[1]}else if("A"===e[0]){var l=I(e[6]-a,e[7]-s,0);n&&H(l,l,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+l[0]+","+l[1]}else if("Q"===e[0]){var h=I(e[1]-a,e[2]-s,0),f=I(e[3]-a,e[4]-s,0);n&&(H(h,h,n),H(f,f,n)),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"}return t+r}),"")}(r,e,n)},t.createVec3=Ha,t.decompose=Za,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=ja,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Ne,t.fromRotationTranslationScale=qa,t.getAngle=Ya,t.getEuler=za,t.getOrCalculatePathTotalLength=oo,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=Pe,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=kr,t.mergeColors=Sr,t.parseColor=Pr,t.parseLength=Cr,t.parsePath=Xr,t.parseTransform=fi,t.parsedTransformToMat4=ro,t.propertyMetadataCache=ss,t.rad2deg=Xa,t.resetEntityCounter=function(){ea=0},t.runtime=Vs,t.setDOMSize=function(t,e,n){Pe&&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 c=t[u+1],l=0===u&&(0!==r||0!==i),h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==a&&0!==o;switch(s[0]){case"M":return l?"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=Wa,Object.defineProperty(t,"__esModule",{value:!0})}));