@antv/g-plugin-canvas-renderer
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,1 +0,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.CanvasRenderer=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.CanvasRenderer=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 a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.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 a in t)e.d(r,a,function(n){return t[n]}.bind(null,a));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=7)}([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,a,i,o){!function t(e,r,a,i,o){for(;i>a;){if(i-a>600){var u=i-a+1,c=r-a+1,s=Math.log(u),h=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*h*(u-h)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(a,Math.floor(r-c*h/u+l)),Math.min(i,Math.floor(r+(u-c)*h/u+l)),o)}var f=e[r],d=a,p=i;for(n(e,a,r),o(e[i],f)>0&&n(e,a,i);d<p;){for(n(e,d,p),d++,p--;o(e[d],f)<0;)d++;for(;o(e[p],f)>0;)p--}0===o(e[a],f)?n(e,a,p):n(e,++p,i),p<=r&&(a=p+1),r<=p&&(i=p-1)}}(t,r,a||0,i||t.length-1,o||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 a(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 i(t,n){o(t,0,t.children.length,n,t)}function o(t,n,e,r,a){a||(a=p(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var i=n;i<e;i++){var o=t.children[i];u(a,t.leaf?r(o):o)}return a}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 h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function l(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(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,a,i){for(var o=[e,r];o.length;)if(!((r=o.pop())-(e=o.pop())<=a)){var u=e+Math.ceil((r-e)/a/2)*a;t(n,u,e,r,i),o.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,a=[];n;){for(var i=0;i<n.children.length;i++){var o=n.children[i],u=n.leaf?r(o):o;d(t,u)&&(n.leaf?e.push(o):f(t,u)?this._all(o,e):a.push(o))}n=a.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 a=n.children[r],i=n.leaf?this.toBBox(a):a;if(d(t,i)){if(n.leaf||f(t,i))return!0;e.push(a)}}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,i,o=this.data,u=this.toBBox(t),c=[],s=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],e=s.pop(),i=!0),o.leaf){var h=a(t,o.children,n);if(-1!==h)return o.children.splice(h,1),c.push(o),this._condense(c),this}i||o.leaf||!f(o,u)?r?(e++,o=r.children[e],i=!1):o=null:(c.push(o),s.push(e),e=0,r=o,o=o.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 a,o=e-n+1,u=this._maxEntries;if(o<=u)return i(a=p(t.slice(n,e+1)),this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(u)),u=Math.ceil(o/Math.pow(u,r-1))),(a=p([])).leaf=!1,a.height=r;var c=Math.ceil(o/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var h=n;h<=e;h+=s){var l=Math.min(h+s-1,e);v(t,h,l,c,this.compareMinY);for(var f=h;f<=l;f+=c){var d=Math.min(f+c-1,l);a.children.push(this._build(t,f,d,r-1))}}return i(a,this.toBBox),a},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var a=1/0,i=1/0,o=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=h(c),l=(f=t,d=c,(Math.max(d.maxX,f.maxX)-Math.min(d.minX,f.minX))*(Math.max(d.maxY,f.maxY)-Math.min(d.minY,f.minY))-s);l<i?(i=l,a=s<a?s:a,o=c):l===i&&s<a&&(a=s,o=c)}n=o||n.children[0]}var f,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),a=[],i=this._chooseSubtree(r,this.data,n,a);for(i.children.push(t),u(i,r);n>=0&&a[n].children.length>this._maxEntries;)this._split(a,n),n--;this._adjustParentBBoxes(r,a,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,r);var o=this._chooseSplitIndex(e,a,r),u=p(e.children.splice(o,e.children.length-o));u.height=e.height,u.leaf=e.leaf,i(e,this.toBBox),i(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,i(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,a,i,u,c,s,l,f=1/0,d=1/0,p=n;p<=e-n;p++){var v=o(t,0,p,this.toBBox),y=o(t,p,e,this.toBBox),m=(a=v,i=y,u=Math.max(a.minX,i.minX),c=Math.max(a.minY,i.minY),s=Math.min(a.maxX,i.maxX),l=Math.min(a.maxY,i.maxY),Math.max(0,s-u)*Math.max(0,l-c)),g=h(v)+h(y);m<f?(f=m,r=p,d=g<d?g:d):m===f&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,a=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,a)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var a=this.toBBox,i=o(t,0,n,a),c=o(t,e-n,e,a),s=l(i)+l(c),h=n;h<e-n;h++){var f=t.children[h];u(i,t.leaf?a(f):f),s+=l(i)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?a(p):p),s+=l(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():i(t[n],this.toBBox)},r}()},,,,,function(t,n,e){"use strict";e.r(n),e.d(n,"PathGeneratorFactory",(function(){return G})),e.d(n,"PathGenerator",(function(){return q})),e.d(n,"RBushNode",(function(){return ke})),e.d(n,"RBushRoot",(function(){return Ne})),e.d(n,"RBush",(function(){return s.a})),e.d(n,"StyleRendererFactory",(function(){return h})),e.d(n,"CircleRendererContribution",(function(){return l})),e.d(n,"EllipseRendererContribution",(function(){return f})),e.d(n,"RectRendererContribution",(function(){return d})),e.d(n,"LineRendererContribution",(function(){return p})),e.d(n,"PolylineRendererContribution",(function(){return v})),e.d(n,"PolygonRendererContribution",(function(){return y})),e.d(n,"PathRendererContribution",(function(){return m})),e.d(n,"TextRendererContribution",(function(){return g})),e.d(n,"ImageRendererContribution",(function(){return M})),e.d(n,"ImageRenderer",(function(){return E})),e.d(n,"TextRenderer",(function(){return T})),e.d(n,"RectRenderer",(function(){return k})),e.d(n,"CircleRenderer",(function(){return N})),e.d(n,"EllipseRenderer",(function(){return Y})),e.d(n,"LineRenderer",(function(){return D})),e.d(n,"PolylineRenderer",(function(){return I})),e.d(n,"PolygonRenderer",(function(){return X})),e.d(n,"PathRenderer",(function(){return _})),e.d(n,"Plugin",(function(){return Xe}));var r={};e.r(r),e.d(r,"create",(function(){return U})),e.d(r,"clone",(function(){return Q})),e.d(r,"copy",(function(){return Z})),e.d(r,"fromValues",(function(){return z})),e.d(r,"set",(function(){return J})),e.d(r,"identity",(function(){return W})),e.d(r,"transpose",(function(){return K})),e.d(r,"invert",(function(){return $})),e.d(r,"adjoint",(function(){return tt})),e.d(r,"determinant",(function(){return nt})),e.d(r,"multiply",(function(){return et})),e.d(r,"translate",(function(){return rt})),e.d(r,"scale",(function(){return at})),e.d(r,"rotate",(function(){return it})),e.d(r,"rotateX",(function(){return ot})),e.d(r,"rotateY",(function(){return ut})),e.d(r,"rotateZ",(function(){return ct})),e.d(r,"fromTranslation",(function(){return st})),e.d(r,"fromScaling",(function(){return ht})),e.d(r,"fromRotation",(function(){return lt})),e.d(r,"fromXRotation",(function(){return ft})),e.d(r,"fromYRotation",(function(){return dt})),e.d(r,"fromZRotation",(function(){return pt})),e.d(r,"fromRotationTranslation",(function(){return vt})),e.d(r,"fromQuat2",(function(){return yt})),e.d(r,"getTranslation",(function(){return mt})),e.d(r,"getScaling",(function(){return gt})),e.d(r,"getRotation",(function(){return Mt})),e.d(r,"fromRotationTranslationScale",(function(){return bt})),e.d(r,"fromRotationTranslationScaleOrigin",(function(){return xt})),e.d(r,"fromQuat",(function(){return Ot})),e.d(r,"frustum",(function(){return St})),e.d(r,"perspectiveNO",(function(){return Ct})),e.d(r,"perspective",(function(){return jt})),e.d(r,"perspectiveZO",(function(){return Bt})),e.d(r,"perspectiveFromFieldOfView",(function(){return Rt})),e.d(r,"orthoNO",(function(){return Pt})),e.d(r,"ortho",(function(){return At})),e.d(r,"orthoZO",(function(){return Et})),e.d(r,"lookAt",(function(){return Tt})),e.d(r,"targetTo",(function(){return wt})),e.d(r,"str",(function(){return kt})),e.d(r,"frob",(function(){return Nt})),e.d(r,"add",(function(){return Yt})),e.d(r,"subtract",(function(){return Dt})),e.d(r,"multiplyScalar",(function(){return It})),e.d(r,"multiplyScalarAndAdd",(function(){return Xt})),e.d(r,"exactEquals",(function(){return _t})),e.d(r,"equals",(function(){return Lt})),e.d(r,"mul",(function(){return Gt})),e.d(r,"sub",(function(){return qt}));var a={};e.r(a),e.d(a,"create",(function(){return Ft})),e.d(a,"clone",(function(){return Vt})),e.d(a,"length",(function(){return Ht})),e.d(a,"fromValues",(function(){return Ut})),e.d(a,"copy",(function(){return Qt})),e.d(a,"set",(function(){return Zt})),e.d(a,"add",(function(){return zt})),e.d(a,"subtract",(function(){return Jt})),e.d(a,"multiply",(function(){return Wt})),e.d(a,"divide",(function(){return Kt})),e.d(a,"ceil",(function(){return $t})),e.d(a,"floor",(function(){return tn})),e.d(a,"min",(function(){return nn})),e.d(a,"max",(function(){return en})),e.d(a,"round",(function(){return rn})),e.d(a,"scale",(function(){return an})),e.d(a,"scaleAndAdd",(function(){return on})),e.d(a,"distance",(function(){return un})),e.d(a,"squaredDistance",(function(){return cn})),e.d(a,"squaredLength",(function(){return sn})),e.d(a,"negate",(function(){return hn})),e.d(a,"inverse",(function(){return ln})),e.d(a,"normalize",(function(){return fn})),e.d(a,"dot",(function(){return dn})),e.d(a,"cross",(function(){return pn})),e.d(a,"lerp",(function(){return vn})),e.d(a,"hermite",(function(){return yn})),e.d(a,"bezier",(function(){return mn})),e.d(a,"random",(function(){return gn})),e.d(a,"transformMat4",(function(){return Mn})),e.d(a,"transformMat3",(function(){return bn})),e.d(a,"transformQuat",(function(){return xn})),e.d(a,"rotateX",(function(){return On})),e.d(a,"rotateY",(function(){return Sn})),e.d(a,"rotateZ",(function(){return Cn})),e.d(a,"angle",(function(){return jn})),e.d(a,"zero",(function(){return Bn})),e.d(a,"str",(function(){return Rn})),e.d(a,"exactEquals",(function(){return Pn})),e.d(a,"equals",(function(){return An})),e.d(a,"sub",(function(){return Tn})),e.d(a,"mul",(function(){return wn})),e.d(a,"div",(function(){return kn})),e.d(a,"dist",(function(){return Nn})),e.d(a,"sqrDist",(function(){return Yn})),e.d(a,"len",(function(){return Dn})),e.d(a,"sqrLen",(function(){return In})),e.d(a,"forEach",(function(){return Xn}));var i={};e.r(i),e.d(i,"create",(function(){return Gn})),e.d(i,"identity",(function(){return qn})),e.d(i,"setAxisAngle",(function(){return Fn})),e.d(i,"getAxisAngle",(function(){return Vn})),e.d(i,"getAngle",(function(){return Hn})),e.d(i,"multiply",(function(){return Un})),e.d(i,"rotateX",(function(){return Qn})),e.d(i,"rotateY",(function(){return Zn})),e.d(i,"rotateZ",(function(){return zn})),e.d(i,"calculateW",(function(){return Jn})),e.d(i,"exp",(function(){return Wn})),e.d(i,"ln",(function(){return Kn})),e.d(i,"pow",(function(){return $n})),e.d(i,"slerp",(function(){return te})),e.d(i,"random",(function(){return ne})),e.d(i,"invert",(function(){return ee})),e.d(i,"conjugate",(function(){return re})),e.d(i,"fromMat3",(function(){return ae})),e.d(i,"fromEuler",(function(){return ie})),e.d(i,"str",(function(){return oe})),e.d(i,"clone",(function(){return pe})),e.d(i,"fromValues",(function(){return ve})),e.d(i,"copy",(function(){return ye})),e.d(i,"set",(function(){return me})),e.d(i,"add",(function(){return ge})),e.d(i,"mul",(function(){return Me})),e.d(i,"scale",(function(){return be})),e.d(i,"dot",(function(){return xe})),e.d(i,"lerp",(function(){return Oe})),e.d(i,"length",(function(){return Se})),e.d(i,"len",(function(){return Ce})),e.d(i,"squaredLength",(function(){return je})),e.d(i,"sqrLen",(function(){return Be})),e.d(i,"normalize",(function(){return Re})),e.d(i,"exactEquals",(function(){return Pe})),e.d(i,"equals",(function(){return Ae})),e.d(i,"rotationTo",(function(){return Ee})),e.d(i,"sqlerp",(function(){return Te})),e.d(i,"setAxes",(function(){return we}));var o=e(0),u=e(1),c=e(2),s=e.n(c),h=u.Syringe.defineToken("StyleRendererFactory"),l=u.Syringe.defineToken("CircleRenderer",{multiple:!1}),f=u.Syringe.defineToken("EllipseRenderer",{multiple:!1}),d=u.Syringe.defineToken("RectRenderer",{multiple:!1}),p=u.Syringe.defineToken("LineRenderer",{multiple:!1}),v=u.Syringe.defineToken("PolylineRenderer",{multiple:!1}),y=u.Syringe.defineToken("PolygonRenderer",{multiple:!1}),m=u.Syringe.defineToken("PathRenderer",{multiple:!1}),g=u.Syringe.defineToken("TextRenderer",{multiple:!1}),M=u.Syringe.defineToken("ImageRenderer",{multiple:!1}),b=function(t,n){return(b=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)};function x(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}b(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var O=function(){return(O=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var a in n=arguments[e])Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a]);return t}).apply(this,arguments)};function S(t,n,e,r){var a,i=arguments.length,o=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(o=(i<3?a(o):i>3?a(n,e,o):a(n,e))||o);return i>3&&o&&Object.defineProperty(n,e,o),o}function C(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function j(t,n,e,r){return new(e||(e=Promise))((function(a,i){function o(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var n;t.done?a(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,u)}c((r=r.apply(t,n||[])).next())}))}function B(t,n){var e,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=n.call(t,o)}catch(t){i=[6,t],r=0}finally{e=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}Object.create;function R(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,a,i=e.call(t),o=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(a)throw a.error}}return o}function P(t,n,e){if(e||2===arguments.length)for(var r,a=0,i=n.length;a<i;a++)!r&&a in n||(r||(r=Array.prototype.slice.call(n,0,a)),r[a]=n[a]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var A=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,a){var i;e?i=e(t):o.isBrowser&&(i=new window.Image),i&&(i.onload=function(){r(i)},i.onerror=function(t){a(t)},i.crossOrigin="Anonymous",i.src=t,n.imageCache[t]=i)}))},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 a=e.generatePatternKey(t),i=n.createPattern(r,t.repetition);return i&&(e.patternCache[a]=i),e.patternCache[a]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},S([Object(u.inject)(o.CanvasConfig),C("design:type",Object)],t.prototype,"canvasConfig",void 0),t=S([Object(u.singleton)()],t)}(),E=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.width,a=n.height,i=n.img,u=r.value,c=a.value;if(Object(o.isString)(i)?e=this.imagePool.getImageSync(i):(u||(u=i.width),c||(c=i.height),e=i),e)try{t.drawImage(e,0,0,u,c)}catch(t){}},S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),t=S([Object(u.singleton)({token:M})],t)}(),T=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n,a=r.lineWidth,i=r.textAlign,u=r.textBaseline,c=r.lineJoin,s=r.miterLimit,h=void 0===s?0:s,l=r.letterSpacing,f=void 0===l?0:l,d=r.stroke,p=r.fill,v=r.fillOpacity,y=r.strokeOpacity,m=r.opacity,g=r.metrics,M=r.dx,b=r.dy,x=g.font,O=g.lines,S=g.height,C=g.lineHeight,j=g.lineMetrics;t.font=x,t.lineWidth=a.value,t.textAlign=i.value,t.textBaseline=u.value,t.lineJoin=c.value,t.miterLimit=h;var B=0;"middle"===u.value?B=-S/2-C/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?B=-S:"top"!==u.value&&"hanging"!==u.value||(B=-C);var R=0;M&&M.unit===o.UnitType.kPixels&&(R+=M.value),b&&b.unit===o.UnitType.kPixels&&(B+=b.value);for(var P=0;P<O.length;P++){var A=a.value/2+R;B+=C,!Object(o.isNil)(d)&&a&&a.value&&this.drawLetterSpacing(t,O[P],j[P],i.value,A,B,f,v.value,y.value,m.value,!0),Object(o.isNil)(p)||this.drawLetterSpacing(t,O[P],j[P],i.value,A,B,f,v.value,y.value,m.value)}},t.prototype.drawLetterSpacing=function(t,n,e,r,a,i,o,u,c,s,h){if(void 0===h&&(h=!1),0!==o){var l=t.textAlign;t.textAlign="left";var f=a;"center"===r?f=a-e.width/2:"right"!==r&&"end"!==r||(f=a-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];h?this.strokeText(t,m,f,i,c):this.fillText(t,m,f,i,u,s),f+=p-(v=t.measureText(n.substring(y+1)).width)+o,p=v}t.textAlign=l}else h?this.strokeText(t,n,a,i,c):this.fillText(t,n,a,i,u,s)},t.prototype.fillText=function(t,n,e,r,a,i){var u,c=!Object(o.isNil)(a)&&1!==a;c&&(u=t.globalAlpha,t.globalAlpha=a*i),t.fillText(n,e,r),c&&(t.globalAlpha=u)},t.prototype.strokeText=function(t,n,e,r,a){var i,u=!Object(o.isNil)(a)&&1!==a;u&&(i=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,e,r),u&&(t.globalAlpha=i)},t=S([Object(u.singleton)({token:g})],t)}(),w=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,a=n.fillOpacity,i=n.stroke,u=n.strokeOpacity,c=n.lineWidth,s=n.lineCap,h=n.lineJoin,l=n.shadowColor,f=n.filter,d=n.miterLimit,p=!Object(o.isNil)(e),v=!Object(o.isNil)(i),y=0===e.alpha;if(p&&(Object(o.isNil)(a)||1===a.value?t.fill():(t.globalAlpha=a.value,t.fill(),t.globalAlpha=r.value)),v&&c&&c.value>0){!Object(o.isNil)(u)&&1!==u.value&&(t.globalAlpha=u.value),t.lineWidth=c.value,Object(o.isNil)(d)||(t.miterLimit=d),Object(o.isNil)(s)||(t.lineCap=s.value),Object(o.isNil)(h)||(t.lineJoin=h.value);var m=void 0,g=void 0,M=void 0,b=!Object(o.isNil)(l),x=!Object(o.isNil)(f);b&&(m=t.shadowBlur,g=t.shadowColor,Object(o.isNil)(m)||(t.shadowColor="transparent",t.shadowBlur=0)),x&&(M=t.filter,!Object(o.isNil)(M)&&M.indexOf("drop-shadow")>-1&&(t.filter=M.replace(/drop-shadow\([^)]*\)/,"").trim()||"none"));var O=p&&!y;O&&t.stroke(),b&&(t.shadowColor=g,t.shadowBlur=m),x&&(t.filter=M),O||t.stroke()}},t=S([Object(u.singleton)()],t)}(),k=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:d})],n)}(w),N=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:l})],n)}(w),Y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:f})],n)}(w),D=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:p})],n)}(w),I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:v})],n)}(w),X=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:y})],n)}(w),_=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:m})],n)}(w),L=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,a=t.x0,i=t.y0,u=t.x1,c=t.y1,s=t.steps,h=t.width,l=t.height;if(this.gradientCache[e])return this.gradientCache[e];var f=null;if(r===o.GradientPatternType.LinearGradient)f=n.createLinearGradient(a*h,i*l,u*h,c*l);else if(r===o.GradientPatternType.RadialGradient){var d=Math.sqrt(h*h+l*l)/2;f=n.createRadialGradient(a*h,i*l,0,u*h,c*l,t.r1*d)}return f&&(s.forEach((function(t){var n=R(t,2),e=n[0],r=n[1];null==f||f.addColorStop(Number(e),r)})),this.gradientCache[e]=f),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,a=t.x1,i=t.y1,o=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(a,"-").concat(i,"-").concat(o||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=S([Object(u.singleton)()],t)}();var G=u.Syringe.defineToken("PathGeneratorFactory"),q=u.Syringe.defineToken("PathGenerator"),F=1e-6,V="undefined"!=typeof Float32Array?Float32Array:Array,H=Math.random;Math.PI;function U(){var t=new V(16);return V!=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 Q(t){var n=new V(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 Z(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 z(t,n,e,r,a,i,o,u,c,s,h,l,f,d,p,v){var y=new V(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=a,y[5]=i,y[6]=o,y[7]=u,y[8]=c,y[9]=s,y[10]=h,y[11]=l,y[12]=f,y[13]=d,y[14]=p,y[15]=v,y}function J(t,n,e,r,a,i,o,u,c,s,h,l,f,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=a,t[4]=i,t[5]=o,t[6]=u,t[7]=c,t[8]=s,t[9]=h,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function W(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 K(t,n){if(t===n){var e=n[1],r=n[2],a=n[3],i=n[6],o=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]=i,t[11]=n[14],t[12]=a,t[13]=o,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 $(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=n[4],u=n[5],c=n[6],s=n[7],h=n[8],l=n[9],f=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*o,M=e*c-a*o,b=e*s-i*o,x=r*c-a*u,O=r*s-i*u,S=a*s-i*c,C=h*v-l*p,j=h*y-f*p,B=h*m-d*p,R=l*y-f*v,P=l*m-d*v,A=f*m-d*y,E=g*A-M*P+b*R+x*B-O*j+S*C;return E?(E=1/E,t[0]=(u*A-c*P+s*R)*E,t[1]=(a*P-r*A-i*R)*E,t[2]=(v*S-y*O+m*x)*E,t[3]=(f*O-l*S-d*x)*E,t[4]=(c*B-o*A-s*j)*E,t[5]=(e*A-a*B+i*j)*E,t[6]=(y*b-p*S-m*M)*E,t[7]=(h*S-f*b+d*M)*E,t[8]=(o*P-u*B+s*C)*E,t[9]=(r*B-e*P-i*C)*E,t[10]=(p*O-v*b+m*g)*E,t[11]=(l*b-h*O-d*g)*E,t[12]=(u*j-o*R-c*C)*E,t[13]=(e*R-r*j+a*C)*E,t[14]=(v*M-p*x-y*g)*E,t[15]=(h*x-l*M+f*g)*E,t):null}function tt(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=n[4],u=n[5],c=n[6],s=n[7],h=n[8],l=n[9],f=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(f*m-d*y)-l*(c*m-s*y)+v*(c*d-s*f),t[1]=-(r*(f*m-d*y)-l*(a*m-i*y)+v*(a*d-i*f)),t[2]=r*(c*m-s*y)-u*(a*m-i*y)+v*(a*s-i*c),t[3]=-(r*(c*d-s*f)-u*(a*d-i*f)+l*(a*s-i*c)),t[4]=-(o*(f*m-d*y)-h*(c*m-s*y)+p*(c*d-s*f)),t[5]=e*(f*m-d*y)-h*(a*m-i*y)+p*(a*d-i*f),t[6]=-(e*(c*m-s*y)-o*(a*m-i*y)+p*(a*s-i*c)),t[7]=e*(c*d-s*f)-o*(a*d-i*f)+h*(a*s-i*c),t[8]=o*(l*m-d*v)-h*(u*m-s*v)+p*(u*d-s*l),t[9]=-(e*(l*m-d*v)-h*(r*m-i*v)+p*(r*d-i*l)),t[10]=e*(u*m-s*v)-o*(r*m-i*v)+p*(r*s-i*u),t[11]=-(e*(u*d-s*l)-o*(r*d-i*l)+h*(r*s-i*u)),t[12]=-(o*(l*y-f*v)-h*(u*y-c*v)+p*(u*f-c*l)),t[13]=e*(l*y-f*v)-h*(r*y-a*v)+p*(r*f-a*l),t[14]=-(e*(u*y-c*v)-o*(r*y-a*v)+p*(r*c-a*u)),t[15]=e*(u*f-c*l)-o*(r*f-a*l)+h*(r*c-a*u),t}function nt(t){var n=t[0],e=t[1],r=t[2],a=t[3],i=t[4],o=t[5],u=t[6],c=t[7],s=t[8],h=t[9],l=t[10],f=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*o-e*i)*(l*y-f*v)-(n*u-r*i)*(h*y-f*p)+(n*c-a*i)*(h*v-l*p)+(e*u-r*o)*(s*y-f*d)-(e*c-a*o)*(s*v-l*d)+(r*c-a*u)*(s*p-h*d)}function et(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=n[8],f=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],O=e[3];return t[0]=M*r+b*u+x*l+O*v,t[1]=M*a+b*c+x*f+O*y,t[2]=M*i+b*s+x*d+O*m,t[3]=M*o+b*h+x*p+O*g,M=e[4],b=e[5],x=e[6],O=e[7],t[4]=M*r+b*u+x*l+O*v,t[5]=M*a+b*c+x*f+O*y,t[6]=M*i+b*s+x*d+O*m,t[7]=M*o+b*h+x*p+O*g,M=e[8],b=e[9],x=e[10],O=e[11],t[8]=M*r+b*u+x*l+O*v,t[9]=M*a+b*c+x*f+O*y,t[10]=M*i+b*s+x*d+O*m,t[11]=M*o+b*h+x*p+O*g,M=e[12],b=e[13],x=e[14],O=e[15],t[12]=M*r+b*u+x*l+O*v,t[13]=M*a+b*c+x*f+O*y,t[14]=M*i+b*s+x*d+O*m,t[15]=M*o+b*h+x*p+O*g,t}function rt(t,n,e){var r,a,i,o,u,c,s,h,l,f,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],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=n[8],f=n[9],d=n[10],p=n[11],t[0]=r,t[1]=a,t[2]=i,t[3]=o,t[4]=u,t[5]=c,t[6]=s,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=r*v+u*y+l*m+n[12],t[13]=a*v+c*y+f*m+n[13],t[14]=i*v+s*y+d*m+n[14],t[15]=o*v+h*y+p*m+n[15]),t}function at(t,n,e){var r=e[0],a=e[1],i=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]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=n[11]*i,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function it(t,n,e,r){var a,i,o,u,c,s,h,l,f,d,p,v,y,m,g,M,b,x,O,S,C,j,B,R,P=r[0],A=r[1],E=r[2],T=Math.hypot(P,A,E);return T<F?null:(P*=T=1/T,A*=T,E*=T,a=Math.sin(e),o=1-(i=Math.cos(e)),u=n[0],c=n[1],s=n[2],h=n[3],l=n[4],f=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=P*P*o+i,b=A*P*o+E*a,x=E*P*o-A*a,O=P*A*o-E*a,S=A*A*o+i,C=E*A*o+P*a,j=P*E*o+A*a,B=A*E*o-P*a,R=E*E*o+i,t[0]=u*M+l*b+v*x,t[1]=c*M+f*b+y*x,t[2]=s*M+d*b+m*x,t[3]=h*M+p*b+g*x,t[4]=u*O+l*S+v*C,t[5]=c*O+f*S+y*C,t[6]=s*O+d*S+m*C,t[7]=h*O+p*S+g*C,t[8]=u*j+l*B+v*R,t[9]=c*j+f*B+y*R,t[10]=s*j+d*B+m*R,t[11]=h*j+p*B+g*R,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function ot(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[4],o=n[5],u=n[6],c=n[7],s=n[8],h=n[9],l=n[10],f=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]=i*a+s*r,t[5]=o*a+h*r,t[6]=u*a+l*r,t[7]=c*a+f*r,t[8]=s*a-i*r,t[9]=h*a-o*r,t[10]=l*a-u*r,t[11]=f*a-c*r,t}function ut(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[0],o=n[1],u=n[2],c=n[3],s=n[8],h=n[9],l=n[10],f=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]=i*a-s*r,t[1]=o*a-h*r,t[2]=u*a-l*r,t[3]=c*a-f*r,t[8]=i*r+s*a,t[9]=o*r+h*a,t[10]=u*r+l*a,t[11]=c*r+f*a,t}function ct(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[0],o=n[1],u=n[2],c=n[3],s=n[4],h=n[5],l=n[6],f=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]=i*a+s*r,t[1]=o*a+h*r,t[2]=u*a+l*r,t[3]=c*a+f*r,t[4]=s*a-i*r,t[5]=h*a-o*r,t[6]=l*a-u*r,t[7]=f*a-c*r,t}function st(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 ht(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 lt(t,n,e){var r,a,i,o=e[0],u=e[1],c=e[2],s=Math.hypot(o,u,c);return s<F?null:(o*=s=1/s,u*=s,c*=s,r=Math.sin(n),i=1-(a=Math.cos(n)),t[0]=o*o*i+a,t[1]=u*o*i+c*r,t[2]=c*o*i-u*r,t[3]=0,t[4]=o*u*i-c*r,t[5]=u*u*i+a,t[6]=c*u*i+o*r,t[7]=0,t[8]=o*c*i+u*r,t[9]=u*c*i-o*r,t[10]=c*c*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ft(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 dt(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 pt(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 vt(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=r+r,c=a+a,s=i+i,h=r*u,l=r*c,f=r*s,d=a*c,p=a*s,v=i*s,y=o*u,m=o*c,g=o*s;return t[0]=1-(d+v),t[1]=l+g,t[2]=f-m,t[3]=0,t[4]=l-g,t[5]=1-(h+v),t[6]=p+y,t[7]=0,t[8]=f+m,t[9]=p-y,t[10]=1-(h+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function yt(t,n){var e=new V(3),r=-n[0],a=-n[1],i=-n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=r*r+a*a+i*i+o*o;return l>0?(e[0]=2*(u*o+h*r+c*i-s*a)/l,e[1]=2*(c*o+h*a+s*r-u*i)/l,e[2]=2*(s*o+h*i+u*a-c*r)/l):(e[0]=2*(u*o+h*r+c*i-s*a),e[1]=2*(c*o+h*a+s*r-u*i),e[2]=2*(s*o+h*i+u*a-c*r)),vt(t,n,e),t}function mt(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function gt(t,n){var e=n[0],r=n[1],a=n[2],i=n[4],o=n[5],u=n[6],c=n[8],s=n[9],h=n[10];return t[0]=Math.hypot(e,r,a),t[1]=Math.hypot(i,o,u),t[2]=Math.hypot(c,s,h),t}function Mt(t,n){var e=new V(3);gt(e,n);var r=1/e[0],a=1/e[1],i=1/e[2],o=n[0]*r,u=n[1]*a,c=n[2]*i,s=n[4]*r,h=n[5]*a,l=n[6]*i,f=n[8]*r,d=n[9]*a,p=n[10]*i,v=o+h+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(l-d)/y,t[1]=(f-c)/y,t[2]=(u-s)/y):o>h&&o>p?(y=2*Math.sqrt(1+o-h-p),t[3]=(l-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(f+c)/y):h>p?(y=2*Math.sqrt(1+h-o-p),t[3]=(f-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(l+d)/y):(y=2*Math.sqrt(1+p-o-h),t[3]=(u-s)/y,t[0]=(f+c)/y,t[1]=(l+d)/y,t[2]=.25*y),t}function bt(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=n[3],c=a+a,s=i+i,h=o+o,l=a*c,f=a*s,d=a*h,p=i*s,v=i*h,y=o*h,m=u*c,g=u*s,M=u*h,b=r[0],x=r[1],O=r[2];return t[0]=(1-(p+y))*b,t[1]=(f+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(f-M)*x,t[5]=(1-(l+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*O,t[9]=(v-m)*O,t[10]=(1-(l+p))*O,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function xt(t,n,e,r,a){var i=n[0],o=n[1],u=n[2],c=n[3],s=i+i,h=o+o,l=u+u,f=i*s,d=i*h,p=i*l,v=o*h,y=o*l,m=u*l,g=c*s,M=c*h,b=c*l,x=r[0],O=r[1],S=r[2],C=a[0],j=a[1],B=a[2],R=(1-(v+m))*x,P=(d+b)*x,A=(p-M)*x,E=(d-b)*O,T=(1-(f+m))*O,w=(y+g)*O,k=(p+M)*S,N=(y-g)*S,Y=(1-(f+v))*S;return t[0]=R,t[1]=P,t[2]=A,t[3]=0,t[4]=E,t[5]=T,t[6]=w,t[7]=0,t[8]=k,t[9]=N,t[10]=Y,t[11]=0,t[12]=e[0]+C-(R*C+E*j+k*B),t[13]=e[1]+j-(P*C+T*j+N*B),t[14]=e[2]+B-(A*C+w*j+Y*B),t[15]=1,t}function Ot(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e+e,u=r+r,c=a+a,s=e*o,h=r*o,l=r*u,f=a*o,d=a*u,p=a*c,v=i*o,y=i*u,m=i*c;return t[0]=1-l-p,t[1]=h+m,t[2]=f-y,t[3]=0,t[4]=h-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=f+y,t[9]=d-v,t[10]=1-s-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,n,e,r,a,i,o){var u=1/(e-n),c=1/(a-r),s=1/(i-o);return t[0]=2*i*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(a+r)*c,t[10]=(o+i)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*s,t[15]=0,t}function Ct(t,n,e,r,a){var i,o=1/Math.tan(n/2);return t[0]=o/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(r-a),t[10]=(a+r)*i,t[14]=2*a*r*i):(t[10]=-1,t[14]=-2*r),t}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;function Bt(t,n,e,r,a){var i,o=1/Math.tan(n/2);return t[0]=o/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(r-a),t[10]=a*i,t[14]=a*r*i):(t[10]=-1,t[14]=-r),t}function Rt(t,n,e,r){var a=Math.tan(n.upDegrees*Math.PI/180),i=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(o+u),s=2/(a+i);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]=-(o-u)*c*.5,t[9]=(a-i)*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 Pt(t,n,e,r,a,i,o){var u=1/(n-e),c=1/(r-a),s=1/(i-o);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]=(a+r)*c,t[14]=(o+i)*s,t[15]=1,t}var At=Pt;function Et(t,n,e,r,a,i,o){var u=1/(n-e),c=1/(r-a),s=1/(i-o);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]=(a+r)*c,t[14]=i*s,t[15]=1,t}function Tt(t,n,e,r){var a,i,o,u,c,s,h,l,f,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],O=e[2];return Math.abs(p-b)<F&&Math.abs(v-x)<F&&Math.abs(y-O)<F?W(t):(h=p-b,l=v-x,f=y-O,a=g*(f*=d=1/Math.hypot(h,l,f))-M*(l*=d),i=M*(h*=d)-m*f,o=m*l-g*h,(d=Math.hypot(a,i,o))?(a*=d=1/d,i*=d,o*=d):(a=0,i=0,o=0),u=l*o-f*i,c=f*a-h*o,s=h*i-l*a,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=a,t[1]=u,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=l,t[7]=0,t[8]=o,t[9]=s,t[10]=f,t[11]=0,t[12]=-(a*p+i*v+o*y),t[13]=-(u*p+c*v+s*y),t[14]=-(h*p+l*v+f*y),t[15]=1,t)}function wt(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=r[0],c=r[1],s=r[2],h=a-e[0],l=i-e[1],f=o-e[2],d=h*h+l*l+f*f;d>0&&(h*=d=1/Math.sqrt(d),l*=d,f*=d);var p=c*f-s*l,v=s*h-u*f,y=u*l-c*h;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]=l*y-f*v,t[5]=f*p-h*y,t[6]=h*v-l*p,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=a,t[13]=i,t[14]=o,t[15]=1,t}function kt(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 Nt(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 Yt(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 Dt(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 It(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 Xt(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 _t(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 Lt(t,n){var e=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],c=t[6],s=t[7],h=t[8],l=t[9],f=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],O=n[4],S=n[5],C=n[6],j=n[7],B=n[8],R=n[9],P=n[10],A=n[11],E=n[12],T=n[13],w=n[14],k=n[15];return Math.abs(e-g)<=F*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=F*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-b)<=F*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-x)<=F*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-O)<=F*Math.max(1,Math.abs(o),Math.abs(O))&&Math.abs(u-S)<=F*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-C)<=F*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(s-j)<=F*Math.max(1,Math.abs(s),Math.abs(j))&&Math.abs(h-B)<=F*Math.max(1,Math.abs(h),Math.abs(B))&&Math.abs(l-R)<=F*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(f-P)<=F*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-A)<=F*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-E)<=F*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(v-T)<=F*Math.max(1,Math.abs(v),Math.abs(T))&&Math.abs(y-w)<=F*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-k)<=F*Math.max(1,Math.abs(m),Math.abs(k))}var Gt=et,qt=Dt;function Ft(){var t=new V(3);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Vt(t){var n=new V(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Ht(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Ut(t,n,e){var r=new V(3);return r[0]=t,r[1]=n,r[2]=e,r}function Qt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Zt(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function zt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function Jt(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function Wt(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Kt(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function $t(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function tn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function nn(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 en(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 rn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function an(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function on(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 un(t,n){var e=n[0]-t[0],r=n[1]-t[1],a=n[2]-t[2];return Math.hypot(e,r,a)}function cn(t,n){var e=n[0]-t[0],r=n[1]-t[1],a=n[2]-t[2];return e*e+r*r+a*a}function sn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function hn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function ln(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function fn(t,n){var e=n[0],r=n[1],a=n[2],i=e*e+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function dn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function pn(t,n,e){var r=n[0],a=n[1],i=n[2],o=e[0],u=e[1],c=e[2];return t[0]=a*c-i*u,t[1]=i*o-r*c,t[2]=r*u-a*o,t}function vn(t,n,e,r){var a=n[0],i=n[1],o=n[2];return t[0]=a+r*(e[0]-a),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t}function yn(t,n,e,r,a,i){var o=i*i,u=o*(2*i-3)+1,c=o*(i-2)+i,s=o*(i-1),h=o*(3-2*i);return t[0]=n[0]*u+e[0]*c+r[0]*s+a[0]*h,t[1]=n[1]*u+e[1]*c+r[1]*s+a[1]*h,t[2]=n[2]*u+e[2]*c+r[2]*s+a[2]*h,t}function mn(t,n,e,r,a,i){var o=1-i,u=o*o,c=i*i,s=u*o,h=3*i*u,l=3*c*o,f=c*i;return t[0]=n[0]*s+e[0]*h+r[0]*l+a[0]*f,t[1]=n[1]*s+e[1]*h+r[1]*l+a[1]*f,t[2]=n[2]*s+e[2]*h+r[2]*l+a[2]*f,t}function gn(t,n){n=n||1;var e=2*H()*Math.PI,r=2*H()-1,a=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*a,t[1]=Math.sin(e)*a,t[2]=r*n,t}function Mn(t,n,e){var r=n[0],a=n[1],i=n[2],o=e[3]*r+e[7]*a+e[11]*i+e[15];return o=o||1,t[0]=(e[0]*r+e[4]*a+e[8]*i+e[12])/o,t[1]=(e[1]*r+e[5]*a+e[9]*i+e[13])/o,t[2]=(e[2]*r+e[6]*a+e[10]*i+e[14])/o,t}function bn(t,n,e){var r=n[0],a=n[1],i=n[2];return t[0]=r*e[0]+a*e[3]+i*e[6],t[1]=r*e[1]+a*e[4]+i*e[7],t[2]=r*e[2]+a*e[5]+i*e[8],t}function xn(t,n,e){var r=e[0],a=e[1],i=e[2],o=e[3],u=n[0],c=n[1],s=n[2],h=a*s-i*c,l=i*u-r*s,f=r*c-a*u,d=a*f-i*l,p=i*h-r*f,v=r*l-a*h,y=2*o;return h*=y,l*=y,f*=y,d*=2,p*=2,v*=2,t[0]=u+h+d,t[1]=c+l+p,t[2]=s+f+v,t}function On(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[0],i[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),i[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Sn(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),i[1]=a[1],i[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Cn(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),i[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),i[2]=a[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function jn(t,n){var e=t[0],r=t[1],a=t[2],i=n[0],o=n[1],u=n[2],c=Math.sqrt(e*e+r*r+a*a)*Math.sqrt(i*i+o*o+u*u),s=c&&dn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function Bn(t){return t[0]=0,t[1]=0,t[2]=0,t}function Rn(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Pn(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function An(t,n){var e=t[0],r=t[1],a=t[2],i=n[0],o=n[1],u=n[2];return Math.abs(e-i)<=F*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-o)<=F*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-u)<=F*Math.max(1,Math.abs(a),Math.abs(u))}var En,Tn=Jt,wn=Wt,kn=Kt,Nn=un,Yn=cn,Dn=Ht,In=sn,Xn=(En=Ft(),function(t,n,e,r,a,i){var o,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,o=e;o<u;o+=n)En[0]=t[o],En[1]=t[o+1],En[2]=t[o+2],a(En,En,i),t[o]=En[0],t[o+1]=En[1],t[o+2]=En[2];return t});function _n(t){var n=t[0],e=t[1],r=t[2],a=t[3];return Math.hypot(n,e,r,a)}function Ln(t){var n=t[0],e=t[1],r=t[2],a=t[3];return n*n+e*e+r*r+a*a}!function(){var t,n=(t=new V(4),V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Gn(){var t=new V(4);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function qn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Fn(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 Vn(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>F?(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 Hn(t,n){var e=xe(t,n);return Math.acos(2*e*e-1)}function Un(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=e[0],c=e[1],s=e[2],h=e[3];return t[0]=r*h+o*u+a*s-i*c,t[1]=a*h+o*c+i*u-r*s,t[2]=i*h+o*s+r*c-a*u,t[3]=o*h-r*u-a*c-i*s,t}function Qn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=a*c+i*u,t[2]=i*c-a*u,t[3]=o*c-r*u,t}function Zn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-i*u,t[1]=a*c+o*u,t[2]=i*c+r*u,t[3]=o*c-a*u,t}function zn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=a*c-r*u,t[2]=i*c+o*u,t[3]=o*c-i*u,t}function Jn(t,n){var e=n[0],r=n[1],a=n[2];return t[0]=e,t[1]=r,t[2]=a,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-a*a)),t}function Wn(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=Math.sqrt(e*e+r*r+a*a),u=Math.exp(i),c=o>0?u*Math.sin(o)/o:0;return t[0]=e*c,t[1]=r*c,t[2]=a*c,t[3]=u*Math.cos(o),t}function Kn(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=Math.sqrt(e*e+r*r+a*a),u=o>0?Math.atan2(o,i)/o:0;return t[0]=e*u,t[1]=r*u,t[2]=a*u,t[3]=.5*Math.log(e*e+r*r+a*a+i*i),t}function $n(t,n,e){return Kn(t,n),be(t,t,e),Wn(t,t),t}function te(t,n,e,r){var a,i,o,u,c,s=n[0],h=n[1],l=n[2],f=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(i=s*d+h*p+l*v+f*y)<0&&(i=-i,d=-d,p=-p,v=-v,y=-y),1-i>F?(a=Math.acos(i),o=Math.sin(a),u=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*h+c*p,t[2]=u*l+c*v,t[3]=u*f+c*y,t}function ne(t){var n=H(),e=H(),r=H(),a=Math.sqrt(1-n),i=Math.sqrt(n);return t[0]=a*Math.sin(2*Math.PI*e),t[1]=a*Math.cos(2*Math.PI*e),t[2]=i*Math.sin(2*Math.PI*r),t[3]=i*Math.cos(2*Math.PI*r),t}function ee(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e*e+r*r+a*a+i*i,u=o?1/o:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-a*u,t[3]=i*u,t}function re(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function ae(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 a=0;n[4]>n[0]&&(a=1),n[8]>n[3*a+a]&&(a=2);var i=(a+1)%3,o=(a+2)%3;e=Math.sqrt(n[3*a+a]-n[3*i+i]-n[3*o+o]+1),t[a]=.5*e,e=.5/e,t[3]=(n[3*i+o]-n[3*o+i])*e,t[i]=(n[3*i+a]+n[3*a+i])*e,t[o]=(n[3*o+a]+n[3*a+o])*e}return t}function ie(t,n,e,r){var a=.5*Math.PI/180;n*=a,e*=a,r*=a;var i=Math.sin(n),o=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),h=Math.cos(r);return t[0]=i*c*h-o*u*s,t[1]=o*u*h+i*c*s,t[2]=o*c*s-i*u*h,t[3]=o*c*h+i*u*s,t}function oe(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var ue,ce,se,he,le,fe,de,pe=function(t){var n=new V(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},ve=function(t,n,e,r){var a=new V(4);return a[0]=t,a[1]=n,a[2]=e,a[3]=r,a},ye=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},me=function(t,n,e,r,a){return t[0]=n,t[1]=e,t[2]=r,t[3]=a,t},ge=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},Me=Un,be=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},xe=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},Oe=function(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=n[3];return t[0]=a+r*(e[0]-a),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t[3]=u+r*(e[3]-u),t},Se=_n,Ce=Se,je=Ln,Be=je,Re=function(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e*e+r*r+a*a+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e*o,t[1]=r*o,t[2]=a*o,t[3]=i*o,t},Pe=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},Ae=function(t,n){var e=t[0],r=t[1],a=t[2],i=t[3],o=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-o)<=F*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-u)<=F*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=F*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(i-s)<=F*Math.max(1,Math.abs(i),Math.abs(s))},Ee=(ue=Ft(),ce=Ut(1,0,0),se=Ut(0,1,0),function(t,n,e){var r=dn(n,e);return r<-.999999?(pn(ue,ce,n),Dn(ue)<1e-6&&pn(ue,se,n),fn(ue,ue),Fn(t,ue,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(pn(ue,n,e),t[0]=ue[0],t[1]=ue[1],t[2]=ue[2],t[3]=1+r,Re(t,t))}),Te=(he=Gn(),le=Gn(),function(t,n,e,r,a,i){return te(he,n,a,i),te(le,e,r,i),te(t,he,le,2*i*(1-i)),t}),we=(fe=new V(9),V!=Float32Array&&(fe[1]=0,fe[2]=0,fe[3]=0,fe[5]=0,fe[6]=0,fe[7]=0),fe[0]=1,fe[4]=1,fe[8]=1,de=fe,function(t,n,e,r){return de[0]=e[0],de[3]=e[1],de[6]=e[2],de[1]=r[0],de[4]=r[1],de[7]=r[2],de[2]=-n[0],de[5]=-n[1],de[8]=-n[2],Re(t,ae(t,de))}),ke=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),Ne="RBushRoot",Ye=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 a=e.getRenderBounds();if(a){var i=R(a.getMin(),2),o=i[0],u=i[1],c=R(a.getMax(),2),s=c[0],h=c[1];r.aabb={id:e.entity,minX:o,minY:u,maxX:s,maxY:h}}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 ke,e.pushToSync(t.composedPath().slice(0,-2))},i=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))},u=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.tapPromise(n.tag,(function(){return j(e,void 0,void 0,(function(){return B(this,(function(t){return this.renderingContext.root.addEventListener(o.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(o.ElementEvent.UNMOUNTED,i),this.renderingContext.root.addEventListener(o.ElementEvent.BOUNDS_CHANGED,u),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(o.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(o.ElementEvent.UNMOUNTED,i),e.renderingContext.root.removeEventListener(o.ElementEvent.BOUNDS_CHANGED,u)})),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(o.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,i=n.enableDirtyRectangleRenderingDebug,u=e.contextService.getContext(),c=e.renderQueue;if(r){if(!e.clearFullScreen){var s=e.safeMergeAABB.apply(e,P([e.mergeDirtyAABBs(e.renderQueue)],R(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,i=t.maxY,u=new o.AABB;return u.setMinMax(a.fromValues(n,e,0),a.fromValues(r,i,0)),u}))),!1));if(e.removedRBushNodeAABBs=[],o.AABB.isEmpty(s))return void(e.renderQueue=[]);var h=e.convertAABB2Rect(s),l=h.x,f=h.y,d=h.width,p=h.height;u.clearRect(l,f,d,p),u.beginPath(),u.rect(l,f,d,p),u.clip(),i&&(u.lineWidth=4,u.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),u.strokeRect(l,f,d,p)),c=e.searchDirtyObjects(s)}c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n&&n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(u,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){u.restore()})),e.restoreStack=[],e.clearFullScreen=!1,u.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):n.isVisible()&&!n.isCulled()&&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(),a=this.restoreStack[this.restoreStack.length-1];a&&t.parentNode!==a;)r.restore(),this.restoreStack.pop(),a=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName,u=this.styleRendererFactory(i),c=!1;if(this.enableBatch&&u){var s=u.hash(t.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=t,c=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var h=t.style.clipPath;if(h){r.save(),this.applyTransform(r,h.getLocalTransform());var l=this.pathGeneratorFactory(h.nodeName);l&&this.useAnchor(r,h,(function(){r.beginPath(),l(r,h.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&&(!c&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===o.Shape.LINE||t.nodeName===o.Shape.PATH||t.nodeName===o.Shape.POLYLINE||r.closePath()),u&&!e.enableBatch&&u.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]),a=Math.floor(n[1]);return{x:r,y:a,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-a}},t.prototype.mergeDirtyAABBs=function(t){var n=new o.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=R(t.getMin(),2),r=e[0],a=e[1],i=R(t.getMax(),2),o=i[0],u=i[1];return this.rBush.search({minX:r,minY:a,maxX:o,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 o.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=R(r.getTranslation(a.create(),n),2),u=e[0],c=e[1],s=R(r.getScaling(a.create(),n),2),h=s[0],l=s[1],f=r.getRotation(i.create(),n),d=R(Object(o.getEuler)(a.create(),f),3),p=d[0],v=(d[1],d[2]),y=Object(o.fromRotationTranslationScale)(p||v,u,c,h,l);t.transform(y[0],y[1],y[3],y[4],y[6],y[7])},t.prototype.getColor=function(t,n,e,r){var a;if(t instanceof o.CSSGradientValue){if(t.type===o.GradientPatternType.LinearGradient||t.type===o.GradientPatternType.RadialGradient){var i=n.getGeometryBounds(),u=i&&2*i.halfExtents[0]||0,c=i&&2*i.halfExtents[1]||0;a=this.gradientPool.getOrCreateGradient(O(O({type:t.type},t.value),{width:u,height:c}),e)}else if(t.type===o.GradientPatternType.Pattern){var s=this.imagePool.getPatternSync(t.value);s?a=s:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}}else a=t.toString();return a},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,a=r.stroke,i=r.fill,u=r.opacity,c=r.lineDash,s=r.lineDashOffset,h=r.filter,l=r.shadowColor,f=r.shadowBlur,d=r.shadowOffsetX,p=r.shadowOffsetY;c&&Array.isArray(c)&&t.setLineDash(c.map((function(t){return t.value}))),Object(o.isNil)(s)||(t.lineDashOffset=s.value),Object(o.isNil)(u)||(t.globalAlpha*=u.value),Object(o.isNil)(a)||(t.strokeStyle=this.getColor(a,n,t,e)),Object(o.isNil)(i)||(t.fillStyle=this.getColor(i,n,t,e)),Object(o.isNil)(h)||(t.filter=n.style.filter),Object(o.isNil)(l)||(t.shadowColor=l.toString(),t.shadowBlur=f&&f.value||0,t.shadowOffsetX=d&&d.value||0,t.shadowOffsetY=p&&p.value||0)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var a=r.halfExtents,i=(n.parsedStyle||{}).anchor;t.translate(-(i&&i[0].value||0)*a[0]*2,-(i&&i[1].value||0)*a[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 o.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRenderer",S([Object(u.inject)(o.CanvasConfig),C("design:type",Object)],t.prototype,"canvasConfig",void 0),S([Object(u.inject)(o.DefaultCamera),C("design:type",o.Camera)],t.prototype,"camera",void 0),S([Object(u.inject)(o.ContextService),C("design:type",Object)],t.prototype,"contextService",void 0),S([Object(u.inject)(o.RenderingContext),C("design:type",Object)],t.prototype,"renderingContext",void 0),S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),S([Object(u.inject)(L),C("design:type",L)],t.prototype,"gradientPool",void 0),S([Object(u.inject)(G),C("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),S([Object(u.inject)(h),C("design:type",Function)],t.prototype,"styleRendererFactory",void 0),S([Object(u.inject)(o.DisplayObjectPool),C("design:type",o.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),S([Object(u.inject)(Ne),C("design:type",s.a)],t.prototype,"rBush",void 0),t=n=S([Object(u.singleton)({contrib:o.RenderingPluginContribution})],t)}(),De=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,a=r.nodeName,i=r.attributes;if(a===o.Shape.IMAGE){var u=i.img;Object(o.isString)(u)&&e.imagePool.getOrCreateImage(u).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},a=function(n){var r=n.target,a=n.attrName,i=n.newValue;r.nodeName===o.Shape.IMAGE&&"img"===a&&Object(o.isString)(i)&&e.imagePool.getOrCreateImage(i).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(n.tag,(function(){return j(e,void 0,void 0,(function(){return B(this,(function(t){return this.renderingContext.root.addEventListener(o.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(o.ElementEvent.ATTR_MODIFIED,a),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(o.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(o.ElementEvent.ATTR_MODIFIED,a)}))},t.tag="LoadImage",S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),S([Object(u.inject)(o.RenderingContext),C("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=S([Object(u.singleton)({contrib:o.RenderingPluginContribution})],t)}();u.GlobalContainer.register({token:{token:q,named:o.Shape.CIRCLE},useValue:function(t,n){var e=n.r;t.arc(e.value,e.value,e.value,0,2*Math.PI,!1)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.ELLIPSE},useValue:function(t,n){var e=n.rx,r=n.ry,a=e.value,i=r.value;if(t.ellipse)t.ellipse(a,i,a,i,0,0,2*Math.PI,!1);else{var o=a>i?a:i,u=a>i?1:a/i,c=a>i?i/a:1;t.save(),t.scale(u,c),t.arc(0,0,o,0,2*Math.PI)}}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.RECT},useValue:function(t,n){var e=n.radius,r=n.width,a=n.height,i=r.value,o=a.value,u=e&&e.value||0;if(0===u)t.rect(0,0,i,o);else{var c=R(function(t){var n=0,e=0,r=0,a=0;return Array.isArray(t)?1===t.length?n=e=r=a=t[0]:2===t.length?(n=r=t[0],e=a=t[1]):3===t.length?(n=t[0],e=a=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],a=t[3]):n=e=r=a=t,[n,e,r,a]}(u),4),s=c[0],h=c[1],l=c[2],f=c[3];t.moveTo(s,0),t.lineTo(i-h,0),0!==h&&t.arc(i-h,h,h,-Math.PI/2,0),t.lineTo(i,o-l),0!==l&&t.arc(i-l,o-l,l,0,Math.PI/2),t.lineTo(f,o),0!==f&&t.arc(f,o-f,f,Math.PI/2,Math.PI),t.lineTo(0,s),0!==s&&t.arc(s,s,s,Math.PI,1.5*Math.PI)}}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,a=n.x2,i=n.y2,o=n.defX,u=void 0===o?0:o,c=n.defY,s=void 0===c?0:c;t.moveTo(e.value-u,r.value-s),t.lineTo(a.value-u,i.value-s)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.points.points,u=o.length,c=o[0][0]-r,s=o[0][1]-i,h=o[u-1][0]-r,l=o[u-1][1]-i;t.moveTo(c,s);for(var f=0;f<u-1;f++){var d=o[f];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(h,l)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.points.points,u=o.length,c=o[0][0]-r,s=o[0][1]-i,h=o[u-1][0]-r,l=o[u-1][1]-i;t.moveTo(c,s);for(var f=0;f<u-1;f++){var d=o[f];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(h,l)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.path,u=o.curve,c=o.zCommandIndexes,s=P([],R(u),!1);c.forEach((function(t,n){s.splice(t+n,1,["Z"])}));for(var h=0;h<s.length;h++){var l=s[h];switch(l[0]){case"M":t.moveTo(l[1]-r,l[2]-i);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-i,l[3]-r,l[4]-i,l[5]-r,l[6]-i);break;case"Z":t.closePath()}}}}),u.GlobalContainer.register({token:G,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(q,e)&&(n[e]=t.container.getNamed(q,e)),n[e]}}});var Ie=Object(u.Module)((function(t){var n;t(A),t({token:Ne,useValue:new s.a}),t(N),t(Y),t(k),t(E),t(T),t(D),t(I),t(X),t(_);var e=((n={})[o.Shape.CIRCLE]=l,n[o.Shape.ELLIPSE]=f,n[o.Shape.RECT]=d,n[o.Shape.IMAGE]=M,n[o.Shape.TEXT]=g,n[o.Shape.LINE]=p,n[o.Shape.POLYLINE]=v,n[o.Shape.POLYGON]=y,n[o.Shape.PATH]=m,n);t({token:h,useFactory:function(t){var n={};return function(r){var a=e[r];return a&&!n[r]&&t.container.isBound(a)&&(n[r]=t.container.get(a)),n[r]}}}),t(L),t(Ye),t(De)})),Xe=function(){function t(){this.name="canvas-renderer"}return t.prototype.init=function(t){t.load(Ie,!0)},t.prototype.destroy=function(t){t.unload(Ie)},t}()}])})); | ||
!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.CanvasRenderer=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.CanvasRenderer=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 a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.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 a in t)e.d(r,a,function(n){return t[n]}.bind(null,a));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=7)}([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,a,i,o){!function t(e,r,a,i,o){for(;i>a;){if(i-a>600){var u=i-a+1,c=r-a+1,s=Math.log(u),h=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*h*(u-h)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(a,Math.floor(r-c*h/u+l)),Math.min(i,Math.floor(r+(u-c)*h/u+l)),o)}var f=e[r],d=a,p=i;for(n(e,a,r),o(e[i],f)>0&&n(e,a,i);d<p;){for(n(e,d,p),d++,p--;o(e[d],f)<0;)d++;for(;o(e[p],f)>0;)p--}0===o(e[a],f)?n(e,a,p):n(e,++p,i),p<=r&&(a=p+1),r<=p&&(i=p-1)}}(t,r,a||0,i||t.length-1,o||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 a(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 i(t,n){o(t,0,t.children.length,n,t)}function o(t,n,e,r,a){a||(a=p(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var i=n;i<e;i++){var o=t.children[i];u(a,t.leaf?r(o):o)}return a}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 h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function l(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(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,a,i){for(var o=[e,r];o.length;)if(!((r=o.pop())-(e=o.pop())<=a)){var u=e+Math.ceil((r-e)/a/2)*a;t(n,u,e,r,i),o.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,a=[];n;){for(var i=0;i<n.children.length;i++){var o=n.children[i],u=n.leaf?r(o):o;d(t,u)&&(n.leaf?e.push(o):f(t,u)?this._all(o,e):a.push(o))}n=a.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 a=n.children[r],i=n.leaf?this.toBBox(a):a;if(d(t,i)){if(n.leaf||f(t,i))return!0;e.push(a)}}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,i,o=this.data,u=this.toBBox(t),c=[],s=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],e=s.pop(),i=!0),o.leaf){var h=a(t,o.children,n);if(-1!==h)return o.children.splice(h,1),c.push(o),this._condense(c),this}i||o.leaf||!f(o,u)?r?(e++,o=r.children[e],i=!1):o=null:(c.push(o),s.push(e),e=0,r=o,o=o.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 a,o=e-n+1,u=this._maxEntries;if(o<=u)return i(a=p(t.slice(n,e+1)),this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(u)),u=Math.ceil(o/Math.pow(u,r-1))),(a=p([])).leaf=!1,a.height=r;var c=Math.ceil(o/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var h=n;h<=e;h+=s){var l=Math.min(h+s-1,e);v(t,h,l,c,this.compareMinY);for(var f=h;f<=l;f+=c){var d=Math.min(f+c-1,l);a.children.push(this._build(t,f,d,r-1))}}return i(a,this.toBBox),a},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var a=1/0,i=1/0,o=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=h(c),l=(f=t,d=c,(Math.max(d.maxX,f.maxX)-Math.min(d.minX,f.minX))*(Math.max(d.maxY,f.maxY)-Math.min(d.minY,f.minY))-s);l<i?(i=l,a=s<a?s:a,o=c):l===i&&s<a&&(a=s,o=c)}n=o||n.children[0]}var f,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),a=[],i=this._chooseSubtree(r,this.data,n,a);for(i.children.push(t),u(i,r);n>=0&&a[n].children.length>this._maxEntries;)this._split(a,n),n--;this._adjustParentBBoxes(r,a,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,r);var o=this._chooseSplitIndex(e,a,r),u=p(e.children.splice(o,e.children.length-o));u.height=e.height,u.leaf=e.leaf,i(e,this.toBBox),i(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,i(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,a,i,u,c,s,l,f=1/0,d=1/0,p=n;p<=e-n;p++){var v=o(t,0,p,this.toBBox),y=o(t,p,e,this.toBBox),m=(a=v,i=y,u=Math.max(a.minX,i.minX),c=Math.max(a.minY,i.minY),s=Math.min(a.maxX,i.maxX),l=Math.min(a.maxY,i.maxY),Math.max(0,s-u)*Math.max(0,l-c)),g=h(v)+h(y);m<f?(f=m,r=p,d=g<d?g:d):m===f&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,a=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,a)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var a=this.toBBox,i=o(t,0,n,a),c=o(t,e-n,e,a),s=l(i)+l(c),h=n;h<e-n;h++){var f=t.children[h];u(i,t.leaf?a(f):f),s+=l(i)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?a(p):p),s+=l(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():i(t[n],this.toBBox)},r}()},,,,,function(t,n,e){"use strict";e.r(n),e.d(n,"PathGeneratorFactory",(function(){return G})),e.d(n,"PathGenerator",(function(){return q})),e.d(n,"RBushNode",(function(){return ke})),e.d(n,"RBushRoot",(function(){return Ne})),e.d(n,"RBush",(function(){return s.a})),e.d(n,"StyleRendererFactory",(function(){return h})),e.d(n,"CircleRendererContribution",(function(){return l})),e.d(n,"EllipseRendererContribution",(function(){return f})),e.d(n,"RectRendererContribution",(function(){return d})),e.d(n,"LineRendererContribution",(function(){return p})),e.d(n,"PolylineRendererContribution",(function(){return v})),e.d(n,"PolygonRendererContribution",(function(){return y})),e.d(n,"PathRendererContribution",(function(){return m})),e.d(n,"TextRendererContribution",(function(){return g})),e.d(n,"ImageRendererContribution",(function(){return M})),e.d(n,"ImageRenderer",(function(){return E})),e.d(n,"TextRenderer",(function(){return T})),e.d(n,"RectRenderer",(function(){return k})),e.d(n,"CircleRenderer",(function(){return N})),e.d(n,"EllipseRenderer",(function(){return Y})),e.d(n,"LineRenderer",(function(){return D})),e.d(n,"PolylineRenderer",(function(){return I})),e.d(n,"PolygonRenderer",(function(){return X})),e.d(n,"PathRenderer",(function(){return _})),e.d(n,"Plugin",(function(){return Xe}));var r={};e.r(r),e.d(r,"create",(function(){return U})),e.d(r,"clone",(function(){return Q})),e.d(r,"copy",(function(){return Z})),e.d(r,"fromValues",(function(){return z})),e.d(r,"set",(function(){return J})),e.d(r,"identity",(function(){return W})),e.d(r,"transpose",(function(){return K})),e.d(r,"invert",(function(){return $})),e.d(r,"adjoint",(function(){return tt})),e.d(r,"determinant",(function(){return nt})),e.d(r,"multiply",(function(){return et})),e.d(r,"translate",(function(){return rt})),e.d(r,"scale",(function(){return at})),e.d(r,"rotate",(function(){return it})),e.d(r,"rotateX",(function(){return ot})),e.d(r,"rotateY",(function(){return ut})),e.d(r,"rotateZ",(function(){return ct})),e.d(r,"fromTranslation",(function(){return st})),e.d(r,"fromScaling",(function(){return ht})),e.d(r,"fromRotation",(function(){return lt})),e.d(r,"fromXRotation",(function(){return ft})),e.d(r,"fromYRotation",(function(){return dt})),e.d(r,"fromZRotation",(function(){return pt})),e.d(r,"fromRotationTranslation",(function(){return vt})),e.d(r,"fromQuat2",(function(){return yt})),e.d(r,"getTranslation",(function(){return mt})),e.d(r,"getScaling",(function(){return gt})),e.d(r,"getRotation",(function(){return Mt})),e.d(r,"fromRotationTranslationScale",(function(){return bt})),e.d(r,"fromRotationTranslationScaleOrigin",(function(){return xt})),e.d(r,"fromQuat",(function(){return Ot})),e.d(r,"frustum",(function(){return St})),e.d(r,"perspectiveNO",(function(){return Ct})),e.d(r,"perspective",(function(){return jt})),e.d(r,"perspectiveZO",(function(){return Bt})),e.d(r,"perspectiveFromFieldOfView",(function(){return Rt})),e.d(r,"orthoNO",(function(){return Pt})),e.d(r,"ortho",(function(){return At})),e.d(r,"orthoZO",(function(){return Et})),e.d(r,"lookAt",(function(){return Tt})),e.d(r,"targetTo",(function(){return wt})),e.d(r,"str",(function(){return kt})),e.d(r,"frob",(function(){return Nt})),e.d(r,"add",(function(){return Yt})),e.d(r,"subtract",(function(){return Dt})),e.d(r,"multiplyScalar",(function(){return It})),e.d(r,"multiplyScalarAndAdd",(function(){return Xt})),e.d(r,"exactEquals",(function(){return _t})),e.d(r,"equals",(function(){return Lt})),e.d(r,"mul",(function(){return Gt})),e.d(r,"sub",(function(){return qt}));var a={};e.r(a),e.d(a,"create",(function(){return Ft})),e.d(a,"clone",(function(){return Vt})),e.d(a,"length",(function(){return Ht})),e.d(a,"fromValues",(function(){return Ut})),e.d(a,"copy",(function(){return Qt})),e.d(a,"set",(function(){return Zt})),e.d(a,"add",(function(){return zt})),e.d(a,"subtract",(function(){return Jt})),e.d(a,"multiply",(function(){return Wt})),e.d(a,"divide",(function(){return Kt})),e.d(a,"ceil",(function(){return $t})),e.d(a,"floor",(function(){return tn})),e.d(a,"min",(function(){return nn})),e.d(a,"max",(function(){return en})),e.d(a,"round",(function(){return rn})),e.d(a,"scale",(function(){return an})),e.d(a,"scaleAndAdd",(function(){return on})),e.d(a,"distance",(function(){return un})),e.d(a,"squaredDistance",(function(){return cn})),e.d(a,"squaredLength",(function(){return sn})),e.d(a,"negate",(function(){return hn})),e.d(a,"inverse",(function(){return ln})),e.d(a,"normalize",(function(){return fn})),e.d(a,"dot",(function(){return dn})),e.d(a,"cross",(function(){return pn})),e.d(a,"lerp",(function(){return vn})),e.d(a,"hermite",(function(){return yn})),e.d(a,"bezier",(function(){return mn})),e.d(a,"random",(function(){return gn})),e.d(a,"transformMat4",(function(){return Mn})),e.d(a,"transformMat3",(function(){return bn})),e.d(a,"transformQuat",(function(){return xn})),e.d(a,"rotateX",(function(){return On})),e.d(a,"rotateY",(function(){return Sn})),e.d(a,"rotateZ",(function(){return Cn})),e.d(a,"angle",(function(){return jn})),e.d(a,"zero",(function(){return Bn})),e.d(a,"str",(function(){return Rn})),e.d(a,"exactEquals",(function(){return Pn})),e.d(a,"equals",(function(){return An})),e.d(a,"sub",(function(){return Tn})),e.d(a,"mul",(function(){return wn})),e.d(a,"div",(function(){return kn})),e.d(a,"dist",(function(){return Nn})),e.d(a,"sqrDist",(function(){return Yn})),e.d(a,"len",(function(){return Dn})),e.d(a,"sqrLen",(function(){return In})),e.d(a,"forEach",(function(){return Xn}));var i={};e.r(i),e.d(i,"create",(function(){return Gn})),e.d(i,"identity",(function(){return qn})),e.d(i,"setAxisAngle",(function(){return Fn})),e.d(i,"getAxisAngle",(function(){return Vn})),e.d(i,"getAngle",(function(){return Hn})),e.d(i,"multiply",(function(){return Un})),e.d(i,"rotateX",(function(){return Qn})),e.d(i,"rotateY",(function(){return Zn})),e.d(i,"rotateZ",(function(){return zn})),e.d(i,"calculateW",(function(){return Jn})),e.d(i,"exp",(function(){return Wn})),e.d(i,"ln",(function(){return Kn})),e.d(i,"pow",(function(){return $n})),e.d(i,"slerp",(function(){return te})),e.d(i,"random",(function(){return ne})),e.d(i,"invert",(function(){return ee})),e.d(i,"conjugate",(function(){return re})),e.d(i,"fromMat3",(function(){return ae})),e.d(i,"fromEuler",(function(){return ie})),e.d(i,"str",(function(){return oe})),e.d(i,"clone",(function(){return pe})),e.d(i,"fromValues",(function(){return ve})),e.d(i,"copy",(function(){return ye})),e.d(i,"set",(function(){return me})),e.d(i,"add",(function(){return ge})),e.d(i,"mul",(function(){return Me})),e.d(i,"scale",(function(){return be})),e.d(i,"dot",(function(){return xe})),e.d(i,"lerp",(function(){return Oe})),e.d(i,"length",(function(){return Se})),e.d(i,"len",(function(){return Ce})),e.d(i,"squaredLength",(function(){return je})),e.d(i,"sqrLen",(function(){return Be})),e.d(i,"normalize",(function(){return Re})),e.d(i,"exactEquals",(function(){return Pe})),e.d(i,"equals",(function(){return Ae})),e.d(i,"rotationTo",(function(){return Ee})),e.d(i,"sqlerp",(function(){return Te})),e.d(i,"setAxes",(function(){return we}));var o=e(0),u=e(1),c=e(2),s=e.n(c),h=u.Syringe.defineToken("StyleRendererFactory"),l=u.Syringe.defineToken("CircleRenderer",{multiple:!1}),f=u.Syringe.defineToken("EllipseRenderer",{multiple:!1}),d=u.Syringe.defineToken("RectRenderer",{multiple:!1}),p=u.Syringe.defineToken("LineRenderer",{multiple:!1}),v=u.Syringe.defineToken("PolylineRenderer",{multiple:!1}),y=u.Syringe.defineToken("PolygonRenderer",{multiple:!1}),m=u.Syringe.defineToken("PathRenderer",{multiple:!1}),g=u.Syringe.defineToken("TextRenderer",{multiple:!1}),M=u.Syringe.defineToken("ImageRenderer",{multiple:!1}),b=function(t,n){return(b=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)};function x(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}b(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var O=function(){return(O=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var a in n=arguments[e])Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a]);return t}).apply(this,arguments)};function S(t,n,e,r){var a,i=arguments.length,o=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(o=(i<3?a(o):i>3?a(n,e,o):a(n,e))||o);return i>3&&o&&Object.defineProperty(n,e,o),o}function C(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function j(t,n,e,r){return new(e||(e=Promise))((function(a,i){function o(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var n;t.done?a(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,u)}c((r=r.apply(t,n||[])).next())}))}function B(t,n){var e,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=n.call(t,o)}catch(t){i=[6,t],r=0}finally{e=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}Object.create;function R(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,a,i=e.call(t),o=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(a)throw a.error}}return o}function P(t,n,e){if(e||2===arguments.length)for(var r,a=0,i=n.length;a<i;a++)!r&&a in n||(r||(r=Array.prototype.slice.call(n,0,a)),r[a]=n[a]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var A=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,a){var i;e?i=e(t):o.isBrowser&&(i=new window.Image),i&&(i.onload=function(){r(i)},i.onerror=function(t){a(t)},i.crossOrigin="Anonymous",i.src=t,n.imageCache[t]=i)}))},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 a=e.generatePatternKey(t),i=n.createPattern(r,t.repetition);return i&&(e.patternCache[a]=i),e.patternCache[a]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},S([Object(u.inject)(o.CanvasConfig),C("design:type",Object)],t.prototype,"canvasConfig",void 0),t=S([Object(u.singleton)()],t)}(),E=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.width,a=n.height,i=n.img,u=r.value,c=a.value;if(Object(o.isString)(i)?e=this.imagePool.getImageSync(i):(u||(u=i.width),c||(c=i.height),e=i),e)try{t.drawImage(e,0,0,u,c)}catch(t){}},S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),t=S([Object(u.singleton)({token:M})],t)}(),T=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n,a=r.lineWidth,i=r.textAlign,u=r.textBaseline,c=r.lineJoin,s=r.miterLimit,h=void 0===s?0:s,l=r.letterSpacing,f=void 0===l?0:l,d=r.stroke,p=r.fill,v=r.fillOpacity,y=r.strokeOpacity,m=r.opacity,g=r.metrics,M=r.dx,b=r.dy,x=g.font,O=g.lines,S=g.height,C=g.lineHeight,j=g.lineMetrics;t.font=x,t.lineWidth=a.value,t.textAlign=i.value,t.textBaseline=u.value,t.lineJoin=c.value,t.miterLimit=h;var B=0;"middle"===u.value?B=-S/2-C/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?B=-S:"top"!==u.value&&"hanging"!==u.value||(B=-C);var R=0;M&&M.unit===o.UnitType.kPixels&&(R+=M.value),b&&b.unit===o.UnitType.kPixels&&(B+=b.value);for(var P=0;P<O.length;P++){var A=a.value/2+R;B+=C,!Object(o.isNil)(d)&&a&&a.value&&this.drawLetterSpacing(t,O[P],j[P],i.value,A,B,f,v.value,y.value,m.value,!0),Object(o.isNil)(p)||this.drawLetterSpacing(t,O[P],j[P],i.value,A,B,f,v.value,y.value,m.value)}},t.prototype.drawLetterSpacing=function(t,n,e,r,a,i,o,u,c,s,h){if(void 0===h&&(h=!1),0!==o){var l=t.textAlign;t.textAlign="left";var f=a;"center"===r?f=a-e.width/2:"right"!==r&&"end"!==r||(f=a-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];h?this.strokeText(t,m,f,i,c):this.fillText(t,m,f,i,u,s),f+=p-(v=t.measureText(n.substring(y+1)).width)+o,p=v}t.textAlign=l}else h?this.strokeText(t,n,a,i,c):this.fillText(t,n,a,i,u,s)},t.prototype.fillText=function(t,n,e,r,a,i){var u,c=!Object(o.isNil)(a)&&1!==a;c&&(u=t.globalAlpha,t.globalAlpha=a*i),t.fillText(n,e,r),c&&(t.globalAlpha=u)},t.prototype.strokeText=function(t,n,e,r,a){var i,u=!Object(o.isNil)(a)&&1!==a;u&&(i=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,e,r),u&&(t.globalAlpha=i)},t=S([Object(u.singleton)({token:g})],t)}(),w=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,a=n.fillOpacity,i=n.stroke,u=n.strokeOpacity,c=n.lineWidth,s=n.lineCap,h=n.lineJoin,l=n.shadowColor,f=n.filter,d=n.miterLimit,p=!Object(o.isNil)(e),v=!Object(o.isNil)(i),y=0===e.alpha;if(p&&(Object(o.isNil)(a)||1===a.value?t.fill():(t.globalAlpha=a.value,t.fill(),t.globalAlpha=r.value)),v&&c&&c.value>0){!Object(o.isNil)(u)&&1!==u.value&&(t.globalAlpha=u.value),t.lineWidth=c.value,Object(o.isNil)(d)||(t.miterLimit=d),Object(o.isNil)(s)||(t.lineCap=s.value),Object(o.isNil)(h)||(t.lineJoin=h.value);var m=void 0,g=void 0,M=void 0,b=!Object(o.isNil)(l),x=!Object(o.isNil)(f);b&&(m=t.shadowBlur,g=t.shadowColor,Object(o.isNil)(m)||(t.shadowColor="transparent",t.shadowBlur=0)),x&&(M=t.filter,!Object(o.isNil)(M)&&M.indexOf("drop-shadow")>-1&&(t.filter=M.replace(/drop-shadow\([^)]*\)/,"").trim()||"none"));var O=p&&!y;O&&t.stroke(),b&&(t.shadowColor=g,t.shadowBlur=m),x&&(t.filter=M),O||t.stroke()}},t=S([Object(u.singleton)()],t)}(),k=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:d})],n)}(w),N=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:l})],n)}(w),Y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:f})],n)}(w),D=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:p})],n)}(w),I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:v})],n)}(w),X=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:y})],n)}(w),_=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:m})],n)}(w),L=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,a=t.x0,i=t.y0,u=t.x1,c=t.y1,s=t.steps,h=t.width,l=t.height;if(this.gradientCache[e])return this.gradientCache[e];var f=null;if(r===o.GradientPatternType.LinearGradient)f=n.createLinearGradient(a*h,i*l,u*h,c*l);else if(r===o.GradientPatternType.RadialGradient){var d=Math.sqrt(h*h+l*l)/2;f=n.createRadialGradient(a*h,i*l,0,u*h,c*l,t.r1*d)}return f&&(s.forEach((function(t){var n=R(t,2),e=n[0],r=n[1];null==f||f.addColorStop(Number(e),r)})),this.gradientCache[e]=f),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,a=t.x1,i=t.y1,o=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(a,"-").concat(i,"-").concat(o||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=S([Object(u.singleton)()],t)}();var G=u.Syringe.defineToken("PathGeneratorFactory"),q=u.Syringe.defineToken("PathGenerator"),F=1e-6,V="undefined"!=typeof Float32Array?Float32Array:Array,H=Math.random;Math.PI;function U(){var t=new V(16);return V!=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 Q(t){var n=new V(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 Z(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 z(t,n,e,r,a,i,o,u,c,s,h,l,f,d,p,v){var y=new V(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=a,y[5]=i,y[6]=o,y[7]=u,y[8]=c,y[9]=s,y[10]=h,y[11]=l,y[12]=f,y[13]=d,y[14]=p,y[15]=v,y}function J(t,n,e,r,a,i,o,u,c,s,h,l,f,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=a,t[4]=i,t[5]=o,t[6]=u,t[7]=c,t[8]=s,t[9]=h,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function W(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 K(t,n){if(t===n){var e=n[1],r=n[2],a=n[3],i=n[6],o=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]=i,t[11]=n[14],t[12]=a,t[13]=o,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 $(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=n[4],u=n[5],c=n[6],s=n[7],h=n[8],l=n[9],f=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*o,M=e*c-a*o,b=e*s-i*o,x=r*c-a*u,O=r*s-i*u,S=a*s-i*c,C=h*v-l*p,j=h*y-f*p,B=h*m-d*p,R=l*y-f*v,P=l*m-d*v,A=f*m-d*y,E=g*A-M*P+b*R+x*B-O*j+S*C;return E?(E=1/E,t[0]=(u*A-c*P+s*R)*E,t[1]=(a*P-r*A-i*R)*E,t[2]=(v*S-y*O+m*x)*E,t[3]=(f*O-l*S-d*x)*E,t[4]=(c*B-o*A-s*j)*E,t[5]=(e*A-a*B+i*j)*E,t[6]=(y*b-p*S-m*M)*E,t[7]=(h*S-f*b+d*M)*E,t[8]=(o*P-u*B+s*C)*E,t[9]=(r*B-e*P-i*C)*E,t[10]=(p*O-v*b+m*g)*E,t[11]=(l*b-h*O-d*g)*E,t[12]=(u*j-o*R-c*C)*E,t[13]=(e*R-r*j+a*C)*E,t[14]=(v*M-p*x-y*g)*E,t[15]=(h*x-l*M+f*g)*E,t):null}function tt(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=n[4],u=n[5],c=n[6],s=n[7],h=n[8],l=n[9],f=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(f*m-d*y)-l*(c*m-s*y)+v*(c*d-s*f),t[1]=-(r*(f*m-d*y)-l*(a*m-i*y)+v*(a*d-i*f)),t[2]=r*(c*m-s*y)-u*(a*m-i*y)+v*(a*s-i*c),t[3]=-(r*(c*d-s*f)-u*(a*d-i*f)+l*(a*s-i*c)),t[4]=-(o*(f*m-d*y)-h*(c*m-s*y)+p*(c*d-s*f)),t[5]=e*(f*m-d*y)-h*(a*m-i*y)+p*(a*d-i*f),t[6]=-(e*(c*m-s*y)-o*(a*m-i*y)+p*(a*s-i*c)),t[7]=e*(c*d-s*f)-o*(a*d-i*f)+h*(a*s-i*c),t[8]=o*(l*m-d*v)-h*(u*m-s*v)+p*(u*d-s*l),t[9]=-(e*(l*m-d*v)-h*(r*m-i*v)+p*(r*d-i*l)),t[10]=e*(u*m-s*v)-o*(r*m-i*v)+p*(r*s-i*u),t[11]=-(e*(u*d-s*l)-o*(r*d-i*l)+h*(r*s-i*u)),t[12]=-(o*(l*y-f*v)-h*(u*y-c*v)+p*(u*f-c*l)),t[13]=e*(l*y-f*v)-h*(r*y-a*v)+p*(r*f-a*l),t[14]=-(e*(u*y-c*v)-o*(r*y-a*v)+p*(r*c-a*u)),t[15]=e*(u*f-c*l)-o*(r*f-a*l)+h*(r*c-a*u),t}function nt(t){var n=t[0],e=t[1],r=t[2],a=t[3],i=t[4],o=t[5],u=t[6],c=t[7],s=t[8],h=t[9],l=t[10],f=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*o-e*i)*(l*y-f*v)-(n*u-r*i)*(h*y-f*p)+(n*c-a*i)*(h*v-l*p)+(e*u-r*o)*(s*y-f*d)-(e*c-a*o)*(s*v-l*d)+(r*c-a*u)*(s*p-h*d)}function et(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=n[8],f=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],O=e[3];return t[0]=M*r+b*u+x*l+O*v,t[1]=M*a+b*c+x*f+O*y,t[2]=M*i+b*s+x*d+O*m,t[3]=M*o+b*h+x*p+O*g,M=e[4],b=e[5],x=e[6],O=e[7],t[4]=M*r+b*u+x*l+O*v,t[5]=M*a+b*c+x*f+O*y,t[6]=M*i+b*s+x*d+O*m,t[7]=M*o+b*h+x*p+O*g,M=e[8],b=e[9],x=e[10],O=e[11],t[8]=M*r+b*u+x*l+O*v,t[9]=M*a+b*c+x*f+O*y,t[10]=M*i+b*s+x*d+O*m,t[11]=M*o+b*h+x*p+O*g,M=e[12],b=e[13],x=e[14],O=e[15],t[12]=M*r+b*u+x*l+O*v,t[13]=M*a+b*c+x*f+O*y,t[14]=M*i+b*s+x*d+O*m,t[15]=M*o+b*h+x*p+O*g,t}function rt(t,n,e){var r,a,i,o,u,c,s,h,l,f,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],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=n[8],f=n[9],d=n[10],p=n[11],t[0]=r,t[1]=a,t[2]=i,t[3]=o,t[4]=u,t[5]=c,t[6]=s,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=r*v+u*y+l*m+n[12],t[13]=a*v+c*y+f*m+n[13],t[14]=i*v+s*y+d*m+n[14],t[15]=o*v+h*y+p*m+n[15]),t}function at(t,n,e){var r=e[0],a=e[1],i=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]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=n[11]*i,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function it(t,n,e,r){var a,i,o,u,c,s,h,l,f,d,p,v,y,m,g,M,b,x,O,S,C,j,B,R,P=r[0],A=r[1],E=r[2],T=Math.hypot(P,A,E);return T<F?null:(P*=T=1/T,A*=T,E*=T,a=Math.sin(e),o=1-(i=Math.cos(e)),u=n[0],c=n[1],s=n[2],h=n[3],l=n[4],f=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=P*P*o+i,b=A*P*o+E*a,x=E*P*o-A*a,O=P*A*o-E*a,S=A*A*o+i,C=E*A*o+P*a,j=P*E*o+A*a,B=A*E*o-P*a,R=E*E*o+i,t[0]=u*M+l*b+v*x,t[1]=c*M+f*b+y*x,t[2]=s*M+d*b+m*x,t[3]=h*M+p*b+g*x,t[4]=u*O+l*S+v*C,t[5]=c*O+f*S+y*C,t[6]=s*O+d*S+m*C,t[7]=h*O+p*S+g*C,t[8]=u*j+l*B+v*R,t[9]=c*j+f*B+y*R,t[10]=s*j+d*B+m*R,t[11]=h*j+p*B+g*R,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function ot(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[4],o=n[5],u=n[6],c=n[7],s=n[8],h=n[9],l=n[10],f=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]=i*a+s*r,t[5]=o*a+h*r,t[6]=u*a+l*r,t[7]=c*a+f*r,t[8]=s*a-i*r,t[9]=h*a-o*r,t[10]=l*a-u*r,t[11]=f*a-c*r,t}function ut(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[0],o=n[1],u=n[2],c=n[3],s=n[8],h=n[9],l=n[10],f=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]=i*a-s*r,t[1]=o*a-h*r,t[2]=u*a-l*r,t[3]=c*a-f*r,t[8]=i*r+s*a,t[9]=o*r+h*a,t[10]=u*r+l*a,t[11]=c*r+f*a,t}function ct(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[0],o=n[1],u=n[2],c=n[3],s=n[4],h=n[5],l=n[6],f=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]=i*a+s*r,t[1]=o*a+h*r,t[2]=u*a+l*r,t[3]=c*a+f*r,t[4]=s*a-i*r,t[5]=h*a-o*r,t[6]=l*a-u*r,t[7]=f*a-c*r,t}function st(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 ht(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 lt(t,n,e){var r,a,i,o=e[0],u=e[1],c=e[2],s=Math.hypot(o,u,c);return s<F?null:(o*=s=1/s,u*=s,c*=s,r=Math.sin(n),i=1-(a=Math.cos(n)),t[0]=o*o*i+a,t[1]=u*o*i+c*r,t[2]=c*o*i-u*r,t[3]=0,t[4]=o*u*i-c*r,t[5]=u*u*i+a,t[6]=c*u*i+o*r,t[7]=0,t[8]=o*c*i+u*r,t[9]=u*c*i-o*r,t[10]=c*c*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ft(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 dt(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 pt(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 vt(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=r+r,c=a+a,s=i+i,h=r*u,l=r*c,f=r*s,d=a*c,p=a*s,v=i*s,y=o*u,m=o*c,g=o*s;return t[0]=1-(d+v),t[1]=l+g,t[2]=f-m,t[3]=0,t[4]=l-g,t[5]=1-(h+v),t[6]=p+y,t[7]=0,t[8]=f+m,t[9]=p-y,t[10]=1-(h+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function yt(t,n){var e=new V(3),r=-n[0],a=-n[1],i=-n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=r*r+a*a+i*i+o*o;return l>0?(e[0]=2*(u*o+h*r+c*i-s*a)/l,e[1]=2*(c*o+h*a+s*r-u*i)/l,e[2]=2*(s*o+h*i+u*a-c*r)/l):(e[0]=2*(u*o+h*r+c*i-s*a),e[1]=2*(c*o+h*a+s*r-u*i),e[2]=2*(s*o+h*i+u*a-c*r)),vt(t,n,e),t}function mt(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function gt(t,n){var e=n[0],r=n[1],a=n[2],i=n[4],o=n[5],u=n[6],c=n[8],s=n[9],h=n[10];return t[0]=Math.hypot(e,r,a),t[1]=Math.hypot(i,o,u),t[2]=Math.hypot(c,s,h),t}function Mt(t,n){var e=new V(3);gt(e,n);var r=1/e[0],a=1/e[1],i=1/e[2],o=n[0]*r,u=n[1]*a,c=n[2]*i,s=n[4]*r,h=n[5]*a,l=n[6]*i,f=n[8]*r,d=n[9]*a,p=n[10]*i,v=o+h+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(l-d)/y,t[1]=(f-c)/y,t[2]=(u-s)/y):o>h&&o>p?(y=2*Math.sqrt(1+o-h-p),t[3]=(l-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(f+c)/y):h>p?(y=2*Math.sqrt(1+h-o-p),t[3]=(f-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(l+d)/y):(y=2*Math.sqrt(1+p-o-h),t[3]=(u-s)/y,t[0]=(f+c)/y,t[1]=(l+d)/y,t[2]=.25*y),t}function bt(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=n[3],c=a+a,s=i+i,h=o+o,l=a*c,f=a*s,d=a*h,p=i*s,v=i*h,y=o*h,m=u*c,g=u*s,M=u*h,b=r[0],x=r[1],O=r[2];return t[0]=(1-(p+y))*b,t[1]=(f+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(f-M)*x,t[5]=(1-(l+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*O,t[9]=(v-m)*O,t[10]=(1-(l+p))*O,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function xt(t,n,e,r,a){var i=n[0],o=n[1],u=n[2],c=n[3],s=i+i,h=o+o,l=u+u,f=i*s,d=i*h,p=i*l,v=o*h,y=o*l,m=u*l,g=c*s,M=c*h,b=c*l,x=r[0],O=r[1],S=r[2],C=a[0],j=a[1],B=a[2],R=(1-(v+m))*x,P=(d+b)*x,A=(p-M)*x,E=(d-b)*O,T=(1-(f+m))*O,w=(y+g)*O,k=(p+M)*S,N=(y-g)*S,Y=(1-(f+v))*S;return t[0]=R,t[1]=P,t[2]=A,t[3]=0,t[4]=E,t[5]=T,t[6]=w,t[7]=0,t[8]=k,t[9]=N,t[10]=Y,t[11]=0,t[12]=e[0]+C-(R*C+E*j+k*B),t[13]=e[1]+j-(P*C+T*j+N*B),t[14]=e[2]+B-(A*C+w*j+Y*B),t[15]=1,t}function Ot(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e+e,u=r+r,c=a+a,s=e*o,h=r*o,l=r*u,f=a*o,d=a*u,p=a*c,v=i*o,y=i*u,m=i*c;return t[0]=1-l-p,t[1]=h+m,t[2]=f-y,t[3]=0,t[4]=h-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=f+y,t[9]=d-v,t[10]=1-s-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,n,e,r,a,i,o){var u=1/(e-n),c=1/(a-r),s=1/(i-o);return t[0]=2*i*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(a+r)*c,t[10]=(o+i)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*s,t[15]=0,t}function Ct(t,n,e,r,a){var i,o=1/Math.tan(n/2);return t[0]=o/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(r-a),t[10]=(a+r)*i,t[14]=2*a*r*i):(t[10]=-1,t[14]=-2*r),t}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;function Bt(t,n,e,r,a){var i,o=1/Math.tan(n/2);return t[0]=o/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(r-a),t[10]=a*i,t[14]=a*r*i):(t[10]=-1,t[14]=-r),t}function Rt(t,n,e,r){var a=Math.tan(n.upDegrees*Math.PI/180),i=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(o+u),s=2/(a+i);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]=-(o-u)*c*.5,t[9]=(a-i)*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 Pt(t,n,e,r,a,i,o){var u=1/(n-e),c=1/(r-a),s=1/(i-o);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]=(a+r)*c,t[14]=(o+i)*s,t[15]=1,t}var At=Pt;function Et(t,n,e,r,a,i,o){var u=1/(n-e),c=1/(r-a),s=1/(i-o);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]=(a+r)*c,t[14]=i*s,t[15]=1,t}function Tt(t,n,e,r){var a,i,o,u,c,s,h,l,f,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],O=e[2];return Math.abs(p-b)<F&&Math.abs(v-x)<F&&Math.abs(y-O)<F?W(t):(h=p-b,l=v-x,f=y-O,a=g*(f*=d=1/Math.hypot(h,l,f))-M*(l*=d),i=M*(h*=d)-m*f,o=m*l-g*h,(d=Math.hypot(a,i,o))?(a*=d=1/d,i*=d,o*=d):(a=0,i=0,o=0),u=l*o-f*i,c=f*a-h*o,s=h*i-l*a,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=a,t[1]=u,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=l,t[7]=0,t[8]=o,t[9]=s,t[10]=f,t[11]=0,t[12]=-(a*p+i*v+o*y),t[13]=-(u*p+c*v+s*y),t[14]=-(h*p+l*v+f*y),t[15]=1,t)}function wt(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=r[0],c=r[1],s=r[2],h=a-e[0],l=i-e[1],f=o-e[2],d=h*h+l*l+f*f;d>0&&(h*=d=1/Math.sqrt(d),l*=d,f*=d);var p=c*f-s*l,v=s*h-u*f,y=u*l-c*h;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]=l*y-f*v,t[5]=f*p-h*y,t[6]=h*v-l*p,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=a,t[13]=i,t[14]=o,t[15]=1,t}function kt(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 Nt(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 Yt(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 Dt(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 It(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 Xt(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 _t(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 Lt(t,n){var e=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],c=t[6],s=t[7],h=t[8],l=t[9],f=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],O=n[4],S=n[5],C=n[6],j=n[7],B=n[8],R=n[9],P=n[10],A=n[11],E=n[12],T=n[13],w=n[14],k=n[15];return Math.abs(e-g)<=F*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=F*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-b)<=F*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-x)<=F*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-O)<=F*Math.max(1,Math.abs(o),Math.abs(O))&&Math.abs(u-S)<=F*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-C)<=F*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(s-j)<=F*Math.max(1,Math.abs(s),Math.abs(j))&&Math.abs(h-B)<=F*Math.max(1,Math.abs(h),Math.abs(B))&&Math.abs(l-R)<=F*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(f-P)<=F*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-A)<=F*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-E)<=F*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(v-T)<=F*Math.max(1,Math.abs(v),Math.abs(T))&&Math.abs(y-w)<=F*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-k)<=F*Math.max(1,Math.abs(m),Math.abs(k))}var Gt=et,qt=Dt;function Ft(){var t=new V(3);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Vt(t){var n=new V(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Ht(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Ut(t,n,e){var r=new V(3);return r[0]=t,r[1]=n,r[2]=e,r}function Qt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Zt(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function zt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function Jt(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function Wt(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Kt(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function $t(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function tn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function nn(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 en(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 rn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function an(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function on(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 un(t,n){var e=n[0]-t[0],r=n[1]-t[1],a=n[2]-t[2];return Math.hypot(e,r,a)}function cn(t,n){var e=n[0]-t[0],r=n[1]-t[1],a=n[2]-t[2];return e*e+r*r+a*a}function sn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function hn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function ln(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function fn(t,n){var e=n[0],r=n[1],a=n[2],i=e*e+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function dn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function pn(t,n,e){var r=n[0],a=n[1],i=n[2],o=e[0],u=e[1],c=e[2];return t[0]=a*c-i*u,t[1]=i*o-r*c,t[2]=r*u-a*o,t}function vn(t,n,e,r){var a=n[0],i=n[1],o=n[2];return t[0]=a+r*(e[0]-a),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t}function yn(t,n,e,r,a,i){var o=i*i,u=o*(2*i-3)+1,c=o*(i-2)+i,s=o*(i-1),h=o*(3-2*i);return t[0]=n[0]*u+e[0]*c+r[0]*s+a[0]*h,t[1]=n[1]*u+e[1]*c+r[1]*s+a[1]*h,t[2]=n[2]*u+e[2]*c+r[2]*s+a[2]*h,t}function mn(t,n,e,r,a,i){var o=1-i,u=o*o,c=i*i,s=u*o,h=3*i*u,l=3*c*o,f=c*i;return t[0]=n[0]*s+e[0]*h+r[0]*l+a[0]*f,t[1]=n[1]*s+e[1]*h+r[1]*l+a[1]*f,t[2]=n[2]*s+e[2]*h+r[2]*l+a[2]*f,t}function gn(t,n){n=n||1;var e=2*H()*Math.PI,r=2*H()-1,a=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*a,t[1]=Math.sin(e)*a,t[2]=r*n,t}function Mn(t,n,e){var r=n[0],a=n[1],i=n[2],o=e[3]*r+e[7]*a+e[11]*i+e[15];return o=o||1,t[0]=(e[0]*r+e[4]*a+e[8]*i+e[12])/o,t[1]=(e[1]*r+e[5]*a+e[9]*i+e[13])/o,t[2]=(e[2]*r+e[6]*a+e[10]*i+e[14])/o,t}function bn(t,n,e){var r=n[0],a=n[1],i=n[2];return t[0]=r*e[0]+a*e[3]+i*e[6],t[1]=r*e[1]+a*e[4]+i*e[7],t[2]=r*e[2]+a*e[5]+i*e[8],t}function xn(t,n,e){var r=e[0],a=e[1],i=e[2],o=e[3],u=n[0],c=n[1],s=n[2],h=a*s-i*c,l=i*u-r*s,f=r*c-a*u,d=a*f-i*l,p=i*h-r*f,v=r*l-a*h,y=2*o;return h*=y,l*=y,f*=y,d*=2,p*=2,v*=2,t[0]=u+h+d,t[1]=c+l+p,t[2]=s+f+v,t}function On(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[0],i[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),i[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Sn(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),i[1]=a[1],i[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Cn(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),i[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),i[2]=a[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function jn(t,n){var e=t[0],r=t[1],a=t[2],i=n[0],o=n[1],u=n[2],c=Math.sqrt(e*e+r*r+a*a)*Math.sqrt(i*i+o*o+u*u),s=c&&dn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function Bn(t){return t[0]=0,t[1]=0,t[2]=0,t}function Rn(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Pn(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function An(t,n){var e=t[0],r=t[1],a=t[2],i=n[0],o=n[1],u=n[2];return Math.abs(e-i)<=F*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-o)<=F*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-u)<=F*Math.max(1,Math.abs(a),Math.abs(u))}var En,Tn=Jt,wn=Wt,kn=Kt,Nn=un,Yn=cn,Dn=Ht,In=sn,Xn=(En=Ft(),function(t,n,e,r,a,i){var o,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,o=e;o<u;o+=n)En[0]=t[o],En[1]=t[o+1],En[2]=t[o+2],a(En,En,i),t[o]=En[0],t[o+1]=En[1],t[o+2]=En[2];return t});function _n(t){var n=t[0],e=t[1],r=t[2],a=t[3];return Math.hypot(n,e,r,a)}function Ln(t){var n=t[0],e=t[1],r=t[2],a=t[3];return n*n+e*e+r*r+a*a}!function(){var t,n=(t=new V(4),V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Gn(){var t=new V(4);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function qn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Fn(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 Vn(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>F?(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 Hn(t,n){var e=xe(t,n);return Math.acos(2*e*e-1)}function Un(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=e[0],c=e[1],s=e[2],h=e[3];return t[0]=r*h+o*u+a*s-i*c,t[1]=a*h+o*c+i*u-r*s,t[2]=i*h+o*s+r*c-a*u,t[3]=o*h-r*u-a*c-i*s,t}function Qn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=a*c+i*u,t[2]=i*c-a*u,t[3]=o*c-r*u,t}function Zn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-i*u,t[1]=a*c+o*u,t[2]=i*c+r*u,t[3]=o*c-a*u,t}function zn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=a*c-r*u,t[2]=i*c+o*u,t[3]=o*c-i*u,t}function Jn(t,n){var e=n[0],r=n[1],a=n[2];return t[0]=e,t[1]=r,t[2]=a,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-a*a)),t}function Wn(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=Math.sqrt(e*e+r*r+a*a),u=Math.exp(i),c=o>0?u*Math.sin(o)/o:0;return t[0]=e*c,t[1]=r*c,t[2]=a*c,t[3]=u*Math.cos(o),t}function Kn(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=Math.sqrt(e*e+r*r+a*a),u=o>0?Math.atan2(o,i)/o:0;return t[0]=e*u,t[1]=r*u,t[2]=a*u,t[3]=.5*Math.log(e*e+r*r+a*a+i*i),t}function $n(t,n,e){return Kn(t,n),be(t,t,e),Wn(t,t),t}function te(t,n,e,r){var a,i,o,u,c,s=n[0],h=n[1],l=n[2],f=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(i=s*d+h*p+l*v+f*y)<0&&(i=-i,d=-d,p=-p,v=-v,y=-y),1-i>F?(a=Math.acos(i),o=Math.sin(a),u=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*h+c*p,t[2]=u*l+c*v,t[3]=u*f+c*y,t}function ne(t){var n=H(),e=H(),r=H(),a=Math.sqrt(1-n),i=Math.sqrt(n);return t[0]=a*Math.sin(2*Math.PI*e),t[1]=a*Math.cos(2*Math.PI*e),t[2]=i*Math.sin(2*Math.PI*r),t[3]=i*Math.cos(2*Math.PI*r),t}function ee(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e*e+r*r+a*a+i*i,u=o?1/o:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-a*u,t[3]=i*u,t}function re(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function ae(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 a=0;n[4]>n[0]&&(a=1),n[8]>n[3*a+a]&&(a=2);var i=(a+1)%3,o=(a+2)%3;e=Math.sqrt(n[3*a+a]-n[3*i+i]-n[3*o+o]+1),t[a]=.5*e,e=.5/e,t[3]=(n[3*i+o]-n[3*o+i])*e,t[i]=(n[3*i+a]+n[3*a+i])*e,t[o]=(n[3*o+a]+n[3*a+o])*e}return t}function ie(t,n,e,r){var a=.5*Math.PI/180;n*=a,e*=a,r*=a;var i=Math.sin(n),o=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),h=Math.cos(r);return t[0]=i*c*h-o*u*s,t[1]=o*u*h+i*c*s,t[2]=o*c*s-i*u*h,t[3]=o*c*h+i*u*s,t}function oe(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var ue,ce,se,he,le,fe,de,pe=function(t){var n=new V(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},ve=function(t,n,e,r){var a=new V(4);return a[0]=t,a[1]=n,a[2]=e,a[3]=r,a},ye=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},me=function(t,n,e,r,a){return t[0]=n,t[1]=e,t[2]=r,t[3]=a,t},ge=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},Me=Un,be=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},xe=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},Oe=function(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=n[3];return t[0]=a+r*(e[0]-a),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t[3]=u+r*(e[3]-u),t},Se=_n,Ce=Se,je=Ln,Be=je,Re=function(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e*e+r*r+a*a+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e*o,t[1]=r*o,t[2]=a*o,t[3]=i*o,t},Pe=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},Ae=function(t,n){var e=t[0],r=t[1],a=t[2],i=t[3],o=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-o)<=F*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-u)<=F*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=F*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(i-s)<=F*Math.max(1,Math.abs(i),Math.abs(s))},Ee=(ue=Ft(),ce=Ut(1,0,0),se=Ut(0,1,0),function(t,n,e){var r=dn(n,e);return r<-.999999?(pn(ue,ce,n),Dn(ue)<1e-6&&pn(ue,se,n),fn(ue,ue),Fn(t,ue,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(pn(ue,n,e),t[0]=ue[0],t[1]=ue[1],t[2]=ue[2],t[3]=1+r,Re(t,t))}),Te=(he=Gn(),le=Gn(),function(t,n,e,r,a,i){return te(he,n,a,i),te(le,e,r,i),te(t,he,le,2*i*(1-i)),t}),we=(fe=new V(9),V!=Float32Array&&(fe[1]=0,fe[2]=0,fe[3]=0,fe[5]=0,fe[6]=0,fe[7]=0),fe[0]=1,fe[4]=1,fe[8]=1,de=fe,function(t,n,e,r){return de[0]=e[0],de[3]=e[1],de[6]=e[2],de[1]=r[0],de[4]=r[1],de[7]=r[2],de[2]=-n[0],de[5]=-n[1],de[8]=-n[2],Re(t,ae(t,de))}),ke=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),Ne="RBushRoot",Ye=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 a=e.getRenderBounds();if(a){var i=R(a.getMin(),2),o=i[0],u=i[1],c=R(a.getMax(),2),s=c[0],h=c[1];r.aabb={id:e.entity,minX:o,minY:u,maxX:s,maxY:h}}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 ke,e.pushToSync(t.composedPath().slice(0,-2))},i=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))},u=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.tapPromise(n.tag,(function(){return j(e,void 0,void 0,(function(){var t,n,e,a;return B(this,(function(c){return this.renderingContext.root.addEventListener(o.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(o.ElementEvent.UNMOUNTED,i),this.renderingContext.root.addEventListener(o.ElementEvent.BOUNDS_CHANGED,u),t=this.canvasConfig,n=t.width,e=t.height,a=this.contextService.getContext(),this.clearRect(a,0,0,n,e),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(o.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(o.ElementEvent.UNMOUNTED,i),e.renderingContext.root.removeEventListener(o.ElementEvent.BOUNDS_CHANGED,u)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig,r=n.renderer,a=n.width,i=n.height,u=r.getConfig().enableDirtyRectangleRendering;e.clearFullScreen=!u||e.renderingContext.renderReasons.has(o.RenderReason.CAMERA_CHANGED),t&&(t.save(),e.clearFullScreen&&e.clearRect(t,0,0,a,i),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){e.syncRTree();var n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering,i=n.enableDirtyRectangleRenderingDebug,u=e.contextService.getContext(),c=e.renderQueue;if(r){if(!e.clearFullScreen){var s=e.safeMergeAABB.apply(e,P([e.mergeDirtyAABBs(e.renderQueue)],R(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,i=t.maxY,u=new o.AABB;return u.setMinMax(a.fromValues(n,e,0),a.fromValues(r,i,0)),u}))),!1));if(e.removedRBushNodeAABBs=[],o.AABB.isEmpty(s))return void(e.renderQueue=[]);var h=e.convertAABB2Rect(s),l=h.x,f=h.y,d=h.width,p=h.height;e.clearRect(u,l,f,d,p),u.beginPath(),u.rect(l,f,d,p),u.clip(),i&&(u.lineWidth=4,u.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),u.strokeRect(l,f,d,p)),c=e.searchDirtyObjects(s)}c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n&&n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(u,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){u.restore()})),e.restoreStack=[],e.clearFullScreen=!1,u.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)}))},t.prototype.clearRect=function(t,n,e,r,a){t.clearRect(n,e,r,a);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(n,e,r,a))},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(),a=this.restoreStack[this.restoreStack.length-1];a&&t.parentNode!==a;)r.restore(),this.restoreStack.pop(),a=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName,u=this.styleRendererFactory(i),c=!1;if(this.enableBatch&&u){var s=u.hash(t.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=t,c=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var h=t.style.clipPath;if(h){r.save(),this.applyTransform(r,h.getLocalTransform());var l=this.pathGeneratorFactory(h.nodeName);l&&this.useAnchor(r,h,(function(){r.beginPath(),l(r,h.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&&(!c&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===o.Shape.LINE||t.nodeName===o.Shape.PATH||t.nodeName===o.Shape.POLYLINE||r.closePath()),u&&!e.enableBatch&&u.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]),a=Math.floor(n[1]);return{x:r,y:a,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-a}},t.prototype.mergeDirtyAABBs=function(t){var n=new o.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=R(t.getMin(),2),r=e[0],a=e[1],i=R(t.getMax(),2),o=i[0],u=i[1];return this.rBush.search({minX:r,minY:a,maxX:o,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 o.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=R(r.getTranslation(a.create(),n),2),u=e[0],c=e[1],s=R(r.getScaling(a.create(),n),2),h=s[0],l=s[1],f=r.getRotation(i.create(),n),d=R(Object(o.getEuler)(a.create(),f),3),p=d[0],v=(d[1],d[2]),y=Object(o.fromRotationTranslationScale)(p||v,u,c,h,l);t.transform(y[0],y[1],y[3],y[4],y[6],y[7])},t.prototype.getColor=function(t,n,e,r){var a;if(t instanceof o.CSSGradientValue){if(t.type===o.GradientPatternType.LinearGradient||t.type===o.GradientPatternType.RadialGradient){var i=n.getGeometryBounds(),u=i&&2*i.halfExtents[0]||0,c=i&&2*i.halfExtents[1]||0;a=this.gradientPool.getOrCreateGradient(O(O({type:t.type},t.value),{width:u,height:c}),e)}else if(t.type===o.GradientPatternType.Pattern){var s=this.imagePool.getPatternSync(t.value);s?a=s:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}}else a=t.toString();return a},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,a=r.stroke,i=r.fill,u=r.opacity,c=r.lineDash,s=r.lineDashOffset,h=r.filter,l=r.shadowColor,f=r.shadowBlur,d=r.shadowOffsetX,p=r.shadowOffsetY;c&&Array.isArray(c)&&t.setLineDash(c.map((function(t){return t.value}))),Object(o.isNil)(s)||(t.lineDashOffset=s.value),Object(o.isNil)(u)||(t.globalAlpha*=u.value),Object(o.isNil)(a)||(t.strokeStyle=this.getColor(a,n,t,e)),Object(o.isNil)(i)||(t.fillStyle=this.getColor(i,n,t,e)),Object(o.isNil)(h)||(t.filter=n.style.filter),Object(o.isNil)(l)||(t.shadowColor=l.toString(),t.shadowBlur=f&&f.value||0,t.shadowOffsetX=d&&d.value||0,t.shadowOffsetY=p&&p.value||0)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var a=r.halfExtents,i=(n.parsedStyle||{}).anchor;t.translate(-(i&&i[0].value||0)*a[0]*2,-(i&&i[1].value||0)*a[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 o.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRenderer",S([Object(u.inject)(o.CanvasConfig),C("design:type",Object)],t.prototype,"canvasConfig",void 0),S([Object(u.inject)(o.DefaultCamera),C("design:type",o.Camera)],t.prototype,"camera",void 0),S([Object(u.inject)(o.ContextService),C("design:type",Object)],t.prototype,"contextService",void 0),S([Object(u.inject)(o.RenderingContext),C("design:type",Object)],t.prototype,"renderingContext",void 0),S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),S([Object(u.inject)(L),C("design:type",L)],t.prototype,"gradientPool",void 0),S([Object(u.inject)(G),C("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),S([Object(u.inject)(h),C("design:type",Function)],t.prototype,"styleRendererFactory",void 0),S([Object(u.inject)(o.DisplayObjectPool),C("design:type",o.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),S([Object(u.inject)(Ne),C("design:type",s.a)],t.prototype,"rBush",void 0),t=n=S([Object(u.singleton)({contrib:o.RenderingPluginContribution})],t)}(),De=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,a=r.nodeName,i=r.attributes;if(a===o.Shape.IMAGE){var u=i.img;Object(o.isString)(u)&&e.imagePool.getOrCreateImage(u).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},a=function(n){var r=n.target,a=n.attrName,i=n.newValue;r.nodeName===o.Shape.IMAGE&&"img"===a&&Object(o.isString)(i)&&e.imagePool.getOrCreateImage(i).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(n.tag,(function(){return j(e,void 0,void 0,(function(){return B(this,(function(t){return this.renderingContext.root.addEventListener(o.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(o.ElementEvent.ATTR_MODIFIED,a),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(o.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(o.ElementEvent.ATTR_MODIFIED,a)}))},t.tag="LoadImage",S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),S([Object(u.inject)(o.RenderingContext),C("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=S([Object(u.singleton)({contrib:o.RenderingPluginContribution})],t)}();u.GlobalContainer.register({token:{token:q,named:o.Shape.CIRCLE},useValue:function(t,n){var e=n.r;t.arc(e.value,e.value,e.value,0,2*Math.PI,!1)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.ELLIPSE},useValue:function(t,n){var e=n.rx,r=n.ry,a=e.value,i=r.value;if(t.ellipse)t.ellipse(a,i,a,i,0,0,2*Math.PI,!1);else{var o=a>i?a:i,u=a>i?1:a/i,c=a>i?i/a:1;t.save(),t.scale(u,c),t.arc(0,0,o,0,2*Math.PI)}}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.RECT},useValue:function(t,n){var e=n.radius,r=n.width,a=n.height,i=r.value,o=a.value;if(e&&e.some((function(t){return 0!==t.value}))){var u=R(e.map((function(t){return t.value})),4),c=u[0],s=u[1],h=u[2],l=u[3];t.moveTo(c,0),t.lineTo(i-s,0),0!==s&&t.arc(i-s,s,s,-Math.PI/2,0),t.lineTo(i,o-h),0!==h&&t.arc(i-h,o-h,h,0,Math.PI/2),t.lineTo(l,o),0!==l&&t.arc(l,o-l,l,Math.PI/2,Math.PI),t.lineTo(0,c),0!==c&&t.arc(c,c,c,Math.PI,1.5*Math.PI)}else t.rect(0,0,i,o)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,a=n.x2,i=n.y2,o=n.defX,u=void 0===o?0:o,c=n.defY,s=void 0===c?0:c;t.moveTo(e.value-u,r.value-s),t.lineTo(a.value-u,i.value-s)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.points.points,u=o.length,c=o[0][0]-r,s=o[0][1]-i,h=o[u-1][0]-r,l=o[u-1][1]-i;t.moveTo(c,s);for(var f=0;f<u-1;f++){var d=o[f];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(h,l)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.points.points,u=o.length,c=o[0][0]-r,s=o[0][1]-i,h=o[u-1][0]-r,l=o[u-1][1]-i;t.moveTo(c,s);for(var f=0;f<u-1;f++){var d=o[f];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(h,l)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.path,u=o.curve,c=o.zCommandIndexes,s=P([],R(u),!1);c.forEach((function(t,n){s.splice(t+n,1,["Z"])}));for(var h=0;h<s.length;h++){var l=s[h];switch(l[0]){case"M":t.moveTo(l[1]-r,l[2]-i);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-i,l[3]-r,l[4]-i,l[5]-r,l[6]-i);break;case"Z":t.closePath()}}}}),u.GlobalContainer.register({token:G,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(q,e)&&(n[e]=t.container.getNamed(q,e)),n[e]}}});var Ie=Object(u.Module)((function(t){var n;t(A),t({token:Ne,useValue:new s.a}),t(N),t(Y),t(k),t(E),t(T),t(D),t(I),t(X),t(_);var e=((n={})[o.Shape.CIRCLE]=l,n[o.Shape.ELLIPSE]=f,n[o.Shape.RECT]=d,n[o.Shape.IMAGE]=M,n[o.Shape.TEXT]=g,n[o.Shape.LINE]=p,n[o.Shape.POLYLINE]=v,n[o.Shape.POLYGON]=y,n[o.Shape.PATH]=m,n);t({token:h,useFactory:function(t){var n={};return function(r){var a=e[r];return a&&!n[r]&&t.container.isBound(a)&&(n[r]=t.container.get(a)),n[r]}}}),t(L),t(Ye),t(De)})),Xe=function(){function t(){this.name="canvas-renderer"}return t.prototype.init=function(t){t.load(Ie,!0)},t.prototype.destroy=function(t){t.unload(Ie)},t}()}])})); |
@@ -37,2 +37,3 @@ import type { RenderingService, RenderingPlugin } from '@antv/g'; | ||
apply(renderingService: RenderingService): void; | ||
private clearRect; | ||
private flush; | ||
@@ -39,0 +40,0 @@ private renderDisplayObject; |
@@ -141,6 +141,11 @@ import { __assign, __awaiter, __decorate, __generator, __metadata, __read, __spreadArray } from "tslib"; | ||
return __awaiter(_this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
var _a, width, height, context; | ||
return __generator(this, function (_b) { | ||
this.renderingContext.root.addEventListener(ElementEvent.MOUNTED, handleMounted); | ||
this.renderingContext.root.addEventListener(ElementEvent.UNMOUNTED, handleUnmounted); | ||
this.renderingContext.root.addEventListener(ElementEvent.BOUNDS_CHANGED, handleBoundsChanged); | ||
_a = this.canvasConfig, width = _a.width, height = _a.height; | ||
context = this.contextService.getContext(); | ||
this.clearRect(context, 0, 0, width, height); | ||
return [2 | ||
@@ -162,7 +167,10 @@ /*return*/ | ||
var enableDirtyRectangleRendering = _this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering; // clear fullscreen when: | ||
var _a = _this.canvasConfig, | ||
renderer = _a.renderer, | ||
width = _a.width, | ||
height = _a.height; | ||
var enableDirtyRectangleRendering = renderer.getConfig().enableDirtyRectangleRendering; // clear fullscreen when: | ||
// 1. dirty rectangle rendering disabled | ||
// 2. camera changed | ||
_this.clearFullScreen = !enableDirtyRectangleRendering || _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED); | ||
@@ -174,3 +182,3 @@ | ||
if (_this.clearFullScreen) { | ||
context.clearRect(0, 0, _this.canvasConfig.width, _this.canvasConfig.height); | ||
_this.clearRect(context, 0, 0, width, height); | ||
} // account for camera's world matrix | ||
@@ -224,3 +232,4 @@ | ||
context.clearRect(x, y, width, height); | ||
_this.clearRect(context, x, y, width, height); | ||
context.beginPath(); | ||
@@ -289,2 +298,12 @@ context.rect(x, y, width, height); | ||
CanvasRendererPlugin.prototype.clearRect = function (context, x, y, width, height) { | ||
context.clearRect(x, y, width, height); | ||
var background = this.canvasConfig.background; | ||
if (background) { | ||
context.fillStyle = background; | ||
context.fillRect(x, y, width, height); | ||
} | ||
}; | ||
CanvasRendererPlugin.prototype.flush = function (context, renderingService) { | ||
@@ -291,0 +310,0 @@ if (this.batchedDisplayObject) { |
import { __read } from "tslib"; | ||
import { parseRadius } from '../../utils/parse'; | ||
export function generatePath(context, parsedStyle) { | ||
@@ -9,8 +8,12 @@ var radius = parsedStyle.radius, | ||
var h = height.value; | ||
var r = radius && radius.value || 0; | ||
var hasRadius = radius && radius.some(function (r) { | ||
return r.value !== 0; | ||
}); | ||
if (r === 0) { | ||
if (!hasRadius) { | ||
context.rect(0, 0, w, h); | ||
} else { | ||
var _a = __read(parseRadius(r), 4), | ||
var _a = __read(radius.map(function (r) { | ||
return r.value; | ||
}), 4), | ||
r1 = _a[0], | ||
@@ -17,0 +20,0 @@ r2 = _a[1], |
@@ -37,2 +37,3 @@ import type { RenderingService, RenderingPlugin } from '@antv/g'; | ||
apply(renderingService: RenderingService): void; | ||
private clearRect; | ||
private flush; | ||
@@ -39,0 +40,0 @@ private renderDisplayObject; |
@@ -162,6 +162,11 @@ "use strict"; | ||
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () { | ||
return (0, _tslib.__generator)(this, function (_a) { | ||
var _a, width, height, context; | ||
return (0, _tslib.__generator)(this, function (_b) { | ||
this.renderingContext.root.addEventListener(_g.ElementEvent.MOUNTED, handleMounted); | ||
this.renderingContext.root.addEventListener(_g.ElementEvent.UNMOUNTED, handleUnmounted); | ||
this.renderingContext.root.addEventListener(_g.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged); | ||
_a = this.canvasConfig, width = _a.width, height = _a.height; | ||
context = this.contextService.getContext(); | ||
this.clearRect(context, 0, 0, width, height); | ||
return [2 | ||
@@ -183,7 +188,10 @@ /*return*/ | ||
var enableDirtyRectangleRendering = _this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering; // clear fullscreen when: | ||
var _a = _this.canvasConfig, | ||
renderer = _a.renderer, | ||
width = _a.width, | ||
height = _a.height; | ||
var enableDirtyRectangleRendering = renderer.getConfig().enableDirtyRectangleRendering; // clear fullscreen when: | ||
// 1. dirty rectangle rendering disabled | ||
// 2. camera changed | ||
_this.clearFullScreen = !enableDirtyRectangleRendering || _this.renderingContext.renderReasons.has(_g.RenderReason.CAMERA_CHANGED); | ||
@@ -195,3 +203,3 @@ | ||
if (_this.clearFullScreen) { | ||
context.clearRect(0, 0, _this.canvasConfig.width, _this.canvasConfig.height); | ||
_this.clearRect(context, 0, 0, width, height); | ||
} // account for camera's world matrix | ||
@@ -245,3 +253,4 @@ | ||
context.clearRect(x, y, width, height); | ||
_this.clearRect(context, x, y, width, height); | ||
context.beginPath(); | ||
@@ -310,2 +319,12 @@ context.rect(x, y, width, height); | ||
CanvasRendererPlugin.prototype.clearRect = function (context, x, y, width, height) { | ||
context.clearRect(x, y, width, height); | ||
var background = this.canvasConfig.background; | ||
if (background) { | ||
context.fillStyle = background; | ||
context.fillRect(x, y, width, height); | ||
} | ||
}; | ||
CanvasRendererPlugin.prototype.flush = function (context, renderingService) { | ||
@@ -312,0 +331,0 @@ if (this.batchedDisplayObject) { |
@@ -10,4 +10,2 @@ "use strict"; | ||
var _parse = require("../../utils/parse"); | ||
function generatePath(context, parsedStyle) { | ||
@@ -19,8 +17,12 @@ var radius = parsedStyle.radius, | ||
var h = height.value; | ||
var r = radius && radius.value || 0; | ||
var hasRadius = radius && radius.some(function (r) { | ||
return r.value !== 0; | ||
}); | ||
if (r === 0) { | ||
if (!hasRadius) { | ||
context.rect(0, 0, w, h); | ||
} else { | ||
var _a = (0, _tslib.__read)((0, _parse.parseRadius)(r), 4), | ||
var _a = (0, _tslib.__read)(radius.map(function (r) { | ||
return r.value; | ||
}), 4), | ||
r1 = _a[0], | ||
@@ -27,0 +29,0 @@ r2 = _a[1], |
{ | ||
"name": "@antv/g-plugin-canvas-renderer", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A G plugin of renderer implementation with Canvas2D API", | ||
@@ -35,3 +35,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@antv/g-math": "^1.1.1", | ||
"@antv/g-math": "^1.1.2", | ||
"rbush": "^3.0.1", | ||
@@ -52,3 +52,3 @@ "tslib": "^2.3.1" | ||
"homepage": "https://github.com/antvis/g#readme", | ||
"gitHead": "5152e91b7489c53f5d2a5c3d7cb645716c506f26" | ||
"gitHead": "633cec1df324421b0c0821cb18d3ee351c1a47f3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202784
112
3569
Updated@antv/g-math@^1.1.2