@antv/g-canvas 1.0.15 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["@antv/g","mana-syringe"],n):"object"==typeof exports?exports.Canvas2D=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.Canvas2D=n(t.G,t.G.ManaSyringe))}(window,(function(t,n){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=6)}([function(n,e){n.exports=t},function(t,e){t.exports=n},function(t,n,e){t.exports=function(){"use strict";function t(t,r,o,a,i){!function t(e,r,o,a,i){for(;a>o;){if(a-o>600){var u=a-o+1,c=r-o+1,s=Math.log(u),f=.5*Math.exp(2*s/3),h=.5*Math.sqrt(s*f*(u-f)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(o,Math.floor(r-c*f/u+h)),Math.min(a,Math.floor(r+(u-c)*f/u+h)),i)}var l=e[r],d=o,p=a;for(n(e,o,r),i(e[a],l)>0&&n(e,o,a);d<p;){for(n(e,d,p),d++,p--;i(e[d],l)<0;)d++;for(;i(e[p],l)>0;)p--}0===i(e[o],l)?n(e,o,p):n(e,++p,a),p<=r&&(o=p+1),r<=p&&(a=p-1)}}(t,r,o||0,a||t.length-1,i||e)}function n(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function e(t,n){return t<n?-1:t>n?1:0}var r=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 o(t,n,e){if(!e)return n.indexOf(t);for(var r=0;r<n.length;r++)if(e(t,n[r]))return r;return-1}function a(t,n){i(t,0,t.children.length,n,t)}function i(t,n,e,r,o){o||(o=p(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var a=n;a<e;a++){var i=t.children[a];u(o,t.leaf?r(i):i)}return o}function u(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function c(t,n){return t.minX-n.minX}function s(t,n){return t.minY-n.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function d(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(n,e,r,o,a){for(var i=[e,r];i.length;)if(!((r=i.pop())-(e=i.pop())<=o)){var u=e+Math.ceil((r-e)/o/2)*o;t(n,u,e,r,a),i.push(e,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,e=[];if(!d(t,n))return e;for(var r=this.toBBox,o=[];n;){for(var a=0;a<n.children.length;a++){var i=n.children[a],u=n.leaf?r(i):i;d(t,u)&&(n.leaf?e.push(i):l(t,u)?this._all(i,e):o.push(i))}n=o.pop()}return e},r.prototype.collides=function(t){var n=this.data;if(!d(t,n))return!1;for(var e=[];n;){for(var r=0;r<n.children.length;r++){var o=n.children[r],a=n.leaf?this.toBBox(o):o;if(d(t,a)){if(n.leaf||l(t,a))return!0;e.push(o)}}n=e.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var r=this.data;this.data=e,e=r}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(t,n){if(!t)return this;for(var e,r,a,i=this.data,u=this.toBBox(t),c=[],s=[];i||c.length;){if(i||(i=c.pop(),r=c[c.length-1],e=s.pop(),a=!0),i.leaf){var f=o(t,i.children,n);if(-1!==f)return i.children.splice(f,1),c.push(i),this._condense(c),this}a||i.leaf||!l(i,u)?r?(e++,i=r.children[e],a=!1):i=null:(c.push(i),s.push(e),e=0,r=i,i=i.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,n){return t.minX-n.minX},r.prototype.compareMinY=function(t,n){return t.minY-n.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,n){for(var e=[];t;)t.leaf?n.push.apply(n,t.children):e.push.apply(e,t.children),t=e.pop();return n},r.prototype._build=function(t,n,e,r){var o,i=e-n+1,u=this._maxEntries;if(i<=u)return a(o=p(t.slice(n,e+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(u)),u=Math.ceil(i/Math.pow(u,r-1))),(o=p([])).leaf=!1,o.height=r;var c=Math.ceil(i/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var f=n;f<=e;f+=s){var h=Math.min(f+s-1,e);v(t,f,h,c,this.compareMinY);for(var l=f;l<=h;l+=c){var d=Math.min(l+c-1,h);o.children.push(this._build(t,l,d,r-1))}}return a(o,this.toBBox),o},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var o=1/0,a=1/0,i=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=f(c),h=(l=t,d=c,(Math.max(d.maxX,l.maxX)-Math.min(d.minX,l.minX))*(Math.max(d.maxY,l.maxY)-Math.min(d.minY,l.minY))-s);h<a?(a=h,o=s<o?s:o,i=c):h===a&&s<o&&(o=s,i=c)}n=i||n.children[0]}var l,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),o=[],a=this._chooseSubtree(r,this.data,n,o);for(a.children.push(t),u(a,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,r);var i=this._chooseSplitIndex(e,o,r),u=p(e.children.splice(i,e.children.length-i));u.height=e.height,u.leaf=e.leaf,a(e,this.toBBox),a(u,this.toBBox),n?t[n-1].children.push(u):this._splitRoot(e,u)},r.prototype._splitRoot=function(t,n){this.data=p([t,n]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,o,a,u,c,s,h,l=1/0,d=1/0,p=n;p<=e-n;p++){var v=i(t,0,p,this.toBBox),y=i(t,p,e,this.toBBox),m=(o=v,a=y,u=Math.max(o.minX,a.minX),c=Math.max(o.minY,a.minY),s=Math.min(o.maxX,a.maxX),h=Math.min(o.maxY,a.maxY),Math.max(0,s-u)*Math.max(0,h-c)),g=f(v)+f(y);m<l?(l=m,r=p,d=g<d?g:d):m===l&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,o=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,o)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var o=this.toBBox,a=i(t,0,n,o),c=i(t,e-n,e,o),s=h(a)+h(c),f=n;f<e-n;f++){var l=t.children[f];u(a,t.leaf?o(l):l),s+=h(a)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?o(p):p),s+=h(c)}return s},r.prototype._adjustParentBBoxes=function(t,n,e){for(var r=e;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,e=void 0;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():a(t[n],this.toBBox)},r}()},,,,function(t,n,e){"use strict";e.r(n),e.d(n,"DomInteraction",(function(){return r})),e.d(n,"CanvasRenderer",(function(){return s})),e.d(n,"CanvasPicker",(function(){return f})),e.d(n,"HTMLRenderer",(function(){return h})),e.d(n,"Renderer",(function(){return aa}));var r={};e.r(r),e.d(r,"Plugin",(function(){return E}));var o={};e.r(o),e.d(o,"create",(function(){return K})),e.d(o,"fromMat4",(function(){return tt})),e.d(o,"clone",(function(){return nt})),e.d(o,"copy",(function(){return et})),e.d(o,"fromValues",(function(){return rt})),e.d(o,"set",(function(){return ot})),e.d(o,"identity",(function(){return at})),e.d(o,"transpose",(function(){return it})),e.d(o,"invert",(function(){return ut})),e.d(o,"adjoint",(function(){return ct})),e.d(o,"determinant",(function(){return st})),e.d(o,"multiply",(function(){return ft})),e.d(o,"translate",(function(){return ht})),e.d(o,"rotate",(function(){return lt})),e.d(o,"scale",(function(){return dt})),e.d(o,"fromTranslation",(function(){return pt})),e.d(o,"fromRotation",(function(){return vt})),e.d(o,"fromScaling",(function(){return yt})),e.d(o,"fromMat2d",(function(){return mt})),e.d(o,"fromQuat",(function(){return gt})),e.d(o,"normalFromMat4",(function(){return Mt})),e.d(o,"projection",(function(){return bt})),e.d(o,"str",(function(){return xt})),e.d(o,"frob",(function(){return Pt})),e.d(o,"add",(function(){return Ot})),e.d(o,"subtract",(function(){return Et})),e.d(o,"multiplyScalar",(function(){return St})),e.d(o,"multiplyScalarAndAdd",(function(){return Ct})),e.d(o,"exactEquals",(function(){return At})),e.d(o,"equals",(function(){return jt})),e.d(o,"mul",(function(){return Bt})),e.d(o,"sub",(function(){return wt}));var a={};e.r(a),e.d(a,"create",(function(){return Rt})),e.d(a,"clone",(function(){return Tt})),e.d(a,"copy",(function(){return Lt})),e.d(a,"fromValues",(function(){return kt})),e.d(a,"set",(function(){return It})),e.d(a,"identity",(function(){return Dt})),e.d(a,"transpose",(function(){return Yt})),e.d(a,"invert",(function(){return Nt})),e.d(a,"adjoint",(function(){return _t})),e.d(a,"determinant",(function(){return Xt})),e.d(a,"multiply",(function(){return qt})),e.d(a,"translate",(function(){return Ft})),e.d(a,"scale",(function(){return Gt})),e.d(a,"rotate",(function(){return $t})),e.d(a,"rotateX",(function(){return Ht})),e.d(a,"rotateY",(function(){return Vt})),e.d(a,"rotateZ",(function(){return Ut})),e.d(a,"fromTranslation",(function(){return Wt})),e.d(a,"fromScaling",(function(){return zt})),e.d(a,"fromRotation",(function(){return Qt})),e.d(a,"fromXRotation",(function(){return Zt})),e.d(a,"fromYRotation",(function(){return Jt})),e.d(a,"fromZRotation",(function(){return Kt})),e.d(a,"fromRotationTranslation",(function(){return tn})),e.d(a,"fromQuat2",(function(){return nn})),e.d(a,"getTranslation",(function(){return en})),e.d(a,"getScaling",(function(){return rn})),e.d(a,"getRotation",(function(){return on})),e.d(a,"fromRotationTranslationScale",(function(){return an})),e.d(a,"fromRotationTranslationScaleOrigin",(function(){return un})),e.d(a,"fromQuat",(function(){return cn})),e.d(a,"frustum",(function(){return sn})),e.d(a,"perspectiveNO",(function(){return fn})),e.d(a,"perspective",(function(){return hn})),e.d(a,"perspectiveZO",(function(){return ln})),e.d(a,"perspectiveFromFieldOfView",(function(){return dn})),e.d(a,"orthoNO",(function(){return pn})),e.d(a,"ortho",(function(){return vn})),e.d(a,"orthoZO",(function(){return yn})),e.d(a,"lookAt",(function(){return mn})),e.d(a,"targetTo",(function(){return gn})),e.d(a,"str",(function(){return Mn})),e.d(a,"frob",(function(){return bn})),e.d(a,"add",(function(){return xn})),e.d(a,"subtract",(function(){return Pn})),e.d(a,"multiplyScalar",(function(){return On})),e.d(a,"multiplyScalarAndAdd",(function(){return En})),e.d(a,"exactEquals",(function(){return Sn})),e.d(a,"equals",(function(){return Cn})),e.d(a,"mul",(function(){return An})),e.d(a,"sub",(function(){return jn}));var i={};e.r(i),e.d(i,"create",(function(){return Bn})),e.d(i,"clone",(function(){return wn})),e.d(i,"length",(function(){return Rn})),e.d(i,"fromValues",(function(){return Tn})),e.d(i,"copy",(function(){return Ln})),e.d(i,"set",(function(){return kn})),e.d(i,"add",(function(){return In})),e.d(i,"subtract",(function(){return Dn})),e.d(i,"multiply",(function(){return Yn})),e.d(i,"divide",(function(){return Nn})),e.d(i,"ceil",(function(){return _n})),e.d(i,"floor",(function(){return Xn})),e.d(i,"min",(function(){return qn})),e.d(i,"max",(function(){return Fn})),e.d(i,"round",(function(){return Gn})),e.d(i,"scale",(function(){return $n})),e.d(i,"scaleAndAdd",(function(){return Hn})),e.d(i,"distance",(function(){return Vn})),e.d(i,"squaredDistance",(function(){return Un})),e.d(i,"squaredLength",(function(){return Wn})),e.d(i,"negate",(function(){return zn})),e.d(i,"inverse",(function(){return Qn})),e.d(i,"normalize",(function(){return Zn})),e.d(i,"dot",(function(){return Jn})),e.d(i,"cross",(function(){return Kn})),e.d(i,"lerp",(function(){return te})),e.d(i,"hermite",(function(){return ne})),e.d(i,"bezier",(function(){return ee})),e.d(i,"random",(function(){return re})),e.d(i,"transformMat4",(function(){return oe})),e.d(i,"transformMat3",(function(){return ae})),e.d(i,"transformQuat",(function(){return ie})),e.d(i,"rotateX",(function(){return ue})),e.d(i,"rotateY",(function(){return ce})),e.d(i,"rotateZ",(function(){return se})),e.d(i,"angle",(function(){return fe})),e.d(i,"zero",(function(){return he})),e.d(i,"str",(function(){return le})),e.d(i,"exactEquals",(function(){return de})),e.d(i,"equals",(function(){return pe})),e.d(i,"sub",(function(){return ye})),e.d(i,"mul",(function(){return me})),e.d(i,"div",(function(){return ge})),e.d(i,"dist",(function(){return Me})),e.d(i,"sqrDist",(function(){return be})),e.d(i,"len",(function(){return xe})),e.d(i,"sqrLen",(function(){return Pe})),e.d(i,"forEach",(function(){return Oe}));var u={};e.r(u),e.d(u,"create",(function(){return Ce})),e.d(u,"identity",(function(){return Ae})),e.d(u,"setAxisAngle",(function(){return je})),e.d(u,"getAxisAngle",(function(){return Be})),e.d(u,"getAngle",(function(){return we})),e.d(u,"multiply",(function(){return Re})),e.d(u,"rotateX",(function(){return Te})),e.d(u,"rotateY",(function(){return Le})),e.d(u,"rotateZ",(function(){return ke})),e.d(u,"calculateW",(function(){return Ie})),e.d(u,"exp",(function(){return De})),e.d(u,"ln",(function(){return Ye})),e.d(u,"pow",(function(){return Ne})),e.d(u,"slerp",(function(){return _e})),e.d(u,"random",(function(){return Xe})),e.d(u,"invert",(function(){return qe})),e.d(u,"conjugate",(function(){return Fe})),e.d(u,"fromMat3",(function(){return Ge})),e.d(u,"fromEuler",(function(){return $e})),e.d(u,"str",(function(){return He})),e.d(u,"clone",(function(){return Je})),e.d(u,"fromValues",(function(){return Ke})),e.d(u,"copy",(function(){return tr})),e.d(u,"set",(function(){return nr})),e.d(u,"add",(function(){return er})),e.d(u,"mul",(function(){return rr})),e.d(u,"scale",(function(){return or})),e.d(u,"dot",(function(){return ar})),e.d(u,"lerp",(function(){return ir})),e.d(u,"length",(function(){return ur})),e.d(u,"len",(function(){return cr})),e.d(u,"squaredLength",(function(){return sr})),e.d(u,"sqrLen",(function(){return fr})),e.d(u,"normalize",(function(){return hr})),e.d(u,"exactEquals",(function(){return lr})),e.d(u,"equals",(function(){return dr})),e.d(u,"rotationTo",(function(){return pr})),e.d(u,"sqlerp",(function(){return vr})),e.d(u,"setAxes",(function(){return yr}));var c={};e.r(c),e.d(c,"create",(function(){return mr})),e.d(c,"clone",(function(){return gr})),e.d(c,"fromValues",(function(){return Mr})),e.d(c,"copy",(function(){return br})),e.d(c,"set",(function(){return xr})),e.d(c,"add",(function(){return Pr})),e.d(c,"subtract",(function(){return Or})),e.d(c,"multiply",(function(){return Er})),e.d(c,"divide",(function(){return Sr})),e.d(c,"ceil",(function(){return Cr})),e.d(c,"floor",(function(){return Ar})),e.d(c,"min",(function(){return jr})),e.d(c,"max",(function(){return Br})),e.d(c,"round",(function(){return wr})),e.d(c,"scale",(function(){return Rr})),e.d(c,"scaleAndAdd",(function(){return Tr})),e.d(c,"distance",(function(){return Lr})),e.d(c,"squaredDistance",(function(){return kr})),e.d(c,"length",(function(){return Ir})),e.d(c,"squaredLength",(function(){return Dr})),e.d(c,"negate",(function(){return Yr})),e.d(c,"inverse",(function(){return Nr})),e.d(c,"normalize",(function(){return _r})),e.d(c,"dot",(function(){return Xr})),e.d(c,"cross",(function(){return qr})),e.d(c,"lerp",(function(){return Fr})),e.d(c,"random",(function(){return Gr})),e.d(c,"transformMat2",(function(){return $r})),e.d(c,"transformMat2d",(function(){return Hr})),e.d(c,"transformMat3",(function(){return Vr})),e.d(c,"transformMat4",(function(){return Ur})),e.d(c,"rotate",(function(){return Wr})),e.d(c,"angle",(function(){return zr})),e.d(c,"zero",(function(){return Qr})),e.d(c,"str",(function(){return Zr})),e.d(c,"exactEquals",(function(){return Jr})),e.d(c,"equals",(function(){return Kr})),e.d(c,"len",(function(){return to})),e.d(c,"sub",(function(){return no})),e.d(c,"mul",(function(){return eo})),e.d(c,"div",(function(){return ro})),e.d(c,"dist",(function(){return oo})),e.d(c,"sqrDist",(function(){return ao})),e.d(c,"sqrLen",(function(){return io})),e.d(c,"forEach",(function(){return uo}));var s={};e.r(s),e.d(s,"PathGeneratorFactory",(function(){return W})),e.d(s,"PathGenerator",(function(){return z})),e.d(s,"StyleRenderer",(function(){return j})),e.d(s,"RBushNode",(function(){return co})),e.d(s,"RBushRoot",(function(){return so})),e.d(s,"RBush",(function(){return C.a})),e.d(s,"Plugin",(function(){return po}));var f={};e.r(f),e.d(f,"Plugin",(function(){return Zo}));var h={};e.r(h),e.d(h,"Plugin",(function(){return ta}));
1
+ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["@antv/g","mana-syringe"],n):"object"==typeof exports?exports.Canvas2D=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.Canvas2D=n(t.G,t.G.ManaSyringe))}(window,(function(t,n){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=6)}([function(n,e){n.exports=t},function(t,e){t.exports=n},function(t,n,e){t.exports=function(){"use strict";function t(t,r,o,a,i){!function t(e,r,o,a,i){for(;a>o;){if(a-o>600){var u=a-o+1,c=r-o+1,s=Math.log(u),f=.5*Math.exp(2*s/3),h=.5*Math.sqrt(s*f*(u-f)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(o,Math.floor(r-c*f/u+h)),Math.min(a,Math.floor(r+(u-c)*f/u+h)),i)}var l=e[r],d=o,p=a;for(n(e,o,r),i(e[a],l)>0&&n(e,o,a);d<p;){for(n(e,d,p),d++,p--;i(e[d],l)<0;)d++;for(;i(e[p],l)>0;)p--}0===i(e[o],l)?n(e,o,p):n(e,++p,a),p<=r&&(o=p+1),r<=p&&(a=p-1)}}(t,r,o||0,a||t.length-1,i||e)}function n(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function e(t,n){return t<n?-1:t>n?1:0}var r=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 o(t,n,e){if(!e)return n.indexOf(t);for(var r=0;r<n.length;r++)if(e(t,n[r]))return r;return-1}function a(t,n){i(t,0,t.children.length,n,t)}function i(t,n,e,r,o){o||(o=p(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var a=n;a<e;a++){var i=t.children[a];u(o,t.leaf?r(i):i)}return o}function u(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function c(t,n){return t.minX-n.minX}function s(t,n){return t.minY-n.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function d(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(n,e,r,o,a){for(var i=[e,r];i.length;)if(!((r=i.pop())-(e=i.pop())<=o)){var u=e+Math.ceil((r-e)/o/2)*o;t(n,u,e,r,a),i.push(e,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,e=[];if(!d(t,n))return e;for(var r=this.toBBox,o=[];n;){for(var a=0;a<n.children.length;a++){var i=n.children[a],u=n.leaf?r(i):i;d(t,u)&&(n.leaf?e.push(i):l(t,u)?this._all(i,e):o.push(i))}n=o.pop()}return e},r.prototype.collides=function(t){var n=this.data;if(!d(t,n))return!1;for(var e=[];n;){for(var r=0;r<n.children.length;r++){var o=n.children[r],a=n.leaf?this.toBBox(o):o;if(d(t,a)){if(n.leaf||l(t,a))return!0;e.push(o)}}n=e.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var r=this.data;this.data=e,e=r}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(t,n){if(!t)return this;for(var e,r,a,i=this.data,u=this.toBBox(t),c=[],s=[];i||c.length;){if(i||(i=c.pop(),r=c[c.length-1],e=s.pop(),a=!0),i.leaf){var f=o(t,i.children,n);if(-1!==f)return i.children.splice(f,1),c.push(i),this._condense(c),this}a||i.leaf||!l(i,u)?r?(e++,i=r.children[e],a=!1):i=null:(c.push(i),s.push(e),e=0,r=i,i=i.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,n){return t.minX-n.minX},r.prototype.compareMinY=function(t,n){return t.minY-n.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,n){for(var e=[];t;)t.leaf?n.push.apply(n,t.children):e.push.apply(e,t.children),t=e.pop();return n},r.prototype._build=function(t,n,e,r){var o,i=e-n+1,u=this._maxEntries;if(i<=u)return a(o=p(t.slice(n,e+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(u)),u=Math.ceil(i/Math.pow(u,r-1))),(o=p([])).leaf=!1,o.height=r;var c=Math.ceil(i/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var f=n;f<=e;f+=s){var h=Math.min(f+s-1,e);v(t,f,h,c,this.compareMinY);for(var l=f;l<=h;l+=c){var d=Math.min(l+c-1,h);o.children.push(this._build(t,l,d,r-1))}}return a(o,this.toBBox),o},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var o=1/0,a=1/0,i=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=f(c),h=(l=t,d=c,(Math.max(d.maxX,l.maxX)-Math.min(d.minX,l.minX))*(Math.max(d.maxY,l.maxY)-Math.min(d.minY,l.minY))-s);h<a?(a=h,o=s<o?s:o,i=c):h===a&&s<o&&(o=s,i=c)}n=i||n.children[0]}var l,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),o=[],a=this._chooseSubtree(r,this.data,n,o);for(a.children.push(t),u(a,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,r);var i=this._chooseSplitIndex(e,o,r),u=p(e.children.splice(i,e.children.length-i));u.height=e.height,u.leaf=e.leaf,a(e,this.toBBox),a(u,this.toBBox),n?t[n-1].children.push(u):this._splitRoot(e,u)},r.prototype._splitRoot=function(t,n){this.data=p([t,n]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,o,a,u,c,s,h,l=1/0,d=1/0,p=n;p<=e-n;p++){var v=i(t,0,p,this.toBBox),y=i(t,p,e,this.toBBox),m=(o=v,a=y,u=Math.max(o.minX,a.minX),c=Math.max(o.minY,a.minY),s=Math.min(o.maxX,a.maxX),h=Math.min(o.maxY,a.maxY),Math.max(0,s-u)*Math.max(0,h-c)),g=f(v)+f(y);m<l?(l=m,r=p,d=g<d?g:d):m===l&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,o=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,o)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var o=this.toBBox,a=i(t,0,n,o),c=i(t,e-n,e,o),s=h(a)+h(c),f=n;f<e-n;f++){var l=t.children[f];u(a,t.leaf?o(l):l),s+=h(a)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?o(p):p),s+=h(c)}return s},r.prototype._adjustParentBBoxes=function(t,n,e){for(var r=e;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,e=void 0;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():a(t[n],this.toBBox)},r}()},,,,function(t,n,e){"use strict";e.r(n),e.d(n,"DomInteraction",(function(){return r})),e.d(n,"CanvasRenderer",(function(){return s})),e.d(n,"CanvasPicker",(function(){return f})),e.d(n,"HTMLRenderer",(function(){return h})),e.d(n,"Renderer",(function(){return ea}));var r={};e.r(r),e.d(r,"Plugin",(function(){return P}));var o={};e.r(o),e.d(o,"create",(function(){return Z})),e.d(o,"fromMat4",(function(){return J})),e.d(o,"clone",(function(){return K})),e.d(o,"copy",(function(){return tt})),e.d(o,"fromValues",(function(){return nt})),e.d(o,"set",(function(){return et})),e.d(o,"identity",(function(){return rt})),e.d(o,"transpose",(function(){return ot})),e.d(o,"invert",(function(){return at})),e.d(o,"adjoint",(function(){return it})),e.d(o,"determinant",(function(){return ut})),e.d(o,"multiply",(function(){return ct})),e.d(o,"translate",(function(){return st})),e.d(o,"rotate",(function(){return ft})),e.d(o,"scale",(function(){return ht})),e.d(o,"fromTranslation",(function(){return lt})),e.d(o,"fromRotation",(function(){return dt})),e.d(o,"fromScaling",(function(){return pt})),e.d(o,"fromMat2d",(function(){return vt})),e.d(o,"fromQuat",(function(){return yt})),e.d(o,"normalFromMat4",(function(){return mt})),e.d(o,"projection",(function(){return gt})),e.d(o,"str",(function(){return Mt})),e.d(o,"frob",(function(){return bt})),e.d(o,"add",(function(){return xt})),e.d(o,"subtract",(function(){return Pt})),e.d(o,"multiplyScalar",(function(){return Ot})),e.d(o,"multiplyScalarAndAdd",(function(){return Et})),e.d(o,"exactEquals",(function(){return St})),e.d(o,"equals",(function(){return Ct})),e.d(o,"mul",(function(){return jt})),e.d(o,"sub",(function(){return At}));var a={};e.r(a),e.d(a,"create",(function(){return Tt})),e.d(a,"clone",(function(){return Bt})),e.d(a,"copy",(function(){return Rt})),e.d(a,"fromValues",(function(){return wt})),e.d(a,"set",(function(){return Lt})),e.d(a,"identity",(function(){return kt})),e.d(a,"transpose",(function(){return It})),e.d(a,"invert",(function(){return Dt})),e.d(a,"adjoint",(function(){return Yt})),e.d(a,"determinant",(function(){return Nt})),e.d(a,"multiply",(function(){return _t})),e.d(a,"translate",(function(){return Xt})),e.d(a,"scale",(function(){return qt})),e.d(a,"rotate",(function(){return Ft})),e.d(a,"rotateX",(function(){return Gt})),e.d(a,"rotateY",(function(){return $t})),e.d(a,"rotateZ",(function(){return Ht})),e.d(a,"fromTranslation",(function(){return Vt})),e.d(a,"fromScaling",(function(){return Ut})),e.d(a,"fromRotation",(function(){return Wt})),e.d(a,"fromXRotation",(function(){return zt})),e.d(a,"fromYRotation",(function(){return Qt})),e.d(a,"fromZRotation",(function(){return Zt})),e.d(a,"fromRotationTranslation",(function(){return Jt})),e.d(a,"fromQuat2",(function(){return Kt})),e.d(a,"getTranslation",(function(){return tn})),e.d(a,"getScaling",(function(){return nn})),e.d(a,"getRotation",(function(){return en})),e.d(a,"fromRotationTranslationScale",(function(){return rn})),e.d(a,"fromRotationTranslationScaleOrigin",(function(){return on})),e.d(a,"fromQuat",(function(){return an})),e.d(a,"frustum",(function(){return un})),e.d(a,"perspectiveNO",(function(){return cn})),e.d(a,"perspective",(function(){return sn})),e.d(a,"perspectiveZO",(function(){return fn})),e.d(a,"perspectiveFromFieldOfView",(function(){return hn})),e.d(a,"orthoNO",(function(){return ln})),e.d(a,"ortho",(function(){return dn})),e.d(a,"orthoZO",(function(){return pn})),e.d(a,"lookAt",(function(){return vn})),e.d(a,"targetTo",(function(){return yn})),e.d(a,"str",(function(){return mn})),e.d(a,"frob",(function(){return gn})),e.d(a,"add",(function(){return Mn})),e.d(a,"subtract",(function(){return bn})),e.d(a,"multiplyScalar",(function(){return xn})),e.d(a,"multiplyScalarAndAdd",(function(){return Pn})),e.d(a,"exactEquals",(function(){return On})),e.d(a,"equals",(function(){return En})),e.d(a,"mul",(function(){return Sn})),e.d(a,"sub",(function(){return Cn}));var i={};e.r(i),e.d(i,"create",(function(){return jn})),e.d(i,"clone",(function(){return An})),e.d(i,"length",(function(){return Tn})),e.d(i,"fromValues",(function(){return Bn})),e.d(i,"copy",(function(){return Rn})),e.d(i,"set",(function(){return wn})),e.d(i,"add",(function(){return Ln})),e.d(i,"subtract",(function(){return kn})),e.d(i,"multiply",(function(){return In})),e.d(i,"divide",(function(){return Dn})),e.d(i,"ceil",(function(){return Yn})),e.d(i,"floor",(function(){return Nn})),e.d(i,"min",(function(){return _n})),e.d(i,"max",(function(){return Xn})),e.d(i,"round",(function(){return qn})),e.d(i,"scale",(function(){return Fn})),e.d(i,"scaleAndAdd",(function(){return Gn})),e.d(i,"distance",(function(){return $n})),e.d(i,"squaredDistance",(function(){return Hn})),e.d(i,"squaredLength",(function(){return Vn})),e.d(i,"negate",(function(){return Un})),e.d(i,"inverse",(function(){return Wn})),e.d(i,"normalize",(function(){return zn})),e.d(i,"dot",(function(){return Qn})),e.d(i,"cross",(function(){return Zn})),e.d(i,"lerp",(function(){return Jn})),e.d(i,"hermite",(function(){return Kn})),e.d(i,"bezier",(function(){return te})),e.d(i,"random",(function(){return ne})),e.d(i,"transformMat4",(function(){return ee})),e.d(i,"transformMat3",(function(){return re})),e.d(i,"transformQuat",(function(){return oe})),e.d(i,"rotateX",(function(){return ae})),e.d(i,"rotateY",(function(){return ie})),e.d(i,"rotateZ",(function(){return ue})),e.d(i,"angle",(function(){return ce})),e.d(i,"zero",(function(){return se})),e.d(i,"str",(function(){return fe})),e.d(i,"exactEquals",(function(){return he})),e.d(i,"equals",(function(){return le})),e.d(i,"sub",(function(){return pe})),e.d(i,"mul",(function(){return ve})),e.d(i,"div",(function(){return ye})),e.d(i,"dist",(function(){return me})),e.d(i,"sqrDist",(function(){return ge})),e.d(i,"len",(function(){return Me})),e.d(i,"sqrLen",(function(){return be})),e.d(i,"forEach",(function(){return xe}));var u={};e.r(u),e.d(u,"create",(function(){return Ee})),e.d(u,"identity",(function(){return Se})),e.d(u,"setAxisAngle",(function(){return Ce})),e.d(u,"getAxisAngle",(function(){return je})),e.d(u,"getAngle",(function(){return Ae})),e.d(u,"multiply",(function(){return Te})),e.d(u,"rotateX",(function(){return Be})),e.d(u,"rotateY",(function(){return Re})),e.d(u,"rotateZ",(function(){return we})),e.d(u,"calculateW",(function(){return Le})),e.d(u,"exp",(function(){return ke})),e.d(u,"ln",(function(){return Ie})),e.d(u,"pow",(function(){return De})),e.d(u,"slerp",(function(){return Ye})),e.d(u,"random",(function(){return Ne})),e.d(u,"invert",(function(){return _e})),e.d(u,"conjugate",(function(){return Xe})),e.d(u,"fromMat3",(function(){return qe})),e.d(u,"fromEuler",(function(){return Fe})),e.d(u,"str",(function(){return Ge})),e.d(u,"clone",(function(){return Qe})),e.d(u,"fromValues",(function(){return Ze})),e.d(u,"copy",(function(){return Je})),e.d(u,"set",(function(){return Ke})),e.d(u,"add",(function(){return tr})),e.d(u,"mul",(function(){return nr})),e.d(u,"scale",(function(){return er})),e.d(u,"dot",(function(){return rr})),e.d(u,"lerp",(function(){return or})),e.d(u,"length",(function(){return ar})),e.d(u,"len",(function(){return ir})),e.d(u,"squaredLength",(function(){return ur})),e.d(u,"sqrLen",(function(){return cr})),e.d(u,"normalize",(function(){return sr})),e.d(u,"exactEquals",(function(){return fr})),e.d(u,"equals",(function(){return hr})),e.d(u,"rotationTo",(function(){return lr})),e.d(u,"sqlerp",(function(){return dr})),e.d(u,"setAxes",(function(){return pr}));var c={};e.r(c),e.d(c,"create",(function(){return vr})),e.d(c,"clone",(function(){return yr})),e.d(c,"fromValues",(function(){return mr})),e.d(c,"copy",(function(){return gr})),e.d(c,"set",(function(){return Mr})),e.d(c,"add",(function(){return br})),e.d(c,"subtract",(function(){return xr})),e.d(c,"multiply",(function(){return Pr})),e.d(c,"divide",(function(){return Or})),e.d(c,"ceil",(function(){return Er})),e.d(c,"floor",(function(){return Sr})),e.d(c,"min",(function(){return Cr})),e.d(c,"max",(function(){return jr})),e.d(c,"round",(function(){return Ar})),e.d(c,"scale",(function(){return Tr})),e.d(c,"scaleAndAdd",(function(){return Br})),e.d(c,"distance",(function(){return Rr})),e.d(c,"squaredDistance",(function(){return wr})),e.d(c,"length",(function(){return Lr})),e.d(c,"squaredLength",(function(){return kr})),e.d(c,"negate",(function(){return Ir})),e.d(c,"inverse",(function(){return Dr})),e.d(c,"normalize",(function(){return Yr})),e.d(c,"dot",(function(){return Nr})),e.d(c,"cross",(function(){return _r})),e.d(c,"lerp",(function(){return Xr})),e.d(c,"random",(function(){return qr})),e.d(c,"transformMat2",(function(){return Fr})),e.d(c,"transformMat2d",(function(){return Gr})),e.d(c,"transformMat3",(function(){return $r})),e.d(c,"transformMat4",(function(){return Hr})),e.d(c,"rotate",(function(){return Vr})),e.d(c,"angle",(function(){return Ur})),e.d(c,"zero",(function(){return Wr})),e.d(c,"str",(function(){return zr})),e.d(c,"exactEquals",(function(){return Qr})),e.d(c,"equals",(function(){return Zr})),e.d(c,"len",(function(){return Jr})),e.d(c,"sub",(function(){return Kr})),e.d(c,"mul",(function(){return to})),e.d(c,"div",(function(){return no})),e.d(c,"dist",(function(){return eo})),e.d(c,"sqrDist",(function(){return ro})),e.d(c,"sqrLen",(function(){return oo})),e.d(c,"forEach",(function(){return ao}));var s={};e.r(s),e.d(s,"PathGeneratorFactory",(function(){return V})),e.d(s,"PathGenerator",(function(){return U})),e.d(s,"StyleRenderer",(function(){return C})),e.d(s,"RBushNode",(function(){return io})),e.d(s,"RBushRoot",(function(){return uo})),e.d(s,"RBush",(function(){return E.a})),e.d(s,"Plugin",(function(){return ho}));var f={};e.r(f),e.d(f,"Plugin",(function(){return zo}));var h={};e.r(h),e.d(h,"Plugin",(function(){return Jo}));
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var l=function(t,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)};var d=function(){return(d=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function p(t,n,e,r){var o,a=arguments.length,i=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(i=(a<3?o(i):a>3?o(n,e,i):o(n,e))||i);return a>3&&i&&Object.defineProperty(n,e,i),i}function v(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}Object.create;function y(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,a=e.call(t),i=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i}function m(t,n,e){if(e||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var g=e(0),M=e(1),b="ontouchstart"in self,x=!!self.PointerEvent;var P=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){t.hooks.pointerMove.call(n)},o=function(n){t.hooks.pointerUp.call(n)},a=function(n){t.hooks.pointerDown.call(n)},i=function(n){t.hooks.pointerOver.call(n)},u=function(n){t.hooks.pointerOut.call(n)},c=function(n){t.hooks.pointerWheel.call(n)};t.hooks.init.tap(n.tag,(function(){var t=e.contextService.getDomElement();x?(self.document.addEventListener("pointermove",r,!0),t.addEventListener("pointerdown",a,!0),t.addEventListener("pointerleave",u,!0),t.addEventListener("pointerover",i,!0),self.addEventListener("pointerup",o,!0)):(self.document.addEventListener("mousemove",r,!0),t.addEventListener("mousedown",a,!0),t.addEventListener("mouseout",u,!0),t.addEventListener("mouseover",i,!0),self.addEventListener("mouseup",o,!0)),b&&(t.addEventListener("touchstart",a,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",r,!0)),t.addEventListener("wheel",c,{passive:!0,capture:!0})})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();x?(self.document.removeEventListener("pointermove",r,!0),t.removeEventListener("pointerdown",a,!0),t.removeEventListener("pointerleave",u,!0),t.removeEventListener("pointerover",i,!0),self.removeEventListener("pointerup",o,!0)):(self.document.removeEventListener("mousemove",r,!0),t.removeEventListener("mousedown",a,!0),t.removeEventListener("mouseout",u,!0),t.removeEventListener("mouseover",i,!0),self.removeEventListener("mouseup",o,!0)),b&&(t.removeEventListener("touchstart",a,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",r,!0)),t.removeEventListener("wheel",c,!0)}))},t.tag="DOMInteractionPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),O=Object(M.Module)((function(t){t(P)})),E=function(){function t(){}return t.prototype.init=function(t){t.load(O,!0)},t.prototype.destroy=function(t){t.unload(O)},t}(),S=e(2),C=e.n(S),A=M.Syringe.defineToken("StyleRendererFactory"),j=M.Syringe.defineToken("StyleRenderer"),B={}.toString,w=function(t,n){return B.call(t)==="[object "+n+"]"},R=function(t){return w(t,"Function")},T=function(t){return null==t},L=function(t){return Array.isArray?Array.isArray(t):w(t,"Array")},k=function(t){var n=typeof t;return null!==t&&"object"===n||"function"===n};var I=function(t,n){if(t)if(L(t))for(var e=0,r=t.length;e<r&&!1!==n(t[e],e);e++);else if(k(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break};Object.keys;var D=function(t){if(L(t))return t.reduce((function(t,n){return Math.max(t,n)}),t[0])},Y=function(t){if(L(t))return t.reduce((function(t,n){return Math.min(t,n)}),t[0])},N=Array.prototype,_=(N.splice,N.indexOf,Array.prototype.splice,function(t){return w(t,"String")});Object.prototype.hasOwnProperty;var X=function(t){return w(t,"Number")};Number.isInteger&&Number.isInteger;Math.PI,parseInt,Math.PI;var q=Object.values?function(t){return Object.values(t)}:function(t){var n=[];return I(t,(function(e,r){R(t)&&"prototype"===r||n.push(e)})),n};Object.prototype;Object.prototype.hasOwnProperty;var F;Object.prototype.hasOwnProperty;(function(t,n){if(!R(t))throw new TypeError("Expected a function");var e=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var a=n?n.apply(this,r):r[0],i=e.cache;if(i.has(a))return i.get(a);var u=t.apply(this,r);return i.set(a,u),u};e.cache=new Map})((function(t,n){void 0===n&&(n={});var e=n.fontSize,r=n.fontFamily,o=n.fontWeight,a=n.fontStyle,i=n.fontVariant;return F||(F=document.createElement("canvas").getContext("2d")),F.font=[a,i,o,e+"px",r].join(" "),F.measureText(_(t)?t:"").width}),(function(t,n){return void 0===n&&(n={}),function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var a=arguments[n],i=0,u=a.length;i<u;i++,o++)r[o]=a[i];return r}([t],q(n)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,n){var e=this.map[t];return void 0===e?n:e},t.prototype.set=function(t,n){this.map[t]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var G=function(){function t(){}return t.prototype.hash=function(t){t.fill,t.opacity,t.fillOpacity,t.stroke,t.strokeOpacity,t.lineWidth,t.lineCap,t.lineJoin;return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,o=n.fillOpacity,a=n.stroke,i=n.strokeOpacity,u=n.lineWidth,c=n.lineCap,s=n.lineJoin,f=n.shadowColor,h=n.filter,l=n.miterLimit;if(T(e)||(T(o)||1===o?t.fill():(t.globalAlpha=o,t.fill(),t.globalAlpha=r)),!T(a)&&u&&u.value>0){!T(i)&&1!==i&&(t.globalAlpha=i),t.lineWidth=u.value,T(l)||(t.miterLimit=l),T(c)||(t.lineCap=c),T(s)||(t.lineJoin=s);var d=void 0,p=void 0,v=void 0,y=!T(f),m=!T(h);y&&(d=t.shadowBlur,p=t.shadowColor,T(d)||(t.shadowColor="transparent",t.shadowBlur=0)),m&&(v=t.filter,!T(v)&&v.indexOf("drop-shadow")>-1&&(t.filter=v.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")),t.stroke(),y&&(t.shadowColor=p,t.shadowBlur=d),m&&(t.filter=v)}},t=p([Object(M.singleton)({token:[{token:j,named:g.Shape.CIRCLE},{token:j,named:g.Shape.ELLIPSE},{token:j,named:g.Shape.RECT},{token:j,named:g.Shape.LINE},{token:j,named:g.Shape.POLYLINE},{token:j,named:g.Shape.POLYGON},{token:j,named:g.Shape.PATH}]})],t)}(),$=function(){function t(){this.imageCache={},this.patternCache={}}return t.prototype.getImageSync=function(t){return this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;return this.imageCache[t]?Promise.resolve(this.imageCache[t]):new Promise((function(e,r){var o=new window.Image;o.onload=function(){e(o)},o.onerror=function(t){r(t)},o.crossOrigin="Anonymous",o.src=t,n.imageCache[t]=o}))},t.prototype.getPatternSync=function(t){var n=this.generatePatternKey(t);if(this.patternCache[n])return this.patternCache[n]},t.prototype.createPattern=function(t,n){var e=this;return this.getOrCreateImage(t.src).then((function(r){var o=e.generatePatternKey(t),a=n.createPattern(r,t.repetition);return a&&(e.patternCache[o]=a),e.patternCache[o]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},t=p([Object(M.singleton)()],t)}(),H=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.widthInPixels,o=n.heightInPixels,a=n.img,i=r,u=o;_(a)?e=this.imagePool.getImageSync(a):(i||(i=a.width),u||(u=a.height),e=a),t.drawImage(e,0,0,i,u)},p([Object(M.inject)($),v("design:type",$)],t.prototype,"imagePool",void 0),t=p([Object(M.singleton)({token:{token:j,named:g.Shape.IMAGE}})],t)}(),V=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n.lineWidth,o=n.textAlign,a=n.textBaseline,i=n.lineJoin,u=n.miterLimit,c=void 0===u?0:u,s=n.letterSpacing,f=void 0===s?0:s,h=n.stroke,l=n.fill,d=n.fillOpacity,p=n.strokeOpacity,v=n.opacity,y=n.metrics,m=n.dx,g=n.dy,M=y.font,b=y.lines,x=y.height,P=y.lineHeight,O=y.lineMetrics;t.font=M,t.lineWidth=r.value,t.textAlign=o,t.textBaseline=a,t.lineJoin=i,t.miterLimit=c;var E=0;"middle"===a?E=-x/2-P/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?E=-x:"top"!==a&&"hanging"!==a||(E=-P);var S=0;m&&"px"===m.unit&&(S+=m.value),g&&"px"===g.unit&&(E+=g.value);for(var C=0;C<b.length;C++){var A=r.value/2+S;E+=P,!T(h)&&r&&r.value&&this.drawLetterSpacing(t,b[C],O[C],o,A,E,f,d,p,v,!0),T(l)||this.drawLetterSpacing(t,b[C],O[C],o,A,E,f,d,p,v)}},t.prototype.drawLetterSpacing=function(t,n,e,r,o,a,i,u,c,s,f){if(void 0===f&&(f=!1),0!==i){var h=t.textAlign;t.textAlign="left";var l=o;"center"===r?l=o-e.width/2:"right"!==r&&"end"!==r||(l=o-e.width);for(var d=Array.from(n),p=t.measureText(n).width,v=0,y=0;y<d.length;++y){var m=d[y];f?this.strokeText(t,m,l,a,c):this.fillText(t,m,l,a,u,s),l+=p-(v=t.measureText(n.substring(y+1)).width)+i,p=v}t.textAlign=h}else f?this.strokeText(t,n,o,a,c):this.fillText(t,n,o,a,u,s)},t.prototype.fillText=function(t,n,e,r,o,a){var i,u=!T(o)&&1!==o;u&&(i=t.globalAlpha,t.globalAlpha=o*a),t.fillText(n,e,r),u&&(t.globalAlpha=i)},t.prototype.strokeText=function(t,n,e,r,o){var a,i=!T(o)&&1!==o;i&&(a=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,e,r),i&&(t.globalAlpha=a)},p([Object(M.inject)(g.TextService),v("design:type",g.TextService)],t.prototype,"textService",void 0),t=p([Object(M.singleton)({token:{token:j,named:g.Shape.TEXT}})],t)}(),U=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,o=t.x0,a=t.y0,i=t.x1,u=t.y1,c=t.steps,s=t.width,f=t.height;if(this.gradientCache[e])return this.gradientCache[e];var h=null;if(r===g.PARSED_COLOR_TYPE.LinearGradient)h=n.createLinearGradient(o*s,a*f,i*s,u*f);else if(r===g.PARSED_COLOR_TYPE.RadialGradient){var l=Math.sqrt(s*s+f*f)/2;h=n.createRadialGradient(o*s,a*f,0,i*s,u*f,t.r1*l)}return h&&(c.forEach((function(t){var n=y(t,2),e=n[0],r=n[1];null==h||h.addColorStop(Number(e),r)})),this.gradientCache[e]=h),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,o=t.x1,a=t.y1,i=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(o,"-").concat(a,"-").concat(i||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=p([Object(M.singleton)()],t)}();var W="PathGeneratorFactory",z="PathGenerator",Q=1e-6,Z="undefined"!=typeof Float32Array?Float32Array:Array,J=Math.random;Math.PI;function K(){var t=new Z(9);return Z!=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 tt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function nt(t){var n=new Z(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n}function et(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function rt(t,n,e,r,o,a,i,u,c){var s=new Z(9);return s[0]=t,s[1]=n,s[2]=e,s[3]=r,s[4]=o,s[5]=a,s[6]=i,s[7]=u,s[8]=c,s}function ot(t,n,e,r,o,a,i,u,c,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=u,t[7]=c,t[8]=s,t}function at(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function it(t,n){if(t===n){var e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function ut(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=f*i-u*s,l=-f*a+u*c,d=s*a-i*c,p=e*h+r*l+o*d;return p?(p=1/p,t[0]=h*p,t[1]=(-f*r+o*s)*p,t[2]=(u*r-o*i)*p,t[3]=l*p,t[4]=(f*e-o*c)*p,t[5]=(-u*e+o*a)*p,t[6]=d*p,t[7]=(-s*e+r*c)*p,t[8]=(i*e-r*a)*p,t):null}function ct(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8];return t[0]=i*f-u*s,t[1]=o*s-r*f,t[2]=r*u-o*i,t[3]=u*c-a*f,t[4]=e*f-o*c,t[5]=o*a-e*u,t[6]=a*s-i*c,t[7]=r*c-e*s,t[8]=e*i-r*a,t}function st(t){var n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],c=t[7],s=t[8];return n*(s*a-i*c)+e*(-s*o+i*u)+r*(c*o-a*u)}function ft(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1],p=e[2],v=e[3],y=e[4],m=e[5],g=e[6],M=e[7],b=e[8];return t[0]=l*r+d*i+p*s,t[1]=l*o+d*u+p*f,t[2]=l*a+d*c+p*h,t[3]=v*r+y*i+m*s,t[4]=v*o+y*u+m*f,t[5]=v*a+y*c+m*h,t[6]=g*r+M*i+b*s,t[7]=g*o+M*u+b*f,t[8]=g*a+M*c+b*h,t}function ht(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=c,t[6]=l*r+d*i+s,t[7]=l*o+d*u+f,t[8]=l*a+d*c+h,t}function lt(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=Math.sin(e),d=Math.cos(e);return t[0]=d*r+l*i,t[1]=d*o+l*u,t[2]=d*a+l*c,t[3]=d*i-l*r,t[4]=d*u-l*o,t[5]=d*c-l*a,t[6]=s,t[7]=f,t[8]=h,t}function dt(t,n,e){var r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function pt(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t}function vt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function yt(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function mt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t}function gt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,u=r+r,c=o+o,s=e*i,f=r*i,h=r*u,l=o*i,d=o*u,p=o*c,v=a*i,y=a*u,m=a*c;return t[0]=1-h-p,t[3]=f-m,t[6]=l+y,t[1]=f+m,t[4]=1-s-p,t[7]=d-v,t[2]=l-y,t[5]=d+v,t[8]=1-s-h,t}function Mt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*i,M=e*c-o*i,b=e*s-a*i,x=r*c-o*u,P=r*s-a*u,O=o*s-a*c,E=f*v-h*p,S=f*y-l*p,C=f*m-d*p,A=h*y-l*v,j=h*m-d*v,B=l*m-d*y,w=g*B-M*j+b*A+x*C-P*S+O*E;return w?(w=1/w,t[0]=(u*B-c*j+s*A)*w,t[1]=(c*C-i*B-s*S)*w,t[2]=(i*j-u*C+s*E)*w,t[3]=(o*j-r*B-a*A)*w,t[4]=(e*B-o*C+a*S)*w,t[5]=(r*C-e*j-a*E)*w,t[6]=(v*O-y*P+m*x)*w,t[7]=(y*b-p*O-m*M)*w,t[8]=(p*P-v*b+m*g)*w,t):null}function bt(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function xt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Pt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Ot(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t}function Et(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}function St(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t}function Ct(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t}function At(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}function jt(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=n[0],l=n[1],d=n[2],p=n[3],v=n[4],y=n[5],m=n[6],g=n[7],M=n[8];return Math.abs(e-h)<=Q*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-l)<=Q*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-d)<=Q*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=Q*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(i-v)<=Q*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(u-y)<=Q*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=Q*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(s-g)<=Q*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-M)<=Q*Math.max(1,Math.abs(f),Math.abs(M))}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var Bt=ft,wt=Et;function Rt(){var t=new Z(16);return Z!=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 Tt(t){var n=new Z(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Lt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function kt(t,n,e,r,o,a,i,u,c,s,f,h,l,d,p,v){var y=new Z(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=o,y[5]=a,y[6]=i,y[7]=u,y[8]=c,y[9]=s,y[10]=f,y[11]=h,y[12]=l,y[13]=d,y[14]=p,y[15]=v,y}function It(t,n,e,r,o,a,i,u,c,s,f,h,l,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=u,t[7]=c,t[8]=s,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function Dt(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 Yt(t,n){if(t===n){var e=n[1],r=n[2],o=n[3],a=n[6],i=n[7],u=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=e,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=a,t[11]=n[14],t[12]=o,t[13]=i,t[14]=u}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t}function Nt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*i,M=e*c-o*i,b=e*s-a*i,x=r*c-o*u,P=r*s-a*u,O=o*s-a*c,E=f*v-h*p,S=f*y-l*p,C=f*m-d*p,A=h*y-l*v,j=h*m-d*v,B=l*m-d*y,w=g*B-M*j+b*A+x*C-P*S+O*E;return w?(w=1/w,t[0]=(u*B-c*j+s*A)*w,t[1]=(o*j-r*B-a*A)*w,t[2]=(v*O-y*P+m*x)*w,t[3]=(l*P-h*O-d*x)*w,t[4]=(c*C-i*B-s*S)*w,t[5]=(e*B-o*C+a*S)*w,t[6]=(y*b-p*O-m*M)*w,t[7]=(f*O-l*b+d*M)*w,t[8]=(i*j-u*C+s*E)*w,t[9]=(r*C-e*j-a*E)*w,t[10]=(p*P-v*b+m*g)*w,t[11]=(h*b-f*P-d*g)*w,t[12]=(u*S-i*A-c*E)*w,t[13]=(e*A-r*S+o*E)*w,t[14]=(v*M-p*x-y*g)*w,t[15]=(f*x-h*M+l*g)*w,t):null}function _t(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(l*m-d*y)-h*(c*m-s*y)+v*(c*d-s*l),t[1]=-(r*(l*m-d*y)-h*(o*m-a*y)+v*(o*d-a*l)),t[2]=r*(c*m-s*y)-u*(o*m-a*y)+v*(o*s-a*c),t[3]=-(r*(c*d-s*l)-u*(o*d-a*l)+h*(o*s-a*c)),t[4]=-(i*(l*m-d*y)-f*(c*m-s*y)+p*(c*d-s*l)),t[5]=e*(l*m-d*y)-f*(o*m-a*y)+p*(o*d-a*l),t[6]=-(e*(c*m-s*y)-i*(o*m-a*y)+p*(o*s-a*c)),t[7]=e*(c*d-s*l)-i*(o*d-a*l)+f*(o*s-a*c),t[8]=i*(h*m-d*v)-f*(u*m-s*v)+p*(u*d-s*h),t[9]=-(e*(h*m-d*v)-f*(r*m-a*v)+p*(r*d-a*h)),t[10]=e*(u*m-s*v)-i*(r*m-a*v)+p*(r*s-a*u),t[11]=-(e*(u*d-s*h)-i*(r*d-a*h)+f*(r*s-a*u)),t[12]=-(i*(h*y-l*v)-f*(u*y-c*v)+p*(u*l-c*h)),t[13]=e*(h*y-l*v)-f*(r*y-o*v)+p*(r*l-o*h),t[14]=-(e*(u*y-c*v)-i*(r*y-o*v)+p*(r*c-o*u)),t[15]=e*(u*l-c*h)-i*(r*l-o*h)+f*(r*c-o*u),t}function Xt(t){var n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],c=t[7],s=t[8],f=t[9],h=t[10],l=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*i-e*a)*(h*y-l*v)-(n*u-r*a)*(f*y-l*p)+(n*c-o*a)*(f*v-h*p)+(e*u-r*i)*(s*y-l*d)-(e*c-o*i)*(s*v-h*d)+(r*c-o*u)*(s*p-f*d)}function qt(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=n[9],d=n[10],p=n[11],v=n[12],y=n[13],m=n[14],g=n[15],M=e[0],b=e[1],x=e[2],P=e[3];return t[0]=M*r+b*u+x*h+P*v,t[1]=M*o+b*c+x*l+P*y,t[2]=M*a+b*s+x*d+P*m,t[3]=M*i+b*f+x*p+P*g,M=e[4],b=e[5],x=e[6],P=e[7],t[4]=M*r+b*u+x*h+P*v,t[5]=M*o+b*c+x*l+P*y,t[6]=M*a+b*s+x*d+P*m,t[7]=M*i+b*f+x*p+P*g,M=e[8],b=e[9],x=e[10],P=e[11],t[8]=M*r+b*u+x*h+P*v,t[9]=M*o+b*c+x*l+P*y,t[10]=M*a+b*s+x*d+P*m,t[11]=M*i+b*f+x*p+P*g,M=e[12],b=e[13],x=e[14],P=e[15],t[12]=M*r+b*u+x*h+P*v,t[13]=M*o+b*c+x*l+P*y,t[14]=M*a+b*s+x*d+P*m,t[15]=M*i+b*f+x*p+P*g,t}function Ft(t,n,e){var r,o,a,i,u,c,s,f,h,l,d,p,v=e[0],y=e[1],m=e[2];return n===t?(t[12]=n[0]*v+n[4]*y+n[8]*m+n[12],t[13]=n[1]*v+n[5]*y+n[9]*m+n[13],t[14]=n[2]*v+n[6]*y+n[10]*m+n[14],t[15]=n[3]*v+n[7]*y+n[11]*m+n[15]):(r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=n[9],d=n[10],p=n[11],t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=c,t[6]=s,t[7]=f,t[8]=h,t[9]=l,t[10]=d,t[11]=p,t[12]=r*v+u*y+h*m+n[12],t[13]=o*v+c*y+l*m+n[13],t[14]=a*v+s*y+d*m+n[14],t[15]=i*v+f*y+p*m+n[15]),t}function Gt(t,n,e){var r=e[0],o=e[1],a=e[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function $t(t,n,e,r){var o,a,i,u,c,s,f,h,l,d,p,v,y,m,g,M,b,x,P,O,E,S,C,A,j=r[0],B=r[1],w=r[2],R=Math.hypot(j,B,w);return R<Q?null:(j*=R=1/R,B*=R,w*=R,o=Math.sin(e),i=1-(a=Math.cos(e)),u=n[0],c=n[1],s=n[2],f=n[3],h=n[4],l=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=j*j*i+a,b=B*j*i+w*o,x=w*j*i-B*o,P=j*B*i-w*o,O=B*B*i+a,E=w*B*i+j*o,S=j*w*i+B*o,C=B*w*i-j*o,A=w*w*i+a,t[0]=u*M+h*b+v*x,t[1]=c*M+l*b+y*x,t[2]=s*M+d*b+m*x,t[3]=f*M+p*b+g*x,t[4]=u*P+h*O+v*E,t[5]=c*P+l*O+y*E,t[6]=s*P+d*O+m*E,t[7]=f*P+p*O+g*E,t[8]=u*S+h*C+v*A,t[9]=c*S+l*C+y*A,t[10]=s*S+d*C+m*A,t[11]=f*S+p*C+g*A,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function Ht(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[4],i=n[5],u=n[6],c=n[7],s=n[8],f=n[9],h=n[10],l=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=a*o+s*r,t[5]=i*o+f*r,t[6]=u*o+h*r,t[7]=c*o+l*r,t[8]=s*o-a*r,t[9]=f*o-i*r,t[10]=h*o-u*r,t[11]=l*o-c*r,t}function Vt(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[0],i=n[1],u=n[2],c=n[3],s=n[8],f=n[9],h=n[10],l=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=a*o-s*r,t[1]=i*o-f*r,t[2]=u*o-h*r,t[3]=c*o-l*r,t[8]=a*r+s*o,t[9]=i*r+f*o,t[10]=u*r+h*o,t[11]=c*r+l*o,t}function Ut(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[0],i=n[1],u=n[2],c=n[3],s=n[4],f=n[5],h=n[6],l=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=a*o+s*r,t[1]=i*o+f*r,t[2]=u*o+h*r,t[3]=c*o+l*r,t[4]=s*o-a*r,t[5]=f*o-i*r,t[6]=h*o-u*r,t[7]=l*o-c*r,t}function Wt(t,n){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]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function zt(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Qt(t,n,e){var r,o,a,i=e[0],u=e[1],c=e[2],s=Math.hypot(i,u,c);return s<Q?null:(i*=s=1/s,u*=s,c*=s,r=Math.sin(n),a=1-(o=Math.cos(n)),t[0]=i*i*a+o,t[1]=u*i*a+c*r,t[2]=c*i*a-u*r,t[3]=0,t[4]=i*u*a-c*r,t[5]=u*u*a+o,t[6]=c*u*a+i*r,t[7]=0,t[8]=i*c*a+u*r,t[9]=u*c*a-i*r,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Zt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=e,t[7]=0,t[8]=0,t[9]=-e,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Jt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-e,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=e,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Kt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=0,t[4]=-e,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}function tn(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=r+r,c=o+o,s=a+a,f=r*u,h=r*c,l=r*s,d=o*c,p=o*s,v=a*s,y=i*u,m=i*c,g=i*s;return t[0]=1-(d+v),t[1]=h+g,t[2]=l-m,t[3]=0,t[4]=h-g,t[5]=1-(f+v),t[6]=p+y,t[7]=0,t[8]=l+m,t[9]=p-y,t[10]=1-(f+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function nn(t,n){var e=new Z(3),r=-n[0],o=-n[1],a=-n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=r*r+o*o+a*a+i*i;return h>0?(e[0]=2*(u*i+f*r+c*a-s*o)/h,e[1]=2*(c*i+f*o+s*r-u*a)/h,e[2]=2*(s*i+f*a+u*o-c*r)/h):(e[0]=2*(u*i+f*r+c*a-s*o),e[1]=2*(c*i+f*o+s*r-u*a),e[2]=2*(s*i+f*a+u*o-c*r)),tn(t,n,e),t}function en(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function rn(t,n){var e=n[0],r=n[1],o=n[2],a=n[4],i=n[5],u=n[6],c=n[8],s=n[9],f=n[10];return t[0]=Math.hypot(e,r,o),t[1]=Math.hypot(a,i,u),t[2]=Math.hypot(c,s,f),t}function on(t,n){var e=new Z(3);rn(e,n);var r=1/e[0],o=1/e[1],a=1/e[2],i=n[0]*r,u=n[1]*o,c=n[2]*a,s=n[4]*r,f=n[5]*o,h=n[6]*a,l=n[8]*r,d=n[9]*o,p=n[10]*a,v=i+f+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(h-d)/y,t[1]=(l-c)/y,t[2]=(u-s)/y):i>f&&i>p?(y=2*Math.sqrt(1+i-f-p),t[3]=(h-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(l+c)/y):f>p?(y=2*Math.sqrt(1+f-i-p),t[3]=(l-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(h+d)/y):(y=2*Math.sqrt(1+p-i-f),t[3]=(u-s)/y,t[0]=(l+c)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function an(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=n[3],c=o+o,s=a+a,f=i+i,h=o*c,l=o*s,d=o*f,p=a*s,v=a*f,y=i*f,m=u*c,g=u*s,M=u*f,b=r[0],x=r[1],P=r[2];return t[0]=(1-(p+y))*b,t[1]=(l+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(l-M)*x,t[5]=(1-(h+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*P,t[9]=(v-m)*P,t[10]=(1-(h+p))*P,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function un(t,n,e,r,o){var a=n[0],i=n[1],u=n[2],c=n[3],s=a+a,f=i+i,h=u+u,l=a*s,d=a*f,p=a*h,v=i*f,y=i*h,m=u*h,g=c*s,M=c*f,b=c*h,x=r[0],P=r[1],O=r[2],E=o[0],S=o[1],C=o[2],A=(1-(v+m))*x,j=(d+b)*x,B=(p-M)*x,w=(d-b)*P,R=(1-(l+m))*P,T=(y+g)*P,L=(p+M)*O,k=(y-g)*O,I=(1-(l+v))*O;return t[0]=A,t[1]=j,t[2]=B,t[3]=0,t[4]=w,t[5]=R,t[6]=T,t[7]=0,t[8]=L,t[9]=k,t[10]=I,t[11]=0,t[12]=e[0]+E-(A*E+w*S+L*C),t[13]=e[1]+S-(j*E+R*S+k*C),t[14]=e[2]+C-(B*E+T*S+I*C),t[15]=1,t}function cn(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,u=r+r,c=o+o,s=e*i,f=r*i,h=r*u,l=o*i,d=o*u,p=o*c,v=a*i,y=a*u,m=a*c;return t[0]=1-h-p,t[1]=f+m,t[2]=l-y,t[3]=0,t[4]=f-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=l+y,t[9]=d-v,t[10]=1-s-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function sn(t,n,e,r,o,a,i){var u=1/(e-n),c=1/(o-r),s=1/(a-i);return t[0]=2*a*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(o+r)*c,t[10]=(i+a)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*a*2*s,t[15]=0,t}function fn(t,n,e,r,o){var a,i=1/Math.tan(n/2);return t[0]=i/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,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!=o&&o!==1/0?(a=1/(r-o),t[10]=(o+r)*a,t[14]=2*o*r*a):(t[10]=-1,t[14]=-2*r),t}var hn=fn;function ln(t,n,e,r,o){var a,i=1/Math.tan(n/2);return t[0]=i/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,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!=o&&o!==1/0?(a=1/(r-o),t[10]=o*a,t[14]=o*r*a):(t[10]=-1,t[14]=-r),t}function dn(t,n,e,r){var o=Math.tan(n.upDegrees*Math.PI/180),a=Math.tan(n.downDegrees*Math.PI/180),i=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(i+u),s=2/(o+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=-(i-u)*c*.5,t[9]=(o-a)*s*.5,t[10]=r/(e-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*e/(e-r),t[15]=0,t}function pn(t,n,e,r,o,a,i){var u=1/(n-e),c=1/(r-o),s=1/(a-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*s,t[11]=0,t[12]=(n+e)*u,t[13]=(o+r)*c,t[14]=(i+a)*s,t[15]=1,t}var vn=pn;function yn(t,n,e,r,o,a,i){var u=1/(n-e),c=1/(r-o),s=1/(a-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=s,t[11]=0,t[12]=(n+e)*u,t[13]=(o+r)*c,t[14]=a*s,t[15]=1,t}function mn(t,n,e,r){var o,a,i,u,c,s,f,h,l,d,p=n[0],v=n[1],y=n[2],m=r[0],g=r[1],M=r[2],b=e[0],x=e[1],P=e[2];return Math.abs(p-b)<Q&&Math.abs(v-x)<Q&&Math.abs(y-P)<Q?Dt(t):(f=p-b,h=v-x,l=y-P,o=g*(l*=d=1/Math.hypot(f,h,l))-M*(h*=d),a=M*(f*=d)-m*l,i=m*h-g*f,(d=Math.hypot(o,a,i))?(o*=d=1/d,a*=d,i*=d):(o=0,a=0,i=0),u=h*i-l*a,c=l*o-f*i,s=f*a-h*o,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=h,t[7]=0,t[8]=i,t[9]=s,t[10]=l,t[11]=0,t[12]=-(o*p+a*v+i*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+h*v+l*y),t[15]=1,t)}function gn(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=r[0],c=r[1],s=r[2],f=o-e[0],h=a-e[1],l=i-e[2],d=f*f+h*h+l*l;d>0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var p=c*l-s*h,v=s*f-u*l,y=u*h-c*f;return(d=p*p+v*v+y*y)>0&&(p*=d=1/Math.sqrt(d),v*=d,y*=d),t[0]=p,t[1]=v,t[2]=y,t[3]=0,t[4]=h*y-l*v,t[5]=l*p-f*y,t[6]=f*v-h*p,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=o,t[13]=a,t[14]=i,t[15]=1,t}function Mn(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]+")"}function bn(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])}function xn(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t[9]=n[9]+e[9],t[10]=n[10]+e[10],t[11]=n[11]+e[11],t[12]=n[12]+e[12],t[13]=n[13]+e[13],t[14]=n[14]+e[14],t[15]=n[15]+e[15],t}function Pn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}function On(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12]*e,t[13]=n[13]*e,t[14]=n[14]*e,t[15]=n[15]*e,t}function En(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t[9]=n[9]+e[9]*r,t[10]=n[10]+e[10]*r,t[11]=n[11]+e[11]*r,t[12]=n[12]+e[12]*r,t[13]=n[13]+e[13]*r,t[14]=n[14]+e[14]*r,t[15]=n[15]+e[15]*r,t}function Sn(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]}function Cn(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=t[9],l=t[10],d=t[11],p=t[12],v=t[13],y=t[14],m=t[15],g=n[0],M=n[1],b=n[2],x=n[3],P=n[4],O=n[5],E=n[6],S=n[7],C=n[8],A=n[9],j=n[10],B=n[11],w=n[12],R=n[13],T=n[14],L=n[15];return Math.abs(e-g)<=Q*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=Q*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(o-b)<=Q*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=Q*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(i-P)<=Q*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(u-O)<=Q*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(c-E)<=Q*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(s-S)<=Q*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(f-C)<=Q*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-A)<=Q*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(l-j)<=Q*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(d-B)<=Q*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(p-w)<=Q*Math.max(1,Math.abs(p),Math.abs(w))&&Math.abs(v-R)<=Q*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=Q*Math.max(1,Math.abs(y),Math.abs(T))&&Math.abs(m-L)<=Q*Math.max(1,Math.abs(m),Math.abs(L))}var An=qt,jn=Pn;function Bn(){var t=new Z(3);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function wn(t){var n=new Z(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Rn(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Tn(t,n,e){var r=new Z(3);return r[0]=t,r[1]=n,r[2]=e,r}function Ln(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function kn(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function In(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function Dn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function Yn(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Nn(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function _n(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function Xn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function qn(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t}function Fn(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t}function Gn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function $n(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function Hn(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}function Vn(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.hypot(e,r,o)}function Un(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function Wn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function zn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function Qn(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function Zn(t,n){var e=n[0],r=n[1],o=n[2],a=e*e+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function Jn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Kn(t,n,e){var r=n[0],o=n[1],a=n[2],i=e[0],u=e[1],c=e[2];return t[0]=o*c-a*u,t[1]=a*i-r*c,t[2]=r*u-o*i,t}function te(t,n,e,r){var o=n[0],a=n[1],i=n[2];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t[2]=i+r*(e[2]-i),t}function ne(t,n,e,r,o,a){var i=a*a,u=i*(2*a-3)+1,c=i*(a-2)+a,s=i*(a-1),f=i*(3-2*a);return t[0]=n[0]*u+e[0]*c+r[0]*s+o[0]*f,t[1]=n[1]*u+e[1]*c+r[1]*s+o[1]*f,t[2]=n[2]*u+e[2]*c+r[2]*s+o[2]*f,t}function ee(t,n,e,r,o,a){var i=1-a,u=i*i,c=a*a,s=u*i,f=3*a*u,h=3*c*i,l=c*a;return t[0]=n[0]*s+e[0]*f+r[0]*h+o[0]*l,t[1]=n[1]*s+e[1]*f+r[1]*h+o[1]*l,t[2]=n[2]*s+e[2]*f+r[2]*h+o[2]*l,t}function re(t,n){n=n||1;var e=2*J()*Math.PI,r=2*J()-1,o=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*o,t[1]=Math.sin(e)*o,t[2]=r*n,t}function oe(t,n,e){var r=n[0],o=n[1],a=n[2],i=e[3]*r+e[7]*o+e[11]*a+e[15];return i=i||1,t[0]=(e[0]*r+e[4]*o+e[8]*a+e[12])/i,t[1]=(e[1]*r+e[5]*o+e[9]*a+e[13])/i,t[2]=(e[2]*r+e[6]*o+e[10]*a+e[14])/i,t}function ae(t,n,e){var r=n[0],o=n[1],a=n[2];return t[0]=r*e[0]+o*e[3]+a*e[6],t[1]=r*e[1]+o*e[4]+a*e[7],t[2]=r*e[2]+o*e[5]+a*e[8],t}function ie(t,n,e){var r=e[0],o=e[1],a=e[2],i=e[3],u=n[0],c=n[1],s=n[2],f=o*s-a*c,h=a*u-r*s,l=r*c-o*u,d=o*l-a*h,p=a*f-r*l,v=r*h-o*f,y=2*i;return f*=y,h*=y,l*=y,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=c+h+p,t[2]=s+l+v,t}function ue(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[0],a[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),a[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ce(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),a[1]=o[1],a[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function se(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),a[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),a[2]=o[2],t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function fe(t,n){var e=t[0],r=t[1],o=t[2],a=n[0],i=n[1],u=n[2],c=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(a*a+i*i+u*u),s=c&&Jn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function he(t){return t[0]=0,t[1]=0,t[2]=0,t}function le(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function de(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function pe(t,n){var e=t[0],r=t[1],o=t[2],a=n[0],i=n[1],u=n[2];return Math.abs(e-a)<=Q*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-i)<=Q*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(o-u)<=Q*Math.max(1,Math.abs(o),Math.abs(u))}var ve,ye=Dn,me=Yn,ge=Nn,Me=Vn,be=Un,xe=Rn,Pe=Wn,Oe=(ve=Bn(),function(t,n,e,r,o,a){var i,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,i=e;i<u;i+=n)ve[0]=t[i],ve[1]=t[i+1],ve[2]=t[i+2],o(ve,ve,a),t[i]=ve[0],t[i+1]=ve[1],t[i+2]=ve[2];return t});function Ee(t){var n=t[0],e=t[1],r=t[2],o=t[3];return Math.hypot(n,e,r,o)}function Se(t){var n=t[0],e=t[1],r=t[2],o=t[3];return n*n+e*e+r*r+o*o}!function(){var t,n=(t=new Z(4),Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Ce(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ae(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function je(t,n,e){e*=.5;var r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function Be(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>Q?(t[0]=n[0]/r,t[1]=n[1]/r,t[2]=n[2]/r):(t[0]=1,t[1]=0,t[2]=0),e}function we(t,n){var e=ar(t,n);return Math.acos(2*e*e-1)}function Re(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=e[0],c=e[1],s=e[2],f=e[3];return t[0]=r*f+i*u+o*s-a*c,t[1]=o*f+i*c+a*u-r*s,t[2]=a*f+i*s+r*c-o*u,t[3]=i*f-r*u-o*c-a*s,t}function Te(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+i*u,t[1]=o*c+a*u,t[2]=a*c-o*u,t[3]=i*c-r*u,t}function Le(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-a*u,t[1]=o*c+i*u,t[2]=a*c+r*u,t[3]=i*c-o*u,t}function ke(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=o*c-r*u,t[2]=a*c+i*u,t[3]=i*c-a*u,t}function Ie(t,n){var e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t}function De(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=Math.sqrt(e*e+r*r+o*o),u=Math.exp(a),c=i>0?u*Math.sin(i)/i:0;return t[0]=e*c,t[1]=r*c,t[2]=o*c,t[3]=u*Math.cos(i),t}function Ye(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=Math.sqrt(e*e+r*r+o*o),u=i>0?Math.atan2(i,a)/i:0;return t[0]=e*u,t[1]=r*u,t[2]=o*u,t[3]=.5*Math.log(e*e+r*r+o*o+a*a),t}function Ne(t,n,e){return Ye(t,n),or(t,t,e),De(t,t),t}function _e(t,n,e,r){var o,a,i,u,c,s=n[0],f=n[1],h=n[2],l=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(a=s*d+f*p+h*v+l*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),1-a>Q?(o=Math.acos(a),i=Math.sin(o),u=Math.sin((1-r)*o)/i,c=Math.sin(r*o)/i):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*f+c*p,t[2]=u*h+c*v,t[3]=u*l+c*y,t}function Xe(t){var n=J(),e=J(),r=J(),o=Math.sqrt(1-n),a=Math.sqrt(n);return t[0]=o*Math.sin(2*Math.PI*e),t[1]=o*Math.cos(2*Math.PI*e),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t}function qe(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e*e+r*r+o*o+a*a,u=i?1/i:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-o*u,t[3]=a*u,t}function Fe(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function Ge(t,n){var e,r=n[0]+n[4]+n[8];if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{var o=0;n[4]>n[0]&&(o=1),n[8]>n[3*o+o]&&(o=2);var a=(o+1)%3,i=(o+2)%3;e=Math.sqrt(n[3*o+o]-n[3*a+a]-n[3*i+i]+1),t[o]=.5*e,e=.5/e,t[3]=(n[3*a+i]-n[3*i+a])*e,t[a]=(n[3*a+o]+n[3*o+a])*e,t[i]=(n[3*i+o]+n[3*o+i])*e}return t}function $e(t,n,e,r){var o=.5*Math.PI/180;n*=o,e*=o,r*=o;var a=Math.sin(n),i=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),f=Math.cos(r);return t[0]=a*c*f-i*u*s,t[1]=i*u*f+a*c*s,t[2]=i*c*s-a*u*f,t[3]=i*c*f+a*u*s,t}function He(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Ve,Ue,We,ze,Qe,Ze,Je=function(t){var n=new Z(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},Ke=function(t,n,e,r){var o=new Z(4);return o[0]=t,o[1]=n,o[2]=e,o[3]=r,o},tr=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},nr=function(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t},er=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t},rr=Re,or=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t},ar=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},ir=function(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=n[3];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t[2]=i+r*(e[2]-i),t[3]=u+r*(e[3]-u),t},ur=Ee,cr=ur,sr=Se,fr=sr,hr=function(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e*e+r*r+o*o+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=e*i,t[1]=r*i,t[2]=o*i,t[3]=a*i,t},lr=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},dr=function(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-i)<=Q*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-u)<=Q*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-c)<=Q*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-s)<=Q*Math.max(1,Math.abs(a),Math.abs(s))},pr=(Ve=Bn(),Ue=Tn(1,0,0),We=Tn(0,1,0),function(t,n,e){var r=Jn(n,e);return r<-.999999?(Kn(Ve,Ue,n),xe(Ve)<1e-6&&Kn(Ve,We,n),Zn(Ve,Ve),je(t,Ve,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Kn(Ve,n,e),t[0]=Ve[0],t[1]=Ve[1],t[2]=Ve[2],t[3]=1+r,hr(t,t))}),vr=(ze=Ce(),Qe=Ce(),function(t,n,e,r,o,a){return _e(ze,n,o,a),_e(Qe,e,r,a),_e(t,ze,Qe,2*a*(1-a)),t}),yr=(Ze=K(),function(t,n,e,r){return Ze[0]=e[0],Ze[3]=e[1],Ze[6]=e[2],Ze[1]=r[0],Ze[4]=r[1],Ze[7]=r[2],Ze[2]=-n[0],Ze[5]=-n[1],Ze[8]=-n[2],hr(t,Ge(t,Ze))});function mr(){var t=new Z(2);return Z!=Float32Array&&(t[0]=0,t[1]=0),t}function gr(t){var n=new Z(2);return n[0]=t[0],n[1]=t[1],n}function Mr(t,n){var e=new Z(2);return e[0]=t,e[1]=n,e}function br(t,n){return t[0]=n[0],t[1]=n[1],t}function xr(t,n,e){return t[0]=n,t[1]=e,t}function Pr(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function Or(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function Er(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function Sr(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function Cr(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function Ar(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function jr(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function Br(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function wr(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function Rr(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Tr(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function Lr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function kr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Ir(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function Dr(t){var n=t[0],e=t[1];return n*n+e*e}function Yr(t,n){return t[0]=-n[0],t[1]=-n[1],t}function Nr(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function _r(t,n){var e=n[0],r=n[1],o=e*e+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t}function Xr(t,n){return t[0]*n[0]+t[1]*n[1]}function qr(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function Fr(t,n,e,r){var o=n[0],a=n[1];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t}function Gr(t,n){n=n||1;var e=2*J()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function $r(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o,t[1]=e[1]*r+e[3]*o,t}function Hr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o+e[4],t[1]=e[1]*r+e[3]*o+e[5],t}function Vr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[3]*o+e[6],t[1]=e[1]*r+e[4]*o+e[7],t}function Ur(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[4]*o+e[12],t[1]=e[1]*r+e[5]*o+e[13],t}function Wr(t,n,e,r){var o=n[0]-e[0],a=n[1]-e[1],i=Math.sin(r),u=Math.cos(r);return t[0]=o*u-a*i+e[0],t[1]=o*i+a*u+e[1],t}function zr(t,n){var e=t[0],r=t[1],o=n[0],a=n[1],i=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+a*a),u=i&&(e*o+r*a)/i;return Math.acos(Math.min(Math.max(u,-1),1))}function Qr(t){return t[0]=0,t[1]=0,t}function Zr(t){return"vec2("+t[0]+", "+t[1]+")"}function Jr(t,n){return t[0]===n[0]&&t[1]===n[1]}function Kr(t,n){var e=t[0],r=t[1],o=n[0],a=n[1];return Math.abs(e-o)<=Q*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-a)<=Q*Math.max(1,Math.abs(r),Math.abs(a))}var to=Ir,no=Or,eo=Er,ro=Sr,oo=Lr,ao=kr,io=Dr,uo=function(){var t=mr();return function(n,e,r,o,a,i){var u,c;for(e||(e=2),r||(r=0),c=o?Math.min(o*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],a(t,t,i),n[u]=t[0],n[u+1]=t[1];return n}}(),co=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),so="RBushRoot",fo=function(){function t(){this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n;return n=t,t.prototype.syncRTree=function(){var t=this,n=[];this.toSync.forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var o=e.getRenderBounds();if(o){var a=y(o.getMin(),2),i=a[0],u=a[1],c=y(o.getMax(),2),s=c[0],f=c[1];r.aabb={id:e.entity,minX:i,minY:u,maxX:s,maxY:f}}r.aabb&&n.push(r.aabb)})),this.rBush.load(n),this.toSync.clear()},t.prototype.pushToSync=function(t){var n=this;t.forEach((function(t){n.toSync.add(t)}))},t.prototype.apply=function(t){var e=this,r=function(t){t.target.rBushNode=new co,e.pushToSync(t.composedPath().slice(0,-2))},o=function(t){var n=t.target,r=n.rBushNode;r.aabb&&(e.rBush.remove(r.aabb),e.toSync.delete(n),e.removedRBushNodeAABBs.push(r.aabb))},a=function(t){var n,r=t.target;(null===(n=r.ownerDocument)||void 0===n?void 0:n.documentElement)===e.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){e.pushToSync([t])})),e.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.addEventListener(g.ElementEvent.BOUNDS_CHANGED,a)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.removeEventListener(g.ElementEvent.BOUNDS_CHANGED,a)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering;n.enableDirtyRectangleRenderingDebug;e.clearFullScreen=!r||e.renderingContext.renderReasons.has(g.RenderReason.CAMERA_CHANGED),t&&(t.save(),e.clearFullScreen&&t.clearRect(0,0,e.canvasConfig.width,e.canvasConfig.height),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){e.syncRTree();var n=e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering,r=e.contextService.getContext(),o=e.renderQueue;if(n){if(!e.clearFullScreen){var a=e.safeMergeAABB.apply(e,m([e.mergeDirtyAABBs(e.renderQueue.filter((function(t){return t.nodeName!==g.Shape.GROUP})))],y(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,o=t.maxY,a=new g.AABB;return a.setMinMax(i.fromValues(n,e,0),i.fromValues(r,o,0)),a}))),!1));if(e.removedRBushNodeAABBs=[],!a||g.AABB.isEmpty(a))return;var u=e.convertAABB2Rect(a),c=u.x,s=u.y,f=u.width,h=u.height;r.clearRect(c,s,f,h),r.beginPath(),r.rect(c,s,f,h),r.clip(),o=e.searchDirtyObjects(a)}o.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n&&n.isVisible()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(r,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){r.restore()})),e.restoreStack=[],e.clearFullScreen=!1,r.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):e.renderDisplayObject(n,t)}))},t.prototype.flush=function(t,n){if(this.batchedDisplayObject){var e=this.styleRendererFactory(this.batchedDisplayObject.nodeName);e&&(this.applyAttributesToContext(t,this.batchedDisplayObject,n),t.closePath(),e.render(t,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),t.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},t.prototype.renderDisplayObject=function(t,n){for(var e=this,r=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)r.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=t.nodeName,i=this.styleRendererFactory(a),u=!1;if(this.enableBatch&&i){var c=i.hash(t.attributes);this.batchedStyleHash&&c!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=c,this.batchedDisplayObject=t,u=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var s=t.style.clipPath;if(s){r.save(),this.applyTransform(r,s.getLocalTransform());var f=this.pathGeneratorFactory(s.nodeName);f&&this.useAnchor(r,s,(function(){r.beginPath(),f(r,s.parsedStyle),r.closePath()})),r.restore(),r.clip()}this.enableBatch||(r.save(),this.applyAttributesToContext(r,t,n)),this.useAnchor(r,t,(function(){var n=e.pathGeneratorFactory(t.nodeName);n&&(!u&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===g.Shape.LINE||t.nodeName===g.Shape.PATH||t.nodeName===g.Shape.POLYLINE||r.closePath()),i&&!e.enableBatch&&i.render(r,t.parsedStyle,t)})),this.enableBatch||r.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},t.prototype.convertAABB2Rect=function(t){var n=t.getMin(),e=t.getMax(),r=Math.floor(n[0]),o=Math.floor(n[1]);return{x:r,y:o,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-o}},t.prototype.mergeDirtyAABBs=function(t){var n=new g.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=y(t.getMin(),2),r=e[0],o=e[1],a=y(t.getMax(),2),i=a[0],u=a[1];return this.rBush.search({minX:r,minY:o,maxX:i,maxY:u}).map((function(t){var e=t.id;return n.displayObjectPool.getByEntity(e)}))},t.prototype.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new g.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=y(a.getTranslation(i.create(),n),2),r=e[0],o=e[1],c=y(a.getScaling(i.create(),n),2),s=c[0],f=c[1],h=a.getRotation(u.create(),n),l=y(Object(g.getEuler)(i.create(),h),3),d=l[0],p=(l[1],l[2]),v=Object(g.fromRotationTranslationScale)(d||p,r,o,s,f);t.transform(v[0],v[1],v[3],v[4],v[6],v[7])},t.prototype.getColor=function(t,n,e,r){var o;if(t.type===g.PARSED_COLOR_TYPE.LinearGradient||t.type===g.PARSED_COLOR_TYPE.RadialGradient){var a=n.getGeometryBounds(),i=a&&2*a.halfExtents[0]||0,u=a&&2*a.halfExtents[1]||0;o=this.gradientPool.getOrCreateGradient(d(d({type:t.type},t.value),{width:i,height:u}),e)}else if(t.type===g.PARSED_COLOR_TYPE.Pattern){var c=this.imagePool.getPatternSync(t.value);c?o=c:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}else o=t.formatted;return o},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,o=r.stroke,a=r.fill,i=r.opacity,u=r.lineDash,c=r.lineDashOffset,s=r.filter,f=r.shadowColor,h=r.shadowBlur,l=r.shadowOffsetX,d=r.shadowOffsetY;u&&L(u)&&t.setLineDash(u),T(c)||(t.lineDashOffset=c),T(i)||(t.globalAlpha*=i),T(o)||(t.strokeStyle=this.getColor(o,n,t,e)),T(a)||(t.fillStyle=this.getColor(a,n,t,e)),T(s)||(t.filter=n.style.filter),T(f)||(t.shadowColor=f.formatted,t.shadowBlur=h,t.shadowOffsetX=l,t.shadowOffsetY=d)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var o=r.halfExtents,a=(n.parsedStyle||{}).anchor,i=void 0===a?[0,0]:a;t.translate(-i[0]*o[0]*2,-i[1]*o[1]*2),e()}else e()},t.prototype.safeMergeAABB=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=new g.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRendererPlugin",p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),p([Object(M.inject)(g.DefaultCamera),v("design:type",g.Camera)],t.prototype,"camera",void 0),p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),p([Object(M.inject)($),v("design:type",$)],t.prototype,"imagePool",void 0),p([Object(M.inject)(U),v("design:type",U)],t.prototype,"gradientPool",void 0),p([Object(M.inject)(W),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)(A),v("design:type",Function)],t.prototype,"styleRendererFactory",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(so),v("design:type",C.a)],t.prototype,"rBush",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),ho=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,o=r.nodeName,a=r.attributes;if(o===g.Shape.IMAGE){var i=a.img;_(i)&&e.imagePool.getOrCreateImage(i).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var r=n.target,o=n.attrName,a=n.newValue;r.nodeName===g.Shape.IMAGE&&"img"===o&&_(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.ATTR_MODIFIED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.ATTR_MODIFIED,o)}))},t.tag="LoadImagePlugin",p([Object(M.inject)($),v("design:type",$)],t.prototype,"imagePool",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();g.globalContainer.register({token:{token:z,named:g.Shape.CIRCLE},useValue:function(t,n){var e=n.rInPixels;t.arc(e,e,e,0,2*Math.PI,!1)}}),g.globalContainer.register({token:{token:z,named:g.Shape.ELLIPSE},useValue:function(t,n){var e=n.rxInPixels,r=n.ryInPixels;if(t.ellipse)t.ellipse(e,r,e,r,0,0,2*Math.PI,!1);else{var o=e>r?e:r,a=e>r?1:e/r,i=e>r?r/e:1;t.save(),t.scale(a,i),t.arc(0,0,o,0,2*Math.PI)}}}),g.globalContainer.register({token:{token:z,named:g.Shape.RECT},useValue:function(t,n){var e=n.radius,r=void 0===e?0:e,o=n.widthInPixels,a=n.heightInPixels;if(0===r)t.rect(0,0,o,a);else{var i=y(function(t){var n=0,e=0,r=0,o=0;return L(t)?1===t.length?n=e=r=o=t[0]:2===t.length?(n=r=t[0],e=o=t[1]):3===t.length?(n=t[0],e=o=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],o=t[3]):n=e=r=o=t,[n,e,r,o]}(r),4),u=i[0],c=i[1],s=i[2],f=i[3];t.moveTo(u,0),t.lineTo(o-c,0),0!==c&&t.arc(o-c,c,c,-Math.PI/2,0),t.lineTo(o,a-s),0!==s&&t.arc(o-s,a-s,s,0,Math.PI/2),t.lineTo(f,a),0!==f&&t.arc(f,a-f,f,Math.PI/2,Math.PI),t.lineTo(0,u),0!==u&&t.arc(u,u,u,Math.PI,1.5*Math.PI)}}}),g.globalContainer.register({token:{token:z,named:g.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,o=n.x2,a=n.y2,i=n.defX,u=void 0===i?0:i,c=n.defY,s=void 0===c?0:c;t.moveTo(e-u,r-s),t.lineTo(o-u,a-s)}}),g.globalContainer.register({token:{token:z,named:g.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.points.points,u=i.length,c=i[0][0]-r,s=i[0][1]-a,f=i[u-1][0]-r,h=i[u-1][1]-a;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=i[l];t.lineTo(d[0]-r,d[1]-a)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:z,named:g.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.points.points,u=i.length,c=i[0][0]-r,s=i[0][1]-a,f=i[u-1][0]-r,h=i[u-1][1]-a;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=i[l];t.lineTo(d[0]-r,d[1]-a)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:z,named:g.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.path,u=i.curve,c=i.zCommandIndexes,s=u;c.forEach((function(t,n){s.splice(t+n,0,["Z"])}));for(var f=[-r,-a],h=0;h<s.length;h++){var l=s[h],d=l[0];switch(d){case"M":t.moveTo(l[1]-r,l[2]-a),f=[l[1]-r,l[2]-a];break;case"C":t.bezierCurveTo(l[1]-r,l[2]-a,l[3]-r,l[4]-a,l[5]-r,l[6]-a);break;case"Z":t.closePath()}if("Z"===d)f;else{var p=l.length;[l[p-2]-r,l[p-1]-a]}}}}),g.globalContainer.register({token:W,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(z,e)&&(n[e]=t.container.getNamed(z,e)),n[e]}}});var lo=Object(M.Module)((function(t){t($),t({token:so,useValue:new C.a}),t(G),t(H),t(V),t({token:A,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(j,e)&&(n[e]=t.container.getNamed(j,e)),n[e]}}}),t(U),t(fo),t(ho)})),po=function(){function t(){}return t.prototype.init=function(t){t.load(lo,!0)},t.prototype.destroy=function(t){t.unload(lo)},t}(),vo=function(){function t(){var t=this;this.isHit=function(n,e,r){var o=t.pointInPathPickerFactory(n.nodeName);if(o){var u=a.invert(a.create(),r),c=i.transformMat4(i.create(),i.fromValues(e[0],e[1],0),u),s=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor,h=void 0===f?[0,0]:f;if(c[0]+=h[0]*s[0]*2,c[1]+=h[1]*s[1]*2,o(n,new g.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(),o=t.pathGeneratorFactory(n.nodeName);return o&&o(r,n.parsedStyle),r.isPointInPath(e.x,e.y)}}var n;return n=t,t.prototype.apply=function(t){var e=this;t.hooks.pick.tap(n.tag,(function(t){var n=t.position,r=n.x,o=n.y,u=i.fromValues(r,o,0),c=[],s=e.rBush.search({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1]}),f=s.map((function(t){return t.id}));return s.forEach((function(t){var n=t.id,r=e.displayObjectPool.getByEntity(n);if(r.isVisible()&&r.interactive){if(r.parentNode&&-1===f.indexOf(r.parentNode.entity))return;var o=r.style.clipPath||r,i=r.getWorldTransform();r.style.clipPath&&(i=a.multiply(a.create(),i,r.style.clipPath.getLocalTransform())),e.isHit(o,u,i)&&c.push(r)}})),c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})),t.picked=c[c.length-1]||null,t}))},t.tag="CanvasPickerPlugin",p([Object(M.inject)(g.SceneGraphService),v("design:type",Object)],t.prototype,"sceneGraphService",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(g.OffscreenCanvasCreator),v("design:type",g.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),p([Object(M.inject)(so),v("design:type",Function)],t.prototype,"rBush",void 0),p([Object(M.inject)(W),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)("PointInPathPicker"),v("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();function yo(t,n,e,r){var o=t-e,a=n-r;return Math.sqrt(o*o+a*a)}function mo(t,n){return Math.abs(t-n)<.001}function go(t,n){var e=Y(t),r=Y(n);return{x:e,y:r,width:D(t)-e,height:D(n)-r}}function Mo(t){return(t+2*Math.PI)%(2*Math.PI)}var bo={box:function(t,n,e,r){return go([t,e],[n,r])},length:function(t,n,e,r){return yo(t,n,e,r)},pointAt:function(t,n,e,r,o){return{x:(1-o)*t+o*e,y:(1-o)*n+o*r}},pointDistance:function(t,n,e,r,o,a){var i=(e-t)*(o-t)+(r-n)*(a-n);return i<0?yo(t,n,o,a):i>(e-t)*(e-t)+(r-n)*(r-n)?yo(e,r,o,a):this.pointToLine(t,n,e,r,o,a)},pointToLine:function(t,n,e,r,o,a){var i=[e-t,r-n];if(c.exactEquals(i,[0,0]))return Math.sqrt((o-t)*(o-t)+(a-n)*(a-n));var u=[-i[1],i[0]];c.normalize(u,u);var s=[o-t,a-n];return Math.abs(c.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function xo(t,n,e,r,o,a){var i=-1,u=1/0,c=[e,r],s=20;a&&a>200&&(s=a/10);for(var f=1/s,h=f/10,l=0;l<=s;l++){var d=l*f,p=[o.apply(null,t.concat([d])),o.apply(null,n.concat([d]))];(g=yo(c[0],c[1],p[0],p[1]))<u&&(i=d,u=g)}if(0===i)return{x:t[0],y:n[0]};if(1===i){var v=t.length;return{x:t[v-1],y:n[v-1]}}u=1/0;for(l=0;l<32&&!(h<1e-4);l++){var y=i-h,m=i+h,g=(p=[o.apply(null,t.concat([y])),o.apply(null,n.concat([y]))],yo(c[0],c[1],p[0],p[1]));if(y>=0&&g<u)i=y,u=g;else{var M=[o.apply(null,t.concat([m])),o.apply(null,n.concat([m]))],b=yo(c[0],c[1],M[0],M[1]);m<=1&&b<u?(i=m,u=b):h*=.5}}return{x:o.apply(null,t.concat([i])),y:o.apply(null,n.concat([i]))}}function Po(t,n,e,r){var o=1-r;return o*o*t+2*r*o*n+r*r*e}function Oo(t,n,e){var r=t+e-2*n;if(mo(r,0))return[.5];var o=(t-n)/r;return o<=1&&o>=0?[o]:[]}function Eo(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function So(t,n,e,r,o,a,i){var u=Po(t,e,o,i),c=Po(n,r,a,i),s=bo.pointAt(t,n,e,r,i),f=bo.pointAt(e,r,o,a,i);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,o,a]]}var Co={box:function(t,n,e,r,o,a){var i=Oo(t,e,o)[0],u=Oo(n,r,a)[0],c=[t,o],s=[n,a];return void 0!==i&&c.push(Po(t,e,o,i)),void 0!==u&&s.push(Po(n,r,a,u)),go(c,s)},length:function(t,n,e,r,o,a){return function t(n,e,r,o,a,i,u){if(0===u)return(yo(n,e,r,o)+yo(r,o,a,i)+yo(n,e,a,i))/2;var c=So(n,e,r,o,a,i,.5),s=c[0],f=c[1];return s.push(u-1),f.push(u-1),t.apply(null,s)+t.apply(null,f)}(t,n,e,r,o,a,3)},nearestPoint:function(t,n,e,r,o,a,i,u){return xo([t,e,o],[n,r,a],i,u,Po)},pointDistance:function(t,n,e,r,o,a,i,u){var c=this.nearestPoint(t,n,e,r,o,a,i,u);return yo(c.x,c.y,i,u)},interpolationAt:Po,pointAt:function(t,n,e,r,o,a,i){return{x:Po(t,e,o,i),y:Po(n,r,a,i)}},divide:function(t,n,e,r,o,a,i){return So(t,n,e,r,o,a,i)},tangentAngle:function(t,n,e,r,o,a,i){var u=Eo(t,e,o,i),c=Eo(n,r,a,i);return Mo(Math.atan2(c,u))}};function Ao(t,n,e,r,o){var a=1-o;return a*a*a*t+3*n*o*a*a+3*e*o*o*a+r*o*o*o}function jo(t,n,e,r,o){var a=1-o;return 3*(a*a*(n-t)+2*a*o*(e-n)+o*o*(r-e))}function Bo(t,n,e,r){var o,a,i,u=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,s=3*n-3*t,f=[];if(mo(u,0))mo(c,0)||(o=-s/c)>=0&&o<=1&&f.push(o);else{var h=c*c-4*u*s;mo(h,0)?f.push(-c/(2*u)):h>0&&(a=(-c-(i=Math.sqrt(h)))/(2*u),(o=(-c+i)/(2*u))>=0&&o<=1&&f.push(o),a>=0&&a<=1&&f.push(a))}return f}function wo(t,n,e,r,o,a,i,u,c){var s=Ao(t,e,o,i,c),f=Ao(n,r,a,u,c),h=bo.pointAt(t,n,e,r,c),l=bo.pointAt(e,r,o,a,c),d=bo.pointAt(o,a,i,u,c),p=bo.pointAt(h.x,h.y,l.x,l.y,c),v=bo.pointAt(l.x,l.y,d.x,d.y,c);return[[t,n,h.x,h.y,p.x,p.y,s,f],[s,f,v.x,v.y,d.x,d.y,i,u]]}function Ro(t,n,e,r,o,a,i,u,c){if(0===c)return function(t,n){for(var e=0,r=t.length,o=0;o<r;o++){e+=yo(t[o],n[o],t[(o+1)%r],n[(o+1)%r])}return e/2}([t,e,o,i],[n,r,a,u]);var s=wo(t,n,e,r,o,a,i,u,.5),f=m(m([],y(s[0]),!1),[c-1],!1),h=m(m([],y(s[1]),!1),[c-1],!1);return Ro.apply(null,f)+Ro.apply(null,h)}var To={extrema:Bo,box:function(t,n,e,r,o,a,i,u){for(var c=[t,i],s=[n,u],f=Bo(t,e,o,i),h=Bo(n,r,a,u),l=0;l<f.length;l++)c.push(Ao(t,e,o,i,f[l]));for(l=0;l<h.length;l++)s.push(Ao(n,r,a,u,h[l]));return go(c,s)},length:function(t,n,e,r,o,a,i,u){return Ro(t,n,e,r,o,a,i,u,3)},nearestPoint:function(t,n,e,r,o,a,i,u,c,s,f){return xo([t,e,o,i],[n,r,a,u],c,s,Ao,f)},pointDistance:function(t,n,e,r,o,a,i,u,c,s,f){var h=this.nearestPoint(t,n,e,r,o,a,i,u,c,s,f);return yo(h.x,h.y,c,s)},interpolationAt:Ao,pointAt:function(t,n,e,r,o,a,i,u,c){return{x:Ao(t,e,o,i,c),y:Ao(n,r,a,u,c)}},divide:function(t,n,e,r,o,a,i,u,c){return wo(t,n,e,r,o,a,i,u,c)},tangentAngle:function(t,n,e,r,o,a,i,u,c){var s=jo(t,e,o,i,c),f=jo(n,r,a,u,c);return Mo(Math.atan2(f,s))}};function Lo(t,n,e,r){var o=t-e,a=n-r;return Math.sqrt(o*o+a*a)}function ko(t,n,e,r,o,a){return o>=t&&o<=t+e&&a>=n&&a<=n+r}function Io(t,n,e,r,o,a,i,u){var c=(Math.atan2(u-n,i-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>o)return!1;var s={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return Lo(s.x,s.y,i,u)<=a/2}function Do(t,n,e,r,o,a,i){var u=Math.min(t,e),c=Math.max(t,e),s=Math.min(n,r),f=Math.max(n,r),h=o/2;return a>=u-h&&a<=c+h&&i>=s-h&&i<=f+h&&bo.pointToLine(t,n,e,r,a,i)<=o/2}function Yo(t,n,e,r,o){var a=t.length;if(a<2)return!1;for(var i=0;i<a-1;i++){if(Do(t[i][0],t[i][1],t[i+1][0],t[i+1][1],n,e,r))return!0}if(o){var u=t[0],c=t[a-1];if(Do(u[0],u[1],c[0],c[1],n,e,r))return!0}return!1}function No(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function _o(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}function Xo(t,n,e){var r=!1,o=t.length;if(o<=2)return!1;for(var a=0;a<o;a++){var i=t[a],u=t[(a+1)%o];if(_o(i,u,[n,e]))return!0;No(i[1]-e)>0!=No(u[1]-e)>0&&No(n-(e-i[1])*(i[0]-u[0])/(i[1]-u[1])-i[0])<0&&(r=!r)}return r}function qo(t,n,e){for(var r=!1,o=0;o<t.length;o++){if(r=Xo(t[o],n,e))break}return r}function Fo(t,n){var e=t.parsedStyle,r=e.rInPixels,o=e.fill,a=e.stroke,i=e.lineWidth,u=e.clipPathTargets,c=i.value/2,s=Lo(r,r,n.x,n.y),f=!!(null==u?void 0:u.length);return o&&a||f?s<=r+c:o?s<=r:!!a&&(s>=r-c&&s<=r+c)}function Go(t,n,e,r){return t/(e*e)+n/(r*r)}function $o(t,n){var e=n.x,r=n.y,o=t.parsedStyle,a=o.rxInPixels,i=o.ryInPixels,u=o.fill,c=o.stroke,s=o.lineWidth,f=o.clipPathTargets,h=!!(null==f?void 0:f.length),l=s.value/2,d=(e-a)*(e-a),p=(r-i)*(r-i);return u&&c||h?Go(d,p,a+l,i+l)<=1:u?Go(d,p,a,i)<=1:!!c&&(Go(d,p,a-l,i-l)>=1&&Go(d,p,a+l,i+l)<=1)}function Ho(t,n){var e=t.parsedStyle,r=e.x1,o=e.y1,a=e.x2,i=e.y2,u=e.lineWidth,c=e.defX,s=void 0===c?0:c,f=e.defY,h=void 0===f?0:f;return Do(r,o,a,i,u.value,n.x+s,n.y+h)}function Vo(t,n){var e=t.parsedStyle,r=e.stroke,o=e.lineWidth,a=e.points,i=e.defX,u=void 0===i?0:i,c=e.defY,s=void 0===c?0:c,f=e.clipPathTargets,h=!!(null==f?void 0:f.length);return!(!r&&!h||!o)&&Yo(a.points,o.value,n.x+u,n.y+s,!1)}function Uo(t,n,e){var r=t.parsedStyle,a=r.lineWidth,i=r.stroke,u=r.fill,s=r.defX,f=void 0===s?0:s,h=r.defY,l=void 0===h?0:h,d=r.clipPathTargets,p=r.path,v=p.segments,y=p.hasArc,m=p.polylines,g=p.polygons,M=p.totalLength,b=!!(null==d?void 0:d.length),x=!1;return(i||b)&&(x=function(t,n,e,r,a,i,u){for(var s=!1,f=n/2,h=0;h<t.length;h++){var l=t[h],d=l.currentPoint,p=l.params,v=l.prePoint,y=l.box;if(!y||ko(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(l.command){case"L":case"Z":s=Do(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=Co.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=To.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],p[5],p[6],e,r,a)<=n/2;break;case"A":var m=l.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,P=m.startAngle,O=m.endAngle,E=m.xRotation,S=b>x?b:x,C=b>x?1:b/x,A=b>x?x/b:1,j=o.fromTranslation(o.create(),[-g,-M]);o.multiply(j,o.fromRotation(o.create(),-E),j),o.multiply(j,o.fromScaling(o.create(),[1/C,1/A]),j);var B=c.fromValues(e,r);s=Io(0,0,S,P,O,n,(B=c.transformMat3(B,B,j))[0],B[1])}if(s)break}}return s}(v,a.value,n.x+f,n.y+l,M)),x||!u&&!b||(x=y?e(t,n):qo(g,n.x+f,n.y+l)||qo(m,n.x+f,n.y+l)),x}function Wo(t,n,e){var r=t.parsedStyle,o=r.radius,a=r.fill,i=r.stroke,u=r.lineWidth,c=r.width,s=r.height,f=r.clipPathTargets,h=!!(null==f?void 0:f.length),l=c.unit,d=c.value,p=s.unit,v=s.value,y=0,m=0;if(""!==l&&"px"!==l||(y=d),""!==p&&"px"!==p||(m=v),o){var g=!1;return(i||h)&&(g=function(t,n,e,r,o,a,i,u){return Do(t+o,n,t+e-o,n,a,i,u)||Do(t+e,n+o,t+e,n+r-o,a,i,u)||Do(t+e-o,n+r,t+o,n+r,a,i,u)||Do(t,n+r-o,t,n+o,a,i,u)||Io(t+e-o,n+o,o,1.5*Math.PI,2*Math.PI,a,i,u)||Io(t+e-o,n+r-o,o,0,.5*Math.PI,a,i,u)||Io(t+o,n+r-o,o,.5*Math.PI,Math.PI,a,i,u)||Io(t+o,n+o,o,Math.PI,1.5*Math.PI,a,i,u)}(0,0,y,m,o,u.value,n.x,n.y)),g||!a&&!h||(g=e(t,n)),g}var M=u.value/2;return a&&i||h?ko(0-M,0-M,y+M,m+M,n.x,n.y):a?ko(0,0,y,m,n.x,n.y):!!i&&function(t,n,e,r,o,a,i){var u=o/2;return ko(t-u,n-u,e,o,a,i)||ko(t+e-u,n-u,o,r,a,i)||ko(t+u,n+r-u,e,o,a,i)||ko(t-u,n+u,o,r,a,i)}(0,0,y,m,u.value,n.x,n.y)}function zo(t,n){var e=t.parsedStyle,r=e.stroke,o=e.fill,a=e.lineWidth,i=e.points,u=e.defX,c=void 0===u?0:u,s=e.defY,f=void 0===s?0:s,h=e.clipPathTargets,l=!!(null==h?void 0:h.length),d=!1;return(r||l)&&(d=Yo(i.points,a.value,n.x+c,n.y+f,!0)),d||!o&&!l||(d=Xo(i.points,n.x+c,n.y+f)),d}var Qo=Object(M.Module)((function(t){t({token:"PointInPathPicker",useFactory:function(t){return function(t){return t===g.Shape.CIRCLE?Fo:t===g.Shape.ELLIPSE?$o:t===g.Shape.RECT?Wo:t===g.Shape.LINE?Ho:t===g.Shape.POLYLINE?Vo:t===g.Shape.POLYGON?zo:t===g.Shape.PATH?Uo:t===g.Shape.IMAGE||t===g.Shape.TEXT?function(){return!0}:null}}}),t(vo)})),Zo=function(){function t(){}return t.prototype.init=function(t){t.load(Qo,!0)},t.prototype.destroy=function(t){t.unload(Qo)},t}(),Jo=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(t){var n=t.target;if(n.nodeName===g.Shape.HTML){var r=n.parsedStyle.innerHTML,o="g-html-"+n.entity,a=e.contextService.getDomElement().parentNode;if(a)if(!a.querySelector("#"+o)){var i=document.createElement("div");n.parsedStyle.$el=i,i.id=o,_(r)?i.innerHTML=r:i.appendChild(r),a.appendChild(i)}}},o=function(t){var n=t.target;if(n.nodeName===g.Shape.HTML){var r="g-html-"+n.entity,o=e.contextService.getDomElement().parentNode;if(o){var a=o.querySelector("#"+r);a&&o.removeChild(a)}}};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===g.Shape.HTML){var n="g-html-"+t.entity,r=e.contextService.getDomElement().parentNode;if(r){var o=r.querySelector("#"+n);e.updateCSSStyle(o,t.parsedStyle,t)}}}))},t.prototype.updateCSSStyle=function(t,n,e){var r=n.zIndex,o=void 0===r?0:r,a=n.visibility,i=void 0===a?"visible":a,u=n.opacity,c=void 0===u?1:u,s=n.fill,f=n.lineWidth,h=n.lineDash,l=n.stroke,d=n.anchor,p=n.width,v=n.height,y=n.style,m=void 0===y?"":y,M=n.className,b=void 0===M?"":M,x=0,P=0,O=p.unit,E=p.value,S=v.unit,C=v.value;""!==O&&"px"!==O||(x=E),""!==S&&"px"!==S||(P=C);var A={position:"absolute",top:0,left:0};if(A.width="".concat(x,"px"),A.height="".concat(P,"px"),A.transform="matrix3d(".concat(e.getWorldTransform().join(","),")"),d&&(A.transform+=" translate(".concat(100*d[0],"%, ").concat(100*d[0],"%)")),e.style.transformOrigin&&(A["transform-origin"]=e.style.transformOrigin),A["z-index"]=o,A.visibility=i,A.opacity=c,s){var j="";if(s.type===g.PARSED_COLOR_TYPE.Constant)j=s.formatted;else if(s.type===g.PARSED_COLOR_TYPE.LinearGradient){var B=s.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");j="linear-gradient(to right, ".concat(B,");")}else s.type===g.PARSED_COLOR_TYPE.RadialGradient||(s.type,g.PARSED_COLOR_TYPE.Pattern);A.background=j}A["border-width"]="".concat(f.value,"px"),l&&l.type===g.PARSED_COLOR_TYPE.Constant&&(A["border-color"]=l.formatted,A["border-style"]="solid"),h&&(A["border-style"]="dashed"),e.style.filter&&(A.filter=e.style.filter),b&&(Array.isArray(b)?b.forEach((function(n){t.classList.add(n)})):t.classList.add(b)),t.setAttribute("style",Object.keys(A).map((function(t){return"".concat(t,":").concat(A[t])})).join(";")+m)},t.tag="HTMLRenderingPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),Ko=Object(M.Module)((function(t){t(Jo)})),ta=function(){function t(){}return t.prototype.init=function(t){t.load(Ko,!0)},t.prototype.destroy=function(t){t.unload(Ko)},t}(),na="undefined"!=typeof window&&void 0!==window.document;var ea=function(){function t(){}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,e=t.canvas,r=t.devicePixelRatio;if(e)this.$canvas=e,n&&e.parentElement!==n&&n.appendChild(e),this.$container=e.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=_(n)?document.getElementById(n):n,this.$container)){var o=document.createElement("canvas");this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o}this.context=this.$canvas.getContext("2d");var a=r||na&&window.devicePixelRatio||1;a=a>=1?Math.ceil(a):1,this.dpr=a,this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,n){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,function(t,n,e){na&&t.style&&(t.style.width=n+"px",t.style.height=e+"px")}(this.$canvas,t,n);var e=this.getDPR();this.context.scale(e,e)}},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),t=p([Object(M.singleton)({token:g.ContextService})],t)}(),ra=Object(M.Module)((function(t){t(ea)})),oa=function(){function t(){}return t.prototype.init=function(t){t.load(ra,!0)},t.prototype.destroy=function(t){t.unload(ra)},t}(),aa=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new oa),e.registerPlugin(new po),e.registerPlugin(new E),e.registerPlugin(new Zo),e.registerPlugin(new ta),e}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}l(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n}(g.AbstractRenderer)}])}));
16
+ var l=function(t,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)};var d=function(){return(d=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function p(t,n,e,r){var o,a=arguments.length,i=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(i=(a<3?o(i):a>3?o(n,e,i):o(n,e))||i);return a>3&&i&&Object.defineProperty(n,e,i),i}function v(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}Object.create;function y(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,a=e.call(t),i=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i}function m(t,n,e){if(e||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var g=e(0),M=e(1),b=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){t.hooks.pointerMove.call(n)},o=function(n){t.hooks.pointerUp.call(n)},a=function(n){t.hooks.pointerDown.call(n)},i=function(n){t.hooks.pointerOver.call(n)},u=function(n){t.hooks.pointerOut.call(n)},c=function(n){t.hooks.pointerWheel.call(n)};t.hooks.init.tap(n.tag,(function(){var t=e.contextService.getDomElement();g.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",r,!0),t.addEventListener("pointerdown",a,!0),t.addEventListener("pointerleave",u,!0),t.addEventListener("pointerover",i,!0),globalThis.addEventListener("pointerup",o,!0)):(globalThis.document.addEventListener("mousemove",r,!0),t.addEventListener("mousedown",a,!0),t.addEventListener("mouseout",u,!0),t.addEventListener("mouseover",i,!0),globalThis.addEventListener("mouseup",o,!0)),g.supportsTouchEvents&&(t.addEventListener("touchstart",a,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",r,!0)),t.addEventListener("wheel",c,{passive:!0,capture:!0})})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();g.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",r,!0),t.removeEventListener("pointerdown",a,!0),t.removeEventListener("pointerleave",u,!0),t.removeEventListener("pointerover",i,!0),globalThis.removeEventListener("pointerup",o,!0)):(globalThis.document.removeEventListener("mousemove",r,!0),t.removeEventListener("mousedown",a,!0),t.removeEventListener("mouseout",u,!0),t.removeEventListener("mouseover",i,!0),globalThis.removeEventListener("mouseup",o,!0)),g.supportsTouchEvents&&(t.removeEventListener("touchstart",a,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",r,!0)),t.removeEventListener("wheel",c,!0)}))},t.tag="DOMInteractionPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),x=Object(M.Module)((function(t){t(b)})),P=function(){function t(){}return t.prototype.init=function(t){t.load(x,!0)},t.prototype.destroy=function(t){t.unload(x)},t}(),O=e(2),E=e.n(O),S=M.Syringe.defineToken("StyleRendererFactory"),C=M.Syringe.defineToken("StyleRenderer"),j={}.toString,A=function(t,n){return j.call(t)==="[object "+n+"]"},T=function(t){return A(t,"Function")},B=function(t){return null==t},R=function(t){return Array.isArray?Array.isArray(t):A(t,"Array")},w=function(t){var n=typeof t;return null!==t&&"object"===n||"function"===n};var L=function(t,n){if(t)if(R(t))for(var e=0,r=t.length;e<r&&!1!==n(t[e],e);e++);else if(w(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break};Object.keys;var k=function(t){if(R(t))return t.reduce((function(t,n){return Math.max(t,n)}),t[0])},I=function(t){if(R(t))return t.reduce((function(t,n){return Math.min(t,n)}),t[0])},D=Array.prototype,Y=(D.splice,D.indexOf,Array.prototype.splice,function(t){return A(t,"String")});Object.prototype.hasOwnProperty;var N=function(t){return A(t,"Number")};Number.isInteger&&Number.isInteger;Math.PI,parseInt,Math.PI;var _=Object.values?function(t){return Object.values(t)}:function(t){var n=[];return L(t,(function(e,r){T(t)&&"prototype"===r||n.push(e)})),n};Object.prototype;Object.prototype.hasOwnProperty;var X;Object.prototype.hasOwnProperty;(function(t,n){if(!T(t))throw new TypeError("Expected a function");var e=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var a=n?n.apply(this,r):r[0],i=e.cache;if(i.has(a))return i.get(a);var u=t.apply(this,r);return i.set(a,u),u};e.cache=new Map})((function(t,n){void 0===n&&(n={});var e=n.fontSize,r=n.fontFamily,o=n.fontWeight,a=n.fontStyle,i=n.fontVariant;return X||(X=document.createElement("canvas").getContext("2d")),X.font=[a,i,o,e+"px",r].join(" "),X.measureText(Y(t)?t:"").width}),(function(t,n){return void 0===n&&(n={}),function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var a=arguments[n],i=0,u=a.length;i<u;i++,o++)r[o]=a[i];return r}([t],_(n)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,n){var e=this.map[t];return void 0===e?n:e},t.prototype.set=function(t,n){this.map[t]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var q=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,o=n.fillOpacity,a=n.stroke,i=n.strokeOpacity,u=n.lineWidth,c=n.lineCap,s=n.lineJoin,f=n.shadowColor,h=n.filter,l=n.miterLimit;if(B(e)||(B(o)||1===o?t.fill():(t.globalAlpha=o,t.fill(),t.globalAlpha=r)),!B(a)&&u&&u.value>0){!B(i)&&1!==i&&(t.globalAlpha=i),t.lineWidth=u.value,B(l)||(t.miterLimit=l),B(c)||(t.lineCap=c),B(s)||(t.lineJoin=s);var d=void 0,p=void 0,v=void 0,y=!B(f),m=!B(h);y&&(d=t.shadowBlur,p=t.shadowColor,B(d)||(t.shadowColor="transparent",t.shadowBlur=0)),m&&(v=t.filter,!B(v)&&v.indexOf("drop-shadow")>-1&&(t.filter=v.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")),t.stroke(),y&&(t.shadowColor=p,t.shadowBlur=d),m&&(t.filter=v)}},t=p([Object(M.singleton)({token:[{token:C,named:g.Shape.CIRCLE},{token:C,named:g.Shape.ELLIPSE},{token:C,named:g.Shape.RECT},{token:C,named:g.Shape.LINE},{token:C,named:g.Shape.POLYLINE},{token:C,named:g.Shape.POLYGON},{token:C,named:g.Shape.PATH}]})],t)}(),F=function(){function t(){this.imageCache={},this.patternCache={}}return t.prototype.getImageSync=function(t){return this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var e=this.canvasConfig.createImage;return new Promise((function(r,o){var a;e?a=e():g.isBrowser&&(a=new window.Image),a&&(a.onload=function(){r(a)},a.onerror=function(t){o(t)},a.crossOrigin="Anonymous",a.src=t,n.imageCache[t]=a)}))},t.prototype.getPatternSync=function(t){var n=this.generatePatternKey(t);if(this.patternCache[n])return this.patternCache[n]},t.prototype.createPattern=function(t,n){var e=this;return this.getOrCreateImage(t.src).then((function(r){var o=e.generatePatternKey(t),a=n.createPattern(r,t.repetition);return a&&(e.patternCache[o]=a),e.patternCache[o]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),t=p([Object(M.singleton)()],t)}(),G=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.widthInPixels,o=n.heightInPixels,a=n.img,i=r,u=o;Y(a)?e=this.imagePool.getImageSync(a):(i||(i=a.width),u||(u=a.height),e=a),e&&t.drawImage(e,0,0,i,u)},p([Object(M.inject)(F),v("design:type",F)],t.prototype,"imagePool",void 0),t=p([Object(M.singleton)({token:{token:C,named:g.Shape.IMAGE}})],t)}(),$=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n.lineWidth,o=n.textAlign,a=n.textBaseline,i=n.lineJoin,u=n.miterLimit,c=void 0===u?0:u,s=n.letterSpacing,f=void 0===s?0:s,h=n.stroke,l=n.fill,d=n.fillOpacity,p=n.strokeOpacity,v=n.opacity,y=n.metrics,m=n.dx,g=n.dy,M=y.font,b=y.lines,x=y.height,P=y.lineHeight,O=y.lineMetrics;t.font=M,t.lineWidth=r.value,t.textAlign=o,t.textBaseline=a,t.lineJoin=i,t.miterLimit=c;var E=0;"middle"===a?E=-x/2-P/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?E=-x:"top"!==a&&"hanging"!==a||(E=-P);var S=0;m&&"px"===m.unit&&(S+=m.value),g&&"px"===g.unit&&(E+=g.value);for(var C=0;C<b.length;C++){var j=r.value/2+S;E+=P,!B(h)&&r&&r.value&&this.drawLetterSpacing(t,b[C],O[C],o,j,E,f,d,p,v,!0),B(l)||this.drawLetterSpacing(t,b[C],O[C],o,j,E,f,d,p,v)}},t.prototype.drawLetterSpacing=function(t,n,e,r,o,a,i,u,c,s,f){if(void 0===f&&(f=!1),0!==i){var h=t.textAlign;t.textAlign="left";var l=o;"center"===r?l=o-e.width/2:"right"!==r&&"end"!==r||(l=o-e.width);for(var d=Array.from(n),p=t.measureText(n).width,v=0,y=0;y<d.length;++y){var m=d[y];f?this.strokeText(t,m,l,a,c):this.fillText(t,m,l,a,u,s),l+=p-(v=t.measureText(n.substring(y+1)).width)+i,p=v}t.textAlign=h}else f?this.strokeText(t,n,o,a,c):this.fillText(t,n,o,a,u,s)},t.prototype.fillText=function(t,n,e,r,o,a){var i,u=!B(o)&&1!==o;u&&(i=t.globalAlpha,t.globalAlpha=o*a),t.fillText(n,e,r),u&&(t.globalAlpha=i)},t.prototype.strokeText=function(t,n,e,r,o){var a,i=!B(o)&&1!==o;i&&(a=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,e,r),i&&(t.globalAlpha=a)},p([Object(M.inject)(g.TextService),v("design:type",g.TextService)],t.prototype,"textService",void 0),t=p([Object(M.singleton)({token:{token:C,named:g.Shape.TEXT}})],t)}(),H=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,o=t.x0,a=t.y0,i=t.x1,u=t.y1,c=t.steps,s=t.width,f=t.height;if(this.gradientCache[e])return this.gradientCache[e];var h=null;if(r===g.PARSED_COLOR_TYPE.LinearGradient)h=n.createLinearGradient(o*s,a*f,i*s,u*f);else if(r===g.PARSED_COLOR_TYPE.RadialGradient){var l=Math.sqrt(s*s+f*f)/2;h=n.createRadialGradient(o*s,a*f,0,i*s,u*f,t.r1*l)}return h&&(c.forEach((function(t){var n=y(t,2),e=n[0],r=n[1];null==h||h.addColorStop(Number(e),r)})),this.gradientCache[e]=h),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,o=t.x1,a=t.y1,i=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(o,"-").concat(a,"-").concat(i||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=p([Object(M.singleton)()],t)}();var V="PathGeneratorFactory",U="PathGenerator",W=1e-6,z="undefined"!=typeof Float32Array?Float32Array:Array,Q=Math.random;Math.PI;function Z(){var t=new z(9);return z!=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 J(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function K(t){var n=new z(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n}function tt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function nt(t,n,e,r,o,a,i,u,c){var s=new z(9);return s[0]=t,s[1]=n,s[2]=e,s[3]=r,s[4]=o,s[5]=a,s[6]=i,s[7]=u,s[8]=c,s}function et(t,n,e,r,o,a,i,u,c,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=u,t[7]=c,t[8]=s,t}function rt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function ot(t,n){if(t===n){var e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function at(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=f*i-u*s,l=-f*a+u*c,d=s*a-i*c,p=e*h+r*l+o*d;return p?(p=1/p,t[0]=h*p,t[1]=(-f*r+o*s)*p,t[2]=(u*r-o*i)*p,t[3]=l*p,t[4]=(f*e-o*c)*p,t[5]=(-u*e+o*a)*p,t[6]=d*p,t[7]=(-s*e+r*c)*p,t[8]=(i*e-r*a)*p,t):null}function it(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8];return t[0]=i*f-u*s,t[1]=o*s-r*f,t[2]=r*u-o*i,t[3]=u*c-a*f,t[4]=e*f-o*c,t[5]=o*a-e*u,t[6]=a*s-i*c,t[7]=r*c-e*s,t[8]=e*i-r*a,t}function ut(t){var n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],c=t[7],s=t[8];return n*(s*a-i*c)+e*(-s*o+i*u)+r*(c*o-a*u)}function ct(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1],p=e[2],v=e[3],y=e[4],m=e[5],g=e[6],M=e[7],b=e[8];return t[0]=l*r+d*i+p*s,t[1]=l*o+d*u+p*f,t[2]=l*a+d*c+p*h,t[3]=v*r+y*i+m*s,t[4]=v*o+y*u+m*f,t[5]=v*a+y*c+m*h,t[6]=g*r+M*i+b*s,t[7]=g*o+M*u+b*f,t[8]=g*a+M*c+b*h,t}function st(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=c,t[6]=l*r+d*i+s,t[7]=l*o+d*u+f,t[8]=l*a+d*c+h,t}function ft(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=Math.sin(e),d=Math.cos(e);return t[0]=d*r+l*i,t[1]=d*o+l*u,t[2]=d*a+l*c,t[3]=d*i-l*r,t[4]=d*u-l*o,t[5]=d*c-l*a,t[6]=s,t[7]=f,t[8]=h,t}function ht(t,n,e){var r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function lt(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t}function dt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function pt(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function vt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t}function yt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,u=r+r,c=o+o,s=e*i,f=r*i,h=r*u,l=o*i,d=o*u,p=o*c,v=a*i,y=a*u,m=a*c;return t[0]=1-h-p,t[3]=f-m,t[6]=l+y,t[1]=f+m,t[4]=1-s-p,t[7]=d-v,t[2]=l-y,t[5]=d+v,t[8]=1-s-h,t}function mt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*i,M=e*c-o*i,b=e*s-a*i,x=r*c-o*u,P=r*s-a*u,O=o*s-a*c,E=f*v-h*p,S=f*y-l*p,C=f*m-d*p,j=h*y-l*v,A=h*m-d*v,T=l*m-d*y,B=g*T-M*A+b*j+x*C-P*S+O*E;return B?(B=1/B,t[0]=(u*T-c*A+s*j)*B,t[1]=(c*C-i*T-s*S)*B,t[2]=(i*A-u*C+s*E)*B,t[3]=(o*A-r*T-a*j)*B,t[4]=(e*T-o*C+a*S)*B,t[5]=(r*C-e*A-a*E)*B,t[6]=(v*O-y*P+m*x)*B,t[7]=(y*b-p*O-m*M)*B,t[8]=(p*P-v*b+m*g)*B,t):null}function gt(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Mt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function bt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function xt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t}function Pt(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}function Ot(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t}function Et(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t}function St(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}function Ct(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=n[0],l=n[1],d=n[2],p=n[3],v=n[4],y=n[5],m=n[6],g=n[7],M=n[8];return Math.abs(e-h)<=W*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-l)<=W*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-d)<=W*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=W*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(i-v)<=W*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(u-y)<=W*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=W*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(s-g)<=W*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-M)<=W*Math.max(1,Math.abs(f),Math.abs(M))}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var jt=ct,At=Pt;function Tt(){var t=new z(16);return z!=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 Bt(t){var n=new z(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Rt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function wt(t,n,e,r,o,a,i,u,c,s,f,h,l,d,p,v){var y=new z(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=o,y[5]=a,y[6]=i,y[7]=u,y[8]=c,y[9]=s,y[10]=f,y[11]=h,y[12]=l,y[13]=d,y[14]=p,y[15]=v,y}function Lt(t,n,e,r,o,a,i,u,c,s,f,h,l,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=u,t[7]=c,t[8]=s,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function kt(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 It(t,n){if(t===n){var e=n[1],r=n[2],o=n[3],a=n[6],i=n[7],u=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=e,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=a,t[11]=n[14],t[12]=o,t[13]=i,t[14]=u}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t}function Dt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*i,M=e*c-o*i,b=e*s-a*i,x=r*c-o*u,P=r*s-a*u,O=o*s-a*c,E=f*v-h*p,S=f*y-l*p,C=f*m-d*p,j=h*y-l*v,A=h*m-d*v,T=l*m-d*y,B=g*T-M*A+b*j+x*C-P*S+O*E;return B?(B=1/B,t[0]=(u*T-c*A+s*j)*B,t[1]=(o*A-r*T-a*j)*B,t[2]=(v*O-y*P+m*x)*B,t[3]=(l*P-h*O-d*x)*B,t[4]=(c*C-i*T-s*S)*B,t[5]=(e*T-o*C+a*S)*B,t[6]=(y*b-p*O-m*M)*B,t[7]=(f*O-l*b+d*M)*B,t[8]=(i*A-u*C+s*E)*B,t[9]=(r*C-e*A-a*E)*B,t[10]=(p*P-v*b+m*g)*B,t[11]=(h*b-f*P-d*g)*B,t[12]=(u*S-i*j-c*E)*B,t[13]=(e*j-r*S+o*E)*B,t[14]=(v*M-p*x-y*g)*B,t[15]=(f*x-h*M+l*g)*B,t):null}function Yt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(l*m-d*y)-h*(c*m-s*y)+v*(c*d-s*l),t[1]=-(r*(l*m-d*y)-h*(o*m-a*y)+v*(o*d-a*l)),t[2]=r*(c*m-s*y)-u*(o*m-a*y)+v*(o*s-a*c),t[3]=-(r*(c*d-s*l)-u*(o*d-a*l)+h*(o*s-a*c)),t[4]=-(i*(l*m-d*y)-f*(c*m-s*y)+p*(c*d-s*l)),t[5]=e*(l*m-d*y)-f*(o*m-a*y)+p*(o*d-a*l),t[6]=-(e*(c*m-s*y)-i*(o*m-a*y)+p*(o*s-a*c)),t[7]=e*(c*d-s*l)-i*(o*d-a*l)+f*(o*s-a*c),t[8]=i*(h*m-d*v)-f*(u*m-s*v)+p*(u*d-s*h),t[9]=-(e*(h*m-d*v)-f*(r*m-a*v)+p*(r*d-a*h)),t[10]=e*(u*m-s*v)-i*(r*m-a*v)+p*(r*s-a*u),t[11]=-(e*(u*d-s*h)-i*(r*d-a*h)+f*(r*s-a*u)),t[12]=-(i*(h*y-l*v)-f*(u*y-c*v)+p*(u*l-c*h)),t[13]=e*(h*y-l*v)-f*(r*y-o*v)+p*(r*l-o*h),t[14]=-(e*(u*y-c*v)-i*(r*y-o*v)+p*(r*c-o*u)),t[15]=e*(u*l-c*h)-i*(r*l-o*h)+f*(r*c-o*u),t}function Nt(t){var n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],c=t[7],s=t[8],f=t[9],h=t[10],l=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*i-e*a)*(h*y-l*v)-(n*u-r*a)*(f*y-l*p)+(n*c-o*a)*(f*v-h*p)+(e*u-r*i)*(s*y-l*d)-(e*c-o*i)*(s*v-h*d)+(r*c-o*u)*(s*p-f*d)}function _t(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=n[9],d=n[10],p=n[11],v=n[12],y=n[13],m=n[14],g=n[15],M=e[0],b=e[1],x=e[2],P=e[3];return t[0]=M*r+b*u+x*h+P*v,t[1]=M*o+b*c+x*l+P*y,t[2]=M*a+b*s+x*d+P*m,t[3]=M*i+b*f+x*p+P*g,M=e[4],b=e[5],x=e[6],P=e[7],t[4]=M*r+b*u+x*h+P*v,t[5]=M*o+b*c+x*l+P*y,t[6]=M*a+b*s+x*d+P*m,t[7]=M*i+b*f+x*p+P*g,M=e[8],b=e[9],x=e[10],P=e[11],t[8]=M*r+b*u+x*h+P*v,t[9]=M*o+b*c+x*l+P*y,t[10]=M*a+b*s+x*d+P*m,t[11]=M*i+b*f+x*p+P*g,M=e[12],b=e[13],x=e[14],P=e[15],t[12]=M*r+b*u+x*h+P*v,t[13]=M*o+b*c+x*l+P*y,t[14]=M*a+b*s+x*d+P*m,t[15]=M*i+b*f+x*p+P*g,t}function Xt(t,n,e){var r,o,a,i,u,c,s,f,h,l,d,p,v=e[0],y=e[1],m=e[2];return n===t?(t[12]=n[0]*v+n[4]*y+n[8]*m+n[12],t[13]=n[1]*v+n[5]*y+n[9]*m+n[13],t[14]=n[2]*v+n[6]*y+n[10]*m+n[14],t[15]=n[3]*v+n[7]*y+n[11]*m+n[15]):(r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=n[9],d=n[10],p=n[11],t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=c,t[6]=s,t[7]=f,t[8]=h,t[9]=l,t[10]=d,t[11]=p,t[12]=r*v+u*y+h*m+n[12],t[13]=o*v+c*y+l*m+n[13],t[14]=a*v+s*y+d*m+n[14],t[15]=i*v+f*y+p*m+n[15]),t}function qt(t,n,e){var r=e[0],o=e[1],a=e[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function Ft(t,n,e,r){var o,a,i,u,c,s,f,h,l,d,p,v,y,m,g,M,b,x,P,O,E,S,C,j,A=r[0],T=r[1],B=r[2],R=Math.hypot(A,T,B);return R<W?null:(A*=R=1/R,T*=R,B*=R,o=Math.sin(e),i=1-(a=Math.cos(e)),u=n[0],c=n[1],s=n[2],f=n[3],h=n[4],l=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=A*A*i+a,b=T*A*i+B*o,x=B*A*i-T*o,P=A*T*i-B*o,O=T*T*i+a,E=B*T*i+A*o,S=A*B*i+T*o,C=T*B*i-A*o,j=B*B*i+a,t[0]=u*M+h*b+v*x,t[1]=c*M+l*b+y*x,t[2]=s*M+d*b+m*x,t[3]=f*M+p*b+g*x,t[4]=u*P+h*O+v*E,t[5]=c*P+l*O+y*E,t[6]=s*P+d*O+m*E,t[7]=f*P+p*O+g*E,t[8]=u*S+h*C+v*j,t[9]=c*S+l*C+y*j,t[10]=s*S+d*C+m*j,t[11]=f*S+p*C+g*j,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function Gt(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[4],i=n[5],u=n[6],c=n[7],s=n[8],f=n[9],h=n[10],l=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=a*o+s*r,t[5]=i*o+f*r,t[6]=u*o+h*r,t[7]=c*o+l*r,t[8]=s*o-a*r,t[9]=f*o-i*r,t[10]=h*o-u*r,t[11]=l*o-c*r,t}function $t(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[0],i=n[1],u=n[2],c=n[3],s=n[8],f=n[9],h=n[10],l=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=a*o-s*r,t[1]=i*o-f*r,t[2]=u*o-h*r,t[3]=c*o-l*r,t[8]=a*r+s*o,t[9]=i*r+f*o,t[10]=u*r+h*o,t[11]=c*r+l*o,t}function Ht(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[0],i=n[1],u=n[2],c=n[3],s=n[4],f=n[5],h=n[6],l=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=a*o+s*r,t[1]=i*o+f*r,t[2]=u*o+h*r,t[3]=c*o+l*r,t[4]=s*o-a*r,t[5]=f*o-i*r,t[6]=h*o-u*r,t[7]=l*o-c*r,t}function Vt(t,n){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]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Ut(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Wt(t,n,e){var r,o,a,i=e[0],u=e[1],c=e[2],s=Math.hypot(i,u,c);return s<W?null:(i*=s=1/s,u*=s,c*=s,r=Math.sin(n),a=1-(o=Math.cos(n)),t[0]=i*i*a+o,t[1]=u*i*a+c*r,t[2]=c*i*a-u*r,t[3]=0,t[4]=i*u*a-c*r,t[5]=u*u*a+o,t[6]=c*u*a+i*r,t[7]=0,t[8]=i*c*a+u*r,t[9]=u*c*a-i*r,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function zt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=e,t[7]=0,t[8]=0,t[9]=-e,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Qt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-e,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=e,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Zt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=0,t[4]=-e,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}function Jt(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=r+r,c=o+o,s=a+a,f=r*u,h=r*c,l=r*s,d=o*c,p=o*s,v=a*s,y=i*u,m=i*c,g=i*s;return t[0]=1-(d+v),t[1]=h+g,t[2]=l-m,t[3]=0,t[4]=h-g,t[5]=1-(f+v),t[6]=p+y,t[7]=0,t[8]=l+m,t[9]=p-y,t[10]=1-(f+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Kt(t,n){var e=new z(3),r=-n[0],o=-n[1],a=-n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=r*r+o*o+a*a+i*i;return h>0?(e[0]=2*(u*i+f*r+c*a-s*o)/h,e[1]=2*(c*i+f*o+s*r-u*a)/h,e[2]=2*(s*i+f*a+u*o-c*r)/h):(e[0]=2*(u*i+f*r+c*a-s*o),e[1]=2*(c*i+f*o+s*r-u*a),e[2]=2*(s*i+f*a+u*o-c*r)),Jt(t,n,e),t}function tn(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function nn(t,n){var e=n[0],r=n[1],o=n[2],a=n[4],i=n[5],u=n[6],c=n[8],s=n[9],f=n[10];return t[0]=Math.hypot(e,r,o),t[1]=Math.hypot(a,i,u),t[2]=Math.hypot(c,s,f),t}function en(t,n){var e=new z(3);nn(e,n);var r=1/e[0],o=1/e[1],a=1/e[2],i=n[0]*r,u=n[1]*o,c=n[2]*a,s=n[4]*r,f=n[5]*o,h=n[6]*a,l=n[8]*r,d=n[9]*o,p=n[10]*a,v=i+f+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(h-d)/y,t[1]=(l-c)/y,t[2]=(u-s)/y):i>f&&i>p?(y=2*Math.sqrt(1+i-f-p),t[3]=(h-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(l+c)/y):f>p?(y=2*Math.sqrt(1+f-i-p),t[3]=(l-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(h+d)/y):(y=2*Math.sqrt(1+p-i-f),t[3]=(u-s)/y,t[0]=(l+c)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function rn(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=n[3],c=o+o,s=a+a,f=i+i,h=o*c,l=o*s,d=o*f,p=a*s,v=a*f,y=i*f,m=u*c,g=u*s,M=u*f,b=r[0],x=r[1],P=r[2];return t[0]=(1-(p+y))*b,t[1]=(l+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(l-M)*x,t[5]=(1-(h+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*P,t[9]=(v-m)*P,t[10]=(1-(h+p))*P,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function on(t,n,e,r,o){var a=n[0],i=n[1],u=n[2],c=n[3],s=a+a,f=i+i,h=u+u,l=a*s,d=a*f,p=a*h,v=i*f,y=i*h,m=u*h,g=c*s,M=c*f,b=c*h,x=r[0],P=r[1],O=r[2],E=o[0],S=o[1],C=o[2],j=(1-(v+m))*x,A=(d+b)*x,T=(p-M)*x,B=(d-b)*P,R=(1-(l+m))*P,w=(y+g)*P,L=(p+M)*O,k=(y-g)*O,I=(1-(l+v))*O;return t[0]=j,t[1]=A,t[2]=T,t[3]=0,t[4]=B,t[5]=R,t[6]=w,t[7]=0,t[8]=L,t[9]=k,t[10]=I,t[11]=0,t[12]=e[0]+E-(j*E+B*S+L*C),t[13]=e[1]+S-(A*E+R*S+k*C),t[14]=e[2]+C-(T*E+w*S+I*C),t[15]=1,t}function an(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,u=r+r,c=o+o,s=e*i,f=r*i,h=r*u,l=o*i,d=o*u,p=o*c,v=a*i,y=a*u,m=a*c;return t[0]=1-h-p,t[1]=f+m,t[2]=l-y,t[3]=0,t[4]=f-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=l+y,t[9]=d-v,t[10]=1-s-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function un(t,n,e,r,o,a,i){var u=1/(e-n),c=1/(o-r),s=1/(a-i);return t[0]=2*a*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(o+r)*c,t[10]=(i+a)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*a*2*s,t[15]=0,t}function cn(t,n,e,r,o){var a,i=1/Math.tan(n/2);return t[0]=i/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,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!=o&&o!==1/0?(a=1/(r-o),t[10]=(o+r)*a,t[14]=2*o*r*a):(t[10]=-1,t[14]=-2*r),t}var sn=cn;function fn(t,n,e,r,o){var a,i=1/Math.tan(n/2);return t[0]=i/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,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!=o&&o!==1/0?(a=1/(r-o),t[10]=o*a,t[14]=o*r*a):(t[10]=-1,t[14]=-r),t}function hn(t,n,e,r){var o=Math.tan(n.upDegrees*Math.PI/180),a=Math.tan(n.downDegrees*Math.PI/180),i=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(i+u),s=2/(o+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=-(i-u)*c*.5,t[9]=(o-a)*s*.5,t[10]=r/(e-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*e/(e-r),t[15]=0,t}function ln(t,n,e,r,o,a,i){var u=1/(n-e),c=1/(r-o),s=1/(a-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*s,t[11]=0,t[12]=(n+e)*u,t[13]=(o+r)*c,t[14]=(i+a)*s,t[15]=1,t}var dn=ln;function pn(t,n,e,r,o,a,i){var u=1/(n-e),c=1/(r-o),s=1/(a-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=s,t[11]=0,t[12]=(n+e)*u,t[13]=(o+r)*c,t[14]=a*s,t[15]=1,t}function vn(t,n,e,r){var o,a,i,u,c,s,f,h,l,d,p=n[0],v=n[1],y=n[2],m=r[0],g=r[1],M=r[2],b=e[0],x=e[1],P=e[2];return Math.abs(p-b)<W&&Math.abs(v-x)<W&&Math.abs(y-P)<W?kt(t):(f=p-b,h=v-x,l=y-P,o=g*(l*=d=1/Math.hypot(f,h,l))-M*(h*=d),a=M*(f*=d)-m*l,i=m*h-g*f,(d=Math.hypot(o,a,i))?(o*=d=1/d,a*=d,i*=d):(o=0,a=0,i=0),u=h*i-l*a,c=l*o-f*i,s=f*a-h*o,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=h,t[7]=0,t[8]=i,t[9]=s,t[10]=l,t[11]=0,t[12]=-(o*p+a*v+i*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+h*v+l*y),t[15]=1,t)}function yn(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=r[0],c=r[1],s=r[2],f=o-e[0],h=a-e[1],l=i-e[2],d=f*f+h*h+l*l;d>0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var p=c*l-s*h,v=s*f-u*l,y=u*h-c*f;return(d=p*p+v*v+y*y)>0&&(p*=d=1/Math.sqrt(d),v*=d,y*=d),t[0]=p,t[1]=v,t[2]=y,t[3]=0,t[4]=h*y-l*v,t[5]=l*p-f*y,t[6]=f*v-h*p,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=o,t[13]=a,t[14]=i,t[15]=1,t}function mn(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]+")"}function gn(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])}function Mn(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t[9]=n[9]+e[9],t[10]=n[10]+e[10],t[11]=n[11]+e[11],t[12]=n[12]+e[12],t[13]=n[13]+e[13],t[14]=n[14]+e[14],t[15]=n[15]+e[15],t}function bn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}function xn(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12]*e,t[13]=n[13]*e,t[14]=n[14]*e,t[15]=n[15]*e,t}function Pn(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t[9]=n[9]+e[9]*r,t[10]=n[10]+e[10]*r,t[11]=n[11]+e[11]*r,t[12]=n[12]+e[12]*r,t[13]=n[13]+e[13]*r,t[14]=n[14]+e[14]*r,t[15]=n[15]+e[15]*r,t}function On(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]}function En(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=t[9],l=t[10],d=t[11],p=t[12],v=t[13],y=t[14],m=t[15],g=n[0],M=n[1],b=n[2],x=n[3],P=n[4],O=n[5],E=n[6],S=n[7],C=n[8],j=n[9],A=n[10],T=n[11],B=n[12],R=n[13],w=n[14],L=n[15];return Math.abs(e-g)<=W*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=W*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(o-b)<=W*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=W*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(i-P)<=W*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(u-O)<=W*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(c-E)<=W*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(s-S)<=W*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(f-C)<=W*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-j)<=W*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(l-A)<=W*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(d-T)<=W*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-B)<=W*Math.max(1,Math.abs(p),Math.abs(B))&&Math.abs(v-R)<=W*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-w)<=W*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-L)<=W*Math.max(1,Math.abs(m),Math.abs(L))}var Sn=_t,Cn=bn;function jn(){var t=new z(3);return z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function An(t){var n=new z(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Tn(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Bn(t,n,e){var r=new z(3);return r[0]=t,r[1]=n,r[2]=e,r}function Rn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function wn(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function Ln(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function kn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function In(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Dn(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function Yn(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function Nn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function _n(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t}function Xn(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t}function qn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function Fn(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function Gn(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}function $n(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.hypot(e,r,o)}function Hn(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function Vn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function Un(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function Wn(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function zn(t,n){var e=n[0],r=n[1],o=n[2],a=e*e+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function Qn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Zn(t,n,e){var r=n[0],o=n[1],a=n[2],i=e[0],u=e[1],c=e[2];return t[0]=o*c-a*u,t[1]=a*i-r*c,t[2]=r*u-o*i,t}function Jn(t,n,e,r){var o=n[0],a=n[1],i=n[2];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t[2]=i+r*(e[2]-i),t}function Kn(t,n,e,r,o,a){var i=a*a,u=i*(2*a-3)+1,c=i*(a-2)+a,s=i*(a-1),f=i*(3-2*a);return t[0]=n[0]*u+e[0]*c+r[0]*s+o[0]*f,t[1]=n[1]*u+e[1]*c+r[1]*s+o[1]*f,t[2]=n[2]*u+e[2]*c+r[2]*s+o[2]*f,t}function te(t,n,e,r,o,a){var i=1-a,u=i*i,c=a*a,s=u*i,f=3*a*u,h=3*c*i,l=c*a;return t[0]=n[0]*s+e[0]*f+r[0]*h+o[0]*l,t[1]=n[1]*s+e[1]*f+r[1]*h+o[1]*l,t[2]=n[2]*s+e[2]*f+r[2]*h+o[2]*l,t}function ne(t,n){n=n||1;var e=2*Q()*Math.PI,r=2*Q()-1,o=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*o,t[1]=Math.sin(e)*o,t[2]=r*n,t}function ee(t,n,e){var r=n[0],o=n[1],a=n[2],i=e[3]*r+e[7]*o+e[11]*a+e[15];return i=i||1,t[0]=(e[0]*r+e[4]*o+e[8]*a+e[12])/i,t[1]=(e[1]*r+e[5]*o+e[9]*a+e[13])/i,t[2]=(e[2]*r+e[6]*o+e[10]*a+e[14])/i,t}function re(t,n,e){var r=n[0],o=n[1],a=n[2];return t[0]=r*e[0]+o*e[3]+a*e[6],t[1]=r*e[1]+o*e[4]+a*e[7],t[2]=r*e[2]+o*e[5]+a*e[8],t}function oe(t,n,e){var r=e[0],o=e[1],a=e[2],i=e[3],u=n[0],c=n[1],s=n[2],f=o*s-a*c,h=a*u-r*s,l=r*c-o*u,d=o*l-a*h,p=a*f-r*l,v=r*h-o*f,y=2*i;return f*=y,h*=y,l*=y,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=c+h+p,t[2]=s+l+v,t}function ae(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[0],a[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),a[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ie(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),a[1]=o[1],a[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ue(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),a[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),a[2]=o[2],t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ce(t,n){var e=t[0],r=t[1],o=t[2],a=n[0],i=n[1],u=n[2],c=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(a*a+i*i+u*u),s=c&&Qn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function se(t){return t[0]=0,t[1]=0,t[2]=0,t}function fe(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function he(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function le(t,n){var e=t[0],r=t[1],o=t[2],a=n[0],i=n[1],u=n[2];return Math.abs(e-a)<=W*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-i)<=W*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(o-u)<=W*Math.max(1,Math.abs(o),Math.abs(u))}var de,pe=kn,ve=In,ye=Dn,me=$n,ge=Hn,Me=Tn,be=Vn,xe=(de=jn(),function(t,n,e,r,o,a){var i,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,i=e;i<u;i+=n)de[0]=t[i],de[1]=t[i+1],de[2]=t[i+2],o(de,de,a),t[i]=de[0],t[i+1]=de[1],t[i+2]=de[2];return t});function Pe(t){var n=t[0],e=t[1],r=t[2],o=t[3];return Math.hypot(n,e,r,o)}function Oe(t){var n=t[0],e=t[1],r=t[2],o=t[3];return n*n+e*e+r*r+o*o}!function(){var t,n=(t=new z(4),z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Ee(){var t=new z(4);return z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Se(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ce(t,n,e){e*=.5;var r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function je(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>W?(t[0]=n[0]/r,t[1]=n[1]/r,t[2]=n[2]/r):(t[0]=1,t[1]=0,t[2]=0),e}function Ae(t,n){var e=rr(t,n);return Math.acos(2*e*e-1)}function Te(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=e[0],c=e[1],s=e[2],f=e[3];return t[0]=r*f+i*u+o*s-a*c,t[1]=o*f+i*c+a*u-r*s,t[2]=a*f+i*s+r*c-o*u,t[3]=i*f-r*u-o*c-a*s,t}function Be(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+i*u,t[1]=o*c+a*u,t[2]=a*c-o*u,t[3]=i*c-r*u,t}function Re(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-a*u,t[1]=o*c+i*u,t[2]=a*c+r*u,t[3]=i*c-o*u,t}function we(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=o*c-r*u,t[2]=a*c+i*u,t[3]=i*c-a*u,t}function Le(t,n){var e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t}function ke(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=Math.sqrt(e*e+r*r+o*o),u=Math.exp(a),c=i>0?u*Math.sin(i)/i:0;return t[0]=e*c,t[1]=r*c,t[2]=o*c,t[3]=u*Math.cos(i),t}function Ie(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=Math.sqrt(e*e+r*r+o*o),u=i>0?Math.atan2(i,a)/i:0;return t[0]=e*u,t[1]=r*u,t[2]=o*u,t[3]=.5*Math.log(e*e+r*r+o*o+a*a),t}function De(t,n,e){return Ie(t,n),er(t,t,e),ke(t,t),t}function Ye(t,n,e,r){var o,a,i,u,c,s=n[0],f=n[1],h=n[2],l=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(a=s*d+f*p+h*v+l*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),1-a>W?(o=Math.acos(a),i=Math.sin(o),u=Math.sin((1-r)*o)/i,c=Math.sin(r*o)/i):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*f+c*p,t[2]=u*h+c*v,t[3]=u*l+c*y,t}function Ne(t){var n=Q(),e=Q(),r=Q(),o=Math.sqrt(1-n),a=Math.sqrt(n);return t[0]=o*Math.sin(2*Math.PI*e),t[1]=o*Math.cos(2*Math.PI*e),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t}function _e(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e*e+r*r+o*o+a*a,u=i?1/i:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-o*u,t[3]=a*u,t}function Xe(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function qe(t,n){var e,r=n[0]+n[4]+n[8];if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{var o=0;n[4]>n[0]&&(o=1),n[8]>n[3*o+o]&&(o=2);var a=(o+1)%3,i=(o+2)%3;e=Math.sqrt(n[3*o+o]-n[3*a+a]-n[3*i+i]+1),t[o]=.5*e,e=.5/e,t[3]=(n[3*a+i]-n[3*i+a])*e,t[a]=(n[3*a+o]+n[3*o+a])*e,t[i]=(n[3*i+o]+n[3*o+i])*e}return t}function Fe(t,n,e,r){var o=.5*Math.PI/180;n*=o,e*=o,r*=o;var a=Math.sin(n),i=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),f=Math.cos(r);return t[0]=a*c*f-i*u*s,t[1]=i*u*f+a*c*s,t[2]=i*c*s-a*u*f,t[3]=i*c*f+a*u*s,t}function Ge(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var $e,He,Ve,Ue,We,ze,Qe=function(t){var n=new z(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},Ze=function(t,n,e,r){var o=new z(4);return o[0]=t,o[1]=n,o[2]=e,o[3]=r,o},Je=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},Ke=function(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t},tr=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t},nr=Te,er=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t},rr=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},or=function(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=n[3];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t[2]=i+r*(e[2]-i),t[3]=u+r*(e[3]-u),t},ar=Pe,ir=ar,ur=Oe,cr=ur,sr=function(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e*e+r*r+o*o+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=e*i,t[1]=r*i,t[2]=o*i,t[3]=a*i,t},fr=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},hr=function(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-i)<=W*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-u)<=W*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-c)<=W*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-s)<=W*Math.max(1,Math.abs(a),Math.abs(s))},lr=($e=jn(),He=Bn(1,0,0),Ve=Bn(0,1,0),function(t,n,e){var r=Qn(n,e);return r<-.999999?(Zn($e,He,n),Me($e)<1e-6&&Zn($e,Ve,n),zn($e,$e),Ce(t,$e,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Zn($e,n,e),t[0]=$e[0],t[1]=$e[1],t[2]=$e[2],t[3]=1+r,sr(t,t))}),dr=(Ue=Ee(),We=Ee(),function(t,n,e,r,o,a){return Ye(Ue,n,o,a),Ye(We,e,r,a),Ye(t,Ue,We,2*a*(1-a)),t}),pr=(ze=Z(),function(t,n,e,r){return ze[0]=e[0],ze[3]=e[1],ze[6]=e[2],ze[1]=r[0],ze[4]=r[1],ze[7]=r[2],ze[2]=-n[0],ze[5]=-n[1],ze[8]=-n[2],sr(t,qe(t,ze))});function vr(){var t=new z(2);return z!=Float32Array&&(t[0]=0,t[1]=0),t}function yr(t){var n=new z(2);return n[0]=t[0],n[1]=t[1],n}function mr(t,n){var e=new z(2);return e[0]=t,e[1]=n,e}function gr(t,n){return t[0]=n[0],t[1]=n[1],t}function Mr(t,n,e){return t[0]=n,t[1]=e,t}function br(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function xr(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function Pr(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function Or(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function Er(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function Sr(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function Cr(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function jr(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function Ar(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function Tr(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Br(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function Rr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function wr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Lr(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function kr(t){var n=t[0],e=t[1];return n*n+e*e}function Ir(t,n){return t[0]=-n[0],t[1]=-n[1],t}function Dr(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function Yr(t,n){var e=n[0],r=n[1],o=e*e+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t}function Nr(t,n){return t[0]*n[0]+t[1]*n[1]}function _r(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function Xr(t,n,e,r){var o=n[0],a=n[1];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t}function qr(t,n){n=n||1;var e=2*Q()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function Fr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o,t[1]=e[1]*r+e[3]*o,t}function Gr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o+e[4],t[1]=e[1]*r+e[3]*o+e[5],t}function $r(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[3]*o+e[6],t[1]=e[1]*r+e[4]*o+e[7],t}function Hr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[4]*o+e[12],t[1]=e[1]*r+e[5]*o+e[13],t}function Vr(t,n,e,r){var o=n[0]-e[0],a=n[1]-e[1],i=Math.sin(r),u=Math.cos(r);return t[0]=o*u-a*i+e[0],t[1]=o*i+a*u+e[1],t}function Ur(t,n){var e=t[0],r=t[1],o=n[0],a=n[1],i=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+a*a),u=i&&(e*o+r*a)/i;return Math.acos(Math.min(Math.max(u,-1),1))}function Wr(t){return t[0]=0,t[1]=0,t}function zr(t){return"vec2("+t[0]+", "+t[1]+")"}function Qr(t,n){return t[0]===n[0]&&t[1]===n[1]}function Zr(t,n){var e=t[0],r=t[1],o=n[0],a=n[1];return Math.abs(e-o)<=W*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-a)<=W*Math.max(1,Math.abs(r),Math.abs(a))}var Jr=Lr,Kr=xr,to=Pr,no=Or,eo=Rr,ro=wr,oo=kr,ao=function(){var t=vr();return function(n,e,r,o,a,i){var u,c;for(e||(e=2),r||(r=0),c=o?Math.min(o*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],a(t,t,i),n[u]=t[0],n[u+1]=t[1];return n}}(),io=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),uo="RBushRoot",co=function(){function t(){this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n;return n=t,t.prototype.syncRTree=function(){var t=this,n=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var o=e.getRenderBounds();if(o){var a=y(o.getMin(),2),i=a[0],u=a[1],c=y(o.getMax(),2),s=c[0],f=c[1];r.aabb={id:e.entity,minX:i,minY:u,maxX:s,maxY:f}}r.aabb&&n.push(r.aabb)})),this.rBush.load(n),this.toSync.clear()},t.prototype.pushToSync=function(t){var n=this;t.forEach((function(t){n.toSync.add(t)}))},t.prototype.apply=function(t){var e=this,r=function(t){t.target.rBushNode=new io,e.pushToSync(t.composedPath().slice(0,-2))},o=function(t){var n=t.target,r=n.rBushNode;r.aabb&&(e.rBush.remove(r.aabb),e.toSync.delete(n),e.removedRBushNodeAABBs.push(r.aabb))},a=function(t){var n,r=t.target;(null===(n=r.ownerDocument)||void 0===n?void 0:n.documentElement)===e.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){e.pushToSync([t])})),e.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.addEventListener(g.ElementEvent.BOUNDS_CHANGED,a)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.removeEventListener(g.ElementEvent.BOUNDS_CHANGED,a)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering;e.clearFullScreen=!n||e.renderingContext.renderReasons.has(g.RenderReason.CAMERA_CHANGED),t&&(t.save(),e.clearFullScreen&&t.clearRect(0,0,e.canvasConfig.width,e.canvasConfig.height),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){e.syncRTree();var n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering,o=n.enableDirtyRectangleRenderingDebug,a=e.contextService.getContext(),u=e.renderQueue;if(r){if(!e.clearFullScreen){var c=e.safeMergeAABB.apply(e,m([e.mergeDirtyAABBs(e.renderQueue.filter((function(t){return t.nodeName!==g.Shape.GROUP})))],y(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,o=t.maxY,a=new g.AABB;return a.setMinMax(i.fromValues(n,e,0),i.fromValues(r,o,0)),a}))),!1));if(e.removedRBushNodeAABBs=[],g.AABB.isEmpty(c))return;var s=e.convertAABB2Rect(c),f=s.x,h=s.y,l=s.width,d=s.height;a.clearRect(f,h,l,d),a.beginPath(),a.rect(f,h,l,d),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),a.strokeRect(f,h,l,d)),u=e.searchDirtyObjects(c)}u.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n&&n.isVisible()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(a,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){a.restore()})),e.restoreStack=[],e.clearFullScreen=!1,a.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):e.renderDisplayObject(n,t)}))},t.prototype.flush=function(t,n){if(this.batchedDisplayObject){var e=this.styleRendererFactory(this.batchedDisplayObject.nodeName);e&&(this.applyAttributesToContext(t,this.batchedDisplayObject,n),t.closePath(),e.render(t,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),t.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},t.prototype.renderDisplayObject=function(t,n){for(var e=this,r=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)r.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=t.nodeName,i=this.styleRendererFactory(a),u=!1;if(this.enableBatch&&i){var c=i.hash(t.attributes);this.batchedStyleHash&&c!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=c,this.batchedDisplayObject=t,u=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var s=t.style.clipPath;if(s){r.save(),this.applyTransform(r,s.getLocalTransform());var f=this.pathGeneratorFactory(s.nodeName);f&&this.useAnchor(r,s,(function(){r.beginPath(),f(r,s.parsedStyle),r.closePath()})),r.restore(),r.clip()}this.enableBatch||(r.save(),this.applyAttributesToContext(r,t,n)),this.useAnchor(r,t,(function(){var n=e.pathGeneratorFactory(t.nodeName);n&&(!u&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===g.Shape.LINE||t.nodeName===g.Shape.PATH||t.nodeName===g.Shape.POLYLINE||r.closePath()),i&&!e.enableBatch&&i.render(r,t.parsedStyle,t)})),this.enableBatch||r.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},t.prototype.convertAABB2Rect=function(t){var n=t.getMin(),e=t.getMax(),r=Math.floor(n[0]),o=Math.floor(n[1]);return{x:r,y:o,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-o}},t.prototype.mergeDirtyAABBs=function(t){var n=new g.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=y(t.getMin(),2),r=e[0],o=e[1],a=y(t.getMax(),2),i=a[0],u=a[1];return this.rBush.search({minX:r,minY:o,maxX:i,maxY:u}).map((function(t){var e=t.id;return n.displayObjectPool.getByEntity(e)}))},t.prototype.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new g.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=y(a.getTranslation(i.create(),n),2),r=e[0],o=e[1],c=y(a.getScaling(i.create(),n),2),s=c[0],f=c[1],h=a.getRotation(u.create(),n),l=y(Object(g.getEuler)(i.create(),h),3),d=l[0],p=(l[1],l[2]),v=Object(g.fromRotationTranslationScale)(d||p,r,o,s,f);t.transform(v[0],v[1],v[3],v[4],v[6],v[7])},t.prototype.getColor=function(t,n,e,r){var o;if(t.type===g.PARSED_COLOR_TYPE.LinearGradient||t.type===g.PARSED_COLOR_TYPE.RadialGradient){var a=n.getGeometryBounds(),i=a&&2*a.halfExtents[0]||0,u=a&&2*a.halfExtents[1]||0;o=this.gradientPool.getOrCreateGradient(d(d({type:t.type},t.value),{width:i,height:u}),e)}else if(t.type===g.PARSED_COLOR_TYPE.Pattern){var c=this.imagePool.getPatternSync(t.value);c?o=c:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}else o=t.formatted;return o},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,o=r.stroke,a=r.fill,i=r.opacity,u=r.lineDash,c=r.lineDashOffset,s=r.filter,f=r.shadowColor,h=r.shadowBlur,l=r.shadowOffsetX,d=r.shadowOffsetY;u&&R(u)&&t.setLineDash(u),B(c)||(t.lineDashOffset=c),B(i)||(t.globalAlpha*=i),B(o)||(t.strokeStyle=this.getColor(o,n,t,e)),B(a)||(t.fillStyle=this.getColor(a,n,t,e)),B(s)||(t.filter=n.style.filter),B(f)||(t.shadowColor=f.formatted,t.shadowBlur=h,t.shadowOffsetX=l,t.shadowOffsetY=d)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var o=r.halfExtents,a=(n.parsedStyle||{}).anchor,i=void 0===a?[0,0]:a;t.translate(-i[0]*o[0]*2,-i[1]*o[1]*2),e()}else e()},t.prototype.safeMergeAABB=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=new g.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRendererPlugin",p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),p([Object(M.inject)(g.DefaultCamera),v("design:type",g.Camera)],t.prototype,"camera",void 0),p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),p([Object(M.inject)(F),v("design:type",F)],t.prototype,"imagePool",void 0),p([Object(M.inject)(H),v("design:type",H)],t.prototype,"gradientPool",void 0),p([Object(M.inject)(V),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)(S),v("design:type",Function)],t.prototype,"styleRendererFactory",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(uo),v("design:type",E.a)],t.prototype,"rBush",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),so=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,o=r.nodeName,a=r.attributes;if(o===g.Shape.IMAGE){var i=a.img;Y(i)&&e.imagePool.getOrCreateImage(i).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var r=n.target,o=n.attrName,a=n.newValue;r.nodeName===g.Shape.IMAGE&&"img"===o&&Y(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.ATTR_MODIFIED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.ATTR_MODIFIED,o)}))},t.tag="LoadImagePlugin",p([Object(M.inject)(F),v("design:type",F)],t.prototype,"imagePool",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();g.globalContainer.register({token:{token:U,named:g.Shape.CIRCLE},useValue:function(t,n){var e=n.rInPixels;t.arc(e,e,e,0,2*Math.PI,!1)}}),g.globalContainer.register({token:{token:U,named:g.Shape.ELLIPSE},useValue:function(t,n){var e=n.rxInPixels,r=n.ryInPixels;if(t.ellipse)t.ellipse(e,r,e,r,0,0,2*Math.PI,!1);else{var o=e>r?e:r,a=e>r?1:e/r,i=e>r?r/e:1;t.save(),t.scale(a,i),t.arc(0,0,o,0,2*Math.PI)}}}),g.globalContainer.register({token:{token:U,named:g.Shape.RECT},useValue:function(t,n){var e=n.radius,r=void 0===e?0:e,o=n.widthInPixels,a=n.heightInPixels;if(0===r)t.rect(0,0,o,a);else{var i=y(function(t){var n=0,e=0,r=0,o=0;return R(t)?1===t.length?n=e=r=o=t[0]:2===t.length?(n=r=t[0],e=o=t[1]):3===t.length?(n=t[0],e=o=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],o=t[3]):n=e=r=o=t,[n,e,r,o]}(r),4),u=i[0],c=i[1],s=i[2],f=i[3];t.moveTo(u,0),t.lineTo(o-c,0),0!==c&&t.arc(o-c,c,c,-Math.PI/2,0),t.lineTo(o,a-s),0!==s&&t.arc(o-s,a-s,s,0,Math.PI/2),t.lineTo(f,a),0!==f&&t.arc(f,a-f,f,Math.PI/2,Math.PI),t.lineTo(0,u),0!==u&&t.arc(u,u,u,Math.PI,1.5*Math.PI)}}}),g.globalContainer.register({token:{token:U,named:g.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,o=n.x2,a=n.y2,i=n.defX,u=void 0===i?0:i,c=n.defY,s=void 0===c?0:c;t.moveTo(e-u,r-s),t.lineTo(o-u,a-s)}}),g.globalContainer.register({token:{token:U,named:g.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.points.points,u=i.length,c=i[0][0]-r,s=i[0][1]-a,f=i[u-1][0]-r,h=i[u-1][1]-a;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=i[l];t.lineTo(d[0]-r,d[1]-a)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:U,named:g.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.points.points,u=i.length,c=i[0][0]-r,s=i[0][1]-a,f=i[u-1][0]-r,h=i[u-1][1]-a;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=i[l];t.lineTo(d[0]-r,d[1]-a)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:U,named:g.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.path,u=i.curve,c=i.zCommandIndexes,s=u;c.forEach((function(t,n){s.splice(t+n,0,["Z"])}));for(var f=0;f<s.length;f++){var h=s[f];switch(h[0]){case"M":t.moveTo(h[1]-r,h[2]-a);break;case"C":t.bezierCurveTo(h[1]-r,h[2]-a,h[3]-r,h[4]-a,h[5]-r,h[6]-a);break;case"Z":t.closePath()}}}}),g.globalContainer.register({token:V,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(U,e)&&(n[e]=t.container.getNamed(U,e)),n[e]}}});var fo=Object(M.Module)((function(t){t(F),t({token:uo,useValue:new E.a}),t(q),t(G),t($),t({token:S,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(C,e)&&(n[e]=t.container.getNamed(C,e)),n[e]}}}),t(H),t(co),t(so)})),ho=function(){function t(){}return t.prototype.init=function(t){t.load(fo,!0)},t.prototype.destroy=function(t){t.unload(fo)},t}(),lo=function(){function t(){var t=this;this.isHit=function(n,e,r){var o=t.pointInPathPickerFactory(n.nodeName);if(o){var u=a.invert(a.create(),r),c=i.transformMat4(i.create(),i.fromValues(e[0],e[1],0),u),s=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor,h=void 0===f?[0,0]:f;if(c[0]+=h[0]*s[0]*2,c[1]+=h[1]*s[1]*2,o(n,new g.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(),o=t.pathGeneratorFactory(n.nodeName);return o&&o(r,n.parsedStyle),r.isPointInPath(e.x,e.y)}}var n;return n=t,t.prototype.apply=function(t){var e=this;t.hooks.pick.tap(n.tag,(function(t){var n=t.position,r=n.x,o=n.y,u=i.fromValues(r,o,0),c=[],s=e.rBush.search({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1]}),f=s.map((function(t){return t.id}));return s.forEach((function(t){var n=t.id,r=e.displayObjectPool.getByEntity(n);if(r.isVisible()&&r.interactive){if(r.parentNode&&-1===f.indexOf(r.parentNode.entity))return;var o=r.style.clipPath||r,i=r.getWorldTransform();r.style.clipPath&&(i=a.multiply(a.create(),i,r.style.clipPath.getLocalTransform())),e.isHit(o,u,i)&&c.push(r)}})),c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})),t.picked=c[c.length-1]||null,t}))},t.tag="CanvasPickerPlugin",p([Object(M.inject)(g.SceneGraphService),v("design:type",Object)],t.prototype,"sceneGraphService",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(g.OffscreenCanvasCreator),v("design:type",g.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),p([Object(M.inject)(uo),v("design:type",Function)],t.prototype,"rBush",void 0),p([Object(M.inject)(V),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)("PointInPathPicker"),v("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();function po(t,n,e,r){var o=t-e,a=n-r;return Math.sqrt(o*o+a*a)}function vo(t,n){return Math.abs(t-n)<.001}function yo(t,n){var e=I(t),r=I(n);return{x:e,y:r,width:k(t)-e,height:k(n)-r}}function mo(t){return(t+2*Math.PI)%(2*Math.PI)}var go={box:function(t,n,e,r){return yo([t,e],[n,r])},length:function(t,n,e,r){return po(t,n,e,r)},pointAt:function(t,n,e,r,o){return{x:(1-o)*t+o*e,y:(1-o)*n+o*r}},pointDistance:function(t,n,e,r,o,a){var i=(e-t)*(o-t)+(r-n)*(a-n);return i<0?po(t,n,o,a):i>(e-t)*(e-t)+(r-n)*(r-n)?po(e,r,o,a):this.pointToLine(t,n,e,r,o,a)},pointToLine:function(t,n,e,r,o,a){var i=[e-t,r-n];if(c.exactEquals(i,[0,0]))return Math.sqrt((o-t)*(o-t)+(a-n)*(a-n));var u=[-i[1],i[0]];c.normalize(u,u);var s=[o-t,a-n];return Math.abs(c.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function Mo(t,n,e,r,o,a){var i=-1,u=1/0,c=[e,r],s=20;a&&a>200&&(s=a/10);for(var f=1/s,h=f/10,l=0;l<=s;l++){var d=l*f,p=[o.apply(void 0,m([],y(t.concat([d])),!1)),o.apply(void 0,m([],y(n.concat([d])),!1))];(b=po(c[0],c[1],p[0],p[1]))<u&&(i=d,u=b)}if(0===i)return{x:t[0],y:n[0]};if(1===i){var v=t.length;return{x:t[v-1],y:n[v-1]}}u=1/0;for(l=0;l<32&&!(h<1e-4);l++){var g=i-h,M=i+h,b=(p=[o.apply(void 0,m([],y(t.concat([g])),!1)),o.apply(void 0,m([],y(n.concat([g])),!1))],po(c[0],c[1],p[0],p[1]));if(g>=0&&b<u)i=g,u=b;else{var x=[o.apply(void 0,m([],y(t.concat([M])),!1)),o.apply(void 0,m([],y(n.concat([M])),!1))],P=po(c[0],c[1],x[0],x[1]);M<=1&&P<u?(i=M,u=P):h*=.5}}return{x:o.apply(void 0,m([],y(t.concat([i])),!1)),y:o.apply(void 0,m([],y(n.concat([i])),!1))}}function bo(t,n,e,r){var o=1-r;return o*o*t+2*r*o*n+r*r*e}function xo(t,n,e){var r=t+e-2*n;if(vo(r,0))return[.5];var o=(t-n)/r;return o<=1&&o>=0?[o]:[]}function Po(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function Oo(t,n,e,r,o,a,i){var u=bo(t,e,o,i),c=bo(n,r,a,i),s=go.pointAt(t,n,e,r,i),f=go.pointAt(e,r,o,a,i);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,o,a]]}var Eo={box:function(t,n,e,r,o,a){var i=xo(t,e,o)[0],u=xo(n,r,a)[0],c=[t,o],s=[n,a];return void 0!==i&&c.push(bo(t,e,o,i)),void 0!==u&&s.push(bo(n,r,a,u)),yo(c,s)},length:function(t,n,e,r,o,a){return function t(n,e,r,o,a,i,u){if(0===u)return(po(n,e,r,o)+po(r,o,a,i)+po(n,e,a,i))/2;var c=Oo(n,e,r,o,a,i,.5),s=c[0],f=c[1];return s.push(u-1),f.push(u-1),t.apply(void 0,m([],y(s),!1))+t.apply(void 0,m([],y(f),!1))}(t,n,e,r,o,a,3)},nearestPoint:function(t,n,e,r,o,a,i,u){return Mo([t,e,o],[n,r,a],i,u,bo)},pointDistance:function(t,n,e,r,o,a,i,u){var c=this.nearestPoint(t,n,e,r,o,a,i,u);return po(c.x,c.y,i,u)},interpolationAt:bo,pointAt:function(t,n,e,r,o,a,i){return{x:bo(t,e,o,i),y:bo(n,r,a,i)}},divide:function(t,n,e,r,o,a,i){return Oo(t,n,e,r,o,a,i)},tangentAngle:function(t,n,e,r,o,a,i){var u=Po(t,e,o,i),c=Po(n,r,a,i);return mo(Math.atan2(c,u))}};function So(t,n,e,r,o){var a=1-o;return a*a*a*t+3*n*o*a*a+3*e*o*o*a+r*o*o*o}function Co(t,n,e,r,o){var a=1-o;return 3*(a*a*(n-t)+2*a*o*(e-n)+o*o*(r-e))}function jo(t,n,e,r){var o,a,i,u=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,s=3*n-3*t,f=[];if(vo(u,0))vo(c,0)||(o=-s/c)>=0&&o<=1&&f.push(o);else{var h=c*c-4*u*s;vo(h,0)?f.push(-c/(2*u)):h>0&&(a=(-c-(i=Math.sqrt(h)))/(2*u),(o=(-c+i)/(2*u))>=0&&o<=1&&f.push(o),a>=0&&a<=1&&f.push(a))}return f}function Ao(t,n,e,r,o,a,i,u,c){var s=So(t,e,o,i,c),f=So(n,r,a,u,c),h=go.pointAt(t,n,e,r,c),l=go.pointAt(e,r,o,a,c),d=go.pointAt(o,a,i,u,c),p=go.pointAt(h.x,h.y,l.x,l.y,c),v=go.pointAt(l.x,l.y,d.x,d.y,c);return[[t,n,h.x,h.y,p.x,p.y,s,f],[s,f,v.x,v.y,d.x,d.y,i,u]]}function To(t,n,e,r,o,a,i,u,c){if(0===c)return function(t,n){for(var e=0,r=t.length,o=0;o<r;o++){e+=po(t[o],n[o],t[(o+1)%r],n[(o+1)%r])}return e/2}([t,e,o,i],[n,r,a,u]);var s=Ao(t,n,e,r,o,a,i,u,.5),f=m(m([],y(s[0]),!1),[c-1],!1),h=m(m([],y(s[1]),!1),[c-1],!1);return To.apply(void 0,m([],y(f),!1))+To.apply(void 0,m([],y(h),!1))}var Bo={extrema:jo,box:function(t,n,e,r,o,a,i,u){for(var c=[t,i],s=[n,u],f=jo(t,e,o,i),h=jo(n,r,a,u),l=0;l<f.length;l++)c.push(So(t,e,o,i,f[l]));for(l=0;l<h.length;l++)s.push(So(n,r,a,u,h[l]));return yo(c,s)},length:function(t,n,e,r,o,a,i,u){return To(t,n,e,r,o,a,i,u,3)},nearestPoint:function(t,n,e,r,o,a,i,u,c,s,f){return Mo([t,e,o,i],[n,r,a,u],c,s,So,f)},pointDistance:function(t,n,e,r,o,a,i,u,c,s,f){var h=this.nearestPoint(t,n,e,r,o,a,i,u,c,s,f);return po(h.x,h.y,c,s)},interpolationAt:So,pointAt:function(t,n,e,r,o,a,i,u,c){return{x:So(t,e,o,i,c),y:So(n,r,a,u,c)}},divide:function(t,n,e,r,o,a,i,u,c){return Ao(t,n,e,r,o,a,i,u,c)},tangentAngle:function(t,n,e,r,o,a,i,u,c){var s=Co(t,e,o,i,c),f=Co(n,r,a,u,c);return mo(Math.atan2(f,s))}};function Ro(t,n,e,r){var o=t-e,a=n-r;return Math.sqrt(o*o+a*a)}function wo(t,n,e,r,o,a){return o>=t&&o<=t+e&&a>=n&&a<=n+r}function Lo(t,n,e,r,o,a,i,u){var c=(Math.atan2(u-n,i-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>o)return!1;var s={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return Ro(s.x,s.y,i,u)<=a/2}function ko(t,n,e,r,o,a,i){var u=Math.min(t,e),c=Math.max(t,e),s=Math.min(n,r),f=Math.max(n,r),h=o/2;return a>=u-h&&a<=c+h&&i>=s-h&&i<=f+h&&go.pointToLine(t,n,e,r,a,i)<=o/2}function Io(t,n,e,r,o){var a=t.length;if(a<2)return!1;for(var i=0;i<a-1;i++){if(ko(t[i][0],t[i][1],t[i+1][0],t[i+1][1],n,e,r))return!0}if(o){var u=t[0],c=t[a-1];if(ko(u[0],u[1],c[0],c[1],n,e,r))return!0}return!1}function Do(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Yo(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}function No(t,n,e){var r=!1,o=t.length;if(o<=2)return!1;for(var a=0;a<o;a++){var i=t[a],u=t[(a+1)%o];if(Yo(i,u,[n,e]))return!0;Do(i[1]-e)>0!=Do(u[1]-e)>0&&Do(n-(e-i[1])*(i[0]-u[0])/(i[1]-u[1])-i[0])<0&&(r=!r)}return r}function _o(t,n,e){for(var r=!1,o=0;o<t.length;o++){if(r=No(t[o],n,e))break}return r}function Xo(t,n){var e=t.parsedStyle,r=e.rInPixels,o=e.fill,a=e.stroke,i=e.lineWidth,u=e.clipPathTargets,c=i.value/2,s=Ro(r,r,n.x,n.y),f=!!(null==u?void 0:u.length);return o&&a||f?s<=r+c:o?s<=r:!!a&&(s>=r-c&&s<=r+c)}function qo(t,n,e,r){return t/(e*e)+n/(r*r)}function Fo(t,n){var e=n.x,r=n.y,o=t.parsedStyle,a=o.rxInPixels,i=o.ryInPixels,u=o.fill,c=o.stroke,s=o.lineWidth,f=o.clipPathTargets,h=!!(null==f?void 0:f.length),l=s.value/2,d=(e-a)*(e-a),p=(r-i)*(r-i);return u&&c||h?qo(d,p,a+l,i+l)<=1:u?qo(d,p,a,i)<=1:!!c&&(qo(d,p,a-l,i-l)>=1&&qo(d,p,a+l,i+l)<=1)}function Go(t,n){var e=t.parsedStyle,r=e.x1,o=e.y1,a=e.x2,i=e.y2,u=e.lineWidth,c=e.defX,s=void 0===c?0:c,f=e.defY,h=void 0===f?0:f;return ko(r,o,a,i,u.value,n.x+s,n.y+h)}function $o(t,n){var e=t.parsedStyle,r=e.stroke,o=e.lineWidth,a=e.points,i=e.defX,u=void 0===i?0:i,c=e.defY,s=void 0===c?0:c,f=e.clipPathTargets,h=!!(null==f?void 0:f.length);return!(!r&&!h||!o)&&Io(a.points,o.value,n.x+u,n.y+s,!1)}function Ho(t,n,e){var r=t.parsedStyle,a=r.lineWidth,i=r.stroke,u=r.fill,s=r.defX,f=void 0===s?0:s,h=r.defY,l=void 0===h?0:h,d=r.clipPathTargets,p=r.path,v=p.segments,y=p.hasArc,m=p.polylines,g=p.polygons,M=p.totalLength,b=!!(null==d?void 0:d.length),x=!1;return(i||b)&&(x=function(t,n,e,r,a,i,u){for(var s=!1,f=n/2,h=0;h<t.length;h++){var l=t[h],d=l.currentPoint,p=l.params,v=l.prePoint,y=l.box;if(!y||wo(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(l.command){case"L":case"Z":s=ko(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=Eo.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=Bo.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],p[5],p[6],e,r,a)<=n/2;break;case"A":var m=l.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,P=m.startAngle,O=m.endAngle,E=m.xRotation,S=b>x?b:x,C=b>x?1:b/x,j=b>x?x/b:1,A=o.fromTranslation(o.create(),[-g,-M]);o.multiply(A,o.fromRotation(o.create(),-E),A),o.multiply(A,o.fromScaling(o.create(),[1/C,1/j]),A);var T=c.fromValues(e,r);s=Lo(0,0,S,P,O,n,(T=c.transformMat3(T,T,A))[0],T[1])}if(s)break}}return s}(v,a.value,n.x+f,n.y+l,M)),x||!u&&!b||(x=y?e(t,n):_o(g,n.x+f,n.y+l)||_o(m,n.x+f,n.y+l)),x}function Vo(t,n,e){var r=t.parsedStyle,o=r.radius,a=r.fill,i=r.stroke,u=r.lineWidth,c=r.width,s=r.height,f=r.clipPathTargets,h=!!(null==f?void 0:f.length),l=c.unit,d=c.value,p=s.unit,v=s.value,y=0,m=0;if(""!==l&&"px"!==l||(y=d),""!==p&&"px"!==p||(m=v),o){var g=!1;return(i||h)&&(g=function(t,n,e,r,o,a,i,u){return ko(t+o,n,t+e-o,n,a,i,u)||ko(t+e,n+o,t+e,n+r-o,a,i,u)||ko(t+e-o,n+r,t+o,n+r,a,i,u)||ko(t,n+r-o,t,n+o,a,i,u)||Lo(t+e-o,n+o,o,1.5*Math.PI,2*Math.PI,a,i,u)||Lo(t+e-o,n+r-o,o,0,.5*Math.PI,a,i,u)||Lo(t+o,n+r-o,o,.5*Math.PI,Math.PI,a,i,u)||Lo(t+o,n+o,o,Math.PI,1.5*Math.PI,a,i,u)}(0,0,y,m,o,u.value,n.x,n.y)),g||!a&&!h||(g=e(t,n)),g}var M=u.value/2;return a&&i||h?wo(0-M,0-M,y+M,m+M,n.x,n.y):a?wo(0,0,y,m,n.x,n.y):!!i&&function(t,n,e,r,o,a,i){var u=o/2;return wo(t-u,n-u,e,o,a,i)||wo(t+e-u,n-u,o,r,a,i)||wo(t+u,n+r-u,e,o,a,i)||wo(t-u,n+u,o,r,a,i)}(0,0,y,m,u.value,n.x,n.y)}function Uo(t,n){var e=t.parsedStyle,r=e.stroke,o=e.fill,a=e.lineWidth,i=e.points,u=e.defX,c=void 0===u?0:u,s=e.defY,f=void 0===s?0:s,h=e.clipPathTargets,l=!!(null==h?void 0:h.length),d=!1;return(r||l)&&(d=Io(i.points,a.value,n.x+c,n.y+f,!0)),d||!o&&!l||(d=No(i.points,n.x+c,n.y+f)),d}var Wo=Object(M.Module)((function(t){t({token:"PointInPathPicker",useFactory:function(t){return function(t){return t===g.Shape.CIRCLE?Xo:t===g.Shape.ELLIPSE?Fo:t===g.Shape.RECT?Vo:t===g.Shape.LINE?Go:t===g.Shape.POLYLINE?$o:t===g.Shape.POLYGON?Uo:t===g.Shape.PATH?Ho:t===g.Shape.IMAGE||t===g.Shape.TEXT?function(){return!0}:null}}}),t(lo)})),zo=function(){function t(){}return t.prototype.init=function(t){t.load(Wo,!0)},t.prototype.destroy=function(t){t.unload(Wo)},t}(),Qo=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(t){var n=t.target;if(n.nodeName===g.Shape.HTML){var r=n.parsedStyle.innerHTML,o="g-html-"+n.entity,a=e.contextService.getDomElement().parentNode;if(a)if(!a.querySelector("#"+o)){var i=document.createElement("div");n.parsedStyle.$el=i,i.id=o,Y(r)?i.innerHTML=r:i.appendChild(r),a.appendChild(i)}}},o=function(t){var n=t.target;if(n.nodeName===g.Shape.HTML){var r="g-html-"+n.entity,o=e.contextService.getDomElement().parentNode;if(o){var a=o.querySelector("#"+r);a&&o.removeChild(a)}}};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===g.Shape.HTML){var n="g-html-"+t.entity,r=e.contextService.getDomElement().parentNode;if(r){var o=r.querySelector("#"+n);e.updateCSSStyle(o,t.parsedStyle,t)}}}))},t.prototype.updateCSSStyle=function(t,n,e){var r=n.zIndex,o=void 0===r?0:r,a=n.visibility,i=void 0===a?"visible":a,u=n.opacity,c=void 0===u?1:u,s=n.fill,f=n.lineWidth,h=n.lineDash,l=n.stroke,d=n.anchor,p=n.width,v=n.height,y=n.style,m=void 0===y?"":y,M=n.className,b=void 0===M?"":M,x=0,P=0,O=p.unit,E=p.value,S=v.unit,C=v.value;""!==O&&"px"!==O||(x=E),""!==S&&"px"!==S||(P=C);var j={position:"absolute",top:0,left:0};if(j.width="".concat(x,"px"),j.height="".concat(P,"px"),j.transform="matrix3d(".concat(e.getWorldTransform().join(","),")"),d&&(j.transform+=" translate(".concat(100*d[0],"%, ").concat(100*d[0],"%)")),e.style.transformOrigin&&(j["transform-origin"]=e.style.transformOrigin),j["z-index"]=o,j.visibility=i,j.opacity=c,s){var A="";if(s.type===g.PARSED_COLOR_TYPE.Constant)A=s.formatted;else if(s.type===g.PARSED_COLOR_TYPE.LinearGradient){var T=s.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");A="linear-gradient(to right, ".concat(T,");")}else s.type===g.PARSED_COLOR_TYPE.RadialGradient||(s.type,g.PARSED_COLOR_TYPE.Pattern);j.background=A}j["border-width"]="".concat(f.value,"px"),l&&l.type===g.PARSED_COLOR_TYPE.Constant&&(j["border-color"]=l.formatted,j["border-style"]="solid"),h&&(j["border-style"]="dashed"),e.style.filter&&(j.filter=e.style.filter),b&&(Array.isArray(b)?b.forEach((function(n){t.classList.add(n)})):t.classList.add(b)),t.setAttribute("style",Object.keys(j).map((function(t){return"".concat(t,":").concat(j[t])})).join(";")+m)},t.tag="HTMLRenderingPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),Zo=Object(M.Module)((function(t){t(Qo)})),Jo=function(){function t(){}return t.prototype.init=function(t){t.load(Zo,!0)},t.prototype.destroy=function(t){t.unload(Zo)},t}();var Ko=function(){function t(){}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,e=t.canvas,r=t.devicePixelRatio;if(e)this.$canvas=e,n&&e.parentElement!==n&&n.appendChild(e),this.$container=e.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=Y(n)?document.getElementById(n):n,this.$container)){var o=document.createElement("canvas");this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o}this.context=this.$canvas.getContext("2d");var a=r||g.isBrowser&&window.devicePixelRatio||1;a=a>=1?Math.ceil(a):1,this.dpr=a,this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,n){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,function(t,n,e){g.isBrowser&&t.style&&(t.style.width=n+"px",t.style.height=e+"px")}(this.$canvas,t,n);var e=this.getDPR();this.context.scale(e,e)}},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),t=p([Object(M.singleton)({token:g.ContextService})],t)}(),ta=Object(M.Module)((function(t){t(Ko)})),na=function(){function t(){}return t.prototype.init=function(t){t.load(ta,!0)},t.prototype.destroy=function(t){t.unload(ta)},t}(),ea=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new na),e.registerPlugin(new ho),e.registerPlugin(new P),e.registerPlugin(new zo),e.registerPlugin(new Jo),e}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}l(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n}(g.AbstractRenderer)}])}));
@@ -1,9 +1,8 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import { CanvasConfig, ContextService } from '@antv/g';
2
+ import { CanvasConfig, ContextService, isBrowser } from '@antv/g';
3
3
  import { inject, singleton } from 'mana-syringe';
4
4
  import { isString } from '@antv/util';
5
5
  import { setDOMSize } from './utils/dom';
6
- import { isBrowser } from './utils/browser';
7
6
 
8
7
  var Canvas2DContextService =
9
8
  /** @class */
@@ -1,5 +1,5 @@
1
- import { Syringe } from 'mana-syringe';
2
- import { RendererPlugin } from '@antv/g';
1
+ import type { Syringe } from 'mana-syringe';
2
+ import type { RendererPlugin } from '@antv/g';
3
3
  export declare class ContextRegisterPlugin implements RendererPlugin {
4
4
  init(container: Syringe.Container): void;
5
5
  destroy(container: Syringe.Container): void;
package/es/utils/dom.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isBrowser } from './browser';
1
+ import { isBrowser } from '@antv/g';
2
2
  var PX_SUFFIX = 'px';
3
3
  export function setDOMSize($el, width, height) {
4
4
  // @ts-ignore
@@ -15,8 +15,6 @@ var _util = require("@antv/util");
15
15
 
16
16
  var _dom = require("./utils/dom");
17
17
 
18
- var _browser = require("./utils/browser");
19
-
20
18
  var Canvas2DContextService =
21
19
  /** @class */
22
20
  function () {
@@ -56,7 +54,7 @@ function () {
56
54
 
57
55
  this.context = this.$canvas.getContext('2d'); // use user-defined dpr first
58
56
 
59
- var dpr = devicePixelRatio || _browser.isBrowser && window.devicePixelRatio || 1;
57
+ var dpr = devicePixelRatio || _g.isBrowser && window.devicePixelRatio || 1;
60
58
  dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
61
59
  this.dpr = dpr;
62
60
  this.resize(this.canvasConfig.width, this.canvasConfig.height);
@@ -1,5 +1,5 @@
1
- import { Syringe } from 'mana-syringe';
2
- import { RendererPlugin } from '@antv/g';
1
+ import type { Syringe } from 'mana-syringe';
2
+ import type { RendererPlugin } from '@antv/g';
3
3
  export declare class ContextRegisterPlugin implements RendererPlugin {
4
4
  init(container: Syringe.Container): void;
5
5
  destroy(container: Syringe.Container): void;
package/lib/utils/dom.js CHANGED
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setDOMSize = setDOMSize;
7
7
 
8
- var _browser = require("./browser");
8
+ var _g = require("@antv/g");
9
9
 
10
10
  var PX_SUFFIX = 'px';
11
11
 
12
12
  function setDOMSize($el, width, height) {
13
13
  // @ts-ignore
14
- if (_browser.isBrowser && $el.style) {
14
+ if (_g.isBrowser && $el.style) {
15
15
  // @ts-ignore
16
16
  $el.style.width = width + PX_SUFFIX; // @ts-ignore
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-canvas",
3
- "version": "1.0.15",
3
+ "version": "1.0.18",
4
4
  "description": "A renderer implemented by Canvas 2D API",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "homepage": "https://github.com/antvis/g#readme",
39
39
  "dependencies": {
40
- "@antv/g-plugin-canvas-picker": "^1.0.13",
41
- "@antv/g-plugin-canvas-renderer": "^1.0.13",
42
- "@antv/g-plugin-dom-interaction": "^1.0.13",
43
- "@antv/g-plugin-html-renderer": "^1.0.14",
40
+ "@antv/g-plugin-canvas-picker": "^1.0.16",
41
+ "@antv/g-plugin-canvas-renderer": "^1.0.16",
42
+ "@antv/g-plugin-dom-interaction": "^1.0.16",
43
+ "@antv/g-plugin-html-renderer": "^1.0.17",
44
44
  "@antv/util": "^2.0.13",
45
45
  "tslib": "^2.3.1"
46
46
  },
@@ -51,5 +51,5 @@
51
51
  "scripts": {
52
52
  "umd": "webpack"
53
53
  },
54
- "gitHead": "0c7b71ca68a0ada7e50c9eeec3c47f9b7de44f01"
54
+ "gitHead": "ac4d1b7ab482f8ff862c76fb6248ef92b4a8c22d"
55
55
  }
@@ -1 +0,0 @@
1
- export declare const isBrowser: boolean;
@@ -1 +0,0 @@
1
- export var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -1 +0,0 @@
1
- export declare const isBrowser: boolean;
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isBrowser = void 0;
7
- var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
8
- exports.isBrowser = isBrowser;