Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-plugin-canvas-renderer

Package Overview
Dependencies
Maintainers
58
Versions
262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-canvas-renderer - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

4

dist/index.umd.min.js

@@ -1,3 +0,3 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["exports","@antv/g","mana-syringe"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).G=e.G||{},e.G.CanvasRenderer={}),e.window.G,e.window.G.ManaSyringe)}(this,(function(e,t,n){"use strict";function r(e,t,n,r,o){i(e,t,n||0,r||e.length-1,o||a)}function i(e,t,n,r,a){for(;r>n;){if(r-n>600){var l=r-n+1,s=t-n+1,h=Math.log(l),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(l-c)/l)*(0>s-l/2?-1:1);i(e,t,Math.max(n,Math.floor(t-s*c/l+u)),Math.min(r,Math.floor(t+(l-s)*c/l+u)),a)}var d=e[t],f=n,p=r;for(o(e,n,t),a(e[r],d)>0&&o(e,n,r);p>f;){for(o(e,f,p),f++,p--;0>a(e[f],d);)f++;for(;a(e[p],d)>0;)p--}0===a(e[n],d)?o(e,n,p):o(e,++p,r),p>t||(n=p+1),t>p||(r=p-1)}}function o(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function a(e,t){return t>e?-1:e>t?1:0}class l{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!m(e,t))return n;const r=this.toBBox,i=[];for(;t;){for(let o=0;t.children.length>o;o++){const a=t.children[o],l=t.leaf?r(a):a;m(e,l)&&(t.leaf?n.push(a):y(e,l)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!m(e,t))return!1;const n=[];for(;t;){for(let r=0;t.children.length>r;r++){const i=t.children[r],o=t.leaf?this.toBBox(i):i;if(m(e,o)){if(t.leaf||y(e,o))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(this._minEntries>e.length){for(let t=0;e.length>t;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(t.height>this.data.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=x([]),this}remove(e,t){if(!e)return this;let n=this.data;const r=this.toBBox(e),i=[],o=[];let a,l,h;for(;n||i.length;){if(n||(n=i.pop(),l=i[i.length-1],a=o.pop(),h=!0),n.leaf){const r=s(e,n.children,t);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}h||n.leaf||!y(n,r)?l?(a++,n=l.children[a],h=!1):n=null:(i.push(n),o.push(a),a=0,l=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){const i=n-t+1;let o,a=this._maxEntries;if(a>=i)return o=x(e.slice(t,n+1)),h(o,this.toBBox),o;r||(a=Math.ceil(i/Math.pow(a,(r=Math.ceil(Math.log(i)/Math.log(a)))-1))),o=x([]),o.leaf=!1,o.height=r;const l=Math.ceil(i/a),s=l*Math.ceil(Math.sqrt(a));b(e,t,n,s,this.compareMinX);for(let i=t;n>=i;i+=s){const t=Math.min(i+s-1,n);b(e,i,t,l,this.compareMinY);for(let n=i;t>=n;n+=l){o.children.push(this._build(e,n,Math.min(n+l-1,t),r-1))}}return h(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let l=0;t.children.length>l;l++){const s=t.children[l],h=p(s),c=(Math.max((o=s).maxX,(i=e).maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-h;a>c?(a=c,r=r>h?h:r,n=s):c===a&&r>h&&(r=h,n=s)}t=n||t.children[0]}var i,o;return t}_insert(e,t,n){const r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),u(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){const n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=x(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,h(n,this.toBBox),h(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=x([e,t]),this.data.height=e.height+1,this.data.leaf=!1,h(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,o=1/0;for(let a=t;n-t>=a;a++){const t=c(e,0,a,this.toBBox),l=c(e,a,n,this.toBBox),s=g(t,l),h=p(t)+p(l);i>s?(i=s,r=a,o=o>h?h:o):s===i&&o>h&&(o=h,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){const r=e.leaf?this.compareMinX:d,i=e.leaf?this.compareMinY:f,o=this._allDistMargin(e,t,n,r);this._allDistMargin(e,t,n,i)>o&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this.toBBox,o=c(e,0,t,i),a=c(e,n-t,n,i);let l=v(o)+v(a);for(let r=t;n-t>r;r++){const t=e.children[r];u(o,e.leaf?i(t):t),l+=v(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];u(a,e.leaf?i(t):t),l+=v(a)}return l}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)u(t[r],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():h(e[n],this.toBBox)}}function s(e,t,n){if(!n)return t.indexOf(e);for(let r=0;t.length>r;r++)if(n(e,t[r]))return r;return-1}function h(e,t){c(e,0,e.children.length,t,e)}function c(e,t,n,r,i){i||(i=x(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;n>o;o++){const t=e.children[o];u(i,e.leaf?r(t):t)}return i}function u(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function d(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function v(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(e,t){return!(e.minX>t.minX||e.minY>t.minY||t.maxX>e.maxX||t.maxY>e.maxY)}function m(e,t){return!(t.minX>e.maxX||t.minY>e.maxY||e.minX>t.maxX||e.minY>t.maxY)}function x(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function b(e,t,n,i,o){const a=[t,n];for(;a.length;){if(i>=(n=a.pop())-(t=a.pop()))continue;const l=t+Math.ceil((n-t)/i/2)*i;r(e,l,t,n,o),a.push(t,l,l,n)}}var R=n.Syringe.defineToken("StyleRendererFactory"),C=n.Syringe.defineToken("CircleRenderer",{multiple:!1}),S=n.Syringe.defineToken("EllipseRenderer",{multiple:!1}),B=n.Syringe.defineToken("RectRenderer",{multiple:!1}),E=n.Syringe.defineToken("LineRenderer",{multiple:!1}),w=n.Syringe.defineToken("PolylineRenderer",{multiple:!1}),P=n.Syringe.defineToken("PolygonRenderer",{multiple:!1}),M=n.Syringe.defineToken("PathRenderer",{multiple:!1}),T=n.Syringe.defineToken("TextRenderer",{multiple:!1}),O=n.Syringe.defineToken("ImageRenderer",{multiple:!1});function A(e,t,n,r){var i,o=arguments.length,a=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(3>o?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function k(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var L=function(){function e(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var n=e.prototype;return n.getImageSync=function(e){return this.imageCache[e]},n.getOrCreateImage=function(e){var n=this;if(this.imageCache[e])return Promise.resolve(this.imageCache[e]);var r=this.canvasConfig.createImage;return new Promise((function(i,o){var a;r?a=r(e):t.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(e){o(e)},a.crossOrigin="Anonymous",a.src=e,n.imageCache[e]=a)}))},n.getPatternSync=function(e){var t=this.generatePatternKey(e);if(this.patternCache[t])return this.patternCache[t]},n.createPattern=function(e,t){var n=this;return this.getOrCreateImage(e.src).then((function(r){var i=n.generatePatternKey(e),o=t.createPattern(r,e.repetition);return o&&(n.patternCache[i]=o),n.patternCache[i]}))},n.generatePatternKey=function(e){return"pattern-"+e.src+"-"+e.repetition},e}();function N(){
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["exports","@antv/g","mana-syringe"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).G=e.G||{},e.G.CanvasRenderer={}),e.window.G,e.window.G.ManaSyringe)}(this,(function(e,t,n){"use strict";function r(e,t,n,r,o){i(e,t,n||0,r||e.length-1,o||a)}function i(e,t,n,r,a){for(;r>n;){if(r-n>600){var l=r-n+1,s=t-n+1,h=Math.log(l),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(l-c)/l)*(0>s-l/2?-1:1);i(e,t,Math.max(n,Math.floor(t-s*c/l+u)),Math.min(r,Math.floor(t+(l-s)*c/l+u)),a)}var d=e[t],f=n,p=r;for(o(e,n,t),a(e[r],d)>0&&o(e,n,r);p>f;){for(o(e,f,p),f++,p--;0>a(e[f],d);)f++;for(;a(e[p],d)>0;)p--}0===a(e[n],d)?o(e,n,p):o(e,++p,r),p>t||(n=p+1),t>p||(r=p-1)}}function o(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function a(e,t){return t>e?-1:e>t?1:0}class l{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!m(e,t))return n;const r=this.toBBox,i=[];for(;t;){for(let o=0;t.children.length>o;o++){const a=t.children[o],l=t.leaf?r(a):a;m(e,l)&&(t.leaf?n.push(a):y(e,l)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!m(e,t))return!1;const n=[];for(;t;){for(let r=0;t.children.length>r;r++){const i=t.children[r],o=t.leaf?this.toBBox(i):i;if(m(e,o)){if(t.leaf||y(e,o))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(this._minEntries>e.length){for(let t=0;e.length>t;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(t.height>this.data.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=x([]),this}remove(e,t){if(!e)return this;let n=this.data;const r=this.toBBox(e),i=[],o=[];let a,l,h;for(;n||i.length;){if(n||(n=i.pop(),l=i[i.length-1],a=o.pop(),h=!0),n.leaf){const r=s(e,n.children,t);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}h||n.leaf||!y(n,r)?l?(a++,n=l.children[a],h=!1):n=null:(i.push(n),o.push(a),a=0,l=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){const i=n-t+1;let o,a=this._maxEntries;if(a>=i)return o=x(e.slice(t,n+1)),h(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=x([]),o.leaf=!1,o.height=r;const l=Math.ceil(i/a),s=l*Math.ceil(Math.sqrt(a));b(e,t,n,s,this.compareMinX);for(let i=t;n>=i;i+=s){const t=Math.min(i+s-1,n);b(e,i,t,l,this.compareMinY);for(let n=i;t>=n;n+=l){const i=Math.min(n+l-1,t);o.children.push(this._build(e,n,i,r-1))}}return h(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let l=0;t.children.length>l;l++){const s=t.children[l],h=p(s),c=(i=e,o=s,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-h);a>c?(a=c,r=r>h?h:r,n=s):c===a&&r>h&&(r=h,n=s)}t=n||t.children[0]}var i,o;return t}_insert(e,t,n){const r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),u(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){const n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=x(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,h(n,this.toBBox),h(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=x([e,t]),this.data.height=e.height+1,this.data.leaf=!1,h(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,o=1/0;for(let a=t;n-t>=a;a++){const t=c(e,0,a,this.toBBox),l=c(e,a,n,this.toBBox),s=g(t,l),h=p(t)+p(l);i>s?(i=s,r=a,o=o>h?h:o):s===i&&o>h&&(o=h,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){const r=e.leaf?this.compareMinX:d,i=e.leaf?this.compareMinY:f,o=this._allDistMargin(e,t,n,r);this._allDistMargin(e,t,n,i)>o&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this.toBBox,o=c(e,0,t,i),a=c(e,n-t,n,i);let l=v(o)+v(a);for(let r=t;n-t>r;r++){const t=e.children[r];u(o,e.leaf?i(t):t),l+=v(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];u(a,e.leaf?i(t):t),l+=v(a)}return l}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)u(t[r],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():h(e[n],this.toBBox)}}function s(e,t,n){if(!n)return t.indexOf(e);for(let r=0;t.length>r;r++)if(n(e,t[r]))return r;return-1}function h(e,t){c(e,0,e.children.length,t,e)}function c(e,t,n,r,i){i||(i=x(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;n>o;o++){const t=e.children[o];u(i,e.leaf?r(t):t)}return i}function u(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function d(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function v(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(e,t){return!(e.minX>t.minX||e.minY>t.minY||t.maxX>e.maxX||t.maxY>e.maxY)}function m(e,t){return!(t.minX>e.maxX||t.minY>e.maxY||e.minX>t.maxX||e.minY>t.maxY)}function x(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function b(e,t,n,i,o){const a=[t,n];for(;a.length;){if(i>=(n=a.pop())-(t=a.pop()))continue;const l=t+Math.ceil((n-t)/i/2)*i;r(e,l,t,n,o),a.push(t,l,l,n)}}var R=n.Syringe.defineToken("StyleRendererFactory"),C=n.Syringe.defineToken("CircleRenderer",{multiple:!1}),S=n.Syringe.defineToken("EllipseRenderer",{multiple:!1}),w=n.Syringe.defineToken("RectRenderer",{multiple:!1}),B=n.Syringe.defineToken("LineRenderer",{multiple:!1}),E=n.Syringe.defineToken("PolylineRenderer",{multiple:!1}),P=n.Syringe.defineToken("PolygonRenderer",{multiple:!1}),M=n.Syringe.defineToken("PathRenderer",{multiple:!1}),T=n.Syringe.defineToken("TextRenderer",{multiple:!1}),O=n.Syringe.defineToken("ImageRenderer",{multiple:!1});function A(e,t,n,r){var i,o=arguments.length,a=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(3>o?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function k(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var L=function(){function e(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var n=e.prototype;return n.getImageSync=function(e){return this.imageCache[e]},n.getOrCreateImage=function(e){var n=this;if(this.imageCache[e])return Promise.resolve(this.imageCache[e]);var r=this.canvasConfig.createImage;return new Promise((function(i,o){var a;r?a=r(e):t.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(e){o(e)},a.crossOrigin="Anonymous",a.src=e,n.imageCache[e]=a)}))},n.getPatternSync=function(e){var t=this.generatePatternKey(e);if(this.patternCache[t])return this.patternCache[t]},n.createPattern=function(e,t){var n=this;return this.getOrCreateImage(e.src).then((function(r){var i=n.generatePatternKey(e),o=t.createPattern(r,e.repetition);return o&&(n.patternCache[i]=o),n.patternCache[i]}))},n.generatePatternKey=function(e){return"pattern-"+e.src+"-"+e.repetition},e}();function N(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
N=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=Object.create((t&&t.prototype instanceof u?t:u).prototype),o=new S(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=b(a,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,o),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function u(){}function d(){}function f(){}var p={};l(p,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(B([])));g&&g!==t&&n.call(g,i)&&(p=g);var y=f.prototype=u.prototype=Object.create(p);function m(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(i,o,a,l){var s=h(e[i],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(s.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function B(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=f,l(y,"constructor",f),l(f,"constructor",d),d.displayName=l(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},m(x.prototype),l(x.prototype,o,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(y),l(y,a,"Generator"),l(y,i,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=B,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var l=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(l&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===e||"continue"===e)&&t>=o.tryLoc&&o.finallyLoc>=t&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function j(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){j(o,r,i,a,l,"next",e)}function l(e){j(o,r,i,a,l,"throw",e)}a(void 0)}))}}function Y(){return Y=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function G(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X(e,t)}function X(e,t){return X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},X(e,t)}A([n.inject(t.CanvasConfig),k("design:type",Object)],L.prototype,"canvasConfig",void 0),L=A([n.singleton()],L),e.ImageRenderer=function(){function e(){this.imagePool=void 0}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n){var r,i=n.img,o=n.width.value,a=n.height.value;if(t.isString(i)?r=this.imagePool.getImageSync(i):(o||(o=i.width),a||(a=i.height),r=i),r)try{e.drawImage(r,0,0,o,a)}catch(e){}},e}(),A([n.inject(L),k("design:type",L)],e.ImageRenderer.prototype,"imagePool",void 0),e.ImageRenderer=A([n.singleton({token:O})],e.ImageRenderer),e.TextRenderer=function(){function e(){}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n,r){var i=n.lineWidth,o=n.textAlign,a=n.textBaseline,l=n.lineJoin,s=n.miterLimit,h=void 0===s?0:s,c=n.letterSpacing,u=void 0===c?0:c,d=n.stroke,f=n.fill,p=n.fillOpacity,v=n.strokeOpacity,g=n.opacity,y=n.metrics,m=n.dx,x=n.dy,b=y.lines,R=y.height,C=y.lineHeight,S=y.lineMetrics;e.font=y.font,e.lineWidth=i.value,e.textAlign=o.value,e.textBaseline=a.value,e.lineJoin=l.value,e.miterLimit=h;var B=0;"middle"===a.value?B=-R/2-C/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?B=-R:"top"!==a.value&&"hanging"!==a.value||(B=-C);var E=0;m&&m.unit===t.UnitType.kPixels&&(E+=m.value),x&&x.unit===t.UnitType.kPixels&&(B+=x.value);for(var w=0;b.length>w;w++){var P=i.value/2+E;B+=C,!t.isNil(d)&&i&&i.value&&this.drawLetterSpacing(e,b[w],S[w],o.value,P,B,u,p.value,v.value,g.value,!0),t.isNil(f)||this.drawLetterSpacing(e,b[w],S[w],o.value,P,B,u,p.value,v.value,g.value)}},n.drawLetterSpacing=function(e,t,n,r,i,o,a,l,s,h,c){if(void 0===c&&(c=!1),0!==a){var u=e.textAlign;e.textAlign="left";var d=i;"center"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var f=Array.from(t),p=e.measureText(t).width,v=0,g=0;f.length>g;++g){var y=f[g];c?this.strokeText(e,y,d,o,s):this.fillText(e,y,d,o,l,h),d+=p-(v=e.measureText(t.substring(g+1)).width)+a,p=v}e.textAlign=u}else c?this.strokeText(e,t,i,o,s):this.fillText(e,t,i,o,l,h)},n.fillText=function(e,n,r,i,o,a){var l,s=!t.isNil(o)&&1!==o;s&&(l=e.globalAlpha,e.globalAlpha=o*a),e.fillText(n,r,i),s&&(e.globalAlpha=l)},n.strokeText=function(e,n,r,i,o){var a,l=!t.isNil(o)&&1!==o;l&&(a=e.globalAlpha,e.globalAlpha=o),e.strokeText(n,r,i),l&&(e.globalAlpha=a)},e}(),e.TextRenderer=A([n.singleton({token:T})],e.TextRenderer);var D=function(){function e(){}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n){var r=n.fill,i=n.opacity,o=n.fillOpacity,a=n.stroke,l=n.strokeOpacity,s=n.lineWidth,h=n.lineCap,c=n.lineJoin,u=n.shadowColor,d=n.filter,f=n.miterLimit,p=!t.isNil(r),v=!t.isNil(a),g=0===r.alpha;if(p&&(t.isNil(o)||1===o.value?e.fill():(e.globalAlpha=o.value,e.fill(),e.globalAlpha=i.value)),v&&s&&s.value>0){var y,m,x;!t.isNil(l)&&1!==l.value&&(e.globalAlpha=l.value),e.lineWidth=s.value,t.isNil(f)||(e.miterLimit=f),t.isNil(h)||(e.lineCap=h.value),t.isNil(c)||(e.lineJoin=c.value);var b=!t.isNil(u),R=!t.isNil(d);b&&(m=e.shadowColor,t.isNil(y=e.shadowBlur)||(e.shadowColor="transparent",e.shadowBlur=0)),R&&!t.isNil(x=e.filter)&&x.indexOf("drop-shadow")>-1&&(e.filter=x.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var C=p&&!g;C&&e.stroke(),b&&(e.shadowColor=m,e.shadowBlur=y),R&&(e.filter=x),C||e.stroke()}},e}();D=A([n.singleton()],D),e.RectRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.RectRenderer=A([n.singleton({token:B})],e.RectRenderer),e.CircleRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.CircleRenderer=A([n.singleton({token:C})],e.CircleRenderer),e.EllipseRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.EllipseRenderer=A([n.singleton({token:S})],e.EllipseRenderer),e.LineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.LineRenderer=A([n.singleton({token:E})],e.LineRenderer),e.PolylineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PolylineRenderer=A([n.singleton({token:w})],e.PolylineRenderer),e.PolygonRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PolygonRenderer=A([n.singleton({token:P})],e.PolygonRenderer),e.PathRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PathRenderer=A([n.singleton({token:M})],e.PathRenderer);var I=function(){function e(){this.gradientCache={}}var n=e.prototype;return n.getOrCreateGradient=function(e,n){var r=this.generateCacheKey(e),i=e.type,o=e.x0,a=e.y0,l=e.x1,s=e.y1,h=e.steps,c=e.width,u=e.height;if(this.gradientCache[r])return this.gradientCache[r];var d=null;if(i===t.GradientPatternType.LinearGradient)d=n.createLinearGradient(o*c,a*u,l*c,s*u);else if(i===t.GradientPatternType.RadialGradient){d=n.createRadialGradient(o*c,a*u,0,l*c,s*u,e.r1*(Math.sqrt(c*c+u*u)/2))}return d&&(h.forEach((function(e){var t,n=e[1];null===(t=d)||void 0===t||t.addColorStop(Number(e[0]),n)})),this.gradientCache[r]=d),this.gradientCache[r]},n.generateCacheKey=function(e){return"gradient-"+e.type+"-"+e.x0+"-"+e.y0+"-"+e.x1+"-"+e.y1+"-"+(e.r1||0)+"-"+e.width+"-"+e.height+"-"+e.steps.map((function(e){return e.join("")})).join("-")},e}();I=A([n.singleton()],I);var F=n.Syringe.defineToken("PathGeneratorFactory"),H=n.Syringe.defineToken("PathGenerator"),U="undefined"!=typeof Float32Array?Float32Array:Array;function V(e,t){var n=t[4],r=t[5],i=t[6],o=t[8],a=t[9],l=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,r,i),e[2]=Math.hypot(o,a,l),e}function q(){var e=new U(3);return U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Q(e,t,n){var r=new U(3);return r[0]=e,r[1]=t,r[2]=n,r}function J(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],l=n[1],s=n[2];return e[0]=i*s-o*l,e[1]=o*a-r*s,e[2]=r*l-i*a,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var K,W=function(e){return Math.hypot(e[0],e[1],e[2])};K=q();!function(){var e,t=(e=new U(4),U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function z(){var e=new U(4);return U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Z(e,t,n,r){var i,o,a,l,s,h=t[0],c=t[1],u=t[2],d=t[3],f=n[0],p=n[1],v=n[2],g=n[3];return 0>(o=h*f+c*p+u*v+d*g)&&(o=-o,f=-f,p=-p,v=-v,g=-g),1-o>1e-6?(a=Math.sin(i=Math.acos(o)),l=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(l=1-r,s=r),e[0]=l*h+s*f,e[1]=l*c+s*p,e[2]=l*u+s*v,e[3]=l*d+s*g,e}var $,ee,te,ne,re,ie,oe,ae,le,se=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e},he=($=q(),ee=Q(1,0,0),te=Q(0,1,0),ne=z(),re=z(),ie=new U(9),U!=Float32Array&&(ie[1]=0,ie[2]=0,ie[3]=0,ie[5]=0,ie[6]=0,ie[7]=0),ie[0]=1,ie[4]=1,ie[8]=1,oe=ie,function(){this.aabb=void 0});he.tag="c-canvas-rbush-node";var ce,ue,de="RBushRoot",fe=(ae=function(){function e(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n=e.prototype;return n.syncRTree=function(){var e=this,t=[];Array.from(this.toSync).filter((function(e){return e.isConnected})).forEach((function(n){var r=n.rBushNode;r&&e.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],l=o[1],s=i.getMax();r.aabb={id:n.entity,minX:a,minY:l,maxX:s[0],maxY:s[1]}}r.aabb&&t.push(r.aabb)})),this.rBush.load(t),this.toSync.clear()},n.pushToSync=function(e){var t=this;e.forEach((function(e){t.toSync.add(e)}))},n.apply=function(e){var n=this,r=function(e){e.target.rBushNode=new he,n.pushToSync(e.composedPath().slice(0,-2))},i=function(e){var t=e.target,r=t.rBushNode;r.aabb&&(n.rBush.remove(r.aabb),n.toSync.delete(t),n.removedRBushNodeAABBs.push(r.aabb))},o=function(e){var t,r=e.target;(null===(t=r.ownerDocument)||void 0===t?void 0:t.documentElement)===n.renderingContext.root&&(e.detail.affectChildren&&r.forEach((function(e){n.pushToSync([e])})),n.pushToSync(e.composedPath().slice(0,-2)))};e.hooks.init.tapPromise(le.tag,_(N().mark((function e(){var a,l,s,h;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,o),l=(a=n.canvasConfig).width,s=a.height,h=n.contextService.getContext(),n.clearRect(h,0,0,l,s);case 6:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(le.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,o)})),e.hooks.beginFrame.tap(le.tag,(function(){var e=n.contextService.getContext(),r=n.canvasConfig,i=r.width,o=r.height,a=r.renderer.getConfig();n.clearFullScreen=!a.enableDirtyRectangleRendering||n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED),e&&(e.save(),n.clearFullScreen&&n.clearRect(e,0,0,i,o),n.applyTransform(e,n.camera.getOrthoMatrix()))})),e.hooks.endFrame.tap(le.tag,(function(){n.syncRTree();var r=n.canvasConfig.renderer.getConfig(),i=r.enableDirtyRectangleRendering,o=r.enableDirtyRectangleRenderingDebug,a=n.contextService.getContext(),l=n.renderQueue;if(i){if(!n.clearFullScreen){var s=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(e){var n=e.minX,r=e.minY,i=e.maxX,o=e.maxY,a=new t.AABB;return a.setMinMax(Q(n,r,0),Q(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],t.AABB.isEmpty(s))return void(n.renderQueue=[]);var h=n.convertAABB2Rect(s),c=h.x,u=h.y,d=h.width,f=h.height;n.clearRect(a,c,u,d,f),a.beginPath(),a.rect(c,u,d,f),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba("+255*Math.random()+", "+255*Math.random()+", "+255*Math.random()+", 1)",a.strokeRect(c,u,d,f)),l=n.searchDirtyObjects(s)}l.sort((function(e,t){return e.sortable.renderOrder-t.sortable.renderOrder})).forEach((function(t){t&&t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)})),n.enableBatch&&n.batchedStyleHash&&n.flush(a,e),n.renderQueue.forEach((function(e){n.saveDirtyAABB(e)})),n.renderQueue=[]}n.restoreStack.forEach((function(e){a.restore()})),n.restoreStack=[],n.clearFullScreen=!1,a.restore()})),e.hooks.render.tap(le.tag,(function(t){n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?n.renderQueue.push(t):t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)}))},n.clearRect=function(e,t,n,r,i){e.clearRect(t,n,r,i);var o=this.canvasConfig.background;o&&(e.fillStyle=o,e.fillRect(t,n,r,i))},n.flush=function(e,t){if(this.batchedDisplayObject){var n=this.styleRendererFactory(this.batchedDisplayObject.nodeName);n&&(this.applyAttributesToContext(e,this.batchedDisplayObject,t),e.closePath(),n.render(e,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),e.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},n.renderDisplayObject=function(e,n){for(var r=this,i=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&e.parentNode!==o;)i.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=this.styleRendererFactory(e.nodeName),l=!1;if(this.enableBatch&&a){var s=a.hash(e.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(i,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=e,l=!0)}i.save(),this.applyTransform(i,e.getLocalTransform());var h=e.style.clipPath;if(h){i.save(),this.applyTransform(i,h.getLocalTransform());var c=this.pathGeneratorFactory(h.nodeName);c&&this.useAnchor(i,h,(function(){i.beginPath(),c(i,h.parsedStyle),i.closePath()})),i.restore(),i.clip()}this.enableBatch||(i.save(),this.applyAttributesToContext(i,e,n)),this.useAnchor(i,e,(function(){var n=r.pathGeneratorFactory(e.nodeName);n&&(!l&&r.enableBatch||i.beginPath(),n(i,e.parsedStyle),r.enableBatch||e.nodeName===t.Shape.LINE||e.nodeName===t.Shape.PATH||e.nodeName===t.Shape.POLYLINE||i.closePath()),a&&!r.enableBatch&&a.render(i,e.parsedStyle,e)})),this.enableBatch||i.restore(),e.renderable.dirty=!1,this.restoreStack.push(e)},n.convertAABB2Rect=function(e){var t=e.getMin(),n=e.getMax(),r=Math.floor(t[0]),i=Math.floor(t[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},n.mergeDirtyAABBs=function(e){var n=new t.AABB;return e.forEach((function(e){var t=e.getRenderBounds();n.add(t);var r=e.renderable.dirtyRenderBounds;r&&n.add(r)})),n},n.searchDirtyObjects=function(e){var t=this,n=e.getMin(),r=n[0],i=n[1],o=e.getMax();return this.rBush.search({minX:r,minY:i,maxX:o[0],maxY:o[1]}).map((function(e){return t.displayObjectPool.getByEntity(e.id)}))},n.saveDirtyAABB=function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new t.AABB);var r=e.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},n.applyTransform=function(e,n){var r=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}(q(),n),i=r[0],o=r[1],a=V(q(),n),l=a[0],s=a[1],h=function(e,t){var n=new U(3);V(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,l=t[1]*i,s=t[2]*o,h=t[4]*r,c=t[5]*i,u=t[6]*o,d=t[8]*r,f=t[9]*i,p=t[10]*o,v=a+c+p,g=0;return v>0?(e[3]=.25*(g=2*Math.sqrt(v+1)),e[0]=(u-f)/g,e[1]=(d-s)/g,e[2]=(l-h)/g):a>c&&a>p?(e[3]=(u-f)/(g=2*Math.sqrt(1+a-c-p)),e[0]=.25*g,e[1]=(l+h)/g,e[2]=(d+s)/g):c>p?(e[3]=(d-s)/(g=2*Math.sqrt(1+c-a-p)),e[0]=(l+h)/g,e[1]=.25*g,e[2]=(u+f)/g):(e[3]=(l-h)/(g=2*Math.sqrt(1+p-a-c)),e[0]=(d+s)/g,e[1]=(u+f)/g,e[2]=.25*g),e}(z(),n),c=t.getEuler(q(),h),u=t.fromRotationTranslationScale(c[0]||c[2],i,o,l,s);e.transform(u[0],u[1],u[3],u[4],u[6],u[7])},n.getColor=function(e,n,r,i){var o;if(e instanceof t.CSSGradientValue){if(e.type===t.GradientPatternType.LinearGradient||e.type===t.GradientPatternType.RadialGradient){var a=n.getGeometryBounds();o=this.gradientPool.getOrCreateGradient(Y({type:e.type},e.value,{width:a&&2*a.halfExtents[0]||0,height:a&&2*a.halfExtents[1]||0}),r)}else if(e.type===t.GradientPatternType.Pattern){var l=this.imagePool.getPatternSync(e.value);l?o=l:this.imagePool.createPattern(e.value,r).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else o=""+e;return o},n.applyAttributesToContext=function(e,n,r){var i=n.parsedStyle,o=i.stroke,a=i.fill,l=i.opacity,s=i.lineDash,h=i.lineDashOffset,c=i.filter,u=i.shadowColor,d=i.shadowBlur,f=i.shadowOffsetX,p=i.shadowOffsetY;s&&Array.isArray(s)&&e.setLineDash(s.map((function(e){return e.value}))),t.isNil(h)||(e.lineDashOffset=h.value),t.isNil(l)||(e.globalAlpha*=l.value),t.isNil(o)||(e.strokeStyle=this.getColor(o,n,e,r)),t.isNil(a)||(e.fillStyle=this.getColor(a,n,e,r)),t.isNil(c)||(e.filter=n.style.filter),t.isNil(u)||(e.shadowColor=""+u,e.shadowBlur=d&&d.value||0,e.shadowOffsetX=f&&f.value||0,e.shadowOffsetY=p&&p.value||0)},n.useAnchor=function(e,t,n){var r=t.getGeometryBounds();if(r){var i=r.halfExtents,o=(t.parsedStyle||{}).anchor;e.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),n()}else n()},n.safeMergeAABB=function(){for(var e=new t.AABB,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(t){e.add(t)})),e},e}(),ae.tag="CanvasRenderer",le=ae);A([n.inject(t.CanvasConfig),k("design:type",Object)],fe.prototype,"canvasConfig",void 0),A([n.inject(t.DefaultCamera),k("design:type",t.Camera)],fe.prototype,"camera",void 0),A([n.inject(t.ContextService),k("design:type",Object)],fe.prototype,"contextService",void 0),A([n.inject(t.RenderingContext),k("design:type",Object)],fe.prototype,"renderingContext",void 0),A([n.inject(L),k("design:type",L)],fe.prototype,"imagePool",void 0),A([n.inject(I),k("design:type",I)],fe.prototype,"gradientPool",void 0),A([n.inject(F),k("design:type",Function)],fe.prototype,"pathGeneratorFactory",void 0),A([n.inject(R),k("design:type",Function)],fe.prototype,"styleRendererFactory",void 0),A([n.inject(t.DisplayObjectPool),k("design:type",t.DisplayObjectPool)],fe.prototype,"displayObjectPool",void 0),A([n.inject(de),k("design:type",l)],fe.prototype,"rBush",void 0),fe=le=A([n.singleton({contrib:t.RenderingPluginContribution})],fe);var pe=(ce=function(){function e(){this.imagePool=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this,r=function(r){var i=r.target;if(i.nodeName===t.Shape.IMAGE){var o=i.attributes.img;t.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))}},i=function(r){var i=r.target,o=r.newValue;i.nodeName===t.Shape.IMAGE&&"img"===r.attrName&&t.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))};e.hooks.init.tapPromise(ue.tag,_(N().mark((function e(){return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,i);case 2:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(ue.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,i)}))},e}(),ce.tag="LoadImage",ue=ce);A([n.inject(L),k("design:type",L)],pe.prototype,"imagePool",void 0),A([n.inject(t.RenderingContext),k("design:type",Object)],pe.prototype,"renderingContext",void 0),pe=ue=A([n.singleton({contrib:t.RenderingPluginContribution})],pe),n.GlobalContainer.register({token:{token:H,named:t.Shape.CIRCLE},useValue:function(e,t){var n=t.r;e.arc(n.value,n.value,n.value,0,2*Math.PI,!1)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.ELLIPSE},useValue:function(e,t){var n=t.rx.value,r=t.ry.value;if(e.ellipse)e.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;e.save(),e.scale(o,a),e.arc(0,0,i,0,2*Math.PI)}}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.RECT},useValue:function(e,t){var n=t.radius,r=t.width.value,i=t.height.value;if(n&&n.some((function(e){return 0!==e.value}))){var o=n.map((function(e){return e.value})),a=o[0],l=o[1],s=o[2],h=o[3];e.moveTo(a,0),e.lineTo(r-l,0),0!==l&&e.arc(r-l,l,l,-Math.PI/2,0),e.lineTo(r,i-s),0!==s&&e.arc(r-s,i-s,s,0,Math.PI/2),e.lineTo(h,i),0!==h&&e.arc(h,i-h,h,Math.PI/2,Math.PI),e.lineTo(0,a),0!==a&&e.arc(a,a,a,Math.PI,1.5*Math.PI)}else e.rect(0,0,r,i)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.LINE},useValue:function(e,t){var n=t.x2,r=t.y2,i=t.defX,o=void 0===i?0:i,a=t.defY,l=void 0===a?0:a;e.moveTo(t.x1.value-o,t.y1.value-l),e.lineTo(n.value-o,r.value-l)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.POLYLINE},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.points.points,l=a.length,s=a[l-1][0]-r,h=a[l-1][1]-o;e.moveTo(a[0][0]-r,a[0][1]-o);for(var c=0;l-1>c;c++){var u=a[c];e.lineTo(u[0]-r,u[1]-o)}e.lineTo(s,h)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.POLYGON},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.points.points,l=a.length,s=a[l-1][0]-r,h=a[l-1][1]-o;e.moveTo(a[0][0]-r,a[0][1]-o);for(var c=0;l-1>c;c++){var u=a[c];e.lineTo(u[0]-r,u[1]-o)}e.lineTo(s,h)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.PATH},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.path,l=a.zCommandIndexes,s=[].concat(a.curve);l.forEach((function(e,t){s.splice(e+t,1,["Z"])}));for(var h=0;s.length>h;h++){var c=s[h];switch(c[0]){case"M":e.moveTo(c[1]-r,c[2]-o);break;case"C":e.bezierCurveTo(c[1]-r,c[2]-o,c[3]-r,c[4]-o,c[5]-r,c[6]-o);break;case"Z":e.closePath()}}}}),n.GlobalContainer.register({token:F,useFactory:function(e){var t={};return function(n){return t[n]||e.container.isBoundNamed(H,n)&&(t[n]=e.container.getNamed(H,n)),t[n]}}});var ve=n.Module((function(n){var r;n(L),n({token:de,useValue:new l}),n(e.CircleRenderer),n(e.EllipseRenderer),n(e.RectRenderer),n(e.ImageRenderer),n(e.TextRenderer),n(e.LineRenderer),n(e.PolylineRenderer),n(e.PolygonRenderer),n(e.PathRenderer);var i=((r={})[t.Shape.CIRCLE]=C,r[t.Shape.ELLIPSE]=S,r[t.Shape.RECT]=B,r[t.Shape.IMAGE]=O,r[t.Shape.TEXT]=T,r[t.Shape.LINE]=E,r[t.Shape.POLYLINE]=w,r[t.Shape.POLYGON]=P,r[t.Shape.PATH]=M,r);n({token:R,useFactory:function(e){var t={};return function(n){var r=i[n];return r&&!t[n]&&e.container.isBound(r)&&(t[n]=e.container.get(r)),t[n]}}}),n(I),n(fe),n(pe)})),ge=function(){function e(){this.name="canvas-renderer"}var t=e.prototype;return t.init=function(e){e.load(ve,!0)},t.destroy=function(e){e.unload(ve)},e}();e.CircleRendererContribution=C,e.EllipseRendererContribution=S,e.ImageRendererContribution=O,e.LineRendererContribution=E,e.PathGenerator=H,e.PathGeneratorFactory=F,e.PathRendererContribution=M,e.Plugin=ge,e.PolygonRendererContribution=P,e.PolylineRendererContribution=w,e.RBush=l,e.RBushNode=he,e.RBushRoot=de,e.RectRendererContribution=B,e.StyleRendererFactory=R,e.TextRendererContribution=T,Object.defineProperty(e,"__esModule",{value:!0})}));
N=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=Object.create((t&&t.prototype instanceof u?t:u).prototype),o=new S(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return B()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=b(a,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,o),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function u(){}function d(){}function f(){}var p={};l(p,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(w([])));g&&g!==t&&n.call(g,i)&&(p=g);var y=f.prototype=u.prototype=Object.create(p);function m(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(i,o,a,l){var s=h(e[i],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(s.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function w(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:B}}function B(){return{value:void 0,done:!0}}return d.prototype=f,l(y,"constructor",f),l(f,"constructor",d),d.displayName=l(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},m(x.prototype),l(x.prototype,o,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(y),l(y,a,"Generator"),l(y,i,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=w,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var l=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(l&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===e||"continue"===e)&&t>=o.tryLoc&&o.finallyLoc>=t&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function j(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){j(o,r,i,a,l,"next",e)}function l(e){j(o,r,i,a,l,"throw",e)}a(void 0)}))}}function Y(){return Y=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function G(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X(e,t)}function X(e,t){return X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},X(e,t)}A([n.inject(t.CanvasConfig),k("design:type",Object)],L.prototype,"canvasConfig",void 0),L=A([n.singleton()],L),e.ImageRenderer=function(){function e(){this.imagePool=void 0}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n){var r,i=n.img,o=n.width.value,a=n.height.value;if(t.isString(i)?r=this.imagePool.getImageSync(i):(o||(o=i.width),a||(a=i.height),r=i),r)try{e.drawImage(r,0,0,o,a)}catch(e){}},e}(),A([n.inject(L),k("design:type",L)],e.ImageRenderer.prototype,"imagePool",void 0),e.ImageRenderer=A([n.singleton({token:O})],e.ImageRenderer),e.TextRenderer=function(){function e(){}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n,r){var i=n.lineWidth,o=n.textAlign,a=n.textBaseline,l=n.lineJoin,s=n.miterLimit,h=void 0===s?0:s,c=n.letterSpacing,u=void 0===c?0:c,d=n.stroke,f=n.fill,p=n.fillOpacity,v=n.strokeOpacity,g=n.opacity,y=n.metrics,m=n.dx,x=n.dy,b=y.lines,R=y.height,C=y.lineHeight,S=y.lineMetrics;e.font=y.font,e.lineWidth=i.value,e.textAlign=o.value,e.textBaseline=a.value,e.lineJoin=l.value,e.miterLimit=h;var w=0;"middle"===a.value?w=-R/2-C/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?w=-R:"top"!==a.value&&"hanging"!==a.value||(w=-C);var B=0;m&&m.unit===t.UnitType.kPixels&&(B+=m.value),x&&x.unit===t.UnitType.kPixels&&(w+=x.value);for(var E=0;b.length>E;E++){var P=i.value/2+B;w+=C,!t.isNil(d)&&i&&i.value&&this.drawLetterSpacing(e,b[E],S[E],o.value,P,w,u,p.value,v.value,g.value,!0),t.isNil(f)||this.drawLetterSpacing(e,b[E],S[E],o.value,P,w,u,p.value,v.value,g.value)}},n.drawLetterSpacing=function(e,t,n,r,i,o,a,l,s,h,c){if(void 0===c&&(c=!1),0!==a){var u=e.textAlign;e.textAlign="left";var d=i;"center"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var f=Array.from(t),p=e.measureText(t).width,v=0,g=0;f.length>g;++g){var y=f[g];c?this.strokeText(e,y,d,o,s):this.fillText(e,y,d,o,l,h),d+=p-(v=e.measureText(t.substring(g+1)).width)+a,p=v}e.textAlign=u}else c?this.strokeText(e,t,i,o,s):this.fillText(e,t,i,o,l,h)},n.fillText=function(e,n,r,i,o,a){var l,s=!t.isNil(o)&&1!==o;s&&(l=e.globalAlpha,e.globalAlpha=o*a),e.fillText(n,r,i),s&&(e.globalAlpha=l)},n.strokeText=function(e,n,r,i,o){var a,l=!t.isNil(o)&&1!==o;l&&(a=e.globalAlpha,e.globalAlpha=o),e.strokeText(n,r,i),l&&(e.globalAlpha=a)},e}(),e.TextRenderer=A([n.singleton({token:T})],e.TextRenderer);var D=function(){function e(){}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n){var r=n.fill,i=n.opacity,o=n.fillOpacity,a=n.stroke,l=n.strokeOpacity,s=n.lineWidth,h=n.lineCap,c=n.lineJoin,u=n.shadowColor,d=n.filter,f=n.miterLimit,p=!t.isNil(r),v=!t.isNil(a),g=0===r.alpha;if(p&&(t.isNil(o)||1===o.value?e.fill():(e.globalAlpha=o.value,e.fill(),e.globalAlpha=i.value)),v&&s&&s.value>0){var y,m,x;!t.isNil(l)&&1!==l.value&&(e.globalAlpha=l.value),e.lineWidth=s.value,t.isNil(f)||(e.miterLimit=f),t.isNil(h)||(e.lineCap=h.value),t.isNil(c)||(e.lineJoin=c.value);var b=!t.isNil(u),R=!t.isNil(d);b&&(m=e.shadowColor,t.isNil(y=e.shadowBlur)||(e.shadowColor="transparent",e.shadowBlur=0)),R&&!t.isNil(x=e.filter)&&x.indexOf("drop-shadow")>-1&&(e.filter=x.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var C=p&&!g;C&&e.stroke(),b&&(e.shadowColor=m,e.shadowBlur=y),R&&(e.filter=x),C||e.stroke()}},e}();D=A([n.singleton()],D),e.RectRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.RectRenderer=A([n.singleton({token:w})],e.RectRenderer),e.CircleRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.CircleRenderer=A([n.singleton({token:C})],e.CircleRenderer),e.EllipseRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.EllipseRenderer=A([n.singleton({token:S})],e.EllipseRenderer),e.LineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.LineRenderer=A([n.singleton({token:B})],e.LineRenderer),e.PolylineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PolylineRenderer=A([n.singleton({token:E})],e.PolylineRenderer),e.PolygonRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PolygonRenderer=A([n.singleton({token:P})],e.PolygonRenderer),e.PathRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PathRenderer=A([n.singleton({token:M})],e.PathRenderer);var I=function(){function e(){this.gradientCache={}}var n=e.prototype;return n.getOrCreateGradient=function(e,n){var r=this.generateCacheKey(e),i=e.type,o=e.x0,a=e.y0,l=e.x1,s=e.y1,h=e.steps,c=e.width,u=e.height;if(this.gradientCache[r])return this.gradientCache[r];var d=null;if(i===t.GradientPatternType.LinearGradient)d=n.createLinearGradient(o*c,a*u,l*c,s*u);else if(i===t.GradientPatternType.RadialGradient){var f=Math.sqrt(c*c+u*u)/2;d=n.createRadialGradient(o*c,a*u,0,l*c,s*u,e.r1*f)}return d&&(h.forEach((function(e){var t,n=e[1];null===(t=d)||void 0===t||t.addColorStop(Number(e[0]),n)})),this.gradientCache[r]=d),this.gradientCache[r]},n.generateCacheKey=function(e){return"gradient-"+e.type+"-"+e.x0+"-"+e.y0+"-"+e.x1+"-"+e.y1+"-"+(e.r1||0)+"-"+e.width+"-"+e.height+"-"+e.steps.map((function(e){return e.join("")})).join("-")},e}();I=A([n.singleton()],I);var F=n.Syringe.defineToken("PathGeneratorFactory"),H=n.Syringe.defineToken("PathGenerator"),U="undefined"!=typeof Float32Array?Float32Array:Array;function V(e,t){var n=t[4],r=t[5],i=t[6],o=t[8],a=t[9],l=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,r,i),e[2]=Math.hypot(o,a,l),e}function q(){var e=new U(3);return U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Q(e,t,n){var r=new U(3);return r[0]=e,r[1]=t,r[2]=n,r}function J(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],l=n[1],s=n[2];return e[0]=i*s-o*l,e[1]=o*a-r*s,e[2]=r*l-i*a,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var K,W=function(e){return Math.hypot(e[0],e[1],e[2])};K=q();!function(){var e,t=(e=new U(4),U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function z(){var e=new U(4);return U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Z(e,t,n,r){var i,o,a,l,s,h=t[0],c=t[1],u=t[2],d=t[3],f=n[0],p=n[1],v=n[2],g=n[3];return 0>(o=h*f+c*p+u*v+d*g)&&(o=-o,f=-f,p=-p,v=-v,g=-g),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),l=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(l=1-r,s=r),e[0]=l*h+s*f,e[1]=l*c+s*p,e[2]=l*u+s*v,e[3]=l*d+s*g,e}var $,ee,te,ne,re,ie,oe,ae,le,se=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e},he=($=q(),ee=Q(1,0,0),te=Q(0,1,0),ne=z(),re=z(),ie=new U(9),U!=Float32Array&&(ie[1]=0,ie[2]=0,ie[3]=0,ie[5]=0,ie[6]=0,ie[7]=0),ie[0]=1,ie[4]=1,ie[8]=1,oe=ie,function(){this.aabb=void 0});he.tag="c-canvas-rbush-node";var ce,ue,de="RBushRoot",fe=(ae=function(){function e(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n=e.prototype;return n.syncRTree=function(){var e=this,t=[];Array.from(this.toSync).filter((function(e){return e.isConnected})).forEach((function(n){var r=n.rBushNode;r&&e.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],l=o[1],s=i.getMax();r.aabb={id:n.entity,minX:a,minY:l,maxX:s[0],maxY:s[1]}}r.aabb&&t.push(r.aabb)})),this.rBush.load(t),this.toSync.clear()},n.pushToSync=function(e){var t=this;e.forEach((function(e){t.toSync.add(e)}))},n.apply=function(e){var n=this,r=function(e){e.target.rBushNode=new he,n.pushToSync(e.composedPath().slice(0,-2))},i=function(e){var t=e.target,r=t.rBushNode;r.aabb&&(n.rBush.remove(r.aabb),n.toSync.delete(t),n.removedRBushNodeAABBs.push(r.aabb))},o=function(e){var t,r=e.target;(null===(t=r.ownerDocument)||void 0===t?void 0:t.documentElement)===n.renderingContext.root&&(e.detail.affectChildren&&r.forEach((function(e){n.pushToSync([e])})),n.pushToSync(e.composedPath().slice(0,-2)))};e.hooks.init.tapPromise(le.tag,_(N().mark((function e(){var a,l,s,h;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,o),l=(a=n.canvasConfig).width,s=a.height,h=n.contextService.getContext(),n.clearRect(h,0,0,l,s);case 6:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(le.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,o)})),e.hooks.beginFrame.tap(le.tag,(function(){var e=n.contextService.getContext(),r=n.canvasConfig,i=r.width,o=r.height,a=r.renderer.getConfig();n.clearFullScreen=!a.enableDirtyRectangleRendering||n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED),e&&(e.save(),n.clearFullScreen&&n.clearRect(e,0,0,i,o),n.applyTransform(e,n.camera.getOrthoMatrix()))})),e.hooks.endFrame.tap(le.tag,(function(){n.syncRTree();var r=n.canvasConfig.renderer.getConfig(),i=r.enableDirtyRectangleRendering,o=r.enableDirtyRectangleRenderingDebug,a=n.contextService.getContext(),l=n.renderQueue;if(i){if(!n.clearFullScreen){var s=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(e){var n=e.minX,r=e.minY,i=e.maxX,o=e.maxY,a=new t.AABB;return a.setMinMax(Q(n,r,0),Q(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],t.AABB.isEmpty(s))return void(n.renderQueue=[]);var h=n.convertAABB2Rect(s),c=h.x,u=h.y,d=h.width,f=h.height;n.clearRect(a,c,u,d,f),a.beginPath(),a.rect(c,u,d,f),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba("+255*Math.random()+", "+255*Math.random()+", "+255*Math.random()+", 1)",a.strokeRect(c,u,d,f)),l=n.searchDirtyObjects(s)}l.sort((function(e,t){return e.sortable.renderOrder-t.sortable.renderOrder})).forEach((function(t){t&&t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)})),n.enableBatch&&n.batchedStyleHash&&n.flush(a,e),n.renderQueue.forEach((function(e){n.saveDirtyAABB(e)})),n.renderQueue=[]}n.restoreStack.forEach((function(e){a.restore()})),n.restoreStack=[],n.clearFullScreen=!1,a.restore()})),e.hooks.render.tap(le.tag,(function(t){n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?n.renderQueue.push(t):t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)}))},n.clearRect=function(e,t,n,r,i){e.clearRect(t,n,r,i);var o=this.canvasConfig.background;o&&(e.fillStyle=o,e.fillRect(t,n,r,i))},n.flush=function(e,t){if(this.batchedDisplayObject){var n=this.styleRendererFactory(this.batchedDisplayObject.nodeName);n&&(this.applyAttributesToContext(e,this.batchedDisplayObject,t),e.closePath(),n.render(e,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),e.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},n.renderDisplayObject=function(e,n){for(var r=this,i=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&e.parentNode!==o;)i.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=this.styleRendererFactory(e.nodeName),l=!1;if(this.enableBatch&&a){var s=a.hash(e.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(i,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=e,l=!0)}i.save(),this.applyTransform(i,e.getLocalTransform());var h=e.style.clipPath;if(h){i.save(),this.applyTransform(i,h.getLocalTransform());var c=this.pathGeneratorFactory(h.nodeName);c&&this.useAnchor(i,h,(function(){i.beginPath(),c(i,h.parsedStyle),i.closePath()})),i.restore(),i.clip()}this.enableBatch||(i.save(),this.applyAttributesToContext(i,e,n)),this.useAnchor(i,e,(function(){var n=r.pathGeneratorFactory(e.nodeName);n&&(!l&&r.enableBatch||i.beginPath(),n(i,e.parsedStyle),r.enableBatch||e.nodeName===t.Shape.LINE||e.nodeName===t.Shape.PATH||e.nodeName===t.Shape.POLYLINE||i.closePath()),a&&!r.enableBatch&&a.render(i,e.parsedStyle,e)})),this.enableBatch||i.restore(),e.renderable.dirty=!1,this.restoreStack.push(e)},n.convertAABB2Rect=function(e){var t=e.getMin(),n=e.getMax(),r=Math.floor(t[0]),i=Math.floor(t[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},n.mergeDirtyAABBs=function(e){var n=new t.AABB;return e.forEach((function(e){var t=e.getRenderBounds();n.add(t);var r=e.renderable.dirtyRenderBounds;r&&n.add(r)})),n},n.searchDirtyObjects=function(e){var t=this,n=e.getMin(),r=n[0],i=n[1],o=e.getMax();return this.rBush.search({minX:r,minY:i,maxX:o[0],maxY:o[1]}).map((function(e){return t.displayObjectPool.getByEntity(e.id)}))},n.saveDirtyAABB=function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new t.AABB);var r=e.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},n.applyTransform=function(e,n){var r=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}(q(),n),i=r[0],o=r[1],a=V(q(),n),l=a[0],s=a[1],h=function(e,t){var n=new U(3);V(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,l=t[1]*i,s=t[2]*o,h=t[4]*r,c=t[5]*i,u=t[6]*o,d=t[8]*r,f=t[9]*i,p=t[10]*o,v=a+c+p,g=0;return v>0?(g=2*Math.sqrt(v+1),e[3]=.25*g,e[0]=(u-f)/g,e[1]=(d-s)/g,e[2]=(l-h)/g):a>c&&a>p?(g=2*Math.sqrt(1+a-c-p),e[3]=(u-f)/g,e[0]=.25*g,e[1]=(l+h)/g,e[2]=(d+s)/g):c>p?(g=2*Math.sqrt(1+c-a-p),e[3]=(d-s)/g,e[0]=(l+h)/g,e[1]=.25*g,e[2]=(u+f)/g):(g=2*Math.sqrt(1+p-a-c),e[3]=(l-h)/g,e[0]=(d+s)/g,e[1]=(u+f)/g,e[2]=.25*g),e}(z(),n),c=t.getEuler(q(),h),u=t.fromRotationTranslationScale(c[0]||c[2],i,o,l,s);e.transform(u[0],u[1],u[3],u[4],u[6],u[7])},n.getColor=function(e,n,r,i){var o;if(e instanceof t.CSSGradientValue){if(e.type===t.GradientPatternType.LinearGradient||e.type===t.GradientPatternType.RadialGradient){var a=n.getGeometryBounds();o=this.gradientPool.getOrCreateGradient(Y({type:e.type},e.value,{width:a&&2*a.halfExtents[0]||0,height:a&&2*a.halfExtents[1]||0}),r)}else if(e.type===t.GradientPatternType.Pattern){var l=this.imagePool.getPatternSync(e.value);l?o=l:this.imagePool.createPattern(e.value,r).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else o=e.toString();return o},n.applyAttributesToContext=function(e,n,r){var i=n.parsedStyle,o=i.stroke,a=i.fill,l=i.opacity,s=i.lineDash,h=i.lineDashOffset,c=i.filter,u=i.shadowColor,d=i.shadowBlur,f=i.shadowOffsetX,p=i.shadowOffsetY;s&&Array.isArray(s)&&e.setLineDash(s.map((function(e){return e.value}))),t.isNil(h)||(e.lineDashOffset=h.value),t.isNil(l)||(e.globalAlpha*=l.value),t.isNil(o)||(e.strokeStyle=this.getColor(o,n,e,r)),t.isNil(a)||(e.fillStyle=this.getColor(a,n,e,r)),t.isNil(c)||(e.filter=n.style.filter),t.isNil(u)||(e.shadowColor=u.toString(),e.shadowBlur=d&&d.value||0,e.shadowOffsetX=f&&f.value||0,e.shadowOffsetY=p&&p.value||0)},n.useAnchor=function(e,t,n){var r=t.getGeometryBounds();if(r){var i=r.halfExtents,o=(t.parsedStyle||{}).anchor;e.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),n()}else n()},n.safeMergeAABB=function(){for(var e=new t.AABB,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(t){e.add(t)})),e},e}(),ae.tag="CanvasRenderer",le=ae);A([n.inject(t.CanvasConfig),k("design:type",Object)],fe.prototype,"canvasConfig",void 0),A([n.inject(t.DefaultCamera),k("design:type",t.Camera)],fe.prototype,"camera",void 0),A([n.inject(t.ContextService),k("design:type",Object)],fe.prototype,"contextService",void 0),A([n.inject(t.RenderingContext),k("design:type",Object)],fe.prototype,"renderingContext",void 0),A([n.inject(L),k("design:type",L)],fe.prototype,"imagePool",void 0),A([n.inject(I),k("design:type",I)],fe.prototype,"gradientPool",void 0),A([n.inject(F),k("design:type",Function)],fe.prototype,"pathGeneratorFactory",void 0),A([n.inject(R),k("design:type",Function)],fe.prototype,"styleRendererFactory",void 0),A([n.inject(t.DisplayObjectPool),k("design:type",t.DisplayObjectPool)],fe.prototype,"displayObjectPool",void 0),A([n.inject(de),k("design:type",l)],fe.prototype,"rBush",void 0),fe=le=A([n.singleton({contrib:t.RenderingPluginContribution})],fe);var pe=(ce=function(){function e(){this.imagePool=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this,r=function(r){var i=r.target;if(i.nodeName===t.Shape.IMAGE){var o=i.attributes.img;t.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))}},i=function(r){var i=r.target,o=r.newValue;i.nodeName===t.Shape.IMAGE&&"img"===r.attrName&&t.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))};e.hooks.init.tapPromise(ue.tag,_(N().mark((function e(){return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,i);case 2:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(ue.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,i)}))},e}(),ce.tag="LoadImage",ue=ce);A([n.inject(L),k("design:type",L)],pe.prototype,"imagePool",void 0),A([n.inject(t.RenderingContext),k("design:type",Object)],pe.prototype,"renderingContext",void 0),pe=ue=A([n.singleton({contrib:t.RenderingPluginContribution})],pe),n.GlobalContainer.register({token:{token:H,named:t.Shape.CIRCLE},useValue:function(e,t){var n=t.r;e.arc(n.value,n.value,n.value,0,2*Math.PI,!1)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.ELLIPSE},useValue:function(e,t){var n=t.rx.value,r=t.ry.value;if(e.ellipse)e.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;e.save(),e.scale(o,a),e.arc(0,0,i,0,2*Math.PI)}}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.RECT},useValue:function(e,t){var n=t.radius,r=t.width.value,i=t.height.value;if(n&&n.some((function(e){return 0!==e.value}))){var o=n.map((function(e){return e.value})),a=o[0],l=o[1],s=o[2],h=o[3];e.moveTo(a,0),e.lineTo(r-l,0),0!==l&&e.arc(r-l,l,l,-Math.PI/2,0),e.lineTo(r,i-s),0!==s&&e.arc(r-s,i-s,s,0,Math.PI/2),e.lineTo(h,i),0!==h&&e.arc(h,i-h,h,Math.PI/2,Math.PI),e.lineTo(0,a),0!==a&&e.arc(a,a,a,Math.PI,1.5*Math.PI)}else e.rect(0,0,r,i)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.LINE},useValue:function(e,t){var n=t.x2,r=t.y2,i=t.defX,o=void 0===i?0:i,a=t.defY,l=void 0===a?0:a;e.moveTo(t.x1.value-o,t.y1.value-l),e.lineTo(n.value-o,r.value-l)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.POLYLINE},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.points.points,l=a.length,s=a[l-1][0]-r,h=a[l-1][1]-o;e.moveTo(a[0][0]-r,a[0][1]-o);for(var c=0;l-1>c;c++){var u=a[c];e.lineTo(u[0]-r,u[1]-o)}e.lineTo(s,h)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.POLYGON},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.points.points,l=a.length,s=a[l-1][0]-r,h=a[l-1][1]-o;e.moveTo(a[0][0]-r,a[0][1]-o);for(var c=0;l-1>c;c++){var u=a[c];e.lineTo(u[0]-r,u[1]-o)}e.lineTo(s,h)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.PATH},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.path,l=a.zCommandIndexes,s=[].concat(a.curve);l.forEach((function(e,t){s.splice(e+t,1,["Z"])}));for(var h=0;s.length>h;h++){var c=s[h];switch(c[0]){case"M":e.moveTo(c[1]-r,c[2]-o);break;case"C":e.bezierCurveTo(c[1]-r,c[2]-o,c[3]-r,c[4]-o,c[5]-r,c[6]-o);break;case"Z":e.closePath()}}}}),n.GlobalContainer.register({token:F,useFactory:function(e){var t={};return function(n){return t[n]||e.container.isBoundNamed(H,n)&&(t[n]=e.container.getNamed(H,n)),t[n]}}});var ve=n.Module((function(n){var r;n(L),n({token:de,useValue:new l}),n(e.CircleRenderer),n(e.EllipseRenderer),n(e.RectRenderer),n(e.ImageRenderer),n(e.TextRenderer),n(e.LineRenderer),n(e.PolylineRenderer),n(e.PolygonRenderer),n(e.PathRenderer);var i=((r={})[t.Shape.CIRCLE]=C,r[t.Shape.ELLIPSE]=S,r[t.Shape.RECT]=w,r[t.Shape.IMAGE]=O,r[t.Shape.TEXT]=T,r[t.Shape.LINE]=B,r[t.Shape.POLYLINE]=E,r[t.Shape.POLYGON]=P,r[t.Shape.PATH]=M,r);n({token:R,useFactory:function(e){var t={};return function(n){var r=i[n];return r&&!t[n]&&e.container.isBound(r)&&(t[n]=e.container.get(r)),t[n]}}}),n(I),n(fe),n(pe)})),ge=function(){function e(){this.name="canvas-renderer"}var t=e.prototype;return t.init=function(e){e.load(ve,!0)},t.destroy=function(e){e.unload(ve)},e}();e.CircleRendererContribution=C,e.EllipseRendererContribution=S,e.ImageRendererContribution=O,e.LineRendererContribution=B,e.PathGenerator=H,e.PathGeneratorFactory=F,e.PathRendererContribution=M,e.Plugin=ge,e.PolygonRendererContribution=P,e.PolylineRendererContribution=E,e.RBush=l,e.RBushNode=he,e.RBushRoot=de,e.RectRendererContribution=w,e.StyleRendererFactory=R,e.TextRendererContribution=T,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@antv/g-plugin-canvas-renderer",
"version": "1.1.3",
"version": "1.1.4",
"description": "A G plugin of renderer implementation with Canvas2D API",

@@ -30,3 +30,3 @@ "keywords": [

"dependencies": {
"@antv/g-math": "^1.1.3",
"@antv/g-math": "^1.1.4",
"rbush": "^3.0.1",

@@ -46,3 +46,3 @@ "tslib": "^2.3.1"

},
"gitHead": "3a02a5b5f99a5bddbc52fabf6f3be6a38e3c746e"
"gitHead": "8c7cefec629c4a036903a55e9b435ef4ddbcf9c3"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc