@antv/g-canvas 1.7.5 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +64 -21
- package/dist/index.umd.min.js +6 -6
- package/package.json +8 -8
package/dist/index.umd.js
CHANGED
|
@@ -1739,7 +1739,12 @@
|
|
|
1739
1739
|
|
|
1740
1740
|
var displayObject = _this2.displayObjectPool.getByEntity(id);
|
|
1741
1741
|
|
|
1742
|
-
|
|
1742
|
+
var pointerEvents = displayObject.parsedStyle.pointerEvents; // account for `visibility`
|
|
1743
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events
|
|
1744
|
+
|
|
1745
|
+
var isVisibilityAffected = ['auto', 'visiblepainted', 'visiblefill', 'visiblestroke', 'visible'].includes(pointerEvents);
|
|
1746
|
+
|
|
1747
|
+
if ((!isVisibilityAffected || isVisibilityAffected && displayObject.isVisible()) && !displayObject.isCulled() && displayObject.isInteractive()) {
|
|
1743
1748
|
// parent is not included, eg. parent is clipped
|
|
1744
1749
|
if (displayObject.parentNode && queriedIds.indexOf(displayObject.parentNode.entity) === -1) {
|
|
1745
1750
|
return;
|
|
@@ -2387,12 +2392,15 @@
|
|
|
2387
2392
|
stroke = _displayObject$parsed.stroke,
|
|
2388
2393
|
lineWidth = _displayObject$parsed.lineWidth,
|
|
2389
2394
|
increasedLineWidthForHitTesting = _displayObject$parsed.increasedLineWidthForHitTesting,
|
|
2390
|
-
clipPathTargets = _displayObject$parsed.clipPathTargets
|
|
2395
|
+
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2396
|
+
pointerEvents = _displayObject$parsed.pointerEvents;
|
|
2391
2397
|
var halfLineWidth = ((lineWidth || 0) + (increasedLineWidthForHitTesting || 0)) / 2;
|
|
2392
2398
|
var absDistance = distance$1(r, r, position.x, position.y);
|
|
2393
2399
|
var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length);
|
|
2394
|
-
|
|
2395
|
-
var
|
|
2400
|
+
|
|
2401
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2402
|
+
hasFill = _isFillOrStrokeAffect[0],
|
|
2403
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2396
2404
|
|
|
2397
2405
|
if (hasFill && hasStroke || isClipPath) {
|
|
2398
2406
|
return absDistance <= r + halfLineWidth;
|
|
@@ -2423,10 +2431,14 @@
|
|
|
2423
2431
|
stroke = _displayObject$parsed.stroke,
|
|
2424
2432
|
lineWidth = _displayObject$parsed.lineWidth,
|
|
2425
2433
|
increasedLineWidthForHitTesting = _displayObject$parsed.increasedLineWidthForHitTesting,
|
|
2426
|
-
clipPathTargets = _displayObject$parsed.clipPathTargets
|
|
2434
|
+
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2435
|
+
pointerEvents = _displayObject$parsed.pointerEvents;
|
|
2427
2436
|
var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length);
|
|
2428
|
-
|
|
2429
|
-
var
|
|
2437
|
+
|
|
2438
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2439
|
+
hasFill = _isFillOrStrokeAffect[0],
|
|
2440
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2441
|
+
|
|
2430
2442
|
var halfLineWith = ((lineWidth || 0) + (increasedLineWidthForHitTesting || 0)) / 2;
|
|
2431
2443
|
var squareX = (x - rx) * (x - rx);
|
|
2432
2444
|
var squareY = (y - ry) * (y - ry); // 使用椭圆的公式: x*x/rx*rx + y*y/ry*ry = 1;
|
|
@@ -2457,7 +2469,21 @@
|
|
|
2457
2469
|
_displayObject$parsed2 = _displayObject$parsed.defX,
|
|
2458
2470
|
x = _displayObject$parsed2 === void 0 ? 0 : _displayObject$parsed2,
|
|
2459
2471
|
_displayObject$parsed3 = _displayObject$parsed.defY,
|
|
2460
|
-
y = _displayObject$parsed3 === void 0 ? 0 : _displayObject$parsed3
|
|
2472
|
+
y = _displayObject$parsed3 === void 0 ? 0 : _displayObject$parsed3,
|
|
2473
|
+
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2474
|
+
pointerEvents = _displayObject$parsed.pointerEvents,
|
|
2475
|
+
fill = _displayObject$parsed.fill,
|
|
2476
|
+
stroke = _displayObject$parsed.stroke;
|
|
2477
|
+
var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length); // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2478
|
+
|
|
2479
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2480
|
+
_ = _isFillOrStrokeAffect[0],
|
|
2481
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2482
|
+
|
|
2483
|
+
if (!hasStroke && !isClipPath || !lineWidth) {
|
|
2484
|
+
return false;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2461
2487
|
return inLine(x1, y1, x2, y2, (lineWidth || 0) + (increasedLineWidthForHitTesting || 0), position.x + x, position.y + y);
|
|
2462
2488
|
}
|
|
2463
2489
|
|
|
@@ -2504,9 +2530,13 @@
|
|
|
2504
2530
|
_displayObject$parsed3 = _displayObject$parsed.defY,
|
|
2505
2531
|
y = _displayObject$parsed3 === void 0 ? 0 : _displayObject$parsed3,
|
|
2506
2532
|
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2507
|
-
path = _displayObject$parsed.path
|
|
2508
|
-
|
|
2509
|
-
|
|
2533
|
+
path = _displayObject$parsed.path,
|
|
2534
|
+
pointerEvents = _displayObject$parsed.pointerEvents;
|
|
2535
|
+
|
|
2536
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2537
|
+
hasFill = _isFillOrStrokeAffect[0],
|
|
2538
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2539
|
+
|
|
2510
2540
|
var segments = path.segments,
|
|
2511
2541
|
hasArc = path.hasArc,
|
|
2512
2542
|
polylines = path.polylines,
|
|
@@ -2565,10 +2595,14 @@
|
|
|
2565
2595
|
x = _displayObject$parsed2 === void 0 ? 0 : _displayObject$parsed2,
|
|
2566
2596
|
_displayObject$parsed3 = _displayObject$parsed.defY,
|
|
2567
2597
|
y = _displayObject$parsed3 === void 0 ? 0 : _displayObject$parsed3,
|
|
2568
|
-
clipPathTargets = _displayObject$parsed.clipPathTargets
|
|
2598
|
+
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2599
|
+
pointerEvents = _displayObject$parsed.pointerEvents;
|
|
2569
2600
|
var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length);
|
|
2570
|
-
|
|
2571
|
-
var
|
|
2601
|
+
|
|
2602
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2603
|
+
hasFill = _isFillOrStrokeAffect[0],
|
|
2604
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2605
|
+
|
|
2572
2606
|
var isHit = false;
|
|
2573
2607
|
|
|
2574
2608
|
if (hasStroke || isClipPath) {
|
|
@@ -2584,7 +2618,6 @@
|
|
|
2584
2618
|
|
|
2585
2619
|
function isPointInPath$5(displayObject, position) {
|
|
2586
2620
|
var _displayObject$parsed = displayObject.parsedStyle,
|
|
2587
|
-
stroke = _displayObject$parsed.stroke,
|
|
2588
2621
|
lineWidth = _displayObject$parsed.lineWidth,
|
|
2589
2622
|
increasedLineWidthForHitTesting = _displayObject$parsed.increasedLineWidthForHitTesting,
|
|
2590
2623
|
points = _displayObject$parsed.points,
|
|
@@ -2592,9 +2625,15 @@
|
|
|
2592
2625
|
x = _displayObject$parsed2 === void 0 ? 0 : _displayObject$parsed2,
|
|
2593
2626
|
_displayObject$parsed3 = _displayObject$parsed.defY,
|
|
2594
2627
|
y = _displayObject$parsed3 === void 0 ? 0 : _displayObject$parsed3,
|
|
2595
|
-
clipPathTargets = _displayObject$parsed.clipPathTargets
|
|
2596
|
-
|
|
2597
|
-
|
|
2628
|
+
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2629
|
+
pointerEvents = _displayObject$parsed.pointerEvents,
|
|
2630
|
+
fill = _displayObject$parsed.fill,
|
|
2631
|
+
stroke = _displayObject$parsed.stroke;
|
|
2632
|
+
var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length); // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2633
|
+
|
|
2634
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2635
|
+
_ = _isFillOrStrokeAffect[0],
|
|
2636
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2598
2637
|
|
|
2599
2638
|
if (!hasStroke && !isClipPath || !lineWidth) {
|
|
2600
2639
|
return false;
|
|
@@ -2612,10 +2651,14 @@
|
|
|
2612
2651
|
increasedLineWidthForHitTesting = _displayObject$parsed.increasedLineWidthForHitTesting,
|
|
2613
2652
|
width = _displayObject$parsed.width,
|
|
2614
2653
|
height = _displayObject$parsed.height,
|
|
2615
|
-
clipPathTargets = _displayObject$parsed.clipPathTargets
|
|
2654
|
+
clipPathTargets = _displayObject$parsed.clipPathTargets,
|
|
2655
|
+
pointerEvents = _displayObject$parsed.pointerEvents;
|
|
2616
2656
|
var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length);
|
|
2617
|
-
|
|
2618
|
-
var
|
|
2657
|
+
|
|
2658
|
+
var _isFillOrStrokeAffect = g.isFillOrStrokeAffected(pointerEvents, fill, stroke),
|
|
2659
|
+
hasFill = _isFillOrStrokeAffect[0],
|
|
2660
|
+
hasStroke = _isFillOrStrokeAffect[1];
|
|
2661
|
+
|
|
2619
2662
|
var hasRadius = radius && radius.some(function (r) {
|
|
2620
2663
|
return r !== 0;
|
|
2621
2664
|
});
|
package/dist/index.umd.min.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g")):"function"==typeof define&&define.amd?define(["exports","@antv/g"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G)}(this,(function(t,e){"use strict";function r(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=h(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(P([])));g&&g!==e&&n.call(g,i)&&(v=g);var m=d.prototype=f.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var s=h(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,s(m,"constructor",d),s(d,"constructor",p),p.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(x.prototype),s(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)}))}}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var s=e.Syringe.defineToken(""),u=e.Syringe.defineToken("");function h(t,e){var r=e.r;t.arc(r,r,r,0,2*Math.PI,!1)}function l(t,e){var r=e.rx,n=e.ry;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function f(t,r){var n,o,i=r.x1,a=r.y1,c=r.x2,s=r.y2,u=r.defX,h=void 0===u?0:u,l=r.defY,f=void 0===l?0:l,p=r.markerStart,d=r.markerEnd,v=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,x=0,b=0;p&&p instanceof e.DisplayObject&&v&&(n=c-i,o=s-a,b=Math.atan2(o,n),g=Math.cos(b)*(v||0),m=Math.sin(b)*(v||0)),d&&d instanceof e.DisplayObject&&y&&(n=i-c,o=a-s,b=Math.atan2(o,n),w=Math.cos(b)*(y||0),x=Math.sin(b)*(y||0)),t.moveTo(i-h+g,a-f+m),t.lineTo(c-h+w,s-f+x)}function p(t,r){var n=r.defX,o=void 0===n?0:n,i=r.defY,a=void 0===i?0:i,c=r.markerStart,s=r.markerEnd,u=r.markerStartOffset,h=r.markerEndOffset,l=r.path,f=l.zCommandIndexes,p=[].concat(l.curve);f.forEach((function(t,e){p.splice(t+e,1,["Z"])}));var d,v,y=p.length&&"Z"===p[p.length-1][0],g=0,m=0,w=0,x=0,b=0;if(c&&c instanceof e.DisplayObject&&u){var E=c.parentNode.getStartTangent(),L=E[0],O=E[1];d=L[0]-O[0],v=L[1]-O[1],b=Math.atan2(v,d),g=Math.cos(b)*(u||0),m=Math.sin(b)*(u||0)}if(s&&s instanceof e.DisplayObject&&h){var P=s.parentNode.getEndTangent(),S=P[0],C=P[1];d=S[0]-C[0],v=S[1]-C[1],b=Math.atan2(v,d),w=Math.cos(b)*(h||0),x=Math.sin(b)*(h||0)}for(var k=0;p.length>k;k++){var M=p[k];switch(M[0]){case"M":t.moveTo(M[1]-o+g,M[2]-a+m);break;case"C":t.bezierCurveTo(M[1]-o,M[2]-a,M[3]-o,M[4]-a,M[5]-o+(k===p.length-(y?2:1)?w:0),M[6]-a+(k===p.length-(y?2:1)?x:0));break;case"Z":t.closePath()}}}function d(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,s=void 0===c?0:c,u=r.markerStart,h=r.markerEnd,l=r.markerStartOffset,f=r.markerEndOffset,p=r.points.points,d=p.length,v=p[0][0]-a,y=p[0][1]-s,g=p[d-1][0]-a,m=p[d-1][1]-s,w=0,x=0,b=0,E=0,L=0;u&&u instanceof e.DisplayObject&&l&&(n=p[1][0]-p[0][0],o=p[1][1]-p[0][1],L=Math.atan2(o,n),w=Math.cos(L)*(l||0),x=Math.sin(L)*(l||0)),h&&h instanceof e.DisplayObject&&f&&(n=p[d-1][0]-p[0][0],o=p[d-1][1]-p[0][1],L=Math.atan2(o,n),b=Math.cos(L)*(f||0),E=Math.sin(L)*(f||0)),t.moveTo(v+(w||b),y+(x||E));for(var O=1;d-1>O;O++){var P=p[O];t.lineTo(P[0]-a,P[1]-s)}t.lineTo(g,m)}function v(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,s=void 0===c?0:c,u=r.markerStart,h=r.markerEnd,l=r.markerStartOffset,f=r.markerEndOffset,p=r.points.points,d=p.length,v=p[0][0]-a,y=p[0][1]-s,g=p[d-1][0]-a,m=p[d-1][1]-s,w=0,x=0,b=0,E=0,L=0;u&&u instanceof e.DisplayObject&&l&&(n=p[1][0]-p[0][0],o=p[1][1]-p[0][1],L=Math.atan2(o,n),w=Math.cos(L)*(l||0),x=Math.sin(L)*(l||0)),h&&h instanceof e.DisplayObject&&f&&(n=p[d-2][0]-p[d-1][0],o=p[d-2][1]-p[d-1][1],L=Math.atan2(o,n),b=Math.cos(L)*(f||0),E=Math.sin(L)*(f||0)),t.moveTo(v+w,y+x);for(var O=1;d-1>O;O++){var P=p[O];t.lineTo(P[0]-a,P[1]-s)}t.lineTo(g+b,m+E)}function y(t,r){var n=r.radius,o=r.width,i=r.height,a=o,c=i;if(n&&n.some((function(t){return 0!==t}))){var s=o>0?1:-1,u=i>0?1:-1,h=s+u===0,l=n.map((function(t){return e.clamp(t,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=l[0],p=l[1],d=l[2],v=l[3];t.moveTo(s*f,0),t.lineTo(a-s*p,0),0!==p&&t.arc(a-s*p,u*p,p,-u*Math.PI/2,s>0?0:Math.PI,h),t.lineTo(a,c-u*d),0!==d&&t.arc(a-s*d,c-u*d,d,s>0?0:Math.PI,u>0?Math.PI/2:1.5*Math.PI,h),t.lineTo(s*v,c),0!==v&&t.arc(s*v,c-u*v,v,u>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,h),t.lineTo(0,u*f),0!==f&&t.arc(s*f,u*f,f,s>0?Math.PI:0,u>0?1.5*Math.PI:Math.PI/2,h)}else t.rect(0,0,a,c)}var g=e.Module((function(t){t({token:{token:u,named:e.Shape.CIRCLE},useValue:h}),t({token:{token:u,named:e.Shape.ELLIPSE},useValue:l}),t({token:{token:u,named:e.Shape.RECT},useValue:y}),t({token:{token:u,named:e.Shape.LINE},useValue:f}),t({token:{token:u,named:e.Shape.POLYLINE},useValue:v}),t({token:{token:u,named:e.Shape.POLYGON},useValue:d}),t({token:{token:u,named:e.Shape.PATH},useValue:p}),t({token:s,useFactory:function(t){return function(e){return t.container.isBoundNamed(u,e)?t.container.getNamed(u,e):null}}})})),m=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,c(e,r);var o=n.prototype;return o.init=function(){this.container.load(g,!0)},o.destroy=function(){this.container.unload(g)},n}(e.AbstractRendererPlugin),w=Object.freeze({__proto__:null,PathGenerator:u,PathGeneratorFactory:s,Plugin:m});function x(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function b(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function E(){
|
|
3
|
+
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=h(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(P([])));g&&g!==e&&n.call(g,i)&&(v=g);var m=d.prototype=f.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var s=h(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,s(m,"constructor",d),s(d,"constructor",p),p.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)}))}}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var s=e.Syringe.defineToken(""),u=e.Syringe.defineToken("");function h(t,e){var r=e.r;t.arc(r,r,r,0,2*Math.PI,!1)}function l(t,e){var r=e.rx,n=e.ry;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function f(t,r){var n,o,i=r.x1,a=r.y1,c=r.x2,s=r.y2,u=r.defX,h=void 0===u?0:u,l=r.defY,f=void 0===l?0:l,p=r.markerStart,d=r.markerEnd,v=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,b=0,x=0;p&&p instanceof e.DisplayObject&&v&&(n=c-i,o=s-a,x=Math.atan2(o,n),g=Math.cos(x)*(v||0),m=Math.sin(x)*(v||0)),d&&d instanceof e.DisplayObject&&y&&(n=i-c,o=a-s,x=Math.atan2(o,n),w=Math.cos(x)*(y||0),b=Math.sin(x)*(y||0)),t.moveTo(i-h+g,a-f+m),t.lineTo(c-h+w,s-f+b)}function p(t,r){var n=r.defX,o=void 0===n?0:n,i=r.defY,a=void 0===i?0:i,c=r.markerStart,s=r.markerEnd,u=r.markerStartOffset,h=r.markerEndOffset,l=r.path,f=l.zCommandIndexes,p=[].concat(l.curve);f.forEach((function(t,e){p.splice(t+e,1,["Z"])}));var d,v,y=p.length&&"Z"===p[p.length-1][0],g=0,m=0,w=0,b=0,x=0;if(c&&c instanceof e.DisplayObject&&u){var E=c.parentNode.getStartTangent(),L=E[0],O=E[1];d=L[0]-O[0],v=L[1]-O[1],x=Math.atan2(v,d),g=Math.cos(x)*(u||0),m=Math.sin(x)*(u||0)}if(s&&s instanceof e.DisplayObject&&h){var P=s.parentNode.getEndTangent(),S=P[0],k=P[1];d=S[0]-k[0],v=S[1]-k[1],x=Math.atan2(v,d),w=Math.cos(x)*(h||0),b=Math.sin(x)*(h||0)}for(var C=0;p.length>C;C++){var M=p[C];switch(M[0]){case"M":t.moveTo(M[1]-o+g,M[2]-a+m);break;case"C":t.bezierCurveTo(M[1]-o,M[2]-a,M[3]-o,M[4]-a,M[5]-o+(C===p.length-(y?2:1)?w:0),M[6]-a+(C===p.length-(y?2:1)?b:0));break;case"Z":t.closePath()}}}function d(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,s=void 0===c?0:c,u=r.markerStart,h=r.markerEnd,l=r.markerStartOffset,f=r.markerEndOffset,p=r.points.points,d=p.length,v=p[0][0]-a,y=p[0][1]-s,g=p[d-1][0]-a,m=p[d-1][1]-s,w=0,b=0,x=0,E=0,L=0;u&&u instanceof e.DisplayObject&&l&&(n=p[1][0]-p[0][0],o=p[1][1]-p[0][1],L=Math.atan2(o,n),w=Math.cos(L)*(l||0),b=Math.sin(L)*(l||0)),h&&h instanceof e.DisplayObject&&f&&(n=p[d-1][0]-p[0][0],o=p[d-1][1]-p[0][1],L=Math.atan2(o,n),x=Math.cos(L)*(f||0),E=Math.sin(L)*(f||0)),t.moveTo(v+(w||x),y+(b||E));for(var O=1;d-1>O;O++){var P=p[O];t.lineTo(P[0]-a,P[1]-s)}t.lineTo(g,m)}function v(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,s=void 0===c?0:c,u=r.markerStart,h=r.markerEnd,l=r.markerStartOffset,f=r.markerEndOffset,p=r.points.points,d=p.length,v=p[0][0]-a,y=p[0][1]-s,g=p[d-1][0]-a,m=p[d-1][1]-s,w=0,b=0,x=0,E=0,L=0;u&&u instanceof e.DisplayObject&&l&&(n=p[1][0]-p[0][0],o=p[1][1]-p[0][1],L=Math.atan2(o,n),w=Math.cos(L)*(l||0),b=Math.sin(L)*(l||0)),h&&h instanceof e.DisplayObject&&f&&(n=p[d-2][0]-p[d-1][0],o=p[d-2][1]-p[d-1][1],L=Math.atan2(o,n),x=Math.cos(L)*(f||0),E=Math.sin(L)*(f||0)),t.moveTo(v+w,y+b);for(var O=1;d-1>O;O++){var P=p[O];t.lineTo(P[0]-a,P[1]-s)}t.lineTo(g+x,m+E)}function y(t,r){var n=r.radius,o=r.width,i=r.height,a=o,c=i;if(n&&n.some((function(t){return 0!==t}))){var s=o>0?1:-1,u=i>0?1:-1,h=s+u===0,l=n.map((function(t){return e.clamp(t,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=l[0],p=l[1],d=l[2],v=l[3];t.moveTo(s*f,0),t.lineTo(a-s*p,0),0!==p&&t.arc(a-s*p,u*p,p,-u*Math.PI/2,s>0?0:Math.PI,h),t.lineTo(a,c-u*d),0!==d&&t.arc(a-s*d,c-u*d,d,s>0?0:Math.PI,u>0?Math.PI/2:1.5*Math.PI,h),t.lineTo(s*v,c),0!==v&&t.arc(s*v,c-u*v,v,u>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,h),t.lineTo(0,u*f),0!==f&&t.arc(s*f,u*f,f,s>0?Math.PI:0,u>0?1.5*Math.PI:Math.PI/2,h)}else t.rect(0,0,a,c)}var g=e.Module((function(t){t({token:{token:u,named:e.Shape.CIRCLE},useValue:h}),t({token:{token:u,named:e.Shape.ELLIPSE},useValue:l}),t({token:{token:u,named:e.Shape.RECT},useValue:y}),t({token:{token:u,named:e.Shape.LINE},useValue:f}),t({token:{token:u,named:e.Shape.POLYLINE},useValue:v}),t({token:{token:u,named:e.Shape.POLYGON},useValue:d}),t({token:{token:u,named:e.Shape.PATH},useValue:p}),t({token:s,useFactory:function(t){return function(e){return t.container.isBoundNamed(u,e)?t.container.getNamed(u,e):null}}})})),m=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,c(e,r);var o=n.prototype;return o.init=function(){this.container.load(g,!0)},o.destroy=function(){this.container.unload(g)},n}(e.AbstractRendererPlugin),w=Object.freeze({__proto__:null,PathGenerator:u,PathGeneratorFactory:s,Plugin:m});function b(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function x(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function E(){
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
5
|
-
E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function L(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}var P="undefined"!=typeof Float32Array?Float32Array:Array;function S(){var t=new P(16);return P!=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 C(){var t=new P(3);return P!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function k(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var M;M=C();!function(){var t,e=(t=new P(2),P!=Float32Array&&(t[0]=0,t[1]=0),t)}();var j,T,N=e.Syringe.defineToken(""),_=(j=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.tmpVec3a=C(),this.tmpVec3b=C(),this.tmpVec3c=C(),this.isHit=function(r,n,o){var i,a,c,s,u,h,l,f,p,d,v,y,g,m,w,x,b,E,L,O,P,C,M,j,T,N,_,A,R,I,G,F=t.pointInPathPickerFactory(r.nodeName);if(F){var B=(i=S(),(G=(L=(c=(a=o)[0])*(f=a[5])-(s=a[1])*(l=a[4]))*(I=(g=a[10])*(E=a[15])-(m=a[11])*(b=a[14]))-(O=c*(p=a[6])-(u=a[2])*l)*(R=(y=a[9])*E-m*(x=a[13]))+(P=c*(d=a[7])-(h=a[3])*l)*(A=y*b-g*x)+(C=s*p-u*f)*(_=(v=a[8])*E-m*(w=a[12]))-(M=s*d-h*f)*(N=v*b-g*w)+(j=u*d-h*p)*(T=v*x-y*w))?(i[0]=(f*I-p*R+d*A)*(G=1/G),i[1]=(u*R-s*I-h*A)*G,i[2]=(x*j-b*M+E*C)*G,i[3]=(g*M-y*j-m*C)*G,i[4]=(p*_-l*I-d*N)*G,i[5]=(c*I-u*_+h*N)*G,i[6]=(b*P-w*j-E*O)*G,i[7]=(v*j-g*P+m*O)*G,i[8]=(l*R-f*_+d*T)*G,i[9]=(s*_-c*R-h*T)*G,i[10]=(w*M-x*P+E*L)*G,i[11]=(y*P-v*M-m*L)*G,i[12]=(f*N-l*A-p*T)*G,i[13]=(c*A-s*N+u*T)*G,i[14]=(x*O-w*C-b*L)*G,i[15]=(v*C-y*O+g*L)*G,i):null),D=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(t.tmpVec3b,k(t.tmpVec3c,n[0],n[1],0),B),Y=r.getGeometryBounds().halfExtents,W=r.parsedStyle.anchor;if(D[0]+=(W&&W[0]||0)*Y[0]*2,D[1]+=(W&&W[1]||0)*Y[1]*2,F(r,new e.Point(D[0],D[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&(n.beginPath(),o(n,e.parsedStyle),n.closePath()),n.isPointInPath(r.x,r.y)}}var r=t.prototype;return r.apply=function(t){var e=this;t.hooks.pick.tapPromise(T.tag,function(){var t,r=(t=E().mark((function t(r){var n,o,i,a,c,s,u,h,l,f,p,d,v;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=k(e.tmpVec3a,(o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),s=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id);if(r.isVisible()&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;s.push(r)}})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),u=[],h=0,l=s;case 9:if(h>=l.length){t.next=37;break}if(p=(f=l[h]).getWorldTransform(),!e.isHit(f,i,p)){t.next=34;break}if(!(d=e.findClosestClipPath(f))){t.next=28;break}if(v=d.style.clipPath,y=S(),g=d===f?p:d.getWorldTransform(),m=v.getLocalTransform(),w=void 0,x=void 0,b=void 0,E=void 0,L=void 0,O=void 0,P=void 0,C=void 0,M=void 0,j=void 0,T=void 0,N=void 0,_=void 0,A=void 0,R=void 0,I=void 0,G=void 0,F=void 0,B=void 0,D=void 0,x=g[1],b=g[2],E=g[3],O=g[5],P=g[6],C=g[7],j=g[9],T=g[10],N=g[11],A=g[13],R=g[14],I=g[15],y[0]=(G=m[0])*(w=g[0])+(F=m[1])*(L=g[4])+(B=m[2])*(M=g[8])+(D=m[3])*(_=g[12]),y[1]=G*x+F*O+B*j+D*A,y[2]=G*b+F*P+B*T+D*R,y[3]=G*E+F*C+B*N+D*I,y[4]=(G=m[4])*w+(F=m[5])*L+(B=m[6])*M+(D=m[7])*_,y[5]=G*x+F*O+B*j+D*A,y[6]=G*b+F*P+B*T+D*R,y[7]=G*E+F*C+B*N+D*I,y[8]=(G=m[8])*w+(F=m[9])*L+(B=m[10])*M+(D=m[11])*_,y[9]=G*x+F*O+B*j+D*A,y[10]=G*b+F*P+B*T+D*R,y[11]=G*E+F*C+B*N+D*I,y[12]=(G=m[12])*w+(F=m[13])*L+(B=m[14])*M+(D=m[15])*_,y[13]=G*x+F*O+B*j+D*A,y[14]=G*b+F*P+B*T+D*R,y[15]=G*E+F*C+B*N+D*I,!e.isHit(v,i,p=y)){t.next=26;break}if(!n){t.next=25;break}return r.picked=[f],t.abrupt("return",r);case 25:u.push(f);case 26:t.next=34;break;case 28:if(!n){t.next=33;break}return r.picked=[f],t.abrupt("return",r);case 33:u.push(f);case 34:h++,t.next=9;break;case 37:return r.picked=u,t.abrupt("return",r);case 39:case"end":return t.stop()}var y,g,m,w,x,b,E,L,O,P,C,M,j,T,N,_,A,R,I,G,F,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},r.findClosestClipPath=function(t){var e=t;do{var r;if(null===(r=e.style)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null},t}(),j.tag="CanvasPicker",T=j);function A(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function R(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}x([e.inject(e.DisplayObjectPool),b("design:type",e.DisplayObjectPool)],_.prototype,"displayObjectPool",void 0),x([e.inject(e.CanvasConfig),b("design:type",Object)],_.prototype,"canvasConfig",void 0),x([e.inject(e.OffscreenCanvasCreator),b("design:type",e.OffscreenCanvasCreator)],_.prototype,"offscreenCanvas",void 0),x([e.inject(e.RBushRoot),b("design:type",e.RBush)],_.prototype,"rBush",void 0),x([e.inject(s),b("design:type",Function)],_.prototype,"pathGeneratorFactory",void 0),x([e.inject(N),b("design:type",Function)],_.prototype,"pointInPathPickerFactory",void 0),_=T=x([e.singleton({contrib:e.RenderingPluginContribution})],_);var G=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},F=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function B(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function D(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Y(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,s=6*t-12*e+6*r,u=3*e-3*t,h=[];if(R(c,0))R(s,0)||0>(o=-u/s)||o>1||h.push(o);else{var l=s*s-4*c*u;R(l,0)?h.push(-s/(2*c)):l>0&&(i=(-s-(a=Math.sqrt(l)))/(2*c),0>(o=(-s+a)/(2*c))||o>1||h.push(o),0>i||i>1||h.push(i))}return h}function W(t,e,r,n,o,i,a,c,s){var u=B(t,r,o,a,s),h=B(e,n,i,c,s),l=G(t,e,r,n,s),f=G(r,n,o,i,s),p=G(o,i,a,c,s),d=G(l.x,l.y,f.x,f.y,s),v=G(f.x,f.y,p.x,p.y,s);return[[t,e,l.x,l.y,d.x,d.y,u,h],[u,h,v.x,v.y,p.x,p.y,a,c]]}function $(t,e,r,n,o,i,a,c,s){if(0===s)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=A(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var u=W(t,e,r,n,o,i,a,c,.5),h=[].concat(u[0],[s-1]),l=[].concat(u[1],[s-1]);return $.apply(void 0,h)+$.apply(void 0,l)}var H={extrema:Y,box:function(t,e,r,n,o,i,a,c){for(var s=[t,a],u=[e,c],h=Y(t,r,o,a),l=Y(e,n,i,c),f=0;h.length>f;f++)s.push(B(t,r,o,a,h[f]));for(var p=0;l.length>p;p++)u.push(B(e,n,i,c,l[p]));return I(s,u)},length:function(t,e,r,n,o,i,a,c){return $(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,s,u,h){return function(t,e,r,n,o,i){var a=-1,c=1/0,s=[r,n],u=20;i&&i>200&&(u=i/10);for(var h=1/u,l=h/10,f=0;u>=f;f++){var p=f*h,d=[o.apply(void 0,t.concat([p])),o.apply(void 0,e.concat([p]))],v=A(s[0],s[1],d[0],d[1]);c>v&&(a=p,c=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&l>=1e-4;g++){var m=a-l,w=a+l,x=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],b=A(s[0],s[1],x[0],x[1]);if(m>=0&&c>b)a=m,c=b;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=A(s[0],s[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):l*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}([t,r,o,a],[e,n,i,c],s,u,B,h)},pointDistance:function(t,e,r,n,o,i,a,c,s,u,h){var l=this.nearestPoint(t,e,r,n,o,i,a,c,s,u,h);return A(l.x,l.y,s,u)},interpolationAt:B,pointAt:function(t,e,r,n,o,i,a,c,s){return{x:B(t,r,o,a,s),y:B(e,n,i,c,s)}},divide:function(t,e,r,n,o,i,a,c,s){return W(t,e,r,n,o,i,a,c,s)},tangentAngle:function(t,e,r,n,o,i,a,c,s){var u=D(t,r,o,a,s),h=D(e,n,i,c,s);return(Math.atan2(h,u)+2*Math.PI)%(2*Math.PI)}};function U(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function V(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function X(t,e,r,n,o,i,a,c){var s=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>s||s>o)return!1;var u={x:t+r*Math.cos(s),y:e+r*Math.sin(s)};return U(u.x,u.y,a,c)<=i/2}function z(t,e,r,n,o,i,a){var c=Math.min(t,r),s=Math.max(t,r),u=Math.min(e,n),h=Math.max(e,n),l=o/2;return!(c-l>i||i>s+l||u-l>a||a>h+l)&&F(t,e,r,n,i,a)<=o/2}function q(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(z(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],s=t[i-1];if(z(c[0],c[1],s[0],s[1],e,r,n))return!0}return!1}function Q(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Z(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function J(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(Z(a,c,[e,r]))return!0;Q(a[1]-r)>0!=Q(c[1]-r)>0&&0>Q(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function K(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=J(t[o],e,r))break}return n}function tt(t,e){var r=t.parsedStyle,n=r.r,o=r.fill,i=r.stroke,a=r.clipPathTargets,c=((r.lineWidth||0)+(r.increasedLineWidthForHitTesting||0))/2,s=U(n,n,e.x,e.y),u=o&&!o.isNone,h=i&&!i.isNone;return u&&h||!!(null==a?void 0:a.length)?n+c>=s:u?n>=s:!!h&&(s>=n-c&&n+c>=s)}function et(t,e,r,n){return t/(r*r)+e/(n*n)}function rt(t,e){var r=e.x,n=e.y,o=t.parsedStyle,i=o.rx,a=o.ry,c=o.fill,s=o.stroke,u=o.clipPathTargets,h=c&&!c.isNone,l=s&&!s.isNone,f=((o.lineWidth||0)+(o.increasedLineWidthForHitTesting||0))/2,p=(r-i)*(r-i),d=(n-a)*(n-a);return h&&l||!!(null==u?void 0:u.length)?1>=et(p,d,i+f,a+f):h?1>=et(p,d,i,a):!!l&&(et(p,d,i-f,a-f)>=1&&1>=et(p,d,i+f,a+f))}function nt(t,e){var r=t.parsedStyle,n=r.defX,o=r.defY;return z(r.x1,r.y1,r.x2,r.y2,(r.lineWidth||0)+(r.increasedLineWidthForHitTesting||0),e.x+(void 0===n?0:n),e.y+(void 0===o?0:o))}function ot(t,e,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.stroke,c=n.fill,s=n.defX,u=void 0===s?0:s,h=n.defY,l=void 0===h?0:h,f=n.clipPathTargets,p=n.path,d=a&&!a.isNone,v=p.segments,y=p.polylines,g=p.polygons,m=p.totalLength,w=!!(null==f?void 0:f.length),x=!1;return c&&!c.isNone||w?x=p.hasArc?r(t,e):K(g,e.x+u,e.y+l)||K(y,e.x+u,e.y+l):((d||w)&&(x=function(t,e,r,n,o){for(var i=!1,a=0;t.length>a;a++){var c=t[a],s=c.currentPoint,u=c.params,h=c.prePoint;switch(c.command){case"L":case"Z":i=z(h[0],h[1],s[0],s[1],e,r,n);break;case"C":i=e/2>=H.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],r,n,o)}if(i)break}return i}(v,(o||0)+(i||0),e.x+u,e.y+l,m)),x)}function it(t,e){var r=t.parsedStyle,n=r.stroke,o=r.fill,i=r.points,a=r.defX,c=void 0===a?0:a,s=r.defY,u=void 0===s?0:s,h=r.clipPathTargets,l=!!(null==h?void 0:h.length),f=o&&!o.isNone,p=!1;return(n&&!n.isNone||l)&&(p=q(i.points,(r.lineWidth||0)+(r.increasedLineWidthForHitTesting||0),e.x+c,e.y+u,!0)),p||!f&&!l||(p=J(i.points,e.x+c,e.y+u)),p}function at(t,e){var r=t.parsedStyle,n=r.stroke,o=r.lineWidth,i=r.defX,a=r.defY,c=r.clipPathTargets;return!((!n||n.isNone)&&!(null==c?void 0:c.length)||!o)&&q(r.points.points,(o||0)+(r.increasedLineWidthForHitTesting||0),e.x+(void 0===i?0:i),e.y+(void 0===a?0:a),!1)}function ct(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.fill,c=o.stroke,s=o.width,u=o.height,h=o.clipPathTargets,l=!!(null==h?void 0:h.length),f=a&&!a.isNone,p=c&&!c.isNone,d=(o.lineWidth||0)+(o.increasedLineWidthForHitTesting||0);if(i&&i.some((function(t){return 0!==t}))){var v=!1;return(p||l)&&(v=function(t,e,r,n,o,i,a,c){var s=o[0],u=o[1],h=o[2],l=o[3];return z(t+s,e,t+r-u,e,i,a,c)||z(t+r,e+u,t+r,e+n-h,i,a,c)||z(t+r-h,e+n,t+l,e+n,i,a,c)||z(t,e+n-l,t,e+s,i,a,c)||X(t+r-u,e+u,u,1.5*Math.PI,2*Math.PI,i,a,c)||X(t+r-h,e+n-h,h,0,.5*Math.PI,i,a,c)||X(t+l,e+n-l,l,.5*Math.PI,Math.PI,i,a,c)||X(t+s,e+s,s,Math.PI,1.5*Math.PI,i,a,c)}(0,0,s,u,i.map((function(t){return e.clamp(t,0,Math.min(Math.abs(s)/2,Math.abs(u)/2))})),d,r.x,r.y)),v||!f&&!l||(v=n(t,r)),v}var y=d/2;return f&&p||l?V(0-y,0-y,s+y,u+y,r.x,r.y):f?V(0,0,s,u,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return V(t-c,e-c,r,o,i,a)||V(t+r-c,e-c,o,n,i,a)||V(t+c,e+n-c,r,o,i,a)||V(t-c,e+c,o,n,i,a)}(0,0,s,u,d,r.x,r.y)}var st=e.Module((function(t){t({token:N,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?tt:t===e.Shape.ELLIPSE?rt:t===e.Shape.RECT?ct:t===e.Shape.LINE?nt:t===e.Shape.POLYLINE?at:t===e.Shape.POLYGON?it:t===e.Shape.PATH?ot:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(_)})),ut=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,O(e,r);var o=n.prototype;return o.init=function(){this.container.load(st,!0)},o.destroy=function(){this.container.unload(st)},n}(e.AbstractRendererPlugin),ht=Object.freeze({__proto__:null,Plugin:ut});function lt(){
|
|
5
|
+
E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function L(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}var P="undefined"!=typeof Float32Array?Float32Array:Array;function S(){var t=new P(16);return P!=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 k(){var t=new P(3);return P!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var M;M=k();!function(){var t,e=(t=new P(2),P!=Float32Array&&(t[0]=0,t[1]=0),t)}();var j,T,_=e.Syringe.defineToken(""),N=(j=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.tmpVec3a=k(),this.tmpVec3b=k(),this.tmpVec3c=k(),this.isHit=function(r,n,o){var i,a,c,s,u,h,l,f,p,d,v,y,g,m,w,b,x,E,L,O,P,k,M,j,T,_,N,A,R,I,F,G=t.pointInPathPickerFactory(r.nodeName);if(G){var B=(i=S(),(F=(L=(c=(a=o)[0])*(f=a[5])-(s=a[1])*(l=a[4]))*(I=(g=a[10])*(E=a[15])-(m=a[11])*(x=a[14]))-(O=c*(p=a[6])-(u=a[2])*l)*(R=(y=a[9])*E-m*(b=a[13]))+(P=c*(d=a[7])-(h=a[3])*l)*(A=y*x-g*b)+(k=s*p-u*f)*(N=(v=a[8])*E-m*(w=a[12]))-(M=s*d-h*f)*(_=v*x-g*w)+(j=u*d-h*p)*(T=v*b-y*w))?(i[0]=(f*I-p*R+d*A)*(F=1/F),i[1]=(u*R-s*I-h*A)*F,i[2]=(b*j-x*M+E*k)*F,i[3]=(g*M-y*j-m*k)*F,i[4]=(p*N-l*I-d*_)*F,i[5]=(c*I-u*N+h*_)*F,i[6]=(x*P-w*j-E*O)*F,i[7]=(v*j-g*P+m*O)*F,i[8]=(l*R-f*N+d*T)*F,i[9]=(s*N-c*R-h*T)*F,i[10]=(w*M-b*P+E*L)*F,i[11]=(y*P-v*M-m*L)*F,i[12]=(f*_-l*A-p*T)*F,i[13]=(c*A-s*_+u*T)*F,i[14]=(b*O-w*k-x*L)*F,i[15]=(v*k-y*O+g*L)*F,i):null),D=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(t.tmpVec3b,C(t.tmpVec3c,n[0],n[1],0),B),Y=r.getGeometryBounds().halfExtents,W=r.parsedStyle.anchor;if(D[0]+=(W&&W[0]||0)*Y[0]*2,D[1]+=(W&&W[1]||0)*Y[1]*2,G(r,new e.Point(D[0],D[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&(n.beginPath(),o(n,e.parsedStyle),n.closePath()),n.isPointInPath(r.x,r.y)}}var r=t.prototype;return r.apply=function(t){var e=this;t.hooks.pick.tapPromise(T.tag,function(){var t,r=(t=E().mark((function t(r){var n,o,i,a,c,s,u,h,l,f,p,d,v;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=C(e.tmpVec3a,(o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),s=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(r.parsedStyle.pointerEvents);if((!n||n&&r.isVisible())&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;s.push(r)}})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),u=[],h=0,l=s;case 9:if(h>=l.length){t.next=37;break}if(p=(f=l[h]).getWorldTransform(),!e.isHit(f,i,p)){t.next=34;break}if(!(d=e.findClosestClipPath(f))){t.next=28;break}if(v=d.style.clipPath,y=S(),g=d===f?p:d.getWorldTransform(),m=v.getLocalTransform(),w=void 0,b=void 0,x=void 0,E=void 0,L=void 0,O=void 0,P=void 0,k=void 0,M=void 0,j=void 0,T=void 0,_=void 0,N=void 0,A=void 0,R=void 0,I=void 0,F=void 0,G=void 0,B=void 0,D=void 0,b=g[1],x=g[2],E=g[3],O=g[5],P=g[6],k=g[7],j=g[9],T=g[10],_=g[11],A=g[13],R=g[14],I=g[15],y[0]=(F=m[0])*(w=g[0])+(G=m[1])*(L=g[4])+(B=m[2])*(M=g[8])+(D=m[3])*(N=g[12]),y[1]=F*b+G*O+B*j+D*A,y[2]=F*x+G*P+B*T+D*R,y[3]=F*E+G*k+B*_+D*I,y[4]=(F=m[4])*w+(G=m[5])*L+(B=m[6])*M+(D=m[7])*N,y[5]=F*b+G*O+B*j+D*A,y[6]=F*x+G*P+B*T+D*R,y[7]=F*E+G*k+B*_+D*I,y[8]=(F=m[8])*w+(G=m[9])*L+(B=m[10])*M+(D=m[11])*N,y[9]=F*b+G*O+B*j+D*A,y[10]=F*x+G*P+B*T+D*R,y[11]=F*E+G*k+B*_+D*I,y[12]=(F=m[12])*w+(G=m[13])*L+(B=m[14])*M+(D=m[15])*N,y[13]=F*b+G*O+B*j+D*A,y[14]=F*x+G*P+B*T+D*R,y[15]=F*E+G*k+B*_+D*I,!e.isHit(v,i,p=y)){t.next=26;break}if(!n){t.next=25;break}return r.picked=[f],t.abrupt("return",r);case 25:u.push(f);case 26:t.next=34;break;case 28:if(!n){t.next=33;break}return r.picked=[f],t.abrupt("return",r);case 33:u.push(f);case 34:h++,t.next=9;break;case 37:return r.picked=u,t.abrupt("return",r);case 39:case"end":return t.stop()}var y,g,m,w,b,x,E,L,O,P,k,M,j,T,_,N,A,R,I,F,G,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},r.findClosestClipPath=function(t){var e=t;do{var r;if(null===(r=e.style)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null},t}(),j.tag="CanvasPicker",T=j);function A(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function R(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}b([e.inject(e.DisplayObjectPool),x("design:type",e.DisplayObjectPool)],N.prototype,"displayObjectPool",void 0),b([e.inject(e.CanvasConfig),x("design:type",Object)],N.prototype,"canvasConfig",void 0),b([e.inject(e.OffscreenCanvasCreator),x("design:type",e.OffscreenCanvasCreator)],N.prototype,"offscreenCanvas",void 0),b([e.inject(e.RBushRoot),x("design:type",e.RBush)],N.prototype,"rBush",void 0),b([e.inject(s),x("design:type",Function)],N.prototype,"pathGeneratorFactory",void 0),b([e.inject(_),x("design:type",Function)],N.prototype,"pointInPathPickerFactory",void 0),N=T=b([e.singleton({contrib:e.RenderingPluginContribution})],N);var F=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},G=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function B(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function D(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Y(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,s=6*t-12*e+6*r,u=3*e-3*t,h=[];if(R(c,0))R(s,0)||0>(o=-u/s)||o>1||h.push(o);else{var l=s*s-4*c*u;R(l,0)?h.push(-s/(2*c)):l>0&&(i=(-s-(a=Math.sqrt(l)))/(2*c),0>(o=(-s+a)/(2*c))||o>1||h.push(o),0>i||i>1||h.push(i))}return h}function W(t,e,r,n,o,i,a,c,s){var u=B(t,r,o,a,s),h=B(e,n,i,c,s),l=F(t,e,r,n,s),f=F(r,n,o,i,s),p=F(o,i,a,c,s),d=F(l.x,l.y,f.x,f.y,s),v=F(f.x,f.y,p.x,p.y,s);return[[t,e,l.x,l.y,d.x,d.y,u,h],[u,h,v.x,v.y,p.x,p.y,a,c]]}function $(t,e,r,n,o,i,a,c,s){if(0===s)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=A(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var u=W(t,e,r,n,o,i,a,c,.5),h=[].concat(u[0],[s-1]),l=[].concat(u[1],[s-1]);return $.apply(void 0,h)+$.apply(void 0,l)}var H={extrema:Y,box:function(t,e,r,n,o,i,a,c){for(var s=[t,a],u=[e,c],h=Y(t,r,o,a),l=Y(e,n,i,c),f=0;h.length>f;f++)s.push(B(t,r,o,a,h[f]));for(var p=0;l.length>p;p++)u.push(B(e,n,i,c,l[p]));return I(s,u)},length:function(t,e,r,n,o,i,a,c){return $(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,s,u,h){return function(t,e,r,n,o,i){var a=-1,c=1/0,s=[r,n],u=20;i&&i>200&&(u=i/10);for(var h=1/u,l=h/10,f=0;u>=f;f++){var p=f*h,d=[o.apply(void 0,t.concat([p])),o.apply(void 0,e.concat([p]))],v=A(s[0],s[1],d[0],d[1]);c>v&&(a=p,c=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&l>=1e-4;g++){var m=a-l,w=a+l,b=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],x=A(s[0],s[1],b[0],b[1]);if(m>=0&&c>x)a=m,c=x;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=A(s[0],s[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):l*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}([t,r,o,a],[e,n,i,c],s,u,B,h)},pointDistance:function(t,e,r,n,o,i,a,c,s,u,h){var l=this.nearestPoint(t,e,r,n,o,i,a,c,s,u,h);return A(l.x,l.y,s,u)},interpolationAt:B,pointAt:function(t,e,r,n,o,i,a,c,s){return{x:B(t,r,o,a,s),y:B(e,n,i,c,s)}},divide:function(t,e,r,n,o,i,a,c,s){return W(t,e,r,n,o,i,a,c,s)},tangentAngle:function(t,e,r,n,o,i,a,c,s){var u=D(t,r,o,a,s),h=D(e,n,i,c,s);return(Math.atan2(h,u)+2*Math.PI)%(2*Math.PI)}};function U(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function V(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function X(t,e,r,n,o,i,a,c){var s=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>s||s>o)return!1;var u={x:t+r*Math.cos(s),y:e+r*Math.sin(s)};return U(u.x,u.y,a,c)<=i/2}function z(t,e,r,n,o,i,a){var c=Math.min(t,r),s=Math.max(t,r),u=Math.min(e,n),h=Math.max(e,n),l=o/2;return!(c-l>i||i>s+l||u-l>a||a>h+l)&&G(t,e,r,n,i,a)<=o/2}function q(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(z(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],s=t[i-1];if(z(c[0],c[1],s[0],s[1],e,r,n))return!0}return!1}function Q(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Z(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function J(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(Z(a,c,[e,r]))return!0;Q(a[1]-r)>0!=Q(c[1]-r)>0&&0>Q(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function K(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=J(t[o],e,r))break}return n}function tt(t,r){var n=t.parsedStyle,o=n.r,i=n.fill,a=n.stroke,c=n.clipPathTargets,s=n.pointerEvents,u=((n.lineWidth||0)+(n.increasedLineWidthForHitTesting||0))/2,h=U(o,o,r.x,r.y),l=!!(null==c?void 0:c.length),f=e.isFillOrStrokeAffected(s,i,a),p=f[0],d=f[1];return p&&d||l?o+u>=h:p?o>=h:!!d&&(h>=o-u&&o+u>=h)}function et(t,e,r,n){return t/(r*r)+e/(n*n)}function rt(t,r){var n=r.x,o=r.y,i=t.parsedStyle,a=i.rx,c=i.ry,s=i.lineWidth,u=i.increasedLineWidthForHitTesting,h=i.clipPathTargets,l=!!(null==h?void 0:h.length),f=e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),p=f[0],d=f[1],v=((s||0)+(u||0))/2,y=(n-a)*(n-a),g=(o-c)*(o-c);return p&&d||l?1>=et(y,g,a+v,c+v):p?1>=et(y,g,a,c):!!d&&(et(y,g,a-v,c-v)>=1&&1>=et(y,g,a+v,c+v))}function nt(t,r){var n=t.parsedStyle,o=n.x1,i=n.y1,a=n.x2,c=n.y2,s=n.lineWidth,u=n.increasedLineWidthForHitTesting,h=n.defX,l=void 0===h?0:h,f=n.defY,p=void 0===f?0:f,d=n.clipPathTargets,v=!!(null==d?void 0:d.length),y=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke);return!(!y[1]&&!v||!s)&&z(o,i,a,c,(s||0)+(u||0),r.x+l,r.y+p)}function ot(t,r,n){var o=t.parsedStyle,i=o.lineWidth,a=o.increasedLineWidthForHitTesting,c=o.defX,s=void 0===c?0:c,u=o.defY,h=void 0===u?0:u,l=o.clipPathTargets,f=o.path,p=e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),d=p[1],v=f.segments,y=f.polylines,g=f.polygons,m=f.totalLength,w=!!(null==l?void 0:l.length),b=!1;return p[0]||w?b=f.hasArc?n(t,r):K(g,r.x+s,r.y+h)||K(y,r.x+s,r.y+h):((d||w)&&(b=function(t,e,r,n,o){for(var i=!1,a=0;t.length>a;a++){var c=t[a],s=c.currentPoint,u=c.params,h=c.prePoint;switch(c.command){case"L":case"Z":i=z(h[0],h[1],s[0],s[1],e,r,n);break;case"C":i=e/2>=H.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],r,n,o)}if(i)break}return i}(v,(i||0)+(a||0),r.x+s,r.y+h,m)),b)}function it(t,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.points,c=n.defX,s=void 0===c?0:c,u=n.defY,h=void 0===u?0:u,l=n.clipPathTargets,f=!!(null==l?void 0:l.length),p=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke),d=p[0],v=!1;return(p[1]||f)&&(v=q(a.points,(o||0)+(i||0),r.x+s,r.y+h,!0)),v||!d&&!f||(v=J(a.points,r.x+s,r.y+h)),v}function at(t,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.points,c=n.defX,s=void 0===c?0:c,u=n.defY,h=void 0===u?0:u,l=n.clipPathTargets,f=!!(null==l?void 0:l.length),p=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke);return!(!p[1]&&!f||!o)&&q(a.points,(o||0)+(i||0),r.x+s,r.y+h,!1)}function ct(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.lineWidth,c=o.increasedLineWidthForHitTesting,s=o.width,u=o.height,h=o.clipPathTargets,l=!!(null==h?void 0:h.length),f=e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),p=f[0],d=f[1],v=(a||0)+(c||0);if(i&&i.some((function(t){return 0!==t}))){var y=!1;return(d||l)&&(y=function(t,e,r,n,o,i,a,c){var s=o[0],u=o[1],h=o[2],l=o[3];return z(t+s,e,t+r-u,e,i,a,c)||z(t+r,e+u,t+r,e+n-h,i,a,c)||z(t+r-h,e+n,t+l,e+n,i,a,c)||z(t,e+n-l,t,e+s,i,a,c)||X(t+r-u,e+u,u,1.5*Math.PI,2*Math.PI,i,a,c)||X(t+r-h,e+n-h,h,0,.5*Math.PI,i,a,c)||X(t+l,e+n-l,l,.5*Math.PI,Math.PI,i,a,c)||X(t+s,e+s,s,Math.PI,1.5*Math.PI,i,a,c)}(0,0,s,u,i.map((function(t){return e.clamp(t,0,Math.min(Math.abs(s)/2,Math.abs(u)/2))})),v,r.x,r.y)),y||!p&&!l||(y=n(t,r)),y}var g=v/2;return p&&d||l?V(0-g,0-g,s+g,u+g,r.x,r.y):p?V(0,0,s,u,r.x,r.y):!!d&&function(t,e,r,n,o,i,a){var c=o/2;return V(t-c,e-c,r,o,i,a)||V(t+r-c,e-c,o,n,i,a)||V(t+c,e+n-c,r,o,i,a)||V(t-c,e+c,o,n,i,a)}(0,0,s,u,v,r.x,r.y)}var st=e.Module((function(t){t({token:_,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?tt:t===e.Shape.ELLIPSE?rt:t===e.Shape.RECT?ct:t===e.Shape.LINE?nt:t===e.Shape.POLYLINE?at:t===e.Shape.POLYGON?it:t===e.Shape.PATH?ot:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(N)})),ut=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,O(e,r);var o=n.prototype;return o.init=function(){this.container.load(st,!0)},o.destroy=function(){this.container.unload(st)},n}(e.AbstractRendererPlugin),ht=Object.freeze({__proto__:null,Plugin:ut});function lt(){
|
|
6
6
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
7
|
-
lt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))}}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}var vt,yt,gt=function(){function t(){this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,r,n){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var i,a=t.image,c=t.repetition,s=(i=e.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(i,c);return o&&s&&(this.patternCache[o]=s),s},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),o=t.type,i=t.steps,a=t.width,c=t.height,s=t.cx,u=t.cy;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(o===e.GradientType.LinearGradient){var l=e.computeLinearGradient(a,c,t.angle);h=r.createLinearGradient(l.x1,l.y1,l.x2,l.y2)}else if(o===e.GradientType.RadialGradient){var f=e.computeRadialGradient(a,c,s,u),p=f.x,d=f.y;h=r.createRadialGradient(p,d,0,p,d,f.r)}return h&&(i.forEach((function(t){var e;null===(e=h)||void 0===e||e.addColorStop(t[0],t[1])})),this.gradientCache[n]=h),this.gradientCache[n]},r.generateGradientKey=function(t){return"gradient-"+t.type+"-"+(t.angle||0)+"-"+(t.cx||0)+"-"+(t.cy||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},r.generatePatternKey=function(t){var r=t.image,n=t.repetition;if(e.isString(r))return"pattern-"+r+"-"+n},t}();x([e.inject(e.CanvasConfig),b("design:type",Object)],gt.prototype,"canvasConfig",void 0),gt=x([e.singleton()],gt);var mt=(vt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&r.imagePool.getImageSync(i,(function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(yt.tag,pt(lt().mark((function t(){return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(yt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),vt.tag="LoadImage",yt=vt);x([e.inject(gt),b("design:type",gt)],mt.prototype,"imagePool",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],mt.prototype,"renderingContext",void 0),mt=yt=x([e.singleton({contrib:e.RenderingPluginContribution})],mt);var wt=e.Module((function(t){t(gt),t(mt)})),xt=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="image-loader",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,dt(e,r);var o=n.prototype;return o.init=function(){this.container.load(wt,!0)},o.destroy=function(){this.container.unload(wt)},n}(e.AbstractRendererPlugin),bt=Object.freeze({__proto__:null,get ImagePool(){return gt},Plugin:xt});function Et(){
|
|
7
|
+
lt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))}}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}var vt,yt,gt=function(){function t(){this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,r,n){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var i,a=t.image,c=t.repetition,s=(i=e.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(i,c);return o&&s&&(this.patternCache[o]=s),s},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),o=t.type,i=t.steps,a=t.width,c=t.height,s=t.cx,u=t.cy;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(o===e.GradientType.LinearGradient){var l=e.computeLinearGradient(a,c,t.angle);h=r.createLinearGradient(l.x1,l.y1,l.x2,l.y2)}else if(o===e.GradientType.RadialGradient){var f=e.computeRadialGradient(a,c,s,u),p=f.x,d=f.y;h=r.createRadialGradient(p,d,0,p,d,f.r)}return h&&(i.forEach((function(t){var e;null===(e=h)||void 0===e||e.addColorStop(t[0],t[1])})),this.gradientCache[n]=h),this.gradientCache[n]},r.generateGradientKey=function(t){return"gradient-"+t.type+"-"+(t.angle||0)+"-"+(t.cx||0)+"-"+(t.cy||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},r.generatePatternKey=function(t){var r=t.image,n=t.repetition;if(e.isString(r))return"pattern-"+r+"-"+n},t}();b([e.inject(e.CanvasConfig),x("design:type",Object)],gt.prototype,"canvasConfig",void 0),gt=b([e.singleton()],gt);var mt=(vt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&r.imagePool.getImageSync(i,(function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(yt.tag,pt(lt().mark((function t(){return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(yt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),vt.tag="LoadImage",yt=vt);b([e.inject(gt),x("design:type",gt)],mt.prototype,"imagePool",void 0),b([e.inject(e.RenderingContext),x("design:type",Object)],mt.prototype,"renderingContext",void 0),mt=yt=b([e.singleton({contrib:e.RenderingPluginContribution})],mt);var wt=e.Module((function(t){t(gt),t(mt)})),bt=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="image-loader",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,dt(e,r);var o=n.prototype;return o.init=function(){this.container.load(wt,!0)},o.destroy=function(){this.container.unload(wt)},n}(e.AbstractRendererPlugin),xt=Object.freeze({__proto__:null,get ImagePool(){return gt},Plugin:bt});function Et(){
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
9
|
-
Et=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Lt(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Ot(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,c,"next",t)}function c(t){Lt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Pt(){return Pt=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Pt.apply(this,arguments)}function St(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ct(t,e)}function Ct(t,e){return Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ct(t,e)}var kt="undefined"!=typeof Float32Array?Float32Array:Array;function Mt(){var t=new kt(16);return kt!=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 jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],p=e[10],d=e[11],v=e[12],y=e[13],g=e[14],m=e[15],w=r[0],x=r[1],b=r[2],E=r[3];return t[0]=w*n+x*c+b*l+E*v,t[1]=w*o+x*s+b*f+E*y,t[2]=w*i+x*u+b*p+E*g,t[3]=w*a+x*h+b*d+E*m,t[4]=(w=r[4])*n+(x=r[5])*c+(b=r[6])*l+(E=r[7])*v,t[5]=w*o+x*s+b*f+E*y,t[6]=w*i+x*u+b*p+E*g,t[7]=w*a+x*h+b*d+E*m,t[8]=(w=r[8])*n+(x=r[9])*c+(b=r[10])*l+(E=r[11])*v,t[9]=w*o+x*s+b*f+E*y,t[10]=w*i+x*u+b*p+E*g,t[11]=w*a+x*h+b*d+E*m,t[12]=(w=r[12])*n+(x=r[13])*c+(b=r[14])*l+(E=r[15])*v,t[13]=w*o+x*s+b*f+E*y,t[14]=w*i+x*u+b*p+E*g,t[15]=w*a+x*h+b*d+E*m,t}function Nt(t,e,r){var n,o,i,a,c,s,u,h,l,f,p,d,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],p=e[10],d=e[11],t[0]=n=e[0],t[1]=o,t[2]=i,t[3]=a,t[4]=c,t[5]=s,t[6]=u,t[7]=h,t[8]=l,t[9]=f,t[10]=p,t[11]=d,t[12]=n*v+c*y+l*g+e[12],t[13]=o*v+s*y+f*g+e[13],t[14]=i*v+u*y+p*g+e[14],t[15]=a*v+h*y+d*g+e[15]),t}function _t(){var t=new kt(3);return kt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function At(t,e,r){var n=new kt(3);return n[0]=t,n[1]=e,n[2]=r,n}function Rt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=_t()}();var It=e.Syringe.defineToken(""),Gt=e.Syringe.defineToken("",{multiple:!1}),Ft=e.Syringe.defineToken("",{multiple:!1}),Bt=e.Syringe.defineToken("",{multiple:!1}),Dt=e.Syringe.defineToken("",{multiple:!1}),Yt=e.Syringe.defineToken("",{multiple:!1}),Wt=e.Syringe.defineToken("",{multiple:!1}),$t=e.Syringe.defineToken("",{multiple:!1}),Ht=e.Syringe.defineToken("",{multiple:!1}),Ut=e.Syringe.defineToken("",{multiple:!1}),Vt=function(){function t(){this.imagePool=void 0}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.opacity,c=r.fillOpacity,s=r.stroke,u=r.strokeOpacity,h=r.lineWidth,l=r.lineCap,f=r.lineJoin,p=r.shadowType,d=r.shadowColor,v=r.shadowBlur,y=r.filter,g=r.miterLimit,m=!e.isNil(i)&&!i.isNone,w=!e.isNil(s)&&!s.isNone&&h>0,x=0===i.alpha,b=!(!y||!y.length),E=!e.isNil(d)&&v>0,L=n.nodeName,O="inner"===p,P=w&&E&&(L===e.Shape.PATH||L===e.Shape.LINE||L===e.Shape.POLYLINE||x||O);m&&(t.globalAlpha=a*c,P||Xt(n,t,E),this.fill(t,n,i,o),P||this.clearShadowAndFilter(t,b,E)),w&&(t.globalAlpha=a*u,t.lineWidth=h,e.isNil(g)||(t.miterLimit=g),e.isNil(l)||(t.lineCap=l),e.isNil(f)||(t.lineJoin=f),P&&(O&&(t.globalCompositeOperation="source-atop"),Xt(n,t,!0),O&&(this.stroke(t,n,s,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,b,!0))),this.stroke(t,n,s,o))},r.clearShadowAndFilter=function(t,r,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),r){var o=t.filter;!e.isNil(o)&&o.indexOf("drop-shadow")>-1&&(t.filter=o.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=i.getColor(e,r,t),t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,o)),t.fill())},r.stroke=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=i.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,o)),t.stroke())},r.getPattern=function(t,e,r,n){return this.imagePool.getOrCreatePatternSync(t,r,(function(){e.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(t,r,n){var o;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var i=r.getGeometryBounds();o=this.imagePool.getOrCreateGradient(Pt({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();function Xt(t,e,r){var n=t.parsedStyle,o=n.filter,i=n.shadowColor,a=n.shadowBlur,c=n.shadowOffsetX,s=n.shadowOffsetY;o&&o.length&&(e.filter=t.style.filter),r&&(e.shadowColor=i.toString(),e.shadowBlur=a||0,e.shadowOffsetX=c||0,e.shadowOffsetY=s||0)}x([e.inject(gt),b("design:type",gt)],Vt.prototype,"imagePool",void 0),Vt=x([e.singleton()],Vt);var zt=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r,n){var o,i=r.img,a=r.shadowColor,c=r.shadowBlur,s=r.width,u=r.height;if(e.isString(i)?o=this.imagePool.getImageSync(i):(s||(s=i.width),u||(u=i.height),o=i),o){Xt(n,t,!e.isNil(a)&&c>0);try{t.drawImage(o,0,0,s,u)}catch(t){}}},t}();x([e.inject(gt),b("design:type",gt)],zt.prototype,"imagePool",void 0),zt=x([e.singleton({token:Ut})],zt);var qt=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,s=r.miterLimit,u=r.letterSpacing,h=r.stroke,l=r.fill,f=r.fillOpacity,p=r.strokeOpacity,d=r.opacity,v=r.metrics,y=r.dx,g=r.dy,m=r.shadowColor,w=r.shadowBlur,x=v.lines,b=v.height,E=v.lineHeight,L=v.lineMetrics;t.font=v.font,t.lineWidth=o,t.textAlign=i,t.textBaseline=a,t.lineJoin=c,e.isNil(s)||(t.miterLimit=s);var O=0;"middle"===a?O=-b/2-E/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?O=-b:"top"!==a&&"hanging"!==a||(O=-E);var P=y||0;O+=g||0,Xt(n,t,!e.isNil(m)&&w>0);for(var S=0;x.length>S;S++){var C=o/2+P;O+=E,e.isNil(h)||h.isNone||!o||this.drawLetterSpacing(t,x[S],L[S],i,C,O,u,f,p,d,!0),e.isNil(l)||this.drawLetterSpacing(t,x[S],L[S],i,C,O,u,f,p,d)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,s,u,h){if(void 0===h&&(h=!1),0!==a){var l=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var p=Array.from(e),d=t.measureText(e).width,v=0,y=0;p.length>y;++y){var g=p[y];h?this.strokeText(t,g,f,i,s):this.fillText(t,g,f,i,c,u),f+=d-(v=t.measureText(e.substring(y+1)).width)+a,d=v}t.textAlign=l}else h?this.strokeText(t,e,o,i,s):this.fillText(t,e,o,i,c,u)},r.fillText=function(t,r,n,o,i,a){var c,s=!e.isNil(i)&&1!==i;s&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),s&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();qt=x([e.singleton({token:Ht})],qt);var Qt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Qt=x([e.singleton({token:Bt})],Qt);var Zt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Zt=x([e.singleton({token:Gt})],Zt);var Jt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Jt=x([e.singleton({token:Ft})],Jt);var Kt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Kt=x([e.singleton({token:Dt})],Kt);var te=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);te=x([e.singleton({token:Yt})],te);var ee=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);ee=x([e.singleton({token:Wt})],ee);var re=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);re=x([e.singleton({token:$t})],re);var ne,oe,ie=e.Syringe.defineToken(""),ae=(ne=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.canvasRendererPluginOptions=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Mt(),this.dprMatrix=Mt(),this.tmpMat4=Mt(),this.vec3a=_t(),this.vec3b=_t(),this.vec3c=_t(),this.vec3d=_t()}var r=t.prototype;return r.apply=function(t){var r=this,n=this.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},i=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(oe.tag,Ot(Et().mark((function t(){var n,a,c,s,u;return Et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,i),n=r.contextService.getDPR(),c=(a=r.canvasConfig).width,s=a.height,u=r.contextService.getContext(),r.clearRect(u,0,0,c*n,s*n),h=r.dprMatrix,l=At(n,n,1),h[0]=l[0],h[1]=0,h[2]=0,h[3]=0,h[4]=0,h[5]=l[1],h[6]=0,h[7]=0,h[8]=0,h[9]=0,h[10]=l[2],h[11]=0,h[12]=0,h[13]=0,h[14]=0,h[15]=1;case 7:case"end":return t.stop()}var h,l}),t)})))),t.hooks.destroy.tap(oe.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,i)})),t.hooks.beginFrame.tap(oe.tag,(function(){var e=r.contextService.getContext(),n=r.contextService.getDPR(),o=r.canvasConfig,i=o.width,a=o.height,c=r.canvasRendererPluginOptions,s=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,h=t.getStats(),l=h.rendered,f=l/h.total;r.clearFullScreen=t.disableDirtyRectangleRendering()||l>s&&f>u,e&&(e.resetTransform(),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n))}));var a=function e(n){n.isVisible()&&!n.isCulled()&&(r.renderDisplayObject(n,t),r.saveDirtyAABB(n)),(n.sortable.sorted||n.childNodes).forEach((function(t){e(t)}))};t.hooks.endFrame.tap(oe.tag,(function(){var o=r.contextService.getContext();if(Tt(r.vpMatrix,r.dprMatrix,r.camera.getOrthoMatrix()),r.clearFullScreen)a(r.renderingContext.root);else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(At(r,n,0),At(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),s=c.x,u=c.y,h=c.width,l=c.height,f=Rt(r.vec3a,At(s,u,0),r.vpMatrix),p=Rt(r.vec3b,At(s+h,u,0),r.vpMatrix),d=Rt(r.vec3c,At(s,u+l,0),r.vpMatrix),v=Rt(r.vec3d,At(s+h,u+l,0),r.vpMatrix),y=Math.min(f[0],p[0],v[0],d[0]),g=Math.min(f[1],p[1],v[1],d[1]),m=Math.max(f[0],p[0],v[0],d[0]),w=Math.max(f[1],p[1],v[1],d[1]),x=Math.floor(y),b=Math.floor(g),E=Math.ceil(m-y),L=Math.ceil(w-g);o.save(),r.clearRect(o,x,b,E,L),o.beginPath(),o.rect(x,b,E,L),o.clip(),o.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),r.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&n.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:x,y:b,width:E,height:L}})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),o.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){o.restore()})),r.restoreStack=[]})),t.hooks.render.tap(oe.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),o=t.nodeName,i=this.restoreStack[this.restoreStack.length-1];!i||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[o]&&(this.styleRendererFactoryCache[o]=this.styleRendererFactory(o));var a=this.styleRendererFactoryCache[o];void 0===this.pathGeneratorFactoryCache[o]&&(this.pathGeneratorFactoryCache[o]=this.pathGeneratorFactory(o));var c=this.pathGeneratorFactoryCache[o],s=t.parsedStyle.clipPath;if(s){this.applyWorldTransform(n,s,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[s.nodeName]&&(this.pathGeneratorFactoryCache[s.nodeName]=this.pathGeneratorFactory(s.nodeName));var u=this.pathGeneratorFactoryCache[s.nodeName];u&&(n.save(),this.restoreStack.push(t),n.beginPath(),u(n,s.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,t.parsedStyle,t,r),n.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,r){var n=r.parsedStyle,o=n.stroke,i=n.fill,a=n.opacity,c=n.lineDash,s=n.lineDashOffset;c&&t.setLineDash(c),e.isNil(s)||(t.lineDashOffset=s),e.isNil(a)||(t.globalAlpha*=a),e.isNil(o)||Array.isArray(o)||o.isNone||(t.strokeStyle=r.attributes.stroke),e.isNil(i)||Array.isArray(i)||i.isNone||(t.fillStyle=r.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,o=0,i=(e.parsedStyle||{}).anchor,a=i&&i[0]||0,c=i&&i[1]||0;if(0!==a||0!==c){var s=e.getGeometryBounds();n=-a*(s&&2*s.halfExtents[0]||0),o=-c*(s&&2*s.halfExtents[1]||0)}r?(jt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,Nt(this.tmpMat4,this.tmpMat4,this.vec3a),Tt(this.tmpMat4,r,this.tmpMat4),Tt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(jt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,Nt(this.tmpMat4,this.tmpMat4,this.vec3a),Tt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),ne.tag="CanvasRenderer",oe=ne);x([e.inject(e.CanvasConfig),b("design:type",Object)],ae.prototype,"canvasConfig",void 0),x([e.inject(e.DefaultCamera),b("design:type",e.Camera)],ae.prototype,"camera",void 0),x([e.inject(e.ContextService),b("design:type",Object)],ae.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],ae.prototype,"renderingContext",void 0),x([e.inject(s),b("design:type",Function)],ae.prototype,"pathGeneratorFactory",void 0),x([e.inject(It),b("design:type",Function)],ae.prototype,"styleRendererFactory",void 0),x([e.inject(e.DisplayObjectPool),b("design:type",e.DisplayObjectPool)],ae.prototype,"displayObjectPool",void 0),x([e.inject(ie),b("design:type",Object)],ae.prototype,"canvasRendererPluginOptions",void 0),x([e.inject(e.RBushRoot),b("design:type",e.RBush)],ae.prototype,"rBush",void 0),ae=oe=x([e.singleton({contrib:e.RenderingPluginContribution})],ae);var ce,se,ue=e.Module((function(t){var r;t(Zt),t(Jt),t(Qt),t(zt),t(qt),t(Kt),t(te),t(ee),t(re);var n=((r={})[e.Shape.CIRCLE]=Gt,r[e.Shape.ELLIPSE]=Ft,r[e.Shape.RECT]=Bt,r[e.Shape.IMAGE]=Ut,r[e.Shape.TEXT]=Ht,r[e.Shape.LINE]=Dt,r[e.Shape.POLYLINE]=Yt,r[e.Shape.POLYGON]=Wt,r[e.Shape.PATH]=$t,r);t({token:It,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(ae)})),he=function(t){function e(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}St(e,t);var r=e.prototype;return r.init=function(){this.container.register(ie,{useValue:Pt({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(ue,!0)},r.destroy=function(){this.container.unload(ue),this.container.remove(ie)},e}(e.AbstractRendererPlugin),le=Object.freeze({__proto__:null,get CircleRenderer(){return Zt},CircleRendererContribution:Gt,get EllipseRenderer(){return Jt},EllipseRendererContribution:Ft,get ImageRenderer(){return zt},ImageRendererContribution:Ut,get LineRenderer(){return Kt},LineRendererContribution:Dt,get PathRenderer(){return re},PathRendererContribution:$t,Plugin:he,get PolygonRenderer(){return ee},PolygonRendererContribution:Wt,get PolylineRenderer(){return te},PolylineRendererContribution:Yt,get RectRenderer(){return Qt},RectRendererContribution:Bt,StyleRendererFactory:It,get TextRenderer(){return qt},TextRendererContribution:Ht});function fe(){
|
|
9
|
+
Et=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Lt(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Ot(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,c,"next",t)}function c(t){Lt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Pt(){return Pt=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Pt.apply(this,arguments)}function St(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,kt(t,e)}function kt(t,e){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kt(t,e)}var Ct="undefined"!=typeof Float32Array?Float32Array:Array;function Mt(){var t=new Ct(16);return Ct!=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 jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],p=e[10],d=e[11],v=e[12],y=e[13],g=e[14],m=e[15],w=r[0],b=r[1],x=r[2],E=r[3];return t[0]=w*n+b*c+x*l+E*v,t[1]=w*o+b*s+x*f+E*y,t[2]=w*i+b*u+x*p+E*g,t[3]=w*a+b*h+x*d+E*m,t[4]=(w=r[4])*n+(b=r[5])*c+(x=r[6])*l+(E=r[7])*v,t[5]=w*o+b*s+x*f+E*y,t[6]=w*i+b*u+x*p+E*g,t[7]=w*a+b*h+x*d+E*m,t[8]=(w=r[8])*n+(b=r[9])*c+(x=r[10])*l+(E=r[11])*v,t[9]=w*o+b*s+x*f+E*y,t[10]=w*i+b*u+x*p+E*g,t[11]=w*a+b*h+x*d+E*m,t[12]=(w=r[12])*n+(b=r[13])*c+(x=r[14])*l+(E=r[15])*v,t[13]=w*o+b*s+x*f+E*y,t[14]=w*i+b*u+x*p+E*g,t[15]=w*a+b*h+x*d+E*m,t}function _t(t,e,r){var n,o,i,a,c,s,u,h,l,f,p,d,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],p=e[10],d=e[11],t[0]=n=e[0],t[1]=o,t[2]=i,t[3]=a,t[4]=c,t[5]=s,t[6]=u,t[7]=h,t[8]=l,t[9]=f,t[10]=p,t[11]=d,t[12]=n*v+c*y+l*g+e[12],t[13]=o*v+s*y+f*g+e[13],t[14]=i*v+u*y+p*g+e[14],t[15]=a*v+h*y+d*g+e[15]),t}function Nt(){var t=new Ct(3);return Ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function At(t,e,r){var n=new Ct(3);return n[0]=t,n[1]=e,n[2]=r,n}function Rt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=Nt()}();var It=e.Syringe.defineToken(""),Ft=e.Syringe.defineToken("",{multiple:!1}),Gt=e.Syringe.defineToken("",{multiple:!1}),Bt=e.Syringe.defineToken("",{multiple:!1}),Dt=e.Syringe.defineToken("",{multiple:!1}),Yt=e.Syringe.defineToken("",{multiple:!1}),Wt=e.Syringe.defineToken("",{multiple:!1}),$t=e.Syringe.defineToken("",{multiple:!1}),Ht=e.Syringe.defineToken("",{multiple:!1}),Ut=e.Syringe.defineToken("",{multiple:!1}),Vt=function(){function t(){this.imagePool=void 0}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.opacity,c=r.fillOpacity,s=r.stroke,u=r.strokeOpacity,h=r.lineWidth,l=r.lineCap,f=r.lineJoin,p=r.shadowType,d=r.shadowColor,v=r.shadowBlur,y=r.filter,g=r.miterLimit,m=!e.isNil(i)&&!i.isNone,w=!e.isNil(s)&&!s.isNone&&h>0,b=0===i.alpha,x=!(!y||!y.length),E=!e.isNil(d)&&v>0,L=n.nodeName,O="inner"===p,P=w&&E&&(L===e.Shape.PATH||L===e.Shape.LINE||L===e.Shape.POLYLINE||b||O);m&&(t.globalAlpha=a*c,P||Xt(n,t,E),this.fill(t,n,i,o),P||this.clearShadowAndFilter(t,x,E)),w&&(t.globalAlpha=a*u,t.lineWidth=h,e.isNil(g)||(t.miterLimit=g),e.isNil(l)||(t.lineCap=l),e.isNil(f)||(t.lineJoin=f),P&&(O&&(t.globalCompositeOperation="source-atop"),Xt(n,t,!0),O&&(this.stroke(t,n,s,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,x,!0))),this.stroke(t,n,s,o))},r.clearShadowAndFilter=function(t,r,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),r){var o=t.filter;!e.isNil(o)&&o.indexOf("drop-shadow")>-1&&(t.filter=o.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=i.getColor(e,r,t),t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,o)),t.fill())},r.stroke=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=i.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,o)),t.stroke())},r.getPattern=function(t,e,r,n){return this.imagePool.getOrCreatePatternSync(t,r,(function(){e.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(t,r,n){var o;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var i=r.getGeometryBounds();o=this.imagePool.getOrCreateGradient(Pt({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();function Xt(t,e,r){var n=t.parsedStyle,o=n.filter,i=n.shadowColor,a=n.shadowBlur,c=n.shadowOffsetX,s=n.shadowOffsetY;o&&o.length&&(e.filter=t.style.filter),r&&(e.shadowColor=i.toString(),e.shadowBlur=a||0,e.shadowOffsetX=c||0,e.shadowOffsetY=s||0)}b([e.inject(gt),x("design:type",gt)],Vt.prototype,"imagePool",void 0),Vt=b([e.singleton()],Vt);var zt=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r,n){var o,i=r.img,a=r.shadowColor,c=r.shadowBlur,s=r.width,u=r.height;if(e.isString(i)?o=this.imagePool.getImageSync(i):(s||(s=i.width),u||(u=i.height),o=i),o){Xt(n,t,!e.isNil(a)&&c>0);try{t.drawImage(o,0,0,s,u)}catch(t){}}},t}();b([e.inject(gt),x("design:type",gt)],zt.prototype,"imagePool",void 0),zt=b([e.singleton({token:Ut})],zt);var qt=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,s=r.miterLimit,u=r.letterSpacing,h=r.stroke,l=r.fill,f=r.fillOpacity,p=r.strokeOpacity,d=r.opacity,v=r.metrics,y=r.dx,g=r.dy,m=r.shadowColor,w=r.shadowBlur,b=v.lines,x=v.height,E=v.lineHeight,L=v.lineMetrics;t.font=v.font,t.lineWidth=o,t.textAlign=i,t.textBaseline=a,t.lineJoin=c,e.isNil(s)||(t.miterLimit=s);var O=0;"middle"===a?O=-x/2-E/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?O=-x:"top"!==a&&"hanging"!==a||(O=-E);var P=y||0;O+=g||0,Xt(n,t,!e.isNil(m)&&w>0);for(var S=0;b.length>S;S++){var k=o/2+P;O+=E,e.isNil(h)||h.isNone||!o||this.drawLetterSpacing(t,b[S],L[S],i,k,O,u,f,p,d,!0),e.isNil(l)||this.drawLetterSpacing(t,b[S],L[S],i,k,O,u,f,p,d)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,s,u,h){if(void 0===h&&(h=!1),0!==a){var l=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var p=Array.from(e),d=t.measureText(e).width,v=0,y=0;p.length>y;++y){var g=p[y];h?this.strokeText(t,g,f,i,s):this.fillText(t,g,f,i,c,u),f+=d-(v=t.measureText(e.substring(y+1)).width)+a,d=v}t.textAlign=l}else h?this.strokeText(t,e,o,i,s):this.fillText(t,e,o,i,c,u)},r.fillText=function(t,r,n,o,i,a){var c,s=!e.isNil(i)&&1!==i;s&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),s&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();qt=b([e.singleton({token:Ht})],qt);var Qt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Qt=b([e.singleton({token:Bt})],Qt);var Zt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Zt=b([e.singleton({token:Ft})],Zt);var Jt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Jt=b([e.singleton({token:Gt})],Jt);var Kt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);Kt=b([e.singleton({token:Dt})],Kt);var te=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);te=b([e.singleton({token:Yt})],te);var ee=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);ee=b([e.singleton({token:Wt})],ee);var re=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(Vt);re=b([e.singleton({token:$t})],re);var ne,oe,ie=e.Syringe.defineToken(""),ae=(ne=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.canvasRendererPluginOptions=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Mt(),this.dprMatrix=Mt(),this.tmpMat4=Mt(),this.vec3a=Nt(),this.vec3b=Nt(),this.vec3c=Nt(),this.vec3d=Nt()}var r=t.prototype;return r.apply=function(t){var r=this,n=this.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},i=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(oe.tag,Ot(Et().mark((function t(){var n,a,c,s,u;return Et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,i),n=r.contextService.getDPR(),c=(a=r.canvasConfig).width,s=a.height,u=r.contextService.getContext(),r.clearRect(u,0,0,c*n,s*n),h=r.dprMatrix,l=At(n,n,1),h[0]=l[0],h[1]=0,h[2]=0,h[3]=0,h[4]=0,h[5]=l[1],h[6]=0,h[7]=0,h[8]=0,h[9]=0,h[10]=l[2],h[11]=0,h[12]=0,h[13]=0,h[14]=0,h[15]=1;case 7:case"end":return t.stop()}var h,l}),t)})))),t.hooks.destroy.tap(oe.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,i)})),t.hooks.beginFrame.tap(oe.tag,(function(){var e=r.contextService.getContext(),n=r.contextService.getDPR(),o=r.canvasConfig,i=o.width,a=o.height,c=r.canvasRendererPluginOptions,s=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,h=t.getStats(),l=h.rendered,f=l/h.total;r.clearFullScreen=t.disableDirtyRectangleRendering()||l>s&&f>u,e&&(e.resetTransform(),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n))}));var a=function e(n){n.isVisible()&&!n.isCulled()&&(r.renderDisplayObject(n,t),r.saveDirtyAABB(n)),(n.sortable.sorted||n.childNodes).forEach((function(t){e(t)}))};t.hooks.endFrame.tap(oe.tag,(function(){var o=r.contextService.getContext();if(Tt(r.vpMatrix,r.dprMatrix,r.camera.getOrthoMatrix()),r.clearFullScreen)a(r.renderingContext.root);else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(At(r,n,0),At(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),s=c.x,u=c.y,h=c.width,l=c.height,f=Rt(r.vec3a,At(s,u,0),r.vpMatrix),p=Rt(r.vec3b,At(s+h,u,0),r.vpMatrix),d=Rt(r.vec3c,At(s,u+l,0),r.vpMatrix),v=Rt(r.vec3d,At(s+h,u+l,0),r.vpMatrix),y=Math.min(f[0],p[0],v[0],d[0]),g=Math.min(f[1],p[1],v[1],d[1]),m=Math.max(f[0],p[0],v[0],d[0]),w=Math.max(f[1],p[1],v[1],d[1]),b=Math.floor(y),x=Math.floor(g),E=Math.ceil(m-y),L=Math.ceil(w-g);o.save(),r.clearRect(o,b,x,E,L),o.beginPath(),o.rect(b,x,E,L),o.clip(),o.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),r.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&n.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:b,y:x,width:E,height:L}})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),o.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){o.restore()})),r.restoreStack=[]})),t.hooks.render.tap(oe.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),o=t.nodeName,i=this.restoreStack[this.restoreStack.length-1];!i||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[o]&&(this.styleRendererFactoryCache[o]=this.styleRendererFactory(o));var a=this.styleRendererFactoryCache[o];void 0===this.pathGeneratorFactoryCache[o]&&(this.pathGeneratorFactoryCache[o]=this.pathGeneratorFactory(o));var c=this.pathGeneratorFactoryCache[o],s=t.parsedStyle.clipPath;if(s){this.applyWorldTransform(n,s,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[s.nodeName]&&(this.pathGeneratorFactoryCache[s.nodeName]=this.pathGeneratorFactory(s.nodeName));var u=this.pathGeneratorFactoryCache[s.nodeName];u&&(n.save(),this.restoreStack.push(t),n.beginPath(),u(n,s.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,t.parsedStyle,t,r),n.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,r){var n=r.parsedStyle,o=n.stroke,i=n.fill,a=n.opacity,c=n.lineDash,s=n.lineDashOffset;c&&t.setLineDash(c),e.isNil(s)||(t.lineDashOffset=s),e.isNil(a)||(t.globalAlpha*=a),e.isNil(o)||Array.isArray(o)||o.isNone||(t.strokeStyle=r.attributes.stroke),e.isNil(i)||Array.isArray(i)||i.isNone||(t.fillStyle=r.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,o=0,i=(e.parsedStyle||{}).anchor,a=i&&i[0]||0,c=i&&i[1]||0;if(0!==a||0!==c){var s=e.getGeometryBounds();n=-a*(s&&2*s.halfExtents[0]||0),o=-c*(s&&2*s.halfExtents[1]||0)}r?(jt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,_t(this.tmpMat4,this.tmpMat4,this.vec3a),Tt(this.tmpMat4,r,this.tmpMat4),Tt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(jt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,_t(this.tmpMat4,this.tmpMat4,this.vec3a),Tt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),ne.tag="CanvasRenderer",oe=ne);b([e.inject(e.CanvasConfig),x("design:type",Object)],ae.prototype,"canvasConfig",void 0),b([e.inject(e.DefaultCamera),x("design:type",e.Camera)],ae.prototype,"camera",void 0),b([e.inject(e.ContextService),x("design:type",Object)],ae.prototype,"contextService",void 0),b([e.inject(e.RenderingContext),x("design:type",Object)],ae.prototype,"renderingContext",void 0),b([e.inject(s),x("design:type",Function)],ae.prototype,"pathGeneratorFactory",void 0),b([e.inject(It),x("design:type",Function)],ae.prototype,"styleRendererFactory",void 0),b([e.inject(e.DisplayObjectPool),x("design:type",e.DisplayObjectPool)],ae.prototype,"displayObjectPool",void 0),b([e.inject(ie),x("design:type",Object)],ae.prototype,"canvasRendererPluginOptions",void 0),b([e.inject(e.RBushRoot),x("design:type",e.RBush)],ae.prototype,"rBush",void 0),ae=oe=b([e.singleton({contrib:e.RenderingPluginContribution})],ae);var ce,se,ue=e.Module((function(t){var r;t(Zt),t(Jt),t(Qt),t(zt),t(qt),t(Kt),t(te),t(ee),t(re);var n=((r={})[e.Shape.CIRCLE]=Ft,r[e.Shape.ELLIPSE]=Gt,r[e.Shape.RECT]=Bt,r[e.Shape.IMAGE]=Ut,r[e.Shape.TEXT]=Ht,r[e.Shape.LINE]=Dt,r[e.Shape.POLYLINE]=Yt,r[e.Shape.POLYGON]=Wt,r[e.Shape.PATH]=$t,r);t({token:It,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(ae)})),he=function(t){function e(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}St(e,t);var r=e.prototype;return r.init=function(){this.container.register(ie,{useValue:Pt({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(ue,!0)},r.destroy=function(){this.container.unload(ue),this.container.remove(ie)},e}(e.AbstractRendererPlugin),le=Object.freeze({__proto__:null,get CircleRenderer(){return Zt},CircleRendererContribution:Ft,get EllipseRenderer(){return Jt},EllipseRendererContribution:Gt,get ImageRenderer(){return zt},ImageRendererContribution:Ut,get LineRenderer(){return Kt},LineRendererContribution:Dt,get PathRenderer(){return re},PathRendererContribution:$t,Plugin:he,get PolygonRenderer(){return ee},PolygonRendererContribution:Wt,get PolylineRenderer(){return te},PolylineRendererContribution:Yt,get RectRenderer(){return Qt},RectRendererContribution:Bt,StyleRendererFactory:It,get TextRenderer(){return qt},TextRendererContribution:Ht});function fe(){
|
|
10
10
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
11
|
-
fe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function pe(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function de(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){pe(i,n,o,a,c,"next",t)}function c(t){pe(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ve(t,e){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ve(t,e)}var ye=(ce=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},s=function(e){t.hooks.pointerCancel.call(e)},u=function(e){t.hooks.pointerWheel.call(e)},h=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},l=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",s,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(se.tag,de(fe().mark((function t(){var n;return fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?h(n):f(n),r.supportsTouchEvents&&l(n),n.addEventListener("wheel",u,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(se.tag,(function(){var t=e.contextService.getDomElement();globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):r.supportsPointerEvents&&(t.style.touchAction=""),r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0),t.removeEventListener("touchcancel",s,!0)}(t),t.removeEventListener("wheel",u,!0)}))},t}(),ce.tag="DOMInteraction",se=ce);x([e.inject(e.ContextService),b("design:type",Object)],ye.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],ye.prototype,"renderingContext",void 0),ye=se=x([e.singleton({contrib:e.RenderingPluginContribution})],ye);var ge,me,we=e.Module((function(t){t(ye)})),xe=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="dom-interaction",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,ve(e,r);var o=n.prototype;return o.init=function(){this.container.load(we,!0)},o.destroy=function(){this.container.unload(we)},n}(e.AbstractRendererPlugin),be=Object.freeze({__proto__:null,Plugin:xe});function Ee(){
|
|
11
|
+
fe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function pe(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function de(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){pe(i,n,o,a,c,"next",t)}function c(t){pe(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ve(t,e){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ve(t,e)}var ye=(ce=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},s=function(e){t.hooks.pointerCancel.call(e)},u=function(e){t.hooks.pointerWheel.call(e)},h=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},l=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",s,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(se.tag,de(fe().mark((function t(){var n;return fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?h(n):f(n),r.supportsTouchEvents&&l(n),n.addEventListener("wheel",u,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(se.tag,(function(){var t=e.contextService.getDomElement();globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):r.supportsPointerEvents&&(t.style.touchAction=""),r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0),t.removeEventListener("touchcancel",s,!0)}(t),t.removeEventListener("wheel",u,!0)}))},t}(),ce.tag="DOMInteraction",se=ce);b([e.inject(e.ContextService),x("design:type",Object)],ye.prototype,"contextService",void 0),b([e.inject(e.RenderingContext),x("design:type",Object)],ye.prototype,"renderingContext",void 0),ye=se=b([e.singleton({contrib:e.RenderingPluginContribution})],ye);var ge,me,we=e.Module((function(t){t(ye)})),be=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="dom-interaction",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,ve(e,r);var o=n.prototype;return o.init=function(){this.container.load(we,!0)},o.destroy=function(){this.container.unload(we)},n}(e.AbstractRendererPlugin),xe=Object.freeze({__proto__:null,Plugin:be});function Ee(){
|
|
12
12
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
13
|
-
Ee=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Le(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Oe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Le(i,n,o,a,c,"next",t)}function c(t){Le(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}var Se=(ge=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t,e){var r=t.getWorldTransform();e.style.transform="matrix("+[r[0],r[1],r[4],r[5],r[12],r[13]].join(",")+")"},o=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o),a=o.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){i.style[t]=a[t]})),Object.keys(o.attributes).forEach((function(t){r.updateAttribute(t,o)})),n(o,i)}},i=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},a=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)},c=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o);n(o,i)}};t.hooks.init.tapPromise(me.tag,Oe(Ee().mark((function t(){return Ee().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,c);case 4:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(me.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,c)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;break;case"width":var a=r.computedStyleMap().get("width");n.style.width=a.toString();break;case"height":var c=r.computedStyleMap().get("height");n.style.height=c.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex;break;case"visibility":n.style.visibility=r.parsedStyle.visibility;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity;break;case"fill":var s=r.parsedStyle.fill,u="";s instanceof e.CSSRGB?u=s.isNone?"transparent":r.getAttribute("fill"):Array.isArray(s)?u=r.getAttribute("fill"):e.isPattern(s),n.style.background=u;break;case"stroke":var h=r.parsedStyle.stroke,l="";h instanceof e.CSSRGB?l=h.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(h)?l=r.getAttribute("stroke"):e.isPattern(h),n.style["border-color"]=l,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.style.filter}},t}(),ge.tag="HTMLRendering",me=ge);x([e.inject(e.ContextService),b("design:type",Object)],Se.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],Se.prototype,"renderingContext",void 0),x([e.inject(e.CanvasConfig),b("design:type",Object)],Se.prototype,"canvasConfig",void 0),Se=me=x([e.singleton({contrib:e.RenderingPluginContribution})],Se);var Ce=e.Module((function(t){t(Se)})),ke=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="html-renderer",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,Pe(e,r);var o=n.prototype;return o.init=function(){this.container.load(Ce,!0)},o.destroy=function(){this.container.unload(Ce)},n}(e.AbstractRendererPlugin),Me=Object.freeze({__proto__:null,Plugin:ke}),je=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var n=t.prototype;return n.init=function(){var t=o(r().mark((function t(){var n,o,i,a,c,s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),s=1>(s=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(s),this.dpr=s,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getContext=function(){return this.context},n.getDomElement=function(){return this.$canvas},n.getDPR=function(){return this.dpr},n.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},n.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},n.resize=function(t,r){this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r))},n.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},n.toDataURL=function(){var t=o(r().mark((function t(e){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e={}),t.abrupt("return",this.context.canvas.toDataURL((n=e).type,n.encoderOptions));case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();x([e.inject(e.CanvasConfig),b("design:type",Object)],je.prototype,"canvasConfig",void 0),je=x([e.singleton({token:e.ContextService})],je);var Te=e.Module((function(t){t(je)})),Ne=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-context-register",e}i(e,t);var r=e.prototype;return r.init=function(){this.container.load(Te,!0)},r.destroy=function(){this.container.unload(Te)},e}(e.AbstractRendererPlugin),_e=function(t){function e(e){var r;return(r=t.call(this,e)||this).registerPlugin(new Ne),r.registerPlugin(new xt),r.registerPlugin(new m),r.registerPlugin(new he),r.registerPlugin(new xe),r.registerPlugin(new ut),r.registerPlugin(new ke),r}return i(e,t),e}(e.AbstractRenderer);t.CanvasPathGenerator=w,t.CanvasPicker=ht,t.CanvasRenderer=le,t.DomInteraction=be,t.HTMLRenderer=Me,t.ImageLoader=bt,t.Renderer=_e,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
13
|
+
Ee=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Le(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Oe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Le(i,n,o,a,c,"next",t)}function c(t){Le(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}var Se=(ge=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t,e){var r=t.getWorldTransform();e.style.transform="matrix("+[r[0],r[1],r[4],r[5],r[12],r[13]].join(",")+")"},o=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o),a=o.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){i.style[t]=a[t]})),Object.keys(o.attributes).forEach((function(t){r.updateAttribute(t,o)})),n(o,i)}},i=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},a=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)},c=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o);n(o,i)}};t.hooks.init.tapPromise(me.tag,Oe(Ee().mark((function t(){return Ee().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,c);case 4:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(me.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,c)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;break;case"width":var a=r.computedStyleMap().get("width");n.style.width=a.toString();break;case"height":var c=r.computedStyleMap().get("height");n.style.height=c.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex;break;case"visibility":n.style.visibility=r.parsedStyle.visibility;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity;break;case"fill":var s=r.parsedStyle.fill,u="";s instanceof e.CSSRGB?u=s.isNone?"transparent":r.getAttribute("fill"):Array.isArray(s)?u=r.getAttribute("fill"):e.isPattern(s),n.style.background=u;break;case"stroke":var h=r.parsedStyle.stroke,l="";h instanceof e.CSSRGB?l=h.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(h)?l=r.getAttribute("stroke"):e.isPattern(h),n.style["border-color"]=l,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.style.filter}},t}(),ge.tag="HTMLRendering",me=ge);b([e.inject(e.ContextService),x("design:type",Object)],Se.prototype,"contextService",void 0),b([e.inject(e.RenderingContext),x("design:type",Object)],Se.prototype,"renderingContext",void 0),b([e.inject(e.CanvasConfig),x("design:type",Object)],Se.prototype,"canvasConfig",void 0),Se=me=b([e.singleton({contrib:e.RenderingPluginContribution})],Se);var ke=e.Module((function(t){t(Se)})),Ce=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="html-renderer",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,Pe(e,r);var o=n.prototype;return o.init=function(){this.container.load(ke,!0)},o.destroy=function(){this.container.unload(ke)},n}(e.AbstractRendererPlugin),Me=Object.freeze({__proto__:null,Plugin:Ce}),je=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var n=t.prototype;return n.init=function(){var t=o(r().mark((function t(){var n,o,i,a,c,s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),s=1>(s=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(s),this.dpr=s,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getContext=function(){return this.context},n.getDomElement=function(){return this.$canvas},n.getDPR=function(){return this.dpr},n.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},n.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},n.resize=function(t,r){this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r))},n.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},n.toDataURL=function(){var t=o(r().mark((function t(e){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e={}),t.abrupt("return",this.context.canvas.toDataURL((n=e).type,n.encoderOptions));case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();b([e.inject(e.CanvasConfig),x("design:type",Object)],je.prototype,"canvasConfig",void 0),je=b([e.singleton({token:e.ContextService})],je);var Te=e.Module((function(t){t(je)})),_e=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-context-register",e}i(e,t);var r=e.prototype;return r.init=function(){this.container.load(Te,!0)},r.destroy=function(){this.container.unload(Te)},e}(e.AbstractRendererPlugin),Ne=function(t){function e(e){var r;return(r=t.call(this,e)||this).registerPlugin(new _e),r.registerPlugin(new bt),r.registerPlugin(new m),r.registerPlugin(new he),r.registerPlugin(new be),r.registerPlugin(new ut),r.registerPlugin(new Ce),r}return i(e,t),e}(e.AbstractRenderer);t.CanvasPathGenerator=w,t.CanvasPicker=ht,t.CanvasRenderer=le,t.DomInteraction=xe,t.HTMLRenderer=Me,t.ImageLoader=xt,t.Renderer=Ne,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g-canvas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "A renderer implemented by Canvas 2D API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antv",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@antv/g-plugin-canvas-path-generator": "^1.1.
|
|
34
|
-
"@antv/g-plugin-canvas-picker": "^1.
|
|
35
|
-
"@antv/g-plugin-canvas-renderer": "^1.7.
|
|
36
|
-
"@antv/g-plugin-dom-interaction": "^1.7.
|
|
37
|
-
"@antv/g-plugin-html-renderer": "^1.7.
|
|
38
|
-
"@antv/g-plugin-image-loader": "^1.1.
|
|
33
|
+
"@antv/g-plugin-canvas-path-generator": "^1.1.4",
|
|
34
|
+
"@antv/g-plugin-canvas-picker": "^1.8.1",
|
|
35
|
+
"@antv/g-plugin-canvas-renderer": "^1.7.7",
|
|
36
|
+
"@antv/g-plugin-dom-interaction": "^1.7.4",
|
|
37
|
+
"@antv/g-plugin-html-renderer": "^1.7.4",
|
|
38
|
+
"@antv/g-plugin-image-loader": "^1.1.5",
|
|
39
39
|
"tslib": "^2.3.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d449cbf8de0fea85c8e600aa89da0d63de6fbc52"
|
|
52
52
|
}
|