From 9d74ea7c777eb873c5eed46e3675a0d67671aeba Mon Sep 17 00:00:00 2001 From: xiongjj Date: Wed, 3 Jul 2024 19:31:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90feature=E3=80=91=E6=9B=B4=E6=96=B0icli?= =?UTF-8?q?ent=20l7filter=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js b/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js index 2adf2562..9f78e00a 100644 --- a/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js +++ b/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js @@ -5,4 +5,4 @@ * license: Apache-2.0 * version: v11.2.0 * - */!function(){var t={2306:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(t,e){o[t.id]=e,i.push([])}),n&&n.forEach(function(t){var r=t.source,n=t.target,a=o[r],s=o[n];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))}),i};e.default=r},6765:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return n.GADDIAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return n.connectedComponentAsync}}),e.default=void 0,Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return n.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return n.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return n.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return n.detectCycleAsync}}),e.detectDirectedCycleAsync=void 0,Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return n.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return n.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return n.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return n.floydWarshallAsync}}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return n.getAdjMatrixAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return n.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return n.getInDegreeAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return n.getNeighborsAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return n.getOutDegreeAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return n.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return n.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return n.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return n.pageRankAsync}});var n=r(4613),i=n.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:n.getAdjMatrixAsync,connectedComponentAsync:n.connectedComponentAsync,getDegreeAsync:n.getDegreeAsync,getInDegreeAsync:n.getInDegreeAsync,getOutDegreeAsync:n.getOutDegreeAsync,detectCycleAsync:n.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:n.detectAllCyclesAsync,detectAllDirectedCycleAsync:n.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:n.detectAllUndirectedCycleAsync,dijkstraAsync:n.dijkstraAsync,findAllPathAsync:n.findAllPathAsync,findShortestPathAsync:n.findShortestPathAsync,floydWarshallAsync:n.floydWarshallAsync,labelPropagationAsync:n.labelPropagationAsync,louvainAsync:n.louvainAsync,minimumSpanningTreeAsync:n.minimumSpanningTreeAsync,pageRankAsync:n.pageRankAsync,getNeighborsAsync:n.getNeighborsAsync,GADDIAsync:n.GADDIAsync};e.default=o},1264:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(3247))&&n.__esModule?n:{default:n},o=r(8182);var a=function(t,e,r,n){void 0===n&&(n=!0);var a=function(t){void 0===t&&(t={});var e,r=t,n=function(){},i=(e={},function(t){var r=t.next;return!e[r]&&(e[r]=!0,!0)});return r.allowTraversal=t.allowTraversal||i,r.enter=t.enter||n,r.leave=t.leave||n,r}(r),s=new i.default,u=t.edges,l=void 0===u?[]:u;s.enqueue(e);for(var c="",f=function(){var t=s.dequeue();a.enter({current:t,previous:c}),(0,o.getNeighbors)(t,l,n?"target":void 0).forEach(function(e){a.allowTraversal({previous:c,current:t,next:e})&&s.enqueue(e)}),a.leave({current:t,previous:c}),c=t};!s.isEmpty();)f()};e.default=a},6616:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return e?o(t):i(t)},e.detectStrongConnectComponents=e.detectConnectedComponents=void 0;var n=r(8182),i=function(t){for(var e=t.nodes,r=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u=[],l=function t(e){u.push(e),s[e.id]=!0;for(var i=(0,n.getNeighbors)(e.id,o),a=function(e){var n=i[e];if(!s[n]){var o=r.filter(function(t){return t.id===n});o.length>0&&t(o[0])}},l=0;l0;)h.push(u.pop());a.push(h)}}return a};e.detectConnectedComponents=i;var o=function(t){for(var e=t.nodes,r=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u={},l={},c=[],f=0,h=function t(e){u[e.id]=f,l[e.id]=f,f+=1,a.push(e),s[e.id]=!0;for(var i=(0,n.getNeighbors)(e.id,o,"target").filter(function(t){return r.map(function(t){return t.id}).indexOf(t)>-1}),h=function(n){var o=i[n];if(u[o]||0===u[o])s[o]&&(l[e.id]=Math.min(l[e.id],u[o]));else{var a=r.filter(function(t){return t.id===o});a.length>0&&t(a[0]),l[e.id]=Math.min(l[e.id],l[o])}},p=0;p0;){var y=a.pop();if(s[y.id]=!1,d.push(y),y===e)break}d.length>0&&c.push(d)}},p=0,d=r;p0;)for(var v=p.pop(),g=v.id,m=(0,s.getNeighbors)(g,t.edges),b=function(n){var i,a=m[n],s=t.nodes.find(function(t){return t.id===a});if(a===g)o.push(((i={})[a]=v,i));else if(a in y){if(!y[g].has(s)){for(var u=!0,l=[s,v],c=d[g];y[a].size&&!y[a].has(c)&&(l.push(c),c!==d[c.id]);)c=d[c.id];if(l.push(c),e&&r?(u=!1,l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!0)):e&&!r&&l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!1),u){for(var f={},h=1;h-1)return f;n.push(a),i.add(a);for(var h=c[a.id],p=0;p0;){var r=e.pop();i.has(r)&&(i.delete(r),o[r.id].forEach(function(t){e.push(t)}),o[r.id].clear())}}(a);else for(p=0;p-1});g-1?y[v.id].push(c[b]):u.push(((i={})[v.id]=v,i))}}return{component:d,adjList:y,minIdx:a}},b=0;b=b}),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter(function(t){return t.length>1});if(0===w.length)break;var _=m(w),S=_.minIdx,E=_.adjList,k=_.component;if(!(k.length>1))break;k.forEach(function(t){o[t.id]=new Set});var T=l[S];if(e&&r&&-1===e.indexOf(T.id))return u;f(T,T,E),b=S+1}return u};e.detectAllDirectedCycle=c;e.detectAllCycles=function(t,e,r,n){return void 0===n&&(n=!0),e?c(t,r,n):l(t,r,n)};var f=function(t){var e=null,r=t.nodes,n={},i={},a={},s={};(void 0===r?[]:r).forEach(function(t){i[t.id]=t});for(var u={enter:function(t){var r=t.current,o=t.previous;if(a[r]){e={};for(var s=r,u=o;u!==r;)e[s]=u,s=u,u=n[u];e[s]=u}else a[r]=r,delete i[r],n[r]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var r=t.next;return!e&&!s[r]}};Object.keys(i).length;){var l=Object.keys(i)[0];(0,o.default)(t,l,u)}return e};e.default=f},1940:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,i){void 0===i&&(i=!0);!function t(e,r,i,o,a){void 0===a&&(a=!0);o.enter({current:r,previous:i});var s=e.edges,u=void 0===s?[]:s;(0,n.getNeighbors)(r,u,a?"target":void 0).forEach(function(n){o.allowTraversal({previous:i,current:r,next:n})&&t(e,n,r,o,a)});o.leave({current:r,previous:i})}(t,e,"",function(t){void 0===t&&(t={});var e=t,r=function(){},n=(i={},function(t){var e=t.next;return!i[e]&&(i[e]=!0,!0)});var i;return e.allowTraversal=t.allowTraversal||n,e.enter=t.enter||r,e.leave=t.leave||r,e}(r),i)};var n=r(8182)},7618:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(7582),i=r(7061),o=r(8182),a=function(t,e,r,n){var i=t.nodes,a=void 0===i?[]:i,u=t.edges,l=void 0===u?[]:u,c=[],f={},h={},p={};a.forEach(function(t,r){var n=t.id;c.push(n),h[n]=1/0,n===e&&(h[n]=0)});for(var d=a.length,y=function(t){var e=function(t,e,r){for(var n,i=1/0,o=0;oh[e.id]+s?(h[a]=h[e.id]+s,p[a]=[e.id]):h[a]===h[e.id]+s&&p[a].push(e.id)})},v=0;v0&&c.length>0;){var p=c[c.length-1];if(p.length){var d=p.shift();if(d&&(u.push(d),l[d]=!0,h=n?(0,o.getNeighbors)(d,s,"target"):(0,o.getNeighbors)(d,s),c.push(h.filter(function(t){return!l[t]}))),u[u.length-1]===r){var y=u.map(function(t){return t});f.push(y),v=u.pop(),l[v]=!1,c.pop()}}else{var v=u.pop();l[v]=!1,c.pop()}}return f}},1613:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2306))&&n.__esModule?n:{default:n};var o=function(t,e){for(var r=(0,i.default)(t,e),n=[],o=r.length,a=0;an[a][u]+n[u][s]&&(n[a][s]=n[a][u]+n[u][s]);return n};e.default=o},5654:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(7061),i=r(1821),o=function(){function t(t,e,r,n,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:r||i.VACANT_NODE_LABEL,edgeLabel:n||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var r=0;r=0;e--){var r=this.dfsEdgeList[e],n=r.fromNode,i=r.toNode;nf||n.hasNode(o[c.to])||(e.labelg&&"break"!==m(b);b--);if(y){var x=t.findMinLabel(d);l.dfsEdgeList.push(new o(p,v,i.VACANT_NODE_LABEL,x.edgeLabel,i.VACANT_NODE_LABEL));var w=l.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===l.dfsEdgeList[w]&&a(d[x.edgeLabel].projected)}var _={};y=!1;var S=0;c.forEach(function(e){var r=new s(e),i=t.findForwardPureEdges(n,r.edges[f[0]],h,r);i.length>0&&(y=!0,S=p,i.forEach(function(t){var r="".concat(t.label,"-").concat(u[t.to].label);_[r]||(_[r]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[r].projected.push({graphId:n.id,edge:t,preNode:e})}))});var E=f.length,k=function(e){if(y)return"break";var r=f[e];c.forEach(function(e){var i=new s(e),o=t.findForwardRmpathEdges(n,i.edges[r],h,i);o.length>0&&(y=!0,S=l.dfsEdgeList[r].fromNode,o.forEach(function(t){var r="".concat(t.label,"-").concat(u[t.to].label);_[r]||(_[r]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[r].projected.push({graphId:n.id,edge:t,preNode:e})}))})};for(b=0;b=0;h--){var p=e.findBackwardEdge(i,f.edges[n[h]],f.edges[n[0]],f);if(p){var d="".concat(e.dfsCode.dfsEdgeList[n[h]].fromNode,"-").concat(p.label);c[d]||(c[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[n[h]].fromNode,edgeLabel:p.label}),c[d].projected.push({graphId:t.graphId,edge:p,preNode:t})}}if(!(r>=e.maxNodeNum)){e.findForwardPureEdges(i,f.edges[n[0]],u,f).forEach(function(e){var r="".concat(a,"-").concat(e.label,"-").concat(o[e.to].label);l[r]||(l[r]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),l[r].projected.push({graphId:t.graphId,edge:e,preNode:t})});var y=function(r){e.findForwardRmpathEdges(i,f.edges[n[r]],u,f).forEach(function(i){var a="".concat(e.dfsCode.dfsEdgeList[n[r]].fromNode,"-").concat(i.label,"-").concat(o[i.to].label);l[a]||(l[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[n[r]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),l[a].projected.push({graphId:t.graphId,edge:i,preNode:t})})};for(h=0;hi){var a=i;i=n,n=a}var c=t.label,f="".concat(r,"-").concat(n,"-").concat(c,"-").concat(i),h="".concat(n,"-").concat(c,"-").concat(i);if(!o[h]){var p=o[h]||0;p++,o[h]=p}s[f]={graphId:r,nodeLabel1:n,edgeLabel:c,nodeLabel2:i}})})}),Object.keys(i).forEach(function(t){if(!(i[t]e&&(s=e);var n=r[t.id].inDegree;u>n&&(u=n);var i=r[t.id].outDegree;l>i&&(l=i)}),t[e]={degree:s,inDegree:u,outDegree:l}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:l}},m=function(t,e,r,s,u,m,b){var x;if(void 0===r&&(r=!1),void 0===m&&(m="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var w=t.nodes.length;if(w){var _=(0,i.default)(t,r),S=(0,i.default)(e,r),E=y(t.nodes,_,r),k=y(e.nodes,S,r),T=p(t.nodes,m),C=T.nodeMap,O=T.nodeLabelMap,A=p(e.nodes,m),P=A.nodeMap,M=A.nodeLabelMap;d(t.edges,b,C);var I=d(e.edges,b,P).edgeLabelMap,L=[];null===S||void 0===S||S.forEach(function(t){L=L.concat(t)}),u||(u=Math.max.apply(Math,(0,n.__spreadArray)((0,n.__spreadArray)([],L,!1),[2],!1))),s||(s=u);var j=l(t,_,m,s),N=l(e,S,m,s),R=function(t,e,r,n,i){var o=Math.ceil(r/e),a={},s=0;return n.forEach(function(t,n){for(var u=0,l=0,c=t.nodeIdxs,f=t.neighborNum-1;u2*e)););if(p<2*e&&(a["".concat(n,"-").concat(h)]={start:n,end:h,distance:i[n][h]},u++,++s>=r))return a;if(++l>2*e)break}uX&&(X=r.length,q=r,Y=e,W=t)});var Z={},K={},J={},Q={},$={},tt={};Object.keys(M).forEach(function(n,i){$[n]=[],r&&(tt[n]=[]);var o=-1/0,a={};M[n].forEach(function(t){var e=k["".concat(W.id,"-").concat(t.id)];if(e&&$[n].push(e),o$[n][l]){u=!0;break}if(u)return q.splice(e,1),"continue";var c={};i.neighbors.forEach(function(t){var e=E["".concat(r.id,"-").concat(t.id)];c["".concat(r.id,"-").concat(t.id)]={start:C[r.id].idx,end:C[t.id].idx,distance:e}}),D=f(c,j,t,D);var p=[];Object.keys(c).forEach(function(t){if(H[t])p.push(H[t]);else{var e=D[t];H[t]=h(e,V,m,b),p.push(H[t])}}),p=p.sort(function(t,e){return e-t});var d=!1;for(l=0;l=0;l--)u(l)});var et=[];null===q||void 0===q||q.forEach(function(n){for(var i=C[n.id].idx,o=c(t.nodes,_[i],i,m,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1$[f][d])o.splice(s,1);else{if(r){var y="".concat(l.id,"-").concat(n.id),x=E[y];if(d=tt[f].length-1,x>tt[f][d]){o.splice(s,1);continue}}var w=H[h]?H[h]:v(t,n,l,C,p,j,V,m,b,H,D),S="".concat(W.id,"-").concat(f);if(w=0&&"break"!==x(p);p--);if(v)return et.splice(n,1),"continue";i.edges=l;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[m];if(s[e]--,s[e]nt[n][nt[n].length-1]){if(e=u[t].node[m],s[e]--,s[e]=0;E--){var k=i.nodes[E],T=u[k.id].degree,O=u[k.id].inDegree,A=u[k.id].outDegree,L=k[m],j=g(Z,L,P,M),N=j.minPatternNodeLabelDegree,R=j.minPatternNodeLabelInDegree,D=j.minPatternNodeLabelOutDegree;if(r?T=0;B--){var F=l[B];if(!u[F.source]||!u[F.target]){l.splice(B,1);var z=F[b];if(c[z]--,u[F.source]&&(u[F.source].degree--,u[F.source].outDegree--),u[F.target]&&(u[F.target].degree--,u[F.target].inDegree--),I[z]&&c[z]=0&&"break"!==it(ot);ot--);var at=et.length,st=function(t){var e={};et[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};et[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&et.splice(t,1)},n=at-1;n>t;n--)r(n);at=et.length};for(ot=0;ot<=at-1;ot++)st(ot);return et}}};e.default=m},3760:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2306))&&n.__esModule?n:{default:n},o=r(8182);var a=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={},f={};s.forEach(function(t,e){var r=(0,o.uniqueId)();t.clusterId=r,c[r]={id:r,nodes:[t]},f[t.id]={node:t,idx:e}});var h=[],p={};(0,i.default)(t,e).forEach(function(t,e){var r=0,n=s[e].id;p[n]={},t.forEach(function(t,e){if(t){r+=t;var i=s[e].id;p[n][i]=t}}),h.push(r)});for(var d=0,y=function(){var t=!1;if(s.forEach(function(e){var r={};Object.keys(p[e.id]).forEach(function(t){var n=p[e.id][t],i=f[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n=0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),l=c[i[u]];l.nodes.push(e),e.clusterId=l.id}}}),!t)return"break";d++};d0&&A>P&&A-PP&&(I=v.map(function(t){return{node:t,clusterId:t.clusterId}}),L=(0,n.clone)(S),P=A),j||M>100)break;M++,Object.keys(S).forEach(function(t){var e=0;m.forEach(function(n){var i=n.source,o=n.target,a=E[i].node.clusterId,s=E[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),S[t].sumTot=e}),v.forEach(function(t,e){var n,i=S[t.clusterId],o=0,a=T[e]/(2*O),s=0,l=i.nodes;l.forEach(function(t){var r=E[t.id].idx;s+=k[e][r]||0});var f=s-i.sumTot*a,h=l.filter(function(e){return e.id!==t.id}),p=[];h.forEach(function(t,e){p[e]=b[t.originIndex]});var y=c(h,b)*d,v=C[t.id];if(Object.keys(v).forEach(function(r){var i=E[r].node.clusterId;if(i!==t.clusterId){var s=S[i],l=s.nodes;if(l&&l.length){var h=0;l.forEach(function(t){var r=E[t.id].idx;h+=k[e][r]||0});var p=h-s.sumTot*a,v=l.concat([t]),g=[];v.forEach(function(t,e){g[e]=b[t.originIndex]});var m=c(v,b)*d,x=p-f;u&&(x=p+m-(f+y)),x>o&&(o=x,n=s)}}}),o>0){n.nodes.push(t);var g=t.clusterId;t.clusterId=n.id;var x=i.nodes.indexOf(t);i.nodes.splice(x,1);var w=0,_=0;m.forEach(function(t){var e=t.source,i=t.target,o=E[e].node.clusterId,a=E[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(w+=t[r]||1),(o===g&&a!==g||a===g&&o!==g)&&(_+=t[r]||1)}),n.sumTot=w,i.sumTot=_}})}var N={},R=0;Object.keys(L).forEach(function(t){var e=L[t];if(e.nodes&&e.nodes.length){var r=String(R+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),L[r]=e,N[t]=r,delete L[t],R++)}else delete L[t]}),I.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&N[e.clusterId]&&(e.clusterId=N[e.clusterId]))});var D=[],B={};m.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=E[e].node.clusterId,a=E[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(B[s])B[s].weight+=i,B[s].count++;else{var u={source:o,target:a,weight:i,count:1};B[s]=u,D.push(u)}}});var F=[];return Object.keys(L).forEach(function(t){F.push(L[t])}),{clusters:F,clusterEdges:D}};e.default=f},15:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(9511)),i=a(r(7605)),o=r(8182);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var r=[],n=t.nodes,a=void 0===n?[]:n,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return r;var l=a[0],c=new Set;c.add(l);var f=new i.default(function(t,r){return e?t.weight-r.weight:0});for((0,o.getEdgesByNodeId)(l.id,u).forEach(function(t){f.insert(t)});!f.isEmpty();){var h=f.delMin(),p=h.source,d=h.target;c.has(p)&&c.has(d)||(r.push(h),c.has(p)||(c.add(p),(0,o.getEdgesByNodeId)(p,u).forEach(function(t){f.insert(t)})),c.has(d)||(c.add(d),(0,o.getEdgesByNodeId)(d,u).forEach(function(t){f.insert(t)})))}return r},u=function(t,e){var r=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return r;var u=s.map(function(t){return t});e&&u.sort(function(t,e){return t.weight-e.weight});for(var l=new n.default(o.map(function(t){return t.id}));u.length>0;){var c=u.shift(),f=c.source,h=c.target;l.connected(f,h)||(r.push(c),l.union(f,h))}return r},l=function(t,e,r){return r?{prim:s,kruskal:u}[r](t,e):u(t,e)};e.default=l},6155:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(3597))&&n.__esModule?n:{default:n},o=r(8182);var a=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,a=1,s=0,u=1e3,l=t.nodes,c=void 0===l?[]:l,f=t.edges,h=void 0===f?[]:f,p=c.length,d={},y={},v=0;v0&&a>e;){for(s=0,v=0;v0&&(n+=y[w]/_)}d[m]=r*n,s+=d[m]}}for(s=(1-s)/p,a=0,v=0;v0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n0?r=n:null!==i&&i0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}();e.default=n},800:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var r=function(t,e){return t===e},n=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=n;var i=function(){function t(t){void 0===t&&(t=r),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new n(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new n(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var r=this.head;if(null!==r)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},t.prototype.find=function(t){var e=t.value,r=void 0===e?void 0:e,n=t.callback,i=void 0===n?void 0:n;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==r&&this.compare(o.value,r))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach(function(t){return e.append(t)}),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},t}();e.default=i},3247:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(800))&&n.__esModule?n:{default:n};var o=function(){function t(){this.linkedList=new i.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=o},9511:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?C(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?C(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=v.exec(t))?new A(e[1],e[2],e[3],1):(e=g.exec(t))?new A(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=m.exec(t))?C(e[1],e[2],e[3],e[4]):(e=b.exec(t))?C(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=x.exec(t))?N(e[1],e[2]/100,e[3]/100,1):(e=w.exec(t))?N(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?T(_[t]):"transparent"===t?new A(NaN,NaN,NaN,0):null}function T(t){return new A(t>>16&255,t>>8&255,255&t,1)}function C(t,e,r,n){return n<=0&&(t=e=r=NaN),new A(t,e,r,n)}function O(t,e,r,n){return 1===arguments.length?((i=t)instanceof f||(i=k(i)),i?new A((i=i.rgb()).r,i.g,i.b,i.opacity):new A):new A(t,e,r,null==n?1:n);var i}function A(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function P(){return"#".concat(j(this.r)).concat(j(this.g)).concat(j(this.b))}function M(){var t=I(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(L(this.r),", ").concat(L(this.g),", ").concat(L(this.b)).concat(1===t?")":", ".concat(t,")"))}function I(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function L(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function j(t){return((t=L(t))<16?"0":"")+t.toString(16)}function N(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new D(t,e,r,n)}function R(t){if(t instanceof D)return new D(t.h,t.s,t.l,t.opacity);if(t instanceof f||(t=k(t)),!t)return new D;if(t instanceof D)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(r-n)/s+6*(r0&&u<1?0:a,new D(a,s,u,t.opacity)}function D(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function B(t){return(t=(t||0)%360)<0?t+360:t}function F(t){return Math.max(0,Math.min(1,t||0))}function z(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function U(t,e,r,n,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*r+(1+3*t+3*o-3*a)*n+a*i)/6}l(f,k,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:S,formatHex:S,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return R(this).formatHsl()},formatRgb:E,toString:E}),l(A,O,c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new A(L(this.r),L(this.g),L(this.b),I(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:P,formatHex:P,formatHex8:function(){return"#".concat(j(this.r)).concat(j(this.g)).concat(j(this.b)).concat(j(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:M,toString:M})),l(D,function(t,e,r,n){return 1===arguments.length?R(t):new D(t,e,r,null==n?1:n)},c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new D(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new D(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new A(z(t>=240?t-240:t+120,i,n),z(t,i,n),z(t<120?t+240:t-120,i,n),this.opacity)},clamp:function(){return new D(B(this.h),F(this.s),F(this.l),I(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=I(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(B(this.h),", ").concat(100*F(this.s),"%, ").concat(100*F(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));var G=function(t){return function(){return t}};function V(t,e){return function(r){return t+r*e}}function H(t){return 1==(t=+t)?W:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):G(isNaN(e)?r:e)}}function W(t,e){var r=e-t;return r?V(t,r):G(isNaN(t)?e:t)}var q=function t(e){var r=H(e);function n(t,e){var n=r((t=O(t)).r,(e=O(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=W(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Y(t){return function(e){var r,n,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],a=n>0?t[n-1]:2*i-o,s=no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:J(r,n)})),o=tt.lastIndex;return oh.length?(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.fillPathByDiff(h,f),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f):e.pathFormatted||(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f,e.pathFormatted=!0),n[c]=[];for(var p=0;p0){for(var o=n.animators.length-1;o>=0;o--)if((t=n.animators[o]).destroyed)n.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)r=e[a],ut(t,r,i)&&(e.splice(a,1),!1,r.callback&&r.callback());0===e.length&&n.removeAnimator(o)}n.canvas.get("autoDraw")||n.canvas.draw()}})},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ct=r(4918),ft=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ht(t,e,r){r.name=e,r.target=t,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}function pt(t,e,r){if(r.bubbles){var n=void 0,i=!1;if("mouseenter"===e?(n=r.fromShape,i=!0):"mouseleave"===e&&(i=!0,n=r.toShape),t.isCanvas()&&i)return;if(n&&(0,a.UY)(t,n))return void(r.bubbles=!1);r.name=e,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}}var dt=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var r=t.type;e._triggerEvent(r,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var r=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,r,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var r=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,r,null),e._emitEvent("dragend",t,r,e.draggingShape),e._afterDrag(e.draggingShape,r,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");(0,a.S6)(ft,function(r){e.addEventListener(r,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");(0,a.S6)(ft,function(r){e.removeEventListener(r,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,r,n,i,o){var a=new ct.Z(t,e);return a.fromShape=i,a.toShape=o,a.x=r.x,a.y=r.y,a.clientX=r.clientX,a.clientY=r.clientY,a.propagationPath.push(n),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,r=e.getClientByEvent(t),n=e.getPointByEvent(t);return{x:n.x,y:n.y,clientX:r.x,clientY:r.y}},t.prototype._triggerEvent=function(t,e){var r=this._getPointInfo(e),n=this._getShape(r,e),i=this["_on"+t],o=!1;if(i)i.call(this,r,n,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,r,null,null,n),n&&this._emitEvent(t,e,r,n,null,n),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,r,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,r,a,a,null),this._emitEvent(t,e,r,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,r,null)):this._emitEvent(t,e,r,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=n.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,r){0===r.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,r,n){var i=this.canvas.get("el");r!==n&&(r&&(this._emitEvent("mouseout",t,e,r,r,n),this._emitEvent("mouseleave",t,e,r,r,n),n&&!n.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",t,e,n,r,n),this._emitEvent("mouseenter",t,e,n,r,n)))},t.prototype._emitDragoverEvents=function(t,e,r,n,i){n?(n!==r&&(r&&this._emitEvent("dragleave",t,e,r,r,n),this._emitEvent("dragenter",t,e,n,r,n)),i||this._emitEvent("dragover",t,e,n)):r&&this._emitEvent("dragleave",t,e,r,r,n),i&&this._emitEvent("dragover",t,e,n)},t.prototype._afterDrag=function(t,e,r){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(e,r);n!==t&&this._emitMouseoverEvents(r,e,t,n),this.currentShape=n},t.prototype._onmouseup=function(t,e,r){if(0===r.button){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",r,t,e),this._emitEvent("dragend",r,t,n),this._afterDrag(n,t,r)):(this._emitEvent("mouseup",r,t,e),e===this.mousedownShape&&this._emitEvent("click",r,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,r){r.preventDefault();var n=this.currentShape;this._emitDragoverEvents(r,t,n,e,!0)},t.prototype._onmousemove=function(t,e,r){var n=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,t,i,e,!1),this._emitEvent("drag",r,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=r.timeStamp-this.mousedownTimeStamp,l=a.clientX-t.clientX,c=a.clientY-t.clientY;u>120||l*l+c*c>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e))}else this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)}},t.prototype._emitEvent=function(t,e,r,n,i,o){var a=this._getEventObj(t,e,r,n,i,o);if(n){a.shape=n,ht(n,t,a);for(var s=n.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||pt(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ht(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),yt=(0,i.qY)(),vt=yt&&"firefox"===yt.name,gt=function(t){function e(e){var r=t.call(this,e)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");(0,a.HD)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new dt({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new lt(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var r=this.get("el");a.jU&&(r.style.width=t+"px",r.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");a.jU&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(vt&&!(0,a.kK)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,a.kK)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),r=e.x,n=e.y;return this.getPointByClient(r,n)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t-r.left,y:e-r.top}},e.prototype.getClientByPoint=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t+r.left,y:e+r.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(o.Z)},1765:function(t,e,r){"use strict";var n=r(7582),i=r(3618),o=r(59),a={},s="_INDEX";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.__extends)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.S6)(i,function(i){var o=i.getBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;ae&&(e=s),un&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.S6)(i,function(i){var o=i.getCanvasBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;ae&&(e=s),un&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,r,n){if(t.prototype.onAttrChange.call(this,e,r,n),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var r=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var n=this.getTotalMatrix();n!==r&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();(0,o.S6)(e,function(e){e.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],e=0;e=0;a--){var s=t[a];if((0,o.pP)(s)&&(s.isGroup()?i=s.getShape(e,r,n):s.isHit(e,r)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),r=this.getChildren(),n=this.get("timeline"),i=t.getParent();i&&function(t,e,r){void 0===r&&(r=!0),r?e.destroy():(e.set("parent",null),e.set("canvas",null)),(0,o.As)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,r){if(e.set("canvas",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,e),n&&function t(e,r){if(e.set("timeline",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,n),r.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();(0,o.S6)(e,function(t,e){return t[s]=e,t}),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,r){var n=t(e,r);return 0===n?e[s]-r[s]:n})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],r=this.getChildren();return(0,o.S6)(r,function(r){t(r)&&e.push(r),r.isGroup()&&(e=e.concat(r.findAll(t)))}),e},e.prototype.find=function(t){var e=null,r=this.getChildren();return(0,o.S6)(r,function(r){if(t(r)?e=r:r.isGroup()&&(e=r.find(t)),e)return!1}),e},e.prototype.findById=function(t){return this.find(function(e){return e.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(e){return e.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(e){return e.get("name")===t})},e}(i.Z);e.Z=u},3618:function(t,e,r){"use strict";var n=r(7582),i=r(7061),o=r(2128),a=r(59),s=r(6431),u=r(1006),l=o.vs,c=["zIndex","capture","visible","type"],f=["repeat"];var h=function(t){function e(e){var r=t.call(this,e)||this;r.attrs={};var n=r.getDefaultAttrs();return(0,i.mix)(n,e.attrs),r.attrs=n,r.initAttrs(n),r.initAnimate(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],r=0;r0?n=function(t,e){if(e.onFrame)return t;var r=e.startTime,n=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return(0,i.each)(t,function(t){r+nt.delay&&(0,i.each)(e.toAttrs,function(e,r){a.call(t.toAttrs,r)&&(delete t.toAttrs[r],delete t.fromAttrs[r])})}),t}(n,x):r.addAnimator(this),n.push(x),this.set("animations",n),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var r=this.get("animations");(0,i.each)(r,function(r){t&&(r.onFrame?e.attr(r.onFrame(1)):e.attr(r.toAttrs)),r.callback&&r.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),r=t.getTime();return(0,i.each)(e,function(t){t._paused=!0,t._pauseTime=r,t.pauseCallback&&t.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:r}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),r=this.get("_pause").pauseTime;return(0,i.each)(e,function(e){e.startTime=e.startTime+(t-r),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var r,n=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?r=e.fromShape:"mouseleave"===t&&(r=e.toShape);for(var s=function(t){var s=o[t],l=s.get("name");if(l){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&r&&(0,a.UY)(s,r))return"break";(0,i.isArray)(l)?(0,i.each)(l,function(t){n.emitDelegateEvent(s,t,e)}):u.emitDelegateEvent(s,l,e)}},u=this,l=0;l=t&&r.minY<=e&&r.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),r=t.minX,n=t.minY,i=t.maxX,a=t.maxY;if(e){var s=(0,o.rG)(e,[t.minX,t.minY]),u=(0,o.rG)(e,[t.maxX,t.minY]),l=(0,o.rG)(e,[t.minX,t.maxY]),c=(0,o.rG)(e,[t.maxX,t.maxY]);r=Math.min(s[0],u[0],l[0],c[0]),i=Math.max(s[0],u[0],l[0],c[0]),n=Math.min(s[1],u[1],l[1],c[1]),a=Math.max(s[1],u[1],l[1],c[1])}var f=this.attrs;if(f.shadowColor){var h=f.shadowBlur,p=void 0===h?0:h,d=f.shadowOffsetX,y=void 0===d?0:d,v=f.shadowOffsetY,g=void 0===v?0:v,m=r-p+y,b=i+p+y,x=n-p+g,w=a+p+g;r=Math.min(r,m),i=Math.max(i,b),n=Math.min(n,x),a=Math.max(a,w)}return{x:r,y:n,minX:r,minY:n,maxX:i,maxY:a,width:i-r,height:a-n}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var r=this.get("startArrowShape"),n=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(r&&r.isHit(o,a))return!0;if(n&&n.isHit(o,a))return!0}return!1},e}(i.Z);e.Z=a},5247:function(t,e,r){"use strict";r.d(e,{_:function(){return Y},C:function(){return X}});var n={};function i(t){return+t}function o(t){return t*t}function a(t){return t*(2-t)}function s(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function u(t){return t*t*t}function l(t){return--t*t*t+1}function c(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}r.r(n),r.d(n,{easeBack:function(){return U},easeBackIn:function(){return F},easeBackInOut:function(){return U},easeBackOut:function(){return z},easeBounce:function(){return D},easeBounceIn:function(){return R},easeBounceInOut:function(){return B},easeBounceOut:function(){return D},easeCircle:function(){return k},easeCircleIn:function(){return S},easeCircleInOut:function(){return k},easeCircleOut:function(){return E},easeCubic:function(){return c},easeCubicIn:function(){return u},easeCubicInOut:function(){return c},easeCubicOut:function(){return l},easeElastic:function(){return H},easeElasticIn:function(){return V},easeElasticInOut:function(){return W},easeElasticOut:function(){return H},easeExp:function(){return _},easeExpIn:function(){return x},easeExpInOut:function(){return _},easeExpOut:function(){return w},easeLinear:function(){return i},easePoly:function(){return p},easePolyIn:function(){return f},easePolyInOut:function(){return p},easePolyOut:function(){return h},easeQuad:function(){return s},easeQuadIn:function(){return o},easeQuadInOut:function(){return s},easeQuadOut:function(){return a},easeSin:function(){return m},easeSinIn:function(){return v},easeSinInOut:function(){return m},easeSinOut:function(){return g}});var f=function t(e){function r(t){return Math.pow(t,e)}return e=+e,r.exponent=t,r}(3),h=function t(e){function r(t){return 1-Math.pow(1-t,e)}return e=+e,r.exponent=t,r}(3),p=function t(e){function r(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,r.exponent=t,r}(3),d=Math.PI,y=d/2;function v(t){return 1==+t?1:1-Math.cos(t*y)}function g(t){return Math.sin(t*y)}function m(t){return(1-Math.cos(d*t))/2}function b(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function x(t){return b(1-+t)}function w(t){return 1-b(t)}function _(t){return((t*=2)<=1?b(1-t):2-b(t-1))/2}function S(t){return 1-Math.sqrt(1-t*t)}function E(t){return Math.sqrt(1- --t*t)}function k(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var T=4/11,C=6/11,O=8/11,A=.75,P=9/11,M=10/11,I=.9375,L=21/22,j=63/64,N=1/T/T;function R(t){return 1-D(1-t)}function D(t){return(t=+t)Math.PI/2?Math.PI-l:l,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-l)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",function(t){for(var e=t.attr().points,r=[],n=[],i=0;i2&&(r.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&r.push([i,s[0]]),"r"===u)r.push([i].concat(s));else for(;s.length>=e[u]&&(r.push([i].concat(s.splice(0,e[u]))),e[u]););return t}),r},u=function(t,e){for(var r=[],n=0,i=t.length;i-2*!e>n;n+=2){var o=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?i-4===n?o[3]={x:+t[0],y:+t[1]}:i-2===n&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===n?o[3]=o[2]:n||(o[0]={x:+t[n],y:+t[n+1]}),r.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return r},l=function(t,e,r,n,i){var o=[];if(null===i&&null===n&&(n=r),t=+t,e=+e,r=+r,n=+n,null!==i){var a=Math.PI/180,s=t+r*Math.cos(-n*a),u=t+r*Math.cos(-i*a);o=[["M",s,e+r*Math.sin(-n*a)],["A",r,r,0,+(i-n>180),0,u,e+r*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-n],["a",r,n,0,1,1,0,2*n],["a",r,n,0,1,1,0,-2*n],["z"]];return o},c=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,r,n=[],i=0,o=0,a=0,c=0,f=0;"M"===t[0][0]&&(a=i=+t[0][1],c=o=+t[0][2],f++,n[0]=["M",i,o]);for(var h=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=void 0,d=void 0,y=f,v=t.length;y1&&(n*=_=Math.sqrt(_),i*=_);var S=n*n,E=i*i,k=(a===s?-1:1)*Math.sqrt(Math.abs((S*E-S*w*w-E*x*x)/(S*w*w+E*x*x)));d=k*n*w/i+(e+u)/2,y=k*-i*x/n+(r+l)/2,h=Math.asin(((r-y)/i).toFixed(9)),p=Math.asin(((l-y)/i).toFixed(9)),h=ep&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var T=p-h;if(Math.abs(T)>v){var C=p,O=u,A=l;p=h+v*(s&&p>h?1:-1),m=t(u=d+n*Math.cos(p),l=y+i*Math.sin(p),n,i,o,0,s,O,A,[p,C,d,y])}T=p-h;var P=Math.cos(h),M=Math.sin(h),I=Math.cos(p),L=Math.sin(p),j=Math.tan(T/4),N=4/3*n*j,R=4/3*i*j,D=[e,r],B=[e+N*M,r-R*P],F=[u+N*L,l-R*I],z=[u,l];if(B[0]=2*D[0]-B[0],B[1]=2*D[1]-B[1],c)return[B,F,z].concat(m);for(var U=[],G=0,V=(m=[B,F,z].concat(m).join().split(",")).length;G7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),r=Math.max(n.length,i&&i.length||0)}},v=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],r=Math.max(n.length,i&&i.length||0))};r=Math.max(n.length,i&&i.length||0);for(var g=0;g1?1:u<0?0:u)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,p=0;p<12;p++){var d=l*c[p]+l,y=v(d,t,r,i,a),g=v(d,e,n,o,s),m=y*y+g*g;h+=f[p]*Math.sqrt(m)}return l*h},m=function(t,e,r,n,i,o,a,s){if(!(Math.max(t,r)Math.max(i,a)||Math.max(e,n)Math.max(o,s))){var u=(t-r)*(o-s)-(e-n)*(i-a);if(u){var l=((t*n-e*r)*(i-a)-(t-r)*(i*s-o*a))/u,c=((t*n-e*r)*(o-s)-(e-n)*(i*s-o*a))/u,f=+l.toFixed(2),h=+c.toFixed(2);if(!(f<+Math.min(t,r).toFixed(2)||f>+Math.max(t,r).toFixed(2)||f<+Math.min(i,a).toFixed(2)||f>+Math.max(i,a).toFixed(2)||h<+Math.min(e,n).toFixed(2)||h>+Math.max(e,n).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+Math.max(o,s).toFixed(2)))return{x:l,y:c}}}},b=function(t,e,r){return e>=t.x&&e<=t.x+t.width&&r>=t.y&&r<=t.y+t.height},x=function(t,e,r,n,i){if(i)return[["M",+t+ +i,e],["l",r-2*i,0],["a",i,i,0,0,1,i,i],["l",0,n-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-r,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-n],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",r,0],["l",0,n],["l",-r,0],["z"]];return o.parsePathArray=y,o},w=function(t,e,r,n){return null===t&&(t=e=r=n=0),null===e&&(e=t.y,r=t.width,n=t.height,t=t.x),{x:t,y:e,width:r,w:r,height:n,h:n,x2:t+r,y2:e+n,cx:t+r/2,cy:e+n/2,r1:Math.min(r,n)/2,r2:Math.max(r,n)/2,r0:Math.sqrt(r*r+n*n)/2,path:x(t,e,r,n),vb:[t,e,r,n].join(" ")}},_=function(t,e,r,i,o,a,s,u){(0,n.isArray)(t)||(t=[t,e,r,i,o,a,s,u]);var l=function(t,e,r,n,i,o,a,s){for(var u,l,c,f,h=[],p=[[],[]],d=0;d<2;++d)if(0===d?(l=6*t-12*r+6*i,u=-3*t+9*r-9*i+3*a,c=3*r-3*t):(l=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*s,c=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(l)<1e-12)continue;(f=-c/l)>0&&f<1&&h.push(f)}else{var y=l*l-4*c*u,v=Math.sqrt(y);if(!(y<0)){var g=(-l+v)/(2*u);g>0&&g<1&&h.push(g);var m=(-l-v)/(2*u);m>0&&m<1&&h.push(m)}}for(var b,x=h.length,w=x;x--;)b=1-(f=h[x]),p[0][x]=b*b*b*t+3*b*b*f*r+3*b*f*f*i+f*f*f*a,p[1][x]=b*b*b*e+3*b*b*f*n+3*b*f*f*o+f*f*f*s;return p[0][w]=t,p[1][w]=e,p[0][w+1]=a,p[1][w+1]=s,p[0].length=p[1].length=w+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}}.apply(null,t);return w(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},S=function(t,e,r,n,i,o,a,s,u){var l=1-u,c=Math.pow(l,3),f=Math.pow(l,2),h=u*u,p=h*u,d=t+2*u*(r-t)+h*(i-2*r+t),y=e+2*u*(n-e)+h*(o-2*n+e),v=r+2*u*(i-r)+h*(a-2*i+r),g=n+2*u*(o-n)+h*(s-2*o+n);return{x:c*t+3*f*u*r+3*l*u*u*i+p*a,y:c*e+3*f*u*n+3*l*u*u*o+p*s,m:{x:d,y:y},n:{x:v,y:g},start:{x:l*t+u*r,y:l*e+u*n},end:{x:l*i+u*a,y:l*o+u*s},alpha:90-180*Math.atan2(d-v,y-g)/Math.PI}},E=function(t,e,r){if(!function(t,e){return t=w(t),e=w(e),b(e,t.x,t.y)||b(e,t.x2,t.y)||b(e,t.x,t.y2)||b(e,t.x2,t.y2)||b(t,e.x,e.y)||b(t,e.x2,e.y)||b(t,e.x,e.y2)||b(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(_(t),_(e)))return r?0:[];for(var n=~~(g.apply(0,t)/8),i=~~(g.apply(0,e)/8),o=[],a=[],s={},u=r?0:[],l=0;l=0&&k<=1&&T>=0&&T<=1&&(r?u+=1:u.push({x:E.x,y:E.y,t1:k,t2:T}))}}return u},k=function(t,e){return function(t,e,r){var n,i,o,a,s,u,l,c,f,h;t=p(t),e=p(e);for(var d=r?0:[],y=0,v=t.length;y=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}(t,e,r));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=r-1;o++)n.push(i)}return n},O=function(t,e){if(1===t.length)return t;var r=t.length-1,n=e.length-1,i=r/n,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var f=i-(n=t.length);if(n0)){t[n]=e[n];break}r=I(r,t[n-1],1)}t[n]=["Q"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"T":t[n]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(n>0)){t[n]=e[n];break}r=I(r,t[n-1],2)}t[n]=["C"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(r.length<2){if(!(n>0)){t[n]=e[n];break}r=I(r,t[n-1],1)}t[n]=["S"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;default:t[n]=e[n]}return t}},5963:function(t,e,r){"use strict";r.d(e,{$O:function(){return s},FE:function(){return o},mY:function(){return a}});var n=r(59),i=r(3264);function o(t,e,r){var i=1;return(0,n.HD)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,r)*(i-1):e}function a(t,e){var r=(0,i.L)(),o=0;if((0,n.kK)(t)||""===t)return o;if(r.save(),r.font=e,(0,n.HD)(t)&&t.includes("\n")){var a=t.split("\n");(0,n.S6)(a,function(t){var e=r.measureText(t).width;o(r-t)*(r-t)+(n-e)*(n-e)?o(r,n,i,a):this.pointToLine(t,e,r,n,i,a)},pointToLine:function(t,e,r,n,i,o){var a=[r-t,n-e];if(c.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];c.normalize(s,s);var u=[i-t,o-e];return Math.abs(c.dot(u,s))},tangentAngle:function(t,e,r,n){return Math.atan2(n-e,r-t)}},h=1e-4;function p(t,e,r,n,i,a){var s,u=1/0,l=[r,n],c=20;a&&a>200&&(c=a/10);for(var f=1/c,p=f/10,d=0;d<=c;d++){var y=d*f,v=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))];(x=o(l[0],l[1],v[0],v[1]))=0&&x=0?[i]:[]}function v(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function g(t,e,r,n,i,o,a){var s=d(t,r,i,a),u=d(e,n,o,a),l=f.pointAt(t,e,r,n,a),c=f.pointAt(r,n,i,o,a);return[[t,e,l.x,l.y,s,u],[s,u,c.x,c.y,i,o]]}var m={box:function(t,e,r,n,i,o){var a=y(t,r,i)[0],u=y(e,n,o)[0],l=[t,i],c=[e,o];return void 0!==a&&l.push(d(t,r,i,a)),void 0!==u&&c.push(d(e,n,o,u)),s(l,c)},length:function(t,e,r,n,i,a){return function t(e,r,n,i,a,s,u){if(0===u)return(o(e,r,n,i)+o(n,i,a,s)+o(e,r,a,s))/2;var l=g(e,r,n,i,a,s,.5),c=l[0],f=l[1];return c.push(u-1),f.push(u-1),t.apply(null,c)+t.apply(null,f)}(t,e,r,n,i,a,3)},nearestPoint:function(t,e,r,n,i,o,a,s){return p([t,r,i],[e,n,o],a,s,d)},pointDistance:function(t,e,r,n,i,a,s,u){var l=this.nearestPoint(t,e,r,n,i,a,s,u);return o(l.x,l.y,s,u)},interpolationAt:d,pointAt:function(t,e,r,n,i,o,a){return{x:d(t,r,i,a),y:d(e,n,o,a)}},divide:function(t,e,r,n,i,o,a){return g(t,e,r,n,i,o,a)},tangentAngle:function(t,e,r,n,i,o,a){var s=v(t,r,i,a),u=v(e,n,o,a);return l(Math.atan2(u,s))}};function b(t,e,r,n,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*r*i*i*o+n*i*i*i}function x(t,e,r,n,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(r-e)+i*i*(n-r))}function w(t,e,r,n){var i,o,s,u=-3*t+9*e-9*r+3*n,l=6*t-12*e+6*r,c=3*e-3*t,f=[];if(a(u,0))a(l,0)||(i=-c/l)>=0&&i<=1&&f.push(i);else{var h=l*l-4*u*c;a(h,0)?f.push(-l/(2*u)):h>0&&(o=(-l-(s=Math.sqrt(h)))/(2*u),(i=(-l+s)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}function _(t,e,r,n,i,o,a,s,u){var l=b(t,r,i,a,u),c=b(e,n,o,s,u),h=f.pointAt(t,e,r,n,u),p=f.pointAt(r,n,i,o,u),d=f.pointAt(i,o,a,s,u),y=f.pointAt(h.x,h.y,p.x,p.y,u),v=f.pointAt(p.x,p.y,d.x,d.y,u);return[[t,e,h.x,h.y,y.x,y.y,l,c],[l,c,v.x,v.y,d.x,d.y,a,s]]}function S(t,e,r,n,i,a,s,u,l){if(0===l)return function(t,e){for(var r=0,n=t.length,i=0;i0?r:-1*r}var T=function(t,e,r,n,i,o){var a=r,s=n;if(0===a||0===s)return{x:t,y:e};for(var u,l,c=i-t,f=o-e,h=Math.abs(c),p=Math.abs(f),d=a*a,y=s*s,v=Math.PI/4,g=0;g<4;g++){u=a*Math.cos(v),l=s*Math.sin(v);var m=(d-y)*Math.pow(Math.cos(v),3)/a,b=(y-d)*Math.pow(Math.sin(v),3)/s,x=u-m,w=l-b,_=h-m,S=p-b,E=Math.hypot(w,x),T=Math.hypot(S,_);v+=E*Math.asin((x*S-w*_)/(E*T))/Math.sqrt(d+y-u*u-l*l),v=Math.min(Math.PI/2,Math.max(0,v))}return{x:t+k(u,c),y:e+k(l,f)}};function C(t,e,r,n,i,o){return r*Math.cos(i)*Math.cos(o)-n*Math.sin(i)*Math.sin(o)+t}function O(t,e,r,n,i,o){return r*Math.sin(i)*Math.cos(o)+n*Math.cos(i)*Math.sin(o)+e}function A(t,e,r){return{x:t*Math.cos(r),y:e*Math.sin(r)}}function P(t,e,r){var n=Math.cos(r),i=Math.sin(r);return[t*n-e*i,t*i+e*n]}var M={box:function(t,e,r,n,i,o,a){for(var s=function(t,e,r){return Math.atan(-e/t*Math.tan(r))}(r,n,i),u=1/0,l=-1/0,c=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;ol&&(l=p)}var d=function(t,e,r){return Math.atan(e/(t*Math.tan(r)))}(r,n,i),y=1/0,v=-1/0,g=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var m=d+f;ov&&(v=b)}return{x:u,y:y,width:l-u,height:v-y}},length:function(t,e,r,n,i,o,a){},nearestPoint:function(t,e,r,n,i,o,a,s,u){var l=P(s-t,u-e,-i),c=l[0],f=l[1],h=T(0,0,r,n,c,f),p=function(t,e,r,n){return(Math.atan2(n*t,r*e)+2*Math.PI)%(2*Math.PI)}(r,n,h.x,h.y);pa&&(h=A(r,n,a));var d=P(h.x,h.y,i);return{x:d[0]+t,y:d[1]+e}},pointDistance:function(t,e,r,n,i,a,s,u,l){var c=this.nearestPoint(t,e,r,n,u,l);return o(c.x,c.y,u,l)},pointAt:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o;return{x:C(t,0,r,n,i,u),y:O(0,e,r,n,i,u)}},tangentAngle:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o,c=function(t,e,r,n,i,o,a,s){return-1*r*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}(0,0,r,n,i,0,0,u),f=function(t,e,r,n,i,o,a,s){return-1*r*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}(0,0,r,n,i,0,0,u);return l(Math.atan2(f,c))}};function I(t){for(var e=0,r=[],n=0;n1||e<0||t.length<2)return null;var r=I(t),n=r.segments,i=r.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;s=o&&e<=o+h){var p=(e-o)/h;a=f.pointAt(l[0],l[1],c[0],c[1],p);break}o+=h}return a}function N(t,e){if(e>1||e<0||t.length<2)return 0;for(var r=I(t),n=r.segments,i=r.totalLength,o=0,a=0,s=0;s=o&&e<=o+f){a=Math.atan2(c[1]-l[1],c[0]-l[0]);break}o+=f}return a}function R(t,e,r){for(var n=1/0,i=0;i0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(t){return t.isReferer}).forEach(function(t){var e=t.data,r=t.name;n.model.confirmInput(e.model,r)}),r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r16)throw new Error("invalid data type ".concat(r));i[e]=function(){return t.data}}});var o=this.getOuputDataTexture(),a=o.textureWidth,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:ht,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return c(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()}),dt&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var t=i(m().mark(function t(){var e,r,n,i,o,a,s,u,l=this;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){e=l.reGl.read()}),!e){t.next=6;break}if(r=this.getOuputDataTexture(),n=r.originalDataLength,i=r.elementsPerTexel,o=r.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u2&&void 0!==arguments[2]&&arguments[2];var r=this.context.uniforms.find(function(e){return e.name===t});if(r){var n=this.calcDataTexture(t,r.type,e),i=n.texture,o=n.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e,dt&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,r=t.textureWidth;return ft(ft({},t),{},{id:pt++,texture:this.reGl.texture({width:r,height:r,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,r){var n=1;e===_.Vector4FloatArray&&(n=4);for(var i=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=new t;return r.setConfig(e),r.setEngine(new kt),r}}]),t}()},2314:function(t,e,r){"use strict";r.r(e),r.d(e,{Graph:function(){return x},GraphWithEvent:function(){return C},algorithm:function(){return n},comparision:function(){return o},essence:function(){return i},generate:function(){return s}});var n={};r.r(n),r.d(n,{components:function(){return M},dfs:function(){return I},dijkstra:function(){return D},dijkstraAll:function(){return B},findCycles:function(){return z},floydWarshall:function(){return et},isAcyclic:function(){return J},postorder:function(){return Q},preorder:function(){return $},prim:function(){return P},tarjan:function(){return F},topsort:function(){return K}});var i={};r.r(i),r.d(i,{hasSelfLoop:function(){return vt},isGraph:function(){return pt},isNullGraph:function(){return yt},isSimpleGraph:function(){return dt}});var o={};r.r(o),r.d(o,{containAllSameEdges:function(){return ut},containAllSameNodes:function(){return st},containSameEdges:function(){return nt},containSameNodes:function(){return rt},getSameEdges:function(){return ot},getSameNodes:function(){return it},isGraphComplement:function(){return gt},isGraphContainsAnother:function(){return ct},isGraphOptionSame:function(){return at},isGraphSame:function(){return lt}});var a,s={};function u(t,e){var r=t.get(e)||0;t.set(e,r+1)}function l(t,e){var r=t.get(e);void 0!==r&&((r-=1)>0?t.set(e,r):t.delete(e))}function c(t,e,r,n){var i=String(e),o=String(r);if(!t&&i>o){var s=i;i=o,o=s}return i+a.EDGE_KEY_DELIM+o+a.EDGE_KEY_DELIM+(void 0===n?a.DEFAULT_EDGE_NAME:n)}function f(t,e,r,n){var i=String(e),o=String(r),a={v:e,w:r};if(!t&&i>o){var s=a.v;a.v=a.w,a.w=s}return void 0!==n&&(a.name=n),a}function h(t,e){return c(t,e.v,e.w,e.name)}function p(t){return"function"==typeof t}r.r(s),r.d(s,{getGraphComplement:function(){return mt}}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(a||(a={}));var d=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return t.nodes().map(function(e){var r={id:e,value:t.node(e),parent:t.parent(e)};return void 0===r.value&&delete r.value,void 0===r.parent&&delete r.parent,r})}(t),edges:function(t){return t.edges().map(function(e){var r=t.edge(e),n={v:e.v,w:e.w,value:r,name:e.name};return void 0===n.name&&delete n.name,void 0===n.value&&delete n.value,n})}(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function v(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return p(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.inEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.sinks=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.outEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.setNodes=function(t,r){return t.map(function(t){return e.setNode(t,r)}),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var r,n=null===(r=e.parentMap)||void 0===r?void 0:r.get(t);if(n!==e.GRAPH_NODE)return n}},this.removeFromParentsChildList=function(t){var r=e.parentMap.get(t);e.childrenMap.get(r).delete(t)},this.setParent=function(t,r){var n,i;e.checkCompound();for(var o=void 0===r?e.GRAPH_NODE:r,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");a=e.parent(a)}r&&e.setNode(r),e.setNode(t),e.removeFromParentsChildList(t),null===(n=e.parentMap)||void 0===n||n.set(t,o);var s=e.childrenMap.get(o);return s.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,s),e},this.children=function(t){var r=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var n,i=null===(n=e.childrenMap)||void 0===n?void 0:n.get(r);return i?Array.from(i.keys()):void 0}return r===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var r=e.predecessorsMap.get(t);return r?Array.from(r.keys()):void 0},this.successors=function(t){var r=e.successorsMap.get(t);return r?Array.from(r.keys()):void 0},this.neighbors=function(t){var r;if(e.hasNode(t))return Array.from(new Set(null===(r=e.predecessors(t))||void 0===r?void 0:r.concat(e.successors(t))))},this.isLeaf=function(t){var r,n;return e.isDirected()?!(null===(n=e.successors(t))||void 0===n?void 0:n.length):!(null===(r=e.neighbors(t))||void 0===r?void 0:r.length)},this.filterNodes=function(r){var n=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:n,multigraph:i,compound:o});if(a.setGraph(e.graph()),e.nodes().forEach(function(t){r(t)&&a.setNode(t,e.node(t))}),e.edges().forEach(function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))}),o){a.nodes().forEach(function(t){a.setParent(t,function(t){for(var r=e.parent(t);void 0!==r&&!a.hasNode(r);)r=e.parent(r);return r}(t))})}return a},this.setDefaultEdgeLabel=function(t){return p(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,r){return e.setEdge(t.v,t.w,r,t.name)},this.setPath=function(t,r){return t.reduce(function(t,n){return e.setEdge(t,n,r),n}),e},this.edgeFromArgs=function(t,r,n){return e.edge({v:t,w:r,name:n})},this.edge=function(t){return e.edgesLabelsMap.get(h(e.isDirected(),t))},this.hasEdge=function(t,r,n){return e.edgesLabelsMap.has(h(e.isDirected(),{v:t,w:r,name:n}))},this.removeEdgeObj=function(t){var r=t.v,n=t.w,i=t.name;return e.removeEdge(r,n,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,r){var n=e.inEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.v===r})},this.outEdges=function(t,r){var n=e.outEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.w===r})},this.nodeEdges=function(t,r){var n;if(e.hasNode(t))return null===(n=e.inEdges(t,r))||void 0===n?void 0:n.concat(e.outEdges(t,r))},this.toJSON=function(){return d(e)},this.nodeInDegree=function(t){var r=e.inEdgesMap.get(t);return r?r.size:0},this.nodeOutDegree=function(t){var r=e.outEdgesMap.get(t);return r?r.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var n=v(v({},b),r);this.compound=n.compound,this.directed=n.directed,this.multigraph=n.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,r,n;return e=t,(r=[{key:"setNode",value:function(t,e){var r,n=this.nodesLabelMap,i=this.defaultNodeLabelFn,o=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,l=this.outEdgesMap,c=this.predecessorsMap,f=this.successorsMap;if(n.has(t))return void 0!==e&&n.set(t,e),this;(n.set(t,e||i(t)),o())&&(null===a||void 0===a||a.set(t,this.GRAPH_NODE),null===s||void 0===s||s.set(t,new Map),(null===s||void 0===s?void 0:s.has(this.GRAPH_NODE))||null===s||void 0===s||s.set(this.GRAPH_NODE,new Map),null===s||void 0===s||null===(r=s.get(this.GRAPH_NODE))||void 0===r||r.set(t,!0));return[u,l,c,f].forEach(function(e){return e.set(t,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var r,n,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,l=this.successorsMap,c=this.nodesLabelMap;if(this.isCompound())this.removeFromParentsChildList(t),null===(r=this.parentMap)||void 0===r||r.delete(t),null===(n=this.children(t))||void 0===n||n.forEach(function(t){return e.setParent(t)}),null===(i=this.childrenMap)||void 0===i||i.delete(t);var f=a.get(t),h=s.get(t);Array.from(f.values()).forEach(function(t){return o(t)}),Array.from(h.values()).forEach(function(t){return o(t)}),c.delete(t),a.delete(t),s.delete(t),u.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,r,n){var i,o,a=f(this.isDirected(),t,e,n),s=h(this.isDirected(),a),l=a.v,c=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,r),this;if(void 0!==n&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(c),this.edgesLabelsMap.set(s,r||this.defaultEdgeLabelFn(l,c,n)),Object.freeze(a),this.edgesMap.set(s,a);var p=this.predecessorsMap.get(c),d=this.successorsMap.get(l);return u(p,l),u(d,c),null===(i=this.inEdgesMap.get(c))||void 0===i||i.set(s,a),null===(o=this.outEdgesMap.get(l))||void 0===o||o.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,r){var n=c(this.isDirected(),t,e,r);if(this.edgesMap.get(n)){var i=f(this.isDirected(),t,e,r),o=i.v,a=i.w;this.edgesLabelsMap.delete(n),this.edgesMap.delete(n);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(o);l(s,o),l(u,a),this.inEdgesMap.get(a).delete(n),this.outEdgesMap.get(o).delete(n),this.edgeCountNum-=1}return this}}])&&m(e.prototype,r),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function w(t){"@babel/helpers - typeof";return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){for(var r=0;r-1&&this.eventPool[t].splice(r,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n>1])||void 0===a?void 0:a.priority)e.arr[n].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[n].priority," New: ").concat(r));e.arr[n].priority=r,e.innerDecrease(n)}}),P=function(t,e){var r,n=new x,i=new Map,o=new A;function a(t){var n=t.v===r?t.w:t.v,a=o.priority(n);if(void 0!==a){var s=e(t);s0;){var u;if(r=o.removeMin(),i.has(r))n.setEdge(r,i.get(r));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(r))||void 0===u||u.forEach(a)}return n},M=function(t){var e=new Set,r=[];return t.nodes().forEach(function(n){for(var i=[],o=[n];o.length>0;){var a,s,u=o.pop();e.has(u)||(e.add(u),i.push(u),null===(a=t.successors(u))||void 0===a||a.forEach(function(t){return o.push(t)}),null===(s=t.predecessors(u))||void 0===s||s.forEach(function(t){return o.push(t)}))}i.length&&r.push(i)}),r},I=function(t,e,r){var n=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],o=[];return(Array.isArray(e)?e:[e]).forEach(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){i.includes(r)||(i.push(r),n||a.push(r),o(r).forEach(function(r){return t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(i=s.removeMin(),!(o=a.get(i))||o.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);var l={};return Array.from(a.entries()).forEach(function(t){var e=L(t,2),r=e[0],n=e[1];return l[String(r)]=n,l}),l},D=function(t,e,r,n){return R(t,e,r||N,n||function(e){return t.outEdges(e)})},B=function(t,e,r){var n={};return t.nodes().forEach(function(i){return n[String(i)]=D(t,i,e,r),n}),n},F=function(t){var e=0,r=[],n=new Map,i=[];return t.nodes().forEach(function(o){n.has(o)||function o(a){var s,u={onStack:!0,lowlink:e,index:e};if(n.set(a,u),e+=1,r.push(a),null===(s=t.successors(a))||void 0===s||s.forEach(function(t){var e;if(n.has(t)){if(null===(e=n.get(t))||void 0===e?void 0:e.onStack){var r=n.get(t);u.lowlink=Math.min(u.lowlink,r.index)}}else{o(t);var i=n.get(t);u.lowlink=Math.min(u.lowlink,i.lowlink)}}),u.lowlink===u.index){var l,c=[];do{l=r.pop(),n.get(l).onStack=!1,c.push(l)}while(a!==l);i.push(c)}}(o)}),i},z=function(t){return F(t).filter(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})};function U(t){"@babel/helpers - typeof";return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function G(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);ro&&(o=e.depth);var r=e.children,n=r.length,i=new function(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var r=this;r.x=r.y=0,r.leftChild=r.rightChild=null,r.height=0,r.children=e}(e.height,[]);return r.forEach(function(e,r){var o=t(e);i.children.push(o),0===r&&(i.leftChild=o),r===n-1&&(i.rightChild=o)}),i.originNode=e,i.isLeaf=e.isLeaf(),i}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=o;else{var r=e.children.map(function(e){return t(e)}),n=Math.min.apply(null,r);e.drawingDepth=n-1}return e.drawingDepth}(a),function t(n){n.x=n.drawingDepth*e.rankSep,n.isLeaf?(n.y=0,r&&(n.y=r.y+r.height+e.nodeSep,n.originNode.parent!==r.originNode.parent&&(n.y+=e.subTreeSep)),r=n):(n.children.forEach(function(e){t(e)}),n.y=(n.leftChild.y+n.rightChild.y)/2)}(a),function t(e,r,n){n?(r.x=e.x,r.y=e.y):(r.x=e.y,r.y=e.x),e.children.forEach(function(e,i){t(e,r.children[i],n)})}(a,t,e.isHorizontal),t}},4507:function(t,e,r){var n=r(5097),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,r){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])r(t,e);else if(s===i[1])r(t,e),t.right2left();else if(s===i[2])r(t,e);else if(s===i[3])r(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=n(t,e),l=u.left,c=u.right;r(l,e),r(c,e),e.isHorizontal?l.right2left():l.bottom2top(),c.translate(l.x-c.x,l.y-c.y),t.x=l.x,t.y=c.y;var f=t.getBoundingBox();e.isHorizontal?f.top<0&&t.translate(0,-f.top):f.left<0&&t.translate(-f.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},5406:function(t,e,r){var n=r(1102),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var r=this;if(r.vgap=r.hgap=0,t instanceof o)return t;r.data=t;var n=e.getHGap(t),i=e.getVGap(t);return r.preH=e.getPreH(t),r.preV=e.getPreV(t),r.width=e.getWidth(t),r.height=e.getHeight(t),r.width+=r.preH,r.height+=r.preV,r.id=e.getId(t),r.x=r.y=0,r.depth=0,r.children||(r.children=[]),r.addGap(n,i),r}n.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,r=[this];e=r.shift();)t(e),r=e.children.concat(r)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,r=[this];e=r.shift();)t(e),r=r.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)}),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode(function(r){r.x+=t,r.y+=e,r.x+=r.preH,r.y+=r.preV})},right2left:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.x=e.x-2*(e.x-t.left)-e.width}),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.y=e.y-2*(e.y-t.top)-e.height}),this.translate(0,t.height)}}),t.exports=function(t,e,r){void 0===e&&(e={});var a,s=new o(t,e=n.assign({},i,e)),u=[s];if(!r&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var l=e.getChildren(a.data),c=l?l.length:0;if(a.children=new Array(c),l&&c)for(var f=0;ft.y?u:t.y}}else t.y=0}(t,o,e,r,i),o=t})}},7397:function(t,e,r){var n=r(1102);var i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=n.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse(function(t){t.x=t.parent.x+t.parent.width}),t.parent=null,function t(e,r){var n=0;return e.children.length?e.children.forEach(function(e){n+=t(e,r)}):n=e.height,e._subTreeSep=r.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,n)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode(function(t){var e=t.children,r=e.length;if(r){var n=e[0];if(n.startY=t.startY+t._subTreeSep,1===r)n.y=t.y+t.height/2-n.height/2;else{n.y=n.startY+n.totalHeight/2-n.height/2;for(var i=1;ie.height)e.y=i.y+a/2-e.height/2;else if(1!==r.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;r.forEach(function(t){t.translate(0,u)})}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}},5160:function(t){function e(t,e,r,n){void 0===n&&(n=[]);var i=this;i.w=t||0,i.h=e||0,i.y=r||0,i.x=0,i.c=n||[],i.cs=n.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){!function t(e,r,n){n?e.y+=r:e.x+=r,e.children.forEach(function(e){t(e,r,n)})}(t,-function t(e,r){var n=r?e.y:e.x;return e.children.forEach(function(e){n=Math.min(t(e,r),n)}),n}(t,e),e)}e.fromNode=function(t,r){if(!t)return null;var n=[];return t.children.forEach(function(t){n.push(e.fromNode(t,r))}),r?new e(t.height,t.width,t.x,n):new e(t.width,t.height,t.y,n)},t.exports=function(t,n){void 0===n&&(n={});var i=n.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,r){for(var n=t.c[e-1],i=n.mod,o=t.c[e],a=o.mod;null!==n&&null!==o;){c(n)>r.low&&(r=r.nxt);var f=i+n.prelim+n.w-(a+o.prelim);f>0&&(a+=f,s(t,e,r.index,f));var h=c(n),p=c(o);h<=p&&null!==(n=l(n))&&(i+=n.mod),h>=p&&null!==(o=u(o))&&(a+=o.mod)}!n&&o?function(t,e,r,n){var i=t.c[0].el;i.tl=r;var o=n-r.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):n&&!o&&function(t,e,r,n){var i=t.c[e].er;i.tr=r;var o=n-r.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,n,i)}function s(t,e,r,n){t.c[e].mod+=n,t.c[e].msel+=n,t.c[e].mser+=n,function(t,e,r,n){if(r!==e-1){var i=e-r;t.c[r+1].shift+=n/i,t.c[e].shift-=n/i,t.c[e].change-=n-n/i}}(t,e,r,n)}function u(t){return 0===t.cs?t.tl:t.c[0]}function l(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function c(t){return t.y+t.h}function f(t,e,r){for(;null!==r&&t>=r.low;)r=r.nxt;return{low:t,index:e,nxt:r}}!function t(e,r,n){void 0===n&&(n=0),r?(e.x=n,n+=e.width):(e.y=n,n+=e.height),e.children.forEach(function(e){t(e,r,n)})}(t,i);var h=e.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var r=f(c(e.c[0].el),0,null),n=1;nn?1:0}var u=function(t){function e(e){var r=t.call(this)||this;return r.radius=null,r.nodeSize=void 0,r.startRadius=null,r.endRadius=null,r.startAngle=0,r.endAngle=2*Math.PI,r.clockwise=!0,r.divisions=1,r.ordering=null,r.angleRatio=1,r.nodes=[],r.edges=[],r.nodeMap={},r.degrees=[],r.width=300,r.height=300,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this.nodes,r=this.edges,n=e.length;if(0!==n){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n)return e[0].x=i[0],e[0].y=i[1],void(this.onLayoutEnd&&this.onLayoutEnd());var o=this.radius,s=this.startRadius,u=this.endRadius,l=this.divisions,c=this.startAngle,f=this.endAngle,h=this.angleRatio,p=this.ordering,d=this.clockwise,y=this.nodeSpacing,v=this.nodeSize,g=(f-c)/n,m={};e.forEach(function(t,e){m[t.id]=e}),this.nodeMap=m;var b=(0,a.getDegree)(e.length,m,r);if(this.degrees=b,y){var x=(0,a.getFuncByUnknownType)(10,y),w=(0,a.getFuncByUnknownType)(10,v),_=-1/0;e.forEach(function(t){var e=w(t);_this.width?this.width/2:this.height/2;var E=g*h,k=[];k="topology"===p?this.topologyOrdering():"topology-directed"===p?this.topologyOrdering(!0):"degree"===p?this.degreeOrdering():e;for(var T=Math.ceil(n/l),C=0;C=0;S--)_(S);return{nodes:e,edges:r,combos:n,comboEdges:i}},e.prototype.getInnerGraphs=function(t){var e=this.comboTrees,r=this.nodeSize,n=this.edges,i=this.comboPadding,a=this.spacing,s={},c=this.innerLayout||new l.ConcentricLayout({type:"concentric",sortBy:"id"});return c.center=[0,0],c.preventOverlap=!0,c.nodeSpacing=a,(e||[]).forEach(function(e){(0,u.traverseTreeUp)(e,function(e){var a,l=(null===i||void 0===i?void 0:i(e))||10;if((0,u.isArray)(l)&&(l=Math.max.apply(Math,l)),null===(a=e.children)||void 0===a?void 0:a.length){var f=e.children.map(function(e){if("combo"===e.itemType)return s[e.id];var r=t[e.id]||{};return o(o({},r),e)}),h=f.map(function(t){return t.id}),p={nodes:f,edges:n.filter(function(t){return h.includes(t.source)&&h.includes(t.target)})},d=1/0;f.forEach(function(t){var e;t.size||(t.size=(null===(e=s[t.id])||void 0===e?void 0:e.size)||(null===r||void 0===r?void 0:r(t))||[30,30]),(0,u.isNumber)(t.size)&&(t.size=[t.size,t.size]),d>t.size[0]&&(d=t.size[0]),d>t.size[1]&&(d=t.size[1])}),c.layout(p);var y=(0,u.getLayoutBBox)(f),v=y.minX,g=y.minY,m=y.maxX,b=y.maxY,x={x:(m+v)/2,y:(b+g)/2};p.nodes.forEach(function(t){t.x-=x.x,t.y-=x.y});var w=Math.max(m-v,d)+2*l,_=Math.max(b-g,d)+2*l;s[e.id]={id:e.id,nodes:f,size:[w,_]}}else if("combo"===e.itemType){var S=l?[2*l,2*l]:[30,30];s[e.id]={id:e.id,nodes:[],size:S}}return!0})}),s},e.prototype.initVals=function(){var t,e,r=this.nodeSize,n=this.spacing;if(e=(0,u.isNumber)(n)?function(){return n}:(0,u.isFunction)(n)?n:function(){return 0},this.spacing=e,r)if((0,u.isFunction)(r))t=function(t){var n=r(t),i=e(t);return(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if((0,u.isArray)(r)){var i=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return i+e(t)/2}}else{var o=r/2;t=function(t){return o+e(t)/2}}else t=function(t){var r=e(t);return t.size?(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+r)/2:(0,u.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+r)/2:(t.size+r)/2:10+r/2};this.nodeSize=t;var a,s=this.comboPadding;a=(0,u.isNumber)(s)?function(){return s}:(0,u.isArray)(s)?function(){return Math.max.apply(null,s)}:(0,u.isFunction)(s)?s:function(){return 0},this.comboPadding=a},e.prototype.getType=function(){return"comboCombined"},e}(s.Base);e.ComboCombinedLayout=c},5428:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=r(9284),a=r(8652),s=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.maxIteration=100,r.gravity=10,r.comboGravity=10,r.linkDistance=10,r.alpha=1,r.alphaMin=.001,r.alphaDecay=1-Math.pow(r.alphaMin,1/300),r.alphaTarget=0,r.velocityDecay=.6,r.edgeStrength=.6,r.nodeStrength=30,r.preventOverlap=!1,r.preventNodeOverlap=!1,r.preventComboOverlap=!1,r.collideStrength=void 0,r.nodeCollideStrength=.5,r.comboCollideStrength=.5,r.comboSpacing=20,r.comboPadding=10,r.optimizeRangeFactor=1,r.onTick=function(){},r.onLayoutEnd=function(){},r.depthAttractiveForceScale=1,r.depthRepulsiveForceScale=2,r.nodes=[],r.edges=[],r.combos=[],r.comboTrees=[],r.width=300,r.height=300,r.bias=[],r.nodeMap={},r.oriComboMap={},r.indexMap={},r.comboMap={},r.previousLayouted=!1,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(this.comboTree={id:"comboTreeRoot",depth:-1,children:this.comboTrees},t&&0!==t.length){if(1===t.length)return t[0].x=e[0],t[0].y=e[1],void(this.onLayoutEnd&&this.onLayoutEnd());this.initVals(),this.run(),this.onLayoutEnd&&this.onLayoutEnd()}else this.onLayoutEnd&&this.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,r=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var n=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var s=function(r){var n=[];e.forEach(function(t,e){n[e]={x:0,y:0}}),t.applyCalculate(n),t.applyComboCenterForce(n),e.forEach(function(t,e){(0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)&&(t.x+=n[e].x*i,t.y+=n[e].y*i)}),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;uv[1]?v[0]:v[1])/2;d=function(t){return m}}else{var b=v/2;d=function(t){return b}}else d=function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=d;var x,w=this.comboSpacing;x=(0,a.isNumber)(w)?function(){return w}:(0,a.isFunction)(w)?w:function(){return 0},this.comboSpacing=x;var _,S=this.comboPadding;_=(0,a.isNumber)(S)?function(){return S}:(0,a.isArray)(S)?function(){return Math.max.apply(null,S)}:(0,a.isFunction)(S)?S:function(){return 0},this.comboPadding=_;var E,k=this.linkDistance;k||(k=10),E=(0,a.isNumber)(k)?function(t){return k}:k,this.linkDistance=E;var T,C=this.edgeStrength;C||(C=1),T=(0,a.isNumber)(C)?function(t){return C}:C,this.edgeStrength=T;var O,A=this.nodeStrength;A||(A=30),O=(0,a.isNumber)(A)?function(t){return A}:A,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach(function(e,r){var n=e.comboId,i=t[n];n&&i?(e.x=i.cx+100/(r+1),e.y=i.cy+100/(r+1)):(e.x=100/(r+1),e.y=100/(r+1))})},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,r=t.comboTrees,n=t.oriComboMap,i={};return(r||[]).forEach(function(r){var o=[];(0,a.traverseTreeUp)(r,function(r){if("node"===r.itemType)return!0;if(!n[r.id])return!0;if(void 0===i[r.id]){var s={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};i[r.id]=s}var u=r.children;u&&u.forEach(function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)});var l=i[r.id];if(l.cx=0,l.cy=0,0===o.length){l.empty=!0;var c=n[r.id];l.cx=c.x,l.cy=c.y}return o.forEach(function(t){if(l.count++,"node"!==t.itemType){var r=i[t.id];return(0,a.isNumber)(r.cx)&&(l.cx+=r.cx),void((0,a.isNumber)(r.cy)&&(l.cy+=r.cy))}var n=e[t.id];n&&((0,a.isNumber)(n.x)&&(l.cx+=n.x),(0,a.isNumber)(n.y)&&(l.cy+=n.y))}),l.cx/=l.count||1,l.cy/=l.count||1,l.children=o,!0})}),i},e.prototype.applyComboCenterForce=function(t){var e=this.gravity,r=this.comboGravity||e,n=this.alpha,i=this.comboTrees,o=this.indexMap,s=this.nodeMap,u=this.comboMap;(i||[]).forEach(function(e){(0,a.traverseTreeUp)(e,function(e){if("node"===e.itemType)return!0;if(!u[e.id])return!0;var i=u[e.id],l=(i.depth+1)/10*.5,c=i.cx,f=i.cy;return i.cx=0,i.cy=0,i.children.forEach(function(e){if("node"!==e.itemType){var h=u[e.id];return h&&(0,a.isNumber)(h.cx)&&(i.cx+=h.cx),void(h&&(0,a.isNumber)(h.cy)&&(i.cy+=h.cy))}var p=s[e.id],d=p.x-c||.005,y=p.y-f||.005,v=Math.sqrt(d*d+y*y),g=o[p.id],m=r*n/v*l;t[g].x-=d*m,t[g].y-=y*m,(0,a.isNumber)(p.x)&&(i.cx+=p.x),(0,a.isNumber)(p.y)&&(i.cy+=p.y)}),i.cx/=i.count||1,i.cy/=i.count||1,!0})})},e.prototype.applyCalculate=function(t){var e=this.comboMap,r=this.nodes,n={};r.forEach(function(t,e){r.forEach(function(r,i){if(!(eo&&(l.minX=o),l.minY>a&&(l.minY=a),l.maxX1&&a.forEach(function(r,s){if("node"===r.itemType)return!1;var u=e[r.id];u&&a.forEach(function(a,l){if(s<=l)return!1;if("node"===a.itemType)return!1;var c=e[a.id];if(!c)return!1;var f=u.cx-c.cx||.005,h=u.cy-c.cy||.005,p=f*f+h*h,d=u.r||1,y=c.r||1,v=d+y,g=y*y,m=d*d;if(pi)){var g=e["".concat(p.id,"-").concat(r.id)],m=g.vx,b=g.vy,x=Math.log(Math.abs(r.depth-p.depth)/10)+1||1;x=x<1?1:x,r.comboId!==p.comboId&&(x+=1);var w=x?Math.pow(f,x):1,_=o(r)*a/y*w;if(t[d].x+=m*_,t[d].y+=b*_,d0){var e=Math.abs(g[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(g=[],v.push(g))}g.push(t)});var m=u+(h||r.minNodeSpacing);if(!r.preventOverlap){var b=v.length>0&&v[0].length>1,x=(Math.min(r.width,r.height)/2-m)/(v.length+(b?1:0));m=Math.min(m,x)}var w=0;if(v.forEach(function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var i=Math.cos(n)-Math.cos(0),o=Math.sin(n)-Math.sin(0),a=Math.sqrt(m*m/(i*i+o*o));w=Math.max(a,w)}t.r=w,w+=m}),r.equidistant){for(var _=0,S=0,E=0;Ee.x&&(L=e.x),j>e.y&&(j=e.y)}),w.edges().forEach(function(t){var e;null===(e=w.edge(t).points)||void 0===e||e.forEach(function(t){L>t.x&&(L=t.x),j>t.y&&(j=t.y)})}),I[0]=d[0]-L,I[1]=d[1]-j}var N="LR"===h||"RL"===h;if(y){var R=this.focusNode,D=this.ranksep,B=this.getRadialPos,F=(0,s.isString)(R)?R:null===R||void 0===R?void 0:R.id,z=F?null===(n=w.node(F))||void 0===n?void 0:n._rank:0,U=[],G=N?"y":"x",V=N?"height":"width",H=1/0,W=-1/0;w.nodes().forEach(function(t){var e=w.node(t);if(o.nodeMap[t]){var r=C(o.nodeMap[t]);if(0===z)U[e._rank]||(U[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),U[e._rank].nodes.push(t),U[e._rank].totalWidth+=2*r+e[V],U[e._rank].maxSizeW&&(W=s)}});var q=D||50,Y={},X=(W-H)/.9,Z=[.5*(H+W-X),.5*(H+W+X)],K=function(t,e,r,n){void 0===r&&(r=-1/0),void 0===n&&(n=[0,1]);var i=r;return t.forEach(function(t){var r=w.node(t);Y[t]=e;var a=B(r[G],Z,X,e,n),s=a.x,u=a.y;if(o.nodeMap[t]){o.nodeMap[t].x=s+I[0],o.nodeMap[t].y=u+I[1],o.nodeMap[t]._order=r._order;var l=T(o.nodeMap[t]);i=i})}:function(t,e,r){var n=Math.max(e.x,r.x),i=Math.min(e.x,r.x);return t.filter(function(t){return t.x<=n&&t.x>=i})};w.edges().forEach(function(t){var e,r=w.edge(t),n=x.findIndex(function(e){var r=(0,s.getEdgeTerminal)(e,"source"),n=(0,s.getEdgeTerminal)(e,"target");return r===t.v&&n===t.w});if(!(n<=-1)&&o.edgeLabelSpace&&o.controlPoints&&"loop"!==x[n].type){null===(e=null===r||void 0===r?void 0:r.points)||void 0===e||e.forEach(function(t){t.x+=I[0],t.y+=I[1]});var i=o.nodeMap[t.v],a=o.nodeMap[t.w];x[n].controlPoints=f(null===r||void 0===r?void 0:r.points,i,a,tt,N,et,rt)}})}return o.onLayoutEnd&&o.onLayoutEnd(),{nodes:u,edges:x}}},e.prototype.getRadialPos=function(t,e,r,n,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/r,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*n,y:Math.sin(a)*n}},e.prototype.getType=function(){return"dagre"},e}(u.Base);e.DagreLayout=c;var f=function(t,e,r,n,i,o,a){var s=(null===t||void 0===t?void 0:t.slice(1,t.length-1))||[];if(e&&r){var u=e.x,l=e.y,c=r.x,f=r.y;if(i&&(u=e.y,l=e.x,c=r.y,f=r.x),f!==l&&u!==c){var h=n.indexOf(l),p=n[h+1];if(p){var d=s[0],y=i?{x:(l+p)/2,y:(null===d||void 0===d?void 0:d.y)||c}:{x:(null===d||void 0===d?void 0:d.x)||c,y:(l+p)/2};d&&!o(d,y)||s.unshift(y)}var v=n.indexOf(f),g=Math.abs(v-h);if(1===g)(s=a(s,e,r)).length||s.push(i?{x:(l+f)/2,y:u}:{x:u,y:(l+f)/2});else if(g>1){var m=n[v-1];if(m){var b=s[s.length-1],x=i?{x:(f+m)/2,y:(null===b||void 0===b?void 0:b.y)||c}:{x:(null===b||void 0===b?void 0:b.x)||u,y:(f+m)/2};b&&!o(b,x)||s.push(x)}}}}return s}},1083:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;rt.x&&(i=t.x),o>t.y&&(o=t.y)}),e.forEach(function(t){t.points.forEach(function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)})}),n[0]=r[0]-i,n[1]=r[1]-o}return n},e.prototype.updateNodePosition=function(t,e){var r=this.combos,n=this.nodes,i=this.edges,o=this.anchorPoint,a=this.graphSettings,s=this.getBegin(t,e);t.forEach(function(t){var l,c=t.x,f=t.y,h=t.id,p=t.type,d=t.coreBox;if(p===u.HierarchyNodeType.META&&h!==u.ROOT_NAME){var y=r.findIndex(function(t){return t.id===h}),v=null===(l=null===a||void 0===a?void 0:a.subScene)||void 0===l?void 0:l.meta;r[y].offsetX=c+s[0],r[y].offsetY=f+s[1],r[y].fixSize=[d.width,d.height],r[y].fixCollapseSize=[d.width,d.height],t.expanded?r[y].padding=[null===v||void 0===v?void 0:v.paddingTop,null===v||void 0===v?void 0:v.paddingRight,null===v||void 0===v?void 0:v.paddingBottom,null===v||void 0===v?void 0:v.paddingLeft]:r[y].padding=[0,0,0,0]}else if(p===u.HierarchyNodeType.OP){y=n.findIndex(function(t){return t.id===h});if(n[y].x=c+s[0],n[y].y=f+s[1],o){var g=[],m=e.filter(function(t){return t.v===h}),b=e.filter(function(t){return t.w===h});m.length>0&&m.forEach(function(e){var r=e.points[0],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;g.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.sourceAnchor=g.length-1)})}),b.length>0&&b.forEach(function(e){var r=e.points[e.points.length-1],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;g.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.targetAnchor=g.length-1)})}),n[y].anchorPoints=g.length>0?g:n[y].anchorPoints||[]}}})},e.prototype.updateEdgePosition=function(t,e){var r=this,n=r.combos,i=r.edges,s=r.controlPoints,l=this.getBegin(t,e);s&&(n.forEach(function(t){t.inEdges=[],t.outEdges=[]}),i.forEach(function(e){var i,s,c,f,h=t.find(function(t){return t.id===e.source}),p=t.find(function(t){return t.id===e.target}),d=[],y=[];if(h&&p)y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t);else if(!h||!p){var v=r.getNodePath(e.source),g=r.getNodePath(e.target),m=v.reverse().slice(h?0:1).find(function(e){return t.find(function(t){return t.id===e})}),b=g.reverse().slice(p?0:1).find(function(e){return t.find(function(t){return t.id===e})});h=t.find(function(t){return t.id===m}),p=t.find(function(t){return t.id===b}),y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t,{v:e.source,w:e.target})}if(d=(d=y.reduce(function(t,e){return a(a([],t,!0),e.points.map(function(t){return o(o({},t),{x:t.x+l[0],y:t.y+l[1]})}),!0)},[])).slice(1,-1),e.controlPoints=d,(null===p||void 0===p?void 0:p.type)===u.NodeType.META){var x=n.findIndex(function(t){return t.id===(null===p||void 0===p?void 0:p.id)});if(!n[x]||(null===(i=n[x].inEdges)||void 0===i?void 0:i.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(s=n[x].inEdges)||void 0===s||s.push({source:h.id,target:p.id,controlPoints:d})}if((null===h||void 0===h?void 0:h.type)===u.NodeType.META){x=n.findIndex(function(t){return t.id===(null===h||void 0===h?void 0:h.id)});if(!n[x]||(null===(c=n[x].outEdges)||void 0===c?void 0:c.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(f=n[x].outEdges)||void 0===f||f.push({source:h.id,target:p.id,controlPoints:d})}}))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every(function(t){return void 0!==t.layoutOrder})||t.forEach(function(t,e){t.layoutOrder=e}),t.sort(function(t,e){return t.layoutOrder-e.layoutOrder})},e}(s.Base);e.DagreCompoundLayout=c},5317:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r(2314).Graph);e.Graph=o},6269:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(1449)),o=r(656);e.default={layout:i.default,util:{time:o.time,notime:o.notime}}},2051:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(6791)),o=function(t){var e=[],r={},n={};return t.nodes().forEach(function i(o){var a;n[o]||(n[o]=!0,r[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach(function(t){r[t.w]?e.push(t):i(t.w)}),delete r[o])}),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,i.default)(t,function(t){return function(e){var r;return(null===(r=t.edge(e))||void 0===r?void 0:r.weight)||1}}(t)):o(t);null===e||void 0===e||e.forEach(function(e){var r=t.edge(e);t.removeEdgeObj(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,"rev-".concat(Math.random()))})},undo:function(t){t.edges().forEach(function(e){var r=t.edge(e);if(r.reversed){t.removeEdgeObj(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}}},1850:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(656),i=function(t,e,r,i,o,a){var s={rank:a,borderType:e,width:0,height:0},u=o[e][a-1],l=(0,n.addDummyNode)(t,"border",s,r);o[e][a]=l,t.setParent(l,i),u&&t.setEdge(u,l,{weight:1})};e.default=function(t){var e;null===(e=t.children())||void 0===e||e.forEach(function(e){return function e(r){var n=t.children(r),o=t.node(r);if((null===n||void 0===n?void 0:n.length)&&n.forEach(function(t){return e(t)}),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,s=o.maxRank+1;a0;--s)if(n=e[s].dequeue()){i=i.concat(h(t,e,r,n,!0));break}}return i},h=function(t,e,r,n,i){var o,a,s=[];return null===(o=t.inEdges(n.v))||void 0===o||o.forEach(function(n){var o=t.edge(n),a=t.node(n.v);i&&s.push({v:n.v,w:n.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,d(e,r,a)}),null===(a=t.outEdges(n.v))||void 0===a||a.forEach(function(n){var i=t.edge(n),o=n.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,d(e,r,a)}),t.removeNode(n.v),i?s:void 0},p=function(t,e){var r=new l,n=0,i=0;t.nodes().forEach(function(t){r.setNode(t,{v:t,in:0,out:0})}),t.edges().forEach(function(t){var o=r.edge(t)||0,a=(null===e||void 0===e?void 0:e(t))||1,s=o+a;r.setEdge(t.v,t.w,s),i=Math.max(i,r.node(t.v).out+=a),n=Math.max(n,r.node(t.w).in+=a)});for(var o=[],a=i+n+3,s=0;s0;)e%2&&(r+=u[e+1]),u[e=e-1>>1]+=t.weight;l+=t.weight*r}}),l};e.default=function(t,e){for(var r=0,n=1;n<(null===e||void 0===e?void 0:e.length);n+=1)r+=i(t,e[n-1],e[n]);return r}},4962:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9883)),o=n(r(2468)),a=n(r(5053)),s=n(r(2059)),u=n(r(9514)),l=r(8652),c=r(5317),f=r(656),h=function(t,e,r){return e.map(function(e){return(0,a.default)(t,e,r)})},p=function(t,e,r,n){var i=new c.Graph;null===t||void 0===t||t.forEach(function(t){for(var o,a=t.graph().root,l=(0,u.default)(t,a,i,e,r,n),c=0;c<(null===(o=l.vs)||void 0===o?void 0:o.length);c++){var f=t.node(l.vs[c]);f&&(f.order=c)}(0,s.default)(t,i,l.vs)})},d=function(t,e){null===e||void 0===e||e.forEach(function(e){null===e||void 0===e||e.forEach(function(e,r){t.node(e).order=r})})};e.default=function(t,e){for(var r=(0,f.maxRank)(t),n=[],a=[],s=1;s-1;s--)a.push(s);var u=h(t,n,"inEdges"),c=h(t,a,"outEdges"),y=(0,i.default)(t);d(t,y);for(var v,g=Number.POSITIVE_INFINITY,m=(s=0,0);m<4;++s,++m)p(s%2?u:c,s%4>=2,!1,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y))=2,!0,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y))=e.barycenter)&&n(e,t)})(t);var e}),null===(r=o.out)||void 0===r||r.forEach(function(e){return(r=o,function(e){e.in.push(r),0==--e.indegree&&t.push(e)})(e);var r})};null===t||void 0===t?void 0:t.length;)o();var a=["vs","i","barycenter","weight"];return i.filter(function(t){return!t.merged}).map(function(t){var e={};return null===a||void 0===a||a.forEach(function(r){void 0!==t[r]&&(e[r]=t[r])}),e})},n=function(t,e){var r,n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(r=e.vs)||void 0===r?void 0:r.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var n,i,o,a={};null===t||void 0===t||t.forEach(function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var r=a[t.v];void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)}),null===(n=e.edges())||void 0===n||n.forEach(function(t){var e=a[t.v],r=a[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(a[t.w]))});var s=null===(o=(i=Object.values(a)).filter)||void 0===o?void 0:o.call(i,function(t){return!t.indegree});return r(s)}},9514:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(6771)),o=n(r(135)),a=n(r(728)),s=function(t,e){null===t||void 0===t||t.forEach(function(t){var r,n=null===(r=t.vs)||void 0===r?void 0:r.map(function(t){return e[t]?e[t].vs:t});t.vs=n.flat()})},u=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=function t(e,r,n,l,c,f){var h,p,d,y,v=e.children(r),g=e.node(r),m=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};m&&(v=null===v||void 0===v?void 0:v.filter(function(t){return t!==m&&t!==b}));var w=(0,i.default)(e,v||[]);null===w||void 0===w||w.forEach(function(r){var i;if(null===(i=e.children(r.v))||void 0===i?void 0:i.length){var o=t(e,r.v,n,l,f);x[r.v]=o,o.hasOwnProperty("barycenter")&&u(r,o)}});var _=(0,o.default)(w,n);s(_,x),null===(h=_.filter(function(t){return t.vs.length>0}))||void 0===h||h.forEach(function(t){var r=e.node(t.vs[0]);r&&(t.fixorder=r.fixorder,t.order=r.order)});var S=(0,a.default)(_,l,c,f);if(m&&(S.vs=[m,S.vs,b].flat(),null===(p=e.predecessors(m))||void 0===p?void 0:p.length)){var E=e.node((null===(d=e.predecessors(m))||void 0===d?void 0:d[0])||""),k=e.node((null===(y=e.predecessors(b))||void 0===y?void 0:y[0])||"");S.hasOwnProperty("barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+E.order+k.order)/(S.weight+2),S.weight+=2}return S}},728:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(656),i=function(t,e,r){for(var n,i=r;e.length&&(n=e[e.length-1]).i<=i;)e.pop(),null===t||void 0===t||t.push(n.vs),i++;return i},o=function(t,e){return function(r,n){if(void 0!==r.fixorder&&void 0!==n.fixorder)return r.fixorder-n.fixorder;if(r.barycentern.barycenter)return 1;if(e&&void 0!==r.order&&void 0!==n.order){if(r.ordern.order)return 1}return t?n.i-r.i:r.i-n.i}};e.default=function(t,e,r,a){var s=(0,n.partition)(t,function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")}),u=s.lhs,l=s.rhs.sort(function(t,e){return-t.i- -e.i}),c=[],f=0,h=0,p=0;null===u||void 0===u||u.sort(o(!!e,!!r)),p=i(c,l,p),null===u||void 0===u||u.forEach(function(t){var e;p+=null===(e=t.vs)||void 0===e?void 0:e.length,c.push(t.vs),f+=t.barycenter*t.weight,h+=t.weight,p=i(c,l,p)});var d={vs:c.flat()};return h&&(d.barycenter=f/h,d.weight=h),d}},1745:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,r=function(t){var e,r={},n=0;return null===(e=t.children())||void 0===e||e.forEach(function e(i){var o,a=n;null===(o=t.children(i))||void 0===o||o.forEach(e),r[i]={low:a,lim:n++}}),r}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach(function(e){var n,i,o=e,a=t.node(o),s=a.edgeObj;if(s)for(var u=function(t,e,r,n){var i,o,a=[],s=[],u=Math.min(e[r].low,e[n].low),l=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||l>e[i].lim));for(o=i,i=n;i&&i!==o;)s.push(i),i=t.parent(i);return{lca:o,path:a.concat(s.reverse())}}(t,r,s.v,s.w),l=u.path,c=u.lca,f=0,h=l[f],p=!0;o!==s.w;){if(a=t.node(o),p){for(;h!==c&&(null===(n=t.node(h))||void 0===n?void 0:n.maxRank)s)&&(0,e.addConflict)(n,r,c)}))}.apply(void 0,r),i.set(o,!0))}return(null===r||void 0===r?void 0:r.length)&&r.reduce(function(e,r){var n,o=-1,a=0,s=new Map;return null===r||void 0===r||r.forEach(function(u,l){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var f=t.predecessors(u)||[];f.length&&(n=t.node(f[0]).order,i([r,a,l,o,n],s),a=l,o=n)}i([r,a,r.length,n,e.length],s)}),r}),n};e.findOtherInnerSegmentNode=function(t,e){var r,n;if(null===(r=t.node(e))||void 0===r?void 0:r.dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find(function(e){return t.node(e).dummy})};e.addConflict=function(t,e,r){var n=e,i=r;if(n>i){var o=n;n=i,i=o}var a=t[n];a||(t[n]=a={}),a[i]=!0};e.hasConflict=function(t,e,r){var n=e;n>r&&(n=r);return!!t[n]};e.verticalAlignment=function(t,r,n,i){var o={},a={},s={};return null===r||void 0===r||r.forEach(function(t){null===t||void 0===t||t.forEach(function(t,e){o[t]=t,a[t]=t,s[t]=e})}),null===r||void 0===r||r.forEach(function(t){var r=-1;null===t||void 0===t||t.forEach(function(t){var u=i(t);if(u.length)for(var l=((u=u.sort(function(t,e){return s[t]-s[e]})).length-1)/2,c=Math.floor(l),f=Math.ceil(l);c<=f;++c){var h=u[c];a[t]===t&&ru.lim&&(l=u,c=!0);var f=e.edges().filter(function(e){return c===p(t,t.node(e.v),l)&&c!==p(t,t.node(e.w),l)});return(0,o.minBy)(f,function(t){return(0,i.slack)(e,t)})};e.exchangeEdges=function(t,r,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,r),f(t,r)};var f=function(t,e){var r=t.nodes().find(function(t){var r;return!(null===(r=e.node(t))||void 0===r?void 0:r.parent)}),n=s(t,r);null===(n=null===n||void 0===n?void 0:n.slice(1))||void 0===n||n.forEach(function(r){var n=t.node(r).parent,i=e.edgeFromArgs(r,n),o=!1;i||(i=e.edgeFromArgs(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})},h=function(t,e,r){return t.hasEdge(e,r)},p=function(t,e,r){return r.low<=e.lim&&e.lim<=r.lim};e.default=function(t){var r=(0,o.simplify)(t);(0,i.longestPath)(r);var a,s,u=(0,n.feasibleTree)(r);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,r);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,r,a),(0,e.exchangeEdges)(u,r,a,s)}},8861:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var r=function(t){var e,r={};null===(e=t.sources())||void 0===e||e.forEach(function(e){return function e(n){var i,o,a=t.node(n);return a?r[n]?a.rank:(r[n]=!0,null===(i=t.outEdges(n))||void 0===i||i.forEach(function(r){var n=e(r.w)-t.edge(r).minlen;n&&(void 0===o||nMath.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var r=[],n=(0,e.maxRank)(t)+1,i=0;ie)&&(e=i)}),e||(e=0),e};e.partition=function(t,e){var r={lhs:[],rhs:[]};return null===t||void 0===t||t.forEach(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r};e.time=function(t,e){var r=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-r,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce(function(t,r){return e(t)>e(r)?r:t})}},245:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1){var e=n({},t);delete e.size,s.push(e)}});var h=[];i.forEach(function(t){var e=s.find(function(e){return e.id===t.source}),r=s.find(function(e){return e.id===t.target});e&&r&&h.push(t)});var p=new f.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:h}).nodes;r.forEach(function(t){var e=(p||[]).find(function(e){return e.id===t.id});t.x=(null===e||void 0===e?void 0:e.x)||o/2,t.y=(null===e||void 0===e?void 0:e.y)||a/2});var d=JSON.parse(JSON.stringify(r)),y=JSON.parse(JSON.stringify(i)),v=u.forceSimulation().nodes(d).force("link",u.forceLink(y).id(function(t){return t.id}).distance(function(t){return h.find(function(e){return e.source===t.source&&e.target===t.target})?30:20})).force("charge",u.forceManyBody()).force("center",u.forceCenter(o/2,a/2)).force("x",u.forceX(o/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise(function(t){v.on("end",function(){r.forEach(function(t){var e=d.find(function(e){return e.id===t.id});e&&(t.x=e.x,t.y=e.y)});var n=Math.min.apply(Math,r.map(function(t){return t.x})),s=Math.max.apply(Math,r.map(function(t){return t.x})),u=Math.min.apply(Math,r.map(function(t){return t.y})),f=Math.max.apply(Math,r.map(function(t){return t.y})),h=o/(s-n),p=a/(f-u);r.forEach(function(t){void 0!==t.x&&h<1&&(t.x=(t.x-n)*h),void 0!==t.y&&p<1&&(t.y=(t.y-u)*p)}),r.forEach(function(t){t.sizeTemp=t.size,t.size=[10,10]}),(0,c.default)(r,i),r.forEach(function(t){t.size=t.sizeTemp||[],delete t.sizeTemp}),(0,l.default)({nodes:r,edges:i},e),t()})})}},693:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(1860));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var r=e.width,n=e.height,o=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach(function(t){var e=t.size[0]||50,r=t.size[1]||50;a=Math.min(e,a),s=Math.min(r,s)});var u=new i.default;u.init(r,n,{CELL_H:s,CELL_W:a}),t.nodes.forEach(function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)});for(var l=0;la){for(var d=v=Math.ceil((c.size[0]+o)/a)-1,y=0;y-1&&!u.cells[h+y+1][p].node);y++)d--;u.insertColumn(h,d)}if(c.size[1]+o>s){var v;for(d=v=Math.ceil((c.size[1]+o)/s)-1,y=0;y-1&&!u.cells[h][p+y+1].node);y++)d--;u.insertRow(p,d)}}for(l=0;lt;n--)for(i=0;i=t&&(this.additionColumn[i]+=e);for(n=0;nt;n--)this.cells[i][n+e]=r(r({},this.cells[i][n]),{dx:i,dy:n+e,x:i*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[i][n]={dx:i,dy:n,x:i*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n=t&&(this.additionRow[n]+=e);for(i=0;ia?e:t,h=n>a?t:e,p=f.x-f.size[0]/2,d=f.y-f.size[1]/2,y=f.x+f.size[0]/2,v=f.y+f.size[1]/2,g=h.x-h.size[0]/2,m=h.y-h.size[1]/2,b=h.x+h.size[0]/2,x=h.y+h.size[1]/2,w=f.x,_=f.y,S=h.x,E=h.y,k=0,T=0;if(y>=g&&b>=p&&v>=m&&x>=d){0===(T=Math.sqrt(Math.pow(S-w,2)+Math.pow(E-_,2)))&&(T=1e-7),k=1*o/T*100+((yg?p:g))*((vm?d:m)),k*=i}else{var C=!1,O=function(t,e,r){var n=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,c=e.x-e.size[0]/2,f=e.y-e.size[1]/2,h=e.x+e.size[0]/2,p=e.y+e.size[1]/2,d=t.x,y=t.y,v=e.x,g=e.y,m=v-d,b=Math.atan2(m,g-y),x=0,w=0,_=0,S=0;b>s?(w=i-p,x=c-o,_=parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)),S=parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2))):_=S=0(x=c-o)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):b<-s?(w=i-p)>(x=-(h-n))?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):(w=f-a)>(x=Math.abs(m)>(o-n)/2?n-h:m)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x&&0!==b?(x/Math.sin(b)).toFixed(2):w.toFixed(2));var E=parseFloat(b.toFixed(2)),k=r;return r&&(k=ur||o.y>n)&&(e+=1e12);for(var a=i+1;a150)&&!(c<30||c>150)||l*c<0){a=!1;break}if(l>70&&l<110&&!(c>70&&c<110)||l*c<0){a=!1;break}if((u.x-t.x)*(u.x-e.x)<0){a=!1;break}if((u.y-t.y)*(u.y-e.y)<0){a=!1;break}}return a}function b(t,e){for(var r=!1,n=1*f,i=1*h,o=[n,-n,0,0],a=[0,0,i,-i],s=0;sd?(l=v,r=!0):(u.x-=o[c],u.y-=a[c])}}return p>d&&(p*=y),r?g(t):0}function x(t,e){var i=0;(t.x<0||t.y<0||t.x+t.size[0]+20>r||t.y+t.size[1]+20>n)&&(i+=1e12);for(var o=0;o0&&!(++a>=50);){var s=b(t,e);0!==s&&(o=s),i=o-r,r=o,0===i?--n:n=20}return t.forEach(function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}),{nodes:t,edges:e}}},2569:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var n=r(6835);function i(t){var e=0,r=0,n=0;if(t.length){for(var i=0;i<4;i++){(o=t[i])&&o.weight&&(e+=o.weight,r+=o.x*o.weight,n+=o.y*o.weight)}t.x=r/e,t.y=n/e,t.weight=e}else{var o=t;t.x=o.data.x,t.y=o.data.y,t.weight=o.data.weight}}e.forceNBody=function(t,e,r,a,s){var u=r/a,l=t.map(function(t,r){var n=e[t.id],i=n.data,o=n.x,a=n.y,s=n.size,l=i.layout.force.nodeStrength;return{x:o,y:a,size:s,index:r,vx:0,vy:0,weight:u*l}}),c=(0,n.quadtree)(l,function(t){return t.x},function(t){return t.y}).visitAfter(i);return l.forEach(function(t){!function(t,e){e.visit(function(e,r,n,i,a){return o(e,r,n,i,a,t)})}(t,c)}),l.map(function(r,n){var i=e[t[n].id].data.layout.force.mass,o=void 0===i?1:i;s[2*n]=r.vx/o,s[2*n+1]=r.vy/o}),s};var o=function(t,e,r,n,i,o){var a=o.x-t.x||.1,s=o.y-t.y||.1,u=n-e,l=a*a+s*s,c=Math.sqrt(l)*l;if(u*u*.811&&(o=(0,s.getAvgNodePosition)(l))}else o=void 0;return{x:null===o||void 0===o?void 0:o.x,y:null===o||void 0===o?void 0:o.y}}}}if(n){t||(t=this.getSameTypeLeafMap());var p={};Array.from(new Set(a.map(function(t,e){return t[i]}))).filter(function(t){return void 0!==t}).forEach(function(t){var e=a.filter(function(e){return e[i]===t}).map(function(t){return u[t.id]});p[t]=(0,s.getAvgNodePosition)(e)}),f={single:function(t){return c(t)},leaf:function(t){return c(t)},others:function(t){return c(t)},center:function(t,e,r){var n=p[t[i]];return{x:null===n||void 0===n?void 0:n.x,y:null===n||void 0===n?void 0:n.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),f);var d=this.centripetalOptions,y=d.leaf,v=d.single,g=d.others;y&&"function"!=typeof y&&(this.centripetalOptions.leaf=function(){return y}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),g&&"function"!=typeof g&&(this.centripetalOptions.others=function(){return g})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,r=t.edges,n=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,s.getDegreeMap)(e,r),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var r=1;(0,s.isNumber)(e.mass)&&(r=e.mass);var n=t.degreesMap[e.id].all;return!n||n<5?r:5*n*r};var a,u=t.nodeSize;if(t.preventOverlap){var c,f=t.nodeSpacing;c=(0,s.isNumber)(f)?function(){return f}:(0,s.isFunction)(f)?f:function(){return 0},a=u?(0,s.isArray)(u)?function(t){return Math.max(u[0],u[1])+c(t)}:function(t){return u+c(t)}:function(t){return t.size?(0,s.isArray)(t.size)?Math.max(t.size[0],t.size[1])+c(t):(0,s.isObject)(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=a,t.linkDistance=l(t.linkDistance,1),t.nodeStrength=l(t.nodeStrength,1),t.edgeStrength=l(t.edgeStrength,1);var h={},p={};e.forEach(function(e,n){(0,s.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,s.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];h[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,r)}}})}),p[e.id]=n}),t.nodeMap=h,t.nodeIdxMap=p,t.edgeInfos=[],null===r||void 0===r||r.forEach(function(e){var r=h[e.source],i=h[e.target];r&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:n?n(o(o({},e),{source:r,target:i}),r,i):t.linkDistance(e,r,i)||1+(u(r)+u(r)||0)/2}):elf.edgeInfos.push({})}),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,r=t.nodes,n=t.edges,i=t.workerEnabled,o=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,r){var l=[];if(r.forEach(function(t,e){l[2*e]=0,l[2*e+1]=0}),this.defSideCoe&&"function"==typeof this.defSideCoe){var c={};n.forEach(function(t){var e=t.source,r=t.target;c[e]=c[e]||[],c[e].push(t),c[r]=c[r]||[],c[r].push(t)}),this.relatedEdges=c}var f=e;if(i||!a){for(var h=0;(t.judgingDistance>o||h<1)&&h=f||t.judgingDistanceo){var c=o/l;s*=c,u*=c}e[2*a]=s,e[2*a+1]=u})},e.prototype.updatePosition=function(t,e){var r=this,n=r.nodes,i=r.distanceThresholdMode,o=r.nodeMap;if(null===n||void 0===n?void 0:n.length){var a=0;"max"===i?r.judgingDistance=-1/0:"min"===i&&(r.judgingDistance=1/0);var u=1/0,l=-1/0;n.forEach(function(n,c){var f=o[n.id];if((0,s.isNumber)(n.fx)&&(0,s.isNumber)(n.fy))return n.x=n.fx,n.y=n.fy,f.x=n.x,void(f.y=n.y);var h=t[2*c]*e,p=t[2*c+1]*e;n.x+=h,n.y+=p,f.x=n.x,f.y=n.y,n.yl&&(l=n.y);var d=Math.sqrt(h*h+p*p);switch(i){case"max":r.judgingDistanced&&(r.judgingDistance=d);break;default:a+=d}}),this.currentMinY=u,this.currentMaxY=l,i&&"mean"!==i||(r.judgingDistance=a/n.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,r=t.nodes,n=t.edges,i=t.nodeMap,o=t.degreesMap;if(null===r||void 0===r?void 0:r.length){var a={};return r.forEach(function(t,r){1===o[t.id].all&&(a[t.id]=(0,s.getCoreNodeAndRelativeLeafNodes)("leaf",t,n,e,o,i))}),a}},e}(a.Base);e.Force2Layout=c},9398:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,r=this.ry-t.ry;return Math.hypot(e,r)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,r=t.ry-this.ry,n=Math.hypot(e,r);n=n<1e-4?1e-4:n;var i=this.g*(this.degree+1)*(t.degree+1)/n;this.fx+=i*e/n,this.fy+=i*r/n},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var r=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/r,ry:(this.ry*this.mass+e.ry*e.mass)/r,mass:r,degree:this.degree+e.degree})},t}();e.default=r},432:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var a=r(9284),s=r(8652),u=o(r(9398)),l=o(r(9785)),c=o(r(9122)),f=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.kr=5,r.kg=1,r.mode="normal",r.preventOverlap=!1,r.dissuadeHubs=!1,r.barnesHut=void 0,r.maxIteration=0,r.ks=.1,r.ksmax=10,r.tao=.1,r.onLayoutEnd=function(){},r.prune=void 0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this.nodes,e=this.onLayoutEnd,r=this.prune,n=this.maxIteration;this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight);for(var i=[],o=t.length,a=0;a250&&(this.barnesHut=!0),void 0===this.prune&&o>100&&(this.prune=!0),0!==this.maxIteration||this.prune?0===this.maxIteration&&r&&(n=100,o<=200&&o>100?n=500:o>200&&(n=950),this.maxIteration=n):(n=250,o<=200&&o>100?n=1e3:o>200&&(n=1200),this.maxIteration=n),this.kr||(this.kr=50,o>100&&o<=500?this.kr=20:o>500&&(this.kr=1)),this.kg||(this.kg=20,o>100&&o<=500?this.kg=10:o>500&&(this.kg=1)),this.nodes=this.updateNodesByForces(i),e()},e.prototype.updateNodesByForces=function(t){for(var e=this.edges,r=this.maxIteration,n=this.nodes,i=e.filter(function(t){return(0,s.getEdgeTerminal)(t,"source")!==(0,s.getEdgeTerminal)(t,"target")}),o=n.length,a=i.length,u=[],l={},c={},f=[],h=0;h0;){for(g=0;g50||!l)?this.getOptRepGraForces(d,v,i):this.getRepGraForces(p,50,d,100,o,i);var b=this.updatePos(d,y,h,i);a=b.nodes,h=b.sg,p--,this.tick&&this.tick()}return a},e.prototype.getAttrForces=function(t,e,r,n,i,o,a,s){for(var u=this.nodes,l=this.preventOverlap,c=this.dissuadeHubs,f=this.mode,h=this.prune,p=0;p0&&(x=b,w=b),s[2*n[d.id]]+=x*m[0],s[2*n[v.id]]-=w*m[0],s[2*n[d.id]+1]+=x*m[1],s[2*n[v.id]+1]-=w*m[1]}}return s},e.prototype.getRepGraForces=function(t,e,r,n,i,o){for(var a=this.nodes,s=this.preventOverlap,u=this.kr,l=this.kg,c=this.center,f=this.prune,h=a.length,p=0;p0&&(g=u*(o[p]+1)*(o[d]+1)/v),r[2*p]-=g*y[0],r[2*d]+=g*y[0],r[2*p+1]-=g*y[1],r[2*d+1]+=g*y[1]}var m=[a[p].x-c[0],a[p].y-c[1]],b=Math.hypot(m[0],m[1]);m[0]=m[0]/b,m[1]=m[1]/b;var x=l*(o[p]+1);r[2*p]-=x*m[0],r[2*p+1]-=x*m[1]}return r},e.prototype.getOptRepGraForces=function(t,e,r){for(var n=this.nodes,i=this.kg,o=this.center,a=this.prune,s=n.length,u=9e10,f=-9e10,h=9e10,p=-9e10,d=0;d=f&&(f=n[d].x),n[d].x<=u&&(u=n[d].x),n[d].y>=p&&(p=n[d].y),n[d].y<=h&&(h=n[d].y));var y={xmid:(f+u)/2,ymid:(p+h)/2,length:Math.max(f-u,p-h),massCenter:o,mass:s},v=new l.default(y),g=new c.default(v);for(d=0;d1.5*x?1.5*x:r);for(y=0;yS?S:w)*t[2*y],k=w*t[2*y+1];i[y].x+=E,i[y].y+=k}return{nodes:i,sg:r}},e}(a.Base);e.ForceAtlas2Layout=f},9785:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var r=this.length/2;return t<=this.xmid+r&&t>=this.xmid-r&&e<=this.ymid+r&&e>=this.ymid-r},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=r},9122:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()?t.addForce(this.body):(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)-1||(e[n]=t[n])}),e}),this.ticking=!1},e.prototype.execute=function(t){var e=this,r=e.nodes,n=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(r),e.clusterForce.links(n)),i.nodes(r),n&&e.edgeForce)e.edgeForce.links(n);else if(n&&!e.edgeForce){h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var u=l.forceManyBody();if(e.nodeStrength&&u.strength(e.nodeStrength),i=l.forceSimulation().nodes(r),e.clustering){var f=(0,c.default)();f.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),n&&f.links(n),r&&f.nodes(r),f.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=f,i.force("group",f)}if(i.force("center",l.forceCenter(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),n){var h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}if(e.workerEnabled&&!y()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var d=function(t){var e=t.alphaMin(),r=t.alphaTarget(),n=t.alpha(),i=Math.log((e-r)/(n-r))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),v=1;v<=d;v++)i.tick(),postMessage({nodes:r,currentTick:v,totalTicks:d,type:p.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else i.on("tick",function(){e.tick()}).on("end",function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()}),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,r,n=this.nodeSize,i=this.nodeSpacing,o=this.collideStrength;if(r=(0,f.isNumber)(i)?function(){return i}:(0,f.isFunction)(i)?i:function(){return 0},n)if((0,f.isFunction)(n))e=function(t){return n(t)+r(t)};else if((0,f.isArray)(n)){var a=(n[0]>n[1]?n[0]:n[1])/2;e=function(t){return a+r(t)}}else if((0,f.isNumber)(n)){var s=n/2;e=function(t){return s+r(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,f.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+r(t):(0,f.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+r(t):t.size/2+r(t):10+r(t)};t.force("collisionForce",l.forceCollide(e).strength(o))},e.prototype.updateCfg=function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object.assign(this,t)},e.prototype.destroy=function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0},e}(h.Base);function y(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=d},1878:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(461),e)},6865:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.FruchtermanLayout=void 0;var o=r(9284),a=r(8652),s=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=1e3,r.workerEnabled=!1,r.gravity=10,r.speed=5,r.clustering=!1,r.clusterGravity=10,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.onLayoutEnd=function(){},r.tick=function(){},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=this.nodes;if(void 0!==this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval),n&&0!==n.length){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=this.onLayoutEnd)||void 0===e||e.call(this));var o={},s={};return n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,s[t.id]=e}),this.nodeMap=o,this.nodeIdxMap=s,this.run()}null===(t=this.onLayoutEnd)||void 0===t||t.call(this)},e.prototype.run=function(){var t,e=this,r=e.nodes;if(r){var n=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,s=e.animate,u={};if(a&&r.forEach(function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})}),o||!s){for(var l=0;l=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))},0)}return{nodes:r,edges:n}}},e.prototype.runOneStep=function(t){var e,r=this.nodes;if(r){var n=this.edges,i=this.center,o=this.gravity,s=this.speed,u=this.clustering,l=this.height*this.width,c=Math.sqrt(l)/10,f=l/(r.length+1),h=Math.sqrt(f),p=[];if(r.forEach(function(t,e){p[e]={x:0,y:0}}),this.applyCalculate(r,n,p,h,f),u){for(var d in t)t[d].cx=0,t[d].cy=0,t[d].count=0;for(var d in r.forEach(function(e){var r=t[e.cluster];(0,a.isNumber)(e.x)&&(r.cx+=e.x),(0,a.isNumber)(e.y)&&(r.cy+=e.y),r.count++}),t)t[d].cx/=t[d].count,t[d].cy/=t[d].count;var y=this.clusterGravity||o;r.forEach(function(e,r){if((0,a.isNumber)(e.x)&&(0,a.isNumber)(e.y)){var n=t[e.cluster],i=Math.sqrt((e.x-n.cx)*(e.x-n.cx)+(e.y-n.cy)*(e.y-n.cy)),o=h*y;p[r].x-=o*(e.x-n.cx)/i,p[r].y-=o*(e.y-n.cy)/i}})}r.forEach(function(t,e){if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=.01*h*o;p[e].x-=r*(t.x-i[0]),p[e].y-=r*(t.y-i[1])}}),r.forEach(function(t,e){if((0,a.isNumber)(t.fx)&&(0,a.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(r>0){var n=Math.min(c*(s/800),r);t.x+=p[e].x/r*n,t.y+=p[e].y/r*n}}}),null===(e=this.tick)||void 0===e||e.call(this)}},e.prototype.applyCalculate=function(t,e,r,n,i){this.calRepulsive(t,r,i),e&&this.calAttractive(e,r,n)},e.prototype.calRepulsive=function(t,e,r){t.forEach(function(n,i){e[i]={x:0,y:0},t.forEach(function(t,o){if(i!==o&&(0,a.isNumber)(n.x)&&(0,a.isNumber)(t.x)&&(0,a.isNumber)(n.y)&&(0,a.isNumber)(t.y)){var s=n.x-t.x,u=n.y-t.y,l=s*s+u*u;if(0===l){l=1;var c=i>o?1:-1;s=.01*c,u=.01*c}var f=r/l;e[i].x+=s*f,e[i].y+=u*f}})})},e.prototype.calAttractive=function(t,e,r){var n=this;t.forEach(function(t){var i=(0,a.getEdgeTerminal)(t,"source"),o=(0,a.getEdgeTerminal)(t,"target");if(i&&o){var s=n.nodeIdxMap[i],u=n.nodeIdxMap[o];if(s!==u){var l=n.nodeMap[i],c=n.nodeMap[o];if((0,a.isNumber)(c.x)&&(0,a.isNumber)(l.x)&&(0,a.isNumber)(c.y)&&(0,a.isNumber)(l.y)){var f=c.x-l.x,h=c.y-l.y,p=Math.sqrt(f*f+h*h),d=p*p/r;e[u].x-=f/p*d,e[u].y-=h/p*d,e[s].x+=f/p*d,e[s].y+=h/p*d}}}})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=s},6007:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=r(9284),a=r(8652),s=function(t,e){return t?(0,a.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},u=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=500,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.preventOverlap=!0,r.collideStrength=1,r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),n&&0!==n.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var i=r.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var o={},u={};n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,u[t.id]=e}),r.nodeMap=o,r.nodeIdxMap=u,r.linkDistance=s(r.linkDistance,1),r.nodeStrength=s(r.nodeStrength,1),r.edgeStrength=s(r.edgeStrength,1);var l,c=r.nodeSize;if(r.preventOverlap){var f,h=r.nodeSpacing;f=(0,a.isNumber)(h)?function(){return h}:(0,a.isFunction)(h)?h:function(){return 0},l=c?(0,a.isArray)(c)?function(t){return Math.max(c[0],c[1])+f(t)}:function(t){return c+f(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+f(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+f(t):t.size+f(t):10+f(t)}}r.nodeSize=l;var p=r.edges;r.degrees=(0,a.getDegree)(n.length,r.nodeIdxMap,p),r.getMass||(r.getMass=function(t){return t.mass||r.degrees[r.nodeIdxMap[t.id]].all||1}),r.run()}else null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,r=e.maxIteration,n=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(n)if(i||!a){for(var s=0;s=r&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}},0)}},e.prototype.reachMoveThreshold=function(t,e,r){var n=0;return t.forEach(function(t,r){var i=t.x-e[r].x,o=t.y-e[r].y;n+=Math.sqrt(i*i+o*o)}),(n/=t.length)=h)){var p=a.x-e.x,d=a.y-e.y;0===p&&0===d&&(p=.01*Math.random(),d=.01*Math.random());var y=p*p+d*d,v=Math.sqrt(y),g=(v+.1)*i,m=p/v,b=d/v,x=.5*(u(a)+u(e))*n/(g*g),w=r?r(e):1;if(t[2*c]+=m*x,t[2*c+1]+=b*x,t[2*h]-=m*x,t[2*h+1]-=b*x,o&&(l(a)+l(e))/2>v){var _=s*(u(a)+u(e))*.5/y;t[2*c]+=m*_/f,t[2*c+1]+=b*_/f,t[2*h]-=m*_/w,t[2*h+1]-=b*_/w}}})})},e.prototype.calAttractive=function(t,e){var r=this.nodeMap,n=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,s=this.nodeSize,u=this.getMass;e.forEach(function(e,l){var c=(0,a.getEdgeTerminal)(e,"source"),f=(0,a.getEdgeTerminal)(e,"target"),h=r[c],p=r[f],d=p.x-h.x,y=p.y-h.y;0===d&&0===y&&(d=.01*Math.random(),y=.01*Math.random());var v=Math.sqrt(d*d+y*y),g=d/v,m=y/v,b=((i(e,h,p)||1+(s(h)+s(p)||0)/2)-v)*o(e),x=n[c],w=n[f],_=u?u(h):1,S=u?u(p):1;t[2*x]-=g*b/_,t[2*x+1]-=m*b/_,t[2*w]+=g*b/S,t[2*w+1]+=m*b/S})},e.prototype.calGravity=function(t,e){for(var r=this.center,n=this.gravity,i=this.degrees,o=e.length,s=0;si.maxSpeed){var l=i.maxSpeed/u;a*=l,s*=l}e[2*n]=a,e[2*n+1]=s})},e.prototype.updatePosition=function(t,e,r){r.forEach(function(r,n){if((0,a.isNumber)(r.fx)&&(0,a.isNumber)(r.fy))return r.x=r.fx,void(r.y=r.fy);var i=t[2*n]*e,o=t[2*n+1]*e;r.x+=i,r.y+=o})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=u},9720:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]t.cells)((x=t.small())-1)*(b=t.large())>=t.cells?t.small(x-1):(b-1)*x>=t.cells&&t.large(b-1);else for(;t.cols*t.rows=t.cells?t.large(b+1):t.small(x+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),f||h){var w=(0,o.getFuncByUnknownType)(10,h),_=(0,o.getFuncByUnknownType)(30,p,!1);d.forEach(function(e){e.x&&e.y||(e.x=0,e.y=0);var r,n,i=_(e)||30;(0,o.isArray)(i)?(r=i[0],n=i[1]):(r=i,n=i);var a=void 0!==w?w(e):c,s=r+a,u=n+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)})}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var S=0;S=t&&(this.col=0,this.row++)},e.prototype.getPos=function(t){var e,r,n=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+n[0],r=a.row*o+o/2+n[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+n[0],r=this.row*o+o/2+n[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=r},e.prototype.getType=function(){return"grid"},e}(r(9284).Base);e.GridLayout=a},1812:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var o=r(790);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return o.GridLayout}});var a=r(3846);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=r(6007);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=r(3490);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var l=r(1878);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return l.ForceLayout}});var c=r(4933);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return c.CircularLayout}});var f=r(813);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return f.DagreLayout}});var h=r(1083);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return h.DagreCompoundLayout}});var p=r(4318);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return p.RadialLayout}});var d=r(7940);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return d.ConcentricLayout}});var y=r(5031);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return y.MDSLayout}});var v=r(6865);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return v.FruchtermanLayout}});var g=r(9720);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return g.FruchtermanGPULayout}});var m=r(4790);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return m.GForceGPULayout}});var b=r(5428);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var x=r(9266);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return x.ComboCombinedLayout}});var w=r(432);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return w.ForceAtlas2Layout}});var _=r(4957);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return _.ERLayout}});var S=r(4199);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),i(r(8312),e)},4199:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var n=r(2235),i=r(790),o=r(3846),a=r(3490),s=r(6007),u=r(1878),l=r(4933),c=r(813),f=r(4318),h=r(7940),p=r(5031),d=r(6865),y=r(9720),v=r(4790),g=r(5428),m=r(9266),b=r(432),x=r(4957),w=r(1083),_=r(8652),S=function(){function t(t){var e=(0,n.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null===t||void 0===t?void 0:t.length){var e=1/0,r=[];if(t.forEach(function(t){(0,_.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(r.push(t),t.layern[0]?n[0]:b-n[0],_=x-n[1]>n[1]?n[1]:x-n[1];0===w&&(w=b/2),0===_&&(_=x/2);var S=_>w?w:_,E=Math.max.apply(Math,m),k=[];m.forEach(function(e,r){t.unitRadius||(t.unitRadius=S/E),k[r]=e*t.unitRadius}),t.radii=k;var T=t.eIdealDisMatrix();t.eIdealDistances=T;var C=function(t){for(var e=t.length,r=t[0].length,n=[],i=0;iM[1]?M[0]:M[1])+L(t)}:function(t){return M+L(t)}:function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+L(t):(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+L(t):t.size+L(t):10+L(t)};var N={nodes:e,nodeSizeFunc:A,adjMatrix:y,positions:O,radii:k,height:x,width:b,strictRadial:I,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:O.length/4.5},R=new l.default(N);O=R.layout()}return O.forEach(function(t,r){e[r].x=t[0]+n[0],e[r].y=t[1]+n[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this.maxIteration,e=this.positions||[],r=this.weights||[],n=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,n,r)}},e.prototype.oneIteration=function(t,e,r,n,i){var o=1-t,a=this.focusIndex;e.forEach(function(s,u){var l=c(s,[0,0]),f=0===l?0:1/l;if(u!==a){var h=0,p=0,d=0;e.forEach(function(t,e){if(u!==e){var r=c(s,t),o=0===r?0:1/r,a=n[e][u];d+=i[u][e],h+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),p+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}});var y=0===r[u]?0:1/r[u];d*=o,d+=t*y*y,h*=o,h+=t*y*s[0]*f,s[0]=h/d,p*=o,p+=t*y*s[1]*f,s[1]=p/d}})},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var r=t.distances,n=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,s=[];return r&&r.forEach(function(r,u){var l=[];r.forEach(function(r,s){if(u===s)l.push(0);else if(i[u]===i[s])if("data"===t.sortBy)l.push(r*(Math.abs(u-s)*t.sortStrength)/(i[u]/o));else if(t.sortBy){var c=e[u][t.sortBy]||0,f=e[s][t.sortBy]||0;(0,a.isString)(c)&&(c=c.charCodeAt(0)),(0,a.isString)(f)&&(f=f.charCodeAt(0)),l.push(r*(Math.abs(c-f)*t.sortStrength)/(i[u]/o))}else l.push(r*n/(i[u]/o));else{var h=(n+o)/2;l.push(r*h)}}),s.push(l)}),s},e.prototype.handleInfinity=function(t,e,r){for(var n=t.length,i=0;ir?t[e][n]:r);return r},e.prototype.getType=function(){return"radial"},e}(s.Base);e.RadialLayout=f},632:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this.positions,e=[],r=this.iterations,n=this.width/10;this.maxDisplace=n,this.disp=e;for(var i=0;iu?1:-1;l=.01*h,c=.01*h}if(fMath.PI/2&&(c-=Math.PI/2,s*=-1,u*=-1);var f=Math.cos(c)*l;e.x=s*f,e.y=u*f});var a=this.radii;t.forEach(function(s,u){if(u!==i){var l=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(l>0&&u!==i){var c=Math.min(o*(r/800),l);if(s[0]+=e[u].x/l*c,s[1]+=e[u].y/l*c,n){var f=s[0]-t[i][0],h=s[1]-t[i][1],p=Math.sqrt(f*f+h*h);f=f/p*a[u],h=h/p*a[u],s[0]=t[i][0]+f,s[1]=t[i][1]+h}}}})},t}();e.default=r},3846:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,r=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach(function(e){e.x=.9*(Math.random()-.5)*t.width+r[0],e.y=.9*(Math.random()-.5)*t.height+r[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(r(9284).Base);e.RandomLayout=o},8312:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2235:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=r(9284),a=r(8652),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,a.isObject)(e)){var r=function(t){function r(r){var n,i,o=n=t.call(this)||this,a={},s=Object.assign({},o.getDefaultCfg(),(null===(i=e.getDefaultCfg)||void 0===i?void 0:i.call(e))||{});return Object.assign(a,s,e,r),Object.keys(a).forEach(function(t){var e=a[t];o[t]=e}),n}return i(r,t),r}(o.Base);s.set(t,r)}else s.set(t,e);return s.get(t)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},5458:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},7102:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var n=r(8652),i=r(8325);e.isFunction=function(t){return"function"==typeof t};e.getFunc=function(t,e,r){return r||((0,i.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,r,o){return void 0===o&&(o=!0),r||0===r?(0,e.isFunction)(r)?r:(0,i.isNumber)(r)?function(){return r}:(0,n.isArray)(r)?function(){if(o){var e=Math.max.apply(Math,r);return isNaN(e)?t:e}return r}:(0,n.isObject)(r)?function(){if(o){var e=Math.max(r.width,r.height);return isNaN(e)?t:e}return[r.width,r.height]}:function(){return t}:function(e){return e.size?(0,n.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,n.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},446:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var n=r(8652),i=r(3979);e.proccessToFunc=function(t,e){return t?(0,n.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var r=[],n=[],o={},a=0;for(a=0;ae[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e};e.getAdjMatrix=function(t,r){var n=t.nodes,i=t.edges,o=[],a={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(t,e){a[t.id]=e,o.push([])}),null===i||void 0===i||i.forEach(function(t){var n=(0,e.getEdgeTerminal)(t,"source"),i=(0,e.getEdgeTerminal)(t,"target"),s=a[n],u=a[i];void 0!==s&&void 0!==u&&(o[s][u]=1,r||(o[u][s]=1))}),o};e.scaleMatrix=function(t,e){var r=[];return t.forEach(function(t){var n=[];t.forEach(function(t){n.push(t*e)}),r.push(n)}),r};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,r){if(e&&e.children)for(var n=e.children.length-1;n>=0;n--)if(!t(e.children[n],r))return;return!!r(e)}(t,e)};e.getLayoutBBox=function(t){var e=1/0,r=1/0,o=-1/0,a=-1/0;return t.forEach(function(t){var s=t.size;(0,n.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,i.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],l=t.x-u[0],c=t.x+u[0],f=t.y-u[1],h=t.y+u[1];e>l&&(e=l),r>f&&(r=f),oi&&(n=r,a(1),++e),r[t]=o}function a(t){e=0,r=Object.create(null),t||(n=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==r[t]||void 0!==n[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=n[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}(r),n},l=/rgba?\(([\s.,0-9]+)\)/;var c=u(function(t){if("#"===t[0]&&7===t.length)return t;var e;s||((e=document.createElement("i")).title="Web Colour Picker",e.style.display="none",document.body.appendChild(e),s=e),s.style.color=t;var r=document.defaultView.getComputedStyle(s,"").getPropertyValue("color");return r=o(l.exec(r)[1].split(/\s*,\s*/).map(function(t){return Number(t)}))},function(t){return t},256);function f(t,e,r,n){return t[n]+(e[n]-t[n])*r}function h(t){var e=("string"==typeof t?t.split("-"):t).map(function(t){return n(-1===t.indexOf("#")?c(t):t)});return function(t){return function(t,e){var r=isNaN(Number(e))||e<0?0:e>1?1:Number(e),n=t.length-1,i=Math.floor(n*r),a=n*r-i,s=t[i],u=i===n?s:t[i+1];return o([f(s,u,a,0),f(s,u,a,1),f(s,u,a,2)])}(e,t)}}var p=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,d=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,y=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function v(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=p.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=d.exec(t))[4]}var o=r.match(y);return o.forEach(function(t,r){var n=t.split(":");e+=n[1]+" "+100*Number(n[0])+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}var g=r(8610);function m(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return g.fromRotation(n,r),g.multiply(t,n,e)}function b(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return g.fromScaling(n,r),g.multiply(t,n,e)}function x(t,e,r){return g.multiply(t,r,e)}function w(t,e){for(var r,n,i,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s=0;return r?i?2*Math.PI-n:n:i?n:2*Math.PI-n}function k(t,e,r){return r?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function T(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var r="number"==typeof e&&e>=1?Math.pow(10,e):1;return t.map(function(t){var n=t.slice(1).map(Number).map(function(t){return e?Math.round(t*r)/r:Math.round(t)});return[t[0]].concat(n)})}(t,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")}var C=r(7582),O={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function A(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],i=r;n.length;)e[r]="A",t.splice(i+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var P={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function M(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return P[e]===t.length-1&&"achlmqstvz".includes(e)})}function I(t){return M(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function L(t){return I(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function j(t){for(var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;n.length>=P[r]&&("m"===r&&n.length>2?(t.segments.push([e].concat(n.splice(0,2))),r="l",e="m"===e?"l":"L"):t.segments.push([e].concat(n.splice(0,P[r]))),P[r]););}function N(t){var e=t.index,r=t.pathValue,n=r.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function R(t){return t>=48&&t<=57||43===t||45===t||46===t}function D(t){return t>=48&&t<=57}function B(t){var e,r=t.max,n=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(o>=r)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=n.charCodeAt(o))&&45!==e||(o+=1,e=n.charCodeAt(o)),D(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=n.charCodeAt(o),a&&o=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function z(t){var e=t.max,r=t.pathValue,n=t.index,i=r.charCodeAt(n),o=P[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,F(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?B(t):N(t),t.err.length)return;t.data.push(t.param),F(t),t.index=t.max)break;if(!R(r.charCodeAt(t.index)))break}j(t)}else j(t);else t.err='[path-util]: Invalid path value "'+r[n]+'" is not a path command'}var U=function(){return function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}}();function G(t){if(M(t))return[].concat(t);var e=new U(t);for(F(e);e.index1&&(g*=T=Math.sqrt(T),m*=T);var C=g*g,O=m*m,A=(o===a?-1:1)*Math.sqrt(Math.abs((C*O-C*k*k-O*E*E)/(C*k*k+O*E*E)));p=A*g*k/m+(y+b)/2,d=A*-m*E/g+(v+x)/2,f=Math.asin(((v-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=yh&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var M=h,I=b,L=x;h=f+w*(a&&h>f?1:-1),S=Y(b=p+g*Math.cos(h),x=d+m*Math.sin(h),g,m,i,0,a,I,L,[h,M,p,d])}P=h-f;var j=Math.cos(f),N=Math.sin(f),R=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*g*B,z=4/3*m*B,U=[y,v],G=[y+F*N,v-z*j],V=[b+F*D,x-z*R],H=[b,x];if(G[0]=2*U[0]-G[0],G[1]=2*U[1]-G[1],l)return G.concat(V,H,S);for(var W=[],X=0,Z=(S=G.concat(V,H,S)).length;X=o)a={x:r,y:n};else{var s=X([t,e],[r,n],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function nt(t,e){var r=t.x,n=t.y,i=e.x,o=e.y,a=r*i+n*o,s=Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(o,2)));return(r*o-n*i<0?-1:1)*Math.acos(a/s)}function it(t,e,r,n,i,o,a,s,u,l){var c=Math.abs,f=Math.sin,h=Math.cos,p=Math.sqrt,d=Math.PI,y=c(r),v=c(n),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return rt(t,e,s,u,l).point;var m=(t-s)/2,b=(e-u)/2,x={x:h(g)*m+f(g)*b,y:-f(g)*m+h(g)*b},w=Math.pow(x.x,2)/Math.pow(y,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(y*=p(w),v*=p(w));var _=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(y,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2));_=_<0?0:_;var S=(o!==a?1:-1)*p(_),E=S*(y*x.y/v),k=S*(-v*x.x/y),T=h(g)*E-f(g)*k+(t+s)/2,C=f(g)*E+h(g)*k+(e+u)/2,O={x:(x.x-E)/y,y:(x.y-k)/v},A=nt({x:1,y:0},O),P=nt(O,{x:(-x.x-E)/y,y:(-x.y-k)/v});!a&&P>0?P-=2*d:a&&P<0&&(P+=2*d);var M=A+(P%=2*d)*l,I=y*h(M),L=v*f(M);return{x:h(g)*I-f(g)*L+T,y:f(g)*I+h(g)*L+C}}function ot(t,e,r,n,i,o,a,s,u,l,c){var f,h=c.bbox,p=void 0===h||h,d=c.length,y=void 0===d||d,v=c.sampleSize,g=void 0===v?30:v,m="number"==typeof l,b=t,x=e,w=0,_=[b,x,w],S=[b,x],E={x:0,y:0},k=[{x:b,y:x}];m&&l<=0&&(E={x:b,y:x});for(var T=0;T<=g;T+=1){if(b=(f=it(t,e,r,n,i,o,a,s,u,T/g)).x,x=f.y,p&&k.push({x:b,y:x}),y&&(w+=et(S,[b,x])),S=[b,x],m&&w>=l&&l>_[2]){var C=(w-l)/(w-_[2]);E={x:S[0]*(1-C)+_[0]*C,y:S[1]*(1-C)+_[1]*C}}_=[b,x,w]}return m&&l>=w&&(E={x:s,y:u}),{length:w,point:E,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function at(t,e,r,n,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function st(t,e,r,n,i,o,a,s,u,l){var c,f=l.bbox,h=void 0===f||f,p=l.length,d=void 0===p||p,y=l.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,b=e,x=0,w=[m,b,x],_=[m,b],S={x:0,y:0},E=[{x:m,y:b}];g&&u<=0&&(S={x:m,y:b});for(var k=0;k<=v;k+=1){if(m=(c=at(t,e,r,n,i,o,a,s,k/v)).x,b=c.y,h&&E.push({x:m,y:b}),d&&(x+=et(_,[m,b])),_=[m,b],g&&x>=u&&u>w[2]){var T=(x-u)/(x-w[2]);S={x:_[0]*(1-T)+w[0]*T,y:_[1]*(1-T)+w[1]*T}}w=[m,b,x]}return g&&u>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map(function(t){return t.x})),y:Math.min.apply(null,E.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function ut(t,e,r,n,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*r+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*n+Math.pow(a,2)*o}}function lt(t,e,r,n,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,f=s.length,h=void 0===f||f,p=s.sampleSize,d=void 0===p?10:p,y="number"==typeof a,v=t,g=e,m=0,b=[v,g,m],x=[v,g],w={x:0,y:0},_=[{x:v,y:g}];y&&a<=0&&(w={x:v,y:g});for(var S=0;S<=d;S+=1){if(v=(u=ut(t,e,r,n,i,o,S/d)).x,g=u.y,c&&_.push({x:v,y:g}),h&&(m+=et(x,[v,g])),x=[v,g],y&&m>=a&&a>b[2]){var E=(m-a)/(m-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[v,g,m]}return y&&a>=m&&(w={x:i,y:o}),{length:m,point:w,min:{x:Math.min.apply(null,_.map(function(t){return t.x})),y:Math.min.apply(null,_.map(function(t){return t.y}))},max:{x:Math.max.apply(null,_.map(function(t){return t.x})),y:Math.max.apply(null,_.map(function(t){return t.y}))}}}function ct(t,e,r){for(var n,i,o,a,s,u,l,c,f,h=W(t),p="number"==typeof e,d=[],y=0,v=0,g=0,m=0,b=[],x=[],w=0,_={x:0,y:0},S=_,E=_,k=_,T=0,C=0,O=h.length;C=e&&(k=E),x.push(S),b.push(_),T+=w,y=(u="Z"!==c?f.slice(-2):[g,m])[0],v=u[1];return p&&e>=T&&(k={x:y,y:v}),{length:T,point:k,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,x.map(function(t){return t.x})),y:Math.max.apply(null,x.map(function(t){return t.y}))}}}function ft(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{length:!1})),n=r.min,i=n.x,o=n.y,a=r.max,s=a.x,u=a.y,l=s-i,c=u-o;return{width:l,height:c,x:i,y:o,x2:s,y2:u,cx:i+l/2,cy:o+c/2,cz:Math.max(l,c)+Math.min(l,c)/2}}function ht(t,e){return ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!1,length:!0})).length}function pt(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!0,length:!0})),n=r.length,i=r.min,o=i.x,a=i.y,s=r.max,u=s.x,l=s.y,c=u-o,f=l-a;return{length:n,width:c,height:f,x:o,y:a,x2:u,y2:l,cx:o+c/2,cy:a+f/2,cz:Math.max(c,f)+Math.min(c,f)/2}}function dt(t,e){var r=t.length-1,n=[],i=0,o=function(t){var e=t.length,r=e-1;return t.map(function(n,i){return t.map(function(n,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=r),t[s])})})}(t);return o.forEach(function(o,a){t.slice(1).forEach(function(n,o){i+=et(t[(a+o)%r].slice(-2),e[o%r].slice(-2))}),n[a]=i,i=0}),o[n.indexOf(Math.min.apply(null,n))]}function yt(t){var e=0,r=0,n=0;return J(t).map(function(t){var i;switch(t[0]){case"M":return e=t[1],r=t[2],0;default:var o=t.slice(1),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],f=o[5];return n=function(t,e,r,n,i,o,a,s){return 3*((s-e)*(r+i)-(a-t)*(n+o)+n*(t-i)-r*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,r,a,s,u,l,c,f),i=t.slice(-2),e=i[0],r=i[1],n}}).reduce(function(t,e){return t+e},0)}function vt(t){return yt(t)>=0}function gt(t,e,r){return ct(t,e,(0,C.__assign)((0,C.__assign)({},r),{bbox:!1,length:!0})).point}function mt(t,e){for(var r,n,i,o,a=G(t),s=W(a),u=ht(a),l=function(t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n},c=8,f=0,h=0,p=1/0,d=0;d<=u;d+=c)(f=l(r=gt(s,d))).5;)g=l(i=gt(s,y=h-c)),m=l(o=gt(s,v=h+c)),y>=0&&g=i)return s=i-(a=ht(n=r.slice(0,-1))),{segment:r[o],index:o,length:s,lengthAtSegment:a};for(var f=[];o>0;)u=n[o],s=i-(a=ht(n=n.slice(0,-1))),i=a,f.push({segment:u,index:o,length:s,lengthAtSegment:a}),o-=1;return f.find(function(t){return t.lengthAtSegment<=e})}(a,h);return{closest:n,distance:Math.sqrt(p),segment:b}}function bt(t,e){var r=mt(t,e).distance;return Math.abs(r)<.001}function xt(t){return t.map(function(t,e,r){var n=e&&r[e-1].slice(-2).concat(t.slice(1)),i=e?st(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var r=t.slice(0,2),n=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=X(r,n,e),s=X(n,i,e),u=X(i,o,e),l=X(a,s,e),c=X(s,u,e),f=X(l,c,e);return[["C"].concat(a,l,f),["C"].concat(c,u,o)]}(n):[t,t]:[t],l:i}})}function wt(t,e,r){var n=xt(t),i=xt(e),o=n.length,a=i.length,s=n.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,c=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,f=r||Math.max(o,a),h=[l,c],p=[f-o,f-a],d=0,y=[n,i].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,r){return d=r&&p[e]&&t.l>=h[e],p[e]-=d?1:0,d?t.ss:[t.s]}).flat()});return y[0].length===y[1].length?y:wt(y[0],y[1],f)}var _t=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},St=function(t,e){return!!_t(t)&&t.indexOf(e)>-1},Et=function(t,e){if(!_t(t))return t;for(var r=[],n=0;n-1;)Yt.call(t,o,1);return t},Kt=Array.prototype.splice,Jt=function(t,e){if(!_t(t))return[];for(var r=t?e.length:0,n=r-1;r--;){var i=void 0,o=e[r];r!==n&&o===i||(i=o,Kt.call(t,o,1))}return t},Qt=function(t,e,r){if(!At(t)&&!Dt(t))return t;var n=r;return It(t,function(t,r){n=e(n,t,r)}),n},$t=function(t,e){var r=[];if(!_t(t))return r;for(var n=-1,i=[],o=t.length;++ne[i])return 1;if(t[i]r?r:t},we=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},_e=function(t){return Ot(t,"Number")},Se=function(t){return _e(t)&&t%1!=0},Ee=function(t){return _e(t)&&t%2==0},ke=Number.isInteger?Number.isInteger:function(t){return _e(t)&&t%1==0},Te=function(t){return _e(t)&&t<0},Ce=1e-5;function Oe(t,e,r){return void 0===r&&(r=Ce),Math.abs(t-e)0},Me=function(t,e){if(At(t)){for(var r,n=-1/0,i=0;in&&(r=o,n=s)}return r}},Ie=function(t,e){if(At(t)){for(var r,n=1/0,i=0;ie?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},Rr=function(t){return _t(t)?Array.prototype.slice.call(t):[]},Dr={},Br=function(t){return Dr[t=t||"g"]?Dr[t]+=1:Dr[t]=1,t+Dr[t]},Fr=function(){},zr=function(t){return t};function Ur(t){return Tt(t)?0:_t(t)?t.length:Object.keys(t).length}var Gr=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),Vr=1e-6;function Hr(t){return Math.abs(t)0!=Hr(s[1]-r)>0&&Hr(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var Yr=function(t,e,r){return t>=e&&t<=r};function Xr(t){for(var e=[],r=t.length,n=0;n1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function Zr(t,e){var r=!1;return t.forEach(function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;Yr(h,0,1)&&Yr(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function Kr(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function Jr(t,e){if(t.length<2||e.length<2)return!1;var r,n,i=Kr(t),o=Kr(e);if(r=i,(n=o).minX>r.maxX||n.maxXr.maxY||n.maxY1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==r.output){if(!i(r.output))throw new TypeError("output option must be an array if specified");e=r.output}else e=new Array(t.length);var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;us&&(s=t[u]);return s}(t);if(n===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=r.min,s=void 0===a?r.autoMinMax?n:0:a,u=r.max,l=void 0===u?r.autoMinMax?o:1:u;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(o-n),f=0;f1&&void 0!==arguments[1]?arguments[1]:{},r=e.maxRows,n=void 0===r?15:r,i=e.maxColumns,o=void 0===i?10:i,u=e.maxNumSize,c=void 0===u?8:u;return"".concat(t.constructor.name," {\n").concat(a,"[\n").concat(s).concat(function(t,e,r,n){for(var i=t.rows,o=t.columns,a=Math.min(i,e),u=Math.min(o,r),c=[],f=0;fn)throw new RangeError("Row index out of range")}function h(t,e,r){var n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function p(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function d(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function y(t,e,r){return{row:v(t,e),column:g(t,r)}}function v(t,e){if("object"!==c(e))throw new TypeError("unexpected type for row indices");if(e.some(function(e){return e<0||e>=t.rows}))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function g(t,e){if("object"!==c(e))throw new TypeError("unexpected type for column indices");if(e.some(function(e){return e<0||e>=t.columns}))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function m(t,e,r,n,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(x("startRow",e),x("endRow",r),x("startColumn",n),x("endColumn",i),e>r||n>i||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function b(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],n=0;nr?(i=!0,r=e):(n=!1,i=!0);t++}return n}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,r=-1,n=!0,i=!1;tr?(i=!0,r=e):(n=!1,i=!0);for(var o=e+1;ot.get(n,r)&&(n=i);if(0===t.get(n,r))r++;else{t.swapRows(e,n);for(var o=t.get(e,r),a=r;a=0;)if(0===t.maxRow(n))n--;else{for(var i=0,o=!1;i0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==T(t))throw new TypeError("options must be an object");var e=t.rows,r=void 0===e?1:e,n=t.columns,i=void 0===n?1:n;if(!Number.isInteger(r)||r<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new L(this.rows*r,this.columns*i),a=0;at&&(t=this.get(e,r));return t}},{key:"maxIndex",value:function(){for(var t=this.get(0,0),e=[0,0],r=0;rt&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}},{key:"min",value:function(){for(var t=this.get(0,0),e=0;ee&&(e=this.get(t,r));return e}},{key:"maxRowIndex",value:function(t){f(this,t);for(var e=this.get(t,0),r=[t,0],n=1;ne&&(e=this.get(t,n),r[1]=n);return r}},{key:"minRow",value:function(t){f(this,t);for(var e=this.get(t,0),r=1;re&&(e=this.get(r,t));return e}},{key:"maxColumnIndex",value:function(t){h(this,t);for(var e=this.get(0,t),r=[0,t],n=1;ne&&(e=this.get(n,t),r[0]=n);return r}},{key:"minColumn",value:function(t){h(this,t);for(var e=this.get(0,t),r=1;r0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==T(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new L(this.rows,this.columns),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==T(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new L(this.rows,this.columns),s=0;s0&&void 0!==arguments[0]?arguments[0]:I,e=0;e0&&void 0!==arguments[0]?arguments[0]:I,e=0;er||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");for(var n=new L(t.length,r-e+1),i=0;i=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));n.set(i,o-e,this.get(t[i],o))}return n}},{key:"subMatrixColumn",value:function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");for(var n=new L(r-e+1,t.length),i=0;i=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));n.set(o-e,i,this.get(o,t[i]))}return n}},{key:"setSubMatrix",value:function(t,e,r){m(this,e,e+(t=L.checkMatrix(t)).rows-1,r,r+t.columns-1);for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("object"===T(t)&&(e=t,t=void 0),"object"!==T(e))throw new TypeError("options must be an object");var r=e,n=r.unbiased,i=void 0===n||n,o=r.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return function(t,e,r){for(var n=t.rows,i=t.columns,o=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:{};if("object"===T(t)&&(e=t,t=void 0),"object"!==T(e))throw new TypeError("options must be an object");var r=e.center,n=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("object"===T(t)&&(e=t,t=void 0),"object"!==T(e))throw new TypeError("options must be an object");var r=e.scale;switch(t){case"row":if(void 0===r)r=function(t){for(var e=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==T(r))throw new TypeError("options must be an object");for(var n=r.random,i=void 0===n?Math.random:n,o=new L(t,e),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==T(r))throw new TypeError("options must be an object");var n=r.min,i=void 0===n?0:n,o=r.max,a=void 0===o?1e3:o,s=r.random,u=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var l=a-i,c=new L(t,e),f=0;f0){if(n.data=[],!(Number.isInteger(r)&&r>0))throw new TypeError("nColumns must be a positive integer");for(var i=0;i>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r>t.get(r,n));return this},t.signPropagatingRightShift=function(t,r){return new e(t).signPropagatingRightShift(r)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(var e=0;e>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r>>t.get(r,n));return this},t.rightShift=function(t,r){return new e(t).rightShift(r)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=n.rows,o=void 0===i?1:i;if(t.length%o!=0)throw new Error("the data length is not divisible by the number of rows");return(r=$t(this,e)).rows=o,r.columns=t.length/o,r.data=t,r}var r,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ee(t,e)}(e,M),r=e,(n=[{key:"set",value:function(t,e,r){var n=this._calculateIndex(t,e);return this.data[n]=r,this}},{key:"get",value:function(t,e){var r=this._calculateIndex(t,e);return this.data[r]}},{key:"_calculateIndex",value:function(t,e){return t*this.columns+e}}])&&Jt(r.prototype,n),i&&Jt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function ne(t){"@babel/helpers - typeof";return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ie(t,e){for(var r=0;rMath.abs(l[o])&&(o=r);if(o!==n){for(i=0;i=0;i--){for(n=0;no?n.set(i,o,t.get(i,o)):i===o?n.set(i,o,1):n.set(i,o,0);return n}},{key:"upperTriangularMatrix",get:function(){for(var t=this.LU,e=t.rows,r=t.columns,n=new L(e,r),i=0;iMath.abs(e)?(r=e/t,Math.abs(t)*Math.sqrt(1+r*r)):0!==e?(r=t/e,Math.abs(e)*Math.sqrt(1+r*r)):0}function ve(t){"@babel/helpers - typeof";return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ge(t,e){for(var r=0;r=0;o--){for(i=0;i=0;r--){for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n,i=(e=le.checkMatrix(e)).rows,o=e.columns,a=r.computeLeftSingularVectors,s=void 0===a||a,u=r.computeRightSingularVectors,l=void 0===u||u,c=r.autoTranspose,f=void 0!==c&&c,h=Boolean(s),p=Boolean(l),d=!1;if(i=0;Z--)if(0!==m[Z]){for(var K=Z+1;K=0;nt--){if(nt0;){var ft=void 0,ht=void 0;for(ft=q-2;ft>=-1&&-1!==ft;ft--){var pt=Number.MIN_VALUE+ct*Math.abs(m[ft]+Math.abs(m[ft+1]));if(Math.abs(w[ft])<=pt||Number.isNaN(w[ft])){w[ft]=0;break}}if(ft===q-2)ht=4;else{var dt=void 0;for(dt=q-1;dt>=ft&&dt!==ft;dt--){var yt=(dt!==q?Math.abs(w[dt]):0)+(dt!==ft+1?Math.abs(w[dt-1]):0);if(Math.abs(m[dt])<=ct*yt){m[dt]=0;break}}dt===ft?ht=3:dt===q-1?ht=1:(ht=2,ft=dt)}switch(ft++,ht){case 1:var vt=w[q-2];w[q-2]=0;for(var gt=q-2;gt>=ft;gt--){var mt=ye(m[gt],vt),bt=m[gt]/mt,xt=vt/mt;if(m[gt]=mt,gt!==ft&&(vt=-xt*w[gt-1],w[gt-1]=bt*w[gt-1]),p)for(var wt=0;wt=m[ft+1]);){var qt=m[ft];if(m[ft]=m[ft+1],m[ft+1]=qt,p&&fte&&i.set(o,a,t.get(o,a)/this.s[a]);for(var s=this.U,u=s.rows,l=s.columns,c=new L(r,u),f=0;ft&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return L.diag(this.s)}}])&&we(e.prototype,r),n&&we(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ee(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=le.checkMatrix(t),e?new Se(t).inverse():ke(t,L.eye(t.rows))}function ke(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=le.checkMatrix(t),e=le.checkMatrix(e),r?new Se(t).solve(e):t.isSquare()?new de(t).solve(e):new be(t).solve(e)}function Te(t){var e,r,n,i,o,a;if((t=L.checkMatrix(t)).isSquare())return 2===t.columns?(e=t.get(0,0),r=t.get(0,1),n=t.get(1,0),e*t.get(1,1)-r*n):3===t.columns?(i=new Nt(t,[1,2],[1,2]),o=new Nt(t,[1,2],[0,2]),a=new Nt(t,[1,2],[0,1]),e=t.get(0,0),r=t.get(0,1),n=t.get(0,2),e*Te(i)-r*Te(o)+n*Te(a)):new de(t).determinant;throw Error("determinant can only be calculated for a square matrix")}function Ce(t,e){for(var r=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:1e-9;if(t>(arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e-9))return new Array(e.rows+1).fill(0);for(var i=e.addRow(r,[0]),o=0;o1&&void 0!==arguments[1]?arguments[1]:{},r=e.thresholdValue,n=void 0===r?1e-9:r,i=e.thresholdError,o=void 0===i?1e-9:i,a=(t=L.checkMatrix(t)).rows,s=new L(a,a),u=0;u1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;t=L.checkMatrix(t);for(var r=new Se(t,{autoTranspose:!0}),n=r.leftSingularVectors,i=r.rightSingularVectors,o=r.diagonal,a=0;ae?o[a]=1/o[a]:o[a]=0;return i.mmul(L.diag(o).mmul(n.transpose()))}function Me(t){"@babel/helpers - typeof";return(Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ie(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new L(t);var n=!1;if("object"!==Me(e)||L.isMatrix(e)||Array.isArray(e)?e=new L(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=r.center;(void 0===i||i)&&(t=t.center("column"),n||(e=e.center("column")));for(var o=t.transpose().mmul(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new L(t);var n=!1;if("object"!==Le(e)||L.isMatrix(e)||Array.isArray(e)?e=new L(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=r,o=i.center,a=void 0===o||o,s=i.scale,u=void 0===s||s;a&&(t.center("column"),n||e.center("column")),u&&(t.scale("column"),n||e.scale("column"));for(var l=t.standardDeviation("column",{unbiased:!0}),c=n?l:e.standardDeviation("column",{unbiased:!0}),f=t.transpose().mmul(e),h=0;h1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=r.assumeSymmetric,i=void 0!==n&&n;if(!(e=le.checkMatrix(e)).isSquare())throw new Error("Matrix is not a square matrix");var o,a,s=e.columns,u=new L(s,s),l=new Float64Array(s),c=new Float64Array(s),f=e;if(!!i||e.isSymmetric()){for(o=0;o0;s--){for(f=0,a=0,l=0;l0&&(o=-o),e[s]=f*o,a-=i*o,r[s-1]=i-o,u=0;ul){0;do{for(1,i=r[l],f=(r[l+1]-i)/(2*e[l]),h=ye(f,1),f<0&&(h=-h),r[l]=e[l]/(f+h),r[l+1]=e[l]*(f+h),p=r[l+1],o=i-r[l],a=l+2;a=l;a--)for(v=y,y=d,b=m,i=d*e[a],o=d*f,h=ye(f,e[a]),e[a+1]=m*h,m=e[a]/h,f=(d=f/h)*r[a]-m*i,r[a+1]=o+m*(d*i+m*r[a]),u=0;u_*w)}r[l]=r[l]+x,e[l]=0}for(a=0;a=l;s--)r[s]=e.get(s,l-1)/c,a+=r[s]*r[s];for(o=Math.sqrt(a),r[l]>0&&(o=-o),a-=r[l]*o,r[l]=r[l]-o,u=l;u=l;s--)i+=r[s]*e.get(s,u);for(i/=a,s=l;s<=f;s++)e.set(s,u,e.get(s,u)-i*r[s])}for(s=0;s<=f;s++){for(i=0,u=f;u>=l;u--)i+=r[u]*e.get(s,u);for(i/=a,u=l;u<=f;u++)e.set(s,u,e.get(s,u)-i*r[u])}r[l]=c*r[l],e.set(l,l-1,c*o)}}for(s=0;s=1;l--)if(0!==e.get(l,l-1)){for(s=l+1;s<=f;s++)r[s]=e.get(s,l-1);for(u=l;u<=f;u++){for(o=0,s=l;s<=f;s++)o+=r[s]*n.get(s,u);for(o=o/r[l]/e.get(l,l-1),s=l;s<=f;s++)n.set(s,u,n.get(s,u)+o*r[s])}}}(s,h,p,u),function(t,e,r,n,i){var o,a,s,u,l,c,f,h,p,d,y,v,g,m,b,x=t-1,w=t-1,_=Number.EPSILON,S=0,E=0,k=0,T=0,C=0,O=0,A=0,P=0;for(o=0;ow)&&(r[o]=i.get(o,o),e[o]=0),a=Math.max(o-1,0);a=0;){for(u=x;u>0&&(0===(O=Math.abs(i.get(u-1,u-1))+Math.abs(i.get(u,u)))&&(O=E),!(Math.abs(i.get(u,u-1))<_*O));)u--;if(u===x)i.set(x,x,i.get(x,x)+S),r[x]=i.get(x,x),e[x]=0,x--,P=0;else if(u===x-1){if(f=i.get(x,x-1)*i.get(x-1,x),k=(i.get(x-1,x-1)-i.get(x,x))/2,T=k*k+f,A=Math.sqrt(Math.abs(T)),i.set(x,x,i.get(x,x)+S),i.set(x-1,x-1,i.get(x-1,x-1)+S),h=i.get(x,x),T>=0){for(A=k>=0?k+A:k-A,r[x-1]=h+A,r[x]=r[x-1],0!==A&&(r[x]=h-f/A),e[x-1]=0,e[x]=0,h=i.get(x,x-1),O=Math.abs(h)+Math.abs(A),k=h/O,T=A/O,C=Math.sqrt(k*k+T*T),k/=C,T/=C,a=x-1;a0){for(O=Math.sqrt(O),p=u&&(A=i.get(l,l),k=((C=h-A)*(O=p-A)-f)/i.get(l+1,l)+i.get(l,l+1),T=i.get(l+1,l+1)-A-C-O,C=i.get(l+2,l+1),O=Math.abs(k)+Math.abs(T)+Math.abs(C),k/=O,T/=O,C/=O,l!==u)&&!(Math.abs(i.get(l,l-1))*(Math.abs(T)+Math.abs(C))<_*(Math.abs(k)*(Math.abs(i.get(l-1,l-1))+Math.abs(A)+Math.abs(i.get(l+1,l+1)))));)l--;for(o=l+2;o<=x;o++)i.set(o,o-2,0),o>l+2&&i.set(o,o-3,0);for(s=l;s<=x-1&&(m=s!==x-1,s!==l&&(k=i.get(s,s-1),T=i.get(s+1,s-1),C=m?i.get(s+2,s-1):0,0!==(h=Math.abs(k)+Math.abs(T)+Math.abs(C))&&(k/=h,T/=h,C/=h)),0!==h);s++)if(O=Math.sqrt(k*k+T*T+C*C),k<0&&(O=-O),0!==O){for(s!==l?i.set(s,s-1,-O*h):u!==l&&i.set(s,s-1,-i.get(s,s-1)),h=(k+=O)/O,p=T/O,A=C/O,T/=k,C/=k,a=s;a=0;x--)if(k=r[x],0===(T=e[x]))for(u=x,i.set(x,x,1),o=x-1;o>=0;o--){for(f=i.get(o,o)-k,C=0,a=u;a<=x;a++)C+=i.get(o,a)*i.get(a,x);if(e[o]<0)A=f,O=C;else if(u=o,0===e[o]?i.set(o,x,0!==f?-C/f:-C/(_*E)):(h=i.get(o,o+1),p=i.get(o+1,o),T=(r[o]-k)*(r[o]-k)+e[o]*e[o],c=(h*O-A*C)/T,i.set(o,x,c),i.set(o+1,x,Math.abs(h)>Math.abs(A)?(-C-f*c)/h:(-O-p*c)/A)),c=Math.abs(i.get(o,x)),_*c*c>1)for(a=o;a<=x;a++)i.set(a,x,i.get(a,x)/c)}else if(T<0)for(u=x-1,Math.abs(i.get(x,x-1))>Math.abs(i.get(x-1,x))?(i.set(x-1,x-1,T/i.get(x,x-1)),i.set(x-1,x,-(i.get(x,x)-k)/i.get(x,x-1))):(b=Fe(0,-i.get(x-1,x),i.get(x-1,x-1)-k,T),i.set(x-1,x-1,b[0]),i.set(x-1,x,b[1])),i.set(x,x-1,0),i.set(x,x,1),o=x-2;o>=0;o--){for(d=0,y=0,a=u;a<=x;a++)d+=i.get(o,a)*i.get(a,x-1),y+=i.get(o,a)*i.get(a,x);if(f=i.get(o,o)-k,e[o]<0)A=f,C=d,O=y;else if(u=o,0===e[o]?(b=Fe(-d,-y,f,T),i.set(o,x-1,b[0]),i.set(o,x,b[1])):(h=i.get(o,o+1),p=i.get(o+1,o),v=(r[o]-k)*(r[o]-k)+e[o]*e[o]-T*T,g=2*(r[o]-k)*T,0===v&&0===g&&(v=_*E*(Math.abs(f)+Math.abs(T)+Math.abs(h)+Math.abs(p)+Math.abs(A))),b=Fe(h*C-A*d+T*y,h*O-A*y-T*d,v,g),i.set(o,x-1,b[0]),i.set(o,x,b[1]),Math.abs(h)>Math.abs(A)+Math.abs(T)?(i.set(o+1,x-1,(-d-f*i.get(o,x-1)+T*i.get(o,x))/h),i.set(o+1,x,(-y-f*i.get(o,x)-T*i.get(o,x-1))/h)):(b=Fe(-C-p*i.get(o,x-1),-O-p*i.get(o,x),A,T),i.set(o+1,x-1,b[0]),i.set(o+1,x,b[1]))),c=Math.max(Math.abs(i.get(o,x-1)),Math.abs(i.get(o,x))),_*c*c>1)for(a=o;a<=x;a++)i.set(a,x-1,i.get(a,x-1)/c),i.set(a,x,i.get(a,x)/c)}for(o=0;ow)for(a=o;a=0;a--)for(o=0;o<=w;o++){for(A=0,s=0;s<=Math.min(a,w);s++)A+=n.get(o,s)*i.get(s,a);n.set(o,a,A)}}(s,c,l,u,h)}this.n=s,this.e=c,this.d=l,this.V=u}var e,r,n;return e=t,(r=[{key:"realEigenvalues",get:function(){return Array.from(this.d)}},{key:"imaginaryEigenvalues",get:function(){return Array.from(this.e)}},{key:"eigenvectorMatrix",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){var t,e,r=this.n,n=this.e,i=this.d,o=new L(r,r);for(t=0;t0?o.set(t,t+1,n[t]):n[t]<0&&o.set(t,t-1,n[t])}return o}}])&&Re(e.prototype,r),n&&Re(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Fe(t,e,r,n){var i,o;return Math.abs(r)>Math.abs(n)?[(t+(i=n/r)*e)/(o=r+i*n),(e-i*t)/o]:[((i=r/n)*t+e)/(o=n+i*r),(i*e-t)/o]}function ze(t){"@babel/helpers - typeof";return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ue(t,e){for(var r=0;r0,s.set(n,n,Math.sqrt(Math.max(l,0))),i=n+1;i=0;o--)for(i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=le.checkMatrix(e);var n,i=r.Y,o=r.scaleScores,a=void 0!==o&&o,s=r.maxIterations,u=void 0===s?1e3:s,l=r.terminationCriteria,c=void 0===l?1e-10:l;if(i){if(!(i=Array.isArray(i)&&"number"==typeof i[0]?L.columnVector(i):le.checkMatrix(i)).isColumnVector()||i.rows!==e.rows)throw new Error("Y must be a column vector of length X.rows");n=i}else n=e.getColumnVector(0);for(var f,h,p,d,y=1,v=0;vc;v++)p=(p=e.transpose().mmul(n).div(n.transpose().mmul(n).get(0,0))).div(p.norm()),f=e.mmul(p).div(p.transpose().mmul(p).get(0,0)),v>0&&(y=f.clone().sub(d).pow(2).sum()),d=f.clone(),i?(h=(h=i.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0))).div(h.norm()),n=i.mmul(h).div(h.transpose().mmul(h).get(0,0))):n=f;if(i){var g=e.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0));g=g.div(g.norm());var m=e.clone().sub(f.clone().mmul(g.transpose())),b=n.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0)),x=i.clone().sub(f.clone().mulS(b.get(0,0)).mmul(h.transpose()));this.t=f,this.p=g.transpose(),this.w=p.transpose(),this.q=h,this.u=n,this.s=f.transpose().mmul(f),this.xResidual=m,this.yResidual=x,this.betas=b}else this.w=p.transpose(),this.s=f.transpose().mmul(f).sqrt(),this.t=a?f.clone().div(this.s.get(0,0)):f,this.xResidual=e.sub(f.mmul(p.transpose()))})},2128:function(t,e,r){"use strict";r.d(e,{Dg:function(){return l},lh:function(){return s},m$:function(){return o},vs:function(){return u},zu:function(){return a}});var n=r(8610),i=r(8699);function o(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromTranslation(i,r),n.multiply(t,i,e)}function a(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromRotation(i,r),n.multiply(t,i,e)}function s(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromScaling(i,r),n.multiply(t,i,e)}function u(t,e){for(var r,i,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,f=e.length;c=0;return r?o?2*Math.PI-n:n:o?n:2*Math.PI-n}},7592:function(t,e,r){"use strict";var n=r(2917);function i(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromTranslation(i,r),n.mat3.multiply(t,i,e)}function o(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromRotation(i,r),n.mat3.multiply(t,i,e)}function a(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromScaling(i,r),n.mat3.multiply(t,i,e)}function s(t,e){return t[0]*e[1]-e[0]*t[1]}e.vs=function(t,e){for(var r,s,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,f=e.length;c1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}(0,n.each)(t,function(e,r){isNaN(e)||(t[r]=+e)}),e[r]=t}),e):void 0},s=r(8699);var u=function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=[[0,0],[1,1]]);for(var n=!!e,i=[],o=0,a=t.length;o2&&(r.push([n].concat(o.splice(0,2))),a="l",n="m"===n?"l":"L"),"o"===a&&1===o.length&&r.push([n,o[0]]),"r"===a)r.push([n].concat(o));else for(;o.length>=e[a]&&(r.push([n].concat(o.splice(0,e[a]))),e[a]););return""}),r}var p=/[a-z]/;function d(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function y(t){var e=h(t);if(!e||!e.length)return[["M",0,0]];for(var r=!1,n=0;n=0){r=!0;break}}if(!r)return e;var o=[],a=0,s=0,u=0,l=0,c=0,f=e[0];"M"!==f[0]&&"m"!==f[0]||(u=a=+f[1],l=s=+f[2],c++,o[0]=["M",a,s]);n=c;for(var y=e.length;n1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var y=r*r*(p*p)+i*i*(h*h),v=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var x=i?v*r*p/i:0,w=r?v*-i*h/r:0,_=(u+c)/2+Math.cos(o)*x-Math.sin(o)*w,S=(l+f)/2+Math.sin(o)*x+Math.cos(o)*w,E=[(h-x)/r,(p-w)/i],k=[(-1*h-x)/r,(-1*p-w)/i],T=m([1,0],E),C=m(E,k);return g(E,k)<=-1&&(C=Math.PI),g(E,k)>=1&&(C=0),0===s&&C>0&&(C-=2*Math.PI),1===s&&C<0&&(C+=2*Math.PI),{cx:_,cy:S,rx:b(t,[c,f])?0:r,ry:b(t,[c,f])?0:i,startAngle:T,endAngle:T+C,xRotation:o,arcFlag:a,sweepFlag:s}}function w(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function _(t){for(var e=[],r=null,n=null,i=null,o=0,s=(t=a(t)).length,u=0;u0!=E(s[1]-r)>0&&E(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var C=function(t,e,r){return t>=e&&t<=r};function O(t){for(var e=[],r=t.length,n=0;n1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function A(t,e){var r=!1;return(0,n.each)(t,function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;C(h,0,1)&&C(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function P(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function M(t,e){if(t.length<2||e.length<2)return!1;var r,i,o=P(t),a=P(e);if(r=o,(i=a).minX>r.maxX||i.maxXr.maxY||i.maxY-1},o=function(t,e){if(!n(t))return t;for(var r=[],i=0;i-1;)A.call(t,o,1);return t},I=Array.prototype.splice,L=function(t,e){if(!n(t))return[];for(var r=t?e.length:0,i=r-1;r--;){var o=void 0,a=e[r];r!==i&&a===o||(o=a,I.call(t,a,1))}return t},j=function(t,e,r){if(!f(t)&&!b(t))return t;var n=r;return d(t,function(t,r){n=e(n,t,r)}),n},N=function(t,e){var r=[];if(!n(t))return r;for(var i=-1,o=[],a=t.length;++ie[i])return 1;if(t[i]r?r:t},nt=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},it=function(t){return u(t,"Number")},ot=function(t){return it(t)&&t%1!=0},at=function(t){return it(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return it(t)&&t%1==0},ut=function(t){return it(t)&&t<0},lt=1e-5;function ct(t,e,r){return void 0===r&&(r=lt),Math.abs(t-e)0},pt=function(t,e){if(f(t)){for(var r,n=-1/0,i=0;in&&(r=o,n=a)}return r}},dt=function(t,e){if(f(t)){for(var r,n=1/0,i=0;ie?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},me=function(t){return n(t)?Array.prototype.slice.call(t):[]},be={},xe=function(t){return be[t=t||"g"]?be[t]+=1:be[t]=1,t+be[t]},we=function(){},_e=function(t){return t};function Se(t){return c(t)?0:n(t)?t.length:Object.keys(t).length}var Ee,ke=r(7582),Te=$t(function(t,e){void 0===e&&(e={});var r=e.fontSize,n=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Ee||(Ee=document.createElement("canvas").getContext("2d")),Ee.font=[o,a,i,r+"px",n].join(" "),Ee.measureText(R(t)?t:"").width},function(t,e){return void 0===e&&(e={}),(0,ke.__spreadArrays)([t],Et(e)).join("")}),Ce=function(t,e,r,n){void 0===n&&(n="...");var i,o,a=Te(n,r),s=R(t)?t:Tt(t),u=e,l=[];if(Te(t,r)<=e)return t;for(;i=s.substr(0,16),!((o=Te(i,r))+a>u&&o>u);)if(l.push(i),u-=o,!(s=s.substr(16)))return l.join("");for(;i=s.substr(0,1),!((o=Te(i,r))+a>u);)if(l.push(i),u-=o,!(s=s.substr(1)))return l.join("");return""+l.join("")+n},Oe=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},7380:function(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},9289:function(t,e,r){var n=r(7380),i=r(344),o=Object.hasOwnProperty,a=Object.create(null);for(var s in n)o.call(n,s)&&(a[n[s]]=s);var u=t.exports={to:{},get:{}};function l(t,e,r){return Math.min(Math.max(e,t),r)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,r;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),r="hsl";break;case"hwb":e=u.get.hwb(t),r="hwb";break;default:e=u.get.rgb(t),r="rgb"}return e?{model:r,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,r,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],r=0;r<3;r++){var s=2*r;a[r]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],r=0;r<3;r++)a[r]=parseInt(e[r]+e[r],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)a[r]=parseInt(e[r+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(n,e[1])?((a=n[e[1]])[3]=1,a):null:null;for(r=0;r<3;r++)a[r]=Math.round(2.55*parseFloat(e[r+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(r=0;r<3;r++)a[r]=l(a[r],0,255);return a[3]=l(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(r)?1:r,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(r)?1:r,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},9630:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(9289),o=r(738),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach(function(t){u[a.call(o[t].labels).sort().join("")]=t});var l={};function c(t,e){if(!(this instanceof c))return new c(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var r,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof c)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var f=i.get(t);if(null===f)throw new Error("Unable to parse color from string: "+t);this.model=f.model,n=o[this.model].channels,this.color=f.value.slice(0,n),this.valpha="number"==typeof f.value[n]?f.value[n]:1}else if(t.length){this.model=e||"rgb",n=o[this.model].channels;var h=a.call(t,0,n);this.color=p(h,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var y=d.sort().join("");if(!(y in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[y];var v=o[this.model].labels,g=[];for(r=0;rr?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return c.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+n(t));var r=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=r.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,l=1-u;return c.rgb(u*r.red()+l*i.red(),u*r.green()+l*i.green(),u*r.blue()+l*i.blue(),r.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach(function(t){if(-1===s.indexOf(t)){var e=o[t].channels;c.prototype[t]=function(){if(this.model===t)return new c(this);if(arguments.length)return new c(arguments,t);var r,n="number"==typeof arguments[e]?e:this.valpha;return new c((r=o[this.model][t].raw(this.color),Array.isArray(r)?r:[r]).concat(n),t)},c[t]=function(r){return"number"==typeof r&&(r=p(a.call(arguments),e)),new c(r,t)}}}),t.exports=c},6786:function(t,e,r){var n=r(1719),i={};for(var o in n)n.hasOwnProperty(o)&&(i[n[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:l})}a.rgb.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a;return s===a?e=0:n===s?e=(i-o)/u:i===s?e=2+(o-n)/u:o===s&&(e=4+(n-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(a+s)/2,[e,100*(s===a?0:r<=.5?u/(s+a):u/(2-s-a)),100*r]},a.rgb.hsv=function(t){var e,r,n,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,l=Math.max(a,s,u),c=l-Math.min(a,s,u),f=function(t){return(l-t)/6/c+.5};return 0===c?i=o=0:(o=c/l,e=f(a),r=f(s),n=f(u),a===l?i=n-r:s===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*l]},a.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},a.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-i)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var r,o,a,s=1/0;for(var u in n)if(n.hasOwnProperty(u)){var l=n[u],c=(o=t,a=l,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));c.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),r=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,r,n,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var l=0;l<3;l++)(n=a+1/3*-(l-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[l]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,i*=o<=1?o:2-o,[e,100*(0===n?2*i/(o+i):2*r/(n+r)),100*((n+r)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,a];case 1:return[s,n,a];case 2:return[a,n,u];case 3:return[a,s,n];case 4:return[u,a,n];case 5:return[n,a,s]}},a.hsv.hsl=function(t){var e,r,n,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return n=(2-o)*a,r=o*s,[i,100*(r=(r/=(e=(2-o)*s)<=1?e:2-e)||0),100*(n/=2)]},a.hwb.rgb=function(t){var e,r,n,i,o,a,s,u=t[0]/360,l=t[1]/100,c=t[2]/100,f=l+c;switch(f>1&&(l/=f,c/=f),r=1-c,n=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(n=1-n),i=l+n*(r-l),e){default:case 6:case 0:o=r,a=i,s=l;break;case 1:o=i,a=r,s=l;break;case 2:o=l,a=r,s=i;break;case 3:o=l,a=i,s=r;break;case 4:o=i,a=l,s=r;break;case 5:o=r,a=l,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(t){var e,r,n,i=t[0]/100,o=t[1]/100,a=t[2]/100;return r=-.9689*i+1.8758*o+.0415*a,n=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(t){var e,r,n,i=t[0],o=t[1],a=t[2];e=o/500+(r=(i+16)/116),n=r-a/200;var s=Math.pow(r,3),u=Math.pow(e,3),l=Math.pow(n,3);return r=s>.008856?s:(r-16/116)/7.787,e=u>.008856?u:(e-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},a.lab.lch=function(t){var e,r=t[0],n=t[1],i=t[2];return(e=360*Math.atan2(i,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+i*i),e]},a.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map(function(t){return t+t}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.max(Math.max(n,i),o),s=Math.min(Math.min(n,i),o),u=a-s;return e=u<1?s/(1-u):0,r=u<=0?0:a===n?(i-o)/u%6:a===i?2+(o-n)/u:4+(n-i)/u+4,r/=6,[360*(r%=1),100*u,100*e]},a.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return(n=r<.5?2*e*r:2*e*(1-r))<1&&(i=(r-.5*n)/(1-n)),[t[0],100*n,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-r)*n,[255*(r*o[0]+i),255*(r*o[1]+i),255*(r*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},a.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},a.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},a.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},738:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(6786),o=r(2511),a={};Object.keys(i).forEach(function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach(function(r){var i=e[r];a[t][r]=function(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"===n(r))for(var i=r.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)})}),t.exports=a},2511:function(t,e,r){var n=r(6786);function i(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,i=0;ic;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((t||c in u)&&u[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},2177:function(t,e,r){var n=r(9738),i=n({}.toString),o=n("".slice);t.exports=function(t){return o(i(t),8,-1)}},9029:function(t,e,r){var n=r(1675),i=r(9402),o=r(7238),a=r(704);t.exports=function(t,e,r){for(var s=i(e),u=a.f,l=o.f,c=0;c0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),t.exports=i},8525:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},7926:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(5835),o=r(7238).f,a=r(8268),s=r(7454),u=r(161),l=r(9029),c=r(3175);t.exports=function(t,e){var r,f,h,p,d,y=t.target,v=t.global,g=t.stat;if(r=v?i:g?i[y]||u(y,{}):(i[y]||{}).prototype)for(f in e){if(p=e[f],h=t.dontCallGetSet?(d=o(r,f))&&d.value:r[f],!c(v?f:y+(g?".":"#")+f,t.forced)&&void 0!==h){if(n(p)==n(h))continue;l(p,h)}(t.sham||h&&h.sham)&&a(p,"sham",!0),s(r,f,p,t)}}},6583:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},9096:function(t,e,r){var n=r(6583);t.exports=!n(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},5057:function(t,e,r){var n=r(9096),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},1864:function(t,e,r){var n=r(6539),i=r(1675),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,l=s&&(!n||n&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:l}},9738:function(t,e,r){var n=r(9096),i=Function.prototype,o=i.call,a=n&&i.bind.bind(o,o);t.exports=n?a:function(t){return function(){return o.apply(t,arguments)}}},8078:function(t,e,r){var n=r(5835),i=r(729);t.exports=function(t,e){return arguments.length<2?(r=n[t],i(r)?r:void 0):n[t]&&n[t][e];var r}},2337:function(t,e,r){var n=r(5980),i=r(6254);t.exports=function(t,e){var r=t[e];return i(r)?void 0:n(r)}},5835:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(t){return t&&t.Math==Math&&t};t.exports=i("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||i("object"==("undefined"==typeof window?"undefined":n(window))&&window)||i("object"==("undefined"==typeof self?"undefined":n(self))&&self)||i("object"==(void 0===r.g?"undefined":n(r.g))&&r.g)||function(){return this}()||this||Function("return this")()},1675:function(t,e,r){var n=r(9738),i=r(5825),o=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},940:function(t){t.exports={}},2175:function(t,e,r){var n=r(6539),i=r(6583),o=r(3343);t.exports=!n&&!i(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},5407:function(t,e,r){var n=r(9738),i=r(6583),o=r(2177),a=Object,s=n("".split);t.exports=i(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"==o(t)?s(t,""):a(t)}:a},6111:function(t,e,r){var n=r(9738),i=r(729),o=r(9700),a=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},4751:function(t,e,r){var n,i,o,a=r(9801),s=r(5835),u=r(691),l=r(8268),c=r(1675),f=r(9700),h=r(7307),p=r(940),d=s.TypeError,y=s.WeakMap;if(a||f.state){var v=f.state||(f.state=new y);v.get=v.get,v.has=v.has,v.set=v.set,n=function(t,e){if(v.has(t))throw d("Object already initialized");return e.facade=t,v.set(t,e),e},i=function(t){return v.get(t)||{}},o=function(t){return v.has(t)}}else{var g=h("state");p[g]=!0,n=function(t,e){if(c(t,g))throw d("Object already initialized");return e.facade=t,l(t,g,e),e},i=function(t){return c(t,g)?t[g]:{}},o=function(t){return c(t,g)}}t.exports={set:n,get:i,has:o,enforce:function(t){return o(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=i(e)).type!==t)throw d("Incompatible receiver, "+t+" required");return r}}}},729:function(t,e,r){var n=r(9967),i=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},3175:function(t,e,r){var n=r(6583),i=r(729),o=/#|\.prototype\./,a=function(t,e){var r=u[s(t)];return r==c||r!=l&&(i(e)?n(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},6254:function(t){t.exports=function(t){return null===t||void 0===t}},691:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(729),o=r(9967),a=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:i(t)||t===a}:function(t){return"object"==n(t)?null!==t:i(t)}},1437:function(t){t.exports=!1},4192:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(8078),o=r(729),a=r(5522),s=r(7860),u=Object;t.exports=s?function(t){return"symbol"==n(t)}:function(t){var e=i("Symbol");return o(e)&&a(e.prototype,u(t))}},6803:function(t,e,r){var n=r(5108);t.exports=function(t){return n(t.length)}},7948:function(t,e,r){var n=r(9738),i=r(6583),o=r(729),a=r(1675),s=r(6539),u=r(1864).CONFIGURABLE,l=r(6111),c=r(4751),f=c.enforce,h=c.get,p=String,d=Object.defineProperty,y=n("".slice),v=n("".replace),g=n([].join),m=s&&!i(function(){return 8!==d(function(){},"length",{value:8}).length}),b=String(String).split("String"),x=t.exports=function(t,e,r){"Symbol("===y(p(e),0,7)&&(e="["+v(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(s?d(t,"name",{value:e,configurable:!0}):t.name=e),m&&r&&a(r,"arity")&&t.length!==r.arity&&d(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=f(t);return a(n,"source")||(n.source=g(b,"string"==typeof e?e:"")),t};Function.prototype.toString=x(function(){return o(this)&&h(this).source||l(this)},"toString")},4920:function(t){var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},7328:function(t,e,r){"use strict";var n=r(6539),i=r(9738),o=r(5057),a=r(6583),s=r(5403),u=r(7485),l=r(5339),c=r(5825),f=r(5407),h=Object.assign,p=Object.defineProperty,d=i([].concat);t.exports=!h||a(function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(t){e[t]=t}),7!=h({},t)[r]||"abcdefghijklmnopqrst"!=s(h({},e)).join("")})?function(t,e){for(var r=c(t),i=arguments.length,a=1,h=u.f,p=l.f;i>a;)for(var y,v=f(arguments[a++]),g=h?d(s(v),h(v)):s(v),m=g.length,b=0;m>b;)y=g[b++],n&&!o(p,v,y)||(r[y]=v[y]);return r}:h},704:function(t,e,r){var n=r(6539),i=r(2175),o=r(4821),a=r(7563),s=r(9737),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor;e.f=n?o?function(t,e,r){if(a(t),e=s(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=c(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return l(t,e,r)}:l:function(t,e,r){if(a(t),e=s(e),a(r),i)try{return l(t,e,r)}catch(t){}if("get"in r||"set"in r)throw u("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},7238:function(t,e,r){var n=r(6539),i=r(5057),o=r(5339),a=r(4925),s=r(6462),u=r(9737),l=r(1675),c=r(2175),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=s(t),e=u(e),c)try{return f(t,e)}catch(t){}if(l(t,e))return a(!i(o.f,t,e),t[e])}},5454:function(t,e,r){var n=r(497),i=r(8525).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},7485:function(t,e){e.f=Object.getOwnPropertySymbols},5522:function(t,e,r){var n=r(9738);t.exports=n({}.isPrototypeOf)},497:function(t,e,r){var n=r(9738),i=r(1675),o=r(6462),a=r(8632).indexOf,s=r(940),u=n([].push);t.exports=function(t,e){var r,n=o(t),l=0,c=[];for(r in n)!i(s,r)&&i(n,r)&&u(c,r);for(;e.length>l;)i(n,r=e[l++])&&(~a(c,r)||u(c,r));return c}},5403:function(t,e,r){var n=r(497),i=r(8525);t.exports=Object.keys||function(t){return n(t,i)}},5339:function(t,e){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);e.f=i?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},2821:function(t,e,r){var n=r(5057),i=r(729),o=r(691),a=TypeError;t.exports=function(t,e){var r,s;if("string"===e&&i(r=t.toString)&&!o(s=n(r,t)))return s;if(i(r=t.valueOf)&&!o(s=n(r,t)))return s;if("string"!==e&&i(r=t.toString)&&!o(s=n(r,t)))return s;throw a("Can't convert object to primitive value")}},9402:function(t,e,r){var n=r(8078),i=r(9738),o=r(5454),a=r(7485),s=r(7563),u=i([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=o.f(s(t)),r=a.f;return r?u(e,r(t)):e}},97:function(t,e,r){var n=r(5835);t.exports=n},1894:function(t,e,r){var n=r(6254),i=TypeError;t.exports=function(t){if(n(t))throw i("Can't call method on "+t);return t}},7307:function(t,e,r){var n=r(5464),i=r(6065),o=n("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},9700:function(t,e,r){var n=r(5835),i=r(161),o=n["__core-js_shared__"]||i("__core-js_shared__",{});t.exports=o},5464:function(t,e,r){var n=r(1437),i=r(9700);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.0",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4993:function(t,e,r){var n=r(9282),i=r(6583),o=r(5835).String;t.exports=!!Object.getOwnPropertySymbols&&!i(function(){var t=Symbol();return!o(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41})},5333:function(t,e,r){var n=r(1087),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},6462:function(t,e,r){var n=r(5407),i=r(1894);t.exports=function(t){return n(i(t))}},1087:function(t,e,r){var n=r(4920);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},5108:function(t,e,r){var n=r(1087),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},5825:function(t,e,r){var n=r(1894),i=Object;t.exports=function(t){return i(n(t))}},1044:function(t,e,r){var n=r(5057),i=r(691),o=r(4192),a=r(2337),s=r(2821),u=r(3121),l=TypeError,c=u("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var r,u=a(t,c);if(u){if(void 0===e&&(e="default"),r=n(u,t,e),!i(r)||o(r))return r;throw l("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},9737:function(t,e,r){var n=r(1044),i=r(4192);t.exports=function(t){var e=n(t,"string");return i(e)?e:e+""}},8434:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},6065:function(t,e,r){var n=r(9738),i=0,o=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},7860:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(4993);t.exports=i&&!Symbol.sham&&"symbol"==n(Symbol.iterator)},4821:function(t,e,r){var n=r(6539),i=r(6583);t.exports=n&&i(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},9801:function(t,e,r){var n=r(5835),i=r(729),o=n.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},5336:function(t,e,r){var n=r(97),i=r(1675),o=r(8384),a=r(704).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},8384:function(t,e,r){var n=r(3121);e.f=n},3121:function(t,e,r){var n=r(5835),i=r(5464),o=r(1675),a=r(6065),s=r(4993),u=r(7860),l=n.Symbol,c=i("wks"),f=u?l.for||l:l&&l.withoutSetter||a;t.exports=function(t){return o(c,t)||(c[t]=s&&o(l,t)?l[t]:f("Symbol."+t)),c[t]}},7422:function(t,e,r){var n=r(7926),i=r(7328);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},4835:function(t,e,r){r(5336)("asyncIterator")},6727:function(t,e,r){var n=r(879);t.exports=n},8690:function(t,e,r){var n=r(3723);t.exports=n},918:function(t,e,r){"use strict";function n(t,e){var r,n=1;function i(){var i,o,a=r.length,s=0,u=0;for(i=0;ip+c||id+c||of.index){var h=p-s.x-s.vx,g=d-s.y-s.vy,m=h*h+g*g;mt.r&&(t.r=t[e].r)}function p(){if(e){var n,i,o=e.length;for(r=new Array(o),n=0;n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var r,n,i=new Array(r),o=0;o1?(null==r?u.delete(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,o,a,s,u,l=0,c=t.length;for(null==n?n=1/0:n*=n,l=0;l1?(c.on(t,r),e):c.on(t)}}}function A(){var t,e,r,n,s,u=o(-30),l=1,c=1/0,f=.81;function h(r){var o,a=t.length,s=(0,i.Z)(t,E,k).visitAfter(d);for(n=r,o=0;o=c)){(t.data!==e||t.next)&&(0===h&&(y+=(h=a(r))*h),0===p&&(y+=(p=a(r))*p),y=(o=(y+g)/2))?y=o:g=o,(c=r>=(a=(v+m)/2))?v=a:m=a,i=p,!(p=p[f=c<<1|l]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&r===u)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(y+g)/2))?y=o:g=o,(c=r>=(a=(v+m)/2))?v=a:m=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function i(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function o(t){return t[0]}function a(t){return t[1]}function s(t,e,r){var n=new u(null==e?o:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function u(t,e,r,n,i,o){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function l(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}r.d(e,{Z:function(){return s}});var c=s.prototype=u.prototype;c.copy=function(){var t,e,r=new u(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},c.add=function(t){var e=+this._x.call(null,t),r=+this._y.call(null,t);return n(this.cover(e,r),e,r,t)},c.addAll=function(t){var e,r,i,o,a=t.length,s=new Array(a),u=new Array(a),l=1/0,c=1/0,f=-1/0,h=-1/0;for(r=0;rf&&(f=i),oh&&(h=o));if(l>f||c>h)return this;for(this.cover(l,c).cover(f,h),r=0;rt||t>=i||n>e||e>=o;)switch(s=(ep||(a=l.y0)>d||(s=l.x1)=m)<<1|t>=g)&&(l=y[y.length-1],y[y.length-1]=y[y.length-1-c],y[y.length-1-c]=l)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),w=b*b+x*x;if(w=(s=(d+v)/2))?d=s:v=s,(c=a>=(u=(y+g)/2))?y=u:g=u,e=p,!(p=p[f=c<<1|l]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},c.removeAll=function(t){for(var e=0,r=t.length;e=0&&e._call.call(null,t),e=e._next;--a}()}finally{a=0,function(){var t,e,r=i,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:i=e);o=t,w(n)}(),f=0}}function x(){var t=p.now(),e=t-c;e>l&&(h-=e,c=t)}function w(t){a||(s&&(s=clearTimeout(s)),t-f>24?(t<1/0&&(s=setTimeout(b,t-p.now()-h)),u&&(u=clearInterval(u))):(u||(c=p.now(),u=setInterval(x,l)),a=1,d(b)))}g.prototype=m.prototype={constructor:g,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?y():+r)+(null==e?0:+e),this._next||o===this||(o?o._next=this:i=this,o=this),this._call=t,this._time=r,w()},stop:function(){this._call&&(this._call=null,this._time=1/0,w())}}},7628:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=l(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function i(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e,r){return e=a(e),function(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,a=JSON.parse(JSON.stringify(o)),s=(null===(t=null==i?void 0:i.graph)||void 0===t?void 0:t.meta)||{},u=(null===(e=null==i?void 0:i.subScene)||void 0===e?void 0:e.meta)||{},l=(null===(r=null==i?void 0:i.nodeSize)||void 0===r?void 0:r.meta)||{},c=(null===(n=null==i?void 0:i.nodeSize)||void 0===n?void 0:n.node)||{},f=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,s)},subScene:{meta:Object.assign(a.subScene.meta,u)},nodeSize:{meta:Object.assign(a.nodeSize.meta,l),node:Object.assign(a.nodeSize.node,c),bridge:f}}}function m(t){return"◬".concat(t,"◬")}var b,x,w,_,S=m("ROOT"),E=m("BRIDGE_GRAPH");!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(b||(b={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(x||(x={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(w||(w={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(_||(_={}));var k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function T(t,e){return t(e={exports:{}},e.exports),e.exports}var C=function(t,e){return t===e||t!=t&&e!=e},O=function(t,e){for(var r=t.length;r--;)if(C(t[r][0],e))return r;return-1},A=Array.prototype.splice;function P(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1},P.prototype.set=function(t,e){var r=this.__data__,n=O(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var M,I=P,L="object"==y(k)&&k&&k.Object===Object&&k,j="object"==("undefined"==typeof self?"undefined":y(self))&&self&&self.Object===Object&&self,N=L||j||Function("return this")(),R=N.Symbol,D=Object.prototype,B=D.hasOwnProperty,F=D.toString,z=R?R.toStringTag:void 0,U=Object.prototype.toString,G=R?R.toStringTag:void 0,V=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":G&&G in Object(t)?function(t){var e=B.call(t,z),r=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);return n&&(e?t[z]=r:delete t[z]),i}(t):function(t){return U.call(t)}(t)},H=function(t){var e=y(t);return null!=t&&("object"==e||"function"==e)},W=function(t){if(!H(t))return!1;var e=V(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},q=N["__core-js_shared__"],Y=(M=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",X=Function.prototype.toString,Z=function(t){if(null!=t){try{return X.call(t)}catch(t){}try{return t+""}catch(t){}}return""},K=/^\[object .+?Constructor\]$/,J=Function.prototype,Q=Object.prototype,$=J.toString,tt=Q.hasOwnProperty,et=RegExp("^"+$.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=function(t){return!(!H(t)||function(t){return!!Y&&Y in t}(t))&&(W(t)?et:K).test(Z(t))},nt=function(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return rt(r)?r:void 0},it=nt(N,"Map"),ot=nt(Object,"create"),at=Object.prototype.hasOwnProperty,st=Object.prototype.hasOwnProperty;function ut(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;var jt=function(t){return function(e){return t(e)}},Nt=T(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,i=n&&n.exports===r&&L.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o}),Rt=Nt&&Nt.isTypedArray,Dt=Rt?jt(Rt):function(t){return wt(t)&&It(t.length)&&!!Lt[V(t)]},Bt=Object.prototype.hasOwnProperty,Ft=function(t,e){var r=Ct(t),n=!r&&Tt(t),i=!r&&!n&&At(t),o=!r&&!n&&!i&&Dt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++rs))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,h=!0,p=2&r?new qe:void 0;for(o.set(t,e),o.set(e,t);++f0&&n(u)?r>1?t(u,r-1,n,i,o):ie(o,u):i||(o[o.length]=u)}return o},on=Math.max,an=function(t,e,r){return e=on(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=on(n.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(sn),cn=function(t,e){return ln(an(t,e,Ue),t+"")},fn=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o-1},dn=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n=200){var l=e?null:yn(t);if(l)return Je(l);a=!1,i=Xe,u=new qe}else u=e?[]:s;t:for(;++no){var a=i;i=o,o=a}return i+""+o+""+(bn.isUndefined(n)?"\0":n)}function kn(t,e){return En(t,e.v,e.w,e.name)}wn.prototype._nodeCount=0,wn.prototype._edgeCount=0,wn.prototype.isDirected=function(){return this._isDirected},wn.prototype.isMultigraph=function(){return this._isMultigraph},wn.prototype.isCompound=function(){return this._isCompound},wn.prototype.setGraph=function(t){return this._label=t,this},wn.prototype.graph=function(){return this._label},wn.prototype.setDefaultNodeLabel=function(t){return bn.isFunction(t)||(t=bn.constant(t)),this._defaultNodeLabelFn=t,this},wn.prototype.nodeCount=function(){return this._nodeCount},wn.prototype.nodes=function(){return bn.keys(this._nodes)},wn.prototype.sources=function(){var t=this;return bn.filter(this.nodes(),function(e){return bn.isEmpty(t._in[e])})},wn.prototype.sinks=function(){var t=this;return bn.filter(this.nodes(),function(e){return bn.isEmpty(t._out[e])})},wn.prototype.setNodes=function(t,e){var r=arguments,n=this;return bn.each(t,function(t){r.length>1?n.setNode(t,e):n.setNode(t)}),this},wn.prototype.setNode=function(t,e){return bn.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},wn.prototype.node=function(t){return this._nodes[t]},wn.prototype.hasNode=function(t){return bn.has(this._nodes,t)},wn.prototype.removeNode=function(t){var e=this;if(bn.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],bn.each(this.children(t),function(t){e.setParent(t)}),delete this._children[t]),bn.each(bn.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],bn.each(bn.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},wn.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(bn.isUndefined(e))e="\0";else{for(var r=e+="";!bn.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},wn.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},wn.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},wn.prototype.children=function(t){if(bn.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return bn.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},wn.prototype.predecessors=function(t){var e=this._preds[t];if(e)return bn.keys(e)},wn.prototype.successors=function(t){var e=this._sucs[t];if(e)return bn.keys(e)},wn.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return bn.union(e,this.successors(t))},wn.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},wn.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;bn.each(this._nodes,function(r,n){t(n)&&e.setNode(n,r)}),bn.each(this._edgeObjs,function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))});var n={};return this._isCompound&&bn.each(e.nodes(),function(t){e.setParent(t,function t(i){var o=r.parent(i);return void 0===o||e.hasNode(o)?(n[i]=o,o):o in n?n[o]:t(o)}(t))}),e},wn.prototype.setDefaultEdgeLabel=function(t){return bn.isFunction(t)||(t=bn.constant(t)),this._defaultEdgeLabelFn=t,this},wn.prototype.edgeCount=function(){return this._edgeCount},wn.prototype.edges=function(){return bn.values(this._edgeObjs)},wn.prototype.setPath=function(t,e){var r=this,n=arguments;return bn.reduce(t,function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i}),this},wn.prototype.setEdge=function(){var t,e,r,n,i=!1,o=arguments[0];"object"==y(o)&&null!==o&&"v"in o?(t=o.v,e=o.w,r=o.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=o,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,bn.isUndefined(r)||(r=""+r);var a=En(this._isDirected,t,e,r);if(bn.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!bn.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,e,r);var s=function(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,_n(this._preds[e],t),_n(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},wn.prototype.edge=function(t,e,r){var n=1===arguments.length?kn(this._isDirected,arguments[0]):En(this._isDirected,t,e,r);return this._edgeLabels[n]},wn.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?kn(this._isDirected,arguments[0]):En(this._isDirected,t,e,r);return bn.has(this._edgeLabels,n)},wn.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?kn(this._isDirected,arguments[0]):En(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Sn(this._preds[e],t),Sn(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},wn.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=bn.values(r);return e?bn.filter(n,function(t){return t.v===e}):n}},wn.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=bn.values(r);return e?bn.filter(n,function(t){return t.w===e}):n}},wn.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))};var Tn={Graph:xn,version:"2.1.8"},Cn={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return bn.map(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return bn.isUndefined(r)||(i.value=r),bn.isUndefined(n)||(i.parent=n),i})}(t),edges:function(t){return bn.map(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return bn.isUndefined(e.name)||(n.name=e.name),bn.isUndefined(r)||(n.value=r),n})}(t)};return bn.isUndefined(t.graph())||(e.value=bn.clone(t.graph())),e},read:function(t){var e=new xn(t.options).setGraph(t.value);return bn.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),bn.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}};var On=An;function An(){this._arr=[],this._keyIndices={}}An.prototype.size=function(){return this._arr.length},An.prototype.keys=function(){return this._arr.map(function(t){return t.key})},An.prototype.has=function(t){return bn.has(this._keyIndices,t)},An.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},An.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},An.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!bn.has(r,t)){var n=this._arr,i=n.length;return r[t]=i,n.push({key:t,priority:e}),this._decrease(i),!0}return!1},An.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},An.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},An.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);return a}(t,String(e),r||Mn,n||function(e){return t.outEdges(e)})},Mn=bn.constant(1),In=function(t){var e=0,r=[],n={},i=[];function o(a){var s=n[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach(function(t){bn.has(n,t)?n[t].onStack&&(s.lowlink=Math.min(s.lowlink,n[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,n[t].lowlink))}),s.lowlink===s.index){var u,l=[];do{u=r.pop(),n[u].onStack=!1,l.push(u)}while(a!==u);i.push(l)}}return t.nodes().forEach(function(t){bn.has(n,t)||o(t)}),i},Ln=bn.constant(1),jn=Nn;function Nn(t){var e={},r={},n=[];if(bn.each(t.sinks(),function i(o){if(bn.has(r,o))throw new Rn;bn.has(e,o)||(r[o]=!0,e[o]=!0,bn.each(t.predecessors(o),i),delete r[o],n.push(o))}),bn.size(e)!==t.nodeCount())throw new Rn;return n}function Rn(){}Nn.CycleException=Rn,Rn.prototype=new Error;var Dn=function(t,e,r){bn.isArray(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return bn.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){bn.has(i,r)||(i[r]=!0,n||a.push(r),bn.each(o(r),function(r){t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};var Bn,Fn={Graph:Tn.Graph,json:Cn,alg:{components:function(t){var e,r={},n=[];function i(n){bn.has(r,n)||(r[n]=!0,e.push(n),bn.each(t.successors(n),i),bn.each(t.predecessors(n),i))}return bn.each(t.nodes(),function(t){e=[],i(t),e.length&&n.push(e)}),n},dijkstra:Pn,dijkstraAll:function(t,e,r){return bn.transform(t.nodes(),function(n,i){n[i]=Pn(t,i,e,r)},{})},findCycles:function(t){return bn.filter(In(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})},floydWarshall:function(t,e,r){return function(t,e,r){var n={},i=t.nodes();return i.forEach(function(t){n[t]={},n[t][t]={distance:0},i.forEach(function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})}),r(t).forEach(function(r){var i=r.v===t?r.w:r.v,o=e(r);n[t][i]={distance:o,predecessor:t}})}),i.forEach(function(t){var e=n[t];i.forEach(function(r){var o=n[r];i.forEach(function(r){var n=o[t],i=e[r],a=o[r],s=n.distance+i.distance;s0;){if(r=o.removeMin(),bn.has(i,r))n.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return n},tarjan:In,topsort:jn},version:Tn.version};try{Bn=Fn}catch(v){}Bn||(Bn=window.graphlib);var zn,Un=Bn,Gn=function(t,e,r){if(!H(r))return!1;var n=y(e);return!!("number"==n?qt(r)&&Mt(e,r.length):"string"==n&&e in r)&&C(r[e],t)},Vn=Object.prototype,Hn=Vn.hasOwnProperty,Wn=cn(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&Gn(e[0],e[1],i)&&(n=1);++r-1?i[o?e[a]:a]:void 0}}(function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:function(t){var e=Jn(t),r=e%1;return e==e?r?e-r:e:0}(r);return i<0&&(i=Qn(n+i,0)),fn(t,Mr(e),i)}),ti=function(t){return null!=t&&t.length?nn(t,1):[]},ei=function(t,e,r){for(var n=-1,i=t.length;++ne},ni=function(t,e,r){(void 0!==r&&!C(t[e],r)||void 0===r&&!(e in t))&>(t,e,r)},ii=Function.prototype,oi=Object.prototype,ai=ii.toString,si=oi.hasOwnProperty,ui=ai.call(Object),li=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ci=function(t,e,r,n,i,o,a){var s=li(t,r),u=li(e,r),l=a.get(u);if(l)ni(t,r,l);else{var c=o?o(s,u,r+"",t,e,a):void 0,f=void 0===c;if(f){var h=Ct(u),p=!h&&At(u),d=!h&&!p&&Dt(u);c=u,h||p||d?Ct(s)?c=s:vn(s)?c=Qt(s):p?(f=!1,c=Jt(u,!0)):d?(f=!1,c=Te(u,!0)):c=[]:function(t){if(!wt(t)||"[object Object]"!=V(t))return!1;var e=oe(t);if(null===e)return!0;var r=si.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ai.call(r)==ui}(u)||Tt(u)?(c=s,Tt(s)?c=function(t){return xt(t,Kt(t))}(s):H(s)&&!W(s)||(c=Pe(u))):f=!1}f&&(a.set(u,c),i(c,u,n,o,a),a.delete(u)),ni(t,r,c)}},fi=function(t){return cn(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Gn(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++ne||o&&a&&u&&!s&&!l||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!l&&t=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})},wi=cn(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Gn(t,e[0],e[1])?e=[]:r>2&&Gn(e[0],e[1],e[2])&&(e=[e[0]]),xi(t,nn(e,1),[])}),_i=0;try{zn={cloneDeep:function(t){return Re(t,5)},constant:De,defaults:Wn,each:He,filter:Ir,find:$n,flatten:ti,forEach:Ve,forIn:function(t,e){return null==t?t:Be(t,Ge(e),Kt)},has:Nr,isUndefined:Dr,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Fr,mapValues:function(t,e){var r={};return e=Mr(e),Fe(t,function(t,n,i){gt(r,n,e(t,n,i))}),r},max:function(t){return t&&t.length?ei(t,Ue,ri):void 0},merge:fi,min:function(t){return t&&t.length?ei(t,Ue,hi):void 0},minBy:function(t,e){return t&&t.length?ei(t,Mr(e),hi):void 0},now:function(){return N.Date.now()},pick:yi,range:mi,reduce:Gr,sortBy:wi,uniqueId:function(t){var e=++_i;return wr(t)+e},values:mn,zipObject:function(t,e){return function(t,e,r){for(var n=-1,i=t.length,o=e.length,a={};++n0;--s)if(n=e[s].dequeue()){i=i.concat(Pi(t,e,r,n,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx);return Si.flatten(Si.map(n,function(e){return t.outEdges(e.v,e.w)}),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],r={},n={};return Si.forEach(t.nodes(),function i(o){Si.has(n,o)||(n[o]=!0,r[o]=!0,Si.forEach(t.outEdges(o),function(t){Si.has(r,t.w)?e.push(t):i(t.w)}),delete r[o])}),e}(t);Si.forEach(e,function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,Si.uniqueId("rev"))})},Li=function(t){Si.forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})},ji=Un.Graph,Ni={addDummyNode:Ri,simplify:function(t){var e=(new ji).setGraph(t.graph());return Si.forEach(t.nodes(),function(r){e.setNode(r,t.node(r))}),Si.forEach(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e},asNonCompoundGraph:function(t){var e=new ji({multigraph:t.isMultigraph()}).setGraph(t.graph());return Si.forEach(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Si.forEach(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e},successorWeights:function(t){var e=Si.map(t.nodes(),function(e){var r={};return Si.forEach(t.outEdges(e),function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight}),r});return Si.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=Si.map(t.nodes(),function(e){var r={};return Si.forEach(t.inEdges(e),function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight}),r});return Si.zipObject(t.nodes(),e)},intersectRect:function(t,e){var r,n,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,l=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}},buildLayerMatrix:function(t){var e=Si.map(Si.range(Di(t)+1),function(){return[]});return Si.forEach(t.nodes(),function(r){var n=t.node(r),i=n.rank;Si.isUndefined(i)||(e[i][n.order]=r)}),e},normalizeRanks:function(t){var e=Si.min(Si.map(t.nodes(),function(e){return t.node(e).rank}));Si.forEach(t.nodes(),function(r){var n=t.node(r);Si.has(n,"rank")&&(n.rank-=e)})},removeEmptyRanks:function(t){var e=Si.min(Si.map(t.nodes(),function(e){return t.node(e).rank})),r=[];Si.forEach(t.nodes(),function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)});var n=0,i=t.graph().nodeRankFactor;Si.forEach(r,function(e,r){Si.isUndefined(e)&&r%i!=0?--n:n&&Si.forEach(e,function(e){t.node(e).rank+=n})})},addBorderNode:function(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Ri(t,"border",i,e)},maxRank:Di,partition:function(t,e){var r={lhs:[],rhs:[]};return Si.forEach(t,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r},time:function(t,e){var r=Si.now();try{return e()}finally{console.log(t+" time: "+(Si.now()-r)+"ms")}},notime:function(t,e){return e()}};function Ri(t,e,r,n){var i;do{i=Si.uniqueId(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Di(t){return Si.max(Si.map(t.nodes(),function(e){var r=t.node(e).rank;if(!Si.isUndefined(r))return r}))}var Bi=function(t){t.graph().dummyChains=[],Si.forEach(t.edges(),function(e){!function(t,e){var r,n,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,l=e.name,c=t.edge(e),f=c.labelRank;if(u!==a+1){for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var l=Si.filter(e.edges(),function(e){return u===so(t,t.node(e.v),s)&&u!==so(t,t.node(e.w),s)});return Si.minBy(l,function(t){return Xi(e,t)})}function ao(t,e,r,n){var i=r.v,o=r.w;t.removeEdge(i,o),t.setEdge(n.v,n.w,{}),no(t),eo(t,e),function(t,e){var r=Si.find(t.nodes(),function(t){return!e.node(t).parent}),n=Ki(t,r);n=n.slice(1),Si.forEach(n,function(r){var n=t.node(r).parent,i=e.edge(r,n),o=!1;i||(i=e.edge(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})}(t,e)}function so(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}to.initLowLimValues=no,to.initCutValues=eo,to.calcCutValue=ro,to.leaveEdge=io,to.enterEdge=oo,to.exchangeEdges=ao;var uo=zi,lo=uo;function co(t){$i(t)}var fo=function(t){var e=Ni.addDummyNode(t,"root",{},"_root"),r=function(t){var e={};function r(n,i){var o=t.children(n);o&&o.length&&Si.forEach(o,function(t){r(t,i+1)}),e[n]=i}return Si.forEach(t.children(),function(t){r(t,1)}),e}(t),n=Si.max(Si.values(r))-1,i=2*n+1;t.graph().nestingRoot=e,Si.forEach(t.edges(),function(e){t.edge(e).minlen*=i});var o=function(t){return Si.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}(t)+1;Si.forEach(t.children(),function(a){!function t(e,r,n,i,o,a,s){var u=e.children(s);if(u.length){var l=Ni.addBorderNode(e,"_bt"),c=Ni.addBorderNode(e,"_bb"),f=e.node(s);e.setParent(l,s),f.borderTop=l,e.setParent(c,s),f.borderBottom=c,Si.forEach(u,function(u){t(e,r,n,i,o,a,u);var f=e.node(u),h=f.borderTop?f.borderTop:u,p=f.borderBottom?f.borderBottom:u,d=f.borderTop?i:2*i,y=h!==p?1:o-a[s]+1;e.setEdge(l,h,{weight:d,minlen:y,nestingEdge:!0}),e.setEdge(p,c,{weight:d,minlen:y,nestingEdge:!0})}),e.parent(s)||e.setEdge(r,l,{weight:0,minlen:o+a[s]})}else s!==r&&e.setEdge(r,s,{weight:0,minlen:n})}(t,e,i,o,n,r,a)}),t.graph().nodeRankFactor=i},ho=function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Si.forEach(t.edges(),function(e){t.edge(e).nestingEdge&&t.removeEdge(e)})};function po(t,e,r,n,i,o){var a={width:0,height:0,rank:o,borderType:e},s=i[e][o-1],u=Ni.addDummyNode(t,"border",a,r);i[e][o]=u,t.setParent(u,n),s&&t.setEdge(s,u,{weight:1})}var yo=function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||go(t)},vo=function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){Si.forEach(t.nodes(),function(e){bo(t.node(e))}),Si.forEach(t.edges(),function(e){var r=t.edge(e);Si.forEach(r.points,bo),Si.has(r,"y")&&bo(r)})}(t),"lr"!==e&&"rl"!==e||(function(t){Si.forEach(t.nodes(),function(e){xo(t.node(e))}),Si.forEach(t.edges(),function(e){var r=t.edge(e);Si.forEach(r.points,xo),Si.has(r,"x")&&xo(r)})}(t),go(t))};function go(t){Si.forEach(t.nodes(),function(e){mo(t.node(e))}),Si.forEach(t.edges(),function(e){mo(t.edge(e))})}function mo(t){var e=t.width;t.width=t.height,t.height=e}function bo(t){t.y=-t.y}function xo(t){var e=t.x;t.x=t.y,t.y=e}var wo=function(t,e){for(var r=0,n=1;n0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*r})),u}function So(t,e,r){for(var n;e.length&&(n=Si.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}var Eo=function t(e,r,n,i){var o=e.children(r),a=e.node(r),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,l={};s&&(o=Si.filter(o,function(t){return t!==s&&t!==u}));var c=function(t,e){return Si.map(e,function(e){var r=t.inEdges(e);if(r.length){var n=Si.reduce(r,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}})}(e,o);Si.forEach(c,function(r){if(e.children(r.v).length){var o=t(e,r.v,n,i);l[r.v]=o,Si.has(o,"barycenter")&&(a=r,s=o,Si.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var f=function(t,e){var r={};return Si.forEach(t,function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};Si.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),Si.forEach(e.edges(),function(t){var e=r[t.v],n=r[t.w];Si.isUndefined(e)||Si.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))}),function(t){var e=[];function r(t){return function(e){e.merged||(Si.isUndefined(e.barycenter)||Si.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(;t.length;){var i=t.pop();e.push(i),Si.forEach(i.in.reverse(),r(i)),Si.forEach(i.out,n(i))}return Si.map(Si.filter(e,function(t){return!t.merged}),function(t){return Si.pick(t,["vs","i","barycenter","weight"])})}(Si.filter(r,function(t){return!t.indegree}))}(c,n);!function(t,e){Si.forEach(t,function(t){t.vs=Si.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}(f,l);var h=function(t,e){var r,n=Ni.partition(t,function(t){return Si.has(t,"barycenter")}),i=n.lhs,o=Si.sortBy(n.rhs,function(t){return-t.i}),a=[],s=0,u=0,l=0;i.sort((r=!!e,function(t,e){return t.barycentere.barycenter?1:r?e.i-t.i:t.i-e.i})),l=So(a,o,l),Si.forEach(i,function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,l=So(a,o,l)});var c={vs:Si.flatten(a,!0)};return u&&(c.barycenter=s/u,c.weight=u),c}(f,i);if(s&&(h.vs=Si.flatten([s,h.vs,u],!0),e.predecessors(s).length)){var p=e.node(e.predecessors(s)[0]),d=e.node(e.predecessors(u)[0]);Si.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+p.order+d.order)/(h.weight+2),h.weight+=2}return h},ko=Un.Graph,To=function(t,e,r){var n=function(t){for(var e;t.hasNode(e=Si.uniqueId("_root")););return e}(t),i=new ko({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(e){return t.node(e)});return Si.forEach(t.nodes(),function(o){var a=t.node(o),s=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,s||n),Si.forEach(t[r](o),function(e){var r=e.v===o?e.w:e.v,n=i.edge(r,o),a=Si.isUndefined(n)?0:n.weight;i.setEdge(r,o,{weight:t.edge(e).weight+a})}),Si.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i},Co=function(t,e,r){var n,i={};Si.forEach(r,function(r){for(var o,a,s=t.parent(r);s;){if((o=t.parent(s))?(a=i[o],i[o]=s):(a=n,n=s),a&&a!==s)return void e.setEdge(a,s);s=o}})},Oo=Un.Graph,Ao=function(t){var e=Ni.maxRank(t),r=Po(t,Si.range(1,e+1),"inEdges"),n=Po(t,Si.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},r=Si.filter(t.nodes(),function(e){return!t.children(e).length}),n=Si.max(Si.map(r,function(e){return t.node(e).rank})),i=Si.map(Si.range(n+1),function(){return[]});var o=Si.sortBy(r,function(e){return t.node(e).rank});return Si.forEach(o,function r(n){if(!Si.has(e,n)){e[n]=!0;var o=t.node(n);i[o.rank].push(n),Si.forEach(t.successors(n),r)}}),i}(t);Io(t,i);for(var o,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){Mo(s%2?r:n,s%4>=2),i=Ni.buildLayerMatrix(t);var l=wo(t,i);lr){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function No(t,e,r){if(e>r){var n=e;e=r,r=n}return Si.has(t[e],r)}var Ro=function(t){var e,r=Ni.buildLayerMatrix(t),n=Si.merge(function(t,e){var r={};return Si.reduce(e,function(e,n){var i=0,o=0,a=e.length,s=Si.last(n);return Si.forEach(n,function(e,u){var l=function(t,e){if(t.node(e).dummy)return Si.find(t.predecessors(e),function(e){return t.node(e).dummy})}(t,e),c=l?t.node(l).order:a;(l||e===s)&&(Si.forEach(n.slice(o,u+1),function(e){Si.forEach(t.predecessors(e),function(n){var o=t.node(n),a=o.order;!(aa)&&jo(r,e,s)})})}return Si.reduce(e,function(e,r){var i,o=-1,a=0;return Si.forEach(r,function(s,u){if("border"===t.node(s).dummy){var l=t.predecessors(s);l.length&&(i=t.node(l[0]).order,n(r,a,u,o,i),a=u,o=i)}n(r,a,r.length,i,e.length)}),r}),r}(t,r)),i={};Si.forEach(["u","d"],function(o){e="u"===o?r:Si.values(r).reverse(),Si.forEach(["l","r"],function(r){"r"===r&&(e=Si.map(e,function(t){return Si.values(t).reverse()}));var a=("u"===o?t.predecessors:t.successors).bind(t),s=function(t,e,r,n){var i={},o={},a={};return Si.forEach(e,function(t){Si.forEach(t,function(t,e){i[t]=t,o[t]=t,a[t]=e})}),Si.forEach(e,function(t){var e=-1;Si.forEach(t,function(t){var s=n(t);if(s.length)for(var u=((s=Si.sortBy(s,function(t){return a[t]})).length-1)/2,l=Math.floor(u),c=Math.ceil(u);l<=c;++l){var f=s[l];o[t]===t&&eu||l>e[i].lim));for(o=i,i=n;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,l=a[u],c=!0;r!==i.w;){if(n=t.node(r),c){for(;(l=a[u])!==s&&t.node(l).maxRank1&&void 0!==arguments[1]?arguments[1]:{};d(this,t),this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=x.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=b.META,this.path=[],this.name=e,this.metaGraph=sa(e,w.META,r)}return h(t,[{key:"getFirstChild",value:function(){return this.metaGraph.node(this.metaGraph.nodes()[0])}},{key:"getChildren",value:function(){var t=this;return this.metaGraph.nodes().map(function(e){return t.metaGraph.node(e)})}},{key:"leaves",value:function(){for(var t,e=[],r=[this];r.length;){var n=r.shift();n.isGroupNode?(t=n.metaGraph).nodes().forEach(function(e){return r.push(t.node(e))}):e.push(n.name)}return e}}]),t}(),ia=function(){function t(e,r){d(this,t),this.v=e,this.w=r,this.baseEdgeList=[],this.inbound=null,this.name=null}return h(t,[{key:"addBaseEdge",value:function(t,e){this.baseEdgeList.push(t)}}]),t}();function oa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new na(t,e)}function aa(t,e){return new ia(t,e)}function sa(t,e,r){var n=r||{},i=new $o.Graph(n);return i.setGraph({name:t,rankdir:n.rankdir,type:e,align:n.align}),i}var ua=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,t),this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=oa(S,this.graphOptions),this.index[S]=this.root}return h(t,[{key:"getNodeMap",value:function(){return this.index}},{key:"node",value:function(t){return this.index[t]}},{key:"setNode",value:function(t,e){this.index[t]=e}},{key:"getBridgeGraph",value:function(t){var e=this,r=this.index[t];if(!r)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in r))return null;var n=r;if(n.bridgeGraph)return n.bridgeGraph;var i=sa(E,w.BRIDGE,this.graphOptions);if(n.bridgeGraph=i,!(r.parentNode&&"metaGraph"in r.parentNode))return i;var o=r.parentNode;return[o.metaGraph,this.getBridgeGraph(o.name)].forEach(function(r){r.edges().filter(function(e){return e.v===t||e.w===t}).forEach(function(n){var o=n.w===t;r.edge(n).baseEdgeList.forEach(function(r){var a=u(o?[r.w,n.v]:[r.v,n.w],2),s=a[0],l=a[1],c=e.getChildName(t,s),f={v:o?l:c,w:o?c:l},h=i.edge(f);h||((h=aa(f.v,f.w)).inbound=o,i.setEdge(f.v,f.w,h)),h.addBaseEdge(r,e)})})}),i}},{key:"getChildName",value:function(t,e){for(var r=this.index[e];r;){if(r.parentNode&&r.parentNode.name===t)return r.name;r=r.parentNode}throw Error("Could not find immediate child for descendant: "+e)}},{key:"getPredecessors",value:function(t){var e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}},{key:"getSuccessors",value:function(t){var e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}},{key:"getOneWayEdges",value:function(t,e){var r=[];if(!t.parentNode||!t.parentNode.isGroupNode)return r;var n=t.parentNode,i=n.metaGraph,o=this.getBridgeGraph(n.name);return la(i,t,e,r),la(o,t,e,r),r}}]),t}();function la(t,e,r,n){(r?t.inEdges(e.name):t.outEdges(e.name)).forEach(function(e){var r=t.edge(e);n.push(r)})}var ca=function(){function t(e){d(this,t),this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new pa(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0}return h(t,[{key:"getRenderInfoNodes",value:function(){return Object.values(this.index)}},{key:"getSubHierarchy",value:function(){return this.hasSubHierarchy}},{key:"buildSubHierarchy",value:function(t){var e=this;if(!(t in this.hasSubHierarchy)){this.hasSubHierarchy[t]=!0;var r=this.index[t];if(r.node.type===b.META){var n=r,i=n.node.metaGraph,o=n.coreGraph;i.nodes().forEach(function(t){var r=e.getOrCreateRenderNodeByName(t);o.setNode(t,r)}),i.edges().forEach(function(t){var e=i.edge(t),r=new ha(e);o.setEdge(t.v,t.w,r)});var a=n.node.parentNode;if(a){var s=this.getRenderNodeByName(a.name),l=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]&&arguments[1];if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){var r="".concat(t.displayName).length;t.width=Math.max(t.coreBox.width,3*r)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(n=null==e?void 0:e.nodeSize)||void 0===n?void 0:n.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!f.width)||2===t.node.type&&!!(null===(u=null===(s=null==e?void 0:e.nodeSize)||void 0===s?void 0:s.bridge)||void 0===u?void 0:u.width)))}})}(t,e),t.node.type===b.META&&function(t,e){var r=g(e),n=r.subScene.meta;Object.assign(t,n);var i=r.graph.meta,o={nodesep:i.nodeSep,ranksep:i.rankSep,edgesep:i.edgeSep,align:i.align};Object.assign(t.coreBox,function(t,e){var r=e.ranksep,n=e.nodesep,i=e.edgesep,o=e.align;Object.assign(t.graph(),{ranksep:r,nodesep:n,edgesep:i,align:o});var a=[];if(t.nodes().forEach(function(e){t.node(e).node.type!==b.BRIDGE&&a.push(e)}),!a.length)return{width:0,height:0};ta(t);var s=1/0,u=1/0,l=-1/0,c=-1/0;return a.forEach(function(e){var r=t.node(e),n=.5*r.width,i=r.x-n,o=r.x+n;s=il?o:l;var a=.5*r.height,f=r.y-a,h=r.y+a;u=fc?h:c}),t.edges().forEach(function(e){var r=t.edge(e),n=t.node(r.metaEdge.v),i=t.node(r.metaEdge.w);if(3===r.points.length&&function(t){for(var e=ya(t[0],t[1]),r=1;r1)return!1;e=n}return!0}(r.points)){if(null!=n){var o=n.expanded?n.x:va(n);r.points[0].x=o}if(null!=i){var a=i.expanded?i.x:va(i);r.points[2].x=a}r.points=[r.points[0],r.points[1]]}var f=r.points[r.points.length-2];null!=i&&(r.points[r.points.length-1]=ga(f,i));var h=r.points[1];null!=n&&(r.points[0]=ga(h,n)),r.points.forEach(function(t){s=t.xl?t.x:l,u=t.yc?t.y:c})}),t.nodes().forEach(function(e){var r=t.node(e);r.x-=s,r.y-=u}),t.edges().forEach(function(e){t.edge(e).points.forEach(function(t){t.x-=s,t.y-=u})}),{width:l-s,height:c-u}}(t.coreGraph,o));var a=0;t.coreGraph.nodeCount()>0&&a++;var s=a<=1?0:a;t.coreBox.width+=s+s,t.coreBox.height=n.labelHeight+t.coreBox.height,t.width=t.coreBox.width+n.paddingLeft+n.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function ya(t,e){var r=e.x-t.x,n=e.y-t.y;return 180*Math.atan(n/r)/Math.PI}function va(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function ga(t,e){var r,n,i=e.expanded?e.x:va(e),o=e.y,a=t.x-i,s=t.y-o,u=e.expanded?e.width:e.coreBox.width,l=e.expanded?e.height:e.coreBox.height;return Math.abs(s)*u/2>Math.abs(a)*l/2?(s<0&&(l=-l),r=0===s?0:l/2*a/s,n=l/2):(a<0&&(u=-u),r=u/2,n=0===a?0:u/2*s/a),{x:i+r,y:o+n}}function ma(t,e,r){var o,a,s,l,c=t.nodes.filter(function(t,e,r){return r.findIndex(function(e){return e.id===t.id})!==e}).map(function(t){return t.id});if(c.length)throw new Error("Duplicated ids found: ".concat(c.join(", ")));var f=function(t){var e={nodes:[]},r=t.compound,n=Object.keys(r||{}),o=new Map,a=function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(o.has(e))return o.get(e);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:[];if(0===Object.keys(e).length)return i(new Set(o));var a,s=new Map(Object.keys(e).map(function(t){return[t,e[t]]})),l={},c=n(s);try{for(c.s();!(a=c.n()).done;){var f=u(a.value,2),h=f[0],p=f[1];r(h,s)?l[h]=p:o=o.concat(h,p)}}catch(t){c.e(t)}finally{c.f()}return t(l,o)}(t).filter(function(t){return e.includes(t)})}(t.compound||{},(null==e?void 0:e.expanded)||[]),p=function(t,e){return function(t){return new ca(t)}(function(t,e){var r=e.rankDirection,n=e.align,i=new ua({rankdir:r,align:n});return function(t,e){Object.keys(e.nodes).forEach(function(r){var n=e.nodes[r],i=n.path,o=t.root;o.depth=Math.max(i.length,o.depth);for(var a=0;a1&&void 0!==arguments[1]&&arguments[1],r=JSON.parse(JSON.stringify(t)),n={nodes:[r],edges:i(r.edges)};return r.nodes.forEach(function t(e){(0===e.type||1===e.type)&&n.nodes.push(e),0===e.type&&(n.edges=n.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)}),e&&n.nodes.forEach(function(t){var e=n.nodes.find(function(e){return e.id===t.parentNodeName});if(e){var r=e.x-e.width/2+e.paddingLeft,i=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==S&&(t.x+=r,t.y+=i),0===t.type&&t.edges.forEach(function(e){e.points.forEach(function(e){e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop})})}}),n}function xa(t,e,r,n){var o,a,s=[],u=(null===(o=r.find(function(e){return e.id===t}))||void 0===o?void 0:o.path)||[],l=(null===(a=r.find(function(t){return t.id===e}))||void 0===a?void 0:a.path)||[],c=[S].concat(i(u)).slice(0,u.length).reverse(),f=[S].concat(i(l)).slice(0,l.length);return c.forEach(function(i){var o=r.find(function(t){return t.id===i});s=s.concat(o.edges.filter(function(r){return r.baseEdgeList.some(function(r){return r.v===((null==n?void 0:n.v)||t)&&r.w===((null==n?void 0:n.w)||e)})}))}),f.filter(function(t){return!c.includes(t)}).forEach(function(i){var o=r.find(function(t){return t.id===i});s=s.concat(o.edges.filter(function(r){return r.baseEdgeList.some(function(r){return r.v===((null==n?void 0:n.v)||t)&&r.w===((null==n?void 0:n.w)||e)})}))}),s}function wa(t){var e,r=t.coreGraph.nodes().map(function(e){return t.coreGraph.node(e)});return Object.assign(Object.assign({},_a(t)),{expanded:t.expanded,nodes:t.expanded?(e=r,e.map(function(t){return t.node.type===b.META?wa(t):_a(t)})):[],edges:t.expanded?function(t){return t.coreGraph.edges().map(function(e){return{renderInfoEdge:t.coreGraph.edge(e),edge:e}}).filter(function(t){var e=t.renderInfoEdge;return e.metaEdge}).map(function(e){var r=e.edge,n=e.renderInfoEdge,i=function(t,e){var r=e.points.map(function(t){return Object.assign({},t)});if(e.adjoiningMetaEdge){var n=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?n[n.length-1]:n[0],a=r[i?0:r.length-1],s=t.x-t.width/2,u=t.y-t.height/2,l=o.x-s,c=o.y-u,f=-t.paddingLeft,h=-(t.paddingTop+t.labelHeight);a.x=l+f,a.y=c+h}return r}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:r.w,v:r.v,points:i,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}})}(t):[]})}function _a(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}},6643:function(t,e,r){"use strict";r.d(e,{qY:function(){return p}});var n=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i5&&"xml"===n)return d("InvalidXml","XML declaration allowed only at the start of the document.",v(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function s(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},i,e);var r,u=[],l=!1,f=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var y=0;y"!==t[y]&&" "!==t[y]&&"\t"!==t[y]&&"\n"!==t[y]&&"\r"!==t[y];y++)b+=t[y];if("/"===(b=b.trim())[b.length-1]&&(b=b.substring(0,b.length-1),y--),r=b,!n.isName(r)){return d("InvalidTag",0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",v(t,y))}var x=c(t,y);if(!1===x)return d("InvalidAttr","Attributes for '"+b+"' have open quote.",v(t,y));var w=x.value;if(y=x.index,"/"===w[w.length-1]){var _=y-w.length,S=h(w=w.substring(0,w.length-1),e);if(!0!==S)return d(S.err.code,S.err.msg,v(t,_+S.err.line));l=!0}else if(m){if(!x.tagClosed)return d("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",v(t,y));if(w.trim().length>0)return d("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",v(t,g));var E=u.pop();if(b!==E.tagName){var k=v(t,E.tagStartPos);return d("InvalidTag","Expected closing tag '"+E.tagName+"' (opened in line "+k.line+", col "+k.col+") instead of closing tag '"+b+"'.",v(t,g))}0==u.length&&(f=!0)}else{var T=h(w,e);if(!0!==T)return d(T.err.code,T.err.msg,v(t,y-w.length+T.err.line));if(!0===f)return d("InvalidXml","Multiple possible root nodes found.",v(t,y));-1!==e.unpairedTags.indexOf(b)||u.push({tagName:b,tagStartPos:g}),l=!0}for(y++;y0)||d("InvalidXml","Invalid '"+JSON.stringify(u.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};var u='"',l="'";function c(t,e){for(var r="",n="",i=!1;e"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function h(t,e){for(var r=n.getAllMatches(t,f),i={},o=0;o","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(t){this.options=Object.assign({},a,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=u,this.options.format?(this.indentate=l,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(t,e,r){var n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function l(t){return this.options.indentBy.repeat(t)}function c(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}s.prototype.build=function(t){return this.options.preserveOrder?o(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=i({},this.options.arrayNodeName,t)),this.j2x(t,0).val)},s.prototype.j2x=function(t,e){var r="",i="";for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(i+="");else if(null===t[o])this.isAttribute(o)?i+="":"?"===o[0]?i+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)i+=this.buildTextValNode(t[o],o,"",e);else if("object"!==n(t[o])){var a=this.isAttribute(o);if(a)r+=this.buildAttrPairStr(a,""+t[o]);else if(o===this.options.textNodeName){var s=this.options.tagValueProcessor(o,""+t[o]);i+=this.replaceEntitiesValue(s)}else i+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){for(var u=t[o].length,l="",c=0;c"+t+i},s.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(e,t);return""===(i=this.replaceEntitiesValue(i))?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"0&&this.options.processEntities)for(var e=0;e0&&e.processEntities)for(var r=0;r0&&(s=e),function t(e,a,s,u){for(var l="",c=!1,f=0;f":l+=g+"/>":m&&0!==m.length||!a.suppressEmptyNode?m&&m.endsWith(">")?l+=g+">".concat(m).concat(u,""):(l+=g+">",m&&""!==u&&(m.includes("/>")||m.includes("")):l+=g+"/>",c=!0}else{var b=n(h[":@"],a),x="?xml"===p?"":u,w=h[p][0][a.textNodeName];w=0!==w.length?" "+w:"",l+=x+"<".concat(p).concat(w).concat(b,"?>"),c=!0}else l+=u+"\x3c!--".concat(h[p][0][a.textNodeName],"--\x3e"),c=!0;else c&&(l+=u),l+=""),c=!1;else{var _=h[p];i(d,a)||(_=o(_=a.tagValueProcessor(p,_),a)),c&&(l+=u),l+=_,c=!1}}}return l}(t,a,"",s)}},8763:function(t,e,r){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"===t[e]){if(p?"-"===t[e-1]&&"-"===t[e-2]&&(p=!1,i--):i--,0===i)break}else"["===t[e]?o=!0:t[e];else{if(o&&u(t,e)){var d=n(a(t,(e+=7)+1),3);entityName=d[0],val=d[1],e=d[2],-1===val.indexOf("&")&&(r[h(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(o&&l(t,e))e+=8;else if(o&&c(t,e))e+=8;else if(o&&f(t,e))e+=9;else{if(!s)throw new Error("Invalid DOCTYPE");p=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}},4706:function(t,e){var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}};e.buildOptions=function(t){return Object.assign({},r,t)},e.defaultOptions=r},9244:function(t,e,r){"use strict";function n(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=h,this.parseXml=g,this.parseTextData=p,this.resolveNameSpace=d,this.buildAttributesMap=v,this.isItStopNode=w,this.replaceEntitiesValue=b,this.readStopNodeData=E,this.saveTextToParentTag=x,this.addChild=m});function h(t){for(var e=Object.keys(t),r=0;r0)){s||(t=this.replaceEntitiesValue(t));var u=this.options.tagValueProcessor(e,t,r,o,a);return null===u||void 0===u?t:i(u)!==i(t)||u!==t?u:this.options.trimValues?k(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?k(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function d(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var y=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function v(t,e,r){if(!this.options.ignoreAttributes&&"string"==typeof t){for(var n=s.getAllMatches(t,y),o=n.length,a={},u=0;u",a,"Closing Tag is not closed."),c=t.substring(a+2,s).trim();if(this.options.removeNSPrefix){var f=c.indexOf(":");-1!==f&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(i=this.saveTextToParentTag(i,r,o));var h=o.substring(o.lastIndexOf(".")+1);if(c&&-1!==this.options.unpairedTags.indexOf(c))throw new Error("Unpaired tag can not be used as closing tag: "));var p=0;h&&-1!==this.options.unpairedTags.indexOf(h)?(p=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=o.lastIndexOf("."),o=o.substring(0,p),r=this.tagsNodeStack.pop(),i="",a=s}else if("?"===t[a+1]){var d=S(t,a,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,o),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var y=new u(d.tagName);y.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(y[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(r,y,o)}a=d.closeIndex+1}else if("!--"===t.substr(a+1,3)){var v=_(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var g=t.substring(a+4,v-2);i=this.saveTextToParentTag(i,r,o),r.add(this.options.commentPropName,[n({},this.options.textNodeName,g)])}a=v}else if("!D"===t.substr(a+1,2)){var m=l(t,a);this.docTypeEntities=m.entities,a=m.i}else if("!["===t.substr(a+1,2)){var b=_(t,"]]>",a,"CDATA is not closed.")-2,x=t.substring(a+9,b);i=this.saveTextToParentTag(i,r,o);var w=this.parseTextData(x,r.tagname,o,!0,!1,!0,!0);void 0==w&&(w=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[n({},this.options.textNodeName,x)]):r.add(this.options.textNodeName,w),a=b+2}else{var E=S(t,a,this.options.removeNSPrefix),k=E.tagName,T=E.rawTagName,C=E.tagExp,O=E.attrExpPresent,A=E.closeIndex;this.options.transformTagName&&(k=this.options.transformTagName(k)),r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,o,!1));var P=r;if(P&&-1!==this.options.unpairedTags.indexOf(P.tagname)&&(r=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),k!==e.tagname&&(o+=o?"."+k:k),this.isItStopNode(this.options.stopNodes,o,k)){var M="";if(C.length>0&&C.lastIndexOf("/")===C.length-1)a=E.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(k))a=E.closeIndex;else{var I=this.readStopNodeData(t,T,A+1);if(!I)throw new Error("Unexpected end of ".concat(T));a=I.i,M=I.tagContent}var L=new u(k);k!==C&&O&&(L[":@"]=this.buildAttributesMap(C,o,k)),M&&(M=this.parseTextData(M,k,o,!0,O,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),L.add(this.options.textNodeName,M),this.addChild(r,L,o)}else{if(C.length>0&&C.lastIndexOf("/")===C.length-1){"/"===k[k.length-1]?(k=k.substr(0,k.length-1),o=o.substr(0,o.length-1),C=k):C=C.substr(0,C.length-1),this.options.transformTagName&&(k=this.options.transformTagName(k));var j=new u(k);k!==C&&O&&(j[":@"]=this.buildAttributesMap(C,o,k)),this.addChild(r,j,o),o=o.substr(0,o.lastIndexOf("."))}else{var N=new u(k);this.tagsNodeStack.push(r),k!==C&&O&&(N[":@"]=this.buildAttributesMap(C,o,k)),this.addChild(r,N,o),r=N}i="",a=A}}else i+=t[a]}return e.child};function m(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}var b=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var n in this.lastEntities){var i=this.lastEntities[n];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var a=this.htmlEntities[o];t=t.replace(a.regex,a.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function x(t,e,r,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function w(t,e,r){var n="*."+r;for(var i in t){var o=t[i];if(n===o||e===o)return!0}return!1}function _(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}function S(t,e,r){var n=function(t,e){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",i="",o=e;o3&&void 0!==arguments[3]?arguments[3]:">");if(n){var i=n.data,o=n.index,a=i.search(/\s/),s=i,u=!0;-1!==a&&(s=i.substring(0,a),i=i.substring(a+1).trimStart());var l=s;if(r){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==n.data.substr(c+1))}return{tagName:s,tagExp:i,closeIndex:o,attrExpPresent:u,rawTagName:l}}}function E(t,e,r){for(var n=r,i=1;r",r,"".concat(e," is not closed"));if(t.substring(r+2,o).trim()===e&&0===--i)return{tagContent:t.substring(n,r),i:o};r=o}else if("?"===t[r+1]){r=_(t,"?>",r+1,"StopNode is not closed.")}else if("!--"===t.substr(r+1,3)){r=_(t,"--\x3e",r+3,"StopNode is not closed.")}else if("!["===t.substr(r+1,2)){r=_(t,"]]>",r,"StopNode is not closed.")-2}else{var a=S(t,r,">");if(a)(a&&a.tagName)===e&&"/"!==a.tagExp[a.tagExp.length-1]&&i++,r=a.closeIndex}}function k(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&c(t,r)}return s.isExist(t)?t:""}t.exports=f},9162:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r0&&(u[o.textNodeName]=s):void 0!==s&&(u[o.textNodeName]=s),u}(t,e)}},5295:function(t){"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){for(var r=0;r0?this.child.push(r(r({},t.tagname,t.child),":@",t[":@"])):this.child.push(r({},t.tagname,t.child))}}])&&n(e.prototype,i),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();t.exports=o},5937:function(t){!function(e){"use strict";if(e.__disableNativeFetch||!e.fetch){s.prototype.append=function(t,e){t=o(t),e=a(e);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(e)},s.prototype.delete=function(t){delete this.map[o(t)]},s.prototype.get=function(t){var e=this.map[o(t)];return e?e[0]:null},s.prototype.getAll=function(t){return this.map[o(t)]||[]},s.prototype.has=function(t){return this.map.hasOwnProperty(o(t))},s.prototype.set=function(t,e){this.map[o(t)]=[a(e)]},s.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){t.call(e,n,r,this)},this)},this)};var r={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this)},f.call(h.prototype),f.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},d.error=function(){var t=new d(null,{status:0,statusText:""});return t.type="error",t};var i=[301,302,303,307,308];d.redirect=function(t,e){if(-1===i.indexOf(e))throw new RangeError("Invalid status code");return new d(null,{status:e,headers:{location:t}})},e.Headers=s,e.Request=h,e.Response=d,e.fetch=function(t,e){return new Promise(function(n,i){var o;o=h.prototype.isPrototypeOf(t)&&!e?t:new h(t,e);var a=new XMLHttpRequest;var u=!1;function l(){if(4===a.readyState){var t=1223===a.status?204:a.status;if(t<100||t>599){if(u)return;return u=!0,void i(new TypeError("Network request failed"))}var e={status:t,statusText:a.statusText,headers:function(t){var e=new s;return t.getAllResponseHeaders().trim().split("\n").forEach(function(t){var r=t.trim().split(":"),n=r.shift().trim(),i=r.join(":").trim();e.append(n,i)}),e}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;u||(u=!0,n(new d(r,e)))}}a.onreadystatechange=l,a.onload=l,a.onerror=function(){u||(u=!0,i(new TypeError("Network request failed")))},a.open(o.method,o.url,!0);try{"include"===o.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(t){console&&console.warn&&console.warn("set withCredentials error:"+t)}"responseType"in a&&r.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0,t.exports&&(t.exports=e.fetch)}function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function c(t){var e=new FileReader;return e.readAsArrayBuffer(t),l(e)}function f(){return this.bodyUsed=!1,this._initBody=function(t,e){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(r.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t,this._options=e;else if(r.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(c)},this.text=function(){var t,e,r,n,i,o,a,s=u(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=this._options,r=new FileReader,n=e.headers.map["content-type"]?e.headers.map["content-type"].toString():"",i=/charset\=[0-9a-zA-Z\-\_]*;?/,o=t.type.match(i)||n.match(i),a=[t],o&&a.push(o[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),l(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=u(this);return t||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function h(t,e){var r,i,o=(e=e||{}).body;if(h.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,o||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=(r=e.method||this.method||"GET",i=r.toUpperCase(),n.indexOf(i)>-1?i:r),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o,e)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function d(t,e){e||(e={}),this._initBody(t,e),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof s?e.headers:new s(e.headers),this.url=e.url||""}}("undefined"!=typeof self?self:this)},4238:function(t,e){var r,n,i;n=[e,t],void 0===(i="function"==typeof(r=function(t,e){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(t){try{delete window[t]}catch(e){window[t]=void 0}}function i(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t,a=e.timeout||r.timeout,s=e.jsonpCallback||r.jsonpCallback,u=void 0;return new Promise(function(r,l){var c=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),f=s+"_"+c;window[c]=function(t){r({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),i(f),n(c)},o+=-1===o.indexOf("?")?"?":"&";var h=document.createElement("script");h.setAttribute("src",""+o+s+"="+c),e.charset&&h.setAttribute("charset",e.charset),h.id=f,document.getElementsByTagName("head")[0].appendChild(h),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),n(c),i(f),window[c]=function(){n(c)}},a),h.onerror=function(){l(new Error("JSONP request to "+t+" failed")),n(c),i(f),u&&clearTimeout(u)}})}})?r.apply(e,n):r)||(t.exports=i)},8428:function(t,e,r){"use strict";r.r(e),r.d(e,{ARRAY_TYPE:function(){return i},EPSILON:function(){return n},RANDOM:function(){return o},equals:function(){return l},setMatrixArrayType:function(){return a},toRadian:function(){return u}});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;function a(t){i=t}var s=Math.PI/180;function u(t){return t*s}function l(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},2917:function(t,e,r){"use strict";r.r(e),r.d(e,{glMatrix:function(){return l},mat2:function(){return n},mat2d:function(){return i},mat3:function(){return st},mat4:function(){return o},quat:function(){return s},quat2:function(){return u},vec2:function(){return kn},vec3:function(){return oe},vec4:function(){return a}});var n={};r.r(n),r.d(n,{LDU:function(){return C},add:function(){return O},adjoint:function(){return m},clone:function(){return f},copy:function(){return h},create:function(){return c},determinant:function(){return b},equals:function(){return M},exactEquals:function(){return P},frob:function(){return T},fromRotation:function(){return S},fromScaling:function(){return E},fromValues:function(){return d},identity:function(){return p},invert:function(){return g},mul:function(){return j},multiply:function(){return x},multiplyScalar:function(){return I},multiplyScalarAndAdd:function(){return L},rotate:function(){return w},scale:function(){return _},set:function(){return y},str:function(){return k},sub:function(){return N},subtract:function(){return A},transpose:function(){return v}});var i={};r.r(i),r.d(i,{add:function(){return $},clone:function(){return D},copy:function(){return B},create:function(){return R},determinant:function(){return V},equals:function(){return it},exactEquals:function(){return nt},frob:function(){return Q},fromRotation:function(){return X},fromScaling:function(){return Z},fromTranslation:function(){return K},fromValues:function(){return z},identity:function(){return F},invert:function(){return G},mul:function(){return ot},multiply:function(){return H},multiplyScalar:function(){return et},multiplyScalarAndAdd:function(){return rt},rotate:function(){return W},scale:function(){return q},set:function(){return U},str:function(){return J},sub:function(){return at},subtract:function(){return tt},translate:function(){return Y}});var o={};r.r(o),r.d(o,{add:function(){return Jt},adjoint:function(){return vt},clone:function(){return lt},copy:function(){return ct},create:function(){return ut},determinant:function(){return gt},equals:function(){return re},exactEquals:function(){return ee},frob:function(){return Kt},fromQuat:function(){return Bt},fromQuat2:function(){return It},fromRotation:function(){return Ct},fromRotationTranslation:function(){return Mt},fromRotationTranslationScale:function(){return Rt},fromRotationTranslationScaleOrigin:function(){return Dt},fromScaling:function(){return Tt},fromTranslation:function(){return kt},fromValues:function(){return ft},fromXRotation:function(){return Ot},fromYRotation:function(){return At},fromZRotation:function(){return Pt},frustum:function(){return Ft},getRotation:function(){return Nt},getScaling:function(){return jt},getTranslation:function(){return Lt},identity:function(){return pt},invert:function(){return yt},lookAt:function(){return Yt},mul:function(){return ne},multiply:function(){return mt},multiplyScalar:function(){return $t},multiplyScalarAndAdd:function(){return te},ortho:function(){return Wt},orthoNO:function(){return Ht},orthoZO:function(){return qt},perspective:function(){return Ut},perspectiveFromFieldOfView:function(){return Vt},perspectiveNO:function(){return zt},perspectiveZO:function(){return Gt},rotate:function(){return wt},rotateX:function(){return _t},rotateY:function(){return St},rotateZ:function(){return Et},scale:function(){return xt},set:function(){return ht},str:function(){return Zt},sub:function(){return ie},subtract:function(){return Qt},targetTo:function(){return Xt},translate:function(){return bt},transpose:function(){return dt}});var a={};r.r(a),r.d(a,{add:function(){return fe},ceil:function(){return ye},clone:function(){return se},copy:function(){return le},create:function(){return ae},cross:function(){return Pe},dist:function(){return Ve},distance:function(){return _e},div:function(){return Ge},divide:function(){return de},dot:function(){return Ae},equals:function(){return Be},exactEquals:function(){return De},floor:function(){return ve},forEach:function(){return Ye},fromValues:function(){return ue},inverse:function(){return Ce},len:function(){return We},length:function(){return Ee},lerp:function(){return Me},max:function(){return me},min:function(){return ge},mul:function(){return Ue},multiply:function(){return pe},negate:function(){return Te},normalize:function(){return Oe},random:function(){return Ie},round:function(){return be},scale:function(){return xe},scaleAndAdd:function(){return we},set:function(){return ce},sqrDist:function(){return He},sqrLen:function(){return qe},squaredDistance:function(){return Se},squaredLength:function(){return ke},str:function(){return Re},sub:function(){return ze},subtract:function(){return he},transformMat4:function(){return Le},transformQuat:function(){return je},zero:function(){return Ne}});var s={};r.r(s),r.d(s,{add:function(){return Er},calculateW:function(){return nr},clone:function(){return xr},conjugate:function(){return cr},copy:function(){return _r},create:function(){return Xe},dot:function(){return Cr},equals:function(){return Nr},exactEquals:function(){return jr},exp:function(){return ir},fromEuler:function(){return hr},fromMat3:function(){return fr},fromValues:function(){return wr},getAngle:function(){return Qe},getAxisAngle:function(){return Je},identity:function(){return Ze},invert:function(){return lr},len:function(){return Pr},length:function(){return Ar},lerp:function(){return Or},ln:function(){return or},mul:function(){return kr},multiply:function(){return $e},normalize:function(){return Lr},pow:function(){return ar},random:function(){return ur},rotateX:function(){return tr},rotateY:function(){return er},rotateZ:function(){return rr},rotationTo:function(){return Rr},scale:function(){return Tr},set:function(){return Sr},setAxes:function(){return Br},setAxisAngle:function(){return Ke},slerp:function(){return sr},sqlerp:function(){return Dr},sqrLen:function(){return Ir},squaredLength:function(){return Mr},str:function(){return pr}});var u={};r.r(u),r.d(u,{add:function(){return ln},clone:function(){return zr},conjugate:function(){return vn},copy:function(){return Yr},create:function(){return Fr},dot:function(){return pn},equals:function(){return En},exactEquals:function(){return Sn},fromMat4:function(){return qr},fromRotation:function(){return Wr},fromRotationTranslation:function(){return Vr},fromRotationTranslationValues:function(){return Gr},fromTranslation:function(){return Hr},fromValues:function(){return Ur},getDual:function(){return Jr},getReal:function(){return Kr},getTranslation:function(){return tn},identity:function(){return Xr},invert:function(){return yn},len:function(){return mn},length:function(){return gn},lerp:function(){return dn},mul:function(){return fn},multiply:function(){return cn},normalize:function(){return wn},rotateAroundAxis:function(){return un},rotateByQuatAppend:function(){return an},rotateByQuatPrepend:function(){return sn},rotateX:function(){return rn},rotateY:function(){return nn},rotateZ:function(){return on},scale:function(){return hn},set:function(){return Zr},setDual:function(){return $r},setReal:function(){return Qr},sqrLen:function(){return xn},squaredLength:function(){return bn},str:function(){return _n},translate:function(){return en}});var l=r(8428);function c(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function f(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function p(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function d(t,e,r,n){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function y(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function v(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function g(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function m(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function b(t){return t[0]*t[3]-t[2]*t[1]}function x(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*l+o*c,t[3]=i*l+a*c,t}function w(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function S(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function E(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function k(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function T(t){return Math.hypot(t[0],t[1],t[2],t[3])}function C(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function A(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function M(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function I(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function L(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var j=x,N=A;function R(){var t=new l.ARRAY_TYPE(6);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function D(t){var e=new l.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function B(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}function F(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function z(t,e,r,n,i,o){var a=new l.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function U(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function G(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function V(t){return t[0]*t[3]-t[1]*t[2]}function H(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1],f=r[2],h=r[3],p=r[4],d=r[5];return t[0]=n*l+o*c,t[1]=i*l+a*c,t[2]=n*f+o*h,t[3]=i*f+a*h,t[4]=n*p+o*d+s,t[5]=i*p+a*d+u,t}function W(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*l,t[1]=i*c+a*l,t[2]=n*-l+o*c,t[3]=i*-l+a*c,t[4]=s,t[5]=u,t}function q(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1];return t[0]=n*l,t[1]=i*l,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function Y(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*l+o*c+s,t[5]=i*l+a*c+u,t}function X(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function Z(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function K(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function J(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Q(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function $(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function tt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function et(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function rt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function nt(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]}function it(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],c=e[1],f=e[2],h=e[3],p=e[4],d=e[5];return Math.abs(r-u)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-f)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-h)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-p)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-d)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))}var ot=H,at=tt,st=r(8610);function ut(){var t=new l.ARRAY_TYPE(16);return l.ARRAY_TYPE!=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 lt(t){var e=new l.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ct(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 ft(t,e,r,n,i,o,a,s,u,c,f,h,p,d,y,v){var g=new l.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=u,g[9]=c,g[10]=f,g[11]=h,g[12]=p,g[13]=d,g[14]=y,g[15]=v,g}function ht(t,e,r,n,i,o,a,s,u,l,c,f,h,p,d,y,v){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=f,t[11]=h,t[12]=p,t[13]=d,t[14]=y,t[15]=v,t}function pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function dt(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function yt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,x=r*l-o*a,w=n*u-i*s,_=n*l-o*s,S=i*l-o*u,E=c*y-f*d,k=c*v-h*d,T=c*g-p*d,C=f*v-h*y,O=f*g-p*y,A=h*g-p*v,P=m*A-b*O+x*C+w*T-_*k+S*E;return P?(P=1/P,t[0]=(s*A-u*O+l*C)*P,t[1]=(i*O-n*A-o*C)*P,t[2]=(y*S-v*_+g*w)*P,t[3]=(h*_-f*S-p*w)*P,t[4]=(u*T-a*A-l*k)*P,t[5]=(r*A-i*T+o*k)*P,t[6]=(v*x-d*S-g*b)*P,t[7]=(c*S-h*x+p*b)*P,t[8]=(a*O-s*T+l*E)*P,t[9]=(n*T-r*O-o*E)*P,t[10]=(d*_-y*x+g*m)*P,t[11]=(f*x-c*_-p*m)*P,t[12]=(s*k-a*C-u*E)*P,t[13]=(r*C-n*k+i*E)*P,t[14]=(y*b-d*w-v*m)*P,t[15]=(c*w-f*b+h*m)*P,t):null}function vt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],v=e[14],g=e[15];return t[0]=s*(h*g-p*v)-f*(u*g-l*v)+y*(u*p-l*h),t[1]=-(n*(h*g-p*v)-f*(i*g-o*v)+y*(i*p-o*h)),t[2]=n*(u*g-l*v)-s*(i*g-o*v)+y*(i*l-o*u),t[3]=-(n*(u*p-l*h)-s*(i*p-o*h)+f*(i*l-o*u)),t[4]=-(a*(h*g-p*v)-c*(u*g-l*v)+d*(u*p-l*h)),t[5]=r*(h*g-p*v)-c*(i*g-o*v)+d*(i*p-o*h),t[6]=-(r*(u*g-l*v)-a*(i*g-o*v)+d*(i*l-o*u)),t[7]=r*(u*p-l*h)-a*(i*p-o*h)+c*(i*l-o*u),t[8]=a*(f*g-p*y)-c*(s*g-l*y)+d*(s*p-l*f),t[9]=-(r*(f*g-p*y)-c*(n*g-o*y)+d*(n*p-o*f)),t[10]=r*(s*g-l*y)-a*(n*g-o*y)+d*(n*l-o*s),t[11]=-(r*(s*p-l*f)-a*(n*p-o*f)+c*(n*l-o*s)),t[12]=-(a*(f*v-h*y)-c*(s*v-u*y)+d*(s*h-u*f)),t[13]=r*(f*v-h*y)-c*(n*v-i*y)+d*(n*h-i*f),t[14]=-(r*(s*v-u*y)-a*(n*v-i*y)+d*(n*u-i*s)),t[15]=r*(s*h-u*f)-a*(n*h-i*f)+c*(n*u-i*s),t}function gt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],f=t[10],h=t[11],p=t[12],d=t[13],y=t[14],v=t[15];return(e*a-r*o)*(f*v-h*y)-(e*s-n*o)*(c*v-h*d)+(e*u-i*o)*(c*y-f*d)+(r*s-n*a)*(l*v-h*p)-(r*u-i*a)*(l*y-f*p)+(n*u-i*s)*(l*d-c*p)}function mt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],b=r[0],x=r[1],w=r[2],_=r[3];return t[0]=b*n+x*s+w*f+_*y,t[1]=b*i+x*u+w*h+_*v,t[2]=b*o+x*l+w*p+_*g,t[3]=b*a+x*c+w*d+_*m,b=r[4],x=r[5],w=r[6],_=r[7],t[4]=b*n+x*s+w*f+_*y,t[5]=b*i+x*u+w*h+_*v,t[6]=b*o+x*l+w*p+_*g,t[7]=b*a+x*c+w*d+_*m,b=r[8],x=r[9],w=r[10],_=r[11],t[8]=b*n+x*s+w*f+_*y,t[9]=b*i+x*u+w*h+_*v,t[10]=b*o+x*l+w*p+_*g,t[11]=b*a+x*c+w*d+_*m,b=r[12],x=r[13],w=r[14],_=r[15],t[12]=b*n+x*s+w*f+_*y,t[13]=b*i+x*u+w*h+_*v,t[14]=b*o+x*l+w*p+_*g,t[15]=b*a+x*c+w*d+_*m,t}function bt(t,e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y=r[0],v=r[1],g=r[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*y+s*v+f*g+e[12],t[13]=i*y+u*v+h*g+e[13],t[14]=o*y+l*v+p*g+e[14],t[15]=a*y+c*v+d*g+e[15]),t}function xt(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function wt(t,e,r,n){var i,o,a,s,u,c,f,h,p,d,y,v,g,m,b,x,w,_,S,E,k,T,C,O,A=n[0],P=n[1],M=n[2],I=Math.hypot(A,P,M);return I0?(r[0]=2*(s*a+f*n+u*o-c*i)/h,r[1]=2*(u*a+f*i+c*n-s*o)/h,r[2]=2*(c*a+f*o+s*i-u*n)/h):(r[0]=2*(s*a+f*n+u*o-c*i),r[1]=2*(u*a+f*i+c*n-s*o),r[2]=2*(c*a+f*o+s*i-u*n)),Mt(t,e,r),t}function Lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jt(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,l,c),t}function Nt(t,e){var r=new l.ARRAY_TYPE(3);jt(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,c=e[4]*n,f=e[5]*i,h=e[6]*o,p=e[8]*n,d=e[9]*i,y=e[10]*o,v=a+f+y,g=0;return v>0?(g=2*Math.sqrt(v+1),t[3]=.25*g,t[0]=(h-d)/g,t[1]=(p-u)/g,t[2]=(s-c)/g):a>f&&a>y?(g=2*Math.sqrt(1+a-f-y),t[3]=(h-d)/g,t[0]=.25*g,t[1]=(s+c)/g,t[2]=(p+u)/g):f>y?(g=2*Math.sqrt(1+f-a-y),t[3]=(p-u)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(h+d)/g):(g=2*Math.sqrt(1+y-a-f),t[3]=(s-c)/g,t[0]=(p+u)/g,t[1]=(h+d)/g,t[2]=.25*g),t}function Rt(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,f=i*u,h=i*l,p=i*c,d=o*l,y=o*c,v=a*c,g=s*u,m=s*l,b=s*c,x=n[0],w=n[1],_=n[2];return t[0]=(1-(d+v))*x,t[1]=(h+b)*x,t[2]=(p-m)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+v))*w,t[6]=(y+g)*w,t[7]=0,t[8]=(p+m)*_,t[9]=(y-g)*_,t[10]=(1-(f+d))*_,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Dt(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,f=s+s,h=o*l,p=o*c,d=o*f,y=a*c,v=a*f,g=s*f,m=u*l,b=u*c,x=u*f,w=n[0],_=n[1],S=n[2],E=i[0],k=i[1],T=i[2],C=(1-(y+g))*w,O=(p+x)*w,A=(d-b)*w,P=(p-x)*_,M=(1-(h+g))*_,I=(v+m)*_,L=(d+b)*S,j=(v-m)*S,N=(1-(h+y))*S;return t[0]=C,t[1]=O,t[2]=A,t[3]=0,t[4]=P,t[5]=M,t[6]=I,t[7]=0,t[8]=L,t[9]=j,t[10]=N,t[11]=0,t[12]=r[0]+E-(C*E+P*k+L*T),t[13]=r[1]+k-(O*E+M*k+j*T),t[14]=r[2]+T-(A*E+I*k+N*T),t[15]=1,t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,l=r*a,c=n*a,f=n*s,h=i*a,p=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-f-d,t[1]=c+g,t[2]=h-v,t[3]=0,t[4]=c-g,t[5]=1-l-d,t[6]=p+y,t[7]=0,t[8]=h+v,t[9]=p-y,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ft(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function zt(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}var Ut=zt;function Gt(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=i*o,t[14]=i*n*o):(t[10]=-1,t[14]=-n),t}function Vt(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*l*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ht(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t}var Wt=Ht;function qt(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=o*l,t[15]=1,t}function Yt(t,e,r,n){var i,o,a,s,u,c,f,h,p,d,y=e[0],v=e[1],g=e[2],m=n[0],b=n[1],x=n[2],w=r[0],_=r[1],S=r[2];return Math.abs(y-w)0&&(c*=p=1/Math.sqrt(p),f*=p,h*=p);var d=u*h-l*f,y=l*c-s*h,v=s*f-u*c;return(p=d*d+y*y+v*v)>0&&(d*=p=1/Math.sqrt(p),y*=p,v*=p),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=f*v-h*y,t[5]=h*d-c*v,t[6]=c*y-f*d,t[7]=0,t[8]=c,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Zt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Jt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Qt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function $t(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function ee(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]}function re(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=t[8],h=t[9],p=t[10],d=t[11],y=t[12],v=t[13],g=t[14],m=t[15],b=e[0],x=e[1],w=e[2],_=e[3],S=e[4],E=e[5],k=e[6],T=e[7],C=e[8],O=e[9],A=e[10],P=e[11],M=e[12],I=e[13],L=e[14],j=e[15];return Math.abs(r-b)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-x)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-w)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-_)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(s-E)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(u-k)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-T)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(f-C)<=l.EPSILON*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-O)<=l.EPSILON*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(p-A)<=l.EPSILON*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(d-P)<=l.EPSILON*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(y-M)<=l.EPSILON*Math.max(1,Math.abs(y),Math.abs(M))&&Math.abs(v-I)<=l.EPSILON*Math.max(1,Math.abs(v),Math.abs(I))&&Math.abs(g-L)<=l.EPSILON*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(m-j)<=l.EPSILON*Math.max(1,Math.abs(m),Math.abs(j))}var ne=mt,ie=Qt,oe=r(4010);function ae(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function se(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ue(t,e,r,n){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function le(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ce(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function fe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function he(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function pe(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function de(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function ye(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function ve(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function ge(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function me(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function be(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function xe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function we(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function _e(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}function Se(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function Ee(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function ke(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Te(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Ce(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function Oe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function Ae(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Pe(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],l=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],h=e[2],p=e[3];return t[0]=f*l-h*u+p*s,t[1]=-c*l+h*a-p*o,t[2]=c*u-f*a+p*i,t[3]=-c*s+f*o-h*i,t}function Me(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function Ie(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*l.RANDOM()-1)*r+(n=2*l.RANDOM()-1)*n}while(a>=1);do{s=(i=2*l.RANDOM()-1)*i+(o=2*l.RANDOM()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function Le(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function je(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],l=r[3],c=l*n+s*o-u*i,f=l*i+u*n-a*o,h=l*o+a*i-s*n,p=-a*n-s*i-u*o;return t[0]=c*l+p*-a+f*-u-h*-s,t[1]=f*l+p*-s+h*-a-c*-u,t[2]=h*l+p*-u+c*-s-f*-a,t[3]=e[3],t}function Ne(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function Re(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Be(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var Fe,ze=he,Ue=pe,Ge=de,Ve=_e,He=Se,We=Ee,qe=ke,Ye=(Fe=ae(),function(t,e,r,n,i,o){var a,s;for(e||(e=4),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;al.EPSILON?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function Qe(t,e){var r=Cr(t,e);return Math.acos(2*r*r-1)}function $e(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-n*l,t[2]=o*c+a*l+n*u-i*s,t[3]=a*c-n*s-i*u-o*l,t}function tr(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function er(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function rr(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function nr(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function ir(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function or(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function ar(t,e,r){return or(t,e),Tr(t,t,r),ir(t,t),t}function sr(t,e,r,n){var i,o,a,s,u,c=e[0],f=e[1],h=e[2],p=e[3],d=r[0],y=r[1],v=r[2],g=r[3];return(o=c*d+f*y+h*v+p*g)<0&&(o=-o,d=-d,y=-y,v=-v,g=-g),1-o>l.EPSILON?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*f+u*y,t[2]=s*h+u*v,t[3]=s*p+u*g,t}function ur(t){var e=l.RANDOM(),r=l.RANDOM(),n=l.RANDOM(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function lr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function cr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function fr(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function hr(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),l=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}function pr(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var dr,yr,vr,gr,mr,br,xr=se,wr=ue,_r=le,Sr=ce,Er=fe,kr=$e,Tr=xe,Cr=Ae,Or=Me,Ar=Ee,Pr=Ar,Mr=ke,Ir=Mr,Lr=Oe,jr=De,Nr=Be,Rr=(dr=oe.create(),yr=oe.fromValues(1,0,0),vr=oe.fromValues(0,1,0),function(t,e,r){var n=oe.dot(e,r);return n<-.999999?(oe.cross(dr,yr,e),oe.len(dr)<1e-6&&oe.cross(dr,vr,e),oe.normalize(dr,dr),Ke(t,dr,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(oe.cross(dr,e,r),t[0]=dr[0],t[1]=dr[1],t[2]=dr[2],t[3]=1+n,Lr(t,t))}),Dr=(gr=Xe(),mr=Xe(),function(t,e,r,n,i,o){return sr(gr,e,i,o),sr(mr,r,n,o),sr(t,gr,mr,2*o*(1-o)),t}),Br=(br=st.create(),function(t,e,r,n){return br[0]=r[0],br[3]=r[1],br[6]=r[2],br[1]=n[0],br[4]=n[1],br[7]=n[2],br[2]=-e[0],br[5]=-e[1],br[8]=-e[2],Lr(t,fr(t,br))});function Fr(){var t=new l.ARRAY_TYPE(8);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function zr(t){var e=new l.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Ur(t,e,r,n,i,o,a,s){var u=new l.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function Gr(t,e,r,n,i,o,a){var s=new l.ARRAY_TYPE(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,c=.5*o,f=.5*a;return s[4]=u*n+c*r-f*e,s[5]=c*n+f*t-u*r,s[6]=f*n+u*e-c*t,s[7]=-u*t-c*e-f*r,s}function Vr(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],l=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=l,t[4]=n*l+i*u-o*s,t[5]=i*l+o*a-n*u,t[6]=o*l+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function Hr(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Wr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function qr(t,e){var r=Xe();Nt(r,e);var n=new l.ARRAY_TYPE(3);return Lt(n,e),Vr(t,r,n),t}function Yr(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}function Xr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Zr(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Kr=_r;function Jr(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Qr=_r;function $r(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function tn(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],l=e[3];return t[0]=2*(r*l+o*a+n*u-i*s),t[1]=2*(n*l+o*s+i*a-r*u),t[2]=2*(i*l+o*u+r*s-n*a),t}function en(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],l=.5*r[2],c=e[4],f=e[5],h=e[6],p=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*l-o*u+c,t[5]=a*u+o*s-n*l+f,t[6]=a*l+n*u-i*s+h,t[7]=-n*s-i*u-o*l+p,t}function rn(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return tr(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function nn(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return er(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function on(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return rr(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function an(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],l=e[2],c=e[3];return t[0]=s*a+c*n+u*o-l*i,t[1]=u*a+c*i+l*n-s*o,t[2]=l*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-l*o,s=e[4],u=e[5],l=e[6],c=e[7],t[4]=s*a+c*n+u*o-l*i,t[5]=u*a+c*i+l*n-s*o,t[6]=l*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-l*o,t}function sn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-n*l,t[2]=o*c+a*l+n*u-i*s,t[3]=a*c-n*s-i*u-o*l,s=r[4],u=r[5],l=r[6],c=r[7],t[4]=n*c+a*s+i*l-o*u,t[5]=i*c+a*u+o*s-n*l,t[6]=o*c+a*l+n*u-i*s,t[7]=a*c-n*s-i*u-o*l,t}function un(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],l=e[6],c=e[7],f=n*s+i*u+o*l+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(l-o*f)/r,t[7]=(c-a*f)/r}return t}function _n(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Sn(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]}function En(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=e[0],h=e[1],p=e[2],d=e[3],y=e[4],v=e[5],g=e[6],m=e[7];return Math.abs(r-f)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-h)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-p)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-v)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-g)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-m)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(m))}var kn=r(8699)},8610:function(t,e,r){"use strict";r.r(e),r.d(e,{add:function(){return O},adjoint:function(){return p},clone:function(){return a},copy:function(){return s},create:function(){return i},determinant:function(){return d},equals:function(){return L},exactEquals:function(){return I},frob:function(){return C},fromMat2d:function(){return _},fromMat4:function(){return o},fromQuat:function(){return S},fromRotation:function(){return x},fromScaling:function(){return w},fromTranslation:function(){return b},fromValues:function(){return u},identity:function(){return c},invert:function(){return h},mul:function(){return j},multiply:function(){return y},multiplyScalar:function(){return P},multiplyScalarAndAdd:function(){return M},normalFromMat4:function(){return E},projection:function(){return k},rotate:function(){return g},scale:function(){return m},set:function(){return l},str:function(){return T},sub:function(){return N},subtract:function(){return A},translate:function(){return v},transpose:function(){return f}});var n=r(8428);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function a(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function s(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}function u(t,e,r,i,o,a,s,u,l){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=o,c[5]=a,c[6]=s,c[7]=u,c[8]=l,c}function l(t,e,r,n,i,o,a,s,u,l){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function f(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function h(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=c*a-s*l,h=-c*o+s*u,p=l*o-a*u,d=r*f+n*h+i*p;return d?(d=1/d,t[0]=f*d,t[1]=(-c*n+i*l)*d,t[2]=(s*n-i*a)*d,t[3]=h*d,t[4]=(c*r-i*u)*d,t[5]=(-s*r+i*o)*d,t[6]=p*d,t[7]=(-l*r+n*u)*d,t[8]=(a*r-n*o)*d,t):null}function p(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8];return t[0]=a*c-s*l,t[1]=i*l-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*l-a*u,t[7]=n*u-r*l,t[8]=r*a-n*o,t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8];return e*(l*o-a*u)+r*(-l*i+a*s)+n*(u*i-o*s)}function y(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=r[0],p=r[1],d=r[2],y=r[3],v=r[4],g=r[5],m=r[6],b=r[7],x=r[8];return t[0]=h*n+p*a+d*l,t[1]=h*i+p*s+d*c,t[2]=h*o+p*u+d*f,t[3]=y*n+v*a+g*l,t[4]=y*i+v*s+g*c,t[5]=y*o+v*u+g*f,t[6]=m*n+b*a+x*l,t[7]=m*i+b*s+x*c,t[8]=m*o+b*u+x*f,t}function v(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+p*a+l,t[7]=h*i+p*s+c,t[8]=h*o+p*u+f,t}function g(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=Math.sin(r),p=Math.cos(r);return t[0]=p*n+h*a,t[1]=p*i+h*s,t[2]=p*o+h*u,t[3]=p*a-h*n,t[4]=p*s-h*i,t[5]=p*u-h*o,t[6]=l,t[7]=c,t[8]=f,t}function m(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function _(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,l=r*a,c=n*a,f=n*s,h=i*a,p=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-f-d,t[3]=c-g,t[6]=h+v,t[1]=c+g,t[4]=1-l-d,t[7]=p-y,t[2]=h-v,t[5]=p+y,t[8]=1-l-f,t}function E(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,x=r*l-o*a,w=n*u-i*s,_=n*l-o*s,S=i*l-o*u,E=c*y-f*d,k=c*v-h*d,T=c*g-p*d,C=f*v-h*y,O=f*g-p*y,A=h*g-p*v,P=m*A-b*O+x*C+w*T-_*k+S*E;return P?(P=1/P,t[0]=(s*A-u*O+l*C)*P,t[1]=(u*T-a*A-l*k)*P,t[2]=(a*O-s*T+l*E)*P,t[3]=(i*O-n*A-o*C)*P,t[4]=(r*A-i*T+o*k)*P,t[5]=(n*T-r*O-o*E)*P,t[6]=(y*S-v*_+g*w)*P,t[7]=(v*x-d*S-g*b)*P,t[8]=(d*_-y*x+g*m)*P,t):null}function k(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function T(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function C(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function A(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function M(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function I(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]}function L(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=e[0],p=e[1],d=e[2],y=e[3],v=e[4],g=e[5],m=e[6],b=e[7],x=e[8];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-p)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-g)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(l-m)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(f-x)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(x))}var j=y,N=A},8699:function(t,e,r){"use strict";r.r(e),r.d(e,{add:function(){return l},angle:function(){return R},ceil:function(){return p},clone:function(){return o},copy:function(){return s},create:function(){return i},cross:function(){return O},dist:function(){return q},distance:function(){return x},div:function(){return W},divide:function(){return h},dot:function(){return C},equals:function(){return z},exactEquals:function(){return F},floor:function(){return d},forEach:function(){return Z},fromValues:function(){return a},inverse:function(){return k},len:function(){return G},length:function(){return _},lerp:function(){return A},max:function(){return v},min:function(){return y},mul:function(){return H},multiply:function(){return f},negate:function(){return E},normalize:function(){return T},random:function(){return P},rotate:function(){return N},round:function(){return g},scale:function(){return m},scaleAndAdd:function(){return b},set:function(){return u},sqrDist:function(){return Y},sqrLen:function(){return X},squaredDistance:function(){return w},squaredLength:function(){return S},str:function(){return B},sub:function(){return V},subtract:function(){return c},transformMat2:function(){return M},transformMat2d:function(){return I},transformMat3:function(){return L},transformMat4:function(){return j},zero:function(){return D}});var n=r(8428);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,r){return t[0]=e,t[1]=r,t}function l(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function h(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function d(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function y(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function v(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function g(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function _(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function S(t){var e=t[0],r=t[1];return e*e+r*r}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function k(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function T(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function C(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function A(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function P(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function M(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function I(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function j(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function N(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function R(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function D(t){return t[0]=0,t[1]=0,t}function B(t){return"vec2("+t[0]+", "+t[1]+")"}function F(t,e){return t[0]===e[0]&&t[1]===e[1]}function z(t,e){var r=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))}var U,G=_,V=c,H=f,W=h,q=x,Y=w,X=S,Z=(U=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=2),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function C(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function A(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function P(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,l=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*l+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*l+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*l+i[2]*c,t}function M(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,l=s*a,c=3*o*s,f=3*u*a,h=u*o;return t[0]=e[0]*l+r[0]*c+n[0]*f+i[0]*h,t[1]=e[1]*l+r[1]*c+n[1]*f+i[1]*h,t[2]=e[2]*l+r[2]*c+n[2]*f+i[2]*h,t}function I(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function j(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function N(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],l=e[2],c=i*l-o*u,f=o*s-n*l,h=n*u-i*s,p=i*h-o*f,d=o*c-n*h,y=n*f-i*c,v=2*a;return c*=v,f*=v,h*=v,p*=2,d*=2,y*=2,t[0]=s+c+p,t[1]=u+f+d,t[2]=l+h+y,t}function R(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function D(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function B(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function F(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),l=u&&C(t,e)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function z(t){return t[0]=0,t[1]=0,t[2]=0,t}function U(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function G(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var H,W=f,q=h,Y=p,X=w,Z=_,K=a,J=S,Q=(H=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},2138:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var i=200,o="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Boolean]",l="[object Date]",c="[object Function]",f="[object GeneratorFunction]",h="[object Map]",p="[object Number]",d="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",m="[object Symbol]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",S="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",C="[object Uint8ClampedArray]",O="[object Uint16Array]",A="[object Uint32Array]",P=/\w*$/,M=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,L={};L[s]=L["[object Array]"]=L[b]=L[x]=L[u]=L[l]=L[w]=L[_]=L[S]=L[E]=L[k]=L[h]=L[p]=L[d]=L[y]=L[v]=L[g]=L[m]=L[T]=L[C]=L[O]=L[A]=!0,L["[object Error]"]=L[c]=L["[object WeakMap]"]=!1;var j="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,N="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,R=j||N||Function("return this")(),D="object"==n(e)&&e&&!e.nodeType&&e,B=D&&"object"==n(t)&&t&&!t.nodeType&&t,F=B&&B.exports===D;function z(t,e){return t.set(e[0],e[1]),t}function U(t,e){return t.add(e),t}function G(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},Ct.prototype.set=function(t,e){var r=this.__data__,n=It(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new Tt,map:new(dt||Ct),string:new Tt}},Ot.prototype.delete=function(t){return Dt(this,t).delete(t)},Ot.prototype.get=function(t){return Dt(this,t).get(t)},Ot.prototype.has=function(t){return Dt(this,t).has(t)},Ot.prototype.set=function(t,e){return Dt(this,t).set(t,e),this},At.prototype.clear=function(){this.__data__=new Ct},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ct){var n=r.__data__;if(!dt||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=a}(t.length)&&!Xt(t)}var Yt=ft||function(){return!1};function Xt(t){var e=Zt(t)?et.call(t):"";return e==c||e==f}function Zt(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function Kt(t){return qt(t)?Pt(t):function(t){if(!Gt(t))return ht(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Lt(t,!0,!0)}},7820:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=9007199254740991,o="[object Arguments]",a="[object Function]",s="[object GeneratorFunction]",u="[object Map]",l="[object Set]",c=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")();function y(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!X(t)}function X(t){var e=Z(t)?k.call(t):"";return e==a||e==s}function Z(t){var e=n(t);return!!t&&("object"==e||"function"==e)}var K,J=(K=function(t){return Y(t)?F(t):U(t)},function(t){var e,r,n,i=V(t);return i==u?(e=t,r=-1,n=Array(e.size),e.forEach(function(t,e){n[++r]=[e,t]}),n):i==l?function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=[t,t]}),r}(t):y(t,K(t))});t.exports=J},9819:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var i=200,o="Expected a function",a="__lodash_hash_undefined__",s=1,u=2,l=1/0,c=9007199254740991,f="[object Arguments]",h="[object Array]",p="[object Boolean]",d="[object Date]",y="[object Error]",v="[object Function]",g="[object GeneratorFunction]",m="[object Map]",b="[object Number]",x="[object Object]",w="[object RegExp]",_="[object Set]",S="[object String]",E="[object Symbol]",k="[object ArrayBuffer]",T="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,P=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[f]=j[h]=j[k]=j[p]=j[T]=j[d]=j[y]=j[v]=j[m]=j[b]=j[x]=j[w]=j[_]=j[S]=j["[object WeakMap]"]=!1;var N="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,R="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,D=N||R||Function("return this")(),B="object"==n(e)&&e&&!e.nodeType&&e,F=B&&"object"==n(t)&&t&&!t.nodeType&&t,z=F&&F.exports===B&&N.process,U=function(){try{return z&&z.binding("util")}catch(t){}}(),G=U&&U.isTypedArray;function V(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var i=t.length,o=r+(n?1:-1);for(;n?o--:++o-1}function H(t,e,r){for(var n=-1,i=t?t.length:0;++n-1},At.prototype.set=function(t,e){var r=this.__data__,n=jt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Pt.prototype.clear=function(){this.__data__={hash:new Ot,map:new(yt||At),string:new Ot}},Pt.prototype.delete=function(t){return Ht(this,t).delete(t)},Pt.prototype.get=function(t){return Ht(this,t).get(t)},Pt.prototype.has=function(t){return Ht(this,t).has(t)},Pt.prototype.set=function(t,e){return Ht(this,t).set(t,e),this},Mt.prototype.add=Mt.prototype.push=function(t){return this.__data__.set(t,a),this},Mt.prototype.has=function(t){return this.__data__.has(t)},It.prototype.clear=function(){this.__data__=new At},It.prototype.delete=function(t){return this.__data__.delete(t)},It.prototype.get=function(t){return this.__data__.get(t)},It.prototype.has=function(t){return this.__data__.has(t)},It.prototype.set=function(t,e){var r=this.__data__;if(r instanceof At){var n=r.__data__;if(!yt||n.lengthl))return!1;var f=o.get(t);if(f&&o.get(e))return f==e;var h=-1,p=!0,d=i&s?new Mt:void 0;for(o.set(t,e),o.set(e,t);++h-1&&t%1==0&&t-1&&t%1==0&&t<=c}function se(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function ue(t){return!!t&&"object"==n(t)}function le(t){return"symbol"==n(t)||ue(t)&&st.call(t)==E}var ce=G?function(t){return function(e){return t(e)}}(G):function(t){return ue(t)&&ae(t.length)&&!!j[st.call(t)]};function fe(t){return ie(t)?Lt(t):zt(t)}function he(t){return t}t.exports=function(t,e){return t&&t.length?function(t,e,r){var n=-1,o=V,a=t.length,s=!0,u=[],l=u;if(r)s=!1,o=H;else if(a>=i){var c=e?null:Gt(t);if(c)return K(c);s=!1,o=Y,l=new Mt}else l=e?[]:u;t:for(;++n-1&&t%1==0&&t<=e}},9505:function(t,e,r){var n=r(5244),i=r(8223),o="[object Number]";t.exports=function(t){return"number"==typeof t||i(t)&&n(t)==o}},8223:function(t){function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!=t&&"object"==e(t)}},4361:function(t,e,r){var n=r(5244),i=r(2264),o=r(8223),a="[object Object]",s=Function.prototype,u=Object.prototype,l=s.toString,c=u.hasOwnProperty,f=l.call(Object);t.exports=function(t){if(!o(t)||n(t)!=a)return!1;var e=i(t);if(null===e)return!0;var r=c.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==f}},9906:function(t,e,r){var n=r(4323),i=r(9679),o=r(5684),a=o&&o.isTypedArray,s=a?i(a):n;t.exports=s},7367:function(t,e,r){var n,i,o,a;function s(t){"@babel/helpers - typeof";return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),window,a=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==s(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,r){(function(e){var n=r(0),i=r(35),o=t.exports=n.util=n.util||{};function a(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function u(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(o.isArrayBuffer(t)||o.isArrayBufferView(t))if("undefined"!=typeof Buffer&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var r=0;r15?(r=Date.now(),a(t)):(e.push(t),1===e.length&&i.setAttribute("a",n=!n))}}o.nextTick=o.setImmediate}(),o.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,o.globalScope=o.isNodejs?e:"undefined"==typeof self?window:self,o.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},o.isArrayBufferView=function(t){return t&&o.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},o.ByteBuffer=u,o.ByteStringBuffer=u,o.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},o.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},o.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},o.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(o.encodeUtf8(t))},o.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},o.ByteStringBuffer.prototype.putInt=function(t,e){a(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e},o.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},o.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},o.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var t=o.createBuffer(this.data);return t.read=this.read,t},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},o.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},o.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(t,e){a(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},o.DataBuffer.prototype.putSignedInt=function(t,e){return a(e),this.accommodate(e/8),t<0&&(t+=2<0);return e},o.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},o.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},o.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},o.xorBytes=function(t,e,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+o},o.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(t,e){for(var r,n,i,o="",a="",s=0;s>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+o},o.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",a=0;a>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},o.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},o.decodeUtf8=function(t){return decodeURIComponent(escape(t))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},o.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},o.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+o},o.binary.base64.decode=function(t,e,r){var n,i,o,a,s=e;s||(s=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==o&&(s[l++]=(15&i)<<4|o>>2,64!==a&&(s[l++]=(3&o)<<6|a));return e?l-r:s.subarray(0,l)},o.binary.base58.encode=function(t,e){return o.binary.baseN.encode(t,f,e)},o.binary.base58.decode=function(t,e){return o.binary.baseN.decode(t,f,e)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(t,e,r){t=o.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,a=0;a0&&o.push(r),a=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},o.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-l).toFixed(o).slice(2):"")},o.formatSize=function(t){return t>=1073741824?o.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?o.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?o.formatNumber(t/1024,0)+" KiB":o.formatNumber(t,0)+" bytes"},o.bytesFromIP=function(t){return-1!==t.indexOf(".")?o.bytesFromIPv4(t):-1!==t.indexOf(":")?o.bytesFromIPv6(t):null},o.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=o.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(a)}if(r.length>0){var l=r[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},o.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in o&&!t.update)return e(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,e(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,e(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,e(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()s.st&&i.sti.st&&s.ste){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;ur){if(a.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=r,d.requested=p,d}p=r}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(o(e,r,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),r-=2;break}s=e.length(),f.push(t(e,r,n+1,a)),r-=s-e.length()}else for(;p>0;)s=e.length(),f.push(t(e,p,n+1,a)),r-=s-e.length(),p-=s-e.length();if(void 0===f&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&a.decodeBitStrings&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&p>1){var v=e.read,g=r,m=0;if(c===i.Type.BITSTRING&&(o(e,r,1),m=e.getByte(),r--),0===m)try{s=e.length();var b=t(e,r,n+1,{strict:!0,decodeBitStrings:!0}),x=s-e.length();r-=x,c==i.Type.BITSTRING&&x++;var w=b.tagClass;x!==p||w!==i.Class.UNIVERSAL&&w!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(t){}void 0===f&&(e.read=v,r=g)}if(void 0===f){if(void 0===p){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=r}if(c===i.Type.BMPSTRING)for(f="";p>0;p-=2)o(e,r,2),f+=String.fromCharCode(e.getInt16()),r-=2;else f=e.getBytes(p),r-=p}var _=void 0===h?null:{bitStringContents:h};return i.create(l,c,y,f,_)}(t,t.length(),0,e);if(e.parseAllBytes&&0!==t.length()){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=t.length(),s}return a},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=i.equals(t,t.original))),a)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var s=0;s1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(e.putByte(128|l.length),s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,r,i,o,a=t.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,e||(o|=128),r.push(o),e=!1}while(i>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}return s},i.derToOid=function(t){var e;"string"==typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},i.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var f=t.length-5,h=t.charAt(f);return"+"!==h&&"-"!==h||(l=60*parseInt(t.substr(f+1,2),10)+parseInt(t.substr(f+4,2),10),l*=6e4,"+"===h&&(l*=-1),c=!0),"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,u),e.setTime(+e+l)):(e.setFullYear(r,n,i),e.setHours(o,a,s,u)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},i.derToInteger=function(t){"string"==typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,o){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&n.util.isArray(e.value))for(var s=0,u=0;a&&u0&&(o+="\n");for(var s="",u=0;u1?o+="0x"+n.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var h=t.value.charCodeAt(0);1==h?o+=" (1 unused bit shown)":h>1&&(o+=" ("+h+" unused bits shown)")}}else if(t.type===i.Type.OCTETSTRING)a.test(t.value)||(o+="("+t.value+") "),o+="0x"+n.util.bytesToHex(t.value);else if(t.type===i.Type.UTF8)try{o+=n.util.decodeUtf8(t.value)}catch(e){if("URI malformed"!==e.message)throw e;o+="0x"+n.util.bytesToHex(t.value)+" (malformed UTF8)"}else t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:a.test(t.value)?o+="0x"+n.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},function(t,e,r){var n=r(0);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.aes.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){c||f();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return p(r._w,t,e,!1)},decrypt:function(t,e){return p(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i>>=2,i=0;i>8^255&f^99,o[y]=f,a[f]=y,p=(h=t[f])<<24^f<<16^f<<8^f^h,d=((r=t[y])^(n=t[r])^(i=t[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,l[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^t[t[t[r^i]]],v^=t[t[v]])}}function h(t,e){for(var r,n=t.slice(0),i=1,a=n.length,u=4*(a+6+1),c=a;c>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^s[i]<<24,i++):a>6&&c%a==4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[c]=n[c-a]^r;if(e){for(var f,h=l[0],p=l[1],d=l[2],y=l[3],v=n.slice(0),g=(c=0,(u=n.length)-4);c>>24]]^p[o[f>>>16&255]]^d[o[f>>>8&255]]^y[o[255&f]];n=v}return n}function p(t,e,r,n){var i,s,c,f,h,p,d,y,v,g,m,b,x=t.length/4-1;n?(i=l[0],s=l[1],c=l[2],f=l[3],h=a):(i=u[0],s=u[1],c=u[2],f=u[3],h=o),p=e[0]^t[0],d=e[n?3:1]^t[1],y=e[2]^t[2],v=e[n?1:3]^t[3];for(var w=3,_=1;_>>24]^s[d>>>16&255]^c[y>>>8&255]^f[255&v]^t[++w],m=i[d>>>24]^s[y>>>16&255]^c[v>>>8&255]^f[255&p]^t[++w],b=i[y>>>24]^s[v>>>16&255]^c[p>>>8&255]^f[255&d]^t[++w],v=i[v>>>24]^s[p>>>16&255]^c[d>>>8&255]^f[255&y]^t[++w],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^t[++w],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^t[++w],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^t[++w],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^t[++w]}function d(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(0);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function o(t,e){i[t]=e,i[e]=t}function a(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("1.3.14.3.2.29","sha1WithRSASignature"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("2.16.840.1.101.3.4.2.4","sha224"),o("2.16.840.1.101.3.4.2.5","sha512-224"),o("2.16.840.1.101.3.4.2.6","sha512-256"),o("1.2.840.113549.2.2","md2"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.4","surname"),o("2.5.4.5","serialNumber"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.12","title"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("2.5.4.42","givenName"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,r){var n=r(0);r(1);var i=t.exports=n.pem=n.pem||{};function o(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i65&&-1!==a){var s=e[a];","===s?(++a,e=e.substr(0,a)+"\r\n "+e.substr(a)):e=e.substr(0,a)+"\r\n"+s+e.substr(a+1),o=i-a-1,a=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(a=i);return e}function a(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=o(r)),t.headers)for(var a=0;ae.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),l=a.length(),u=0;u>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),s(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(h,r,a);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var o=null,a=!1;function s(t,e,r){for(var n,i,o,a,s,u,l,c=r.length();c>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<20;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<32;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<40;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<60;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<80;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}},function(t,e,r){var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.des.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return p(r._keys,t,e,!1)},decrypt:function(t,e){return p(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=t.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,x=0;x>>4^_))<<4,w^=e=65535&((_^=e)>>>-16^w),w^=(e=858993459&(w>>>2^(_^=e<<-16)))<<2,w^=e=65535&((_^=e)>>>-16^w),w^=(e=1431655765&(w>>>1^(_^=e<<-16)))<<1,w^=e=16711935&((_^=e)>>>8^w),e=(w^=(e=1431655765&(w>>>1^(_^=e<<8)))<<1)<<8|(_^=e)>>>20&240,w=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=e;for(var S=0;S>>26,_=_<<2|_>>>26):(w=w<<1|w>>>27,_=_<<1|_>>>27);var E=r[(w&=-15)>>>28]|n[w>>>24&15]|i[w>>>20&15]|o[w>>>16&15]|a[w>>>12&15]|s[w>>>8&15]|u[w>>>4&15],k=l[(_&=-15)>>>28]|c[_>>>24&15]|f[_>>>20&15]|h[_>>>16&15]|p[_>>>12&15]|d[_>>>8&15]|y[_>>>4&15];e=65535&(k>>>16^E),g[b++]=E^e,g[b++]=k^e<<16}}return g}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],l=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],c=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(t,e,r,n){var i,p,d=32===t.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=e[0],v=e[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g>>4|v<<28)^t[x+1];p=y,y=v,v=p^(a[w>>>24&63]|u[w>>>16&63]|c[w>>>8&63]|h[63&w]|o[_>>>24&63]|s[_>>>16&63]|l[_>>>8&63]|f[63&_])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(16):null,a=n.asn1,u=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var l=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},y={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},v=function(t){var e;if(!(t.algorithm in l.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=l.oids[t.algorithm];var n=a.oidToDer(e).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},g=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var a=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u.multiply(o.modInverse(e.n)).mod(e.n)};function m(t,e,r){var i=n.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s,u=o-3-t.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function x(t,e,r){"function"==typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function a(){s(t.pBits,function(e,n){return e?r(e):(t.p=n,null!==t.q?u(e,t.q):void s(t.qBits,u))})}function s(t,e){n.prime.generateProbablePrime(t,o,e)}function u(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void a();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void s(t.qBits,u);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void a();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void s(t.qBits,u);var c=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(o.prng=e.prng),a()}function w(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function _(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function S(t){return n.util.isNodejs&&"function"==typeof o[t]}function E(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.crypto)&&"object"==s(u.globalScope.crypto.subtle)&&"function"==typeof u.globalScope.crypto.subtle[t]}function k(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.msCrypto)&&"object"==s(u.globalScope.msCrypto.subtle)&&"function"==typeof u.globalScope.msCrypto.subtle[t]}function T(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},l.rsa.decrypt=function(t,e,r,o){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new i(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=g(u,e,r).toString(16),c=n.util.createBuffer(),f=a-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==o?b(c.getBytes(),e,r):c.getBytes()},l.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,a=(r=r||{}).prng||n.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),r=0;r>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},l.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,a=function(t,e){return t|e},s=+new Date,u=0;null===t.keys&&(e<=0||uf?t.pqState=0:t.num.isProbablePrime(_(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var p=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,p,t.p,t.q,p.mod(t.p1),p.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)}}u+=(n=+new Date)-s,s=n}return null!==t.keys},l.rsa.generateKeyPair=function(t,e,r,i){if(1===arguments.length?"object"==s(t)?(r=t,t=void 0):"function"==typeof t&&(i=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(i=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(i){if(S("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(t,e,r){if(t)return i(t);i(null,{privateKey:l.privateKeyFromPem(r),publicKey:l.publicKeyFromPem(e)})});if(E("generateKey")&&E("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:T(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return u.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){i(t)}).then(function(t){if(t){var e=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:e,publicKey:l.setRsaPublicKey(e.n,e.e)})}});if(k("generateKey")&&k("exportKey")){var c=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:T(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=u.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:r,publicKey:l.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){i(t)}},void(c.onerror=function(t){i(t)})}}else if(S("generateKeyPairSync")){var f=o.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:l.privateKeyFromPem(f.privateKey),publicKey:l.publicKeyFromPem(f.publicKey)}}var h=l.rsa.createKeyPairGenerationState(t,e,r);if(!i)return l.rsa.stepKeyPairGenerationState(h,0),h.keys;x(h,r,i)},l.setRsaPublicKey=l.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return m(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return l.rsa.encrypt(o,r,!0)},verify:function(t,e,i,o){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===o&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(t,e){e=b(e,r,!0);var i=a.fromDer(e,{parseAllBytes:o._parseAllDigestBytes}),s={},u=[];if(!a.validate(i,y,s,u))throw(l=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,l;var l,c=a.derToOid(s.algorithmIdentifier);if(c!==n.oids.md2&&c!==n.oids.md5&&c!==n.oids.sha1&&c!==n.oids.sha224&&c!==n.oids.sha256&&c!==n.oids.sha384&&c!==n.oids.sha512&&c!==n.oids["sha512-224"]&&c!==n.oids["sha512-256"])throw(l=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=c,l;if(!(c!==n.oids.md2&&c!==n.oids.md5||"parameters"in s))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return t===s.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(t,e){return t===b(e,r,!0)}});var s=l.rsa.decrypt(e,r,!0,!1);return i.verify(t,s,r.n.bitLength())}};return r},l.setRsaPrivateKey=l.rsa.setPrivateKey=function(t,e,r,i,o,a,s,u){var c={n:t,e:e,d:r,p:i,q:o,dP:a,dQ:s,qInv:u,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=l.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:b};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,c,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:v},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,c.n.bitLength());return l.rsa.encrypt(n,c,r)}};return c},l.wrapRsaPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(t).getBytes())])},l.privateKeyFromAsn1=function(t){var e,r,o,s,u,c,p,d,y={},v=[];if(a.validate(t,f,y,v)&&(t=a.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!a.validate(t,h,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return e=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),u=n.util.createBuffer(y.privateKeyPrime2).toHex(),c=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),l.setRsaPrivateKey(new i(e,16),new i(r,16),new i(o,16),new i(s,16),new i(u,16),new i(c,16),new i(p,16),new i(d,16))},l.privateKeyToAsn1=l.privateKeyToRSAPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.qInv))])},l.publicKeyFromAsn1=function(t){var e={},r=[];if(a.validate(t,d,e,r)){var o,s=a.derToOid(e.publicKeyOid);if(s!==l.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;t=e.rsaPublicKey}if(r=[],!a.validate(t,p,e,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var u=n.util.createBuffer(e.publicKeyModulus).toHex(),c=n.util.createBuffer(e.publicKeyExponent).toHex();return l.setRsaPublicKey(new i(u,16),new i(c,16))},l.publicKeyToAsn1=l.publicKeyToSubjectPublicKeyInfo=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[l.publicKeyToRSAPublicKey(t)])])},l.publicKeyToRSAPublicKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.e))])}},function(t,e,r){var n,i=r(0);function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function s(t,e,r,n,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+r.data[n]+i)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return i}t.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+r.data[n]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var a=e*this.data[t++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(o.prototype.am=s,n=28),o.prototype.DB=n,o.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function y(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function E(t){return t}function k(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}y.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},y.prototype.revert=function(t){return t},y.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var s=8==r?255&t[n]:h(t,n);s<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e.data[r+a+1]=this.data[r]>>i|s,s=(this.data[r]&o)<=0;--r)e.data[r]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;n>0&&(e.data[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},o.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),o.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var w=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,w,r,b,0,f))0&&r.rShiftTo(c,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=a(),n=a(),i=e.convert(this),s=d(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var u=r;r=n,n=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(s>s)>0&&(i=!0,o=f(r));a>=0;)s>(s+=this.DB-e)):(r=this.data[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=f(r));return i?o:"0"},o.prototype.negate=function(){var t=a();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new y(e):new v(e),this.exp(t,r)},o.ZERO=p(0),o.ONE=p(1),S.prototype.convert=E,S.prototype.revert=E,S.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},S.prototype.sqrTo=function(t,e){t.squareTo(e)},k.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},k.prototype.revert=function(t){return t},k.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},k.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},k.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var T=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],C=(1<<26)/T[T.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=p(r),i=a(),o=a(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),a={nextBytes:function(t){for(var e=0;e=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var l=1;l++>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this.data[t]&(1<>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=a();return this.bitwiseTo(t,g,e),e},o.prototype.or=function(t){var e=a();return this.bitwiseTo(t,m,e),e},o.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,b,e),e},o.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,x,e),e},o.prototype.not=function(){for(var t=a(),e=0;e=this.t?0!=this.s:0!=(this.data[e]&1<1){var f=a();for(n.sqrTo(s[1],f);u<=c;)s[u]=a(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=t.t-1,b=!0,x=a();for(i=d(t.data[m])-1;m>=0;){for(i>=l?h=t.data[m]>>i-l&c:(h=(t.data[m]&(1<0&&(h|=t.data[m-1]>>this.DB+i-l)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(o),b=!1;else{for(;u>1;)n.sqrTo(o,x),n.sqrTo(x,o),u-=2;u>0?n.sqrTo(o,x):(g=o,o=x,x=g),n.mulTo(x,s[h],o)}for(;m>=0&&0==(t.data[m]&1<=0?(r.subTo(n,r),e&&i.subTo(s,i),a.subTo(u,a)):(n.subTo(r,n),e&&s.subTo(i,s),u.subTo(a,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new S)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=T[T.length-1]){for(e=0;e>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),c(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-s));for(var u,l=0,f=i.fullMessageLength.length-1;f>=0;--f)l=(u=8*i.fullMessageLength[f]+l)/4294967296>>>0,a.putInt32Le(u>>>0);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};c(h,r,a);var p=n.util.createBuffer();return p.putInt32Le(h.h0),p.putInt32Le(h.h1),p.putInt32Le(h.h2),p.putInt32Le(h.h3),p},i};var o=null,a=null,s=null,u=null,l=!1;function c(t,e,r){for(var n,i,o,l,c,f,h,p=r.length();p>=64;){for(i=t.h0,o=t.h1,l=t.h2,c=t.h3,h=0;h<16;++h)e[h]=r.getInt32Le(),n=i+(c^o&(l^c))+u[h]+e[h],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<32;++h)n=i+(l^c&(o^l))+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<48;++h)n=i+(o^l^c)+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<64;++h)n=i+(l^(o|~c))+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+l|0,t.h3=t.h3+c|0,p-=64}}},function(t,e,r){var n=r(0);r(8),r(4),r(1);var i,o=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(16)),t.exports=n.pbkdf2=o.pbkdf2=function(t,e,r,o,a,u){if("function"==typeof a&&(u=a,a=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===a||"object"!=s(a))&&(i.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),u?4===i.pbkdf2Sync.length?i.pbkdf2(t,e,r,o,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):i.pbkdf2(t,e,r,o,a,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,e,r,o).toString("binary"):i.pbkdf2Sync(t,e,r,o,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in n.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=n.md[a].create()}var l=a.digestLength;if(o>4294967295*l){var c=new Error("Derived key is too long.");if(u)return u(c);throw c}var f=Math.ceil(o/l),h=o-(f-1)*l,p=n.hmac.create();p.start(a,t);var d,y,v,g="";if(!u){for(var m=1;m<=f;++m){p.start(null,null),p.update(e),p.update(n.util.int32ToBytes(m)),d=v=p.digest().getBytes();for(var b=2;b<=r;++b)p.start(null,null),p.update(v),y=p.digest().getBytes(),d=n.util.xorBytes(d,y,l),v=y;g+=mf)return u(null,g);p.start(null,null),p.update(e),p.update(n.util.int32ToBytes(m)),d=v=p.digest().getBytes(),b=2,w()}function w(){if(b<=r)return p.start(null,null),p.update(v),y=p.digest().getBytes(),d=n.util.xorBytes(d,y,l),v=y,++b,n.util.setImmediate(w);g+=m128)throw new Error('Invalid "nsComment" content.');t.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&e.cert){var p=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=p.toHex(),t.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===t.name&&e.cert){if(t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=t.value.value,t.keyIdentifier){var d=!0===t.keyIdentifier?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;c.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(t.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===t.authorityCertIssuer?e.cert.issuer:t.authorityCertIssuer)])];c.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(t.serialNumber){var v=n.util.hexToBytes(!0===t.serialNumber?e.cert.serialNumber:t.serialNumber);c.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if("cRLDistributionPoints"===t.name){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=t.value.value;var g,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),x=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,e){u.md=v({signatureOid:u.signatureOid,type:"certificate"});var h=i.toDer(u.tbsCertificate);u.md.update(h.getBytes())}var p=n.md.sha1.create(),g=i.toDer(r.certIssuer);p.update(g.getBytes()),u.issuer.getField=function(t){return d(u.issuer,t)},u.issuer.addField=function(t){b([t]),u.issuer.attributes.push(t)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=p.digest().toHex();var m=n.md.sha1.create(),x=i.toDer(r.certSubject);return m.update(x.getBytes()),u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){b([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),e.digitalSignature=128==(128&r),e.nonRepudiation=64==(64&r),e.keyEncipherment=32==(32&r),e.dataEncipherment=16==(16&r),e.keyAgreement=8==(8&r),e.keyCertSign=4==(4&r),e.cRLSign=2==(2&r),e.encipherOnly=1==(1&r),e.decipherOnly=128==(128&o)}else if("basicConstraints"===e.name){(u=i.fromDer(e.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?e.cA=0!==u.value[0].value.charCodeAt(0):e.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(e.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===e.name)for(var u=i.fromDer(e.value),l=0;l1&&(r=u.value.charCodeAt(1)),e.client=128==(128&r),e.server=64==(64&r),e.email=32==(32&r),e.objsign=16==(16&r),e.reserved=8==(8&r),e.sslCA=4==(4&r),e.emailCA=2==(2&r),e.objCA=1==(1&r);else if("subjectAltName"===e.name||"issuerAltName"===e.name){var f;e.altNames=[],u=i.fromDer(e.value);for(var h=0;h=_&&t0&&a.value.push(o.certificateExtensionsToAsn1(t.extensions)),a},o.getCertificationRequestInfo=function(t){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),m(t.subject),o.publicKeyToAsn1(t.publicKey),function(t){var e=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return e;for(var r=t.attributes,o=0;of.validity.notAfter)&&(l={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===l){if(null===(h=e[0]||t.getIssuer(f))&&f.isIssuer(f)&&(p=!0,h=f),h){var d=h;n.util.isArray(d)||(d=[d]);for(var y=!1;!y&&d.length>0;){h=d.shift();try{y=h.verify(f)}catch(t){}}y||(l={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==l||h&&!p||t.hasCertificate(f)||(l={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===l&&h&&!f.isIssuer(h)&&(l={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===l)for(var v={keyUsage:!0,basicConstraints:!0},g=0;null===l&&gb.pathLenConstraint&&(l={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var w=null===l||l.error,_=r.verify?r.verify(w,c,i):w;if(!0!==_)throw!0===w&&(l={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(_||0===_)&&("object"!=s(_)||n.util.isArray(_)?"string"==typeof _&&(l.error=_):(_.message&&(l.message=_.message),_.error&&(l.error=_.error))),l;l=null,u=!1,++c}while(e.length>0);return!0}},function(t,e,r){var n=r(0);r(2),r(1),(t.exports=n.pss=n.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,i=t.mgf,o=r.digestLength,a=t.salt||null;if("string"==typeof a&&(a=n.util.createBuffer(a)),"saltLength"in t)e=t.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");e=a.length()}if(null!==a&&a.length()!==e)throw new Error("Given salt length does not match length of given salt.");var s=t.prng||n.random;return{encode:function(t,u){var l,c,f=u-1,h=Math.ceil(f/8),p=t.digest().getBytes();if(h>8*h-f&255;return(x=String.fromCharCode(x.charCodeAt(0)&~w)+x.substr(1))+y+String.fromCharCode(188)},verify:function(t,a,s){var u,l=s-1,c=Math.ceil(l/8);if(a=a.substr(-c),c>8*c-l&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u4){var r=t;t=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},i.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},i.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=s(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},i.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,o=new Array(i),a=0;a>>1,i=new Array(r);i[n]=t.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o>1,s=a+(1&t.length),u=t.substr(0,s),l=t.substr(a,s),c=n.util.createBuffer(),f=n.hmac.create();r=e+r;var h=Math.ceil(i/16),p=Math.ceil(i/20);f.start("MD5",u);var d=n.util.createBuffer();c.putBytes(r);for(var y=0;y0&&(c.queue(t,c.createAlert(t,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(t)),t.process()},c.parseHelloMessage=function(t,e,r){var i=null,o=t.entity===c.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var a=e.fragment,s=a.length();if(i={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:u(a,1),extensions:[]},o?(i.cipher_suite=a.getBytes(2),i.compression_method=a.getByte()):(i.cipher_suites=u(a,2),i.compression_methods=u(a,1)),(s=r-(s-a.length()))>0){for(var l=u(a,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:u(l,2)});if(!o)for(var f=0;f0&&0===p.getByte();)t.session.extensions.server_name.serverNameList.push(u(p,2).getBytes())}}if(t.session.version&&(i.version.major!==t.session.version.major||i.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=c.getCipherSuite(i.cipher_suite);else for(var d=n.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(t.session.cipherSuite=c.getCipherSuite(d.getBytes(2)),null===t.session.cipherSuite););if(null===t.session.cipherSuite)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});t.session.compressionMethod=o?i.compression_method:c.CompressionMethod.none}return i},c.createSecurityParameters=function(t,e){var r=t.entity===c.ConnectionEnd.client,n=e.random.bytes(),i=r?t.session.sp.client_random:n,o=r?n:c.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:c.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:o}},c.handleServerHello=function(t,e,r){var n=c.parseHelloMessage(t,e,r);if(!t.fail){if(!(n.version.minor<=t.version.minor))return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});t.version.minor=n.version.minor,t.session.version=t.version;var i=n.session_id.bytes();i.length>0&&i===t.session.id?(t.expect=y,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=f,t.session.resuming=!1,c.createSecurityParameters(t,n)),t.session.id=i,t.process()}},c.handleClientHello=function(t,e,r){var i=c.parseHelloMessage(t,e,r);if(!t.fail){var o=i.session_id.bytes(),a=null;if(t.sessionCache&&(null===(a=t.sessionCache.getSession(o))?o="":(a.version.major!==i.version.major||a.version.minor>i.version.minor)&&(a=null,o="")),0===o.length&&(o=n.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=i.version,t.session.sp={},a)t.version=t.session.version=a.version,t.session.sp=a.sp;else{for(var s,u=1;u0;)i=u(s.certificate_list,3),o=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(o,!0),l.push(i)}catch(e){return t.error(t,{message:"Could not parse certificate list.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var f=t.entity===c.ConnectionEnd.client;!f&&!0!==t.verifyClient||0!==l.length?0===l.length?t.expect=f?h:x:(f?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],c.verifyCertificateChain(t,l)&&(t.expect=f?h:x)):t.error(t,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),t.process()},c.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});t.expect=p,t.process()},c.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var i=e.fragment,o={enc_pre_master_secret:u(i,2).getBytes()},a=null;if(t.getPrivateKey)try{a=t.getPrivateKey(t,t.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(e){t.error(t,{message:"Could not get private key.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===a)return t.error(t,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var s=t.session.sp;s.pre_master_secret=a.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==s.pre_master_secret.charCodeAt(0)||l.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(t){s.pre_master_secret=n.random.getBytes(48)}t.expect=_,null!==t.session.clientCertificate&&(t.expect=w),t.process()},c.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=e.fragment,i={certificate_types:u(n,1),certificate_authorities:u(n,2)};t.session.certificateRequest=i,t.expect=d,t.process()},c.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i=e.fragment;i.read-=4;var o=i.bytes();i.read+=4;var a={signature:u(i,2).getBytes()},s=n.util.createBuffer();s.putBuffer(t.session.md5.digest()),s.putBuffer(t.session.sha1.digest()),s=s.getBytes();try{if(!t.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch(e){return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}t.expect=_,t.process()},c.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===t.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},o=t.verify(t,i.alert.description,0,[]);if(!0!==o)return(o||0===o)&&("object"!=s(o)||n.util.isArray(o)?"number"==typeof o&&(i.alert.description=o):(o.message&&(i.message=o.message),o.alert&&(i.alert.description=o.alert))),t.error(t,i)}null!==t.session.certificateRequest&&(e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificate(t)}),c.queue(t,e)),e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createClientKeyExchange(t)}),c.queue(t,e),t.expect=m;var a=function(t,e){null!==t.session.certificateRequest&&null!==t.session.clientCertificate&&c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificateVerify(t,e)})),c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.pending=c.createConnectionState(t),t.state.current.write=t.state.pending.write,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)})),t.expect=y,c.flush(t),t.process()};if(null===t.session.certificateRequest||null===t.session.clientCertificate)return a(t,null);c.getClientSignature(t,a)},c.handleChangeCipherSpec=function(t,e){if(1!==e.fragment.getByte())return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=t.entity===c.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=c.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?v:S,t.process()},c.handleFinished=function(t,e,r){var o=e.fragment;o.read-=4;var a=o.bytes();o.read+=4;var s=e.fragment.getBytes();(o=n.util.createBuffer()).putBuffer(t.session.md5.digest()),o.putBuffer(t.session.sha1.digest());var u=t.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=t.session.sp;if((o=i(f.master_secret,l,o.getBytes(),12)).getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});t.session.md5.update(a),t.session.sha1.update(a),(t.session.resuming&&u||!t.session.resuming&&!u)&&(c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)}))),t.expect=u?g:E,t.handshaking=!1,++t.handshakes,t.peerCertificate=u?t.session.serverCertificate:t.session.clientCertificate,c.flush(t),t.isConnected=!0,t.connected(t),t.process()},c.handleAlert=function(t,e){var r,n=e.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===c.Alert.Description.close_notify)return t.close();t.error(t,{message:r,send:!1,origin:t.entity===c.ConnectionEnd.client?"server":"client",alert:i}),t.process()},c.handleHandshake=function(t,e){var r=e.fragment,i=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=n.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var a=r.bytes(o+4);r.read+=4,i in F[t.entity][t.expect]?(t.entity!==c.ConnectionEnd.server||t.open||t.fail||(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==c.HandshakeType.hello_request&&i!==c.HandshakeType.certificate_verify&&i!==c.HandshakeType.finished&&(t.session.md5.update(a),t.session.sha1.update(a)),F[t.entity][t.expect][i](t,e,o)):c.handleUnexpected(t,e)},c.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()},c.handleHeartbeat=function(t,e){var r=e.fragment,i=r.getByte(),o=r.getInt16(),a=r.getBytes(o);if(i===c.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>a.length)return t.process();c.queue(t,c.createRecord(t,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,a)})),c.flush(t)}else if(i===c.HeartbeatMessageType.heartbeat_response){if(a!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,n.util.createBuffer(a))}t.process()};var f=1,h=2,p=3,d=4,y=5,v=6,g=7,m=8,b=1,x=2,w=3,_=4,S=5,E=6,k=c.handleUnexpected,T=c.handleChangeCipherSpec,C=c.handleAlert,O=c.handleHandshake,A=c.handleApplicationData,P=c.handleHeartbeat,M=[];M[c.ConnectionEnd.client]=[[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[T,C,k,k,P],[k,C,O,k,P],[k,C,O,A,P],[k,C,O,k,P]],M[c.ConnectionEnd.server]=[[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[T,C,k,k,P],[k,C,O,k,P],[k,C,O,A,P],[k,C,O,k,P]];var I=c.handleHelloRequest,L=c.handleServerHello,j=c.handleCertificate,N=c.handleServerKeyExchange,R=c.handleCertificateRequest,D=c.handleServerHelloDone,B=c.handleFinished,F=[];F[c.ConnectionEnd.client]=[[k,k,L,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,j,N,R,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,N,R,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,R,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,B],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];var z=c.handleClientHello,U=c.handleClientKeyExchange,G=c.handleCertificateVerify;F[c.ConnectionEnd.server]=[[k,z,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,j,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,U,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,G,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,B],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]],c.generateKeys=function(t,e){var r=i,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,a=t.version.major===c.Versions.TLS_1_0.major&&t.version.minor===c.Versions.TLS_1_0.minor;a&&(o+=2*e.fixed_iv_length);var s=r(e.master_secret,"key expansion",n,o),u={client_write_MAC_key:s.getBytes(e.mac_key_length),server_write_MAC_key:s.getBytes(e.mac_key_length),client_write_key:s.getBytes(e.enc_key_length),server_write_key:s.getBytes(e.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(e.fixed_iv_length),u.server_write_IV=s.getBytes(e.fixed_iv_length)),u},c.createConnectionState=function(t){var e=t.entity===c.ConnectionEnd.client,r=function(){var t={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(t){return!0},compressionState:null,compressFunction:function(t){return!0},updateSequenceNumber:function(){4294967295===t.sequenceNumber[1]?(t.sequenceNumber[1]=0,++t.sequenceNumber[0]):++t.sequenceNumber[1]}};return t},n={read:r(),write:r()};if(n.read.update=function(t,e){return n.read.cipherFunction(e,n.read)?n.read.compressFunction(t,e,n.read)||t.error(t,{message:"Could not decompress record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):t.error(t,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_record_mac}}),!t.fail},n.write.update=function(t,e){return n.write.compressFunction(t,e,n.write)?n.write.cipherFunction(e,n.write)||t.error(t,{message:"Could not encrypt record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):t.error(t,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!t.fail},t.session){var i=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(i),i.keys=c.generateKeys(t,i),n.read.macKey=e?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=e?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,i),i.compression_algorithm){case c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=a,n.write.compressFunction=o;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var t=new Date,e=+t+6e4*t.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(e),r.putBytes(n.random.getBytes(28)),r},c.createRecord=function(t,e){return e.data?{type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data}:null},c.createAlert=function(t,e){var r=n.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),c.createRecord(t,{type:c.ContentType.alert,data:r})},c.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=n.util.createBuffer(),r=0;r0&&(d+=2);var y=t.session.id,v=y.length+1+2+4+28+2+o+1+s+d,g=n.util.createBuffer();return g.putByte(c.HandshakeType.client_hello),g.putInt24(v),g.putByte(t.version.major),g.putByte(t.version.minor),g.putBytes(t.session.sp.client_random),l(g,1,n.util.createBuffer(y)),l(g,2,e),l(g,1,a),d>0&&l(g,2,u),g},c.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(c.HandshakeType.server_hello),i.putInt24(r),i.putByte(t.version.major),i.putByte(t.version.minor),i.putBytes(t.session.sp.server_random),l(i,1,n.util.createBuffer(e)),i.putByte(t.session.cipherSuite.id[0]),i.putByte(t.session.cipherSuite.id[1]),i.putByte(t.session.compressionMethod),i},c.createCertificate=function(t){var e,r=t.entity===c.ConnectionEnd.client,i=null;t.getCertificate&&(e=r?t.session.certificateRequest:t.session.extensions.server_name.serverNameList,i=t.getCertificate(t,e));var o=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var a=null,s=0;sc.MaxFragment;)i.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(o.slice(0,c.MaxFragment))})),o=o.slice(c.MaxFragment);o.length>0&&i.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(o)}))}for(var a=0;a0&&(i=r.order[0]),null!==i&&i in r.cache)for(var o in e=r.cache[i],delete r.cache[i],r.order)if(r.order[o]===i){r.order.splice(o,1);break}return e},r.setSession=function(t,e){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(t),r.order.push(i),r.cache[i]=e}}return r},c.createConnection=function(t){var e;e=t.caStore?n.util.isArray(t.caStore)?n.pki.createCaStore(t.caStore):t.caStore:n.pki.createCaStore();var r=t.cipherSuites||null;if(null===r)for(var i in r=[],c.CipherSuites)r.push(c.CipherSuites[i]);var o=t.server?c.ConnectionEnd.server:c.ConnectionEnd.client,a=t.sessionCache?c.createSessionCache(t.sessionCache):null,s={version:{major:c.Version.major,minor:c.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:a,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(t,e,r,n){return e},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:function(e,r){r.origin=r.origin||(e.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(e,c.createAlert(e,r.alert)),c.flush(e));var n=!1!==r.fatal;n&&(e.fail=!0),t.error(e,r),n&&e.close(!1)},deflate:t.deflate||null,inflate:t.inflate||null,reset:function(t){s.version={major:c.Version.major,minor:c.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,c.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(t||void 0===t),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=c.createConnectionState(s)}};return s.reset(),s.handshake=function(t){if(s.entity!==c.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var e=null;(t=t||"").length>0&&(s.sessionCache&&(e=s.sessionCache.getSession(t)),null===e&&(t="")),0===t.length&&s.sessionCache&&null!==(e=s.sessionCache.getSession())&&(t=e.id),s.session={id:t,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},e&&(s.version=e.version,s.session.sp=e.sp),s.session.sp.client_random=c.createRandom().getBytes(),s.open=!0,c.queue(s,c.createRecord(s,{type:c.ContentType.handshake,data:c.createClientHello(s)})),c.flush(s)}},s.process=function(t){var e=0;return t&&s.input.putBytes(t),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(e=function(t){var e=0,r=t.input,i=r.length();if(i<5)e=5-i;else{t.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var o=t.record.version.major===t.version.major;o&&t.session&&t.session.version&&(o=t.record.version.minor===t.version.minor),o||t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}})}return e}(s)),s.fail||null===s.record||s.record.ready||(e=function(t){var e=0,r=t.input,n=r.length();return n=0;u--)A>>=8,A+=k.at(u)+O.at(u),O.setAt(u,255&A);C.putBuffer(O)}x=C,f.putBuffer(S)}return f.truncate(f.length()-o),f},a.pbe.getCipher=function(t,e,r){switch(t){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(t,e,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(t,e,r){var i,s={},u=[];if(!o.validate(e,l,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((t=o.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,i.supportedOids=["pkcs5PBKDF2"],i;if((t=o.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&t!==a.oids["aes192-CBC"]&&t!==a.oids["aes256-CBC"]&&t!==a.oids["des-EDE3-CBC"]&&t!==a.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var c,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),a.oids[t]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,c,y),g=s.encIv,m=f(v);return m.start(g),m},a.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},s=[];if(!o.validate(e,c,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,l,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),t){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,y}var v=h(i.prfOid),g=a.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,a.pbe.generatePkcs12Key(r,p,2,d,l,v))},a.pbe.opensslDeriveBytes=function(t,e,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===e&&(e="");for(var o=[f(i,t+e)],a=16,s=1;a>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(h,r,a);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var o=null,a=!1,s=null;function u(t,e,r){for(var n,i,o,a,u,l,c,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(l=t.h0,c=t.h1,f=t.h2,h=t.h3,p=t.h4,d=t.h5,y=t.h6,v=t.h7,u=0;u<64;++u)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|f&(l^c),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+e[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=c,c=l,l=n+(i=o+a)>>>0;t.h0=t.h0+l|0,t.h1=t.h1+c|0,t.h2=t.h2+f|0,t.h3=t.h3+h|0,t.h4=t.h4+p|0,t.h5=t.h5+d|0,t.h6=t.h6+y|0,t.h7=t.h7+v|0,g-=64}}},function(t,e,r){var n=r(0);r(1);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(16)),(t.exports=n.prng=n.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,o=new Array(32),a=0;a<32;++a)o[a]=r.create();function s(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r==0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var i=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(i),e.generated=0}function l(t){var e=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(e=function(t){return i.getRandomValues(t)});var o=n.util.createBuffer();if(e)for(;o.length()>16)))<<16,h=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31)),u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),o.putByte(255&f);return o.getBytes(t)}return e.pools=o,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var i=e.plugin.cipher,o=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed,l=n.util.createBuffer();e.key=null,function c(f){if(f)return r(f);if(l.length()>=t)return r(null,l.getBytes(t));if(e.generated>1048575&&(e.key=null),null===e.key)return n.util.nextTick(function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,function(r,n){if(r)return t(r);e.collect(n),u(),t()})}(c)});var h=i(e.key,e.seed);e.generated+=h.length,l.putBytes(h),e.key=a(i(e.key,o(e.seed))),e.seed=s(i(e.key,e.seed)),n.util.setImmediate(c)}()},e.generateSync=function(t){var r=e.plugin.cipher,i=e.plugin.increment,o=e.plugin.formatKey,a=e.plugin.formatSeed;e.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(e.key=null),null===e.key&&s();var l=r(e.key,e.seed);e.generated+=l.length,u.putBytes(l),e.key=o(r(e.key,i(e.seed))),e.seed=a(r(e.key,e.seed))}return u.getBytes(t)},i?(e.seedFile=function(t,e){i.randomBytes(t,function(t,r){if(t)return e(t);e(null,r.toString())})},e.seedFileSync=function(t){return i.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,l(t))}catch(t){e(t)}},e.seedFileSync=l),e.collect=function(t){for(var r=t.length,n=0;n>i&255);e.collect(n)},e.registerWorker=function(t){t===self?e.seedFile=function(t,e){self.addEventListener("message",function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:t}}})}:t.addEventListener("message",function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})})})},e}},function(t,e,r){var n=r(0);r(1);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],a=function(t,e){return t<>16-e},s=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"==typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,o=t,a=t.length(),s=e,u=Math.ceil(s/8),l=255>>(7&s);for(r=a;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-a)&255]);for(o.setAt(128-u,i[o.at(128-u)&l]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(t,e,r){var i,u,l,c,f=!1,h=null,p=null,d=null,y=[];for(t=n.rc2.expandKey(t,e),l=0;l<64;l++)y.push(t.getInt16Le());r?(i=function(t){for(l=0;l<4;l++)t[l]+=y[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),t[l]=a(t[l],o[l]),c++},u=function(t){for(l=0;l<4;l++)t[l]+=y[63&t[(l+3)%4]]}):(i=function(t){for(l=3;l>=0;l--)t[l]=s(t[l],o[l]),t[l]-=y[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),c--},u=function(t){for(l=3;l>=0;l--)t[l]-=y[63&t[(l+3)%4]]});var v=function(t){var e=[];for(l=0;l<4;l++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),e.push(65535&n)}c=r?0:63;for(var i=0;i=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(e&&(f=!0,g.update()),!r&&(e=0===h.length()))if(t)e=t(8,p,!r);else{var i=p.length(),o=p.at(i-1);o>i?e=!1:p.truncate(o)}return e}}};n.rc2.startEncrypting=function(t,e,r){var i=n.rc2.createEncryptionCipher(t,128);return i.start(e,r),i},n.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var i=n.rc2.createDecryptionCipher(t,128);return i.start(e,r),i},n.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},function(t,e,r){var n=r(0);r(1),r(2),r(9);var i=t.exports=n.pkcs1=n.pkcs1||{};function o(t,e,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(e/r.digestLength),a=0;a>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(t+s),i+=r.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,r){var i,a,s,u;"string"==typeof r?(i=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=e.length,y.maxLength=c,y;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=c-e.length,d=0;dt&&(a=u(t,e));var p=a.toString(16);i.target.postMessage({hex:p,workLoad:c}),a.dAddOffset(f,0)}}}p()}(t,e,i,o):s(t,e,i,o)}(t,l,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function s(t,e,r,o){var a=u(t,e),s=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function t(e,r,o,a,s,l,c){var f=+new Date;do{if(e.bitLength()>r&&(e=u(r,o)),e.isProbablePrime(s))return c(null,e);e.dAddOffset(i[a++%8],0)}while(l<0||+new Date-f=0&&i.push(s):i.push(s))}return i}function p(t){if(t.composed||t.constructed){for(var e=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==e&&(p=n.util.isArray(e)?e:[e]);for(var d=[],y=0;y0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),x=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(x)}var w=null;if(null!==t){var _=o.wrapRsaPrivateKey(o.privateKeyToAsn1(t));w=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[_]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[o.encryptPrivateKeyInfo(_,r,s)]),u]);var S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[w]),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(S).getBytes())])]);h.push(E)}var k,T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var C=n.md.sha1.create(),O=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),A=s.count,P=(t=a.generateKey(r,O,3,A,20),n.hmac.create());P.start(C,t),P.update(i.toDer(T).getBytes());var M=P.getMac();k=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,M.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(A).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(T).getBytes())])]),k])},a.generateKey=n.pbe.generatePkcs12Key},function(t,e,r){var n=r(0);r(3),r(1);var i=n.asn1,o=t.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(t,e,r){var n=r(0);r(1),n.mgf=n.mgf||{},(t.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(t){return{generate:function(e,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/t.digestLength),a=0;a>>0,a>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=a[1],a[1]=a[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(t),c(r,o,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var e=n.util.createBuffer();e.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;e.putBytes(a.substr(0,p.blockLength-u));for(var l=8*p.fullMessageLength[0],f=0;f>>0,e.putInt32(l>>>0),l=s>>>0;e.putInt32(l);var h=new Array(r.length);for(f=0;f=128;){for(P=0;P<16;++P)e[P][0]=r.getInt32()>>>0,e[P][1]=r.getInt32()>>>0;for(;P<80;++P)n=(((M=(L=e[P-2])[0])>>>19|(I=L[1])<<13)^(I>>>29|M<<3)^M>>>6)>>>0,i=((M<<13|I>>>19)^(I<<3|M>>>29)^(M<<26|I>>>6))>>>0,o=(((M=(N=e[P-15])[0])>>>1|(I=N[1])<<31)^(M>>>8|I<<24)^M>>>7)>>>0,a=((M<<31|I>>>1)^(M<<24|I>>>8)^(M<<25|I>>>7))>>>0,j=e[P-7],R=e[P-16],I=i+j[1]+a+R[1],e[P][0]=n+j[0]+o+R[0]+(I/4294967296>>>0)>>>0,e[P][1]=I>>>0;for(d=t[0][0],y=t[0][1],v=t[1][0],g=t[1][1],m=t[2][0],b=t[2][1],x=t[3][0],w=t[3][1],_=t[4][0],S=t[4][1],E=t[5][0],k=t[5][1],T=t[6][0],C=t[6][1],O=t[7][0],A=t[7][1],P=0;P<80;++P)c=((_>>>14|S<<18)^(_>>>18|S<<14)^(S>>>9|_<<23))>>>0,f=(T^_&(E^T))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,l=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,I=A+(((_<<18|S>>>14)^(_<<14|S>>>18)^(S<<23|_>>>9))>>>0)+((C^S&(k^C))>>>0)+u[P][1]+e[P][1],n=O+c+f+u[P][0]+e[P][0]+(I/4294967296>>>0)>>>0,i=I>>>0,o=s+h+((I=l+p)/4294967296>>>0)>>>0,a=I>>>0,O=T,A=C,T=E,C=k,E=_,k=S,_=x+n+((I=w+i)/4294967296>>>0)>>>0,S=I>>>0,x=m,w=b,m=v,b=g,v=d,g=y,d=n+o+((I=i+a)/4294967296>>>0)>>>0,y=I>>>0;I=t[0][1]+y,t[0][0]=t[0][0]+d+(I/4294967296>>>0)>>>0,t[0][1]=I>>>0,I=t[1][1]+g,t[1][0]=t[1][0]+v+(I/4294967296>>>0)>>>0,t[1][1]=I>>>0,I=t[2][1]+b,t[2][0]=t[2][0]+m+(I/4294967296>>>0)>>>0,t[2][1]=I>>>0,I=t[3][1]+w,t[3][0]=t[3][0]+x+(I/4294967296>>>0)>>>0,t[3][1]=I>>>0,I=t[4][1]+S,t[4][0]=t[4][0]+_+(I/4294967296>>>0)>>>0,t[4][1]=I>>>0,I=t[5][1]+k,t[5][0]=t[5][0]+E+(I/4294967296>>>0)>>>0,t[5][1]=I>>>0,I=t[6][1]+C,t[6][0]=t[6][0]+T+(I/4294967296>>>0)>>>0,t[6][1]=I>>>0,I=t[7][1]+A,t[7][0]=t[7][0]+O+(I/4294967296>>>0)>>>0,t[7][1]=I>>>0,D-=128}}},function(t,e,r){t.exports=r(33)},function(t,e,r){t.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":s(window))&&(r=window)}t.exports=r},function(t,e){var r={};t.exports=r;var n={};r.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,o=e.length,a=e.charAt(0),s=[0];for(i=0;i0;)s.push(l%o),l=l/o|0}for(i=0;0===t[i]&&i=0;--i)n+=e[s[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),o=[0];for(r=0;r0;)o.push(s%n),s=s/n|0}var u="";for(r=0;0===t.at(r)&&r=0;--r)u+=e[o[r]];return u}(t,e);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join("\r\n")}return n},r.decode=function(t,e){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');var r=n[e];if(!r){r=n[e]=[];for(var i=0;i>=8;for(;c>0;)s.push(255&c),c>>=8}for(var f=0;t[f]===a&&f=i.Versions.TLS_1_1.minor&&u.output.putBytes(r),u.update(t.fragment),u.finish(s)&&(t.fragment=u.output,t.length=t.fragment.length(),o=!0),o}function s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}function u(t,e,r){var n=!0;if(r){for(var i=e.length(),o=e.last(),a=i-1-o;a=s?(t.fragment=a.output.getBytes(c-s),l=a.output.getBytes(s)):t.fragment=a.output.getBytes(),t.fragment=n.util.createBuffer(t.fragment),t.length=t.fragment.length();var f=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),function(t,e,r){var i=n.hmac.create();return i.start("SHA1",t),i.update(e),e=i.digest().getBytes(),i.start(null,null),i.update(r),e===(r=i.digest().getBytes())}(e.macKey,l,f)&&o}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,t.cipher_type=i.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=i.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:o},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,t.cipher_type=i.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=i.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:o}},function(t,e,r){var n=r(0);r(30),t.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(t,e,r){var n=r(0);r(12),r(2),r(31),r(1);var i=r(39),o=i.publicKeyValidator,a=i.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,l="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},t.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var c=n.ed25519;function f(t){var e=t.message;if(e instanceof Uint8Array||e instanceof l)return e;var r=t.encoding;if(void 0===e){if(!t.md)throw new TypeError('"options.message" or "options.md" not specified.');e=t.md.digest().getBytes(),r="binary"}if("string"==typeof e&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof e){if("undefined"!=typeof Buffer)return Buffer.from(e,r);e=new u(e,r)}else if(!(e instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new l(e.length()),i=0;i=0;--r)B(n,n),1!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(r,r),F(r,r,i),F(r,r,o),F(r,r,o),F(t[0],r,o),B(n,t[0]),F(n,n,o),C(n,i)&&F(t[0],t[0],b),B(n,t[0]),F(n,n,o),C(n,i)?-1:(A(t[0])===e[31]>>7&&D(t[0],h,t[0]),F(t[3],t[0],t[1]),0)}(s,n))return-1;for(i=0;i=0};var h=N(),p=N([1]),d=N([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=N([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=N([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),g=N([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=N([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(t,e){var r=n.md.sha512.create(),i=new u(t);r.update(i.getBytes(e),"binary");var o=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(o,"binary");for(var a=new l(c.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)a[s]=o.charCodeAt(s);return a}function w(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;++i)e[i]+=r-(e[31]>>4)*m[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;++i)e[i]-=r*m[i];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function _(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;w(t,e)}function S(t,e){var r=N(),n=N(),i=N(),o=N(),a=N(),s=N(),u=N(),l=N(),c=N();D(r,t[1],t[0]),D(c,e[1],e[0]),F(r,r,c),R(n,t[0],t[1]),R(c,e[0],e[1]),F(n,n,c),F(i,t[3],e[3]),F(i,i,y),F(o,t[2],e[2]),R(o,o,o),D(a,n,r),D(s,o,i),R(u,o,i),R(l,n,r),F(t[0],a,s),F(t[1],l,u),F(t[2],u,s),F(t[3],a,l)}function E(t,e,r){for(var n=0;n<4;++n)j(t[n],e[n],r)}function k(t,e){var r=N(),n=N(),i=N();!function(t,e){var r,n=N();for(r=0;r<16;++r)n[r]=e[r];for(r=253;r>=0;--r)B(n,n),2!==r&&4!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(i,e[2]),F(r,e[0],i),F(n,e[1],i),T(t,n),t[31]^=A(r)<<7}function T(t,e){var r,n,i,o=N(),a=N();for(r=0;r<16;++r)a[r]=e[r];for(L(a),L(a),L(a),n=0;n<2;++n){for(o[0]=a[0]-65517,r=1;r<15;++r)o[r]=a[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,j(a,o,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function C(t,e){var r=new l(32),n=new l(32);return T(r,t),T(n,e),O(r,0,n,0)}function O(t,e,r,n){return function(t,e,r,n,i){var o,a=0;for(o=0;o<32;++o)a|=t[e+o]^r[n+o];return(1&a-1>>>8)-1}(t,e,r,n)}function A(t){var e=new l(32);return T(e,t),1&e[0]}function P(t,e,r){var n,i;for(I(t[0],h),I(t[1],p),I(t[2],p),I(t[3],h),i=255;i>=0;--i)E(t,e,n=r[i/8|0]>>(7&i)&1),S(e,t),S(t,t),E(t,e,n)}function M(t,e){var r=[N(),N(),N(),N()];I(r[0],v),I(r[1],g),I(r[2],p),F(r[3],v,g),P(t,r,e)}function I(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function L(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function j(t,e,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function N(t){var e,r=new Float64Array(16);if(t)for(e=0;e0&&(a=n.util.fillString(String.fromCharCode(0),u)+a),{encapsulation:e.encrypt(a,"NONE"),key:t.generate(a,o)}},decrypt:function(e,r,n){var i=e.decrypt(r,"NONE");return t.generate(i,n)}}},n.kem.kdf1=function(t,e){o(this,t,0,e||t.digestLength)},n.kem.kdf2=function(t,e){o(this,t,1,e||t.digestLength)}},function(t,e,r){var n=r(0);r(1),t.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},o=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o=r&&a0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,e)),o.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),a.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,t.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),a])},addSigner:function(e){var r=e.issuer,i=e.serialNumber;if(e.certificate){var o=e.certificate;"string"==typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var a=e.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=e.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=e.authenticatedAttributes||[];if(u.length>0){for(var l=!1,c=!1,f=0;f="8"&&(r="00"+r);var i=n.util.hexToBytes(r);t.putInt32(i.length),t.putBytes(i)}function a(t,e){t.putInt32(e.length),t.putString(e)}function s(){for(var t=n.md.sha1.create(),e=arguments.length,r=0;r=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,r,i,o){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((r-e)/i/2)*i,n(t,a,e,r,o),s.push(e,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!d(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),s=y(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,u,l,c,h,p,d,y,v,g,m;for(l=c=1/0,n=e;n<=r-e;n++)i=s(t,0,n,this.toBBox),o=s(t,n,r,this.toBBox),p=i,d=o,void 0,void 0,void 0,void 0,y=Math.max(p.minX,d.minX),v=Math.max(p.minY,d.minY),g=Math.min(p.maxX,d.maxX),m=Math.min(p.maxY,d.maxY),a=Math.max(0,g-y)*Math.max(0,m-v),u=f(i)+f(o),a=e;i--)o=t.children[i],u(c,t.leaf?a(o):o),f+=h(c);return f},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},4333:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function e(t,e){return te?1:0}return function(r,n,i,o,a){!function e(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*c/s+f)),p=Math.min(o,Math.floor(n+(s-u)*c/s+f));e(r,n,h,p,a)}var d=r[n],y=i,v=o;for(t(r,i,n),a(r[o],d)>0&&t(r,i,o);y0;)v--}0===a(r[i],d)?t(r,i,v):t(r,++v,o),v<=n&&(i=v+1),n<=v&&(o=v-1)}}(r,n,i||0,o||r.length-1,a||e)}},"object"===a(e)?t.exports=o():void 0===(i="function"==typeof(n=o)?n.call(e,r,e,t):n)||(t.exports=i)},4934:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var r=Object.keys(e),n=0;n=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,n,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),u=o===t.FRAGMENT_SHADER?"fragment":"vertex";b(n,"string",u+" shader source must be a string",a);var l=v(n,a),f=function(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);r?e.push(new p(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new p("unknown",0,t))}}),e}(s);!function(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}(l,f),Object.keys(l).forEach(function(t){var e=l[t];if(e.hasErrors){var n=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach(function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+r,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var s=a[1];switch(i=a[2],s){case"assign":s="="}e=Math.max(t.line.indexOf(s,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+r,"font-weight:bold"),o(c("| ",6)),o(i+r,"font-weight:bold")}),o(c("| ",6)+r)}else o(c(t.number,4)+"| "),o(t.line+r,"color:red")}),"undefined"==typeof document||window.chrome?console.log(n.join("")):(i[0]=n.join("%c"),console.log.apply(console,i))}function o(t,e){n.push(t),i.push(e||"")}}),i.raise("Error compiling "+u+" shader, "+l[0].name)}},linkError:function(t,e,n,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var s=t.getProgramInfoLog(e),u=v(n,a),l='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+r+"%c"+s,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+r+s),i.raise(l)}},callSite:y,saveCommandRef:g,saveDrawInfo:function(t,e,r,n){function i(t){return t?n.id(t):0}function o(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,r.static),o(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,r){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,r){var n,o=e.width,a=e.height,s=e.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),t.wrapS===x&&t.wrapT===x||i(L(o)&&L(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(t.minFilter!==_&&t.minFilter!==E&&t.minFilter!==S&&t.minFilter!==k,"min filter requires mipmap"):(i(L(o)&&L(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),e.type===T&&(r.extensions.indexOf("oes_texture_float_linear")<0&&i(t.minFilter===w&&t.magFilter===w,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(n=0;n<16;++n)if(u[n]){var l=o>>n,c=a>>n;i(e.mipmask&1<0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===x&&e.wrapT===x,"wrap mode not supported by cube map");for(var u=0;u>f,d=a>>f;i(l.mipmask&1<1&&r===n&&('"'===r||"'"===r))return['"'+z(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+z(e)+'"'];for(var a=[],s=0;s0,"invalid pixel ratio"))):i=(o=u).canvas:j.raise("invalid arguments to regl"),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!o){if(!i){j("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,r,n){var i,o=document.createElement("canvas");function a(){var r=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();r=a.right-a.left,i=a.bottom-a.top}o.width=n*r,o.height=n*i,e(o.style,{width:r+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver(function(){setTimeout(a)})).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(n||document.body,0,h);if(!v)return null;i=v.canvas,y=v.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),o=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,l)}return o?{gl:o,canvas:i,container:n,extensions:c,optionalExtensions:f,pixelRatio:h,profile:p,onDone:d,onDestroy:y}:(y(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function X(t,e){for(var r=Array(t),n=0;n65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function nt(){var t=X(8,function(){return[]});function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[rt(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[rt(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case Z:n=new Int8Array(e(r),0,r);break;case K:n=new Uint8Array(e(r),0,r);break;case J:n=new Int16Array(e(2*r),0,r);break;case Q:n=new Uint16Array(e(2*r),0,r);break;case $:n=new Int32Array(e(4*r),0,r);break;case tt:n=new Uint32Array(e(4*r),0,r);break;case et:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var it=nt();it.zero=nt();var ot=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(3553,a),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=t.createFramebuffer();if(t.bindFramebuffer(36160,s),t.framebufferTexture2D(36160,36064,3553,a,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=it.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),it.freeType(u)}}var l=!0;if(!("undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var c=t.createTexture(),f=it.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,c),t.texImage2D(34069,0,6408,3,3,0,6408,5121,f),it.freeType(f),t.bindTexture(34067,null),t.deleteTexture(c),l=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:l}};function at(e){return!!e&&"object"===a(e)&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var st=function(t){return Object.keys(t).map(function(e){return t[e]})},ut={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var o=0;o>>31<<15,o=(n<<1>>>24)-127,a=n>>13&1023;if(o<-24)e[r]=i;else if(o<-14){var s=-14-o;e[r]=i+(a+1024>>s)}else e[r]=o>15?i+31744:i+(o+15<<10)+a}return e}function zt(e){return Array.isArray(e)||t(e)}var Ut=function(t){return!(t&t-1||!t)},Gt=34467,Vt=3553,Ht=34067,Wt=34069,qt=6408,Yt=6406,Xt=6407,Zt=6409,Kt=6410,Jt=32854,Qt=32855,$t=36194,te=32819,ee=32820,re=33635,ne=34042,ie=6402,oe=34041,ae=35904,se=35906,ue=36193,le=33776,ce=33777,fe=33778,he=33779,pe=35986,de=35987,ye=34798,ve=35840,ge=35841,me=35842,be=35843,xe=36196,we=5121,_e=5123,Se=5125,Ee=5126,ke=10242,Te=10243,Ce=10497,Oe=33071,Ae=33648,Pe=10240,Me=10241,Ie=9728,Le=9729,je=9984,Ne=9985,Re=9986,De=9987,Be=33170,Fe=4352,ze=4353,Ue=4354,Ge=34046,Ve=3317,He=37440,We=37441,qe=37443,Ye=37444,Xe=33984,Ze=[je,Re,Ne,De],Ke=[0,Zt,Kt,Xt,qt],Je={};function Qe(t){return"[object "+t+"]"}Je[Zt]=Je[Yt]=Je[ie]=1,Je[oe]=Je[Kt]=2,Je[Xt]=Je[ae]=3,Je[qt]=Je[se]=4;var $e=Qe("HTMLCanvasElement"),tr=Qe("OffscreenCanvas"),er=Qe("CanvasRenderingContext2D"),rr=Qe("ImageBitmap"),nr=Qe("HTMLImageElement"),ir=Qe("HTMLVideoElement"),or=Object.keys(ct).concat([$e,tr,er,rr,nr,ir]),ar=[];ar[we]=1,ar[Ee]=4,ar[ue]=2,ar[_e]=2,ar[Se]=4;var sr=[];function ur(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function lr(t){return!!Array.isArray(t)&&!(0===t.length||!zt(t[0]))}function cr(t){return Object.prototype.toString.call(t)}function fr(t){return cr(t)===$e}function hr(t){return cr(t)===tr}function pr(t){if(!t)return!1;var e=cr(t);return or.indexOf(e)>=0||(ur(t)||lr(t)||at(t))}function dr(t){return 0|ct[Object.prototype.toString.call(t)]}function yr(t,e){return it.allocType(t.type===ue?Ee:t.type,e)}function vr(t,e){t.type===ue?(t.data=Ft(e),it.freeType(e)):t.data=e}function gr(t,e,r,n,i,o){var a;if(a=void 0!==sr[t]?sr[t]:Je[t]*ar[e],o&&(a*=6),i){for(var s=0,u=r;u>=1;)s+=a*u*u,u/=2;return s}return a*r*n}function mr(r,n,i,o,s,u,l){var c={"don't care":Fe,"dont care":Fe,nice:Ue,fast:ze},f={repeat:Ce,clamp:Oe,mirror:Ae},h={nearest:Ie,linear:Le},p=e({mipmap:De,"nearest mipmap nearest":je,"linear mipmap nearest":Ne,"nearest mipmap linear":Re,"linear mipmap linear":De},h),d={none:0,browser:Ye},y={uint8:we,rgba4:te,rgb565:re,"rgb5 a1":ee},v={alpha:Yt,luminance:Zt,"luminance alpha":Kt,rgb:Xt,rgba:qt,rgba4:Jt,"rgb5 a1":Qt,rgb565:$t},g={};n.ext_srgb&&(v.srgb=ae,v.srgba=se),n.oes_texture_float&&(y.float32=y.float=Ee),n.oes_texture_half_float&&(y.float16=y["half float"]=ue),n.webgl_depth_texture&&(e(v,{depth:ie,"depth stencil":oe}),e(y,{uint16:_e,uint32:Se,"depth stencil":ne})),n.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":le,"rgba s3tc dxt1":ce,"rgba s3tc dxt3":fe,"rgba s3tc dxt5":he}),n.webgl_compressed_texture_atc&&e(g,{"rgb atc":pe,"rgba atc explicit alpha":de,"rgba atc interpolated alpha":ye}),n.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":ve,"rgb pvrtc 2bppv1":ge,"rgba pvrtc 4bppv1":me,"rgba pvrtc 2bppv1":be}),n.webgl_compressed_texture_etc1&&(g["rgb etc1"]=xe);var m=Array.prototype.slice.call(r.getParameter(Gt));Object.keys(g).forEach(function(t){var e=g[t];m.indexOf(e)>=0&&(v[t]=e)});var b=Object.keys(v);i.textureFormats=b;var x=[];Object.keys(v).forEach(function(t){var e=v[t];x[e]=t});var w=[];Object.keys(y).forEach(function(t){var e=y[t];w[e]=t});var _=[];Object.keys(h).forEach(function(t){var e=h[t];_[e]=t});var S=[];Object.keys(p).forEach(function(t){var e=p[t];S[e]=t});var E=[];Object.keys(f).forEach(function(t){var e=f[t];E[e]=t});var k=b.reduce(function(t,e){var r=v[e];return r===Zt||r===Yt||r===Zt||r===Kt||r===ie||r===oe||n.ext_srgb&&(r===ae||r===se)?t[r]=r:r===Qt||e.indexOf("rgba")>=0?t[r]=qt:t[r]=Xt,t},{});function T(){this.internalformat=qt,this.format=qt,this.type=we,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Ye,this.width=0,this.height=0,this.channels=0}function C(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function O(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(j.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(j.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(j.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(j.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var r=e.type;j(n.oes_texture_float||!("float"===r||"float32"===r),"you must enable the OES_texture_float extension in order to use floating point textures."),j(n.oes_texture_half_float||!("half float"===r||"float16"===r),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),j(n.webgl_depth_texture||!("uint16"===r||"uint32"===r||"depth stencil"===r),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),j.parameter(r,y,"invalid texture type"),t.type=y[r]}var o=t.width,s=t.height,u=t.channels,l=!1;"shape"in e?(j(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],s=e.shape[1],3===e.shape.length&&(u=e.shape[2],j(u>0&&u<=4,"invalid number of channels"),l=!0),j(o>=0&&o<=i.maxTextureSize,"invalid width"),j(s>=0&&s<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=s=e.radius,j(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,j(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(s=e.height,j(s>=0&&s<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,j(u>0&&u<=4,"invalid number of channels"),l=!0)),t.width=0|o,t.height=0|s,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;j(n.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),j.parameter(f,v,"invalid texture format");var h=t.internalformat=v[f];t.format=k[h],f in y&&("type"in e||(t.type=y[f])),f in g&&(t.compressed=!0),c=!0}!l&&c?t.channels=Je[t.format]:l&&!c?t.channels!==Ke[t.format]&&(t.format=t.internalformat=Ke[t.channels]):c&&l&&j(t.channels===Je[t.format],"number of channels inconsistent with specified format")}}function A(t){r.pixelStorei(He,t.flipY),r.pixelStorei(We,t.premultiplyAlpha),r.pixelStorei(qe,t.colorSpace),r.pixelStorei(Ve,t.unpackAlignment)}function P(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function M(e,r){var n=null;if(pr(r)?n=r:r&&(j.type(r,"object","invalid pixel data type"),O(e,r),"x"in r&&(e.xOffset=0|r.x),"y"in r&&(e.yOffset=0|r.y),pr(r.data)&&(n=r.data)),j(!e.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),r.copy){j(!n,"can not specify copy and data field for the same texture");var o=s.viewportWidth,a=s.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,j(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=a,"copy texture read out of bounds")}else if(n){if(t(n))e.channels=e.channels||4,e.data=n,"type"in r||e.type!==we||(e.type=dr(n));else if(ur(n))e.channels=e.channels||4,function(t,e){var r=e.length;switch(t.type){case we:case _e:case Se:case Ee:var n=it.allocType(t.type,r);n.set(e),t.data=n;break;case ue:t.data=Ft(e);break;default:j.raise("unsupported texture type, must specify a typed array")}}(e,n),e.alignment=1,e.needsFree=!0;else if(at(n)){var u=n.data;Array.isArray(u)||e.type!==we||(e.type=dr(u));var l,c,f,h,p,d,y=n.shape,v=n.stride;3===y.length?(f=y[2],d=v[2]):(j(2===y.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,d=1),l=y[0],c=y[1],h=v[0],p=v[1],e.alignment=1,e.width=l,e.height=c,e.channels=f,e.format=e.internalformat=Ke[f],e.needsFree=!0,function(t,e,r,n,i,o){for(var a=t.width,s=t.height,u=t.channels,l=yr(t,a*s*u),c=0,f=0;f=0,"oes_texture_float extension not enabled"):e.type===ue&&j(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function I(t,e,n){var i=t.element,a=t.data,s=t.internalformat,u=t.format,l=t.type,c=t.width,f=t.height;A(t),i?r.texImage2D(e,n,u,u,l,i):t.compressed?r.compressedTexImage2D(e,n,s,c,f,0,a):t.needsCopy?(o(),r.copyTexImage2D(e,n,u,t.xOffset,t.yOffset,c,f,0)):r.texImage2D(e,n,u,c,f,0,u,l,a||null)}function L(t,e,n,i,a){var s=t.element,u=t.data,l=t.internalformat,c=t.format,f=t.type,h=t.width,p=t.height;A(t),s?r.texSubImage2D(e,a,n,i,c,f,s):t.compressed?r.compressedTexSubImage2D(e,a,n,i,l,h,p,u):t.needsCopy?(o(),r.copyTexSubImage2D(e,a,n,i,t.xOffset,t.yOffset,h,p)):r.texSubImage2D(e,a,n,i,h,p,c,f,u)}var N=[];function R(){return N.pop()||new P}function D(t){t.needsFree&&it.freeType(t.data),P.call(t),N.push(t)}function B(t,e,r){var n=t.images[0]=R();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function F(t,e){var r=null;if(pr(e))C(r=t.images[0]=R(),t),M(r,e),t.mipmask=1;else if(O(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,M(r,n[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;j.parameter(n,h),t.magFilter=h[n]}var o=t.wrapS,s=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(j.parameter(u,f),o=s=f[u]):Array.isArray(u)&&(j.parameter(u[0],f),j.parameter(u[1],f),o=f[u[0]],s=f[u[1]])}else{if("wrapS"in e){var l=e.wrapS;j.parameter(l,f),o=f[l]}if("wrapT"in e){var d=e.wrapT;j.parameter(d,f),s=f[d]}}if(t.wrapS=o,t.wrapT=s,"anisotropic"in e){var y=e.anisotropic;j("number"==typeof y&&y>=1&&y<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(a(e.mipmap)){case"string":j.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":j(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:j.raise("invalid mipmap type")}!v||"min"in e||(t.minFilter=je)}}function q(t,e){r.texParameteri(e,Me,t.minFilter),r.texParameteri(e,Pe,t.magFilter),r.texParameteri(e,ke,t.wrapS),r.texParameteri(e,Te,t.wrapT),n.ext_texture_filter_anisotropic&&r.texParameteri(e,Ge,t.anisotropic),t.genMipmaps&&(r.hint(Be,t.mipmapHint),r.generateMipmap(e))}var Y=0,X={},Z=i.maxTextureUnits,K=Array(Z).map(function(){return null});function J(t){T.call(this),this.mipmask=0,this.internalformat=qt,this.id=Y++,this.refCount=1,this.target=t,this.texture=r.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new H,l.profile&&(this.stats={size:0})}function Q(t){r.activeTexture(Xe),r.bindTexture(t.target,t.texture)}function $(){var t=K[0];t?r.bindTexture(t.target,t.texture):r.bindTexture(Vt,null)}function tt(t){var e=t.texture;j(e,"must not double destroy texture");var n=t.unit,i=t.target;n>=0&&(r.activeTexture(Xe+n),r.bindTexture(i,null),K[n]=null),r.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete X[t.id],u.textureCount--}return e(J.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;n.unit=-1}K[e]=this,t=e;break}t>=Z&&j.raise("insufficient number of texture units"),l.profile&&u.maxTextureUnits>u)-a,l.height=l.height||(n.height>>u)-s,j(n.type===l.type&&n.format===l.format&&n.internalformat===l.internalformat,"incompatible format for texture.subimage"),j(a>=0&&s>=0&&a+l.width<=n.width&&s+l.height<=n.height,"texture.subimage write out of bounds"),j(n.mipmask&1<>s;++s){var u=i>>s,c=a>>s;if(!u||!c)break;r.texImage2D(Vt,s,n.format,u,c,0,n.format,n.type,null)}return $(),l.profile&&(n.stats.size=gr(n.internalformat,n.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=n,l.profile&&(o.stats=n.stats),o.destroy=function(){n.decRef()},o},createCube:function(t,e,n,o,s,c){var f=new J(Ht);X[f.id]=f,u.cubeCount++;var h=new Array(6);function p(t,e,r,n,o,s){var u,c=f.texInfo;for(H.call(c),u=0;u<6;++u)h[u]=G();if("number"!=typeof t&&t)if("object"===a(t))if(e)F(h[0],t),F(h[1],e),F(h[2],r),F(h[3],n),F(h[4],o),F(h[5],s);else if(W(c,t),O(f,t),"faces"in t){var d=t.faces;for(j(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),u=0;u<6;++u)j("object"===a(d[u])&&!!d[u],"invalid input for cube map face"),C(h[u],f),F(h[u],d[u])}else for(u=0;u<6;++u)F(h[u],t);else j.raise("invalid arguments to cube map");else{var y=0|t||1;for(u=0;u<6;++u)B(h[u],y,y)}for(C(f,h[0]),i.npotTextureCube||j(Ut(f.width)&&Ut(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(h[0].width<<1)-1:f.mipmask=h[0].mipmask,j.textureCube(f,c,h,i),f.internalformat=h[0].internalformat,p.width=h[0].width,p.height=h[0].height,Q(f),u=0;u<6;++u)z(h[u],Wt+u);for(q(c,Ht),$(),l.profile&&(f.stats.size=gr(f.internalformat,f.type,p.width,p.height,c.genMipmaps,!0)),p.format=x[f.internalformat],p.type=w[f.type],p.mag=_[c.magFilter],p.min=S[c.minFilter],p.wrapS=E[c.wrapS],p.wrapT=E[c.wrapT],u=0;u<6;++u)V(h[u]);return p}return p(t,e,n,o,s,c),p.subimage=function(t,e,r,n,i){j(!!e,"must specify image data"),j("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|r,a=0|n,s=0|i,u=R();return C(u,f),u.width=0,u.height=0,M(u,e),u.width=u.width||(f.width>>s)-o,u.height=u.height||(f.height>>s)-a,j(f.type===u.type&&f.format===u.format&&f.internalformat===u.internalformat,"incompatible format for texture.subimage"),j(o>=0&&a>=0&&o+u.width<=f.width&&a+u.height<=f.height,"texture.subimage write out of bounds"),j(f.mipmask&1<>i;++i)r.texImage2D(Wt+n,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return $(),l.profile&&(f.stats.size=gr(f.internalformat,f.type,p.width,p.height,!1,!0)),p}},p._reglType="textureCube",p._texture=f,l.profile&&(p.stats=f.stats),p.destroy=function(){f.decRef()},p},clear:function(){for(var t=0;t>e,t.height>>e,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)r.texImage2D(Wt+n,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);q(t.texInfo,t.target)})},refresh:function(){for(var t=0;t=2,"invalid renderbuffer shape"),u=0|d[0],l=0|d[1]}else"radius"in p&&(u=l=0|p.radius),"width"in p&&(u=0|p.width),"height"in p&&(l=0|p.height);"format"in p&&(j.parameter(p.format,o,"invalid renderbuffer format"),c=o[p.format])}else"number"==typeof e?(u=0|e,l="number"==typeof n?0|n:u):e?j.raise("invalid arguments to renderbuffer constructor"):u=l=1;if(j(u>0&&l>0&&u<=r.maxRenderbufferSize&&l<=r.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||l!==f.height||c!==f.format)return h.width=f.width=u,h.height=f.height=l,f.format=c,t.bindRenderbuffer(br,f.renderbuffer),t.renderbufferStorage(br,c,u,l),j(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=_r(f.format,f.width,f.height)),h.format=s[f.format],h}return l[f.id]=f,n.renderbufferCount++,h(e,u),h.resize=function(e,n){var o=0|e,a=0|n||o;return o===f.width&&a===f.height?h:(j(o>0&&a>0&&o<=r.maxRenderbufferSize&&a<=r.maxRenderbufferSize,"invalid renderbuffer size"),h.width=f.width=o,h.height=f.height=a,t.bindRenderbuffer(br,f.renderbuffer),t.renderbufferStorage(br,f.format,o,a),j(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=_r(f.format,f.width,f.height)),h)},h._reglType="renderbuffer",h._renderbuffer=f,i.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){st(l).forEach(f)},restore:function(){st(l).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(br,e.renderbuffer),t.renderbufferStorage(br,e.format,e.width,e.height)}),t.bindRenderbuffer(br,null)}}},Er=36160,kr=36161,Tr=3553,Cr=34069,Or=36064,Ar=36096,Pr=36128,Mr=33306,Ir=36053,Lr=6402,jr=[6407,6408],Nr=[];Nr[6408]=4,Nr[6407]=3;var Rr=[];Rr[5121]=1,Rr[5126]=4,Rr[36193]=2;var Dr=33189,Br=36168,Fr=34041,zr=[32854,32855,36194,35907,34842,34843,34836],Ur={};Ur[Ir]="complete",Ur[36054]="incomplete attachment",Ur[36057]="incomplete dimensions",Ur[36055]="incomplete, missing attachment",Ur[36061]="unsupported";var Gr=5126,Vr=34962;function Hr(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Gr,this.offset=0,this.stride=0,this.divisor=0}var Wr=35632,qr=35633,Yr=35718,Xr=35721;function Zr(t,r,n,i){var o={},a={};function s(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function u(t,e){for(var r=0;r1)for(var g=0;gt&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);st(o).forEach(e),o={},st(a).forEach(e),a={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,c={},n.shaderCount=0},program:function(r,s,u,l){j.command(r>=0,"missing vertex shader",u),j.command(s>=0,"missing fragment shader",u);var d=c[s];d||(d=c[s]={});var y=d[r];if(y&&(y.refCount++,!l))return y;var v=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(s,r);return n.shaderCount++,p(v,u,l),y||(d[r]=v),f.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=f.indexOf(v);f.splice(e,1),n.shaderCount--}d[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete c[v.fragId][v.vertId]),Object.keys(c[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete c[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t=0&&c=0&&f0&&h+c<=i.framebufferWidth,"invalid width for read pixels"),j(p>0&&p+f<=i.framebufferHeight,"invalid height for read pixels"),n();var y=h*p*4;return d||(l===Jr?d=new Uint8Array(y):l===$r&&(d=d||new Float32Array(y))),j.isTypedArray(d,"data buffer for regl.read() must be a typedarray"),j(d.byteLength>=y,"data buffer for regl.read() too small"),e.pixelStorei(Qr,4),e.readPixels(c,f,h,p,Kr,l,d),d}return function(t){return t&&"framebuffer"in t?function(t){var e;return r.setFBO({framebuffer:t.framebuffer},function(){e=u(t)}),e}(t):u(t)}}function en(t){return Array.prototype.slice.call(t)}function rn(t){return en(t).join("")}var nn="xyzw".split(""),on=5121,an=1,sn=2,un=0,ln=1,cn=2,fn=3,hn=4,pn=5,dn=6,yn="dither",vn="blend.enable",gn="blend.color",mn="blend.equation",bn="blend.func",xn="depth.enable",wn="depth.func",_n="depth.range",Sn="depth.mask",En="colorMask",kn="cull.enable",Tn="cull.face",Cn="frontFace",On="lineWidth",An="polygonOffset.enable",Pn="polygonOffset.offset",Mn="sample.alpha",In="sample.enable",Ln="sample.coverage",jn="stencil.enable",Nn="stencil.mask",Rn="stencil.func",Dn="stencil.opFront",Bn="stencil.opBack",Fn="scissor.enable",zn="scissor.box",Un="viewport",Gn="profile",Vn="framebuffer",Hn="vert",Wn="frag",qn="elements",Yn="primitive",Xn="count",Zn="offset",Kn="instances",Jn="vao",Qn=Vn+"Width",$n=Vn+"Height",ti=Un+"Width",ei=Un+"Height",ri="drawingBufferWidth",ni="drawingBufferHeight",ii=[bn,mn,Rn,Dn,Bn,Ln,Un,zn,Pn],oi=34962,ai=34963,si=3553,ui=34067,li=2884,ci=3042,fi=3024,hi=2960,pi=2929,di=3089,yi=32823,vi=32926,gi=32928,mi=5126,bi=35664,xi=35665,wi=35666,_i=5124,Si=35667,Ei=35668,ki=35669,Ti=35670,Ci=35671,Oi=35672,Ai=35673,Pi=35674,Mi=35675,Ii=35676,Li=35678,ji=35680,Ni=4,Ri=1028,Di=1029,Bi=2304,Fi=2305,zi=32775,Ui=32776,Gi=519,Vi=7680,Hi=0,Wi=1,qi=32774,Yi=513,Xi=36160,Zi=36064,Ki={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ji=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Qi={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},$i={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},to={frag:35632,vert:35633},eo={cw:Bi,ccw:Fi};function ro(e){return Array.isArray(e)||t(e)||at(e)}function no(t){return t.sort(function(t,e){return t===Un?-1:e===Un?1:t=1,n>=2,e)}if(r===hn){var i=t.data;return new io(i.thisDep,i.contextDep,i.propDep,e)}if(r===pn)return new io(!1,!1,!1,e);if(r===dn){for(var o=!1,a=!1,s=!1,u=0;u=1&&(a=!0),c>=2&&(s=!0)}else l.type===hn&&(o=o||l.data.thisDep,a=a||l.data.contextDep,s=s||l.data.propDep)}return new io(o,a,s,e)}return new io(r===fn,r===cn,r===ln,e)}var uo=new io(!1,!1,!1,function(){});function lo(t,r,n,i,o,s,u,l,c,f,h,p,d,y,v){var g=f.Record,m={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(m.min=zi,m.max=Ui);var b=n.angle_instanced_arrays,x=n.webgl_draw_buffers,w={dirty:!0,profile:v.profile},_={},S=[],E={},k={};function T(t){return t.replace(".","_")}function C(t,e,r){var n=T(t);S.push(t),_[n]=w[n]=!!r,E[n]=e}function O(t,e,r){var n=T(t);S.push(t),Array.isArray(r)?(w[n]=r.slice(),_[n]=r.slice()):w[n]=_[n]=r,k[n]=e}C(yn,fi),C(vn,ci),O(gn,"blendColor",[0,0,0,0]),O(mn,"blendEquationSeparate",[qi,qi]),O(bn,"blendFuncSeparate",[Wi,Hi,Wi,Hi]),C(xn,pi,!0),O(wn,"depthFunc",Yi),O(_n,"depthRange",[0,1]),O(Sn,"depthMask",!0),O(En,En,[!0,!0,!0,!0]),C(kn,li),O(Tn,"cullFace",Di),O(Cn,Cn,Fi),O(On,On,1),C(An,yi),O(Pn,"polygonOffset",[0,0]),C(Mn,vi),C(In,gi),O(Ln,"sampleCoverage",[1,!1]),C(jn,hi),O(Nn,"stencilMask",-1),O(Rn,"stencilFunc",[Gi,0,-1]),O(Dn,"stencilOpSeparate",[Ri,Vi,Vi,Vi]),O(Bn,"stencilOpSeparate",[Di,Vi,Vi,Vi]),C(Fn,di),O(zn,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),O(Un,Un,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var A={gl:t,context:d,strings:r,next:_,current:w,draw:p,elements:s,buffer:o,shader:h,attributes:f.state,vao:f,uniforms:c,framebuffer:l,extensions:n,timer:y,isBufferArgs:ro},P={primTypes:St,compareFuncs:Qi,blendFuncs:Ki,blendEquations:m,stencilOps:$i,glTypes:ft,orientationType:eo};j.optional(function(){A.isArrayLike=zt}),x&&(P.backBuffer=[Di],P.drawBuffer=X(i.maxDrawbuffers,function(t){return 0===t?[0]:X(t,function(t){return Zi+t})}));var M=0;function I(){var t=function(){var t=0,r=[],n=[];function i(){var r=[],n=[];return e(function(){r.push.apply(r,en(arguments))},{def:function(){var e="v"+t++;return n.push(e),arguments.length>0&&(r.push(e,"="),r.push.apply(r,en(arguments)),r.push(";")),e},toString:function(){return rn([n.length>0?"var "+n.join(",")+";":"",rn(r)])}})}function o(){var t=i(),r=i(),n=t.toString,o=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e(function(){t.apply(t,en(arguments))},{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i=0,'unknown parameter "'+e+'"',p.commandStr)})}e(d),e(y)});var v=function(t,e){var r=t.static;if("string"==typeof r[Wn]&&"string"==typeof r[Hn]){if(Object.keys(e.dynamic).length>0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var o=[],a=0;a=0,"invalid "+t,r.commandStr)):u=!1,"height"in o?(s=0|o.height,j.command(s>=0,"invalid "+t,r.commandStr)):u=!1,new io(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,function(t,e){var r=t.shared.context,n=a;"width"in o||(n=e.def(r,".",Qn,"-",l));var i=s;return"height"in o||(i=e.def(r,".",$n,"-",c)),[l,c,n,i]})}if(t in i){var f=i[t],h=so(f,function(e,r){var n=e.invoke(r,f);j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,o=r.def(n,".x|0"),a=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Qn,"-",o,")"),u=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",$n,"-",a,")");return j.optional(function(){e.assert(r,s+">=0&&"+u+">=0","invalid "+t)}),[o,a,s,u]});return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new io(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Qn),e.def(r,".",$n)]}):null}var a=o(Un);if(a){var s=a;a=new io(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+ti,r[2]),e.set(n,"."+ei,r[3]),r})}return{viewport:a,scissor_box:o(zn)}}(t,x,p),_=function(t,e){var r=t.static,n=t.dynamic,i=function(){if(qn in r){var t=r[qn];ro(t)?t=s.getElements(s.create(t,!0)):t&&(t=s.getElements(t),j.command(t,"invalid elements",e.commandStr));var i=ao(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return i.value=t,i}if(qn in n){var o=n[qn];return so(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(n,"(",a,")"),l=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return j.optional(function(){t.assert(l.else,"!"+a+"||"+s,"invalid elements")}),e.entry(l),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}();function o(t,o){if(t in r){var a=0|r[t];return j.command(!o||a>=0,"invalid "+t,e.commandStr),ao(function(t,e){return o&&(t.OFFSET=a),a})}if(t in n){var s=n[t];return so(s,function(e,r){var n=e.invoke(r,s);return o&&(e.OFFSET=n,j.optional(function(){e.assert(r,n+">=0","invalid "+t)})),n})}return o&&i?ao(function(t,e){return t.OFFSET="0",0}):null}var a=o(Zn,!0);return{elements:i,primitive:function(){if(Yn in r){var t=r[Yn];return j.commandParameter(t,St,"invalid primitve",e.commandStr),ao(function(e,r){return St[t]})}if(Yn in n){var o=n[Yn];return so(o,function(t,e){var r=t.constants.primTypes,n=t.invoke(e,o);return j.optional(function(){t.assert(e,n+" in "+r,"invalid primitive, must be one of "+Object.keys(St))}),e.def(r,"[",n,"]")})}return i?oo(i)?i.value?ao(function(t,e){return e.def(t.ELEMENTS,".primType")}):ao(function(){return Ni}):new io(i.thisDep,i.contextDep,i.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Ni)}):null}(),count:function(){if(Xn in r){var t=0|r[Xn];return j.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ao(function(){return t})}if(Xn in n){var o=n[Xn];return so(o,function(t,e){var r=t.invoke(e,o);return j.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">=0&&"+r+"===("+r+"|0)","invalid vertex count")}),r})}if(i){if(oo(i)){if(i)return a?new io(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return j.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):ao(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var s=ao(function(){return-1});return j.optional(function(){s.MISSING=!0}),s}var u=new io(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return j.optional(function(){u.DYNAMIC=!0}),u}return null}(),instances:o(Kn,!1),offset:a}}(t,p),E=function(t,e){var r=t.static,n=t.dynamic,o={};return S.forEach(function(t){var s=T(t);function u(e,i){if(t in r){var a=e(r[t]);o[s]=ao(function(){return a})}else if(t in n){var u=n[t];o[s]=so(u,function(t,e){return i(t,e,t.invoke(e,u))})}}switch(t){case kn:case vn:case yn:case jn:case xn:case Fn:case An:case Mn:case In:case Sn:return u(function(r){return j.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return j.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case wn:return u(function(r){return j.commandParameter(r,Qi,"invalid "+t,e.commandStr),Qi[r]},function(e,r,n){var i=e.constants.compareFuncs;return j.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qi))}),r.def(i,"[",n,"]")});case _n:return u(function(t){return j.command(zt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return j.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case bn:return u(function(t){j.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return j.commandParameter(r,Ki,s+".srcRGB",e.commandStr),j.commandParameter(n,Ki,s+".srcAlpha",e.commandStr),j.commandParameter(i,Ki,s+".dstRGB",e.commandStr),j.commandParameter(o,Ki,s+".dstAlpha",e.commandStr),j.command(-1===Ji.indexOf(r+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ki[r],Ki[i],Ki[n],Ki[o]]},function(e,r,n){var i=e.constants.blendFuncs;function o(o,a){var s=r.def('"',o,a,'" in ',n,"?",n,".",o,a,":",n,".",o);return j.optional(function(){e.assert(r,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Ki))}),s}j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var a=o("src","RGB"),s=o("dst","RGB");j.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var u=r.def(i,"[",a,"]"),l=r.def(i,"[",o("src","Alpha"),"]");return[u,r.def(i,"[",s,"]"),l,r.def(i,"[",o("dst","Alpha"),"]")]});case mn:return u(function(r){return"string"==typeof r?(j.commandParameter(r,m,"invalid "+t,e.commandStr),[m[r],m[r]]):"object"===a(r)?(j.commandParameter(r.rgb,m,t+".rgb",e.commandStr),j.commandParameter(r.alpha,m,t+".alpha",e.commandStr),[m[r.rgb],m[r.alpha]]):void j.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,o=r.def(),a=r.def(),s=e.cond("typeof ",n,'==="string"');return j.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(m))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(o,"=",a,"=",i,"[",n,"];"),s.else(o,"=",i,"[",n,".rgb];",a,"=",i,"[",n,".alpha];"),r(s),[o,a]});case gn:return u(function(t){return j.command(zt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),X(4,function(e){return+t[e]})},function(t,e,r){return j.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),X(4,function(t){return e.def("+",r,"[",t,"]")})});case Nn:return u(function(t){return j.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return j.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Rn:return u(function(r){j.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,o="mask"in r?r.mask:-1;return j.commandParameter(n,Qi,t+".cmp",e.commandStr),j.commandType(i,"number",t+".ref",e.commandStr),j.commandType(o,"number",t+".mask",e.commandStr),[Qi[n],i,o]},function(t,e,r){var n=t.constants.compareFuncs;return j.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Vi),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Dn:case Bn:return u(function(r){j.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",o=r.zpass||"keep";return j.commandParameter(n,$i,t+".fail",e.commandStr),j.commandParameter(i,$i,t+".zfail",e.commandStr),j.commandParameter(o,$i,t+".zpass",e.commandStr),[t===Bn?Di:Ri,$i[n],$i[i],$i[o]]},function(e,r,n){var i=e.constants.stencilOps;function o(o){return j.optional(function(){e.assert(r,'!("'+o+'" in '+n+")||("+n+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys($i))}),r.def('"',o,'" in ',n,"?",i,"[",n,".",o,"]:",Vi)}return j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Bn?Di:Ri,o("fail"),o("zfail"),o("zpass")]});case Pn:return u(function(t){j.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return j.commandType(r,"number",s+".factor",e.commandStr),j.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case Tn:return u(function(t){var r=0;return"front"===t?r=Ri:"back"===t&&(r=Di),j.command(!!r,s,e.commandStr),r},function(t,e,r){return j.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Ri,":",Di)});case On:return u(function(t){return j.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t},function(t,e,r){return j.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+i.lineWidthDims[0]+"&&"+r+"<="+i.lineWidthDims[1],"invalid line width")}),r});case Cn:return u(function(t){return j.commandParameter(t,eo,s,e.commandStr),eo[t]},function(t,e,r){return j.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+Bi+":"+Fi)});case En:return u(function(t){return j.command(zt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return j.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),X(4,function(t){return"!!"+r+"["+t+"]"})});case Ln:return u(function(t){j.command("object"===a(t)&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return j.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return j.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),o}(t,p),k=function(t,e,n){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=r.id(i[t]);j.optional(function(){h.shader(to[t],e,j.guessCommand())});var n=ao(function(){return e});return n.id=e,n}if(t in o){var a=o[t];return so(a,function(e,r){var n=e.invoke(r,a),i=r.def(e.shared.strings,".id(",n,")");return j.optional(function(){r(e.shared.shader,".shader(",to[t],",",i,",",e.command,");")}),i})}return null}var s,u=a(Wn),l=a(Hn),c=null;return oo(u)&&oo(l)?(c=h.program(l.id,u.id,null,n),s=ao(function(t,e){return t.link(c)})):s=new io(u&&u.thisDep||l&&l.thisDep,u&&u.contextDep||l&&l.contextDep,u&&u.propDep||l&&l.propDep,function(t,e){var r,n=t.shared.shader;r=u?u.append(t,e):e.def(n,".",Wn);var i=n+".program("+(l?l.append(t,e):e.def(n,".",Hn))+","+r;return j.optional(function(){i+=","+t.command}),e.def(i+")")}),{frag:u,vert:l,progVar:s,program:c}}(t,0,v);function C(t){var e=w[t];e&&(E[t]=e)}C(Un),C(T(zn));var O=Object.keys(E).length>0,A={framebuffer:x,draw:_,shader:k,state:E,dirty:O,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(A.profile=function(t){var e,r=t.static,n=t.dynamic;if(Gn in r){var i=!!r[Gn];(e=ao(function(t,e){return i})).enable=i}else if(Gn in n){var o=n[Gn];e=so(o,function(t,e){return t.invoke(e,o)})}return e}(t),A.uniforms=function(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,o=r[t];if("number"==typeof o||"boolean"==typeof o)n=ao(function(){return o});else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?n=ao(function(t){return t.link(o)}):"framebuffer"===a||"framebufferCube"===a?(j.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=ao(function(t){return t.link(o.color[0])})):j.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else zt(o)?n=ao(function(e){return e.global.def("[",X(o.length,function(r){return j.command("number"==typeof o[r]||"boolean"==typeof o[r],"invalid uniform "+t,e.commandStr),o[r]}),"]")}):j.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=o,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=so(e,function(t,r){return t.invoke(r,e)})}),i}(u,p),A.drawVAO=A.scopeVAO=function(t,e){var r=t.static,n=t.dynamic;if(Jn in r){var i=r[Jn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),ao(function(t){return t.link(f.getVAO(i))})}if(Jn in n){var o=n[Jn];return so(o,function(t,e){var r=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+r+")")})}return null}(t),!A.drawVAO&&k.program&&!v&&n.angle_instanced_arrays){var P=!0,M=k.program.attributes.map(function(t){var r=e.static[t];return P=P&&!!r,r});if(P&&M.length>0){var I=f.getVAO(f.createVAO(M));A.drawVAO=new io(null,null,null,function(t,e){return t.link(I)}),A.useVAO=!0}}return v?A.useVAO=!0:A.attributes=function(t,e){var n=t.static,i=t.dynamic,s={};return Object.keys(n).forEach(function(t){var i=n[t],u=r.id(t),l=new g;if(ro(i))l.state=an,l.buffer=o.getBuffer(o.create(i,oi,!1,!0)),l.type=0;else{var c=o.getBuffer(i);if(c)l.state=an,l.buffer=c,l.type=0;else if(j.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;l.buffer="null",l.state=sn,"number"==typeof f?l.x=f:(j.command(zt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),nn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',e.commandStr);var p=0|i.stride;j.command(p>=0&&p<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;j.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var y=!!i.normalized,v=0;"type"in i&&(j.commandParameter(i.type,ft,"invalid type for attribute "+t,e.commandStr),v=ft[i.type]);var m=0|i.divisor;"divisor"in i&&(j.command(0===m||b,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),j.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),j.optional(function(){var r=e.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach(function(e){j.command(n.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",r)})}),l.buffer=c,l.state=an,l.size=d,l.normalized=y,l.type=v||c.dtype,l.offset=h,l.stride=p,l.divisor=m}}s[t]=ao(function(t,e){var r=t.attribCache;if(u in r)return r[u];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[u]=n,n})}),Object.keys(i).forEach(function(t){var e=i[t];s[t]=so(e,function(r,n){var i=r.invoke(n,e),o=r.shared,a=r.constants,s=o.isBufferArgs,u=o.buffer;j.optional(function(){r.assert(n,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')});var l={isStream:n.def(!1)},c=new g;c.state=an,Object.keys(c).forEach(function(t){l[t]=n.def(""+c[t])});var f=l.buffer,h=l.type;function p(t){n(l[t],"=",i,".",t,"|0;")}return n("if(",s,"(",i,")){",l.isStream,"=true;",f,"=",u,".createStream(",oi,",",i,");",h,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",h,"=",f,".dtype;",'}else if("constant" in ',i,"){",l.state,"=",sn,";","if(typeof "+i+'.constant === "number"){',l[nn[0]],"=",i,".constant;",nn.slice(1).map(function(t){return l[t]}).join("="),"=0;","}else{",nn.map(function(t,e){return l[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",i,".buffer)){",f,"=",u,".createStream(",oi,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",f,".dtype;",l.normalized,"=!!",i,".normalized;"),p("size"),p("offset"),p("stride"),p("divisor"),n("}}"),n.exit("if(",l.isStream,"){",u,".destroyStream(",f,");","}"),l})}),s}(e,p),A.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=ao(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=so(e,function(t,r){return t.invoke(r,e)})}),n}(c),A}function N(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(o){e.save(n,"."+o);var a=r[o].append(t,e);Array.isArray(a)?i(n,".",o,"=[",a.join(),"];"):i(n,".",o,"=",a,";")}),e(i)}function R(t,e,r,n){var i,o=t.shared,a=o.gl,s=o.framebuffer;x&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,l=t.constants,c=l.drawBuffer,f=l.backBuffer;u=r?r.append(t,e):e.def(s,".next"),n||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",Xi,",",u,".framebuffer);"),x&&e(i,".drawBuffersWEBGL(",c,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",Xi,",null);"),x&&e(i,".drawBuffersWEBGL(",f,");"),e("}",s,".cur=",u,";"),n||e("}")}function D(t,e,r){var n=t.shared,i=n.gl,o=t.current,a=t.next,s=n.current,u=n.next,l=t.cond(s,".dirty");S.forEach(function(e){var n,c,f=T(e);if(!(f in r.state))if(f in a){n=a[f],c=o[f];var h=X(w[f].length,function(t){return l.def(n,"[",t,"]")});l(t.cond(h.map(function(t,e){return t+"!=="+c+"["+e+"]"}).join("||")).then(i,".",k[f],"(",h,");",h.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";"))}else{n=l.def(u,".",f);var p=t.cond(n,"!==",s,".",f);l(p),f in E?p(t.cond(n).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",n,";"):p(i,".",k[f],"(",n,");",s,".",f,"=",n,";")}}),0===Object.keys(r.state).length&&l(s,".dirty=false;"),e(l)}function B(t,e,r,n){var i=t.shared,o=t.current,a=i.current,s=i.gl;no(Object.keys(r)).forEach(function(i){var u=r[i];if(!n||n(u)){var l=u.append(t,e);if(E[i]){var c=E[i];oo(u)?e(s,l?".enable(":".disable(",c,");"):e(t.cond(l).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(a,".",i,"=",l,";")}else if(zt(l)){var f=o[i];e(s,".",k[i],"(",l,");",l.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",k[i],"(",l,");",a,".",i,"=",l,";")}})}function F(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,r,n,i){var o,a,s,u=t.shared,l=t.stats,c=u.current,f=u.timer,h=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(o=e.def(),"=",p(),";"),"string"==typeof i?t(l,".count+=",i,";"):t(l,".count++;"),y&&(n?t(a=e.def(),"=",f,".getNumPendingQueries();"):t(f,".beginQuery(",l,");"))}function v(t){t(l,".cpuTime+=",p(),"-",o,";"),y&&(n?t(f,".pushScopeStats(",a,",",f,".getNumPendingQueries(),",l,");"):t(f,".endQuery();"))}function g(t){var r=e.def(c,".profile");e(c,".profile=",t,";"),e.exit(c,".profile=",r,";")}if(h){if(oo(h))return void(h.enable?(d(e),v(e.exit),g("true")):g("false"));g(s=h.append(t,e))}else s=e.def(c,".profile");var m=t.block();d(m),e("if(",s,"){",m,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function U(t,e,r,n,i){var o=t.shared;n.forEach(function(n){var a,s=n.name,u=r.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(uo))return;var l=t.scopeAttrib(s);j.optional(function(){t.assert(e,l+".state","missing attribute "+s)}),a={},Object.keys(new g).forEach(function(t){a[t]=e.def(l,".",t)})}!function(r,n,i){var a=o.gl,s=e.def(r,".location"),u=e.def(o.attributes,"[",s,"]"),l=i.state,c=i.buffer,f=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function p(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var r,o=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",o,"||",u,".size!==",r,"||",h.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",a,".bindBuffer(",oi,",",c,".buffer);",a,".vertexAttribPointer(",[s,r,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",r,";",h.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),b){var l=i.divisor;e("if(",u,".divisor!==",l,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,l],");",u,".divisor=",l,";}")}}function d(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",nn.map(function(t,e){return u+"."+t+"!=="+f[e]}).join("||"),"){",a,".vertexAttrib4f(",s,",",f,");",nn.map(function(t,e){return u+"."+t+"="+f[e]+";"}).join(""),"}")}l===an?p():l===sn?d():(e("if(",l,"===",an,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case bi:case Si:case Ci:return 2;case xi:case Ei:case Oi:return 3;case wi:case ki:case Ai:return 4;default:return 1}}(n.info.type),a)})}function V(t,e,n,i,o){for(var a,s=t.shared,u=s.gl,l=0;l1?e(X(x,function(t){return Array.isArray(c)?c[t]:c+"["+t+"]"})):(j(!Array.isArray(c),"uniform value must not be an array"),e(c));e(");")}}function H(t,e,r,n){var i=t.shared,o=i.gl,a=i.draw,s=n.draw;var u=function(){var i,u=s.elements,l=e;return u?((u.contextDep&&n.contextDynamic||u.propDep)&&(l=r),i=u.append(t,l)):i=l.def(a,".",qn),i&&l("if("+i+")"+o+".bindBuffer("+ai+","+i+".buffer.buffer);"),i}();function l(i){var o=s[i];return o?o.contextDep&&n.contextDynamic||o.propDep?o.append(t,r):o.append(t,e):e.def(a,".",i)}var c,f,h=l(Yn),p=l(Zn),d=function(){var i,o=s.count,u=e;return o?((o.contextDep&&n.contextDynamic||o.propDep)&&(u=r),i=o.append(t,u),j.optional(function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")})):(i=u.def(a,".",Xn),j.optional(function(){t.assert(u,i+">=0","missing vertex count")})),i}();if("number"==typeof d){if(0===d)return}else r("if(",d,"){"),r.exit("}");b&&(c=l(Kn),f=t.instancing);var y=u+".type",v=s.elements&&oo(s.elements);function g(){function t(){r(f,".drawElementsInstancedANGLE(",[h,d,y,p+"<<(("+y+"-"+on+")>>1)",c],");")}function e(){r(f,".drawArraysInstancedANGLE(",[h,p,d,c],");")}u?v?t():(r("if(",u,"){"),t(),r("}else{"),e(),r("}")):e()}function m(){function t(){r(o+".drawElements("+[h,d,y,p+"<<(("+y+"-"+on+")>>1)"]+");")}function e(){r(o+".drawArrays("+[h,p,d]+");")}u?v?t():(r("if(",u,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof c||c>=0)?"string"==typeof c?(r("if(",c,">0){"),g(),r("}else if(",c,"<0){"),m(),r("}")):g():m()}function W(t,e,r,n,i){var o=I(),a=o.proc("body",i);return j.optional(function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)}),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,r,n),o.compile().body}function q(t,e,r,n){F(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,r,n.attributes,function(){return!0})),V(t,e,r,n.uniforms,function(){return!0}),H(t,e,e,r)}function Y(t,e,r,n){function i(){return!0}t.batchId="a1",F(t,e),U(t,e,r,n.attributes,i),V(t,e,r,n.uniforms,i),H(t,e,e,r)}function Z(t,e,r,n){F(t,e);var i=r.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function l(t){return t.contextDep&&i||t.propDep}function c(t){return!l(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),r.needsContext&&N(t,u,r.context),r.needsFramebuffer&&R(t,u,r.framebuffer),B(t,u,r.state,l),r.profile&&l(r.profile)&&z(t,u,r,!1,!0),n)r.useVAO?r.drawVAO?l(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),U(t,s,r,n.attributes,c),U(t,u,r,n.attributes,l)),V(t,s,r,n.uniforms,c),V(t,u,r,n.uniforms,l),H(t,s,u,r);else{var f=t.global.def("{}"),h=r.shader.progVar.append(t,u),p=u.def(h,".id"),d=u.def(f,"[",p,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",d,"){",d,"=",f,"[",p,"]=",t.link(function(e){return W(Y,t,r,e,2)}),"(",h,");}",d,".call(this,a0[",o,"],",o,");")}}function K(t,e,r){var n=e.static[r];if(n&&function(t){if("object"===a(t)&&!zt(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;")}(s,u),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(r){var o=e.shader[r];o&&n.set(i.shader,"."+r,o.append(t,n))}N(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),no(Object.keys(e.state)).forEach(function(r){var o=e.state[r].append(t,n);zt(o)?o.forEach(function(e,i){n.set(t.next[r],"["+i+"]",e)}):n.set(i.next,"."+r,o)}),z(t,n,e,!0,!0),[qn,Zn,Xn,Kn,Yn].forEach(function(r){var o=e.draw[r];o&&n.set(i.draw,"."+r,""+o.append(t,n))}),Object.keys(e.uniforms).forEach(function(o){var a=e.uniforms[o].append(t,n);Array.isArray(a)&&(a="["+a.join()+"]"),n.set(i.uniforms,"["+r.id(o)+"]",a)}),Object.keys(e.attributes).forEach(function(r){var i=e.attributes[r].append(t,n),o=t.scopeAttrib(r);Object.keys(new g).forEach(function(t){n.set(o,"."+t,i[t])})}),e.scopeVAO&&n.set(i.vao,".targetVAO",e.scopeVAO.append(t,n)),a(Hn),a(Wn),Object.keys(e.state).length>0&&(n(o,".dirty=true;"),n.exit(o,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var r=t.proc("batch",2);t.batchId="0",F(t,r);var n=!1,i=!0;Object.keys(e.context).forEach(function(t){n=n||e.context[t].propDep}),n||(N(t,r,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&n||t.propDep}o?(o.propDep?n=a=!0:o.contextDep&&n&&(a=!0),a||R(t,r,o)):R(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),D(t,r,e),B(t,r,e.state,function(t){return!s(t)}),e.profile&&s(e.profile)||z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&n||u.propDep)Z(t,r,e,null);else{var l=u.append(t,r);if(r(t.shared.gl,".useProgram(",l,".program);"),e.shader.program)Z(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var c=t.global.def("{}"),f=r.def(l,".id"),h=r.def(c,"[",f,"]");r(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",c,"[",f,"]=",t.link(function(r){return W(Z,t,e,r,2)}),"(",l,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var co=34918,fo=34919,ho=35007,po=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];var o=[];function a(t){o.push(t)}var s=[];function u(t,e,r){var n=o.pop()||new function(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var l=[],c=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(ho,n),i.push(n),u(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(ho)},pushScopeStats:u,update:function(){var t,r,o=i.length;if(0!==o){c.length=Math.max(c.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,c[0]=0;var u=0;for(t=0,r=0;r0)if(Array.isArray(r[0])){s=dt(r);for(var c=1,f=1;f0)if("number"==typeof e[0]){var o=it.allocType(h.dtype,e.length);wt(o,e),d(o,i),it.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){n=dt(e);var a=pt(e,n,h.dtype);d(a,i),it.freeType(a)}else j.raise("invalid buffer data")}else if(at(e)){n=e.shape;var s=e.stride,u=0,l=0,c=0,f=0;1===n.length?(u=n[0],l=1,c=s[0],f=0):2===n.length?(u=n[0],l=n[1],c=s[0],f=s[1]):j.raise("invalid shape");var y=Array.isArray(e.data)?h.dtype:xt(e.data),v=it.allocType(y,u*l);_t(v,e.data,u,l,c,f,e.offset),d(v,i),it.freeType(v)}else j.raise("invalid data for buffer subdata");return p},n.profile&&(p.stats=h.stats),p.destroy=function(){f(h)},p},createStream:function(t,e){var r=u.pop();return r||(r=new s(t)),r.bind(),c(r,e,vt,0,1,!1),r},destroyStream:function(t){u.push(t)},clear:function(){st(a).forEach(f),u.forEach(f)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){st(a).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:c}}(i,h,n,function(t){return w.destroyBuffer(t)}),w=function(e,r,n,i,o){for(var a=n.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=n.attributes;u.length=e.length;for(var l=0;l=p.byteLength?c.subdata(p):(c.destroy(),n.buffers[l]=null)),n.buffers[l]||(c=n.buffers[l]=o.create(f,Vr,!1,!0)),h.buffer=o.getBuffer(c),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[l]=1):o.getBuffer(f)?(h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(f.buffer)?(h.buffer=o.getBuffer(f.buffer),h.size=0|(+f.size||h.buffer.dimension),h.normalized=!!f.normalized||!1,"type"in f?(j.parameter(f.type,ft,"invalid buffer type"),h.type=ft[f.type]):h.type=h.buffer.dtype,h.offset=0|(f.offset||0),h.stride=0|(f.stride||0),h.divisor=0|(f.divisor||0),h.state=1,j(h.size>=1&&h.size<=4,"size must be between 1 and 4"),j(h.offset>=0,"invalid offset"),j(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),j(h.divisor>=0,"divisor must be positive"),j(!h.divisor||!!r.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in f?(j(l>0,"first attribute must not be a constant"),h.x=+f.x||0,h.y=+f.y||0,h.z=+f.z||0,h.w=+f.w||0,h.state=2):j(!1,"invalid attribute spec for location "+l)}for(var d=0;d>=1:f===It&&(p>>=2)),i.vertCount=p;var d=s;if(s<0){d=Tt;var y=i.buffer.dimension;1===y&&(d=Et),2===y&&(d=kt),3===y&&(d=Tt)}i.primType=d}function f(t){i.elementsCount--,j(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,r){var o=n.create(null,Lt,!0),a=new u(o._buffer);function l(e){if(e)if("number"==typeof e)o(e),a.primType=Tt,a.vertCount=0|e,a.type=Ot;else{var r=null,n=Nt,i=-1,u=-1,f=0,h=0;Array.isArray(e)||t(e)||at(e)?r=e:(j.type(e,"object","invalid arguments for elements"),"data"in e&&(r=e.data,j(Array.isArray(r)||t(r)||at(r),"invalid data for element buffer")),"usage"in e&&(j.parameter(e.usage,ht,"invalid element buffer usage"),n=ht[e.usage]),"primitive"in e&&(j.parameter(e.primitive,St,"invalid element buffer primitive"),i=St[e.primitive]),"count"in e&&(j("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(j.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?f=0|e.length:(f=u,h===Pt||h===At?f*=2:h!==It&&h!==Mt||(f*=4))),c(a,r,n,i,u,f,h)}else o(),a.primType=Tt,a.vertCount=0,a.type=Ot;return l}return i.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return o.subdata(t,e),l},l.destroy=function(){f(a)},l},createStream:function(t){var e=l.pop();return e||(e=new u(n.create(null,Lt,!0,!1)._buffer)),c(e,t,jt,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){st(o).forEach(f)}}}(i,p,x,h),S=Zr(i,f,h,n),E=mr(i,p,b,function(){C.procs.poll()},m,h,n),k=Sr(i,p,b,h,n),T=function(t,r,n,i,o,s){var u={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function h(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function p(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,r){if(t)if(t.texture){var n=t.texture._texture,i=Math.max(1,n.width),o=Math.max(1,n.height);j(i===e&&o===r,"inconsistent width/height for supplied texture"),n.refCount+=1}else{var a=t.renderbuffer._renderbuffer;j(a.width===e&&a.height===r,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function y(e,r){r&&(r.texture?t.framebufferTexture2D(Er,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(Er,e,kr,r.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=Tr,r=null,n=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),j.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(r=i,j(e===Tr)):"textureCube"===o?(r=i,j(e>=Cr&&e=2,"invalid shape for framebuffer"),s=M[0],h=M[1]}else"radius"in P&&(s=h=P.radius),"width"in P&&(s=P.width),"height"in P&&(h=P.height);("color"in P||"colors"in P)&&(b=P.color||P.colors,Array.isArray(b)&&j(1===b.length||r.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in P&&(E=0|P.colorCount,j(E>0,"invalid color buffer count")),"colorTexture"in P&&(x=!!P.colorTexture,w="rgba4"),"colorType"in P&&(_=P.colorType,x?(j(r.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),j(r.oes_texture_half_float||!("half float"===_||"float16"===_),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===_||"float16"===_?(j(r.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==_&&"float32"!==_||(j(r.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),j.oneOf(_,f,"invalid color type")),"colorFormat"in P&&(w=P.colorFormat,l.indexOf(w)>=0?x=!0:c.indexOf(w)>=0?x=!1:x?j.oneOf(P.colorFormat,l,"invalid color format for texture"):j.oneOf(P.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in P||"depthStencilTexture"in P)&&(A=!(!P.depthTexture&&!P.depthStencilTexture),j(!A||r.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in P&&("boolean"==typeof P.depth?p=P.depth:(T=P.depth,y=!1)),"stencil"in P&&("boolean"==typeof P.stencil?y=P.stencil:(C=P.stencil,p=!1)),"depthStencil"in P&&("boolean"==typeof P.depthStencil?p=y=P.depthStencil:(O=P.depthStencil,p=!1,y=!1))}else s=h=1;var I=null,L=null,N=null,R=null;if(Array.isArray(b))I=b.map(v);else if(b)I=[v(b)];else for(I=new Array(E),i=0;i=0||I[i].renderbuffer&&zr.indexOf(I[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),I[i]&&I[i].texture){var B=Nr[I[i].texture._texture.format]*Rr[I[i].texture._texture.type];null===D?D=B:j(D===B,"all color attachments much have the same number of bits per pixel.")}return d(L,s,h),j(!L||L.texture&&L.texture._texture.format===Lr||L.renderbuffer&&L.renderbuffer._renderbuffer.format===Dr,"invalid depth attachment for framebuffer object"),d(N,s,h),j(!N||N.renderbuffer&&N.renderbuffer._renderbuffer.format===Br,"invalid stencil attachment for framebuffer object"),d(R,s,h),j(!R||R.texture&&R.texture._texture.format===Fr||R.renderbuffer&&R.renderbuffer._renderbuffer.format===Fr,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=s,o.height=h,o.colorAttachments=I,o.depthAttachment=L,o.stencilAttachment=N,o.depthStencilAttachment=R,a.color=I.map(m),a.depth=m(L),a.stencil=m(N),a.depthStencil=m(R),a.width=o.width,a.height=o.height,k(o),a}return s.framebufferCount++,a(t,i),e(a,{resize:function(t,e){j(u.next!==o,"can not resize a framebuffer which is currently in use");var r=Math.max(0|t,1),n=Math.max(0|e||r,1);if(r===o.width&&n===o.height)return a;for(var i=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),j(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in g&&(h=0|g.radius),"width"in g?(h=0|g.width,"height"in g&&j(g.height===h,"must be square")):"height"in g&&(h=0|g.height);("color"in g||"colors"in g)&&(p=g.color||g.colors,Array.isArray(p)&&j(1===p.length||r.webgl_draw_buffers,"multiple render targets not supported")),p||("colorCount"in g&&(v=0|g.colorCount,j(v>0,"invalid color buffer count")),"colorType"in g&&(j.oneOf(g.colorType,f,"invalid color type"),y=g.colorType),"colorFormat"in g&&(d=g.colorFormat,j.oneOf(g.colorFormat,l,"invalid color format for texture"))),"depth"in g&&(c.depth=g.depth),"stencil"in g&&(c.stencil=g.stencil),"depthStencil"in g&&(c.depthStencil=g.depthStencil)}else h=1;if(p)if(Array.isArray(p))for(s=[],n=0;n0&&(c.depth=o[0].depth,c.stencil=o[0].stencil,c.depthStencil=o[0].depthStencil),o[n]?o[n](c):o[n]=T(c)}return e(a,{width:h,height:h,color:s})}return a(t),e(a,{faces:o,resize:function(t){var e,r=0|t;if(j(r>0&&r<=n.maxCubeMapSize,"invalid radius for cube fbo"),r===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=M[t];e&&e(m,null,0)}i.flush(),d&&d.update()}function B(){!R&&M.length>0&&(R=V.next(D))}function F(){R&&(V.cancel(D),R=null)}function z(t){t.preventDefault(),s=!0,F(),I.forEach(function(t){t()})}function U(t){i.getError(),s=!1,u.restore(),S.restore(),x.restore(),E.restore(),k.restore(),T.restore(),w.restore(),d&&d.restore(),C.procs.refresh(),B(),L.forEach(function(t){t()})}function W(t){function r(t,e){var r={},n={};return Object.keys(t).forEach(function(i){var o=t[i];if(G.isDynamic(o))n[i]=G.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return f.call(this,function(t){for(;p.length=0,"cannot cancel a frame twice"),M[e]=function t(){var e=Eo(M,t);M[e]=M[M.length-1],M.length-=1,M.length<=0&&F()}}}}function K(){var t=A.viewport,e=A.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function J(){m.tick+=1,m.time=$(),K(),C.procs.poll()}function Q(){E.refresh(),K(),C.procs.refresh(),d&&d.update()}function $(){return(H()-y)/1e3}Q();var tt=e(W,{clear:function(t){if(j("object"===a(t)&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var r=0;r<6;++r)q(e({framebuffer:t.framebuffer.faces[r]},t),X);else q(t,X);else X(0,t)},prop:G.define.bind(null,wo),context:G.define.bind(null,_o),this:G.define.bind(null,So),draw:W({}),buffer:function(t){return x.create(t,mo,!1,!1)},elements:function(t){return _.create(t,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:k.create,framebuffer:T.create,framebufferCube:T.createCube,vao:w.createVAO,attributes:o,frame:Z,on:function(t,e){var r;switch(j.type(e,"function","listener callback must be a function"),t){case"frame":return Z(e);case"lost":r=I;break;case"restore":r=L;break;case"destroy":r=N;break;default:j.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t=0},read:O,destroy:function(){M.length=0,F(),P&&(P.removeEventListener(bo,z),P.removeEventListener(xo,U)),S.clear(),T.clear(),k.clear(),E.clear(),_.clear(),x.clear(),w.clear(),d&&d.clear(),N.forEach(function(t){t()})},_gl:i,_refresh:Q,poll:function(){J(),d&&d.update()},now:$,stats:h});return n.onDone(null,tt),tt}},"object"===a(e)?t.exports=o():void 0===(i="function"==typeof(n=o)?n.call(e,r,e,t):n)||(t.exports=i)},344:function(t,e,r){"use strict";var n=r(6730),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],r=0,a=t.length;r1&&void 0!==arguments[1]?arguments[1]:{};if(i=Object.assign({},n,i),!t||"string"!=typeof t)return t;var o=t.trim();if(void 0!==i.skipLike&&i.skipLike.test(o))return t;if(i.hex&&e.test(o))return Number.parseInt(o,16);var a=r.exec(o);if(a){var s=a[1],u=a[2],l=function(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}(a[3]),c=a[4]||a[6];if(!i.leadingZeros&&u.length>0&&s&&"."!==o[2])return t;if(!i.leadingZeros&&u.length>0&&!s&&"."!==o[1])return t;var f=Number(o),h=""+f;return-1!==h.search(/[eE]/)?i.eNotation?f:t:c?i.eNotation?f:t:-1!==o.indexOf(".")?"0"===h&&""===l?f:h===l?f:s&&h==="-"+l?f:t:u?l===h?f:s+l===h?f:t:o===h?f:o===s+h?f:t}return t}},12:function(t,e,r){var n,i;function o(t){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(a,s){"use strict";"object"===o(t)&&t.exports?t.exports=s():void 0===(i="function"==typeof(n=s)?n.call(e,r,e,t):n)||(t.exports=i)}(0,function(t){"use strict";var e=t&&t.IPv6;return{best:function(t){var e,r,n=t.toLowerCase().split(":"),i=n.length,o=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[i-1]&&""===n[i-2]&&n.pop(),-1!==n[(i=n.length)-1].indexOf(".")&&(o=7),e=0;e1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,l=0,c=0,f=-1,h=!1;for(a=0;al&&(u=f,l=c)):"0"===n[a]&&(h=!0,f=a,c=1);c>l&&(u=f,l=c),l>1&&n.splice(u,l,""),i=n.length;var p="";for(""===n[0]&&(p=":"),a=0;a=t.length-1)return!1;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return!1;var i=r.list[t.slice(e+1)];return!!i&&i.indexOf(" "+t.slice(n+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var n=r.list[t.slice(e+1)];return!!n&&n.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return null;var i=r.list[t.slice(e+1)];return i?i.indexOf(" "+t.slice(n+1,e)+" ")<0?null:t.slice(n+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r})},9545:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(s,u){"use strict";"object"===a(t)&&t.exports?t.exports=u(r(9167),r(12),r(5199)):(i=[r(9167),r(12),r(5199)],void 0===(o="function"==typeof(n=u)?n.apply(e,i):n)||(t.exports=o))}(0,function(t,e,r,n){"use strict";var i=n&&n.URI;function o(t,e){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof o))return r?n?new o(t,e):new o(t):new o;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}o.version="1.19.11";var s=o.prototype,u=Object.prototype.hasOwnProperty;function l(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function f(t){return"Array"===c(t)}function h(t,e){var r,n,i={};if("RegExp"===c(e))i=null;else if(f(e))for(r=0,n=e.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return o.domAttributes[e]}},o.encode=g,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=g,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(t,e){var r=o.encode(t+"");return void 0===e&&(e=o.escapeQuerySpace),e?r.replace(/%20/g,"+"):r},o.decodeQuery=function(t,e){t+="",void 0===e&&(e=o.escapeQuerySpace);try{return o.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var m,b={encode:"encode",decode:"decode"},x=function(t,e){return function(r){try{return o[e](r+"").replace(o.characters[t][e].expression,function(r){return o.characters[t][e].map[r]})}catch(t){return r}}};for(m in b)o[m+"PathSegment"]=x("pathname",b[m]),o[m+"UrnPathSegment"]=x("urnpath",b[m]);var w=function(t,e,r){return function(n){var i;i=r?function(t){return o[e](o[r](t))}:o[e];for(var a=(n+"").split(t),s=0,u=a.length;s-1&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),(r=t.indexOf("?"))>-1&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=o.parseAuthority(t,e)):(r=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(o.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=o.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},o.parseHost=function(t,e){t||(t="");var r,n,i=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===i&&(i=t.length),"["===t.charAt(0))r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,i)||null,"/"===e.port&&(e.port=null);else{var a=t.indexOf(":"),s=t.indexOf("/"),u=t.indexOf(":",a+1);-1!==u&&(-1===s||u-1?i:t.length-1);return a>-1&&(-1===i||a-1?p.slice(0,d)+p.slice(d).replace(a,""):p.replace(a,"")).length<=l[0].length||r.ignore&&r.ignore.test(p))){var g=e(p,c,h=c+p.length,t);void 0!==g?(g=String(g),t=t.slice(0,c)+g+t.slice(h),n.lastIndex=c+g.length):n.lastIndex=h}}return n.lastIndex=0,t},o.ensureValidHostname=function(e,r){var n=!!e,i=!1;if(!!r&&(i=p(o.hostProtocols,r)),i&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(e&&e.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},o.noConflict=function(t){if(t){var e={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(e.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(e.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=n.SecondLevelDomains.noConflict()),e}return n.URI===this&&(n.URI=i),this},s.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new o(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=S("query","?"),s.fragment=S("fragment","#"),s.search=function(t,e){var r=this.query(t,e);return"string"==typeof r&&r.length?"?"+r:r},s.hash=function(t,e){var r=this.fragment(t,e);return"string"==typeof r&&r.length?"#"+r:r},s.pathname=function(t,e){if(void 0===t||!0===t){var r=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?o.decodeUrnPath:o.decodePath)(r):r}return this._parts.urn?this._parts.path=t?o.recodeUrnPath(t):"":this._parts.path=t?o.recodePath(t):"/",this.build(!e),this},s.path=s.pathname,s.href=function(t,e){var r;if(void 0===t)return this.toString();this._string="",this._parts=o._parts();var n=t instanceof o,i="object"===a(t)&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[o.getDomAttribute(t)]||"",i=!1);if(!n&&i&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=o.parse(String(t),this._parts);else{if(!n&&!i)throw new TypeError("invalid input");var s=n?t._parts:t;for(r in s)"query"!==r&&u.call(this._parts,r)&&(this._parts[r]=s[r]);s.query&&this.query(s.query,!1)}return this.build(!e),this},s.is=function(t){var e=!1,n=!1,i=!1,a=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=o.ip4_expression.test(this._parts.hostname),i=o.ip6_expression.test(this._parts.hostname),s=(a=!(e=n||i))&&r&&r.has(this._parts.hostname),u=a&&o.idn_expression.test(this._parts.hostname),l=a&&o.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return a;case"sld":return s;case"ip":return e;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return i;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var E=s.protocol,k=s.port,T=s.hostname;s.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(o.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return E.call(this,t,e)},s.scheme=s.protocol,s.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),o.ensureValidPort(t))),k.call(this,t,e))},s.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==o.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(t,this._parts.protocol)}return T.call(this,t,e)},s.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=o(t);return this.protocol(n.protocol()).authority(n.authority()).build(!e),this},s.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?o.buildHost(this._parts):"";if("/"!==o.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?o.buildAuthority(this._parts):"";if("/"!==o.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=o.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==t[t.length-1]&&(t+="@"),o.parseUserinfo(t,this._parts),this.build(!e),this},s.resource=function(t,e){var r;return void 0===t?this.path()+this.search()+this.hash():(r=o.parse(t),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!e),this)},s.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,n),a=new RegExp("^"+l(i));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&o.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,t),this.build(!e),this},s.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(e).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var i=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},s.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),i=this._parts.hostname.substring(n+1);return!0!==e&&r&&r.list[i.toLowerCase()]&&r.get(this._parts.hostname)||i}var o;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},s.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return t?o.decodePath(n):n}var i=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,i),s=new RegExp("^"+l(a));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=o.recodePath(t),this._parts.path=this._parts.path.replace(s,t),this.build(!e),this},s.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return t?o.decodePathSegment(n):n}var i=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(i=!0);var a=new RegExp(l(this.filename())+"$");return t=o.recodePath(t),this._parts.path=this._parts.path.replace(a,t),i?this.normalizePath(e):this.build(!e),this},s.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,i=this.filename(),a=i.lastIndexOf(".");return-1===a?"":(r=i.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",t?o.decodePathSegment(n):n)}"."===t.charAt(0)&&(t=t.substring(1));var s,u=this.suffix();if(u)s=t?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!t)return this;this._parts.path+="."+o.recodePath(t)}return s&&(t=o.recodePath(t),this._parts.path=this._parts.path.replace(s,t)),this.build(!e),this},s.segment=function(t,e,r){var n=this._parts.urn?":":"/",i=this.path(),o="/"===i.substring(0,1),a=i.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(o&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(f(e)){a=[];for(var s=0,u=e.length;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=h-p,k=Math.floor,T=String.fromCharCode;function C(t){throw new RangeError(S[t])}function O(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+O((t=t.replace(_,".")).split("."),e).join(".")}function P(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=T((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=T(t)}).join("")}function I(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function L(t,e,r){var n=0;for(t=r?k(t/v):t>>1,t+=k(t/e);t>E*d>>1;n+=h)t=k(t/E);return k(n+(E+1)*t/(t+y))}function j(t){var e,r,n,i,o,a,s,u,l,c,y,v=[],x=t.length,w=0,_=m,S=g;for((r=t.lastIndexOf(b))<0&&(r=0),n=0;n=128&&C("not-basic"),v.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=x&&C("invalid-input"),((u=(y=t.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:h)>=h||u>k((f-w)/a))&&C("overflow"),w+=u*a,!(u<(l=s<=S?p:s>=S+d?d:s-S));s+=h)a>k(f/(c=h-l))&&C("overflow"),a*=c;S=L(w-o,e=v.length+1,0==o),k(w/e)>f-_&&C("overflow"),_+=k(w/e),w%=e,v.splice(w++,0,_)}return M(v)}function N(t){var e,r,n,i,o,a,s,u,l,c,y,v,x,w,_,S=[];for(v=(t=P(t)).length,e=m,r=0,o=g,a=0;a=e&&yk((f-r)/(x=n+1))&&C("overflow"),r+=(s-e)*x,e=s,a=0;af&&C("overflow"),y==e){for(u=r,l=h;!(u<(c=l<=o?p:l>=o+d?d:l-o));l+=h)_=u-c,w=h-c,S.push(T(I(c+_%w,0))),u=k(_/w);S.push(T(I(u,0))),o=L(r,x,n==i),r=0,++n}++r,++e}return S.join("")}if(l={version:"1.3.2",ucs2:{decode:P,encode:M},decode:j,encode:N,toASCII:function(t){return A(t,function(t){return w.test(t)?"xn--"+N(t):t})},toUnicode:function(t){return A(t,function(t){return x.test(t)?j(t.slice(4).toLowerCase()):t})}},"object"==i(r.amdO)&&r.amdO)void 0===(n=function(){return l}.call(e,r,e,t))||(t.exports=n);else if(a&&s)if(t.exports==a)s.exports=l;else for(c in l)l.hasOwnProperty(c)&&(a[c]=l[c]);else o.punycode=l}(this)},3679:function(){"use strict"},2333:function(t,e,r){"use strict";var n={};r.r(n),r.d(n,{GADDI:function(){return q_},Stack:function(){return Y_},breadthFirstSearch:function(){return Bw},connectedComponent:function(){return Uw},cosineSimilarity:function(){return v_},default:function(){return Z_},depthFirstSearch:function(){return qw},detectAllCycles:function(){return Zw},detectAllDirectedCycle:function(){return Xw},detectAllUndirectedCycle:function(){return Yw},detectCycle:function(){return Kw},detectDirectedCycle:function(){return X_},dijkstra:function(){return Jw},findAllPath:function(){return e_},findShortestPath:function(){return t_},floydWarshall:function(){return r_},getAdjMatrix:function(){return Pw},getDegree:function(){return Vw},getInDegree:function(){return Hw},getNeighbors:function(){return Nw},getOutDegree:function(){return Ww},iLouvain:function(){return h_},kCore:function(){return p_},kMeans:function(){return y_},labelPropagation:function(){return n_},louvain:function(){return f_},minimumSpanningTree:function(){return S_},nodesCosineSimilarity:function(){return g_},pageRank:function(){return E_}});var i={};r.r(i),r.d(i,{Line:function(){return _S},applyMatrix:function(){return aS},compare:function(){return tS},distance:function(){return lS},floydWarshall:function(){return fS},fractionToLine:function(){return TS},getAdjMatrix:function(){return hS},getBBoxBoundLine:function(){return SS},getCircleCenterByPoints:function(){return uS},getCircleIntersectByPoint:function(){return iS},getDegree:function(){return gS},getEllipseIntersectByPoint:function(){return oS},getLineIntersect:function(){return rS},getPointsCenter:function(){return CS},getRectIntersectByPoint:function(){return nS},intersectBBox:function(){return xS},invertMatrix:function(){return sS},isPointInPolygon:function(){return bS},isPointsOverlap:function(){return PS},isPolygonsIntersect:function(){return wS},itemIntersectByLine:function(){return kS},lerp:function(){return LS},lerpArray:function(){return jS},move:function(){return dS},pointLineDistance:function(){return IS},pointLineSquareDist:function(){return AS},pointRectSquareDist:function(){return MS},rotate:function(){return vS},scale:function(){return yS},scaleMatrix:function(){return cS},squareDist:function(){return OS},translate:function(){return pS}});var o={};r.r(o),r.d(o,{cloneBesidesImg:function(){return oE},getAnimateCfgWithCallback:function(){return aE},getBBox:function(){return YS},getComboBBox:function(){return nE},getLabelPosition:function(){return ZS},getLetterWidth:function(){return QS},getLoopCfgs:function(){return XS},getTextSize:function(){return $S},plainCombosToTrees:function(){return eE},reconstructTree:function(){return rE},shouldRefreshEdge:function(){return iE},traverseTree:function(){return KS},traverseTreeUp:function(){return JS},truncateLabelByLength:function(){return tE}});var a={};r.r(a),r.d(a,{calculationItemsBBox:function(){return vE},cloneEvent:function(){return pE},formatPadding:function(){return hE},isNaN:function(){return yE},isViewportChanged:function(){return dE},processParallelEdges:function(){return gE},uniqueId:function(){return fE}});var s={};r.r(s),r.d(s,{getClosedSpline:function(){return WE},getControlPoint:function(){return GE},getSpline:function(){return UE},getStarPath:function(){return JE},paddedHull:function(){return KE},pathToPoints:function(){return HE},pointsToPolygon:function(){return VE},roundedHull:function(){return ZE}});var u={};r.r(u),r.d(u,{defaultSubjectColors:function(){return Tk}});var l={};r.r(l),r.d(l,{isForce:function(){return Ck}});var c={};r.r(c),r.d(c,{Base:function(){return mT},Circle:function(){return bT},Ellipse:function(){return wT},Image:function(){return ST},Line:function(){return TT},Marker:function(){return OT},Path:function(){return BT},Polygon:function(){return zT},Polyline:function(){return UT},Rect:function(){return GT},Text:function(){return VT}});var f={};r.r(f),r.d(f,{Canvas:function(){return qT},Group:function(){return gT},Shape:function(){return c},getArcParams:function(){return Jk},version:function(){return YT}});var h={};r.r(h),r.d(h,{Base:function(){return iC},Circle:function(){return oC},Dom:function(){return aC},Ellipse:function(){return sC},Image:function(){return uC},Line:function(){return lC},Marker:function(){return hC},Path:function(){return pC},Polygon:function(){return dC},Polyline:function(){return yC},Rect:function(){return vC},Text:function(){return wC}});var p={};r.r(p),r.d(p,{Canvas:function(){return FC},Group:function(){return nC},Shape:function(){return h},version:function(){return zC}});var d={};r.r(d),r.d(d,{getColorSetsBySubjectColors:function(){return GO},getColorsWithSubjectColor:function(){return UO},mixColor:function(){return zO}});var y={};r.r(y),r.d(y,{arrayToTextureData:function(){return oA},attributesToTextureData:function(){return iA},buildTextureData:function(){return eA},buildTextureDataWithOneEdgeAttr:function(){return rA},buildTextureDataWithTwoEdgeAttr:function(){return nA},proccessToFunc:function(){return tA},radialLayout:function(){return aA}});var v={};r.r(v),r.d(v,{gpuDetector:function(){return sA}});var g={};r.r(g),r.d(g,{getBrowserName:function(){return uA}});var m={};r.r(m),r.d(m,{assign:function(){return DP},default:function(){return nM},defaultI18n:function(){return UP},format:function(){return eM},parse:function(){return rM},setGlobalDateI18n:function(){return VP},setGlobalDateMasks:function(){return tM}});var b={};r.r(b),r.d(b,{Arc:function(){return aU},DataMarker:function(){return lU},DataRegion:function(){return cU},Html:function(){return gU},Image:function(){return uU},Line:function(){return iU},Region:function(){return sU},RegionFilter:function(){return fU},Shape:function(){return hU},Text:function(){return oU}});var x={};r.r(x),r.d(x,{ellipsisHead:function(){return _U},ellipsisMiddle:function(){return EU},ellipsisTail:function(){return SU},getDefault:function(){return wU}});var w={};r.r(w),r.d(w,{equidistance:function(){return LU},equidistanceWithReverseBoth:function(){return jU},getDefault:function(){return AU},reserveBoth:function(){return IU},reserveFirst:function(){return PU},reserveLast:function(){return MU}});var _={};r.r(_),r.d(_,{fixedAngle:function(){return DU},getDefault:function(){return RU},unfixedAngle:function(){return BU}});var S={};r.r(S),r.d(S,{autoEllipsis:function(){return x},autoHide:function(){return w},autoRotate:function(){return _}});var E={};r.r(E),r.d(E,{Base:function(){return GU},Circle:function(){return HU},Html:function(){return qU},Line:function(){return VU}});var k={};r.r(k),r.d(k,{CONTAINER_CLASS:function(){return nG},CROSSHAIR_X:function(){return cG},CROSSHAIR_Y:function(){return fG},LIST_CLASS:function(){return oG},LIST_ITEM_CLASS:function(){return aG},MARKER_CLASS:function(){return sG},NAME_CLASS:function(){return lG},TITLE_CLASS:function(){return iG},VALUE_CLASS:function(){return uG}});var T={};r.r(T),r.d(T,{Action:function(){return mV},BRUSH_FILTER_EVENTS:function(){return hZ},Chart:function(){return rW},ComponentController:function(){return nW},Coordinate:function(){return wz},DIRECTION:function(){return _F},ELEMENT_RANGE_HIGHLIGHT_EVENTS:function(){return OX},Element:function(){return pW},Event:function(){return YH},Facet:function(){return dV},Geometry:function(){return PW},GeometryLabel:function(){return FW},Interaction:function(){return oH},InteractionAction:function(){return mV},LAYER:function(){return wF},Scale:function(){return PP},TooltipController:function(){return iW},Util:function(){return aq},VERSION:function(){return oq},VIEW_LIFE_CIRCLE:function(){return kF},View:function(){return eW},getActionClass:function(){return wV},getAnimation:function(){return aW},getEngine:function(){return NF},getFacet:function(){return vV},getGeometryLabel:function(){return vW},getGeometryLabelLayout:function(){return mW},getInteraction:function(){return yH},getShapeFactory:function(){return kW},getTheme:function(){return IH},registerAction:function(){return _V},registerAnimation:function(){return sW},registerComponentController:function(){return WH},registerEngine:function(){return RF},registerFacet:function(){return gV},registerGeometry:function(){return tW},registerGeometryLabel:function(){return gW},registerGeometryLabelLayout:function(){return bW},registerInteraction:function(){return vH},registerShape:function(){return EW},registerShapeFactory:function(){return SW},registerTheme:function(){return LH}});var C=r(7140),O=r.n(C),A={values:[],set:function(t){return this.values=t,this.values},add:function(t){return this.values.push(t),this.values}},P=(r(9957),r(5937),r(4238)),M=r.n(P);function I(t){"@babel/helpers - typeof";return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(t,e){for(var r=0;r0&&(r=parseFloat(t.toPrecision(e))),r},format:function(t,e,r,n){e=void 0!==e?e:0,r=void 0!==r?r:D.thousandsSeparator,n=void 0!==n?n:D.decimalSeparator,null!=e&&(t=parseFloat(t.toFixed(e)));var i=t.toString().split(".");1===i.length&&null==e&&(e=0);var o,a=i[0];if(r)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+r+"$2");if(0==e)o=a;else{var u=i.length>1?i[1]:"0";null!=e&&(u+=new Array(e-u.length+1).join("0")),o=a+n+u}return o}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(t){return D.limitSigDigs(this,t)});var B={bind:function(t,e){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return t.apply(e,n)}},bindAsEventListener:function(t,e){return function(r){return t.call(e,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},F={filter:function(t,e,r){var n=[];if(Array.prototype.filter)n=t.filter(e,r);else{var i=t.length;if("function"!=typeof e)throw new TypeError;for(var o=0;o-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(e="msie",t=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(e="chrome",t=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(e="firefox",t=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(e="opera",t=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(e="safari",t=i.match(/version\/([\d.]+)/)),r=t?t[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?n="apple":i.indexOf("android")>-1&&(r=(t=i.match(/version\/([\d.]+)/))?t[1]:"",n="android"),{name:e,version:r,device:n}}(),J=(Y=!0,X=K,document.createElement("canvas").getContext?("firefox"===X.name&&parseFloat(X.version)<5&&(Y=!1),"safari"===X.name&&parseFloat(X.version)<4&&(Y=!1),"opera"===X.name&&parseFloat(X.version)<10&&(Y=!1),"msie"===X.name&&parseFloat(X.version)<9&&(Y=!1)):Y=!1,Y),Q=-1===(Z=navigator.userAgent.toLowerCase()).indexOf("webkit")&&-1!==Z.indexOf("gecko"),$={assign:function(t){for(var e=0;e=0;r--)t[r]===e&&t.splice(r,1);return t},indexOf:function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r=0&&parseFloat(s)<1?(t.style.filter="alpha(opacity="+100*s+")",t.style.opacity=s):1===parseFloat(s)&&(t.style.filter="",t.style.opacity="")},applyDefaults:function(t,e){t=t||{};var r="function"==typeof window.Event&&e instanceof window.Event;for(var n in e)(void 0===t[n]||!r&&e.hasOwnProperty&&e.hasOwnProperty(n)&&!t.hasOwnProperty(n))&&(t[n]=e[n]);return!r&&e&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&!t.hasOwnProperty("toString")&&(t.toString=e.toString),t},getParameterString:function(t){var e=[];for(var r in t){var n,i=t[r];if(null!=i&&"function"!=typeof i)n=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},urlAppend:function(t,e){var r=t;if(e){0===e.indexOf("?")&&(e=e.substring(1));var n=(t+" ").split(/[?&]/);r+=" "===n.pop()?e:n.length?"&"+e:"?"+e}return r},urlPathAppend:function(t,e){var r=t;if(!e)return r;0===e.indexOf("/")&&(e=e.substring(1));var n=t.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r="".concat(n[0]).concat(e).concat(n.length>1?"?".concat(n[1]):"")},DEFAULT_PRECISION:14,toFloat:function(t,e){return null==e&&(e=$.DEFAULT_PRECISION),"number"!=typeof t&&(t=parseFloat(t)),0===e?t:parseFloat(t.toPrecision(e))},rad:function(t){return t*Math.PI/180},getParameters:function(t){t=null===t||void 0===t?window.location.href:t;var e="";if(R.contains(t,"?")){var r=t.indexOf("?")+1,n=R.contains(t,"#")?t.indexOf("#"):t.length;e=t.substring(r,n)}for(var i={},o=e.split(/[&;]/),a=0,s=o.length;a1?1/t:t},getResolutionFromScale:function(t,e){var r;t&&(null==e&&(e="degrees"),r=1/($.normalizeScale(t)*tt[e]*96));return r},getScaleFromResolution:function(t,e){return null==e&&(e="degrees"),t*tt[e]*96},getBrowser:function(){return K},isSupportCanvas:J,supportCanvas:function(){return $.isSupportCanvas},isInTheSameDomain:function(t){return!t||(-1===t.indexOf("//")||$.isSameDomain(t,document.location.toString()))},isSameDomain:function(t,e){return new(W())(t).normalize().origin()===new(W())(e).normalize().origin()},calculateDpi:function(t,e,r,n,i){if(t&&e&&r){var o,a=t.getWidth(),s=t.getHeight(),u=e.w,l=e.h;if(i=i||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){var c=a/u,f=s/l;o=254/(c>f?c:f)/r/(2*Math.PI*i/360)/1e4}else{o=254/(a/u)/r/1e4}return o}},toJSON:function(t){var e=t;if(null==e)return null;switch(e.constructor){case String:return e=(e=(e=(e=(e=(e=(e='"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,i=e.length;n0?"{"+u.join(",")+"}":"{}"}return e.toString()}},getResolutionFromScaleDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?(t=$.normalizeScale(t),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4):-1},getScaleFromResolutionDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4:-1},transformResult:function(t){return t.responseText&&"string"==typeof t.responseText&&(t=JSON.parse(t.responseText)),t},copyAttributes:function(t,e){if(t=t||{},e)for(var r in e){var n=e[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(t[r]=n)}return t},copyAttributesWithClip:function(t,e,r){if(t=t||{},e)for(var n in e){var i=!1;if(r&&r.length)for(var o=0,a=r.length;o=0&&o<=1&&i<=1&&o>=0?new V.Point(t.x+i*(e.x-t.x),t.y+i*(e.y-t.y)):"No Intersection";else if(0==s&&0==u){var c=Math.max(t.y,e.y),f=Math.min(t.y,e.y),h=Math.max(t.x,e.x),p=Math.min(t.x,e.x);a=(r.y>=f&&r.y<=c||n.y>=f&&n.y<=c)&&r.x>=p&&r.x<=h||n.x>=p&&n.x<=h?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(t,e,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",t.fontSize&&(r.style.fontSize=t.fontSize),t.fontFamily&&(r.style.fontFamily=t.fontFamily),t.fontWeight&&(r.style.fontWeight=t.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=e;var n=r.clientWidth,i=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:i}},convertPath:function(t,e){return e?t.replace(/\{([\w-\.]+)\}/g,function(t,r){var n;return n=e.hasOwnProperty(r)?function(t){if(void 0==t||null==t)return"";if(t instanceof Date)return t.toJSON();if(function(t){if("string"!=typeof t&&"object"!==q(t))return!1;try{var e=t.toString();return"[object Object]"===e||"[object Array]"===e}catch(t){return!1}}(t))return JSON.stringify(t);return t.toString()}(e[r]):t,encodeURIComponent(n)}):t}},tt={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};tt.in=tt.inches,tt.degrees=tt.dd,tt.nmi=1852*tt.m;var et=.0254000508001016;$.extend(tt,{Inch:tt.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),$.extend(tt,{mm:tt.Meter/1e3,cm:tt.Meter/100,dm:100*tt.Meter,km:1e3*tt.Meter,kmi:tt.nmi,fath:tt.Fathom,ch:tt.IntnlChain,link:tt.IntnlLink,"us-in":tt.inches,"us-ft":tt.Foot,"us-yd":tt.Yard,"us-ch":tt.GunterChain,"us-mi":tt.Mile,"ind-yd":tt.IndianYd37,"ind-ft":tt.IndianFt37,"ind-ch":791.9942845122}),tt.degree=tt.dd,tt.meter=tt.m,tt.foot=tt.ft,tt.inch=tt.inches,tt.mile=tt.mi,tt.kilometer=tt.km,tt.yard=tt.yd;var rt,nt,it=window.fetch,ot={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(t){for(var e in t){this.queryKeys.push(e),"string"!=typeof t[e]&&(t[e]=$.toJSON(t[e]));var r=encodeURIComponent(t[e]);this.queryValues.push(r)}},issue:function(t){for(var e=this,r=e.getUid(),n=t.url,i=[],o=n,a=0,s=e.queryKeys?e.queryKeys.length:0,u=0;u=e.limitLength){if(0==a)return!1;i.push(o),o=n,a=0,u--}else if(o.length+e.queryKeys[u].length+2+e.queryValues[u].length>e.limitLength)for(var l=e.queryValues[u];l.length>0;){var c=e.limitLength-o.length-e.queryKeys[u].length-2;o.indexOf("?")>-1?o+="&":o+="?";var f=l.substring(0,c);"%"===f.substring(c-1,c)?(c-=1,f=l.substring(0,c)):"%"===f.substring(c-2,c-1)&&(c-=2,f=l.substring(0,c)),o+=e.queryKeys[u]+"="+f,l=l.substring(c),f.length>0&&(i.push(o),o=n,a=0)}else a++,o.indexOf("?")>-1?o+="&":o+="?",o+=e.queryKeys[u]+"="+e.queryValues[u];return i.push(o),e.send(i,"SuperMapJSONPCallbacks_"+r,t&&t.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(t,e,r){var n=t.length;if(n>0)return new Promise(function(i){for(var o=(new Date).getTime(),a=0;a-1?s+="&":s+="?",s+="sectionCount="+n,s+="§ionIndex="+a,s+="&jsonpUserID="+o,r&&(s=decodeURIComponent(s),s=r+encodeURIComponent(s)),M()(s,{jsonpCallbackFunction:e,timeout:3e4}).then(function(t){i(t.json())})}})},GET:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(t.params),this.issue(t)},POST:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},PUT:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},DELETE:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)}},at=function(){return void 0!=rt?rt:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},st=function(){return nt||45e3},ut={commit:function(t,e,r,n){switch(t=t?t.toUpperCase():t){case"GET":return this.get(e,r,n);case"POST":return this.post(e,r,n);case"PUT":return this.put(e,r,n);case"DELETE":return this.delete(e,r,n);default:return this.get(e,r,n)}},supportDirectRequest:function(t,e){return!!$.isInTheSameDomain(t)||(void 0!=e.crossOrigin?e.crossOrigin:at()||e.proxy)},get:function(t,e,r){r=r||{};if(t=$.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){var n={url:t=t.replace(".json",".jsonp"),data:e};return ot.GET(n)}return this.urlIsLong(t)?this._postSimulatie("GET",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"GET")},delete:function(t,e,r){r=r||{};if(t=$.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=DELETE",data:e};return ot.DELETE(n)}return this.urlIsLong(t)?this._postSimulatie("DELETE",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"DELETE")},post:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:$.urlAppend(t,"_method=POST"),data:e};return ot.POST(n)}return this._fetch(t,e,r,"POST")},put:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=PUT",data:e};return ot.PUT(n)}return this._fetch(t,e,r,"PUT")},urlIsLong:function(t){for(var e=0,r=null,n=0,i=t.length;n-1?"&":"?")+"_method="+t,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(e,r,n)},_processUrl:function(t,e){if(this._isMVTRequest(t))return t;if(-1===t.indexOf(".json")&&!e.withoutFormatSuffix)if(t.indexOf("?")<0)t+=".json";else{var r=t.split("?");2===r.length&&(t=r[0]+".json?"+r[1])}return e&&e.proxy&&("function"==typeof e.proxy?t=e.proxy(t):(t=decodeURIComponent(t),t=e.proxy+encodeURIComponent(t))),t},_fetch:function(t,e,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(e)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,it(t,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?e:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:st()}).then(function(t){return t})):it(t,{method:n,body:"PUT"===n||"POST"===n?e:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:st()}).then(function(t){return t})},_getWithCredentials:function(t){return!0===t.withCredentials?"include":!1===t.withCredentials?"omit":"same-origin"},_fetchJsonp:function(t,e){return e=e||{},M()(t,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(t,e){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},t),e.then(r,n)})},_getParameterString:function(t){var e=[];for(var r in t){var n,i=t[r];if(null!=i&&"function"!=typeof i)n=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},_isMVTRequest:function(t){return t.indexOf(".mvt")>-1||t.indexOf(".pbf")>-1}},lt=r(7367);function ct(t,e){t&&-1===t.indexOf("BEGIN PUBLIC KEY")&&(t="-----BEGIN PUBLIC KEY-----\n".concat(t,"\n-----END PUBLIC KEY-----"));var r=lt.pki.publicKeyFromPem(t),n={md:lt.md.sha256.create(),mgf1:{md:lt.md.sha1.create()}},i=r.encrypt(e,"RSA-OAEP",n);return!!i&&window.btoa(i)}function ft(t,e,r){r=lt.util.encodeUtf8(r);var n=lt.cipher.createCipher("AES-GCM",t);if(n.start({iv:e,additionalData:"",tagLength:128}),n.update(lt.util.createBuffer(r)),n.finish()){var i=n.output,o=n.mode.tag;return window.btoa(i.data+o.data)}return!1}function ht(t){for(var e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}function pt(t){"@babel/helpers - typeof";return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dt(){dt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==pt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function yt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Rt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}!function(){O().VectorTileSource&&void 0===O().VectorTileSource.prototype.beforeLoadBak&&(O().VectorTileSource.prototype.beforeLoadBak=O().VectorTileSource.prototype.beforeLoad,O().VectorTileSource.prototype.beforeLoad=function(){var t,e=(t=Nt().mark(function t(e,r){var n,i;return Nt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r&&r.tiles&&r.tiles[0],!A.values.includes(e)||!n){t.next=6;break}return t.next=4,_t(n);case 4:i=t.sent,this.decryptKey=i;case 6:this.beforeLoadBak(e,r);case 7:case"end":return t.stop()}},t,this)}),function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){Rt(o,n,i,a,s,"next",t)}function s(t){Rt(o,n,i,a,s,"throw",t)}a(void 0)})});return function(t,r){return e.apply(this,arguments)}}());var t=O().Map.prototype;O().Map=function(e){function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=It(this,r,[t])).overlayLayersManager={},e}var n,i,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(r,O().Map),n=r,(i=[{key:"getSource",value:function(e){var r=Object.values(this.overlayLayersManager).find(function(t){return t.sourceId===e});return r&&r.getSource?r.getSource():t.getSource.call(this,e)}},{key:"getLayer",value:function(t){var e=this.overlayLayersManager[t];return e?e.getLayer?e.getLayer():e:this.style.getLayer(t)}},{key:"addLayer",value:function(e,r){return e.source||"custom"===e.type||"background"===e.type?(t.addLayer.call(this,e,r),e.overlay&&!this.overlayLayersManager[e.id]&&(this.overlayLayersManager[e.id]=e),this):this.overlayLayersManager[e.id]||this.style._layers[e.id]?void this.fire("error",{error:new Error("A layer with this id already exists.")}):(e.onAdd&&e.onAdd(this),this.overlayLayersManager[e.id]=e,this)}},{key:"moveLayer",value:function(t,e){return this.overlayLayersManager[t]?(this.overlayLayersManager[t].moveLayer?this.overlayLayersManager[t].moveLayer(t,e):this._moveToHandler(t,e),this):this.style._layers[t]?(this.style.moveLayer(t,e),this._update(!0),this):void 0}},{key:"removeLayer",value:function(t){if(this.overlayLayersManager[t]){var e=this.overlayLayersManager[t];if(delete this.overlayLayersManager[t],"custom"!==e.type)return e.removeFromMap&&e.removeFromMap(),this}return this.style.removeLayer(t),this._update(!0),this}},{key:"listLayers",value:function(){var t=[],e=this.style._order||[];for(var r in t.push.apply(t,Ot(e)),this.overlayLayersManager){var n=this.overlayLayersManager[r].id;t.includes(n)||t.push(n)}return t}},{key:"getPaintProperty",value:function(e,r){var n=this.overlayLayersManager[e];return n?n.getPaintProperty?n.getPaintProperty(r):void 0:t.getPaintProperty.call(this,e,r)}},{key:"getLayoutProperty",value:function(e,r){var n=this.overlayLayersManager[e];return n&&n.getLayoutProperty?n.getLayoutProperty?n.getLayoutProperty(r):void 0:t.getLayoutProperty.call(this,e,r)}},{key:"setLayoutProperty",value:function(t,e,r){var n=this.overlayLayersManager[t];return n?(n.setLayoutProperty&&(n.setLayoutProperty(e,r),this.style.fire("data",{dataType:"style"})),this):(this.style.setLayoutProperty(t,e,r),this._update(!0),this)}},{key:"getFilter",value:function(e,r,n){var i=this.overlayLayersManager[e];return i?i.getFilter?i.getFilter(r,n):void 0:t.getFilter.call(this,e,r,n)}},{key:"setFilter",value:function(e,r,n){var i=this.overlayLayersManager[e];return i?i.setFilter?i.setFilter(r,n):this:t.setFilter.call(this,e,r,n)}},{key:"updateTransform",value:function(t,e,r,n,i,o,a){this.transform.units=t;var s=this.mercatorZfromAltitude;O().MercatorCoordinate.fromLngLat=function(t,n){n=n||0;var i=O().LngLat.convert(t);return new(O().MercatorCoordinate)((i.lng-e)/o,(r-i.lat)/a,s(n,i.lat))},O().MercatorCoordinate.prototype.toLngLat=function(){return new(O().LngLat)(this.x*o+e,r-this.y*a)},this.customConvertPoint=window.URL.createObjectURL(new Blob(["customConvertPoint = {projectX:function(x){return (x - "+n+") / "+o+" + 0.5},projectY:function(y){y = 0.5 - ((y - "+i+") / "+a+");return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+a+"+"+i+";}}"],{type:"text/javascript"}))}},{key:"on",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"on"})}},{key:"once",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"once"})}},{key:"off",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"off"})}},{key:"queryRenderedFeatures",value:function(e,r){var n,i=this,o=Object.keys(this.overlayLayersManager);r&&r.layers&&(o=r.layers.filter(function(t){return i.overlayLayersManager[t]}),n=r.layers.filter(function(t){return!i.overlayLayersManager[t]}));var a=e||[[0,0],[this.transform.width,this.transform.height]],s=r||{};delete s.layers;var u=o.reduce(function(t,e){var r=i.overlayLayersManager[e];return r.query&&r.queryRenderedFeatures&&r.queryRenderedFeatures(a,s,function(e){t=t.concat(e)}),t},[]);return t.queryRenderedFeatures.call(this,e,Tt(Tt({},r),{},{layers:n})).concat(u)}},{key:"querySourceFeatures",value:function(e,r){var n=Object.values(this.overlayLayersManager).find(function(t){return t.sourceId===e});return n?n.query&&n.querySourceFeatures?n.querySourceFeatures(r):void 0:t.querySourceFeatures.call(this,e,r)}},{key:"_moveToHandler",value:function(t,e){var r,n=document.getElementById(t);e&&((r=document.getElementById(e))||O().Evented.prototype.fire("error",{error:new Error('Layer with id "'.concat(e,'" does not exist on this document.'))})),n&&r?r.parentNode.insertBefore(n,r):n.parentNode.appendChild(n)}},{key:"_eventsModeHandler",value:function(e){var r=this,n=e.type,i=e.layerId,o=e.listener,a=e.mode,s=[];o&&(s=s.concat(i)),s.forEach(function(t){var e=r.overlayLayersManager[t]||{};e.interaction&&e[a]&&e.events.includes(n)&&e[a](n,o||i)});var u=o&&s.filter(function(t){return!r.overlayLayersManager[t]});if(u&&!u.length)return this;var l=u&&"string"!=typeof i?u:i;return t[a].call(this,n,l,o)}}])&&Pt(n.prototype,i),o&&Pt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),r}()}();function Dt(t){"@babel/helpers - typeof";return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bt(t,e){for(var r=0;r"+r+"",this._createStyleSheet(),this._container}},{key:"_createStyleSheet",value:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".iclient-logo{margin:0 !important;}.iclient-logo a{border: none;display: block;height:31px;}.iclient-logo img{border: none;white-space: nowrap}",document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_extend",value:function(t){for(var e=0;et.right;)e.lon-=t.getWidth()}return e}},{key:"destroy",value:function(){this.lon=null,this.lat=null}}])&&Kt(e.prototype,r),n&&Kt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $t(t){"@babel/helpers - typeof";return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function te(t,e){for(var r=0;rthis.right)&&(this.right=r.right),(null==this.top||r.top>this.top)&&(this.top=r.top))}}},{key:"containsLonLat",value:function(t,e){"boolean"==typeof e&&(e={inclusive:e}),e=e||{};var r=this.contains(t.lon,t.lat,e.inclusive),n=e.worldBounds;if(n&&!r){var i=n.getWidth(),o=(n.left+n.right)/2,a=Math.round((t.lon-o)/i);r=this.containsLonLat({lon:t.lon-a*i,lat:t.lat},{inclusive:e.inclusive})}return r}},{key:"containsPixel",value:function(t,e){return this.contains(t.x,t.y,e)}},{key:"contains",value:function(t,e,r){if(null==r&&(r=!0),null==t||null==e)return!1;var n=!1;return n=r?t>=this.left&&t<=this.right&&e>=this.bottom&&e<=this.top:t>this.left&&tthis.bottom&&e=r.bottom&&t.bottom<=r.top||r.bottom>=t.bottom&&r.bottom<=t.top,a=t.top>=r.bottom&&t.top<=r.top||r.top>t.bottom&&r.top=r.left&&t.left<=r.right||r.left>=t.left&&r.left<=t.right,u=t.right>=r.left&&t.right<=r.right||r.right>=t.left&&r.right<=t.right;n=(o||a)&&(s||u)}if(e.worldBounds&&!n){var l=e.worldBounds,c=l.getWidth(),f=!l.containsBounds(r),h=!l.containsBounds(t);f&&!h?(t=t.add(-c,0),n=r.intersectsBounds(t,{inclusive:e.inclusive})):h&&!f&&(r=r.add(-c,0),n=t.intersectsBounds(r,{inclusive:e.inclusive}))}return n}},{key:"containsBounds",value:function(t,e,r){null==e&&(e=!1),null==r&&(r=!0);var n=this.contains(t.left,t.bottom,r),i=this.contains(t.right,t.bottom,r),o=this.contains(t.left,t.top,r),a=this.contains(t.right,t.top,r);return e?n||i||o||a:n&&i&&o&&a}},{key:"determineQuadrant",value:function(t){var e="",r=this.getCenterLonLat();return e+=t.lat=t.right&&i.right>t.right;)i=i.add(-o,0);var a=i.left+r;at.left&&i.right-n>t.right&&(i=i.add(-o,0))}return i}},{key:"toServerJSONObject",value:function(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}},{key:"destroy",value:function(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}}])&&te(e.prototype,r),n&&te(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ne(t){"@babel/helpers - typeof";return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ie(t,e){for(var r=0;r-1)){if(null!=e&&e=0;--r)e=this.removeComponent(t[r])||e;return e}},{key:"removeComponent",value:function(t){return $.removeItem(this.components,t),this.clearBounds(),!0}},{key:"getArea",value:function(){for(var t=0,e=0,r=this.components.length;e=1?1:g)<=-1?-1:g,c=180*Math.acos(g)/Math.PI,a=(c=i.x==r.x?e.x>r.x&&n.x>r.x||e.xh*e.x+p&&n.y>h*n.x+p||e.yr.y?n.xr.x&&(s=!1):i.xh*n.x+p&&(s=!1):i.x>r.x?n.y>r.y&&(s=!1):n.y=0?180*Math.atan(m)/Math.PI:Math.abs(180*Math.atan(m)/Math.PI)+90,x=Math.abs(e.y);r.y==x&&x==i.y&&r.x=0?m>=0?l+=u:l=180-(l-90)+u:l=m>0?l-180+u:90-l+u:w>=0?m>=0?l-=u:l=180-(l-90)-u:l=m>=0?l-180-u:90-l-u,l=l*Math.PI/180;var S=e.x+o*Math.cos(l),E=e.y+o*Math.sin(l);f.push(new ce(S,E))}f.push(i)}return f}},{key:"createLineEPS",value:function(t){var r=[],n=t.length;if(n<2)return t;for(var i=0;i2;return r&&De(Be(e.prototype),"removeComponent",this).apply(this,arguments),r}},{key:"getSortedSegments",value:function(){for(var t,e,r=this.components.length-1,n=new Array(r),i=0;i3;if(r){this.components.pop(),We(qe(e.prototype),"removeComponent",this).apply(this,arguments);var n=this.components[0];We(qe(e.prototype),"addComponent",this).apply(this,[n])}return r}},{key:"getArea",value:function(){var t=0;if(this.components&&this.components.length>2){for(var e=0,r=0,n=this.components.length;r0){t+=Math.abs(this.components[0].getArea());for(var e=1,r=this.components.length;e0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),e));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(t){var e={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(t)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(t,r){var n=e[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+t+'"'},number:function(t){return isFinite(t)?String(t):"null"},boolean:function(t){return String(t)},date:function(t){function e(t){return t<10?"0"+t:t}return'"'+t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+'"'}},r}var r,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cr(t,e)}(e,wr),r=e,(n=[{key:"read",value:function(t,e){var r;if(this.nativeJSON)try{r=JSON.parse(t,e)}catch(e){return{data:t}}return this.keepData&&(this.data=r),r}},{key:"write",value:function(t,e){this.pretty=!!e;var r=null,n=_r(t);if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(t):this.serialize[n].apply(this,[t])}catch(t){}return r}},{key:"writeIndent",value:function(){var t=[];if(this.pretty)for(var e=0;e0))return null;for(var a=0,s=0,u=[];a0){t+='"points":[';for(var r=0,n=this.components.length;rt[o]){var a=t[o];t[o]=t[i],t[i]=a;var s=e[o];if(e[o]=e[i],e[i]=s,r&&r.length>0){var u=r[o];r[o]=r[i],r[i]=u}if(n&&n.length>0){var l=n[o];n[o]=n[i],n[i]=l}}}}],(r=[{key:"destroy",value:function(){var t=this;t.id=null,t.style=null,t.parts=null,t.partTopo=null,t.points=null,t.type=null,t.prjCoordSys=null}},{key:"toGeometry",value:function(){var t=this;switch(t.type.toUpperCase()){case vn.POINT:return t.toGeoPoint();case vn.LINE:return t.toGeoLine();case vn.LINEM:return t.toGeoLinem();case vn.REGION:return t.toGeoRegion();case vn.POINTEPS:return t.toGeoPoint();case vn.LINEEPS:return t.toGeoLineEPS();case vn.REGIONEPS:return t.toGeoRegionEPS();case vn.GEOCOMPOUND:return t.transformGeoCompound()}}},{key:"toGeoPoint",value:function(){var t=this.parts||[],e=this.points||[],r=t.length;if(r>0){if(1===r)return new ce(e[0].x,e[0].y);for(var n=[],i=0;i0){if(1===r){for(var n=[],i=0;i0){if(1===s){for(t=0,r=[];t=0;b--)if(g[m]=-1,f[b].containsBounds(f[m])){h[m]=-1*h[b],h[m]<0&&(g[m]=b);break}for(var x=0;x0?o.push(c[x]):(o[g[x]].components=o[g[x]].components.concat(c[x].components),o.push(""))}else{o=new Array;for(var w=0;w0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(u),u=[]),o.push(c[w])),w==i-1){var _=o.length;if(_)o[_-1].components=o[_-1].components.concat(u);else for(var S=0,E=u.length;S=0;x--)if(m[b]=-1,h[x].containsBounds(h[b])){p[b]=-1*p[x],p[b]<0&&(m[b]=x);break}for(var w=0;w0?a.push(f[w]):(a[m[w]].components=a[m[w]].components.concat(f[w].components),a.push(""))}else{a=new Array;for(var _=0;_0&&a.length>0&&(a[a.length-1].components=a[a.length-1].components.concat(l),l=[]),a.push(f[_])),_==i-1){var S=a.length;if(S)a[S-1].components=a[S-1].components.concat(l);else for(var E=0,k=l.length;E-1||(e[n]=t[n]);return e}}])&&ui(r.prototype,n),i&&ui(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}(),yi=function(t){return"[object Array]"==Object.prototype.toString.call(t)},vi=function(t){return"string"==typeof t&&t.constructor===String},gi={toSuperMapGeometry:function(t){if(t&&t.type)return(new di).read(t,"FeatureCollection")[0].geometry},toSuperMapBounds:function(t){return yi(t)?new re(t[0],t[1],t[2],t[3]):t instanceof O().LngLatBounds?new re(t.getWest(),t.getSouth(),t.getEast(),t.getNorth()):t},toSuperMapPoint:function(t){return yi(t)?new ce(t[0],t[1]):t.lng&&t.lat?new ce(t.lng,t.lat):new ce(t.geometry.coordinates[0],t.geometry.coordinates[1])},toSuperMapPolygon:function(t){var e=t.getWest(),r=t.getEast(),n=t.getSouth(),i=t.getNorth();return new er([new Xe([new ce(e,n),new ce(r,n),new ce(r,i),new ce(e,i)])])},isArray:yi,toGeoJSON:function(t){if(t)return(new di).toGeoJSON(t)},toProcessingParam:function(t){var e={};if(t.length<1)e="";else{for(var r=[],n=0;n1e-7;a++)e=1,o+=s=Math.PI/2-2*Math.atan(i*e)-o;return new(O().LngLat)(t[0]*r/n,o*r)},transformUrl:function(t){var e=t.url,r=t.server,n=t.excludePortalProxyUrl,i=t.credentialValue,o=t.credentialKey,a=-1===e.indexOf(".json")?"".concat(e,".json"):e,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return i&&o&&(a+="?"+o+"="+i),a}};function mi(t){"@babel/helpers - typeof";return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bi(t,e){for(var r=0;r1&&(r=parseFloat(r)*l),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":u.x+=e/2,u.y+=r/2;break;case"lm":u.x+=e/2;break;case"lb":u.x+=e/2,u.y-=r/2;break;case"ct":u.y+=r/2;break;case"cb":u.y-=r/2;break;case"rt":u.x-=e/2,u.y+=r/2;break;case"rm":u.x-=e/2;break;case"rb":u.x-=e/2,u.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=e,i=u.x-parseFloat(e)/2,o=u.y+parseFloat(r)/2,s=u.x+parseFloat(e)/2,a=u.y-parseFloat(r)/2,new re(i,o,s,a)}},{key:"getLabelPxBoundsByText",value:function(t,e){var r,n,i,o,a=this.getLabelPxSize(e),s=$.cloneObject(t);if(e.labelAlign&&"cm"!==e.labelAlign)switch(e.labelAlign){case"lt":s.x+=a.w/2,s.y+=a.h/2;break;case"lm":s.x+=a.w/2;break;case"lb":s.x+=a.w/2,s.y-=a.h/2;break;case"ct":s.y+=a.h/2;break;case"cb":s.y-=a.h/2;break;case"rt":s.x-=a.w/2,s.y+=a.h/2;break;case"rm":s.x-=a.w/2;break;case"rb":s.x-=a.w/2,s.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=s.x-a.w/2,n=s.y+a.h/2,o=e.fontStyle&&"italic"===e.fontStyle?s.x+a.w/2+parseInt(parseFloat(e.fontSize)/2):s.x+a.w/2,i=s.y-a.h/2,new re(r,n,o,i)}},{key:"getLabelPxSize",value:function(t){var e,r,n,i,o=parseFloat(t.strokeWidth);e=t.label||this.text,r=t.fontSize?parseFloat(t.fontSize):parseFloat("12px");var a=e.split("\n"),s=a.length;i=s>1?r*s+s+o+.2*r:r+o+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return e.cnC=r,e.enC=n,e.textC=t.length,e}}])&&bi(r.prototype,n),i&&bi(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Ti(t){"@babel/helpers - typeof";return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ci(t,e){for(var r=0;r1&&(t=new ce(e[0],e[1])),new gr(t,this.attributes)}}])&&Mi(e.prototype,r),n&&Mi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ji(t){"@babel/helpers - typeof";return(ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ni(t,e){for(var r=0;ro&&(o=t+s+100,n.width=o,r=!0),e+u>a&&(a=e+u+100,n.height=a,r=!0),t<-s&&(o+=s=100*Math.ceil(-t/100),n.width=o,r=!0),e<-u&&(a+=u=100*Math.ceil(-e/100),n.height=a,r=!0),r&&i.translate(s,u)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],i=n.length,o=0;o4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],i=this._handlers[t],o=i.length,a=0;a-this.EPSILON&&tthis.EPSILON||t<-this.EPSILON}},{key:"cubicAt",value:function(t,e,r,n,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*n+3*o*r)}},{key:"cubicDerivativeAt",value:function(t,e,r,n,i){var o=1-i;return 3*(((e-t)*o+2*(r-e)*i)*o+(n-r)*i*i)}},{key:"cubicRootAt",value:function(t,e,r,n,i,o){var a=n+3*(e-r)-t,s=3*(r-2*e+t),u=3*(e-t),l=t-i,c=s*s-3*a*u,f=s*u-9*a*l,h=u*u-3*s*l,p=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(s))o[0]=0;else{var d=-u/s;d>=0&&d<=1&&(o[p++]=d)}else{var y=f*f-4*c*h;if(this.isAroundZero(y)){var v=f/c,g=-s/a+v,m=-v/2;g>=0&&g<=1&&(o[p++]=g),m>=0&&m<=1&&(o[p++]=m)}else if(y>0){var b=Math.sqrt(y),x=c*s+1.5*a*(-f+b),w=c*s+1.5*a*(-f-b),_=(-s-((x=x<0?-Math.pow(-x,this.ONE_THIRD):Math.pow(x,this.ONE_THIRD))+(w=w<0?-Math.pow(-w,this.ONE_THIRD):Math.pow(w,this.ONE_THIRD))))/(3*a);_>=0&&_<=1&&(o[p++]=_)}else{var S=(2*c*s-3*a*f)/(2*Math.sqrt(c*c*c)),E=Math.acos(S)/3,k=Math.sqrt(c),T=Math.cos(E),C=(-s-2*k*T)/(3*a),O=(-s+k*(T+this.THREE_SQRT*Math.sin(E)))/(3*a),A=(-s+k*(T-this.THREE_SQRT*Math.sin(E)))/(3*a);C>=0&&C<=1&&(o[p++]=C),O>=0&&O<=1&&(o[p++]=O),A>=0&&A<=1&&(o[p++]=A)}}return p}},{key:"cubicExtrema",value:function(t,e,r,n,i){var o=6*r-12*e+6*t,a=9*e+3*n-3*t-9*r,s=3*e-3*t,u=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(o)){var l=-s/o;l>=0&&l<=1&&(i[u++]=l)}}else{var c=o*o-4*a*s;if(this.isAroundZero(c))i[0]=-o/(2*a);else if(c>0){var f=Math.sqrt(c),h=(-o+f)/(2*a),p=(-o-f)/(2*a);h>=0&&h<=1&&(i[u++]=h),p>=0&&p<=1&&(i[u++]=p)}}return u}},{key:"cubicSubdivide",value:function(t,e,r,n,i,o){var a=(e-t)*i+t,s=(r-e)*i+e,u=(n-r)*i+r,l=(s-a)*i+a,c=(u-s)*i+s,f=(c-l)*i+l;o[0]=t,o[1]=a,o[2]=l,o[3]=f,o[4]=f,o[5]=c,o[6]=u,o[7]=n}},{key:"cubicProjectPoint",value:function(t,e,r,n,i,o,a,s,u,l,c){var f,h=this.vector.create(),p=this.vector.create(),d=this.vector.create(),y=.005,v=1/0;h[0]=u,h[1]=l;for(var g=0;g<1;g+=.05){p[0]=this.cubicAt(t,r,i,a,g),p[1]=this.cubicAt(e,n,o,s,g);var m=this.vector.distSquare(h,p);m=0&&_=0&&l<=1&&(i[u++]=l)}}else{var c=a*a-4*o*s;if(this.isAroundZero(c)){var f=-a/(2*o);f>=0&&f<=1&&(i[u++]=f)}else if(c>0){var h=Math.sqrt(c),p=(-a+h)/(2*o),d=(-a-h)/(2*o);p>=0&&p<=1&&(i[u++]=p),d>=0&&d<=1&&(i[u++]=d)}}return u}},{key:"quadraticExtremum",value:function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n}},{key:"quadraticProjectPoint",value:function(t,e,r,n,i,o,a,s,u){var l,c=this.vector.create(),f=this.vector.create(),h=this.vector.create(),p=.005,d=1/0;c[0]=a,c[1]=s;for(var y=0;y<1;y+=.05){f[0]=this.quadraticAt(t,r,i,y),f[1]=this.quadraticAt(e,n,o,y);var v=this.vector.distSquare(c,f);v=0&&x0){for(var m=this.isInsidePolygon(e.pointList,v,g),b=t.holePolygonPointLists,x=!1,w=0,_=b.length;w<_;w++){var S=b[w];!0===this.isInsidePolygon(S,v,g)&&(x=!0)}return!0===m&&!1===x}return this.isInsidePolygon(e.pointList,v,g);case"text":var E=e.__rect||t.getRect(e);return this.isInsideRect(E.x,E.y,E.width,E.height,r,n);case"smictext":var k=t.getTextBackground(e);return this.isInsidePolygon(k,r,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,r,n);case"smicimage":var T=e.x,C=e.y;return t.refOriginalPosition&&(T=e.x+t.refOriginalPosition[0],C=e.y+t.refOriginalPosition[1]),this.isInsideRect(T,C,e.width,e.height,r,n)}}},{key:"_buildPathMethod",value:function(t,e,r,n,i){return e.beginPath(),t.buildPath(e,r),e.closePath(),e.isPointInPath(n,i)}},{key:"isOutside",value:function(t,e,r,n){return!this.isInside(t,e,r,n)}},{key:"isInsideLine",value:function(t,e,r,n,i,o,a){if(0===i)return!1;var s=Math.max(i,5),u=0;if(a>e+s&&a>n+s||at+s&&o>r+s||oe+f&&c>n+f&&c>o+f&&c>s+f||ct+f&&l>r+f&&l>i+f&&l>a+f||le+l&&u>n+l&&u>o+l||ut+l&&s>r+l&&s>i+l||sr||f+c=l)return!0;if(o){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=l);var p=Math.atan2(u,s);return p<0&&(p+=l),p>=n&&p<=i||p+l>=n&&p+l<=i}},{key:"isInsideBrokenLine",value:function(t,e,r,n){for(var i=Math.max(e,10),o=0,a=t.length-1;or*r}},{key:"isInsideRect",value:function(t,e,r,n,i,o){return i>=t&&i<=t+r&&o>=e&&o<=e+n}},{key:"isInsideCircle",value:function(t,e,r,n,i){return(n-t)*(n-t)+(i-e)*(i-e)e&&o>n||oi?ne&&l>n&&l>o&&l>s||l1&&this.swapExtrema(),d=c.cubicAt(e,n,o,s,h[0]),g>1&&(y=c.cubicAt(e,n,o,s,h[1]))),2==g?be&&s>n&&s>o||s=0&&f<=1){for(var h=0,p=u.quadraticAt(e,n,o,f),d=0;da||(l[d]a?0:or||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(u[0]=-c,u[1]=c,Math.abs(n-i)>=l){n=0,i=l;var f=o?1:-1;return a>=u[0]+t&&a<=u[1]+t?f:0}if(o){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=l);for(var p=0,d=0;d<2;d++){var y=u[d];if(y+t>a){var v=Math.atan2(s,y),g=o?1:-1;v<0&&(v=l+v),(v>=n&&v<=i||v+l>=n&&v+l<=i)&&(v>Math.PI/2&&v<1.5*Math.PI&&(g=-g),p+=g)}}return p}},{key:"isInsidePath",value:function(t,e,r,n,i){for(var o=0,a=0,s=0,u=0,l=0,c=!0,f=!0,h="stroke"===(r=r||"fill")||"both"===r,p="fill"===r||"both"===r,d=0;d0&&(p&&(o+=this.windingLine(a,s,u,l,n,i)),0!==o))return!0;u=v[v.length-2],l=v[v.length-1],c=!1,f&&"A"!==y.command&&(f=!1,a=u,s=l)}switch(y.command){case"M":a=v[0],s=v[1];break;case"L":if(h&&this.isInsideLine(a,s,v[0],v[1],e,n,i))return!0;p&&(o+=this.windingLine(a,s,v[0],v[1],n,i)),a=v[0],s=v[1];break;case"C":if(h&&this.isInsideCubicStroke(a,s,v[0],v[1],v[2],v[3],v[4],v[5],e,n,i))return!0;p&&(o+=this.windingCubic(a,s,v[0],v[1],v[2],v[3],v[4],v[5],n,i)),a=v[4],s=v[5];break;case"Q":if(h&&this.isInsideQuadraticStroke(a,s,v[0],v[1],v[2],v[3],e,n,i))return!0;p&&(o+=this.windingQuadratic(a,s,v[0],v[1],v[2],v[3],n,i)),a=v[2],s=v[3];break;case"A":var g=v[0],m=v[1],b=v[2],x=v[3],w=v[4],_=v[5],S=Math.cos(w)*b+g,E=Math.sin(w)*x+m;f?(f=!1,u=S,l=E):o+=this.windingLine(a,s,S,E);var k=(n-g)*x/b+g;if(h&&this.isInsideArcStroke(g,m,x,w,w+_,1-v[7],e,k,i))return!0;p&&(o+=this.windingArc(g,m,x,w,w+_,1-v[7],k,i)),a=Math.cos(w+_)*b+g,s=Math.sin(w+_)*x+m;break;case"z":if(h&&this.isInsideLine(a,s,u,l,e,n,i))return!0;c=!0}}return p&&(o+=this.windingLine(a,s,u,l,n,i)),0!==o}},{key:"getTextWidth",value:function(t,e){var r=t+":"+e;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,i=0,o=(t=(t+"").split("\n")).length;ithis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(t,e){var r=t+":"+e;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}])&&Ji(e.prototype,r),n&&Ji(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){"@babel/helpers - typeof";return(to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eo(t,e){for(var r=0;r1)for(var i=0,o=n-1;i1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],r=0;return t.replace(/[\d.]+/g,function(t){r<3?t|=0:t=+t,e[r++]=t}),e}},{key:"convert",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):e.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,e)}},{key:"toRGBA",value:function(t){return this.convert(t,"rgba")}},{key:"toRGB",value:function(t){return this.convert(t,"rgb")}},{key:"toHex",value:function(t){return this.convert(t,"hex")}},{key:"toHSVA",value:function(t){return this.convert(t,"hsva")}},{key:"toHSV",value:function(t){return this.convert(t,"hsv")}},{key:"toHSBA",value:function(t){return this.convert(t,"hsba")}},{key:"toHSB",value:function(t){return this.convert(t,"hsb")}},{key:"toHSLA",value:function(t){return this.convert(t,"hsla")}},{key:"toHSL",value:function(t){return this.convert(t,"hsl")}},{key:"toName",value:function(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}},{key:"trim",value:function(t){return String(t).replace(/\s+/g,"")}},{key:"normalize",value:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t}},{key:"lift",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),i=0;i<3;i++)n[i]=1===r?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}},{key:"mix",value:function(t,e,r){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,i=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),a=i[3]-o[3],s=((n*a==-1?n:(n+a)/(1+n*a))+1)/2,u=1-s,l=[],c=0;c<3;c++)l[c]=i[c]*s+o[c]*u;var f=i[3]*r+o[3]*(1-r);return f=Math.max(0,Math.min(1,f)),1===i[3]&&1===o[3]?this.toColor(l,"rgb"):(l[3]=f,this.toColor(l,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(e){var r,n,i=(e=this.normalize(e)).match(this.colorRegExp);if(null===i)throw new Error("The color format error");var o,a=[];if(i[2])o=[(r=i[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(o,function(e){return t.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(i[4]){var s=i[4].split(",");n=s[3],o=s.slice(0,3),a=this.map(o,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),t.prototype.adjust.call(this,e,[0,255])}),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}else if(i[5]||i[6]){var u=(i[5]||i[6]).split(","),l=parseInt(u[0],0)/360,c=u[1],f=u[2];n=u[3],(a=this.map([c,f],function(e){return t.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}return a}},{key:"alpha",value:function(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var r=this.getData(this.toRGBA(t));return r[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t}},{key:"isCalculableColor",value:function(t){return t instanceof Array||"string"==typeof t}},{key:"_HSV_2_RGB",value:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s=6*i;6===s&&(s=0);var u=0|s,l=a*(1-o),c=a*(1-o*(s-u)),f=a*(1-o*(1-(s-u))),h=0,p=0,d=0;0===u?(h=a,p=f,d=l):1===u?(h=c,p=a,d=l):2===u?(h=l,p=a,d=f):3===u?(h=l,p=c,d=a):4===u?(h=f,p=l,d=a):(h=a,p=l,d=c),e=255*h,r=255*p,n=255*d}return[e,r,n]}},{key:"_HSL_2_RGB",value:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+o):a+o-o*a);e=255*this._HUE_2_RGB(u,s,i+1/3),r=255*this._HUE_2_RGB(u,s,i),n=255*this._HUE_2_RGB(u,s,i-1/3)}return[e,r,n]}},{key:"_HUE_2_RGB",value:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}},{key:"_RGB_2_HSB",value:function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,l=s;if(0===u)e=0,r=0;else{r=u/s;var c=((s-n)/6+u/2)/u,f=((s-i)/6+u/2)/u,h=((s-o)/6+u/2)/u;n===s?e=h-f:i===s?e=1/3+c-h:o===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}},{key:"_RGB_2_HSL",value:function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,l=(s+a)/2;if(0===u)e=0,r=0;else{r=l<.5?u/(s+a):u/(2-s-a);var c=((s-n)/6+u/2)/u,f=((s-i)/6+u/2)/u,h=((s-o)/6+u/2)/u;n===s?e=h-f:i===s?e=1/3+c-h:o===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}}])&&eo(e.prototype,r),n&&eo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function io(t){"@babel/helpers - typeof";return(io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oo(t,e){for(var r=0;ri&&(i=u[0]),u[1]a&&(a=u[1])}e[0]=n,e[1]=o,r[0]=i,r[1]=a}}},{key:"cubeBezier",value:function(t,e,r,n,i,o){var a=new Zi,s=[];a.cubicExtrema(t[0],e[0],r[0],n[0],s);for(var u=0;ui&&!o?i+=2*Math.PI:nn&&(f[0]=Math.cos(p)*r+t,f[1]=Math.sin(p)*r+e,u.min(a,f,a),u.max(s,f,s))}}])&&oo(e.prototype,r),n&&oo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function uo(t){"@babel/helpers - typeof";return(uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lo(t,e){for(var r=0;r=200&&i.status<300||304===i.status?e&&e(i.responseText):r&&r(),i.onreadystatechange=new Function,i=null)},i.send(null)}}])&&mo(e.prototype,r),n&&mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wo(t){"@babel/helpers - typeof";return(wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _o(t,e){for(var r=0;r1)for(var e in arguments)console.log(arguments[e])}}var e,r,n;return e=t,(r=[{key:"destory",value:function(){return!0}}])&&To(e.prototype,r),n&&To(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ao(t){"@babel/helpers - typeof";return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Po(t,e){for(var r=0;ra-2?a-1:p+1][0]+o[0],e[p>a-2?a-1:p+1][1]+o[1]],m=[e[p>a-3?a-1:p+2][0]+o[0],e[p>a-3?a-1:p+2][1]+o[1]]);var b=d*d,x=d*b;s.push([w(y[0],v[0],g[0],m[0],d,b,x),w(y[1],v[1],g[1],m[1],d,b,x)])}return s;function w(t,e,r,n,i,o,a){var s=.5*(r-t),u=.5*(n-e);return(2*(e-r)+s+u)*a+(-3*(e-r)-2*s-u)*o+s*i+e}}},{key:"SUtil_dashedLineTo",value:function(t,e,r,n,i,o,a){var s=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return s[0]=o,s[1]=o,a&&a instanceof Array?t.setLineDash(a):t.setLineDash(s),t.moveTo(e,r),void t.lineTo(n,i);var u=n-e,l=i-r,c=Math.floor(Math.sqrt(u*u+l*l)/o);u/=c,l/=c;for(var f=!0,h=0;h-5e-5&&t<5e-5}zo.Util_vector.sub(e,t,this.position),n(e[0])&&n(e[1])||(zo.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})}var e,r,n;return e=t,(r=[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||zo.Util_matrix.create();if(zo.Util_matrix.identity(e),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;var r=i(t[0])||i(t[1]);r&&zo.Util_matrix.translate(e,e,t),zo.Util_matrix.scale(e,e,this.scale),r&&(t[0]=-t[0],t[1]=-t[1],zo.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;var n=i(t[0])||i(t[1]);n&&zo.Util_matrix.translate(e,e,t),zo.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],zo.Util_matrix.translate(e,e,t))}}else 0!=+this.rotation&&zo.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&zo.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?zo.Util_matrix.mul(this.transform,this.parent.transform,this.transform):zo.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}},{key:"setTransform",value:function(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],r=this.position,n=this.scale,i=this.rotation;a(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];a(o-1)&&(o=Math.sqrt(o)),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,i[0]=Math.atan2(-t[1]/o,t[0]/e),i[1]=i[2]=0}function a(t){return t>5e-5||t<-5e-5}}}])&&Go(e.prototype,r),n&&Go(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wo(t){"@babel/helpers - typeof";return(Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qo(t,e){for(var r=0;r0}},{key:"addRoot",value:function(t){t instanceof $o&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}},{key:"delRoot",value:function(t){if(void 0===t){for(var e=0;e=0&&(this.delFromMap(o.id),this._roots.splice(a,1),o instanceof $o&&o.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(t){return t instanceof $o&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}},{key:"get",value:function(t){return this._elements[t]}},{key:"delFromMap",value:function(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof $o&&(e._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}])&&ea(e.prototype,r),n&&ea(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ia(t){"@babel/helpers - typeof";return(ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oa(t,e){for(var r=0;r1},isLeftClick:function(t){return t.which&&1===t.which||t.button&&1===t.button},isRightClick:function(t){return t.which&&3===t.which||t.button&&2===t.button},stop:function(t,e){e||(t.preventDefault?t.preventDefault():t.returnValue=!1),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},findElement:function(t,e){for(var r=va.element(t);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=e.toUpperCase());)r=r.parentNode;return r},observe:function(t,e,r,n){var i=$.getElement(t);if(n=n||!1,"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!i._eventCacheID){var o="eventCacheID_";i.id&&(o=i.id+"_"+o),i._eventCacheID=$.createUniqueID(o)}var a=i._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:i,name:e,observer:r,useCapture:n}),i.addEventListener?"mousewheel"===e?i.addEventListener(e,r,{useCapture:n,passive:!1}):i.addEventListener(e,r,n):i.attachEvent&&i.attachEvent("on"+e,r)},stopObservingElement:function(t){var e=$.getElement(t)._eventCacheID;this._removeElementObservers(va.observers[e])},_removeElementObservers:function(t){if(t)for(var e=t.length-1;e>=0;e--){var r=t[e],n=new Array(r.element,r.name,r.observer,r.useCapture);va.stopObserving.apply(this,n)}},stopObserving:function(t,e,r,n){n=n||!1;var i=$.getElement(t),o=i._eventCacheID;"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(e="keydown");var a=!1,s=va.observers[o];if(s)for(var u=0;!a&&u0&&(this.setCtxGlobalAlpha(t,"stroke",r),t.stroke()),this.setCtxGlobalAlpha(t,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",r),r.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",r);break;default:this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)}this.drawText(t,r,this.style),this.afterBrush(t)}},{key:"beforeBrush",value:function(t,e){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),e&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r}},{key:"afterBrush",value:function(t){t.restore()}},{key:"setContext",value:function(t,e){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,i=r.length;n=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&zo.Util_area.isInside(this,this.style,t,e)}},{key:"drawText",value:function(t,r,n){if(void 0!==r.text&&!1!==r.text){var i=r.textColor||r.color||r.strokeColor;t.fillStyle=i;var o,a,s,u,l=10,c=r.textPosition||this.textPosition||"top",f=[];switch(f=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var h=(n||r).__rect||this.getRect(n||r);switch(c){case"inside":s=h.x+h.width/2,u=h.y+h.height/2,o="center",a="middle","stroke"!=r.brushType&&i==r.color&&(t.fillStyle="#fff");break;case"left":s=h.x-l,u=h.y+h.height/2,o="end",a="middle";break;case"right":s=h.x+h.width+l,u=h.y+h.height/2,o="start",a="middle";break;case"top":s=h.x+h.width/2,u=h.y-l,o="center",a="bottom";break;case"bottom":s=h.x+h.width/2,u=h.y+h.height+l,o="center",a="top"}}break;case"start":case"end":var p=0,d=0,y=0,v=0;if(void 0!==r.pointList){var g=r.pointList;if(g.length<2)return;var m=g.length;switch(c){case"start":p=g[0][0]+f[0],d=g[1][0]+f[0],y=g[0][1]+f[1],v=g[1][1]+f[1];break;case"end":p=g[m-2][0]+f[0],d=g[m-1][0]+f[0],y=g[m-2][1]+f[1],v=g[m-1][1]+f[1]}}else p=r.xStart+f[0]||0,d=r.xEnd+f[0]||0,y=r.yStart+f[1]||0,v=r.yEnd+f[1]||0;switch(c){case"start":o=p0&&t>this._zlevelList[0]){for(i=0;it);i++);n=this._layers[this._zlevelList[i]]}this._zlevelList.splice(i+1,0,t),e=new es($.createUniqueID("_levelLayer_"+t),this);var o=n?n.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(e.dom,o.nextSibling):o.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new Di).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(t){var e=this._layers,r={};for(var n in e)"hover"!==n&&(r[n]=e[n].elCount,e[n].elCount=0);for(var i=0;i0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var i in r)if("hover"!==i){var o=r[i],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var s=o.__zoom;s*=e,e=(s=Math.max(Math.min(o.maxZoom,s),o.minZoom))/o.__zoom,o.__zoom=s,a[0]-=(this._mouseX-a[0])*(e-1),a[1]-=(this._mouseY-a[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,Eo.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=zo.Util_event.getX(t),this._mouseY=zo.Util_event.getY(t);var e=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var i=this.painter.getLayers(),o=!1;for(var a in i)if("hover"!==a){var s=i[a];s.panable&&(n="move",s.position[0]+=e,s.position[1]+=r,o=!0,s.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,Eo.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!=this.root)for(;e&&9!=e.nodeType;){if(e==this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(Eo.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,Eo.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,Eo.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&zo.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment=0;i--){var o=r[i];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(zo.Util_matrix.invert(e,t.transform),zo.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(e,1)}},{key:"_update",value:function(){for(var t=(new Date).getTime(),e=t-this._time,r=this._clips,n=r.length,i=[],o=[],a=0;a=0&&!(y[x]<=a);x--);x=Math.min(x,l-2)}else{for(x=T;xa);x++);x=Math.min(x-1,l-2)}T=x,C=a;var s=y[x+1]-y[x];if(0!==s){var c,d;for(w=(a-y[x])/s,o?(S=v[x],_=v[0===x?x:x-1],E=v[x>l-2?l-1:x+1],k=v[x>l-3?l-1:x+2],f?Cs._catmullRomInterpolateArray(_,S,E,k,w,w*w,w*w*w,n(t,u),p):(c=h?Cs.rgba2String(O):Cs._catmullRomInterpolate(_,S,E,k,w,w*w,w*w*w),r(t,u,c))):f?Cs._interpolateArray(v[x],v[x+1],w,n(t,u),p):(h?(Cs._interpolateArray(v[x],v[x+1],w,O,1),d=Cs.rgba2String(O)):d=Cs._interpolateNumber(v[x],v[x+1],w),r(t,u,d)),x=0;x=0;e--)t[e].destroy()}}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,this.display(t),this.redrawThematicFeatures(this.map.getBounds()))}},{key:"display",value:function(t){this.div.style.display=t?"block":"none"}},{key:"setOpacity",value:function(t){if(t!==this.opacity){this.opacity=t;var e=this.div;$.modifyDOMElement(e,null,null,null,null,null,null,t),null!==this.map&&O().Evented.prototype.fire("changelayer",{layer:this,property:"opacity"})}}},{key:"addFeatures",value:function(t){}},{key:"removeFeatures",value:function(t){var e=this;if(t){if(t===e.features)return e.removeAllFeatures();$.isArray(t)||"function"==typeof t||(t=[t]);for(var r=[],n=0;n=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){n=!0;break}}return n}},{key:"clearCache",value:function(){this.cache={},this.charts=[]}},{key:"removeFeatures",value:function(t){this.clearCache(),Zs(Ks(e.prototype),"removeFeatures",this).call(this,t)}},{key:"removeAllFeatures",value:function(){this.clearCache(),Zs(Ks(e.prototype),"removeAllFeatures",this).call(this)}},{key:"redraw",value:function(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getBounds()),!0)}},{key:"clear",value:function(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}}])&&qs(r.prototype,n),i&&qs(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function $s(t){"@babel/helpers - typeof";return($s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tu(t,e){for(var r=0;rn&&(n=u[0]),u[1]i&&(i=u[1]))}return t.__rect={x:e,y:r,width:n-e,height:i-r},t.__rect}},{key:"getRectNoRotation",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition,n=zo.Util_area.getTextHeight("ZH",t.textFont),i=zo.Util_area.getTextWidth(t.text,t.textFont),o=zo.Util_area.getTextHeight(t.text,t.textFont),a=t.x+r[0];"end"==t.textAlign||"right"==t.textAlign?a-=i:"center"==t.textAlign&&(a-=i/2),e="top"==t.textBaseline?t.y+r[1]:"bottom"==t.textBaseline?t.y+r[1]-o:t.y+r[1]-o/2;var s,u=!1;if(t.maxWidth){var l=parseInt(t.maxWidth);l-1&&(i+=!0===u?n/3*(i/s):n/3));return{x:a,y:e,width:i,height:o}}},{key:"getTextBackground",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!e&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),i=t.x+r[0],o=t.y+r[1],a=[];if(t.textRotation&&0!==t.textRotation){var s=t.textRotation,u=this.getRotatedLocation(n.x,n.y,i,o,s),l=this.getRotatedLocation(n.x+n.width,n.y,i,o,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,i,o,s),f=this.getRotatedLocation(n.x,n.y+n.height,i,o,s);a.push(u),a.push(l),a.push(c),a.push(f)}else{var h=[n.x,n.y],p=[n.x+n.width,n.y],d=[n.x+n.width,n.y+n.height],y=[n.x,n.y+n.height];a.push(h),a.push(p),a.push(d),a.push(y)}return t.__textBackground=a,t.__textBackground}},{key:"getRotatedLocation",value:function(t,e,r,n,i){var o,a,s=new Array;return e=-e,n=-n,i=-i,o=(t-r)*Math.cos(i/180*Math.PI)-(e-n)*Math.sin(i/180*Math.PI)+r,a=(t-r)*Math.sin(i/180*Math.PI)+(e-n)*Math.cos(i/180*Math.PI)+n,s[0]=o,s[1]=-a,s}}])&&_l(r.prototype,n),i&&_l(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Al(t){"@babel/helpers - typeof";return(Al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pl(t,e){for(var r=0;r0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(t.beginPath(),this.buildPath(t,r)),this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)),this.drawText(t,r,this.style);var i=$.cloneObject(r);if(i.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,a=o.length,s=0;s0&&("stroke"==i.brushType||"both"==i.brushType)?(n||(t.beginPath(),this.buildPath(t,i)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)):t.globalCompositeOperation="source-over"}t.restore()}},{key:"buildPath",value:function(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var i,o,a,s=zo.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,r);t.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,l=0;lo&&(o=u[l][0]+r[0]),u[l][1]+r[1]s&&(s=u[l][1]+r[1]);return n="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(i-n/2),y:Math.round(a-n/2),width:o-i+n,height:s-a+n},t.__rect}}])&&Bl(r.prototype,n),i&&Bl(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Wl(t){"@babel/helpers - typeof";return(Wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ql(t,e){for(var r=0;rc&&(r*=c/(a=r+n),n*=c/a),i+o>c&&(i*=c/(a=i+o),o*=c/a),n+i>f&&(n*=f/(a=n+i),i*=f/a),r+o>f&&(r*=f/(a=r+o),o*=f/a),t.moveTo(u+r,l),t.lineTo(u+c-n,l),0!==n&&t.quadraticCurveTo(u+c,l,u+c,l+n),t.lineTo(u+c,l+f-i),0!==i&&t.quadraticCurveTo(u+c,l+f,u+c-i,l+f),t.lineTo(u+o,l+f),0!==o&&t.quadraticCurveTo(u,l+f,u,l+f-o),t.lineTo(u,l+r),0!==r&&t.quadraticCurveTo(u,l,u+r,l)}},{key:"buildPath",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+r[0],e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1])),t.closePath()}},{key:"getRect",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+r[0]-e/2),y:Math.round(t.y+r[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}])&&tc(r.prototype,n),i&&tc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function sc(t){"@babel/helpers - typeof";return(sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uc(t,e){for(var r=0;r1?zo.Util_computeBoundingBox.arc(a,s,u,c,f,!h,r,i):(r[0]=i[0]=a,r[1]=i[1]=s),zo.Util_computeBoundingBox.arc(a,s,l,c,f,!h,n,o),zo.Util_vector.min(r,r,n),zo.Util_vector.max(i,i,o),t.__rect={x:r[0],y:r[1],width:i[0]-r[0],height:i[1]-r[1]},t.__rect}}])&&uc(r.prototype,n),i&&uc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function yc(t){"@babel/helpers - typeof";return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vc(t,e){for(var r=0;r=15){var h=parseInt(o.axis3DParameter),p=[i[0]-h,i[1]+h];o.axisUseArrow?(c.push([p[0]+1.5,p[1]-7.5]),c.push([p[0]-1,p[1]+1]),c.push([p[0]+7.5,p[1]-1.5]),f.push([p[0],p[1]])):f.push([p[0],p[1]]),f.push([i[0],i[1]])}f.push([i[2]+5,i[1]])}else{var d=Math.abs(i[1]-i[3])/l,y=i[3];f.push([i[0],y-5]);for(var v=0;v=15){var m=parseInt(o.axis3DParameter),b=[i[0]-m,i[1]+m];o.axisUseArrow?(c.push([b[0]+1.5,b[1]-7.5]),c.push([b[0]-1,b[1]+1]),c.push([b[0]+7.5,b[1]-1.5]),f.push([b[0],b[1]])):f.push([b[0],b[1]]),f.push([i[0],i[1]])}f.push([i[2]+5,i[1]])}if(o.axisUseArrow){var x=[[i[2]+5,i[1]+4],[i[2]+13,i[1]],[i[2]+5,i[1]-4]],w=[[i[0]-4,i[3]-5],[i[0],i[3]-13],[i[0]+4,i[3]-5]],_=new Tu(x);_.style={fillColor:"#008acd"},$.copyAttributesWithClip(_.style,o.axisStyle),s.push(t.createShape(_));var S=new Tu(w);if(S.style={fillColor:"#008acd"},$.copyAttributesWithClip(S.style,o.axisStyle),s.push(t.createShape(S)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var E=new Tu(c);E.style={fillColor:"#008acd"},$.copyAttributesWithClip(E.style,o.axisStyle),s.push(t.createShape(E))}}var k=new mu(f);k.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&$.copyAttributesWithClip(k.style,o.axisStyle),k.clickable=!1,k.hoverable=!1;var T=[t.createShape(k)],C=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var O=o.axisYLabels,A=O.length,P=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(P=o.axisYLabelsOffset),1==A){var M=new Ku(i[0]-5+P[0],i[3]+P[1],O[0]);M.style={labelAlign:"right"},o.axisYLabelsStyle&&$.copyAttributesWithClip(M.style,o.axisYLabelsStyle),M.clickable=!1,M.hoverable=!1,C.push(t.createShape(M))}else for(var I=i[3],L=Math.abs(i[1]-i[3])/(A-1),j=0;j0){var D=o.axisXLabels,B=D.length,F=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(F=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==B)for(var z=n.xPositions,U=0;U=0&&r[i]&&$.copyAttributesWithClip(a,r[i]),n&&n.length&&void 0!==o)for(var s=n,u=s.length,l=parseFloat(o),c=0;c0){var l=o[o.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}o.push(n)}if(o.length<2)return null;var c=new Object;(c=$.copyAttributesWithClip(c,this.style,["pointList"])).pointList=o;var f=new Ql({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}},{key:"multiPointToTF",value:function(t){for(var e=t.components,r=[],n=[],i=this.location,o=[],a=this.nodesClipPixel,s=0;s0){var l=o[o.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}o.push(n);var c=new Object;c.r=6,(c=$.copyAttributesWithClip(c,this.style)).x=n[0],c.y=n[1];var f=new xl({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=i,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}},{key:"multiLineStringToTF",value:function(t){for(var e=t.components,r=0;r0){var h=o[o.length-1];if(Math.abs(h[0]-n[0])<=u&&Math.abs(h[1]-n[1])<=u)continue}o.push(n)}}else{a=[];for(var p=0;p0){var d=a[a.length-1];if(Math.abs(d[0]-n[0])<=u&&Math.abs(d[1]-n[1])<=u)continue}a.push(n)}}a.length<2||s.push(a)}if(!(o.length<2)){var y={};(y=$.copyAttributesWithClip(y,this.style,["pointList"])).pointList=o;var v=new Hl({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(v.highlightStyle=this.highlightStyle),v.refOriginalPosition=this.location,v.refDataID=this.data.id,v.isHoverByRefDataID=this.isMultiHover,s.length>0&&(v.holePolygonPointLists=s),this.shapeOptions&&$.copyAttributesWithClip(v,this.shapeOptions),this.shapes.push(v)}}},{key:"rectangleToTF",value:function(t){var e=this.location,r=new Qt(t.x,t.y),n=this.layer.map.getResolution(),i=this.getLocalXY(r),o=new Object;o.r=6,(o=$.copyAttributesWithClip(o,this.style)).x=i[0]-e[0],o.y=i[1]-e[1]-2*t.width/n,o.width=t.width/n,o.height=t.height/n;var a=new ac({style:o,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=e,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}},{key:"geoTextToTF",value:function(t){var e=this.location,r=this.getLocalXY(t),n=new Object;n.r=6,(n=$.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-e[0],n.y=r[1]-e[1],n.text=t.text;var i=new Ol({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(i.highlightStyle=this.highlightStyle),i.refOriginalPosition=e,i.refDataID=this.data.id,i.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(i,this.shapeOptions),this.shapes.push(i)}},{key:"updateAndAddShapes",value:function(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,r=0,n=this.shapes.length;rs){var h=o[0];o.splice(0,1),delete i[h]}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var p=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(p)}}},{key:"createThematicFeature",value:function(t){var e=$.copyAttributesWithClip(this.style);t.style&&!0===this.isAllowFeatureStyle&&(e=$.copyAttributesWithClip(t.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=mc.transformStyle(this.highlightStyle);for(var n=new Oc(t,this,mc.transformStyle(e),r),i=0;i0&&0==this.labelFeatures.length)for(var r=this.setLabelsStyle(this.features),n=0,i=r.length;n=0&&d.x<=f.x&&d.y>=0&&d.y<=f.y){if(r.style.minZoomLevel>-1&&l<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&l>r.style.maxZoomLevel)continue;var y=null;r.isStyleChange?(r.isStyleChange=null,y=this.calculateLabelBounds(r,d)):y=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,d):this.calculateLabelBounds(r,d);var v=new re(0,f.y,f.x,0),g=y.length;if(this.isAvoid){var m=this.getAvoidInfo(v,y);if(m){if("left"===m.aspectW){r.style.labelXOffset+=m.offsetX;for(var b=0;b=i[u].start&&a=i[u].start&&as&&(s=r,u="top")}if(e.y>t.bottom){var n=Math.abs(e.y-t.bottom);n>s&&(s=n,u="bottom")}if(e.xa&&(a=i,l="left")}if(e.x>t.right){var o=Math.abs(e.x-t.right);o>a&&(a=o,l="right")}}}}},{key:"isQuadrilateralOverLap",value:function(t,e){var r=t.length,n=e.length;if(5!==r||5!==n)return null;for(var i=!1,o=0;ot-n&&r.time-1?e=1:["degrees","deg","degree","dd"].indexOf(t.toLocaleLowerCase())>-1?e=2*Math.PI*6378137/360:t===xn.KILOMETER?e=.001:t===xn.INCH?e=1/.025399999918:t===xn.FOOT&&(e=.3048),e};function af(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[-180,180],i=n[1],o=n[0],a=i-o;return t===i&&e?t:t===o&&r?t:0===((t-o)%a+a)%a&&e?i:((t-o)%a+a)%a+o}function sf(t){var e=parseInt(t),r=parseInt(60*(t-e)),n=parseInt(60*(60*(t-e)-r));return r=0===parseInt(r/10)?"0".concat(r):r,n=0===parseInt(n/10)?"0".concat(n):n,"".concat(e,"°").concat(r,"'").concat(n)}function uf(t,e,r){return 1/(t*e*(1/.0254)*of(r))}function lf(t){"@babel/helpers - typeof";return(lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cf(t,e){for(var r=0;rthis.mapVOptions.maxZoom)}},{key:"_getResolution",value:function(){var t=this.map.getBounds(),e=(t.getEast()-t.getWest())/this.map.getCanvas().getBoundingClientRect().width;return of("DEGREE")*e}},{key:"_getCenterPixel",value:function(){return this.map.project(new(O().LngLat)(0,0))}},{key:"addData",value:function(t,e){this.renderer.addData(t,e)}},{key:"update",value:function(t){this.renderer.update(t)}},{key:"getData",value:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}},{key:"removeData",value:function(t){this.renderer&&this.renderer.removeData(t)}},{key:"clearData",value:function(){this.renderer.clearData()}},{key:"show",value:function(){return this.renderer&&this.renderer.show(),this}},{key:"hide",value:function(){return this.renderer&&this.renderer.hide(),this}},{key:"getTopLeft",value:function(){var t,e=this.map;e&&(t=e.getBounds().getNorthWest());return t}},{key:"bindEvent",value:function(){var t=this.map;this.mapVOptions.methods&&(this.mapVOptions.methods.click&&t.on("click",this.renderer.clickEvent),this.mapVOptions.methods.mousemove&&t.on("mousemove",this.renderer.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.mapvOptions.methods&&(this.mapvOptions.methods.click&&t.off("click",this.clickEvent),this.mapvOptions.methods.mousemove&&t.off("mousemove",this.mousemoveEvent))}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,t?this.show():this.hide())}},{key:"setZIndex",value:function(t){this.renderer.setZIndex(t)}}])&&cf(e.prototype,r),n&&cf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pf(t){"@babel/helpers - typeof";return(pf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function df(t,e){for(var r=0;r",a="
"+(e._createLegendElement.call(e)||"")+"
";this._container.innerHTML=o+a}return e._appendLegendCSSStyle(),this._container},r.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},new r}},{key:"_createLegendElement",value:function(){}},{key:"_addLayer",value:function(){var t=this.getLayerStyleOptions(),e=this.id?this.id:"theme3DLayer",r=this.sourceId=e+"Source";this.map.getSource(r)?(this.map.removeSource(r),this.map.addSource(r,{type:"geojson",data:this.data})):this.map.addSource(r,{type:"geojson",data:this.data}),this.map.addLayer({id:e,type:"fill-extrusion",source:r,paint:t}),this.map.moveLayer(e)}},{key:"_addHighLightLayer",value:function(){if(this.map){var t=this.map;t.addLayer({id:this._highlightLayerId,type:"fill-extrusion",source:this.sourceId,paint:this.getHighlightStyleOptions(),filter:["in","$id",""]}),this._selectFeatureId=null,t.on("mousemove",this.id,this._onMouseMove.bind(this)),t.on("mouseout",this.id,this._onMouseMove.bind(this))}}},{key:"_onMouseMove",value:function(t){var e=this,r=this.map,n=r.queryRenderedFeatures(t.point,{layers:[e.id]});if(e.highlight&&e.highlight.callback&&e.highlight.callback(n,t),!n||n.length<1)return e._clearHighlight.call(e),void(e._selectFeatureId=null);var i=n[0].id;e._selectFeatureId!==i&&(e._selectFeatureId=i,r.setFilter(e._highlightLayerId,["==","$id",e._selectFeatureId]))}},{key:"_clearHighlight",value:function(){this.map&&this.map.setFilter(this._highlightLayerId,["in","$id",""])}},{key:"_appendLegendCSSStyle",value:function(){var t=document.createElement("style");t.type="text/css";t.innerHTML="\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n "+this._legendCSSStyle(),document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_legendCSSStyle",value:function(){return"\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n "}},{key:"_extend",value:function(t){for(var e=0;e";for(t=0;t "+i;else i=i+"-"+this._getWrapperText(this.colorStops[t+1][0]);r+="
  • "+i+"
  • "}return r+=""}},{key:"_getWrapperText",value:function(t){var e=t*(null==this.legendRatio?1:parseFloat(this.legendRatio)),r=parseFloat(e);return r%1e6<=1e6?r.toString():parseInt(r/1e3)+"k"}}])&&mf(r.prototype,n),i&&mf(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function kf(t){"@babel/helpers - typeof";return(kf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tf(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,i=r.attributes,o=this.styleGroups,a=!1,s=null;for(var u in i)if(n===u){a=!0,s=i[u];break}if(a)for(var l=0,c=o.length;l=o[l].start&&s"+n+""}return t+=""}}])&&zf(r.prototype,n),i&&zf(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Yf(t){"@babel/helpers - typeof";return(Yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xf(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,i=r.attributes,o=this.styleGroups,a=!1,s=null;for(var u in i)if(n===u){a=!0,s=i[u];break}if(a)for(var l=0,c=o.length;l0&&void 0!==arguments[0]?arguments[0]:null;if(!t||0===t.length||t===this.graphics)return this.graphics.length=0,this.layer.props.data&&(this.layer.props.data.length=0),void this.update();$.isArray(t)||(t=[t]);for(var e=t.length-1;e>=0;e--){var r=t[e],n=$.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()}},{key:"update",value:function(){if("Awaiting state"!==this.layer.lifecycle){this.layer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0});var t=this.getState(),e=parseInt(this.canvas.style.width),r=parseInt(this.canvas.style.height);t.width=e,t.height=r,this.layer.setState(t)}}},{key:"clear",value:function(){this.removeGraphics(),this.deckGL.finalize()}},{key:"remove",value:function(){this.mapOptions.targetElement.removeChild(this.canvas)}},{key:"destroy",value:function(){this.remove(),this.clear()}},{key:"moveTo",value:function(t,e){var r=document.getElementById(this.id);if(e=void 0===e||e){var n=document.getElementById(t);r&&n&&n.parentNode.insertBefore(r,n)}else{var i=document.getElementById(t);if(r){if(i.nextSibling)return void i.parentNode.insertBefore(r,i.nextSibling);i.parentNode.appendChild(r)}}}},{key:"setVisibility",value:function(t){this.canvas&&t!==this.visibility&&(this.visibility=t,this.canvas.style.display=t?"block":"none")}},{key:"draw",value:function(){var t=this.getState(),e={};for(var r in t)e[r]=t[r];var n=parseInt(this.canvas.style.width),i=parseInt(this.canvas.style.height);e.width=n,e.height=i,e.layers=[this.layer],e.canvas=this.canvas,this.deckGL.setProps(e)}},{key:"_initContainer",value:function(){this.canvas=this._createCanvas(this.mapOptions.mapElement),this.mapOptions.targetElement.appendChild(this.canvas)}},{key:"_createCanvas",value:function(t){var e=document.createElement("canvas");return this.id&&(e.id=this.id),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.cursor="",e.width=parseInt(t.style.width),e.height=parseInt(t.style.height),e.style.width=t.style.width,e.style.height=t.style.height,e}},{key:"getState",value:function(){var t=this.functions.getMapState();return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:null;this.renderer&&this.renderer.removeGraphics(t)}},{key:"clear",value:function(){this.renderer&&this.renderer.clear()}},{key:"remove",value:function(){this.renderer&&this.renderer.remove()}},{key:"moveTo",value:function(t,e){this.renderer.moveTo(t,e)}},{key:"setVisibility",value:function(t){this.renderer.setVisibility(t)}},{key:"getState",value:function(){return this.renderer.getState()}},{key:"getMapState",value:function(){var t={},e=this.map.getCenter(),r={longitude:e.lng,latitude:e.lat,zoom:this.map.getZoom(),maxZoom:this.map.getMaxZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()};for(var n in r)t[n]=r[n];return this.map.getCRS&&this.map.getCRS()!==O().CRS.EPSG3857&&(t.coordinateSystem=this.coordinateSystem,t.isGeographicCoordinateSystem=this.isGeographicCoordinateSystem),t}}])&&sh(e.prototype,r),n&&sh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ch=function(){try{return THREE}catch(t){return{}}}();function fh(t,e,r){if(t===r||t===e)return t;var n=r-e;return((t-e)%n+n)%n+e}function hh(t){return t*Math.PI/180}var ph={matrix:[1,-1,0,0],projection:{R:6378137,minZoom:0,maxZoom:22,nativeMaxZoom:19,RAD:Math.PI/180,METERS_PER_DEGREE:6378137*Math.PI/180,MAX_LATITUDE:85.0511287798,project:function(t){var e=this.RAD,r=this.METERS_PER_DEGREE,n=this.MAX_LATITUDE,i=t instanceof Array?{lng:t[0],lat:t[1]}:{lng:t.lng,lat:t.lat},o=i.lng,a=Math.max(Math.min(n,i.lat),-n);return{x:o*r,y:(0===a?0:Math.log(Math.tan((90+a)*e/2))/e)*r}},unproject:function(t){var e,r=t.x,n=t.y,i=this.RAD,o=this.METERS_PER_DEGREE;return 0===n?e=0:(e=n/o,e=(2*Math.atan(Math.exp(e*i))-Math.PI/2)/i),{lng:fh(r/o,-180,180),lat:fh(e,-this.MAX_LATITUDE,this.MAX_LATITUDE)}},locate:function(t,e,r){if(!t)return null;if(e=e||0,r=r||0,!e&&!r)return t;var n=t.lng;if(0!==e){var i=Math.abs(e),o=hh(t.lng);n=fh(180*(o+=2*Math.sqrt(Math.pow(Math.sin(i/(2*this.R)),2)/Math.pow(Math.cos(o),2))*(i>0?1:-1))/Math.PI,-180,180)}var a=t.lat;if(0!==r){var s=Math.abs(r),u=hh(t.lat);a=fh(180*(u+=2*Math.sin(s/(2*this.R))*(s>0?1:-1))/Math.PI,-90,90)}return{lng:n,lat:a}},getResolution:function(t){if(!this.resolutions){for(var e=[],r=12756274*Math.PI,n=0;n<=this.maxZoom;n++)e[n]=r/(256*Math.pow(2,n));this.resolutions=e}var i=0|t,o=this.resolutions.length;i=i<0?0:i>o-1?o-1:i;var a=this.resolutions[i];return(0|t)!==t&&i!==o-1?a+(this.resolutions[i+1]-a)*(t-i):a}},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},lngLatToPoint:function(t,e){var r=this.project(t);return this.transform(r,this.projection.getResolution(e))},locate:function(t,e,r){return this.projection.locate(t,e,r)},transform:function(t,e){return{x:this.matrix[0]*(t.x-this.matrix[2])/e,y:this.matrix[1]*(t.y-this.matrix[3])/e}}};function dh(t){"@babel/helpers - typeof";return(dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yh(t,e){for(var r=0;r=0;e--)t.children[e]instanceof ch.Mesh&&t.remove(t.children[e]);return this}},{key:"clearAll",value:function(t){var e=this.scene;if(!e)return this;for(var r=e.children.length-1;r>=0;r--)!t&&e.children[r]instanceof ch.Camera||e.remove(e.children[r]);return this}},{key:"setPosition",value:function(t,e){if(!t||!e)return this;var r=this.lngLatToPosition(e);return t.position.set(r.x,r.y,r.z),this}},{key:"lngLatToPosition",value:function(t){var e=ph.projection.nativeMaxZoom,r=ph.lngLatToPoint(t,e);return new _h(r.x,r.y,-0)}},{key:"distanceToThreeVector3",value:function(t,e,r){var n=this.map,i=r||n.getCenter(),o=ph.projection.nativeMaxZoom,a=ph.locate(i,t,e),s=ph.lngLatToPoint(i,o),u=ph.lngLatToPoint(a,o),l=Math.abs(u.x-s.x)*Math.sign(t),c=Math.abs(u.y-s.y)*Math.sign(e);return new _h(l,c,0)}},{key:"removeDuplicatedCoordinates",value:function(t){function e(t,e){return t[0]===e[0]&&t[1]===e[1]}for(var r=[].concat(t),n=r.length-1;n>=1;n--)e(r[n],r[n-1])&&r.splice(n,1);return e(r[0],r[r.length-1])&&r.splice(r.length-1,1),r}},{key:"getCoordinatesCenter",value:function(t){for(var e=0,r=0,n=0,i=0,o=t.length;i0?this.convertFastToPixelPoints(t):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}},{key:"convertFastToPixelPoints",value:function(t){var e,r,n,i,o,a,s,u=[],l=t.getEast()-t.getWest(),c=t.getNorth()-t.getSouth(),f=this.mapElement;i=l/f.width>c/f.height?l/f.width:c/f.height,this.useRadius=this.useGeoUnit?parseInt(this.radius/i):this.radius;for(var h=0;h0&&this.maxWidth>0))return!1;var r=this.canvasContext;r.setTransform(1,0,0,1,0,0),this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;nt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.options;(t=t||{}).strokeStyle=Object.assign({},vp,t.strokeStyle||{}),t.lngLabelStyle=Object.assign({},yp,t.lngLabelStyle||{}),t.latLabelStyle=Object.assign({},yp,t.latLabelStyle||{}),this.options=Object.assign({},gp,t,{extent:this.getDefaultExtent(t.extent),wrapX:t.wrapX}),this.oldExtent=this.options.extent,this._calcInterval(),this.isRotate=!1,this.visible=this.options.visible,this.features=this._getGraticuleFeatures()}},{key:"_createCanvas",value:function(){if(!this.canvas){var t=this.mapElement;this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var e=("undefined"==typeof window?{}:window).devicePixelRatio||1;this.canvas.width=parseInt(t.style.width)*e,this.canvas.height=parseInt(t.style.height)*e,this.canvas.style.width=t.style.width,this.canvas.style.height=t.style.height,this.canvas.globalAlpha=this.options.opacity,this.targetElement.appendChild(this.canvas)}}},{key:"_drawCanvas",value:function(){this.canvas||this._createCanvas(),this.setVisibility(),this._reset()}},{key:"_resizeCallback",value:function(){this.targetElement&&this.targetElement.removeChild(this.canvas),this.canvas=null,this._drawCanvas()}},{key:"_reset",value:function(){this._updateRotate(),this._updateExtent(),this._calcInterval(),this._drawLabel()}},{key:"_updateRotate",value:function(){var t=this.getMapStateByKey("getBearing");this.isRotate=t>-180&&t<=-90||t>=90&&t<180}},{key:"_updateExtent",value:function(){if(this.options.wrapX&&!this.oldExtent){var t=this.getMapStateByKey("getBounds"),e=t._ne,r=t._sw;this.options.extent=[r.lng,r.lat,e.lng,e.lat]}}},{key:"_calcInterval",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.interval;"function"==typeof t?(t=t(this.map),this._currLngInterval=t,this._currLatInterval=t):(this._currLngInterval=t,this._currLatInterval=t)}},{key:"_formatLat",value:function(t){return this.options.latFormatTickLabel?this.options.latLabelFormatter(t):t<0?sf(-1*t)+"S":t>0?sf(t)+"N":""+sf(t)}},{key:"_formatLng",value:function(t){return this.options.lngLabelFormatter?this.options.lngLabelFormatter(t):(t=af(t))>0&&t<=180?sf(t)+"E":t<0&&t>=-180?sf(-1*t)+"W":""+sf(t)}},{key:"_parsePxToInt",value:function(t){t.length>2&&"p"===t.charAt(t.length-2)&&(t=t.substr(0,t.length-2));try{return parseInt(t,10)}catch(t){console.log(t)}return 0}},{key:"_drawLabel",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.visible,r=this.canvas,n=r.getContext("2d");if(e&&this.options.showLabel){if(this.mapElement){this._currLngInterval&&this._currLatInterval||this._calcInterval(),n.clearRect(0,0,r.width,r.height);var i=this.options,o=i.lngLabelStyle,a=i.latLabelStyle,s=this._getGridiculePoints(),u=s.lngPoints,l=s.latPonits;u.forEach(function(e){t._drawLng(n,e[0],e[1],e[2],o)}),l.forEach(function(e){t._drawLat(n,e[0],e[1],e[2],a)})}}else n.clearRect(0,0,r.width,r.height)}},{key:"_drawLat",value:function(t,e,r,n,i){t=this._setLabelStyle(t,i);var o=this.canvas.width,a=12;try{var s=t.font.split(" ")[0];a=this._parsePxToInt(s)}catch(t){console.log(t)}if(!n){var u=e;e=r,r=this.getMapStateByKey("project",[u,e])}var l=this._formatLat(e),c=t.measureText(l).width;t.strokeText(l,(n?o:r.x)-c,(n?r:r.y)+a/2),t.fillText(l,(n?o:r.x)-c,(n?r:r.y)+a/2)}},{key:"_drawLng",value:function(t,e,r,n,i){t=this._setLabelStyle(t,i);var o=this.canvas.height;if(!n){var a=r;r=this.getMapStateByKey("project",[e,a])}var s=this._formatLng(e),u=t.measureText(s).width;t.strokeText(s,(n?r:r.x)-u/2,n?o:r.y),t.fillText(s,(n?r:r.x)-u/2,n?o:r.y)}},{key:"_getLatPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-180,180],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(i){if(this.options.wrapX&&-180===e[0]&&180===e[1])return[];var o=[];return i.forEach(function(i){var a=i.geometry.coordinates[0][1];if(i.geometry.coordinates[1][1]===a){var s="number"==typeof n?n:e[1];t.isRotate&&(s="number"==typeof r?r:e[0]),t.options.wrapX&&(o=o.concat(t._getWrapPoints(s,a,[s,s]))),o.push([s,a])}}),o}}},{key:"_getLngPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-90,90],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(i){var o="number"==typeof r?r:e[0];this.isRotate&&(o="number"==typeof n?n:e[1]);var a=[];return i.forEach(function(e){var r=e.geometry.coordinates[0][0];e.geometry.coordinates[1][0]===r&&(a.push([r,o]),t.options.wrapX&&(a=a.concat(t._getWrapPoints(r,o))))}),a}}},{key:"_getWrapPoints",value:function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.oldExtent,n=[],i=this.getMapStateByKey("getBounds"),o=i._ne,a=i._sw,s=r.length>2?r[2]:r[1];t>=a.lng;){var u=af(t,180===s,-180===r[0]);(!r||u>=r[0]&&u<=s)&&n.push([t,e]),t-=360}for(;t<=o.lng;){var l=af(t,180===s,-180===r[0]);(!r||l>=r[0]&&l<=s)&&n.push([t,e]),t+=360}return n}},{key:"_getGridiculePoints",value:function(){var t=this._getEdgeLat(),e=this._getEdgeLng(),r=this._getRange(),n=r.latRange,i=r.lngRange,o=r.firstLat,a=r.firstLng,s=r.lastLat,u=r.lastLng;return{latPonits:this._getUniquePoint(this._getLatPoints(i,a,u),t,1),lngPoints:this._getUniquePoint(this._getLngPoints(n,o,s),e,0)}}},{key:"_getEdgeLat",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLatInterval,r=[],n=[],i=this.canvas.width,o=this.canvas.height,a=this._getRange().extent,s=this.getMapStateByKey("getBounds")._ne;if(this.options.wrapX&&af(s.lng)>a[2])return[];for(var u=this._countDecimals(e),l=0;l<=o;l++){var c=this.getMapStateByKey("unproject",[i,l]),f=af(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lat,l]),n.push(c.lat),void 0===t&&c.lat.toFixed(u)%e==0&&(t=Number(c.lat.toFixed(u))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,d=h.last,y=h.coordinates,v=h.points;t=Math.min(Math.max(p,-90),90);var g=Math.max(Math.min(Math.round(d),90),-90);return-90!==t||-90!==g?this._getClosestCoordinate(t,g,y,v,e):[]}},{key:"_getEdgeLng",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLngInterval,r=[],n=[],i=this.canvas.width,o=this.canvas.height,a=this.options.extent,s=this._countDecimals(e),u=this.getMapStateByKey("getBounds")._sw;if(this.options.wrapX&&af(u.lat)>a[3])return[];for(var l=0;l<=i;l++){var c=this.getMapStateByKey("unproject",[l,o]),f=af(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lng,l]),n.push(c.lng),void 0===t&&c.lng.toFixed(s)%e==0&&(t=Number(c.lng.toFixed(s))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,d=h.last,y=h.coordinates,v=h.points;return t=p,this._getClosestCoordinate(t,d,y,v,e)}},{key:"_getIntersectRange",value:function(t,e,r,n){var i=e[e.length-1];if(t>i){i=t,e.reverse(),r.reverse();for(var o=this._countDecimals(n),a=0;a<=e.length;a++){var s=e[a];if(s.toFixed(o)%n==0){t=Number(s.toFixed(o));break}}}return{first:t,last:i,coordinates:e,points:r}}},{key:"_getClosestCoordinate",value:function(t,e,r,n,i){for(var o=[],a=t;a<=e;){var s=this._getClosestNumberIndex(a,r),u=n[s];o.push([Math.round(u[0]),u[1],!0]),a+=i,r=r.slice(s),n=n.slice(s)}return o}},{key:"_getClosestNumberIndex",value:function(t,e){for(var r=0,n=Number.MAX_VALUE,i=0;i2&&void 0!==arguments[2]?arguments[2]:0;if(this.options.wrapX)return t.concat(e);if(!e||0===e.length)return t;var n=e,i=this.canvas.width,o=this.canvas.height;for(var a in t){var s=this.getMapStateByKey("project",t[a]),u=n.findIndex(function(e){return e[0]===t[a][r]});u<=-1?n.push(t[a]):s&&s.x>=0&&s.x<=i&&s.y>=0&&s.y<=o&&(n[u]=t[a])}return n}},{key:"_countDecimals",value:function(t){return Math.floor(t)!==t&&t.toString().split(".")[1].length||0}},{key:"_getGraticuleFeatures",value:function(){var t=this._currLngInterval||10,e=this._currLatInterval||10,r=[],n=this._getRange(),i=n.latRange,o=n.lngRange,a=n.firstLat,s=n.firstLng,u=n.lastLat,l=n.lastLng;this.options.wrapX&&!this.oldExtent&&(i=[-90,90],o=[-180,180],a=s=u=l=null),"number"==typeof s&&r.unshift(this._makeLineFeature(this._makeLineCoords(s,i,a,u))),"number"==typeof l&&r.unshift(this._makeLineFeature(this._makeLineCoords(l,i,a,u)));for(var c=o[0];c<=o[1];c+=t)r.unshift(this._makeLineFeature(this._makeLineCoords(c,i,a,u)));"number"==typeof a&&r.unshift(this._makeLineFeature(this._makeLineCoords(a,o,s,l,"lat"))),"number"==typeof u&&r.unshift(this._makeLineFeature(this._makeLineCoords(u,o,s,l,"lat")));for(var f=i[0];f<=i[1];f+=e)r.unshift(this._makeLineFeature(this._makeLineCoords(f,o,s,l,"lat")));return r}},{key:"_getRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.extent&&fp(this.options.extent);t&&0!==t.length||(t=this.getDefaultExtent());var e={};if((t=t.map(function(t){return Number(t.toFixed(6))}))[1]%this._currLatInterval!=0){e.firstLat=t[1];var r=Math.ceil(t[1]/this._currLatInterval);t[1]=r*this._currLatInterval}if(t[3]%this._currLatInterval!=0){e.lastLat=t[3];var n=Math.floor(t[3]/this._currLatInterval);t[3]=n*this._currLatInterval}if(t[0]%this._currLngInterval!=0){e.firstLng=t[0];var i=Math.ceil(t[0]/this._currLngInterval);t[0]=i*this._currLngInterval}if(t[2]%this._currLngInterval!=0){e.lastLng=t[2];var o=Math.floor(t[2]/this._currLngInterval);t[2]=o*this._currLngInterval}return Object.assign({latRange:[t[1],t[3]],lngRange:[t[0],t[2]],extent:t},e)}},{key:"_makeLineCoords",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[-90,90],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"lng";t="lng"===i?this._lngFix(t):t,r="number"==typeof r?r:e[0],n="number"==typeof n?n:e[1];for(var o=Math.abs(r-n),a=[],s=r;s<=n;s+=o)"lng"===i?a.push([t,s]):a.push([s,t]);return a}},{key:"_makeLineFeature",value:function(t){return{type:"Feature",geometry:{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"LineString",coordinates:t}}}},{key:"_lngFix",value:function(t){return t>=180?180:t<=-180?-180:t}},{key:"_transformStrokeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.strokeStyle;if(!t||"string"==typeof t)return{paint:{"line-color":t||"rgba(0,0,0,0.2)"}};var e={visibility:this.visible?"visible":"none","line-join":t.lineJoin||"round","line-cap":t.lineCap||"round"},r={"line-color":t.lineColor||"rgba(0,0,0,0.2)","line-width":t.lineWidth||1,"line-offset":t.lineDashOffset||0,"line-translate-anchor":"viewport"};return t.lineWidth&&("function"==typeof t.lineWidth?r["line-width"]=t.lineWidth(this.map):r["line-width"]=t.lineWidth),t.lindDasharray&&("function"==typeof t.lindDasharray?r["line-dasharray"]=t.lindDasharray(this.map):r["line-dasharray"]=t.lindDasharray),{layout:e,paint:r}}},{key:"_setLabelStyle",value:function(t,e){return e.textColor&&(t.fillStyle=e.textColor),e.textSize&&(t.font=e.textSize+" "+(e.textFont||["Calibri","sans-serif"]).join(",")),e.textHaloColor&&(t.strokeStyle=e.textHaloColor,t.lineWidth=e.textHaloWidth||1),e.textAnchor&&(t.textBaseline=this._getTxetBaseline(e.textAnchor),t.textAligin=this._getTxetAlign(e.textAligin)),t}},{key:"_getTxetBaseline",value:function(t){if(!t)return"bottom";var e=t.split("-");return e.includes("bottom")?"bottom":e.includes("top")?"top":e.includes("center")?"middle":void 0}},{key:"_getTxetAlign",value:function(t){if(!t)return"center";var e=t.split("-");return e.includes("left")?"left":e.includes("right")?"right":e.includes("center")?"center":void 0}}])&&pp(e.prototype,r),n&&pp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function bp(t){"@babel/helpers - typeof";return(bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xp(t,e){for(var r=0;r=this.options.minZoom&&e<=this.options.maxZoom,this.renderer&&(this.renderer.visible=this.visible),this.map.getLayer(this.sourceId)&&this.map.setLayoutProperty(this.sourceId,"visibility",this.visible?"visible":"none"),this.renderer&&this.renderer._drawLabel()}},{key:"setMinZoom",value:function(t){this.options.minZoom=t,this.setVisibility()}},{key:"setMaxZoom",value:function(t){this.options.maxZoom=t,this.setVisibility()}},{key:"setShowLabel",value:function(t){this.options.showLabel=t,this.renderer._drawLabel()}},{key:"setExtent",value:function(t){this.options.extent=this.getDefaultExtent(t,this.map),this.updateGraticuleLayer(),this.renderer._drawLabel()}},{key:"setStrokeStyle",value:function(t){if(this.map&&this.map.getLayer(this.sourceId)){this.options.strokeStyle=t;var e=this.renderer._transformStrokeStyle(t),r=e.layout,n=e.paint;for(var i in r)this.map.setLayoutProperty(this.sourceId,i,r[i]);for(var o in n)this.map.setPaintProperty(this.sourceId,o,n[o])}}},{key:"setLngLabelStyle",value:function(t){this.options.lngLabelStyle=t,this.renderer._drawLabel()}},{key:"setLatLabelStyle",value:function(t){this.options.latLabelStyle=t,this.renderer._drawLabel()}},{key:"setIntervals",value:function(t){this.renderer&&this.renderer.setIntervals(t)}},{key:"getDefaultExtent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.map,r=(e.getCRS&&e.getCRS()||{}).extent;if(r||(r=[-180,-85.05119,180,85.05119]),!t||0===t.length)return r;var n=O().LngLatBounds.convert(t),i=n._sw,o=n._ne;return t=[i.lng,i.lat,o.lng,o.lat],t=[Math.max(r[0],t[0]),Math.max(r[1],t[1]),Math.min(r[2],t[2]),Math.min(r[3],t[3])]}},{key:"addGraticuleLayer",value:function(){if(!this.map.getSource(this.sourceId)){var t={type:"geojson",data:{type:"FeatureCollection",features:this.renderer.features}};this.map.addSource(this.sourceId,t)}if(!this.map.getLayer(this.sourceId)){var e=Object.assign({id:this.sourceId,type:"line",source:this.sourceId},this.renderer._transformStrokeStyle());this.map.addLayer(e)}}},{key:"_getLatPoints",value:function(t,e,r,n){return this.renderer._getLatPoints(t,e,r,n)}},{key:"_bindEvent",value:function(){this.map.on("styledata",this.styleDataEevent),this.map.on("resize",this.resizeEvent),this.map.on("zoomend",this.zoomendEvent)}},{key:"_unbindEvent",value:function(){this.map.off("styledata",this.styleDataEevent),this.map.off("resize",this.resizeEvent),this.map.off("zoomend",this.zoomendEvent)}},{key:"_setLayerTop",value:function(){var t=this,e=this.map;if(e){var r=e.getStyle&&e.getStyle().layers;r&&r.length&&r.findIndex(function(e){return e.id===t.sourceId})!==r.length-1&&e.getLayer(this.sourceId)&&(e.removeLayer(this.sourceId),this.addGraticuleLayer())}}},{key:"updateGraticuleLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.features;if(this.map.getSource(this.sourceId)){var e={type:"FeatureCollection",features:t};this.map.getSource(this.sourceId).setData(e)}this.addGraticuleLayer()}}])&&xp(e.prototype,r),n&&xp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(_p||(_p={}));var Cp,Op=new Int32Array(2),Ap=new Float32Array(Op.buffer),Pp=new Float64Array(Op.buffer),Mp=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];function Ip(t){"@babel/helpers - typeof";return(Ip="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lp(t,e){for(var r=0;r>24}},{key:"readUint8",value:function(t){return this.bytes_[t]}},{key:"readInt16",value:function(t){return this.readUint16(t)<<16>>16}},{key:"readUint16",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8}},{key:"readInt32",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}},{key:"readUint32",value:function(t){return this.readInt32(t)>>>0}},{key:"readInt64",value:function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}},{key:"writeUint16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeInt32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeUint32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeInt64",value:function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}},{key:"writeUint64",value:function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}},{key:"writeFloat32",value:function(t,e){Ap[0]=e,this.writeInt32(t,Op[0])}},{key:"writeFloat64",value:function(t,e){Pp[0]=e,this.writeInt32(t,Op[Mp?0:1]),this.writeInt32(t+4,Op[Mp?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length=0;r--)t.addInt32(e[r]);return t.endVector()}},{key:"startEndsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addXy",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"createXyVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startXyVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addZ",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createZVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startZVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addM",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"createMVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startMVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addT",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"createTVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startTVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addTm",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"createTmVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}},{key:"startTmVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addType",value:function(t,e){t.addFieldInt8(6,e,_p.Unknown)}},{key:"addParts",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createPartsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startPartsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endGeometry",value:function(t){return t.endObject()}},{key:"createGeometry",value:function(e,r,n,i,o,a,s,u,l){return t.startGeometry(e),t.addEnds(e,r),t.addXy(e,n),t.addZ(e,i),t.addM(e,o),t.addT(e,a),t.addTm(e,s),t.addType(e,u),t.addParts(e,l),t.endGeometry(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"ends",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}},{key:"endsLength",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"endsArray",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"xy",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"xyLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"xyArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"z",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"zLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"zArray",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"m",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"mLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"mArray",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"t",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"tLength",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"tArray",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"tm",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):BigInt(0)}},{key:"tmLength",value:function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"type",value:function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):_p.Unknown}},{key:"parts",value:function(e,r){var n=this.bb.__offset(this.bb_pos,18);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}},{key:"partsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&Dp(e.prototype,r),n&&Dp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Up(t,e){for(var r=[],n=0;n>1]),r.push(i)}return r}function Gp(t,e,r){if(!r||0===r.length)return[Up(t,e)];var n,i=0,o=Array.from(r).map(function(e){return t.slice(i,i=e<<1)});return e&&(i=0,n=Array.from(r).map(function(t){return e.slice(i,i=t)})),o.map(function(t,e){return Up(t,n?n[e]:void 0)})}function Vp(t,e){var r=e;if(r===_p.Unknown&&(r=t.type()),r===_p.GeometryCollection){for(var n=[],i=0;i=0;r--)t.addInt8(e[r]);return t.endVector()}},{key:"startPropertiesVector",value:function(t,e){t.startVector(1,e,1)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endFeature",value:function(t){return t.endObject()}},{key:"finishFeatureBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedFeatureBuffer",value:function(t,e){t.finish(e,void 0,!0)}},{key:"createFeature",value:function(e,r,n,i){return t.startFeature(e),t.addGeometry(e,r),t.addProperties(e,n),t.addColumns(e,i),t.endFeature(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"geometry",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new zp).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"properties",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}},{key:"propertiesLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"propertiesArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new Yp).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&Zp(e.prototype,r),n&&Zp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Qp=(new TextEncoder,new TextDecoder);function $p(t,e){var r={};if(!e||0===e.length)return r;var n=t.propertiesArray();if(!n)return r;for(var i=new DataView(n.buffer,n.byteOffset),o=t.propertiesLength(),a=0;a0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:function(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}(e,r.value)}})},rd.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(o){return o.done?(e._array=ed,e._index=0,r>0?n.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,n.set(o.value.subarray(0,t-r),r),n):(n.set(o.value,r),r+=o.value.length,i())})}()},rd.prototype.cancel=function(){return this._source.cancel()};var ad=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bb=null,this.bb_pos=0}var e,r,n;return e=t,n=[{key:"getRootAsCrs",value:function(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"getSizePrefixedRootAsCrs",value:function(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startCrs",value:function(t){t.startObject(6)}},{key:"addOrg",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addCode",value:function(t,e){t.addFieldInt32(1,e,0)}},{key:"addName",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"addWkt",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"addCodeString",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"endCrs",value:function(t){return t.endObject()}},{key:"createCrs",value:function(e,r,n,i,o,a,s){return t.startCrs(e),t.addOrg(e,r),t.addCode(e,n),t.addName(e,i),t.addDescription(e,o),t.addWkt(e,a),t.addCodeString(e,s),t.endCrs(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"org",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"code",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"wkt",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"codeString",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&id(e.prototype,r),n&&id(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function sd(t){"@babel/helpers - typeof";return(sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ud(t,e){for(var r=0;r=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startEnvelopeVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addGeometryType",value:function(t,e){t.addFieldInt8(2,e,_p.Unknown)}},{key:"addHasZ",value:function(t,e){t.addFieldInt8(3,+e,0)}},{key:"addHasM",value:function(t,e){t.addFieldInt8(4,+e,0)}},{key:"addHasT",value:function(t,e){t.addFieldInt8(5,+e,0)}},{key:"addHasTm",value:function(t,e){t.addFieldInt8(6,+e,0)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addFeaturesCount",value:function(t,e){t.addFieldInt64(8,e,BigInt("0"))}},{key:"addIndexNodeSize",value:function(t,e){t.addFieldInt16(9,e,16)}},{key:"addCrs",value:function(t,e){t.addFieldOffset(10,e,0)}},{key:"addTitle",value:function(t,e){t.addFieldOffset(11,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(12,e,0)}},{key:"addMetadata",value:function(t,e){t.addFieldOffset(13,e,0)}},{key:"endHeader",value:function(t){return t.endObject()}},{key:"finishHeaderBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedHeaderBuffer",value:function(t,e){t.finish(e,void 0,!0)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"envelope",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"envelopeLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"envelopeArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"geometryType",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):_p.Unknown}},{key:"hasZ",value:function(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasM",value:function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasT",value:function(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasTm",value:function(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new Yp).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"featuresCount",value:function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt("0")}},{key:"indexNodeSize",value:function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}},{key:"crs",value:function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new ad).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"title",value:function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"metadata",value:function(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&ud(e.prototype,r),n&&ud(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fd(t){for(var e=cd.getRootAsHeader(t),r=e.featuresCount(),n=e.indexNodeSize(),i=[],o=0;o0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vd(t){return this instanceof vd?(this.v=t,this):new vd(t)}function gd(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){i[t]&&(n[t]=function(e){return new Promise(function(r,n){o.push([t,e,r,n])>1||s(t,e)})})}function s(t,e){try{(r=i[t](e)).value instanceof vd?Promise.resolve(r.value.v).then(u,l):c(o[0][2],r)}catch(t){c(o[0][3],t)}var r}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}var md=function(t){function e(e){var r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(t,e){function r(){this.constructor=t}hd(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Error);(function(){function t(t){if(t<0)throw new RangeError("Capacity may not be less than 0");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){if(this.full)throw new Error("Buffer full");this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}})(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){for(;this._q.length>=this._c;)this._q.shift();this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}}(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){this._q.length=Sd;return Promise.resolve(e).then(function(e){return!r&&t.state>=Ed?Cd(t).then(function(t){return{value:t,done:!0}}):{value:e,done:r}})}function Ad(t,e){var r,n;if(!(t.state>=_d))if(t.state=_d,t.onnext(),t.onstop(),null==t.err&&(t.err=e),0!==t.pushes.length||void 0!==t.buffer&&!t.buffer.empty)try{for(var i=yd(t.pushes),o=i.next();!o.done;o=i.next()){o.value.resolve()}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}else Pd(t)}function Pd(t){var e,r;if(!(t.state>=Sd)){t.state<_d&&Ad(t),t.state=Sd,t.buffer=void 0;try{for(var n=yd(t.nexts),i=n.next();!i.done;i=n.next()){var o=i.value,a=void 0===t.pending?Cd(t):t.pending.then(function(){return Cd(t)});o.resolve(Od(t,a))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t.pushes=[],t.nexts=[]}}function Md(t){t.state>=Ed||(t.state=wd)){t.state=wd;var e=function(t,e){if(bd(e),t.pushes.length>=kd)throw new md("No more than "+kd+" pending calls to push are allowed on a single repeater.");if(t.state>=_d)return Promise.resolve(void 0);var r,n=void 0===t.pending?Promise.resolve(e):t.pending.then(function(){return e});n=n.catch(function(e){t.state<_d&&(t.err=e),Md(t)}),t.nexts.length?(t.nexts.shift().resolve(Od(t,n)),r=t.nexts.length?Promise.resolve(t.nexts[0].value):new Promise(function(e){return t.onnext=e})):void 0===t.buffer||t.buffer.full?r=new Promise(function(e){return t.pushes.push({resolve:e,value:n})}):(t.buffer.add(n),r=Promise.resolve(void 0));var i=!0,o={},a=r.catch(function(t){if(i)throw t});return o.then=function(t,e){return i=!1,Promise.prototype.then.call(r,t,e)},o.catch=function(t){return i=!1,Promise.prototype.catch.call(r,t)},o.finally=r.finally.bind(r),t.pending=n.then(function(){return a}).catch(function(e){t.err=e,Md(t)}),o}.bind(null,t),r=function(t){var e=Ad.bind(null,t),r=new Promise(function(e){return t.onstop=e});return e.then=r.then.bind(r),e.catch=r.catch.bind(r),e.finally=r.finally.bind(r),e}(t);t.execution=new Promise(function(n){return n(t.executor(e,r))}),t.execution.catch(function(){return Ad(t)})}}var Ld=new WeakMap,jd=function(){function t(t,e){Ld.set(this,{executor:t,buffer:e,err:void 0,state:xd,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:Td,onstop:Td})}return t.prototype.next=function(t){bd(t);var e=Ld.get(this);if(void 0===e)throw new Error("WeakMap error");if(e.nexts.length>=kd)throw new md("No more than "+kd+" pending calls to next are allowed on a single repeater.");if(e.state<=xd&&Id(e),e.onnext(t),void 0!==e.buffer&&!e.buffer.empty){var r=Od(e,e.buffer.remove());if(e.pushes.length){var n=e.pushes.shift();e.buffer.add(n.value),e.onnext=n.resolve}return r}if(e.pushes.length){var i=e.pushes.shift();return e.onnext=i.resolve,Od(e,i.value)}return e.state>=_d?(Pd(e),Od(e,Cd(e))):new Promise(function(r){return e.nexts.push({resolve:r,value:t})})},t.prototype.return=function(t){bd(t);var e=Ld.get(this);if(void 0===e)throw new Error("WeakMap error");return Pd(e),e.execution=Promise.resolve(e.execution).then(function(){return t}),Od(e,Cd(e))},t.prototype.throw=function(t){var e=Ld.get(this);if(void 0===e)throw new Error("WeakMap error");return e.state<=xd||e.state>=_d||void 0!==e.buffer&&!e.buffer.empty?(Pd(e),null==e.err&&(e.err=t),Od(e,Cd(e))):this.next(Promise.reject(t))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=Rd,t.merge=Dd,t.zip=Bd,t.latest=Fd,t}();function Nd(t,e){var r,n,i=[],o=function(t){null!=t&&"function"==typeof t[Symbol.asyncIterator]?i.push(t[Symbol.asyncIterator]()):null!=t&&"function"==typeof t[Symbol.iterator]?i.push(t[Symbol.iterator]()):i.push(function(){return gd(this,arguments,function(){return dd(this,function(r){switch(r.label){case 0:return e.yieldValues?[4,vd(t)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return e.returnValues?[4,vd(t)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=yd(t),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function Rd(t){var e=this,r=Nd(t,{returnValues:!0});return new jd(function(t,n){return pd(e,void 0,void 0,function(){var e,i,o,a,s,u;return dd(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2];i=!1,n.then(function(){e(),i=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),a=void 0,s=0,u=function(){var i,u,l,c,f,h;return dd(this,function(p){switch(p.label){case 0:i=s;try{for(f=void 0,u=yd(r),l=u.next();!l.done;l=u.next())c=l.value,Promise.resolve(c.next()).then(function(t){t.done?(n(),void 0===o&&(o=t)):s===i&&(s++,e(t))},function(t){return n(t)})}catch(t){f={error:t}}finally{try{l&&!l.done&&(h=u.return)&&h.call(u)}finally{if(f)throw f.error}}return[4,new Promise(function(t){return e=t})];case 1:return void 0===(a=p.sent())?[3,3]:[4,t(a.value)];case 2:p.sent(),p.label=3;case 3:return[2]}})},l.label=2;case 2:return i?[3,4]:[5,u()];case 3:return l.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return n(),[4,Promise.race(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function Dd(t){var e=this,r=Nd(t,{yieldValues:!0});return new jd(function(t,n){return pd(e,void 0,void 0,function(){var e,i,o,a=this;return dd(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2];e=[],i=!1,n.then(function(){var t,r;i=!0;try{for(var n=yd(e),o=n.next();!o.done;o=n.next()){(0,o.value)()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,s){return pd(a,void 0,void 0,function(){var a;return dd(this,function(u){switch(u.label){case 0:u.trys.push([0,,6,9]),u.label=1;case 1:return i?[3,5]:(Promise.resolve(r.next()).then(function(t){return e[s](t)},function(t){return n(t)}),[4,new Promise(function(t){e[s]=t})]);case 2:return void 0===(a=u.sent())?[3,4]:a.done?(o=a,[2]):[4,t(a.value)];case 3:u.sent(),u.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return s.sent(),[2,o&&o.value];case 3:return n(),[7];case 4:return[2]}})})})}function Bd(t){var e=this,r=Nd(t,{returnValues:!0});return new jd(function(t,n){return pd(e,void 0,void 0,function(){var e,i,o,a;return dd(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2,[]];i=!1,n.then(function(){e(),i=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return i?[3,5]:(Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})]);case 3:return void 0===(o=s.sent())?[2]:(a=o.map(function(t){return t.value}),o.some(function(t){return t.done})?[2,a]:[4,t(a)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function Fd(t){var e=this,r=Nd(t,{yieldValues:!0,returnValues:!0});return new jd(function(t,n){return pd(e,void 0,void 0,function(){var e,i,o,a,s,u=this;return dd(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2,[]];i=[],o=!1,n.then(function(){var t,r;e();try{for(var n=yd(i),a=n.next();!a.done;a=n.next()){(0,a.value)()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}o=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})];case 2:return void 0===(a=l.sent())?[2]:(s=a.map(function(t){return t.value}),a.every(function(t){return t.done})?[2,s]:[4,t(s.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(e,r){return pd(u,void 0,void 0,function(){var u;return dd(this,function(l){switch(l.label){case 0:if(a[r].done)return[2,a[r].value];l.label=1;case 1:return o?[3,4]:(Promise.resolve(e.next()).then(function(t){return i[r](t)},function(t){return n(t)}),[4,new Promise(function(t){return i[r]=t})]);case 2:return void 0===(u=l.sent())?[2,a[r].value]:u.done?[2,u.value]:(s[r]=u.value,[4,t(s.slice())]);case 3:return l.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function zd(t){"@babel/helpers - typeof";return(zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ud(t,e){for(var r=0;rt)){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function $d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ty(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ty(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ty(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rthis.nodes[1]),this.nodes[1]=t}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&ry(e.prototype,r),n&&ry(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),a=n.minX,s=n.minY,u=n.maxX,l=n.maxY,Kd.info("tree items: ".concat(e,", nodeSize: ").concat(r)),c=uy(e,r),f=c[0][0],void 0,y=c.length-1,h=new o([0,1],y),p=[h],Kd.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(e,", nodeSize: ").concat(r,", levelBounds: ").concat(c)),d=Qd().mark(function t(){var n,h,d,y,v,g,m,b,x;return Qd().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=p.shift(),Kd.debug("popped node: ".concat(n,", queueLength: ").concat(p.length)),h=n.startNodeIdx(),d=h>=f,y=function(){var t=$d(c[n.level()],2)[1],e=Math.min(n.endNodeIdx()+r,t);return d&&em.getFloat64(c+16,!0))){t.next=8;break}return t.abrupt("return",0);case 8:if(!(s>m.getFloat64(c+24,!0))){t.next=10;break}return t.abrupt("return",0);case 10:if(y=m.getBigUint64(c+32,!0),!d){t.next=18;break}return v=y,g=function(){if(r ").concat(x)),_.extendEndNodeIdx(Number(x)),t.abrupt("return",0);case 25:void 0,void 0,E=n.level()-1,k=[Number(x),Number(x)+1],S=new o(k,E),void 0!==_&&_.level()==S.level()?Kd.info("Same level, but too far away. Pushing new request for nodeIdx: ".concat(x," rather than merging with distant ").concat(_)):Kd.info("Pushing new level for ".concat(S," onto queue with nearestNodeRange: ").concat(_," since there's not already a range for this level.")),p.push(S);case 28:case"end":return t.stop()}var E,k},t)}),x=h;case 12:if(!(x=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function yy(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||vy(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vy(t,e){if(t){if("string"==typeof t)return gy(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gy(t,e):void 0}}function gy(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function by(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function xy(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){by(o,n,i,a,s,"next",t)}function s(t){by(o,n,i,a,s,"throw",t)}a(void 0)})}}function wy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _y(t,e){for(var r=0;rWd.global.extraRequestThreshold()&&(Kd.info("Pushing new feature batch, since gap ".concat(b," was too large")),a.push(s),s=[]),s.push([y,g]);case 23:u=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),l=!0,c=r.t0;case 32:if(r.prev=32,r.prev=33,!u||null==f.return){r.next=37;break}return r.next=37,Cy(f.return());case 37:if(r.prev=37,!l){r.next=40;break}throw c;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return e.headerClient.logUsage("header+index"),s.length>0&&a.push(s),x=a.flatMap(function(t){return e.readFeatureBatch(t,e.nocache)}),r.delegateYield(Oy(Py(jd.merge(x))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return fy.length+hy+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(t){return new Ly(this.headerClient.httpClient,t)}},{key:"readFeatureBatch",value:function(t,e){var r=this;return ky(my().mark(function n(){var i,o,a,s,u,l,c,f,h,p,d,y;return my().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:i=yy(t[0],1),o=i[0],a=yy(t[t.length-1],2),s=a[0],u=a[1],l=s+u-o,c=r.buildFeatureClient(e),f=l,h=dy(t),n.prev=8,h.s();case 10:if((p=h.n()).done){n.next=19;break}return d=yy(p.value,1),y=d[0],n.next=14,Cy(r.readFeature(c,y,f));case 14:return n.next=16,n.sent;case 16:f=0;case 17:n.next=10;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n.catch(8),h.e(n.t0);case 24:return n.prev=24,h.f(),n.finish(24);case 27:c.logUsage("feature");case 28:case"end":return n.stop()}},n,null,[[8,21,24,27]])}))()}},{key:"readFeature",value:function(){var t=xy(my().mark(function t(e,r,n){var i,o,a,s,u,l,c;return my().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=r+this.lengthBeforeFeatures(),t.next=3,e.getRange(i,4,n,"feature length");case 3:return a=t.sent,o=new DataView(a).getUint32(0,!0),t.next=7,e.getRange(i+4,o,n,"feature data");case 7:return s=t.sent,u=new Uint8Array(s),(l=new Uint8Array(o+hy)).set(u,hy),(c=new Np(l)).setPosition(hy),t.abrupt("return",Jp.getRootAsFeature(c));case 14:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}],[{key:"open",value:function(){var e=xy(my().mark(function e(r,n){var i,o,a,s,u,l,c,f,h,p,d;return my().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=2024,o=new Ly(r,n),a=function(){var t,e=0;for(t=0;t<3;t++){e+=Math.pow(16,t)*ay}return e}(),s=i+a,Kd.debug("fetching header. minReqLength: ".concat(s," (assumedHeaderLength: ").concat(i,", assumedIndexLength: ").concat(a,")")),e.t0=Uint8Array,e.next=8,o.getRange(0,8,s,"header");case 8:if(e.t1=e.sent,(u=new e.t0(e.t1)).subarray(0,3).every(function(t,e){return fy[e]===t})){e.next=13;break}throw Kd.error("bytes: ".concat(u," != ").concat(fy)),new Error("Not a FlatGeobuf file");case 13:return Kd.debug("magic bytes look good"),e.next=16,o.getRange(8,4,s,"header");case 16:if(c=e.sent,!((l=new DataView(c).getUint32(0,!0))>10485760||l<8)){e.next=21;break}throw new Error("Invalid header size");case 21:return Kd.debug("headerLength: ".concat(l)),e.next=24,o.getRange(12,l,s,"header");case 24:return f=e.sent,h=new Np(new Uint8Array(f)),p=fd(h),d=sy(p.featuresCount,p.indexNodeSize),Kd.debug("completed: opening http reader"),e.abrupt("return",new t(o,p,l,d,n));case 30:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()}]),t}(),Ly=function(){function t(e,r){if(wy(this,t),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,"string"==typeof e)this.httpClient=new jy(e,r);else{if(!(e instanceof jy))throw new Error("Unknown source ");this.httpClient=e}}return Sy(t,[{key:"getRange",value:function(){var t=xy(my().mark(function t(e,r,n,i){var o,a,s;return my().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.bytesEverUsed+=r,o=e-this.head,a=o+r,!(o>=0&&a<=this.buffer.byteLength)){t.next=5;break}return t.abrupt("return",this.buffer.slice(o,a));case 5:return s=Math.max(r,n),this.bytesEverFetched+=s,Kd.debug("requesting for new Range: ".concat(e,"-").concat(e+s-1)),t.next=10,this.httpClient.getRange(e,s,i);case 10:return this.buffer=t.sent,this.head=e,t.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return t.stop()}},t,this)}));return function(e,r,n,i){return t.apply(this,arguments)}}()},{key:"logUsage",value:function(t){var e=t.split(" ")[0],r=this.bytesEverUsed,n=this.bytesEverFetched,i=(100*r/n).toFixed(2);Kd.info("".concat(e," bytes used/requested: ").concat(r," / ").concat(n," = ").concat(i,"%"))}}]),t}(),jy=function(){function t(e,r){wy(this,t),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e,this.nocache=r}return Sy(t,[{key:"getRange",value:function(){var t=xy(my().mark(function t(e,r,n){var i,o,a;return my().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,i="bytes=".concat(e,"-").concat(e+r-1),Kd.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(n,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(i)),o={Range:i},this.nocache&&(o["Cache-Control"]="no-cache, no-store"),t.next=8,fetch(this.url,{headers:o});case 8:return a=t.sent,t.abrupt("return",a.arrayBuffer());case 10:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}]),t}();function Ny(t){"@babel/helpers - typeof";return(Ny="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ry(){Ry=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Ny(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Dy(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function By(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){Dy(o,n,i,a,s,"next",t)}function s(t){Dy(o,n,i,a,s,"throw",t)}a(void 0)})}}function Fy(t){var e,r,n,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new zy(e.call(t));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function zy(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(zy=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new zy(t)}function Uy(t){return new Hy(t,0)}function Gy(t){return function(){return new Vy(t.apply(this,arguments))}}function Vy(t){var e,r;function n(e,r){try{var o=t[e](r),a=o.value,s=a instanceof Hy;Promise.resolve(s?a.v:a).then(function(r){if(s){var u="return"===e?"return":"next";if(!a.k||r.done)return n(u,r);r=t[u](r).value}i(o.done?"return":"normal",r)},function(t){n("throw",t)})}catch(t){i("throw",t)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,i){return new Promise(function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,i))})},"function"!=typeof t.return&&(this.return=void 0)}function Hy(t,e){this.v=t,this.k=e}function Wy(){return(Wy=Gy(Ry().mark(function t(e,r,n){var i,o,a,s,u,l,c,f,h,p;return Ry().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i="function"==typeof(d=e).slice?d:new rd("function"==typeof d.read?d:d.getReader()),o=function(){var t=By(Ry().mark(function t(e){return Ry().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.slice(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),t.t0=Uint8Array,t.next=5,Uy(o(8,"magic bytes"));case 5:if(t.t1=t.sent,(a=new t.t0(t.t1)).subarray(0,3).every(function(t,e){return fy[e]===t})){t.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return t.t2=Uint8Array,t.next=12,Uy(o(4,"header length"));case 12:return t.t3=t.sent,a=new t.t2(t.t3),s=new Np(a),u=s.readUint32(0),t.t4=Uint8Array,t.next=19,Uy(o(u,"header data"));case 19:if(t.t5=t.sent,a=new t.t4(t.t5),s=new Np(a),l=fd(s),n&&n(l),c=l.indexNodeSize,f=l.featuresCount,!(c>0)){t.next=29;break}return h=sy(f,c),t.next=29,Uy(o(h,"entire index, w/o rect"));case 29:return t.next=31,Uy(Yy(o,l,r));case 31:if(!(p=t.sent)){t.next=36;break}return t.next=34,p;case 34:t.next=29;break;case 36:case"end":return t.stop()}var d},t)}))).apply(this,arguments)}function qy(){return(qy=Gy(function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Ry().mark(function o(){var a,s,u,l,c,f,h;return Ry().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Uy(Iy.open(t,i));case 2:a=o.sent,Kd.debug("opened reader"),n&&n(a.header),s=!1,u=!1,o.prev=7,c=Fy(a.selectBbox(e));case 9:return o.next=11,Uy(c.next());case 11:if(!(s=!(f=o.sent).done)){o.next=18;break}return h=f.value,o.next=15,r(h,a.header);case 15:s=!1,o.next=9;break;case 18:o.next=24;break;case 20:o.prev=20,o.t0=o.catch(7),u=!0,l=o.t0;case 24:if(o.prev=24,o.prev=25,!s||null==c.return){o.next=29;break}return o.next=29,Uy(c.return());case 29:if(o.prev=29,!u){o.next=32;break}throw l;case 32:return o.finish(29);case 33:return o.finish(24);case 34:case"end":return o.stop()}},o,null,[[7,20,24,34],[25,,29,33]])})()})).apply(this,arguments)}function Yy(t,e,r){return Xy.apply(this,arguments)}function Xy(){return(Xy=By(Ry().mark(function t(e,r,n){var i,o,a,s,u;return Ry().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,e(4,"feature length");case 3:if(t.t1=t.sent,0!==(i=new t.t0(t.t1)).byteLength){t.next=7;break}return t.abrupt("return");case 7:return o=new Np(i),a=o.readUint32(0),t.t2=Uint8Array,t.next=12,e(a,"feature data");case 12:return t.t3=t.sent,i=new t.t2(t.t3),(s=new Uint8Array(a+4)).set(i,4),(o=new Np(s)).setPosition(hy),u=Jp.getRootAsFeature(o),t.abrupt("return",n(u,r));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Zy(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,3).every(function(t,e){return fy[e]===t}))throw new Error("Not a FlatGeobuf file");var n=new Np(t),i=n.readUint32(fy.length);n.setPosition(fy.length+hy);var o=fd(n);r&&r(o);var a=fy.length+hy+i,s=o.indexNodeSize,u=o.featuresCount;s>0&&(a+=sy(u,s));for(var l=[];a3&&void 0!==arguments[3]&&arguments[3])}function Qy(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t instanceof Uint8Array?Zy(t,r):t instanceof ReadableStream?Ky(t,r):Jy(t,e,r,n)}Vy.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Vy.prototype.next=function(t){return this._invoke("next",t)},Vy.prototype.throw=function(t){return this._invoke("throw",t)},Vy.prototype.return=function(t){return this._invoke("return",t)};var $y=r(3861),tv=r.n($y);function ev(t){"@babel/helpers - typeof";return(ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rv(){rv=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==ev(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function nv(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function iv(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){nv(o,n,i,a,s,"next",t)}function s(t){nv(o,n,i,a,s,"throw",t)}a(void 0)})}}function ov(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:$.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.init()}var e,r,n;return e=t,(r=[{key:"init",value:function(){"bbox"===this.strategy&&(this.loadedExtentsRtree_=new(tv()))}},{key:"iterateFeatures",value:function(){var t=iv(rv().mark(function t(e){var r,n,i,o,a,s,u;return rv().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r={type:"FeatureCollection",features:[]},n=!1,i=!1,t.prev=3,a=sv(e);case 5:return t.next=7,a.next();case 7:if(!(n=!(s=t.sent).done)){t.next=15;break}u=s.value,this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.layerType||(this.layerType=lv[u.geometry.type]),r.features.push(u);case 12:n=!1,t.next=5;break;case 15:t.next=21;break;case 17:t.prev=17,t.t0=t.catch(3),i=!0,o=t.t0;case 21:if(t.prev=21,t.prev=22,!n||null==a.return){t.next=26;break}return t.next=26,a.return();case 26:if(t.prev=26,!i){t.next=29;break}throw o;case 29:return t.finish(26);case 30:return t.finish(21);case 31:return t.abrupt("return",r);case 32:case"end":return t.stop()}},t,this,[[3,17,21,31],[22,,26,30]])}));return function(e){return t.apply(this,arguments)}}()},{key:"_loadData",value:function(){var t=iv(rv().mark(function t(e){var r,n,i=this;return rv().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]},e.length){t.next=7;break}return t.next=4,this._getStream(this.url);case 4:r=t.sent,t.next=9;break;case 7:n.value={extent:e.slice()},this.loadedExtentsRtree_.insert(n);case 9:return t.next=11,Qy(r&&r.body||this.url,n,function(t){i.layerType=lv[t.geometryType]});case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_getStream",value:function(){var t=iv(rv().mark(function t(e){return rv().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ut.get(e,{},{withoutFormatSuffix:!0}).then(function(t){return t});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()},{key:"_containsExtent",value:function(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}},{key:"_getInExtent",value:function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.loadedExtentsRtree_.search(e).map(function(t){return t.value})}},{key:"_forEachInExtent",value:function(t,e){return this._forEach(this._getInExtent(t),e)}},{key:"_forEach",value:function(t,e){for(var r,n=0,i=t.length;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function pv(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function dv(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){pv(o,n,i,a,s,"next",t)}function s(t){pv(o,n,i,a,s,"throw",t)}a(void 0)})}}function yv(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:$.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.overlay=!0,this.type="custom",this.renderingMode="3d",this._updateFeaturesFn=this._updateFeatures.bind(this)}var e,r,n;return e=t,(r=[{key:"onAdd",value:function(t){this.map=t;var e,r,n,i=[];if("bbox"===this.strategy){var o=this.map.getBounds().toArray();i=[o[0][0],o[0][1],o[1][0],o[1][1]],this.map.on("moveend",this._updateFeaturesFn)}if(this.extent){var a=(e=this.extent,n=[],function(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}(e,r=i)&&(e[0]>r[0]?n[0]=e[0]:n[0]=r[0],e[1]>r[1]?n[1]=e[1]:n[1]=r[1],e[2]0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.url=e.url,this.layerId=e.id}var e,r,n;return e=t,(r=[{key:"_createVideoElement",value:function(){var t=document.createElement("video");t.id=this.layerId,t.className="video-js",t.style.position="fixed",t.style.left="-300%",t.setAttribute("crossorigin","anonymous"),document.body.appendChild(t)}},{key:"createVideo",value:function(){this._createVideoElement();var t=this._getVideoOptions();return this.video=xv()(this.layerId,t,function(){}),this.video}},{key:"_getVideoOptions",value:function(){if(this.url){var t={autoplay:!0,muted:!0};return t.loop=!1!==this.loop,this.url.includes("mp4")?t.sources=[{src:this.url,type:"video/mp4"}]:this.url.includes("flv")?t={autoplay:this.autoplay,techOrder:["html5","flvjs"],flvjs:{mediaDataSource:{isLive:!0,cors:!0,withCredentials:!1}},sources:[{src:this.url,type:"video/x-flv"}]}:this.url.includes("m3u8")&&(t.sources=[{src:this.url}]),t}}},{key:"getVideoDomId",value:function(){if(this.url){var t;if(this.url.includes("flv")){var e=document.querySelector("#".concat(this.layerId));t="".concat(this.layerId,"_flvjs_api"),e.style.position="fixed",e.style.left="-200%"}else t=this.video.el_.firstChild.id;return t}}}])&&_v(e.prototype,r),n&&_v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),kv=function(){try{return turf}catch(t){return{}}}();function Tv(t){"@babel/helpers - typeof";return(Tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cv(t,e){for(var r=0;r=this.text.length)return;t=this.text[this.place++]}switch(this.state){case ig:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},cg.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(ug.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},cg.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=ig)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=ig,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},cg.prototype.number=function(t){if(!lg.test(t)){if(ug.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},cg.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},cg.prototype.keyword=function(t){if(sg.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=ig)}if(!ug.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},cg.prototype.neutral=function(t){if(ag.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(lg.test(t))return this.word=t,void(this.state=3);if(!ug.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},cg.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=yg(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i}function gg(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?gg[t]=rg(arguments[1]):gg[t]=vg(arguments[1]):gg[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?gg.apply(e,t):gg(t)});if("string"==typeof t){if(t in gg)return gg[t]}else"EPSG"in t?gg["EPSG:"+t.EPSG]=t:"ESRI"in t?gg["ESRI:"+t.ESRI]=t:"IAU2000"in t?gg["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(gg);var mg=gg;var bg=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var xg=["3857","900913","3785","102113"];var wg=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in mg}(t))return mg[t];if(function(t){return bg.some(function(e){return t.indexOf(e)>-1})}(t)){var e=vg(t);if(function(t){var e=eg(t,"authority");if(e){var r=eg(e,"epsg");return r&&xg.indexOf(r)>-1}}(e))return mg["EPSG:3857"];var r=function(t){var e=eg(t,"extension");if(e)return eg(e,"proj4")}(e);return r?rg(r):e}return function(t){return"+"===t[0]}(t)?rg(t):void 0};function _g(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}function Sg(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}function Eg(t){return t<0?-1:1}function kg(t){return Math.abs(t)<=Jv?t:t-Eg(t)*Kv}function Tg(t,e,r){var n=t*r,i=.5*t;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(Gv-e))/n}function Cg(t,e){for(var r,n,i=.5*t,o=Gv-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(o),o+=n=Gv-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999}function Og(t){return t}var Ag=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Sg(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,i=t.y;if(i*Xv>90&&i*Xv<-90&&n*Xv>180&&n*Xv<-180)return null;if(Math.abs(Math.abs(i)-Gv)<=qv)return null;if(this.sphere)e=this.x0+this.a*this.k0*kg(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(Zv+.5*i));else{var o=Math.sin(i),a=Tg(this.e,i,o);e=this.x0+this.a*this.k0*kg(n-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=Gv-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=Cg(this.e,o)))return null}return e=kg(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Og,inverse:Og,names:["longlat","identity"]}],Pg={},Mg=[];function Ig(t,e){var r=Mg.length;return t.names?(Mg[r]=t,t.names.forEach(function(t){Pg[t.toLowerCase()]=r}),this):(console.log(e),!0)}var Lg={start:function(){Ag.forEach(Ig)},add:Ig,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Pg[e]&&Mg[Pg[e]]?Mg[Pg[e]]:void 0}},jg={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Ng=jg.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};jg.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Rg={};Rg.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Rg.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Rg.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Rg.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Rg.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Rg.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Rg.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Rg.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Rg.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},Rg.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Rg.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Rg.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Rg.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Rg.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Rg.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Rg.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Rg.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Rg.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var Dg=function(t,e,r,n,i,o,a){var s={};return s.datum_type=void 0===t||"none"===t?Dv:Rv,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=Lv),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=jv,s.datum_params[3]*=Uv,s.datum_params[4]*=Uv,s.datum_params[5]*=Uv,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=Nv,s.grids=a),s.a=r,s.b=n,s.es=i,s.ep2=o,s},Bg={};function Fg(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Bg[t]||null,isNull:!1}}function zg(t){return t/3600*Math.PI/180}function Ug(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function Gg(t){return t.map(function(t){return[zg(t.longitudeShift),zg(t.latitudeShift)]})}function Vg(t,e,r){return{name:Ug(t,e+8,e+16).trim(),parent:Ug(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function Hg(t,e,r,n){for(var i=e+176,o=[],a=0;a-1.001*Gv)u=-Gv;else if(u>Gv&&u<1.001*Gv)u=Gv;else{if(u<-Gv)return{x:-1/0,y:-1/0,z:t.z};if(u>Gv)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(u),a=Math.cos(u),o=i*i,{x:((n=r/Math.sqrt(1-e*o))+l)*a*Math.cos(s),y:(n+l)*a*Math.sin(s),z:(n*(1-e)+l)*i}}function Xg(t,e,r,n){var i,o,a,s,u,l,c,f,h,p,d,y,v,g,m,b=t.x,x=t.y,w=t.z?t.z:0;if(i=Math.sqrt(b*b+x*x),o=Math.sqrt(b*b+x*x+w*w),i/r<1e-12){if(g=0,o/r<1e-12)return Gv,m=-n,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(x,b);a=w/o,f=(s=i/o)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),h=a*u,v=0;do{v++,l=e*(c=r/Math.sqrt(1-e*h*h))/(c+(m=i*f+w*h-c*(1-e*h*h))),y=(d=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*f-(p=s*(1-l)*u)*h,f=p,h=d}while(y*y>1e-24&&v<30);return{x:g,y:Math.atan(d/Math.abs(p)),z:m}}function Zg(t){return t===Lv||t===jv}function Kg(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===Lv?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==jv||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===Dv||e.datum_type===Dv)return r;var n=t.a,i=t.es;if(t.datum_type===Nv){if(0!==Jg(t,!1,r))return;n=Bv,i=zv}var o=e.a,a=e.b,s=e.es;if(e.datum_type===Nv&&(o=Bv,a=Fv,s=zv),i===s&&n===o&&!Zg(t.datum_type)&&!Zg(e.datum_type))return r;if((r=Yg(r,i,n),Zg(t.datum_type)&&(r=function(t,e,r){if(e===Lv)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===jv){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6];return{x:l*(t.x-u*t.y+s*t.z)+n,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(r,t.datum_type,t.datum_params)),Zg(e.datum_type)&&(r=function(t,e,r){if(e===Lv)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===jv){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=(t.x-n)/l,f=(t.y-i)/l,h=(t.z-o)/l;return{x:c+u*f-s*h,y:-u*c+f+a*h,z:s*c-a*f+h}}}(r,e.datum_type,e.datum_params)),r=Xg(r,s,o,a),e.datum_type===Nv)&&0!==Jg(e,!0,r))return;return r}function Jg(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[];t:for(var a=0;an.y||p>n.x||v1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=kg(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=t.x+o.x,n.y=t.y+o.y);return n}function $g(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),a=n.x-1*i,s=n.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;r=o*e.lim[0]+i;var l=e.cvs[r][0],c=e.cvs[r][1];r++;var f=e.cvs[r][0],h=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],d=e.cvs[r][1];r--;var y=e.cvs[r][0],v=e.cvs[r][1],g=a*s,m=a*(1-s),b=(1-a)*(1-s),x=(1-a)*s;return u.x=b*l+m*f+x*y+g*p,u.y=b*c+m*h+x*v+g*d,u}function tm(t,e,r){var n,i,o,a=r.x,s=r.y,u=r.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(n=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(n=u,i="z"),t.axis[o]){case"e":l[i]=n;break;case"w":l[i]=-n;break;case"n":l[i]=n;break;case"s":l[i]=-n;break;case"u":void 0!==r[i]&&(l.z=n);break;case"d":void 0!==r[i]&&(l.z=-n);break;default:return null}return l}function em(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function rm(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function nm(t,e,r,n){var i,o=void 0!==(r=Array.isArray(r)?em(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){rm(t.x),rm(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===Lv||t.datum.datum_type===jv||t.datum.datum_type===Nv)&&"WGS84"!==e.datumCode||(e.datum.datum_type===Lv||e.datum.datum_type===jv||e.datum.datum_type===Nv)&&"WGS84"!==t.datumCode}(t,e)&&(r=nm(t,i=new qg("WGS84"),r,n),t=i),n&&"enu"!==t.axis&&(r=tm(t,!1,r)),"longlat"===t.projName)r={x:r.x*Yv,y:r.y*Yv,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=Kg(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*Xv,y:r.y*Xv,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),n&&"enu"!==e.axis?tm(e,!0,r):(r&&!o&&delete r.z,r)}var im=qg("WGS84");function om(t,e,r,n){var i,o,a;return Array.isArray(r)?(i=nm(t,e,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(o=nm(t,e,r,n),2===(a=Object.keys(r)).length?o:(a.forEach(function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;o[n]=r[n]}),o))}function am(t){return t instanceof qg?t:t.oProj?t.oProj:qg(t)}var sm=function(t,e,r){t=am(t);var n,i=!1;return void 0===e?(e=t,t=im,i=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=im,i=!0),e=am(e),r?om(t,e,r):(n={forward:function(r,n){return om(t,e,r,n)},inverse:function(r,n){return om(e,t,r,n)}},i&&(n.oProj=e),n)},um=6,lm="AJSAJS",cm="AFAFAF",fm=65,hm=73,pm=79,dm=86,ym=90,vm={forward:gm,inverse:function(t){var e=wm(Sm(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:mm};function gm(t,e){return e=e||5,function(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,d=t.northing,y=t.zoneNumber,v=_m(y),g=Math.floor(p/1e5),m=Math.floor(d/1e5)%20,i=g,o=m,a=v,s=a-1,u=lm.charCodeAt(s),l=cm.charCodeAt(s),c=u+i-1,f=l+o,h=!1,c>ym&&(c=c-ym+fm-1,h=!0),(c===hm||uhm||(c>hm||upm||(c>pm||uym&&(c=c-ym+fm-1),f>dm?(f=f-dm+fm-1,h=!0):h=!1,(f===hm||lhm||(f>hm||lpm||(f>pm||ldm&&(f=f-dm+fm-1),String.fromCharCode(c)+String.fromCharCode(f))+r.substr(r.length-5,e)+n.substr(n.length-5,e);var i,o,a,s,u,l,c,f,h;var p,d,y,v,g,m}(function(t){var e,r,n,i,o,a,s,u=t.lat,l=t.lon,c=6378137,f=bm(u),h=bm(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=bm(6*(s-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=.006739496752268451*Math.cos(f)*Math.cos(f),i=Math.cos(f)*(h-a),o=c*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var p=.9996*e*(i+(1-r+n)*i*i*i/6+(5-18*r+r*r+72*n-.39089081163157013)*i*i*i*i*i/120)+5e5,d=.9996*(o+e*Math.tan(f)*(i*i/2+(5-r+9*n+4*n*n)*i*i*i*i/24+(61-58*r+r*r+600*n-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(d+=1e7);return{northing:Math.round(d),easting:Math.round(p),zoneNumber:s,zoneLetter:function(t){var e="Z";84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C");return e}(u)}}({lat:t[1],lon:t[0]}),e)}function mm(t){var e=wm(Sm(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function bm(t){return t*(Math.PI/180)}function xm(t){return t/Math.PI*180}function wm(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,f,h,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=e;n<"N"&&(v-=1e7),c=6*(i-1)-180+3,h=(f=v/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*f)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*f)+151*d*d*d/96*Math.sin(6*f),o=p/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),a=Math.tan(h)*Math.tan(h),s=.006739496752268451*Math.cos(h)*Math.cos(h),u=.99330562*p/Math.pow(1-.00669438*Math.sin(h)*Math.sin(h),1.5),l=y/(.9996*o);var g=h-o*Math.tan(h)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);g=xm(g);var m,b=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(h);if(b=c+xm(b),t.accuracy){var x=wm({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:x.lat,right:x.lon,bottom:g,left:b}}else m={lat:g,lon:b};return m}function _m(t){var e=t%um;return 0===e&&(e=um),e}function Sm(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;n=t.substring(o,o+=2);for(var u=_m(a),l=function(t,e){var r=lm.charCodeAt(e-1),n=1e5,i=!1;for(;r!==t.charCodeAt(0);){if(++r===hm&&r++,r===pm&&r++,r>ym){if(i)throw"Bad character: "+t;r=fm,i=!0}n+=1e5}return n}(n.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var r=cm.charCodeAt(e-1),n=0,i=!1;for(;r!==t.charCodeAt(0);){if(++r===hm&&r++,r===pm&&r++,r>dm){if(i)throw"Bad character: "+t;r=fm,i=!0}n+=1e5}return n}(n.charAt(1),u);c0&&(h=1e5/Math.pow(10,y),p=t.substring(o,o+y),v=parseFloat(p)*h,d=t.substring(o+y),g=parseFloat(d)*h),{easting:v+l,northing:g+c,zoneLetter:s,zoneNumber:a,accuracy:h}}function Em(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function km(t,e,r){if(!(this instanceof km))return new km(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}km.fromMGRS=function(t){return new km(mm(t))},km.prototype.toMGRS=function(t){return gm([this.x,this.y],t)};var Tm=km,Cm=1,Om=.25,Am=.046875,Pm=.01953125,Mm=.01068115234375,Im=.75,Lm=.46875,jm=.013020833333333334,Nm=.007120768229166667,Rm=.3645833333333333,Dm=.005696614583333333,Bm=.3076171875;function Fm(t){var e=[];e[0]=Cm-t*(Om+t*(Am+t*(Pm+t*Mm))),e[1]=t*(Im-t*(Am+t*(Pm+t*Mm)));var r=t*t;return e[2]=r*(Lm-t*(jm+t*Nm)),r*=t,e[3]=r*(Rm-t*Dm),e[4]=r*t*Bm,e}function zm(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var Um=20;function Gm(t,e,r){for(var n=1/(1-e),i=t,o=Um;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=(zm(i,a,Math.cos(i),r)-t)*(s*Math.sqrt(s))*n,Math.abs(s)qv?Math.tan(o):0,d=Math.pow(p,2),y=Math.pow(d,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var v=zm(o,s,u,this.en);r=this.a*(this.k0*l*(1+c/6*(1-d+f+c/20*(5-18*d+y+14*f-58*d*f+c/42*(61+179*y-y*d-479*d)))))+this.x0,n=this.a*(this.k0*(v-this.ml0+s*a*l/2*(1+c/12*(5-d+9*f+4*h+c/30*(61+y-58*d+270*f-330*d*f+c/56*(1385+543*y-y*d-3111*d))))))+this.y0}else{var g=u*Math.sin(a);if(Math.abs(Math.abs(g)-1)=1){if(g-1>qv)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,i,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Gm(e=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)qv?Math.tan(r):0,c=this.ep2*Math.pow(u,2),f=Math.pow(c,2),h=Math.pow(l,2),p=Math.pow(h,2);e=1-this.es*Math.pow(s,2);var d=o*Math.sqrt(e)/this.k0,y=Math.pow(d,2);n=r-(e*=l)*y/(1-this.es)*.5*(1-y/12*(5+3*h-9*c*h+c-4*f-y/30*(61+90*h-252*c*h+45*p+46*c-y/56*(1385+3633*h+4095*p+1574*p*h)))),i=kg(this.long0+d*(1-y/6*(1+2*h+c-y/20*(5+28*h+24*p+8*c*h+6*c-y/42*(61+662*h+1320*p+720*p*h))))/u)}else n=Gv*Eg(a),i=0;else{var v=Math.exp(o/this.k0),g=.5*(v-1/v),m=this.lat0+a/this.k0,b=Math.cos(m);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(g,2))),n=Math.asin(e),a<0&&(n=-n),i=0===g&&0===b?0:kg(Math.atan2(g,b)+this.long0)}return t.x=i,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Hm(t){var e=Math.exp(t);return e=(e-1/e)/2}function Wm(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function qm(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(Wm(1,e)+1))),t<0?-e:e}function Ym(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return e+r*Math.sin(2*e)}function Xm(t,e,r){for(var n,i,o=Math.sin(e),a=Math.cos(e),s=Hm(r),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(r),l=2*a*u,c=-2*o*s,f=t.length-1,h=t[f],p=0,d=0,y=0;--f>=0;)n=d,i=p,h=l*(d=h)-n-c*(p=y)+t[f],y=c*d-i+l*p;return[(l=o*u)*h-(c=a*s)*y,l*y+c*h]}var Zm={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Vm.init.apply(this),this.forward=Vm.forward,this.inverse=Vm.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var n=Ym(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=kg(t.x-this.long0),r=t.y;r=Ym(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(e),a=Math.cos(e);r=Math.atan2(n,a*i),e=Math.atan2(o*i,Wm(n,i*a)),e=qm(Math.tan(e));var s,u,l=Xm(this.gtu,2*r,2*e);return r+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=Xm(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(Hm(n));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(n),l=Math.cos(n);i=Math.atan2(a*l,Wm(u,l*s)),e=kg((n=Math.atan2(u,l*s))+this.long0),r=Ym(this.cgb,i)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var Km={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(kg(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Yv,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Zm.init.apply(this),this.forward=Zm.forward,this.inverse=Zm.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Jm(t,e){return Math.pow((1-t)/(1+t),e)}var Qm=20;var $m={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Zv)/(Math.pow(Math.tan(.5*this.lat0+Zv),this.C)*Jm(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+Zv),this.C)*Jm(this.e*Math.sin(r),this.ratexp))-Gv,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+Zv)/this.K,1/this.C),i=Qm;i>0&&(r=2*Math.atan(n*Jm(this.e*Math.sin(t.y),-.5*this.e))-Gv,!(Math.abs(r-t.y)<1e-14));--i)t.y=r;return i?(t.x=e,t.y=r,t):null},names:["gauss"]};var tb={init:function(){$m.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,i;return t.x=kg(t.x-this.long0),$m.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Wm(t.x,t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/o),n=Math.atan2(t.x*e,o*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,n=0;return t.x=n,t.y=i,$m.inverse.apply(this,[t]),t.x=kg(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var eb={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=qv&&(this.k0=.5*(1+Eg(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=qv&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=qv&&Math.abs(Math.cos(this.lat_ts))>qv&&(this.k0=.5*this.cons*Sg(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Tg(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Sg(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Gv,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,i,o,a,s=t.x,u=t.y,l=Math.sin(u),c=Math.cos(u),f=kg(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=qv&&Math.abs(u+this.lat0)<=qv?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(f)),t.x=this.a*e*c*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*l-this.sinlat0*c*Math.cos(f))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,l,this.e))-Gv,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=qv?(o=Tg(this.e,u*this.con,this.con*l),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(s-this.long0),t.y=this.y0-this.con*a*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)0?kg(this.long0+Math.atan2(t.x,-1*t.y)):kg(this.long0+Math.atan2(t.x,t.y)):kg(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=qv){if(a<=qv)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*Cg(this.e,n),e=this.con*kg(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=qv?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=kg(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*Cg(this.e,Math.tan(.5*(Gv+o)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(Gv+t))*Math.pow((1-e)/(1+e),.5*r)}};var rb={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,f=0;Math.abs(l-c)>1e-7;){if(++f>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]},nb=1e-7;var ib={init:function(){var t,e,r,n,i,o,a,s,u,l,c,f,h,p=0,d=0,y=0,v=0,g=0,m=0,b=0;this.no_off=(h="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(h)),this.no_rot="no_rot"in this;var x=!1;"alpha"in this&&(x=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),x&&(b=this.alpha),w&&(p=this.rectified_grid_angle*Yv),x||w)d=this.longc;else if(y=this.long1,g=this.lat1,v=this.long2,m=this.lat2,Math.abs(g-m)<=nb||(t=Math.abs(g))<=nb||Math.abs(t-Gv)<=nb||Math.abs(Math.abs(this.lat0)-Gv)<=nb||Math.abs(Math.abs(m)-Gv)<=nb)throw new Error;var _=1-this.es;e=Math.sqrt(_),Math.abs(this.lat0)>qv?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/_),this.A=this.B*this.k0*e/t,(i=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(Tg(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=i=1),x||w?(x?(c=Math.asin(Math.sin(b)/n),w||(p=b)):(c=p,b=Math.asin(n*Math.sin(c))),this.lam0=d-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(o=Math.pow(Tg(this.e,g,Math.sin(g)),this.B),a=Math.pow(Tg(this.e,m,Math.sin(m)),this.B),i=this.E/o,u=(a-o)/(a+o),l=((l=this.E*this.E)-a*o)/(l+a*o),(t=y-v)<-Math.pi?v-=Kv:t>Math.pi&&(v+=Kv),this.lam0=kg(.5*(y+v)-Math.atan(l*Math.tan(.5*this.B*(y-v))/u)/this.B),c=Math.atan(2*Math.sin(this.B*kg(y-this.lam0))/(i-1/i)),p=b=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(Zv-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Zv+i))},forward:function(t){var e,r,n,i,o,a,s,u,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Gv)>qv){if(e=.5*((o=this.E/Math.pow(Tg(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),r=.5*(o+a),i=Math.sin(this.B*t.x),n=(e*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(l.x=s,l.y=u):(s-=this.u_0,l.x=u*this.cosrot+s*this.sinrot,l.y=s*this.cosrot-u*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var e,r,n,i,o,a,s,u={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),s=((a=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)qv?this.ns=Math.log(n/s)/Math.log(i/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=qv&&(r=Eg(r)*(Gv-2*qv));var n,i,o=Math.abs(Math.abs(r)-Gv);if(o>qv)n=Tg(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var a=this.ns*kg(e-this.long0);return t.x=this.k0*(i*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(a))+this.y0,t},inverse:function(t){var e,r,n,i,o,a=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+s*s),r=1):(e=-Math.sqrt(a*a+s*s),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*a,r*s)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(i=Cg(this.e,n)))return null}else i=-Gv;return o=kg(u/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var ab={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,i,o,a,s,u=t.x,l=t.y,c=kg(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function sb(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function ub(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function lb(t){return.375*t*(1+.25*t*(1+.46875*t))}function cb(t){return.05859375*t*t*(1+.75*t)}function fb(t){return t*t*t*(35/3072)}function hb(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}function pb(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}var gb=.3333333333333333,mb=.17222222222222222,bb=.10257936507936508,xb=.06388888888888888,wb=.0664021164021164,_b=.016415012942191543;var Sb={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-Gv)0)switch(this.qp=vb(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=t*gb,e=t*t,r[0]+=e*mb,r[1]=e*xb,e*=t,r[0]+=e*bb,r[1]+=e*wb,r[2]=e*_b,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=vb(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,i,o,a,s,u,l,c,f=t.x,h=t.y;if(f=kg(f-this.long0),this.sphere){if(o=Math.sin(h),c=Math.cos(h),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+c*n:1+this.sinph0*o+this.cosph0*c*n)<=qv)return null;e=(r=Math.sqrt(2/r))*c*Math.sin(f),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(h+this.lat0)=0?(e=(l=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?l:-l)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,i,o,a,s,u,l,c,f=t.x/this.a,h=t.y/this.a;if(this.sphere){var p,d=0,y=0;if((r=.5*(p=Math.sqrt(f*f+h*h)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(r),d=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(p)<=qv?0:Math.asin(h*y/p),f*=y,h=d*p;break;case this.OBLIQ:r=Math.abs(p)<=qv?this.lat0:Math.asin(d*this.sinph0+h*y*this.cosph0/p),f*=y*this.cosph0,h=(d-Math.sin(r)*this.sinph0)*p;break;case this.N_POLE:h=-h,r=Gv-r;break;case this.S_POLE:r-=Gv}e=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,h*=this.dd,(a=Math.sqrt(f*f+h*h))1&&(t=t>1?1:-1),Math.asin(t)}var kb={init:function(){Math.abs(this.lat1+this.lat2)qv?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=vb(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*kg(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),i=0,0!==e&&(i=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=kg(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,i,o,a,s=Eb(.5*e);if(t0||Math.abs(o)<=qv?(a=this.x0+1*this.a*r*Math.sin(n)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)/o):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),a=Eb((n=Math.cos(i))*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),o=kg(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var Cb={init:function(){this.sphere||(this.k0=Sg(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,i=t.y,o=kg(n-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=vb(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,r=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=kg(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*Gv:Gv;for(var n,i,o,a,s=Math.asin(.5*e),u=0;u<30;u++)if(i=Math.sin(s),o=Math.cos(s),a=t*i,s+=n=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-i/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=kg(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]};var Ob={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=kg(e-this.long0),i=pb(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,r=t.y;return t.x=kg(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=pb(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ab=20;var Pb={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ub(this.es),this.e1=lb(this.es),this.e2=cb(this.es),this.e3=fb(this.es),this.ml0=this.a*sb(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,i=t.x,o=t.y,a=kg(i-this.long0);if(n=a*Math.sin(o),this.sphere)Math.abs(o)<=qv?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(o),r=this.a*(pb(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=qv)e=this.a*a,r=-1*this.ml0;else{var s=hb(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(n),r=this.a*sb(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,i,o,a,s,u,l;if(n=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=qv)e=kg(n/this.a+this.long0),r=0;else{var c;for(a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,u=a,o=Ab;o;--o)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=qv){r=u;break}e=kg(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=qv)r=0,e=kg(this.long0+n/this.a);else{var f,h,p,d,y;for(a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,u=a,o=Ab;o;--o)if(y=this.e*Math.sin(u),f=Math.sqrt(1-y*y)*Math.tan(u),h=this.a*sb(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(f*(d=h/this.a)+1)-d-.5*f*(d*d+s))/(this.es*Math.sin(2*u)*(d*d+s-2*a*d)/(4*f)+(a-d)*(f*p-2/Math.sin(2*u))-p),Math.abs(l)<=qv){r=u;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=kg(this.long0+Math.asin(n*f/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]};var Mb={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,i=r-this.long0,o=n/Uv*1e-5,a=i,s=1,u=0;for(e=1;e<=10;e++)s*=o,u+=this.A[e]*s;var l,c=u,f=a,h=1,p=0,d=0,y=0;for(e=1;e<=6;e++)l=p*c+h*f,h=h*c-p*f,p=l,d=d+this.B_re[e]*h-this.B_im[e]*p,y=y+this.B_im[e]*h+this.B_re[e]*p;return t.x=y*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,i=t.y,o=n-this.x0,a=(i-this.y0)/this.a,s=o/this.a,u=1,l=0,c=0,f=0;for(e=1;e<=6;e++)r=l*a+u*s,u=u*a-l*s,l=r,c=c+this.C_re[e]*u-this.C_im[e]*l,f=f+this.C_im[e]*u+this.C_re[e]*l;for(var h=0;h.999999999999&&(r=.999999999999),e=Math.asin(r);var n=kg(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=n,t.y=i,t},names:["Mollweide","moll"]};var Rb={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==r&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=kg(this.long0+o/this.ns),n=pb(this.g-r/this.a),t.x=i,t.y=n,t):(n=db(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=kg(this.long0+o/this.ns),t.x=i,t.y=n,t)},names:["Equidistant_Conic","eqdc"]};var Db={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,i=t.y,o=kg(n-this.long0);Math.abs(i)<=qv&&(e=this.x0+this.R*o,r=this.y0);var a=Eb(2*Math.abs(i/Math.PI));(Math.abs(o)<=qv||Math.abs(Math.abs(i)-Gv)<=qv)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),u=s*s,l=Math.sin(a),c=Math.cos(a),f=c/(l+c-1),h=f*f,p=f*(2/l-1),d=p*p,y=Math.PI*this.R*(s*(f-d)+Math.sqrt(u*(f-d)*(f-d)-(d+u)*(h-d)))/(d+u);o<0&&(y=-y),e=this.x0+y;var v=u+f;return y=Math.PI*this.R*(p*v-s*Math.sqrt((d+u)*(u+1)-v*v))/(d+u),r=i>=0?this.y0+y:this.y0-y,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,i,o,a,s,u,l,c,f,h;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,o=(n=t.x/f)*n+(i=t.y/f)*i,f=3*(i*i/(u=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+n*n)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(f)>1&&(f=f>=0?1:-1),h=Math.acos(f)/3,r=t.y>=0?(-c*Math.cos(h+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(h+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(n)2*Gv*this.a)return;return r=e/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(e)<=qv?a=this.lat0:(a=Eb(i*this.sin_p12+t.y*n*this.cos_p12/e),s=Math.abs(this.lat0)-Gv,o=Math.abs(s)<=qv?this.lat0>=0?kg(this.long0+Math.atan2(t.x,-t.y)):kg(this.long0-Math.atan2(-t.x,t.y)):kg(this.long0+Math.atan2(t.x*n,e*this.cos_p12*i-t.y*this.sin_p12*n))),t.x=o,t.y=a,t}return u=ub(this.es),l=lb(this.es),c=cb(this.es),f=fb(this.es),Math.abs(this.sin_p12-1)<=qv?(a=db(((h=this.a*sb(u,l,c,f,Gv))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,u,l,c,f),o=kg(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=qv?(h=this.a*sb(u,l,c,f,Gv),a=db(((e=Math.sqrt(t.x*t.x+t.y*t.y))-h)/this.a,u,l,c,f),o=kg(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),p=hb(this.a,this.e,this.sin_p12),v=Math.cos(y),m=-(g=this.e*this.cos_p12*v)*g/(1-this.es),b=3*this.es*(1-m)*this.sin_p12*this.cos_p12*v/(1-this.es),_=1-m*(w=(x=e/p)-m*(1+m)*Math.pow(x,3)/6-b*(1+3*m)*Math.pow(x,4)/24)*w/2-x*w*w*w/6,d=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*v),o=kg(this.long0+Math.asin(Math.sin(y)*Math.sin(w)/Math.cos(d))),S=Math.sin(d),a=Math.atan2((S-this.es*_*this.sin_p12)*Math.tan(d),S*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var Fb={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,a,s,u=t.x,l=t.y;return n=kg(u-this.long0),e=Math.sin(l),r=Math.cos(l),i=Math.cos(n),((o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=qv)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a,s;return t.x-=this.x0,t.y-=this.y0,r=Eb((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(e)<=qv?(s=this.lat0,t.x=a,t.y=s,t):(s=Eb(i*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-Gv,Math.abs(o)<=qv?(a=this.lat0>=0?kg(this.long0+Math.atan2(t.x,-t.y)):kg(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=s,t):(a=kg(this.long0+Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n)),t.x=a,t.y=s,t))},names:["ortho"]},zb={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Ub={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Gb(t,e,r,n){var i;return tZv&&i<=Gv+Zv?(n.value=Ub.AREA_1,i-=Gv):i>Gv+Zv||i<=-(Gv+Zv)?(n.value=Ub.AREA_2,i=i>=0?i-Jv:i+Jv):(n.value=Ub.AREA_3,i+=Gv)),i}function Vb(t,e){var r=t+e;return r<-Jv?r+=Kv:r>+Jv&&(r-=Kv),r}var Hb={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Gv-Zv/2?this.face=zb.TOP:this.lat0<=-(Gv-Zv/2)?this.face=zb.BOTTOM:Math.abs(this.long0)<=Zv?this.face=zb.FRONT:Math.abs(this.long0)<=Gv+Zv?this.face=this.long0>0?zb.RIGHT:zb.LEFT:this.face=zb.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,i,o,a,s={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,this.face===zb.TOP)i=Gv-e,r>=Zv&&r<=Gv+Zv?(u.value=Ub.AREA_0,n=r-Gv):r>Gv+Zv||r<=-(Gv+Zv)?(u.value=Ub.AREA_1,n=r>0?r-Jv:r+Jv):r>-(Gv+Zv)&&r<=-Zv?(u.value=Ub.AREA_2,n=r+Gv):(u.value=Ub.AREA_3,n=r);else if(this.face===zb.BOTTOM)i=Gv+e,r>=Zv&&r<=Gv+Zv?(u.value=Ub.AREA_0,n=-r+Gv):r=-Zv?(u.value=Ub.AREA_1,n=-r):r<-Zv&&r>=-(Gv+Zv)?(u.value=Ub.AREA_2,n=-r-Gv):(u.value=Ub.AREA_3,n=r>0?-r+Jv:-r-Jv);else{var l,c,f,h,p,d;this.face===zb.RIGHT?r=Vb(r,+Gv):this.face===zb.BACK?r=Vb(r,+Jv):this.face===zb.LEFT&&(r=Vb(r,-Gv)),h=Math.sin(e),p=Math.cos(e),d=Math.sin(r),l=p*Math.cos(r),c=p*d,f=h,this.face===zb.FRONT?n=Gb(i=Math.acos(l),f,c,u):this.face===zb.RIGHT?n=Gb(i=Math.acos(c),f,-l,u):this.face===zb.BACK?n=Gb(i=Math.acos(-l),f,-c,u):this.face===zb.LEFT?n=Gb(i=Math.acos(-c),f,l,u):(i=n=0,u.value=Ub.AREA_0)}return a=Math.atan(12/Jv*(n+Math.acos(Math.sin(n)*Math.cos(Zv))-Gv)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),u.value===Ub.AREA_1?a+=Gv:u.value===Ub.AREA_2?a+=Jv:u.value===Ub.AREA_3&&(a+=1.5*Jv),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,r,n,i,o,a,s,u,l,c,f,h,p={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=Ub.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=Ub.AREA_1,e-=Gv):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=Ub.AREA_2,e=e<0?e+Jv:e-Jv):(d.value=Ub.AREA_3,e+=Gv),l=Jv/12*Math.tan(e),o=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(n=Math.cos(e))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===zb.TOP)u=Math.acos(s),p.phi=Gv-u,d.value===Ub.AREA_0?p.lam=a+Gv:d.value===Ub.AREA_1?p.lam=a<0?a+Jv:a-Jv:d.value===Ub.AREA_2?p.lam=a-Gv:p.lam=a;else if(this.face===zb.BOTTOM)u=Math.acos(s),p.phi=u-Gv,d.value===Ub.AREA_0?p.lam=-a+Gv:d.value===Ub.AREA_1?p.lam=-a:d.value===Ub.AREA_2?p.lam=-a-Gv:p.lam=a<0?-a-Jv:-a+Jv;else{var y,v,g;l=(y=s)*y,v=(l+=(g=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*g)>=1?0:Math.sqrt(1-l),d.value===Ub.AREA_1?(l=v,v=-g,g=l):d.value===Ub.AREA_2?(v=-v,g=-g):d.value===Ub.AREA_3&&(l=v,v=g,g=-l),this.face===zb.RIGHT?(l=y,y=-v,v=l):this.face===zb.BACK?(y=-y,v=-v):this.face===zb.LEFT&&(l=y,y=v,v=-l),p.phi=Math.acos(-g)-Gv,p.lam=Math.atan2(v,y),this.face===zb.RIGHT?p.lam=Vb(p.lam,-Gv):this.face===zb.BACK?p.lam=Vb(p.lam,-Jv):this.face===zb.LEFT&&(p.lam=Vb(p.lam,+Gv))}return 0!==this.es&&(c=p.phi<0?1:0,f=Math.tan(p.phi),h=this.b/Math.sqrt(f*f+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-h*h)/(this.one_minus_f*h)),c&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Wb=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],qb=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Yb=.8487,Xb=1.3523,Zb=Xv/5,Kb=1/Zb,Jb=18,Qb=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},$b=function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])};var tx={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=kg(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*Zb);n<0?n=0:n>=Jb&&(n=Jb-1),r=Xv*(r-Kb*n);var i={x:Qb(Wb[n],r)*e,y:Qb(qb[n],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*Yb+this.x0,i.y=i.y*this.a*Xb+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*Yb),y:Math.abs(t.y-this.y0)/(this.a*Xb)};if(e.y>=1)e.x/=Wb[Jb][0],e.y=t.y<0?-Gv:Gv;else{var r=Math.floor(e.y*Jb);for(r<0?r=0:r>=Jb&&(r=Jb-1);;)if(qb[r][0]>e.y)--r;else{if(!(qb[r+1][0]<=e.y))break;++r}var n=qb[r],i=5*(e.y-n[0])/(qb[r+1][0]-n[0]);i=function(t,e,r,n){for(var i=e;n;--n){var o=t(i);if(i-=o,Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,n,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/Wm(this.radius_p*Math.cos(a),Math.sin(a));if(r=s*Math.cos(o)*Math.cos(a),n=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/Wm(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/Wm(n,e)))}else"sphere"===this.shape&&(e=Math.cos(a),r=Math.cos(o)*e,n=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/Wm(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/Wm(n,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,n,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Wm(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Wm(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},ax=1.340264,sx=-.081106,ux=893e-6,lx=.003796,cx=Math.sqrt(3)/2;var fx={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=kg(t.x-this.long0),r=t.y,n=Math.asin(cx*Math.sin(r)),i=n*n,o=i*i*i;return t.x=e*Math.cos(n)/(cx*(ax+3*sx*i+o*(7*ux+9*lx*i))),t.y=n*(ax+sx*i+o*(ux+lx*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,r,n,i,o=t.y;for(i=0;i<12&&(o-=n=(o*(ax+sx*(e=o*o)+(r=e*e*e)*(ux+lx*e))-t.y)/(ax+3*sx*e+r*(7*ux+9*lx*e)),!(Math.abs(n)<1e-9));++i);return r=(e=o*o)*e*e,t.x=cx*t.x*(ax+3*sx*e+r*(7*ux+9*lx*e))/Math.cos(o),t.y=Math.asin(Math.sin(o)/cx),t.x=kg(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};sm.defaultDatum="WGS84",sm.Proj=qg,sm.WGS84=new sm.Proj("WGS84"),sm.Point=Tm,sm.toPoint=em,sm.defs=mg,sm.nadgrid=function(t,e){var r=new DataView(e),n=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Ug(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,n),o={header:i,subgrids:function(t,e,r){for(var n=176,i=[],o=0;ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r0?(r.totalTimes--,r.ajaxPolling(t)):r._commit(t)}},{key:"ajaxPolling",value:function(t){var e=this,r=t.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],r=r.replace(n,n.exec(e.url)[0]),t.url=r,t.isInTheSameDomain=$.isInTheSameDomain(r),e._commit(t)}},{key:"calculatePollingTimes",value:function(){var t=this;t.times?t.totalTimes>t.POLLING_TIMES?t.times>t.POLLING_TIMES?t.totalTimes=t.POLLING_TIMES:t.totalTimes=t.times:t.timest.POLLING_TIMES&&(t.totalTimes=t.POLLING_TIMES),t.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"transformResult",value:function(t,e){return{result:t=$.transformResult(t),options:e}}},{key:"transformErrorResult",value:function(t,e){return{error:(t=$.transformResult(t)).error||t,options:e}}},{key:"serviceProcessCompleted",value:function(t,e){t=this.transformResult(t).result,this.events.triggerEvent("processCompleted",{result:t,options:e})}},{key:"serviceProcessFailed",value:function(t,e){var r=(t=this.transformErrorResult(t).error).error||t;this.events.triggerEvent("processFailed",{error:r,options:e})}},{key:"_returnContent",value:function(t){return t.scope.format!==dn.FGB&&!!t.scope.returnContent}},{key:"supportDataFormat",value:function(t){return this.dataFormat().includes(t)}},{key:"dataFormat",value:function(){return[dn.GEOJSON,dn.ISERVER]}},{key:"_commit",value:function(t){var e=this;if("POST"===t.method||"PUT"===t.method||"PATCH"===t.method)if(t.params&&(t.url=$.urlAppend(t.url,$.getParameterString(t.params||{}))),"object"!==Dx(t.data)||t.data instanceof FormData)t.params=t.data;else try{t.params=$.toJSON(t.data)}catch(t){console.log("不是json对象")}return ut.commit(t.method,t.url,t.params,{headers:t.headers,withoutFormatSuffix:t.withoutFormatSuffix,withCredentials:t.withCredentials,crossOrigin:t.crossOrigin,timeout:t.async?0:null,proxy:t.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(e){var r=e;return"string"==typeof e&&(r=(new Or).read(e)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&t.scope.format===dn.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(function(r){var n={object:e};if(r.error){var i="processFailed";if(e.events&&e.events.listeners[i]&&e.events.listeners[i].length){var o=t.failure&&(t.scope?B.bind(t.failure,t.scope):t.failure);o?o(r,t):e.serviceProcessFailed(r,t)}else(n=Nx(Nx({},n),e.transformErrorResult(r,t))).type=i,t.failure&&t.failure(n)}else{var a="processCompleted";if(e.events&&e.events.listeners[a]&&e.events.listeners[a].length){var s=t.success&&(t.scope?B.bind(t.success,t.scope):t.success);s?s(r,t):e.serviceProcessCompleted(r,t)}else r.succeed=void 0==r.succeed||r.succeed,(n=Nx(Nx({},n),e.transformResult(r,t))).type=a,t.success&&t.success(n)}return n})}}])&&Bx(e.prototype,r),n&&Bx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ux(t){"@babel/helpers - typeof";return(Ux="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gx(){Gx=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Ux(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Vx(t){return function(t){if(Array.isArray(t))return Hx(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Hx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hx(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hx(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ew(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function rw(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:"id";return lw()(t,e)}function mw(t){return t.hasOwnProperty("start")&&t.hasOwnProperty("end")}function bw(t,e,r){var n=t.id,i=t.properties,o=t.lables,a=e?function(t,e){if(!e)return{};for(var r=t.id,n=t.labels,i=e.filter(function(t){return"entity"===t.type}),o=0;o0&&t(o[0])}},u=0;u0;)f.push(s.pop());o.push(f)}}return o},zw=function(t){for(var e=t.nodes,r=void 0===e?[]:e,n=t.edges,i=void 0===n?[]:n,o=[],a={},s={},u={},l=[],c=0,f=function t(e){s[e.id]=c,u[e.id]=c,c+=1,o.push(e),a[e.id]=!0;for(var n=Nw(e.id,i,"target").filter(function(t){return r.map(function(t){return t.id}).indexOf(t)>-1}),f=function(i){var o=n[i];if(s[o]||0===s[o])a[o]&&(u[e.id]=Math.min(u[e.id],s[o]));else{var l=r.filter(function(t){return t.id===o});l.length>0&&t(l[0]),u[e.id]=Math.min(u[e.id],u[o])}},h=0;h0;){var d=o.pop();if(a[d.id]=!1,p.push(d),d===e)break}p.length>0&&l.push(p)}},h=0,p=r;h0;)for(var d=f.pop(),y=d.id,v=Nw(y,t.edges),g=function(n){var i,a=v[n],s=t.nodes.find(function(t){return t.id===a});if(a===y)o.push(((i={})[a]=d,i));else if(a in p){if(!p[y].has(s)){for(var u=!0,l=[s,d],c=h[y];p[a].size&&!p[a].has(c)&&(l.push(c),c!==h[c.id]);)c=h[c.id];if(l.push(c),e&&r?(u=!1,l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!0)):e&&!r&&l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!1),u){for(var g={},m=1;m-1)return f;n.push(u),i.add(u);for(var h=c[u.id],p=0;p0;){var r=e.pop();i.has(r)&&(i.delete(r),o[r.id].forEach(function(t){e.push(t)}),o[r.id].clear())}}(u);else for(p=0;p-1});v-1?d[y.id].push(u[m]):a.push(((i={})[y.id]=y,i))}}return{component:p,adjList:d,minIdx:s}},g=0;g=g}),b=zw({nodes:m,edges:t.edges}).filter(function(t){return t.length>1});if(0===b.length)break;var x=v(b),w=x.minIdx,_=x.adjList,S=x.component;if(!(S.length>1))break;S.forEach(function(t){o[t.id]=new Set});var E=s[w];if(e&&r&&-1===e.indexOf(E.id))return a;l(E,E,_),g=w+1}return a},Zw=function(t,e,r,n){return void 0===n&&(n=!0),e?Xw(t,r,n):Yw(t,r,n)},Kw=function(t){var e=null,r=t.nodes,n={},i={},o={},a={};(void 0===r?[]:r).forEach(function(t){i[t.id]=t});for(var s={enter:function(t){var r=t.current,a=t.previous;if(o[r]){e={};for(var s=r,u=a;u!==r;)e[s]=u,s=u,u=n[u];e[s]=u}else o[r]=r,delete i[r],n[r]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var r=t.next;return!e&&!a[r]}};Object.keys(i).length;)qw(t,Object.keys(i)[0],s);return e},Jw=function(t,e,r,n){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],l={},c={},f={};o.forEach(function(t,r){var n=t.id;u.push(n),c[n]=1/0,n===e&&(c[n]=0)});for(var h=o.length,p=function(t){var e=function(t,e,r){for(var n,i=1/0,o=0;oc[e.id]+s?(c[a]=c[e.id]+s,f[a]=[e.id]):c[a]===c[e.id]+s&&f[a].push(e.id)})},d=0;d0&&l.length>0;){var h=l[l.length-1];if(h.length){var p=h.shift();if(p&&(s.push(p),u[p]=!0,f=n?Nw(p,a,"target"):Nw(p,a),l.push(f.filter(function(t){return!u[t]}))),s[s.length-1]===r){var d=s.map(function(t){return t});c.push(d);y=s.pop();u[y]=!1,l.pop()}}else{var y=s.pop();u[y]=!1,l.pop()}}return c},r_=function(t,e){for(var r=Pw(t,e),n=[],i=r.length,o=0;on[o][s]+n[s][a]&&(n[o][a]=n[o][s]+n[s][a]);return n},n_=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u={},l={};o.forEach(function(t,e){var r=Dw();t.clusterId=r,u[r]={id:r,nodes:[t]},l[t.id]={node:t,idx:e}});var c=[],f={};Pw(t,e).forEach(function(t,e){var r=0,n=o[e].id;f[n]={},t.forEach(function(t,e){if(t){r+=t;var i=o[e].id;f[n][i]=t}}),c.push(r)});for(var h=0,p=function(){var t=!1;if(o.forEach(function(e){var r={};Object.keys(f[e.id]).forEach(function(t){var n=f[e.id][t],i=l[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n=0&&i.splice(o,1),i&&i.length){t=!0;var a=u[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var c=Math.floor(Math.random()*i.length),h=u[i[c]];h.nodes.push(e),e.clusterId=h.id}}}),!t)return"break";h++};h0&&S>E&&S-EE&&(T=c.map(function(t){return{node:t,clusterId:t.clusterId}}),C=(0,Ew.clone)(g),E=S),O||k>100)break;k++,Object.keys(g).forEach(function(t){var e=0;h.forEach(function(n){var i=n.source,o=n.target,a=m[i].node.clusterId,s=m[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),g[t].sumTot=e}),c.forEach(function(t,e){var n,o=g[t.clusterId],a=0,s=x[e]/(2*_),l=0,c=o.nodes;c.forEach(function(t){var r=m[t.id].idx;l+=b[e][r]||0});var f=l-o.sumTot*s,d=c.filter(function(e){return e.id!==t.id}),y=[];d.forEach(function(t,e){y[e]=p[t.originIndex]});var v=c_(d,p)*u,S=w[t.id];if(Object.keys(S).forEach(function(r){var o=m[r].node.clusterId;if(o!==t.clusterId){var l=g[o],c=l.nodes;if(c&&c.length){var h=0;c.forEach(function(t){var r=m[t.id].idx;h+=b[e][r]||0});var d=h-l.sumTot*s,y=c.concat([t]),x=[];y.forEach(function(t,e){x[e]=p[t.originIndex]});var w=c_(y,p)*u,_=d-f;i&&(_=d+w-(f+v)),_>a&&(a=_,n=l)}}}),a>0){n.nodes.push(t);var E=t.clusterId;t.clusterId=n.id;var k=o.nodes.indexOf(t);o.nodes.splice(k,1);var T=0,C=0;h.forEach(function(t){var e=t.source,i=t.target,o=m[e].node.clusterId,a=m[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(T+=t[r]||1),(o===E&&a!==E||a===E&&o!==E)&&(C+=t[r]||1)}),n.sumTot=T,o.sumTot=C}})}var A={},P=0;Object.keys(C).forEach(function(t){var e=C[t];if(e.nodes&&e.nodes.length){var r=String(P+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),C[r]=e,A[t]=r,delete C[t],P++)}else delete C[t]}),T.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&A[e.clusterId]&&(e.clusterId=A[e.clusterId]))});var M=[],I={};h.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=m[e].node.clusterId,a=m[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(I[s])I[s].weight+=i,I[s].count++;else{var u={source:o,target:a,weight:i,count:1};I[s]=u,M.push(u)}}});var L=[];return Object.keys(C).forEach(function(t){L.push(C[t])}),{clusters:L,clusterEdges:M}},h_=function(t,e,r,n,i,o,a,s){return void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e-4),void 0===i&&(i=void 0),void 0===o&&(o=[]),void 0===a&&(a=["id"]),void 0===s&&(s=1),f_(t,e,r,n,!0,i,o,a,s)},p_=function(t,e){var r;void 0===e&&(e=1);for(var n=(0,Ew.clone)(t),i=n.nodes,o=void 0===i?[]:i,a=n.edges,s=void 0===a?[]:a,u=function(){var t=Vw({nodes:o,edges:s}),n=Object.keys(t);n.sort(function(e,r){var n,i;return(null===(n=t[e])||void 0===n?void 0:n.degree)-(null===(i=t[r])||void 0===i?void 0:i.degree)});var i=n[0];if(!o.length||(null===(r=t[i])||void 0===r?void 0:r.degree)>=e)return"break";var a=o.findIndex(function(t){return t.id===i});o.splice(a,1),s=s.filter(function(t){return!(t.source===i||t.target===i)})};"break"!==u(););return{nodes:o,edges:s}},d_=function(t,e,r){var n=[];switch(t){case $w.EuclideanDistance:n=e[r];break;default:n=[]}return n},y_=function(t,e,r,n,i,o){void 0===e&&(e=3),void 0===r&&(r=void 0),void 0===n&&(n=[]),void 0===i&&(i=["id"]),void 0===o&&(o=$w.EuclideanDistance);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={clusters:[{id:"0",nodes:s}],clusterEdges:[]};if(o===$w.EuclideanDistance&&!s.every(function(t){return t.hasOwnProperty(r)}))return c;var f=[],h=[];if(o===$w.EuclideanDistance&&(f=o_(s,r),h=s_(f,n,i)),!h.length)return c;for(var p=(0,Ew.uniq)(h.map(function(t){return t.join("")})),d=Math.min(e,s.length,p.length),y=0;yx&&!v.find(function(e){return(0,Ew.isEqual)(e,d_(o,h,s[t].originIndex))})&&(x=i,w=t)}},S=0;S=0;A--)m[Number(s[y].clusterId)][A].id===s[y].id&&m[Number(s[y].clusterId)].splice(A,1);s[y].clusterId=String(k),m[k].push(s[y])}}var P=!1;for(y=0;y=1e3)break}var j=[],N={};return l.forEach(function(t){var e,r,n=t.source,i=t.target,o=null===(e=s.find(function(t){return t.id===n}))||void 0===e?void 0:e.clusterId,a=null===(r=s.find(function(t){return t.id===i}))||void 0===r?void 0:r.clusterId,u="".concat(o,"---").concat(a);if(N[u])N[u].count++;else{var l={source:o,target:a,count:1};N[u]=l,j.push(l)}}),{clusters:m,clusterEdges:j}},v_=function(t,e){var r=new i_(e),n=r.norm2(),i=new i_(t),o=i.norm2(),a=r.dot(i),s=n*o,u=s?a/s:0;return u},g_=function(t,e,r,n,i){void 0===t&&(t=[]),void 0===r&&(r=void 0),void 0===n&&(n=[]),void 0===i&&(i=[]);var o=(0,Ew.clone)(t.filter(function(t){return t.id!==e.id})),a=t.findIndex(function(t){return t.id===e.id}),s=o_(t,r),u=s_(s,n,i),l=u[a],c=[];return o.forEach(function(t,r){if(t.id!==e.id){var n=u[r],i=v_(n,l);c.push(i),t.cosineSimilarity=i}}),o.sort(function(t,e){return e.cosineSimilarity-t.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},m_=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n0?r=n:null!==i&&i0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}(),w_=function(t,e){var r=[],n=t.nodes,i=void 0===n?[]:n,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return r;var s=i[0],u=new Set;u.add(s);var l=new x_(function(t,r){return e?t.weight-r.weight:0});for(Rw(s.id,a).forEach(function(t){l.insert(t)});!l.isEmpty();){var c=l.delMin(),f=c.source,h=c.target;u.has(f)&&u.has(h)||(r.push(c),u.has(f)||(u.add(f),Rw(f,a).forEach(function(t){l.insert(t)})),u.has(h)||(u.add(h),Rw(h,a).forEach(function(t){l.insert(t)})))}return r},__=function(t,e){var r=[],n=t.nodes,i=void 0===n?[]:n,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return r;var s=a.map(function(t){return t});e&&s.sort(function(t,e){return t.weight-e.weight});for(var u=new m_(i.map(function(t){return t.id}));s.length>0;){var l=s.shift(),c=l.source,f=l.target;u.connected(c,f)||(r.push(l),u.union(c,f))}return r},S_=function(t,e,r){return r?{prim:w_,kruskal:__}[r](t,e):__(t,e)},E_=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,i=1,o=0,a=1e3,s=t.nodes,u=void 0===s?[]:s,l=t.edges,c=void 0===l?[]:l,f=u.length,h={},p={},d=0;d0&&i>e;){for(o=0,d=0;d0&&(n+=p[b]/x)}h[v]=r*n,o+=h[v]}}for(o=(1-o)/f,i=0,d=0;d=0;e--){var r=this.dfsEdgeList[e],n=r.fromNode,i=r.toNode;nf||n.hasNode(o[c.to])||(e.labeld&&"break"!==y(v);v--);if(h){var g=t.findMinLabel(f);o.dfsEdgeList.push(new I_(c,p,O_,g.edgeLabel,O_));var m=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[m]===o.dfsEdgeList[m]&&a(f[g.edgeLabel].projected)}var b={};h=!1;var x=0;s.forEach(function(e){var r=new j_(e),o=t.findForwardPureEdges(n,r.edges[u[0]],l,r);o.length>0&&(h=!0,x=c,o.forEach(function(t){var r="".concat(t.label,"-").concat(i[t.to].label);b[r]||(b[r]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[r].projected.push({graphId:n.id,edge:t,preNode:e})}))});var w=u.length,_=function(e){if(h)return"break";var r=u[e];s.forEach(function(e){var a=new j_(e),s=t.findForwardRmpathEdges(n,a.edges[r],l,a);s.length>0&&(h=!0,x=o.dfsEdgeList[r].fromNode,s.forEach(function(t){var r="".concat(t.label,"-").concat(i[t.to].label);b[r]||(b[r]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[r].projected.push({graphId:n.id,edge:t,preNode:e})}))})};for(v=0;v=0;f--){var h=e.findBackwardEdge(u,c.edges[n[f]],c.edges[n[0]],c);if(h){var p="".concat(e.dfsCode.dfsEdgeList[n[f]].fromNode,"-").concat(h.label);s[p]||(s[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[n[f]].fromNode,edgeLabel:h.label}),s[p].projected.push({graphId:t.graphId,edge:h,preNode:t})}}if(!(r>=e.maxNodeNum)){e.findForwardPureEdges(u,c.edges[n[0]],o,c).forEach(function(e){var r="".concat(i,"-").concat(e.label,"-").concat(l[e.to].label);a[r]||(a[r]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:l[e.to].label}),a[r].projected.push({graphId:t.graphId,edge:e,preNode:t})});var d=function(r){e.findForwardRmpathEdges(u,c.edges[n[r]],o,c).forEach(function(i){var o="".concat(e.dfsCode.dfsEdgeList[n[r]].fromNode,"-").concat(i.label,"-").concat(l[i.to].label);a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[n[r]].fromNode,edgeLabel:i.label,nodeLabel2:l[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})})};for(f=0;fi){var a=i;i=n,n=a}var c=t.label,f="".concat(r,"-").concat(n,"-").concat(c,"-").concat(i),h="".concat(n,"-").concat(c,"-").concat(i);if(!o[h]){var p=o[h]||0;p++,o[h]=p}s[f]={graphId:r,nodeLabel1:n,edgeLabel:c,nodeLabel2:i}})})}),Object.keys(i).forEach(function(t){if(!(i[t]e&&(s=e);var n=r[t.id].inDegree;u>n&&(u=n);var i=r[t.id].outDegree;l>i&&(l=i)}),t[e]={degree:s,inDegree:u,outDegree:l}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:l}},q_=function(t,e,r,n,i,o,a){var s;if(void 0===r&&(r=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var u=t.nodes.length;if(u){var l=r_(t,r),c=r_(e,r),f=V_(t.nodes,l,r),h=V_(e.nodes,c,r),p=U_(t.nodes,o),d=p.nodeMap,y=p.nodeLabelMap,v=U_(e.nodes,o),g=v.nodeMap,m=v.nodeLabelMap;G_(t.edges,a,d);var b=G_(e.edges,a,g).edgeLabelMap,x=[];null===c||void 0===c||c.forEach(function(t){x=x.concat(t)}),i||(i=Math.max.apply(Math,(0,Sw.__spreadArray)((0,Sw.__spreadArray)([],x,!1),[2],!1))),n||(n=i);var w=D_(t,l,o,n),_=D_(e,c,o,n),S=function(t,e,r,n,i){var o=Math.ceil(r/e),a={},s=0;return n.forEach(function(t,n){for(var u=0,l=0,c=t.nodeIdxs,f=t.neighborNum-1;u2*e)););if(p<2*e&&(a["".concat(n,"-").concat(h)]={start:n,end:h,distance:i[n][h]},u++,++s>=r))return a;if(++l>2*e)break}uj&&(j=r.length,I=r,L=e,M=t)});var N={},R={},D={},B={},F={},z={};Object.keys(m).forEach(function(n,i){F[n]=[],r&&(z[n]=[]);var s=-1/0,u={};m[n].forEach(function(t){var e=h["".concat(M.id,"-").concat(t.id)];if(e&&F[n].push(e),sF[n][h]){c=!0;break}if(c)return I.splice(e,1),"continue";var p={};i.neighbors.forEach(function(t){var e=f["".concat(r.id,"-").concat(t.id)];p["".concat(r.id,"-").concat(t.id)]={start:d[r.id].idx,end:d[t.id].idx,distance:e}}),E=F_(p,w,t,E);var y=[];Object.keys(p).forEach(function(t){if(P[t])y.push(P[t]);else{var e=E[t];P[t]=z_(e,A,o,a),y.push(P[t])}}),y=y.sort(function(t,e){return e-t});var v=!1;for(h=0;h=0;p--)c(p)});var U=[];null===I||void 0===I||I.forEach(function(n){for(var s=d[n.id].idx,u=B_(t.nodes,l[s],s,o,i).neighbors,c=!1,h=u.length-1;h>=0;h--){if(u.length+1F[y][x])u.splice(h,1);else{if(r){var _="".concat(p.id,"-").concat(n.id),S=f[_];if(x=z[y].length-1,S>z[y][x]){u.splice(h,1);continue}}var k=P[v]?P[v]:H_(t,n,p,d,b,w,A,o,a,P,E),T="".concat(M.id,"-").concat(y);if(k=0&&"break"!==_(y);y--);if(w)return U.splice(n,1),"continue";i.edges=c;var S=Jw(i,i.nodes[0].id,!1).length;if(Object.keys(S).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!w){if(S[t]===1/0){var e=l[t].node[o];if(u[e]--,u[e]V[n][V[n].length-1]){if(e=l[t].node[o],u[e]--,u[e]=0;T--){var C=i.nodes[T],O=l[C.id].degree,A=l[C.id].inDegree,P=l[C.id].outDegree,I=C[o],L=W_(N,I,g,m),j=L.minPatternNodeLabelDegree,R=L.minPatternNodeLabelInDegree,D=L.minPatternNodeLabelOutDegree;if(r?O=0;B--){var F=c[B];if(!l[F.source]||!l[F.target]){c.splice(B,1);var z=F[a];if(f[z]--,l[F.source]&&(l[F.source].degree--,l[F.source].outDegree--),l[F.target]&&(l[F.target].degree--,l[F.target].inDegree--),b[z]&&f[z]=0&&"break"!==H(W);W--);var q=U.length,Y=function(t){var e={};U[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};U[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&U.splice(t,1)},n=q-1;n>t;n--)r(n);q=U.length};for(W=0;W<=q-1;W++)Y(W);return U}}},Y_=function(){function t(t){void 0===t&&(t=10),this.linkedList=new Lw,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),X_=Kw,Z_={getAdjMatrix:Pw,breadthFirstSearch:Bw,connectedComponent:Uw,getDegree:Vw,getInDegree:Hw,getOutDegree:Ww,detectCycle:Kw,detectDirectedCycle:X_,detectAllCycles:Zw,detectAllDirectedCycle:Xw,detectAllUndirectedCycle:Yw,depthFirstSearch:qw,dijkstra:Jw,findAllPath:e_,findShortestPath:t_,floydWarshall:r_,labelPropagation:n_,louvain:f_,iLouvain:h_,kCore:p_,kMeans:y_,cosineSimilarity:v_,nodesCosineSimilarity:g_,minimumSpanningTree:S_,pageRank:E_,getNeighbors:Nw,Stack:Y_,GADDI:q_},K_=r(4010),J_=r(8610),Q_=r(8699),$_=Aw.vs,tS=function(t){return function(e,r){return e[t]-r[t]}},eS=function(t,e,r){return t>=e&&t<=r},rS=function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=1/c;if(c*c>1e-4*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)*f,p=(i*s-o*a)*f;return eS(h,0,1)&&eS(p,0,1)?{x:t.x+h*a,y:t.y+h*s}:null}return null},nS=function(t,e){var r=t.x,n=t.y,i=t.width,o=t.height,a=[],s={x:r+i/2,y:n+o/2};a.push({x:r,y:n}),a.push({x:r+i,y:n}),a.push({x:r+i,y:n+o}),a.push({x:r,y:n+o}),a.push({x:r,y:n});for(var u=null,l=1;le[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e},hS=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(t,e){o[t.id]=e;i.push([])}),n&&n.forEach(function(t){var r=t.source,n=t.target,a=o[r],s=o[n];i[a][s]=1,e||(i[s][a]=1)}),i},pS=function(t,e){t.translate(e.x,e.y)},dS=function(t,e,r,n){void 0===n&&(n={duration:500});var i=t.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),a=e.x-o.minX,s=e.y-o.minY;if(r){var u=a*i[0],l=s*i[4],c=0,f=0,h=0,p=0;t.animate(function(t){return i=$_(i,[["t",(h=u*t)-c,(p=l*t)-f]]),c=h,f=p,{matrix:i}},n)}else{var d=$_(i,[["t",a,s]]);t.setMatrix(d)}},yS=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e;(0,Ew.isArray)(e)||(n=[e,e]),(0,Ew.isArray)(e)&&1===e.length&&(n=[e[0],e[0]]),r=$_(r,[["s",n[0],n[1]]]),t.setMatrix(r)},vS=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=$_(r,[["r",e]]),t.setMatrix(r)},gS=function(t,e,r){for(var n=[],i=0;i0!=a(l[1]-r)>0&&a(e-(r-u[1])*(u[0]-l[0])/(u[1]-l[1])-u[0])<0&&(n=!n)}return n},xS=function(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=r(t),o=r(e);if(!xS(i,o))return!1;var a=!1;if((0,Ew.each)(e,function(e){if(bS(t,e[0],e[1]))return a=!0,!1}),a)return!0;if((0,Ew.each)(t,function(t){if(bS(e,t[0],t[1]))return a=!0,!1}),a)return!0;var s=n(t),u=n(e),l=!1;return(0,Ew.each)(u,function(t){if(function(t,e){var r=!1;return(0,Ew.each)(t,function(t){if(rS(t.from,t.to,e.from,e.to))return r=!0,!1}),r}(s,t))return l=!0,!1}),l},_S=function(){function t(t,e,r,n){this.x1=t,this.y1=e,this.x2=r,this.y2=n}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),n=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:r,maxY:n,width:r-t,height:n-e}},t}(),SS=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},ES=function(t,e){var r=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),n=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=r/i,a=n/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},kS=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=SS(n,r[a]),u=s[0],l=s[1],c=s[2],f=s[3];o[a]=rS({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:l},{x:c,y:f}),o[a]&&(i+=1)}return[o,i]},TS=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=SS(n,r[a]),u=s[0],l=s[1],c=s[2],f=s[3],h=ES(e,new _S(u,l,c,f));(h=Math.abs(h-.5))>=0&&h<=1&&(o+=1,i=h0){for(var n=0,i=t;ne.x+e.width,i=t.y>e.y+e.height,o=t.y":.604998779296875,"/":.5,"?":.53699951171875},GS=Math.PI,VS=Math.sin,HS=Math.cos,WS=VS(GS/8),qS=HS(GS/8),YS=function(t,e){var r=t.getBBox(),n={x:r.minX,y:r.minY},i={x:r.maxX,y:r.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),n=aS(n,o),i=aS(i,o)}var a=n.x,s=n.y,u=i.x,l=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:l,width:u-a,height:l-s}},XS=function(t){var e=t.sourceNode||t.targetNode,r=e.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e.getKeyShape(),i=n.getBBox(),o=t.loopCfg||{},a=o.dist||2*Math.max(i.width,i.height),s=o.position||zS.defaultLoopPosition,u=[(i.minX+i.maxX)/2+r[6],(i.minY+i.maxY)/2+r[7]],l=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],f=i.height/2,h=i.width/2,p=f,d=f,y=p*WS,v=p*qS,g=d*WS,m=d*qS,b=n.get("type"),x=Math.min(f/2,h/2),w=Math.min(f,h),_=(null===o||void 0===o?void 0:o.pointPadding)?Math.min(w,null===o||void 0===o?void 0:o.pointPadding):x;if(l[0]===c[0]&&l[1]===c[1]){switch(s){case"top":"circle"===b?(l=[u[0]-y,u[1]-v],c=[u[0]+g,u[1]-m]):(l=[u[0]-_,u[1]-f],c=[u[0]+_,u[1]-f]);break;case"top-right":p=f,d=h,"circle"===b?(l=[u[0]+(y=p*WS),u[1]-(v=p*qS)],c=[u[0]+(m=d*qS),u[1]-(g=d*WS)]):(l=[u[0]+h-_,u[1]-f],c=[u[0]+h,u[1]-f+_]);break;case"right":p=h,d=h,"circle"===b?(l=[u[0]+(v=p*qS),u[1]-(y=p*WS)],c=[u[0]+(m=d*qS),u[1]+(g=d*WS)]):(l=[u[0]+h,u[1]-_],c=[u[0]+h,u[1]+_]);break;case"bottom-right":p=h,d=f,"circle"===b?(l=[u[0]+(v=p*qS),u[1]+(y=p*WS)],c=[u[0]+(g=d*WS),u[1]+(m=d*qS)]):(l=[u[0]+h,u[1]+f-_],c=[u[0]+h-_,u[1]+f]);break;case"bottom":p=f,d=f,"circle"===b?(l=[u[0]+(y=p*WS),u[1]+(v=p*qS)],c=[u[0]-(g=d*WS),u[1]+(m=d*qS)]):(l=[u[0]-_,u[1]+f],c=[u[0]+_,u[1]+f]);break;case"bottom-left":p=f,d=h,"circle"===b?(l=[u[0]-(y=p*WS),u[1]+(v=p*qS)],c=[u[0]-(m=d*qS),u[1]+(g=d*WS)]):(l=[u[0]-h,u[1]+f-_],c=[u[0]-h+_,u[1]+f]);break;case"left":p=h,d=h,"circle"===b?(l=[u[0]-(v=p*qS),u[1]+(y=p*WS)],c=[u[0]-(m=d*qS),u[1]-(g=d*WS)]):(l=[u[0]-h,u[1]-_],c=[u[0]-h,u[1]+_]);break;case"top-left":p=h,d=f,"circle"===b?(l=[u[0]-(v=p*qS),u[1]-(y=p*WS)],c=[u[0]-(g=d*WS),u[1]-(m=d*qS)]):(l=[u[0]-h+_,u[1]-f],c=[u[0]-h,u[1]-f+_]);break;default:l=[u[0]-(y=(p=h)*WS),u[1]-(v=p*qS)],c=[u[0]+(g=(d=h)*WS),u[1]-(m=d*qS)]}if(!1===o.clockwise){var S=[l[0],l[1]];l=[c[0],c[1]],c=[S[0],S[1]]}}var E=[l[0]-u[0],l[1]-u[1]],k=(p+a)/p,T=(d+a)/d;!1===o.clockwise&&(k=(d+a)/d,T=(p+a)/p);var C=Q_.scale([0,0],E,k),O=[u[0]+C[0],u[1]+C[1]],A=[c[0]-u[0],c[1]-u[1]],P=Q_.scale([0,0],A,T),M=[u[0]+P[0],u[1]+P[1]];return t.startPoint={x:l[0],y:l[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:O[0],y:O[1]},{x:M[0],y:M[1]}],t},ZS=function(t,e,r,n,i){var o=[],a=null===t||void 0===t?void 0:t.getPoint(e);if(!a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=null===t||void 0===t?void 0:t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*GS),r&&(a.x+=HS(u)*r,a.y+=VS(u)*r),n){var l=u-GS/2;u>.5*GS&&u<1.5*GS&&(l-=GS),a.x+=HS(l)*n,a.y+=VS(l)*n}var c={x:a.x,y:a.y,angle:u};return i?(u>.5*GS&&u<1.5*GS&&(u-=GS),(0,Sw.__assign)({rotate:u},c)):c},KS=function(t,e){"function"==typeof e&&function t(e,r,n,i){if(!1===i(e,r,n))return!1;if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return!1;return!0}(t,null,-1,e)},JS=function(t,e){"function"==typeof e&&function t(e,r,n,i){if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return;return!1!==i(e,r,n)}(t,null,-1,e)},QS=function(t,e){return e*(US[t]||1)},$S=function(t,e){var r=0,n=new RegExp("[一-龥]+");return t.split("").forEach(function(t){n.test(t)?r+=e:r+=QS(t,e)}),[r,e]},tE=function(t,e){return"number"!=typeof e||e<=0||e>=t.length?t:t.substring(0,e)+"..."},eE=function(t,e){var r=[],n={},i={};t.forEach(function(t){i[t.id]=t}),t.forEach(function(t,e){var o=(0,Ew.clone)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo ".concat(o.id," can not be the same as the combo's id")),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo ".concat(o.id," does not exist!")),delete o.parentId);var a=n[o.id];if(a){if(o.children=a.children,n[o.id]=o,!(a=o).parentId)return void r.push(a);var s=n[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var u={id:a.parentId,children:[a]};n[a.parentId]=u,n[o.id]=o}}else if((0,Ew.isString)(t.parentId)){var l=n[t.parentId];if(l)l.children?l.children.push(o):l.children=[o],n[o.id]=o;else{var c={id:t.parentId,children:[o]};n[c.id]=c,n[o.id]=o}}else r.push(o),n[o.id]=o});var o={};(e||[]).forEach(function(t){o[t.id]=t;var e=n[t.comboId];if(e){var r={id:t.id,comboId:t.comboId};e.children?e.children.push(r):e.children=[r],r.itemType="node",n[t.id]=r}});var a=0;return r.forEach(function(t){t.depth=a+10,KS(t,function(t){var e,r=n[t.id].itemType;e="node"===r?n[t.comboId]:n[t.parentId],t.depth=e&&"node"===r?a+1:a+10,a-1&&o.splice(l,1),s||(i={id:e,itemType:"node",comboId:r},a[e]={children:void 0}),e){var c=!1;if(r){var f=0;(t||[]).forEach(function(t){c||KS(t,function(t){return r!==t.id||(c=!0,t.children?t.children.push(i):t.children=[i],f=t.depth,"node"===i.itemType?i.depth=f+2:i.depth=f+1,!1)})})}else r&&c||"node"===i.itemType||t.push(i);var h=i.depth;KS(i,function(t){return"node"===t.itemType?h+=2:h+=1,t.depth=h,!0})}return t},nE=function(t,e,r){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||0===t.length){var i=(null===r||void 0===r?void 0:r.getModel())||{},o=i.x,a=i.y,s=i.fixSize,u=i.collapsed,l=i.fixCollapseSize,c=u?l:s,f=(0,Ew.isArray)(c)?c:[c,c],h=f[0],p=f[1],d=[h/2,p/2];return{minX:o-d[0],minY:a-d[1],maxX:o+d[0],maxY:a+d[1],x:o,y:a,width:h,height:p}}return t.forEach(function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxXr&&(r=l),c>i&&(i=c)}return{x:Math.floor(e),y:Math.floor(n),width:Math.ceil(r)-Math.floor(e),height:Math.ceil(i)-Math.floor(n),minX:e,minY:n,maxX:r,maxY:i}},gE=function(t,e,r,n,i){void 0===e&&(e=15),void 0===r&&(r="quadratic"),void 0===n&&(n=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},l=[],c={},f=0;fn.get("optimizeThreshold")){var a=1/0,s=1/0,u=-1/0,l=-1/0;o.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;a>r&&(a=r),s>n&&(s=n),up&&(d=p,console.warn("fitview failed, ratio out of range, ratio: %f",a,"graph maxzoom has been used instead"));var y=(0,mE.vs)(f,[["t",-i.x,-i.y],["s",d,d],["t",i.x,i.y]]),v=aE({animateCfg:r,callback:function(){t.setMatrix(y),u.emit("viewportchange",{action:"translate",matrix:f}),u.emit("viewportchange",{action:"zoom",matrix:y})}});t.stopAnimate(),t.setMatrix(e),t.animate(function(t){return{matrix:jS(e,y,t)}},v)}else{var g=aE({animateCfg:r,callback:function(){u.emit("viewportchange",{action:"translate",matrix:f})}});t.animate(function(t){return{matrix:jS(e,f,t)}},g)}}},t.prototype.fitView=function(t,e){var r,n=this.graph,i=this.getFormatPadding(),o=n.get("width"),a=n.get("height"),s=n.get("group"),u=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var l=n.getNodes();if(l.length>n.get("optimizeThreshold")){var c=1/0,f=1/0,h=-1/0,p=-1/0;l.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;c>r&&(c=r),f>n&&(f=n),hg&&(m=g),t)this.animatedFitView(s,u,e,r,d,y,m,!0);else{var b=d.x-y.x,x=d.y-y.y;if(yE(b)||yE(x))return;n.translate(b,x),n.zoom(m,d)||console.warn("zoom failed, ratio out of range, ratio: %f",m)}}},t.prototype.fitViewByRules=function(t,e,r){var n,i=t.onlyOutOfViewPort,o=void 0!==i&&i,a=t.direction,s=void 0===a?"both":a,u=t.ratioRule,l=void 0===u?"min":u,c=this.graph,f=this.getFormatPadding(),h=c.get("width"),p=c.get("height"),d=c.get("group"),y=d.getMatrix()||[1,0,0,0,1,0,0,0,1];d.resetMatrix();var v=c.getNodes();if(v.length>c.get("optimizeThreshold")){var g=1/0,m=1/0,b=-1/0,x=-1/0;v.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;g>r&&(g=r),m>n&&(m=n),bc.maxX&&(c.maxX=p.maxX),p.maxY>c.maxY&&(c.maxY=p.maxY)}if(c.x=c.minX,c.y=c.minY,c.width=c.maxX-c.minX,c.height=c.maxY-c.minY,0!==c.width&&0!==c.height){var d=this.getViewCenter(),y={x:c.x+c.width/2,y:c.y+c.height/2},v=(a-o[1]-o[3])/c.width,g=(s-o[0]-o[2])/c.height,m=v;v>g&&(m=g),r?this.animatedFitView(u,l,n,c,d,y,m,e):(i.translate(d.x-y.x,d.y-y.y),e&&!i.zoom(m,d)&&console.warn("zoom failed, ratio out of range, ratio: %f",m))}}},t.prototype.changeSize=function(t,e){var r=this.graph;if(!(0,Ew.isNumber)(t)||!(0,Ew.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:t,height:e}),r.get("canvas").changeSize(t,e),r.get("plugins").forEach(function(t){t.get("gridContainer")&&t.positionInit()})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}();function xE(t){"@babel/helpers - typeof";return(xE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wE(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},r=e(t);if("string"!=typeof r)return r;for(var n=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;en.width&&(n.width=c.width+c.x),c.height+c.y>n.height&&(n.height=c.height+c.y)}}}return t.bbox=function(t,e,r){var n,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:r.width||0,height:r.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,n=2*a.r);break;case"text":a.text&&(i=$S(a.text,a.fontSize||12)[0],n=16,s.y+=n,s.height=n,s.width=i,t.attrs=(0,Sw.__assign)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(n=a.height)}return n>=0&&(s.height=n),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,n),t.attrs=(0,Sw.__assign)((0,Sw.__assign)({},t.attrs),t.bbox),t}function kE(t){var e={},r=function(e){var r="function"==typeof t?t(e):t,n=SE(r)(e),i=document.createElement("div");i.innerHTML=n;var o=EE(function t(e,r){var n={},i=e.getAttributeNames&&e.getAttributeNames()||[],o=e.children&&Array.from(e.children).map(function(e){return t(e,r)}),a={},s=e.tagName?e.tagName.toLowerCase():"group";return"text"===s&&(n.text=e.innerText),a.type=s,"img"===s&&(a.type="image"),Array.from(i).forEach(function(t){var r=_E(t),i=e.getAttribute(t);try{if("style"===r||"attrs"===r){var o=wE(i);n=(0,Sw.__assign)((0,Sw.__assign)({},n),o)}else a[r]=wE(i)}catch(t){if("style"===r)throw t;a[r]=i}}),a.attrs=n,r&&r.style&&a.name&&"object"===xE(r.style[a.name])&&(a.attrs=(0,Sw.__assign)((0,Sw.__assign)({},a.attrs),r.style[a.name])),r&&r.style&&a.keyshape&&(a.attrs=(0,Sw.__assign)((0,Sw.__assign)({},a.attrs),r.style)),o.length&&(a.children=o),a}(i.children[0],e));return i.remove(),o};return{draw:function(t,n){var i=r(t),o=n;return function t(e){var r=e.attrs,i=void 0===r?{}:r,a=e.bbox,s=e.type,u=e.children,l=(0,Sw.__rest)(e,["attrs","bbox","type","children"]);if("group"!==e.type){var c=n.addShape(e.type,(0,Sw.__assign)({attrs:i,origin:{bbox:a,type:s,children:u}},l));e.keyshape&&(o=c)}e.children&&e.children.forEach(function(e){return t(e)})}(i),e[t.id]=[i],o},update:function(t,n){e[t.id]||(e[t.id]=[]);var i=n.getContainer(),o=i.get("children"),a=r(t),s=function t(e){var r;"group"!==e.type&&i.addShape(e.type,{attrs:e.attrs}),(null===(r=e.children)||void 0===r?void 0:r.length)&&e.children.map(function(e){return t(e)})},u=function t(e){var r,n=o.find(function(t){return t.attrs.key===e.attrs.key});n&&i.removeChild(n),(null===(r=e.children)||void 0===r?void 0:r.length)&&e.children.map(function(e){return t(e)})};!function t(e){var r=e.key;if("group"!==e.type){var i=o.find(function(t){return t.attrs.key===r});switch(e.action){case"change":if(i){var a=e.val.keyshape?n.getOriginStyle():{};i.attr((0,Sw.__assign)((0,Sw.__assign)({},a),e.val.attrs))}break;case"add":s(e.val);break;case"delete":u(e.val);break;case"restructure":u(e.formerTarget),s(e.nowTarget)}}e.children&&e.children.forEach(function(e){return t(e)})}(function t(e,r){var n,i,o,a,s=(e||{}).type,u=((null===r||void 0===r?void 0:r.attrs)||{}).key;if(u&&e&&(e.attrs.key=u),!e&&r)return{action:"delete",val:r,type:s,key:u};if(e&&!r)return{action:"add",val:e,type:s};if(!e&&!r)return{action:"same",type:s};var l=[];if((null===(n=e.children)||void 0===n?void 0:n.length)>0||(null===(i=r.children)||void 0===i?void 0:i.length)>0)for(var c=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=r.children)||void 0===a?void 0:a.length),f=r.children||[],h=e.children||[],p=0;p-1)return;r.push(i)}else s>-1&&r.splice(s,1)}else if((0,Ew.isString)(e)){var u=r.filter(function(t){return t.includes(o)});u.length>0&&this.clearStates(u),(a=a.filter(function(t){return!t.includes(o)})).push(i),this.set("states",a)}if(n){var l=this.get("model").type;n.setState(l,t,e,this)}},t.prototype.clearStates=function(t){var e=this,r=e.getStates(),n=e.get("shapeFactory"),i=e.get("model").type;t||(t=r),(0,Ew.isString)(t)&&(t=[t]);var o=r.filter(function(e){return-1===t.indexOf(e)});e.set("states",o),t.forEach(function(t){n.setState(i,t,!1,e)})},t.prototype.setOptimize=function(t){this.optimize=t},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},t.prototype.getUpdateType=function(t){},t.prototype.update=function(t,e){void 0===e&&(e=void 0);var r=this.get("model");if("move"===e)this.updatePosition(t);else{var n=r.visible,i=t.visible;n!==i&&void 0!==i&&this.changeVisibility(i);var o={x:r.x,y:r.y};t.x=isNaN(+t.x)?r.x:+t.x,t.y=isNaN(+t.y)?r.y:+t.y;var a=this.get("styles");if(t.stateStyles){var s=t.stateStyles;(0,Ew.mix)(a,s),delete t.stateStyles}Object.assign(r,t),o.x===t.x&&o.y===t.y||this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(t){var e=this.get("shapeFactory"),r=this.get("model"),n=r.type;if(e.shouldUpdate(n)&&n===this.get("currentShape")){var i=this.getShapeCfg(r,t);e.baseUpdate(n,i,this,t),"move"!==t&&this.setOriginStyle()}else this.draw();this.restoreStates(e,n)},t.prototype.updatePosition=function(t){var e=this.get("model"),r=isNaN(+t.x)?+e.x:+t.x,n=isNaN(+t.y)?+e.y:+t.y,i=this.get("group");if(isNaN(r)||isNaN(n))return!1;e.x=r,e.y=n;var o=i.getMatrix();return(!o||o[6]!==r||o[7]!==n)&&(i.resetMatrix(),pS(i,{x:r,y:n}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),LE={source:"start",target:"end"},jE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var r=LE[t]+"Point",n=t+"Node",i=this.get(n);i&&!i.destroyed&&i.removeEdge(this),(0,Ew.isPlainObject)(e)?(this.set(r,e),this.set(n,null)):e&&(e.addEdge(this),this.set(n,e),this.set(r,null))},e.prototype.getLinkPoint=function(t,e,r){var n=LE[t]+"Point",i=t+"Node",o=this.get(n);if(!o){var a=this.get(i),s=t+"Anchor",u=this.getPrePoint(t,r),l=e[s];(0,Ew.isNil)(l)||(o=a.getLinkPointByAnchor(l)),o=o||a.getLinkPoint(u),(0,Ew.isNil)(o.index)||this.set("".concat(t,"AnchorIndex"),o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var r="source"===t?"target":"source";return this.getEndPoint(r)},e.prototype.getEndPoint=function(t){var e=t+"Node",r=LE[t]+"Point",n=this.get(e);return n&&!n.destroyed?n.get("model"):this.get(r)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),r=this.getEndPoint("target"),n=this.get("shapeFactory"),i=t.type;return n.getControlPoints(i,{startPoint:e,endPoint:r})},e.prototype.getEndCenter=function(t){var e=t+"Node",r=LE[t]+"Point",n=this.get(e);if(n){var i=n.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(r)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e,r){var n=this.get("linkCenter"),i=(null===r||void 0===r?void 0:r.includes("move"))?e:t.prototype.getShapeCfg.call(this,e);if(n)i.startPoint=this.getEndCenter("source"),i.endPoint=this.getEndCenter("target");else{var o=i.controlPoints||this.getControlPointsByCenter(i);i.startPoint=this.getLinkPoint("source",e,o),i.endPoint=this.getLinkPoint("target",e,o)}return i.sourceNode=this.get("sourceNode"),i.targetNode=this.get("targetNode"),i},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("source".concat("Node")),r=this.get("target".concat("Node"));return e?delete t["source".concat("Node")]:t.source=this.get("start".concat("Point")),r?delete t["target".concat("Node")]:t.target=this.get("end".concat("Point")),(0,Ew.isString)(t.source)||(0,Ew.isPlainObject)(t.source)||(t.source=t.source.getID()),(0,Ew.isString)(t.target)||(0,Ew.isPlainObject)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=void 0);var r=this.get("model"),n=r.visible,i=t.visible;n!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("source"),a=this.get("target");if(o&&!o.destroyed&&a&&!a.destroyed){var s=this.get("styles");if(t.stateStyles){var u=t.stateStyles;(0,Ew.mix)(s,u),delete t.stateStyles}Object.assign(r,t),this.updateShape(e),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var e=this.get("source".concat("Node")),r=this.get("target".concat("Node"));e&&!e.destroyed&&e.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),t.prototype.destroy.call(this)},e}(IE),NE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getNearestPoint=function(t,e){for(var r=0,n=t[0],i=lS(t[0],e),o=0;o-1&&e.splice(r,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.getUpdateType=function(t){var e,r,n,i,o;if(t){var a=!(0,Ew.isNil)(t.x),s=!(0,Ew.isNil)(t.y),u=Object.keys(t);return 1===u.length&&(a||s)||2===u.length&&a&&s?"move":(0,Ew.isNumber)(t.x)||(0,Ew.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(null===t||void 0===t?void 0:t.style)&&((null===(e=null===t||void 0===t?void 0:t.style)||void 0===e?void 0:e.r)||(null===(r=null===t||void 0===t?void 0:t.style)||void 0===r?void 0:r.width)||(null===(n=null===t||void 0===t?void 0:t.style)||void 0===n?void 0:n.height)||(null===(i=null===t||void 0===t?void 0:t.style)||void 0===i?void 0:i.rx)||(null===(o=null===t||void 0===t?void 0:t.style)||void 0===o?void 0:o.ry))?"bbox|label":u.includes("label")||u.includes("labelCfg")?"style|label":"style"}},e.prototype.setState=function(e,r){var n=this;this.optimize?t.prototype.setState.call(this,e,r):this.runWithBBoxAffected(function(){return t.prototype.setState.call(n,e,r)})},e.prototype.clearStates=function(e){var r=this;this.optimize?t.prototype.clearStates.call(this,e):this.runWithBBoxAffected(function(){return t.prototype.clearStates.call(r,e)})},e.prototype.runWithBBoxAffected=function(t){var e=["r","width","height","rx","ry","lineWidth"],r=this.getKeyShape().attr(),n={};Object.keys(this.getKeyShape().attr()).forEach(function(t){e.includes(t)&&(n[t]=r[t])}),t();for(var i=this.getKeyShape().attr(),o=0;o-1&&(e.splice(r,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(NE),DE=function(){function t(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,Ew.throttle)(function(t){var r=e.graph;if(r&&!r.get("destroyed")){var n=e.edgeToBeUpdateMap;if(n){var i=Object.values(n);i.length&&(i.forEach(function(t){var e=t.edge;if(e&&!e.destroyed){var r=e.getSource(),n=e.getTarget();r&&!r.destroyed&&n&&!n.destroyed&&e.refresh(t.updateType)}}),e.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var r=this.graph,n="vedge"===t?"edge":t,i=r.get("".concat(n,"Group"))||r.get("group"),o=(0,Ew.upperFirst)(n),a=null,s=r.get(n+(0,Ew.upperFirst)("stateStyles"))||{},u=r.get("default"+o);e.stateStyles&&(s=e.stateStyles),u&&(0,Ew.each)(u,function(t,r){(0,Ew.isObject)(t)&&!(0,Ew.isArray)(t)?e[r]=(0,Ew.deepMix)({},t,e[r]):(0,Ew.isArray)(t)?e[r]=e[r]||(0,Ew.clone)(u[r]):e[r]=e[r]||u[r]});var l=r.get(n+"Mapper");if(l){var c=l(e);c.stateStyles&&(s=c.stateStyles,delete c.stateStyles),(0,Ew.each)(c,function(t,r){(0,Ew.isObject)(t)&&!(0,Ew.isArray)(t)?e[r]=(0,Ew.deepMix)({},e[r],t):e[r]=c[r]||e[r]})}if(r.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,h=void 0;if(f=e.source,h=e.target,f&&(0,Ew.isString)(f)&&(f=r.findById(f)),h&&(0,Ew.isString)(h)&&(h=r.findById(h)),!f||!h)return void console.warn("The source or target node of edge ".concat(e.id," does not exist!"));f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),h.getType&&"combo"===h.getType()&&(e.isComboEdge=!0),a=new jE({model:e,source:f,target:h,styles:s,linkCenter:r.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new NE({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var p=e.children,d=nE(p,r),y=void 0,v=void 0;if(isNaN(d.x)?isNaN(e.x)&&(y=100*Math.random()):y=d.x,isNaN(d.y)?isNaN(e.y)&&(v=100*Math.random()):v=d.y,isNaN(e.x)||isNaN(e.y))e.x=y,e.y=v;else{var g=e.x-y,m=e.y-v;this.updateComboSucceeds(e.id,g,m,p)}var b=i.addGroup();b.setZIndex(e.depth),a=new RE({model:e,styles:s,animate:r.get("animate"),bbox:e.collapsed?nE([],r):d,group:b}),e.collapsed||"circle"!==a.getKeyShape().get("type")||(d.width=Math.hypot(d.height,d.width),d.height=d.width,a.set("bbox",d),a.refresh());var x=a.getModel();(p||[]).forEach(function(t){var e=r.findById(t.id);a.addChild(e),t.depth=x.depth+2})}if(a)return a.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(t,"s")).push(a),r.get("itemMap")[a.get("id")]=a,r.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var r,n,i=this,o=this.graph;if((0,Ew.isString)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a="";t.getType&&(a=t.getType());var s=o.get(a+"Mapper"),u=t.getModel(),l=u.x,c=u.y,f=t.getUpdateType(e);if(s){var h=s((0,Ew.deepMix)({},u,e)),p=(0,Ew.deepMix)({},u,h,e);h.stateStyles&&(t.set("styles",p.stateStyles),delete p.stateStyles),(0,Ew.each)(p,function(t,r){e[r]=t})}else(0,Ew.each)(e,function(t,r){u[r]&&(0,Ew.isObject)(t)&&!(0,Ew.isArray)(t)&&(e[r]=(0,Sw.__assign)((0,Sw.__assign)({},u[r]),e[r]))});if(o.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===a){if(e.source){var d=e.source;(0,Ew.isString)(d)&&(d=o.findById(d)),t.setSource(d)}if(e.target){var y=e.target;(0,Ew.isString)(y)&&(y=o.findById(y)),t.setTarget(y)}t.update(e)}else if("node"===a){t.update(e,f);var v=t.getEdges();"move"===f?(0,Ew.each)(v,function(t){i.edgeToBeUpdateMap[t.getID()]={edge:t,updateType:f},i.throttleRefresh()}):(null===f||void 0===f?void 0:f.includes("bbox"))&&(0,Ew.each)(v,function(t){t.refresh(f)})}else if("combo"===a){if(t.update(e,f),!isNaN(e.x)||!isNaN(e.y)){var g=e.x-l||0,m=e.y-c||0;this.updateComboSucceeds(u.id,g,m)}var b=t.getEdges();if(((null===f||void 0===f?void 0:f.includes("bbox"))||"move"===f)&&"combo"===a){var x=t.get("shapeFactory"),w=u.type||"circle";(void 0===u.animate||void 0===e.animate?null===(n=null===(r=x[w])||void 0===r?void 0:r.options)||void 0===n?void 0:n.animate:u.animate||e.animate)?setTimeout(function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(0,Ew.each)(b,function(t){t&&!t.destroyed&&t.refresh()})}},201):(0,Ew.each)(b,function(t){t.refresh()})}}t.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e,r){var n,i,o=this,a=this.graph;if((0,Ew.isString)(t)&&(t=a.findById(t)),t&&!t.destroyed){var s=t.getModel(),u=nE(e,a,t),l=u.x,c=u.y;t.set("bbox",u);var f=l,h=c;r?(f=isNaN(s.x)?l:s.x,h=isNaN(s.y)?c:s.y):(f=isNaN(l)?s.x:l,h=isNaN(c)?s.y:c),t.update({x:f,y:h});var p=t.get("shapeFactory"),d=s.type||"circle";(void 0===s.animate?null===(i=null===(n=p[d])||void 0===n?void 0:n.options)||void 0===i?void 0:i.animate:s.animate)?setTimeout(function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(s),o.updateComboEdges(t))}},201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e,r,n=t.getEdges()||[],i=0;i-1&&o.splice(a,1),"edge"===i){var s=r.get("v".concat(i,"s")),u=s.indexOf(t);u>-1&&s.splice(u,1)}var l=t.get("id");delete r.get("itemMap")[l];var c=r.get("comboTrees"),f=t.get("id");if("node"===i){var h=t.getModel().comboId;if(c&&h){var p=c,d=!1;c.forEach(function(t){d||KS(t,function(t){if(t.id===f&&p){var e=p.indexOf(t);return p.splice(e,1),d=!0,!1}return p=t.children,!0})})}for(var y=(b=t.getEdges()).length-1;y>=0;y--)r.removeItem(b[y],!1);h&&r.updateCombo(h)}else if("combo"===i){var v,g=t.getModel().parentId,m=!1;(c||[]).forEach(function(t){m||KS(t,function(t){return t.id!==f||(v=t,m=!0,!1)})}),v.removed=!0,v&&v.children&&v.children.forEach(function(t){e.removeItem(t.id)});var b;for(y=(b=t.getEdges()).length;y>=0;y--)r.removeItem(b[y],!1);g&&r.updateCombo(g)}t.destroy(),r.emit("afterremoveitem",{item:n,type:i})}},t.prototype.setItemState=function(t,e,r){var n=this.graph,i=e;(0,Ew.isString)(r)&&(i="".concat(e,":").concat(r)),t.hasState(i)===r&&r||(0,Ew.isString)(r)&&t.hasState(i)||(n.emit("beforeitemstatechange",{item:t,state:i,enabled:r}),t.setState(e,r),n.autoPaint(),n.emit("afteritemstatechange",{item:t,state:i,enabled:r}))},t.prototype.priorityState=function(t,e){var r=this.graph,n=t;(0,Ew.isString)(t)&&(n=r.findById(t)),this.setItemState(n,e,!1),this.setItemState(n,e,!0)},t.prototype.clearItemStates=function(t,e){var r=this.graph;(0,Ew.isString)(t)&&(t=r.findById(t)),r.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),r.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;(0,Ew.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var r=this,n=this.graph;(t||[]).forEach(function(t){JS(t,function(t){var n;return e.forEach(function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,n=e)}),n&&r.addItem("combo",n),!0})});var i=n.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var r=this,n=this.graph;if((0,Ew.isString)(t)&&(t=n.findById(t)),t){if(n.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();(0,Ew.each)(i,function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&r.changeItemVisibility(t,e)})}else if(t.getType&&"combo"===t.getType()){var o=n.get("comboTrees"),a=t.get("id"),s=[],u=!1;(o||[]).forEach(function(t){u||t.children&&0!==t.children.length&&KS(t,function(t){return t.id!==a||(s=t.children,u=!0,!1)})}),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach(function(t){var i=n.findById(t.id);r.changeItemVisibility(i,e)});i=t.getEdges();(0,Ew.each)(i,function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&r.changeItemVisibility(t,e)})}return n.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),BE=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.updateState=function(t,e,r){var n=this.graph.get("states"),i=e;(0,Ew.isString)(r)&&(i="".concat(e,":").concat(r)),n[i]||(n[i]=[]),r?n[i].push(t):n[i]=n[i].filter(function(e){return e!==t}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:n})},t.prototype.updateStates=function(t,e,r){var n=this.graph.get("states");((0,Ew.isString)(e)?[e]:e).forEach(function(e){var i=e;n[i]||(n[i]=[]),(0,Ew.isString)(r)&&(i="".concat(e,":").concat(r)),r?n[i].push(t):n[i]=n[i].filter(function(e){return e!==t})}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:e})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),FE=r(6014),zE=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,r){if("\\"===t.charAt(0))return t.slice(1);var n=e[r];return 0===n&&(n="0"),n||""}):t},UE=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));for(var r=0,n=t;r0?s-1:o-1,l=Q_.normalize([0,0],Q_.add([0,0],a[u].v,Q_.scale([0,0],a[s].v,-1)));a[s].p=Q_.add([0,0],a[s].p,Q_.scale([0,0],l,e))}return a.map(function(t){var e=t.p;return{x:e[0],y:e[1]}})}var JE=function(t,e){for(var r=[],n=0;n<5;n++){var i=Math.cos((18+72*n)/180*Math.PI)*t,o=Math.sin((18+72*n)/180*Math.PI)*t,a=Math.cos((54+72*n)/180*Math.PI)*e,s=Math.sin((54+72*n)/180*Math.PI)*e;0===n?r.push(["M",i,-o]):r.push(["L",i,-o]),r.push(["L",a,-s])}return r.push(["Z"]),r},QE=function(t,e,r){return(t.y-r.y)*(e.x-r.x)-(t.x-r.x)*(e.y-r.y)},$E=function(t){var e=t.map(function(t){return{x:t.getModel().x,y:t.getModel().y}});e.sort(function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x});for(var r={},n=e.length-1;n>=0;n--){var i=e[n],o=i.x,a=i.y;r["".concat(o,"-").concat(a)]&&e.splice(n,1),r["".concat(o,"-").concat(a)]=!0}if(1===e.length)return e;var s=[];for(n=0;n=2&&QE(s[s.length-2],s[s.length-1],e[n])<=0;)s.pop();s.push(e[n])}var u=[];for(n=e.length-1;n>=0;n--){for(;u.length>=2&&QE(u[u.length-2],u[u.length-1],e[n])<=0;)u.pop();u.push(e[n])}return u.pop(),s.pop(),s.concat(u)},tk={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function ek(t,e,r){var n=!1,i=function(t,r){return e.cells[t+r*e.width]},o=function(t,e){var n=0;return i(t-1,e-1)>=r&&(n+=1),i(t,e-1)>r&&(n+=2),i(t-1,e)>r&&(n+=4),i(t,e)>r&&(n+=8),n},a=function(r,n){for(var i,a,s=r,u=n,l=0;l-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var c=o(s,u);switch(c){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: ".concat(c)),!0}}};this.march=function(){for(var t=0;tr&&15!==o(t,s)&&(n=a(t,s));return n}}var rk=function(t,e,r){var n=null,i=Number.POSITIVE_INFINITY;return e.forEach(function(e){var o={x:t.getModel().x,y:t.getModel().y},a={x:e.getModel().x,y:e.getModel().y},s=OS(o,a),u=new _S(o.x,o.y,a.x,a.y),l=r.reduce(function(t,e){return TS(e,u)>0?t+1:t},0);s*Math.pow(l+1,2)=0&&i=1;)h=sk(r,c/=1.5,f,s),p=u(h,o)||u(h,i),d=l(h,e);!h||p||s&&d||(o.push(new _S(t.x1,t.y1,h.x,h.y)),o.push(new _S(h.x,h.y,t.x2,t.y2)),a=!0)};h(!0),a||h(!1)}}a||i.push(t),s+=1};!a&&o.length;)c()}for(;o.length;)i.push(o.pop());return i};var ok=function(t,e,r){var n=Object.assign(tk,r),i=CS(t.map(function(t){return{x:t.getModel().x,y:t.getModel().y}})),o=[],a=[];(t=t.sort(function(t,e){return OS({x:t.getModel().x,y:t.getModel().y},i)-OS({x:e.getModel().x,y:e.getModel().y},i)})).forEach(function(t){(function(t,e,r,n,i){var o=rk(t,r,e);if(null===o)return[];var a=new _S(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y);return function(t){for(var r=[];t.length>0;){var n=t.pop();if(0===t.length){r.push(n);break}var i=t.pop(),o=new _S(n.x1,n.y1,i.x2,i.y2);nk(e,o)?(r.push(n),t.push(i)):t.push(o)}return r}(ik(a,e,n,i))})(t,e,o,n.maxRoutingIterations,n.morphBuffer).forEach(function(t){a.push(t)}),o.push(t)});for(var s,u,l,c,f,h=function(t,e,r){var n={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach(function(t){i.push(t.getBBox())}),e.forEach(function(t){i.push(t.getBBox())});for(var o=0,a=i;on.maxX?s.maxX:n.maxX)+r,n.maxY=(s.maxY>n.maxY?s.maxY:n.maxY)+r}return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.x=n.minX,n.y=n.minY,n}(t,a,n.nodeR0),p=(s=h.width,u=h.height,l=n.pixelGroupSize,c=Math.ceil(s/l),f=Math.ceil(u/l),{cells:new Float32Array(Math.max(0,c*f)).fill(0),width:c,height:f}),d=[],y=[],v=0;v1)for(m=Math.floor(g.length/n.skip);m<3&&n.skip>1;)n.skip-=1,m=Math.floor(g.length/n.skip);for(var b=0,x=0;x0))break;n.nonMemberInfluenceFactor*=.8}}return y};function ak(t,e,r,n,i,o){function a(t,e){var r=Math.floor((t-e)/o.pixelGroupSize);return r<0?0:r}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),l=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),c=function(t,e){return[Math.min(a(t.minX,e+n.minX),i.width),Math.min(a(t.minY,e+n.minY),i.height),Math.min(a(t.maxX,-e+n.minX),i.width),Math.min(a(t.maxY,-e+n.minY),i.height)]},f=function(t,e){for(var r=t.getBBox(),a=c(r,o.nodeR1),u=a[0],l=a[1],f=a[2],h=a[3],p=l;pu.y?n?l.topLeft:l.bottomRight:n?l.topRight:l.bottomLeft:a.ys.x?n?l.topLeft:l.bottomRight:n?l.bottomLeft:l.topRight:o.x0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var r,n,i;switch(this.type){case"round-convex":i=ZE((r=$E(t)).map(function(t){return[t.x,t.y]}),this.padding),n=(0,FE.tr)(i);break;case"smooth-convex":2===(r=$E(t)).length?(i=ZE(r.map(function(t){return[t.x,t.y]}),this.padding),n=(0,FE.tr)(i)):r.length>2&&(i=KE(r.map(function(t){return[t.x,t.y]}),this.padding),n=WE(i));break;case"bubble":n=(r=ok(t,e,this.cfg.bubbleCfg)).length>=2&&WE(r)}return n},t.prototype.render=function(){this.group.addShape("path",{attrs:(0,Sw.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},t.prototype.addMember=function(t){if(t){(0,Ew.isString)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){(0,Ew.isString)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){(0,Ew.isString)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){(0,Ew.isString)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var r=this;this.group.findById(this.id).remove(),t&&(this.members=t.map(function(t){return(0,Ew.isString)(t)?r.graph.findById(t):t})),e&&(this.nonMembers=e.map(function(t){return(0,Ew.isString)(t)?r.graph.findById(t):t})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr((0,Sw.__assign)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=(0,Ew.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map(function(t){return(0,Ew.isString)(t)?e.graph.findById(t):t})),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(t){return(0,Ew.isString)(t)?e.graph.findById(t):t})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,r,n=this,i=(e=(0,Ew.isString)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))r=HE(i.attr("path"));else{var o=i.getCanvasBBox();r=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return r=r.map(function(t){var e=n.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]}),wS(r,HE(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),lk=Aw.vs,ck=function(t){function e(e){var r=t.call(this)||this;return r.sortCombos=(0,Ew.debounce)(function(){var t=r.get("comboSorted");if(r&&!r.destroyed&&!t){r.set("comboSorted",!0);var e=[],n={};(r.get("comboTrees")||[]).forEach(function(t){KS(t,function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0})}),(r.getEdges().concat(r.get("vedges"))||[]).forEach(function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]}),e.forEach(function(t){if(t&&t.length)for(var e=t.length-1;e>=0;e--){var n=r.findById(t[e]);n&&n.toFront()}})}},500,!1),r.cfg=(0,Ew.deepMix)(r.getDefaultCfg(),e),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new Y_(r.cfg.maxStep),r.redoStack=new Y_(r.cfg.maxStep)),r}return(0,Sw.__extends)(e,t),e.prototype.init=function(){this.initCanvas();var t=new bE(this),e=new uE(this),r=new DE(this),n=new BE(this);this.set({viewController:t,modeController:e,itemController:r,stateController:n}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(t){var e=(t.get("el")||{}).id,r=void 0===e?"g6":e,n=t.addGroup({id:"".concat(r,"-root"),className:zS.rootContainerClassName});if(this.get("groupByTypes")){var i=n.addGroup({id:"".concat(r,"-edge"),className:zS.edgeContainerClassName}),o=n.addGroup({id:"".concat(r,"-node"),className:zS.nodeContainerClassName}),a=n.addGroup({id:"".concat(r,"-combo"),className:zS.comboContainerClassName});a.toBack(),this.set({nodeGroup:o,edgeGroup:i,comboGroup:a})}var s=n.addGroup({id:"".concat(r,"-delegate"),className:zS.delegateContainerClassName});this.set({delegateGroup:s}),this.set("group",n)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},e.prototype.set=function(t,e){return(0,Ew.isPlainObject)(t)?this.cfg=(0,Sw.__assign)((0,Sw.__assign)({},this.cfg),t):this.cfg[t]=e,"enabledStack"!==t||!e||this.undoStack||this.redoStack||(this.undoStack=new Y_(this.cfg.maxStep),this.redoStack=new Y_(this.cfg.maxStep)),this},e.prototype.get=function(t){var e;return null===(e=this.cfg)||void 0===e?void 0:e[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){(0,Ew.isString)(t)&&(t=this.findById(t));var r=this.get("itemController");e||(e=t.get("states")),r.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var r,n=this.get("".concat(t,"s"));return(0,Ew.each)(n,function(t,n){if(e(t,n))return r=t}),r},e.prototype.findAll=function(t,e){var r=[];return(0,Ew.each)(this.get("".concat(t,"s")),function(t,n){e(t,n)&&r.push(t)}),r},e.prototype.findAllByState=function(t,e,r){return r?this.findAll(t,function(t){return t.hasState(e)&&r(t)}):this.findAll(t,function(t){return t.hasState(e)})},e.prototype.translate=function(t,e,r,n){var i=this,o=this.get("group"),a=(0,Ew.clone)(o.getMatrix());if(a||(a=[1,0,0,0,1,0,0,0,1]),r){var s=aE({animateCfg:n,callback:function(){return i.emit("viewportchange",{action:"translate",matrix:o.getMatrix()})}});dS(o,{x:o.getCanvasBBox().x+t,y:o.getCanvasBBox().y+e},r,s||{duration:500,easing:"easeCubic"})}else a=lk(a,[["t",t,e]]),o.setMatrix(a),this.emit("viewportchange",{action:"translate",matrix:a}),this.autoPaint()},e.prototype.moveTo=function(t,e,r,n){var i=this.get("group");dS(i,{x:t,y:e},r,n||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},e.prototype.fitView=function(t,e,r,n){t&&this.set("fitViewPadding",t);var i=this.get("viewController");e?i.fitViewByRules(e,r,n):i.fitView(r,n),this.autoPaint()},e.prototype.fitCenter=function(t,e){this.get("viewController").fitCenter(t,e),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,r){return this.get("modeController").updateBehavior(t,e,r),this},e.prototype.zoom=function(t,e,r,n){var i=this,o=this.get("group"),a=(0,Ew.clone)(o.getMatrix())||[1,0,0,0,1,0,0,0,1],s=this.get("minZoom"),u=this.get("maxZoom"),l=this.getZoom()||1,c=l*t,f=t,h=!1;if(s&&cu&&(f=u/l,h=!0),a=lk(a,e?[["t",-e.x,-e.y],["s",f,f],["t",e.x,e.y]]:[["s",f,f]]),r){var p=(0,Ew.clone)(o.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var d=p[0],y=d*f,v=aE({animateCfg:n,callback:function(){return i.emit("viewportchange",{action:"zoom",matrix:o.getMatrix()})}});o.animate(function(t){if(1===t)p=a;else{var r=LS(d,y,t)/p[0];p=lk(p,e?[["t",-e.x,-e.y],["s",r,r],["t",e.x,e.y]]:[["s",r,r]])}return{matrix:p}},v)}else o.setMatrix(a),this.emit("viewportchange",{action:"zoom",matrix:a}),this.autoPaint();return!h},e.prototype.zoomTo=function(t,e,r,n){var i=t/this.getZoom();return this.zoom(i,e,r,n)},e.prototype.focusItem=function(t,e,r){var n=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};r?o=r:void 0===r&&(o=this.get("animateCfg")),n.focus(t,i,o),this.autoPaint()},e.prototype.focusItems=function(t,e,r,n){this.get("viewController").focusItems(t,e,r,n)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var r=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var n=r.getID(),i={},o={};switch(r.getType()){case"node":i.nodes=[{id:n,visible:!1}],o.nodes=[{id:n,visible:!0}];break;case"edge":i.nodes=[{id:n,visible:!1}],o.edges=[{id:n,visible:!0}];break;case"combo":i.nodes=[{id:n,visible:!1}],o.combos=[{id:n,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var r=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var n=r.getID(),i={},o={};switch(r.getType()){case"node":i.nodes=[{id:n,visible:!0}],o.nodes=[{id:n,visible:!1}];break;case"edge":i.nodes=[{id:n,visible:!0}],o.edges=[{id:n,visible:!1}];break;case"combo":i.nodes=[{id:n,visible:!0}],o.combos=[{id:n,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var r=t;if((0,Ew.isString)(t)&&(r=this.findById(t)),!r&&(0,Ew.isString)(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(r){var n="";if(r.getType&&(n=r.getType()),e&&this.get("enabledStack")){var i=(0,Sw.__assign)((0,Sw.__assign)({},r.getModel()),{itemType:n}),o={};switch(n){case"node":o.nodes=[i],o.edges=[];for(var a=r.getEdges(),s=a.length-1;s>=0;s--)o.edges.push((0,Sw.__assign)((0,Sw.__assign)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===n)r.getModel().comboId&&this.updateComboTree(r,void 0,!1);if(this.get("itemController").removeItem(r),"combo"===n){var u=rE(this.get("comboTrees"));this.set("comboTrees",u)}}},e.prototype.innerAddItem=function(t,e,r){if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!(0,Ew.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var n,i=this.get("comboTrees")||[];if("combo"===t){var o=this.get("itemMap"),a=!1;if(i.forEach(function(i){a||JS(i,function(i){if(e.parentId===i.id){a=!0;var s=(0,Sw.__assign)({id:e.id,depth:i.depth+2},e);i.children?i.children.push(s):i.children=[s],e.depth=s.depth,n=r.addItem(t,e)}var u=o[i.id];return a&&u&&u.getType&&"combo"===u.getType()&&r.updateCombo(u,i.children),!0})}),!a){var s=(0,Sw.__assign)({id:e.id,depth:0},e);e.depth=s.depth,i.push(s),n=r.addItem(t,e)}this.set("comboTrees",i),e.collapsed&&(this.collapseCombo(n,!1),this.updateCombo(n))}else if("node"===t&&(0,Ew.isString)(e.comboId)&&i){var u;(u=this.findById(e.comboId))&&u.getType&&"combo"!==u.getType()&&console.warn("'".concat(e.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),n=r.addItem(t,e);var l=this.get("itemMap"),c=!1,f=!1;i.forEach(function(t){f||c||JS(t,function(t){if(t.id===e.id)return f=!0,!1;if(e.comboId===t.id&&!f){c=!0;var n=(0,Ew.clone)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return c&&l[t.id].getType&&"combo"===l[t.id].getType()&&r.updateCombo(l[t.id],t.children),!0})})}else n=r.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(u=this.findById(e.comboId||e.parentId))&&u.getType&&"combo"===u.getType()&&u.addChild(n);return n}console.warn("This item exists already. Be sure the id %c".concat(e.id,"%c is unique."),"font-size: 20px; color: red;","")},e.prototype.addItem=function(t,e,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!n);var o=this.get("itemController"),a=this.innerAddItem(t,e,o);if(!1===a||!0===a)return a;var s=this.get("combos");if(s&&s.length>0&&this.sortCombos(),this.autoPaint(),r&&this.get("enabledStack")){var u=(0,Sw.__assign)((0,Sw.__assign)({},a.getModel()),{itemType:t}),l={};switch(t){case"node":l.nodes=[u];break;case"edge":l.edges=[u];break;case"combo":l.combos=[u]}this.pushStack("add",{before:{},after:l})}return a},e.prototype.addItems=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=!0),void 0===r&&(r=!0);var n=this.get("comboSorted");this.set("comboSorted",n&&!r);for(var i=this.get("itemController"),o=[],a=0;a0&&this.sortCombos()}if(this.autoPaint(),e&&this.get("enabledStack")){var l={nodes:[],edges:[],combos:[]};for(a=0;a=0;p--)h[p].destroyed&&h.splice(p,1);c&&(i.addCombos(c),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",l,o.edges),(0,Ew.each)(u,function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&l.edges.indexOf(t)<0&&(delete u[e],i.remove(t,!1))}),(this.get("comboTrees")||[]).forEach(function(t){JS(t,function(t){return"combo"===n.findById(t.id).getType()&&t.collapsed&&n.collapseCombo(t.id,!1),!0})}),this.set({nodes:l.nodes,edges:l.edges});var d=(this.get("layout")||{}).relayoutAtChangeData,y=void 0===d||d,v=this.get("layoutController");return y&&v&&(v.changeData(function(){setTimeout(function(){var t;null===(t=i.getCombos())||void 0===t||t.forEach(function(t){t.set("animate",!0)})},0)}),i.get("animate")&&!v.getLayoutType()?(i.positionsAnimate(),null===(r=i.getCombos())||void 0===r||r.forEach(function(t){return t.set("animate",!0)})):i.autoPaint()),setTimeout(function(){a.set("localRefresh",s)},16),this.set("data",o),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e,r){var n=this;void 0===r&&(r=!0);var i=this.get("itemController");this.set("comboSorted",!1);var o,a="";if(t){if((0,Ew.isString)(t))a=t,o={id:t};else{if(!(a=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");o=t}var s=r&&this.get("enabledStack"),u={nodes:[],combos:[]};s&&e.forEach(function(t){var e=n.findById(t),r=e.getType();if("node"===r||"combo"===r){var i=e.getModel();u["".concat(r,"s")].push({id:t,parentId:"node"===r?i.comboId:i.parentId})}});var l=this.get("comboTrees"),c=new Set(e),f=new Map;l&&(l.forEach(function(t){JS(t,function(t,e,r){if(c.has(t.id)){if(e){var o=n.findById(e.id),a=n.findById(t.id);e.children.splice(r,1),o.removeChild(a),i.updateCombo(o,e.children)}"combo"===t.itemType&&f.set(t.id,t)}return!0})}),l=l.filter(function(t){return!c.has(t.id)}),this.set("comboTrees",l));var h={nodes:[],combos:[]},p=e.map(function(t){var e=n.findById(t),r=e.getModel(),i="";e.getType&&(i=e.getType());var o=f.get(t)||{id:e.getID(),itemType:i};return"combo"===i?(o.parentId=a,r.parentId=a):"node"===i&&(o.comboId=a,r.comboId=a),s&&h["".concat(i,"s")].push({id:r.id,parentId:a}),o});o.children=p,this.addItem("combo",o,!1),this.set("comboSorted",!1),l&&(l.forEach(function(t){KS(t,function(t){return t.id!==a||(t.itemType="combo",t.children=p,!1)})}),this.sortCombos()),s&&(h.combos.push(o),this.pushStack("createCombo",{before:u,after:h}));var d=this.findById(a);!d.getModel().parentId&&d.getChildren().combos.length&&this.updateComboTree(d,void 0,!1),setTimeout(function(){d.set("animate",!0)},0)}},e.prototype.uncombo=function(t,e){var r,n,i=this;void 0===e&&(e=!0);var o=t;if((0,Ew.isString)(t)&&(o=this.findById(t)),!o||o.getType&&"combo"!==o.getType())console.warn("The item is not a combo!");else{var a=o.getModel(),s=o.getModel().parentId,u=this.get("comboTrees");u||(u=[]);var l,c=this.get("itemMap"),f=o.get("id"),h=[],p=this.get("combos"),d=this.findById(s),y=e&&this.get("enabledStack"),v={};if(y&&((v=(0,Ew.clone)(a)).children=[]),u.forEach(function(t){l||JS(t,function(t){var e;if(t.id===f){l=t,o.getEdges().map(function(t){return t.getID()}).forEach(function(t){i.removeItem(t,!1)});var r=p.indexOf(o);p.splice(r,1),delete c[f];var n=(0,Ew.clone)(o.getModel());o.destroy(),i.emit("afterremoveitem",{item:n,type:"combo"})}return!s||!l||t.id!==s||(d.removeCombo(o),-1!==(r=(h=t.children).indexOf(l))&&h.splice(r,1),null===(e=l.children)||void 0===e||e.forEach(function(t){var e=i.findById(t.id),r=e.getModel();e.getType&&"combo"===e.getType()?(t.parentId=s,delete t.comboId,r.parentId=s,delete r.comboId):e.getType&&"node"===e.getType()&&(t.comboId=s,r.comboId=s),d.addChild(e),h.push(t)}),i.updateCombo(d),!1)})}),!s&&l){var g=u.indexOf(l);u.splice(g,1),null===(r=l.children)||void 0===r||r.forEach(function(t){t.parentId=void 0;var e=i.findById(t.id).getModel();delete e.parentId,delete e.comboId,"node"!==t.itemType&&u.push(t)})}if(y){var m={nodes:[],combos:[]},b={nodes:[],combos:[]};null===(n=l.children)||void 0===n||n.forEach(function(t){var e=i.findById(t.id).getType();"node"!==e&&"combo"!==e||(m["".concat(e,"s")].push({id:t.id,parentId:f}),b["".concat(e,"s")].push({id:t.id,parentId:s}))}),m.combos.push(v),this.pushStack("uncombo",{before:m,after:b})}}},e.prototype.updateCombos=function(t){var e=this;void 0===t&&(t=!1);var r=this.get("comboTrees"),n=this.get("itemController"),i=this.get("itemMap");(r||[]).forEach(function(r){JS(r,function(r){var o;if(!r)return!0;var a=i[r.id];if("combo"===(null===(o=null===a||void 0===a?void 0:a.getType)||void 0===o?void 0:o.call(a))){var s=(0,Sw.__spreadArray)([],a.getStates(),!0);(0,Ew.each)(s,function(t){return e.setItemState(a,t,!1)}),n.updateCombo(a,r.children,t),(0,Ew.each)(s,function(t){return e.setItemState(a,t,!0)})}return!0})}),this.sortCombos()},e.prototype.updateCombo=function(t){var e,r=this,n=t;if((0,Ew.isString)(t)&&(n=this.findById(t)),!n||n.getType&&"combo"!==n.getType())console.warn("The item to be updated is not a combo!");else{e=n.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach(function(t){JS(t,function(t){if(!t)return!0;var n=a[t.id];if(e===t.id&&n&&n.getType&&"combo"===n.getType()){var i=(0,Sw.__spreadArray)([],n.getStates(),!0);(0,Ew.each)(i,function(t){n.getStateStyle(t)&&r.setItemState(n,t,!1)}),o.updateCombo(n,t.children),(0,Ew.each)(i,function(t){n.getStateStyle(t)&&r.setItemState(n,t,!0)}),e&&(e=t.parentId)}return!0})})}},e.prototype.updateComboTree=function(t,e,r){void 0===r&&(r=!0);var n;this.set("comboSorted",!1);var i,o=(n=(0,Ew.isString)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(n.getType&&(s=n.getType()),e&&"combo"===s){var u,l=!0;if((this.get("comboTrees")||[]).forEach(function(t){u||KS(t,function(t){if(!u)return t.id===n.getID()&&(u=t),!0})}),KS(u,function(t){return t.id!==e||(l=!1,!1)}),!l)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(r&&this.get("enabledStack")){var c={},f={};"combo"===s?(c.combos=[{id:o.id,parentId:o.parentId}],f.combos=[{id:o.id,parentId:e}]):"node"===s&&(c.nodes=[{id:o.id,parentId:o.comboId}],f.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:c,after:f})}if(o.parentId||o.comboId){var h=this.findById(o.parentId||o.comboId);h&&h.removeChild(n)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(n));a&&((i=this.findById(a))&&i.removeChild(n));var p=rE(this.get("comboTrees"),o.id,e);this.set("comboTrees",p),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],r=[];return(0,Ew.each)(this.get("nodes"),function(e){t.push(e.getModel())}),(0,Ew.each)(this.get("edges"),function(t){e.push(t.getModel())}),(0,Ew.each)(this.get("combos"),function(t){r.push(t.getModel())}),{nodes:t,edges:e,combos:r}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),r=this.get("edges");(0,Ew.each)(t,function(t){t.refresh()}),(0,Ew.each)(e,function(t){t.refresh()}),(0,Ew.each)(r,function(t){t.refresh()})}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if((0,Ew.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(t){var e=this;e.emit("beforeanimate");var r=e.get("animateCfg"),n=r.onFrame,i=t?e.getNodes().concat(e.getCombos()):e.getNodes(),o=i.map(function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}});e.stopAnimate();var a=e.get("canvas");e.animating=!0,setTimeout(function(){a.animate(function(r){(0,Ew.each)(o,function(t){var i=e.findById(t.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model"),s=i.getContainer().getMatrix();if(void 0!==o&&null!==o||(s&&(o={x:s[6],y:s[7]}),i.set("originAttrs",o||0)),n){var u=n(i,r,t,o||{x:0,y:0});i.set("model",Object.assign(a,u))}else o?(a.x=o.x+(t.x-o.x)*r,a.y=o.y+(t.y-o.y)*r):(a.x=t.x,a.y=t.y)}}),e.refreshPositions(t)},{duration:r.duration,easing:r.easing,callback:function(){(0,Ew.each)(i,function(t){t.set("originAttrs",null)}),r.callback&&r.callback(),e.emit("afteranimate"),e.animating=!1}})},0)},e.prototype.refreshPositions=function(t){this.emit("beforegraphrefreshposition");var e,r=this.get("nodes"),n=this.get("edges"),i=this.get("vedges"),o=this.get("combos"),a={},s=function(t){(0,Ew.each)(t,function(t){e=t.getModel();var r=t.get("originAttrs");if(!r||e.x!==r.x||e.y!==r.y){var n=t.updatePosition({x:e.x,y:e.y});a[e.id]=n,e.comboId&&(a[e.comboId]=a[e.comboId]||n),e.parentId&&(a[e.parentId]=a[e.parentId]||n)}})};s(o),s(r),o&&0!==o.length&&(t?(s(o),this.updateCombos()):this.updateCombos()),(0,Ew.each)(n,function(t){var e=t.getSource().getModel(),r=t.getTarget();if(!(0,Ew.isPlainObject)(r)){var n=r.getModel();(a[e.id]||a[n.id]||t.getModel().isComboEdge)&&t.refresh()}}),(0,Ew.each)(i,function(t){t.refresh()}),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas").cfg.timeline;t&&t.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){var e;return void 0===t&&(t=!1),null===(e=this.get("canvas"))||void 0===e||e.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,e,r,n){var i=this;void 0===t&&(t={}),void 0===n&&(n=!0);var o=this.get("layoutController");if((0,Ew.isString)(t)&&(t={type:t}),e){var a=r;a||(a="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),a=this.getPointByCanvas(a.x,a.y);var s=["force","gForce","fruchterman","force2"];s.includes(t.type)||!t.type&&s.includes(null===o||void 0===o?void 0:o.layoutType)?t.center=[a.x,a.y]:this.once("afterlayout",function(t){var r=i.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];a.x=a.x*r[0]+r[6],a.y=a.y*r[0]+r[7];var n=i.getGroup().getCanvasBBox(),o=n.minX,s=n.maxX,u=n.minY,l={x:(o+s)/2,y:(u+n.maxY)/2};"begin"===e&&(l.x=o,l.y=u),i.translate(a.x-l.x,a.y-l.y)})}var u=(0,Sw.__assign)({},this.get("layout")),l={};Object.assign(l,u,t),t.pipes&&!t.type?delete l.type:!t.pipes&&l.type&&delete l.pipes,this.set("layout",l),o&&(o.isLayoutTypeSame(l)&&l.gpuEnabled===u.gpuEnabled?o.updateLayoutCfg(l):o.changeLayout(l),n&&this.get("enabledStack")&&this.pushStack("layout",{before:u,after:l}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");null===t||void 0===t||t.destroyLayout()},e.prototype.layout=function(){var t,e=this.get("layoutController"),r=this.get("layout");r&&e&&(r.workerEnabled?e.layout():(null===(t=e.layoutMethods)||void 0===t?void 0:t.length)?e.relayout(!0):e.layout())},e.prototype.collapseCombo=function(t,e){var r=this;if(void 0===e&&(e=!0),!this.destroyed)if((0,Ew.isString)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var n=t.getModel();this.get("itemController").collapseCombo(t,e),n.collapsed=!0;var i=this.getEdges().concat(this.get("vedges")),o=[],a=!1;(this.get("comboTrees")||[]).forEach(function(t){a||KS(t,function(t){if(a&&t.depth<=n.depth)return!1;if(n.id===t.id&&(a=!0),a){var e=r.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0})});var s={};i.forEach(function(t){var e=t.getModel(),i=e.isVEdge,a=e.size,u=void 0===a?1:a;if(!t.isVisible()||i){var l,c=t.getSource(),f=t.getTarget(),h=null;if(c.getModel().id===n.id||o.includes(c)&&!o.includes(f)?(h=f,l=!1):(f.getModel().id===n.id||!o.includes(c)&&o.includes(f))&&(h=c,l=!0),h){if(i)return void r.removeItem(t,!1);for(var p=h.getModel();!h.isVisible();){var d=p.parentId,y=p.comboId,v=d||y;if(!(h=r.findById(v))||!v)return;p=h.getModel()}var g=p.id,m=l?{source:g,target:n.id,size:u,isVEdge:!0}:{source:n.id,target:g,size:u,isVEdge:!0},b="".concat(m.source,"-").concat(m.target);if(s[b])return void(s[b].size+=u);s[b]=m}}}),this.addItems(Object.values(s).map(function(t){return{type:"vedge",model:t}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t,e){var r=this;if(void 0===e&&(e=!0),(0,Ew.isString)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").expandCombo(t,e),n.collapsed=!1;var i=this.getEdges().concat(this.get("vedges")),o=[],a=!1;(this.get("comboTrees")||[]).forEach(function(t){a||KS(t,function(t){if(a&&t.depth<=n.depth)return!1;if(n.id===t.id&&(a=!0),a){var e=r.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0})});var s={};i.forEach(function(t){if(!t.isVisible()||t.getModel().isVEdge){var e,i=t.getSource(),a=t.getTarget(),u=i.get("id"),l=a.get("id"),c=null;if(u===n.id||o.includes(i)&&!o.includes(a)?(c=a,e=!1):l===n.id||!o.includes(i)&&o.includes(a)?(c=i,e=!0):o.includes(i)&&o.includes(a)&&i.isVisible()&&a.isVisible()&&t.show(),c){var f=t.getModel(),h=f.isVEdge,p=f.size,d=void 0===p?1:p;if(h)return void r.removeItem(t,!1);for(var y=c.getModel();!c.isVisible();){var v=y.parentId,g=y.comboId,m=v||g;if(!(c=r.findById(m))||!m)return;y=c.getModel()}for(var b=y.id,x=e?a:i,w=x.getModel();!x.isVisible();){var _=w.parentId,S=w.comboId,E=_||S;if(!(x=r.findById(E))||!E)return;if(w.comboId===n.id||w.parentId===n.id)break;w=x.getModel()}var k=w.id;if(b){var T=e?{source:b,target:k,isVEdge:!0,size:d}:{source:k,target:b,isVEdge:!0,size:d},C="".concat(T.source,"-").concat(T.target);if(s[C])return void(s[C].size+=d);s[C]=T}}}}),this.addItems(Object.values(s).map(function(t){return{type:"vedge",model:t}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t,e){if(void 0===e&&(e=!0),(0,Ew.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var r=t.getModel(),n=this.findById(r.parentId);n;){var i=n.getModel();if(i.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(i.parentId)}r.collapsed?this.expandCombo(t,e):this.collapseCombo(t,e),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,e){var r=t;return(0,Ew.isString)(t)&&(r=this.findById(t)),r.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,r){void 0===e&&(e=void 0),void 0===r&&(r=!1);var n=t;(0,Ew.isString)(t)&&(n=this.findById(t));var i=this.get("degrees");i&&!r||(i=Vw(this.save()),this.set("degrees",i));var o=i[n.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,e,r){if(void 0===t&&(t="update"),void 0===r&&(r="undo"),this.get("enabledStack")){var n=e?(0,Ew.clone)(e):{before:{},after:(0,Ew.clone)(this.save())};"redo"===r?this.redoStack.push({action:t,data:n}):this.undoStack.push({action:t,data:n}),this.emit("stackchange",{action:t,stackType:r,undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var r=this.get("adjMatrix");return r&&t||(r=Pw(this.save(),e),this.set("adjMatrix",r)),r},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var r=this.get("adjMatrix"),n=this.get("shortestPathMatrix");return r&&t||(r=Pw(this.save(),e),this.set("adjMatrix",r)),n&&t||(n=r_(this.save(),e),this.set("shortestPathMatrix",n)),n},e.prototype.on=function(e,r,n){return t.prototype.on.call(this,e,r,n)},e.prototype.destroy=function(){var t,e,r,n,i;this.emit("beforedestroy"),this.clear(),this.clearStack(),null===(t=this.get("itemController"))||void 0===t||t.destroy(),null===(e=this.get("modeController"))||void 0===e||e.destroy(),null===(r=this.get("viewController"))||void 0===r||r.destroy(),null===(n=this.get("stateController"))||void 0===n||n.destroy(),null===(i=this.get("canvas"))||void 0===i||i.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),r=this.get("hullMap");if(r||(r={},this.set("hullMap",r)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),r[t.id])return console.warn("Existed hull id."),r[t.id];var n=e.addGroup({id:"".concat(t.id,"-container")}),i=new uk(this,(0,Sw.__assign)((0,Sw.__assign)({},t),{group:n}));return r[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e,r;r=(0,Ew.isString)(t)?this.getHullById(t):t,null===(e=this.get("hullMap"))||void 0===e||delete e[r.id],r.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach(function(e){t[e].destroy()}),this.set("hullMap",{}))},e}(Ow.Z);function fk(t){"@babel/helpers - typeof";return(fk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var hk=Aw.vs,pk=["startArrow","endArrow"],dk={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},yk={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:dk,combo:dk},vk={options:{labelCfg:{style:{fontFamily:zS.windowFontFamily}},descriptionCfg:{style:{fontFamily:zS.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return"move"===e||(null===e||void 0===e?void 0:e.includes("bbox"))?t:(0,Ew.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var r=this.drawShape(t,e);if(r.set("className",this.itemType+"-shape"),e.shapeMap[this.itemType+"-shape"]=r,t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+"-label"),e.shapeMap[this.itemType+"-label"]=n}return r},afterDraw:function(t,e,r){},drawShape:function(t,e){return null},drawLabel:function(t,e){var r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},n=this.getLabelStyle(t,r,e),i=n.rotate;delete n.rotate;var o=e.addShape("text",{attrs:n,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&""!==i){var a=o.getBBox(),s=[1,0,0,0,1,0,0,0,1];if(n.rotateCenter)switch(n.rotateCenter){case"center":s=hk(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=hk(s,[["t",-n.x,-n.y],["r",i],["t",n.x,n.y]]);break;case"leftcenter":s=hk(s,[["t",-n.x,-n.y-a.height/2],["r",i],["t",n.x,n.y+a.height/2]]);break;default:s=hk(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=hk(s,[["t",-n.x,-n.y-a.height/2],["r",i],["t",n.x,n.y+a.height/2]]);o.setMatrix(s)}if(n.background){var u=this.drawLabelBg(t,e,o),l=this.itemType+"-label-bg";u.set("classname",l),e.shapeMap[l]=u,o.toFront()}return o},drawLabelBg:function(t,e,r){var n=this.options.labelCfg,i=(0,Ew.mix)({},n,t.labelCfg),o=this.getLabelBgStyleByPosition(r,i),a=e.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return e.shapeMap["text-bg-shape"]=a,a},getLabelStyleByPosition:function(t,e,r){return{text:t.label}},getLabelBgStyleByPosition:function(t,e){return{}},getLabelStyle:function(t,e,r){var n=this.getLabelStyleByPosition(t,e,r),i="".concat(this.itemType,"Label"),o=zS[i]?zS[i].style:null;return(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},o),n),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,r){this.updateShapeStyle(t,e,r),this.updateLabel(t,e,r)},updateShapeStyle:function(t,e,r){var n,i=e.getContainer(),o=e.getKeyShape(),a=(0,Ew.mix)({},o.attr(),t.style),s=function(t){var e,r=a[t];if((0,Ew.isPlainObject)(r)){var s=(null===(n=i.shapeMap)||void 0===n?void 0:n[t])||i.find(function(e){return e.get("name")===t});null===s||void 0===s||s.attr(r)}else o.attr(((e={})[t]=r,e))};for(var u in a)s(u)},updateLabel:function(t,e,r){var n,i,o=e.getContainer(),a=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,s=void 0===a?{}:a,u=this.itemType+"-label",l=o.shapeMap[u]||o.find(function(t){return t.get("className")===u}),c=this.itemType+"-label-bg",f=o.shapeMap[c]||o.find(function(t){return t.get("className")===c});if(l&&void 0===t.label&&(o.removeChild(l),delete o.shapeMap[u],f&&(o.removeChild(f),delete o.shapeMap[c])),t.label||""===t.label)if(l){(!r||"bbox|label"===r||"edge"===this.itemType&&"style"!==r)&&(s=(0,Ew.deepMix)(s,t.labelCfg));var h=this.getLabelStyleByPosition(t,s,o),p=null===(n=t.labelCfg)||void 0===n?void 0:n.style,d=(0,Sw.__assign)((0,Sw.__assign)({},h),p),y=d.rotate;if(delete d.rotate,isNaN(y)||""===y)1!==(null===(i=l.getMatrix())||void 0===i?void 0:i[4])&&l.resetMatrix(),l.attr(d);else{var v=[1,0,0,0,1,0,0,0,1];v=hk(v,[["t",-d.x,-d.y],["r",y],["t",d.x,d.y]]),d.matrix=v,l.attr(d)}if(f)if(d.background){var g=this.getLabelBgStyleByPosition(l,s);f.attr(g)}else o.removeChild(f);else d.background&&((f=this.drawLabelBg(t,o,l)).set("classname",c),o.shapeMap[c]=f,l.toFront())}else{var m=this.drawLabel(t,o);m.set("className",u),o.shapeMap[u]=m}},afterUpdate:function(t,e){},setState:function(t,e,r){var n,i,o,a=r.get("keyShape");if(a&&!a.destroyed){var s=r.getType(),u=(0,Ew.isBoolean)(e)?t:"".concat(t,":").concat(e),l=this.getStateStyle(u,r),c=r.getStateStyle(u);if(c||l){var f=(0,Ew.mix)({},c||l),h=r.getContainer(),p={x:1,y:1,cx:1,cy:1,matrix:1};if("combo"===s&&(p.r=1,p.width=1,p.height=1),e){var d=function(t){var e,r=f[t];if((0,Ew.isPlainObject)(r)&&!pk.includes(t)){var n=(null===(o=h.shapeMap)||void 0===o?void 0:o[t])||h.find(function(e){return e.get("name")===t});null===n||void 0===n||n.attr(r)}else a.attr(((e={})[t]=r,e))};for(var y in f)d(y)}else{var v=oE(r.getCurrentStatesStyle()),g=r.getModel(),m=(0,Ew.mix)({},g.style,oE(r.getOriginStyle())),b=a.get("name"),x=a.attr(),w={};Object.keys(x).forEach(function(t){if("img"!==t){var e=x[t];e&&"object"===fk(e)?w[t]=(0,Ew.clone)(e):w[t]=e}});var _={},S=function(t){var e=f[t];if((0,Ew.isPlainObject)(e)&&!pk.includes(t)){var r=h.shapeMap[t]||h.find(function(e){return e.get("name")===t});if(r){var n=oE(r.attr());(0,Ew.each)(e,function(e,i){if(t===b&&w[i]&&!p[i]){delete w[i];var o=m[t][i]||yk[s][i];a.attr(i,o)}else if(n[i]||0===n[i]){delete n[i];var u=m[t][i]||yk[s][i];r.attr(i,u)}}),_[t]=n}}else if(w[t]&&!p[t]){delete w[t];var i=m[t]||(m[b]?m[b][t]:void 0)||yk[s][t];a.attr(t,i)}};for(var E in f)S(E);for(var y in b?_[b]=w:(0,Ew.mix)(_,w),v)if(!p[y]){var k=v[y];(0,Ew.isPlainObject)(k)&&!pk.includes(y)||(b?((0,Ew.mix)(m[b],((i={})[y]=k,i)),delete m[y]):(0,Ew.mix)(m,((n={})[y]=k,n)),delete v[y])}var T={};(0,Ew.deepMix)(T,m,_,v);var C=!1,O=function(t){var e,r,n=T[t];if((0,Ew.isPlainObject)(n)&&!pk.includes(t)){var i=h.shapeMap[t]||h.find(function(e){return e.get("name")===t});i&&(("text"===i.get("type")||i.get("labelRelated"))&&(delete n.x,delete n.y,delete n.matrix),t===b&&("combo"===s&&(delete n.r,delete n.width,delete n.height),C=!0),i.attr(n))}else if(!C){var o=n||yk[s][t];"combo"===s?b||a.attr(((e={})[t]=o,e)):a.attr(((r={})[t]=o,r))}};for(var A in T)O(A)}}}},getStateStyle:function(t,e){var r=e.getModel(),n=e.getType(),i=this.getOptions(r),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,u=r.stateStyles?r.stateStyles[t]:o&&o[t];return"combo"===n?(0,Ew.clone)(u):(0,Ew.mix)({},s,u)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,r;return(null===t||void 0===t?void 0:t.anchorPoints)||(null===(e=this.getCustomConfig(t))||void 0===e?void 0:e.anchorPoints)||(null===(r=this.options)||void 0===r?void 0:r.anchorPoints)}},gk={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:zS.nodeLabel.offset,getSize:function(t){var e,r=(null===(e=this.mergeStyle)||void 0===e?void 0:e.size)||t.size||this.getOptions({}).size||zS.defaultNode.size;return(0,Ew.isArray)(r)&&1===r.length&&(r=[r[0],r[0]]),(0,Ew.isArray)(r)||(r=[r,r]),r},getLabelStyleByPosition:function(t,e){var r=e.maxLength,n=t.label;r&&(n=tE(n,r));var i=e.position||this.labelPosition;if("center"===i)return{x:0,y:0,text:n,textBaseline:"middle",textAlign:"center"};var o=e.offset;(0,Ew.isNil)(o)&&(o=this.offset);var a,s=this.getSize(t);switch(i){case"top":a={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":a={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":a={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:a={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"}}return a.text=n,a},getLabelBgStyleByPosition:function(t,e){var r;if(!t)return{};var n=null===(r=e.style)||void 0===r?void 0:r.background;if(!n)return{};var i=t.getBBox(),o=hE(n.padding),a=i.width+o[1]+o[3],s=i.height+o[0]+o[2];return(0,Sw.__assign)((0,Sw.__assign)({x:i.minX-o[3],y:i.minY-o[0]},n),{width:a,height:s})},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),i=e.addShape(r,{attrs:n,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=i,i},updateLinkPoints:function(t,e){var r,n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),o=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),a=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),s=e.shapeMap["link-point-bottom"]||e.find(function(t){return"link-point-bottom"===t.get("className")});i&&(r=i.attr()),o&&!r&&(r=o.attr()),a&&!r&&(r=a.attr()),s&&!r&&(r=s.attr()),r||(r=n);var u=(0,Ew.mix)({},r,t.linkPoints),l=u.fill,c=u.stroke,f=u.lineWidth,h=u.size/2;h||(h=u.r);var p=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},d=p.left,y=p.right,v=p.top,g=p.bottom,m=this.getSize(t),b=m[0],x=m[1],w={r:h,fill:l,stroke:c,lineWidth:f};if(i)d||void 0===d?i.attr((0,Sw.__assign)((0,Sw.__assign)({},w),{x:-b/2,y:0})):(i.remove(),delete e.shapeMap["link-point-left"]);else if(d){var _="link-point-left";e.shapeMap[_]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},w),{x:-b/2,y:0}),className:_,name:_,isAnchorPoint:!0})}if(o)y||void 0===y||(o.remove(),delete e.shapeMap["link-point-right"]),o.attr((0,Sw.__assign)((0,Sw.__assign)({},w),{x:b/2,y:0}));else if(y){var S="link-point-right";e.shapeMap[S]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},w),{x:b/2,y:0}),className:S,name:S,isAnchorPoint:!0})}if(a)v||void 0===v||(a.remove(),delete e.shapeMap["link-point-top"]),a.attr((0,Sw.__assign)((0,Sw.__assign)({},w),{x:0,y:-x/2}));else if(v){var E="link-point-top";e.shapeMap[E]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},w),{x:0,y:-x/2}),className:E,name:E,isAnchorPoint:!0})}if(s)g||void 0===g?s.attr((0,Sw.__assign)((0,Sw.__assign)({},w),{x:0,y:x/2})):(s.remove(),delete e.shapeMap["link-point-bottom"]);else if(g){var k="link-point-bottom";e.shapeMap[k]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},w),{x:0,y:x/2}),className:k,name:k,isAnchorPoint:!0})}},updateShape:function(t,e,r,n,i){e.get("keyShape").attr((0,Sw.__assign)({},r)),this.updateLabel(t,e,i),n&&this.updateIcon(t,e)},updateIcon:function(t,e){var r=this,n=e.getContainer(),i=(this.mergeStyle||this.getOptions(t)).icon,o=t.icon?t.icon:{show:void 0,text:void 0},a=o.show,s=o.text,u=n.shapeMap["".concat(this.type,"-icon")]||n.find(function(t){return t.get("name")==="".concat(r.type,"-icon")});if(u)if(a||void 0===a){var l=(0,Ew.mix)({},u.attr(),i),c=l.width,f=void 0===c?20:c,h=l.height,p=void 0===h?20:h;("iconfont"===l.fontFamily||l.hasOwnProperty("text"))&&(f=0,p=0),u.attr((0,Sw.__assign)((0,Sw.__assign)({},l),{x:-f/2,y:-p/2}))}else u.remove(),delete n.shapeMap["".concat(this.type,"-icon")];else if(a){var d="".concat(this.type,"-icon");if(s)n.shapeMap[d]=n.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:d,name:d});else{f=i.width,p=i.height;n.shapeMap[d]=n.addShape("image",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},i),{x:-f/2,y:-p/2}),className:d,name:d})}var y=n.shapeMap["node-label"]||n.find(function(t){return"node-label"===t.get("name")});y&&y.toFront()}}},mk=(0,Sw.__assign)((0,Sw.__assign)({},vk),gk);ME.registerNode("single-node",mk);var bk={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:zS.defaultEdge.size,style:{x:0,y:0,stroke:zS.defaultEdge.style.stroke,lineAppendWidth:zS.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:zS.edgeLabel.style.fill,fontSize:zS.edgeLabel.style.fontSize,fontFamily:zS.windowFontFamily}},stateStyles:(0,Sw.__assign)({},zS.edgeStateStyles)},getPath:function(t){var e=[];return(0,Ew.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,Ew.mix)({},e,r,t.style),i=t.size||zS.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),u=[o];s&&(u=u.concat(s)),u.push(a);var l=this.getPath(u);return(0,Ew.mix)({},zS.defaultEdge.style,{stroke:zS.defaultEdge.color,lineWidth:i,path:l},n)},updateShapeStyle:function(t,e,r){var n,i=e.getContainer(),o=(null===(n=e.getKeyShape)||void 0===n?void 0:n.call(e))||i.shapeMap["edge-shape"],a=t.size,s=(t=this.getPathPoints(t)).startPoint,u=t.endPoint,l=this.getControlPoints(t),c=[s];l&&(c=c.concat(l)),c.push(u);var f=o.attr(),h=t.style||{};void 0===h.stroke&&(h.stroke=t.color);var p=t.sourceNode,d=t.targetNode,y={radius:h.radius};l||(y={source:p,target:d,offset:h.offset,radius:h.radius});var v=this.getPath(c,y),g={};"move"===r?g={path:v}:(f.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),f.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""}),void 0===(g=(0,Sw.__assign)({},t.style)).lineWidth&&(g.lineWidth=((0,Ew.isNumber)(a)?a:null===a||void 0===a?void 0:a[0])||f.lineWidth),void 0===g.path&&(g.path=v),void 0===g.stroke&&(g.stroke=f.stroke||t.color)),o&&o.attr(g)},getLabelStyleByPosition:function(t,e,r){var n,i=e.position||this.labelPosition,o={},a=null===r||void 0===r?void 0:r.shapeMap["edge-shape"];n="start"===i?0:"end"===i?1:.5;var s,u=e.refX||this.refX,l=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+u,o.y=t.startPoint.y+l,o.text=t.label,o;s=(0,Ew.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var c=ZS(a,n,u,l,s);return o.x=c.x,o.y=c.y,o.rotate=c.rotate,o.textAlign=this._getTextAlign(i,c.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e){if(!t)return{};var r=t.getBBox(),n=e.style&&e.style.background;if(!n)return{};var i=n.padding,o=r.width+i[1]+i[3],a=r.height+i[0]+i[2],s=(0,Sw.__assign)((0,Sw.__assign)({},n),{width:o,height:a,x:r.minX-i[3],y:r.minY-i[0],matrix:[1,0,0,0,1,0,0,0,1]});return((0,Ew.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate)&&(s.matrix=t.attr("matrix")||[1,0,0,0,1,0,0,0,1]),s},_getTextAlign:function(t,e){var r="center";return e?(e%=2*Math.PI,"center"!==t&&(r=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),r):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},drawLabel:function(t,e){var r=this.options.labelCfg,n=(0,Ew.deepMix)({},r,t.labelCfg),i=this.getLabelStyle(t,n,e),o=i.rotate;delete i.rotate;var a=e.addShape("text",{attrs:i,name:"text-shape",labelRelated:!0,draggable:!0});if(e.shapeMap["text-shape"]=a,isNaN(o)||""===o||a.rotateAtStart(o),i.background){var s=this.drawLabelBg(t,e,a,i,o),u=this.itemType+"-label-bg";s.set("classname",u),e.shapeMap[u]=s,a.toFront()}return a},drawLabelBg:function(t,e,r,n,i){var o=this.options.labelCfg,a=(0,Ew.deepMix)({},o,t.labelCfg),s=this.getLabelBgStyleByPosition(r,a),u=e.addShape("rect",{name:"text-bg-shape",attrs:s,labelRelated:!0});return e.shapeMap["text-bg-shape"]=u,u}},xk=(0,Sw.__assign)((0,Sw.__assign)({},vk),bk);ME.registerEdge("single-edge",xk),ME.registerEdge("line",{getControlPoints:function(){}},"single-edge"),ME.registerEdge("spline",{getPath:function(t){return UE(t)}},"single-edge"),ME.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,r,n=t.startPoint,i=t.endPoint,o=(n.x+i.x)/2,a=(n.y+i.y)/2;if(void 0!==t.controlPoints){if(r=t.controlPoints[0],e=uS(n,r,i),n.x<=i.x&&n.y>i.y?this.clockwise=e.x>r.x?0:1:n.x<=i.x&&n.yr.x?1:0:n.x>i.x&&n.y<=i.y?this.clockwise=e.y=t&&i<=t+r&&o>=e&&o<=e+n}function zk(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY=0&&a<.5*Math.PI?(n={x:u.minX,y:u.minY},i={x:u.maxX,y:u.maxY}):.5*Math.PI<=a&&a1&&(r*=Math.sqrt(p),n*=Math.sqrt(p));var d=r*r*(h*h)+n*n*(f*f),y=d?Math.sqrt((r*r*(n*n)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=n?y*r*h/n:0,g=r?y*-n*f/r:0,m=(s+l)/2+Math.cos(i)*v-Math.sin(i)*g,b=(u+c)/2+Math.sin(i)*v+Math.cos(i)*g,x=[(f-v)/r,(h-g)/n],w=[(-1*f-v)/r,(-1*h-g)/n],_=Kk([1,0],x),S=Kk(x,w);return Zk(x,w)<=-1&&(S=Math.PI),Zk(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:m,cy:b,rx:Uk(t,[l,c])?0:r,ry:Uk(t,[l,c])?0:n,startAngle:_,endAngle:_+S,xRotation:i,arcFlag:o,sweepFlag:a}}function Qk(t){"@babel/helpers - typeof";return(Qk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var $k=Math.sin,tT=Math.cos,eT=Math.atan2,rT=Math.PI;function nT(t,e,r,n,i,o,a){var s=e.stroke,u=e.lineWidth,l=eT(n-o,r-i),c=new BT({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*tT(rT/6)+","+10*$k(rT/6)+" L0,0 L"+10*tT(rT/6)+",-"+10*$k(rT/6),stroke:s,lineWidth:u}});c.translate(i,o),c.rotateAtPoint(i,o,l),t.set(a?"startArrowShape":"endArrowShape",c)}function iT(t,e,r,n,i,o,a){var s=e.startArrow,u=e.endArrow,l=e.stroke,c=e.lineWidth,f=a?s:u,h=f.d,p=f.fill,d=f.stroke,y=f.lineWidth,v=(0,Sw.__rest)(f,["d","fill","stroke","lineWidth"]),g=eT(n-o,r-i);h&&(i-=tT(g)*h,o-=$k(g)*h);var m=new BT({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:(0,Sw.__assign)((0,Sw.__assign)({},v),{stroke:d||l,lineWidth:y||c,fill:p})});m.translate(i,o),m.rotateAtPoint(i,o,g),t.set(a?"startArrowShape":"endArrowShape",m)}function oT(t,e,r,n,i){var o=eT(n-e,r-t);return{dx:tT(o)*i,dy:$k(o)*i}}function aT(t,e,r,n,i,o){"object"===Qk(e.startArrow)?iT(t,e,r,n,i,o,!0):e.startArrow?nT(t,e,r,n,i,o,!0):t.set("startArrowShape",null)}function sT(t,e,r,n,i,o){"object"===Qk(e.endArrow)?iT(t,e,r,n,i,o,!1):e.endArrow?nT(t,e,r,n,i,o,!1):t.set("startArrowShape",null)}var uT={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function lT(t,e){var r=e.attr();for(var n in r){var i=r[n],o=uT[n]?uT[n]:n;"matrix"===o&&i?t.transform(i[0],i[1],i[3],i[4],i[6],i[7]):"lineDash"===o&&t.setLineDash?(0,Ew.isArray)(i)&&t.setLineDash(i):("strokeStyle"===o||"fillStyle"===o?i=Yk(t,e,i):"globalAlpha"===o&&(i*=t.globalAlpha),t[o]=i)}}function cT(t,e,r){for(var n=0;nx?b:x,T=b>x?1:b/x,C=b>x?x/b:1;e.translate(g,m),e.rotate(S),e.scale(T,C),e.arc(0,0,k,w,_,1-E),e.scale(1/T,1/C),e.rotate(-S),e.translate(-g,-m)}break;case"Z":e.closePath()}if("Z"===h)s=u;else{var O=f.length;s=[f[O-2],f[O-1]]}}}}function yT(t,e){var r=t.get("canvas");r&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(r.refreshElement(t,e,r),r.get("autoDraw")&&r.draw())))}function vT(t){var e,r,n;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(n=a,e=(r=i)&&n?{minX:Math.min(r.minX,n.minX),minY:Math.min(r.minY,n.minY),maxX:Math.max(r.maxX,n.maxX),maxY:Math.max(r.maxY,n.maxY)}:r||n):o?e=i:s&&(e=a)}return e}var gT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.onCanvasChange=function(t){yT(this,t)},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),lT(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],r=[];(0,Ew.each)(t,function(t){var n=t.cfg.cacheCanvasBBox;n&&t.cfg.isInView&&(e.push(n.minX,n.maxX),r.push(n.minY,n.maxY))});var n=null;if(e.length){var i=(0,Ew.min)(e),o=(0,Ew.max)(e),a=(0,Ew.min)(r),s=(0,Ew.max)(r);n={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var u=this.cfg.canvas;if(u){var l=u.getViewRange();this.set("isInView",zk(n,l))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",n)},e.prototype.draw=function(t,e){var r=this.cfg.children,n=!e||this.cfg.refresh;r.length&&n&&(t.save(),lT(t,this),this._applyClip(t,this.getClip()),cT(t,r,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(lE.AbstractGroup),mT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return gT},e.prototype.onCanvasChange=function(t){yT(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),r=(0,lE.getBBoxMethod)(t)(this),n=e/2,i=r.x-n,o=r.y-n,a=r.x+r.width+n,s=r.y+r.height+n;return{x:i,minX:i,y:o,minY:o,width:r.width+e,height:r.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),lT(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var r=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!zk(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),lT(t,this),this._applyClip(t,r),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),r=zk(e,t);this.set("isInView",r),r?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,r=e.lineWidth,n=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&((0,Ew.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=n)),this.isStroke()&&r>0&&((0,Ew.isNil)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var r=this.isStroke(),n=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,r,n,i)},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(lE.AbstractShape),bT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=o.x,s=o.y,u=o.r,l=i/2,c=Bk(a,s,t,e);return n&&r?c<=u+l:n?c<=u:!!r&&(c>=u-l&&c<=u+l)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.r;t.beginPath(),t.arc(r,n,i,0,2*Math.PI,!1),t.closePath()},e}(mT);function xT(t,e,r,n){return t/(r*r)+e/(n*n)}var wT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,l=o.rx,c=o.ry,f=(t-s)*(t-s),h=(e-u)*(e-u);return n&&r?xT(f,h,l+a,c+a)<=1:n?xT(f,h,l,c)<=1:!!r&&(xT(f,h,l-a,c-a)>=1&&xT(f,h,l+a,c+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(r,n,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(r,n),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(mT);function _T(t){return t instanceof HTMLElement&&(0,Ew.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var ST=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,r=this.attrs;if((0,Ew.isString)(t)){var n=new Image;n.onload=function(){if(e.destroyed)return!1;e.attr("img",n),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},n.crossOrigin="Anonymous",n.src=t,this.set("loading",!0)}else t instanceof Image?(r.width||(r.width=t.width),r.height||(r.height=t.height)):_T(t)&&(r.width||(r.width=Number(t.getAttribute("width"))),r.height||(r.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),"img"===e&&this._setImage(r)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),r=e.x,n=e.y,i=e.width,o=e.height,a=e.sx,s=e.sy,u=e.swidth,l=e.sheight,c=e.img;(c instanceof Image||_T(c))&&((0,Ew.isNil)(a)||(0,Ew.isNil)(s)||(0,Ew.isNil)(u)||(0,Ew.isNil)(l)?t.drawImage(c,r,n,i,o):t.drawImage(c,a,s,u,l,r,n,i,o))},e}(mT),ET=r(3793);function kT(t,e,r,n,i,o,a){var s=Math.min(t,r),u=Math.max(t,r),l=Math.min(e,n),c=Math.max(e,n),f=i/2;return o>=s-f&&o<=u+f&&a>=l-f&&a<=c+f&&ET.x1.pointToLine(t,e,r,n,o,a)<=i/2}var TT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&aT(this,t,n,i,e,r),a&&sT(this,t,e,r,n,i)},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){if(!r||!i)return!1;var o=this.attr();return kT(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},l={dx:0,dy:0};a&&a.d&&(u=oT(r,n,i,o,e.startArrow.d)),s&&s.d&&(l=oT(r,n,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(r+u.dx,n+u.dy),t.lineTo(i-l.dx,o-l.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),r=this.get("endArrowShape");e&&e.draw(t),r&&r.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2;return ET.x1.length(e,r,n,i)},e.prototype.getPoint=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2;return ET.x1.pointAt(r,n,i,o,t)},e}(mT),CT={circle:function(t,e,r){return[["M",t-r,e],["A",r,r,0,1,0,t+r,e],["A",r,r,0,1,0,t-r,e]]},square:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e-r],["L",t+r,e+r],["L",t-r,e+r],["Z"]]},diamond:function(t,e,r){return[["M",t-r,e],["L",t,e-r],["L",t+r,e],["L",t,e+r],["Z"]]},triangle:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e+n],["L",t,e-n],["L",t+r,e+n],["Z"]]},"triangle-down":function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e-n],["L",t+r,e-n],["L",t,e+n],["Z"]]}},OT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,Ew.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,r,n=this.attr(),i=n.x,o=n.y,a=n.symbol||"circle",s=this._getR(n);if((0,Ew.isFunction)(a))r=(t=a)(i,o,s),r=(0,FE.wb)(r);else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;r=t(i,o,s)}return r},e.prototype.createPath=function(t){dT(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=CT,e}(mT);function AT(t,e,r){var n=(0,lE.getOffScreenContext)();return t.createPath(n),n.isPointInPath(e,r)}var PT=1e-6;function MT(t){return Math.abs(t)0!=MT(s[1]-r)>0&&MT(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}function jT(t,e,r,n,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(ui)return!1;var l={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return Bk(l.x,l.y,a,s)<=o/2}var NT=Aw.vs;var RT=(0,Sw.__assign)({hasArc:function(t){for(var e=!1,r=t.length,n=0;n0&&n.push(i),{polygons:r,polylines:n}},isPointInStroke:function(t,e,r,n,i){for(var o=!1,a=e/2,s=0;sg?v:g,S=NT(null,[["t",-d,-y],["r",-x],["s",1/(v>g?1:v/g),1/(v>g?g/v:1)]]);K_.transformMat3(w,w,S),o=jT(0,0,_,m,b,e,w[0],w[1])}if(o)break}}return o}},lE.PathUtil);function DT(t,e,r){for(var n=!1,i=0;i=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)});var o=i[r];if((0,Ew.isNil)(o)||(0,Ew.isNil)(r))return null;var a=o.length,s=i[r+1];return ET.Ll.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",RT.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,r,n,i=0,o=0,a=[],s=this.get("curve");s&&((0,Ew.each)(s,function(t,e){r=s[e+1],n=t.length,r&&(i+=ET.Ll.length(t[n-2],t[n-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)}),this.set("totalLength",i),0!==i?((0,Ew.each)(s,function(u,l){r=s[l+1],n=u.length,r&&((t=[])[0]=o/i,e=ET.Ll.length(u[n-2],u[n-1],r[1],r[2],r[3],r[4],r[5],r[6]),o+=e||0,t[1]=o/i,a.push(t))}),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var r=e[0].currentPoint,n=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([r[0]-i[0],r[1]-i[1]]),t.push([r[0],r[1]])):(t.push([n[0],n[1]]),t.push([r[0],r[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),r=e.length;if(r>1){var n=e[r-2].currentPoint,i=e[r-1].currentPoint,o=e[r-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([n[0],n[1]]),t.push([i[0],i[1]]))}return t},e}(mT);function FT(t,e,r,n,i){var o=t.length;if(o<2)return!1;for(var a=0;a=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)}),ET.x1.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var r,n,i=0,o=[];(0,Ew.each)(t,function(a,s){t[s+1]&&((r=[])[0]=i/e,n=ET.x1.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=n,r[1]=i/e,o.push(r))}),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r},e}(mT);var GT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=o.x,s=o.y,u=o.width,l=o.height,c=o.radius;if(c){var f=!1;return r&&(f=function(t,e,r,n,i,o,a,s){return kT(t+i,e,t+r-i,e,o,a,s)||kT(t+r,e+i,t+r,e+n-i,o,a,s)||kT(t+r-i,e+n,t+i,e+n,o,a,s)||kT(t,e+n-i,t,e+i,o,a,s)||jT(t+r-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||jT(t+r-i,e+n-i,i,0,.5*Math.PI,o,a,s)||jT(t+i,e+n-i,i,.5*Math.PI,Math.PI,o,a,s)||jT(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,u,l,c,i,t,e)),!f&&n&&(f=AT(this,t,e)),f}var h=i/2;return n&&r?Fk(a-h,s-h,u+h,l+h,t,e):n?Fk(a,s,u,l,t,e):r?function(t,e,r,n,i,o,a){var s=i/2;return Fk(t-s,e-s,r,i,o,a)||Fk(t+r-s,e-s,i,n,o,a)||Fk(t+s,e+n-s,r,i,o,a)||Fk(t-s,e+s,i,n,o,a)}(a,s,u,l,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(r,n,i,o);else{var s=function(t){var e=0,r=0,n=0,i=0;return(0,Ew.isArray)(t)?1===t.length?e=r=n=i=t[0]:2===t.length?(e=n=t[0],r=i=t[1]):3===t.length?(e=t[0],r=i=t[1],n=t[2]):(e=t[0],r=t[1],n=t[2],i=t[3]):e=r=n=i=t,[e,r,n,i]}(a),u=s[0],l=s[1],c=s[2],f=s[3];t.moveTo(r+u,n),t.lineTo(r+i-l,n),0!==l&&t.arc(r+i-l,n+l,l,-Math.PI/2,0),t.lineTo(r+i,n+o-c),0!==c&&t.arc(r+i-c,n+o-c,c,0,Math.PI/2),t.lineTo(r+f,n+o),0!==f&&t.arc(r+f,n+o-f,f,Math.PI/2,Math.PI),t.lineTo(r,n+u),0!==u&&t.arc(r+u,n+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(mT),VT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=(0,lE.assembleFont)(t)},e.prototype._setText=function(t){var e=null;(0,Ew.isString)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(r)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,r=1*t.fontSize;return e?e-r:.14*r},e.prototype._drawTextArr=function(t,e,r){var n,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,u=1*i.fontSize,l=this._getSpaceingY(),c=(0,lE.getTextHeight)(i.text,i.fontSize,i.lineHeight);(0,Ew.each)(e,function(e,i){n=s+i*(l+u)-c+u,"middle"===o&&(n+=c-u-(c-u)/2),"top"===o&&(n+=c-u),(0,Ew.isNil)(e)||(r?t.fillText(e,a,n):t.strokeText(e,a,n))})},e.prototype._drawText=function(t,e){var r=this.attr(),n=r.x,i=r.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=r.text;(0,Ew.isNil)(a)||(e?t.fillText(a,n,i):t.strokeText(a,n,i))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,r=e.lineWidth,n=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&r>0&&((0,Ew.isNil)(i)||1===i||(t.globalAlpha=n),this.stroke(t)),this.isFill()&&((0,Ew.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=n)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(mT);function HT(t,e,r){var n=t.getTotalMatrix();if(n){var i=function(t,e){if(e){var r=(0,lE.invert)(e);return(0,lE.multiplyVec2)(r,t)}return t}([e,r,1],n);return[i[0],i[1]]}return[e,r]}function WT(t,e,r){if(t.isCanvas&&t.isCanvas())return!0;if(!(0,lE.isAllowCapture)(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var n=HT(t,e,r),i=n[0],o=n[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&r>=a.minY&&r<=a.maxY}var qT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return gT},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||(window?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,r){t.prototype.setDOMSize.call(this,e,r);var n=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*r,o>1&&n.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),r=this.get("el");e.clearRect(0,0,r.width,r.height)},e.prototype.getShape=function(e,r){return this.get("quickHit")?function t(e,r,n){if(!WT(e,r,n))return null;for(var i=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var s=o[a];if(s.isGroup())i=t(s,r,n);else if(WT(s,r,n)){var u=s,l=HT(s,r,n),c=l[0],f=l[1];u.isInShape(c,f)&&(i=s)}if(i)break}return i}(this,e,r):t.prototype.getShape.call(this,e,r,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),r=this.getViewRange();e.length&&e[0]===this?t=r:(t=function(t){if(!t.length)return null;var e=[],r=[],n=[],i=[];return(0,Ew.each)(t,function(t){var o=vT(t);o&&(e.push(o.minX),r.push(o.minY),n.push(o.maxX),i.push(o.maxY))}),{minX:(0,Ew.min)(e),minY:(0,Ew.min)(r),maxX:(0,Ew.max)(n),maxY:(0,Ew.max)(i)}}(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&zk(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,r)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,Ew.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),r=this.getChildren();t.clearRect(0,0,e.width,e.height),lT(t,this),cT(t,r),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),r=this.getChildren(),n=this._getRefreshRegion();n?(t.clearRect(n.minX,n.minY,n.maxX-n.minX,n.maxY-n.minY),t.save(),t.beginPath(),t.rect(n.minX,n.minY,n.maxX-n.minX,n.maxY-n.minY),t.clip(),lT(t,this),fT(this,r,n),cT(t,r,n),t.restore()):e.length&&function t(e){for(var r=0;re)r.insertBefore(t,i);else if(o0&&(e?"stroke"in r?this._setColor(t,"stroke",o):"strokeStyle"in r&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&c.setAttribute(ZT.strokeOpacity,u),l&&c.setAttribute(ZT.lineWidth,l))},e.prototype._setColor=function(t,e,r){var n=this.get("el");if(r)if(r=r.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(r))(i=t.find("gradient",r))||(i=t.addGradient(r)),n.setAttribute(ZT[e],"url(#"+i+")");else if(/^[p,P]{1}[\s]*\(/.test(r)){var i;(i=t.find("pattern",r))||(i=t.addPattern(r)),n.setAttribute(ZT[e],"url(#"+i+")")}else n.setAttribute(ZT[e],r);else n.setAttribute(ZT[e],"none")},e.prototype.shadow=function(t,e){var r=this.attr(),n=e||r,i=n.shadowOffsetX,o=n.shadowOffsetY,a=n.shadowBlur,s=n.shadowColor;(i||o||a||s)&&function(t,e){var r=t.cfg.el,n=t.attr(),i={dx:n.shadowOffsetX,dy:n.shadowOffsetY,blur:n.shadowBlur,color:n.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=e.find("filter",i);o||(o=e.addShadow(i)),r.setAttribute("filter","url(#"+o+")")}else r.removeAttribute("filter")}(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&$T(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var r=this.get("el"),n=this.get("canvas").get("el").getBoundingClientRect(),i=t+n.left,o=e+n.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(r))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,r=t.lineAppendWidth;return this.isStroke()?e+r:0},e}(lE.AbstractShape),oC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ew.each)(e||r,function(t,e){"x"===e||"y"===e?n.setAttribute("c"+e,t):ZT[e]&&n.setAttribute(ZT[e],t)})},e}(iC),aC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return(0,Sw.__extends)(e,t),e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");if((0,Ew.each)(e||r,function(t,e){ZT[e]&&n.setAttribute(ZT[e],t)}),"function"==typeof r.html){var i=r.html.call(this,r);if(i instanceof Element||i instanceof HTMLDocument){for(var o=n.childNodes,a=o.length-1;a>=0;a--)n.removeChild(o[a]);n.appendChild(i)}else n.innerHTML=i}else n.innerHTML=r.html},e}(iC),sC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ew.each)(e||r,function(t,e){"x"===e||"y"===e?n.setAttribute("c"+e,t):ZT[e]&&n.setAttribute(ZT[e],t)})},e}(iC),uC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");(0,Ew.each)(e||n,function(t,e){"img"===e?r._setImage(n.img):ZT[e]&&i.setAttribute(ZT[e],t)})},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),r=this.get("el");if((0,Ew.isString)(t))r.setAttribute("href",t);else if(t instanceof window.Image)e.width||(r.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(r.setAttribute("height",t.height),this.attr("height",t.height)),r.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,Ew.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())r.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var n=document.createElement("canvas");n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.getContext("2d").putImageData(t,0,0),e.width||(r.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(r.setAttribute("height",""+t.height),this.attr("height",t.height)),r.setAttribute("href",n.toDataURL())}},e}(iC),lC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ew.each)(e||r,function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=(0,Ew.isObject)(e)?t.addArrow(r,ZT[i]):t.getDefaultArrow(r,ZT[i]);n.setAttribute(ZT[i],"url(#"+o+")")}else n.removeAttribute(ZT[i]);else ZT[i]&&n.setAttribute(ZT[i],e)})},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2;return ET.x1.length(e,r,n,i)},e.prototype.getPoint=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2;return ET.x1.pointAt(r,n,i,o,t)},e}(iC),cC={circle:function(t,e,r){return[["M",t,e],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},square:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e-r],["L",t+r,e+r],["L",t-r,e+r],["Z"]]},diamond:function(t,e,r){return[["M",t-r,e],["L",t,e-r],["L",t+r,e],["L",t,e+r],["Z"]]},triangle:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e+n],["L",t,e-n],["L",t+r,e+n],["z"]]},triangleDown:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e-n],["L",t+r,e-n],["L",t,e+n],["Z"]]}},fC={get:function(t){return cC[t]},register:function(t,e){cC[t]=e},remove:function(t){delete cC[t]},getAll:function(){return cC}},hC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,Ew.isArray)(t)?t.map(function(t){return t.join(" ")}).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),r=e.x,n=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=(0,Ew.isFunction)(o)?o:fC.get(o))?t(r,n,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=fC,e}(iC),pC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");(0,Ew.each)(e||n,function(e,o){if("path"===o&&(0,Ew.isArray)(e))i.setAttribute("d",r._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=(0,Ew.isObject)(e)?t.addArrow(n,ZT[o]):t.getDefaultArrow(n,ZT[o]);i.setAttribute(ZT[o],"url(#"+a+")")}else i.removeAttribute(ZT[o]);else ZT[o]&&i.setAttribute(ZT[o],e)})},e.prototype._formatPath=function(t){var e=t.map(function(t){return t.join(" ")}).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),r=this.getTotalLength();if(0===r)return null;var n=e?e.getPointAtLength(t*r):null;return n?{x:n.x,y:n.y}:null},e}(iC),dC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ew.each)(e||r,function(t,e){"points"===e&&(0,Ew.isArray)(t)&&t.length>=2?n.setAttribute("points",t.map(function(t){return t[0]+","+t[1]}).join(" ")):ZT[e]&&n.setAttribute(ZT[e],t)})},e}(iC),yC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ew.each)(e||r,function(t,e){"points"===e&&(0,Ew.isArray)(t)&&t.length>=2?n.setAttribute("points",t.map(function(t){return t[0]+","+t[1]}).join(" ")):ZT[e]&&n.setAttribute(ZT[e],t)})},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return(0,Ew.isNil)(e)?(this.set("totalLength",ET.aH.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,r,n=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),(0,Ew.each)(i,function(n,i){t>=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)}),ET.x1.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var r,n,i=0,o=[];(0,Ew.each)(t,function(a,s){t[s+1]&&((r=[])[0]=i/e,n=ET.x1.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=n,r[1]=i/e,o.push(r))}),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r},e}(iC);var vC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];(0,Ew.each)(e||n,function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&ZT[e]&&i.setAttribute(ZT[e],t):(i.setAttribute("d",r._assembleRect(n)),o=!0)})},e.prototype._assembleRect=function(t){var e=t.x,r=t.y,n=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+r+" l "+n+",0 l 0,"+i+" l"+-n+" 0 z";var a=function(t){var e=0,r=0,n=0,i=0;return(0,Ew.isArray)(t)?1===t.length?e=r=n=i=t[0]:2===t.length?(e=n=t[0],r=i=t[1]):3===t.length?(e=t[0],r=i=t[1],n=t[2]):(e=t[0],r=t[1],n=t[2],i=t[3]):e=r=n=i=t,{r1:e,r2:r,r3:n,r4:i}}(o);return(0,Ew.isArray)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+r],["l "+(n-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-n)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(iC),gC=r(6643),mC={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},bC={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},xC={left:"left",start:"left",center:"middle",right:"end",end:"end"},wC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");this._setFont(),(0,Ew.each)(e||n,function(t,e){"text"===e?r._setText(""+t):"matrix"===e&&t?$T(r):ZT[e]&&i.setAttribute(ZT[e],t)}),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),r=e.textBaseline,n=e.textAlign,i=(0,gC.qY)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",bC[r]||"alphabetic"):t.setAttribute("alignment-baseline",mC[r]||"baseline"),t.setAttribute("text-anchor",xC[n]||"left")},e.prototype._setText=function(t){var e=this.get("el"),r=this.attr(),n=r.x,i=r.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,u="";(0,Ew.each)(a,function(t,e){0===e?"alphabetic"===o?u+=''+t+"":"top"===o?u+=''+t+"":"middle"===o?u+=''+t+"":"bottom"===o?u+=''+t+"":"hanging"===o&&(u+=''+t+""):u+=''+t+""}),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(iC),_C=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,SC=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,EC=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function kC(t){var e=t.match(EC);if(!e)return"";var r="";return e.sort(function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])}),(0,Ew.each)(e,function(t){t=t.split(":"),r+=''}),r}var TC,CC,OC,AC,PC=function(){function t(t){this.cfg={};var e,r,n,i,o,a,s,u=null,l=(0,Ew.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var r,n,i=_C.exec(t),o=(0,Ew.mod)((0,Ew.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(r={x:0,y:0},n={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=r},t}(),jC=function(){function t(t,e){this.cfg={};var r=KT("marker"),n=(0,Ew.uniqueId)("marker_");r.setAttribute("id",n);var i=KT("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),r.appendChild(i),r.setAttribute("overflow","visible"),r.setAttribute("orient","auto-start-reverse"),this.el=r,this.child=i,this.id=n;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var r=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),r.setAttribute("refX",""+10*Math.cos(Math.PI/6)),r.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var r=this.el,n=this.cfg.path,i=this.cfg.d;(0,Ew.isArray)(n)&&(n=n.map(function(t){return t.join(" ")}).join("")),e.setAttribute("d",n),r.appendChild(e),i&&r.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),NC=function(){function t(t){this.type="clip",this.cfg={};var e=KT("clipPath");this.el=e,this.id=(0,Ew.uniqueId)("clip_"),e.id=this.id;var r=t.cfg.el;return e.appendChild(r),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),RC=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,DC=function(){function t(t){this.cfg={};var e=KT("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var r=KT("image");e.appendChild(r);var n=(0,Ew.uniqueId)("pattern_");e.id=n,this.el=e,this.id=n,this.cfg=t;var i=RC.exec(t)[2];r.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),BC=function(){function t(t){var e=KT("defs"),r=(0,Ew.uniqueId)("defs_");e.id=r,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var r=this.children,n=null,i=0;i]*>/,AC={tr:document.createElement("tbody"),tbody:TC,thead:TC,tfoot:TC,td:CC,th:CC,"*":document.createElement("div")});var e=OC.test(t)&&RegExp.$1;e&&e in AC||(e="*");var r=AC[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,r.innerHTML=""+t;var n=r.childNodes[0];return n&&r.contains(n)&&r.removeChild(n),n}var GC=r(9630),VC=r.n(GC);function HC(t){"@babel/helpers - typeof";return(HC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var WC=/^\s+/,qC=/\s+$/;function YC(t,e){if(t=t||"",e=e||{},t instanceof YC)return t;if(!(this instanceof YC))return new YC(t,e);var r=function(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,a=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(WC,"").replace(qC,"").toLowerCase();var e,r=!1;if(cO[t])t=cO[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=SO.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=SO.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=SO.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=SO.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=SO.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=SO.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=SO.hex8.exec(t))return{r:yO(e[1]),g:yO(e[2]),b:yO(e[3]),a:bO(e[4]),format:r?"name":"hex8"};if(e=SO.hex6.exec(t))return{r:yO(e[1]),g:yO(e[2]),b:yO(e[3]),format:r?"name":"hex"};if(e=SO.hex4.exec(t))return{r:yO(e[1]+""+e[1]),g:yO(e[2]+""+e[2]),b:yO(e[3]+""+e[3]),a:bO(e[4]+""+e[4]),format:r?"name":"hex8"};if(e=SO.hex3.exec(t))return{r:yO(e[1]+""+e[1]),g:yO(e[2]+""+e[2]),b:yO(e[3]+""+e[3]),format:r?"name":"hex"};return!1}(t));"object"==HC(t)&&(EO(t.r)&&EO(t.g)&&EO(t.b)?(u=t.r,l=t.g,c=t.b,e={r:255*pO(u,255),g:255*pO(l,255),b:255*pO(c,255)},a=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):EO(t.h)&&EO(t.s)&&EO(t.v)?(n=gO(t.s),i=gO(t.v),e=function(t,e,r){t=6*pO(t,360),e=pO(e,100),r=pO(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(t.h,n,i),a=!0,s="hsv"):EO(t.h)&&EO(t.s)&&EO(t.l)&&(n=gO(t.s),o=gO(t.l),e=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=pO(t,360),e=pO(e,100),r=pO(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(t.h,n,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(r=t.a));var u,l,c;return r=hO(r),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function XC(t,e,r){t=pO(t,255),e=pO(e,255),r=pO(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(YC(n));return o}function lO(t,e){e=e||6;for(var r=YC(t).toHsv(),n=r.h,i=r.s,o=r.v,a=[],s=1/e;e--;)a.push(YC({h:n,s:i,v:o})),o=(o+s)%1;return a}YC.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=hO(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=ZC(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=ZC(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=XC(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=XC(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return KC(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[vO(Math.round(t).toString(16)),vO(Math.round(e).toString(16)),vO(Math.round(r).toString(16)),vO(mO(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*pO(this._r,255))+"%",g:Math.round(100*pO(this._g,255))+"%",b:Math.round(100*pO(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*pO(this._r,255))+"%, "+Math.round(100*pO(this._g,255))+"%, "+Math.round(100*pO(this._b,255))+"%)":"rgba("+Math.round(100*pO(this._r,255))+"%, "+Math.round(100*pO(this._g,255))+"%, "+Math.round(100*pO(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(fO[KC(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+JC(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=YC(t);r="#"+JC(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return YC(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(eO,arguments)},brighten:function(){return this._applyModification(rO,arguments)},darken:function(){return this._applyModification(nO,arguments)},desaturate:function(){return this._applyModification(QC,arguments)},saturate:function(){return this._applyModification($C,arguments)},greyscale:function(){return this._applyModification(tO,arguments)},spin:function(){return this._applyModification(iO,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(uO,arguments)},complement:function(){return this._applyCombination(oO,arguments)},monochromatic:function(){return this._applyCombination(lO,arguments)},splitcomplement:function(){return this._applyCombination(sO,arguments)},triad:function(){return this._applyCombination(aO,[3])},tetrad:function(){return this._applyCombination(aO,[4])}},YC.fromRatio=function(t,e){if("object"==HC(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:gO(t[n]));t=r}return YC(t,e)},YC.equals=function(t,e){return!(!t||!e)&&YC(t).toRgbString()==YC(e).toRgbString()},YC.random=function(){return YC.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},YC.mix=function(t,e,r){r=0===r?0:r||50;var n=YC(t).toRgb(),i=YC(e).toRgb(),o=r/100;return YC({r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a})},YC.readability=function(t,e){var r=YC(t),n=YC(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},YC.isReadable=function(t,e,r){var n,i,o=YC.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},YC.mostReadable=function(t,e,r){var n,i,o,a,s=null,u=0;i=(r=r||{}).includeFallbackColors,o=r.level,a=r.size;for(var l=0;lu&&(u=n,s=YC(e[l]));return YC.isReadable(t,s,{level:o,size:a})||!i?s:(r.includeFallbackColors=!1,YC.mostReadable(t,["#fff","#000"],r))};var cO=YC.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},fO=YC.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(cO);function hO(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function pO(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function dO(t){return Math.min(1,Math.max(0,t))}function yO(t){return parseInt(t,16)}function vO(t){return 1==t.length?"0"+t:""+t}function gO(t){return t<=1&&(t=100*t+"%"),t}function mO(t){return Math.round(255*parseFloat(t)).toString(16)}function bO(t){return yO(t)/255}var xO,wO,_O,SO=(wO="[\\s|\\(]+("+(xO="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+xO+")[,|\\s]+("+xO+")\\s*\\)?",_O="[\\s|\\(]+("+xO+")[,|\\s]+("+xO+")[,|\\s]+("+xO+")[,|\\s]+("+xO+")\\s*\\)?",{CSS_UNIT:new RegExp(xO),rgb:new RegExp("rgb"+wO),rgba:new RegExp("rgba"+_O),hsl:new RegExp("hsl"+wO),hsla:new RegExp("hsla"+_O),hsv:new RegExp("hsv"+wO),hsva:new RegExp("hsva"+_O),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function EO(t){return!!SO.CSS_UNIT.exec(t)}var kO=2,TO=.16,CO=.05,OO=.05,AO=.15,PO=5,MO=4,IO=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function LO(t,e,r){var n;return(n=Math.round(t.h)>=60&&Math.round(t.h)<=240?r?Math.round(t.h)-kO*e:Math.round(t.h)+kO*e:r?Math.round(t.h)+kO*e:Math.round(t.h)-kO*e)<0?n+=360:n>=360&&(n-=360),n}function jO(t,e,r){return 0===t.h&&0===t.s?t.s:((n=r?t.s-TO*e:e===MO?t.s+TO:t.s+CO*e)>1&&(n=1),r&&e===PO&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function NO(t,e,r){var n;return(n=r?t.v+OO*e:t.v-AO*e)>1&&(n=1),Number(n.toFixed(2))}function RO(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=YC(t),i=PO;i>0;i-=1){var o=n.toHsv(),a=YC({h:LO(o,i,!0),s:jO(o,i,!0),v:NO(o,i,!0)}).toHexString();r.push(a)}r.push(n.toHexString());for(var s=1;s<=MO;s+=1){var u=n.toHsv(),l=YC({h:LO(u,s),s:jO(u,s),v:NO(u,s)}).toHexString();r.push(l)}return"dark"===e.theme?IO.map(function(t){var n=t.index,i=t.opacity;return YC.mix(e.backgroundColor||"#141414",r[n],100*i).toHexString()}):r}var DO={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},BO={},FO={};Object.keys(DO).forEach(function(t){BO[t]=RO(DO[t]),BO[t].primary=BO[t][5],FO[t]=RO(DO[t],{theme:"dark",backgroundColor:"#141414"}),FO[t].primary=FO[t][5]});BO.red,BO.volcano,BO.gold,BO.orange,BO.yellow,BO.lime,BO.green,BO.cyan,BO.blue,BO.geekblue,BO.purple,BO.magenta,BO.grey;var zO=function(t,e,r){var n=VC()(t),i=VC()(e);return VC()([(1-r)*n.red()+r*i.red(),(1-r)*n.green()+r*i.green(),(1-r)*n.blue()+r*i.blue()]).rgb()},UO=function(t,e,r,n){return void 0===e&&(e="#fff"),void 0===r&&(r="default"),void 0===n&&(n="rgb(150, 150, 150)"),"default"===r?function(t,e,r){void 0===e&&(e="#fff"),void 0===r&&(r="rgb(150, 150, 150)");var n=zO(e,t,.05).rgb().toString(),i=zO(e,t,.1).rgb().toString(),o=zO(e,t,.2).rgb().toString(),a=zO(e,t,.4).rgb().toString(),s=zO(e,r,.02).rgb().toString(),u=zO(e,r,.05).rgb().toString(),l=zO(e,r,.1).rgb().toString(),c=zO(e,r,.2).rgb().toString(),f=zO(e,r,.3).rgb().toString(),h=RO(t,{theme:"default",backgroundColor:e}),p=VC()(t).hex().toLowerCase(),d=h.indexOf(p),y=t;return-1!==d&&(y=h[d+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:n,inactiveStroke:a,inactiveFill:n,selectedStroke:t,selectedFill:e,highlightStroke:y,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:f,edgeActiveStroke:t,edgeInactiveStroke:c,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:l,comboMainStroke:f,comboMainFill:s,comboActiveStroke:t,comboActiveFill:n,comboInactiveStroke:f,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:y,comboHighlightFill:s,comboDisableStroke:c,comboDisableFill:u}}(t,e,"rgb(150, 150, 150)"):function(t,e,r){void 0===e&&(e="#fff"),void 0===r&&(r="#777");var n=zO(e,t,.2).rgb().toString(),i=zO(e,t,.3).rgb().toString(),o=zO(e,t,.6).rgb().toString(),a=zO(e,t,.8).rgb().toString(),s=zO(e,r,.2).rgb().toString(),u=zO(e,r,.25).rgb().toString(),l=zO(e,r,.3).rgb().toString(),c=zO(e,r,.4).rgb().toString(),f=zO(e,r,.5).rgb().toString(),h=RO(t,{theme:"dark",backgroundColor:e}),p=VC()(t).hex().toLowerCase(),d=h.indexOf(p),y=t;return-1!==d&&(y=h[d+1]),{mainStroke:a,mainFill:n,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:n,selectedStroke:t,selectedFill:n,highlightStroke:t,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:r,edgeActiveStroke:t,edgeInactiveStroke:r,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:l,comboMainStroke:c,comboMainFill:u,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:y,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:s}}(t,e,"#777")},GO=function(t,e,r,n){void 0===e&&(e="#fff"),void 0===r&&(r="default"),void 0===n&&(n="rgb(150, 150, 150)");var i=[];return t.forEach(function(t){i.push(UO(t,e,r,n))}),i},VO=UO("rgb(95, 149, 255)","rgb(255, 255, 255)"),HO={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:VO.mainStroke,fill:VO.mainFill},size:20,color:VO.mainStroke,linkPoints:{size:8,lineWidth:1,fill:VO.activeFill,stroke:VO.activeStroke}},nodeStateStyles:{active:{fill:VO.activeFill,stroke:VO.activeStroke,lineWidth:2,shadowColor:VO.mainStroke,shadowBlur:10},selected:{fill:VO.selectedFill,stroke:VO.selectedStroke,lineWidth:4,shadowColor:VO.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:VO.highlightFill,stroke:VO.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:VO.inactiveFill,stroke:VO.inactiveStroke,lineWidth:1},disable:{fill:VO.disableFill,stroke:VO.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:VO.edgeMainStroke,lineAppendWidth:2},color:VO.edgeMainStroke},edgeStateStyles:{active:{stroke:VO.edgeActiveStroke,lineWidth:1},selected:{stroke:VO.edgeSelectedStroke,lineWidth:2,shadowColor:VO.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:VO.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:VO.edgeInactiveStroke,lineWidth:1},disable:{stroke:VO.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:VO.comboMainFill,lineWidth:1,stroke:VO.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:VO.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:VO.comboActiveStroke,lineWidth:1,fill:VO.comboActiveFill},selected:{stroke:VO.comboSelectedStroke,lineWidth:2,fill:VO.comboSelectedFill,shadowColor:VO.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:VO.comboHighlightStroke,lineWidth:2,fill:VO.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:VO.comboInactiveStroke,fill:VO.comboInactiveFill,lineWidth:1},disable:{stroke:VO.comboDisableStroke,fill:VO.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},WO=function t(e,r){var n;e.isGroup()&&r.isGroup()&&(null===(n=e.get("children"))||void 0===n||n.forEach(function(e,n){var i=r.get("children")[n];t(e,i)}));var i=e.get("type"),o=r.get("type");if("image"===i&&"image"===o){var a=e.get("clipShape");a&&r.setClip({type:a.get("type"),attrs:a.attr()})}};function qO(t,e,r){if(t){if("function"==typeof t.addEventListener)return t.addEventListener(e,r,!1),{remove:function(){t.removeEventListener(e,r,!1)}};if("function"==typeof t.attachEvent)return t.attachEvent("on"+e,r),{remove:function(){t.detachEvent("on"+e,r)}}}}var YO=Ak.cloneEvent,XO=Ak.isViewportChanged,ZO=function(t){function e(e){var r=t.call(this,e)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=e,r.destroyed=!1,r.initEvents(),r}return(0,Sw.__extends)(e,t),e.prototype.initEvents=function(){var t=this.graph,e=this.extendEvents,r=void 0===e?[]:e,n=t.get("canvas"),i=n.get("el"),o=(0,Ew.wrapBehavior)(this,"onCanvasEvents"),a=(0,Ew.wrapBehavior)(this,"onExtendEvents"),s=(0,Ew.wrapBehavior)(this,"onWheelEvent");n.off("*").on("*",o),this.canvasHandler=o,r.push(qO(i,"wheel",s)),"undefined"!=typeof window&&(r.push(qO(window,"keydown",a)),r.push(qO(window,"keyup",a)),r.push(qO(window,"focus",a))),this.resetHandler&&t.off("afterchangedata",this.resetHandler),this.resetHandler=(0,Ew.wrapBehavior)(this,"resetStatus"),t.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var r=this,n=this.graph,i=n.get("canvas"),o=t.target,a=t.type;switch(a){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return}t.canvasX=t.x,t.canvasY=t.y;var s={x:t.canvasX,y:t.canvasY},u=n.get("group").getMatrix();if(u||(u=[1,0,0,0,1,0,0,0,1]),XO(u)&&(s=n.getPointByClient(t.clientX,t.clientY)),t.x=s.x,t.y=s.y,t.currentTarget=n,o===i)return"mousemove"!==a&&"mouseleave"!==a||this.handleMouseMove(t,"canvas"),t.target=i,t.item=null,n.emit(a,t),void n.emit("canvas:".concat(a),t);var l=e.getItemRoot(o);if(l){var c=l.get("item");if(!c.destroyed){var f=c.getType();if(t.target=o,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var h=n.getCanvasByPoint(t.x,t.y);t.canvasX=h.x,t.canvasY=h.y}t.name&&!t.name.includes(":")?(n.emit("".concat(f,":").concat(a),t),n.emit(a,t)):t.name&&n.emit(t.name,t),"dragstart"===a&&(this.dragging=!0),"dragend"===a&&(this.dragging=!1),"mousemove"===a&&this.handleMouseMove(t,f)}}else n.emit(a,t)},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,Ew.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,e){var r=this.graph,n=this.preItem,i=r.get("canvas"),o=t.target===i?null:t.item;t=YO(t),n&&n!==o&&!n.destroyed&&(t.item=n,this.emitCustomEvent(n.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(n.getType(),"dragleave",t)),o&&n!==o&&(t.item=o,this.emitCustomEvent(e,"mouseenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},e.prototype.emitCustomEvent=function(t,e,r){r.type=e,this.graph.emit("".concat(t,":").concat(e),r)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this.graph,e=this.canvasHandler,r=this.extendEvents;t.get("canvas").off("*",e),(0,Ew.each)(r,function(t){t.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(Mk),KO=r(6038),JO=r(8716),QO=r.n(JO),$O=Ak.traverseTree,tA=function(t,e){return t?(0,Ew.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},eA=function(t,e){var r=[],n=[],i={},o=0;for(o=0;o=0&&(o="x",i="y");var a=0;$O(t,function(t){return a++,t.x>n.x&&(n.x=t.x),t.xn.y&&(n.y=t.y),t.yWebGL.
    ','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
    ','Find out how to get it here.'].join("\n")),t},addGetWebGLMessage:function(e){var r=void 0!==(e=e||{}).parent?e.parent:document.body,n=void 0!==e.id?e.id:"oldie",i=t().getWebGLErrorMessage();i.id=n,r.appendChild(i)}}},uA=function(){var t=navigator.userAgent.toLowerCase();return t.indexOf("firefox")>-1?"firefox":t.indexOf("safari")>-1?"safari":t.indexOf("opr")>-1?"opera":t.indexOf("chrome")>-1?"chrome":t.indexOf("trident")>-1?"ie 11":t.indexOf("ie")>-1?"ie":"unknown"},lA=(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},Ak),d),y),v),g),cA=lA.radialLayout,fA=function(){function t(t){this.type=t.type,this.radial=t.radial,this.config=t}return t.prototype.init=function(t){var e=this;this.data=t,this.radial?this.layoutMethod=function(t){var r=QO()[e.type](t,e.config);return cA(r),r}:this.layoutMethod=function(t){return QO()[e.type](t,e.config)}},t.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},t.prototype.layout=function(t){return this.init(t),this.execute()},t}();(0,KO.registerLayout)("grid",KO.GridLayout),(0,KO.registerLayout)("random",KO.RandomLayout),(0,KO.registerLayout)("force",KO.ForceLayout),(0,KO.registerLayout)("circular",KO.CircularLayout),(0,KO.registerLayout)("dagre",KO.DagreLayout),(0,KO.registerLayout)("dagreCompound",KO.DagreCompoundLayout),(0,KO.registerLayout)("radial",KO.RadialLayout),(0,KO.registerLayout)("concentric",KO.ConcentricLayout),(0,KO.registerLayout)("mds",KO.MDSLayout),(0,KO.registerLayout)("fruchterman",KO.FruchtermanLayout),(0,KO.registerLayout)("fruchterman-gpu",KO.FruchtermanGPULayout),(0,KO.registerLayout)("gForce",KO.GForceLayout),(0,KO.registerLayout)("force2",KO.Force2Layout),(0,KO.registerLayout)("gForce-gpu",KO.GForceGPULayout),(0,KO.registerLayout)("comboForce",KO.ComboForceLayout),(0,KO.registerLayout)("comboCombined",KO.ComboCombinedLayout),(0,KO.registerLayout)("forceAtlas2",KO.ForceAtlas2Layout);var hA=function(){return function(t,e){var r=t.toString(),n=new Blob(["importScripts('".concat(e,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(n))}}(),pA=function(t){return void 0===t&&(t="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js"),new hA(function(){var t={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout),onmessage=function(e){(function(e){var r=e.data.type;return r===t.RUN||r===t.GPURUN})(e)&&function(e){var r=this;switch(e.data.type){case t.RUN:var n,i=e.data,o=i.nodes,a=i.edges,s=i.layoutCfg,u=(p=void 0===s?{}:s).type;if(!(l=layout.getLayoutByName(u))){this.postMessage({type:t.ERROR,message:"layout ".concat(u," not found")});break}p.onLayoutEnd=function(){r.postMessage({type:t.END,nodes:o}),null===n||void 0===n||n.destroy()},(n=new l(p)).init({nodes:o,edges:a}),n.execute();break;case t.GPURUN:var l,c=e.data,f=c.nodes,h=(a=c.edges,c.layoutCfg),p=void 0===h?{}:h,d=c.canvas;if(u=p.type,!(l=layout.getLayoutByName(u))){this.postMessage({type:t.ERROR,message:"layout ".concat(u," not found")});break}if("gpu"!==u.split("-")[1]){this.postMessage({type:t.ERROR,message:"layout ".concat(u," does not support GPU")});break}var y=new l(p);y.init({nodes:f,edges:a}),y.executeWithWorker(d,this)}}(e)}},t)},dA="LAYOUT_RUN",yA="LAYOUT_END",vA="LAYOUT_ERROR",gA="LAYOUT_TICK",mA="GPU_LAYOUT_RUN",bA="GPU_LAYOUT_END";function xA(t){"@babel/helpers - typeof";return(xA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var wA=function(t){return setTimeout(t,16)},_A=function(t){return clearTimeout(t)},SA=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||wA)(t)},EA=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||_A)(t)},kA=["fruchterman","gForce"],TA=["force","grid","circular"],CA=function(t){function e(e){var r=t.call(this,e)||this;return r.graph=e,r.layoutCfg=e.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return(0,Sw.__extends)(e,t),e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:("undefined"==typeof Worker?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=pA(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(EA(t.requestId),t.requestId=null),t.requestId2&&(EA(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,e){var r=this;return new Promise(function(n,i){return(0,Sw.__awaiter)(r,void 0,void 0,function(){var r,o,a,s,u,l,c,f,h;return(0,Sw.__generator)(this,function(p){switch(p.label){case 0:if(!(r=this.graph)||r.get("destroyed"))return[2];o=t.type,t.onLayoutEnd=function(){r.emit("aftersublayout",{type:o}),n()},o&&this.isGPU&&(AA(o)?o="".concat(o,"-gpu"):console.warn("The '".concat(o,"' layout does not support GPU calculation for now, it will run in CPU."))),Ak.isForce(o)?(a=t.onTick,s=t.animate,u=void 0===s&&("force"===o||"force2"===o),f=function(){a&&a(),(s||u)&&r.refreshPositions()},t.tick=f):"comboForce"!==o&&"comboCombined"!==o||(t.comboTrees=r.get("comboTrees")),!1;try{l=new KO.Layouts[o](t),this.layoutMethods[e]&&this.layoutMethods[e].destroy(),this.layoutMethods[e]=l}catch(t){console.warn("The layout method: '".concat(o,"' does not exist! Please specify it first.")),i()}return l.enableTick&&(c=t.onTick,f=function(){c&&c(),r.refreshPositions()},l.tick=f),function(t,e){var r;if(!(null===(r=null===t||void 0===t?void 0:t.nodes)||void 0===r?void 0:r.length))return;t.nodes.forEach(function(t){t.layoutOrder=e})}(h=this.filterLayoutData(this.data,t),e),l.init(h),r.emit("beforesublayout",{type:o}),[4,l.execute()];case 1:return p.sent(),l.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}})})})},e.prototype.updateLayoutMethod=function(t,e){var r=this;return new Promise(function(n,i){return(0,Sw.__awaiter)(r,void 0,void 0,function(){var r,i,o,a,s,u,l;return(0,Sw.__generator)(this,function(c){switch(c.label){case 0:return r=this.graph,i=null===e||void 0===e?void 0:e.type,e.onLayoutEnd=function(){r.emit("aftersublayout",{type:i}),n()},Ak.isForce(i)&&(o=e.onTick,a=e.animate,s=void 0===a&&("force"===i||"force2"===i),u=function(){null===o||void 0===o||o(),(a||s)&&r.refreshPositions()},e.tick=u),l=this.filterLayoutData(this.data,e),t.init(l),t.updateCfg(e),r.emit("beforesublayout",{type:i}),[4,t.execute()];case 1:return c.sent(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var e,r=this,n=this.graph;if(n&&!n.get("destroyed")){this.data=this.setDataFromGraph();var i=this.data,o=i.nodes,a=i.hiddenNodes;if(!o)return!1;var s=n.get("width"),u=n.get("height"),l={};Object.assign(l,{width:s,height:u,center:[s/2,u/2]},this.layoutCfg),this.layoutCfg=l;var c=l.type,f=!1;null===(e=this.layoutMethods)||void 0===e||e.forEach(function(t){var e;return f=!!(null===(e=t.nodes)||void 0===e?void 0:e.length)||f});var h=this.destoryLayoutMethods();n.emit("beforelayout");var p=Promise.resolve();f&&c&&1===(null===h||void 0===h?void 0:h.length)&&h[0]===c?this.tweakInit():p=this.initPositions(l.center,o),this.initPositions(l.center,a).then(),this.isGPU=PA(l,c);var d=l.onLayoutEnd,y=l.layoutEndFormatted,v=l.adjust;if(y||(l.layoutEndFormatted=!0,l.onAllLayoutEnd=function(){return(0,Sw.__awaiter)(r,void 0,void 0,function(){return(0,Sw.__generator)(this,function(t){switch(t.label){case 0:return d&&d(o),this.refreshLayout(),v&&l.pipes?[4,this.adjustPipesBox(this.data,v)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return n.emit("afterlayout"),[2]}})})}),this.stopWorker(),l.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var g=!1;return l.type?(g=!0,p=p.then(function(){return(0,Sw.__awaiter)(r,void 0,void 0,function(){return(0,Sw.__generator)(this,function(t){switch(t.label){case 0:return[4,this.execLayoutMethod(l,0)];case 1:return[2,t.sent()]}})})})):l.pipes&&(g=!0,l.pipes.forEach(function(t,e){p=p.then(function(){return(0,Sw.__awaiter)(r,void 0,void 0,function(){return(0,Sw.__generator)(this,function(r){switch(r.label){case 0:return[4,this.execLayoutMethod(t,e)];case 1:return[2,r.sent()]}})})})})),g?p.then(function(){l.onAllLayoutEnd&&l.onAllLayoutEnd(),t&&t()}).catch(function(t){console.warn("graph layout failed,",t)}):(n.refreshPositions(),null===t||void 0===t||t()),!1}},e.prototype.tweakInit=function(){var t=this.data,e=this.graph,r=t.nodes,n=t.edges;if(null===r||void 0===r?void 0:r.length){var i={};r.forEach(function(t){var e=t.x,r=t.y;isNaN(e)||isNaN(r)||(i[t.id]={x:e,y:r},t.mass=t.mass||2)}),n.forEach(function(t){var e=t.source,r=t.target,n=i[e],o=i[r];!n&&o?i[e]={x:o.x+80*(Math.random()-.5),y:o.y+80*(Math.random()-.5)}:!o&&n&&(i[r]={x:n.x+80*(Math.random()-.5),y:n.y+80*(Math.random()-.5)})});var o=e.get("width"),a=e.get("height");r.forEach(function(t){var e=i[t.id]||{x:o/2+20*(Math.random()-.5),y:a/2+20*(Math.random()-.5)};t.x=e.x,t.y=e.y})}},e.prototype.initWithPreset=function(t,e){var r=this;return new Promise(function(n,i){return(0,Sw.__awaiter)(r,void 0,void 0,function(){var r,i,o,a,s,u,l;return(0,Sw.__generator)(this,function(c){switch(c.label){case 0:return i=(r=this).layoutCfg,o=r.data,(null===(a=i.preset)||void 0===a?void 0:a.type)&&KO.Layouts[null===a||void 0===a?void 0:a.type]?(s=PA(a,a.type),u=s?"".concat(a.type,"-gpu"):a.type,l=new KO.Layouts[u](a),delete i.preset,l.init(o),[4,l.execute()]):(null===e||void 0===e||e(),n(),[2,!1]);case 1:return c.sent(),null===t||void 0===t||t(),n(),[2,!0]}})})})},e.prototype.layoutWithWorker=function(t,e){var r=this,n=this.layoutCfg,i=this.graph,o=this.getWorker(),a=this.workerData;if(!o)return!1;a.requestId=null,a.requestId2=null,a.currentTick=null,a.currentTickData=null,i.emit("beforelayout");var s=Promise.resolve(),u=!1;if(n.type)u=!0,s=s.then(function(){return r.runWebworker(o,t,n)});else if(n.pipes){u=!0;for(var l=function(e){s=s.then(function(){return r.runWebworker(o,t,e)})},c=0,f=n.pipes;c'),u=r?r.backgroundColor:void 0,l=r?r.padding:void 0;l?(0,Ew.isNumber)(l)&&(l=[l,l,l,l]):l=[0,0,0,0];var c=i+l[0]+l[2],f=o+l[1]+l[3],h={container:s,height:c,width:f,quickHit:!0},p="svg"===a?new FC(h):new qT(h),d=this.get("group").clone(),y=(0,Ew.clone)(d.getMatrix());y||(y=[1,0,0,0,1,0,0,0,1]);var v=(n.maxX+n.minX)/2,g=(n.maxY+n.minY)/2;y=MA(y,[["t",-v,-g],["t",o/2+l[3],i/2+l[0]]]),d.resetMatrix(),d.setMatrix(y),p.add(d);var m=p.get("el"),b="";e||(e="image/png"),setTimeout(function(){if("svg"===a){var r=m.cloneNode(!0),n=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",n);i.replaceChild(r,i.documentElement);var o=(new XMLSerializer).serializeToString(i);b="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(o))}else{var s=void 0,l=m.getContext("2d"),h=void 0;if(u){var p="undefined"!=typeof window?window.devicePixelRatio:1;try{s=l.getImageData(0,0,f*p,c*p),h=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=u,l.fillRect(0,0,f,c)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}b=m.toDataURL(e),u&&(l.clearRect(0,0,f,c),l.putImageData(s,0,0),l.globalCompositeOperation=h)}t&&t(b)},16)},e.prototype.downloadFullImage=function(t,e,r){var n=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=UC('
    '),l=document.querySelector(".g6-graph-watermarker"),c=r?r.backgroundColor:void 0,f=r?r.padding:void 0;f?(0,Ew.isNumber)(f)&&(f=[f,f,f,f]):f=[0,0,0,0];var h=o+f[0]+f[2],p=a+f[1]+f[3];if(l){var d=this.get("graphWaterMarker").cfg||{},y=d.width,v=d.height;h=Math.ceil(h/v)*v,p=Math.ceil(p/y)*y}var g,m,b={container:u,height:h,width:p},x="svg"===s?new FC(b):new qT(b),w=this.get("group"),_=(m=(g=w).clone(),WO(g,m),m),S=(0,Ew.clone)(_.getMatrix());S||(S=[1,0,0,0,1,0,0,0,1]);var E=(i.maxX+i.minX)/2,k=(i.maxY+i.minY)/2;S=MA(S,[["t",-E,-k],["t",a/2+f[3],o/2+f[0]]]),_.resetMatrix(),_.setMatrix(S),x.add(_);var T=x.get("el");e||(e="image/png"),this.asyncToDataUrl(e,c,function(r){var i=document.createElement("a"),o=(t||"graph")+("svg"===s?".svg":".".concat(e.split("/")[1]));n.dataURLToImage(r,s,i,o);var a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),i.dispatchEvent(a)},p,h,T)},e.prototype.downloadImage=function(t,e,r){var n=this;this.stopAnimate();var i=this.get("canvas").getRenderer();e||(e="image/png");var o=(t||"graph")+("svg"===i?".svg":".".concat(e.split("/")[1])),a=document.createElement("a");this.asyncToDataUrl(e,r,function(t){n.dataURLToImage(t,i,a,o);var e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e)})},e.prototype.dataURLToImage=function(t,e,r,n){if(t&&"data:"!==t){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,l=new Uint8Array(u);u--;)l[u]=s.charCodeAt(u);var c=new Blob([l],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(c,n):r.addEventListener("click",function(){r.download=n,r.href=window.URL.createObjectURL(c)})}else r.addEventListener("click",function(){r.download=n,r.href=t})}else console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items")},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),r=e.indexOf(t);r>=0&&(t.destroyPlugin(),e.splice(r,1))},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=HO.waterMarkerImage);var r=this.get("container");(0,Ew.isString)(r)&&(r=document.getElementById(r)),r.style.position||(r.style.position="relative");var n=this.get("graphWaterMarker"),i=(0,Ew.deepMix)({},HO.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!t){var l=s?r:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(n&&n.clear())}if(n)n.clear();else{var c={container:r,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f,window.devicePixelRatio=f),n=new qT(c),this.set("graphWaterMarker",n)}n.get("el").style.display="none";var h=n.get("context"),p=u.rotate,d=u.x,y=u.y;h.rotate(-p*Math.PI/180);var v=new Image;v.crossOrigin="anonymous",v.src=t,v.onload=function(){if(h.drawImage(v,d,y,u.width,u.height),h.rotate(p*Math.PI/180),s)r.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",n.destroyed||(t.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),r.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var r=this.get("container");(0,Ew.isString)(r)&&(r=document.getElementById(r)),r.style.position||(r.style.position="relative");var n=this.get("graphWaterMarker"),i=(0,Ew.deepMix)({},HO.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!(null===t||void 0===t?void 0:t.length)){var l=s?r:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(n&&n.clear())}if(n)n.clear();else{var c={container:r,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f,window.devicePixelRatio=f),n=new qT(c),this.set("graphWaterMarker",n)}n.get("el").style.display="none";var h=n.get("context"),p=u.rotate,d=u.fill,y=u.fontFamily,v=u.fontSize,g=u.baseline,m=u.x,b=u.y,x=u.lineHeight;h.rotate(-p*Math.PI/180),h.font="".concat(v,"px ").concat(y),h.fillStyle=d,h.textBaseline=g;for(var w=(0,Ew.isString)(t)?[t]:t,_=w.length-1;_>=0;_--)h.fillText(w[_],m,b+_*x);if(h.rotate(p*Math.PI/180),s)r.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var S=document.querySelector(".g6-graph-watermarker");S||((S=document.createElement("div")).className="g6-graph-watermarker"),S.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),r.appendChild(S)}},e.prototype.destroy=function(){var e,r,n,i;(0,Ew.each)(this.get("plugins"),function(t){t.destroyPlugin()});var o=this.get("tooltips");if(o)for(var a=0;a0)for(var l=u.length-1;l>=0;l--){var c=u[l].getModel();-1===e.indexOfChild(t.children||[],c.id)&&(i.innerRemoveChild(c.id,{x:t.x,y:t.y},n),u.splice(l,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var f=o.getModel();n&&o.set("originAttrs",{x:f.x,y:f.y}),o.set("model",Object.assign(f,t.data)),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,r,n)},e.prototype.innerRemoveChild=function(t,e,r){var n=this,i=n.findById(t);if(i)if((0,Ew.each)(i.get("children"),function(t){n.innerRemoveChild(t.getModel().id,e,r)}),r){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),n.get("removeList").push(i)}else n.removeItem(i,!1)},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var r=this;this.getNodes().map(function(t){return r.clearItemStates(t)}),this.getEdges().map(function(t){return r.clearItemStates(t)}),e&&this.get("enabledStack")&&this.pushStack("changedata",{before:r.get("originData"),after:t||r.get("data")}),t?(r.data(t),r.render(!1)):r.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t,e,r,n){void 0===n&&(n=!0);if(t){if(n&&this.get("enabledStack")&&this.pushStack("layout",{before:this.get("layout"),after:t}),this.set("layout",t),this.set("layoutMethod",this.getLayout()),this.layout(),e){var i=r;i||(i="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),i=this.getPointByCanvas(i.x,i.y);var o=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];i.x=i.x*o[0]+o[6],i.y=i.y*o[0]+o[7];var a=this.getGroup().getCanvasBBox(),s=a.minX,u=a.maxX,l=a.minY,c={x:(s+u)/2,y:(l+a.maxY)/2};"begin"===e&&(c.x=s,c.y=l),this.translate(i.x-c.x,i.y-c.y)}}else console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this,r=this.get("data"),n=this.get("layoutMethod"),i=this.get("layout"),o=r;if(null===i||void 0===i?void 0:i.excludeInvisibles){r=(0,Ew.clone)(this.get("data"));var a={};RA(r,function(t){var r=t.children;if(!(null===r||void 0===r?void 0:r.length))return!0;for(var n=r.length-1;n>=0;n--){var i=e.findById(r[n].id);(i?!i.isVisible():!1===r[n].visible)&&(a[t.id]=a[t.id]||[],a[t.id].push({idx:n,child:r.splice(n,1)[0]}))}}),o=n?n(r,this.get("layout")):r,RA(o,function(t){var e=a[t.id];if(null===e||void 0===e?void 0:e.length)for(var r=e.length-1;r>=0;r--){var n=e[r],i=n.idx,o=n.child;t.children.splice(i,0,o)}})}else o=n?n(r,this.get("layout")):r;var s=this.get("animate");(this.emit("beforerefreshlayout",{data:r,layoutData:o}),this.emit("beforelayout"),this.innerUpdateChild(o,void 0,s),t)&&this.get("viewController").fitView();s?this.layoutAnimate(o):(this.refresh(),this.paint()),this.emit("afterrefreshlayout",{data:r,layoutData:o}),this.emit("afterlayout")},e.prototype.addChild=function(t,e,r){void 0===r&&(r=!0);this.emit("beforeaddchild",{model:t,parent:e}),(0,Ew.isString)(e)||(e=e.get("id"));var n=this.findDataById(e);n&&(n.children||(n.children=[]),n.children.push(t),this.findById(e).refresh(),this.changeData(void 0,r))},e.prototype.updateChildren=function(t,e,r){void 0===r&&(r=!0);var n=this.findById(e);e&&n?(this.findDataById(e).children=t,n.refresh(),this.changeData(void 0,r)):console.warn("Update children failed! There is no node with id '".concat(e,"'"))},e.prototype.updateChild=function(t,r,n){void 0===n&&(n=!0);if(r&&this.findById(r)){var i=this.findDataById(r),o=this.findById(t.id);if(i.children||(i.children=[]),o){var a=e.indexOfChild(i.children,t.id);a>-1&&(i.children[a]=t)}else i.children.push(t);var s=this.findById(r);null===s||void 0===s||s.refresh(),this.changeData(void 0,n)}else this.changeData(t,n)},e.prototype.removeChild=function(t,r){void 0===r&&(r=!0);var n,i=this.findById(t);if((n=i?null===i||void 0===i?void 0:i.get("parent"):this.getNodes().find(function(e){return!!(e.getModel().children||[]).find(function(e){return e.id===t})}))&&!n.destroyed){var o=n.get("id"),a=this.findDataById(o),s=a&&a.children||[],u=e.indexOfChild(s,t);s.splice(u,1),n.refresh()}this.changeData(void 0,r)},e.prototype.findDataById=function(t,e){var r=this;if(e||(e=r.get("data")),t===e.id)return e;var n=null;return(0,Ew.each)(e.children||[],function(e){return e.id===t?(n=e,!1):!(n=r.findDataById(t,e))&&void 0}),n},e.prototype.layoutAnimate=function(t,e){var r=this,n=this.get("animateCfg");r.emit("beforeanimate",{data:t}),r.getEdges().forEach(function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(n){RA(t,function(i){var o=r.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,n,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*n,s.y=a.y+(i.y-a.y)*n}return!0}),(0,Ew.each)(r.get("removeList"),function(t){var e=t.getModel(),r=t.get("originAttrs"),i=t.get("to");e.x=r.x+(i.x-r.x)*n,e.y=r.y+(i.y-r.y)*n}),r.refreshPositions()},{duration:n.duration,easing:n.ease,callback:function(){(0,Ew.each)(r.getNodes(),function(t){t.set("originAttrs",null)}),(0,Ew.each)(r.get("removeList"),function(t){r.removeItem(t,!1)}),r.set("removeList",[]),n.callback&&n.callback(),r.emit("afteranimate",{data:t})},delay:n.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){void 0===t&&(t=!0);var e=this.get("data");if(!e||!(0,Ew.isObject)(e)||!Object.keys(e).length)throw new Error("data must be defined first");this.clear(),t&&this.get("enabledStack")&&this.clearStack(),this.emit("beforerender"),this.layout(this.get("fitView")),this.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(e){t.prototype.data.call(this,e),this.set("originData",jA(e))},e}(IA);function BA(t,e){if(t)for(var r in e)e.hasOwnProperty(r)&&(t.style[r]=e[r]);return t}var FA=function(){function t(t){this._cfgs=(0,Ew.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var r=e.getEvents(),n={};(0,Ew.each)(r,function(r,i){var o=(0,Ew.wrapBehavior)(e,r);n[i]=o,t.on(i,o)}),this._events=n,this.init()},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){var e;return null===(e=this._cfgs)||void 0===e?void 0:e[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,Ew.each)(e,function(e,r){t.off(r,e)}),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),zA=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),UA="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",GA=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultCfgs=function(){return{img:UA,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("container"),r=t.get("canvas").get("el"),n=this.get("img")||UA;n.includes("url(")||(n='url("'.concat(n,'")'));var i=UC("
    "),o=UC(""));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),e.insertBefore(i,r)},e.prototype.positionInit=function(){var t=this.get("graph"),e=t.get("minZoom"),r=t.get("width"),n=t.get("height");BA(this.get("container"),{width:"".concat(r,"px"),height:"".concat(n,"px")});var i=80*r/e,o=80*n/e;BA(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),r=t.matrix;r||(r=[1,0,0,0,1,0,0,0,1]);var n=this.get("follow");BA(e,{transform:"matrix(".concat(r[0],", ").concat(r[1],", ").concat(r[3],", ").concat(r[4],", ").concat(n?r[6]:"0",", ").concat(n?r[7]:"0",")")})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(FA),VA=r(8813),HA=r.n(VA),WA=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();"undefined"!=typeof document&&HA()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var qA=function(t){function e(e){return t.call(this,e)||this}return WA(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n
      \n
    • 菜单项1
    • \n
    • 菜单项2
    • \n
    \n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),e=UC("
    "));BA(e,{top:"0px",position:"absolute",visibility:"hidden"});var r=this.get("container");r||(r=this.get("graph").get("container")),(0,Ew.isString)(r)&&(r=document.getElementById(r)),r.appendChild(e),this.set("menu",e)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault();var r=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===r.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===r.indexOf("canvas"))return void e.onMenuHide();if(this.get("shouldBegin")(t)){var n=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);(0,Ew.isString)(a)?n.innerHTML=a:n.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),n.addEventListener("click",u)}var l=o.get("width"),c=o.get("height"),f=n.getBoundingClientRect(),h=this.get("offsetX")||0,p=this.get("offsetY")||0,d=o.getContainer().offsetTop,y=o.getContainer().offsetLeft,v=t.canvasX+y+h,g=t.canvasY+d+p;v+f.width>l&&(v=t.canvasX-f.width-h+y),g+f.height>c&&(g=t.canvasY-f.height-p+d),g<0&&(g=0),BA(n,{top:"".concat(g,"px"),left:"".concat(v,"px"),visibility:"visible"});var m="click"===this.get("trigger"),b=function(t){m?m=!1:e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&BA(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Ew.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(FA),YA=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),XA=function(){return(XA=Object.assign||function(t){for(var e,r=1,n=arguments.length;r-1,a=navigator.userAgent.toLowerCase().indexOf("safari")>-1,s=UC("\n ")),u=0,l=0,c=!1,f=0,h=0,p=0,d=0,y=0,v=0,g=a||o?"mousedown":"dragstart";s.addEventListener(g,function(i){var o,a;if(i.dataTransfer){var g=new Image;g.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(a=(o=i.dataTransfer).setDragImage)||void 0===a||a.call(o,g,0,0);try{i.dataTransfer.setData("text/html","view-port-minimap")}catch(t){i.dataTransfer.setData("text","view-port-minimap")}}if(e.refresh=!1,i.target===s){var m=s.style;f=parseInt(m.left,10),h=parseInt(m.top,10),p=parseInt(m.width,10),d=parseInt(m.height,10),p>r[0]||d>r[1]||(v=n.getZoom(),y=t.get("ratio"),c=!0,u=i.clientX,l=i.clientY)}},!1);var m=function(t){if(c&&!(0,Ew.isNil)(t.clientX)&&!(0,Ew.isNil)(t.clientY)){var e=u-t.clientX,i=l-t.clientY;(f-e<0||f-e+p>=r[0])&&(e=0),(h-i<0||h-i+d>=r[1])&&(i=0),h-=i,BA(s,{left:"".concat(f-=e,"px"),top:"".concat(h,"px")}),n.translate(e*v/y,i*v/y),u=t.clientX,l=t.clientY}};a||o||s.addEventListener("drag",m,!1);var b=function(){c=!1,e.refresh=!0},x=a||o?"mouseup":"dragend";s.addEventListener(x,b,!1),i.addEventListener("mouseleave",b),i.addEventListener("mouseup",b),(a||o)&&i.addEventListener("mousemove",m,!1),this.set("viewport",s),i.appendChild(s)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("totaldx"),r=this.get("totaldy"),n=this.get("graph"),i=this.get("size"),o=n.get("canvas").get("el"),a=n.get("width")||o.scrollWidth||500,s=n.get("height")||o.scrollHeight||500,u=n.getPointByCanvas(0,0),l=n.getPointByCanvas(a,s),c=this.get("viewport");c||this.initViewport();var f=(l.x-u.x)*t,h=(l.y-u.y)*t,p=u.x*t+e,d=u.y*t+r,y=p+f,v=d+h;p<0&&(f+=p,p=0),y>i[0]&&(f-=y-i[0]),d<0&&(h+=d,d=0),v>i[1]&&(h-=v-i[1]),this.set("ratio",t),BA(c,{left:"".concat(p,"px"),top:"".concat(d,"px"),width:"".concat(f,"px"),height:"".concat(h,"px")})}},e.prototype.updateGraphShapes=function(){var t,e=this._cfgs.graph,r=this.get("canvas"),n=e.get("group");n.destroyed||(r.clear(),this.get("hideEdge")?(t=r.addGroup(),n.get("children").forEach(function(e){e.get("id").includes("-edge")||t.add(e.clone())})):((t=n.clone()).resetMatrix(),r.add(t)),"svg"===e.get("renderer")&&this.updateVisible(t))},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var r=t.get("children");if(!r||!r.length)return;r.forEach(function(t){t.get("visible")||t.hide(),e.updateVisible(t)})}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph,r=this.get("canvas"),n=r.get("children")[0]||r.addGroup();this.get("hideEdge")||(0,Ew.each)(e.getEdges(),function(e){t.updateOneEdgeKeyShape(e,n)}),(0,Ew.each)(e.getNodes(),function(e){t.updateOneNodeKeyShape(e,n)});var i=e.getCombos();if(i&&i.length){var o=n.find(function(t){return"comboGroup"===t.get("name")})||n.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Ew.each)(i,function(e){t.updateOneComboKeyShape(e,o)}),null===o||void 0===o||o.sort(),null===o||void 0===o||o.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,e){if(!this.destroyed){var r=this.get("itemMap")||{},n=r[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};n?s=Object.assign(a,s):(n=o,e.add(n));var u=n.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),n.attr(s),t.isVisible()?n.show():n.hide(),n.exist=!0;var l=t.getModel().depth;isNaN(l)||n.set("zIndex",l),r[t.get("id")]=n,this.set("itemMap",r)}},e.prototype.updateOneNodeKeyShape=function(t,e){var r=this.get("itemMap")||{},n=r[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};n?(s=Object.assign(a,s),n.toFront()):(n=o,e.add(n));var u=n.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),n.attr(s),t.isVisible()?n.show():n.hide(),n.exist=!0;var l=t.getModel().depth;isNaN(l)||n.set("zIndex",l),r[t.get("id")]=n,this.set("itemMap",r)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph,r=this.get("canvas"),n=r.get("children")[0]||r.addGroup();this.get("hideEdge")||(0,Ew.each)(e.getEdges(),function(e){t.updateOneEdgeKeyShape(e,n)}),(0,Ew.each)(e.getNodes(),function(e){t.updateOneNodeDelegateShape(e,n)});var i=e.getCombos();if(i&&i.length){var o=n.find(function(t){return"comboGroup"===t.get("name")})||n.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Ew.each)(i,function(e){t.updateOneComboKeyShape(e,o)}),null===o||void 0===o||o.sort(),null===o||void 0===o||o.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var r=e.length-1;r>=0;r--){var n=t[e[r]],i=n.exist;n.exist=!1,i||(n.remove(),delete t[e[r]])}},e.prototype.updateOneEdgeKeyShape=function(t,e){var r=this.get("itemMap")||{},n=r[t.get("id")];if(n){var i=t.get("keyShape").attr("path");n.attr("path",i)}else n=t.get("keyShape").clone(),e.add(n);t.isVisible()?n.show():n.hide(),n.exist=!0,r[t.get("id")]=n,this.set("itemMap",r)},e.prototype.updateOneNodeDelegateShape=function(t,e){var r=this.get("delegateStyle"),n=this.get("itemMap")||{},i=n[t.get("id")],o=t.getBBox();if(i){var a={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(a),i.toFront()}else i=e.addShape("rect",{attrs:XA({x:o.minX,y:o.minY,width:o.width,height:o.height},r),name:"minimap-node-shape"});t.isVisible()?i.show():i.hide(),i.exist=!0,n[t.get("id")]=i,this.set("itemMap",n)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this.get("graph"),e=this.get("size"),r=this.get("className"),n=this.get("container"),i=UC("
    "));(0,Ew.isString)(n)&&(n=document.getElementById(n)),n?n.appendChild(i):t.get("container").appendChild(i),this.set("container",i);var o,a=UC('
    ');i.appendChild(a),a.addEventListener("dragenter",function(t){t.preventDefault()}),a.addEventListener("dragover",function(t){t.preventDefault()}),o="svg"===t.get("renderer")?new FC({container:a,width:e[0],height:e[1]}):new qT({container:a,width:e[0],height:e[1]}),this.set("canvas",o),this.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed&&this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),r=this.get("canvas"),n=this.get("type"),i=this.get("padding");if(!r.destroyed){switch(n){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=r.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getCanvasBBox(),u=t.getZoom()||1,l=s.width/u,c=s.height/u;Number.isFinite(a.width)&&(l=ZA(a.width,l),c=ZA(a.height,c)),l+=2*i,c+=2*i;var f=Math.min(e[0]/l,e[1]/c),h=[1,0,0,0,1,0,0,0,1],p=0,d=0;Number.isFinite(a.minX)&&(p=-a.minX),Number.isFinite(a.minY)&&(d=-a.minY);var y=(e[0]-(l-2*i)*f)/2,v=(e[1]-(c-2*i)*f)/2;h=KA(h,[["t",p,d],["s",f,f],["t",y,v]]),o.setMatrix(h),this.set("ratio",f),this.set("totaldx",y+p*f),this.set("totaldy",v+d*f),this.set("dx",y),this.set("dy",v),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("container");(null===e||void 0===e?void 0:e.parentNode)&&e.parentNode.removeChild(e)},e}(FA),QA=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function $A(t,e,r){var n=t.x-e.x,i=t.y-e.y;return!r||Math.abs(n)>r||Math.abs(i)>r?Math.sqrt(n*n+i*i):r}function tP(t,e){var r=(e.source.y-e.target.y)/(e.source.x-e.target.x),n=(r*r*e.source.x+r*(t.y-e.source.y)+t.x)/(r*r+1);return{x:n,y:r*(n-e.source.x)+e.source.y}}var eP=function(t){function e(e){return t.call(this,e)||this}return QA(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",function(){e&&e(),t.refreshPositions()})},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var r=t.edges||[],n={},i=!1;if((t.nodes||[]).forEach(function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(i=!0),n[t.id]=t}),i)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",n);var o=e.get("divisions"),a=e.get("divRate"),s=e.divideEdges(o);e.set("edgePoints",s);var u=e.getEdgeBundles();e.set("edgeBundles",u);for(var l=e.get("cycles"),c=e.get("iterations"),f=e.get("iterRate"),h=e.get("lambda"),p=0;pc;){var n=c/r,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=n*(t.x-i[o][e-1].x),a.y+=n*(t.y-i[o][e-1].y),f.push(a),r-=c,c=l}c-=r}}),f.push({x:u.x,y:u.y}),i[o]=f}}),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach(function(r,n){0!==n&&(e+=$A(r,t[n-1]))}),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],r=t.get("bundleThreshold"),n=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach(function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])}),e.forEach(function(o,a){var s=n[o.source],u=n[o.target];e.forEach(function(e,o){if(!(o<=a)){var l=n[e.source],c=n[e.target];t.getBundleScore({source:s,target:u},{source:l,target:c})>=r&&(i[a].push(o),i[o].push(a))}})}),i},e.prototype.getBundleScore=function(t,e){return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=$A({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=$A({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),this.getAngleScore(t,e)*this.getScaleScore(t,e)*this.getPositionScore(t,e)*this.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy})/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var r=(t.length+e.length)/2;return 2/(r/Math.min(t.length,e.length)+Math.max(t.length,e.length)/r)},e.prototype.getPositionScore=function(t,e){var r=(t.length+e.length)/2;return r/(r+$A({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var r=this.getEdgeVisibility(t,e),n=this.getEdgeVisibility(e,t);return rr||Math.abs(a.y)>r){var s=1/$A(i[n][t],i[e][t]);o.x+=a.x*s,o.y+=a.y*s}}),o},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(FA),rP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nP=function(){return(nP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(o||r.get("height"))&&e>1||s<(a||.05*r.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.set("delegateCenterDiff",void 0),this.magnify(t,i)}},e.prototype.scaleRByDrag=function(t){if(t){var e,r=this.get("dragPrePos"),n=this.get("graph"),i=n.getPointByClient(t.clientX,t.clientY);e=t.x-r.x<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||n.get("height"))&&e>1||s<(a||.05*n.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.magnify(t,i),this.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var e=0;e=t.originalEvent.wheelDelta<0?-.1:.1;var r=this.get("d")+e,n=this.get("maxD"),i=this.get("minD");if(ri){this.set("d",r);var o=this.get("r");this.set("molecularParam",(r+1)*o);var a=this.get("delegate"),s=a?{x:a.attr("x"),y:a.attr("y")}:void 0;this.set("delegateCenterDiff",void 0),this.magnify(t,s)}}},e.prototype.scaleDByDrag=function(t){var e=this.get("dragPrePos"),r=t.x-e.x>0?.1:-.1,n=this.get("d")+r,i=this.get("maxD"),o=this.get("minD");if(no){this.set("d",n);var a=this.get("r");this.set("molecularParam",(n+1)*a),this.magnify(t)}this.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){this.restoreCache();var r=this.get("graph"),n=this.get("cachedMagnifiedModels"),i=this.get("cachedOriginPositions"),o=this.get("showLabel"),a=this.get("r"),s=this.get("r2"),u=this.get("d"),l=this.get("molecularParam"),c=r.getNodes(),f=c.length,h=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!this.get("dragging")||"mousemove"!==this.get("trigger")&&"click"!==this.get("trigger")||(h=this.get("cacheCenter"));var p=this.get("delegateCenterDiff");p&&(h.x+=p.x,h.y+=p.y),this.updateDelegate(h,a);for(var d=0;d\n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n \n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),r=this.get("getContent")(e),n=r;(0,Ew.isString)(r)&&(n=UC(r));var i=this.get("className");n.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),(0,Ew.isString)(o)&&(o=document.getElementById(o)),o.appendChild(n),this.set("toolBar",n);var a=this.get("handleClick");n.addEventListener("click",function(r){var n=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],r=t.target;r;){if(e.push(r),"HTML"===r.tagName)return e.push(document,window),e;r=r.parentElement}return e}(r).filter(function(t){return"LI"===t.nodeName});if(0!==n.length){var i=n[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i))}});var s=this.get("position");s&&BA(n,{top:"".concat(s.y,"px"),left:"".concat(s.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),r=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),n=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&r&&n&&i&&(e.setAttribute("style","cursor: not-allowed"),r.setAttribute("style","opacity: 0.4"),n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),t.on("stackchange",function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;0===s?(e.setAttribute("style","cursor: not-allowed"),r.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),r.removeAttribute("style")),0===u?(n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(n.removeAttribute("style"),i.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&0!==e.length){var r=e.pop();if(r){var n=r.action;t.pushStack(n,(0,Ew.clone)(r.data),"redo");var i=r.data.before;if("add"===n&&(i=r.data.after),!i)return;switch(n){case"visible":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);e.visible?t.showItem(r,!1):t.hideItem(r,!1)})});break;case"render":case"update":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);delete e.id,t.updateItem(r,e,!1),"combo"===r.getType()&&t.updateCombo(r)})});break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=e.itemType;delete e.itemType,t.addItem(r,e,!1)})});break;case"add":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.removeItem(e.id,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})});break;case"createCombo":var o=r.data.after.combos,a=o[o.length-1];Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})}),t.removeItem(a.id,!1);break;case"uncombo":var s=i.combos[i.combos.length-1],u=i.nodes.concat(i.combos).map(function(t){return t.id}).filter(function(t){return t!==s.id});t.createCombo(s,u,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var r=e.pop();if(r){var n=r.action,i=r.data.after;if(t.pushStack(n,(0,Ew.clone)(r.data)),"delete"===n&&(i=r.data.before),!i)return;switch(n){case"visible":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);e.visible?t.showItem(r,!1):t.hideItem(r,!1)})});break;case"render":case"update":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);delete e.id,t.updateItem(r,e,!1),"combo"===r.getType()&&t.updateCombo(r)})});break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach(function(e){t.removeItem(e.id,!1)}),i.nodes&&i.nodes.forEach(function(e){t.removeItem(e.id,!1)}),i.combos&&i.combos.forEach(function(e){t.removeItem(e.id,!1)});break;case"add":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=e.itemType;delete e.itemType,t.addItem(r,e,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})});break;case"createCombo":var o=i.combos[i.combos.length-1];t.createCombo(o,o.children.map(function(t){return t.id}),!1);break;case"uncombo":var a=r.data.before.combos,s=a[a.length-1];t.uncombo(s.id,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),e=t.getZoom(),r=1/(1-.05*this.get("zoomSensitivity"));r*e>(this.get("maxZoom")||t.get("maxZoom"))||t.zoomTo(e*r)},e.prototype.zoomIn=function(){var t=this.get("graph"),e=t.getZoom(),r=1-.05*this.get("zoomSensitivity");r*e<(this.get("minZoom")||t.get("minZoom"))||t.zoomTo(e*r)},e.prototype.realZoom=function(){this.get("graph").zoomTo(1)},e.prototype.autoZoom=function(){this.get("graph").fitView([20,20])},e.prototype.handleDefaultOperator=function(t){switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom()}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Ew.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var r=this.get("handleClick");r&&t.removeEventListener("click",r)},e}(FA),uP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();"undefined"!=typeof document&&HA()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var lP=function(t){function e(e){return t.call(this,e)||this}return uP(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n

    类型:".concat(t.item.getType(),"

    \n ID:").concat(t.item.getID(),"\n ")},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,e=t.get("className")||"g6-component-tooltip",r=UC("
    ")),n=t.get("container");n||(n=t.get("graph").get("container")),(0,Ew.isString)(n)&&(n=document.getElementById(n)),BA(r,{position:"absolute",visibility:"hidden",display:"none"}),n.appendChild(r),"click"!==t.get("trigger")&&(r.addEventListener("mouseenter",function(t){BA(r,{visibility:"visible",display:"unset"})}),r.addEventListener("mouseleave",function(e){t.hideTooltip()})),t.set("tooltip",r)},e.prototype.onClick=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=t.item,n=this.get("graph");this.currentTarget===r?(this.currentTarget=null,this.hideTooltip(),n.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=r,this.showTooltip(t),n.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=t.item,n=this.get("graph");this.currentTarget=r,this.showTooltip(t),n.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=this.get("tooltip"),n=this.get("getContent")(t);(0,Ew.isString)(n)?r.innerHTML=n:(this.clearContainer(),r.appendChild(n)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&BA(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),r=this.get("tooltip");if(e(t)){var n=this.get("graph"),i=n.get("width"),o=n.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=n.getPointByClient(t.clientX,t.clientY),l=this.get("fixToNode"),c=t.item;if(c.getType&&"node"===c.getType()&&l&&(0,Ew.isArray)(l)&&l.length>=2){var f=c.getBBox();u={x:f.minX+f.width*l[0],y:f.minY+f.height*l[1]}}var h=n.getCanvasByPoint(u.x,u.y),p=h.x,d=h.y,y=n.getContainer(),v={x:p+y.offsetLeft+a,y:d+y.offsetTop+s};BA(r,{visibility:"visible",display:"unset"});var g=r.getBoundingClientRect();p+g.width+a>i&&(v.x-=g.width+a),d+g.height+s>o&&(v.y-=g.height+s,v.y<0&&(v.y=0)),BA(r,{left:"".concat(v.x,"px"),top:"".concat(v.y,"px")})}else BA(r,{visibility:"hidden",display:"none"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Ew.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(FA),cP=function(){function t(t){var e=t.x,r=void 0===e?0:e,n=t.y,i=void 0===n?0:n,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,l=t.className,c=void 0===l?"g6-component-timebar-tooltip":l,f=t.backgroundColor,h=void 0===f?"#000":f,p=t.textColor,d=void 0===p?"#fff":p,y=t.opacity,v=void 0===y?.8:y,g=t.fontSize,m=void 0===g?12:g;this.container=o,this.className=c,this.backgroundColor=h,this.textColor=d,this.x=r,this.y=i,this.text=a,this.padding=u,this.opacity=v,this.fontSize=m,this.render()}return t.prototype.render=function(){var t=this.className,e=(this.x,this.y,this.backgroundColor),r=this.textColor,n=this.text,i=this.padding,o=this.opacity,a=this.fontSize,s=this.container,u=UC("
    '));(0,Ew.isString)(s)&&(s=document.getElementById(s)),s.appendChild(u),this.parentHeight=s.offsetHeight,this.parentWidth=s.offsetWidth,BA(u,{visibility:"hidden",top:0,left:0});var l=UC("\n
    "));l.innerHTML=n,u.appendChild(l),this.backgroundDOM=l;var c=UC("
    "));u.appendChild(c),this.arrowDOM=c,this.container=u},t.prototype.show=function(t){var e=t.text,r=t.x;t.y,t.clientX,t.clientY;this.backgroundDOM.innerHTML=e;var n=this.backgroundDOM.offsetWidth,i=this.backgroundDOM.offsetHeight,o=this.arrowDOM.offsetWidth,a=this.arrowDOM.offsetHeight;BA(this.container,{top:"".concat(-i-a,"px"),left:"".concat(r,"px"),visibility:"visible"}),BA(this.backgroundDOM,{marginLeft:"".concat(-n/2,"px")}),BA(this.arrowDOM,{marginLeft:"".concat(-o/2,"px"),top:"".concat(i,"px")});var s=r-n/2,u=r+n/2;s<0?BA(this.backgroundDOM,{marginLeft:"".concat(-n/2-s,"px")}):u>this.parentWidth&&BA(this.backgroundDOM,{marginLeft:"".concat(-n/2-u+this.parentWidth+12,"px")})},t.prototype.hide=function(){BA(this.container,{top:0,left:0,visibility:"hidden"})},t}(),fP=function(){return(fP=Object.assign||function(t){for(var e,r=1,n=arguments.length;rr&&(o=r,i=e)})}i=e.originalEvent.deltaY>0?Math.max(0,i-1):Math.min(t.speedAxisY.length-1,i+1);var a=t.speedAxisY[i]-n;r=dP(r,[["t",0,a]]),t.speedPoint.setMatrix(r),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit("timebarConfigChanged",{speed:t.currentSpeed,type:t.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(e){var r,n,i=e.target.get("isChecked");i?(t.checkedIcon.hide(),t.checkedText.attr("text",(null===(n=t.controllerCfg)||void 0===n?void 0:n.timePointControllerText)||"单一时间"),t.currentType=wP.RANGE):(t.checkedIcon.show(),t.checkedText.attr("text",(null===(r=t.controllerCfg)||void 0===r?void 0:r.timeRangeControllerText)||"时间范围"),t.currentType=wP.SINGLE),e.target.set("isChecked",!i),t.group.emit("timebarConfigChanged",{type:t.currentType,speed:t.currentSpeed})})},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}(),SP=function(){return(SP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=b&&n<=x?l:c,a=v.addShape("rect",{attrs:SP({x:i+n*(y+2),y:i,width:y,height:p},o),draggable:!0,name:"tick-rect-".concat(n)}),s=v.addShape("rect",{attrs:{x:i+n*y+2*(2*n-1)/2,y:i,width:0===n||n===d-1?y+1:y+2,height:p,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(n)});s.toFront();var h,_=a.getBBox(),S=(_.minX+_.maxX)/2;if(g.push({rect:a,pickRect:s,value:e.date,x:S,y:_.minY}),u?(h=u(e),!(0,Ew.isString)(h)&&h&&(h=e.date)):n%Math.round(d/10)==0&&(h=e.date),h){m.push(h);var E=_.maxY+2*i;v.addShape("line",{attrs:{stroke:"#BFBFBF",x1:S,y1:E,x2:S,y2:E+4},name:"tick-line"});var k=E+4+i,T=v.addShape("text",{attrs:SP({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:S,y:k,textAlign:"center",text:h,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},f),capture:!1,name:"tick-label"}),C=T.getBBox();if(C.maxX>r?T.attr("textAlign","right"):C.minX<0&&T.attr("textAlign","left"),(0,Ew.isNumber)(w)&&10!==m.length){var O=EP([1,0,0,0,1,0,0,0,1],[["t",-S,-k],["r",w],["t",S-5,k+2]]);T.attr({textAlign:"left",matrix:O})}1===m.length?T.attr({textAlign:"left"}):10===m.length&&T.attr({textAlign:"right"})}}),this.tickRects=g;var _=this.group;this.currentSpeed=1,this.controllerBtnGroup=new _P(SP({group:_,x:this.x,y:this.y+n+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",function(e){var r=e.target;if("rect"===r.get("type")&&r.get("name")){var n=parseInt(r.get("name").split("-")[2],10);if(!isNaN(n)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach(function(t){t.rect.attr(o)});var a=t.selectedTickStyle;i[n].rect.attr(a),t.startTickRectId=n,t.endTickRectId=n;var s=n/i.length;t.graph.emit("valuechange",{value:[s,s]})}}}),e.on("dragstart",function(e){var r=t.tickRects,n=t.unselectedTickStyle;r.forEach(function(t){t.rect.attr(n)});var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;r[o].rect.attr(a),t.startTickRectId=o;var s=o/r.length;t.graph.emit("valuechange",{value:[s,s]}),t.dragging=!0}),e.on("dragover",function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var r=parseInt(e.target.get("name").split("-")[2],10),n=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s=n&&s<=r?o:a;i[s].rect.attr(u)}var l=i.length;t.endTickRectId=r;var c=n/l,f=r/l;t.graph.emit("valuechange",{value:[c,f]})}}),e.on("drop",function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var r=t.startTickRectId,n=parseInt(e.target.get("name").split("-")[2],10);if(!(n0?this.endTickRectId++:(e[this.endTickRectId].rect.attr(n),this.endTickRectId--),o!==this.startTickRectId)this.endTickRectIdthis.max?NaN:this.values[n]},e.prototype.getText=function(e){for(var r=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(PP),IP=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,LP="[^\\s]+",jP=/\[([^]*?)\]/gm;function NP(t,e){for(var r=[],n=0,i=t.length;n-1?n:null}};function DP(t){for(var e=[],r=1;r3?0:(t-t%10!=10?1:0)*t%10]}},GP=DP({},UP),VP=function(t){return GP=DP(GP,t)},HP=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},WP=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+WP(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+WP(Math.floor(Math.abs(e)/60),2)+":"+WP(Math.abs(e)%60,2)}},YP=function(t){return+t-1},XP=[null,"\\d\\d?"],ZP=[null,LP],KP=["isPm",LP,function(t,e){var r=t.toLowerCase();return r===e.amPm[0]?0:r===e.amPm[1]?1:null}],JP=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var r=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?r:-r}return 0}],QP={D:["day","\\d\\d?"],DD:["day","\\d\\d"],Do:["day","\\d\\d?"+LP,function(t){return parseInt(t,10)}],M:["month","\\d\\d?",YP],MM:["month","\\d\\d",YP],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","\\d\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","\\d\\d?"],HH:["hour","\\d\\d"],m:["minute","\\d\\d?"],mm:["minute","\\d\\d"],s:["second","\\d\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:XP,dd:XP,ddd:ZP,dddd:ZP,MMM:["month",LP,RP("monthNamesShort")],MMMM:["month",LP,RP("monthNames")],a:KP,A:KP,ZZ:JP,Z:JP},$P={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},tM=function(t){return DP($P,t)},eM=function(t,e,r){if(void 0===e&&(e=$P.default),void 0===r&&(r={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var n=[];e=(e=$P[e]||e).replace(jP,function(t,e){return n.push(e),"@@@"});var i=DP(DP({},GP),r);return(e=e.replace(IP,function(e){return qP[e](t,i)})).replace(/@@@/g,function(){return n.shift()})};function rM(t,e,r){if(void 0===r&&(r={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=$P[e]||e,t.length>1e3)return null;var n={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(jP,function(t,e){return o.push(HP(e)),"@@@"}),s={},u={};a=HP(a).replace(IP,function(t){var e=QP[t],r=e[0],n=e[1],o=e[3];if(s[r])throw new Error("Invalid format. "+r+" specified twice in format");return s[r]=!0,o&&(u[o]=!0),i.push(e),"("+n+")"}),Object.keys(u).forEach(function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")}),a=a.replace(/@@@/g,function(){return o.shift()});var l=t.match(new RegExp(a,"i"));if(!l)return null;for(var c,f=DP(DP({},GP),r),h=1;h11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return c}var nM={format:eM,parse:rM,defaultI18n:UP,setGlobalDateI18n:VP,setGlobalDateMasks:tM};var iM="format";function oM(t,e){return(m[iM]||nM[iM])(t,e)}function aM(t){return(0,Ew.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),(0,Ew.isDate)(t)&&(t=t.getTime()),t}var sM=1e3,uM=60*sM,lM=60*uM,cM=24*lM,fM=31*cM,hM=365*cM,pM=[["HH:mm:ss",sM],["HH:mm:ss",10*sM],["HH:mm:ss",30*sM],["HH:mm",uM],["HH:mm",10*uM],["HH:mm",30*uM],["HH",lM],["HH",6*lM],["HH",12*lM],["YYYY-MM-DD",cM],["YYYY-MM-DD",4*cM],["YYYY-WW",7*cM],["YYYY-MM",fM],["YYYY-MM",4*fM],["YYYY-MM",6*fM],["YYYY",380*cM]];function dM(t,e,r){var n,i=(n=function(t){return t[1]},function(t,e,r,i){for(var o=(0,Ew.isNil)(r)?0:r,a=(0,Ew.isNil)(i)?t.length:i;o>>1;n(t[s])>e?a=s:o=s+1}return o})(pM,(e-t)/r)-1,o=pM[i];return i<0?o=pM[0]:i>=pM.length&&(o=(0,Ew.last)(pM)),o}var yM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return(0,Sw.__extends)(e,t),e.prototype.translate=function(t){t=aM(t);var e=this.values.indexOf(t);return-1===e&&(e=(0,Ew.isNumber)(t)&&t-1){var n=this.values[r],i=this.formatter;return n=i?i(n,e):oM(n,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;(0,Ew.each)(e,function(t,r){e[r]=aM(t)}),e.sort(function(t,e){return t-e}),t.prototype.setDomain.call(this)},e}(MP),vM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return(0,Sw.__extends)(e,t),e.prototype.scale=function(t){if((0,Ew.isNil)(t))return NaN;var e=this.rangeMin(),r=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(r-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,r=(0,Ew.head)(e),n=(0,Ew.last)(e);rthis.max&&(this.max=n),(0,Ew.isNil)(this.minLimit)||(this.min=r),(0,Ew.isNil)(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=(0,Ew.getRange)(this.values),e=t.min,r=t.max;(0,Ew.isNil)(this.min)&&(this.min=e),(0,Ew.isNil)(this.max)&&(this.max=r),this.min>this.max&&(this.min=e,this.max=r)},e.prototype.calculateTicks=function(){var e=this,r=t.prototype.calculateTicks.call(this);return this.nice||(r=(0,Ew.filter)(r,function(t){return t>=e.min&&t<=e.max})),r},e.prototype.getScalePercent=function(t){var e=this.max,r=this.min;return(t-r)/(e-r)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(PP),gM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return(0,Sw.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(vM);function mM(t,e){var r=Math.E;return e>=0?Math.pow(r,Math.log(e)/t):-1*Math.pow(r,Math.log(-e)/t)}function bM(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function xM(t,e,r){(0,Ew.isNil)(r)&&(r=Math.max.apply(null,t));var n=r;return(0,Ew.each)(t,function(t){t>0&&t1&&(n=1),n}var wM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return(0,Sw.__extends)(e,t),e.prototype.invert=function(t){var e,r=this.base,n=bM(r,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(n-(e=bM(r,a/r)))*o;if(t=0?1:-1;return Math.pow(o,r)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,r=this.min;if(e===r)return 0;var n=this.exponent;return(mM(n,t)-mM(n,r))/(mM(n,e)-mM(n,r))},e}(vM),SM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return(0,Sw.__extends)(e,t),e.prototype.getText=function(t,e){var r=this.translate(t),n=this.formatter;return n?n(r,e):oM(r,this.mask)},e.prototype.scale=function(e){var r=e;return((0,Ew.isString)(r)||(0,Ew.isDate)(r))&&(r=this.translate(r)),t.prototype.scale.call(this,r)},e.prototype.translate=function(t){return aM(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),r=this.getConfig("max");if((0,Ew.isNil)(e)&&(0,Ew.isNumber)(e)||(this.min=this.translate(this.min)),(0,Ew.isNil)(r)&&(0,Ew.isNumber)(r)||(this.max=this.translate(this.max)),t&&t.length){var n=[],i=1/0,o=i,a=0;(0,Ew.each)(t,function(t){var e=aM(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a1&&(this.minTickInterval=o-i),(0,Ew.isNil)(e)&&(this.min=i),(0,Ew.isNil)(r)&&(this.max=a)}},e}(gM),EM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return(0,Sw.__extends)(e,t),e.prototype.invert=function(t){var e=this.ticks,r=e.length,n=this.getInvertPercent(t),i=Math.floor(n*(r-1));if(i>=r-1)return(0,Ew.last)(e);if(i<0)return(0,Ew.head)(e);var o=e[i],a=i/(r-1);return o+(n-a)/((i+1)/(r-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||((0,Ew.last)(e)!==this.max&&e.push(this.max),(0,Ew.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<(0,Ew.head)(e))return 0;if(t>(0,Ew.last)(e))return 1;var r=0;return(0,Ew.each)(e,function(e,n){if(!(t>=e))return!1;r=n}),r/(e.length-1)},e}(vM),kM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return(0,Sw.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(EM),TM={};function CM(t){return TM[t]}function OM(t,e){if(CM(t))throw new Error("type '"+t+"' existed.");TM[t]=e}var AM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return(0,Sw.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,Ew.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(PP);function PM(t){var e=t.values,r=t.tickInterval,n=t.tickCount,i=t.showLast;if((0,Ew.isNumber)(r)){var o=(0,Ew.filter)(e,function(t,e){return e%r==0}),a=(0,Ew.last)(e);return i&&(0,Ew.last)(o)!==a&&o.push(a),o}var s=e.length,u=t.min,l=t.max;if((0,Ew.isNil)(u)&&(u=0),(0,Ew.isNil)(l)&&(l=e.length-1),!(0,Ew.isNumber)(n)||n>=s)return e.slice(u,l+1);if(n<=0||l<=0)return[];for(var c=1===n?s:Math.floor(s/(n-1)),f=[],h=u,p=0;p=l);p++)h=Math.min(u+p*c,l),p===n-1&&i?f.push(e[l]):f.push(e[h]);return f}var MM=Math.sqrt(50),IM=Math.sqrt(10),LM=Math.sqrt(2),jM=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,r;void 0===t&&(t=5);var n,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u0?n=NM(s=Math.floor(s/n)*n,u=Math.ceil(u/n)*n,t):n<0&&(n=NM(s=Math.ceil(s*n)/n,u=Math.floor(u*n)/n,t)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(u/n)*n,this.domain(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(u*n)/n,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,r){var n,i,o,a,s=-1;if(r=+r,(t=+t)==(e=+e)&&r>0)return[t];(n=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=MM?10:o>=IM?5:o>=LM?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=MM?10:o>=IM?5:o>=LM?2:1)}function RM(t,e,r){return("ceil"===r?Math.ceil(t/e):"floor"===r?Math.floor(t/e):Math.round(t/e))*e}function DM(t,e,r){var n=RM(t,r,"floor"),i=RM(e,r,"ceil");n=(0,Ew.fixedBase)(n,r),i=(0,Ew.fixedBase)(i,r);for(var o=[],a=Math.max((i-n)/(Math.pow(2,12)-1),r),s=n;s<=i;s+=a){var u=(0,Ew.fixedBase)(s,a);o.push(u)}return{min:n,max:i,ticks:o}}function BM(t,e,r){var n,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,l=void 0===u?5:u,c=(0,Ew.isNil)(i)?(0,Ew.isNil)(e)?a:e:i,f=(0,Ew.isNil)(o)?(0,Ew.isNil)(r)?s:r:o;if(c>f&&(f=(n=[c,f])[0],c=n[1]),l<=2)return[c,f];for(var h=(f-c)/(l-1),p=[],d=0;d=0&&(u=1),1-s/(a-1)-r+u}function VM(t,e,r){var n=(0,Ew.size)(e);return 1-(0,Ew.indexOf)(e,t)/(n-1)-r+1}function HM(t,e,r,n,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,n)-Math.min(r,i));return 2-Math.max(a/s,s/a)}function WM(t,e){return t>=e?2-(t-1)/(e-1):1}function qM(t,e,r,n){var i=e-t;return 1-.5*(Math.pow(e-n,2)+Math.pow(t-r,2))/Math.pow(.1*i,2)}function YM(t,e,r){var n=e-t;if(r>n){var i=(r-n)/2;return 1-Math.pow(i,2)/Math.pow(.1*n,2)}return 1}function XM(t,e,r,n,i,o){void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=zM),void 0===o&&(o=[.25,.2,.5,.05]);var a=r<0?0:Math.round(r);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===a)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var s=(e-t)/(w=r||5);return{min:t,max:e,ticks:Array(w).fill(null).map(function(e,r){return FM(t+s*r)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},l=1;l<1/0;){for(var c=0;cu.score&&(!n||S<=t&&E>=e)&&(u.lmin=S,u.lmax=E,u.lstep=k,u.score=A)}v+=1}p+=1}}l+=1}var P=FM(u.lmax),M=FM(u.lmin),I=FM(u.lstep),L=Math.floor(function(t){return Math.round(1e12*t)/1e12}((P-M)/I))+1,j=new Array(L);j[0]=FM(M);for(c=1;c1&&(i*=Math.ceil(a)),n&&ihM)for(var u=JM(r),l=Math.ceil(o/hM),c=s;c<=u+l;c+=l)a.push(QM(c));else if(o>fM){var f=Math.ceil(o/fM),h=$M(e),p=function(t,e){var r=JM(t),n=JM(e),i=$M(t);return 12*(n-r)+($M(e)-i)%12}(e,r);for(c=0;c<=p+f;c+=f)a.push(tI(s,c+h))}else if(o>cM){var d=(b=new Date(e)).getFullYear(),y=b.getMonth(),v=b.getDate(),g=Math.ceil(o/cM),m=function(t,e){return Math.ceil((e-t)/cM)}(e,r);for(c=0;clM){d=(b=new Date(e)).getFullYear(),y=b.getMonth(),g=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/lM),_=function(t,e){return Math.ceil((e-t)/lM)}(e,r);for(c=0;c<=_+w;c+=w)a.push(new Date(d,y,g,x+c).getTime())}else if(o>uM){var S=function(t,e){return Math.ceil((e-t)/6e4)}(e,r),E=Math.ceil(o/uM);for(c=0;c<=S+E;c+=E)a.push(e+c*uM)}else{var k=o;k=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a}),AP("log",function(t){var e,r=t.base,n=t.tickCount,i=t.min,o=t.max,a=t.values,s=bM(r,o);if(i>0)e=Math.floor(bM(r,i));else{var u=xM(a,r,o);e=Math.floor(bM(r,u))}for(var l=s-e,c=Math.ceil(l/n),f=[],h=e;h=0?1:-1;return Math.pow(t,e)*r})}),AP("quantile",function(t){var e=t.tickCount,r=t.values;if(!r||!r.length)return[];for(var n=r.slice().sort(function(t,e){return t-e}),i=[],o=0;op?(s.show(),l.show(),p=c.minX+c.width+10):(s.hide(),l.hide()),s}),this.controllerBtnGroup=new _P(dI({group:this.group,x:this.x,y:this.y+r+25,width:e,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),o.move(this.x,this.y),this.bindEvents(),this.currentMode===wP.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},t.prototype.bindEvents=function(){var t=this,e=this.group.find(function(t){return"minHandlerShape"===t.get("name")});e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(t){return"maxHandlerShape"===t.get("name")});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat("playPauseBtn",":click"),function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()}),this.group.on("".concat("nextStepBtn",":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()}),this.group.on("".concat("preStepBtn",":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()}),this.group.on("timebarConfigChanged",function(e){var r=e.type,n=e.speed;t.currentSpeed=n,t.currentMode=r,r===wP.SINGLE?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):r===wP.RANGE&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())})},t.prototype.adjustTickIndex=function(t){for(var e=0;e1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var e=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",r-e);var n=(0,Ew.get)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,r]),o=i[0],a=i[1];this.minHandlerShape.setX(e-n/2),(0,Ew.each)(o,function(e,r){return t.minTextShape.attr(r,e)}),this.maxHandlerShape.setX(r-n/2),(0,Ew.each)(a,function(e,r){return t.maxTextShape.attr(r,e)}),this.currentMode===wP.RANGE?this.graph.emit("valuechange",{value:[this.start,this.end].sort()}):this.currentMode===wP.SINGLE&&this.graph.emit("valuechange",{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,r,n=(0,Ew.get)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(r=[o,i])[0],o=r[1],u=!0);var l=i.getBBox(),c=o.getBBox(),f=null,h=null;return"trend"===this.timeBarType?(f=a-l.widththis.x+this.width?{x:s-n/2-2,textAlign:"right"}:{x:s+n/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(f=i.attr("x")>l.width?{x:a,textAlign:"center"}:{x:a,textAlign:"left"},h=o.attr("x")>this.width-c.width?{x:s,textAlign:"right"}:{x:s,textAlign:"center"}),u?[h,f]:[f,h]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame(function(){var e=t,r=e.ticks,n=e.width,i=t.currentSpeed,o=n/r.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())}):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timebarstartplay",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timebarendplay",null))},t.prototype.destory=function(){this.graph.off("valuechange",function(){});var t=this.group,e=t.find(function(t){return"minHandlerShape"===t.get("name")});e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var r=t.find(function(t){return"maxHandlerShape"===t.get("name")});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat("playPauseBtn",":click")),t.off("".concat("nextStepBtn",":click")),t.off("".concat("preStepBtn",":click")),t.off("timebarConfigChanged"),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}(),EI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kI=function(){return(kI=Object.assign||function(t){for(var e,r=1,n=arguments.length;r")),{position:"relative"}),a)&&this.get("graph").get("container").appendChild(t);this.set("timeBarContainer",t),e="SVG"===r.get("renderer")?new FC({container:t,width:i,height:o}):new qT({container:t,width:i,height:o}),this.get("containerCSS")&&BA(t,this.get("containerCSS")),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent();var e="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",e)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var e=this.get("timebar");e&&(e.isPlay=!!t,e.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,e=this._cfgs,r=e.width,n=e.x,i=e.y,o=e.padding,a=e.type,s=e.trend,u=e.slider,l=e.controllerCfg,c=e.textStyle,f=e.tick,h=e.backgroundStyle,p=e.foregroundStyle,d=s.data,y=TI(s,["data"]),v=r-2*o,g="trend"===a?26:4,m=this.get("graph"),b=this.get("timeBarGroup"),x=this.get("canvas"),w=null;if("trend"===a||"simple"===a){var _=this.get("getValue");w=new SI(kI(kI({graph:m,canvas:x,group:b,type:a,x:n+o,y:"trend"===a?i+o:i+o+15,width:v,height:g,padding:o,backgroundStyle:h,foregroundStyle:p,trendCfg:kI(kI({},y),{data:d.map(function(t){return(null===_||void 0===_?void 0:_(t))||t.value})})},u),{tick:{ticks:d,tickLabelFormatter:f.tickLabelFormatter,tickLabelStyle:f.tickLabelStyle,tickLineStyle:f.tickLineStyle},handlerStyle:kI(kI({},u.handlerStyle),{height:u.height||g}),controllerCfg:l,textStyle:c}))}else"tick"===a&&(w=new CP(kI({graph:m,canvas:x,group:b,x:n+o,y:i+o,width:r,height:42,padding:2,controllerCfg:l},f)));var S=function e(){var r=t.get("timebar");r.draggingHandler=!1,r.isPlay&&(r.isPlay=!1,r.currentHandler=r.maxHandlerShape,r.changePlayStatus()),document.removeEventListener("mouseup",e)};x.on("mousedown",function(t){"maxHandlerShape-handler"!==t.target.get("name")&&"minHandlerShape-handler"!==t.target.get("name")&&t.target!==w.foregroundShape||document.addEventListener("mouseup",S)}),this.set("timebar",w)},e.prototype.filterData=function(t){var e,r=t.value;if(!r){r=[];var n=this._cfgs.type;n&&"trend"!==n&&"simple"!==n?"tick"===n&&(r[0]=this._cfgs.tick.start,r[1]=this._cfgs.tick.end):(r[0]=this._cfgs.slider.start,r[1]=this._cfgs.slider.end)}var i=null,o=this._cfgs.type;if("trend"===o||"simple"===o?i=this._cfgs.trend.data:"tick"===o&&(i=this._cfgs.tick.data),i&&0!==i.length){var a=this.get("rangeChange"),s=this.get("graph"),u=Math.round(i.length*r[0]),l=Math.round(i.length*r[1]);l=l>=i.length?i.length-1:l,u=u>=i.length?i.length-1:u;var c=null===(e=this._cfgs.tick)||void 0===e?void 0:e.tickLabelFormatter,f=c?c(i[u]):i[u].date,h=c?c(i[l]):i[l].date;if("tick"!==o)this.get("timebar").setText(f,h);if(a)a(s,f,h);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=s.get("data"));var p=this.get("filterItemTypes"),d=this.get("changeData"),y=this.get("getDate"),v=this.get("shouldIgnore"),g=i[u].date,m=i[l].date;if(d||void 0===d){var b=this.cacheGraphData.nodes,x=this.cacheGraphData.edges,w={},_={};s.getNodes().forEach(function(t){return w[t.getID()]=!0}),s.getEdges().forEach(function(t){return _[t.getID()]=!0}),p.includes("node")&&(null===b||void 0===b||b.forEach(function(t){var e=+((null===y||void 0===y?void 0:y(t))||t.date),r=e>=g&&e<=m||(null===v||void 0===v?void 0:v("node",t,{min:g,max:m})),n=w[t.id];n&&!r?(s.removeItem(t.id),w[t.id]=!1):!n&&r&&(s.addItem("node",t),w[t.id]=!0)}),null===x||void 0===x||x.forEach(function(t){var e=w[t.source]&&w[t.target]||(null===v||void 0===v?void 0:v("edge",t,{min:g,max:m})),r=!!s.findById(t.id);r&&!e?(s.removeItem(t.id),_[t.id]=!1):!r&&e?(s.addItem("edge",t),_[t.id]=!0):r||(_[t.id]=!1)})),(this.get("filterEdge")||p.includes("edge"))&&(null===x||void 0===x||x.filter(function(t){var e=+((null===y||void 0===y?void 0:y(t))||t.date),r=e>=g&&e<=m||(null===v||void 0===v?void 0:v("edge",t,{min:g,max:m})),n=w[t.source]&&w[t.target],i=r&&n,o=_[t.id];o&&!i?(_[t.id]=!1,s.removeItem(t.id)):!o&&i&&(_[t.id]=!0,s.addItem("edge",t))}))}else p.includes("node")&&s.getNodes().forEach(function(t){var e=t.getModel();if(null===v||void 0===v||!v("node",e,{min:g,max:m})){var r=+((null===y||void 0===y?void 0:y(e))||e.date);rm?s.hideItem(t):s.showItem(t)}}),(this.get("filterEdge")||p.includes("edge"))&&s.getEdges().forEach(function(t){var e=t.getModel();if(null===v||void 0===v||!v("edge",e,{min:i[u].date,max:i[l].date})){var r=+((null===y||void 0===y?void 0:y(e))||e.date);if(ri[l].date)s.hideItem(t);else{var n=t.getSource().isVisible(),o=t.getTarget().isVisible();n&&o&&s.showItem(t)}}})}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on("valuechange",this.valueChangeListener)},e.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off("valuechange",this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),t.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,Ew.isString)(i)&&(i=document.getElementById(i)),i===n&&(i=i.parentElement),i.removeChild(n)}},e}(FA),OI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),AI=Ak.applyMatrix;var PI=function(t){function e(e){return t.call(this,e)||this}return OI(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,r=e.graph;if(!this.destroyed){var n=this.get("container");(0,Ew.isString)(n)&&(n=document.getElementById(n));var i=UC("
    ")),o=0,a=0,s=!1,u=0,l=0,c=0,f=0,h=0,p=0;n.addEventListener("mousedown",function(n){if(e.refresh=!1,n.target===i){var u=i.style;c=parseInt(u.width,10),f=parseInt(u.height,10);var l=t.get("width"),d=t.get("height");c>l||f>d||(p=r.getZoom(),h=t.get("ratio"),s=!0,o=n.clientX,a=n.clientY)}},!1),n.addEventListener("mousemove",function(e){if(s&&!(0,Ew.isNil)(e.clientX)&&!(0,Ew.isNil)(e.clientY)){var n=t.get("width"),d=t.get("height"),y=i.style;u=parseInt(y.left,10),l=parseInt(y.top,10),c=parseInt(y.width,10),f=parseInt(y.height,10);var v=o-e.clientX,g=a-e.clientY;u-v<0?v=u:u-v+c>=n&&(v=0),l-g<0?g=l:l-g+f>=d&&(g=0),l-=g,BA(i,{left:"".concat(u-=v,"px"),top:"".concat(l,"px")}),r.translate(v*p/h,g*p/h),o=e.clientX,a=e.clientY}},!1),n.addEventListener("mouseleave",function(){s=!1,e.refresh=!0},!1),n.addEventListener("mouseup",function(){s=!1,e.refresh=!0},!1),this.set("viewport",i),n.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),r=this.get("height"),n=this.get("graph"),i=n.get("width"),o=i/n.get("height"),a=n.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],l=[s.maxX-s.minX,s.maxY-s.minY],c={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(c.width=l[0],c.height=c.width/o):(c.height=l[1],c.width=c.height*o),c.minX=u[0]-c.width/2,c.minY=u[1]-c.height/2;var f=a.getMatrix();f||(f=[1,0,0,0,1,0,0,0,1]);var h=J_.invert([1,0,0,0,1,0,0,0,1],f),p=AI({x:c.minX,y:c.minY},h),d=n.getCanvasByPoint(p.x,p.y),y=this.get("viewport");y||this.initViewport();var v=i/c.width,g=v*e,m=v*r,b=e*-d.x/c.width,x=r*-d.y/c.height,w=b+g,_=x+m;b<0&&(g+=b,b=0),w>e&&(g-=w-e),x<0&&(m+=x,x=0),_>r&&(m-=_-r),this.set("ratio",t),BA(y,{left:"".concat(b,"px"),top:"".concat(x,"px"),width:"".concat(g,"px"),height:"".concat(m,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this.get("graph"),e=t.get("width"),r=t.get("height")/e,n=this.get("className"),i=this.get("container"),o=this.get("width"),a=this.get("height");o||a||(o=200),o?(a=r*o,this.set("height",a)):(o=1/r*a,this.set("width",o));var s=UC("
    "));(0,Ew.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(s):t.get("container").appendChild(s),this.set("container",s);var u=UC('
    ');s.appendChild(u);var l=UC('');u.appendChild(l),this.set("containerDOM",u),this.set("containerSpan",l);var c=UC(''));this.set("imgDOM",c),this.updateImgSize(),l.appendChild(c),this.updateCanvas()},e.prototype.updateImgSize=function(){var t=this.get("imgDOM"),e=this.get("width"),r=this.get("height");t.onload=function(){var n=function(t,e){var r,n;if(t.naturalWidth)r=t.naturalWidth,n=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){e&&e(i.width,i.height)}}return[r,n]}(t);n[0]>n[1]?t.width=e:t.height=r}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){this.get("imgDOM").remove(),this.set("graphImg",t);var e=UC(''));this.set("imgDOM",e),e.src=t,this.updateImgSize(),this.get("containerSpan").appendChild(e),this.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(FA),MI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),II=function(){return(II=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(i||r.get("height"))&&e>1||a<(o||.05*r.get("height"))&&e<1)&&(e=1),a*=e,this.set("r",a),this.filter(t)}},e.prototype.filter=function(t){var e=this.get("graph"),r=e.getNodes(),n={},i=this.get("r"),o=this.get("type"),a={x:t.x,y:t.y};this.updateDelegate(a,i);var s=this.get("shouldShow"),u=this.get("vShapes");u&&u.forEach(function(t){t.remove(),t.destroy()}),u=[],r.forEach(function(t){var e=t.getModel(),r=e.x,o=e.y;LI({x:r,y:o},a)
    ");n.appendChild(i),this.set("container",i);var o=this.render();BA(i,this.getContainerPos(o)),this.bindEvents()},e.prototype.getContainerPos=function(t){void 0===t&&(t=[0,0]);var e=this.get("graph"),r=this.get("offsetX"),n=this.get("offsetY"),i=this.get("margin"),o=this.get("position").split("-"),a={top:0,right:1,bottom:2,left:3},s={left:(e.getWidth()-t[0])/2+0,top:(e.getHeight()-t[1])/2+0};return o.forEach(function(r){var n=i[a[r]],o=r;switch(r){case"top":case"left":n+=0;break;case"bottom":n=e.getHeight()-t[1]-n+0,o="top";break;default:n=e.getWidth()-t[0]-n+0,o="left"}s[o]=n}),s.top+=n+e.getContainer().offsetTop,s.left+=r+e.getContainer().offsetLeft,Object.keys(s).forEach(function(t){s[t]="".concat(s[t],"px")}),s},e.prototype.bindEvents=function(){var t=this,e=t.get("filter");if(e&&e.enable){var r=e.trigger||"click";GI.includes(r)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),r="click");var n=t.get("legendCanvas");"mouseenter"===r?(n.on("node-container:mouseenter",function(e){return t.filterData(e)}),n.on("node-container:mouseleave",function(e){t.clearFilter(),t.clearActiveLegend()})):(n.on("node-container:click",function(e){return t.filterData(e)}),n.on("click",function(e){e.target&&e.target.isCanvas&&e.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var e=this.render();BA(this.get("container"),this.getContainerPos(e))},e.prototype.activateLegend=function(t){var e=this.get("filter");(null===e||void 0===e?void 0:e.multiple)||this.clearActiveLegend();var r=t.get("parent");r.get("active")?(r.set("active",!1),this.findLegendItemsByState("active").length&&r.set("inactive",!0)):(r.set("inactive",!1),r.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(t){t.set("inactive",!0)}):this.clearActiveLegend();var n=(null===e||void 0===e?void 0:e.legendStateStyles)||{},i=(null===n||void 0===n?void 0:n.inactive)||{opacity:.5,"text-shape":{opacity:.5}},o=i["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(t){var e=t.get("children"),r=e[0],n=e[1];r.attr(UI(UI({},r.get("oriAttrs")),i)),n.attr(UI(UI({},n.get("oriAttrs")),o))});var a=(null===n||void 0===n?void 0:n.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},s=a["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(t){var e=t.get("children"),r=e[0],n=e[1];r.attr(UI(UI({},r.get("oriAttrs")),a)),n.attr(UI(UI({},n.get("oriAttrs")),s))})},e.prototype.findLegendItemsByState=function(t,e,r){void 0===e&&(e="all"),void 0===r&&(r=!0);var n=this.get("legendCanvas").find(function(t){return"root"===t.get("name")}),i=n.find(function(t){return"node-group"===t.get("name")}),o=n.find(function(t){return"edge-group"===t.get("name")});return"node"===e?i.get("children").filter(function(e){return!!e.get(t)===r}):"edge"===e?o.get("children").filter(function(e){return!!e.get(t)===r}):i.get("children").filter(function(e){return!!e.get(t)===r}).concat(o.get("children").filter(function(e){return!!e.get(t)===r}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas").find(function(t){return"root"===t.get("name")});[t.find(function(t){return"node-group"===t.get("name")}),t.find(function(t){return"edge-group"===t.get("name")})].forEach(function(t){t.get("children").forEach(function(t){t.set("active",!1),t.set("inactive",!1);var e=t.get("children"),r=e[0],n=e[1];r.attr(r.get("oriAttrs")),n.attr(n.get("oriAttrs"))})})},e.prototype.filterData=function(t){var e=this.get("filter"),r=null===e||void 0===e?void 0:e.filterFunctions;if(e&&r){var n=this.get("legendCanvas"),i=this.get("graph"),o=e.graphActiveState||"active",a=e.graphInactiveState||"inactive",s=e.multiple;this.clearFilter(),s||this.clearActiveLegend(),this.activateLegend(t.target);var u=n.find(function(t){return"root"===t.get("name")}),l=u.find(function(t){return"node-group"===t.get("name")}),c=u.find(function(t){return"edge-group"===t.get("name")}),f=l.get("children").filter(function(t){return t.get("active")}),h=c.get("children").filter(function(t){return t.get("active")}),p=0,d=["getNodes","getEdges"];d.forEach(function(t){i[t]().forEach(function(e){var n=!1;("getNodes"===t?f:h).forEach(function(t){var i=r[t.get("id")];n=n||i(e.getModel())}),n?(i.setItemState(e,a,!1),i.setItemState(e,o,!0),p++):(i.setItemState(e,o,!1),i.setItemState(e,a,!0))})}),p||d.forEach(function(t){i[t]().forEach(function(t){i.clearItemStates(t,[a])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),e=this.get("filter");if(e){var r=e.graphActiveState||"active",n=e.graphInactiveState||"inactive";t.getNodes().forEach(function(e){t.clearItemStates(e,[r,n])}),t.getEdges().forEach(function(e){t.clearItemStates(e,[r,n])})}},e.prototype.render=function(){var t=this;this.processData();var e=this.get("legendCanvas");e?e.clear():e=new qT({container:this.get("container"),width:200,height:200});var r=e.addGroup({name:"root"}),n=r.addGroup({name:"node-group"}),i=r.addGroup({name:"edge-group"});this.set("legendCanvas",e);var o=this.get("itemsData"),a=[n,i];["nodes","edges"].forEach(function(e,r){o[e].forEach(function(n){var i,o,s=a[r].addGroup({id:n.id,name:"node-container"}),u=n.type,l=t.getShapeSize(n),c=l.width,f=l.height,h=l.r,p=t.getStyle(e.substr(0,4),n);switch(n.type){case"circle":o={r:h,x:0,y:0};break;case"rect":o={width:c,height:f,x:-c/2,y:-f/2};break;case"ellipse":o={rx:c,ry:f,x:0,y:0},u="ellipse";break;case"line":o={x1:-c/2,y1:0,x2:c/2,y2:0},u="line";break;case"quadratic":o={path:[["M",-c/2,0],["Q",0,c/2,c/2,0]]},u="path";break;case"cubic":o={path:[["M",-c/2,0],["C",-c/6,c/2,c/6,-c/2,c/2,0]]},u="path";break;case"diamond":o={path:[["M",0,-f],["L",c,0],["L",0,f],["L",-c,0],["Z"]]},u="path";break;case"triangle":o={path:[["M",-c,f],["L",0,-f],["L",c,f],["Z"]]},u="path";break;case"star":o={path:Ak.getStarPath(3*h,1.2*h)},u="path";break;default:o={r:h,x:0,y:0}}var d=s.addShape(u,{attrs:UI(UI({},o),p),name:"".concat(n.type,"-node-keyShape"),oriAttrs:UI({opacity:1},p)});if(n.label){var y=d.getBBox(),v=(null===(i=n.labelCfg)||void 0===i?void 0:i.style)||{},g=UI({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},v);s.addShape("text",{attrs:UI({x:y.maxX+4,y:0,text:n.label},g),className:"legend-label",name:"".concat(n.type,"-node-text"),oriAttrs:g})}})});var s,u=this.get("padding"),l=r.find(function(t){return"title-container"===t.get("name")}),c={height:0,maxY:0,width:0};if(this.get("title")){l||(l=r.addGroup({name:"title-container"}));var f={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:u[0]},h=this.get("titleConfig")||{},p=Object.assign(f,h.style||{});s=l.addShape("text",{attrs:UI({text:this.get("title")},p)}),c=l.getCanvasBBox(),l.setMatrix([1,0,0,0,1,0,h.offsetX,h.offsetY,1])}this.layoutItems();var d=r.getCanvasBBox(),y=n.getCanvasBBox(),v=y.minX<0?Math.abs(y.minX)+u[3]:u[3],g=c.maxYl.max&&(l.max=o[0]),p>c&&(c=p),t.setMatrix([1,0,0,0,1,0,d,y,1])});var f=l.max-l.min,h={min:0,max:-1/0},p=s.getCanvasBBox();o[0]=0,o[1]="vertical"===n?p.maxX+e:p.maxY+r,u.get("children").forEach(function(t,i){0===i&&(h.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),l=u.width,c=u.height,f=0,p=0;"vertical"===n?(f=o[1],p=o[0],o[0]=p+s.height+r,t.setMatrix([1,0,0,0,1,0,0,p+c/2,1])):(f=o[0],p=o[1],o[0]=f+s.width+e,t.setMatrix([1,0,0,0,1,0,f+l/2,0,1])),o[0]>h.max&&(h.max=o[0])});var d=h.max-h.min;if(i&&""!==i&&"left"!==i){var y=f-d,v="center"===i?Math.abs(y)/2:Math.abs(y);(y<0?s:u).get("children").forEach(function(t){var e=t.getMatrix()||[1,0,0,0,1,0,0,0,1];"vertical"===n?e[7]+=v:e[6]+=v,t.setMatrix(e)})}},e.prototype.processData=function(){var t=this.get("data"),e={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(t,e){return t.order-e.order}),t.nodes.forEach(function(t){var r,n,i,o,a,s=t.size||[(null===(r=t.style)||void 0===r?void 0:r.width)||(null===(n=t.style)||void 0===n?void 0:n.r)||8,(null===(i=t.style)||void 0===i?void 0:i.height)||(null===(o=t.style)||void 0===o?void 0:o.r)||8],u=(null===(a=t.labelCfg)||void 0===a?void 0:a.style)||{};e.nodes.push({id:t.id||(0,Ew.uniqueId)(),type:t.type||"circle",style:UI({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:UI({fontFamily:"Arial"},u)}})})),t.edges&&(t.edges.sort(function(t,e){return t.order-e.order}),t.edges.forEach(function(t){var r,n,i=t.type||"line";"cubic-horizontal"===t.type&&(i="cubic");var o=(null===(r=t.labelCfg)||void 0===r?void 0:r.style)||{},a=t.size||[(null===(n=t.style)||void 0===n?void 0:n.width)||8,1];e.edges.push({id:t.id||(0,Ew.uniqueId)(),type:i,size:a,style:UI({lineWidth:(0,Ew.isArray)(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:UI({fontFamily:"Arial"},o)}})})),this.set("itemsData",e)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var e=this.get(t);if((0,Ew.isNumber)(e))this.set(t,[e,e,e,e]);else if((0,Ew.isArray)(e))switch(e.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[e[0],e[0],e[0],e[0]]);break;case 2:this.set(t,[e[0],e[1],e[0],e[1]]);break;case 3:this.set(t,[e[0],e[1],e[2],e[1]])}return this.get(t)},e.prototype.getShapeSize=function(t){var e,r,n;return t.size&&((0,Ew.isArray)(t.size)?(e=t.size[0],r=t.size[1]||t.size[0],n=t.size[0]/2):(0,Ew.isNumber)(t.size)&&(e=t.size,r=t.size,n=t.size/2)),t.style&&(t.style.width&&(e=t.style.width),t.style.height&&(r=t.style.height),t.style.r&&(n=t.style.r)),n||(n=5),e||(e=n),r||(r=n),{width:e,height:r,r:n}},e.prototype.getStyle=function(t,e){return UI(UI({},"node"===t?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1}),e.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");null===t||void 0===t||t.destroy();var e=this.get("graph").get("container"),r=this.get("container");e.removeChild(r)},e}(FA),HI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),WI=function(){return(WI=Object.assign||function(t){for(var e,r=1,n=arguments.length;r+

    ":"

    -

    ",c=e?"":"

    ".concat(a,"

    "),f=e?"".concat(u,"px"):"".concat(u,"px ").concat(u,"px 0 0");return'
    \n \n

    ").concat(i,"

    \n ").concat(l,"\n ").concat("

    x

    ","\n
    \n ").concat(c,"\n ")}},e.prototype.init=function(){var t=this;if(!t.destroyed){var e=t.get("graph").getContainer(),r=t.get("container");this.get("containerCfg")?(r=this.createContainer(),e.appendChild(r)):r=e,this.set("container",r);var n=e.getBoundingClientRect(),i=new qT({container:e,width:n.right-n.left,height:n.bottom-n.top});BA(i.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,Ew.debounce)(function(){return t.resizeCanvas(t)},100));var o=i.addGroup({id:"annotation-link-group"});t.set("linkGroup",o),t.set("canvas",i),t.get("getTitle")||t.set("getTitle",function(t){var e,r=(null===(e=null===t||void 0===t?void 0:t.getModel)||void 0===e?void 0:e.call(t))||{},n=r.label,i=r.id;return n||i||"-"}),t.get("getContent")||t.set("getContent",function(t){var e,r;if(!t)return"-";var n=(null===(e=t.getModel)||void 0===e?void 0:e.call(t))||{},i=n.label,o=n.id,a=null===(r=t.getType)||void 0===r?void 0:r.call(t),s=a?"".concat(a,": "):"";return"".concat(s).concat(i||o||"")});var a=t.get("defaultData");a&&this.readData(a)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var e=this.get("containerCfg"),r=this.get("graph"),n=r.getContainer(),i=n.getBoundingClientRect(),o=i.left,a=i.right,s=i.top,u=i.bottom-s,l=a-o,c=e.position,f=void 0===c?"top":c,h=e.offsetX,p=void 0===h?0:h,d=e.offsetY,y=void 0===d?0:d,v=qI(e,["position","offsetX","offsetY"]),g=e.height,m=void 0===g?"fit-content":g,b=e.width,x=void 0===b?r.getWidth():b;"100%"===m&&(m=u),"100%"===x&&(x=l);var w="unset",_="unset",S={};switch(f){case"right":w="".concat(u,"px"),(S={top:0,right:0}).right+=o+p,S.top+=s+y;break;case"bottom":_="".concat(l,"px"),(S={bottom:0,left:0}).left+=o+p,S.bottom+=s+y;break;case"top":_="".concat(l,"px");case"left":w="".concat(u,"px");default:(S={top:0,left:0}).left+=o+p,S.top+=s+y}Object.keys(S).forEach(function(t){S[t]="".concat(S[t],"px")});var E=UC("
    "));return BA(E,WI(WI({position:"absolute",display:"top"===f||"bottom"===f?"inline-flex":"unset",width:(0,Ew.isNumber)(x)?"".concat(x,"px"):x,height:(0,Ew.isNumber)(m)?"".concat(m,"px"):m,maxHeight:w,maxWidth:_,overflow:"scroll"},S),v)),n.appendChild(E),E.addEventListener("scroll",function(e){t.updateLinks()}),E}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(t&&!t.destroyed){var e=t.get("container").getBoundingClientRect(),r=e.right-e.left,n=e.bottom-e.top;t.get("canvas").changeSize(r,n),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var e=t||this,r=e.get("cardInfoMap")||{},n=e.get("graph"),i=n.getPointByCanvas(0,0),o=n.getPointByCanvas(n.getWidth(),n.getHeight()),a=n.getClientByPoint(i.x,i.y),s=a.x,u=a.y,l=n.getClientByPoint(o.x,o.y),c=l.x,f=l.y;Object.values(r).forEach(function(t){var e=t.card;if(e){var r=e.style,n=ZI(r.left),i=ZI(r.top),o=e.getBoundingClientRect(),a=o.width,l=o.height,h=n,p=i;n+a>c-s&&(h=c-s-a),n<0&&(h=0),i+l>f-u&&(p=f-u-l),i<0&&(p=0),BA(e,{left:"".concat(h,"px"),top:"".concat(p,"px")})}}),e.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var e=t.item;this.toggleAnnotation(e)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var e=t.get("cardInfoMap")||{};Object.keys(e).forEach(function(e){t.hideCard(e)})}},e.prototype.toggleAnnotation=function(t,e){var r,n;void 0===e&&(e={});if(!this.destroyed){var i=this.get("cardInfoMap")||{},o=this.get("graph"),a=this.get("container"),s=this.get("containerCfg"),u=Object.assign({},this.get("cardCfg")||{},e),l=u.minHeight,c=u.minWidth,f=u.width,h=u.height,p=u.collapsed,d=void 0!==p&&p,y=u.x,v=u.y,g=u.title,m=u.content,b=u.maxTitleLength,x=u.defaultBegin,w=qI(u,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),_=this.get("linkGroup"),S=this.get("rows")||[[]],E=null===(r=t.isCanvas)||void 0===r?void 0:r.call(t),k=E?"canvas-annotation":t.getID(),T=i[k]||{},C=T.card,O=T.link,A=T.x,P=T.y,M=T.title,I=T.content,L=this.get("getTitle"),j=this.get("getContent"),N=this.get("getContentPlaceholder")||function(){return""},R=this.get("getTitlePlaceHolder")||function(){return""},D=N(t),B=R(t),F=UC(this.getDOMContent(WI({itemId:k,collapsed:d,title:(null===(n=M||g||(null===L||void 0===L?void 0:L(t)))||void 0===n?void 0:n.substr(0,b))||B,content:I||m||(null===j||void 0===j?void 0:j(t))||D},w))),z=(0,Ew.isNumber)(l)?"".concat(l,"px"):l;BA(F,{minHeight:d?"unset":z,minWidth:(0,Ew.isNumber)(c)?"".concat(c,"px"):c,height:h,width:f});var U,G=!!C;if(G?(null===O||void 0===O||O.remove(!0),a.replaceChild(F,C)):a.appendChild(F),!s){if(U=a.getBoundingClientRect()||{},void 0!==y&&void 0!==v)A=y,P=v;else if(!G&&!E){var V=U.top,H=x||{},W=H.left,q=H.right,Y=void 0===q?16:q,X=H.top,Z=void 0===X?8:X,K=H.bottom,J=Y,Q=Z;isNaN(W)||(J=a.scrollWidth-W),isNaN(K)||(Q=a.scrollHeight-K);var $=(0,Ew.isNumber)(c)?c:100;A=a.scrollWidth-F.scrollWidth-(S.length-1)*$-J;var tt=S[S.length-1],et=(tt[tt.length-1]||{}).bbox;P=(null===et||void 0===et?void 0:et.bottom)-V||Q}BA(F,{position:"absolute",left:"".concat(A,"px"),top:"".concat(P,"px"),cusor:s?"unset":"move"})}this.bindListener(F,k);var rt=F.getBoundingClientRect();if(!E){var nt=XI(t,rt,o,this.get("canvas")),it=this.get("linkStyle");O=_.addShape("path",{attrs:WI({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:nt},it)})}if(i[k]=WI(WI({},i[k]||{}),{id:k,collapsed:d,card:F,link:O,x:A,y:P,cardBBox:rt,content:I||m,title:M||g,contentPlaceholder:D,titlePlaceholder:B,isCanvas:E}),this.set("cardInfoMap",i),s)this.updateCardPositionsInConatainer(),this.updateLinks();else{var ot=!isNaN(y)&&!isNaN(v);if(!G&&!E&&!ot){var at=U.bottom,st=void 0===at?0:at;V=U.top;S[S.length-1].push({id:k,bbox:rt}),rt.top>st-V-rt.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(k);var ut=this.get("onAnnotationChange");null===ut||void 0===ut||ut(i[k],G?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var e=this.get("container"),r=this.get("containerCfg").position,n=e.getBoundingClientRect().width,i=getComputedStyle(e),o=ZI(i.paddingLeft)+ZI(i.paddingRight);n-=o,Object.values(t).forEach(function(t){var e=t.card,i=e.getBoundingClientRect().width;switch(r){case"right":BA(e,{marginLeft:n?"".concat(n-i,"px"):"0px"});break;case"top":case"bottom":BA(e,{marginLeft:"8px"})}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var e=this.get("graph"),r=this.get("cardInfoMap");if(r){var n=r[t].collapsed,i=e.findById(t);if(i)"hide"!==this.get("cardCfg").collapseType||n?this.toggleAnnotation(i,{collapsed:!n}):this.hideCard(t),r[t]=WI(WI({},r[t]),{collapsed:!n})}}},e.prototype.hideCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e&&e[t]){var r=e[t],n=r.card,i=r.link;BA(n,{display:"none"}),null===i||void 0===i||i.hide(),this.get("onAnnotationChange")(e[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=e[t],n=r.card,i=r.link;this.get("container").removeChild(n),null===i||void 0===i||i.remove(!0),delete e[t],this.get("onAnnotationChange")(r,"remove")}}},e.prototype.bindListener=function(t,e){var r=this;if(!this.destroyed){t.addEventListener("mousemove",function(t){var n;if("g6-annotation-collapse"===t.target.className?n="collapse":"g6-annotation-expand"===t.target.className?n="expand":"g6-annotation-close"===t.target.className&&(n="close"),n){var i=r.get("cardCfg").onMouseEnterIcon;(void 0===i?function(){}:i)(t,e,n)}}),t.addEventListener("mouseout",function(t){var n;if("g6-annotation-collapse"===t.target.className?n="collapse":"g6-annotation-expand"===t.target.className?n="expand":"g6-annotation-close"===t.target.className&&(n="close"),n){var i=r.get("cardCfg").onMouseLeaveIcon;(void 0===i?function(){}:i)(t,e,n)}}),t.addEventListener("mouseenter",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("graph"),o=i.findById(e);if(o){var a=r.get("itemHighlightState");i.setItemState(o,a,!0)}var s=n[e].link;if(s){var u=r.get("linkHighlightStyle")||{};s.attr(u)}}}),t.addEventListener("mouseleave",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("graph"),o=i.findById(e);if(o){var a=r.get("itemHighlightState");i.setItemState(o,a,!1)}var s=n[e].link;if(s){var u=r.get("linkHighlightStyle")||{};Object.keys(u).forEach(function(t){s.attr(t,void 0),s.attr(t,void 0)});var l=r.get("linkStyle");s.attr(l)}}}),t.addEventListener("click",function(t){var n=(r.get("cardCfg")||{}).onClickIcon;if("g6-annotation-collapse"===t.target.className||"g6-annotation-expand"===t.target.className)"hide"===r.get("cardCfg").collapseType?r.hideCard(e):r.handleExpandCollapseCard(e),null===n||void 0===n||n(t,e,"g6-annotation-collapse"===t.target.className?"collapse":"expand");else if("g6-annotation-close"===t.target.className){"remove"===r.get("cardCfg").closeType?r.removeCard(e):r.hideCard(e),null===n||void 0===n||n(t,e,"close")}}),this.get("editable")&&t.addEventListener("dblclick",function(t){var n=r.get("cardInfoMap"),i=(r.get("cardCfg")||{}).maxTitleLength,o=void 0===i?20:i;if(n){var a=t.target,s=a.className;if("g6-annotation-title"===s||"g6-annotation-content"===s){var u="g6-annotation-title"===s?a.getBoundingClientRect():a.parentNode.getBoundingClientRect(),l=u.width,c=u.height,f=getComputedStyle(a),h=UC("<".concat("g6-annotation-title"===s?"input":"textarea",' class="').concat(s,'-input" type="textarea" style="width:').concat(l,"px; height: ").concat(c,'px; min-width: 16px;"/>')),p=UC('
    '));p.appendChild(h),a.parentNode.replaceChild(p,a);var d=n[e],y=d.contentPlaceholder,v=d.titlePlaceholder,g=d.content,m=d.title,b=g;"g6-annotation-title"===s?(h.name="title",h.maxLength=o,b=m):h.name="content",b?(h.innerHTML=a.innerHTML,h.value=a.innerHTML):h.placeholder="g6-annotation-title"===s?v:y,h.focus(),h.addEventListener("blur",function(t){h.value&&(a.innerHTML=h.value,d[h.name||"title"]=h.value),p.parentNode.replaceChild(a,p),r.updateCardSize(e);var n=r.get("onAnnotationChange");null===n||void 0===n||n(d,"update")})}}});var n=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(e){var i=e.target.className;if(!n.includes(i)){var o=t.style;r.set("dragging",{card:t,x:e.clientX,y:e.clientY,left:ZI(o.left),top:ZI(o.top)})}}),t.addEventListener("drag",function(t){t.preventDefault();var n=r.get("cardInfoMap");if(n){var i=t.clientX,o=t.clientY,a=r.get("dragging");if(!isNaN(i)&&!isNaN(o)&&a){var s=a.x,u=a.y,l=a.left,c=a.top,f=a.card,h=i-s,p=o-u;l+=h,c+=p;var d=r.get("graph"),y=d.getPointByCanvas(0,0),v=d.getPointByCanvas(d.getWidth(),d.getHeight()),g=d.getClientByPoint(y.x,y.y),m=g.x,b=g.y,x=d.getClientByPoint(v.x,v.y),w=x.x,_=x.y,S=f.getBoundingClientRect(),E=S.right-S.left,k=S.bottom-S.top;(l>w-m-E&&h>0||l<0&&h<0)&&(l-=h),(c>_-b-k&&p>0||c<0&&p<0)&&(c-=p),BA(f,{left:"".concat(l,"px"),top:"".concat(c,"px"),visibility:"hidden"}),s=i,u=o;var T=(n[e]||{}).link;if(T){var C=d.findById(e);T.attr("path",XI(C,S,d,r.get("canvas")))}r.set("dragging",{x:s,y:u,left:l,top:c,card:f})}}});t.addEventListener("dragend",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("dragging");if(i){var o=i.left,a=i.top,s=i.card;n[e].x=o,n[e].y=a,BA(s,{visibility:"visible"}),r.set("dragging",!1);var u=r.get("rows");null===u||void 0===u||u.forEach(function(t){for(var r=t.length-1;r>=0;r--)t[r].id===e&&t.splice(r,1)});var l=r.get("onAnnotationChange");null===l||void 0===l||l(n[e],"update")}}})}},e.prototype.updateCardSize=function(t){var e=this.get("cardInfoMap");if(e){var r=e[t].card,n=r.getBoundingClientRect().width,i=r.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),a=ZI(o.marginLeft),s=i.getBoundingClientRect().width;BA(i,{marginRight:"".concat(n-a-24-16-s,"px")})}}},e.prototype.updateLink=function(t){var e=t.item;if(e){var r=this.get("cardInfoMap");if(r){var n=this.get("canvas"),i=this.get("graph"),o=r[e.getID()]||{},a=o.link,s=o.card;if(a){var u=XI(e,s.getBoundingClientRect(),i,n);a.attr("path",u)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=this.get("graph");Object.values(e).forEach(function(e){var n=e.id,i=r.findById(n);t.updateLink({item:i})})}}},e.prototype.onGraphDataChange=function(){var t=this,e=this.get("cardInfoMap");if(e){var r=this.get("graph");Object.values(e).forEach(function(e){var n=e.id,i=e.card,o=e.isCanvas;if(i&&!o&&"none"!==i.style.display){var a=r.findById(n);a&&a.isVisible()?t.toggleAnnotation(a):t.hideCard(n)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var e=t.item,r=t.visible;if(e&&!e.destroyed){var n=this.get("cardInfoMap");if(n){var i=e.getID();n[i]&&(r||this.hideCard(i))}}},e.prototype.saveData=function(t){void 0===t&&(t=!1);var e=this.get("cardInfoMap");if(e){var r=this.get("graph"),n=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(e).forEach(function(e){var a=e.title,s=e.content,u=e.x,l=e.y,c=e.id,f=e.collapsed,h=e.card;if(!h||"none"!==h.style.display||t){var p=r.findById(c)||r.get("canvas");o.push({id:c,x:u,y:l,collapsed:f,title:a||(null===n||void 0===n?void 0:n(p)),content:s||(null===i||void 0===i?void 0:i(p)),visible:h&&"none"!==h.style.display})}}),o}},e.prototype.readData=function(t){var e=this,r=this.get("graph");t.forEach(function(t){var n=t.id,i=t.x,o=t.y,a=t.title,s=t.content,u=t.collapsed,l=t.visible,c=r.findById(n);if(c||"canvas-annotation"!==n||(c=r.get("canvas")),!c){var f=e.get("cardInfoMap")||{};return f[n]=t,void e.set("cardInfoMap",f)}e.toggleAnnotation(c,{x:i,y:o,title:a,content:s,collapsed:u}),l||e.hideCard(n)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var e=this.get("container");Object.values(t).forEach(function(t){var r=t.card,n=t.link;e.removeChild(r),null===n||void 0===n||n.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("graph");e&&!e.destroyed&&(this.get("containerCfg")&&e.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(FA),XI=function(t,e,r,n){var i,o;if("edge"===t.getType())o=[t.getKeyShape().getPoint(.5)];else{var a=null===(i=t.getKeyShape)||void 0===i?void 0:i.call(t).getBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,f=t.getModel(),h=f.x,p=f.y;o={left:{x:s+=h,y:((u+=p)+(c+=p))/2},right:{x:l+=h,y:(u+c)/2},top:{x:(s+l)/2,y:u},bottom:{x:(s+l)/2,y:c}}}Object.keys(o).forEach(function(t){var e=o[t],i=e.x,a=e.y,s=r.getClientByPoint(i,a);o[t]=n.getPointByClient(s.x,s.y)});var d=e.top,y=void 0===d?0:d,v=e.left,g=void 0===v?0:v,m=e.right,b=void 0===m?0:m,x=e.bottom,w=void 0===x?0:x,_={left:n.getPointByClient(g,(y+w)/2),right:n.getPointByClient(b,(y+w)/2),top:n.getPointByClient((g+b)/2,y),bottom:n.getPointByClient((g+b)/2,w)};return function(t,e){var r,n,i=1/0;Object.keys(t).forEach(function(o){var a=t[o];Object.keys(e).forEach(function(t){var o=e[t],s=a.x-o.x,u=a.y-o.y,l=s*s+u*u;i>l&&(i=l,r=a,n=o)})});var o=Ak.getControlPoint(r,n,.5,20);return[["M",r.x,r.y],["Q",o.x,o.y,n.x,n.y]]}(o,_)},ZI=function(t){return Number(t.replace(/\s+|px/gi,""))||0},KI={PluginBase:FA,Menu:qA,Grid:GA,Minimap:JA,Bundling:eP,ToolBar:sP,Tooltip:lP,Fisheye:oP,TimeBar:CI,ImageMinimap:PI,EdgeFilterLens:NI,SnapLine:FI,Legend:VI,Annotation:YI};Ik("circle",{options:{size:Rk.defaultNode.size,style:{x:0,y:0,stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=(0,Ew.deepMix)({},n,t.icon),a="".concat(this.type,"-keyShape"),s=e.addShape("circle",{attrs:i,className:a,name:a,draggable:!0});e.shapeMap[a]=s;var u=o.width,l=o.height,c=o.show,f=o.text;if(c){var h="".concat(this.type,"-icon");e.shapeMap[h]=f?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:h,name:h,draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)({x:-u/2,y:-l/2},o),className:h,name:h,draggable:!0})}return this.drawLinkPoints(t,e),s},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints;if(r){var n=r||{},i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Sw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t)[0]/2;if(o){var h="link-point-left";e.shapeMap[h]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:-f,y:0,r:u/2||l||5}),className:h,name:h,isAnchorPoint:!0})}if(a){var p="link-point-right";e.shapeMap[p]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:f,y:0,r:u/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(i){var d="link-point-top";e.shapeMap[d]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:-f,r:u/2||l||5}),className:d,name:d,isAnchorPoint:!0})}if(s){var y="link-point-bottom";e.shapeMap[y]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:f,r:u/2||l||5}),className:y,name:y,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.deepMix)({},e,r),i=this.getSize(t)[0]/2;return(0,Sw.__assign)({x:0,y:0,r:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getSize(t),o=(0,Sw.__assign)({},t.style);void 0===t.style.stroke&&t.color&&(o.stroke=t.color),void 0!==t.style.r||isNaN(i[0])||(o.r=i[0]/2),this.updateShape(t,e,o,!0,r),this.updateLinkPoints(t,n)}},"single-node"),Ik("rect",{options:{size:[100,30],style:{radius:0,stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=n,this.drawLinkPoints(t,e),n},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Sw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.mix)({},e,r),i=this.getSize(t),o=n.width||i[0],a=n.height||i[1];return(0,Sw.__assign)({x:-o/2,y:-a/2,width:o,height:a},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a=e.get("keyShape");t.size||(o[0]=a.attr("width")||i.width,o[1]=a.attr("height")||i.height);var s={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,Ew.mix)({},i,a.attr(),s);u=(0,Ew.mix)(u,t.style),this.updateShape(t,e,u,!1,r),this.updateLinkPoints(t,n)}},"single-node"),Ik("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:i,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Sw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0]/2,p=f[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:-h,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:h,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:-p,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:p,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.mix)({},e,r),i=this.getSize(t),o=i[0]/2,a=i[1]/2;return(0,Sw.__assign)({x:0,y:0,rx:o,ry:a},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a={stroke:t.color,rx:o[0]/2,ry:o[1]/2},s=e.get("keyShape"),u=(0,Ew.mix)({},i,s.attr(),a);u=(0,Ew.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)}},"single-node"),Ik("diamond",{options:{size:[80,80],style:{stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Sw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),r=e[0],n=e[1];return[["M",0,-n/2],["L",r/2,0],["L",0,n/2],["L",-r/2,0],["Z"]]},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.mix)({},e,r),i=this.getPath(t);return(0,Sw.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Ew.mix)({},i,s.attr(),a);u=(0,Ew.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)}},"single-node"),Ik("triangle",{options:{size:40,direction:"up",style:{stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.icon,i=void 0===n?{}:n,o=r.direction,a=this.getShapeStyle(t),s=t.direction||o,u=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=i.width,c=i.height,f=i.show,h=i.offset,p=i.text;if(f)if(p)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var d=-l/2,y=-c/2;"up"!==s&&"down"!==s||(y+=h),"left"!==s&&"right"!==s||(d+=h),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,Sw.__assign)({x:d,y:y},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.linkPoints,i=void 0===n?{}:n,o=r.direction,a=t.direction||o,s=i.top,u=i.left,l=i.right,c=i.bottom,f=i.size,h=i.r,p=(0,Sw.__rest)(i,["top","left","right","bottom","size","r"]),d=this.getSize(t)[0];if(u){var y=null,v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"up"===a?y=[-g,v]:"down"===a?y=[-g,-v]:"left"===a&&(y=[-g,g-v]),y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},p),{x:y[0],y:y[1],r:f/2||h||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var m=null;v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"up"===a?m=[g,v]:"down"===a?m=[g,-v]:"right"===a&&(m=[g,g-v]),m&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},p),{x:m[0],y:m[1],r:f/2||h||5}),className:"link-point-right",name:"link-point-right"}))}if(s){var b=null;v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"up"===a?b=[g-v,-v]:"left"===a?b=[g,-v]:"right"===a&&(b=[-g,-v]),b&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},p),{x:b[0],y:b[1],r:f/2||h||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var x=null;v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"down"===a?x=[-g+v,v]:"left"===a?x=[g,v]:"right"===a&&(x=[-g,v]),x&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},p),{x:x[0],y:x[1],r:f/2||h||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,r=t.direction||e,n=this.getSize(t)[0],i=n*Math.sin(1/3*Math.PI),o=n*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===r?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===r?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===r&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.mix)({},e,r),i=this.getPath(t);return(0,Sw.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Ew.mix)({},i,s.attr(),a);u=(0,Ew.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}),n=r.linkPoints,i=r.direction,o=t.direction||i,a=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),s=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),u=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),l=e.shapeMap["link-point-bottom"]||e.find(function(t){return"link-point-bottom"===t.get("className")}),c=n,f=a||s||u||l;f&&(c=f.attr());var h=(0,Ew.mix)({},c,t.linkPoints),p=h.fill,d=h.stroke,y=h.lineWidth,v=h.size/2;v||(v=h.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},m=g.left,b=g.right,x=g.top,w=g.bottom,_=this.getSize(t)[0],S={r:v,fill:p,stroke:d,lineWidth:y},E=null,k=_*Math.sin(1/3*Math.PI),T=_*Math.sin(1/3*Math.PI);"up"===o?E=[-T,k]:"down"===o?E=[-T,-k]:"left"===o&&(E=[-T,T-k]),E&&(a?m||void 0===m?a.attr((0,Sw.__assign)((0,Sw.__assign)({},S),{x:E[0],y:E[1]})):(a.remove(),delete e.shapeMap["link-point-left"]):m&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},S),{x:E[0],y:E[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var C=null;"up"===o?C=[T,k]:"down"===o?C=[T,-k]:"right"===o&&(C=[T,T-k]),C&&(s?b||void 0===b?s.attr((0,Sw.__assign)((0,Sw.__assign)({},S),{x:C[0],y:C[1]})):(s.remove(),delete e.shapeMap["link-point-right"]):b&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},S),{x:C[0],y:C[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var O=null;"up"===o?O=[T-k,-k]:"left"===o?O=[T,-k]:"right"===o&&(O=[-T,-k]),O&&(u?x||void 0===x?u.attr((0,Sw.__assign)((0,Sw.__assign)({},S),{x:O[0],y:O[1]})):(u.remove(),delete e.shapeMap["link-point-top"]):x&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},S),{x:O[0],y:O[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var A=null;"down"===o?A=[-T+k,k]:"left"===o?A=[T,k]:"right"===o&&(A=[-T,k]),A&&(l?w||void 0===w?l.attr((0,Sw.__assign)((0,Sw.__assign)({},S),{x:A[0],y:A[1]})):(l.remove(),delete e.shapeMap["link-point-bottom"]):w&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},S),{x:A[0],y:A[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),Ik("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Rk.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Rk.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Rk.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).preRect,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],s=o[1],u=e.addShape("rect",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=n.show,c=(0,Sw.__rest)(n,["show"]);return l&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:(0,Sw.__assign)({x:-a/2,y:-s/2,height:s},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),u},drawLogoIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).logoIcon,n=void 0===r?{}:r,i=this.getSize(t)[0];if(n.show){var o=n.width,a=n.height,s=n.x,u=n.y,l=n.offset,c=n.text,f=(0,Sw.__rest)(n,["width","height","x","y","offset","text"]);e.shapeMap["rect-logo-icon"]=c?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:s||-i/2+o+l,y:u||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).stateIcon,n=void 0===r?{}:r,i=this.getSize(t)[0];if(n.show){var o=n.width,a=n.height,s=n.x,u=n.y,l=n.offset,c=n.text,f=(0,Sw.__rest)(n,["width","height","x","y","offset","text"]);e.shapeMap["rect-state-icon"]=c?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:s||i/2-o+l,y:u||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Sw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var r=this.getOptions(t),n=r.labelCfg,i=void 0===n?{}:n,o=r.logoIcon,a=void 0===o?{}:o,s=r.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t)[0],c=null,f=a.show,h=a.width,p=-l/2+i.offset;f&&(p=-l/2+h+i.offset);var d=i.style,y=u.style,v=u.paddingTop;return(0,Ew.isString)(t.description)?(c=e.addShape("text",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},d),{x:p,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c,e.shapeMap["rect-description"]=e.addShape("text",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},y),{x:p,y:17+(v||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(c=e.addShape("text",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},d),{x:p,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c),c},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.mix)({},e,r),i=this.getSize(t),o=n.width||i[0],a=n.height||i[1];return(0,Sw.__assign)({x:-o/2,y:-a/2,width:o,height:a},n)},update:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.style,i=void 0===n?{}:n,o=r.labelCfg,a=void 0===o?{}:o,s=r.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t),c=l[0],f=l[1];e.get("keyShape").attr((0,Sw.__assign)((0,Sw.__assign)({},i),{x:-c/2,y:-f/2,width:c,height:f}));var h=e.getContainer(),p=h.shapeMap["rect-logo-icon"]||h.find(function(t){return"rect-logo-icon"===t.get("className")}),d=p?p.attr():{},y=(0,Ew.mix)({},d,t.logoIcon),v=y.width;void 0===v&&(v=this.options.logoIcon.width);var g=t.logoIcon?t.logoIcon.show:void 0,m=a.offset,b=-c/2+v+m;g||void 0===g||(b=-c/2+m);var x=h.shapeMap["node-label"]||h.find(function(t){return"node-label"===t.get("className")}),w=h.shapeMap["rect-description"]||h.find(function(t){return"rect-description"===t.get("className")});if(t.label)if(x){var _=t.labelCfg?t.labelCfg.style:{},S=(0,Ew.mix)({},x.attr(),_);t.label&&(S.text=t.label),S.x=b,(0,Ew.isString)(t.description)&&(S.y=-5),w&&(w.resetMatrix(),w.attr({x:b})),x.resetMatrix(),x.attr(S)}else h.shapeMap["node-label"]=h.addShape("text",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},a.style),{x:b,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});if((0,Ew.isString)(t.description)){var E=u.paddingTop;if(w){_=t.descriptionCfg?t.descriptionCfg.style:{};var k=(0,Ew.mix)({},w.attr(),_);(0,Ew.isString)(t.description)&&(k.text=t.description),k.x=b,w.resetMatrix(),w.attr((0,Sw.__assign)((0,Sw.__assign)({},k),{y:17+(E||0)}))}else h.shapeMap["rect-description"]=h.addShape("text",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},u.style),{x:b,y:17+(E||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})}var T=h.shapeMap["pre-rect"]||h.find(function(t){return"pre-rect"===t.get("className")});if(T&&!T.destroyed){var C=(0,Ew.mix)({},T.attr(),t.preRect);T.attr((0,Sw.__assign)((0,Sw.__assign)({},C),{x:-c/2,y:-f/2,height:f}))}if(p&&!p.destroyed)if(g||void 0===g){var O=y.width,A=y.height,P=y.x,M=y.y,I=y.offset,L=(0,Sw.__rest)(y,["width","height","x","y","offset"]);p.attr((0,Sw.__assign)((0,Sw.__assign)({},L),{x:P||-c/2+O+I,y:M||-A/2,width:O,height:A}))}else p.remove(),delete h.shapeMap["pre-rect"];else g&&this.drawLogoIcon(t,h);var j=h.shapeMap["rect-state-icon"]||h.find(function(t){return"rect-state-icon"===t.get("className")}),N=j?j.attr():{},R=(0,Ew.mix)({},N,t.stateIcon);if(j){R.show||void 0===R.show||(j.remove(),delete h.shapeMap["rect-state-icon"]);var D=R.width,B=(A=R.height,P=R.x,M=R.y,R.offset),F=(0,Sw.__rest)(R,["width","height","x","y","offset"]);j.attr((0,Sw.__assign)((0,Sw.__assign)({},F),{x:P||c/2-D+B,y:M||-A/2,width:D,height:A}))}else R.show&&this.drawStateIcon(t,h);this.updateLinkPoints(t,h)},getOptions:function(t,e){return"move"===e?t:(0,Ew.deepMix)({},this.options,this.getCustomConfig(t)||{},t)}},"single-node"),Ik("star",{options:{size:60,style:{stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.leftBottom,u=n.rightBottom,l=n.size,c=n.r,f=(0,Sw.__rest)(n,["top","left","right","leftBottom","rightBottom","size","r"]),h=this.getSize(t)[0];if(a){var p=Math.cos(.1*Math.PI)*h,d=Math.sin(.1*Math.PI)*h;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(i){p=Math.cos(.5*Math.PI)*h,d=Math.sin(.5*Math.PI)*h;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){p=Math.cos(.9*Math.PI)*h,d=Math.sin(.9*Math.PI)*h;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(s){p=Math.cos(1.3*Math.PI)*h,d=Math.sin(1.3*Math.PI)*h;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){p=Math.cos(1.7*Math.PI)*h,d=Math.sin(1.7*Math.PI)*h;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t)[0],r=3*e/8,n=t.innerR||r;return Ak.getStarPath(e,n)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ew.mix)({},e,r),i=this.getPath(t);return(0,Sw.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Ew.mix)({},i,s.attr(),a);u=(0,Ew.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),i=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),o=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),a=e.shapeMap["link-point-left-bottom"]||e.find(function(t){return"link-point-left-bottom"===t.get("className")}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(t){return"link-point-right-bottom"===t.get("className")}),u=r,l=n||i||o||a||s;l&&(u=l.attr());var c=(0,Ew.mix)({},u,t.linkPoints),f=c.fill,h=c.stroke,p=c.lineWidth,d=c.size/2;d||(d=c.r);var y=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},v=y.left,g=y.right,m=y.top,b=y.leftBottom,x=y.rightBottom,w=this.getSize(t)[0],_={r:d,fill:f,stroke:h,lineWidth:p},S=Math.cos(.1*Math.PI)*w,E=Math.sin(.1*Math.PI)*w;i?g||void 0===g?i.attr((0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E})):(i.remove(),delete e.shapeMap["link-point-right"]):g&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),S=Math.cos(.5*Math.PI)*w,E=Math.sin(.5*Math.PI)*w,o?m||void 0===m?o.attr((0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E})):(o.remove(),delete e.shapeMap["link-point-top"]):m&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),S=Math.cos(.9*Math.PI)*w,E=Math.sin(.9*Math.PI)*w,n?v||void 0===v?n.attr((0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E})):(n.remove(),delete e.shapeMap["link-point-left"]):v&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),S=Math.cos(1.3*Math.PI)*w,E=Math.sin(1.3*Math.PI)*w,a?b||void 0===b?a.attr((0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E})):(a.remove(),delete e.shapeMap["link-point-left-bottom"]):b&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),S=Math.cos(1.7*Math.PI)*w,E=Math.sin(1.7*Math.PI)*w,s?x||void 0===x?s.attr((0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E})):(s.remove(),delete e.shapeMap["link-point-right-bottom"]):x&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},_),{x:S,y:-E}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var JI=Ak.defaultSubjectColors;Ik("donut",{options:{size:Rk.defaultNode.size,style:{x:0,y:0,stroke:Rk.defaultNode.style.stroke,fill:Rk.defaultNode.style.fill,lineWidth:Rk.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rk.nodeLabel.style.fill,fontSize:Rk.nodeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rk.defaultNode.linkPoints.size,lineWidth:Rk.defaultNode.linkPoints.lineWidth,fill:Rk.defaultNode.linkPoints.fill,stroke:Rk.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Sw.__assign)({},Rk.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=(0,Ew.deepMix)({},n,t.icon),a=e.addShape("circle",{attrs:i,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=a;var s=o.width,u=o.height,l=o.show,c=o.text;return l&&(e.shapeMap["".concat(this.type,"-icon")]=c?e.addShape("text",{attrs:(0,Sw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Sw.__assign)({x:-s/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),QI(t,e,a),this.drawLinkPoints(t,e),a},updateShape:function(t,e,r,n,i){var o=e.get("keyShape");o.attr((0,Sw.__assign)({},r)),tL(t,e,o),this.updateLabel(t,e,i),n&&this.updateIcon(t,e)}},"circle");var QI=function(t,e,r){var n=t.donutAttrs,i=void 0===n?{}:n,o=t.donutColorMap,a=void 0===o?{}:o,s=Object.keys(i).length;if(i&&s>1){var u=eL(i,a),l=u.configs,c=u.totalValue;if(c){var f=rL(r),h=f.lineWidth,p=f.arcR,d=[p,0],y=0;if(1===s)return void $I(e,{arcR:p,arcBegin:d,beginAngle:y,config:l[0],fanIndex:0,lineWidth:h,totalValue:c,drawWhole:!0});for(var v=0;v.999)r=[o,1e-4],i=1;else{var g=v*Math.PI*2;n=s+g,r=[o*Math.cos(n),-o*Math.sin(n)],i=g>Math.PI?1:0}var m={path:[["M",a[0],a[1]],["A",o,o,0,i,0,r[0],r[1]]],stroke:u.color||(null===y||void 0===y?void 0:y.attr("stroke"))||JI[l%JI.length],lineWidth:c};return y?y.attr(m):t.shapeMap["".concat("fan-shape-").concat(l)]=t.addShape("path",{attrs:m,name:"".concat("fan-shape-").concat(l),draggable:!0}),{beginAngle:n,arcBegin:r,shape:t.shapeMap["".concat("fan-shape-").concat(l)],shouldEnd:p||v>.999}},tL=function(t,e,r){var n=t.donutAttrs,i=t.donutColorMap,o=void 0===i?{}:i,a={},s=e.getContainer();if(n){var u=eL(n,o),l=u.configs,c=u.totalValue;if(c)for(var f=rL(r),h=f.lineWidth,p=f.arcR,d=[p,0],y=0,v=0;v=0;n--){var i=t[n];i.id="".concat(i.x,"|||").concat(i.y),r[i.id]||(r[i.id]=i,e.push(i))}return e},oL=function(t){return iL(t)},aL=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},sL=function(t,e,r){var n=function(t,e){var r=Math.abs(t.x-e.centerX),n=Math.abs(t.y-e.centerY);return 0===r&&0===n?0:r/e.width>n/e.height}(e,t);if(0===n){var i=t.centerX,o=t.centerY;return r.ye.x?i=t.maxX:r.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},uL=function(t,e){var r=Math.min(t.minX,e.minX),n=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(r+i)/2,centerY:(n+o)/2,minX:r,minY:n,maxX:i,maxY:o,height:o-n,width:i-r}},lL=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},cL=function(t,e){var r=t.x,n=t.y;return re.maxX||ne.maxY},fL=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},hL=function(t,e,r,n,i){return fL(t,e)+fL(t,r)+function(t,e){var r=0;return e.forEach(function(e){e&&(t.x===e.x&&(r+=-2),t.y===e.y&&(r+=-2))}),r}(t,[e,r,n,i])},pL=function t(e,r,n,i,o){void 0===o&&(o=0),e.unshift(r[i]),n[i]&&n[i]!==i&&o<=100&&t(e,r,n,n[i],o+1)},dL=function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=n.x-t.x,s=n.y-t.y,u=r.x-e.x,l=r.y-e.y,c=n.x-e.x,f=n.y-e.y;return(i*s-o*a)*(u*f-l*c)<=0&&(i*l-o*u)*(a*f-s*c)<=0},yL=function(t,e,r){if(r.width||r.height){var n=lL(r),i=n[0],o=n[1],a=n[2],s=n[3];return dL(t,e,i,o)||dL(t,e,i,s)||dL(t,e,o,a)||dL(t,e,a,s)}return!1},vL=function(t,e,r,n){var i=[];return t.forEach(function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(yL(t,e,r)||yL(t,e,n))return;i.push(t)}}),iL(i)},gL=function(t,e){var r=[],n=t[0];return r.push("M".concat(n.x," ").concat(n.y)),t.forEach(function(n,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,r){return!(t.x===e.x&&e.x===r.x||t.y===e.y&&e.y===r.y)}(n,o,a)){var s=function(t,e,r,n){var i=fL(t,e),o=fL(r,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,S).filter(function(t){return cL(t,y)&&cL(t,v)}))}),[{x:g.x,y:m.y},{x:m.x,y:g.y}].forEach(function(t){cL(t,y)&&cL(t,v)&&_.push(t)}),_.unshift(g),_.push(m);var E=function(t,e,r,n,i,o,a){var s,u=[],l=((s={})[e.id]=e,s),c={},f={},h={};f[e.id]=0,h[e.id]=hL(e,r,e);var p=new bL;p.add({id:e.id,value:h[e.id]});var d,y={};for(t.forEach(function(t){y[t.id]=t});Object.keys(l).length;){var v=p.minId(!1);if(!v)break;if((d=l[v])===r){var g=[];return pL(g,y,c,r.id),g}delete l[d.id],p.remove(d.id),u.push(d);var m=vL(t,d,n,i);m.forEach(function(t){if(-1===u.indexOf(t)){var n=t.id;l[n]||(l[n]=t);var i=h[d.id]+fL(d,t);f[n]&&i>=f[n]?p.add({id:n,value:h[n]}):(c[n]=d.id,f[n]=i,h[n]=f[n]+hL(t,r,e,o,a),p.add({id:n,value:h[n]}))}})}return[e,r]}(_=iL(_),g,m,o,a,t,e);return E.unshift(t),E.push(e),oL(E)},bL=function(){function t(){this.arr=[],this.map={},this.arr=[],this.map={}}return t.prototype._innerAdd=function(t,e){for(var r=[0,e-1];r[1]-r[0]>1;){var n=Math.floor((r[0]+r[1])/2);if(this.arr[n].value>t.value)r[1]=n;else{if(!(this.arr[n].value=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},t.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},t.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},t}(),xL={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,r,n,i){return oL(mL(t,e,r,n,i.offset))}},wL=(Math.PI,function(t,e){var r=Math.round(Math.abs(t/e));return r<0?0:(t<0?-1:1)*r}),_L=function(t,e){var r=e.x-t.x,n=e.y-t.y;return r||n?Math.atan2(n,r):0},SL=function(t,e){var r=Math.abs(t-e);return r>Math.PI?2*Math.PI-r:r},EL=function(t,e,r){for(var n=1/0,i=0,o=e.length;iu.minX&&e.xu.minY&&e.y0&&C>0;){var P=m.minId((C+1)%30==0);if(!P)break;if(w=p[P],A["".concat(w.x,"|||").concat(w.y)])return CL(w,y,l,e,t,c,s);delete p[w.id],m.remove(w.id),d[w.id]=!0;for(b=0;bo.maxAllowedDirectionChange||u[M])){p[M]||(p[M]=S);var I=a[T];E=o.distFunc(w,S)+(isNaN(I)?s:I),k=v[w.id]+E;var L=v[M];L&&k>=L||(y[M]=w,v[M]=k,g[M]=k+EL(S,h,o.distFunc),m.add({id:M,value:g[M]}))}}C-=1}return o.fallbackRoute(t,e,r,n,o)};Lk("polyline",{options:{color:Rk.defaultEdge.color,size:Rk.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Rk.defaultEdge.style.stroke,lineAppendWidth:Rk.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Rk.edgeLabel.style.fill,fontSize:Rk.edgeLabel.style.fontSize,fontFamily:Rk.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,Sw.__assign)({},Rk.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t);0===r.radius&&delete r.radius;var n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,Ew.mix)({},e,r,t.style);t=this.getPathPoints(t),this.radius=n.radius,this.offset=n.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var u=t.sourceNode,l=t.targetNode,c=n.radius,f=this.options.routeCfg,h=(0,Ew.mix)({},f,t.routeCfg);h.offset=n.offset;var p=this.getPath(s,u,l,c,h,!Boolean(a));return((0,Ew.isArray)(p)&&p.length<=1||(0,Ew.isString)(p)&&-1===p.indexOf("L"))&&(p="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(p="M0 0, L0 0"),(0,Ew.mix)({},Rk.defaultEdge.style,n,{lineWidth:t.size,path:p})},updateShapeStyle:function(t,e){var r=e.getContainer();if(e.isVisible()){var n={stroke:t.color},i=r.shapeMap["edge-shape"]||r.find(function(t){return"edge-shape"===t.get("className")})||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),l=[a];u&&(l=l.concat(u)),l.push(s);var c=i.attr(),f=(0,Ew.mix)({},n,c,t.style),h=t.sourceNode,p=t.targetNode,d=f.radius,y=this.options.routeCfg,v=(0,Ew.mix)({},y,t.routeCfg);v.offset=f.offset;var g=this.getPath(l,h,p,d,v,!Boolean(u));((0,Ew.isArray)(g)&&g.length<=1||(0,Ew.isString)(g)&&-1===g.indexOf("L"))&&(g="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(g="M0 0, L0 0"),c.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),c.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var m=(0,Ew.mix)(n,i.attr(),{lineWidth:o,path:g},t.style);i&&i.attr(m)}},getPath:function(t,e,r,n,i,o){var a=i.offset,s=i.obstacles,u=i.simple;if(!a||t.length>2||!1===o){if(n)return gL(t,n);var l=[];return(0,Ew.each)(t,function(t,e){0===e?l.push(["M",t.x,t.y]):l.push(["L",t.x,t.y])}),l}!1===u||(null===s||void 0===s?void 0:s.length)||(u=!0);var c=u?mL(t[t.length-1],t[0],r,e,a):OL(t[0],t[t.length-1],e,r,i);return c&&c.length?n?gL(c,n):(c=function(t){if(!(null===t||void 0===t?void 0:t.length))return t;for(var e=t[t.length-1],r={x:e.x,y:e.y},n=[e],i=[e],o=t.length-2;o>=0;o--){var a,s=t[o];s.x===r.x?n.push(s):(n=[s],r.x=s.x),s.y===r.y?i.push(s):(i=[s],r.y=s.y),n.length>2?(a=t.indexOf(n[1]))>-1&&t.splice(a,1):i.length>2&&(a=t.indexOf(i[1]))>-1&&t.splice(a,1)}return t}(c),Ak.pointsToPolygon(c)):"M0 0, L0 0"}},"single-edge");var AL=lA.cloneEvent,PL=lA.isNaN,ML=Math.abs,IL=["shift","ctrl","alt","control"],LL={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,r=+t.clientX,n=+t.clientY;if(!PL(r)&&!PL(n)){var i=r-e.x,o=n-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:r,y:n};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),l=this.scalableRange,c=this.scalableRange;l<1&&l>-1&&(l*=a,c*=s),(u.minX<=a+l&&u.minX+i>a+l||u.maxX+l>=0&&u.maxX+l+i<0)&&(i=0),(u.minY<=s+c&&u.minY+o>s+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(i,o)}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];r&&n||(t.preventDefault(),this.mousedown=!0,this.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=t.originalEvent;if((!e||"touchstart"===t.name||0===e.button)&&("touchstart"===t.name||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&this.shouldBegin(t,this)&&!this.keydown&&this.allowDrag(t)){if(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize){for(var r=this.graph,n=r.getEdges(),i=0,o=n.length;is)for(var h=n.getNodes(),p=0,d=h.length;p-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,r,n=t.target,i=n&&n.isCanvas&&n.isCanvas();if((0,Ew.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!i)return!1;if((0,Ew.isObject)(this.allowDragOnItem)){var o=this.allowDragOnItem,a=o.node,s=o.edge,u=o.combo,l=null===(r=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===r?void 0:r.call(e);if(!a&&"node"===l)return!1;if(!s&&"edge"===l)return!1;if(!u&&"combo"===l)return!1}return!0}},jL={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onTouchStart:function(t){if(t.item){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,this.onDragStart(t)}},onTouchMove:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return void this.onDragEnd(t);t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},"undefined"==typeof window||this.windowEventBinded||(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,r;"node"===(null===(r=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===r?void 0:r.call(e))?this.mousedown&&(this.dragstart?this.onDrag((0,Sw.__assign)((0,Sw.__assign)({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t))):this.onDragEnd()},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,this.shouldBegin((0,Sw.__assign)((0,Sw.__assign)({},t),this.mousedown),this)){var r=this.mousedown,n=r.item,i=r.target;if(n&&!n.destroyed&&!n.hasLocked()){if(n.getContainer().set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n),i)if(i.get("isAnchorPoint"))return;var o=this.graph;this.targets=[],this.targetCombo=null;var a=o.findAllByState("node",this.selectedState),s=n.get("id");if(0===a.filter(function(t){var e=t.get("id");return s===e}).length?this.targets.push(n):a.length>1?a.forEach(function(t){t.hasLocked()||e.targets.push(t)}):this.targets.push(n),this.graph.get("enabledStack")&&this.enableStack){var u=[];this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,i=e.id;u.push({x:r,y:n,id:i})}),this.set("beforeDragNodes",u)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(t){t.getEdges().forEach(function(t){t.isVisible()&&(e.hidenEdge[t.getID()]=!0,t.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(this.mousedown&&this.origin&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(n){e.update(n,t);var i=n.getModel().comboId;i&&(r[i]=e.graph.findById(i))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e,r=this;if(this.mousedown=!1,this.dragstart=!1,"undefined"!=typeof window&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),this.origin){null===(e=this.cachedCaptureItems)||void 0===e||e.forEach(function(t){t.getContainer().set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(t){t.getEdges().forEach(function(t){r.hidenEdge[t.getID()]&&t.show(),t.refresh()})}),this.hidenEdge={};var n=this.graph;if(n.get("enabledStack")&&this.enableStack){var i={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(t){i.before.nodes.push(t)}),this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,o=e.id;i.after.nodes.push({x:r,y:n,id:o})}),n.pushStack("update",(0,Ew.clone)(i))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&this.validationCombo(e)){var r=this.graph;if(this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)r.updateCombos();else{var n=e.getModel();this.targets.map(function(t){t.getModel().comboId!==n.id&&r.updateComboTree(t,n.id)}),r.updateCombo(e)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),this.targets&&0!==this.targets.length&&this.currentShouldEnd&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(t){t.getModel().comboId&&e.updateComboTree(t)}))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item,r=this.graph,n=e.getModel().comboId,i=n?r.findById(n):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(n){var o=r.findById(n);this.comboActiveState&&r.setItemState(o,this.comboActiveState,!1),this.targets.map(function(t){var e=t.getModel();n!==e.comboId&&r.updateComboTree(t,n)}),r.updateCombo(o)}else this.targets.map(function(t){t.getModel().comboId&&r.updateComboTree(t)});r.emit("dragnodeend",{items:this.targets,targetItem:e})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var r=this;this.targets&&0!==this.targets.length&&(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(e){return r.update(e,t)}):this.targets.map(function(n){return r.update(n,t,e)}))},update:function(t,e,r){var n=this.origin,i=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:i.x||0,y:i.y||0});var a=e.x-n.x+this.point[o].x,s=e.y-n.y+this.point[o].y;r&&(a+=n.x-e.x,s+=n.y-e.y);var u={x:a,y:s};this.get("updateEdge")?this.graph.updateItem(t,u,!1):t.updatePosition(u)},debounceUpdate:(0,Ew.debounce)(function(t){var e=t.targets,r=t.graph,n=t.point,i=t.origin,o=t.evt,a=t.updateEdge,s=t.onlyChangeComboSize,u=t.updateParentCombos;e.map(function(t){var e=t.get("model"),s=t.get("id");n[s]||(n[s]={x:e.x||0,y:e.y||0});var u={x:o.x-i.x+n[s].x,y:o.y-i.y+n[s].y};a?r.updateItem(t,u,!1):t.updatePosition(u)}),s&&u(r,e)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var r=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:r,y:n})}else{var i=e.get("group"),o=(0,Ew.deepMix)({},HO.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),s=a.x,u=a.y,l=a.width,c=a.height,f=a.minX,h=a.minY;this.originPoint={x:s,y:u,width:l,height:c,minX:f,minY:h},this.delegateRect=i.addShape("rect",{attrs:(0,Sw.__assign)({width:l,height:c,x:s,y:u},o),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;0===e.length&&e.push(t.item);for(var r=1/0,n=-1/0,i=1/0,o=-1/0,a=0;an&&(n=c),f>o&&(o=f)}return{x:Math.floor(r),y:Math.floor(i),width:Math.ceil(n)-Math.floor(r),height:Math.ceil(o)-Math.floor(i),minX:r,minY:i}},updateParentCombos:function(t,e){var r=t||this.graph,n=e||this.targets,i={};null===n||void 0===n||n.forEach(function(t){var e=t.getModel().comboId;e&&(i[e]=r.findById(e))}),Object.values(i).forEach(function(t){t&&r.updateCombo(t)})}},NL=null,RL={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.setAllItemStates(t)},clearOnTouchStart:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this;this.shouldClearStatusOnSecond&&(NL=null),this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:(0,Ew.throttle)(function(t,e){var r=t.item,n=e.graph;if(n&&!n.destroyed&&(e.item=r,e.shouldUpdate(t.item,{event:t,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,o=r.getModel().id;if(NL===o&&i)return e.throttleClearActiveState(t,e),void(NL=null);for(var a=e.activeState,s=e.inactiveState,u=n.getNodes(),l=n.getCombos(),c=n.getEdges(),f=n.get("vedges"),h=u.length,p=l.length,d=c.length,y=f.length,v=e.inactiveItems||{},g=e.activeItems||{},m=0;m-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,r=this.brush,n=this.selectOnCombo,i="combo"===(null===e||void 0===e?void 0:e.getType());i&&!n||!i&&e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,r=t.findAllByState("node",e),n=t.findAllByState("edge",e),i=t.findAllByState("combo",e);r.forEach(function(r){return t.setItemState(r,e,!1)}),n.forEach(function(r){return t.setItemState(r,e,!1)}),i.forEach(function(r){return t.setItemState(r,e,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,r,n,i){var o=t.getBBox();return o.centerX>=e&&o.centerX<=r&&o.centerY>=n&&o.centerY<=i},getSelectedNodes:function(t){var e=this,r=this.graph,n=this.originPoint,i=this.shouldUpdate,o=this.isBBoxCenterInRect,a=this.selectedState,s={x:t.x,y:t.y},u=r.getPointByCanvas(n.x,n.y),l=DL(s.x,u.x),c=BL(s.x,u.x),f=DL(s.y,u.y),h=BL(s.y,u.y),p=[],d=[];r.getNodes().forEach(function(t){if(t.isVisible()&&o(t,l,c,f,h)&&i(t,"select",e)){p.push(t);var n=t.getModel();d.push(n.id),r.setItemState(t,a,!0)}});var y=[];this.includeEdges&&p.forEach(function(t){t.getOutEdges().forEach(function(t){if(t.isVisible()){var n=t.getModel(),o=n.source,a=n.target;d.includes(o)&&d.includes(a)&&i(t,"select",e)&&(y.push(t),r.setItemState(t,e.selectedState,!0))}})});var v=[];this.includeCombos&&r.getCombos().forEach(function(t){if(t.isVisible()&&o(t,l,c,f,h)&&i(t,"select",e)){v.push(t);var n=t.getModel();d.push(n.id),r.setItemState(t,a,!0)}}),this.selectedEdges=y,this.selectedNodes=p,this.selectedCombos=v,this.onSelect&&this.onSelect(p,y,v),r.emit("nodeselectchange",{selectedItems:{nodes:p,edges:y,combos:v},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:FL(t.canvasX-e.x),height:FL(t.canvasY-e.y),x:DL(t.canvasX,e.x),y:DL(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.keydown=n===r||"control"===n&&"ctrl"===r||"ctrl"===n&&"control"===r}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},GL=["shift","ctrl","alt","control"],VL={getDefaultCfg:function(){return{multiple:!0,trigger:"shift",selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){return GL.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,r=t.item;if(r&&!r.destroyed){var n=r.getType(),i=e.graph,o=e.keydown,a=e.multiple,s=e.shouldUpdate;if((0,e.shouldBegin)(t,e)){if(!o||!a){var u=i.findAllByState("node",e.selectedState).concat(i.findAllByState("edge",e.selectedState)).concat(i.findAllByState("combo",e.selectedState));(0,Ew.each)(u,function(t){t!==r&&i.setItemState(t,e.selectedState,!1)})}if(function(){switch(n){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}())if(r.hasState(e.selectedState)){s(t,e)&&i.setItemState(r,e.selectedState,!1);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:r,selectedItems:{nodes:l,edges:c,combos:f},select:!1})}else{s(t,e)&&i.setItemState(r,e.selectedState,!0);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:r,selectedItems:{nodes:l,edges:c,combos:f},select:!0})}else{var l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{selectedItems:{nodes:l,edges:c,combos:f},select:!1})}}}},onCanvasClick:function(t){var e=this,r=this.graph;if((0,this.shouldBegin)(t,this)){var n=r.findAllByState("node",this.selectedState);(0,Ew.each)(n,function(t){r.setItemState(t,e.selectedState,!1)});var i=r.findAllByState("edge",this.selectedState);(0,Ew.each)(i,function(t){r.setItemState(t,e.selectedState,!1)});var o=r.findAllByState("combo",this.selectedState);(0,Ew.each)(o,function(t){r.setItemState(t,e.selectedState,!1)}),r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}},HL=Aw.vs,WL={getDefaultCfg:function(){return this.isFireFox="firefox"===uA(),{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];t.preventDefault(),n&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,n&&(this.endPoint={pageX:n.pageX,pageY:n.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,r=e[0],n=e[1];if(n){this.endPoint||(this.endPoint={pageX:n.pageX,pageY:n.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:r.pageX,y:r.pageY},{x:n.pageX,y:n.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a0||t.wheelDelta<0?1-.05*o:1/(1-.05*o):t.wheelDelta<0?1-.05*o:1/(1-.05*o));var u=this.get("minZoom")||r.get("minZoom"),l=this.get("maxZoom")||r.get("maxZoom");if(s>l?s=l:sr/2?u-=c.width:u+=this.offset,l>n/2?l-=c.height:l+=this.offset;var f="".concat(u,"px"),h="".concat(l,"px");BA(this.container,{left:f,top:h,visibility:"visible"})}else BA(i,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var r=UC('
    '));return e.parentNode.appendChild(r),BA(r,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},YL=(0,Sw.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},qL),XL=(0,Sw.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},qL),ZL=["click","dblclick"],KL={getDefaultCfg:function(){return{trigger:"click",onChange:function(){}}},getEvents:function(){var t,e;return ZL.includes(this.trigger)?e=this.trigger:(e="click",console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if("click"===this.trigger){if(this.timer)return clearTimeout(this.timer),void(this.timer=0);this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var r=this.graph.findDataById(e.get("id"));if(r){var n=r.children;if(n&&0!==n.length){var i=!r.collapsed;this.shouldBegin(t,i,this)&&(r.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i,this)&&(this.onChange(e,i,this),this.graph.layout()))}}}}},JL=lA.calculationItemsBBox,QL={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(t,this)&&"combo"===e.getType())},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,r=this.graph,n=t.item;if(this.currentShouldEnd=!0,this.validationCombo(t)){this.targets=[];var i=r.findAllByState("combo",this.selectedState),o=n.get("id");0===i.filter(function(t){var e=t.get("id");return o===e}).length?this.targets.push(n):this.targets=i;var a=[];this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,i=e.id;a.push({x:r,y:n,id:i})}),this.set("beforeDragItems",a),this.activeState&&this.targets.map(function(t){var n=t.getModel();if(n.parentId){var i=r.findById(n.parentId);i&&r.setItemState(i,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],function t(e,r){if(!1!==r(e)&&e){var n=e.get("combos");if(0===n.length)return!1;(0,Ew.each)(n,function(e){t(e,r)})}}(n,function(t){if(t.destroyed)return!1;var r=t.getModel();return e.currentItemChildCombos.push(r.id),!0})}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var r=this.graph,n=t.item,i=n.getModel(),o=r.getCombos(),a=n.getBBox(),s=a.centerX,u=a.centerY,l=a.width;o.filter(function(t){var r=t.getModel();return i.parentId,r.id!==i.id&&!e.currentItemChildCombos.includes(r.id)}).map(function(t){var n=t.getBBox(),i=n.centerX,o=n.centerY,a=n.width,c=s-i,f=u-o,h=2*Math.sqrt(c*c+f*f);l+a-h>.8*l?r.setItemState(t,e.activeState,!0):r.setItemState(t,e.activeState,!1)})}(0,Ew.each)(this.targets,function(r){e.updateCombo(r,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var r=this;(this.enableDelegate||e)&&(0,Ew.each)(this.targets,function(n){r.updateCombo(n,t,e)})},onDrop:function(t){var e=this,r=t.item;if(this.currentShouldEnd=this.shouldEnd(t,r,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&r&&this.targets&&!r.destroyed){var n=this.graph,i=r.getModel();this.targets.map(function(t){t.getModel().parentId!==i.id?(e.activeState&&n.setItemState(r,e.activeState,!1),e.onlyChangeComboSize?n.updateCombo(t):n.updateComboTree(t,i.id,!1)):n.updateCombo(r)}),this.end(r,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){var r=this.graph,n=t.item.getModel().comboId,i=n?r.findById(n):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){var o;if(n){if(this.activeState){var a=r.findById(n);r.setItemState(a,this.activeState,!1)}this.targets.map(function(t){e.onlyChangeComboSize?r.updateCombo(t):n!==t.getID()&&(o=r.findById(n),n!==t.getModel().parentId&&r.updateComboTree(t,n,!1))})}else this.targets.map(function(t){e.onlyChangeComboSize?r.updateCombo(t):t.getModel().comboId&&r.updateComboTree(t,void 0,!1)});this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var r=this.getParentCombo(e.getModel().parentId),n=this.graph;r&&this.activeState&&n.setItemState(r,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var r=this;if(this.origin){var n=this.graph;if(this.delegateShape)n.get("delegateGroup").clear(),this.delegateShape=null;if(t&&this.activeState&&n.setItemState(t,this.activeState,!1),!t){var i=n.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(t){if(r.onlyChangeComboSize){n.updateCombo(t);var e=t.getModel(),a=e.x,s=e.y,u=e.id;o.after.combos.push({x:a,y:s,id:u}),n.pushStack("update",o)}else n.updateComboTree(t,void 0,i)})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,r){var n=this;if(void 0===r&&(r={}),!1!==e(t,r)&&t){var i=t.get("combos");(0,Ew.each)(i,function(t){n.traverse(t,e,r)});var o=t.get("nodes");(0,Ew.each)(o,function(t){n.traverse(t,e,r)})}},updateCombo:function(t,e,r){this.updateSingleItem(t,e,r);var n={};this.traverse(t,function(t,e){return!t.destroyed&&(t.getEdges().forEach(function(t){return e[t.getID()]=t}),!0)},n),Object.values(n).forEach(function(t){return t.refresh()})},updateSingleItem:function(t,e,r){var n=this.origin,i=this.graph,o=t.getModel(),a=t.get("id");this.point[a]||(this.point[a]={x:o.x,y:o.y});var s=e.x-n.x+this.point[a].x,u=e.y-n.y+this.point[a].y;r&&(s+=n.x-e.x,u+=n.y-e.y),i.updateItem(t,{x:s,y:u},!1)},getParentCombo:function(t){var e=this.graph;if(t){var r=e.findById(t);if(r)return r}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var r=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:r,y:n})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?JL(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,l=o.height,c=o.minX,f=o.minY;this.originPoint={x:a,y:s,width:u,height:l,minX:c,minY:f};var h=(0,Sw.__assign)((0,Sw.__assign)({},HO.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:(0,Sw.__assign)({width:o.width,height:o.height,x:o.x,y:o.y},h),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this.graph,e=this.targets,r={};null===e||void 0===e||e.forEach(function(e){var n=e.getModel().parentId;n&&(r[n]=t.findById(n))}),Object.values(r).forEach(function(e){e&&t.updateCombo(e)})}},$L=["click","dblclick"],tj={getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return $L.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,r=this.graph,n=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(r.collapseExpandCombo(i),n&&r.get("layout")?r.layout():r.refreshPositions())}}},ej=lA.isPolygonsIntersect,rj=lA.pathToPoints,nj=["drag","shift","ctrl","alt","control"],ij=["click","drag"],oj=["shift","ctrl","control","alt","meta",void 0],aj=["shift","ctrl","alt","control"],sj=["shift","ctrl","alt","control","meta"],uj={"drag-canvas":LL,"zoom-canvas":WL,"drag-node":jL,"activate-relations":RL,"brush-select":UL,"click-select":VL,"lasso-select":{getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return nj.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach(function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){void 0===t&&(t="canvas:click");var e=this.graph,r=this.selectedState,n=this.shouldDeselect,i=e.findAllByState("node",r),o=e.findAllByState("edge",r);n&&!n({action:t,nodes:i,edges:o})||(i.forEach(function(t){return e.setItemState(t,r,!1)}),o.forEach(function(t){return e.setItemState(t,r,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,r=this.shouldUpdate,n=this.points.map(function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]}),i=this.selectedState,o=[],a=[];e.getNodes().forEach(function(s){if(s.isVisible()&&function(t,e){var r,n=t.getKeyShape();if("path"===t.get("type"))r=rj(n.attr("path"));else{var i=n.getCanvasBBox();r=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return ej(e,r)}(s,n)&&r(s,"select",t)){o.push(s);var u=s.getModel();a.push(u.id),e.setItemState(s,i,!0)}});var s=[];this.includeEdges&&o.forEach(function(n){n.getOutEdges().forEach(function(n){if(n.isVisible()){var i=n.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&r(n,"select",t)&&(s.push(n),e.setItemState(n,t.selectedState,!0))}})}),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:(0,Sw.__assign)({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},tooltip:YL,"edge-tooltip":XL,"collapse-expand":KL,"drag-combo":QL,"collapse-expand-combo":tj,"create-edge":{getDefaultCfg:function(){return{trigger:"click",key:void 0,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t;return ij.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="click",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===oj.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,r=this.graph,n=e.getModel(),i=this.getEdgeConfig;if(this.addingEdge&&this.edge){if(!this.shouldEnd(t,this))return;var o=void 0;o=i&&(0,Ew.isFunction)(i)?i({source:this.source,target:n.id},this):this.edgeConfig;var a=(0,Sw.__assign)({target:n.id},o);if(this.source===n.id&&(a.type="loop"),r.emit("beforecreateedge",{}),r.updateItem(this.edge,a,!1),r.get("enabledStack")){var s=(0,Sw.__assign)((0,Sw.__assign)({},this.edge.getModel()),{itemType:"edge"}),u={};u.edges=[s],r.pushStack("add",{before:{},after:u})}r.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin(t,this))return;o=void 0;o=i&&(0,Ew.isFunction)(i)?i({source:n.id,target:n.id},this):this.edgeConfig,this.edge=r.addItem("edge",(0,Sw.__assign)({source:n.id,target:n.id},o),!1),this.source=n.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){this.edge&&this.edge.destroyed&&this.cancelCreating({item:this.edge});var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){var e,r;if(!this.key||this.keydown){var n=this.graph,i=t.item;return this.addingEdge&&(this.edge===i||(null===(r=null===(e=t.target)||void 0===e?void 0:e.isCanvas)||void 0===r?void 0:r.call(e)))?(this.edge&&!this.edge.destroyed&&n.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1)):void 0}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}},"shortcuts-call":{getDefaultCfg:function(){return{trigger:"ctrl",combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return aj.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="ctrl",console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=n===r||"control"===n&&"ctrl"===r||"ctrl"===n&&"control"===r);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(n===o||"control"===n&&"ctrl"===o||"ctrl"===n&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},"scroll-canvas":{getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return this.zoomKey&&-1!==sj.indexOf(this.zoomKey)||(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var r=this.graph,n=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];if(n.includes("control")&&n.push("ctrl"),n.some(function(e){return t["".concat(e,"Key")]})){var i=r.get("canvas").getPointByClient(t.clientX,t.clientY),o=r.getZoom();t.wheelDelta>0?o+=.05*o:o-=.05*o,r.zoomTo(o,{x:i.x,y:i.y})}else{var a=t.deltaX||t.movementX,s=t.deltaY||t.movementY;!s&&navigator.userAgent.indexOf("Firefox")>-1&&(s=125*-t.wheelDelta/3);var u=this.graph.get("width"),l=this.graph.get("height"),c=this.graph.get("canvas").getCanvasBBox(),f=this.scalableRange,h=this.scalableRange;f<1&&f>-1&&(f*=u,h*=l);var p=c.minX,d=c.maxX,y=c.minY,v=c.maxY;a>0?d<-f?a=0:d-a<-f&&(a=d+f):a<0&&(p>u+f?a=0:p-a>u+f&&(a=p-(u+f))),s>0?v<-h?s=0:v-s<-h&&(s=v+h):s<0&&(y>l+h?s=0:y-s>l+h&&(s=y-(l+h))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),r.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var g=this.get("optimizeZoom"),m=this.get("optimized"),b=r.getNodes(),x=r.getEdges(),w=b.length,_=x.length;if(!m){for(var S=0;St.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.hoverColor;return{stroke:t,shadowColor:t,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:t}}}},{key:"_getDefaultNodeHighlightStyle",value:function(){return{lineWidth:3,stroke:arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hoverColor}}},{key:"_getContextMenu",value:function(){var t=this;return new gj.Menu({shouldBegin:function(t){return!!(t.target&&t.target.isCanvas&&t.target.isCanvas())||!!t.item},getContent:function(e){var r=e.item;if(!(e.target&&e.target.isCanvas&&e.target.isCanvas())&&r){var n=r.getType(),i=r.getModel();return n&&i&&"node"===n?t.isCollpased(i.id)?"
      \n
    • 展开
    • \n
    ":"
      \n
    • 折叠
    • \n
    ":void 0}},handleMenuClick:function(e,r){switch(e.id.split("-")[0]){case"hide":t.hideItem(r);break;case"expand":t.expandNode(r);break;case"collapse":t.collapseNode(r);break;case"show":t.showItem(r)}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}},{key:"_getGraphConfig",value:function(t){var e=this,r={speed:120,maxIteration:83,tick:function(){e.refreshPositions()}},n={type:"fruchterman",gravity:5,workerEnabled:!0},i={},o={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},a={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),u=[new gj.ToolBar,s];if(!t)return this._setToolBarStyle(),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"knowledgeGraph",s=document.querySelector("#".concat(t));return{container:t,width:s.scrollWidth,height:s.scrollHeight,plugins:u,modes:a,layout:_j(_j({},n),r),defaultNode:i,defaultEdge:o,nodeStateStyles:{hover:e._getDefaultNodeHighlightStyle(),actived:e._getDefaultNodeHighlightStyle()},edgeStateStyles:{hover:e._getDefaultEdgeHighlightStyle(),actived:e._getDefaultEdgeHighlightStyle()}}}();t.container=t.container||"knowledgeGraph";var l="string"==typeof t.container?document.querySelector("#".concat(t.container)):t.container;t.width=t.width||l.scrollWidth,t.height=t.height||l.scrollHeight,t.layout=_j(_j(_j({},n),t.layout||{}),!1!==t.animate?r:{}),t.defaultNode=_j(_j({},i),t.defaultNode||{}),t.defaultEdge=_j(_j({},o),t.defaultEdge||{}),t.modes={default:[]},!1!==t.dragCanvas&&t.modes.default.push("drag-canvas"),!1!==t.zoomCanvas&&t.modes.default.push("zoom-canvas"),!1!==t.dragNode&&t.modes.default.push("drag-node");var c=_j(_j({},this._getDefaultNodeHighlightStyle()),t.nodeHighlightStyle||{}),f=_j(_j({},this._getDefaultEdgeHighlightStyle()),t.edgeHighlightStyle||{});return t.nodeStateStyles={hover:c,actived:c},t.edgeStateStyles={hover:f,actived:f},!1!==t.showToolBar&&(t.plugins=[new gj.ToolBar],this._setToolBarStyle()),!1!==t.showContextMenu&&(t.plugins=[].concat(bj(t.plugins||[]),[s]),this._setToolBarStyle()),t}},{key:"changeSize",value:function(t,e){return this.graph.changeSize(t,e)}},{key:"autoResize",value:function(){var t=this,e=this.getContainer();window.addEventListener("resize",function(){var r=e.scrollWidth,n=e.scrollHeight;t.graph.changeSize(r,n),t.graph.refresh()})}},{key:"zoom",value:function(t,e,r,n){this.graph.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graph.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graph.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graph.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graph.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graph.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graph.getZoom()}},{key:"getMinZoom",value:function(){return this.graph.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graph.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graph.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graph.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graph.getWidth()}},{key:"getHeight",value:function(){return this.graph.getHeight()}},{key:"setCenter",value:function(t){var e=this.graph.getWidth()/2,r=this.graph.getHeight()/2,n=this.graph.getCanvasByPoint(t.x,t.y);this.graph.translate(e-n.x,r-n.y)}},{key:"_setToolBarStyle",value:function(){HA()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}},{key:"highlightNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("node:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("node:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"highlightEdge",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("edge:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("edge:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data?e.changeData(t):e.data(t),this.data=t}},{key:"render",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).render()}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data=t,e.changeData(t)}},{key:"refresh",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refresh()}},{key:"getContainer",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getContainer()}},{key:"getCanvas",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).get("canvas")}},{key:"getNodes",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getNodes()}},{key:"getEdges",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getEdges()}},{key:"getNeighbors",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).getNeighbors(t,e)}},{key:"findById",value:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).findById(t)}},{key:"find",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).find(t,e)}},{key:"findAll",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return t.getEdges()}},{key:"getInEdges",value:function(t){return t.getInEdges()}},{key:"getOutEdges",value:function(t){return t.getOutEdges()}},{key:"getSourceByEdge",value:function(t){return t.getSource()}},{key:"getTargetByEdge",value:function(t){return t.getTarget()}},{key:"expandNode",value:function(t){var e=t.getModel().id;this._expandCollapseNode(this.collpasedData[e],"show"),delete this.collpasedData[e]}},{key:"collapseNode",value:function(t){var e=t.getModel().id,r=[];this._collapseFunc(t,r),this.collpasedData[e]=r,this._expandCollapseNode(r)}},{key:"isCollpased",value:function(t){return!!this.collpasedData[t]}},{key:"_collapseFunc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this.getNeighbors(t,"target"),n=this.getNeighbors(t,"source"),i=0;i1&&void 0!==arguments[1]?arguments[1]:"hide";t&&t.forEach(function(t){"hide"===r?e.hideItem(t.id):(e.showItem(t.id),e.isCollpased(t.id)&&delete e.collpasedData[t.id]),t.children&&e._expandCollapseNode(t.children,r)})}},{key:"showItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).showItem(t,e)}},{key:"hideItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).hideItem(t,e)}},{key:"show",value:function(t){t.show()}},{key:"hide",value:function(t){t.hide()}},{key:"changeVisibility",value:function(t,e){t.changeVisibility(e)}},{key:"isVisible",value:function(t){return t.isVisible()}},{key:"getModel",value:function(t){return t.getModel()}},{key:"addItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).addItem(t,e)}},{key:"removeItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).removeItem(t)}},{key:"updateItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).updateItem(t,e)}},{key:"refreshItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).refreshItem(t)}},{key:"refreshPositions",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refreshPositions()}},{key:"on",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).on(t,e)}},{key:"off",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).off(t,e)}},{key:"toDataURL",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).toDataURL(t,e)}},{key:"bindNodeDefaultDragEvent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("node:dragstart",function(t){Cj(t)}),t.on("node:drag",function(t){Cj(t)}),t.on("node:dragend",function(t){t.item.get("model").fx=null,t.item.get("model").fy=null})}},{key:"stopDefaultEventPropagation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("click",function(t){t.stopPropagation()}),t.on("mousedown",function(t){t.stopPropagation()}),t.on("mouseover",function(t){t.stopPropagation()}),t.on("mouseout",function(t){t.stopPropagation()})}},{key:"clear",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).clear()}},{key:"destroy",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).destroy()}}])&&Ej(e.prototype,r),n&&Ej(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Cj(t){var e=t.item.get("model");return e.fx=t.x,e.fy=t.y,e.x=t.x,e.y=t.y,e}var Oj=r(2138),Aj=r.n(Oj);function Pj(t){"@babel/helpers - typeof";return(Pj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mj(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"G6";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=null,this.config=Aj()(e),this.graphRender=null,this.type=r,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"}var e,r,n;return e=t,n=[{key:"dataFromGraphMap",value:function(t,e){return vw(t,e)}},{key:"dataFromKnowledgeGraphQuery",value:function(t){return vw(t)}}],(r=[{key:"_handleNodes",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.findById(t);e(n,"node")})}},{key:"_handleEdges",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.find("edge",function(e){return e.get("model").edgeId==t});e(n,"edge")})}},{key:"highlight",value:function(t){var e=t.nodeIDs,r=void 0===e?[]:e,n=t.edgeIDs,i=void 0===n?[]:n,o=this.graph,a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"node";if(e){var n=t[r+"StateStyles"];n&&o.updateItem(e,{style:e.style,stateStyles:{actived:n}}),o.setItemState(e,"actived",!0),o.paint(),o.setAutoPaint(!0)}};this._handleNodes(r,a),this._handleEdges(i,a)}},{key:"clearHighlight",value:function(t){var e=this.graph,r=function(t){t&&(e.clearItemStates(t,"actived"),e.paint(),e.setAutoPaint(!0))};if(e.setAutoPaint(!1),!t)return e.getNodes().forEach(function(t){r(t)}),void e.getEdges().forEach(function(t){r(t)});var n=t.nodeIDs,i=void 0===n?[]:n,o=t.edgeIDs,a=void 0===o?[]:o;this._handleNodes(i,r),this._handleEdges(a,r)}},{key:"handleNodeStatus",value:function(t){var e=t.expand,r=t.collapse,n=t.hidden;this.expandNodes(e),this.collapseNodes(r),this.hideNodes(n)}},{key:"expandNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.expandNode(t+"")})}},{key:"collapseNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.collapseNode(t+"")})}},{key:"hideNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.hideItem(t+"")})}},{key:"createGraphRender",value:function(t){"G6"===t&&(this.graphRender=new Tj)}},{key:"createGraph",value:function(t){var e=this.initGraph(t);return this.graph=e,this.autoResize(),e}},{key:"getGraph",value:function(){return this.graph}},{key:"autoResize",value:function(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}},{key:"zoom",value:function(t,e,r,n){this.graphRender.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graphRender.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graphRender.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graphRender.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graphRender.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graphRender.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graphRender.getZoom()}},{key:"getMinZoom",value:function(){return this.graphRender.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graphRender.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graphRender.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graphRender.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graphRender.getWidth()}},{key:"getHeight",value:function(){return this.graphRender.getHeight()}},{key:"initGraph",value:function(t){var e=this,r=this.graphRender.initGraph(t);this.graph=r;return this.graph.on("afterlayout",function(){void 0!==e.config.zoom&&e.zoom(e.config.zoom),void 0!==e.config.center&&e.graphRender.setCenter({x:e.config.center[0],y:e.config.center[1]})}),r}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;t=t||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(t.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,t.nodes)),this.graphRender.setData(t,e),this.render(e),this.data=t}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&this.graphRender.render(t)}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;e&&this.graphRender.updateGraph(t,e)}},{key:"refresh",value:function(){return this.graphRender.refresh()}},{key:"changeSize",value:function(t,e){return this.graphRender.changeSize(t,e)}},{key:"resize",value:function(t,e){this.graphRender.changeSize(t,e),this.graphRender.refresh()}},{key:"getContainer",value:function(){return this.graphRender.getContainer()}},{key:"getCanvas",value:function(){return this.graphRender.getCanvas()}},{key:"getNodes",value:function(){return this.graphRender.getNodes()}},{key:"getEdges",value:function(){return this.graphRender.getEdges()}},{key:"getNeighbors",value:function(t,e){return this.graphRender.getNeighbors(t,e)}},{key:"findById",value:function(t){return this.graphRender.findById(t)}},{key:"find",value:function(t,e){return this.graphRender.find(t,e)}},{key:"findAll",value:function(t,e){return this.graphRender.findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return this.graphRender.getEdgesByNode(t)}},{key:"getInEdges",value:function(t){return this.graphRender.getInEdges(t)}},{key:"getOutEdges",value:function(t){return this.graphRender.getOutEdges(t)}},{key:"getSourceByEdge",value:function(t){return this.graphRender.getSourceByEdge(t)}},{key:"getTargetByEdge",value:function(t){return this.graphRender.getTargetByEdge(t)}},{key:"expandNode",value:function(t){var e=this.findById(t);e&&this.graphRender.expandNode(e)}},{key:"collapseNode",value:function(t){var e=this.findById(t);e&&this.graphRender.collapseNode(e)}},{key:"showItem",value:function(t,e){this.graphRender.showItem(t,e)}},{key:"hideItem",value:function(t,e){this.graphRender.hideItem(t,e)}},{key:"show",value:function(t){this.graphRender.show(t)}},{key:"hide",value:function(t){this.graphRender.hide(t)}},{key:"changeVisibility",value:function(t,e){this.graphRender.changeVisibility(t,e)}},{key:"isVisible",value:function(t){return this.graphRender.isVisible(t)}},{key:"getModel",value:function(t){return this.graphRender.getModel(t)}},{key:"addItem",value:function(t,e){return this.graphRender.addItem(t,e)}},{key:"removeItem",value:function(t){return this.graphRender.removeItem(t)}},{key:"updateItem",value:function(t,e){return this.graphRender.updateItem(t,e)}},{key:"refreshItem",value:function(t){return this.graphRender.refreshItem(t)}},{key:"refreshPositions",value:function(){return this.graphRender.refreshPositions()}},{key:"on",value:function(t,e){this.graphRender.on(t,e)}},{key:"off",value:function(t,e){this.graphRender.off(t,e)}},{key:"toDataURL",value:function(t,e){this.graphRender.toDataURL(t,e)}},{key:"nodeLabelOpenEllipsis",value:function(t,e){var r=this;return e?t?e.map(function(e){var n=e.labelCfg&&e.labelCfg.fontSize||r.defaultNode&&r.defaultNode.labelCfg&&r.defaultNode.labelCfg.fontSize||14;return e.label=function(t,e,r){var n=1*r;e*=1.6;if(function(t){for(var e=0,r=0;r0&&t.charCodeAt(r)<128?e++:e+=2;return e}(t)*n>e){var i=Math.floor((e-20)/n),o=t.substring(0,i);return(t.substring(i).length+"…".length)*n>e?o+"\n"+t.substring(i,i+i-2)+"…":0==t.substring(i).length?o:o+"\n"+t.substring(i)}return t}(e.label,t,n),e}):e:[]}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.clear()}},{key:"destroy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.destroy()}}])&&Mj(e.prototype,r),n&&Mj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function jj(t){"@babel/helpers - typeof";return(jj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Rj(){Rj=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==jj(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Dj(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Bj(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function hN(t,e){if(t){if("string"==typeof t)return pN(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pN(t,e):void 0}}function pN(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r`.",required:!0},import:{id:{type:"string",doc:"Unique import name.",required:!0},url:{type:"string",doc:"The URL of the style.",required:!0},config:{type:"config",doc:"Configuration values for the imported style's options."},data:{type:"$root",doc:"The inlined style that must correspond to the contents of the specified URL."}},config:{"*":{type:"*",doc:"Value of the imported style's configuration option."}},schema:{"*":{type:"option",doc:"Specification of a configuration option."}},option:{default:{type:"*",doc:"Default configuration value for this option.",required:!0},type:{type:"enum",doc:"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.",values:{string:{doc:"The result will be coerced to a string."},number:{doc:"The result will be coerced to a number."},boolean:{doc:"The result will be coerced to a boolean."},color:{doc:"The result will be coerced to a color."}}},array:{type:"boolean",doc:"If true, this option is returned as an array"},minValue:{type:"number",doc:"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},maxValue:{type:"number",doc:"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},stepValue:{type:"number",doc:"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},values:{type:"array",value:"*",doc:"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."}},models:{"*":{type:"model",doc:"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{id:{type:"string",doc:"Unique light name.",required:!0},properties:{type:"properties",doc:"Properties of the light."},type:{type:"enum",doc:"Type of the light to be added",values:{ambient:{doc:"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},directional:{doc:"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},flat:{doc:"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}}},properties:["properties_light_directional","properties_light_ambient","properties_light_flat"],properties_light_directional:{direction:{type:"array",default:[210,30],minimum:[0,0],maximum:[360,90],length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).",example:[90,40],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"cast-shadows":{type:"boolean",default:!1,doc:"Enable/Disable shadow casting for this light",transition:!1,expression:{interpolated:!1},"property-type":"data-constant","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"shadow-intensity":{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},doc:"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_ambient:{color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_flat:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_array:{type:{required:!0,type:"enum",values:{"raster-array":{doc:"A raster array source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},rasterLayers:{type:"*",doc:"Contains the description of the raster data layers and the bands contained within the tiles."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!1,type:"string",doc:"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_model:{type:{required:!0,type:"enum",values:{model:{doc:"A collection of 3D models"},"batched-model":{doc:"A collection of 3D models with anchor data"}},doc:"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which batched-model tiles are available"},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},"raster-particle":{doc:"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}}},model:{doc:"A 3D model","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},slot:{doc:"Marks the position of a slot.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},slot:{type:"string",doc:"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_model:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"model-id":{type:"string",default:"",doc:"Model to render.","property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!1,requires:[{source:["geojson","vector"]}]}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{type:"boolean",default:!1,doc:"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},requires:[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_raster-particle":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},config:{doc:"Retrieves the configuration value for the given option.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},hsl:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},hsla:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"measure-light":{doc:"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"9.2.0",ios:"5.9.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"raster-value":{doc:"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.",group:"Raster Colorization","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-particle-speed":{doc:"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.",group:"Raster Particle Animation","sdk-support":{"basic functionality":{js:"3.3.0",android:"",ios:""}}},random:{doc:"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"vertical-range":{type:"array",default:[0,0],minimum:0,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},camera:{"camera-projection":{doc:"Camera projection describes how 3D world geometry get projected into 2D screen",type:"enum",values:{perspective:{doc:"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},orthographic:{doc:"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"perspective","property-type":"data-constant"}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0",ios:"10.5.0",android:"10.5.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant",type:"number",default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant",type:"number",default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant",type:"number",default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant",type:"color",default:"#ffffff",doc:"The color of the flood light effect on the walls of the extruded buildings.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant",type:"number",default:0,minimum:0,maximum:1,doc:"The intensity of the flood light color.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven",type:"number",units:"meters",default:0,minimum:0,doc:"The extent of the flood light effect on the walls of the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven",type:"number",units:"meters",default:0,doc:"The extent of the flood light effect on the ground beneath the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant",type:"number",default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant",type:"number",default:1,minimum:0,doc:"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant",type:"boolean",default:!0,doc:"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.",requires:["fill-extrusion-edge-radius"],transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.10.0",ios:"10.10.0"}},expression:{interpolated:!1,parameters:["zoom"]}},"fill-extrusion-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',example:["interpolate",["linear"],["line-progress"],0,"blue",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0"}},"property-type":"constant"},"line-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{type:"number",private:!0,doc:"The width of the line border. A value of zero means no border.",default:0,minimum:0,transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{type:"color",private:!0,doc:"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.",default:"rgba(0, 0, 0, 0)",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},requires:["icon-image"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},doc:"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",transition:!0},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{type:"number",default:1,minimum:0,maximum:1,transition:!0,units:"intensity",doc:"Controls saturation level of the symbol icon. With the default value of 1 the icon color is preserved while with a value of 0 it is fully desaturated and looks black and white.","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}},expression:{interpolated:!1},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-color":{type:"color",doc:'Defines a color map by which to colorize a raster layer, parameterized by the `["raster-value"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.',transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{type:"array",default:[.2126,.7152,.0722,0],length:4,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.",example:[.2126,.7152,.0722,0],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-color-range":{type:"array",length:2,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source's stated data range is used.",example:[.5,10],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{type:"string",required:!1,"property-type":"data-constant",transition:!1,requires:[{source:"raster-array"}],doc:"Displayed band of raster array source layer. Defaults to the first band if not set.",example:"band-name","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}}},"raster-elevation":{type:"number",doc:"Specifies an uniform elevation from the ground, in meters.",default:0,minimum:0,transition:!0,"sdk-support":{"basic functionality":{js:"3.1.0",android:"11.2.0",ios:"11.2.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{type:"string",required:!1,"property-type":"data-constant",transition:!1,doc:"Displayed band of raster array source layer",example:"band-name","sdk-support":{"basic functionality":{js:"",android:"",ios:""}}},"raster-particle-count":{type:"number",doc:"Defines the amount of particles per tile.",default:512,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},"property-type":"data-constant"},"raster-particle-color":{type:"color",doc:'Defines a color map by which to colorize a raster particle layer, parameterized by the `["raster-particle-speed"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.',transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{type:"number",doc:"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.",default:1,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},"property-type":"data-constant"},"raster-particle-speed-factor":{type:"number",doc:"Defines a coefficient for the speed of particles’ motion.",default:.2,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{type:"number",doc:"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.",default:.98,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{type:"number",doc:"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).",default:.8,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_model:{"model-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the model layer.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-rotation":{type:"array",value:"number",length:3,default:[0,0,0],period:360,units:"degrees","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{type:"array",value:"number",length:3,default:[1,1,1],doc:"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-translation":{type:"array",value:"number",length:3,default:[0,0,0],"property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{type:"color",default:"#ffffff",doc:"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-color-mix-intensity":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,doc:"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-type":{type:"enum",values:{"common-3d":{doc:"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{doc:"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"common-3d",doc:"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow casting for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow receiving for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{type:"number",default:1,minimum:0,maximum:1,doc:"Intensity of the ambient occlusion if present in the 3D model.",expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant",transition:!0},"model-emissive-strength":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:5,units:"intensity",doc:"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-roughness":{type:"number",default:1,minimum:0,maximum:1,doc:"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-height-based-emissive-strength-multiplier":{type:"array",default:[1,1,1,1,0],length:5,value:"number",doc:"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};function vN(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:[];iN(this,t),this.parent=e,this.bindings={};var n,i=fN(r);try{for(i.s();!(n=i.n()).done;){var o=Qj(n.value,2),a=o[0],s=o[1];this.bindings[a]=s}}catch(t){i.e(t)}finally{i.f()}}return rN(t,[{key:"concat",value:function(e){return new t(this,e)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}]),t}(),bN={kind:"null"},xN={kind:"number"},wN={kind:"string"},_N={kind:"boolean"},SN={kind:"color"},EN={kind:"object"},kN={kind:"value"},TN={kind:"collator"},CN={kind:"formatted"},ON={kind:"resolvedImage"};function AN(t,e){return{kind:"array",itemType:t,N:e}}function PN(t){if("array"===t.kind){var e=PN(t.itemType);return"number"==typeof t.N?"array<".concat(e,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(e,">")}return t.kind}var MN=[bN,xN,wN,_N,SN,CN,EN,AN(kN),ON];function IN(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!IN(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=MN;r255?255:t}function FN(t){return t<0?0:t>1?1:t}function zN(t){return"%"===t[t.length-1]?BN(parseFloat(t)/100*255):BN(parseInt(t))}function UN(t){return"%"===t[t.length-1]?FN(parseFloat(t)/100):FN(parseFloat(t))}function GN(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{RN={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in DN)return DN[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=UN(a.pop());case"rgb":return 3!==a.length?null:[zN(a[0]),zN(a[1]),zN(a[2]),s];case"hsla":if(4!==a.length)return null;s=UN(a.pop());case"hsl":if(3!==a.length)return null;var u=(parseFloat(a[0])%360+360)%360/360,l=UN(a[1]),c=UN(a[2]),f=c<=.5?c*(l+1):c+l-c*l,h=2*c-f;return[BN(255*GN(h,f,u+1/3)),BN(255*GN(h,f,u)),BN(255*GN(h,f,u-1/3)),s];default:return null}}return null}}catch(t){}var VN=function(){function t(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;iN(this,t),this.r=e,this.g=r,this.b=n,this.a=i}return rN(t,[{key:"toString",value:function(){var t=Qj(this.toArray(),4),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba(".concat(Math.round(e),",").concat(Math.round(r),",").concat(Math.round(n),",").concat(i,")")}},{key:"toArray",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]}},{key:"toArray01",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[t/n,e/n,r/n,n]}},{key:"toArray01Scaled",value:function(t){var e=this.r,r=this.g,n=this.b,i=this.a;return 0===i?[0,0,0]:[e/i*t,r/i*t,n/i*t]}},{key:"toArray01PremultipliedAlpha",value:function(){return[this.r,this.g,this.b,this.a]}},{key:"toArray01Linear",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[Math.pow(t/n,2.2),Math.pow(e/n,2.2),Math.pow(r/n,2.2),n]}}],[{key:"parse",value:function(e){if(e){if(e instanceof t)return e;if("string"==typeof e){var r=RN(e);if(r)return new t(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3])}}}}]),t}();VN.black=new VN(0,0,0,1),VN.white=new VN(1,1,1,1),VN.transparent=new VN(0,0,0,0),VN.red=new VN(1,0,0,1),VN.blue=new VN(0,0,1,1);var HN=VN,WN=function(){function t(e,r,n){iN(this,t),this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}return rN(t,[{key:"compare",value:function(t,e){return this.collator.compare(t,e)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}]),t}(),qN=rN(function t(e,r,n,i,o){iN(this,t),this.text=e.normalize?e.normalize():e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}),YN=function(){function t(e){iN(this,t),this.sections=e}return rN(t,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some(function(t){return 0!==t.text.length||t.image&&0!==t.image.namePrimary.length})}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map(function(t){return t.text}).join("")}},{key:"serialize",value:function(){var t,e=["format"],r=fN(this.sections);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.image)e.push(["image",n.image.namePrimary]);else{e.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),e.push(i)}}}catch(t){r.e(t)}finally{r.f()}return e}}],[{key:"fromString",value:function(e){return new t([new qN(e,null,null,null,null)])}},{key:"factory",value:function(e){return e instanceof t?e:t.fromString(e)}}]),t}(),XN=function(){function t(e){iN(this,t),this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}return rN(t,[{key:"toString",value:function(){return this.nameSecondary?"[".concat(this.namePrimary,",").concat(this.nameSecondary,"]"):this.namePrimary}},{key:"serialize",value:function(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}],[{key:"fromString",value:function(e,r){return e?new t({namePrimary:e,nameSecondary:r,available:!1}):null}}]),t}();function ZN(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function KN(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof HN)return!0;if(t instanceof WN)return!0;if(t instanceof YN)return!0;if(t instanceof XN)return!0;if(Array.isArray(t)){var e,r=fN(t);try{for(r.s();!(e=r.n()).done;){if(!KN(e.value))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}if("object"===dN(t)){for(var n in t)if(!KN(t[n]))return!1;return!0}return!1}function JN(t){if(null===t)return bN;if("string"==typeof t)return wN;if("boolean"==typeof t)return _N;if("number"==typeof t)return xN;if(t instanceof HN)return SN;if(t instanceof WN)return TN;if(t instanceof YN)return CN;if(t instanceof XN)return ON;if(Array.isArray(t)){var e,r,n=t.length,i=fN(t);try{for(i.s();!(r=i.n()).done;){var o=JN(r.value);if(e){if(e===o)continue;e=kN;break}e=o}}catch(t){i.e(t)}finally{i.f()}return AN(e||kN,n)}return EN}function QN(t){var e=dN(t);return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof HN||t instanceof YN||t instanceof XN?t.toString():JSON.stringify(t)}var $N=function(){function t(e,r){iN(this,t),this.type=e,this.value=r}return rN(t,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof HN?["rgba"].concat(this.value.toArray()):this.value instanceof YN?this.value.serialize():this.value}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!KN(e[1]))return r.error("invalid value");var n=e[1],i=JN(n),o=r.expectedType;return"array"!==i.kind||0!==i.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(i=o),new t(i,n)}}]),t}(),tR=function(){function t(e){iN(this,t),this.name="ExpressionEvaluationError",this.message=e}return rN(t,[{key:"toJSON",value:function(){return this.message}}]),t}(),eR={string:wN,number:xN,boolean:_N,object:EN},rR=function(){function t(e,r){iN(this,t),this.type=e,this.args=r}return rN(t,[{key:"evaluate",value:function(t){for(var e=0;e1)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected at least one argument.");var n,i=1,o=e[0];if("array"===o){var a,s;if(e.length>2){var u=e[1];if("string"!=typeof u||!(u in eR)||"object"===u)return r.error('The item type argument of "array" must be one of string, number, boolean',1);a=eR[u],i++}else a=kN;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);s=e[2],i++}n=AN(a,s)}else n=eR[o];for(var l=[];i-1,e.nameSecondary&&e.available&&t.availableImages&&(e.available=t.availableImages.indexOf(e.nameSecondary)>-1)),e}},{key:"eachChild",value:function(t){t(this.inputPrimary),this.inputSecondary&&t(this.inputSecondary)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected two or more arguments.");var n=r.parse(e[1],1,wN);if(!n)return r.error("No image name provided.");if(2===e.length)return new t(n);var i=r.parse(e[2],1,wN);return i?new t(n,i):r.error("Secondary image variant is not a string.")}}]),t}();function oR(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":dN(t)}var aR={"to-boolean":_N,"to-color":SN,"to-number":xN,"to-string":wN},sR=function(){function t(e,r){iN(this,t),this.type=e,this.args=r}return rN(t,[{key:"evaluate",value:function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){var e,r,n,i=fN(this.args);try{for(i.s();!(n=i.n()).done;){if(r=null,(e=n.value.evaluate(t))instanceof HN)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value ".concat(JSON.stringify(e),": expected an array containing either three or four numeric values."):ZN(e[0],e[1],e[2],e[3])))return new HN(e[0]/255,e[1]/255,e[2]/255,e[3])}}catch(t){i.e(t)}finally{i.f()}throw new tR(r||"Could not parse color from value '".concat("string"==typeof e?e:String(JSON.stringify(e)),"'"))}if("number"===this.type.kind){var a,s=null,u=fN(this.args);try{for(u.s();!(a=u.n()).done;){if(null===(s=a.value.evaluate(t)))return 0;var l=Number(s);if(!isNaN(l))return l}}catch(t){u.e(t)}finally{u.f()}throw new tR("Could not convert ".concat(JSON.stringify(s)," to number."))}return"formatted"===this.type.kind?YN.fromString(QN(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?XN.fromString(QN(this.args[0].evaluate(t))):"array"===this.type.kind?this.args.map(function(e){return e.evaluate(t)}):QN(this.args[0].evaluate(t))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new nR([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new iR(this.args[0]).serialize();var t="array"===this.type.kind?[]:["to-".concat(this.type.kind)];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected at least one argument.");var n=e[0],i=[],o=bN;if("to-array"===n){if(!Array.isArray(e[1]))return null;var a=e[1].length;if(r.expectedType){if("array"!==r.expectedType.kind)return r.error("Expected ".concat(r.expectedType.kind," but found array."));o=AN(r.expectedType.itemType,a)}else{if(!(a>0&&KN(e[1][0])))return null;o=AN(JN(e[1][0]),a)}for(var s=0;sn;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1),f=Math.max(n,Math.floor(r-s*l/a+c)),h=Math.min(i,Math.floor(r+(a-s)*l/a+c));t(e,r,f,h,o)}var p=e[r],d=n,y=i;for(dR(e,n,r),o(e[i],p)>0&&dR(e,n,i);d0;)y--}0===o(e[n],p)?dR(e,n,y):dR(e,++y,i),y<=r&&(n=y+1),r<=y&&(i=y-1)}}(t,e,r||0,n||t.length-1,i||yR)}function dR(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function yR(t,e){return te?1:0}function vR(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function xR(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function wR(t,e){for(var r,n,i,o,a,s,u,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=!1,f=0,h=e.length;f0&&f<0||c<0&&f>0}function SR(t,e,r,n){var i,o,a=[e[0]-t[0],e[1]-t[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!=(i=s)[0]*(o=a)[1]-i[1]*o[0]&&!(!_R(t,e,r,n)||!_R(r,n,t,e))}var ER=8192;function kR(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(n*o*ER),Math.round(i*o*ER)]}function TR(t,e){for(var r=0;rr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}mR(e,t)}function LR(t,e,r,n){var i=Math.pow(2,n.z)*ER,o=[n.x*ER,n.y*ER],a=[];if(!t)return a;var s,u=fN(t);try{for(u.s();!(s=u.n()).done;){var l,c=fN(s.value);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=[f.x+o[0],f.y+o[1]];IR(h,e,r,i),a.push(h)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){u.e(t)}finally{u.f()}return a}function jR(t,e,r,n){var i=Math.pow(2,n.z)*ER,o=[n.x*ER,n.y*ER],a=[];if(!t)return a;var s,u,l=fN(t);try{for(l.s();!(s=l.n()).done;){var c,f=[],h=fN(s.value);try{for(h.s();!(c=h.n()).done;){var p=c.value,d=[p.x+o[0],p.y+o[1]];mR(e,d),f.push(d)}}catch(t){h.e(t)}finally{h.f()}a.push(f)}}catch(t){l.e(t)}finally{l.f()}if(e[2]-e[0]<=i/2){(u=e)[0]=u[1]=1/0,u[2]=u[3]=-1/0;var y,v=fN(a);try{for(v.s();!(y=v.n()).done;){var g,m=fN(y.value);try{for(m.s();!(g=m.n()).done;){IR(g.value,e,r,i)}}catch(t){m.e(t)}finally{m.f()}}}catch(t){v.e(t)}finally{v.f()}}return a}var NR=function(){function t(e,r){iN(this,t),this.type=_N,this.geojson=e,this.geometries=r}return rN(t,[{key:"evaluate",value:function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=PR(e.coordinates,n,i),a=LR(t.geometry(),r,n,i);if(!bR(r,n))return!1;var s,u=fN(a);try{for(u.s();!(s=u.n()).done;)if(!wR(s.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===e.type){var l=MR(e.coordinates,n,i),c=LR(t.geometry(),r,n,i);if(!bR(r,n))return!1;var f,h=fN(c);try{for(h.s();!(f=h.n()).done;)if(!TR(f.value,l))return!1}catch(t){h.e(t)}finally{h.f()}}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=PR(e.coordinates,n,i),a=jR(t.geometry(),r,n,i);if(!bR(r,n))return!1;var s,u=fN(a);try{for(u.s();!(s=u.n()).done;)if(!OR(s.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===e.type){var l=MR(e.coordinates,n,i),c=jR(t.geometry(),r,n,i);if(!bR(r,n))return!1;var f,h=fN(c);try{for(h.s();!(f=h.n()).done;)if(!AR(f.value,l))return!1}catch(t){h.e(t)}finally{h.f()}}return!0}(t,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("'within' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(KN(e[1])){var n=e[1];if("FeatureCollection"===n.type)for(var i=0;ie)return VR(i,o,(e-(r-a))/a)}return t[t.length-1]}},{key:"pointToSegmentDistance",value:function(t,e,r){var n=Qj(e,2),i=n[0],o=n[1],a=HR(r[0]-i)*this.kx,s=(r[1]-o)*this.ky,u=0;return 0===a&&0===s||((u=(HR(t[0]-i)*this.kx*a+(t[1]-o)*this.ky*s)/(a*a+s*s))>1?(i=r[0],o=r[1]):u>0&&(i+=a/this.kx*u,o+=s/this.ky*u)),a=HR(t[0]-i)*this.kx,s=(t[1]-o)*this.ky,Math.sqrt(a*a+s*s)}},{key:"pointOnLine",value:function(t,e){for(var r,n,i,o,a=1/0,s=0;s1?(u=t[s+1][0],l=t[s+1][1]):h>0&&(u+=c/this.kx*h,l+=f/this.ky*h));var p=(c=HR(e[0]-u)*this.kx)*c+(f=(e[1]-l)*this.ky)*f;pi.index||n.index===i.index&&n.t>i.t){var o=n;n=i,i=o}var a=[n.point],s=n.index+1,u=i.index;!GR(r[s],a[0])&&s<=u&&a.push(r[s]);for(var l=s+1;l<=u;l++)a.push(r[l]);return GR(r[u],i.point)||a.push(i.point),a}},{key:"lineSliceAlong",value:function(t,e,r){for(var n=0,i=[],o=0;ot&&0===i.length&&i.push(VR(a,s,(t-(n-u))/u)),n>=e)return i.push(VR(a,s,(e-(n-u))/u)),i;n>t&&i.push(s)}return i}},{key:"bufferPoint",value:function(t,e){var r=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-r,t[0]+n,t[1]+r]}},{key:"bufferBBox",value:function(t,e){var r=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-r,t[2]+n,t[3]+r]}},{key:"insideBBox",value:function(t,e){return HR(t[0]-e[0])>=0&&HR(t[0]-e[2])<=0&&t[1]>=e[1]&&t[1]<=e[3]}}],[{key:"fromTile",value:function(e,r,n){var i=Math.PI*(1-2*(e+.5)/Math.pow(2,r));return new t(Math.atan(.5*(Math.exp(i)-Math.exp(-i)))/zR,n)}},{key:"units",get:function(){return RR}}]),t}();function GR(t,e){return t[0]===e[0]&&t[1]===e[1]}function VR(t,e,r){var n=HR(e[0]-t[0]),i=e[1]-t[1];return[t[0]+n*r,t[1]+i*r]}function HR(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}function WR(t,e){this.x=t,this.y=e}WR.prototype={clone:function(){return new WR(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},WR.convert=function(t){return t instanceof WR?t:Array.isArray(t)?new WR(t[0],t[1]):t};var qR=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:YR;if(iN(this,t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}return rN(t,[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n}},{key:"_down",value:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}}]),t}();function YR(t,e){return te?1:0}var XR=8192;function ZR(t,e){return e.dist-t.dist}var KR=100,JR=50;function QR(t){var e=[1/0,1/0,-1/0,-1/0];if(e.length!==t.length)return!1;for(var r=0;r=t[0]&&t[1]t[1])return[null,null];var r=$R(t);if(e){if(2===r)return[t,null];var n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(1===r)return[t,null];var i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function rD(t,e){var r=[1/0,1/0,-1/0,-1/0];if(!tD(e,t.length))return r;for(var n=e[0];n<=e[1];++n)mR(r,t[n]);return r}function nD(t){for(var e=[1/0,1/0,-1/0,-1/0],r=0;re[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]3&&void 0!==arguments[3]?arguments[3]:1/0,i=nD(t),o=nD(e);if(n!==1/0&&iD(i,o,r)>=n)return n;if(bR(i,o)){if(dD(t,e))return 0}else if(dD(e,t))return 0;var a,s=n,u=fN(t);try{for(u.s();!(a=u.n()).done;)for(var l=a.value,c=0,f=l.length,h=f-1;c4&&void 0!==arguments[4]?arguments[4]:1/0,o=Math.min(n.distance(t[0],r[0][0]),i);if(0===o)return o;for(var a={dist:0,range1:[0,t.length-1],range2:[0,0]},s=new qR([a],ZR),u=e?JR:KR,l=nD(r);s.length;){var c=s.pop();if(!(c.dist>=o)){var f=c.range1;if($R(f)<=u){if(!tD(f,t.length))return NaN;if(e){var h=pD(t,f,r,n);if(0===(o=Math.min(o,h)))return o}else for(var p=f[0];p<=f[1];++p){var d=hD(t[p],r,n);if(0===(o=Math.min(o,d)))return o}}else{var y=eD(f,e);if(null!==y[0]){var v=iD(rD(t,y[0]),l,n);v5&&void 0!==arguments[5]?arguments[5]:1/0,a=Math.min(o,i.distance(t[0],r[0]));if(0===a)return a;for(var s={dist:0,range1:[0,t.length-1],range2:[0,r.length-1]},u=new qR([s],ZR),l=e?JR:KR,c=n?JR:KR;u.length;){var f=u.pop();if(!(f.dist>=a)){var h=f.range1,p=f.range2;if($R(h)<=l&&$R(p)<=c){if(!tD(h,t.length)||!tD(p,r.length))return NaN;if(e&&n?a=Math.min(a,cD(t,h,r,p,i)):e||n?e&&!n?a=Math.min(a,uD(r,p,t,h,i)):!e&&n&&(a=Math.min(a,uD(t,h,r,p,i))):a=Math.min(a,fD(t,h,r,p,i)),0===a)return a}else{var d=eD(h,e),y=eD(p,n);vD(u,a,i,t,r,d[0],y[0]),vD(u,a,i,t,r,d[0],y[1]),vD(u,a,i,t,r,d[1],y[0]),vD(u,a,i,t,r,d[1],y[1])}}}return a}function bD(t,e,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=rD(t,[0,t.length-1]),s=fN(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(o!==1/0&&iD(a,rD(u,[0,u.length-1]),n)>=o)&&0===(o=Math.min(o,mD(t,e,u,!0,n,o))))return o}}catch(t){s.e(t)}finally{s.f()}return o}function xD(t,e,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=rD(t,[0,t.length-1]),s=fN(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(o!==1/0&&iD(a,nD(u),n)>=o)){var l=gD(t,e,u,n,o);if(isNaN(l))return l;if(0===(o=Math.min(o,l)))return o}}}catch(t){s.e(t)}finally{s.f()}return o}function wD(t,e,r){var n,i=[],o=fN(function(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;ur&&(t=r),t}var TD=function(){function t(e,r,n){iN(this,t),this.type=e,this.key=r,this.scope=n}return rN(t,[{key:"evaluate",value:function(t){var e=[this.key,this.scope,t.scope].filter(Boolean).join(""),r=t.getConfig(e);if(!r)return null;var n=r.type,i=r.value,o=r.values,a=r.minValue,s=r.maxValue,u=r.stepValue,l=r.default.evaluate(t),c=l;if(i){var f=t.scope;t.scope=(f||"").split("").slice(1).join(""),c=i.evaluate(t),t.scope=f}return n&&(c=ED(n,c)),void 0===c||void 0===a&&void 0===s&&void 0===u||("number"==typeof c?c=kD(c,a,s,u):Array.isArray(c)&&(c=c.map(function(t){return"number"==typeof t?kD(t,a,s,u):t}))),void 0!==i&&void 0!==c&&o&&!o.includes(c)&&(c=l,n&&(c=ED(n,c))),(n&&n!==this.type||void 0!==c&&JN(c)!==this.type)&&(c=ED(this.type.kind,c)),c}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["config",this.key];return this.scope&&t.concat(this.key),t}}],[{key:"parse",value:function(e,r){var n=r.expectedType;if(null!==n&&void 0!==n||(n=kN),e.length<2||e.length>3)return r.error("Invalid number of arguments for 'config' expression.");var i=r.parse(e[1],1);if(!(i instanceof $N))return r.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){var o=r.parse(e[2],2);return o instanceof $N?new t(n,QN(i.value),QN(o.value)):r.error("Scope of 'config' expression must be a string literal.")}return new t(n,QN(i.value))}}]),t}();function CD(t){if(t instanceof fR){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof NR)return!1;if(t instanceof SD)return!1;var e=!0;return t.eachChild(function(t){e&&!CD(t)&&(e=!1)}),e}function OD(t){if(t instanceof fR&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!OD(t)&&(e=!1)}),e}function AD(t){if(t instanceof TD)return!1;var e=!0;return t.eachChild(function(t){e&&!AD(t)&&(e=!1)}),e}function PD(t,e){if(t instanceof fR&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!PD(t,e)&&(r=!1)}),r}var MD=function(){function t(e,r){iN(this,t),this.type=r.type,this.name=e,this.boundExpression=r}return rN(t,[{key:"evaluate",value:function(t){return this.boundExpression.evaluate(t)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(e,r){if(2!==e.length||"string"!=typeof e[1])return r.error("'var' expression requires exactly one string literal argument.");var n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error('Unknown variable "'.concat(n,'". Make sure "').concat(n,'" has been bound in an enclosing "let" expression before using it.'),1)}}]),t}(),ID=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new mN,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;iN(this,t),this.registry=e,this.path=r,this.key=r.map(function(t){return"[".concat(t,"]")}).join(""),this.scope=i,this.errors=o,this.expectedType=n,this._scope=a,this.options=s}return rN(t,[{key:"parse",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e||r?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}},{key:"_parse",value:function(t,e){function r(t,e,r){return"assert"===r?new rR(e,[t]):"coerce"===r?new sR(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n="string"==typeof t[0]?this.registry[t[0]]:void 0;if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,a=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==a.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(o,a))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof $N)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof MD)return t(e.boundExpression);if(e instanceof fR&&"error"===e.name)return!1;if(e instanceof hR)return!1;if(e instanceof NR)return!1;if(e instanceof SD)return!1;if(e instanceof TD)return!1;var r=e instanceof sR||e instanceof rR;var n=!0;e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof $N});if(!n)return!1;return CD(e)&&PD(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}(i)){var s=new lR(this._scope,this.options);try{i=new $N(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return sR.parse(["to-array",t],this)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"===dN(t)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(dN(t)," instead."))}},{key:"concat",value:function(e,r,n){var i="number"==typeof e?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,i,r||null,o,this.errors,this._scope,this.options)}},{key:"error",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;ne))throw new tR("Input is not a number.");a=s-1}return 0}var jD=function(){function t(e,r,n){iN(this,t),this.type=e,this.input=r,this.labels=[],this.outputs=[];var i,o=fN(n);try{for(o.s();!(i=o.n()).done;){var a=Qj(i.value,2),s=a[0],u=a[1];this.labels.push(s),this.outputs.push(u)}}catch(t){o.e(t)}finally{o.f()}}return rN(t,[{key:"evaluate",value:function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[LD(e,n)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var e,r=fN(this.outputs);try{for(r.s();!(e=r.n()).done;){t(e.value)}}catch(t){r.e(t)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){for(var t=["step",this.input.serialize()],e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}],[{key:"parse",value:function(e,r){if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");var n=r.parse(e[1],1,xN);if(!n)return null;var i=[],o=null;r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);for(var a=1;a=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var f=r.parse(u,c,o);if(!f)return null;o=o||f.type,i.push([s,f])}return new t(o,n,i)}}]),t}(),ND=RD;function RD(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}RD.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var DD=NN(ND);function BD(t,e,r){return t*(1-r)+e*r}var FD=Object.freeze({__proto__:null,array:function(t,e,r){return t.map(function(t,n){return BD(t,e[n],r)})},color:function(t,e,r){return new HN(BD(t.r,e.r,r),BD(t.g,e.g,r),BD(t.b,e.b,r),BD(t.a,e.a,r))},number:BD}),zD=.95047,UD=1,GD=1.08883,VD=4/29,HD=6/29,WD=3*HD*HD,qD=HD*HD*HD,YD=Math.PI/180,XD=180/Math.PI;function ZD(t){return t>qD?Math.pow(t,1/3):t/WD+VD}function KD(t){return t>HD?t*t*t:WD*(t-VD)}function JD(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function QD(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $D(t){var e=QD(t.r),r=QD(t.g),n=QD(t.b),i=ZD((.4124564*e+.3575761*r+.1804375*n)/zD),o=ZD((.2126729*e+.7151522*r+.072175*n)/UD);return{l:116*o-16,a:500*(i-o),b:200*(o-ZD((.0193339*e+.119192*r+.9503041*n)/GD)),alpha:t.a}}function tB(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=UD*KD(e),r=zD*KD(r),n=GD*KD(n),new HN(JD(3.2404542*r-1.5371385*e-.4985314*n),JD(-.969266*r+1.8760108*e+.041556*n),JD(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var eB={forward:$D,reverse:tB,interpolate:function(t,e,r){return{l:BD(t.l,e.l,r),a:BD(t.a,e.a,r),b:BD(t.b,e.b,r),alpha:BD(t.alpha,e.alpha,r)}}},rB={forward:function(t){var e=$D(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*XD;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*YD,r=t.c;return tB({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:BD(t.c,e.c,r),l:BD(t.l,e.l,r),alpha:BD(t.alpha,e.alpha,r)}}},nB=Object.freeze({__proto__:null,hcl:rB,lab:eB});function iB(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var oB=function(){function t(e,r,n,i,o){iN(this,t),this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];var a,s=fN(o);try{for(s.s();!(a=s.n()).done;){var u=Qj(a.value,2),l=u[0],c=u[1];this.labels.push(l),this.outputs.push(c)}}catch(t){s.e(t)}finally{s.f()}}return rN(t,[{key:"evaluate",value:function(e){var r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(e);var i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);var o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);var a=LD(r,i),s=r[a],u=r[a+1],l=t.interpolationFactor(this.interpolation,i,s,u),c=n[a].evaluate(e),f=n[a+1].evaluate(e);return"interpolate"===this.operator?FD[this.type.kind.toLowerCase()](c,f,l):"interpolate-hcl"===this.operator?rB.reverse(rB.interpolate(rB.forward(c),rB.forward(f),l)):eB.reverse(eB.interpolate(eB.forward(c),eB.forward(f),l))}},{key:"eachChild",value:function(t){t(this.input);var e,r=fN(this.outputs);try{for(r.s();!(e=r.n()).done;){t(e.value)}}catch(t){r.e(t)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r1}))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:c}}if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,xN)))return null;var f=[],h=null;"interpolate-hcl"===o||"interpolate-lab"===o?h=SN:r.expectedType&&"value"!==r.expectedType.kind&&(h=r.expectedType);for(var p=0;p=d)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var m=r.parse(y,g,h);if(!m)return null;h=h||m.type,f.push([d,m])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new t(h,o,a,s,f):r.error("Type ".concat(PN(h)," is not interpolatable."))}}]),t}(),aB=function(){function t(e,r){iN(this,t),this.type=e,this.args=r}return rN(t,[{key:"evaluate",value:function(t){var e,r,n=null,i=0,o=fN(this.args);try{for(o.s();!(r=o.n()).done;){if(i++,(n=r.value.evaluate(t))&&n instanceof XN&&!n.available&&(e||(e=n),n=null,i===this.args.length))return e;if(null!==n)break}}catch(t){o.e(t)}finally{o.f()}return n}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expectected at least one argument.");var n=null,i=r.expectedType;i&&"value"!==i.kind&&(n=i);var o,a=[],s=fN(e.slice(1));try{for(s.s();!(o=s.n()).done;){var u=o.value,l=r.parse(u,1+a.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,a.push(l)}}catch(t){s.e(t)}finally{s.f()}return new t(i&&a.some(function(t){return IN(i,t.type)})?kN:n,a)}}]),t}(),sB=function(){function t(e,r){iN(this,t),this.type=r.type,this.bindings=[].concat(e),this.result=r}return rN(t,[{key:"evaluate",value:function(t){return this.result.evaluate(t)}},{key:"eachChild",value:function(t){var e,r=fN(this.bindings);try{for(r.s();!(e=r.n()).done;){t(e.value[1])}}catch(t){r.e(t)}finally{r.f()}t(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var t,e=["let"],r=fN(this.bindings);try{for(r.s();!(t=r.n()).done;){var n=Qj(t.value,2),i=n[0],o=n[1];e.push(i,o.serialize())}}catch(t){r.e(t)}finally{r.f()}return e.push(this.result.serialize()),e}}],[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));for(var n=[],i=1;i=r.length)throw new tR("Array index out of bounds: ".concat(e," > ").concat(r.length-1,"."));if(e!==Math.floor(e))throw new tR("Array index must be an integer, but found ".concat(e," instead."));return r[e]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,xN),i=r.parse(e[2],2,AN(r.expectedType||kN));return n&&i?new t(i.type.itemType,n,i):null}}]),t}(),lB=function(){function t(e,r){iN(this,t),this.type=_N,this.needle=e,this.haystack=r}return rN(t,[{key:"evaluate",value:function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!jN(e,["boolean","string","number","null"]))throw new tR("Expected first argument to be of type boolean, string, number or null, but found ".concat(PN(JN(e))," instead."));if(!jN(r,["string","array"]))throw new tR("Expected second argument to be of type array or string, but found ".concat(PN(JN(r))," instead."));return r.indexOf(e)>=0}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,kN),i=r.parse(e[2],2,kN);return n&&i?LN(n.type,[_N,wN,xN,bN,kN])?new t(n,i):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(PN(n.type)," instead")):null}}]),t}(),cB=function(){function t(e,r,n){iN(this,t),this.type=xN,this.needle=e,this.haystack=r,this.fromIndex=n}return rN(t,[{key:"evaluate",value:function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!jN(e,["boolean","string","number","null"]))throw new tR("Expected first argument to be of type boolean, string, number or null, but found ".concat(PN(JN(e))," instead."));if(!jN(r,["string","array"]))throw new tR("Expected second argument to be of type array or string, but found ".concat(PN(JN(r))," instead."));if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,kN),i=r.parse(e[2],2,kN);if(!n||!i)return null;if(!LN(n.type,[_N,wN,xN,bN,kN]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(PN(n.type)," instead"));if(4===e.length){var o=r.parse(e[3],3,xN);return o?new t(n,i,o):null}return new t(n,i)}}]),t}(),fB=function(){function t(e,r,n,i,o,a){iN(this,t),this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}return rN(t,[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);return(JN(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t,e=this,r=["match",this.input.serialize()],n=[],i={},o=fN(Object.keys(this.cases).sort());try{for(o.s();!(t=o.n()).done;){var a=t.value,s=i[this.cases[a]];void 0===s?(i[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[s][1].push(a)}}catch(t){o.e(t)}finally{o.f()}for(var u=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,c=n;lNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,JN(p)))return null}else n=JN(p);if(void 0!==o[String(p)])return c.error("Branch labels must be unique.");o[String(p)]=a.length}}catch(t){h.e(t)}finally{h.f()}var d=r.parse(l,s,i);if(!d)return null;i=i||d.type,a.push(d)}var y=r.parse(e[1],1,kN);if(!y)return null;var v=r.parse(e[e.length-1],e.length-1,i);return v?"value"!==y.type.kind&&r.concat(1).checkSubtype(n,y.type)?null:new t(n,i,y,o,a,v):null}}]),t}(),hB=function(){function t(e,r,n){iN(this,t),this.type=e,this.branches=r,this.otherwise=n}return rN(t,[{key:"evaluate",value:function(t){var e,r=fN(this.branches);try{for(r.s();!(e=r.n()).done;){var n=Qj(e.value,2),i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}}catch(t){r.e(t)}finally{r.f()}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var e,r=fN(this.branches);try{for(r.s();!(e=r.n()).done;){var n=Qj(e.value,2),i=n[0],o=n[1];t(i),t(o)}}catch(t){r.e(t)}finally{r.f()}t(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every(function(t){var e=Qj(t,2);e[0];return e[1].outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=0)return r.error("Expected an odd number of arguments.");var n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);for(var i=[],o=1;o=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,kN),i=r.parse(e[2],2,xN);if(!n||!i)return null;if(!LN(n.type,[AN(kN),wN,kN]))return r.error("Expected first argument to be of type array or string, but found ".concat(PN(n.type)," instead"));if(4===e.length){var o=r.parse(e[3],3,xN);return o?new t(n.type,n,i,o):null}return new t(n.type,n,i)}}]),t}();function dB(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function yB(t,e,r,n){return 0===n.compare(e,r)}function vB(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){iN(this,i),this.type=_N,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return rN(i,[{key:"evaluate",value:function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=JN(o),u=JN(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new tR('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(s.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){var l=JN(o),c=JN(a);if("string"!==l.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,kN);if(!o)return null;if(!dB(r,o.type))return e.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(PN(o.type),"'."));var a=e.parse(t[2],2,kN);if(!a)return null;if(!dB(r,a.type))return e.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(PN(a.type),"'."));if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '".concat(PN(o.type),"' and '").concat(PN(a.type),"'."));n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new rR(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new rR(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,TN)))return null}return new i(o,a,s)}}]),i}()}var gB=vB("==",function(t,e,r){return e===r},yB),mB=vB("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!yB(0,e,r,n)}),bB=vB("<",function(t,e,r){return e",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),wB=vB("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),_B=vB(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),SB=function(){function t(e,r,n,i,o,a){iN(this,t),this.type=wN,this.number=e,this.locale=r,this.currency=n,this.unit=i,this.minFractionDigits=o,this.maxFractionDigits=a}return rN(t,[{key:"evaluate",value:function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}},{key:"eachChild",value:function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected two arguments.");var n=r.parse(e[1],1,xN);if(!n)return null;var i=e[2];if("object"!==dN(i)||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=r.parse(i.locale,1,wN)))return null;var a=null;if(i.currency&&!(a=r.parse(i.currency,1,wN)))return null;var s=null;if(i.unit&&!(s=r.parse(i.unit,1,wN)))return null;var u=null;if(i["min-fraction-digits"]&&!(u=r.parse(i["min-fraction-digits"],1,xN)))return null;var l=null;return i["max-fraction-digits"]&&!(l=r.parse(i["max-fraction-digits"],1,xN))?null:new t(n,o,a,s,u,l)}}]),t}();var EB={"==":gB,"!=":mB,">":xB,"<":bB,">=":_B,"<=":wB,array:rR,at:uB,boolean:rR,case:hB,coalesce:aB,collator:hR,format:nR,image:iR,in:lB,"index-of":cB,interpolate:oB,"interpolate-hcl":oB,"interpolate-lab":oB,length:function(){function t(e){iN(this,t),this.type=xN,this.input=e}return rN(t,[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new tR("Expected value to be of type string or array, but found ".concat(PN(JN(e))," instead."))}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error("Expected argument of type string or array, but found ".concat(PN(n.type)," instead.")):new t(n):null}}]),t}(),let:sB,literal:$N,match:fB,number:rR,"number-format":SB,object:rR,slice:pB,step:jD,string:rR,"to-boolean":sR,"to-color":sR,"to-number":sR,"to-string":sR,var:MD,within:NR,distance:SD,config:TD};function kB(t,e){var r=Qj(e,4),n=r[0],i=r[1],o=r[2],a=r[3];n=n.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var s=a?a.evaluate(t):1,u=ZN(n,i,o,s);if(u)throw new tR(u);return new HN(n/255*s,i/255*s,o/255*s,s)}function TB(t,e){var r=Qj(e,4),n=r[0],i=r[1],o=r[2],a=r[3];n=n.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var s=a?a.evaluate(t):1,u=function(t,e,r,n){return"number"==typeof t&&t>=0&&t<=360?"number"==typeof e&&e>=0&&e<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid hsla value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid hsla value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 's', and 'l' must be between 0 and 100."):"Invalid hsla value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 'h' must be between 0 and 360.")}(n,i,o,s);if(u)throw new tR(u);var l="hsla(".concat(n,", ").concat(i,"%, ").concat(o,"%, ").concat(s,")"),c=HN.parse(l);if(!c)throw new tR("Failed to parse HSLA color: ".concat(l));return c}function CB(t,e){return t in e}function OB(t,e){var r=e[t];return void 0===r?null:r}function AB(t){return{type:t}}fR.register(EB,{error:[{kind:"error"},[wN],function(t,e){var r=Qj(e,1)[0];throw new tR(r.evaluate(t))}],typeof:[wN,[kN],function(t,e){return PN(JN(Qj(e,1)[0].evaluate(t)))}],"to-rgba":[AN(xN,4),[SN],function(t,e){return Qj(e,1)[0].evaluate(t).toArray()}],rgb:[SN,[xN,xN,xN],kB],rgba:[SN,[xN,xN,xN,xN],kB],hsl:[SN,[xN,xN,xN],TB],hsla:[SN,[xN,xN,xN,xN],TB],has:{type:_N,overloads:[[[wN],function(t,e){return CB(Qj(e,1)[0].evaluate(t),t.properties())}],[[wN,EN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return CB(n.evaluate(t),i.evaluate(t))}]]},get:{type:kN,overloads:[[[wN],function(t,e){return OB(Qj(e,1)[0].evaluate(t),t.properties())}],[[wN,EN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return OB(n.evaluate(t),i.evaluate(t))}]]},"feature-state":[kN,[wN],function(t,e){return OB(Qj(e,1)[0].evaluate(t),t.featureState||{})}],properties:[EN,[],function(t){return t.properties()}],"geometry-type":[wN,[],function(t){return t.geometryType()}],id:[kN,[],function(t){return t.id()}],zoom:[xN,[],function(t){return t.globals.zoom}],pitch:[xN,[],function(t){return t.globals.pitch||0}],"distance-from-center":[xN,[],function(t){return t.distanceFromCenter()}],"measure-light":[xN,[wN],function(t,e){var r=Qj(e,1)[0];return t.measureLight(r.evaluate(t))}],"heatmap-density":[xN,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[xN,[],function(t){return t.globals.lineProgress||0}],"raster-value":[xN,[],function(t){return t.globals.rasterValue||0}],"raster-particle-speed":[xN,[],function(t){return t.globals.rasterParticleSpeed||0}],"sky-radial-progress":[xN,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[kN,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[xN,AB(xN),function(t,e){var r,n=0,i=fN(e);try{for(i.s();!(r=i.n()).done;){n+=r.value.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return n}],"*":[xN,AB(xN),function(t,e){var r,n=1,i=fN(e);try{for(i.s();!(r=i.n()).done;){n*=r.value.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return n}],"-":{type:xN,overloads:[[[xN,xN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return n.evaluate(t)-i.evaluate(t)}],[[xN],function(t,e){return-Qj(e,1)[0].evaluate(t)}]]},"/":[xN,[xN,xN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return n.evaluate(t)/i.evaluate(t)}],"%":[xN,[xN,xN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return n.evaluate(t)%i.evaluate(t)}],ln2:[xN,[],function(){return Math.LN2}],pi:[xN,[],function(){return Math.PI}],e:[xN,[],function(){return Math.E}],"^":[xN,[xN,xN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return Math.pow(n.evaluate(t),i.evaluate(t))}],sqrt:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.sqrt(r.evaluate(t))}],log10:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.log(r.evaluate(t))}],log2:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.sin(r.evaluate(t))}],cos:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.cos(r.evaluate(t))}],tan:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.tan(r.evaluate(t))}],asin:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.asin(r.evaluate(t))}],acos:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.acos(r.evaluate(t))}],atan:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.atan(r.evaluate(t))}],min:[xN,AB(xN),function(t,e){return Math.min.apply(Math,Kj(e.map(function(e){return e.evaluate(t)})))}],max:[xN,AB(xN),function(t,e){return Math.max.apply(Math,Kj(e.map(function(e){return e.evaluate(t)})))}],abs:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.abs(r.evaluate(t))}],round:[xN,[xN],function(t,e){var r=Qj(e,1)[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.floor(r.evaluate(t))}],ceil:[xN,[xN],function(t,e){var r=Qj(e,1)[0];return Math.ceil(r.evaluate(t))}],"filter-==":[_N,[wN,kN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return t.properties()[n.value]===i.value}],"filter-id-==":[_N,[kN],function(t,e){var r=Qj(e,1)[0];return t.id()===r.value}],"filter-type-==":[_N,[wN],function(t,e){var r=Qj(e,1)[0];return t.geometryType()===r.value}],"filter-<":[_N,[wN,kN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return dN(o)===dN(a)&&o":[_N,[wN,kN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return dN(o)===dN(a)&&o>a}],"filter-id->":[_N,[kN],function(t,e){var r=Qj(e,1)[0],n=t.id(),i=r.value;return dN(n)===dN(i)&&n>i}],"filter-<=":[_N,[wN,kN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return dN(o)===dN(a)&&o<=a}],"filter-id-<=":[_N,[kN],function(t,e){var r=Qj(e,1)[0],n=t.id(),i=r.value;return dN(n)===dN(i)&&n<=i}],"filter->=":[_N,[wN,kN],function(t,e){var r=Qj(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return dN(o)===dN(a)&&o>=a}],"filter-id->=":[_N,[kN],function(t,e){var r=Qj(e,1)[0],n=t.id(),i=r.value;return dN(n)===dN(i)&&n>=i}],"filter-has":[_N,[kN],function(t,e){return Qj(e,1)[0].value in t.properties()}],"filter-has-id":[_N,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[_N,[AN(wN)],function(t,e){return Qj(e,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[_N,[AN(kN)],function(t,e){return Qj(e,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[_N,[wN,AN(kN)],function(t,e){var r=Qj(e,2),n=r[0];return r[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[_N,[wN,AN(kN)],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[n.value],i.value,0,i.value.length-1)}],all:{type:_N,overloads:[[[_N,_N],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return n.evaluate(t)&&i.evaluate(t)}],[AB(_N),function(t,e){var r,n=fN(e);try{for(n.s();!(r=n.n()).done;){if(!r.value.evaluate(t))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}]]},any:{type:_N,overloads:[[[_N,_N],function(t,e){var r=Qj(e,2),n=r[0],i=r[1];return n.evaluate(t)||i.evaluate(t)}],[AB(_N),function(t,e){var r,n=fN(e);try{for(n.s();!(r=n.n()).done;){if(r.value.evaluate(t))return!0}}catch(t){n.e(t)}finally{n.f()}return!1}]]},"!":[_N,[_N],function(t,e){return!Qj(e,1)[0].evaluate(t)}],"is-supported-script":[_N,[wN],function(t,e){var r=Qj(e,1)[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[wN,[wN],function(t,e){return Qj(e,1)[0].evaluate(t).toUpperCase()}],downcase:[wN,[wN],function(t,e){return Qj(e,1)[0].evaluate(t).toLowerCase()}],concat:[wN,AB(kN),function(t,e){return e.map(function(e){return QN(e.evaluate(t))}).join("")}],"resolved-locale":[wN,[TN],function(t,e){return Qj(e,1)[0].evaluate(t).resolvedLocale()}],random:[xN,[xN,xN,kN],function(t,e){var r,n,i=Qj(e.map(function(e){return e.evaluate(t)}),3),o=i[0],a=i[1],s=i[2];if(o>a)return o;if(o===a)return o;if("string"==typeof s)r=function(t){var e=0;if(0===t.length)return e;for(var r=0;r>>15,1|n);return(((t=t+Math.imul(t^t>>>7,61|t)^t)^t>>>14)>>>0)/4294967296})()*(a-o)}]});var PB=EB;function MB(t){return{result:"success",value:t}}function IB(t){return{result:"error",value:t}}function LB(t,e){return!!t&&!!t.parameters&&t.parameters.indexOf(e)>-1}function jB(t){return"data-driven"===t["property-type"]}function NB(t){return LB(t.expression,"measure-light")}function RB(t){return LB(t.expression,"zoom")}function DB(t){return!!t.expression&&t.expression.interpolated}function BB(t){return"object"===dN(t)&&null!==t&&!Array.isArray(t)}function FB(t){return t}function zB(t,e){var r,n,i,o="color"===e.type,a=t.stops&&"object"===dN(t.stops[0][0]),s=a||void 0!==t.property,u=a||!s,l=t.type||(DB(e)?"exponential":"interval");if(o&&((t=vN({},t)).stops&&(t.stops=t.stops.map(function(t){return[t[0],HN.parse(t[1])]})),t.default?t.default=HN.parse(t.default):t.default=HN.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!nB[t.colorSpace])throw new Error("Unknown color space: ".concat(t.colorSpace));if("exponential"===l)r=HB;else if("interval"===l)r=VB;else if("categorical"===l){r=GB,n=Object.create(null);var c,f=fN(t.stops);try{for(f.s();!(c=f.n()).done;){var h=c.value;n[h[0]]=h[1]}}catch(t){f.e(t)}finally{f.f()}i=dN(t.stops[0][0])}else{if("identity"!==l)throw new Error('Unknown function type "'.concat(l,'"'));r=WB}if(a){for(var p={},d=[],y=0;y=t.stops[n-1][0])return t.stops[n-1][1];var i=LD(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function HB(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==oR(r))return UB(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=LD(t.stops.map(function(t){return t[0]}),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=FD[e.type]||FB;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=nB[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&"string"==typeof t[0]&&t[0]in PB}function XB(t,e,r,n){var i=new ID(PB,[],e?function(t){var e={color:SN,string:wN,number:xN,enum:wN,boolean:_N,formatted:CN,resolvedImage:ON};if("array"===t.type)return AN(e[t.value]||kN,t.length);return e[t.type]}(e):void 0,void 0,void 0,r,n),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?MB(new qB(o,e,r,n)):IB(i.errors)}var ZB=function(){function t(e,r,n){iN(this,t),this.kind=e,this._styleExpression=r,this.isLightConstant=n,this.isStateDependent="constant"!==e&&!OD(r.expression),this.isConfigDependent=!AD(r.expression)}return rN(t,[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)}},{key:"evaluate",value:function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)}}]),t}(),KB=function(){function t(e,r,n,i,o){iN(this,t),this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==e&&!OD(r.expression),this.isLightConstant=o,this.isConfigDependent=!AD(r.expression),this.interpolationType=i}return rN(t,[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)}},{key:"evaluate",value:function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)}},{key:"interpolationFactor",value:function(t,e,r){return this.interpolationType?oB.interpolationFactor(this.interpolationType,t,e,r):0}}]),t}();function JB(t,e,r,n){if("error"===(t=XB(t,e,r,n)).result)return t;var i=t.value.expression,o=CD(i);if(!o&&!jB(e))return IB([new gN("","data expressions not supported")]);var a=PD(i,["zoom","pitch","distance-from-center"]);if(!a&&!RB(e))return IB([new gN("","zoom expressions not supported")]);var s=PD(i,["measure-light"]);if(!s&&!NB(e))return IB([new gN("","measure-light expression not supported")]);var u=e.expression&&e.expression.relaxZoomRestriction,l=function t(e){var r=null;if(e instanceof sB)r=t(e.result);else if(e instanceof aB){var n,i=fN(e.args);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r=t(o))break}}catch(t){i.e(t)}finally{i.f()}}else(e instanceof jD||e instanceof oB)&&e.input instanceof fR&&"zoom"===e.input.name&&(r=e);if(r instanceof gN)return r;e.eachChild(function(e){var n=t(e);n instanceof gN?r=n:r&&n&&r!==n&&(r=new gN("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))});return r}(i);if(!(l||a||u))return IB([new gN("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')]);if(l instanceof gN)return IB([l]);if(l instanceof oB&&!DB(e))return IB([new gN("",'"interpolate" expressions cannot be used with this property')]);if(!l)return MB(new ZB(o?"constant":"source",t.value,s));var c=l instanceof oB?l.interpolation:void 0;return MB(new KB(o?"camera":"composite",t.value,l.labels,c,s))}var QB=function(){function t(e,r){iN(this,t),this._parameters=e,this._specification=r,vN(this,zB(this._parameters,this._specification))}return rN(t,null,[{key:"deserialize",value:function(e){return new t(e._parameters,e._specification)}},{key:"serialize",value:function(t){return{_parameters:t._parameters,_specification:t._specification}}}]),t}();function $B(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function tF(t){if(Array.isArray(t))return t.map(tF);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=tF(t[r]);return e}return $B(t)}function eF(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":var e,r=fN(t.slice(1));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(!eF(n)&&"boolean"!=typeof n)return!1}}catch(t){r.e(t)}finally{r.f()}return!0;default:return!0}}function rF(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill";if(null===t||void 0===t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};eF(t)||(t=aF(t));var r=t,n=!0;try{n=function(t){if(!nF(t))return t;var e=tF(t);return function t(e){var r=!1,n=[];if("case"===e[0]){for(var i=1;i",">=","<","<=","to-boolean"]);function oF(t,e){return te?1:0}function aF(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?sF(t[1],t[2],"=="):"!="===r?cF(sF(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?sF(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(aF))):"all"===r?["all"].concat(t.slice(1).map(aF)):"none"===r?["all"].concat(t.slice(1).map(aF).map(cF)):"in"===r?uF(t[1],t.slice(2)):"!in"===r?cF(uF(t[1],t.slice(2))):"has"===r?lF(t[1]):"!has"!==r||cF(lF(t[1]))}function sF(t,e,r){switch(t){case"$type":return["filter-type-".concat(r),e];case"$id":return["filter-id-".concat(r),e];default:return["filter-".concat(r),t,e]}}function uF(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return dN(t)!==dN(e[0])})?["filter-in-large",t,["literal",e.sort(oF)]]:["filter-in-small",t,["literal",e]]}}function lF(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function cF(t){return["!",t]}var fF={};!function(t){var e=function(){var t=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},e=[1,12],r=[1,13],n=[1,9],i=[1,10],o=[1,11],a=[1,14],s=[1,15],u=[14,18,22,24],l=[18,22],c=[22,24],f={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,n,i,o,a){var s=o.length-1;switch(i){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[s-2],o[s]];break;case 16:this.$={},this.$[o[s][0]]=o[s][1];break;case 17:this.$=o[s-2],o[s-2][o[s][0]]=o[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[s]];break;case 21:this.$=o[s-2],o[s-2].push(o[s])}},table:[{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(u,[2,7]),t(u,[2,8]),t(u,[2,9]),t(u,[2,10]),t(u,[2,11]),t(u,[2,12]),t(u,[2,3]),t(u,[2,4]),t(u,[2,5]),t([14,18,21,22,24],[2,1]),t(u,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(u,[2,13]),{18:[1,24],22:[1,25]},t(l,[2,16]),{21:[1,26]},t(u,[2,18]),{22:[1,28],24:[1,27]},t(c,[2,20]),t(u,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:30,15:7,16:8,17:a,23:s},t(u,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:31,15:7,16:8,17:a,23:s},t(l,[2,17]),t(l,[2,15]),t(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],o=this.table,a="",s=0,u=0,l=1,c=i.slice.call(arguments,1),f=Object.create(this.lexer),h={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(h.yy[p]=this.yy[p]);f.setInput(t,h.yy),h.yy.lexer=f,h.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;i.push(d);var y=f.options&&f.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,g,m,b,x,w,_,S,E,k={};;){if(g=r[r.length-1],this.defaultActions[g]?m=this.defaultActions[g]:(null!==v&&void 0!==v||(E=void 0,"number"!=typeof(E=f.lex()||l)&&(E=e.symbols_[E]||E),v=E),m=o[g]&&o[g][v]),void 0===m||!m.length||!m[0]){var T="";for(x in S=[],o[g])this.terminals_[x]&&x>2&&S.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(s+1)+":\n"+f.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(s+1)+": Unexpected "+(v==l?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:d,expected:S})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+v);switch(m[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(m[1]),v=null,u=f.yyleng,a=f.yytext,s=f.yylineno,d=f.yylloc;break;case 2:if(w=this.productions_[m[1]][1],k.$=n[n.length-w],k._$={first_line:i[i.length-(w||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(w||1)].first_column,last_column:i[i.length-1].last_column},y&&(k._$.range=[i[i.length-(w||1)].range[0],i[i.length-1].range[1]]),void 0!==(b=this.performAction.apply(k,[a,u,s,h.yy,m[1],n,i].concat(c))))return b;w&&(r=r.slice(0,-1*w*2),n=n.slice(0,-1*w),i=i.slice(0,-1*w)),r.push(this.productions_[m[1]][0]),n.push(k.$),i.push(k._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},h={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var o in i)this[o]=i[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),o=0;oe[0].length)){if(e=r,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return f.lexer=h,p.prototype=f,f.Parser=p,new p}();t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)}}(fF);new Set(["vector","raster","raster-dem","raster-array","model","batched-model"]);var hF={StyleExpression:qB,isExpression:YB,isExpressionFilter:eF,createExpression:XB,createPropertyExpression:JB,normalizePropertyExpression:function(t,e,r,n){if(BB(t))return new QB(t,e);if(YB(t)||Array.isArray(t)&&t.length>0){var i=JB(t,e,r,n);if("error"===i.result)throw new Error(i.value.map(function(t){return"".concat(t.key,": ").concat(t.message)}).join(", "));return i.value}var o=t;return"string"==typeof t&&"color"===e.type&&(o=HN.parse(t)),{kind:"constant",isConfigDependent:!1,evaluate:function(){return o}}},ZoomConstantExpression:ZB,ZoomDependentExpression:KB,StylePropertyFunction:QB},pF=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8],"doc":"Style specification version number. Must be 8.","example":8},"fragment":{"type":"boolean","doc":"Indicates that a style is a fragment style.","example":true},"name":{"type":"string","doc":"A human-readable name for the style.","example":"Bright"},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"center":{"type":"array","value":"number","doc":"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":[-73.9749,40.7736]},"zoom":{"type":"number","doc":"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":12.5},"bearing":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Default bearing, in degrees. The bearing is the compass direction that is \\"up\\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":29},"pitch":{"type":"number","default":0,"units":"degrees","doc":"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":50},"light":{"type":"light","doc":"The global light source. Note: This API is deprecated. Prefer using `flat` light type instead in the `lights` API.","example":{"anchor":"viewport","color":"white","intensity":0.4}},"lights":{"required":false,"type":"array","value":"light-3d","doc":"Array of light sources affecting the whole map and the default for 3D style, mutually exclusive with the light property","example":[{"id":"environment","type":"ambient","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4}},{"id":"sun_light","type":"directional","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4,"direction":[200,40],"cast-shadows":true,"shadow-intensity":0.2}}],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"terrain":{"type":"terrain","optional":true,"doc":"A global modifier that elevates layers and markers based on a DEM data source."},"fog":{"type":"fog","doc":"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},"camera":{"type":"camera","doc":"Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."},"imports":{"type":"array","value":"import","doc":"Imports other styles into this style.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"schema":{"type":"schema","doc":"Definition of the schema for configuration options.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"sources":{"required":true,"type":"sources","doc":"Data source specifications.","example":{"mapbox-streets":{"type":"vector","url":"mapbox://mapbox.mapbox-streets-v6"}}},"sprite":{"type":"string","doc":"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","example":"mapbox://sprites/mapbox/bright-v8"},"glyphs":{"type":"string","doc":"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf","example":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition","doc":"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style\'s `transition` property.","example":{"duration":300,"delay":0}},"projection":{"type":"projection","doc":"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.","example":{"name":"albers","center":[-154,50],"parallels":[55,65]}},"layers":{"required":true,"type":"array","value":"layer","doc":"Layers will be drawn in the order of this array.","example":[{"id":"water","source":"mapbox-streets","source-layer":"water","type":"fill","paint":{"fill-color":"#00ffff"}}]},"models":{"type":"models","doc":"Specification of models used in the style.","example":{"spruce1-lod0":"asset://spruce1-lod0.glb","spruce1-lod1":"asset://spruce1-lod1.glb","spruce1-lod2":"asset://spruce1-lod2.glb"}}},"model":{"type":"string","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`.","required":true},"import":{"id":{"type":"string","doc":"Unique import name.","required":true},"url":{"type":"string","doc":"The URL of the style.","required":true},"config":{"type":"config","doc":"Configuration values for the imported style\'s options."},"data":{"type":"$root","doc":"The inlined style that must correspond to the contents of the specified URL."}},"config":{"*":{"type":"*","doc":"Value of the imported style\'s configuration option."}},"schema":{"*":{"type":"option","doc":"Specification of a configuration option."}},"option":{"default":{"type":"*","doc":"Default configuration value for this option.","required":true},"type":{"type":"enum","doc":"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.","values":{"string":{"doc":"The result will be coerced to a string."},"number":{"doc":"The result will be coerced to a number."},"boolean":{"doc":"The result will be coerced to a boolean."},"color":{"doc":"The result will be coerced to a color."}}},"array":{"type":"boolean","doc":"If true, this option is returned as an array"},"minValue":{"type":"number","doc":"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},"maxValue":{"type":"number","doc":"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},"stepValue":{"type":"number","doc":"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},"values":{"type":"array","value":"*","doc":"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."}},"models":{"*":{"type":"model","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{"id":{"type":"string","doc":"Unique light name.","required":true},"properties":{"type":"properties","doc":"Properties of the light."},"type":{"type":"enum","doc":"Type of the light to be added","values":{"ambient":{"doc":"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"directional":{"doc":"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"flat":{"doc":"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).","example":[90,40],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"cast-shadows":{"type":"boolean","default":false,"doc":"Enable/Disable shadow casting for this light","transition":false,"expression":{"interpolated":false},"property-type":"data-constant","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"sources":{"*":{"type":"source","doc":"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{"doc":"A vector tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{"doc":"A raster tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{"doc":"A RGB-encoded raster DEM source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"encoding":{"type":"enum","values":{"terrarium":{"doc":"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},"mapbox":{"doc":"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},"default":"mapbox","doc":"The encoding used by this source. Mapbox Terrain RGB is used by default"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":{"doc":"A raster array source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"rasterLayers":{"type":"*","doc":"Contains the description of the raster data layers and the bands contained within the tiles."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{"doc":"A GeoJSON data source."}},"doc":"The data type of the GeoJSON source."},"data":{"type":"*","doc":"A URL to a GeoJSON file, or inline GeoJSON."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0,"doc":"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},"filter":{"type":"*","doc":"An expression for filtering features prior to processing them for rendering."},"tolerance":{"type":"number","default":0.375,"doc":"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},"cluster":{"type":"boolean","default":false,"doc":"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count"},"clusterRadius":{"type":"number","default":50,"minimum":0,"doc":"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},"clusterMaxZoom":{"type":"number","doc":"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},"clusterMinPoints":{"type":"number","doc":"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},"clusterProperties":{"type":"*","doc":"An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{\\"property_name\\": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `\\"+\\"` or `\\"max\\"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{\\"sum\\": [\\"+\\", [\\"get\\", \\"scalerank\\"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `[\\"accumulated\\"]` value, e.g.:\\n`{\\"sum\\": [[\\"+\\", [\\"accumulated\\"], [\\"get\\", \\"sum\\"]], [\\"get\\", \\"scalerank\\"]]}`"},"lineMetrics":{"type":"boolean","default":false,"doc":"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},"generateId":{"type":"boolean","default":false,"doc":"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{"doc":"A video data source."}},"doc":"The data type of the video source."},"urls":{"required":true,"type":"array","value":"string","doc":"URLs to video content in order of preferred format."},"coordinates":{"required":true,"doc":"Corners of video specified in longitude, latitude pairs.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{"doc":"An image data source."}},"doc":"The data type of the image source."},"url":{"required":false,"type":"string","doc":"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},"coordinates":{"required":true,"doc":"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":{"doc":"A collection of 3D models"},"batched-model":{"doc":"A collection of 3D models with anchor data"}},"doc":"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which batched-model tiles are available"},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec."}},"layer":{"id":{"type":"string","doc":"Unique layer name.","required":true},"type":{"type":"enum","values":{"fill":{"doc":"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"line":{"doc":"A stroked line.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"symbol":{"doc":"An icon or a text label.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"circle":{"doc":"A filled circle.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"heatmap":{"doc":"A heatmap.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"fill-extrusion":{"doc":"An extruded (3D) polygon.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"raster":{"doc":"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"raster-particle":{"doc":"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0","macos":"0.1.0"}}},"hillshade":{"doc":"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}}},"model":{"doc":"A 3D model","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"background":{"doc":"The background color or pattern of the map.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"sky":{"doc":"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"slot":{"doc":"Marks the position of a slot.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"doc":"Rendering type of this layer.","required":true},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"source":{"type":"string","doc":"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{"type":"string","doc":"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},"slot":{"type":"string","doc":"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"minzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},"maxzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},"filter":{"type":"filter","doc":"An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\\"feature-state\\", ...]` expression is not supported in filter expressions. The `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions are supported only for filter expressions on the symbol layer."},"layout":{"type":"layout","doc":"Layout properties for the layer."},"paint":{"type":"paint","doc":"Default paint properties for this layer."}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"model-id":{"type":"string","default":"","doc":"Model to render.","property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":false,"requires":[{"source":["geojson","vector"]}]}},"layout_fill":{"fill-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"},"data-driven styling":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"doc":"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{"doc":"A cap with a squared-off end which is drawn to the exact endpoint of the line."},"round":{"doc":"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"square":{"doc":"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},"default":"butt","doc":"The display of line endings.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{"doc":"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},"round":{"doc":"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"miter":{"doc":"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},"default":"miter","doc":"The display of lines when joining.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"doc":"Used to automatically convert miter joins to bevel joins for sharp angles.","requires":[{"line-join":"miter"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"doc":"Used to automatically convert round joins to miter joins for shallow angles.","requires":[{"line-join":"round"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{"doc":"The label is placed at the point where the geometry is located."},"line":{"doc":"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{"doc":"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},"default":"point","doc":"Label placement relative to its geometry.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`line-center` value":{"js":"0.47.0","android":"6.4.0","ios":"4.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","doc":"Distance between two symbol anchors.","requires":[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"doc":"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"},"data-driven styling":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{"doc":"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"source":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},"default":"auto","doc":"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{"js":"0.49.0","android":"6.6.0","ios":"4.5.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"doc":"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"requires":[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the icon will be visible even if it collides with other previously drawn symbols.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the icon.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"doc":"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},"viewport":{"doc":"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of icons.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","doc":"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{"doc":"The icon is displayed at its intrinsic aspect ratio."},"width":{"doc":"The icon is scaled in the x-dimension to fit the width of the text."},"height":{"doc":"The icon is scaled in the y-dimension to fit the height of the text."},"both":{"doc":"The icon is scaled in both x- and y-dimensions."}},"default":"none","doc":"Scales the icon to fit around the associated text.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"stretchable icons":{"js":"1.6.0","android":"9.2.0","ios":"5.8.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","doc":"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","doc":"Name of image in sprite to use for drawing an image background.","tokens":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the icon clockwise.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the icon bounding box used for detecting symbol collisions.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"doc":"If true, the icon may be flipped to prevent it from being rendered upside-down.","requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"doc":"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{"doc":"The center of the icon is placed closest to the anchor."},"left":{"doc":"The left side of the icon is placed closest to the anchor."},"right":{"doc":"The right side of the icon is placed closest to the anchor."},"top":{"doc":"The top of the icon is placed closest to the anchor."},"bottom":{"doc":"The bottom of the icon is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the icon is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the icon is placed closest to the anchor."}},"default":"center","doc":"Part of the icon placed closest to the anchor.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The icon is aligned to the plane of the map."},"viewport":{"doc":"The icon is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `icon-rotation-alignment`."}},"default":"auto","doc":"Orientation of icon when map is pitched.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The text is aligned to the plane of the map."},"viewport":{"doc":"The text is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `text-rotation-alignment`."}},"default":"auto","doc":"Orientation of text when map is pitched.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},"viewport":{"doc":"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"doc":"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"doc":"Font stack to use for displaying text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","doc":"Font size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","doc":"The maximum line width for text wrapping.","requires":["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","doc":"Text leading value for multi-line text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0","android":"10.0.0","ios":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","doc":"Text tracking amount.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{"doc":"The text is aligned towards the anchor position."},"left":{"doc":"The text is aligned to the left."},"center":{"doc":"The text is centered."},"right":{"doc":"The text is aligned to the right."}},"default":"center","doc":"Text justification options.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"},"auto":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"doc":"Radial offset of text, in the direction of the symbol\'s anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"},"data-driven styling":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"requires":["text-field",{"symbol-placement":["point"]}],"doc":"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"default":"center","doc":"Part of the text placed closest to the anchor.","requires":["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","doc":"Maximum angle change between adjacent characters.","requires":["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{"doc":"If a text\'s language supports horizontal writing mode, symbols would be laid out horizontally."},"vertical":{"doc":"If a text\'s language supports vertical writing mode, symbols would be laid out vertically."}},"doc":"The property allows control over a symbol\'s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single \'vertical\' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [\'horizontal\', \'vertical\'] or [\'vertical\', \'horizontal\'], the order doesn\'t affect the placement.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"1.3.0","android":"8.3.0","ios":"5.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the text clockwise.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the text bounding box used for detecting symbol collisions.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"doc":"If true, the text may be flipped vertically to prevent it from being rendered upside-down.","requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{"doc":"The text is not altered."},"uppercase":{"doc":"Forces all letters to be displayed in uppercase."},"lowercase":{"doc":"Forces all letters to be displayed in lowercase."}},"default":"none","doc":"Specifies how to capitalize text, similar to the CSS `text-transform` property.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","doc":"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the text will be visible even if it collides with other previously drawn symbols.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"doc":"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.","requires":["text-field","icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"filter":{"type":"array","value":"*","doc":"A filter selects specific features from a layer."},"filter_symbol":{"type":"boolean","doc":"Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","doc":"Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","doc":"Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","doc":"Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{"doc":"`[\\"==\\", key, value]` equality: `feature[key] = value`"},"!=":{"doc":"`[\\"!=\\", key, value]` inequality: `feature[key] ≠ value`"},">":{"doc":"`[\\">\\", key, value]` greater than: `feature[key] > value`"},">=":{"doc":"`[\\">=\\", key, value]` greater than or equal: `feature[key] ≥ value`"},"<":{"doc":"`[\\"<\\", key, value]` less than: `feature[key] < value`"},"<=":{"doc":"`[\\"<=\\", key, value]` less than or equal: `feature[key] ≤ value`"},"in":{"doc":"`[\\"in\\", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`"},"!in":{"doc":"`[\\"!in\\", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`"},"all":{"doc":"`[\\"all\\", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`"},"any":{"doc":"`[\\"any\\", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`"},"none":{"doc":"`[\\"none\\", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`"},"has":{"doc":"`[\\"has\\", key]` `feature[key]` exists"},"!has":{"doc":"`[\\"!has\\", key]` `feature[key]` does not exist"}},"doc":"The filter operator."},"geometry_type":{"type":"enum","values":{"Point":{"doc":"Filter to point geometries."},"LineString":{"doc":"Filter to line geometries."},"Polygon":{"doc":"Filter to polygon geometries."}},"doc":"The geometry type for the filter to select."},"function":{"expression":{"type":"expression","doc":"An expression."},"stops":{"type":"array","doc":"An array of stops.","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0,"doc":"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},"property":{"type":"string","doc":"The name of a feature property to use as the function input.","default":"$zoom"},"type":{"type":"enum","values":{"identity":{"doc":"Return the input value as the output value."},"exponential":{"doc":"Generate an output by interpolating between stops just less than and just greater than the function input."},"interval":{"doc":"Return the output value of the stop just less than the function input."},"categorical":{"doc":"Return the output value of the stop equal to the function input."}},"doc":"The interpolation strategy to use in function evaluation.","default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{"doc":"Use the RGB color space to interpolate color values"},"lab":{"doc":"Use the LAB color space to interpolate color values."},"hcl":{"doc":"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},"doc":"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.","default":"rgb"},"default":{"type":"*","required":false,"doc":"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2,"doc":"Zoom level and value pair."},"expression":{"type":"array","value":"*","minimum":1,"doc":"An expression defines a function that can be used for data-driven style properties or feature filters."},"expression_name":{"doc":"","type":"enum","values":{"let":{"doc":"Binds expressions to named variables, which can then be referenced in the result expression using [\\"var\\", \\"variable_name\\"].","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"var":{"doc":"References variable bound using \\"let\\".","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"config":{"doc":"Retrieves the configuration value for the given option.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"literal":{"doc":"Provides a literal array or object value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"array":{"doc":"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"at":{"doc":"Retrieves an item from an array.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"in":{"doc":"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.6.0","android":"9.1.0","ios":"5.8.0"}}},"index-of":{"doc":"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"slice":{"doc":"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"case":{"doc":"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"match":{"doc":"Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\\"get\\", \\"building_type\\"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\\"c\\", \\"b\\"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `\\"in\\"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"coalesce":{"doc":"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`\'image\'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"step":{"doc":"Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\\n\\nInterpolation types:\\n- `[\\"linear\\"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `[\\"exponential\\", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `[\\"cubic-bezier\\", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate-hcl":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"interpolate-lab":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"ln2":{"doc":"Returns mathematical constant ln(2).","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pi":{"doc":"Returns the mathematical constant pi.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"e":{"doc":"Returns the mathematical constant e.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"typeof":{"doc":"Returns a string describing the type of the given value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"string":{"doc":"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"number":{"doc":"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"boolean":{"doc":"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"object":{"doc":"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"collator":{"doc":"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.","group":"Types","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"format":{"doc":"Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `\\"text-font\\"`: Overrides the font stack specified by the root layout property.\\n- `\\"text-color\\"`: Overrides the color specified by the root paint property.\\n- `\\"font-scale\\"`: Applies a scaling factor on `text-size` as specified by the root layout property.","group":"Types","sdk-support":{"basic functionality":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-font":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"font-scale":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-color":{"js":"1.3.0","android":"7.3.0","ios":"4.10.0"},"image":{"js":"1.6.0","android":"8.6.0","ios":"5.7.0"}}},"image":{"doc":"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`\'format\'`](#types-format) expression. A [`\'coalesce\'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `\'image\'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `\'image\'` expression.","group":"Types","sdk-support":{"basic functionality":{"js":"1.4.0","android":"8.6.0","ios":"5.7.0"}}},"number-format":{"doc":"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.","group":"Types","sdk-support":{"basic functionality":{"js":"0.54.0","android":"8.4.0","ios":"5.4.0"}}},"to-string":{"doc":"Converts the input value to a string. If the input is `null`, the result is `\\"\\"`. If the input is a [`boolean`](#types-boolean), the result is `\\"true\\"` or `\\"false\\"`. If the input is a number, it is converted to a string as specified by the [\\"NumberToString\\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `\\"rgba(r,g,b,a)\\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-number":{"doc":"Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the [\\"ToNumber Applied to the String Type\\" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-boolean":{"doc":"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-rgba":{"doc":"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-color":{"doc":"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgb":{"doc":"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgba":{"doc":"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"hsl":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"hsla":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"get":{"doc":"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"has":{"doc":"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"length":{"doc":"Returns the length of an array or string.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"properties":{"doc":"Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\\"get\\", \\"property_name\\"]` directly.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"feature-state":{"doc":"Retrieves a property value from the current feature\'s state. Returns `null` if the requested property is not present on the feature\'s state. A feature\'s state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\"feature-state\\"] can only be used with paint properties that support data-driven styling.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.46.0","android":"10.0.0","ios":"10.0.0"}}},"geometry-type":{"doc":"Returns the feature\'s geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"id":{"doc":"Returns the feature\'s id, if it has one.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"zoom":{"doc":"Returns the current zoom level. Note that in style layout and paint properties, [\\"zoom\\"] may only appear as the input to a top-level \\"step\\" or \\"interpolate\\" expression.","group":"Camera","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pitch":{"doc":"Returns the current pitch in degrees. `[\\"pitch\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"distance-from-center":{"doc":"Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `[\\"distance-from-center\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"measure-light":{"doc":"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"heatmap-density":{"doc":"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.","group":"Heatmap","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"line-progress":{"doc":"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.6.0"}}},"sky-radial-progress":{"doc":"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.","group":"sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"accumulated":{"doc":"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.53.0","android":"8.4.0","ios":"5.5.0"}}},"+":{"doc":"Returns the sum of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"*":{"doc":"Returns the product of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"-":{"doc":"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"/":{"doc":"Returns the result of floating point division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"%":{"doc":"Returns the remainder after integer division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"^":{"doc":"Returns the result of raising the first input to the power specified by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sqrt":{"doc":"Returns the square root of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"log10":{"doc":"Returns the base-ten logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"ln":{"doc":"Returns the natural logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"log2":{"doc":"Returns the base-two logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sin":{"doc":"Returns the sine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"cos":{"doc":"Returns the cosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"tan":{"doc":"Returns the tangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"asin":{"doc":"Returns the arcsine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"acos":{"doc":"Returns the arccosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"atan":{"doc":"Returns the arctangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"min":{"doc":"Returns the minimum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"max":{"doc":"Returns the maximum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"round":{"doc":"Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `[\\"round\\", -1.5]` evaluates to -2.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"abs":{"doc":"Returns the absolute value of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"ceil":{"doc":"Returns the smallest integer that is greater than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"floor":{"doc":"Returns the largest integer that is less than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"distance":{"doc":"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"9.2.0","ios":"5.9.0"}}},"==":{"doc":"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"!=":{"doc":"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">":{"doc":"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<":{"doc":"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">=":{"doc":"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<=":{"doc":"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"all":{"doc":"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"any":{"doc":"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"!":{"doc":"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"within":{"doc":"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line\'s endpoint is on the boundary.","group":"Decision","sdk-support":{"basic functionality":{"js":"1.9.0","android":"9.1.0","ios":"5.8.0"}}},"is-supported-script":{"doc":"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.6.0","ios":"4.1.0"}}},"upcase":{"doc":"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"downcase":{"doc":"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"concat":{"doc":"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"resolved-locale":{"doc":"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"raster-value":{"doc":"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.","group":"Raster Colorization","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-particle-speed":{"doc":"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.","group":"Raster Particle Animation","sdk-support":{"basic functionality":{"js":"3.3.0","android":"","ios":""}}},"random":{"doc":"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"camera":{"camera-projection":{"doc":"Camera projection describes how 3D world geometry get projected into 2D screen","type":"enum","values":{"perspective":{"doc":"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},"orthographic":{"doc":"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}}},"projection":{"name":{"type":"enum","values":{"albers":{"doc":"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"equalEarth":{"doc":"An Equal Earth projection."},"equirectangular":{"doc":"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},"lambertConformalConic":{"doc":"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"mercator":{"doc":"The Mercator projection is the default projection."},"naturalEarth":{"doc":"A Natural Earth projection."},"winkelTripel":{"doc":"A Winkel Tripel projection."},"globe":{"doc":"A globe projection."}},"default":"mercator","doc":"The name of the projection to be used for rendering the map.","required":true,"sdk-support":{"basic functionality":{"js":"2.6.0","ios":"10.5.0","android":"10.5.0"}}},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"doc":"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].","example":[-96,37.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"doc":"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).","example":[29.5,45.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}}},"terrain":{"source":{"type":"string","doc":"Name of a source of `raster_dem` type to be used for terrain elevation.","required":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","requires":["source"],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"doc":"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","doc":"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.","transition":true,"requires":[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","doc":"The outline color of the fill. Matches the value of `fill-color` if unspecified.","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill is translated relative to the map."},"viewport":{"doc":"The fill is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-translate`.","default":"map","requires":["fill-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","doc":"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill extrusion is translated relative to the map."},"viewport":{"doc":"The fill extrusion is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-extrusion-translate`.","default":"map","requires":["fill-extrusion-translate"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude this layer.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.","transition":true,"requires":["fill-extrusion-height"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"doc":"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.","transition":false,"sdk-support":{"basic functionality":{"js":"0.50.0","android":"7.0.0","ios":"4.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.","requires":["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.","requires":["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","doc":"The color of the flood light effect on the walls of the extruded buildings.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"doc":"The intensity of the flood light color.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","units":"meters","default":0,"minimum":0,"doc":"The extent of the flood light effect on the walls of the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","units":"meters","default":0,"doc":"The extent of the flood light effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"doc":"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"doc":"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.","requires":["fill-extrusion-edge-radius"],"transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.10.0","ios":"10.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","doc":"The opacity at which the line will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","doc":"The color with which the line will be drawn.","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.23.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{"doc":"The line is translated relative to the map."},"viewport":{"doc":"The line is translated relative to the viewport."}},"doc":"Controls the frame of reference for `line-translate`.","default":"map","requires":["line-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","doc":"Stroke thickness.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"doc":"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"doc":"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.12.1","android":"3.0.0","ios":"3.1.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","doc":"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won\'t render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","doc":"A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\\"lineMetrics\\": true`.","example":["interpolate",["linear"],["line-progress"],0,"blue",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.4.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","doc":"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.5.0","ios":"10.5.0"}},"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"doc":"The width of the line border. A value of zero means no border.","default":0,"minimum":0,"transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"doc":"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.","default":"rgba(0, 0, 0, 0)","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","doc":"Circle radius.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","doc":"The fill color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"doc":"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","doc":"The opacity at which the circle will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{"doc":"The circle is translated relative to the map."},"viewport":{"doc":"The circle is translated relative to the viewport."}},"doc":"Controls the frame of reference for `circle-translate`.","default":"map","requires":["circle-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{"doc":"Circles are scaled according to their apparent distance to the camera."},"viewport":{"doc":"Circles are not scaled."}},"default":"map","doc":"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The circle is aligned to the plane of the map."},"viewport":{"doc":"The circle is aligned to the plane of the viewport."}},"default":"viewport","doc":"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","doc":"The stroke color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","doc":"The opacity of the circle\'s stroke.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","doc":"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"doc":"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"doc":"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"doc":"Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\\"heatmap-density\\"]` as input.","transition":false,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","doc":"The global opacity at which the heatmap layer will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"doc":"The opacity at which the icon will be drawn.","type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"doc":"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the icon\'s halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the icon outline.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Fade out the halo towards the outside.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{"doc":"Icons are translated relative to the map."},"viewport":{"doc":"Icons are translated relative to the viewport."}},"doc":"Controls the frame of reference for `icon-translate`.","default":"map","requires":["icon-image","icon-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"doc":"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.","transition":true},"text-opacity":{"type":"number","doc":"The opacity at which the text will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","doc":"The color with which the text will be drawn.","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the text\'s halo, which helps it stand out from backgrounds.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The halo\'s fadeout distance towards the outside.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{"doc":"The text is translated relative to the map."},"viewport":{"doc":"The text is translated relative to the viewport."}},"doc":"Controls the frame of reference for `text-translate`.","default":"map","requires":["text-field","text-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"units":"intensity","doc":"Controls saturation level of the symbol icon. With the default value of 1 the icon color is preserved while with a value of 0 it is fully desaturated and looks black and white.","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}},"expression":{"interpolated":false},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","doc":"The opacity at which the image will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","doc":"Defines a color map by which to colorize a raster layer, parameterized by the `[\\"raster-value\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.","transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.","example":[0.2126,0.7152,0.0722,0],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source\'s stated data range is used.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","doc":"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the minimum brightness.","default":0,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the maximum brightness.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","doc":"Increase or reduce the saturation of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","doc":"Increase or reduce the contrast of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","doc":"The resampling/interpolation method to use for overscaling, also known as texture magnification filter","values":{"linear":{"doc":"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},"nearest":{"doc":"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},"default":"linear","sdk-support":{"basic functionality":{"js":"0.47.0","android":"6.3.0","ios":"4.2.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","doc":"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant","transition":false,"requires":[{"source":"raster-array"}],"doc":"Displayed band of raster array source layer. Defaults to the first band if not set.","example":"band-name","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}}},"raster-elevation":{"type":"number","doc":"Specifies an uniform elevation from the ground, in meters.","default":0,"minimum":0,"transition":true,"sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.2.0","ios":"11.2.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant","transition":false,"doc":"Displayed band of raster array source layer","example":"band-name","sdk-support":{"basic functionality":{"js":"","android":"","ios":""}}},"raster-particle-count":{"type":"number","doc":"Defines the amount of particles per tile.","default":512,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"property-type":"data-constant"},"raster-particle-color":{"type":"color","doc":"Defines a color map by which to colorize a raster particle layer, parameterized by the `[\\"raster-particle-speed\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.","transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","doc":"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.","default":1,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","doc":"Defines a coefficient for the speed of particles’ motion.","default":0.2,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","doc":"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.","default":0.98,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","doc":"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).","default":0.8,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"doc":"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.","transition":false,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{"doc":"The hillshade illumination is relative to the north direction."},"viewport":{"doc":"The hillshade illumination is relative to the top of the viewport."}},"default":"viewport","doc":"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","doc":"Intensity of the hillshade","default":0.5,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","doc":"The shading color of areas that face away from the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","doc":"The shading color of areas that faces towards the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","doc":"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","doc":"The color with which the background will be drawn.","transition":true,"requires":[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity at which the background will be drawn.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{"doc":"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},"atmosphere":{"doc":"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},"default":"atmosphere","doc":"The type of the sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"doc":"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"doc":"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"doc":"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.","transition":false,"requires":[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","doc":"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","doc":"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire sky layer.","transition":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the model layer.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"units":"degrees","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"doc":"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{"type":"color","default":"#ffffff","doc":"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"doc":"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model\'s colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-type":{"type":"enum","values":{"common-3d":{"doc":"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{"doc":"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"common-3d","doc":"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow casting for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow receiving for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Intensity of the ambient occlusion if present in the 3D model.","expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"units":"intensity","doc":"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","doc":"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds","doc":"Time allotted for transitions to complete."},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds","doc":"Length of time before a transition begins."}},"property-type":{"data-driven":{"type":"property-type","doc":"Property is interpolable and can be represented using a property expression."},"color-ramp":{"type":"property-type","doc":"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{"type":"property-type","doc":"Property is interpolable but cannot be represented using a property expression."},"constant":{"type":"property-type","doc":"Property is constant across all zoom levels and property values."}},"promoteId":{"*":{"type":"string","doc":"A name of a feature property to use as ID for feature state."}}}');function dF(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function yF(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!vF(t[0])||!vF(t[1]))throw new Error("coordinates must contain numbers");return dF({type:"Point",coordinates:t},e,r)}function vF(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function gF(t,e,r){if(null!==t)for(var n,i,o,a,s,u,l,c,f=0,h=0,p=t.type,d="FeatureCollection"===p,y="Feature"===p,v=d?t.features.length:1,g=0;gt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0},t.prototype.getAdjustRange=function(t,e,r){var n,i,o=this.yField,a=r.indexOf(e),s=r.length;return!o&&this.isAdjust("y")?(n=0,i=1):s>1?(n=r[0===a?0:a-1],i=r[a===s-1?s-1:a+1],0!==a?n+=(e-n)/2:n-=(i-e)/2,a!==s-1?i-=(i-e)/2:i+=(e-r[s-2])/2):(n=0===e?0:e-.5,i=0===e?1:e+.5),{pre:n,next:i}},t.prototype.adjustData=function(t,e){var r=this,n=this.getDimValues(e);Ew.each(t,function(t,e){Ew.each(n,function(n,i){r.adjustDim(i,n,t,e)})})},t.prototype.groupData=function(t,e){return Ew.each(t,function(t){void 0===t[e]&&(t[e]=0)}),Ew.groupBy(t,e)},t.prototype.adjustDim=function(t,e,r,n){},t.prototype.getDimValues=function(t){var e=this.xField,r=this.yField,n=Ew.assign({},this.dimValuesMap),i=[];if(e&&this.isAdjust("x")&&i.push(e),r&&this.isAdjust("y")&&i.push(r),i.forEach(function(e){n&&n[e]||(n[e]=Ew.valuesOfKey(t,e).sort(function(t,e){return t-e}))}),!r&&this.isAdjust("y")){n.y=[0,1]}return n},t}(),VF={},HF=function(t){return VF[t.toLowerCase()]},WF=function(t,e){if(HF(t))throw new Error("Adjust type '"+t+"' existed.");VF[t.toLowerCase()]=e};var qF=function(t,e){return(qF=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function YF(t,e){function r(){this.constructor=t}qF(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var XF=function(){return(XF=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=0)n=u+this.getIntervalOnlyOffset(r,e);else if(!Ew.isNil(s)&&Ew.isNil(a)&&s>=0){n=u+this.getDodgeOnlyOffset(r,e)}else if(!Ew.isNil(a)&&!Ew.isNil(s)&&a>=0&&s>=0){n=u+this.getIntervalAndDodgeOffset(r,e)}else{var f=c*i/r,h=o*f;n=(u+l)/2+(.5*(c-r*f-(r-1)*h)+((e+1)*f+e*h)-.5*f-.5*c)}return n},e.prototype.getIntervalOnlyOffset=function(t,e){var r=this,n=r.defaultSize,i=r.intervalPadding,o=r.xDimensionLegenth,a=r.groupNum,s=r.dodgeRatio,u=r.maxColumnWidth,l=r.minColumnWidth,c=r.columnWidthRatio,f=i/o,h=(1-(a-1)*f)/a*s/(t-1),p=((1-f*(a-1))/a-h*(t-1))/t;if(p=Ew.isNil(c)?p:1/a/t*c,!Ew.isNil(u)){var d=u/o;p=Math.min(p,d)}if(!Ew.isNil(l)){var y=l/o;p=Math.max(p,y)}return((.5+e)*(p=n?n/o:p)+e*(h=((1-(a-1)*f)/a-t*p)/(t-1))+.5*f)*a-f/2},e.prototype.getDodgeOnlyOffset=function(t,e){var r=this,n=r.defaultSize,i=r.dodgePadding,o=r.xDimensionLegenth,a=r.groupNum,s=r.marginRatio,u=r.maxColumnWidth,l=r.minColumnWidth,c=r.columnWidthRatio,f=i/o,h=1*s/(a-1),p=((1-h*(a-1))/a-f*(t-1))/t;if(p=c?1/a/t*c:p,!Ew.isNil(u)){var d=u/o;p=Math.min(p,d)}if(!Ew.isNil(l)){var y=l/o;p=Math.max(p,y)}return((.5+e)*(p=n?n/o:p)+e*f+.5*(h=(1-(p*t+f*(t-1))*a)/(a-1)))*a-h/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var r=this.intervalPadding,n=this.dodgePadding,i=this.xDimensionLegenth,o=this.groupNum,a=r/i,s=n/i;return((.5+e)*(((1-a*(o-1))/o-s*(t-1))/t)+e*s+.5*a)*o-a/2},e.prototype.getDistribution=function(t){var e=this.adjustDataArray,r=this.cacheMap,n=r[t];return n||(n={},Ew.each(e,function(e,r){var i=Ew.valuesOfKey(e,t);i.length||i.push(0),Ew.each(i,function(t){n[t]||(n[t]=[]),n[t].push(r)})}),r[t]=n),n},e}(GF);var KF=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return YF(e,t),e.prototype.process=function(t){var e=Ew.clone(t),r=Ew.flatten(e);return this.adjustData(e,r),e},e.prototype.adjustDim=function(t,e,r){var n=this,i=this.groupData(r,t);return Ew.each(i,function(r,i){return n.adjustGroup(r,t,parseFloat(i),e)})},e.prototype.getAdjustOffset=function(t){var e,r=t.pre,n=t.next,i=.05*(n-r);return(n-i-(e=r+i))*Math.random()+e},e.prototype.adjustGroup=function(t,e,r,n){var i=this,o=this.getAdjustRange(e,r,n);return Ew.each(t,function(t){t[e]=i.getAdjustOffset(o)}),t},e}(GF),JF=Ew.Cache,QF=function(t){function e(e){var r=t.call(this,e)||this,n=e.adjustNames,i=void 0===n?["y"]:n,o=e.height,a=void 0===o?NaN:o,s=e.size,u=void 0===s?10:s,l=e.reverseOrder,c=void 0!==l&&l;return r.adjustNames=i,r.height=a,r.size=u,r.reverseOrder=c,r}return YF(e,t),e.prototype.process=function(t){var e=this.yField,r=this.reverseOrder,n=e?this.processStack(t):this.processOneDimStack(t);return r?this.reverse(n):n},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this.xField,r=this.yField,n=this.reverseOrder?this.reverse(t):t,i=new JF,o=new JF;return n.map(function(t){return t.map(function(t){var n,a=Ew.get(t,e,0),s=Ew.get(t,[r]),u=a.toString();if(s=Ew.isArray(s)?s[1]:s,!Ew.isNil(s)){var l=s>=0?i:o;l.has(u)||l.set(u,0);var c=l.get(u),f=s+c;return l.set(u,f),XF(XF({},t),((n={})[r]=[c,f],n))}return t})})},e.prototype.processOneDimStack=function(t){var e=this,r=this.xField,n=this.height,i=this.reverseOrder?this.reverse(t):t,o=new JF;return i.map(function(t){return t.map(function(t){var i,a=e.size,s=t[r],u=2*a/n;o.has(s)||o.set(s,u/2);var l=o.get(s);return o.set(s,l+u),XF(XF({},t),((i={}).y=l,i))})})},e}(GF),$F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return YF(e,t),e.prototype.process=function(t){var e=Ew.flatten(t),r=this.xField,n=this.yField,i=this.getXValuesMaxMap(e),o=Math.max.apply(Math,Object.keys(i).map(function(t){return i[t]}));return Ew.map(t,function(t){return Ew.map(t,function(t){var e,a,s=t[n],u=t[r];if(Ew.isArray(s)){var l=(o-i[u])/2;return XF(XF({},t),((e={})[n]=Ew.map(s,function(t){return l+t}),e))}var c=(o-s)/2;return XF(XF({},t),((a={})[n]=[c,s+c],a))})})},e.prototype.getXValuesMaxMap=function(t){var e=this,r=this.xField,n=this.yField,i=Ew.groupBy(t,function(t){return t[r]});return Ew.mapValues(i,function(t){return e.getDimMaxValue(t,n)})},e.prototype.getDimMaxValue=function(t,e){var r=Ew.map(t,function(t){return Ew.get(t,e,[])}),n=Ew.flatten(r);return Math.max.apply(Math,n)},e}(GF);WF("Dodge",ZF),WF("Jitter",KF),WF("Stack",QF),WF("Symmetric",$F);var tz=function(t,e){return(0,Ew.isString)(e)?e:t.invert(t.scale(e))},ez=function(){function t(t){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(t)}return t.prototype.mapping=function(){for(var t=this,e=[],r=0;r1?1:Number(e),n=t.length-1,i=Math.floor(n*r),o=n*r-i,a=t[i],s=i===n?a:t[i+1];return sz([az(a,s,o,0),az(a,s,o,1),az(a,s,o,2)])}(r,t)}},toRGB:(0,Ew.memoize)(fz),toCSSGradient:function(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=nz.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=iz.exec(t))[4]}var o=r.match(oz);return(0,Ew.each)(o,function(t,r){var n=t.split(":");e+=n[1]+" "+100*n[0]+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}},pz=function(t){function e(e){var r=t.call(this,e)||this;return r.type="color",r.names=["color"],(0,Ew.isString)(r.values)&&(r.linear=!0),r.gradient=hz.gradient(r.values),r}return(0,Sw.__extends)(e,t),e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(ez),dz=function(t){function e(e){var r=t.call(this,e)||this;return r.type="opacity",r.names=["opacity"],r}return(0,Sw.__extends)(e,t),e}(ez),yz=function(t){function e(e){var r=t.call(this,e)||this;return r.names=["x","y"],r.type="position",r}return(0,Sw.__extends)(e,t),e.prototype.mapping=function(t,e){var r=this.scales,n=r[0],i=r[1];return(0,Ew.isNil)(t)||(0,Ew.isNil)(e)?[]:[(0,Ew.isArray)(t)?t.map(function(t){return n.scale(t)}):n.scale(t),(0,Ew.isArray)(e)?e.map(function(t){return i.scale(t)}):i.scale(e)]},e}(ez),vz=function(t){function e(e){var r=t.call(this,e)||this;return r.type="shape",r.names=["shape"],r}return(0,Sw.__extends)(e,t),e.prototype.getLinearValue=function(t){var e=Math.round((this.values.length-1)*t);return this.values[e]},e}(ez),gz=function(t){function e(e){var r=t.call(this,e)||this;return r.type="size",r.names=["size"],r}return(0,Sw.__extends)(e,t),e}(ez),mz={},bz=function(t){return mz[t.toLowerCase()]},xz=function(t,e){if(bz(t))throw new Error("Attribute type '".concat(t,"' existed."));mz[t.toLowerCase()]=e};xz("Color",pz),xz("Opacity",dz),xz("Position",yz),xz("Shape",vz),xz("Size",gz);var wz=function(){function t(t){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var e=t.start,r=t.end,n=t.matrix,i=void 0===n?[1,0,0,0,1,0,0,0,1]:n,o=t.isTransposed,a=void 0!==o&&o;this.start=e,this.end=r,this.matrix=i,this.originalMatrix=(0,Sw.__spreadArray)([],i),this.isTransposed=a}return t.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},t.prototype.update=function(t){(0,Ew.assign)(this,t),this.initial()},t.prototype.convertDim=function(t,e){var r,n=this[e],i=n.start,o=n.end;return this.isReflect(e)&&(i=(r=[o,i])[0],o=r[1]),i+t*(o-i)},t.prototype.invertDim=function(t,e){var r,n=this[e],i=n.start,o=n.end;return this.isReflect(e)&&(i=(r=[o,i])[0],o=r[1]),(t-i)/(o-i)},t.prototype.applyMatrix=function(t,e,r){void 0===r&&(r=0);var n=this.matrix,i=[t,e,r];return K_.transformMat3(i,i,n),i},t.prototype.invertMatrix=function(t,e,r){void 0===r&&(r=0);var n=this.matrix,i=J_.invert([0,0,0,0,0,0,0,0,0],n),o=[t,e,r];return i&&K_.transformMat3(o,o,i),o},t.prototype.convert=function(t){var e=this.convertPoint(t),r=e.x,n=e.y,i=this.applyMatrix(r,n,1);return{x:i[0],y:i[1]}},t.prototype.invert=function(t){var e=this.invertMatrix(t.x,t.y,1);return this.invertPoint({x:e[0],y:e[1]})},t.prototype.rotate=function(t){var e=this.matrix,r=this.center;return Aw.m$(e,e,[-r.x,-r.y]),Aw.zu(e,e,t),Aw.m$(e,e,[r.x,r.y]),this},t.prototype.reflect=function(t){return"x"===t?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},t.prototype.scale=function(t,e){var r=this.matrix,n=this.center;return Aw.m$(r,r,[-n.x,-n.y]),Aw.lh(r,r,[t,e]),Aw.m$(r,r,[n.x,n.y]),this},t.prototype.translate=function(t,e){var r=this.matrix;return Aw.m$(r,r,[t,e]),this},t.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},t.prototype.getCenter=function(){return this.center},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRadius=function(){return this.radius},t.prototype.isReflect=function(t){return"x"===t?this.isReflectX:this.isReflectY},t.prototype.resetMatrix=function(t){this.matrix=t||(0,Sw.__spreadArray)([],this.originalMatrix)},t}(),_z=function(t){function e(e){var r=t.call(this,e)||this;return r.isRect=!0,r.type="cartesian",r.initial(),r}return(0,Sw.__extends)(e,t),e.prototype.initial=function(){t.prototype.initial.call(this);var e=this.start,r=this.end;this.x={start:e.x,end:r.x},this.y={start:e.y,end:r.y}},e.prototype.convertPoint=function(t){var e,r=t.x,n=t.y;return this.isTransposed&&(r=(e=[n,r])[0],n=e[1]),{x:this.convertDim(r,"x"),y:this.convertDim(n,"y")}},e.prototype.invertPoint=function(t){var e,r=this.invertDim(t.x,"x"),n=this.invertDim(t.y,"y");return this.isTransposed&&(r=(e=[n,r])[0],n=e[1]),{x:r,y:n}},e}(wz),Sz=function(t){function e(e){var r=t.call(this,e)||this;r.isHelix=!0,r.type="helix";var n=e.startAngle,i=void 0===n?1.25*Math.PI:n,o=e.endAngle,a=void 0===o?7.25*Math.PI:o,s=e.innerRadius,u=void 0===s?0:s,l=e.radius;return r.startAngle=i,r.endAngle=a,r.innerRadius=u,r.radius=l,r.initial(),r}return(0,Sw.__extends)(e,t),e.prototype.initial=function(){t.prototype.initial.call(this);var e=(this.endAngle-this.startAngle)/(2*Math.PI)+1,r=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(r*=this.radius),this.d=Math.floor(r*(1-this.innerRadius)/e),this.a=this.d/(2*Math.PI),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*r,end:this.innerRadius*r+.99*this.d}},e.prototype.convertPoint=function(t){var e,r=t.x,n=t.y;this.isTransposed&&(r=(e=[n,r])[0],n=e[1]);var i=this.convertDim(r,"x"),o=this.a*i,a=this.convertDim(n,"y");return{x:this.center.x+Math.cos(i)*(o+a),y:this.center.y+Math.sin(i)*(o+a)}},e.prototype.invertPoint=function(t){var e,r=this.d+this.y.start,n=Q_.subtract([0,0],[t.x,t.y],[this.center.x,this.center.y]),i=Aw.Dg(n,[1,0],!0),o=i*this.a;Q_.length(n)this.width/n?(e=this.width/n,this.circleCenter={x:this.center.x-(.5-o)*this.width,y:this.center.y-(.5-a)*e*i}):(e=this.height/i,this.circleCenter={x:this.center.x-(.5-o)*e*n,y:this.center.y-(.5-a)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=e*this.radius:(this.radius<=0||this.radius>e)&&(this.polarRadius=e):this.polarRadius=e,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var e,r=this.getCenter(),n=t.x,i=t.y;return this.isTransposed&&(n=(e=[i,n])[0],i=e[1]),n=this.convertDim(n,"x"),i=this.convertDim(i,"y"),{x:r.x+Math.cos(n)*i,y:r.y+Math.sin(n)*i}},e.prototype.invertPoint=function(t){var e,r=this.getCenter(),n=[t.x-r.x,t.y-r.y],i=this.startAngle,o=this.endAngle;this.isReflect("x")&&(i=(e=[o,i])[0],o=e[1]);var a=[1,0,0,0,1,0,0,0,1];Aw.zu(a,a,i);var s=[1,0,0];K_.transformMat3(s,s,a);var u=[s[0],s[1]],l=Aw.Dg(u,n,o0?f:-f;var h=this.invertDim(c,"y"),p={x:0,y:0};return p.x=this.isTransposed?h:f,p.y=this.isTransposed?f:h,p},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var r=[0,Math.cos(t),Math.cos(e)],n=[0,Math.sin(t),Math.sin(e)],i=Math.min(t,e);i=0;r--)t.removeChild(e[r])}function Rz(t){var e=t.start,r=t.end,n=Math.min(e.x,r.x),i=Math.min(e.y,r.y),o=Math.max(e.x,r.x),a=Math.max(e.y,r.y);return{x:n,y:i,minX:n,minY:i,maxX:o,maxY:a,width:o-n,height:a-i}}function Dz(t,e,r,n){var i=t+r,o=e+n;return{x:t,y:e,width:r,height:n,minX:t,minY:e,maxX:isNaN(i)?0:i,maxY:isNaN(o)?0:o}}function Bz(t,e,r){return(1-r)*t+e*r}function Fz(t,e,r){return{x:t.x+Math.cos(r)*e,y:t.y+Math.sin(r)*e}}var zz=function(t,e,r){return void 0===r&&(r=Math.pow(Number.EPSILON,.5)),[t,e].includes(1/0)?Math.abs(t)===Math.abs(e):Math.abs(t-e)0?(0,Ew.each)(h,function(t){if(t.get("visible")){if(t.isGroup()&&0===t.get("children").length)return!0;var e=Uz(t),r=t.applyToMatrix([e.minX,e.minY,1]),n=t.applyToMatrix([e.minX,e.maxY,1]),i=t.applyToMatrix([e.maxX,e.minY,1]),o=t.applyToMatrix([e.maxX,e.maxY,1]),a=Math.min(r[0],n[0],i[0],o[0]),s=Math.max(r[0],n[0],i[0],o[0]),h=Math.min(r[1],n[1],i[1],o[1]),p=Math.max(r[1],n[1],i[1],o[1]);al&&(l=s),hf&&(f=p)}}):(u=0,l=0,c=0,f=0),e=Dz(u,c,l-u,f-c)}else e=t.getBBox();return s?(r=e,n=s,i=Math.max(r.minX,n.minX),o=Math.max(r.minY,n.minY),Dz(i,o,Math.min(r.maxX,n.maxX)-i,Math.min(r.maxY,n.maxY)-o)):e}function Gz(t){return t+"px"}function Vz(t,e,r,n){var i,o,a,s,u=n/(i=t,a=(o=e).x-i.x,s=o.y-i.y,Math.sqrt(a*a+s*s)),l=0;return"start"===r?l=0-u:"end"===r&&(l=1+u),{x:Bz(t.x,e.x,l),y:Bz(t.y,e.y,l)}}var Hz={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},Wz=function(t){function e(e){var r=t.call(this,e)||this;return r.initCfg(),r}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},e.prototype.clear=function(){},e.prototype.update=function(t){var e=this,r=this.get("defaultCfg")||{};(0,Ew.each)(t,function(t,n){var i=t;e.get(n)!==t&&((0,Ew.isObject)(t)&&r[n]&&(i=(0,Ew.deepMix)({},r[n],t)),e.set(n,i))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){(0,Ew.hasKey)(t,"visible")&&(t.visible?this.show():this.hide()),(0,Ew.hasKey)(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,e){this.update({offsetX:t,offsetY:e})},e.prototype.setLocation=function(t){var e=(0,Sw.__assign)({},t);this.update(e)},e.prototype.getLocation=function(){var t=this,e={},r=this.get("locationType"),n=Hz[r];return(0,Ew.each)(n,function(r){e[r]=t.get(r)}),e},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,e=this.get("defaultCfg");(0,Ew.each)(e,function(e,r){var n=t.get(r);if((0,Ew.isObject)(n)){var i=(0,Ew.deepMix)({},e,n);t.set(r,i)}})},e}(lE.Base),qz=["visible","tip","delegateObject"],Yz=["container","group","shapesMap","isRegister","isUpdating","destroyed"],Xz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear(),this.get("group").remove()},e.prototype.clear=function(){this.get("group").clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var e=this.getElementById(t);return e&&e.get("component")},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var e=this.getElementId(t);return this.getElementById(e)},e.prototype.getElementsByName=function(t){var e=[];return(0,Ew.each)(this.get("shapesMap"),function(r){r.get("name")===t&&e.push(r)}),e},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var e=this.get("group");this.updateElements(t,e),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){this.get("group").show(),this.set("visible",!0)},e.prototype.hide=function(){this.get("group").hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){this.get("group").set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),t.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),e=this.getInnerLayoutBBox(),r=t.getTotalMatrix();return r&&(e=function(t,e){var r=Mz(t,[e.minX,e.minY]),n=Mz(t,[e.maxX,e.minY]),i=Mz(t,[e.minX,e.maxY]),o=Mz(t,[e.maxX,e.maxY]),a=Math.min(r[0],n[0],i[0],o[0]),s=Math.max(r[0],n[0],i[0],o[0]),u=Math.min(r[1],n[1],i[1],o[1]),l=Math.max(r[1],n[1],i[1],o[1]);return{x:a,y:u,minX:a,minY:u,maxX:s,maxY:l,width:s-a,height:l-u}}(r,e)),e},e.prototype.on=function(t,e,r){return this.get("group").on(t,e,r),this},e.prototype.off=function(t,e){var r=this.get("group");return r&&r.off(t,e),this},e.prototype.emit=function(t,e){this.get("group").emit(t,e)},e.prototype.init=function(){t.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,e){var r=this.get("group");e.target=r,r.emit(t,e),Cz(r,t,e)},e.prototype.createOffScreenGroup=function(){return new(this.get("group").getGroupBase())({delegateObject:this.getDelegateObject()})},e.prototype.applyOffset=function(){var t=this.get("offsetX"),e=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:e})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",Uz(t)),t},e.prototype.addGroup=function(t,e){this.appendDelegateObject(t,e);var r=t.addGroup(e);return this.get("isRegister")&&this.registerElement(r),r},e.prototype.addShape=function(t,e){this.appendDelegateObject(t,e);var r=t.addShape(e);return this.get("isRegister")&&this.registerElement(r),r},e.prototype.addComponent=function(t,e){var r=e.id,n=e.component,i=(0,Sw.__rest)(e,["id","component"]),o=new n((0,Sw.__assign)((0,Sw.__assign)({},i),{id:r,container:t,updateAutoRender:this.get("updateAutoRender")}));return o.init(),o.render(),this.get("isRegister")&&this.registerElement(o.get("group")),o},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){this.get("group").off()},e.prototype.getElementId=function(t){return this.get("id")+"-"+this.get("name")+"-"+t},e.prototype.registerElement=function(t){var e=t.get("id");this.get("shapesMap")[e]=t},e.prototype.unregisterElement=function(t){var e=t.get("id");delete this.get("shapesMap")[e]},e.prototype.moveElementTo=function(t,e){var r=Pz(e);t.attr("matrix",r)},e.prototype.addAnimation=function(t,e,r){var n=e.attr("opacity");(0,Ew.isNil)(n)&&(n=1),e.attr("opacity",0),e.animate({opacity:n},r)},e.prototype.removeAnimation=function(t,e,r){e.animate({opacity:0},r)},e.prototype.updateAnimation=function(t,e,r,n){e.animate(r,n)},e.prototype.updateElements=function(t,e){var r,n=this,i=this.get("animate"),o=this.get("animateOption"),a=t.getChildren().slice(0);(0,Ew.each)(a,function(t){var a=t.get("id"),s=n.getElementById(a),u=t.get("name");if(s)if(t.get("isComponent")){var l=t.get("component"),c=s.get("component"),f=(0,Ew.pick)(l.cfg,(0,Ew.difference)((0,Ew.keys)(l.cfg),Yz));c.update(f),s.set("update_status","update")}else{var h=n.getReplaceAttrs(s,t);i&&o.update?n.updateAnimation(u,s,h,o.update):s.attr(h),t.isGroup()&&n.updateElements(t,s),(0,Ew.each)(qz,function(e){s.set(e,t.get(e))}),function(t,e){if(t.getClip()||e.getClip()){var r=e.getClip();if(r){var n={type:r.get("type"),attrs:r.attr()};t.setClip(n)}else t.setClip(null)}}(s,t),r=s,s.set("update_status","update")}else{e.add(t);var p=e.getChildren();if(p.splice(p.length-1,1),r){var d=p.indexOf(r);p.splice(d+1,0,t)}else p.unshift(t);if(n.registerElement(t),t.set("update_status","add"),t.get("isComponent"))(l=t.get("component")).set("container",e);else t.isGroup()&&n.registerNewGroup(t);if(r=t,i){var y=n.get("isInit")?o.appear:o.enter;y&&n.addAnimation(u,t,y)}}})},e.prototype.clearUpdateStatus=function(t){var e=t.getChildren();(0,Ew.each)(e,function(t){t.set("update_status",null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t;return(t={})[this.get("name")]=this,t.component=this,t},e.prototype.appendDelegateObject=function(t,e){var r=t.get("delegateObject");e.delegateObject||(e.delegateObject={}),(0,Ew.mix)(e.delegateObject,r)},e.prototype.getReplaceAttrs=function(t,e){var r=t.attr(),n=e.attr();return(0,Ew.each)(r,function(t,e){void 0===n[e]&&(n[e]=void 0)}),n},e.prototype.registerNewGroup=function(t){var e=this,r=t.getChildren();(0,Ew.each)(r,function(t){e.registerElement(t),t.set("update_status","add"),t.isGroup()&&e.registerNewGroup(t)})},e.prototype.deleteElements=function(){var t=this,e=this.get("shapesMap"),r=[];(0,Ew.each)(e,function(t,e){!t.get("update_status")||t.destroyed?r.push([e,t]):t.set("update_status",null)});var n=this.get("animate"),i=this.get("animateOption");(0,Ew.each)(r,function(r){var o=r[0],a=r[1];if(!a.destroyed){var s=a.get("name");if(n&&i.leave){var u=(0,Ew.mix)({callback:function(){t.removeElement(a)}},i.leave);t.removeAnimation(s,a,u)}else t.removeElement(a)}delete e[o]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var e=t.get("component");e&&e.destroy()}t.remove()},e}(Wz),Zz="…";function Kz(t,e){return t.charCodeAt(e)>0&&t.charCodeAt(e)<128?1:2}var Jz="…",Qz=2,$z=400;function tU(t){if(t.length>$z)return function(t){for(var e=t.map(function(t){var e=t.attr("text");return(0,Ew.isNil)(e)?"":""+e}),r=0,n=0,i=0;i=19968&&s<=40869?2:1}o>r&&(r=o,n=i)}return t[n].getBBox().width}(t);var e=0;return(0,Ew.each)(t,function(t){var r=t.getBBox().width;e=0?function(t,e,r){void 0===r&&(r="tail");var n=t.length,i="";if("tail"===r){for(var o=0,a=0;o1||n<0)&&(n=1),{x:Bz(t.x,e.x,n),y:Bz(t.y,e.y,n)}},e.prototype.renderLabel=function(t){var e=this.get("text"),r=this.get("start"),n=this.get("end"),i=e.position,o=e.content,a=e.style,s=e.offsetX,u=e.offsetY,l=e.autoRotate,c=e.maxLength,f=e.autoEllipsis,h=e.ellipsisPosition,p=e.background,d=e.isVertical,y=void 0!==d&&d,v=this.getLabelPoint(r,n,i),g=v.x+s,m=v.y+u,b={id:this.getElementId("line-text"),name:"annotation-line-text",x:g,y:m,content:o,style:a,maxLength:c,autoEllipsis:f,ellipsisPosition:h,background:p,isVertical:y};if(l){var x=[n.x-r.x,n.y-r.y];b.rotate=Math.atan2(x[1],x[0])}rU(t,b)},e}(Xz),oU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:nU.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:nU.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var e=this.getLocation(),r=e.x,n=e.y,i=this.get("content"),o=this.get("style");rU(t,{id:this.getElementId("text"),name:this.get("name")+"-text",x:r,y:n,content:i,style:o,maxLength:this.get("maxLength"),autoEllipsis:this.get("autoEllipsis"),isVertical:this.get("isVertical"),ellipsisPosition:this.get("ellipsisPosition"),background:this.get("background"),rotate:this.get("rotate")})},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var e=this.getLocation(),r=e.x,n=e.y,i=this.get("rotate");Lz(t,r,n),Iz(t,i,r,n)}},e}(Xz),aU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),e=t.center,r=t.radius,n=t.startAngle,i=t.endAngle,o=Fz(e,r,n),a=Fz(e,r,i),s=i-n>Math.PI?1:0,u=[["M",o.x,o.y]];if(i-n==2*Math.PI){var l=Fz(e,r,n+Math.PI);u.push(["A",r,r,0,s,1,l.x,l.y]),u.push(["A",r,r,0,s,1,a.x,a.y])}else u.push(["A",r,r,0,s,1,a.x,a.y]);return u},e.prototype.renderArc=function(t){var e=this.getArcPath(),r=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:(0,Sw.__assign)({path:e},r)})},e}(Xz),sU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:nU.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var e=this.get("start"),r=this.get("end"),n=this.get("style"),i=Rz({start:e,end:r});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:(0,Sw.__assign)({x:i.x,y:i.y,width:i.width,height:i.height},n)})},e}(Xz),uU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),e=this.get("end"),r=this.get("style"),n=Rz({start:t,end:e}),i=this.get("src");return(0,Sw.__assign)({x:n.x,y:n.y,img:i,width:n.width,height:n.height},r)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(Xz),lU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:nU.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:nU.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:nU.fontFamily}}}})},e.prototype.renderInner=function(t){(0,Ew.get)(this.get("line"),"display")&&this.renderLine(t),(0,Ew.get)(this.get("text"),"display")&&this.renderText(t),(0,Ew.get)(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var e=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:e})},e.prototype.renderLine=function(t){var e=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:e})},e.prototype.renderText=function(t){var e=this.getShapeAttrs().text,r=e.x,n=e.y,i=e.text,o=(0,Sw.__rest)(e,["x","y","text"]),a=this.get("text"),s=a.background,u=a.maxLength,l=a.autoEllipsis,c=a.isVertival,f=a.ellipsisPosition;rU(t,{x:r,y:n,id:this.getElementId("text"),name:"annotation-text",content:i,style:o,background:s,maxLength:u,autoEllipsis:l,isVertival:c,ellipsisPosition:f})},e.prototype.autoAdjust=function(t){var e=this.get("direction"),r=this.get("x"),n=this.get("y"),i=(0,Ew.get)(this.get("line"),"length",0),o=this.get("coordinateBBox"),a=t.getBBox(),s=a.minX,u=a.maxX,l=a.minY,c=a.maxY,f=t.findById(this.getElementId("text-group")),h=t.findById(this.getElementId("text")),p=t.findById(this.getElementId("line"));if(o&&f){var d=f.attr("x"),y=f.attr("y"),v=h.getCanvasBBox(),g=v.width,m=v.height,b=0,x=0;if(r+s<=o.minX)if("leftward"===e)b=1;else{var w=o.minX-(r+s);d=f.attr("x")+w}else if(r+u>=o.maxX)if("rightward"===e)b=-1;else{w=r+u-o.maxX;d=f.attr("x")-w}if(b&&(p&&p.attr("path",[["M",0,0],["L",i*b,0]]),d=(i+2+g)*b),n+l<=o.minY)if("upward"===e)x=1;else{w=o.minY-(n+l);y=f.attr("y")+w}else if(n+c>=o.maxY)if("downward"===e)x=-1;else{w=n+c-o.maxY;y=f.attr("y")-w}x&&(p&&p.attr("path",[["M",0,0],["L",0,i*x]]),y=(i+2+m)*x),d===f.attr("x")&&y===f.attr("y")||Lz(f,d,y)}},e.prototype.getShapeAttrs=function(){var t=(0,Ew.get)(this.get("line"),"display"),e=(0,Ew.get)(this.get("point"),"style",{}),r=(0,Ew.get)(this.get("line"),"style",{}),n=(0,Ew.get)(this.get("text"),"style",{}),i=this.get("direction"),o=t?(0,Ew.get)(this.get("line"),"length",0):0,a=0,s=0,u="top",l="start";switch(i){case"upward":s=-1,u="bottom";break;case"downward":s=1,u="top";break;case"leftward":a=-1,l="end";break;case"rightward":a=1,l="start"}return{point:(0,Sw.__assign)({x:0,y:0},e),line:(0,Sw.__assign)({path:[["M",0,0],["L",o*a,o*s]]},r),text:(0,Sw.__assign)({x:(o+2)*a,y:(o+2)*s,text:(0,Ew.get)(this.get("text"),"content",""),textBaseline:u,textAlign:l},n)}},e}(Xz),cU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:nU.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:nU.textColor,fontFamily:nU.fontFamily}}}})},e.prototype.renderInner=function(t){var e=(0,Ew.get)(this.get("region"),"style",{}),r=((0,Ew.get)(this.get("text"),"style",{}),this.get("lineLength")||0),n=this.get("points");if(n.length){var i=function(t){var e=t.map(function(t){return t.x}),r=t.map(function(t){return t.y}),n=Math.min.apply(Math,e),i=Math.min.apply(Math,r),o=Math.max.apply(Math,e),a=Math.max.apply(Math,r);return{x:n,y:i,minX:n,minY:i,maxX:o,maxY:a,width:o-n,height:a-i}}(n),o=[];o.push(["M",n[0].x,i.minY-r]),n.forEach(function(t){o.push(["L",t.x,t.y])}),o.push(["L",n[n.length-1].x,n[n.length-1].y-r]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:(0,Sw.__assign)({path:o},e)}),rU(t,(0,Sw.__assign)({id:this.getElementId("text"),name:"annotation-text",x:(i.minX+i.maxX)/2,y:i.minY-r},this.get("text")))}},e}(Xz),fU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var e=this,r=this.get("start"),n=this.get("end"),i=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});(0,Ew.each)(this.get("shapes"),function(t,r){var n=t.get("type"),o=(0,Ew.clone)(t.attr());e.adjustShapeAttrs(o),e.addShape(i,{id:e.getElementId("shape-"+n+"-"+r),capture:!1,type:n,attrs:o})});var o=Rz({start:r,end:n});i.setClip({type:"rect",attrs:{x:o.minX,y:o.minY,width:o.width,height:o.height}})},e.prototype.adjustShapeAttrs=function(t){var e=this.get("color");t.fill&&(t.fill=t.fillStyle=e),t.stroke=t.strokeStyle=e},e}(Xz),hU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"shape",draw:Ew.noop})},e.prototype.renderInner=function(t){var e=this.get("render");(0,Ew.isFunction)(e)&&e(t)},e}(Xz);function pU(t,e,r){var n;try{n=window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.style[e]}catch(t){}finally{n=void 0===n?r:n}return n}function dU(t,e){var r=function(t,e){var r=pU(t,"width",e);return"auto"===r&&(r=t.offsetWidth),parseFloat(r)}(t,e),n=parseFloat(pU(t,"borderLeftWidth"))||0,i=parseFloat(pU(t,"paddingLeft"))||0,o=parseFloat(pU(t,"paddingRight"))||0,a=parseFloat(pU(t,"borderRightWidth"))||0,s=parseFloat(pU(t,"marginRight"))||0;return r+n+a+i+o+(parseFloat(pU(t,"marginLeft"))||0)+s}function yU(t,e){var r=function(t,e){var r=pU(t,"height",e);return"auto"===r&&(r=t.offsetHeight),parseFloat(r)}(t,e),n=parseFloat(pU(t,"borderTopWidth"))||0,i=parseFloat(pU(t,"paddingTop"))||0,o=parseFloat(pU(t,"paddingBottom"))||0;return r+n+(parseFloat(pU(t,"borderBottomWidth"))||0)+i+o+(parseFloat(pU(t,"marginTop"))||0)+(parseFloat(pU(t,"marginBottom"))||0)}var vU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{container:null,containerTpl:"
    ",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){this.get("container").style.display="",this.set("visible",!0)},e.prototype.hide=function(){this.get("container").style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var e=this.getContainer(),r=t?"auto":"none";e.style.pointerEvents=r,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer();return Dz(parseFloat(t.style.left)||0,parseFloat(t.style.top)||0,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){Nz(this.get("container"))},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),t.prototype.destroy.call(this)},e.prototype.init=function(){t.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if((0,Ew.isNil)(t)){t=this.createDom();var e=this.get("parent");(0,Ew.isString)(e)&&(e=document.getElementById(e),this.set("parent",e)),e.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else(0,Ew.isString)(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),e=this.get("defaultStyles");t=t?(0,Ew.deepMix)({},e,t):e,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(t){var e=this.getContainer();this.applyChildrenStyles(e,t);var r,n=this.get("containerClassName");if(n&&(r=n,e.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))))BA(e,t[n])}},e.prototype.applyChildrenStyles=function(t,e){(0,Ew.each)(e,function(e,r){var n=t.getElementsByClassName(r);(0,Ew.each)(n,function(t){BA(t,e)})})},e.prototype.applyStyle=function(t,e){BA(e,this.get("domStyles")[t])},e.prototype.createDom=function(){return UC(this.get("containerTpl"))},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){(0,Ew.hasKey)(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(Wz),gU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
    ',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),e=this.get("html");Nz(t);var r=(0,Ew.isFunction)(e)?e(t):e;if((0,Ew.isElement)(r))t.appendChild(r);else if((0,Ew.isString)(r)||(0,Ew.isNumber)(r)){var n=UC(""+r);n&&t.appendChild(n)}this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),e=this.getLocation(),r=e.x,n=e.y,i=this.get("alignX"),o=this.get("alignY"),a=this.get("offsetX"),s=this.get("offsetY"),u=dU(t),l=yU(t),c={x:r,y:n};"middle"===i?c.x-=Math.round(u/2):"right"===i&&(c.x-=Math.round(u)),"middle"===o?c.y-=Math.round(l/2):"bottom"===o&&(c.y-=Math.round(l)),a&&(c.x+=a),s&&(c.y+=s),BA(t,{position:"absolute",left:c.x+"px",top:c.y+"px",zIndex:this.get("zIndex")})},e}(vU);function mU(t,e,r){var n=e+"Style",i=null;return(0,Ew.each)(r,function(e,r){t[r]&&e[n]&&(i||(i={}),(0,Ew.mix)(i,e[n]))}),i}var bU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:nU.lineColor}},tickLine:{style:{lineWidth:1,stroke:nU.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:nU.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:nU.textColor,fontFamily:nU.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:nU.textColor,textBaseline:"middle",fontFamily:nU.fontFamily,textAlign:"center"},iconStyle:{fill:nU.descriptionIconFill,stroke:nU.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:nU.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,e){(0,Ew.mix)(t,e),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,e,r){t[e]=r,this.updateTickStates(t)},e.prototype.hasState=function(t,e){return!!t[e]},e.prototype.getItemStates=function(t){var e=this.get("tickStates"),r=[];return(0,Ew.each)(e,function(e,n){t[n]&&r.push(n)}),r},e.prototype.clearItemsState=function(t){var e=this,r=this.getItemsByState(t);(0,Ew.each)(r,function(r){e.setItemState(r,t,!1)})},e.prototype.getItemsByState=function(t){var e=this,r=this.getItems();return(0,Ew.filter)(r,function(r){return e.hasState(r,t)})},e.prototype.getSidePoint=function(t,e){var r=this.getSideVector(e,t);return{x:t.x+r[0],y:t.y+r[1]}},e.prototype.getTextAnchor=function(t){var e;return(0,Ew.isNumberEqual)(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e},e.prototype.getTextBaseline=function(t){var e;return(0,Ew.isNumberEqual)(t[1],0)?e="middle":t[1]>0?e="top":t[1]<0&&(e="bottom"),e},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var e=this.getLinePath(),r=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:(0,Ew.mix)({path:e},r.style)})},e.prototype.getTickLineItems=function(t){var e=this,r=[],n=this.get("tickLine"),i=n.alignTick,o=n.length,a=1;return t.length>=2&&(a=t[1].value-t[0].value),(0,Ew.each)(t,function(t){var n=t.point;i||(n=e.getTickPoint(t.value-a/2));var s=e.getSidePoint(n,o);r.push({startPoint:n,tickValue:t.value,endPoint:s,tickId:t.id,id:"tickline-"+t.id})}),r},e.prototype.getSubTickLineItems=function(t){var e=[],r=this.get("subTickLine"),n=r.count,i=t.length;if(i>=2)for(var o=0;o0){var r=(0,Ew.size)(e);if(r>t.threshold){var n=Math.ceil(r/t.threshold),i=e.filter(function(t,e){return e%n==0});this.set("ticks",i),this.set("originalTicks",e)}}},e.prototype.getLabelAttrs=function(t,e,r){var n=this.get("label"),i=n.offset,o=n.offsetX,a=n.offsetY,s=n.rotate,u=n.formatter,l=this.getSidePoint(t.point,i),c=this.getSideVector(i,l),f=u?u(t.name,t,e):t.name,h=n.style;h=(0,Ew.isFunction)(h)?(0,Ew.get)(this.get("theme"),["label","style"],{}):h;var p=(0,Ew.mix)({x:l.x+o,y:l.y+a,text:f,textAlign:this.getTextAnchor(c),textBaseline:this.getTextBaseline(c)},h);return s&&(p.matrix=Az(l,s)),p},e.prototype.drawLabels=function(t){var e=this,r=this.get("ticks"),n=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});(0,Ew.each)(r,function(t,i){e.addShape(n,{type:"text",name:"axis-label",id:e.getElementId("label-"+t.id),attrs:e.getLabelAttrs(t,i,r),delegateObject:{tick:t,item:t,index:i}})}),this.processOverlap(n);var i=n.getChildren(),o=(0,Ew.get)(this.get("theme"),["label","style"],{}),a=this.get("label"),s=a.style,u=a.formatter;if((0,Ew.isFunction)(s)){var l=i.map(function(t){return(0,Ew.get)(t.get("delegateObject"),"tick")});(0,Ew.each)(i,function(t,e){var r=t.get("delegateObject").tick,n=u?u(r.name,r,e):r.name,i=(0,Ew.mix)({},o,s(n,e,l));t.attr(i)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),e=t.style,r=t.position,n=t.offset,i=t.spacing,o=void 0===i?0:i,a=t.autoRotate,s=e.fontSize,u=.5;"start"===r?u=0:"end"===r&&(u=1);var l=this.getTickPoint(u),c=this.getSidePoint(l,n||o+s/2),f=(0,Ew.mix)({x:c.x,y:c.y,text:t.text},e),h=t.rotate,p=h;if((0,Ew.isNil)(h)&&a){var d=this.getAxisVector(l);p=Aw.Dg(d,[1,0],!0)}if(p){var y=Az(c,p);f.matrix=y}return f},e.prototype.drawTitle=function(t){var e,r=this.getTitleAttrs(),n=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:r});(null===(e=this.get("title"))||void 0===e?void 0:e.description)&&this.drawDescriptionIcon(t,n,r.matrix)},e.prototype.drawDescriptionIcon=function(t,e,r){var n=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),i=e.getBBox(),o=i.maxX,a=i.maxY,s=i.height,u=this.get("title").iconStyle,l=s/2,c=l/6,f=o+4,h=a-s/2,p=[f+l,h-l],d=p[0],y=p[1],v=[d+l,y+l],g=v[0],m=v[1],b=[d,m+l],x=b[0],w=b[1],_=[f,y+l],S=_[0],E=_[1],k=[f+l,h-s/4],T=k[0],C=k[1],O=[T,C+c],A=O[0],P=O[1],M=[A,P+c],I=M[0],L=M[1],j=[I,L+3*l/4],N=j[0],R=j[1];this.addShape(n,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:(0,Sw.__assign)({path:[["M",d,y],["A",l,l,0,0,1,g,m],["A",l,l,0,0,1,x,w],["A",l,l,0,0,1,S,E],["A",l,l,0,0,1,d,y],["M",T,C],["L",A,P],["M",I,L],["L",N,R]],lineWidth:c,matrix:r},u)}),this.addShape(n,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:f,y:h-s/2,width:s,height:s,stroke:"#000",fill:"#000",opacity:0,matrix:r,cursor:"pointer"}})},e.prototype.applyTickStates=function(t,e){if(this.getItemStates(t).length){var r=this.get("tickStates"),n=this.getElementId("label-"+t.id),i=e.findById(n);if(i){var o=mU(t,"label",r);o&&i.attr(o)}var a=this.getElementId("tickline-"+t.id),s=e.findById(a);if(s){var u=mU(t,"tickLine",r);u&&s.attr(u)}}},e.prototype.updateTickStates=function(t){var e=this.getItemStates(t),r=this.get("tickStates"),n=this.get("label"),i=this.getElementByLocalId("label-"+t.id),o=this.get("tickLine"),a=this.getElementByLocalId("tickline-"+t.id);if(e.length){if(i){var s=mU(t,"label",r);s&&i.attr(s)}if(a){var u=mU(t,"tickLine",r);u&&a.attr(u)}}else i&&i.attr(n.style),a&&a.attr(o.style)},e}(Xz);function xU(t,e,r,n){var i=e.getChildren(),o=!1;return(0,Ew.each)(i,function(e){var i=eU(t,e,r,n);o=o||i}),o}function wU(){return SU}function _U(t,e,r){return xU(t,e,r,"head")}function SU(t,e,r){return xU(t,e,r,"tail")}function EU(t,e,r){return xU(t,e,r,"middle")}function kU(t){var e,r;return(function(t){var e=t.attr("matrix");return e&&1!==e[0]}(t)?(e=t.attr("matrix"),r=[0,0,0],K_.transformMat3(r,[1,0,0],e),Math.atan2(r[1],r[0])):0)%360}function TU(t,e,r,n){var i=!1,o=kU(e),a=t?Math.abs(r.attr("y")-e.attr("y")):Math.abs(r.attr("x")-e.attr("x")),s=(t?r.attr("y")>e.attr("y"):r.attr("x")>e.attr("x"))?e.getBBox():r.getBBox();if(t){var u=Math.abs(Math.cos(o));i=zz(u,0,Math.PI/180)?s.width+n>a:s.height/u+n>a}else{u=Math.abs(Math.sin(o));i=zz(u,0,Math.PI/180)?s.width+n>a:s.height/u+n>a}return i}function CU(t,e,r,n){var i=(null===n||void 0===n?void 0:n.minGap)||0,o=e.getChildren().slice().filter(function(t){return t.get("visible")});if(!o.length)return!1;var a=!1;r&&o.reverse();for(var s=o.length,u=o[0],l=1;l1){h=Math.ceil(h);for(var d=0;d2){var a=i[0],s=i[i.length-1];a.get("visible")||(a.show(),CU(t,e,!1,n)&&(o=!0)),s.get("visible")||(s.show(),CU(t,e,!0,n)&&(o=!0))}return o}function NU(t,e,r,n){var i=e.getChildren();if(!i.length)return!1;if(!t&&i.length<2)return!1;var o=tU(i),a=!1;t?a=!!r&&o>r:a=o>Math.abs(i[1].attr("x")-i[0].attr("x"));a&&function(t,e){(0,Ew.each)(t,function(t){var r=Az({x:t.attr("x"),y:t.attr("y")},e);t.attr("matrix",r)})}(i,n(r,o));return a}function RU(){return DU}function DU(t,e,r,n){return NU(t,e,r,function(){return(0,Ew.isNumber)(n)?n:t?nU.verticalAxisRotate:nU.horizontalAxisRotate})}function BU(t,e,r){return NU(t,e,r,function(e,r){if(!e)return t?nU.verticalAxisRotate:nU.horizontalAxisRotate;if(t)return-Math.acos(e/r);var n=0;return e>r?n=Math.PI/4:(n=Math.asin(e/r))>Math.PI/4&&(n=Math.PI/4),n})}var FU,zU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),e=this.get("end"),r=[];return r.push(["M",t.x,t.y]),r.push(["L",e.x,e.y]),r},e.prototype.getInnerLayoutBBox=function(){var e=this.get("start"),r=this.get("end"),n=t.prototype.getInnerLayoutBBox.call(this),i=Math.min(e.x,r.x,n.x),o=Math.min(e.y,r.y,n.y),a=Math.max(e.x,r.x,n.maxX),s=Math.max(e.y,r.y,n.maxY);return{x:i,y:o,minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}},e.prototype.isVertical=function(){var t=this.get("start"),e=this.get("end");return(0,Ew.isNumberEqual)(t.x,e.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),e=this.get("end");return(0,Ew.isNumberEqual)(t.y,e.y)},e.prototype.getTickPoint=function(t){var e=this.get("start"),r=this.get("end"),n=r.x-e.x,i=r.y-e.y;return{x:e.x+n*t,y:e.y+i*t}},e.prototype.getSideVector=function(t){var e=this.getAxisVector(),r=Q_.normalize([0,0],e),n=this.get("verticalFactor"),i=[r[1],-1*r[0]];return Q_.scale([0,0],i,t*n)},e.prototype.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},e.prototype.processOverlap=function(t){var e=this,r=this.isVertical(),n=this.isHorizontal();if(r||n){var i=this.get("label"),o=this.get("title"),a=this.get("verticalLimitLength"),s=i.offset,u=a,l=0,c=0;o&&(l=o.style.fontSize,c=o.spacing),u&&(u=u-s-c-l);var f=this.get("overlapOrder");if((0,Ew.each)(f,function(r){i[r]&&e.canProcessOverlap(r)&&e.autoProcessOverlap(r,i[r],t,u)}),o&&(0,Ew.isNil)(o.offset)){var h=t.getCanvasBBox(),p=r?h.width:h.height;o.offset=s+p+c+l/2}}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||(0,Ew.isNil)(e.rotate)},e.prototype.autoProcessOverlap=function(t,e,r,n){var i=this,o=this.isVertical(),a=!1,s=S[t];if(!0===e){this.get("label");a=s.getDefault()(o,r,n)}else if((0,Ew.isFunction)(e))a=e(o,r,n);else if((0,Ew.isObject)(e)){var u=e;s[u.type]&&(a=s[u.type](o,r,n,u.cfg))}else s[e]&&(a=s[e](o,r,n));if("autoRotate"===t){if(a){var l=r.getChildren(),c=this.get("verticalFactor");(0,Ew.each)(l,function(t){if("center"===t.attr("textAlign")){var e=c>0?"end":"start";t.attr("textAlign",e)}})}}else if("autoHide"===t){var f=r.getChildren().slice(0);(0,Ew.each)(f,function(t){t.get("visible")||(i.get("isRegister")&&i.unregisterElement(t),t.remove())})}},e}(bU),UU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getLinePath=function(){var t=this.get("center"),e=t.x,r=t.y,n=this.get("radius"),i=n,o=this.get("startAngle"),a=this.get("endAngle"),s=[];if(Math.abs(a-o)===2*Math.PI)s=[["M",e,r-i],["A",n,i,0,1,1,e,r+i],["A",n,i,0,1,1,e,r-i],["Z"]];else{var u=this.getCirclePoint(o),l=this.getCirclePoint(a),c=Math.abs(a-o)>Math.PI?1:0,f=o>a?0:1;s=[["M",e,r],["L",u.x,u.y],["A",n,i,0,c,f,l.x,l.y],["L",e,r]]}return s},e.prototype.getTickPoint=function(t){var e=this.get("startAngle"),r=e+(this.get("endAngle")-e)*t;return this.getCirclePoint(r)},e.prototype.getSideVector=function(t,e){var r=this.get("center"),n=[e.x-r.x,e.y-r.y],i=this.get("verticalFactor"),o=Q_.length(n);return Q_.scale(n,n,i*t/o),n},e.prototype.getAxisVector=function(t){var e=this.get("center"),r=[t.x-e.x,t.y-e.y];return[r[1],-1*r[0]]},e.prototype.getCirclePoint=function(t,e){var r=this.get("center");return e=e||this.get("radius"),{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||(0,Ew.isNil)(e.rotate)},e.prototype.processOverlap=function(t){var e=this,r=this.get("label"),n=this.get("title"),i=this.get("verticalLimitLength"),o=r.offset,a=i,s=0,u=0;n&&(s=n.style.fontSize,u=n.spacing),a&&(a=a-o-u-s);var l=this.get("overlapOrder");if((0,Ew.each)(l,function(n){r[n]&&e.canProcessOverlap(n)&&e.autoProcessOverlap(n,r[n],t,a)}),n&&(0,Ew.isNil)(n.offset)){var c=t.getCanvasBBox().height;n.offset=o+c+u+s/2}},e.prototype.autoProcessOverlap=function(t,e,r,n){var i=this,o=!1,a=S[t];if(n>0)if(!0===e)o=a.getDefault()(!1,r,n);else if((0,Ew.isFunction)(e))o=e(!1,r,n);else if((0,Ew.isObject)(e)){var s=e;a[s.type]&&(o=a[s.type](!1,r,n,s.cfg))}else a[e]&&(o=a[e](!1,r,n));if("autoRotate"===t){if(o){var u=r.getChildren(),l=this.get("verticalFactor");(0,Ew.each)(u,function(t){if("center"===t.attr("textAlign")){var e=l>0?"end":"start";t.attr("textAlign",e)}})}}else if("autoHide"===t){var c=r.getChildren().slice(0);(0,Ew.each)(c,function(t){t.get("visible")||(i.get("isRegister")&&i.unregisterElement(t),t.remove())})}},e}(bU),GU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:nU.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:nU.textColor,textAlign:"center",textBaseline:"middle",fontFamily:nU.fontFamily}},textBackground:{padding:5,style:{stroke:nU.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var e=this.get("text"),r=e.style,n=e.autoRotate,i=e.content;if(!(0,Ew.isNil)(i)){var o=this.getTextPoint(),a=null;if(n)a=Az(o,this.getRotateAngle());this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},o),{text:i,matrix:a}),r)})}},e.prototype.renderLine=function(t){var e=this.getLinePath(),r=this.get("line").style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:(0,Sw.__assign)({path:e},r)})},e.prototype.renderBackground=function(t){var e=this.getElementId("text"),r=t.findById(e),n=this.get("textBackground");if(n&&r){var i=r.getBBox(),o=jz(n.padding),a=n.style;this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:(0,Sw.__assign)({x:i.x-o[3],y:i.y-o[0],width:i.width+o[1]+o[3],height:i.height+o[0]+o[2],matrix:r.attr("matrix")},a)}).toBack()}},e}(Xz),VU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text").position,i=Math.atan2(r.y-e.y,r.x-e.x);return"start"===n?i-Math.PI/2:i+Math.PI/2},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text");return Vz(e,r,n.position,n.offset)},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.start,r=t.end;return[["M",e.x,e.y],["L",r.x,r.y]]},e}(GU),HU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.startAngle,r=t.endAngle;return"start"===this.get("text").position?e+Math.PI/2:r-Math.PI/2},e.prototype.getTextPoint=function(){var t=this.get("text"),e=t.position,r=t.offset,n=this.getLocation(),i=n.center,o=n.radius,a=n.startAngle,s=n.endAngle,u="start"===e?a:s,l=this.getRotateAngle()-Math.PI,c=Fz(i,o,u),f=Math.cos(l)*r,h=Math.sin(l)*r;return{x:c.x+f,y:c.y+h}},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.center,r=t.radius,n=t.startAngle,i=t.endAngle,o=null;if(i-n==2*Math.PI){var a=e.x,s=e.y;o=[["M",a,s-r],["A",r,r,0,1,1,a,s+r],["A",r,r,0,1,1,a,s-r],["Z"]]}else{var u=Fz(e,r,n),l=Fz(e,r,i),c=Math.abs(i-n)>Math.PI?1:0,f=n>i?0:1;o=[["M",u.x,u.y],["A",r,r,0,c,f,l.x,l.y]]}return o},e}(GU),WU=((FU={})["g2-crosshair"]={position:"relative"},FU["g2-crosshair-line"]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},FU["g2-crosshair-text"]={position:"absolute",color:nU.textColor,fontFamily:nU.fontFamily},FU),qU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
    ',crosshairTpl:'
    ',textTpl:'{content}',domStyles:null,containerClassName:"g2-crosshair",defaultStyles:WU,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),e=UC(this.get("crosshairTpl"));t.appendChild(e),this.applyStyle("g2-crosshair-line",e),this.set("crosshairEl",e)},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text");return Vz(e,r,n.position,n.offset)},e.prototype.resetText=function(){var t=this.get("text"),e=this.get("textEl");if(t){var r=t.content;if(!e){var n=this.getContainer();e=UC((0,Ew.substitute)(this.get("textTpl"),t)),n.appendChild(e),this.applyStyle("g2-crosshair-text",e),this.set("textEl",e)}e.innerHTML=r}else e&&e.remove()},e.prototype.isVertical=function(t,e){return t.x===e.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var e=this.get("start"),r=this.get("end"),n=Math.min(e.x,r.x),i=Math.min(e.y,r.y);this.isVertical(e,r)?BA(t,{width:"1px",height:Gz(Math.abs(r.y-e.y))}):BA(t,{height:"1px",width:Gz(Math.abs(r.x-e.x))}),BA(t,{top:Gz(i),left:Gz(n)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var e=this.get("text").align,r=t.clientWidth,n=this.getTextPoint();switch(e){case"center":n.x=n.x-r/2;break;case"right":n.x=n.x-r}BA(t,{top:Gz(n.y),left:Gz(n.x)})}},e.prototype.updateInner=function(e){(0,Ew.hasKey)(e,"text")&&this.resetText(),t.prototype.updateInner.call(this,e)},e}(vU),YU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:nU.lineColor}}}})},e.prototype.getLineType=function(){return(this.get("line")||this.get("defaultCfg").line).type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,e){var r=this.getGridPath(t),n=e.slice(0).reverse(),i=this.getGridPath(n,!0);return this.get("closed")?r=r.concat(i):(i[0][0]="L",(r=r.concat(i)).push(["Z"])),r},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var e=this,r=this.get("line"),n=this.get("items"),i=this.get("alternateColor"),o=null;(0,Ew.each)(n,function(a,s){var u=a.id||s;if(r){var l=e.getPathStyle();l=(0,Ew.isFunction)(l)?l(a,s,n):l;var c=e.getElementId("line-"+u),f=e.getGridPath(a.points);e.addShape(t,{type:"path",name:"grid-line",id:c,attrs:(0,Ew.mix)({path:f},l)})}if(i&&s>0){var h=e.getElementId("region-"+u),p=s%2==0;if((0,Ew.isString)(i))p&&e.drawAlternateRegion(h,t,o.points,a.points,i);else{var d=p?i[1]:i[0];e.drawAlternateRegion(h,t,o.points,a.points,d)}}o=a})},e.prototype.drawAlternateRegion=function(t,e,r,n,i){var o=this.getAlternatePath(r,n);this.addShape(e,{type:"path",id:t,name:"grid-region",attrs:{path:o,fill:i}})},e}(Xz);var XU,ZU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,e){var r,n,i,o,a,s,u=this.getLineType(),l=this.get("closed"),c=[];if(t.length)if("circle"===u){var f=this.get("center"),h=t[0],p=(r=f.x,n=f.y,i=h.x,o=h.y,a=i-r,s=o-n,Math.sqrt(a*a+s*s)),d=e?0:1;l?(c.push(["M",f.x,f.y-p]),c.push(["A",p,p,0,0,d,f.x,f.y+p]),c.push(["A",p,p,0,0,d,f.x,f.y-p]),c.push(["Z"])):(0,Ew.each)(t,function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["A",p,p,0,0,d,t.x,t.y])})}else(0,Ew.each)(t,function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["L",t.x,t.y])}),l&&c.push(["Z"]);return c},e}(YU),KU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"line"})},e.prototype.getGridPath=function(t){var e=[];return(0,Ew.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e},e}(YU),JU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var e=t.prototype.getLayoutBBox.call(this),r=this.get("maxWidth"),n=this.get("maxHeight"),i=e.width,o=e.height;return r&&(i=Math.min(i,r)),n&&(o=Math.min(o,n)),Dz(e.minX,e.minY,i,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),e=this.get("y"),r=this.get("offsetX"),n=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+r,y:e+n})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var e=this.get("background"),r=t.getBBox(),n=jz(e.padding),i=(0,Sw.__assign)({x:0,y:0,width:r.width+n[1]+n[3],height:r.height+n[0]+n[2]},e.style);this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:i}).toBack()},e.prototype.drawTitle=function(t){var e=this.get("currentPoint"),r=this.get("title"),n=r.spacing,i=r.style,o=r.text,a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:(0,Sw.__assign)({text:o,x:e.x,y:e.y},i)}).getBBox();this.set("currentPoint",{x:e.x,y:a.maxY+n})},e.prototype.resetDraw=function(){var t=this.get("background"),e={x:0,y:0};if(t){var r=jz(t.padding);e.x=r[3],e.y=r[0]}this.set("currentPoint",e)},e}(Xz),QU={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},$U={fill:nU.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:nU.fontFamily,fontWeight:"normal",lineHeight:12},tG={right:90*Math.PI/180,left:270*Math.PI/180,up:0,down:180*Math.PI/180},eG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.currentPageIndex=1,e.totalPagesCnt=1,e.pageWidth=0,e.pageHeight=0,e.startX=0,e.startY=0,e.onNavigationBack=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndex>1){e.currentPageIndex-=1,e.updateNavigation();var r=e.getCurrentNavigationMatrix();e.get("animate")?t.animate({matrix:r},100):t.attr({matrix:r})}},e.onNavigationAfter=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndexd&&(d=m),"horizontal"===f?(y&&ys}(t,y))&&(1===v&&(g=y.x+c,r.moveElementTo(p,{x:S,y:y.y+f/2-d.height/2-d.minY})),v+=1,y.x=n,y.y+=_),r.moveElementTo(t,y),t.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:i+c,height:f}}),y.x+=i+c})}else{(0,Ew.each)(a,function(t){var e=t.getBBox();e.width>m&&(m=e.width)}),b=m,m+=c,s&&(m=Math.min(s,m),b=Math.min(s,b)),this.pageWidth=m,this.pageHeight=u-Math.max(d.height,f+x);var E=Math.floor(this.pageHeight/(f+x));(0,Ew.each)(a,function(t,e){0!==e&&e%E==0&&(v+=1,y.x+=m,y.y=i),r.moveElementTo(t,y),t.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:m,height:f}}),y.y+=f+x}),this.totalPagesCnt=v,this.moveElementTo(p,{x:n+b/2-d.width/2-d.minX,y:u-d.height-d.minY})}this.pageHeight&&this.pageWidth&&e.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),"horizontal"===o&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(v/this.get("maxRow")):this.totalPagesCnt=v,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(p),e.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,e,r,n){var i={x:0,y:0},o=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),a=(0,Ew.get)(n.marker,"style",{}),s=a.size,u=void 0===s?12:s,l=(0,Sw.__rest)(a,["size"]),c=this.drawArrow(o,i,"navigation-arrow-left","horizontal"===e?"up":"left",u,l);c.on("click",this.onNavigationBack);var f=c.getBBox();i.x+=f.width+2;var h=this.addShape(o,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:(0,Sw.__assign)({x:i.x,y:i.y+u/2,text:r,textBaseline:"middle"},(0,Ew.get)(n.text,"style"))}).getBBox();return i.x+=h.width+2,this.drawArrow(o,i,"navigation-arrow-right","horizontal"===e?"down":"right",u,l).on("click",this.onNavigationAfter),o},e.prototype.updateNavigation=function(t){var e=(0,Ew.deepMix)({},QU,this.get("pageNavigator")).marker.style,r=e.fill,n=e.opacity,i=e.inactiveFill,o=e.inactiveOpacity,a=this.currentPageIndex+"/"+this.totalPagesCnt,s=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),u=t?t.findById(this.getElementId("navigation-arrow-left")):this.getElementByLocalId("navigation-arrow-left"),l=t?t.findById(this.getElementId("navigation-arrow-right")):this.getElementByLocalId("navigation-arrow-right");s.attr("text",a),u.attr("opacity",1===this.currentPageIndex?o:n),u.attr("fill",1===this.currentPageIndex?i:r),u.attr("cursor",1===this.currentPageIndex?"not-allowed":"pointer"),l.attr("opacity",this.currentPageIndex===this.totalPagesCnt?o:n),l.attr("fill",this.currentPageIndex===this.totalPagesCnt?i:r),l.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var c=u.getBBox().maxX+2;s.attr("x",c),c+=s.getBBox().width+2,this.updateArrowPath(l,{x:c,y:0})},e.prototype.drawArrow=function(t,e,r,n,i,o){var a=e.x,s=e.y,u=this.addShape(t,{type:"path",id:this.getElementId(r),name:r,attrs:(0,Sw.__assign)({size:i,direction:n,path:[["M",a+i/2,s],["L",a,s+i],["L",a+i,s+i],["Z"]],cursor:"pointer"},o)});return u.attr("matrix",Az({x:a+i/2,y:s+i/2},tG[n])),u},e.prototype.updateArrowPath=function(t,e){var r=e.x,n=e.y,i=t.attr(),o=i.size,a=i.direction,s=Az({x:r+o/2,y:n+o/2},tG[a]);t.attr("path",[["M",r+o/2,n],["L",r,n+o],["L",r+o,n+o],["Z"]]),t.attr("matrix",s)},e.prototype.getCurrentNavigationMatrix=function(){var t=this.currentPageIndex,e=this.pageWidth,r=this.pageHeight;return Pz("horizontal"===this.get("layout")?{x:0,y:r*(1-t)}:{x:e*(1-t),y:0})},e.prototype.applyItemStates=function(t,e){if(this.getItemStates(t).length>0){var r=e.getChildren(),n=this.get("itemStates");(0,Ew.each)(r,function(e){var r=e.get("name").split("-")[2],i=mU(t,r,n);i&&(e.attr(i),"marker"!==r||e.get("isStroke")&&e.get("isFill")||(e.get("isStroke")&&e.attr("fill",null),e.get("isFill")&&e.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),e=this.get("maxItemWidth");return e?t&&(e=t<=e?t:e):t&&(e=t),e},e}(JU),rG=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:nU.textColor,textBaseline:"middle",fontFamily:nU.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:nU.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,e){this.update({min:t,max:e})},e.prototype.setValue=function(t){var e=this.getValue();this.set("value",t);var r=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(r),this.delegateEmit("valuechanged",{originValue:e,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var e=this;t.on("legend-handler-min:drag",function(t){var r=e.getValueByCanvasPoint(t.x,t.y),n=e.getCurrentValue()[1];nr&&(n=r),e.setValue([n,r])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var e=this,r=null;t.on("legend-track:dragstart",function(t){r={x:t.x,y:t.y}}),t.on("legend-track:drag",function(t){if(r){var n=e.getValueByCanvasPoint(r.x,r.y),i=e.getValueByCanvasPoint(t.x,t.y),o=e.getCurrentValue(),a=o[1]-o[0],s=e.getRange(),u=i-n;u<0?o[0]+u>s.min?e.setValue([o[0]+u,o[1]+u]):e.setValue([s.min,s.min+a]):u>0&&(u>0&&o[1]+ui&&(u=i),u0&&this.changeRailLength(n,i,r[i]-l)}},e.prototype.changeRailLength=function(t,e,r){var n,i=t.getBBox();n="height"===e?this.getRailPath(i.x,i.y,i.width,r):this.getRailPath(i.x,i.y,r,i.height),t.attr("path",n)},e.prototype.changeRailPosition=function(t,e,r){var n=t.getBBox(),i=this.getRailPath(e,r,n.width,n.height);t.attr("path",i)},e.prototype.fixedHorizontal=function(t,e,r,n){var i=this.get("label"),o=i.align,a=i.spacing,s=r.getBBox(),u=t.getBBox(),l=e.getBBox(),c=s.height;this.fitRailLength(u,l,s,r),s=r.getBBox(),"rail"===o?(t.attr({x:n.x,y:n.y+c/2}),this.changeRailPosition(r,n.x+u.width+a,n.y),e.attr({x:n.x+u.width+s.width+2*a,y:n.y+c/2})):"top"===o?(t.attr({x:n.x,y:n.y}),e.attr({x:n.x+s.width,y:n.y}),this.changeRailPosition(r,n.x,n.y+u.height+a)):(this.changeRailPosition(r,n.x,n.y),t.attr({x:n.x,y:n.y+s.height+a}),e.attr({x:n.x+s.width,y:n.y+s.height+a}))},e.prototype.fixedVertail=function(t,e,r,n){var i=this.get("label"),o=i.align,a=i.spacing,s=r.getBBox(),u=t.getBBox(),l=e.getBBox();if(this.fitRailLength(u,l,s,r),s=r.getBBox(),"rail"===o)t.attr({x:n.x,y:n.y}),this.changeRailPosition(r,n.x,n.y+u.height+a),e.attr({x:n.x,y:n.y+u.height+s.height+2*a});else if("right"===o)t.attr({x:n.x+s.width+a,y:n.y}),this.changeRailPosition(r,n.x,n.y),e.attr({x:n.x+s.width+a,y:n.y+s.height});else{var c=Math.max(u.width,l.width);t.attr({x:n.x,y:n.y}),this.changeRailPosition(r,n.x+c+a,n.y),e.attr({x:n.x,y:n.y+s.height})}},e}(JU),nG="g2-tooltip",iG="g2-tooltip-title",oG="g2-tooltip-list",aG="g2-tooltip-list-item",sG="g2-tooltip-marker",uG="g2-tooltip-value",lG="g2-tooltip-name",cG="g2-tooltip-crosshair-x",fG="g2-tooltip-crosshair-y",hG=((XU={})[""+nG]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:nU.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},XU[""+iG]={marginBottom:"4px"},XU[""+oG]={margin:"0px",listStyleType:"none",padding:"0px"},XU[""+aG]={listStyleType:"none",marginBottom:"4px"},XU[""+sG]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},XU[""+uG]={display:"inline-block",float:"right",marginLeft:"30px"},XU[""+cG]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},XU[""+fG]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},XU);var pG=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
      ',itemTpl:'
    • \n \n {name}:\n {value}\n
    • ',xCrosshairTpl:'
      ',yCrosshairTpl:'
      ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:nG,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:hG})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!0),BA(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!1),BA(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var e=t?"":"none",r=this.get("xCrosshairDom"),n=this.get("yCrosshairDom");r&&BA(r,{display:e}),n&&BA(n,{display:e})},e.prototype.initContainer=function(){if(t.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var e=this.getHtmlContentNode();this.get("parent").appendChild(e),this.set("container",e),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(e){var r,n,i;this.get("customContent")?this.renderCustomContent():(r=e,n=["title","showTitle"],i=!1,(0,Ew.each)(n,function(t){if((0,Ew.hasKey)(r,t))return i=!0,!1}),i&&this.resetTitle(),(0,Ew.hasKey)(e,"items")&&this.renderItems()),t.prototype.updateInner.call(this,e)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){t.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t,e=this.get("x"),r=this.get("y"),n=this.get("offset"),i=this.getOffset(),o=i.offsetX,a=i.offsetY,s=this.get("position"),u=this.get("region"),l=this.getContainer(),c=this.getBBox(),f=c.width,h=c.height;u&&(t=Rz(u));var p=function(t,e,r,n,i,o,a){var s=function(t,e,r,n,i,o){var a=t,s=e;switch(o){case"left":a=t-n-r,s=e-i/2;break;case"right":a=t+r,s=e-i/2;break;case"top":a=t-n/2,s=e-i-r;break;case"bottom":a=t-n/2,s=e+r;break;default:a=t+r,s=e-i-r}return{x:a,y:s}}(t,e,r,n,i,o);if(a){var u=function(t,e,r,n,i){return{left:ti.x+i.width,top:ei.y+i.height}}(s.x,s.y,n,i,a);"auto"===o?(u.right&&(s.x=Math.max(0,t-n-r)),u.top&&(s.y=Math.max(0,e-i-r))):"top"===o||"bottom"===o?(u.left&&(s.x=a.x),u.right&&(s.x=a.x+a.width-n),"top"===o&&u.top&&(s.y=e+r),"bottom"===o&&u.bottom&&(s.y=e-i-r)):(u.top&&(s.y=a.y),u.bottom&&(s.y=a.y+a.height-i),"left"===o&&u.left&&(s.x=t+r),"right"===o&&u.right&&(s.x=t-n-r))}return s}(e,r,n,f,h,s,t);BA(l,{left:Gz(p.x+o),top:Gz(p.y+a)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),e=this.get("parent"),r=this.get("container");r&&r.parentNode===e?e.replaceChild(t,r):e.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,e=this.get("customContent");if(e){var r=e(this.get("title"),this.get("items"));t=(0,Ew.isElement)(r)?r:UC(r)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),e=t.getElementsByClassName(iG)[0],r=t.getElementsByClassName(oG)[0];this.set("titleDom",e),this.set("listDom",r)},e.prototype.resetTitle=function(){var t=this.get("title");this.get("showTitle")&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var e=this.get("titleDom");e&&(e.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),e=this.get("crosshairs");if(t&&e){var r=Rz(t),n=this.get("xCrosshairDom"),i=this.get("yCrosshairDom");"x"===e?(this.resetCrosshair("x",r),i&&(i.remove(),this.set("yCrosshairDom",null))):"y"===e?(this.resetCrosshair("y",r),n&&(n.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",r),this.resetCrosshair("y",r)),this.setCrossHairsVisible(this.get("visible"))}else this.clearCrosshairs()},e.prototype.resetCrosshair=function(t,e){var r=this.checkCrosshair(t),n=this.get(t);BA(r,"x"===t?{left:Gz(n),top:Gz(e.y),height:Gz(e.height)}:{top:Gz(n),left:Gz(e.x),width:Gz(e.width)})},e.prototype.checkCrosshair=function(t){var e=t+"CrosshairDom",r=t+"CrosshairTpl",n="CROSSHAIR_"+t.toUpperCase(),i=k[n],o=this.get(e),a=this.get("parent");return o||(o=UC(this.get(r)),this.applyStyle(i,o),a.appendChild(o),this.set(e,o)),o},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),e=this.get("itemTpl"),r=this.get("listDom");r&&((0,Ew.each)(t,function(t){var n=hz.toCSSGradient(t.color),i=(0,Sw.__assign)((0,Sw.__assign)({},t),{color:n}),o=UC((0,Ew.substitute)(e,i));r.appendChild(o)}),this.applyChildrenStyles(r,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&Nz(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),e=this.get("yCrosshairDom");t&&t.remove(),e&&e.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(vU),dG={opacity:0},yG={stroke:"#C5C5C5",strokeOpacity:.85},vG={fill:"#CACED4",opacity:.85};function gG(t){return function(t){return(0,Ew.map)(t,function(t,e){return[0===e?"M":"L",t[0],t[1]]})}(t)}function mG(t,e,r,n){void 0===n&&(n=!0);var i=new gM({values:t}),o=new MP({values:(0,Ew.map)(t,function(t,e){return e})}),a=(0,Ew.map)(t,function(t,n){return[o.scale(n)*e,r-i.scale(t)*r]});return n?function(t){if(t.length<=2)return gG(t);var e=[];(0,Ew.each)(t,function(t){(0,Ew.isEqual)(t,e.slice(e.length-2))||e.push(t[0],t[1])});var r=(0,FE.e9)(e,!1),n=(0,Ew.head)(t),i=n[0],o=n[1];return r.unshift(["M",i,o]),r}(a):gG(a)}function bG(t,e,r,n){var i=(0,Sw.__spreadArrays)(t),o=function(t,e){var r=new gM({values:t}),n=r.max<0?r.max:Math.max(0,r.min);return e-r.scale(n)*e}(n,r);return i.push(["L",e,o]),i.push(["L",0,o]),i.push(["Z"]),i}var xG=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:dG,lineStyle:yG,areaStyle:vG})},e.prototype.renderInner=function(t){var e=this.cfg,r=e.width,n=e.height,i=e.data,o=e.smooth,a=e.isArea,s=e.backgroundStyle,u=e.lineStyle,l=e.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:(0,Sw.__assign)({x:0,y:0,width:r,height:n},s)});var c=mG(i,r,n,o);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:(0,Sw.__assign)({path:c},u)}),a){var f=bG(c,r,n,i);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:(0,Sw.__assign)({path:f},l)})}},e.prototype.applyOffset=function(){var t=this.cfg,e=t.x,r=t.y;this.moveElementTo(this.get("group"),{x:e,y:r})},e}(Xz),wG={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},_G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"handler",x:0,y:0,width:10,height:24,style:wG})},e.prototype.renderInner=function(t){var e=this.cfg,r=e.width,n=e.height,i=e.style,o=i.fill,a=i.stroke,s=i.radius,u=i.opacity,l=i.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:r,height:n,fill:o,stroke:a,radius:s,opacity:u,cursor:l}});var c=1/3*r,f=2/3*r,h=.25*n,p=.75*n;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:c,y1:h,x2:c,y2:p,stroke:a,cursor:l}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:f,y1:h,x2:f,y2:p,stroke:a,cursor:l}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var e=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",e),t.draw()}),this.get("group").on("mouseleave",function(){var e=t.get("style").fill;t.getElementByLocalId("background").attr("fill",e),t.draw()})},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(Xz),SG={fill:"#416180",opacity:.05},EG={fill:"#5B8FF9",opacity:.15,cursor:"move"},kG={width:10,height:24},TG={textBaseline:"middle",fill:"#000",opacity:.45},CG="sliderchange",OG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){return function(r){e.currentTarget=t;var n=r.originalEvent;n.stopPropagation(),n.preventDefault(),e.prevX=(0,Ew.get)(n,"touches.0.pageX",n.pageX),e.prevY=(0,Ew.get)(n,"touches.0.pageY",n.pageY);var i=e.getContainerDOM();i.addEventListener("mousemove",e.onMouseMove),i.addEventListener("mouseup",e.onMouseUp),i.addEventListener("mouseleave",e.onMouseUp),i.addEventListener("touchmove",e.onMouseMove),i.addEventListener("touchend",e.onMouseUp),i.addEventListener("touchcancel",e.onMouseUp)}},e.onMouseMove=function(t){var r=e.cfg.width,n=[e.get("start"),e.get("end")];t.stopPropagation(),t.preventDefault();var i=(0,Ew.get)(t,"touches.0.pageX",t.pageX),o=(0,Ew.get)(t,"touches.0.pageY",t.pageY),a=i-e.prevX,s=e.adjustOffsetRange(a/r);e.updateStartEnd(s),e.updateUI(e.getElementByLocalId("foreground"),e.getElementByLocalId("minText"),e.getElementByLocalId("maxText")),e.prevX=i,e.prevY=o,e.draw(),e.emit(CG,[e.get("start"),e.get("end")].sort()),e.delegateEmit("valuechanged",{originValue:n,value:[e.get("start"),e.get("end")]})},e.onMouseUp=function(){e.currentTarget&&(e.currentTarget=void 0);var t=e.getContainerDOM();t&&(t.removeEventListener("mousemove",e.onMouseMove),t.removeEventListener("mouseup",e.onMouseUp),t.removeEventListener("mouseleave",e.onMouseUp),t.removeEventListener("touchmove",e.onMouseMove),t.removeEventListener("touchend",e.onMouseUp),t.removeEventListener("touchcancel",e.onMouseUp))},e}return(0,Sw.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var r=this.get("start"),n=this.get("end"),i=(0,Ew.clamp)(r,t,e),o=(0,Ew.clamp)(n,t,e);this.get("isInit")||r===i&&n===o||this.setValue([i,o])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange();if((0,Ew.isArray)(t)&&2===t.length){var r=[this.get("start"),this.get("end")];this.update({start:(0,Ew.clamp)(t[0],e.min,e.max),end:(0,Ew.clamp)(t[1],e.min,e.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:r,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:SG,foregroundStyle:EG,handlerStyle:kG,textStyle:TG}})},e.prototype.update=function(e){var r=e.start,n=e.end,i=(0,Sw.__assign)({},e);(0,Ew.isNil)(r)||(i.start=(0,Ew.clamp)(r,0,1)),(0,Ew.isNil)(n)||(i.end=(0,Ew.clamp)(n,0,1)),t.prototype.update.call(this,i),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",(0,Ew.clamp)(this.get("start"),0,1)),this.set("end",(0,Ew.clamp)(this.get("end"),0,1)),t.prototype.init.call(this)},e.prototype.render=function(){t.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var e=this.cfg,r=(e.start,e.end,e.width),n=e.height,i=e.trendCfg,o=void 0===i?{}:i,a=e.minText,s=e.maxText,u=e.backgroundStyle,l=void 0===u?{}:u,c=e.foregroundStyle,f=void 0===c?{}:c,h=e.textStyle,p=void 0===h?{}:h,d=(0,Ew.deepMix)({},wG,this.cfg.handlerStyle);(0,Ew.size)((0,Ew.get)(o,"data"))&&(this.trend=this.addComponent(t,(0,Sw.__assign)({component:xG,id:this.getElementId("trend"),x:0,y:0,width:r,height:n},o))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:(0,Sw.__assign)({x:0,y:0,width:r,height:n},l)});this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:(0,Sw.__assign)({y:n/2,textAlign:"right",text:a,silent:!1},p)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:(0,Sw.__assign)({y:n/2,textAlign:"left",text:s,silent:!1},p)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:(0,Sw.__assign)({y:0,height:n},f)});var y=(0,Ew.get)(d,"width",10),v=(0,Ew.get)(d,"height",24);this.minHandler=this.addComponent(t,{component:_G,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(n-v)/2,width:y,height:v,cursor:"ew-resize",style:d}),this.maxHandler=this.addComponent(t,{component:_G,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(n-v)/2,width:y,height:v,cursor:"ew-resize",style:d})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,e,r){var n=this.cfg,i=n.start,o=n.end,a=n.width,s=n.minText,u=n.maxText,l=n.handlerStyle,c=n.height,f=i*a,h=o*a;this.trend&&(this.trend.update({width:a,height:c}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",f),t.attr("width",h-f);var p=(0,Ew.get)(l,"width",10);e.attr("text",s),r.attr("text",u);var d=this._dodgeText([f,h],e,r),y=d[0],v=d[1];this.minHandler&&(this.minHandler.update({x:f-p/2}),this.get("updateAutoRender")||this.minHandler.render()),(0,Ew.each)(y,function(t,r){return e.attr(r,t)}),this.maxHandler&&(this.maxHandler.update({x:h-p/2}),this.get("updateAutoRender")||this.maxHandler.render()),(0,Ew.each)(v,function(t,e){return r.attr(e,t)})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var e=t.findById(this.getElementId("foreground"));e.on("mousedown",this.onMouseDown("foreground")),e.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var e=this.cfg,r=e.start,n=e.end;switch(this.currentTarget){case"minHandler":var i=0-r,o=1-r;return Math.min(o,Math.max(i,t));case"maxHandler":i=0-n,o=1-n;return Math.min(o,Math.max(i,t));case"foreground":i=0-r,o=1-n;return Math.min(o,Math.max(i,t))}},e.prototype.updateStartEnd=function(t){var e=this.cfg,r=e.start,n=e.end;switch(this.currentTarget){case"minHandler":r+=t;break;case"maxHandler":n+=t;break;case"foreground":r+=t,n+=t}this.set("start",r),this.set("end",n)},e.prototype._dodgeText=function(t,e,r){var n,i,o=this.cfg,a=o.handlerStyle,s=o.width,u=(0,Ew.get)(a,"width",10),l=t[0],c=t[1],f=!1;l>c&&(l=(n=[c,l])[0],c=n[1],e=(i=[r,e])[0],r=i[1],f=!0);var h=e.getBBox(),p=r.getBBox(),d=h.width>l-2?{x:l+u/2+2,textAlign:"left"}:{x:l-u/2-2,textAlign:"right"},y=p.width>s-c-2?{x:c-u/2-2,textAlign:"right"}:{x:c+u/2+2,textAlign:"left"};return f?[y,d]:[d,y]},e.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e}(Xz),AG={default:{trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},hover:{thumbColor:"rgba(0,0,0,0.2)"}},PG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.clearEvents=Ew.noop,e.onStartEvent=function(t){return function(r){e.isMobile=t,r.originalEvent.preventDefault();var n=t?(0,Ew.get)(r.originalEvent,"touches.0.clientX"):r.clientX,i=t?(0,Ew.get)(r.originalEvent,"touches.0.clientY"):r.clientY;e.startPos=e.cfg.isHorizontal?n:i,e.bindLaterEvent()}},e.bindLaterEvent=function(){var t=e.getContainerDOM(),r=[];r=e.isMobile?[qO(t,"touchmove",e.onMouseMove),qO(t,"touchend",e.onMouseUp),qO(t,"touchcancel",e.onMouseUp)]:[qO(t,"mousemove",e.onMouseMove),qO(t,"mouseup",e.onMouseUp),qO(t,"mouseleave",e.onMouseUp)],e.clearEvents=function(){r.forEach(function(t){t.remove()})}},e.onMouseMove=function(t){var r=e.cfg,n=r.isHorizontal,i=r.thumbOffset;t.preventDefault();var o=e.isMobile?(0,Ew.get)(t,"touches.0.clientX"):t.clientX,a=e.isMobile?(0,Ew.get)(t,"touches.0.clientY"):t.clientY,s=n?o:a,u=s-e.startPos;e.startPos=s,e.updateThumbOffset(i+u)},e.onMouseUp=function(t){t.preventDefault(),e.clearEvents()},e.onTrackClick=function(t){var r=e.cfg,n=r.isHorizontal,i=r.x,o=r.y,a=r.thumbLen,s=e.getContainerDOM().getBoundingClientRect(),u=t.clientX,l=t.clientY,c=n?u-s.left-i-a/2:l-s.top-o-a/2,f=e.validateRange(c);e.updateThumbOffset(f)},e.onThumbMouseOver=function(){var t=e.cfg.theme.hover.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e.onThumbMouseOut=function(){var t=e.cfg.theme.default.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e}return(0,Sw.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var r=this.getValue(),n=(0,Ew.clamp)(r,t,e);r===n||this.get("isInit")||this.setValue(n)},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange(),r=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*(0,Ew.clamp)(t,e.min,e.max)}),this.delegateEmit("valuechange",{originalValue:r,value:this.getValue()})},e.prototype.getValue=function(){return(0,Ew.clamp)(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Sw.__assign)((0,Sw.__assign)({},e),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:AG})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var e=this.cfg,r=e.trackLen,n=e.theme,i=void 0===n?{default:{}}:n,o=(0,Ew.deepMix)({},AG,i).default,a=o.lineCap,s=o.trackColor,u=o.size,l=(0,Ew.get)(this.cfg,"size",u),c=this.get("isHorizontal")?{x1:0+l/2,y1:l/2,x2:r-l/2,y2:l/2,lineWidth:l,stroke:s,lineCap:a}:{x1:l/2,y1:0+l/2,x2:l/2,y2:r-l/2,lineWidth:l,stroke:s,lineCap:a};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:c})},e.prototype.renderThumbShape=function(t){var e=this.cfg,r=e.thumbOffset,n=e.thumbLen,i=e.theme,o=(0,Ew.deepMix)({},AG,i).default,a=o.size,s=o.lineCap,u=o.thumbColor,l=(0,Ew.get)(this.cfg,"size",a),c=this.get("isHorizontal")?{x1:r+l/2,y1:l/2,x2:r+n-l/2,y2:l/2,lineWidth:l,stroke:u,lineCap:s,cursor:"default"}:{x1:l/2,y1:r+l/2,x2:l/2,y2:r+n-l/2,lineWidth:l,stroke:u,lineCap:s,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:c})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp),t.findById(this.getElementId("track")).on("click",this.onTrackClick);var e=t.findById(this.getElementId("thumb"));e.on("mouseover",this.onThumbMouseOver),e.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e.prototype.validateRange=function(t){var e=this.cfg,r=e.thumbLen,n=e.trackLen,i=t;return t+r>n?i=n-r:t+rt.x?t.x:e,r=rt.y?t.y:n,i=i=n&&t<=i}function YG(t,e){return"object"===WG(t)&&e.forEach(function(e){delete t[e]}),t}function XG(t,e,r){var n,i;void 0===e&&(e=[]),void 0===r&&(r=new Map);try{for(var o=(0,Sw.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;r.has(s)||(e.push(s),r.set(s,!0))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e}var ZG=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x=t,this.y=e,this.height=n,this.width=r}return t.fromRange=function(e,r,n,i){return new t(e,r,n-e,i-r)},t.fromObject=function(e){return new t(e.minX,e.minY,e.width,e.height)},Object.defineProperty(t.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},t.prototype.contains=function(t){return t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.add=function(){for(var t=[],e=0;et.minX&&this.minYt.minY},t.prototype.size=function(){return this.width*this.height},t.prototype.isPointIn=function(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY},t}();function KG(t){if(t.isPolar&&!t.isTransposed)return(t.endAngle-t.startAngle)*t.getRadius();var e=t.convert({x:0,y:0}),r=t.convert({x:1,y:0});return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))}function JG(t,e){var r=t.getCenter();return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function QG(t,e){var r=t.getCenter();return Math.atan2(e.y-r.y,e.x-r.x)}function $G(t,e){void 0===e&&(e=0);var r,n=t.start,i=t.end,o=t.getWidth(),a=t.getHeight();if(t.isPolar){var s=t.startAngle,u=t.endAngle,l=t.getCenter(),c=t.getRadius();return{type:"path",startState:{path:UG(l.x,l.y,c+e,s,s)},endState:function(t){var r=(u-s)*t+s;return{path:UG(l.x,l.y,c+e,s,r)}},attrs:{path:UG(l.x,l.y,c+e,s,u)}}}return r=t.isTransposed?{height:a+2*e}:{width:o+2*e},{type:"rect",startState:{x:n.x-e,y:i.y-e,width:t.isTransposed?o+2*e:0,height:t.isTransposed?0:a+2*e},endState:r,attrs:{x:n.x-e,y:i.y-e,width:o+2*e,height:a+2*e}}}var tV=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function eV(t,e,r,n){return void 0===e&&(e={}),e.type?e.type:"identity"!==t.type&&PF.includes(r)&&["interval"].includes(n)?"cat":t.isCategory?"cat":t.type}function rV(t,e,r){var n=e||[];if((0,Ew.isNumber)(t)||(0,Ew.isNil)((0,Ew.firstValue)(n,t))&&(0,Ew.isEmpty)(r))return new(CM("identity"))({field:t.toString(),values:[t]});var i=(0,Ew.valuesOfKey)(n,t);return new(CM((0,Ew.get)(r,"type",function(t){var e="linear";return tV.test(t)?e="timeCat":(0,Ew.isString)(t)&&(e="cat"),e}(i[0]))))((0,Sw.__assign)({field:t,values:i},r))}function nV(t){return t.alias||t.field}function iV(t,e,r){var n,i=t.values.length;if(1===i)n=[.5,1];else{var o=0;n=function(t){if(t.isPolar){var e=t.startAngle;return t.endAngle-e==2*Math.PI}return!1}(e)?e.isTransposed?[(o=1/i*(0,Ew.get)(r,"widthRatio.multiplePie",1/1.3))/2,1-o/2]:[0,1-1/i]:[o=1/i/2,1-o]}return n}function oV(t,e){var r={start:{x:0,y:0},end:{x:0,y:0}};t.isRect?r=function(t){var e,r;switch(t){case _F.TOP:e={x:0,y:1},r={x:1,y:1};break;case _F.RIGHT:e={x:1,y:0},r={x:1,y:1};break;case _F.BOTTOM:e={x:0,y:0},r={x:1,y:0};break;case _F.LEFT:e={x:0,y:0},r={x:0,y:1};break;default:e=r={x:0,y:0}}return{start:e,end:r}}(e):t.isPolar&&(r=function(t){var e,r;return t.isTransposed?(e={x:0,y:0},r={x:1,y:0}):(e={x:0,y:0},r={x:0,y:1}),{start:e,end:r}}(t));var n=r.start,i=r.end;return{start:t.convert(n),end:t.convert(i)}}function aV(t){var e=t.start,r=t.end;return e.x===r.x}function sV(t,e){var r=t.start,n=t.end;return aV(t)?(r.y-n.y)*(e.x-r.x)>0?1:-1:(n.x-r.x)*(r.y-e.y)>0?-1:1}function uV(t,e){var r=(0,Ew.get)(t,["components","axis"],{});return(0,Ew.deepMix)({},(0,Ew.get)(r,["common"],{}),(0,Ew.deepMix)({},(0,Ew.get)(r,[e],{})))}function lV(t,e,r){var n=(0,Ew.get)(t,["components","axis"],{});return(0,Ew.deepMix)({},(0,Ew.get)(n,["common","title"],{}),(0,Ew.deepMix)({},(0,Ew.get)(n,[e,"title"],{})),r)}function cV(t){var e=t.x,r=t.y,n=t.circleCenter,i=r.start>r.end,o=t.isTransposed?t.convert({x:i?0:1,y:0}):t.convert({x:0,y:i?0:1}),a=[o.x-n.x,o.y-n.y],s=[1,0],u=o.y>n.y?Q_.angle(a,s):-1*Q_.angle(a,s),l=u+(e.end-e.start);return{center:n,radius:Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2)),startAngle:u,endAngle:l}}function fV(t,e){return(0,Ew.isBoolean)(t)?!1!==t&&{}:(0,Ew.get)(t,[e])}function hV(t,e){return(0,Ew.get)(t,"position",e)}function pV(t,e){return(0,Ew.get)(e,["title","text"],nV(t))}var dV=function(){function t(t,e){this.destroyed=!1,this.facets=[],this.view=t,this.cfg=(0,Ew.deepMix)({},this.getDefaultCfg(),e)}return t.prototype.init=function(){this.container||(this.container=this.createContainer());var t=this.view.getData();this.facets=this.generateFacets(t)},t.prototype.render=function(){this.renderViews()},t.prototype.update=function(){},t.prototype.clear=function(){this.clearFacetViews()},t.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},t.prototype.facetToView=function(t){var e=t.region,r=t.data,n=t.padding,i=void 0===n?this.cfg.padding:n,o=this.view.createView({region:e,padding:i});o.data(r||[]),t.view=o,this.beforeEachView(o,t);var a=this.cfg.eachView;return a&&a(o,t),this.afterEachView(o,t),o},t.prototype.createContainer=function(){return this.view.getLayer(wF.FORE).addGroup()},t.prototype.renderViews=function(){this.createFacetViews()},t.prototype.createFacetViews=function(){var t=this;return this.facets.map(function(e){return t.facetToView(e)})},t.prototype.clearFacetViews=function(){var t=this;(0,Ew.each)(this.facets,function(e){e.view&&(t.view.removeView(e.view),e.view=void 0)})},t.prototype.parseSpacing=function(){var t=this.view.viewBBox,e=t.width,r=t.height;return this.cfg.spacing.map(function(t,n){return(0,Ew.isNumber)(t)?t/(0===n?e:r):parseFloat(t)/100})},t.prototype.getFieldValues=function(t,e){var r=[],n={};return(0,Ew.each)(t,function(t){var i=t[e];(0,Ew.isNil)(i)||n[i]||(r.push(i),n[i]=!0)}),r},t.prototype.getRegion=function(t,e,r,n){var i=(0,Sw.__read)(this.parseSpacing(),2),o=i[0],a=i[1],s=(1+o)/(0===e?1:e)-o,u=(1+a)/(0===t?1:t)-a,l={x:(s+o)*r,y:(u+a)*n};return{start:l,end:{x:l.x+s,y:l.y+u}}},t.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},t.prototype.getDefaultTitleCfg=function(){return{style:{fontSize:14,fill:"#666",fontFamily:this.view.getTheme().fontFamily}}},t.prototype.processAxis=function(t,e){var r=t.getOptions(),n=r.coordinate,i=t.geometries;if("rect"===(0,Ew.get)(n,"type","rect")&&i.length){(0,Ew.isNil)(r.axes)&&(r.axes={});var o=r.axes,a=(0,Sw.__read)(i[0].getXYFields(),2),s=a[0],u=a[1],l=fV(o,s),c=fV(o,u);!1!==l&&(r.axes[s]=this.getXAxisOption(s,o,l,e)),!1!==c&&(r.axes[u]=this.getYAxisOption(u,o,c,e))}},t.prototype.getFacetDataFilter=function(t){return function(e){return(0,Ew.every)(t,function(t){var r=t.field,n=t.value;return!(!(0,Ew.isNil)(n)&&r)||e[r]===n})}},t}(),yV={},vV=function(t){return yV[(0,Ew.lowerCase)(t)]},gV=function(t,e){yV[(0,Ew.lowerCase)(t)]=e},mV=function(){function t(t,e){this.context=t,this.cfg=e,t.addAction(this)}return t.prototype.applyCfg=function(t){(0,Ew.assign)(this,t)},t.prototype.init=function(){this.applyCfg(this.cfg)},t.prototype.destroy=function(){this.context.removeAction(this),this.context=null},t}(),bV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.callback=null},e}(mV),xV={};function wV(t){var e=xV[t];return(0,Ew.get)(e,"ActionClass")}function _V(t,e,r){xV[t]={ActionClass:e,cfg:r}}function SV(t,e){for(var r=[t[0]],n=1,i=t.length;n=a[l]?1:0,h=c>Math.PI?1:0,p=r.convert(s),d=JG(r,p);if(d>=.5)if(c===2*Math.PI){var y={x:(s.x+a.x)/2,y:(s.y+a.y)/2},v=r.convert(y);u.push(["A",d,d,0,h,f,v.x,v.y]),u.push(["A",d,d,0,h,f,p.x,p.y])}else u.push(["A",d,d,0,h,f,p.x,p.y]);return u}(r,n,t)):o.push(SV(a,t));break;case"a":o.push(EV(a,t));break;case"z":default:o.push(a)}}),function(t){(0,Ew.each)(t,function(e,r){if("a"===e[0].toLowerCase()){var n=t[r-1],i=t[r+1];i&&"a"===i[0].toLowerCase()?n&&"l"===n[0].toLowerCase()&&(n[0]="M"):n&&"a"===n[0].toLowerCase()&&i&&"l"===i[0].toLowerCase()&&(i[0]="M")}})}(o),o}function PV(t,e){return IV(t.event.target,e)}function MV(t,e){var r=t.getCanvasBBox(),n=r.width,i=r.height;return n>0&&i>0&&(n>=e||i>=e)}function IV(t,e){var r=t.getCanvasBBox();return MV(t,e)?r:null}function LV(t,e){return t.event.maskShapes.map(function(t){return IV(t,e)}).filter(function(t){return!!t})}function jV(t,e){return MV(t,e)?t.attr("path"):null}function NV(t){var e,r=t.event.target;return r&&(e=r.get("element")),e}function RV(t){var e,r=t.event.target;return r&&(e=r.get("delegateObject")),e}function DV(t){var e=t.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function BV(t){return t&&t.component&&t.component.isList()}function FV(t){return t&&t.component&&t.component.isSlider()}function zV(t){var e=t.event.target;return e&&"mask"===(null===e||void 0===e?void 0:e.get("name"))||UV(t)}function UV(t){var e;return"multi-mask"===(null===(e=t.event.target)||void 0===e?void 0:e.get("name"))}function GV(t,e){var r=t.event.target;if(UV(t))return function(t,e){if("path"===t.event.target.get("type")){var r=function(t,e){return t.event.maskShapes.map(function(t){return jV(t,e)})}(t,e);return r.length>0?r.flatMap(function(e){return KV(t.view,e)}):null}var n=LV(t,e);if(n.length>0)return n.flatMap(function(e){return XV(t.view,e)});return null}(t,e);if("path"===r.get("type")){var n=function(t,e){return jV(t.event.target,e)}(t,e);if(!n)return;return KV(t.view,n)}var i=PV(t,e);return i?XV(t.view,i):null}function VV(t,e,r){if(UV(t))return function(t,e,r){var n=LV(t,r);if(n.length>0)return n.flatMap(function(r){return HV(r,t,e)});return null}(t,e,r);var n=PV(t,r);return n?HV(n,t,e):null}function HV(t,e,r){var n=e.view,i=eH(n,r,{x:t.x,y:t.y}),o=eH(n,r,{x:t.maxX,y:t.maxY});return XV(r,{minX:i.x,minY:i.y,maxX:o.x,maxY:o.y})}function WV(t){var e=t.geometries,r=[];return(0,Ew.each)(e,function(t){var e=t.elements;r=r.concat(e)}),t.views&&t.views.length&&(0,Ew.each)(t.views,function(t){r=r.concat(WV(t))}),r}function qV(t,e){var r=t.geometries,n=[];return(0,Ew.each)(r,function(t){var r=t.getElementsBy(function(t){return t.hasState(e)});n=n.concat(r)}),n}function YV(t,e){var r=t.getModel().data;return(0,Ew.isArray)(r)?r[0][e]:r[e]}function XV(t,e){var r=WV(t),n=[];return(0,Ew.each)(r,function(t){var r,i,o=t.shape.getCanvasBBox();r=e,(i=o).minX>r.maxX||i.maxXr.maxY||i.maxY=e.x&&t.y<=e.y&&t.maxY>e.y}function tH(t){var e=t.parent,r=null;return e&&(r=e.views.filter(function(e){return e!==t})),r}function eH(t,e,r){var n=function(t,e){return t.getCoordinate().invert(e)}(t,r);return e.getCoordinate().convert(n)}function rH(t,e,r,n){var i=!1;return(0,Ew.each)(t,function(t){if(t[r]===e[r]&&t[n]===e[n])return i=!0,!1}),i}function nH(t,e){var r=t.getScaleByField(e);return!r&&t.views&&(0,Ew.each)(t.views,function(t){if(r=nH(t,e))return!1}),r}var iH=function(){function t(t){this.actions=[],this.event=null,this.cacheMap={},this.view=t}return t.prototype.cache=function(){for(var t=[],e=0;e=0&&e.splice(r,1)},t.prototype.getCurrentPoint=function(){var t=this.event;return t?t.target instanceof HTMLElement?this.view.getCanvas().getPointByClient(t.clientX,t.clientY):{x:t.x,y:t.y}:null},t.prototype.getCurrentShape=function(){return(0,Ew.get)(this.event,["gEvent","shape"])},t.prototype.isInPlot=function(){var t=this.getCurrentPoint();return!!t&&this.view.isPointInPlot(t)},t.prototype.isInShape=function(t){var e=this.getCurrentShape();return!!e&&e.get("name")===t},t.prototype.isInComponent=function(t){var e=JV(this.view),r=this.getCurrentPoint();return!!r&&!!e.find(function(e){var n=e.getBBox();return t?e.get("name")===t&&$V(n,r):$V(n,r)})},t.prototype.destroy=function(){(0,Ew.each)(this.actions.slice(),function(t){t.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},t}(),oH=function(){function t(t,e){this.view=t,this.cfg=e}return t.prototype.init=function(){this.initEvents()},t.prototype.initEvents=function(){},t.prototype.clearEvents=function(){},t.prototype.destroy=function(){this.clearEvents()},t}();function aH(t,e,r){var n=t.split(":"),i=n[0],o=e.getAction(i)||function(t,e){var r=xV[t],n=null;return r&&((n=new(0,r.ActionClass)(e,r.cfg)).name=t,n.init()),n}(i,e);if(!o)throw new Error("There is no action named ".concat(i));return{action:o,methodName:n[1],arg:r}}function sH(t){var e=t.action,r=t.methodName,n=t.arg;if(!e[r])throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(r));e[r](n)}var uH="start",lH="showEnable",cH="end",fH="rollback",hH="processing",pH=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.callbackCaches={},n.emitCaches={},n.steps=r,n}return(0,Sw.__extends)(e,t),e.prototype.init=function(){this.initContext(),t.prototype.init.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;(0,Ew.each)(this.steps,function(e,r){(0,Ew.each)(e,function(e){var n=t.getActionCallback(r,e);n&&t.bindEvent(e.trigger,n)})})},e.prototype.clearEvents=function(){var t=this;(0,Ew.each)(this.steps,function(e,r){(0,Ew.each)(e,function(e){var n=t.getActionCallback(r,e);n&&t.offEvent(e.trigger,n)})})},e.prototype.initContext=function(){var t=this.view,e=new iH(t);this.context=e;var r=this.steps;(0,Ew.each)(r,function(t){(0,Ew.each)(t,function(t){if((0,Ew.isFunction)(t.action))t.actionObject={action:function(t,e){var r=new bV(e);return r.callback=t,r.name="callback",r}(t.action,e),methodName:"execute"};else if((0,Ew.isString)(t.action))t.actionObject=aH(t.action,e,t.arg);else if((0,Ew.isArray)(t.action)){var r=t.action,n=(0,Ew.isArray)(t.arg)?t.arg:[t.arg];t.actionObject=[],(0,Ew.each)(r,function(r,i){t.actionObject.push(aH(r,e,n[i]))})}})})},e.prototype.isAllowStep=function(t){var e=this.currentStepName,r=this.steps;if(e===t)return!0;if(t===lH)return!0;if(t===hH)return e===uH;if(t===uH)return e!==hH;if(t===cH)return e===hH||e===uH;if(t===fH){if(r[cH])return e===cH;if(e===uH)return!0}return!1},e.prototype.isAllowExecute=function(t,e){if(this.isAllowStep(t)){var r=this.getKey(t,e);return(!e.once||!this.emitCaches[r])&&(!e.isEnable||e.isEnable(this.context))}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,e){t!==lH&&this.currentStepName!==t&&this.enterStep(t);var r=this.getKey(t,e);this.emitCaches[r]=!0},e.prototype.getKey=function(t,e){return t+e.trigger+e.action},e.prototype.getActionCallback=function(t,e){var r=this,n=this.context,i=this.callbackCaches,o=e.actionObject;if(e.action&&o){var a=this.getKey(t,e);if(!i[a]){var s=function(i){n.event=i,r.isAllowExecute(t,e)?((0,Ew.isArray)(o)?(0,Ew.each)(o,function(t){n.event=i,sH(t)}):(n.event=i,sH(o)),r.afterExecute(t,e),e.callback&&(n.event=i,e.callback(n))):n.event=null};e.debounce?i[a]=(0,Ew.debounce)(s,e.debounce.wait,e.debounce.immediate):e.throttle?i[a]=(0,Ew.throttle)(s,e.throttle.wait,{leading:e.throttle.leading,trailing:e.throttle.trailing}):i[a]=s}return i[a]}return null},e.prototype.bindEvent=function(t,e){var r=t.split(":");"window"===r[0]?window.addEventListener(r[1],e):"document"===r[0]?document.addEventListener(r[1],e):this.view.on(t,e)},e.prototype.offEvent=function(t,e){var r=t.split(":");"window"===r[0]?window.removeEventListener(r[1],e):"document"===r[0]?document.removeEventListener(r[1],e):this.view.off(t,e)},e}(oH),dH={};function yH(t){return dH[(0,Ew.lowerCase)(t)]}function vH(t,e){dH[(0,Ew.lowerCase)(t)]=e}function gH(t){var e,r={point:{default:{fill:t.pointFillColor,r:t.pointSize,stroke:t.pointBorderColor,lineWidth:t.pointBorder,fillOpacity:t.pointFillOpacity},active:{stroke:t.pointActiveBorderColor,lineWidth:t.pointActiveBorder},selected:{stroke:t.pointSelectedBorderColor,lineWidth:t.pointSelectedBorder},inactive:{fillOpacity:t.pointInactiveFillOpacity,strokeOpacity:t.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:t.hollowPointFillColor,lineWidth:t.hollowPointBorder,stroke:t.hollowPointBorderColor,strokeOpacity:t.hollowPointBorderOpacity,r:t.hollowPointSize},active:{stroke:t.hollowPointActiveBorderColor,strokeOpacity:t.hollowPointActiveBorderOpacity},selected:{lineWidth:t.hollowPointSelectedBorder,stroke:t.hollowPointSelectedBorderColor,strokeOpacity:t.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:t.hollowPointInactiveBorderOpacity}},area:{default:{fill:t.areaFillColor,fillOpacity:t.areaFillOpacity,stroke:null},active:{fillOpacity:t.areaActiveFillOpacity},selected:{fillOpacity:t.areaSelectedFillOpacity},inactive:{fillOpacity:t.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:t.hollowAreaBorderColor,lineWidth:t.hollowAreaBorder,strokeOpacity:t.hollowAreaBorderOpacity},active:{fill:null,lineWidth:t.hollowAreaActiveBorder},selected:{fill:null,lineWidth:t.hollowAreaSelectedBorder},inactive:{strokeOpacity:t.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:t.intervalFillColor,fillOpacity:t.intervalFillOpacity},active:{stroke:t.intervalActiveBorderColor,lineWidth:t.intervalActiveBorder},selected:{stroke:t.intervalSelectedBorderColor,lineWidth:t.intervalSelectedBorder},inactive:{fillOpacity:t.intervalInactiveFillOpacity,strokeOpacity:t.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:t.hollowIntervalFillColor,stroke:t.hollowIntervalBorderColor,lineWidth:t.hollowIntervalBorder,strokeOpacity:t.hollowIntervalBorderOpacity},active:{stroke:t.hollowIntervalActiveBorderColor,lineWidth:t.hollowIntervalActiveBorder,strokeOpacity:t.hollowIntervalActiveBorderOpacity},selected:{stroke:t.hollowIntervalSelectedBorderColor,lineWidth:t.hollowIntervalSelectedBorder,strokeOpacity:t.hollowIntervalSelectedBorderOpacity},inactive:{stroke:t.hollowIntervalInactiveBorderColor,lineWidth:t.hollowIntervalInactiveBorder,strokeOpacity:t.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:t.lineBorderColor,lineWidth:t.lineBorder,strokeOpacity:t.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:t.lineActiveBorder},selected:{lineWidth:t.lineSelectedBorder},inactive:{strokeOpacity:t.lineInactiveBorderOpacity}}},n=function(t){return{title:{autoRotate:!0,position:"center",spacing:t.axisTitleSpacing,style:{fill:t.axisTitleTextFillColor,fontSize:t.axisTitleTextFontSize,lineHeight:t.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily},iconStyle:{fill:t.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:t.axisLabelOffset,style:{fill:t.axisLabelFillColor,fontSize:t.axisLabelFontSize,lineHeight:t.axisLabelLineHeight,fontFamily:t.fontFamily}},line:{style:{lineWidth:t.axisLineBorder,stroke:t.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:t.axisGridBorderColor,lineWidth:t.axisGridBorder,lineDash:t.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:t.axisTickLineBorder,stroke:t.axisTickLineBorderColor},alignTick:!0,length:t.axisTickLineLength},subTickLine:null,animate:!0}}(t),i=function(t){return{title:null,marker:{symbol:"circle",spacing:t.legendMarkerSpacing,style:{r:t.legendCircleMarkerSize,fill:t.legendMarkerColor}},itemName:{spacing:5,style:{fill:t.legendItemNameFillColor,fontFamily:t.fontFamily,fontSize:t.legendItemNameFontSize,lineHeight:t.legendItemNameLineHeight,fontWeight:t.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:t.legendPageNavigatorMarkerSize,inactiveFill:t.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:t.legendPageNavigatorMarkerInactiveFillOpacity,fill:t.legendPageNavigatorMarkerFillColor,opacity:t.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:t.legendPageNavigatorTextFillColor,fontSize:t.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:t.legendItemSpacing,itemMarginBottom:t.legendItemMarginBottom,padding:t.legendPadding}}(t);return{background:t.backgroundColor,defaultColor:t.brandColor,subColor:t.subColor,semanticRed:t.paletteSemanticRed,semanticGreen:t.paletteSemanticGreen,padding:"auto",fontFamily:t.fontFamily,columnWidthRatio:.5,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:t.paletteQualitative10,colors20:t.paletteQualitative20,sequenceColors:t.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:function(t){var e=t.geometry.coordinate;if(e.isPolar&&e.isTransposed){var n=VG(t.getModel(),e),i=(n.startAngle+n.endAngle)/2,o=7.5*Math.cos(i),a=7.5*Math.sin(i);return{matrix:Aw.vs(null,[["t",o,a]])}}return r.interval.selected}}},"hollow-rect":{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},line:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},tick:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},funnel:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}},pyramid:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}}},line:{line:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},dot:{default:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:(0,Sw.__assign)((0,Sw.__assign)({},r.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vh:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hvh:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vhv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}}},polygon:{polygon:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}}},point:{circle:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},square:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},bowtie:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},diamond:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},hexagon:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},triangle:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},"triangle-down":{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},"hollow-circle":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-square":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-bowtie":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-diamond":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-hexagon":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-triangle":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-triangle-down":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},cross:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},tick:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},plus:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},hyphen:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},line:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}}},area:{area:{default:{style:r.area.default},active:{style:r.area.active},inactive:{style:r.area.inactive},selected:{style:r.area.selected}},smooth:{default:{style:r.area.default},active:{style:r.area.active},inactive:{style:r.area.inactive},selected:{style:r.area.selected}},line:{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}},"smooth-line":{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}}},schema:{candle:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},box:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}}},edge:{line:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vhv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},arc:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}}},violin:{violin:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hollow:{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}},"hollow-smooth":{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}}}},components:{axis:{common:n,top:{position:"top",grid:null,title:null,verticalLimitLength:.5},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:.5},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:(0,Ew.deepMix)({},n.grid,{line:{type:"line"}})},radius:{title:null,grid:(0,Ew.deepMix)({},n.grid,{line:{type:"circle"}})}},legend:{common:i,right:{layout:"vertical",padding:t.legendVerticalPadding},left:{layout:"vertical",padding:t.legendVerticalPadding},top:{layout:"horizontal",padding:t.legendHorizontalPadding},bottom:{layout:"horizontal",padding:t.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:t.sliderRailHeight,defaultLength:t.sliderRailWidth,style:{fill:t.sliderRailFillColor,stroke:t.sliderRailBorderColor,lineWidth:t.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:t.sliderLabelTextFillColor,fontSize:t.sliderLabelTextFontSize,lineHeight:t.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily}},handler:{size:t.sliderHandlerWidth,style:{fill:t.sliderHandlerFillColor,stroke:t.sliderHandlerBorderColor}},slidable:!0,padding:i.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:t.tooltipCrosshairsBorderColor,lineWidth:t.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(nG)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:t.tooltipContainerFillColor,opacity:t.tooltipContainerFillOpacity,boxShadow:t.tooltipContainerShadow,borderRadius:"".concat(t.tooltipContainerBorderRadius,"px"),color:t.tooltipTextFillColor,fontSize:"".concat(t.tooltipTextFontSize,"px"),fontFamily:t.fontFamily,lineHeight:"".concat(t.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(iG)]={marginBottom:"12px",marginTop:"12px"},e["".concat(oG)]={margin:0,listStyleType:"none",padding:0},e["".concat(aG)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(sG)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(uG)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:t.annotationArcBorderColor,lineWidth:t.annotationArcBorder},animate:!0},line:{style:{stroke:t.annotationLineBorderColor,lineDash:t.annotationLineDash,lineWidth:t.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textAlign:"start",fontFamily:t.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:t.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:t.annotationRegionBorder,stroke:t.annotationRegionBorderColor,fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:t.brandColor,lineWidth:2}},line:{style:{stroke:t.annotationLineBorderColor,lineWidth:t.annotationLineBorder},length:t.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:t.cSliderBackgroundFillColor,opacity:t.cSliderBackgroundFillOpacity},foregroundStyle:{fill:t.cSliderForegroundFillColor,opacity:t.cSliderForegroundFillOpacity},handlerStyle:{width:t.cSliderHandlerWidth,height:t.cSliderHandlerHeight,fill:t.cSliderHandlerFillColor,opacity:t.cSliderHandlerFillOpacity,stroke:t.cSliderHandlerBorderColor,lineWidth:t.cSliderHandlerBorder,radius:t.cSliderHandlerBorderRadius,highLightFill:t.cSliderHandlerHighlightFillColor},textStyle:{fill:t.cSliderTextFillColor,opacity:t.cSliderTextFillOpacity,fontSize:t.cSliderTextFontSize,lineHeight:t.cSliderTextLineHeight,fontWeight:t.cSliderTextFontWeight,stroke:t.cSliderTextBorderColor,lineWidth:t.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:t.scrollbarTrackFillColor,thumbColor:t.scrollbarThumbFillColor}},hover:{style:{thumbColor:t.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:t.labelFillColor,fontSize:t.labelFontSize,fontFamily:t.fontFamily,stroke:t.labelBorderColor,lineWidth:t.labelBorder},fillColorDark:t.labelFillColorDark,fillColorLight:t.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:t.innerLabelFillColor,fontSize:t.innerLabelFontSize,fontFamily:t.fontFamily,stroke:t.innerLabelBorderColor,lineWidth:t.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:t.overflowLabelFillColor,fontSize:t.overflowLabelFontSize,fontFamily:t.fontFamily,stroke:t.overflowLabelBorderColor,lineWidth:t.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:t.labelLineBorder}},autoRotate:!0}}}var mH="#000",bH="#595959",xH="#8C8C8C",wH="#BFBFBF",_H="#D9D9D9",SH="#F0F0F0",EH="#FFFFFF",kH="#D9D9D9",TH=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],CH=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],OH=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],AH=function(t){void 0===t&&(t={});var e=t.paletteQualitative10,r=void 0===e?TH:e,n=t.paletteQualitative20,i=void 0===n?CH:n,o=t.brandColor,a=void 0===o?r[0]:o,s={backgroundColor:"transparent",brandColor:a,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:r,paletteQualitative20:i,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:OH,fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial,\n "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n "Noto Color Emoji"',axisLineBorderColor:wH,axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:bH,axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:kH,axisTickLineBorderColor:wH,axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:_H,axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:xH,axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:_H,axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:xH,legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:a,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:bH,legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:mH,legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:mH,legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:xH,legendPageNavigatorTextFontSize:12,sliderRailFillColor:_H,sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:xH,sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:SH,sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:wH,annotationArcBorderColor:_H,annotationArcBorder:1,annotationLineBorderColor:wH,annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:bH,annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:mH,annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:wH,tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:bH,tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:bH,labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:EH,innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:bH,overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:EH,overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:wH,cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:a,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:EH,pointBorderOpacity:1,pointActiveBorderColor:mH,pointSelectedBorder:2,pointSelectedBorderColor:mH,pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:a,hollowPointBorderOpacity:.95,hollowPointFillColor:EH,hollowPointActiveBorder:1,hollowPointActiveBorderColor:mH,hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:mH,hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:a,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:a,areaFillOpacity:.25,areaActiveFillColor:a,areaActiveFillOpacity:.5,areaSelectedFillColor:a,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:a,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:mH,hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:mH,hollowAreaInactiveBorderOpacity:.3,intervalFillColor:a,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:mH,intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:mH,intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:a,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:EH,hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:mH,hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:mH,hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return(0,Sw.__assign)((0,Sw.__assign)({},s),t)};AH();function PH(t){var e=t.styleSheet,r=void 0===e?{}:e,n=(0,Sw.__rest)(t,["styleSheet"]),i=AH(r);return(0,Ew.deepMix)({},gH(i),n)}var MH={default:PH({})};function IH(t){return(0,Ew.get)(MH,(0,Ew.lowerCase)(t),MH.default)}function LH(t,e){MH[(0,Ew.lowerCase)(t)]=PH(e)}function jH(t,e,r){var n=r.translate(t),i=r.translate(e);return(0,Ew.isNumberEqual)(n,i)}function NH(t,e,r){var n=r.coordinate,i=r.getYScale(),o=i.field,a=n.invert(e),s=i.invert(a.y);return(0,Ew.find)(t,function(t){var e=t[MF];return e[o][0]<=s&&e[o][1]>=s})||t[t.length-1]}var RH=(0,Ew.memoize)(function(t){if(t.isCategory)return 1;for(var e=t.values,r=e.length,n=t.translate(e[0]),i=n,o=0;oi&&(i=s)}return(i-n)/(r-1)});function DH(t){var e,r,n,i=function(t){var e=(0,Ew.values)(t.attributes);return(0,Ew.filter)(e,function(t){return(0,Ew.contains)(PF,t.type)})}(t);try{for(var o=(0,Sw.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.getScale(s.type);if(u&&u.isLinear)if("cat"!==eV(u,(0,Ew.get)(t.scaleDefs,u.field),s.type,t.type)){n=u;break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}var l=t.getXScale(),c=t.getYScale();return n||c||l}function BH(t,e,r){if(0===e.length)return null;var n=r.type,i=r.getXScale(),o=r.getYScale(),a=i.field,s=o.field,u=null;if("heatmap"===n||"point"===n){for(var l=r.coordinate.invert(t),c=i.invert(l.x),f=o.invert(l.y),h=1/0,p=0;p(1+o)/2&&(s=a),n.translate(n.invert(s))}(t,r),x=g[MF][a],w=g[MF][s],_=m[MF][a],S=o.isLinear&&(0,Ew.isArray)(w);if((0,Ew.isArray)(x)){for(p=0;p=b){if(!S){u=A;break}(0,Ew.isArray)(u)||(u=[]),u.push(A)}}(0,Ew.isArray)(u)&&(u=NH(u,t,r))}else{var E=void 0;if(i.isLinear||"timeCat"===i.type){if((b>i.translate(_)||bi.max||bMath.abs(i.translate(E[MF][a])-b)&&(m=E)}var P=RH(r.getXScale());return!u&&Math.abs(i.translate(m[MF][a])-b)<=P/2&&(u=m),u}function FH(t,e,r,n){var i,o;void 0===r&&(r=""),void 0===n&&(n=!1);var a,s=t[MF],u=function(t,e,r){var n=e.getAttribute("position").getFields(),i=e.scales,o=(0,Ew.isFunction)(r)||!r?n[0]:r,a=i[o],s=a?a.getText(t[o]):t[o]||o;return(0,Ew.isFunction)(r)?r(s,t):s}(s,e,r),l=e.tooltipOption,c=e.theme.defaultColor,f=[];function h(e,r){if(n||!(0,Ew.isNil)(r)&&""!==r){var i={title:u,data:s,mappingData:t,name:e,value:r,color:t.color||c,marker:!0};f.push(i)}}if((0,Ew.isObject)(l)){var p=l.fields,d=l.callback;if(d){var y=p.map(function(e){return t[MF][e]}),v=d.apply(void 0,(0,Sw.__spreadArray)([],(0,Sw.__read)(y),!1)),g=(0,Sw.__assign)({data:t[MF],mappingData:t,title:u,color:t.color||c,marker:!0},v);f.push(g)}else{var m=e.scales;try{for(var b=(0,Sw.__values)(p),x=b.next();!x.done;x=b.next()){var w=x.value;if(!(0,Ew.isNil)(s[w])){var _=m[w];h(nV(_),a=_.getText(s[w]))}}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}else{var S=DH(e);a=function(t,e){var r=t[e.field];return(0,Ew.isArray)(r)?r.map(function(t){return e.getText(t)}).join("-"):e.getText(r)}(s,S),h(function(t,e){var r,n=e.getGroupScales();if(n.length&&(r=n[0]),r){var i=r.field;return r.getText(t[i])}return nV(DH(e))}(s,e),a)}return f}function zH(t,e,r,n){var i,o,a=n.showNil,s=[],u=t.dataArray;if(!(0,Ew.isEmpty)(u)){t.sort(u);try{for(var l=(0,Sw.__values)(u),c=l.next();!c.done;c=l.next()){var f=BH(e,c.value,t);if(f){var h=t.getElementId(f),p=t.elementsMap[h];if("heatmap"===t.type||p.visible){var d=FH(f,t,r,a);d.length&&s.push(d)}}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}return s}function UH(t,e,r,n){var i=n.showNil,o=[],a=t.container.getShape(e.x,e.y);if(a&&a.get("visible")&&a.get("origin")){var s=FH(a.get("origin").mappingData,t,r,i);s.length&&o.push(s)}return o}function GH(t,e,r){var n,i,o=[],a=t.geometries,s=r.shared,u=r.title,l=r.reversed;try{for(var c=(0,Sw.__values)(a),f=c.next();!f.done;f=c.next()){var h=f.value;if(h.visible&&!1!==h.tooltipOption){var p=h.type,d=void 0;(d=["point","edge","polygon"].includes(p)?UH(h,e,u,r):["area","line","path","heatmap"].includes(p)?zH(h,e,u,r):!1!==s?zH(h,e,u,r):UH(h,e,u,r)).length&&(l&&d.reverse(),o.push(d))}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return o}function VH(t){void 0===t&&(t=0);var e=(0,Ew.isArray)(t)?t:[t];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=(0,Sw.__spreadArray)((0,Sw.__spreadArray)([],(0,Sw.__read)(e),!1),(0,Sw.__read)(e),!1);break;case 3:e=(0,Sw.__spreadArray)((0,Sw.__spreadArray)([],(0,Sw.__read)(e),!1),[e[1]],!1);break;default:e=e.slice(0,4)}return e}var HH={};function WH(t,e){HH[t]=e}var qH=function(){function t(t){this.option=this.wrapperOption(t)}return t.prototype.update=function(t){return this.option=this.wrapperOption(t),this},t.prototype.hasAction=function(t){var e=this.option.actions;return(0,Ew.some)(e,function(e){return e[0]===t})},t.prototype.create=function(t,e){var r=this.option,n=r.type,i=r.cfg,o="theta"===n,a=(0,Sw.__assign)({start:t,end:e},i),s=function(t){return kz[t.toLowerCase()]}(o?"polar":n);return this.coordinate=new s(a),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},t.prototype.adjust=function(t,e){return this.coordinate.update({start:t,end:e}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},t.prototype.rotate=function(t){return this.option.actions.push(["rotate",t]),this},t.prototype.reflect=function(t){return this.option.actions.push(["reflect",t]),this},t.prototype.scale=function(t,e){return this.option.actions.push(["scale",t,e]),this},t.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},t.prototype.getOption=function(){return this.option},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.wrapperOption=function(t){return(0,Sw.__assign)({type:"rect",actions:[],cfg:{}},t)},t.prototype.execActions=function(t){var e=this,r=this.option.actions;(0,Ew.each)(r,function(r){var n,i=(0,Sw.__read)(r),o=i[0],a=i.slice(1);(!!(0,Ew.isNil)(t)||t.includes(o))&&(n=e.coordinate)[o].apply(n,(0,Sw.__spreadArray)([],(0,Sw.__read)(a),!1))})},t}(),YH=function(){function t(t,e,r){this.view=t,this.gEvent=e,this.data=r,this.type=e.type}return t.fromData=function(e,r,n){return new t(e,new lE.Event(r,{}),n)},Object.defineProperty(t.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},t.prototype.clone=function(){return new t(this.view,this.gEvent,this.data)},t}();function XH(t){var e=t.getController("axis"),r=t.getController("legend"),n=t.getController("annotation");[e,t.getController("slider"),t.getController("scrollbar"),r,n].forEach(function(t){t&&t.layout()})}var ZH=function(){function t(){this.scales=new Map,this.syncScales=new Map}return t.prototype.createScale=function(t,e,r,n){var i=r,o=this.getScaleMeta(n);if(0===e.length&&o){var a=o.scale,s={type:a.type};a.isCategory&&(s.values=a.values),i=(0,Ew.deepMix)(s,o.scaleDef,r)}var u=rV(t,e,i);return this.cacheScale(u,r,n),u},t.prototype.sync=function(t,e){var r=this;this.syncScales.forEach(function(n,i){var o=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=[];(0,Ew.each)(n,function(t){var e=r.getScale(t);a=(0,Ew.isNumber)(e.max)?Math.max(a,e.max):a,o=(0,Ew.isNumber)(e.min)?Math.min(o,e.min):o,(0,Ew.each)(e.values,function(t){s.includes(t)||s.push(t)})}),(0,Ew.each)(n,function(n){var i=r.getScale(n);if(i.isContinuous)i.change({min:o,max:a,values:s});else if(i.isCategory){var u=i.range,l=r.getScaleMeta(n);s&&!(0,Ew.get)(l,["scaleDef","range"])&&(u=iV((0,Ew.deepMix)({},i,{values:s}),t,e)),i.change({values:s,range:u})}})})},t.prototype.cacheScale=function(t,e,r){var n=this.getScaleMeta(r);n&&n.scale.type===t.type?(!function(t,e){if("identity"!==t.type&&"identity"!==e.type){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);t.change(r)}}(n.scale,t),n.scaleDef=e):(n={key:r,scale:t,scaleDef:e},this.scales.set(r,n));var i=this.getSyncKey(n);if(n.syncKey=i,this.removeFromSyncScales(r),i){var o=this.syncScales.get(i);o||(o=[],this.syncScales.set(i,o)),o.push(r)}},t.prototype.getScale=function(t){var e=this.getScaleMeta(t);if(!e){var r=(0,Ew.last)(t.split("-")),n=this.syncScales.get(r);n&&n.length&&(e=this.getScaleMeta(n[0]))}return e&&e.scale},t.prototype.deleteScale=function(t){var e=this.getScaleMeta(t);if(e){var r=e.syncKey,n=this.syncScales.get(r);if(n&&n.length){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}this.scales.delete(t)},t.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},t.prototype.removeFromSyncScales=function(t){var e=this;this.syncScales.forEach(function(r,n){var i=r.indexOf(t);if(-1!==i)return r.splice(i,1),0===r.length&&e.syncScales.delete(n),!1})},t.prototype.getSyncKey=function(t){var e=t.scale,r=t.scaleDef,n=e.field,i=(0,Ew.get)(r,["sync"]);return!0===i?n:!1===i?void 0:i},t.prototype.getScaleMeta=function(t){return this.scales.get(t)},t}(),KH=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.top=t,this.right=e,this.bottom=r,this.left=n}return t.instance=function(e,r,n,i){return void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=0),new t(e,r,n,i)},t.prototype.max=function(t){var e=(0,Sw.__read)(t,4),r=e[0],n=e[1],i=e[2],o=e[3];return this.top=Math.max(this.top,r),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,i),this.left=Math.max(this.left,o),this},t.prototype.shrink=function(t){var e=(0,Sw.__read)(t,4),r=e[0],n=e[1],i=e[2],o=e[3];return this.top+=r,this.right+=n,this.bottom+=i,this.left+=o,this},t.prototype.inc=function(t,e){var r=t.width,n=t.height;switch(e){case _F.TOP:case _F.TOP_LEFT:case _F.TOP_RIGHT:this.top+=n;break;case _F.RIGHT:case _F.RIGHT_TOP:case _F.RIGHT_BOTTOM:this.right+=r;break;case _F.BOTTOM:case _F.BOTTOM_LEFT:case _F.BOTTOM_RIGHT:this.bottom+=n;break;case _F.LEFT:case _F.LEFT_TOP:case _F.LEFT_BOTTOM:this.left+=r}return this},t.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},t.prototype.clone=function(){return new(t.bind.apply(t,(0,Sw.__spreadArray)([void 0],(0,Sw.__read)(this.getPadding()),!1)))},t}();function JH(t){var e=t.padding;if(!function(t){return!(0,Ew.isNumber)(t)&&!(0,Ew.isArray)(t)}(e))return new(KH.bind.apply(KH,(0,Sw.__spreadArray)([void 0],(0,Sw.__read)(VH(e)),!1)));var r=t.viewBBox,n=new KH,i=[],o=[],a=[];return(0,Ew.each)(t.getComponents(),function(t){var e=t.type;e===SF.AXIS?i.push(t):[SF.LEGEND,SF.SLIDER,SF.SCROLLBAR].includes(e)?o.push(t):e!==SF.GRID&&e!==SF.TOOLTIP&&a.push(t)}),(0,Ew.each)(i,function(t){var e=t.component.getLayoutBBox(),i=new ZG(e.x,e.y,e.width,e.height).exceed(r);n.max(i)}),(0,Ew.each)(o,function(t){var e=t.component,r=t.direction,i=e.getLayoutBBox(),o=e.get("padding"),a=new ZG(i.x,i.y,i.width,i.height).expand(o);n.inc(a,r)}),(0,Ew.each)(a,function(t){var e=t.component,r=t.direction,i=e.getLayoutBBox(),o=new ZG(i.x,i.y,i.width,i.height);n.inc(o,r)}),n}function QH(t,e,r){var n=r.instance();e.forEach(function(t){t.autoPadding=n.max(t.autoPadding.getPadding())})}var $H=function(t){function e(e){var r=t.call(this,{visible:e.visible})||this;r.views=[],r.geometries=[],r.controllers=[],r.interactions={},r.limitInPlot=!1,r.options={data:[],animate:!0},r.usedControllers=Object.keys(HH),r.scalePool=new ZH,r.layoutFunc=XH,r.isPreMouseInPlot=!1,r.isDataChanged=!1,r.isCoordinateChanged=!1,r.createdScaleKeys=new Map,r.onCanvasEvent=function(t){var e=t.name;if(!e.includes(":")){var n=r.createViewEvent(t);r.doPlotEvent(n),r.emit(e,n)}},r.onDelegateEvents=function(t){var e=t.name;if(e.includes(":")){var n=r.createViewEvent(t);r.emit(e,n)}};var n=e.id,i=void 0===n?(0,Ew.uniqueId)("view"):n,o=e.parent,a=e.canvas,s=e.backgroundGroup,u=e.middleGroup,l=e.foregroundGroup,c=e.region,f=void 0===c?{start:{x:0,y:0},end:{x:1,y:1}}:c,h=e.padding,p=e.appendPadding,d=e.theme,y=e.options,v=e.limitInPlot,g=e.syncViewPadding;return r.parent=o,r.canvas=a,r.backgroundGroup=s,r.middleGroup=u,r.foregroundGroup=l,r.region=f,r.padding=h,r.appendPadding=p,r.options=(0,Sw.__assign)((0,Sw.__assign)({},r.options),y),r.limitInPlot=v,r.id=i,r.syncViewPadding=g,r.themeObject=(0,Ew.isObject)(d)?(0,Ew.deepMix)({},IH("default"),PH(d)):IH(d),r.init(),r}return(0,Sw.__extends)(e,t),e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,e){void 0===t&&(t=!1),this.emit(kF.BEFORE_RENDER,YH.fromData(this,kF.BEFORE_RENDER,e)),this.paint(t),this.emit(kF.AFTER_RENDER,YH.fromData(this,kF.AFTER_RENDER,e)),!1===this.visible&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(kF.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var e=this.geometries,r=0;r
      ');k.appendChild(T);var C=BF(k,s,i,o),O=new(NF(f).Canvas)((0,Sw.__assign)({container:T,pixelRatio:h,localRefresh:d,supportCSSTransform:m},C));return(r=t.call(this,{parent:null,canvas:O,backgroundGroup:O.addGroup({zIndex:AF.BG}),middleGroup:O.addGroup({zIndex:AF.MID}),foregroundGroup:O.addGroup({zIndex:AF.FORE}),padding:u,appendPadding:l,visible:v,options:w,limitInPlot:_,theme:S,syncViewPadding:E})||this).onResize=(0,Ew.debounce)(function(){r.forceFit()},300),r.ele=k,r.canvas=O,r.width=C.width,r.height=C.height,r.autoFit=s,r.localRefresh=d,r.renderer=f,r.wrapperElement=T,r.updateCanvasStyle(),r.bindAutoFit(),r.initDefaultInteractions(x),r}return(0,Sw.__extends)(e,t),e.prototype.initDefaultInteractions=function(t){var e=this;(0,Ew.each)(t,function(t){e.interaction(t)})},e.prototype.aria=function(t){!1===t?this.ele.removeAttribute("aria-label"):this.ele.setAttribute("aria-label",t.label)},e.prototype.changeSize=function(t,e){return this.width===t&&this.height===e?this:(this.emit(kF.BEFORE_CHANGE_SIZE),this.width=t,this.height=e,this.canvas.changeSize(t,e),this.render(!0),this.emit(kF.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){t.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){var e,r;t.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),e=this.wrapperElement,(r=e.parentNode)&&r.removeChild(e),this.wrapperElement=null},e.prototype.changeVisible=function(e){return t.prototype.changeVisible.call(this,e),this.wrapperElement.style.display=e?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=BF(this.ele,!0,this.width,this.height),e=t.width,r=t.height;this.changeSize(e,r)}},e.prototype.updateCanvasStyle=function(){BA(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(eW),nW=function(){function t(t){this.visible=!0,this.components=[],this.view=t}return t.prototype.clear=function(t){(0,Ew.each)(this.components,function(t){t.component.destroy()}),this.components=[]},t.prototype.destroy=function(){this.clear()},t.prototype.getComponents=function(){return this.components},t.prototype.changeVisible=function(t){this.visible!==t&&(this.components.forEach(function(e){t?e.component.show():e.component.hide()}),this.visible=t)},t}();var iW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLocked=!1,e}return(0,Sw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.isVisible=function(){return!1!==this.view.getOptions().tooltip},e.prototype.render=function(){},e.prototype.showTooltip=function(t){if(this.point=t,this.isVisible()){var e=this.view,r=this.getTooltipItems(t);if(r.length){var n=this.getTitle(r),i={x:r[0].x,y:r[0].y};e.emit("tooltip:show",YH.fromData(e,"tooltip:show",(0,Sw.__assign)({items:r,title:n},t)));var o=this.getTooltipCfg(),a=o.follow,s=o.showMarkers,u=o.showCrosshairs,l=o.showContent,c=o.marker,f=this.items,h=this.title;if((0,Ew.isEqual)(h,n)&&(0,Ew.isEqual)(f,r)?(this.tooltip&&a&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()):(e.emit("tooltip:change",YH.fromData(e,"tooltip:change",(0,Sw.__assign)({items:r,title:n},t))),((0,Ew.isFunction)(l)?l(r):l)&&(this.tooltip||this.renderTooltip(),this.tooltip.update((0,Ew.mix)({},o,{items:this.getItemsAfterProcess(r),title:n},a?t:{})),this.tooltip.show()),s&&this.renderTooltipMarkers(r,c)),this.items=r,this.title=n,u){var p=(0,Ew.get)(o,["crosshairs","follow"],!1);this.renderCrosshairs(p?t:i,o)}}else this.hideTooltip()}},e.prototype.hideTooltip=function(){if(this.getTooltipCfg().follow){var t=this.tooltipMarkersGroup;t&&t.hide();var e=this.xCrosshair,r=this.yCrosshair;e&&e.hide(),r&&r.hide();var n=this.tooltip;n&&n.hide(),this.view.emit("tooltip:hide",YH.fromData(this.view,"tooltip:hide",{})),this.point=null}else this.point=null},e.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},e.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},e.prototype.isTooltipLocked=function(){return this.isLocked},e.prototype.clear=function(){var t=this.tooltip,e=this.xCrosshair,r=this.yCrosshair,n=this.tooltipMarkersGroup;t&&(t.hide(),t.clear()),e&&e.clear(),r&&r.clear(),n&&n.clear(),(null===t||void 0===t?void 0:t.get("customContent"))&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},e.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},e.prototype.changeVisible=function(t){if(this.visible!==t){var e=this.tooltip,r=this.tooltipMarkersGroup,n=this.xCrosshair,i=this.yCrosshair;t?(e&&e.show(),r&&r.show(),n&&n.show(),i&&i.show()):(e&&e.hide(),r&&r.hide(),n&&n.hide(),i&&i.hide()),this.visible=t}},e.prototype.getTooltipItems=function(t){var e,r,n,i,o,a,s=this.findItemsFromView(this.view,t);if(s.length){s=(0,Ew.flatten)(s);try{for(var u=(0,Sw.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value;try{for(var f=(n=void 0,(0,Sw.__values)(c)),h=f.next();!h.done;h=f.next()){var p=h.value,d=p.mappingData,y=d.x,v=d.y;p.x=(0,Ew.isArray)(y)?y[y.length-1]:y,p.y=(0,Ew.isArray)(v)?v[v.length-1]:v}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(!1===this.getTooltipCfg().shared&&s.length>1){var g=s[0],m=Math.abs(t.y-g[0].y);try{for(var b=(0,Sw.__values)(s),x=b.next();!x.done;x=b.next()){var w=x.value,_=Math.abs(t.y-w[0].y);_<=m&&(g=w,m=_)}}catch(t){o={error:t}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}s=[g]}return function(t){for(var e=[],r=function(r){var n=t[r];(0,Ew.find)(e,function(t){return t.color===n.color&&t.name===n.name&&t.value===n.value&&t.title===n.title})||e.push(n)},n=0;n'+n+"":n}})},e.prototype.getTitle=function(t){var e=t[0].title||t[0].name;return this.title=e,e},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),e={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},r=this.getTooltipCfg(),n=new DG((0,Sw.__assign)((0,Sw.__assign)({parent:t.get("el").parentNode,region:e},r),{visible:!1,crosshairs:null}));n.init(),this.tooltip=n},e.prototype.renderTooltipMarkers=function(t,e){var r,n,i=this.getTooltipMarkersGroup(),o=this.view.getRootView(),a=o.limitInPlot;try{for(var s=(0,Sw.__values)(t),u=s.next();!u.done;u=s.next()){var l=u.value,c=l.x,f=l.y;if(a||(null===i||void 0===i?void 0:i.getClip())){var h=$G(o.getCoordinate()),p=h.type,d=h.attrs;null===i||void 0===i||i.setClip({type:p,attrs:d})}else null===i||void 0===i||i.setClip(void 0);var y=this.view.getTheme(),v=(0,Ew.get)(y,["components","tooltip","marker"],{}),g=(0,Sw.__assign)((0,Sw.__assign)({fill:l.color,symbol:"circle",shadowColor:l.color},(0,Ew.isFunction)(e)?(0,Sw.__assign)((0,Sw.__assign)({},v),e(l)):e),{x:c,y:f});i.addShape("marker",{attrs:g})}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.renderCrosshairs=function(t,e){var r=(0,Ew.get)(e,["crosshairs","type"],"x");"x"===r?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,e)):"y"===r?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,e)):"xy"===r&&(this.renderXCrosshairs(t,e),this.renderYCrosshairs(t,e))},e.prototype.renderXCrosshairs=function(t,e){var r,n,i=this.getViewWithGeometry(this.view).getCoordinate();if(i.isRect)i.isTransposed?(r={x:i.start.x,y:t.y},n={x:i.end.x,y:t.y}):(r={x:t.x,y:i.end.y},n={x:t.x,y:i.start.y});else{var o=QG(i,t),a=i.getCenter(),s=i.getRadius();n=zG(a.x,a.y,s,o),r=a}var u=(0,Ew.deepMix)({start:r,end:n,container:this.getTooltipCrosshairsGroup()},(0,Ew.get)(e,"crosshairs",{}),this.getCrosshairsText("x",t,e));delete u.type;var l=this.xCrosshair;l?l.update(u):(l=new VU(u)).init(),l.render(),l.show(),this.xCrosshair=l},e.prototype.renderYCrosshairs=function(t,e){var r,n,i=this.getViewWithGeometry(this.view).getCoordinate();if(i.isRect){var o=void 0,a=void 0;i.isTransposed?(o={x:t.x,y:i.end.y},a={x:t.x,y:i.start.y}):(o={x:i.start.x,y:t.y},a={x:i.end.x,y:t.y}),r={start:o,end:a},n="Line"}else r={center:i.getCenter(),radius:JG(i,t),startAngle:i.startAngle,endAngle:i.endAngle},n="Circle";delete(r=(0,Ew.deepMix)({container:this.getTooltipCrosshairsGroup()},r,(0,Ew.get)(e,"crosshairs",{}),this.getCrosshairsText("y",t,e))).type;var s=this.yCrosshair;s?i.isRect&&"circle"===s.get("type")||!i.isRect&&"line"===s.get("type")?(s=new E[n](r)).init():s.update(r):(s=new E[n](r)).init(),s.render(),s.show(),this.yCrosshair=s},e.prototype.getCrosshairsText=function(t,e,r){var n=(0,Ew.get)(r,["crosshairs","text"]),i=(0,Ew.get)(r,["crosshairs","follow"]),o=this.items;if(n){var a=this.getViewWithGeometry(this.view),s=o[0],u=a.getXScale(),l=a.getYScales()[0],c=void 0,f=void 0;if(i){var h=this.view.getCoordinate().invert(e);c=u.invert(h.x),f=l.invert(h.y)}else c=s.data[u.field],f=s.data[l.field];var p="x"===t?c:f;return(0,Ew.isFunction)(n)?n=n(t,p,o,e):n.content=p,{text:n}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):((t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"})).toFront(),this.tooltipMarkersGroup=t),t},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||((t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1})).toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,e){var r,n;if(!1===t.getOptions().tooltip)return[];var i=GH(t,e,this.getTooltipCfg());try{for(var o=(0,Sw.__values)(t.views),a=o.next();!a.done;a=o.next()){var s=a.value;i=i.concat(this.findItemsFromView(s,e))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.getViewWithGeometry=function(t){var e=this;return t.geometries.length?t:(0,Ew.find)(t.views,function(t){return e.getViewWithGeometry(t)})},e.prototype.getItemsAfterProcess=function(t){var e=this.getTooltipCfg().customItems;return(e||function(t){return t})(t)},e}(nW),oW={};function aW(t){return oW[t.toLowerCase()]}function sW(t,e){oW[t.toLowerCase()]=e}var uW={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},lW={interval:function(t){return{enter:{animation:t.isRect?t.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:t.isPolar&&t.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},cW={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(t){var e;return t.isRect?e=t.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",t.isPolar&&t.isTransposed&&(e="wave-in")),{animation:e}},schema:function(t){return{animation:t.isRect?t.isTransposed?"grow-in-x":"grow-in-y":"grow-in-xy"}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function fW(t,e,r){var n=lW[t];return n&&((0,Ew.isFunction)(n)&&(n=n(e)),n=(0,Ew.deepMix)({},uW,n),r)?n[r]:n}function hW(t,e,r){var n=(0,Ew.get)(t.get("origin"),"data",MF),i=e.animation,o=function(t,e){return{delay:(0,Ew.isFunction)(t.delay)?t.delay(e):t.delay,easing:(0,Ew.isFunction)(t.easing)?t.easing(e):t.easing,duration:(0,Ew.isFunction)(t.duration)?t.duration(e):t.duration,callback:t.callback,repeat:t.repeat}}(e,n);if(i){var a=aW(i);a&&a(t,o,r)}else t.animate(r.toAttrs,o)}var pW=function(t){function e(e){var r=t.call(this,e)||this;r.labelShape=[],r.states=[];var n=e.shapeFactory,i=e.container,o=e.offscreenGroup,a=e.elementIndex,s=e.visible,u=void 0===s||s;return r.shapeFactory=n,r.container=i,r.offscreenGroup=o,r.visible=u,r.elementIndex=a,r}return(0,Sw.__extends)(e,t),e.prototype.draw=function(t,e){void 0===e&&(e=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,e),!1===this.visible&&this.changeVisible(!1)},e.prototype.update=function(t){var e=this.shapeFactory,r=this.shape;if(r){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(r,t);var n=this.getOffscreenGroup(),i=e.drawShape(this.shapeType,t,n);i.cfg.data=this.data,i.cfg.origin=t,i.cfg.element=this,this.syncShapeStyle(r,i,this.getStates(),this.getAnimateCfg("update"))}},e.prototype.destroy=function(){var e=this.shapeFactory,r=this.shape;if(r){var n=this.getAnimateCfg("leave");n?hW(r,n,{coordinate:e.coordinate,toAttrs:(0,Sw.__assign)({},r.attr())}):r.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,t.prototype.destroy.call(this)},e.prototype.changeVisible=function(e){t.prototype.changeVisible.call(this,e),e?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(t){t.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(t){t.hide()}))},e.prototype.setState=function(t,e){var r=this,n=r.states,i=r.shapeFactory,o=r.model,a=r.shape,s=r.shapeType,u=n.indexOf(t);if(e){if(u>-1)return;n.push(t),"active"!==t&&"selected"!==t||null===a||void 0===a||a.toFront()}else{if(-1===u)return;if(n.splice(u,1),"active"===t||"selected"===t){var l=this.geometry,c=l.sortZIndex,f=l.zIndexReversed?this.geometry.elements.length-this.elementIndex:this.elementIndex;c?a.setZIndex(f):a.set("zIndex",f)}}var h=i.drawShape(s,o,this.getOffscreenGroup());n.length?this.syncShapeStyle(a,h,n,null):this.syncShapeStyle(a,h,["reset"],null),h.remove(!0);var p={state:t,stateStatus:e,element:this,target:this.container};this.container.emit("statechange",p),Cz(this.shape,"statechange",p)},e.prototype.clearStates=function(){var t=this,e=this.states;(0,Ew.each)(e,function(e){t.setState(e,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this.shape,e=this.labelShape,r={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return t&&(r=t.getCanvasBBox()),e&&e.forEach(function(t){var e=t.getCanvasBBox();r.x=Math.min(e.x,r.x),r.y=Math.min(e.y,r.y),r.minX=Math.min(e.minX,r.minX),r.minY=Math.min(e.minY,r.minY),r.maxX=Math.max(e.maxX,r.maxX),r.maxY=Math.max(e.maxY,r.maxY)}),r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this.shapeType,e=this.geometry,r=this.shapeFactory,n=e.stateOption,i=r.defaultShapeType,o=r.theme[t]||r.theme[i];this.statesStyle=(0,Ew.deepMix)({},o,n)}return this.statesStyle},e.prototype.getStateStyle=function(t,e){var r=this.getStatesStyle(),n=(0,Ew.get)(r,[t,"style"],{}),i=n[e]||n;return(0,Ew.isFunction)(i)?i(this):i},e.prototype.getAnimateCfg=function(t){var e=this,r=this.animate;if(r){var n=r[t];return n?(0,Sw.__assign)((0,Sw.__assign)({},n),{callback:function(){var t;(0,Ew.isFunction)(n.callback)&&n.callback(),null===(t=e.geometry)||void 0===t||t.emit(TF.AFTER_DRAW_ANIMATE)}}):n}return null},e.prototype.drawShape=function(t,e){var r;void 0===e&&(e=!1);var n=this.shapeFactory,i=this.container,o=this.shapeType;if(this.shape=n.drawShape(o,t,i),this.shape){this.setShapeInfo(this.shape,t);var a=this.shape.cfg.name;a?(0,Ew.isString)(a)&&(this.shape.cfg.name=["element",a]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var s=e?"enter":"appear",u=this.getAnimateCfg(s);u&&(null===(r=this.geometry)||void 0===r||r.emit(TF.BEFORE_DRAW_ANIMATE),hW(this.shape,u,{coordinate:n.coordinate,toAttrs:(0,Sw.__assign)({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,e){var r=this;(t.cfg.origin=e,t.cfg.element=this,t.isGroup())&&t.get("children").forEach(function(t){r.setShapeInfo(t,e)})},e.prototype.syncShapeStyle=function(t,e,r,n,i){var o,a=this;if(void 0===r&&(r=[]),void 0===i&&(i=0),t&&e){var s=t.get("clipShape"),u=e.get("clipShape");if(this.syncShapeStyle(s,u,r,n),t.isGroup())for(var l=t.get("children"),c=e.get("children"),f=0;f=0?e:r<=0?r:0},e.prototype.createAttrOption=function(t,e,r){if((0,Ew.isNil)(e)||(0,Ew.isObject)(e))(0,Ew.isObject)(e)&&(0,Ew.isEqual)(Object.keys(e),["values"])?(0,Ew.set)(this.attributeOption,t,{fields:e.values}):(0,Ew.set)(this.attributeOption,t,e);else{var n={};(0,Ew.isNumber)(e)?n.values=[e]:n.fields=CW(e),r&&((0,Ew.isFunction)(r)?n.callback=r:n.values=r),(0,Ew.set)(this.attributeOption,t,n)}},e.prototype.initAttributes=function(){var t=this,e=this.attributes,r=this.attributeOption,n=this.theme,i=this.shapeType;this.groupScales=[];var o={},a=function(a){if(r.hasOwnProperty(a)){var s=r[a];if(!s)return{value:void 0};var u=(0,Sw.__assign)({},s),l=u.callback,c=u.values,f=u.fields,h=(void 0===f?[]:f).map(function(e){var r=t.scales[e];!o[e]&&PF.includes(a)&&("cat"===eV(r,(0,Ew.get)(t.scaleDefs,e),a,t.type)&&(t.groupScales.push(r),o[e]=!0));return r});u.scales=h,"position"!==a&&1===h.length&&"identity"===h[0].type?u.values=h[0].values:l||c||("size"===a?u.values=n.sizes:"shape"===a?u.values=n.shapes[i]||[]:"color"===a&&(h.length?u.values=h[0].values.length<=10?n.colors10:n.colors20:u.values=n.colors10));var p=bz(a);e[a]=new p(u)}};for(var s in r){var u=a(s);if("object"===AW(u))return u.value}},e.prototype.processData=function(t){var e,r;this.hasSorted=!1;for(var n=this.getAttribute("position").scales.filter(function(t){return t.isCategory}),i=this.groupData(t),o=[],a=0,s=i.length;ao&&(o=l)}var c=this.scaleDefs,f={};it.max&&!(0,Ew.get)(c,[n,"max"])&&(f.max=o),t.change(f)},e.prototype.beforeMapping=function(t){var e=t;if(this.sortable&&this.sort(e),this.generatePoints)for(var r=0,n=e.length;r1)for(var c=0;c0})}var DW=function(){function t(t){this.shapesMap={};var e=t.layout,r=t.container;this.layout=e,this.container=r}return t.prototype.render=function(t,e,r){return void 0===r&&(r=!1),(0,Sw.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l,c,f=this;return(0,Sw.__generator)(this,function(h){switch(h.label){case 0:if(n={},i=this.createOffscreenGroup(),!t.length)return[3,2];try{for(o=(0,Sw.__values)(t),a=o.next();!a.done;a=o.next())(s=a.value)&&(n[s.id]=this.renderLabel(s,i))}catch(t){l={error:t}}finally{try{a&&!a.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}}return[4,this.doLayout(t,e,n)];case 1:h.sent(),this.renderLabelLine(t,n),this.renderLabelBackground(t,n),this.adjustLabel(t,n),h.label=2;case 2:return u=this.shapesMap,(0,Ew.each)(n,function(t,e){if(t.destroyed)delete n[e];else{if(u[e]){var i=t.get("data"),o=t.get("origin"),a=t.get("coordinate"),s=t.get("animateCfg"),l=u[e];!function t(e,r,n){var i=n.data,o=n.origin,a=n.animateCfg,s=n.coordinate,u=(0,Ew.get)(a,"update");e.set("data",i),e.set("origin",o),e.set("animateCfg",a),e.set("coordinate",s),e.set("visible",r.get("visible")),(e.getChildren()||[]).forEach(function(l,c){var f=r.getChildByIndex(c);if(f){l.set("data",i),l.set("origin",o),l.set("animateCfg",a),l.set("coordinate",s);var h=HG(l,f);u?hW(l,u,{toAttrs:h,coordinate:s}):l.attr(h),f.isGroup()&&t(l,f,n)}else e.removeChild(l),l.remove(!0)}),(0,Ew.each)(r.getChildren(),function(t,r){(0,Ew.isArray)(e.getChildren())&&r>=e.getCount()&&(t.destroyed||e.add(t))})}(l,n[e],{data:i,origin:o,animateCfg:s,coordinate:a}),n[e]=l}else{if(f.container.destroyed)return;f.container.add(t);var c=(0,Ew.get)(t.get("animateCfg"),r?"enter":"appear");c&&hW(t,c,{toAttrs:(0,Sw.__assign)({},t.attr()),coordinate:t.get("coordinate")})}delete u[e]}}),(0,Ew.each)(u,function(t){var e=(0,Ew.get)(t.get("animateCfg"),"leave");e?hW(t,e,{toAttrs:null,coordinate:t.get("coordinate")}):t.remove(!0)}),this.shapesMap=n,i.destroy(),[2]}})})},t.prototype.clear=function(){this.container.clear(),this.shapesMap={}},t.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},t.prototype.renderLabel=function(t,e){var r,n=t.id,i=t.elementId,o=t.data,a=t.mappingData,s=t.coordinate,u=t.animate,l=t.content,c={id:n,elementId:i,capture:t.capture,data:o,origin:(0,Sw.__assign)((0,Sw.__assign)({},a),{data:a[MF]}),coordinate:s},f=e.addGroup((0,Sw.__assign)({name:"label",animateCfg:!1!==this.animate&&null!==u&&!1!==u&&(0,Ew.deepMix)({},this.animate,u)},c));if(l.isGroup&&l.isGroup()||l.isShape&&l.isShape()){var h=l.getCanvasBBox(),p=h.width,d=h.height,y=(0,Ew.get)(t,"textAlign","left"),v=t.x,g=t.y-d/2;"center"===y?v-=p/2:"right"!==y&&"end"!==y||(v-=p),IW(l,v,g),r=l,f.add(l)}else{var m=(0,Ew.get)(t,["style","fill"]);r=f.addShape("text",(0,Sw.__assign)({attrs:(0,Sw.__assign)((0,Sw.__assign)({x:t.x,y:t.y,textAlign:t.textAlign,textBaseline:(0,Ew.get)(t,"textBaseline","middle"),text:t.content},t.style),{fill:(0,Ew.isNull)(m)?t.color:m})},c))}return t.rotate&&LW(r,t.rotate),f},t.prototype.doLayout=function(t,e,r){return(0,Sw.__awaiter)(this,void 0,void 0,function(){var n,i=this;return(0,Sw.__generator)(this,function(o){switch(o.label){case 0:return this.layout?(n=(0,Ew.isArray)(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(n){var o=mW((0,Ew.get)(n,"type",""));if(o){var a=[],s=[];return(0,Ew.each)(r,function(t,r){a.push(t),s.push(e[t.get("elementId")])}),o(t,a,s,i.region,n.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},t.prototype.renderLabelLine=function(t,e){(0,Ew.each)(t,function(t){var r=(0,Ew.get)(t,"coordinate");if(t&&r){var n=r.getCenter(),i=r.getRadius();if(t.labelLine){var o=(0,Ew.get)(t,"labelLine",{}),a=t.id,s=o.path;if(!s){var u=zG(n.x,n.y,i,t.angle);s=[["M",u.x,u.y],["L",t.x,t.y]]}var l=e[a];l.destroyed||l.addShape("path",{capture:!1,attrs:(0,Sw.__assign)({path:s,stroke:t.color?t.color:(0,Ew.get)(t,["style","fill"],"#000"),fill:null},o.style),id:a,origin:t.mappingData,data:t.data,coordinate:t.coordinate})}}})},t.prototype.renderLabelBackground=function(t,e){(0,Ew.each)(t,function(t){var r=(0,Ew.get)(t,"coordinate"),n=(0,Ew.get)(t,"background");if(n&&r){var i=t.id,o=e[i];if(!o.destroyed){var a=o.getChildren()[0];if(a){var s=NW(o,t,n.padding),u=s.rotation,l=(0,Sw.__rest)(s,["rotation"]),c=o.addShape("rect",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},l),n.style||{}),id:i,origin:t.mappingData,data:t.data,coordinate:t.coordinate});if(c.setZIndex(-1),u){var f=a.getMatrix();c.setMatrix(f)}}}}})},t.prototype.createOffscreenGroup=function(){return new(this.container.getGroupBase())({})},t.prototype.adjustLabel=function(t,e){(0,Ew.each)(t,function(t){if(t){var r=t.id,n=e[r];if(!n.destroyed){var i=n.findAll(function(t){return"path"!==t.get("type")});(0,Ew.each)(i,function(e){e&&(t.offsetX&&e.attr("x",e.attr("x")+t.offsetX),t.offsetY&&e.attr("y",e.attr("y")+t.offsetY))})}}})},t}();function BW(t){var e=0;return(0,Ew.each)(t,function(t){e+=t}),e/t.length}var FW=function(){function t(t){this.geometry=t}return t.prototype.getLabelItems=function(t){var e=this,r=[],n=this.getLabelCfgs(t);return(0,Ew.each)(t,function(t,i){var o=n[i];if(!o||(0,Ew.isNil)(t.x)||(0,Ew.isNil)(t.y))r.push(null);else{var a=(0,Ew.isArray)(o.content)?o.content:[o.content];o.content=a;var s=a.length;(0,Ew.each)(a,function(n,i){if((0,Ew.isNil)(n)||""===n)r.push(null);else{var a=(0,Sw.__assign)((0,Sw.__assign)({},o),e.getLabelPoint(o,t,i));a.textAlign||(a.textAlign=e.getLabelAlign(a,i,s)),a.offset<=0&&(a.labelLine=null),r.push(a)}})}}),r},t.prototype.render=function(t,e){return void 0===e&&(e=!1),(0,Sw.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,Sw.__generator)(this,function(o){switch(o.label){case 0:return r=this.getLabelItems(t),n=this.getLabelsRenderer(),i=this.getGeometryShapes(),[4,n.render(r,i,e)];case 1:return o.sent(),[2]}})})},t.prototype.clear=function(){var t=this.labelsRenderer;t&&t.clear()},t.prototype.destroy=function(){var t=this.labelsRenderer;t&&t.destroy(),this.labelsRenderer=null},t.prototype.getCoordinate=function(){return this.geometry.coordinate},t.prototype.getDefaultLabelCfg=function(t,e){var r=this.geometry,n=r.type,i=r.theme;return"polygon"===n||"interval"===n&&"middle"===e||t<0&&!["line","point","path"].includes(n)?(0,Ew.get)(i,"innerLabels",{}):(0,Ew.get)(i,"labels",{})},t.prototype.getThemedLabelCfg=function(t){var e=this.geometry,r=this.getDefaultLabelCfg(),n=e.type,i=e.theme;return"polygon"===n||t.offset<0&&!["line","point","path"].includes(n)?(0,Ew.deepMix)({},r,i.innerLabels,t):(0,Ew.deepMix)({},r,i.labels,t)},t.prototype.setLabelPosition=function(t,e,r,n){},t.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),r=this.getOffsetVector(t);return e.isTransposed?r[0]:r[1]},t.prototype.getLabelOffsetPoint=function(t,e,r){var n=t.offset,i=this.getCoordinate().isTransposed,o=i?"x":"y",a=i?1:-1,s={x:0,y:0};return s[o]=e>0||1===r?n*a:n*a*-1,s},t.prototype.getLabelPoint=function(t,e,r){var n=this.getCoordinate(),i=t.content.length;function o(e,r,n){void 0===n&&(n=!1);var i=e;return(0,Ew.isArray)(i)&&(i=1===t.content.length?n?BW(i):i.length<=2?i[e.length-1]:BW(i):i[r]),i}var a={content:t.content[r],x:0,y:0,start:{x:0,y:0},color:"#fff"},s=(0,Ew.isArray)(e.shape)?e.shape[0]:e.shape,u="funnel"===s||"pyramid"===s;if("polygon"===this.geometry.type){var l=function(t,e){if((0,Ew.isNumber)(t)&&(0,Ew.isNumber)(e))return[t,e];if(e=e,BG(t=t)||BG(e))return[FG(t),FG(e)];for(var r,n,i=-1,o=0,a=0,s=t.length-1,u=0;++i1&&0===e&&("right"===n?n="left":"left"===n&&(n="right"))}return n},t.prototype.getLabelId=function(t){var e=this.geometry,r=e.type,n=e.getXScale(),i=e.getYScale(),o=t[MF],a=e.getElementId(t);return"line"===r||"area"===r?a+=" ".concat(o[n.field]):"path"===r&&(a+=" ".concat(o[n.field],"-").concat(o[i.field])),a},t.prototype.getLabelsRenderer=function(){var t=this.geometry,e=t.labelsContainer,r=t.labelOption,n=t.canvasRegion,i=t.animateOption,o=this.geometry.coordinate,a=this.labelsRenderer;return a||(a=new DW({container:e,layout:(0,Ew.get)(r,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=a),a.region=n,a.animate=!!i&&fW("label",o),a},t.prototype.getLabelCfgs=function(t){var e=this,r=this.geometry,n=r.labelOption,i=r.scales,o=r.coordinate,a=n,s=a.fields,u=a.callback,l=a.cfg,c=s.map(function(t){return i[t]}),f=[];return(0,Ew.each)(t,function(t,r){var n,i=t[MF],a=e.getLabelText(i,c);if(u){var h=s.map(function(t){return i[t]});if(n=u.apply(void 0,(0,Sw.__spreadArray)([],(0,Sw.__read)(h),!1)),(0,Ew.isNil)(n))return void f.push(null)}var p=(0,Sw.__assign)((0,Sw.__assign)({id:e.getLabelId(t),elementId:e.geometry.getElementId(t),data:i,mappingData:t,coordinate:o},l),n);(0,Ew.isFunction)(p.position)&&(p.position=p.position(i,t,r));var d=e.getLabelOffset(p.offset||0),y=e.getDefaultLabelCfg(d,p.position);(p=(0,Ew.deepMix)({},y,p)).offset=e.getLabelOffset(p.offset||0);var v=p.content;(0,Ew.isFunction)(v)?p.content=v(i,t,r):(0,Ew.isUndefined)(v)&&(p.content=a[0]),f.push(p)}),f},t.prototype.getLabelText=function(t,e){var r=[];return(0,Ew.each)(e,function(e){var n=t[e.field];n=(0,Ew.isArray)(n)?n.map(function(t){return e.getText(t)}):e.getText(n),(0,Ew.isNil)(n)||""===n?r.push(null):r.push(n)}),r},t.prototype.getOffsetVector=function(t){void 0===t&&(t=0);var e=this.getCoordinate(),r=0;return(0,Ew.isNumber)(t)&&(r=t),e.isTransposed?e.applyMatrix(r,0):e.applyMatrix(0,r)},t.prototype.getGeometryShapes=function(){var t=this.geometry,e={};return(0,Ew.each)(t.elementsMap,function(t,r){e[r]=t.shape}),(0,Ew.each)(t.getOffscreenGroup().getChildren(),function(r){var n=t.getElementId(r.get("origin").mappingData);e[n]=r}),e},t}();function zW(t,e,r){if(!t)return r;var n;if(t.callback&&t.callback.length>1){var i=Array(t.callback.length-1).fill("");n=t.mapping.apply(t,(0,Sw.__spreadArray)([e],(0,Sw.__read)(i),!1)).join("")}else n=t.mapping(e).join("");return n||r}var UW={hexagon:function(t,e,r){var n=r/2*Math.sqrt(3);return[["M",t,e-r],["L",t+n,e-r/2],["L",t+n,e+r/2],["L",t,e+r],["L",t-n,e+r/2],["L",t-n,e-r/2],["Z"]]},bowtie:function(t,e,r){var n=r-1.5;return[["M",t-r,e-n],["L",t+r,e+n],["L",t+r,e-n],["L",t-r,e+n],["Z"]]},cross:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e+r],["M",t+r,e-r],["L",t-r,e+r]]},tick:function(t,e,r){return[["M",t-r/2,e-r],["L",t+r/2,e-r],["M",t,e-r],["L",t,e+r],["M",t-r/2,e+r],["L",t+r/2,e+r]]},plus:function(t,e,r){return[["M",t-r,e],["L",t+r,e],["M",t,e-r],["L",t,e+r]]},hyphen:function(t,e,r){return[["M",t-r,e],["L",t+r,e]]},line:function(t,e,r){return[["M",t,e-r],["L",t,e+r]]}},GW=["line","cross","tick","plus","hyphen"];function VW(t){var e=t.symbol;(0,Ew.isString)(e)&&UW[e]&&(t.symbol=UW[e])}function HW(t){return t.startsWith(_F.LEFT)||t.startsWith(_F.RIGHT)?"vertical":"horizontal"}function WW(t,e,r,n,i){var o=r.getScale(r.type);if(o.isCategory){var a=o.field,s=e.getAttribute("color"),u=e.getAttribute("shape"),l=t.getTheme().defaultColor,c=e.coordinate.isPolar;return o.getTicks().map(function(r,f){var h,p=r.text,d=r.value,y=p,v=o.invert(d),g=0===t.filterFieldData(a,[(h={},h[a]=v,h)]).length;(0,Ew.each)(t.views,function(t){var e;t.filterFieldData(a,[(e={},e[a]=v,e)]).length||(g=!0)});var m,b,x=zW(s,v,l),w=zW(u,v,"point"),_=e.getShapeMarker(w,{color:x,isInPolar:c}),S=i;return(0,Ew.isFunction)(S)&&(S=S(y,f,(0,Sw.__assign)({name:y,value:v},(0,Ew.deepMix)({},n,_)))),function(t,e){var r=t.symbol;if((0,Ew.isString)(r)&&-1!==GW.indexOf(r)){var n=(0,Ew.get)(t,"style",{}),i=(0,Ew.get)(n,"lineWidth",1),o=n.stroke||n.fill||e;t.style=(0,Ew.deepMix)({},t.style,{lineWidth:i,stroke:o,fill:null})}}(_=(0,Ew.deepMix)({},n,_,YG((0,Sw.__assign)({},S),["style"])),x),S&&S.style&&(_.style=(m=_.style,b=S.style,(0,Ew.isFunction)(b)?b(m):(0,Ew.deepMix)({},m,b))),VW(_),{id:v,name:y,value:v,marker:_,unchecked:g}})}return[]}function qW(t,e){var r=(0,Ew.get)(t,["components","legend"],{});return(0,Ew.deepMix)({},(0,Ew.get)(r,["common"],{}),(0,Ew.deepMix)({},(0,Ew.get)(r,[e],{})))}function YW(t){return!t&&(null===t||void 0===t||isNaN(t))}function XW(t){if((0,Ew.isArray)(t))return YW(t[1].y);var e=t.y;return(0,Ew.isArray)(e)?YW(e[0]):YW(e)}function ZW(t,e,r){if(void 0===e&&(e=!1),void 0===r&&(r=!0),!t.length||1===t.length&&!r)return[];if(e){for(var n=[],i=0,o=t.length;i0&&(l[0][0]="L")),o=o.concat(l)}),o.push(["Z"])}return o}function _q(t,e,r,n,i){for(var o=QW(t,e,!e,"lineWidth"),a=t.connectNulls,s=t.isInCircle,u=ZW(t.points,a,t.showSinglePoint),l=[],c=0,f=u.length;cn&&(n=i),i=e[0]}));var p=this.scales[f];try{for(var d=(0,Sw.__values)(t),y=d.next();!y.done;y=d.next()){var v=y.value,g=this.getDrawCfg(v),m=g.x,b=g.y,x=p.scale(v[MF][f]);this.drawGrayScaleBlurredCircle(m-s.x,b-u.y,r+n,x,h)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var w=h.getImageData(0,0,l,c);this.clearShadowCanvasCtx(),this.colorize(w),h.putImageData(w,0,0);var _=this.getImageShape();_.attr("x",s.x),_.attr("y",u.y),_.attr("width",l),_.attr("height",c),_.attr("img",h.canvas),_.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),e=this.coordinate;return Math.min(e.getWidth()/(4*t.scales[0].ticks.length),e.getHeight()/(4*t.scales[1].ticks.length))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,e,r,n,i){var o=this.getGrayScaleBlurredCanvas();i.globalAlpha=n,i.drawImage(o,t-r,e-r)},e.prototype.colorize=function(t){for(var e=this.getAttribute("color"),r=t.data,n=this.paletteCache,i=3;ie&&(n=e-(r=r?e/(1+n/r):0)),i+o>e&&(o=e-(i=i?e/(1+o/i):0)),[r||0,n||0,i||0,o||0]}function Pq(t,e,r){var n=[];if(r.isRect){var i=r.isTransposed?{x:r.start.x,y:e[0].y}:{x:e[0].x,y:r.start.y},o=r.isTransposed?{x:r.end.x,y:e[2].y}:{x:e[3].x,y:r.end.y},a=(0,Ew.get)(t,["background","style","radius"]);if(a){var s=r.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,u=r.isTransposed?r.getWidth():r.getHeight(),l=(0,Sw.__read)(Aq(a,Math.min(s,u)),4),c=l[0],f=l[1],h=l[2],p=l[3],d=r.isTransposed&&r.isReflect("y"),y=d?0:1,v=function(t){return d?-t:t};n.push(["M",i.x,o.y+v(c)]),0!==c&&n.push(["A",c,c,0,0,y,i.x+c,o.y]),n.push(["L",o.x-f,o.y]),0!==f&&n.push(["A",f,f,0,0,y,o.x,o.y+v(f)]),n.push(["L",o.x,i.y-v(h)]),0!==h&&n.push(["A",h,h,0,0,y,o.x-h,i.y]),n.push(["L",i.x+p,i.y]),0!==p&&n.push(["A",p,p,0,0,y,i.x,i.y-v(p)])}else n.push(["M",i.x,i.y]),n.push(["L",o.x,i.y]),n.push(["L",o.x,o.y]),n.push(["L",i.x,o.y]),n.push(["L",i.x,i.y]);n.push(["z"])}if(r.isPolar){var g=r.getCenter(),m=VG(t,r),b=m.startAngle,x=m.endAngle;if("theta"===r.type||r.isTransposed){var w=function(t){return Math.pow(t,2)};c=Math.sqrt(w(g.x-e[0].x)+w(g.y-e[0].y)),f=Math.sqrt(w(g.x-e[2].x)+w(g.y-e[2].y));n=UG(g.x,g.y,c,r.startAngle,r.endAngle,f)}else n=UG(g.x,g.y,r.getRadius(),b,x)}return n}function Mq(t,e,r){var n=[];return(0,Ew.isNil)(e)?r?n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",(t[2].x+t[3].x)/2,(t[2].y+t[3].y)/2],["Z"]):n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",t[2].x,t[2].y],["L",t[3].x,t[3].y],["Z"]):n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),n}function Iq(t,e){return[e,t]}SW("interval",{defaultShapeType:"rect",getDefaultPoints:function(t){return Cq(t)}});EW("interval","rect",{draw:function(t,e){var r,n=QW(t,!1,!0),i=e,o=null===t||void 0===t?void 0:t.background;if(o){i=e.addGroup({name:"interval-group"});var a=$W(t),s=Pq(t,this.parsePoints(t.points),this.coordinate);i.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},a),{path:s}),capture:!1,zIndex:-1,name:"element-background"})}r=n.radius&&this.coordinate.isRect?function(t,e,r){var n,i,o,a,s,u,l,c=(0,Sw.__read)((0,Sw.__spreadArray)([],(0,Sw.__read)(t),!1),4),f=c[0],h=c[1],p=c[2],d=c[3],y=(0,Sw.__read)("number"==typeof r?Array(4).fill(r):r,4),v=y[0],g=y[1],m=y[2],b=y[3];e.isTransposed&&(h=(n=(0,Sw.__read)(Iq(h,d),2))[0],d=n[1]),e.isReflect("y")&&(f=(i=(0,Sw.__read)(Iq(f,h),2))[0],h=i[1],p=(o=(0,Sw.__read)(Iq(p,d),2))[0],d=o[1]),e.isReflect("x")&&(f=(a=(0,Sw.__read)(Iq(f,d),2))[0],d=a[1],h=(s=(0,Sw.__read)(Iq(h,p),2))[0],p=s[1]);var x=[],w=function(t){return Math.abs(t)};return v=(u=(0,Sw.__read)(Aq([v,g,m,b],Math.min(w(d.x-f.x),w(h.y-f.y))).map(function(t){return w(t)}),4))[0],g=u[1],m=u[2],b=u[3],e.isTransposed&&(v=(l=(0,Sw.__read)([b,v,g,m],4))[0],g=l[1],m=l[2],b=l[3]),f.y1){i.sort();var y=function(t,e){var r=t.length,n=t;(0,Ew.isString)(n[0])&&(n=t.map(function(t){return e.translate(t)}));for(var i=n[1]-n[0],o=2;oa&&(i=a)}return i}(i,n);a=(n.max-n.min)/y,i.length>a&&(a=i.length)}var v=n.range,g=1/a,m=1;(r.isPolar?m=r.isTransposed&&a>1?p:d:(n.isLinear&&(g*=v[1]-v[0]),m=h),!(0,Ew.isNil)(u)&&u>=0)?g=(1-(a-1)*(u/s))/a:g*=m;if(t.getAdjust("dodge")){var b=function(t,e){if(e){var r=(0,Ew.flatten)(t);return(0,Ew.valuesOfKey)(r,e).length}return t.length}(o,t.getAdjust("dodge").dodgeBy);if(!(0,Ew.isNil)(l)&&l>=0)g=(g-l/s*(b-1))/b;else!(0,Ew.isNil)(u)&&u>=0?(g*=m,g/=b):g/=b;g=g>=0?g:0}if(!(0,Ew.isNil)(c)&&c>=0){var x=c/s;g>x&&(g=x)}if(!(0,Ew.isNil)(f)&&f>=0){var w=f/s;g0&&!(0,Ew.get)(i,[o,"min"])&&n.change({min:0}),s<=0&&!(0,Ew.get)(i,[o,"max"])&&n.change({max:0}))}},e.prototype.getDrawCfg=function(e){var r=t.prototype.getDrawCfg.call(this,e);return r.background=this.background,r},e}(PW),Nq=function(t){function e(e){var r=t.call(this,e)||this;r.type="line";var n=e.sortable,i=void 0!==n&&n;return r.sortable=i,r}return(0,Sw.__extends)(e,t),e}(xq),Rq=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"];function Dq(t,e,r,n,i){var o,a,s=QW(e,i,!i,"r"),u=t.parsePoints(e.points),l=u[0];if(e.isStack)l=u[1];else if(u.length>1){var c=r.addGroup();try{for(var f=(0,Sw.__values)(u),h=f.next();!h.done;h=f.next()){var p=h.value;c.addShape({type:"marker",attrs:(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},s),{symbol:UW[n]||n}),p)})}}catch(t){o={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return c}return r.addShape({type:"marker",attrs:(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},s),{symbol:UW[n]||n}),l)})}SW("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(t){return tq(t)}});(0,Ew.each)(Rq,function(t){EW("point","hollow-".concat(t),{draw:function(e,r){return Dq(this,e,r,t,!0)},getMarker:function(e){var r=e.color;return{symbol:UW[t]||t,style:{r:4.5,stroke:r,fill:null}}}})});var Bq=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="point",e.shapeType="point",e.generatePoints=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getDrawCfg=function(e){var r=t.prototype.getDrawCfg.call(this,e);return(0,Sw.__assign)((0,Sw.__assign)({},r),{isStack:!!this.getAdjust("stack")})},e}(PW);SW("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){var e=[];return(0,Ew.each)(t.x,function(r,n){var i=t.y[n];e.push({x:r,y:i})}),e}});EW("polygon","polygon",{draw:function(t,e){if(!(0,Ew.isEmpty)(t.points)){var r=QW(t,!0,!0),n=this.parsePath(function(t){for(var e=t[0],r=1,n=[["M",e.x,e.y]];r2?"weight":"normal";if(t.isInCircle){var a={x:0,y:1};return"normal"===o?r=function(t,e,r){var n=Vq(e,r),i=[["M",t.x,t.y]];return i.push(n),i}(i[0],i[1],a):(n.fill=n.stroke,r=function(t,e){var r=Vq(t[1],e),n=Vq(t[3],e),i=[["M",t[0].x,t[0].y]];return i.push(n),i.push(["L",t[3].x,t[3].y]),i.push(["L",t[2].x,t[2].y]),i.push(r),i.push(["L",t[1].x,t[1].y]),i.push(["L",t[0].x,t[0].y]),i.push(["Z"]),i}(i,a)),r=this.parsePath(r),e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:r})})}if("normal"===o)return r=GG(((i=this.parsePoints(i))[1].x+i[0].x)/2,i[0].y,Math.abs(i[1].x-i[0].x)/2,Math.PI,2*Math.PI),e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:r})});var s=Gq(i[1],i[3]),u=Gq(i[2],i[0]);return r=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],s,["L",i[3].x,i[3].y],["L",i[2].x,i[2].y],u,["Z"]],r=this.parsePath(r),n.fill=n.stroke,e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:r})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),EW("edge","smooth",{draw:function(t,e){var r=QW(t,!0,!1,"lineWidth"),n=t.points,i=this.parsePath(function(t,e){var r=Gq(t,e),n=[["M",t.x,t.y]];return n.push(r),n}(n[0],n[1]));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}});var Hq=1/3;EW("edge","vhv",{draw:function(t,e){var r=QW(t,!0,!1,"lineWidth"),n=t.points,i=this.parsePath(function(t,e){var r=[];r.push({x:t.x,y:t.y*(1-Hq)+e.y*Hq}),r.push({x:e.x,y:t.y*(1-Hq)+e.y*Hq}),r.push(e);var n=[["M",t.x,t.y]];return(0,Ew.each)(r,function(t){n.push(["L",t.x,t.y])}),n}(n[0],n[1]));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),EW("interval","funnel",{getPoints:function(t){return t.size=2*t.size,Cq(t)},draw:function(t,e){var r=QW(t,!1,!0),n=this.parsePath(Mq(t.points,t.nextPoints,!1));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:n}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),EW("interval","hollow-rect",{draw:function(t,e){var r=QW(t,!0,!1),n=e,i=null===t||void 0===t?void 0:t.background;if(i){n=e.addGroup();var o=$W(t),a=Pq(t,this.parsePoints(t.points),this.coordinate);n.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},o),{path:a}),capture:!1,zIndex:-1,name:"element-background"})}var s=this.parsePath(Oq(t.points)),u=n.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:s}),name:"interval"});return i?n:u},getMarker:function(t){var e=t.color;return t.isInPolar?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}}),EW("interval","line",{getPoints:function(t){return r=(e=t).x,n=e.y,i=e.y0,(0,Ew.isArray)(n)?n.map(function(t,e){return{x:(0,Ew.isArray)(r)?r[e]:r,y:t}}):[{x:r,y:i},{x:r,y:n}];var e,r,n,i},draw:function(t,e){var r=QW(t,!0,!1,"lineWidth"),n=YG((0,Sw.__assign)({},r),["fill"]),i=this.parsePath(Oq(t.points,!1));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,r){return[["M",t,e-r],["L",t,e+r]]},style:{r:5,stroke:t.color}}}}),EW("interval","pyramid",{getPoints:function(t){return t.size=2*t.size,Cq(t)},draw:function(t,e){var r=QW(t,!1,!0),n=this.parsePath(Mq(t.points,t.nextPoints,!0));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:n}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),EW("interval","tick",{getPoints:function(t){return function(t){var e,r,n,i=t.x,o=t.y,a=t.y0,s=t.size;(0,Ew.isArray)(o)?(r=(e=(0,Sw.__read)(o,2))[0],n=e[1]):(r=a,n=o);var u=i+s/2,l=i-s/2;return[{x:i,y:r},{x:i,y:n},{x:l,y:r},{x:u,y:r},{x:l,y:n},{x:u,y:n}]}(t)},draw:function(t,e){var r,n=QW(t,!0,!1),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]);return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,r){return[["M",t-r/2,e-r],["L",t+r/2,e-r],["M",t,e-r],["L",t,e+r],["M",t-r/2,e+r],["L",t+r/2,e+r]]},style:{r:5,stroke:t.color}}}});var Wq=function(t,e,r){var n,i=t.x,o=t.y,a=e.x,s=e.y;switch(r){case"hv":n=[{x:a,y:o}];break;case"vh":n=[{x:i,y:s}];break;case"hvh":var u=(a+i)/2;n=[{x:u,y:o},{x:u,y:s}];break;case"vhv":var l=(o+s)/2;n=[{x:i,y:l},{x:a,y:l}]}return n};function qq(t,e){var r=ZW(t.points,t.connectNulls,t.showSinglePoint),n=[];return(0,Ew.each)(r,function(t){var r=function(t,e){var r=[];return(0,Ew.each)(t,function(n,i){var o=t[i+1];if(r.push(n),o){var a=Wq(n,o,e);r=r.concat(a)}}),r}(t,e);n=n.concat(r.map(function(t,e){return 0===e?["M",t.x,t.y]:["L",t.x,t.y]}))}),(0,Sw.__assign)((0,Sw.__assign)({},QW(t,!0,!1,"lineWidth")),{path:n})}function Yq(t){var e=(0,Ew.isArray)(t)?t:[t],r=e[0],n=e[e.length-1],i=e.length>1?e[1]:r;return{min:r,max:n,min1:i,max1:e.length>3?e[3]:n,median:e.length>2?e[2]:i}}function Xq(t,e,r){var n,i=r/2;if((0,Ew.isArray)(e)){var o=Yq(e),a=o.min,s=o.max,u=o.median,l=o.min1,c=t-i,f=t+i;n=[[c,s],[f,s],[t,s],[t,h=o.max1],[c,l],[c,h],[f,h],[f,l],[t,l],[t,a],[c,a],[f,a],[c,u],[f,u]]}else{e=(0,Ew.isNil)(e)?.5:e;var h,p=Yq(t),d=(a=p.min,s=p.max,u=p.median,e-i),y=e+i;n=[[a,d],[a,y],[a,e],[l=p.min1,e],[l,d],[l,y],[h=p.max1,y],[h,d],[h,e],[s,e],[s,d],[s,y],[u,d],[u,y]]}return n.map(function(t){return{x:t[0],y:t[1]}})}function Zq(t){var e=((0,Ew.isArray)(t)?t:[t]).sort(function(t,e){return e-t});return function(t,e,r){if((0,Ew.isString)(t))return t.padEnd(e,r);if((0,Ew.isArray)(t)){var n=t.length;if(n1){var s=e.addGroup();try{for(var u=(0,Sw.__values)(o),l=u.next();!l.done;l=u.next()){var c=l.value;s.addShape("image",{attrs:{x:c.x-i/2,y:c.y-i,width:i,height:i,img:t.shape[1]}})}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s}return e.addShape("image",{attrs:{x:a.x-i/2,y:a.y-i,width:i,height:i,img:t.shape[1]}})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),(0,Ew.each)(Rq,function(t){EW("point",t,{draw:function(e,r){return Dq(this,e,r,t,!1)},getMarker:function(e){var r=e.color;return{symbol:UW[t]||t,style:{r:4.5,fill:r}}}})}),EW("schema","box",{getPoints:function(t){return Xq(t.x,t.y,t.size)},draw:function(t,e){var r,n=QW(t,!0,!1),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]);return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:i,name:"schema"})})},getMarker:function(t){return{symbol:function(t,e,r){var n=Xq(t,[e-6,e-3,e,e+3,e+6],r);return[["M",n[0].x+1,n[0].y],["L",n[1].x-1,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["M",n[4].x,n[4].y],["L",n[5].x,n[5].y],["L",n[6].x,n[6].y],["L",n[7].x,n[7].y],["L",n[4].x,n[4].y],["Z"],["M",n[8].x,n[8].y],["L",n[9].x,n[9].y],["M",n[10].x+1,n[10].y],["L",n[11].x-1,n[11].y],["M",n[12].x,n[12].y],["L",n[13].x,n[13].y]]},style:{r:6,lineWidth:1,stroke:t.color}}}}),EW("schema","candle",{getPoints:function(t){return Kq(t.x,t.y,t.size)},draw:function(t,e){var r,n=QW(t,!0,!0),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]);return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},n),{path:i,name:"schema"})})},getMarker:function(t){var e=t.color;return{symbol:function(t,e,r){var n=Kq(t,[e+7.5,e+3,e-3,e-7.5],r);return[["M",n[0].x,n[0].y],["L",n[1].x,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["L",n[4].x,n[4].y],["L",n[5].x,n[5].y],["Z"],["M",n[6].x,n[6].y],["L",n[7].x,n[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}}),EW("polygon","square",{draw:function(t,e){if(!(0,Ew.isEmpty)(t.points)){var r=QW(t,!0,!0),n=this.parsePoints(t.points);return e.addShape("rect",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),function(t,e){var r=Math.abs(t[0].x-t[2].x),n=Math.abs(t[0].y-t[2].y),i=Math.min(r,n);return e&&(i=(0,Ew.clamp)(e,0,Math.min(r,n))),i/=2,{x:(t[0].x+t[2].x)/2-i,y:(t[0].y+t[2].y)/2-i,width:2*i,height:2*i}}(n,t.size)),name:"polygon"})}},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),EW("violin","smooth",{draw:function(t,e){var r=QW(t,!0,!0),n=this.parsePath(JW(t.points));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{stroke:null,r:4,fill:t.color}}}}),EW("violin","hollow",{draw:function(t,e){var r=QW(t,!0,!1),n=this.parsePath(KW(t.points));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}}),EW("violin","hollow-smooth",{draw:function(t,e){var r=QW(t,!0,!1),n=this.parsePath(JW(t.points));return e.addShape("path",{attrs:(0,Sw.__assign)((0,Sw.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}});var Jq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getLabelValueDir=function(t){var e=t.points;return e[0].y<=e[2].y?1:-1},e.prototype.getLabelOffsetPoint=function(e,r,n,i){var o,a=t.prototype.getLabelOffsetPoint.call(this,e,r,n),s=this.getCoordinate(),u=s.isTransposed?"x":"y",l=this.getLabelValueDir(e.mappingData);return a=(0,Sw.__assign)((0,Sw.__assign)({},a),((o={})[u]=a[u]*l,o)),s.isReflect("x")&&(a=(0,Sw.__assign)((0,Sw.__assign)({},a),{x:-1*a.x})),s.isReflect("y")&&(a=(0,Sw.__assign)((0,Sw.__assign)({},a),{y:-1*a.y})),a},e.prototype.getThemedLabelCfg=function(t){var e=this.geometry,r=this.getDefaultLabelCfg(),n=e.theme;return(0,Ew.deepMix)({},r,n.labels,"middle"===t.position?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,e,r,n){var i,o,a,s,u=this.getCoordinate(),l=u.isTransposed,c=e.points,f=u.convert(c[0]),h=u.convert(c[2]),p=this.getLabelValueDir(e),d=(0,Ew.isArray)(e.shape)?e.shape[0]:e.shape;if("funnel"===d||"pyramid"===d){var y=(0,Ew.get)(e,"nextPoints"),v=(0,Ew.get)(e,"points");if(y){var g=u.convert(v[0]),m=u.convert(v[1]),b=u.convert(y[0]),x=u.convert(y[1]);l?(i=Math.min(b.y,g.y),a=Math.max(b.y,g.y),o=(m.x+x.x)/2,s=(g.x+b.x)/2):(i=Math.min((m.y+x.y)/2,(g.y+b.y)/2),a=Math.max((m.y+x.y)/2,(g.y+b.y)/2),o=x.x,s=g.x)}else i=Math.min(h.y,f.y),a=Math.max(h.y,f.y),o=h.x,s=f.x}else i=Math.min(h.y,f.y),a=Math.max(h.y,f.y),o=h.x,s=f.x;switch(n){case"right":t.x=o,t.y=(i+a)/2,t.textAlign=(0,Ew.get)(t,"textAlign",p>0?"left":"right");break;case"left":t.x=s,t.y=(i+a)/2,t.textAlign=(0,Ew.get)(t,"textAlign",p>0?"left":"right");break;case"bottom":l&&(t.x=(o+s)/2),t.y=a,t.textAlign=(0,Ew.get)(t,"textAlign","center"),t.textBaseline=(0,Ew.get)(t,"textBaseline",p>0?"bottom":"top");break;case"middle":l&&(t.x=(o+s)/2),t.y=(i+a)/2,t.textAlign=(0,Ew.get)(t,"textAlign","center"),t.textBaseline=(0,Ew.get)(t,"textBaseline","middle");break;case"top":l&&(t.x=(o+s)/2),t.y=i,t.textAlign=(0,Ew.get)(t,"textAlign","center"),t.textBaseline=(0,Ew.get)(t,"textBaseline",p>0?"bottom":"top")}},e}(FW),Qq=Math.PI/2,$q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),r=0;if((0,Ew.isNumber)(t))r=t;else if((0,Ew.isString)(t)&&-1!==t.indexOf("%")){var n=e.getRadius();e.innerRadius>0&&(n*=1-e.innerRadius),r=.01*parseFloat(t)*n}return r},e.prototype.getLabelItems=function(e){var r=t.prototype.getLabelItems.call(this,e),n=this.geometry.getYScale();return(0,Ew.map)(r,function(t){if(t&&n){var e=n.scale((0,Ew.get)(t.data,n.field));return(0,Sw.__assign)((0,Sw.__assign)({},t),{percent:e})}return t})},e.prototype.getLabelAlign=function(t){var e,r=this.getCoordinate();if(t.labelEmit)e=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(r.isTransposed){var n=r.getCenter(),i=t.offset;e=Math.abs(t.x-n.x)<1?"center":t.angle>Math.PI||t.angle<=0?i>0?"left":"right":i>0?"right":"left"}else e="center";return e},e.prototype.getLabelPoint=function(t,e,r){var n,i=1,o=t.content[r];this.isToMiddle(e)?n=this.getMiddlePoint(e.points):(1===t.content.length&&0===r?r=1:0===r&&(i=-1),n=this.getArcPoint(e,r));var a=t.offset*i,s=this.getPointAngle(n),u=t.labelEmit,l=this.getCirclePoint(s,a,n,u);return 0===l.r?l.content="":(l.content=o,l.angle=s,l.color=e.color),l.rotate=t.autoRotate?this.getLabelRotate(s,a,u):t.rotate,l.start={x:n.x,y:n.y},l},e.prototype.getArcPoint=function(t,e){return void 0===e&&(e=0),(0,Ew.isArray)(t.x)||(0,Ew.isArray)(t.y)?{x:(0,Ew.isArray)(t.x)?t.x[e]:t.x,y:(0,Ew.isArray)(t.y)?t.y[e]:t.y}:{x:t.x,y:t.y}},e.prototype.getPointAngle=function(t){return QG(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,e,r,n){var i=this.getCoordinate(),o=i.getCenter(),a=JG(i,r);if(0===a)return(0,Sw.__assign)((0,Sw.__assign)({},o),{r:a});var s=t;i.isTransposed&&a>e&&!n?s=t+2*Math.asin(e/(2*a)):a+=e;return{x:o.x+a*Math.cos(s),y:o.y+a*Math.sin(s),r:a}},e.prototype.getLabelRotate=function(t,e,r){var n=t+Qq;return r&&(n-=Qq),n&&(n>Qq?n-=Math.PI:n<-Qq&&(n+=Math.PI)),n},e.prototype.getMiddlePoint=function(t){var e=this.getCoordinate(),r=t.length,n={x:0,y:0};return(0,Ew.each)(t,function(t){n.x+=t.x,n.y+=t.y}),n.x/=r,n.y/=r,n=e.convert(n)},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(FW),tY=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.defaultLayout="distribute",e}return(0,Sw.__extends)(e,t),e.prototype.getDefaultLabelCfg=function(e,r){var n=t.prototype.getDefaultLabelCfg.call(this,e,r);return(0,Ew.deepMix)({},n,(0,Ew.get)(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(e){return t.prototype.getLabelOffset.call(this,e)||0},e.prototype.getLabelRotate=function(t,e,r){var n;return e<0&&((n=t)>Math.PI/2&&(n-=Math.PI),n<-Math.PI/2&&(n+=Math.PI)),n},e.prototype.getLabelAlign=function(t){var e,r=this.getCoordinate().getCenter();return e=t.angle<=Math.PI/2&&t.x>=r.x?"left":"right",t.offset<=0&&(e="right"===e?"left":"right"),e},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var e,r=this.getCoordinate(),n={x:(0,Ew.isArray)(t.x)?t.x[0]:t.x,y:t.y[0]},i={x:(0,Ew.isArray)(t.x)?t.x[1]:t.x,y:t.y[1]},o=QG(r,n);if(t.points&&t.points[0].y===t.points[1].y)e=o;else{var a=QG(r,i);o>=a&&(a+=2*Math.PI),e=o+(a-o)/2}return e},e.prototype.getCirclePoint=function(t,e){var r=this.getCoordinate(),n=r.getCenter(),i=r.getRadius()+e;return(0,Sw.__assign)((0,Sw.__assign)({},zG(n.x,n.y,i,t)),{angle:t,r:i})},e}($q),eY=4;function rY(t,e,r){var n=t.filter(function(t){return!t.invisible});n.sort(function(t,e){return t.y-e.y});var i,o=!0,a=r.minY,s=r.maxY,u=Math.abs(a-s),l=0,c=Number.MIN_VALUE,f=n.map(function(t){return t.y>l&&(l=t.y),t.yu&&(u=l-a);o;)for(f.forEach(function(t){var e=(Math.min.apply(c,t.targets)+Math.max.apply(c,t.targets))/2;t.pos=Math.min(Math.max(c,e-t.size/2),u-t.size),t.pos=Math.max(0,t.pos)}),o=!1,i=f.length;i--;)if(i>0){var h=f[i-1],p=f[i];h.pos+h.size>p.pos&&(h.size+=p.size,h.targets=h.targets.concat(p.targets),h.pos+h.size>u&&(h.pos=u-h.size),f.splice(i,1),o=!0)}i=0,f.forEach(function(t){var r=a+e/2;t.targets.forEach(function(){n[i].y=t.pos+r,r+=e,i++})})}var nY=4;var iY=4,oY=4,aY=4;var sY=100,uY=function(){function t(t){void 0===t&&(t={}),this.bitmap={};var e=t.xGap,r=void 0===e?1:e,n=t.yGap,i=void 0===n?8:n;this.xGap=r,this.yGap=i}return t.prototype.hasGap=function(t){for(var e=!0,r=this.bitmap,n=Math.round(t.minX),i=Math.round(t.maxX),o=Math.round(t.minY),a=Math.round(t.maxY),s=n;s<=i;s+=1)if(r[s]){if(s===n||s===i){for(var u=o;u<=a;u++)if(r[s][u]){e=!1;break}}else if(r[s][o]||r[s][a]){e=!1;break}}else r[s]={};return e},t.prototype.fillGap=function(t){for(var e=this.bitmap,r=Math.round(t.minX),n=Math.round(t.maxX),i=Math.round(t.minY),o=Math.round(t.maxY),a=r;a<=n;a+=1)e[a]||(e[a]={});for(a=r;a<=n;a+=this.xGap){for(var s=i;s<=o;s+=this.yGap)e[a][s]=!0;e[a][o]=!0}if(1!==this.yGap)for(a=i;a<=o;a+=1)e[r][a]=!0,e[n][a]=!0;if(1!==this.xGap)for(a=r;a<=n;a+=1)e[a][i]=!0,e[a][o]=!0},t.prototype.destroy=function(){this.bitmap={}},t}();function lY(t,e,r,n){var i=t.getCanvasBBox(),o=i.width,a=i.height,s={x:e,y:r,textAlign:"center"};switch(n){case 0:s.y-=a+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=a+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=a+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=a+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=2*a+2;break;case 6:s.y+=2*a+2;break;case 7:s.x+=o+1,s.textAlign="left";break;case 8:s.x-=o+1,s.textAlign="right"}return t.attr(s),t.getCanvasBBox()}function cY(t){if(t.length>4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function fY(t,e,r){void 0===e&&(e=0),void 0===r&&(r={x:0,y:0});var n=t.x,i=t.y;return{x:(n-r.x)*Math.cos(-e)+(i-r.y)*Math.sin(-e)+r.x,y:(r.x-n)*Math.sin(-e)+(i-r.y)*Math.cos(-e)+r.y}}function hY(t){var e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],r=t.rotation;return r?[fY(e[0],r,e[0]),fY(e[1],r,e[0]),fY(e[2],r,e[0]),fY(e[3],r,e[0])]:e}function pY(t,e){if(t.length>4)return{min:0,max:0};var r=[];return t.forEach(function(t){var n,i;r.push((n=[t.x,t.y],i=e,(n[0]||0)*(i[0]||0)+(n[1]||0)*(i[1]||0)+(n[2]||0)*(i[2]||0)))}),{min:Math.min.apply(Math,(0,Sw.__spreadArray)([],(0,Sw.__read)(r),!1)),max:Math.max.apply(Math,(0,Sw.__spreadArray)([],(0,Sw.__read)(r),!1))}}function dY(t,e){return t.max>e.min&&t.mint.x+t.width+r||e.x+e.widtht.y+t.height+r||e.y+e.height4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function e(t,e,r){void 0===e&&(e=0),void 0===r&&(r={x:0,y:0});var n=t.x,i=t.y;return{x:(n-r.x)*Math.cos(-e)+(i-r.y)*Math.sin(-e)+r.x,y:(r.x-n)*Math.sin(-e)+(i-r.y)*Math.cos(-e)+r.y}}function r(t){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=t.rotation;return n?[e(r[0],n,r[0]),e(r[1],n,r[0]),e(r[2],n,r[0]),e(r[3],n,r[0])]:r}function n(t,e){if(t.length>4)return{min:0,max:0};var r=[];return t.forEach(function(t){var n,i;r.push((n=[t.x,t.y],i=e,(n[0]||0)*(i[0]||0)+(n[1]||0)*(i[1]||0)+(n[2]||0)*(i[2]||0)))}),{min:Math.min.apply(null,r),max:Math.max.apply(null,r)}}function i(t,e){return t.max>e.min&&t.mint.x+t.width+r||e.x+e.widtht.y+t.height+r||e.y+e.height=o.height:a.width>=o.width}(t,e,i)})}function TY(t,e,r){return t.some(function(t){return r(t,e)})}function CY(t,e){return TY(t,e,function(t,e){var r,n,i,o=jW(t),a=jW(e);return r=o.getCanvasBBox(),n=a.getCanvasBBox(),void 0===(i=2)&&(i=0),Math.max(0,Math.min(r.x+r.width+i,n.x+n.width+i)-Math.max(r.x-i,n.x-i))*Math.max(0,Math.min(r.y+r.height+i,n.y+n.height+i)-Math.max(r.y-i,n.y-i))>0})}function OY(t,e,r){return t.some(function(t){return r(t,e)})}function AY(t,e){return OY(t,e,function(t,e){var r,n,i,o=jW(t),a=jW(e);return r=o.getCanvasBBox(),n=a.getCanvasBBox(),void 0===(i=2)&&(i=0),Math.max(0,Math.min(r.x+r.width+i,n.x+n.width+i)-Math.max(r.x-i,n.x-i))*Math.max(0,Math.min(r.y+r.height+i,n.y+n.height+i)-Math.max(r.y-i,n.y-i))>0})}function PY(){return _Y||(_Y=document.createElement("canvas").getContext("2d")),_Y}var MY=(0,Ew.memoize)(function(t,e){void 0===e&&(e={});var r=e.fontSize,n=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant,s=PY();return s.font=[o,a,i,"".concat(r,"px"),n].join(" "),s.measureText((0,Ew.isString)(t)?t:"").width},function(t,e){return void 0===e&&(e={}),(0,Sw.__spreadArray)([t],(0,Sw.__read)((0,Ew.values)(e)),!1).join("")}),IY=function(t,e,r){var n,i=MY("...",r);n=(0,Ew.isString)(t)?t:(0,Ew.toString)(t);var o,a,s=e,u=[];if(MY(t,r)<=e)return t;for(;o=n.substr(0,16),!((a=MY(o,r))+i>s&&a>s);)if(u.push(o),s-=a,!(n=n.substr(16)))return u.join("");for(;o=n.substr(0,1),!((a=MY(o,r))+i>s);)if(u.push(o),s-=a,!(n=n.substr(1)))return u.join("");return"".concat(u.join(""),"...")};function LY(t,e,r,n,i){var o,a,s=r.start,u=r.end,l=r.getWidth(),c=r.getHeight();"y"===i?(o=s.x+l/2,a=n.ys.x?n.x:s.x,a=s.y+c/2):"xy"===i&&(r.isPolar?(o=r.getCenter().x,a=r.getCenter().y):(o=(s.x+u.x)/2,a=(s.y+u.y)/2));var f=function(t,e,r){var n,i=(0,Sw.__read)(e,2),o=i[0],a=i[1];return t.applyToMatrix([o,a,1]),"x"===r?(t.setMatrix(Aw.vs(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]])),n=Aw.vs(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])):"y"===r?(t.setMatrix(Aw.vs(t.getMatrix(),[["t",-o,-a],["s",1,.01],["t",o,a]])),n=Aw.vs(t.getMatrix(),[["t",-o,-a],["s",1,100],["t",o,a]])):"xy"===r&&(t.setMatrix(Aw.vs(t.getMatrix(),[["t",-o,-a],["s",.01,.01],["t",o,a]])),n=Aw.vs(t.getMatrix(),[["t",-o,-a],["s",100,100],["t",o,a]])),n}(t,[o,a],i);t.animate({matrix:f},e)}function jY(t,e){var r,n=Jk(t,e),i=n.startAngle,o=n.endAngle;return!(0,Ew.isNumberEqual)(i,.5*-Math.PI)&&i<.5*-Math.PI&&(i+=2*Math.PI),!(0,Ew.isNumberEqual)(o,.5*-Math.PI)&&o<.5*-Math.PI&&(o+=2*Math.PI),0===e[5]&&(i=(r=(0,Sw.__read)([o,i],2))[0],o=r[1]),(0,Ew.isNumberEqual)(i,1.5*Math.PI)&&(i=-.5*Math.PI),(0,Ew.isNumberEqual)(o,-.5*Math.PI)&&!(0,Ew.isNumberEqual)(i,o)&&(o=1.5*Math.PI),{startAngle:i,endAngle:o}}function NY(t){var e;return"M"===t[0]||"L"===t[0]?e=[t[1],t[2]]:"a"!==t[0]&&"A"!==t[0]&&"C"!==t[0]||(e=[t[t.length-2],t[t.length-1]]),e}function RY(t){var e,r,n,i=t.filter(function(t){return"A"===t[0]||"a"===t[0]});if(0===i.length)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var o=i[0],a=i.length>1?i[1]:i[0],s=t.indexOf(o),u=t.indexOf(a),l=NY(t[s-1]),c=NY(t[u-1]),f=jY(l,o),h=f.startAngle,p=f.endAngle,d=jY(c,a),y=d.startAngle,v=d.endAngle;(0,Ew.isNumberEqual)(h,y)&&(0,Ew.isNumberEqual)(p,v)?(r=h,n=p):(r=Math.min(h,y),n=Math.max(p,v));var g=o[1],m=i[i.length-1][1];return g=0;a--){var s=this.getFacetsByLevel(t,a);try{for(var u=(e=void 0,(0,Sw.__values)(s)),l=u.next();!l.done;l=u.next()){var c=l.value;this.isLeaf(c)||(c.originColIndex=c.columnIndex,c.columnIndex=this.getRegionIndex(c.children),c.columnValuesLength=i.length)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}},e.prototype.getFacetsByLevel=function(t,e){var r=[];return t.forEach(function(t){t.rowIndex===e&&r.push(t)}),r},e.prototype.getRegionIndex=function(t){var e=t[0];return(t[t.length-1].columnIndex-e.columnIndex)/2+e.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,e,r){var n=this,i=this.cfg.fields;if(!(i.length=r){var i=n.parsePosition([t[s],t[a.field]]);i&&f.push(i)}if(t[s]===c)return!1}),f},e.prototype.parsePercentPosition=function(t){var e=parseFloat(t[0])/100,r=parseFloat(t[1])/100,n=this.view.getCoordinate(),i=n.start,o=n.end,a=Math.min(i.x,o.x),s=Math.min(i.y,o.y);return{x:n.getWidth()*e+a,y:n.getHeight()*r+s}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),e=t.start,r=t.end,n=t.getWidth(),i=t.getHeight(),o={x:Math.min(e.x,r.x),y:Math.min(e.y,r.y)};return{x:o.x,y:o.y,minX:o.x,minY:o.y,maxX:o.x+n,maxY:o.y+i,width:n,height:i}},e.prototype.getAnnotationCfg=function(t,e,r){var n=this,i=this.view.getCoordinate(),o=this.view.getCanvas(),a={};if((0,Ew.isNil)(e))return null;var s=e.start,u=e.end,l=e.position,c=this.parsePosition(s),f=this.parsePosition(u),h=this.parsePosition(l);if(!(!["arc","image","line","region","regionFilter"].includes(t)||c&&f))return null;if(["text","dataMarker","html"].includes(t)&&!h)return null;if("arc"===t){var p=e,d=(p.start,p.end,(0,Sw.__rest)(p,["start","end"])),y=QG(i,c),v=QG(i,f);y>v&&(v=2*Math.PI+v),a=(0,Sw.__assign)((0,Sw.__assign)({},d),{center:i.getCenter(),radius:JG(i,c),startAngle:y,endAngle:v})}else if("image"===t){var g=e;g.start,g.end,d=(0,Sw.__rest)(g,["start","end"]);a=(0,Sw.__assign)((0,Sw.__assign)({},d),{start:c,end:f,src:e.src})}else if("line"===t){var m=e;m.start,m.end,d=(0,Sw.__rest)(m,["start","end"]);a=(0,Sw.__assign)((0,Sw.__assign)({},d),{start:c,end:f,text:(0,Ew.get)(e,"text",null)})}else if("region"===t){var b=e;b.start,b.end,d=(0,Sw.__rest)(b,["start","end"]);a=(0,Sw.__assign)((0,Sw.__assign)({},d),{start:c,end:f})}else if("text"===t){var x=this.view.getData(),w=e,_=(w.position,w.content),S=(d=(0,Sw.__rest)(w,["position","content"]),_);(0,Ew.isFunction)(_)&&(S=_(x)),a=(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},h),d),{content:S})}else if("dataMarker"===t){var E=e,k=(E.position,E.point),T=E.line,C=E.text,O=E.autoAdjust,A=E.direction;d=(0,Sw.__rest)(E,["position","point","line","text","autoAdjust","direction"]);a=(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},d),h),{coordinateBBox:this.getCoordinateBBox(),point:k,line:T,text:C,autoAdjust:O,direction:A})}else if("dataRegion"===t){var P=e,M=P.start,I=P.end,L=P.region,j=(C=P.text,P.lineLength);d=(0,Sw.__rest)(P,["start","end","region","text","lineLength"]);a=(0,Sw.__assign)((0,Sw.__assign)({},d),{points:this.getRegionPoints(M,I),region:L,text:C,lineLength:j})}else if("regionFilter"===t){var N=e,R=(N.start,N.end,N.apply),D=N.color,B=(d=(0,Sw.__rest)(N,["start","end","apply","color"]),this.view.geometries),F=[],z=function t(e){e&&(e.isGroup()?e.getChildren().forEach(function(e){return t(e)}):F.push(e))};(0,Ew.each)(B,function(t){R?(0,Ew.contains)(R,t.type)&&(0,Ew.each)(t.elements,function(t){z(t.shape)}):(0,Ew.each)(t.elements,function(t){z(t.shape)})}),a=(0,Sw.__assign)((0,Sw.__assign)({},d),{color:D,shapes:F,start:c,end:f})}else if("shape"===t){var U=e,G=U.render,V=(0,Sw.__rest)(U,["render"]);a=(0,Sw.__assign)((0,Sw.__assign)({},V),{render:function(t){if((0,Ew.isFunction)(e.render))return G(t,n.view,{parsePosition:n.parsePosition.bind(n)})}})}else if("html"===t){var H=e,W=H.html;H.position,V=(0,Sw.__rest)(H,["html","position"]);a=(0,Sw.__assign)((0,Sw.__assign)((0,Sw.__assign)({},V),h),{parent:o.get("el").parentNode,html:function(t){return(0,Ew.isFunction)(W)?W(t,n.view):W}})}var q=(0,Ew.deepMix)({},r,(0,Sw.__assign)((0,Sw.__assign)({},a),{top:e.top,style:e.style,offsetX:e.offsetX,offsetY:e.offsetY}));return"html"!==t&&(q.container=this.getComponentContainer(q)),q.animate=this.view.getOptions().animate&&q.animate&&(0,Ew.get)(e,"animate",q.animate),q.animateOption=(0,Ew.deepMix)({},uW,q.animateOption,e.animateOption),q},e.prototype.isTop=function(t){return(0,Ew.get)(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return(0,Ew.get)(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var e=this.cache.get(this.getCacheKey(t));if(e){var r=t.type,n=this.getAnnotationTheme(r),i=this.getAnnotationCfg(r,t,n);i&&YG(i,["container"]),e.component.update((0,Sw.__assign)((0,Sw.__assign)({},i||{}),{visible:!!i})),(0,Ew.includes)(XY,t.type)&&e.component.render()}else(e=this.createAnnotation(t))&&(e.component.init(),(0,Ew.includes)(XY,t.type)&&e.component.render());return e},e.prototype.syncCache=function(t){var e=this,r=new Map(this.cache);return t.forEach(function(t,e){r.set(e,t)}),r.forEach(function(t,n){(0,Ew.find)(e.option,function(t){return n===e.getCacheKey(t)})||(t.component.destroy(),r.delete(n))}),r},e.prototype.getCacheKey=function(t){return t},e}(nW);function KY(t,e){var r=(0,Ew.deepMix)({},(0,Ew.get)(t,["components","axis","common"]),(0,Ew.get)(t,["components","axis",e]));return(0,Ew.get)(r,["grid"],{})}function JY(t,e,r,n){var i=[],o=e.getTicks();return t.isPolar&&o.push({value:1,text:"",tickValue:""}),o.reduce(function(e,o,a){var s=o.value;if(n)i.push({points:[t.convert("y"===r?{x:0,y:s}:{x:s,y:0}),t.convert("y"===r?{x:1,y:s}:{x:s,y:1})]});else if(a){var u=(e.value+s)/2;i.push({points:[t.convert("y"===r?{x:0,y:u}:{x:u,y:0}),t.convert("y"===r?{x:1,y:u}:{x:u,y:1})]})}return o},o[0]),i}function QY(t,e,r,n,i){var o=e.values.length,a=[],s=r.getTicks();return s.reduce(function(e,r){var s=e?e.value:r.value,u=r.value,l=(s+u)/2;return"x"===i?a.push({points:[t.convert({x:n?u:l,y:0}),t.convert({x:n?u:l,y:1})]}):a.push({points:(0,Ew.map)(Array(o+1),function(e,r){return t.convert({x:r/o,y:n?u:l})})}),r},s[0]),a}function $Y(t,e){var r=(0,Ew.get)(e,"grid");if(null===r)return!1;var n=(0,Ew.get)(t,"grid");return!(void 0===r&&null===n)}var tX=["container"],eX=(0,Sw.__assign)((0,Sw.__assign)({},uW),{appear:null}),rX=function(t){function e(e){var r=t.call(this,e)||this;return r.cache=new Map,r.gridContainer=r.view.getLayer(wF.BG).addGroup(),r.gridForeContainer=r.view.getLayer(wF.FORE).addGroup(),r.axisContainer=r.view.getLayer(wF.BG).addGroup(),r.axisForeContainer=r.view.getLayer(wF.FORE).addGroup(),r}return(0,Sw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,e=this.view.getCoordinate();(0,Ew.each)(this.getComponents(),function(r){var n,i=r.component,o=r.direction,a=r.type,s=r.extra,u=s.dim,l=s.scale,c=s.alignTick;if(a===SF.AXIS)e.isPolar?"x"===u?n=e.isTransposed?oV(e,o):cV(e):"y"===u&&(n=e.isTransposed?cV(e):oV(e,o)):n=oV(e,o);else if(a===SF.GRID)if(e.isPolar){n={items:e.isTransposed?"x"===u?QY(e,t.view.getYScales()[0],l,c,u):JY(e,l,u,c):"x"===u?JY(e,l,u,c):QY(e,t.view.getXScale(),l,c,u),center:t.view.getCoordinate().getCenter()}}else n={items:JY(e,l,u,c)};i.update(n)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var e=new Map;this.cache.forEach(function(r,n){t.has(n)?e.set(n,r):r.component.destroy()}),this.cache=e},e.prototype.clear=function(){t.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(e){t.push(e)}),t},e.prototype.updateXAxes=function(t){var e=this.view.getXScale();if(e&&!e.isIdentity){var r=fV(this.option,e.field);if(!1!==r){var n=hV(r,_F.BOTTOM),i=wF.BG,o=this.view.getCoordinate(),a=this.getId("axis",e.field),s=this.getId("grid",e.field);if(o.isRect){if(u=this.cache.get(a))YG(c=this.getLineAxisCfg(e,r,n),tX),u.component.update(c),t.set(a,u);else u=this.createLineAxis(e,r,i,n,"x"),this.cache.set(a,u),t.set(a,u);if(l=this.cache.get(s))YG(c=this.getLineGridCfg(e,r,n,"x"),tX),l.component.update(c),t.set(s,l);else(l=this.createLineGrid(e,r,i,n,"x"))&&(this.cache.set(s,l),t.set(s,l))}else if(o.isPolar){var u,l;if(u=this.cache.get(a)){YG(c=o.isTransposed?this.getLineAxisCfg(e,r,_F.RADIUS):this.getCircleAxisCfg(e,r,n),tX),u.component.update(c),t.set(a,u)}else{if(o.isTransposed){if((0,Ew.isUndefined)(r))return;u=this.createLineAxis(e,r,i,_F.RADIUS,"x")}else u=this.createCircleAxis(e,r,i,n,"x");this.cache.set(a,u),t.set(a,u)}if(l=this.cache.get(s)){var c;YG(c=o.isTransposed?this.getCircleGridCfg(e,r,_F.RADIUS,"x"):this.getLineGridCfg(e,r,_F.CIRCLE,"x"),tX),l.component.update(c),t.set(s,l)}else{if(o.isTransposed){if((0,Ew.isUndefined)(r))return;l=this.createCircleGrid(e,r,i,_F.RADIUS,"x")}else l=this.createLineGrid(e,r,i,_F.CIRCLE,"x");l&&(this.cache.set(s,l),t.set(s,l))}}}}},e.prototype.updateYAxes=function(t){var e=this,r=this.view.getYScales();(0,Ew.each)(r,function(r,n){if(r&&!r.isIdentity){var i=r.field,o=fV(e.option,i);if(!1!==o){var a=wF.BG,s=e.getId("axis",i),u=e.getId("grid",i),l=e.view.getCoordinate();if(l.isRect){var c=hV(o,0===n?_F.LEFT:_F.RIGHT);if(f=e.cache.get(s))YG(p=e.getLineAxisCfg(r,o,c),tX),f.component.update(p),t.set(s,f);else f=e.createLineAxis(r,o,a,c,"y"),e.cache.set(s,f),t.set(s,f);if(h=e.cache.get(u))YG(p=e.getLineGridCfg(r,o,c,"y"),tX),h.component.update(p),t.set(u,h);else(h=e.createLineGrid(r,o,a,c,"y"))&&(e.cache.set(u,h),t.set(u,h))}else if(l.isPolar){var f,h;if(f=e.cache.get(s)){YG(p=l.isTransposed?e.getCircleAxisCfg(r,o,_F.CIRCLE):e.getLineAxisCfg(r,o,_F.RADIUS),tX),f.component.update(p),t.set(s,f)}else{if(l.isTransposed){if((0,Ew.isUndefined)(o))return;f=e.createCircleAxis(r,o,a,_F.CIRCLE,"y")}else f=e.createLineAxis(r,o,a,_F.RADIUS,"y");e.cache.set(s,f),t.set(s,f)}if(h=e.cache.get(u)){var p;YG(p=l.isTransposed?e.getLineGridCfg(r,o,_F.CIRCLE,"y"):e.getCircleGridCfg(r,o,_F.RADIUS,"y"),tX),h.component.update(p),t.set(u,h)}else{if(l.isTransposed){if((0,Ew.isUndefined)(o))return;h=e.createLineGrid(r,o,a,_F.CIRCLE,"y")}else h=e.createCircleGrid(r,o,a,_F.RADIUS,"y");h&&(e.cache.set(u,h),t.set(u,h))}}}}})},e.prototype.createLineAxis=function(t,e,r,n,i){var o={component:new MG(this.getLineAxisCfg(t,e,n)),layer:r,direction:n===_F.RADIUS?_F.NONE:n,type:SF.AXIS,extra:{dim:i,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createLineGrid=function(t,e,r,n,i){var o=this.getLineGridCfg(t,e,n,i);if(o){var a={component:new LG(o),layer:r,direction:_F.NONE,type:SF.GRID,extra:{dim:i,scale:t,alignTick:(0,Ew.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.createCircleAxis=function(t,e,r,n,i){var o={component:new IG(this.getCircleAxisCfg(t,e,n)),layer:r,direction:n,type:SF.AXIS,extra:{dim:i,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createCircleGrid=function(t,e,r,n,i){var o=this.getCircleGridCfg(t,e,n,i);if(o){var a={component:new jG(o),layer:r,direction:_F.NONE,type:SF.GRID,extra:{dim:i,scale:t,alignTick:(0,Ew.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.getLineAxisCfg=function(t,e,r){var n=(0,Ew.get)(e,["top"])?this.axisForeContainer:this.axisContainer,i=this.view.getCoordinate(),o=oV(i,r),a=pV(t,e),s=uV(this.view.getTheme(),r),u=(0,Ew.get)(e,["title"])?(0,Ew.deepMix)({title:{style:{text:a}}},{title:lV(this.view.getTheme(),r,e.title)},e):e,l=(0,Ew.deepMix)((0,Sw.__assign)((0,Sw.__assign)({container:n},o),{ticks:t.getTicks().map(function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}}),verticalFactor:i.isPolar?-1*sV(o,i.getCenter()):sV(o,i.getCenter()),theme:s}),s,u),c=this.getAnimateCfg(l),f=c.animate,h=c.animateOption;l.animateOption=h,l.animate=f;var p=aV(o),d=(0,Ew.get)(l,"verticalLimitLength",p?1/3:.5);if(d<=1){var y=this.view.getCanvas().get("width"),v=this.view.getCanvas().get("height");l.verticalLimitLength=d*(p?y:v)}return l},e.prototype.getLineGridCfg=function(t,e,r,n){if($Y(uV(this.view.getTheme(),r),e)){var i=KY(this.view.getTheme(),r),o=(0,Ew.deepMix)({container:(0,Ew.get)(e,["top"])?this.gridForeContainer:this.gridContainer},i,(0,Ew.get)(e,"grid"),this.getAnimateCfg(e));return o.items=JY(this.view.getCoordinate(),t,n,(0,Ew.get)(o,"alignTick",!0)),o}},e.prototype.getCircleAxisCfg=function(t,e,r){var n=(0,Ew.get)(e,["top"])?this.axisForeContainer:this.axisContainer,i=this.view.getCoordinate(),o=t.getTicks().map(function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}});t.isCategory||Math.abs(i.endAngle-i.startAngle)!==2*Math.PI||o.length&&(o[o.length-1].name="");var a=pV(t,e),s=uV(this.view.getTheme(),_F.CIRCLE),u=(0,Ew.get)(e,["title"])?(0,Ew.deepMix)({title:{style:{text:a}}},{title:lV(this.view.getTheme(),r,e.title)},e):e,l=(0,Ew.deepMix)((0,Sw.__assign)((0,Sw.__assign)({container:n},cV(this.view.getCoordinate())),{ticks:o,verticalFactor:1,theme:s}),s,u),c=this.getAnimateCfg(l),f=c.animate,h=c.animateOption;return l.animate=f,l.animateOption=h,l},e.prototype.getCircleGridCfg=function(t,e,r,n){if($Y(uV(this.view.getTheme(),r),e)){var i=KY(this.view.getTheme(),_F.RADIUS),o=(0,Ew.deepMix)({container:(0,Ew.get)(e,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},i,(0,Ew.get)(e,"grid"),this.getAnimateCfg(e)),a=(0,Ew.get)(o,"alignTick",!0),s="x"===n?this.view.getYScales()[0]:this.view.getXScale();return o.items=QY(this.view.getCoordinate(),s,t,a,n),o}},e.prototype.getId=function(t,e){var r=this.view.getCoordinate();return"".concat(t,"-").concat(e,"-").concat(r.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&(0,Ew.get)(t,"animate"),animateOption:t&&t.animateOption?(0,Ew.deepMix)({},eX,t.animateOption):eX}},e}(nW);function nX(t,e,r){return r===_F.TOP?[t.minX+t.width/2-e.width/2,t.minY]:r===_F.BOTTOM?[t.minX+t.width/2-e.width/2,t.maxY-e.height]:r===_F.LEFT?[t.minX,t.minY+t.height/2-e.height/2]:r===_F.RIGHT?[t.maxX-e.width,t.minY+t.height/2-e.height/2]:r===_F.TOP_LEFT||r===_F.LEFT_TOP?[t.tl.x,t.tl.y]:r===_F.TOP_RIGHT||r===_F.RIGHT_TOP?[t.tr.x-e.width,t.tr.y]:r===_F.BOTTOM_LEFT||r===_F.LEFT_BOTTOM?[t.bl.x,t.bl.y-e.height]:r===_F.BOTTOM_RIGHT||r===_F.RIGHT_BOTTOM?[t.br.x-e.width,t.br.y-e.height]:[0,0]}function iX(t,e){return(0,Ew.isBoolean)(t)?!1!==t&&{}:(0,Ew.get)(t,[e],t)}function oX(t){return(0,Ew.get)(t,"position",_F.BOTTOM)}var aX=function(t){function e(e){var r=t.call(this,e)||this;return r.container=r.view.getLayer(wF.FORE).addGroup(),r}return(0,Sw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,(0,Ew.each)(this.components,function(e){var r=e.component,n=e.direction,i=HW(n),o=r.get("maxWidthRatio"),a=r.get("maxHeightRatio"),s=t.getCategoryLegendSizeCfg(i,o,a),u=r.get("maxWidth"),l=r.get("maxHeight");r.update({maxWidth:Math.min(s.maxWidth,u||0),maxHeight:Math.min(s.maxHeight,l||0)});var c=r.get("padding"),f=r.getLayoutBBox(),h=new ZG(f.x,f.y,f.width,f.height).expand(c),p=(0,Sw.__read)(nX(t.view.viewBBox,h,n),2),d=p[0],y=p[1],v=(0,Sw.__read)(nX(t.layoutBBox,h,n),2),g=v[0],m=v[1],b=0,x=0;n.startsWith("top")||n.startsWith("bottom")?(b=d,x=m):(b=g,x=y),r.setLocation({x:b+c[3],y:x+c[0]}),t.layoutBBox=t.layoutBBox.cut(h,n)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var e={};if((0,Ew.get)(this.option,"custom")){var r="global-custom",n=this.getComponentById(r);if(n){var i=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);YG(i,["container"]),n.component.update(i),e[r]=!0}else{var o=this.createCustomLegend(void 0,void 0,void 0,this.option);if(o){o.init();var a=wF.FORE,s=oX(this.option);this.components.push({id:r,component:o,layer:a,direction:s,type:SF.LEGEND,extra:void 0}),e[r]=!0}}}else this.loopLegends(function(r,n,i){var o=t.getId(i.field),a=t.getComponentById(o);if(a){var s=void 0,u=iX(t.option,i.field);!1!==u&&((0,Ew.get)(u,"custom")?s=t.getCategoryCfg(r,n,i,u,!0):i.isLinear?s=t.getContinuousCfg(r,n,i,u):i.isCategory&&(s=t.getCategoryCfg(r,n,i,u))),s&&(YG(s,["container"]),a.direction=oX(u),a.component.update(s),e[o]=!0)}else{var l=t.createFieldLegend(r,n,i);l&&(l.component.init(),t.components.push(l),e[o]=!0)}});var u=[];(0,Ew.each)(this.getComponents(),function(t){e[t.id]?u.push(t):t.component.destroy()}),this.components=u},e.prototype.clear=function(){t.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var e=this,r=t.geometries;return(0,Ew.each)(t.views,function(t){r=r.concat(e.getGeometries(t))}),r},e.prototype.loopLegends=function(t){if(this.view.getRootView()===this.view){var e=this.getGeometries(this.view),r={};(0,Ew.each)(e,function(e){var n=e.getGroupAttributes();(0,Ew.each)(n,function(n){var i=n.getScale(n.type);i&&"identity"!==i.type&&!r[i.field]&&(t(e,n,i),r[i.field]=!0)})})}},e.prototype.createFieldLegend=function(t,e,r){var n,i=iX(this.option,r.field),o=wF.FORE,a=oX(i);if(!1!==i&&((0,Ew.get)(i,"custom")?n=this.createCustomLegend(t,e,r,i):r.isLinear?n=this.createContinuousLegend(t,e,r,i):r.isCategory&&(n=this.createCategoryLegend(t,e,r,i))),n)return n.set("field",r.field),{id:this.getId(r.field),component:n,layer:o,direction:a,type:SF.LEGEND,extra:{scale:r}}},e.prototype.createCustomLegend=function(t,e,r,n){var i=this.getCategoryCfg(t,e,r,n,!0);return new NG(i)},e.prototype.createContinuousLegend=function(t,e,r,n){var i=this.getContinuousCfg(t,e,r,YG(n,["value"]));return new RG(i)},e.prototype.createCategoryLegend=function(t,e,r,n){var i=this.getCategoryCfg(t,e,r,n);return new NG(i)},e.prototype.getContinuousCfg=function(t,e,r,n){var i=r.getTicks(),o=(0,Ew.find)(i,function(t){return 0===t.value}),a=(0,Ew.find)(i,function(t){return 1===t.value}),s=i.map(function(t){var n=t.value,i=t.tickValue,o=e.mapping(r.invert(n)).join("");return{value:i,attrValue:o,color:o,scaleValue:n}});o||s.push({value:r.min,attrValue:e.mapping(r.invert(0)).join(""),color:e.mapping(r.invert(0)).join(""),scaleValue:0}),a||s.push({value:r.max,attrValue:e.mapping(r.invert(1)).join(""),color:e.mapping(r.invert(1)).join(""),scaleValue:1}),s.sort(function(t,e){return t.value-e.value});var u={min:(0,Ew.head)(s).value,max:(0,Ew.last)(s).value,colors:[],rail:{type:e.type},track:{}};"size"===e.type&&(u.track={style:{fill:"size"===e.type?this.view.getTheme().defaultColor:void 0}}),"color"===e.type&&(u.colors=s.map(function(t){return t.attrValue}));var l=this.container,c=HW(oX(n)),f=(0,Ew.get)(n,"title");return f&&(f=(0,Ew.deepMix)({text:nV(r)},f)),u.container=l,u.layout=c,u.title=f,u.animateOption=uW,this.mergeLegendCfg(u,n,"continuous")},e.prototype.getCategoryCfg=function(t,e,r,n,i){var o=this.container,a=(0,Ew.get)(n,"position",_F.BOTTOM),s=qW(this.view.getTheme(),a),u=(0,Ew.get)(s,["marker"]),l=(0,Ew.get)(n,"marker"),c=HW(a),f=(0,Ew.get)(s,["pageNavigator"]),h=(0,Ew.get)(n,"pageNavigator"),p=i?function(t,e,r){return r.map(function(r,n){var i=e;(0,Ew.isFunction)(i)&&(i=i(r.name,n,(0,Ew.deepMix)({},t,r)));var o=(0,Ew.isFunction)(r.marker)?r.marker(r.name,n,(0,Ew.deepMix)({},t,r)):r.marker,a=(0,Ew.deepMix)({},t,i,o);return VW(a),r.marker=a,r})}(u,l,n.items):WW(this.view,t,e,u,l),d=(0,Ew.get)(n,"title");d&&(d=(0,Ew.deepMix)({text:r?nV(r):""},d));var y=(0,Ew.get)(n,"maxWidthRatio"),v=(0,Ew.get)(n,"maxHeightRatio"),g=this.getCategoryLegendSizeCfg(c,y,v);g.container=o,g.layout=c,g.items=p,g.title=d,g.animateOption=uW,g.pageNavigator=(0,Ew.deepMix)({},f,h);var m=this.mergeLegendCfg(g,n,a);m.reversed&&m.items.reverse();var b=(0,Ew.get)(m,"maxItemWidth");return b&&b<=1&&(m.maxItemWidth=this.view.viewBBox.width*b),m},e.prototype.mergeLegendCfg=function(t,e,r){var n=r.split("-")[0],i=qW(this.view.getTheme(),n);return(0,Ew.deepMix)({},i,t,e)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return(0,Ew.find)(this.components,function(e){return e.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,e,r){void 0===e&&(e=.25),void 0===r&&(r=.25);var n=this.view.viewBBox,i=n.width,o=n.height;return"vertical"===t?{maxWidth:i*e,maxHeight:o}:{maxWidth:i,maxHeight:o*r}},e}(nW),sX=function(t){function e(e){var r=t.call(this,e)||this;return r.onChangeFn=Ew.noop,r.resetMeasure=function(){r.clear()},r.onValueChange=function(t){var e=(0,Sw.__read)(t,2),n=e[0],i=e[1];r.start=n,r.end=i,r.changeViewData(n,i)},r.container=r.view.getLayer(wF.FORE).addGroup(),r.onChangeFn=(0,Ew.throttle)(r.onValueChange,20,{leading:!0}),r.width=0,r.view.on(kF.BEFORE_CHANGE_DATA,r.resetMeasure),r.view.on(kF.BEFORE_CHANGE_SIZE,r.resetMeasure),r}return(0,Sw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(kF.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(kF.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),e=t.start,r=t.end;(0,Ew.isNil)(this.start)&&(this.start=e,this.end=r);var n=this.view.getOptions().data;this.option&&!(0,Ew.isEmpty)(n)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var e=this.view.coordinateBBox.width,r=this.slider.component.get("padding"),n=(0,Sw.__read)(r,4),i=n[0],o=(n[1],n[2],n[3]),a=this.slider.component.getLayoutBBox(),s=new ZG(a.x,a.y,Math.min(a.width,e),a.height).expand(r),u=this.getMinMaxText(this.start,this.end),l=u.minText,c=u.maxText,f=(0,Sw.__read)(nX(this.view.viewBBox,s,_F.BOTTOM),2),h=(f[0],f[1]),p=(0,Sw.__read)(nX(this.view.coordinateBBox,s,_F.BOTTOM),2),d=p[0];p[1];this.slider.component.update((0,Sw.__assign)((0,Sw.__assign)({},this.getSliderCfg()),{x:d+o,y:h+i,width:this.width,start:this.start,end:this.end,minText:l,maxText:c})),this.view.viewBBox=this.view.viewBBox.cut(s,_F.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),e=new OG((0,Sw.__assign)({container:this.container},t));return e.init(),{component:e,layer:wF.FORE,direction:_F.BOTTOM,type:SF.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var e=this.getMinMaxText(this.start,this.end),r=e.minText,n=e.maxText;t=(0,Sw.__assign)((0,Sw.__assign)({},t),{width:this.width,start:this.start,end:this.end,minText:r,maxText:n})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if((0,Ew.isObject)(this.option)){var e=(0,Sw.__assign)({data:this.getData()},(0,Ew.get)(this.option,"trendCfg",{}));t=(0,Ew.deepMix)({},t,this.getThemeOptions(),this.option),t=(0,Sw.__assign)((0,Sw.__assign)({},t),{trendCfg:e})}return t.start=(0,Ew.clamp)(Math.min((0,Ew.isNil)(t.start)?0:t.start,(0,Ew.isNil)(t.end)?1:t.end),0,1),t.end=(0,Ew.clamp)(Math.max((0,Ew.isNil)(t.start)?0:t.start,(0,Ew.isNil)(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,e=(0,Sw.__read)(this.view.getYScales(),1)[0],r=this.view.getGroupScales();if(r.length){var n=r[0],i=n.field,o=n.ticks;return t.reduce(function(t,r){return r[i]===o[0]&&t.push(r[e.field]),t},[])}return t.map(function(t){return t[e.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Ew.get)(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,e){var r=this.view.getOptions().data,n=this.view.getXScale(),i=(0,Ew.valuesOfKey)(r,n.field);n.isLinear&&(i=i.sort());var o=i,a=(0,Ew.size)(r);if(!n||!a)return{};var s=(0,Ew.size)(o),u=Math.round(t*(s-1)),l=Math.round(e*(s-1)),c=(0,Ew.get)(o,[u]),f=(0,Ew.get)(o,[l]),h=this.getSliderCfg().formatter;return h&&(c=h(c,r[u],u),f=h(f,r[l],l)),{minText:c,maxText:f}},e.prototype.changeViewData=function(t,e){var r=this.view.getOptions().data,n=this.view.getXScale(),i=(0,Ew.size)(r);if(n&&i){var o=(0,Ew.valuesOfKey)(r,n.field),a=this.view.getXScale().isLinear?o.sort(function(t,e){return Number(t)-Number(e)}):o,s=a,u=(0,Ew.size)(s),l=Math.round(t*(u-1)),c=Math.round(e*(u-1));this.view.filter(n.field,function(t,e){var r=s.indexOf(t);return!(r>-1)||qG(r,l,c)}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(nW),uX=function(t){function e(e){var r=t.call(this,e)||this;return r.onChangeFn=Ew.noop,r.resetMeasure=function(){r.clear()},r.onValueChange=function(t){var e=t.ratio,n=r.getValidScrollbarCfg().animate;r.ratio=(0,Ew.clamp)(e,0,1);var i=r.view.getOptions().animate;n||r.view.animate(!1),r.changeViewData(r.getScrollRange(),!0),r.view.animate(i)},r.container=r.view.getLayer(wF.FORE).addGroup(),r.onChangeFn=(0,Ew.throttle)(r.onValueChange,20,{leading:!0}),r.trackLen=0,r.thumbLen=0,r.ratio=0,r.view.on(kF.BEFORE_CHANGE_DATA,r.resetMeasure),r.view.on(kF.BEFORE_CHANGE_SIZE,r.resetMeasure),r}return(0,Sw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(kF.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(kF.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var e=this.view.coordinateBBox.width,r=this.scrollbar.component.get("padding"),n=this.scrollbar.component.getLayoutBBox(),i=new ZG(n.x,n.y,Math.min(n.width,e),n.height).expand(r),o=this.getScrollbarComponentCfg(),a=void 0,s=void 0;if(o.isHorizontal){var u=(0,Sw.__read)(nX(this.view.viewBBox,i,_F.BOTTOM),2),l=(u[0],u[1]),c=(0,Sw.__read)(nX(this.view.coordinateBBox,i,_F.BOTTOM),2),f=c[0];c[1];a=f,s=l}else{var h=(0,Sw.__read)(nX(this.view.viewBBox,i,_F.RIGHT),2),p=(h[0],l=h[1],(0,Sw.__read)(nX(this.view.viewBBox,i,_F.RIGHT),2));f=p[0],p[1];a=f,s=l}a+=r[3],s+=r[0],this.trackLen?this.scrollbar.component.update((0,Sw.__assign)((0,Sw.__assign)({},o),{x:a,y:s,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update((0,Sw.__assign)((0,Sw.__assign)({},o),{x:a,y:s})),this.view.viewBBox=this.view.viewBBox.cut(i,o.isHorizontal?_F.BOTTOM:_F.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Ew.get)(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var e=(0,Ew.get)(this.view.getTheme(),["components","scrollbar"]),r=t||{},n=r.thumbHighlightColor,i=(0,Sw.__rest)(r,["thumbHighlightColor"]);return{default:(0,Ew.deepMix)({},(0,Ew.get)(e,["default","style"],{}),i),hover:(0,Ew.deepMix)({},(0,Ew.get)(e,["hover","style"],{}),{thumbColor:n})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),e=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var r=this.getScrollbarComponentCfg(),n=r.trackLen,i=r.thumbLen;this.trackLen=n,this.thumbLen=i,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=e},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*(0,Ew.clamp)(this.ratio,0,1));return[t,Math.min(t+this.step-1,this.cnt-1)]},e.prototype.changeViewData=function(t,e){var r=this,n=(0,Sw.__read)(t,2),i=n[0],o=n[1],a="vertical"!==this.getValidScrollbarCfg().type,s=(0,Ew.valuesOfKey)(this.data,this.xScaleCfg.field),u=this.view.getXScale().isLinear?s.sort(function(t,e){return Number(t)-Number(e)}):s,l=a?u:u.reverse();this.yScalesCfg.forEach(function(t){r.view.scale(t.field,{formatter:t.formatter,type:t.type,min:t.min,max:t.max,tickMethod:t.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(t){var e=l.indexOf(t);return!(e>-1)||qG(e,i,o)}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t="vertical"!==this.getValidScrollbarCfg().type,e=new PG((0,Sw.__assign)((0,Sw.__assign)({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return e.init(),{component:e,layer:wF.FORE,direction:t?_F.BOTTOM:_F.RIGHT,type:SF.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),e=this.trackLen?(0,Sw.__assign)((0,Sw.__assign)({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):(0,Sw.__assign)({},t);return this.scrollbar.component.update(e),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,e=this.getValidScrollbarCfg(),r=e.type,n=e.categorySize,i="vertical"!==r;return Math.floor((i?t.width:t.height)/n)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),e=this.getScrollbarData(),r=(0,Ew.valuesOfKey)(e,t.field);return(0,Ew.size)(r)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,e=t.coordinateBBox,r=t.viewBBox,n=this.getValidScrollbarCfg(),i=n.type,o=n.padding,a=n.width,s=n.height,u=n.style,l="vertical"!==i,c=(0,Sw.__read)(o,4),f=c[0],h=c[1],p=c[2],d=c[3],y=l?{x:e.minX+d,y:r.maxY-s-p}:{x:r.maxX-a-h,y:e.minY+f},v=this.getStep(),g=this.getCnt(),m=l?e.width-d-h:e.height-f-p,b=Math.max(m*(0,Ew.clamp)(v/g,0,1),20);return(0,Sw.__assign)((0,Sw.__assign)({},this.getThemeOptions()),{x:y.x,y:y.y,size:l?s:a,isHorizontal:l,trackLen:m,thumbLen:b,thumbOffset:0,theme:this.getScrollbarTheme(u)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:32,width:8,height:8,padding:[0,0,0,0],animate:!0,style:{}};return(0,Ew.isObject)(this.option)&&(t=(0,Sw.__assign)((0,Sw.__assign)({},t),this.option)),(0,Ew.isObject)(this.option)&&this.option.padding||(t.padding=(t.type,[0,0,0,0])),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),e=this.getValidScrollbarCfg(),r=this.view.getOptions().data||[];return t.isReflect("y")&&"vertical"===e.type&&(r=(0,Sw.__spreadArray)([],(0,Sw.__read)(r),!1).reverse()),r},e}(nW),lX={fill:"#CCD6EC",opacity:.3};function cX(t,e,r){var n,i,o,a,s,u,l=function(t,e,r){var n,i,o=GH(t,e,r);try{for(var a=(0,Sw.__values)(t.views),s=a.next();!s.done;s=a.next()){var u=s.value;o=o.concat(GH(u,e,r))}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}(t,e,r);if(l.length){l=(0,Ew.flatten)(l);try{for(var c=(0,Sw.__values)(l),f=c.next();!f.done;f=c.next()){var h=f.value;try{for(var p=(o=void 0,(0,Sw.__values)(h)),d=p.next();!d.done;d=p.next()){var y=d.value,v=y.mappingData,g=v.x,m=v.y;y.x=(0,Ew.isArray)(g)?g[g.length-1]:g,y.y=(0,Ew.isArray)(m)?m[m.length-1]:m}}catch(t){o={error:t}}finally{try{d&&!d.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}if(!1===r.shared&&l.length>1){var b=l[0],x=Math.abs(e.y-b[0].y);try{for(var w=(0,Sw.__values)(l),_=w.next();!_.done;_=w.next()){var S=_.value,E=Math.abs(e.y-S[0].y);E<=x&&(b=S,x=E)}}catch(t){s={error:t}}finally{try{_&&!_.done&&(u=w.return)&&u.call(w)}finally{if(s)throw s.error}}l=[b]}return(0,Ew.uniq)((0,Ew.flatten)(l))}return[]}var fX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.show=function(t){var e=this.context.view,r=this.context.event,n=e.getController("tooltip").getTooltipCfg(),i=cX(e,{x:r.x,y:r.y},n);if(!(0,Ew.isEqual)(i,this.items)&&(this.items=i,i.length)){var o=e.getXScale().field,a=i[0].data[o],s=[],u=e.geometries;if((0,Ew.each)(u,function(t){if("interval"===t.type||"schema"===t.type){var e=t.getElementsBy(function(t){return t.getData()[o]===a});s=s.concat(e)}}),s.length){var l=e.getCoordinate(),c=s[0].shape.getCanvasBBox(),f=s[0].shape.getCanvasBBox(),h=c;(0,Ew.each)(s,function(t){var e=t.shape.getCanvasBBox();l.isTransposed?(e.minYf.maxY&&(f=e)):(e.minXf.maxX&&(f=e)),h.x=Math.min(e.minX,h.minX),h.y=Math.min(e.minY,h.minY),h.width=Math.max(e.maxX,h.maxX)-h.x,h.height=Math.max(e.maxY,h.maxY)-h.y});var p=e.backgroundGroup,d=e.coordinateBBox,y=void 0;if(l.isRect){var v=e.getXScale(),g=t||{},m=g.appendRatio,b=g.appendWidth;(0,Ew.isNil)(b)&&(m=(0,Ew.isNil)(m)?v.isLinear?0:.25:m,b=l.isTransposed?m*f.height:m*c.width);var x=void 0,w=void 0,_=void 0,S=void 0;l.isTransposed?(x=d.minX,w=Math.min(f.minY,c.minY)-b,_=d.width,S=h.height+2*b):(x=Math.min(c.minX,f.minX)-b,w=d.minY,_=h.width+2*b,S=d.height),y=[["M",x,w],["L",x+_,w],["L",x+_,w+S],["L",x,w+S],["Z"]]}else{var E=(0,Ew.head)(s),k=(0,Ew.last)(s),T=VG(E.getModel(),l).startAngle,C=VG(k.getModel(),l).endAngle,O=l.getCenter(),A=l.getRadius(),P=l.innerRadius*A;y=UG(O.x,O.y,A,T,C,P)}if(this.regionPath)this.regionPath.attr("path",y),this.regionPath.show();else{var M=(0,Ew.get)(t,"style",lX);this.regionPath=p.addShape({type:"path",name:"active-region",capture:!1,attrs:(0,Sw.__assign)((0,Sw.__assign)({},M),{path:y})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),t.prototype.destroy.call(this)},e}(mV),hX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Sw.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=t.event,r=t.view;if(!r.isTooltipLocked()){var n=this.timeStamp,i=+new Date;if(i-n>(0,Ew.get)(t.view.getOptions(),"tooltip.showDelay",16)){var o=this.location,a={x:e.x,y:e.y};o&&(0,Ew.isEqual)(o,a)||this.showTooltip(r,a),this.timeStamp=i,this.location=a}}},e.prototype.hide=function(){var t=this.context.view,e=t.getController("tooltip"),r=this.context.event,n=r.clientX,i=r.clientY;e.isCursorEntered({x:n,y:i})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,e){t.showTooltip(e)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(mV),pX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.showTooltip=function(t,e){var r=tH(t);(0,Ew.each)(r,function(r){var n=eH(t,r,e);r.showTooltip(n)})},e.prototype.hideTooltip=function(t){var e=tH(t);(0,Ew.each)(e,function(t){t.hideTooltip()})},e}(hX),dX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Sw.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context.event,e=this.timeStamp,r=+new Date;if(r-e>16){var n=this.location,i={x:t.x,y:t.y};n&&(0,Ew.isEqual)(n,i)||this.showTooltip(i),this.timeStamp=r,this.location=i}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,r=e.event.target;if(r&&r.get("tip")){if(this.tooltip){var n=e.view.canvas,i={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}};this.tooltip.set("region",i)}else this.renderTooltip();var o=r.get("tip");this.tooltip.update((0,Sw.__assign)({title:o},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view,r=e.canvas,n={start:{x:0,y:0},end:{x:r.get("width"),y:r.get("height")}},i=e.getTheme(),o=(0,Ew.get)(i,["components","tooltip","domStyles"],{}),a=new DG({parent:r.get("el").parentNode,region:n,visible:!1,crosshairs:null,domStyles:(0,Sw.__assign)({},(0,Ew.deepMix)({},o,(t={},t[nG]={"max-width":"50%"},t[iG]={"word-break":"break-all"},t)))});a.init(),a.setCapture(!1),this.tooltip=a},e}(mV),yX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e}return(0,Sw.__extends)(e,t),e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,e){t.setState(this.stateName,e)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var e=this,r=qV(t,this.stateName);(0,Ew.each)(r,function(t){e.setElementState(t,!1)})},e}(mV);function vX(t){return(0,Ew.get)(t.get("delegateObject"),"item")}var gX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreListItemStates=["unchecked"],e}return(0,Sw.__extends)(e,t),e.prototype.isItemIgnore=function(t,e){return!!this.ignoreListItemStates.filter(function(r){return e.hasState(t,r)}).length},e.prototype.setStateByComponent=function(t,e,r){var n=this.context.view,i=t.get("field"),o=WV(n);this.setElementsStateByItem(o,i,e,r)},e.prototype.setStateByElement=function(t,e){this.setElementState(t,e)},e.prototype.isMathItem=function(t,e,r){var n=nH(this.context.view,e),i=YV(t,e);return!(0,Ew.isNil)(i)&&r.name===n.getText(i)},e.prototype.setElementsStateByItem=function(t,e,r,n){var i=this;(0,Ew.each)(t,function(t){i.isMathItem(t,e,r)&&t.setState(i.stateName,n)})},e.prototype.setStateEnable=function(t){var e=NV(this.context);if(e)DV(this.context)&&this.setStateByElement(e,t);else{var r=RV(this.context);if(BV(r)){var n=r.item,i=r.component;if(n&&i&&!this.isItemIgnore(n,i)){var o=this.context.event.gEvent;if(o&&o.fromShape&&o.toShape&&vX(o.fromShape)===vX(o.toShape))return;this.setStateByComponent(i,n,t)}}}},e.prototype.toggle=function(){var t=NV(this.context);if(t){var e=t.hasState(this.stateName);this.setElementState(t,!e)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(yX),mX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Sw.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(gX),bX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache={},e}return(0,Sw.__extends)(e,t),e.prototype.getColorScale=function(t,e){var r=e.geometry.getAttribute("color");return r?t.getScaleByField(r.getFields()[0]):null},e.prototype.getLinkPath=function(t,e){var r=this.context.view.getCoordinate().isTransposed,n=t.shape.getCanvasBBox(),i=e.shape.getCanvasBBox();return r?[["M",n.minX,n.minY],["L",i.minX,i.maxY],["L",i.maxX,i.maxY],["L",n.maxX,n.minY],["Z"]]:[["M",n.maxX,n.minY],["L",i.minX,i.minY],["L",i.minX,i.maxY],["L",n.maxX,n.maxY],["Z"]]},e.prototype.addLinkShape=function(t,e,r,n){var i={opacity:.4,fill:e.shape.attr("fill")};t.addShape({type:"path",attrs:(0,Sw.__assign)((0,Sw.__assign)({},(0,Ew.deepMix)({},i,(0,Ew.isFunction)(n)?n(i,e):n)),{path:this.getLinkPath(e,r)})})},e.prototype.linkByElement=function(t,e){var r=this,n=this.context.view,i=this.getColorScale(n,t);if(i){var o=YV(t,i.field);if(!this.cache[o]){var a=function(t,e,r){return WV(t).filter(function(t){return YV(t,e)===r})}(n,i.field,o),s=this.linkGroup.addGroup();this.cache[o]=s;var u=a.length;(0,Ew.each)(a,function(t,n){if(n=0},e)},e}(xX),NX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Sw.__extends)(e,t),e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,e){CX(WV(this.context.view),function(e){return t===e},e)},e.prototype.clear=function(){TX(this.context.view)},e}(_X),RX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Sw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(xX),DX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Sw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(gX),BX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Sw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(_X),FX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e.ignoreItemStates=[],e}return(0,Sw.__extends)(e,t),e.prototype.getTriggerListInfo=function(){var t=RV(this.context),e=null;return BV(t)&&(e={item:t.item,list:t.component}),e},e.prototype.getAllowComponents=function(){var t=this,e=JV(this.context.view),r=[];return(0,Ew.each)(e,function(e){e.isList()&&t.allowSetStateByElement(e)&&r.push(e)}),r},e.prototype.hasState=function(t,e){return t.hasState(e,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,e=this.getAllowComponents();(0,Ew.each)(e,function(e){e.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var e=t.get("field");if(!e)return!1;if(this.cfg&&this.cfg.componentNames){var r=t.get("name");if(-1===this.cfg.componentNames.indexOf(r))return!1}var n=nH(this.context.view,e);return n&&n.isCategory},e.prototype.allowSetStateByItem=function(t,e){var r=this.ignoreItemStates;return!r.length||0===r.filter(function(r){return e.hasState(t,r)}).length},e.prototype.setStateByElement=function(t,e,r){var n=t.get("field"),i=nH(this.context.view,n),o=YV(e,n),a=i.getText(o);this.setItemsState(t,a,r)},e.prototype.setStateEnable=function(t){var e=this,r=NV(this.context);if(r){var n=this.getAllowComponents();(0,Ew.each)(n,function(n){e.setStateByElement(n,r,t)})}else{var i=RV(this.context);if(BV(i)){var o=i.item,a=i.component;this.allowSetStateByElement(a)&&this.allowSetStateByItem(o,a)&&this.setItemState(a,o,t)}}},e.prototype.setItemsState=function(t,e,r){var n=this,i=t.getItems();(0,Ew.each)(i,function(i){i.name===e&&n.setItemState(t,i,r)})},e.prototype.setItemState=function(t,e,r){t.setItemState(e,this.stateName,r)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,r=t.item,n=this.hasState(e,r);this.setItemState(e,r,!n)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(mV),zX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Sw.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(FX),UX="inactive",GX="active";var VX="active",HX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName=VX,e.ignoreItemStates=["unchecked"],e}return(0,Sw.__extends)(e,t),e.prototype.setItemsState=function(t,e,r){this.setHighlightBy(t,function(t){return t.name===e},r)},e.prototype.setItemState=function(t,e,r){t.getItems();this.setHighlightBy(t,function(t){return t===e},r)},e.prototype.setHighlightBy=function(t,e,r){var n=t.getItems();if(r)(0,Ew.each)(n,function(r){e(r)?(t.hasState(r,"inactive")&&t.setItemState(r,"inactive",!1),t.setItemState(r,VX,!0)):t.hasState(r,VX)||t.setItemState(r,"inactive",!0)});else{var i=t.getItemsByState(VX),o=!0;(0,Ew.each)(i,function(t){if(!e(t))return o=!1,!1}),o?this.clear():(0,Ew.each)(n,function(r){e(r)&&(t.hasState(r,VX)&&t.setItemState(r,VX,!1),t.setItemState(r,"inactive",!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t,e,r=this.getTriggerListInfo();if(r)t=r.list,e=t.getItems(),(0,Ew.each)(e,function(e){t.hasState(e,GX)&&t.setItemState(e,GX,!1),t.hasState(e,UX)&&t.setItemState(e,UX,!1)});else{var n=this.getAllowComponents();(0,Ew.each)(n,function(t){t.clearItemsState(VX),t.clearItemsState("inactive")})}},e}(FX),WX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Sw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(FX),qX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="unchecked",e}return(0,Sw.__extends)(e,t),e.prototype.unchecked=function(){this.setState()},e}(FX),YX="checked",XX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName=YX,e}return(0,Sw.__extends)(e,t),e.prototype.setItemState=function(t,e,r){this.setCheckedBy(t,function(t){return t===e},r)},e.prototype.setCheckedBy=function(t,e,r){var n=t.getItems();r&&(0,Ew.each)(n,function(r){e(r)?(t.hasState(r,"unchecked")&&t.setItemState(r,"unchecked",!1),t.setItemState(r,YX,!0)):t.hasState(r,YX)||t.setItemState(r,"unchecked",!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,r=t.item;!(0,Ew.some)(e.getItems(),function(t){return e.hasState(t,"unchecked")})||e.hasState(r,"unchecked")?this.setItemState(e,r,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();(0,Ew.each)(t,function(t){t.clearItemsState(YX),t.clearItemsState("unchecked")})},e}(FX),ZX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.toggle=function(){var t,e,r,n,i,o,a,s,u=this.getTriggerListInfo();if(null===u||void 0===u?void 0:u.item){var l=u.list,c=u.item,f=l.getItems(),h=f.filter(function(t){return!l.hasState(t,"unchecked")}),p=f.filter(function(t){return l.hasState(t,"unchecked")}),d=h[0];if(f.length===h.length)try{for(var y=(0,Sw.__values)(f),v=y.next();!v.done;v=y.next()){var g=v.value;l.setItemState(g,"unchecked",g.id!==c.id)}}catch(e){t={error:e}}finally{try{v&&!v.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else if(f.length-p.length==1)if(d.id===c.id)try{for(var m=(0,Sw.__values)(f),b=m.next();!b.done;b=m.next()){g=b.value;l.setItemState(g,"unchecked",!1)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}else try{for(var x=(0,Sw.__values)(f),w=x.next();!w.done;w=x.next()){g=w.value;l.setItemState(g,"unchecked",g.id!==c.id)}}catch(t){i={error:t}}finally{try{w&&!w.done&&(o=x.return)&&o.call(x)}finally{if(i)throw i.error}}else try{for(var _=(0,Sw.__values)(f),S=_.next();!S.done;S=_.next()){g=S.value;l.setItemState(g,"unchecked",g.id!==c.id)}}catch(t){a={error:t}}finally{try{S&&!S.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}}},e}(FX),KX="legend-radio-tip",JX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Sw.__extends)(e,t),e.prototype.show=function(){var t=this.getTriggerListInfo();if(null===t||void 0===t?void 0:t.item){var e=t.list,r=t.item;e.setItemState(r,"showRadio",!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(null===t||void 0===t?void 0:t.item){var e=t.list,r=t.item;e.setItemState(r,"showRadio",!1)}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context.event,e=this.timeStamp,r=+new Date,n=this.context.event.target;if(r-e>16&&"legend-item-radio"===n.get("name")){var i=this.location,o={x:t.x,y:t.y};this.timeStamp=r,this.location=o,i&&(0,Ew.isEqual)(i,o)||this.showTooltip(o)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,r=e.event.target;if(r&&r.get("tip")){this.tooltip||this.renderTooltip();var n=e.view.getCanvas().get("el").getBoundingClientRect(),i=n.x,o=n.y;this.tooltip.update((0,Sw.__assign)((0,Sw.__assign)({title:r.get("tip")},t),{x:t.x+i,y:t.y+o})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=((t={})[nG]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[iG]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(KX)&&document.body.removeChild(document.getElementById(KX));var r=new DG({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:e,containerId:KX});r.init(),r.setCapture(!1),this.tooltip=r},e}(FX),QX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShape=null,e.points=[],e.starting=!1,e.moving=!1,e.preMovePoint=null,e.shapeType="path",e}return(0,Sw.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="mask:".concat(t),r=this.context.view,n=this.context.event;r.emit(e,{target:this.maskShape,shape:this.maskShape,points:this.points,x:n.x,y:n.y})},e.prototype.createMask=function(){var t=this.context.view,e=this.getMaskAttrs();return t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:(0,Sw.__assign)({fill:"#C5D4EB",opacity:.3},e)})},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(null===t||void 0===t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(this.moving&&this.maskShape){var t=this.getCurrentPoint(),e=this.preMovePoint,r=t.x-e.x,n=t.y-e.y,i=this.points;(0,Ew.each)(i,function(t){t.x+=r,t.y+=n}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var e=(0,Ew.deepMix)({},this.getMaskAttrs(),t);this.maskShape.attr(e)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,t.prototype.destroy.call(this)},e}(mV);function $X(t){var e=(0,Ew.last)(t),r=0,n=0,i=0;if(t.length){var o=t[0];r=QV(o,e)/2,n=(e.x+o.x)/2,i=(e.y+o.y)/2}return{x:n,y:i,r:r}}var tZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e}return(0,Sw.__extends)(e,t),e.prototype.getMaskAttrs=function(){return $X(this.points)},e}(QX);function eZ(t){return{start:(0,Ew.head)(t),end:(0,Ew.last)(t)}}function rZ(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var nZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return(0,Sw.__extends)(e,t),e.prototype.getRegion=function(){return eZ(this.points)},e.prototype.getMaskAttrs=function(){var t=this.getRegion();return rZ(t.start,t.end)},e}(QX);function iZ(t){t.x=(0,Ew.clamp)(t.x,0,1),t.y=(0,Ew.clamp)(t.y,0,1)}function oZ(t,e,r,n){var i=null,o=null,a=n.invert((0,Ew.head)(t)),s=n.invert((0,Ew.last)(t));return r&&(iZ(a),iZ(s)),"x"===e?(i=n.convert({x:a.x,y:0}),o=n.convert({x:s.x,y:1})):(i=n.convert({x:0,y:a.y}),o=n.convert({x:1,y:s.y})),{start:i,end:o}}var aZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getRegion=function(){var t=this.context.view.getCoordinate();return oZ(this.points,this.dim,this.inPlot,t)},e}(nZ);function sZ(t){var e=[];return t.length&&((0,Ew.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",t[0].x,t[0].y])),e}function uZ(t){return{path:sZ(t)}}var lZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getMaskPath=function(){return sZ(this.points)},e.prototype.getMaskAttrs=function(){return uZ(this.points)},e.prototype.addPoint=function(){this.resize()},e}(QX);function cZ(t){return function(t,e){if(t.length<=2)return CV(t,!1);var r=t[0],n=[];(0,Ew.each)(t,function(t){n.push(t.x),n.push(t.y)});var i=TV(n,e,null);return i.unshift(["M",r.x,r.y]),i}(t,!0)}function fZ(t){return{path:cZ(t)}}var hZ,pZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.getMaskPath=function(){return cZ(this.points)},e.prototype.getMaskAttrs=function(){return fZ(this.points)},e}(lZ),dZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShapes=[],e.starting=!1,e.moving=!1,e.recordPoints=null,e.preMovePoint=null,e.shapeType="path",e.maskType="multi-mask",e}return(0,Sw.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="".concat(this.maskType,":").concat(t),r=this.context.view,n=this.context.event,i={type:this.shapeType,name:this.maskType,get:function(t){return i.hasOwnProperty(t)?i[t]:void 0}};r.emit(e,{target:i,maskShapes:this.maskShapes,multiPoints:this.recordPoints,x:n.x,y:n.y})},e.prototype.createMask=function(t){var e=this.context.view,r=this.recordPoints[t],n=this.getMaskAttrs(r),i=e.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:(0,Sw.__assign)({fill:"#C5D4EB",opacity:.3},n)});this.maskShapes.push(i)},e.prototype.getMaskPath=function(t){return[]},e.prototype.show=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.show()}),this.emitEvent("show"))},e.prototype.start=function(t){this.recordPointStart(),this.starting=!0,this.moving=!1;var e=this.recordPoints.length-1;this.createMask(e),this.updateShapesCapture(!1),this.updateMask(null===t||void 0===t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint(),this.updateShapesCapture(!1)},e.prototype.move=function(){if(this.moving&&0!==this.maskShapes.length){var t=this.getCurrentPoint(),e=this.preMovePoint,r=t.x-e.x,n=t.y-e.y,i=this.getCurMaskShapeIndex();i>-1&&(this.recordPoints[i].forEach(function(t){t.x+=r,t.y+=n}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t)}},e.prototype.updateMask=function(t){var e=this;this.recordPoints.forEach(function(r,n){var i=(0,Ew.deepMix)({},e.getMaskAttrs(r),t);e.maskShapes[n].attr(i)})},e.prototype.resize=function(){this.starting&&this.maskShapes.length>0&&(this.recordPointContinue(),this.updateMask(),this.emitEvent("change"))},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null,this.updateShapesCapture(!0)},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.updateShapesCapture(!0)},e.prototype.hide=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.hide()}),this.emitEvent("hide"))},e.prototype.remove=function(){var t=this.getCurMaskShapeIndex();t>-1&&(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.updateShapesCapture(!0),this.emitEvent("change"))},e.prototype.clearAll=function(){this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.preMovePoint=null},e.prototype.clear=function(){var t=this.getCurMaskShapeIndex();-1===t?(this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.emitEvent("clearAll")):(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.emitEvent("clearSingle")),this.preMovePoint=null},e.prototype.destroy=function(){this.clear(),t.prototype.destroy.call(this)},e.prototype.getRecordPoints=function(){var t;return(0,Sw.__spreadArray)([],(0,Sw.__read)(null!==(t=this.recordPoints)&&void 0!==t?t:[]),!1)},e.prototype.recordPointStart=function(){var t=this.getRecordPoints(),e=this.getCurrentPoint();this.recordPoints=(0,Sw.__spreadArray)((0,Sw.__spreadArray)([],(0,Sw.__read)(t),!1),[[e]],!1)},e.prototype.recordPointContinue=function(){var t=this.getRecordPoints(),e=this.getCurrentPoint(),r=t.splice(-1,1)[0]||[];r.push(e),this.recordPoints=(0,Sw.__spreadArray)((0,Sw.__spreadArray)([],(0,Sw.__read)(t),!1),[r],!1)},e.prototype.recordPointClear=function(){this.recordPoints=[]},e.prototype.updateShapesCapture=function(t){this.maskShapes.forEach(function(e){return e.set("capture",t)})},e.prototype.getCurMaskShapeIndex=function(){var t=this.getCurrentPoint();return this.maskShapes.findIndex(function(e){var r=e.attrs,n=r.width,i=r.height,o=r.r;return!(0===n||0===i||0===o)&&e.isHit(t.x,t.y)})},e}(mV),yZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return(0,Sw.__extends)(e,t),e.prototype.getRegion=function(t){return eZ(t)},e.prototype.getMaskAttrs=function(t){var e=this.getRegion(t);return rZ(e.start,e.end)},e}(dZ),vZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return(0,Sw.__extends)(e,t),e.prototype.getRegion=function(t){var e=this.context.view.getCoordinate();return oZ(t,this.dim,this.inPlot,e)},e}(yZ),gZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e.getMaskAttrs=$X,e}return(0,Sw.__extends)(e,t),e}(dZ),mZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getMaskPath=sZ,e.getMaskAttrs=uZ,e}return(0,Sw.__extends)(e,t),e.prototype.addPoint=function(){this.resize()},e}(dZ),bZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getMaskPath=cZ,e.getMaskAttrs=fZ,e}return(0,Sw.__extends)(e,t),e}(mZ),xZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.setCursor=function(t){this.context.view.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e.prototype.zoomIn=function(){this.setCursor("zoom-in")},e.prototype.zoomOut=function(){this.setCursor("zoom-out")},e}(mV),wZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.filterView=function(t,e,r){var n=this;t.getScaleByField(e)&&t.filter(e,r),t.views&&t.views.length&&(0,Ew.each)(t.views,function(t){n.filterView(t,e,r)})},e.prototype.filter=function(){var t=RV(this.context);if(t){var e=this.context.view,r=t.component,n=r.get("field");if(BV(t)){if(n){var i=r.getItemsByState("unchecked"),o=nH(e,n),a=i.map(function(t){return t.name});a.length?this.filterView(e,n,function(t){var e=o.getText(t);return!a.includes(e)}):this.filterView(e,n,null),e.render(!0)}}else if(FV(t)){var s=r.getValue(),u=(0,Sw.__read)(s,2),l=u[0],c=u[1];this.filterView(e,n,function(t){return t>=l&&t<=c}),e.render(!0)}}},e}(mV);function _Z(t,e,r,n){var i=Math.min(r[e],n[e]),o=Math.max(r[e],n[e]),a=(0,Sw.__read)(t.range,2),s=a[0],u=a[1];if(iu&&(o=u),i===u&&o===u)return null;var l=t.invert(i),c=t.invert(o);if(t.isCategory){var f=t.values.indexOf(l),h=t.values.indexOf(c),p=t.values.slice(f,h+1);return function(t){return p.includes(t)}}return function(t){return t>=l&&t<=c}}!function(t){t.FILTER="brush-filter-processing",t.RESET="brush-filter-reset",t.BEFORE_FILTER="brush-filter:beforefilter",t.AFTER_FILTER="brush-filter:afterfilter",t.BEFORE_RESET="brush-filter:beforereset",t.AFTER_RESET="brush-filter:afterreset"}(hZ||(hZ={}));var SZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.startPoint=null,e.isStarted=!1,e}return(0,Sw.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,e;if(zV(this.context)){var r=this.context.event.target.getCanvasBBox();t={x:r.x,y:r.y},e={x:r.maxX,y:r.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(Math.abs(t.x-e.x)<5||Math.abs(t.x-e.y)<5)){var n=this.context,i=n.view,o={view:i,event:n.event,dims:this.dims};i.emit(hZ.BEFORE_FILTER,YH.fromData(i,hZ.BEFORE_FILTER,o));var a=i.getCoordinate(),s=a.invert(e),u=a.invert(t);if(this.hasDim("x")){var l=i.getXScale(),c=_Z(l,"x",s,u);this.filterView(i,l.field,c)}if(this.hasDim("y")){var f=i.getYScales()[0];c=_Z(f,"y",s,u);this.filterView(i,f.field,c)}this.reRender(i,{source:hZ.FILTER}),i.emit(hZ.AFTER_FILTER,YH.fromData(i,hZ.AFTER_FILTER,o))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(hZ.BEFORE_RESET,YH.fromData(t,hZ.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var r=t.getYScales()[0];this.filterView(t,r.field,null)}this.reRender(t,{source:hZ.RESET}),t.emit(hZ.AFTER_RESET,YH.fromData(t,hZ.AFTER_RESET,{}))},e.prototype.filterView=function(t,e,r){t.filter(e,r)},e.prototype.reRender=function(t,e){t.render(!0,e)},e}(mV),EZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.filterView=function(t,e,r){var n=tH(t);(0,Ew.each)(n,function(t){t.filter(e,r)})},e.prototype.reRender=function(t){var e=tH(t);(0,Ew.each)(e,function(t){t.render(!0)})},e}(SZ),kZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.filter=function(){var t=RV(this.context),e=this.context.view,r=WV(e);if(zV(this.context)){var n=GV(this.context,10);n&&(0,Ew.each)(r,function(t){n.includes(t)?t.show():t.hide()})}else if(t){var i=t.component,o=i.get("field");if(BV(t)){if(o){var a=i.getItemsByState("unchecked"),s=nH(e,o),u=a.map(function(t){return t.name});(0,Ew.each)(r,function(t){var e=YV(t,o),r=s.getText(e);u.indexOf(r)>=0?t.hide():t.show()})}}else if(FV(t)){var l=i.getValue(),c=(0,Sw.__read)(l,2),f=c[0],h=c[1];(0,Ew.each)(r,function(t){var e=YV(t,o);e>=f&&e<=h?t.show():t.hide()})}}},e.prototype.clear=function(){var t=WV(this.context.view);(0,Ew.each)(t,function(t){t.show()})},e.prototype.reset=function(){this.clear()},e}(mV),TZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.byRecord=!1,e}return(0,Sw.__extends)(e,t),e.prototype.filter=function(){zV(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,e=GV(this.context,10);if(e){var r=t.getXScale().field,n=t.getYScales()[0].field,i=e.map(function(t){return t.getModel().data}),o=tH(t);(0,Ew.each)(o,function(t){var e=WV(t);(0,Ew.each)(e,function(t){var e=t.getModel().data;rH(i,e,r,n)?t.show():t.hide()})})}},e.prototype.filterByBBox=function(){var t=this,e=tH(this.context.view);(0,Ew.each)(e,function(e){var r=VV(t.context,e,10),n=WV(e);r&&(0,Ew.each)(n,function(t){r.includes(t)?t.show():t.hide()})})},e.prototype.reset=function(){var t=tH(this.context.view);(0,Ew.each)(t,function(t){var e=WV(t);(0,Ew.each)(e,function(t){t.show()})})},e}(mV),CZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.buttonGroup=null,e.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},e}return(0,Sw.__extends)(e,t),e.prototype.getButtonCfg=function(){return(0,Ew.deepMix)(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),r=e.addShape({type:"text",name:"button-text",attrs:(0,Sw.__assign)({text:t.text},t.textStyle)}).getBBox(),n=VH(t.padding),i=e.addShape({type:"rect",name:"button-rect",attrs:(0,Sw.__assign)({x:r.x-n[3],y:r.y-n[0],width:r.width+n[1]+n[3],height:r.height+n[0]+n[2]},t.style)});i.toBack(),e.on("mouseenter",function(){i.attr(t.activeStyle)}),e.on("mouseleave",function(){i.attr(t.style)}),this.buttonGroup=e},e.prototype.resetPosition=function(){var t=this.context.view.getCoordinate().convert({x:1,y:1}),e=this.buttonGroup,r=e.getBBox(),n=Aw.vs(null,[["t",t.x-r.width-10,t.y+r.height+5]]);e.setMatrix(n)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var e=this.buttonGroup;e&&e.remove(),t.prototype.destroy.call(this)},e}(mV),OZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.dragStart=!1,e}return(0,Sw.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(this.startPoint){var t=this.context.getCurrentPoint(),e=this.context.view,r=this.context.event;this.dragStart?e.emit("drag",{target:r.target,x:r.x,y:r.y}):QV(t,this.startPoint)>4&&(e.emit("dragstart",{target:r.target,x:r.x,y:r.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,e=this.context.event;t.emit("dragend",{target:e.target,x:e.x,y:e.y})}this.starting=!1,this.dragStart=!1},e}(mV),AZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.isMoving=!1,e.startPoint=null,e.startMatrix=null,e}return(0,Sw.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(this.starting){var t=this.startPoint,e=this.context.getCurrentPoint();if(QV(t,e)>5&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var r=this.context.view,n=Aw.vs(this.startMatrix,[["t",e.x-t.x,e.y-t.y]]);r.backgroundGroup.setMatrix(n),r.foregroundGroup.setMatrix(n),r.middleGroup.setMatrix(n)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(mV),PZ="x",MZ="y",IZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=[PZ,MZ],e.cfgFields=["dims"],e.cacheScaleDefs={},e}return(0,Sw.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var e=this.context.view;return"x"===t?e.getXScale():e.getYScales()[0]},e.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var r=this.getScale(t);e.scale(r.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(PZ),this.resetDim(MZ),this.context.view.render(!0)},e}(mV),LZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startPoint=null,e.starting=!1,e.startCache={},e}return(0,Sw.__extends)(e,t),e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var e=this.dims;(0,Ew.each)(e,function(e){var r=t.getScale(e),n=r.min,i=r.max,o=r.values;t.startCache[e]={min:n,max:i,values:o}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(this.starting){var e=this.startPoint,r=this.context.view.getCoordinate(),n=this.context.getCurrentPoint(),i=r.invert(e),o=r.invert(n),a=o.x-i.x,s=o.y-i.y,u=this.context.view,l=this.dims;(0,Ew.each)(l,function(e){t.translateDim(e,{x:-1*a,y:-1*s})}),u.render(!0)}},e.prototype.translateDim=function(t,e){if(this.hasDim(t)){var r=this.getScale(t);r.isLinear&&this.translateLinear(t,r,e)}},e.prototype.translateLinear=function(t,e,r){var n=this.context.view,i=this.startCache[t],o=i.min,a=i.max,s=a-o,u=r[t]*s;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:o,max:a}),n.scale(e.field,{nice:!1,min:o+u,max:a+u})},e.prototype.reset=function(){t.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(IZ),jZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.zoomRatio=.05,e}return(0,Sw.__extends)(e,t),e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var e=this,r=this.dims;(0,Ew.each)(r,function(r){e.zoomDim(r,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,e){if(this.hasDim(t)){var r=this.getScale(t);r.isLinear&&this.zoomLinear(t,r,e)}},e.prototype.zoomLinear=function(t,e,r){var n=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:e.min,max:e.max});var i=this.cacheScaleDefs[t],o=i.max-i.min,a=e.min,s=e.max,u=r*o,l=a-u,c=s+u,f=(c-l)/o;c>l&&f<100&&f>.01&&n.scale(e.field,{nice:!1,min:a-u,max:s+u})},e}(IZ);var NZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.scroll=function(t){var e=this.context,r=e.view,n=e.event;if(r.getOptions().scrollbar){var i=(null===t||void 0===t?void 0:t.wheelDelta)||1,o=r.getController("scrollbar"),a=r.getXScale(),s=r.getOptions().data,u=(0,Ew.size)((0,Ew.valuesOfKey)(s,a.field)),l=(0,Ew.size)(a.values),c=o.getValue(),f=Math.floor((u-l)*c)+(function(t){return t.gEvent.originalEvent.deltaY>0}(n)?i:-i),h=i/(u-l)/1e4,p=(0,Ew.clamp)(f/(u-l)+h,0,1);o.setValue(p)}},e}(mV),RZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Sw.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=RV(t).axis.cfg.title,r=e.description,n=e.text,i=e.descriptionTooltipStyle,o=t.event,a=o.x,s=o.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:n||"",customContent:function(){return'\n
      \n
      \n 字段说明:').concat(r,"\n
      \n
      \n ")},x:a,y:s}),this.tooltip.show()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view.canvas,r={start:{x:0,y:0},end:{x:e.get("width"),y:e.get("height")}},n=new DG({parent:e.get("el").parentNode,region:r,visible:!1,containerId:"aixs-description-tooltip",domStyles:(0,Sw.__assign)({},(0,Ew.deepMix)({},(t={},t[nG]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[iG]={"word-break":"break-all","margin-bottom":"3px"},t)))});n.init(),n.setCapture(!1),this.tooltip=n},e}(mV);function DZ(t){return t.isInPlot()}function BZ(t){return t.gEvent.preventDefault(),t.gEvent.originalEvent.deltaY>0}LH("dark",gH(bq)),RF("canvas",f),RF("svg",p),tW("Polygon",Fq),tW("Interval",jq),tW("Schema",zq),tW("Path",xq),tW("Point",Bq),tW("Line",Nq),tW("Area",Eq),tW("Edge",kq),tW("Heatmap",Tq),tW("Violin",Uq),gW("base",FW),gW("interval",Jq),gW("pie",tY),gW("polar",$q),bW("overlap",function(t,e,r,n){var i=new uY;(0,Ew.each)(e,function(t){for(var e=t.find(function(t){return"text"===t.get("type")}),r=e.attr(),n=r.x,o=r.y,a=!1,s=0;s<=8;s++){var u=lY(e,n,o,s);if(i.hasGap(u)){i.fillGap(u),a=!0;break}}a||t.remove(!0)}),i.destroy()}),bW("distribute",function(t,e,r,n){if(t.length&&e.length){var i=t[0]?t[0].offset:0,o=e[0].get("coordinate"),a=o.getRadius(),s=o.getCenter();if(i>0){var u=2*(a+i)+28,l={start:o.start,end:o.end},c=[[],[]];t.forEach(function(t){t&&("right"===t.textAlign?c[0].push(t):c[1].push(t))}),c.forEach(function(t,r){var n=u/14;t.length>n&&(t.sort(function(t,e){return e["..percent"]-t["..percent"]}),t.splice(n,t.length-n)),t.sort(function(t,e){return t.y-e.y}),function(t,e,r,n,i,o){var a,s,u,l=!0,c=n.start,f=n.end,h=Math.min(c.y,f.y),p=Math.abs(c.y-f.y),d=0,y=Number.MIN_VALUE,v=e.map(function(t){return t.y>d&&(d=t.y),t.yp&&(p=d-h);l;)for(v.forEach(function(t){var e=(Math.min.apply(y,t.targets)+Math.max.apply(y,t.targets))/2;t.pos=Math.min(Math.max(y,e-t.size/2),p-t.size)}),l=!1,u=v.length;u--;)if(u>0){var g=v[u-1],m=v[u];g.pos+g.size>m.pos&&(g.size+=m.size,g.targets=g.targets.concat(m.targets),g.pos+g.size>p&&(g.pos=p-g.size),v.splice(u,1),l=!0)}u=0,v.forEach(function(t){var n=h+r/2;t.targets.forEach(function(){e[u].y=t.pos+n,n+=r,u++})});var b={};try{for(var x=(0,Sw.__values)(t),w=x.next();!w.done;w=x.next()){var _=w.value;b[_.get("id")]=_}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}e.forEach(function(t){var e=t.r*t.r,r=Math.pow(Math.abs(t.y-i.y),2);if(ei.maxX||n.maxY>i.maxY)&&t.remove(!0)})}),bW("limit-in-canvas",function(t,e,r,n){(0,Ew.each)(e,function(t){var e=n.minX,r=n.minY,i=n.maxX,o=n.maxY,a=t.getCanvasBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,f=a.x,h=a.y,p=a.width,d=a.height,y=f,v=h;(si?y=i-p:l>i&&(y-=l-i),u>o?v=o-d:c>o&&(v-=c-o),y===f&&v===h||IW(t,y-f,v-h)})}),bW("limit-in-plot",function(t,e,r,n,i){if(!(e.length<=0)){var o=(null===i||void 0===i?void 0:i.direction)||["top","right","bottom","left"],a=(null===i||void 0===i?void 0:i.action)||"translate",s=(null===i||void 0===i?void 0:i.margin)||0,u=e[0].get("coordinate");if(u){var l=function(t,e){void 0===e&&(e=0);var r=t.start,n=t.end,i=t.getWidth(),o=t.getHeight(),a=Math.min(r.x,n.x),s=Math.min(r.y,n.y);return ZG.fromRange(a-e,s-e,a+i+e,s+o+e)}(u,s),c=l.minX,f=l.minY,h=l.maxX,p=l.maxY;(0,Ew.each)(e,function(t){var e=t.getCanvasBBox(),r=e.minX,n=e.minY,i=e.maxX,s=e.maxY,u=e.x,l=e.y,d=e.width,y=e.height,v=u,g=l;if(o.indexOf("left")>=0&&(r=0&&(n=0&&(r>h?v=h-d:i>h&&(v-=i-h)),o.indexOf("bottom")>=0&&(n>p?g=p-y:s>p&&(g-=s-p)),v!==u||g!==l){var m=v-u;"translate"===a?IW(t,m,g-l):"ellipsis"===a?t.findAll(function(t){return"text"===t.get("type")}).forEach(function(t){var e=(0,Ew.pick)(t.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),r=t.getCanvasBBox(),n=IY(t.attr("text"),r.width-Math.abs(m),e);t.attr("text",n)}):t.hide()}})}}}),bW("pie-outer",function(t,e,r,n){var i,o,a=(0,Ew.filter)(t,function(t){return!(0,Ew.isNil)(t)}),s=e[0]&&e[0].get("coordinate");if(s){var u=s.getCenter(),l=s.getRadius(),c={};try{for(var f=(0,Sw.__values)(e),h=f.next();!h.done;h=f.next()){var p=h.value;c[p.get("id")]=p}}catch(t){i={error:t}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}var d=(0,Ew.get)(a[0],"labelHeight",14),y=(0,Ew.get)(a[0],"offset",0);if(!(y<=0)){var v=(0,Ew.groupBy)(a,function(t){return t.xr&&(t.sort(function(t,e){return e.percent-t.percent}),(0,Ew.each)(t,function(t,e){e+1>r&&(c[t.id].set("visible",!1),t.invisible=!0)})),rY(t,d,w)}),(0,Ew.each)(v,function(t,e){(0,Ew.each)(t,function(t){var r="right"===e,n=c[t.id].getChildByIndex(0);if(n){var i=l+y,o=t.y-u.y,a=Math.pow(i,2),f=Math.pow(o,2),h=a-f>0?a-f:0,p=Math.sqrt(h),d=Math.abs(Math.cos(t.angle)*i);t.x=r?u.x+Math.max(p,d):u.x-Math.max(p,d)}n&&(n.attr("y",t.y),n.attr("x",t.x)),function(t,e){var r=e.getCenter(),n=e.getRadius();if(t&&t.labelLine){var i=t.angle,o=t.offset,a=zG(r.x,r.y,n,i),s=t.x+(0,Ew.get)(t,"offsetX",0)*(Math.cos(i)>0?1:-1),u=t.y+(0,Ew.get)(t,"offsetY",0)*(Math.sin(i)>0?1:-1),l={x:s-Math.cos(i)*nY,y:u-Math.sin(i)*nY},c=t.labelLine.smooth,f=[],h=l.x-r.x,p=l.y-r.y,d=Math.atan(p/h);if(h<0&&(d+=Math.PI),!1===c){(0,Ew.isObject)(t.labelLine)||(t.labelLine={});var y=0;(i<0&&i>-Math.PI/2||i>1.5*Math.PI)&&l.y>a.y&&(y=1),i>=0&&ia.y&&(y=1),i>=Math.PI/2&&il.y&&(y=1),(i<-Math.PI/2||i>=Math.PI&&i<1.5*Math.PI)&&a.y>l.y&&(y=1);var v=o/2>4?4:Math.max(o/2-1,0),g=zG(r.x,r.y,n+v,i),m=zG(r.x,r.y,n+o/2,d);f.push("M ".concat(a.x," ").concat(a.y)),f.push("L ".concat(g.x," ").concat(g.y)),f.push("A ".concat(r.x," ").concat(r.y," 0 ").concat(0," ").concat(y," ").concat(m.x," ").concat(m.y)),f.push("L ".concat(l.x," ").concat(l.y))}else{g=zG(r.x,r.y,n+(o/2>4?4:Math.max(o/2-1,0)),i);var b=a.xMath.pow(Math.E,-16)&&f.push.apply(f,["C",l.x+4*b,l.y,2*g.x-a.x,2*g.y-a.y,a.x,a.y]),f.push("L ".concat(a.x," ").concat(a.y))}t.labelLine.path=f.join(" ")}}(t,s)})})}}}),bW("adjust-color",function(t,e,r){if(0!==r.length){var n=r[0].get("element").geometry.theme,i=n.labels||{},o=i.fillColorLight,a=i.fillColorDark;r.forEach(function(t,r){var i=e[r].find(function(t){return"text"===t.get("type")}),s=ZG.fromObject(t.getBBox()),u=ZG.fromObject(i.getCanvasBBox()),l=!s.contains(u),c=t.attr("fill"),f=EY(c);l?i.attr(n.overflowLabels.style):f?o&&i.attr("fill",o):a&&i.attr("fill",a)})}}),bW("interval-adjust-position",function(t,e,r){var n;if(0!==r.length){var i=null===(n=r[0])||void 0===n?void 0:n.get("element"),o=null===i||void 0===i?void 0:i.geometry;o&&"interval"===o.type&&kY(o,e,r)&&r.forEach(function(t,r){var n=e[r];!function(t,e,r){var n=t.coordinate,i=ZG.fromObject(r.getBBox()),o=jW(e);n.isTransposed?o.attr({x:i.minX+i.width/2,textAlign:"center"}):o.attr({y:i.minY+i.height/2,textBaseline:"middle"})}(o,n,t)})}}),bW("interval-hide-overlap",function(t,e,r){var n;if(0!==r.length){var i=null===(n=r[0])||void 0===n?void 0:n.get("element"),o=null===i||void 0===i?void 0:i.geometry;if(o&&"interval"===o.type){var a,s=function(t){var e=[],r=Math.max(Math.floor(t.length/500),1);return(0,Ew.each)(t,function(t,n){n%r==0?e.push(t):t.set("visible",!1)}),e}(e),u=(0,Sw.__read)(o.getXYFields(),1)[0],l=[],c=[],f=(0,Ew.groupBy)(s,function(t){return t.get("data")[u]}),h=(0,Ew.uniq)((0,Ew.map)(s,function(t){return t.get("data")[u]}));s.forEach(function(t){t.set("visible",!0)});var p=function(t){t&&(t.length&&c.push(t.pop()),c.push.apply(c,(0,Sw.__spreadArray)([],(0,Sw.__read)(t),!1)))};for((0,Ew.size)(h)>0&&(a=h.shift(),p(f[a])),(0,Ew.size)(h)>0&&(a=h.pop(),p(f[a])),(0,Ew.each)(h.reverse(),function(t){p(f[t])});c.length>0;){var d=c.shift();d.get("visible")&&(RW(d,l)?d.set("visible",!1):l.push(d))}}}}),bW("point-adjust-position",function(t,e,r,n,i){var o,a;if(0!==r.length){var s=null===(o=r[0])||void 0===o?void 0:o.get("element"),u=null===s||void 0===s?void 0:s.geometry;if(u&&"point"===u.type){var l=(0,Sw.__read)(u.getXYFields(),2),c=l[0],f=l[1],h=(0,Ew.groupBy)(e,function(t){return t.get("data")[c]}),p=[],d=i&&i.offset||(null===(a=t[0])||void 0===a?void 0:a.offset)||12;(0,Ew.map)((0,Ew.keys)(h).reverse(),function(t){for(var e=function(t,e){var r=t.getXYFields()[1],n=[],i=e.sort(function(t,e){return t.get("data")[r]-t.get("data")[r]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,(0,Sw.__spreadArray)([],(0,Sw.__read)(i),!1)),n}(u,h[t]);e.length;){var r=e.shift(),n=jW(r);if(TY(p,r,function(t,e){return t.get("data")[c]===e.get("data")[c]&&t.get("data")[f]===e.get("data")[f]}))n.set("visible",!1);else{var i=!1;CY(p,r)&&(n.attr("y",n.attr("y")+2*d),i=CY(p,r)),i?n.set("visible",!1):p.push(r)}}})}}}),bW("pie-spider",function(t,e,r,n){var i,o,a=e[0]&&e[0].get("coordinate");if(a){var s=a.getCenter(),u=a.getRadius(),l={};try{for(var c=(0,Sw.__values)(e),f=c.next();!f.done;f=c.next()){var h=f.value;l[h.get("id")]=h}}catch(t){i={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}var p=(0,Ew.get)(t[0],"labelHeight",14),d=Math.max((0,Ew.get)(t[0],"offset",0),iY);(0,Ew.each)(t,function(t){if(t&&(0,Ew.get)(l,[t.id])){var e=t.x>s.x||t.x===s.x&&t.y>s.y,r=(0,Ew.isNil)(t.offsetX)?oY:t.offsetX,n=zG(s.x,s.y,u+iY,t.angle),i=d+r;t.x=s.x+(e?1:-1)*(u+i),t.y=n.y}});var y=a.start,v=a.end,g=(0,Ew.groupBy)(t,function(t){return t.xm&&(m=Math.min(e,Math.abs(y.y-v.y)))});var b={minX:y.x,maxX:v.x,minY:s.y-m/2,maxY:s.y+m/2};(0,Ew.each)(g,function(t,e){var r=m/p;t.length>r&&(t.sort(function(t,e){return e.percent-t.percent}),(0,Ew.each)(t,function(t,e){e>r&&(l[t.id].set("visible",!1),t.invisible=!0)})),rY(t,p,b)});var x=b.minY,w=b.maxY;(0,Ew.each)(g,function(t,e){var r="right"===e;(0,Ew.each)(t,function(t){var e=(0,Ew.get)(l,t&&[t.id]);if(e)if(t.yw)e.set("visible",!1);else{var n=e.getChildByIndex(0),i=n.getCanvasBBox(),o=r?i.x:i.maxX,s=i.y+i.height/2;IW(n,t.x-o,t.y-s),t.labelLine&&function(t,e,r){var n,i=e.getCenter(),o=e.getRadius(),a={x:t.x-(r?aY:-aY),y:t.y},s=zG(i.x,i.y,o+iY,t.angle),u={x:a.x,y:a.y},l={x:s.x,y:s.y},c=zG(i.x,i.y,o,t.angle);if(a.y!==s.y){var f=r?4:-4;u.y=a.y,t.angle<0&&t.angle>=-Math.PI/2&&(u.x=Math.max(s.x,a.x-f),a.y0&&t.angles.y?l.y=u.y:(l.y=s.y,l.x=Math.max(l.x,u.x-f))),t.angle>Math.PI/2&&(u.x=Math.min(s.x,a.x-f),a.y>s.y?l.y=u.y:(l.y=s.y,l.x=Math.min(l.x,u.x-f))),t.angle<-Math.PI/2&&(u.x=Math.min(s.x,a.x-f),a.y0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,(0,Sw.__spreadArray)([],(0,Sw.__read)(i),!1)),n}(u,h[t]);e.length;){var r=e.shift(),n=jW(r);if(OY(p,r,function(t,e){return t.get("data")[c]===e.get("data")[c]&&t.get("data")[f]===e.get("data")[f]}))n.set("visible",!1);else{var i=!1;AY(p,r)&&(n.attr("y",n.attr("y")+2*d),i=AY(p,r)),i?n.set("visible",!1):p.push(r)}}})}}}),sW("fade-in",function(t,e,r){var n={fillOpacity:(0,Ew.isNil)(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),strokeOpacity:(0,Ew.isNil)(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity"),opacity:(0,Ew.isNil)(t.attr("opacity"))?1:t.attr("opacity")};t.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),t.animate(n,e)}),sW("fade-out",function(t,e,r){var n=e.easing,i=e.duration,o=e.delay;t.animate({fillOpacity:0,strokeOpacity:0,opacity:0},i,n,function(){t.remove(!0)},o)}),sW("grow-in-x",function(t,e,r){LY(t,e,r.coordinate,r.minYPoint,"x")}),sW("grow-in-xy",function(t,e,r){LY(t,e,r.coordinate,r.minYPoint,"xy")}),sW("grow-in-y",function(t,e,r){LY(t,e,r.coordinate,r.minYPoint,"y")}),sW("scale-in-x",function(t,e,r){var n=t.getBBox(),i=t.get("origin").mappingData.points,o=i[0].y-i[1].y>0?n.maxX:n.minX,a=(n.minY+n.maxY)/2;t.applyToMatrix([o,a,1]);var s=Aw.vs(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]]);t.setMatrix(s),t.animate({matrix:Aw.vs(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])},e)}),sW("scale-in-y",function(t,e,r){var n=t.getBBox(),i=t.get("origin").mappingData,o=(n.minX+n.maxX)/2,a=i.points,s=a[0].y-a[1].y<=0?n.maxY:n.minY;t.applyToMatrix([o,s,1]);var u=Aw.vs(t.getMatrix(),[["t",-o,-s],["s",1,.01],["t",o,s]]);t.setMatrix(u),t.animate({matrix:Aw.vs(t.getMatrix(),[["t",-o,-s],["s",1,100],["t",o,s]])},e)}),sW("wave-in",function(t,e,r){var n=$G(r.coordinate,20),i=n.type,o=n.startState,a=n.endState,s=t.setClip({type:i,attrs:o});r.toAttrs&&t.attr(r.toAttrs),s.animate(a,(0,Sw.__assign)((0,Sw.__assign)({},e),{callback:function(){t&&!t.get("destroyed")&&t.set("clipShape",null),s.remove(!0),(0,Ew.isFunction)(e.callback)&&e.callback()}}))}),sW("zoom-in",function(t,e,r){DY(t,e,"zoomIn")}),sW("zoom-out",function(t,e,r){DY(t,e,"zoomOut")}),sW("position-update",function(t,e,r){var n=r.toAttrs,i=n.x,o=n.y;delete n.x,delete n.y,t.attr(n),t.animate({x:i,y:o},e)}),sW("sector-path-update",function(t,e,r){var n=r.toAttrs,i=r.coordinate,o=n.path||[],a=o.map(function(t){return t[0]});if(!(o.length<1)){var s=RY(o),u=s.startAngle,l=s.endAngle,c=s.radius,f=s.innerRadius,h=RY(t.attr("path")),p=h.startAngle,d=h.endAngle,y=i.getCenter(),v=u-p,g=l-d;0!==v||0!==g?t.animate(function(t){var e=p+t*v,r=d+t*g;return(0,Sw.__assign)((0,Sw.__assign)({},n),{path:(0,Ew.isEqual)(a,["M","A","A","Z"])?GG(y.x,y.y,c,e,r):UG(y.x,y.y,c,e,r,f)})},(0,Sw.__assign)((0,Sw.__assign)({},e),{callback:function(){t.attr("path",o),(0,Ew.isFunction)(e.callback)&&e.callback()}})):t.attr(n)}}),sW("path-in",function(t,e,r){var n=t.getTotalLength();t.attr("lineDash",[n]),t.animate(function(t){return{lineDashOffset:(1-t)*n}},e)}),gV("rect",HY),gV("mirror",VY),gV("list",UY),gV("matrix",GY),gV("circle",zY),gV("tree",WY),WH("axis",rX),WH("legend",aX),WH("tooltip",iW),WH("annotation",ZY),WH("slider",sX),WH("scrollbar",uX),_V("tooltip",hX),_V("sibling-tooltip",pX),_V("ellipsis-text",dX),_V("element-active",mX),_V("element-single-active",SX),_V("element-range-active",wX),_V("element-highlight",MX),_V("element-highlight-by-x",LX),_V("element-highlight-by-color",IX),_V("element-single-highlight",NX),_V("element-range-highlight",jX),_V("element-sibling-highlight",jX,{effectSiblings:!0,effectByRecord:!0}),_V("element-selected",DX),_V("element-single-selected",BX),_V("element-range-selected",RX),_V("element-link-by-color",bX),_V("active-region",fX),_V("list-active",zX),_V("list-selected",WX),_V("list-highlight",HX),_V("list-unchecked",qX),_V("list-checked",XX),_V("list-focus",ZX),_V("list-radio",JX),_V("legend-item-highlight",HX,{componentNames:["legend"]}),_V("axis-label-highlight",HX,{componentNames:["axis"]}),_V("axis-description",RZ),_V("rect-mask",nZ),_V("x-rect-mask",aZ,{dim:"x"}),_V("y-rect-mask",aZ,{dim:"y"}),_V("circle-mask",tZ),_V("path-mask",lZ),_V("smooth-path-mask",pZ),_V("rect-multi-mask",yZ),_V("x-rect-multi-mask",vZ,{dim:"x"}),_V("y-rect-multi-mask",vZ,{dim:"y"}),_V("circle-multi-mask",gZ),_V("path-multi-mask",mZ),_V("smooth-path-multi-mask",bZ),_V("cursor",xZ),_V("data-filter",wZ),_V("brush",SZ),_V("brush-x",SZ,{dims:["x"]}),_V("brush-y",SZ,{dims:["y"]}),_V("sibling-filter",EZ),_V("sibling-x-filter",EZ,{dims:"x"}),_V("sibling-y-filter",EZ,{dims:"y"}),_V("element-filter",kZ),_V("element-sibling-filter",TZ),_V("element-sibling-filter-record",TZ,{byRecord:!0}),_V("view-drag",OZ),_V("view-move",AZ),_V("scale-translate",LZ),_V("scale-zoom",jZ),_V("reset-button",CZ,{name:"reset-button",text:"reset"}),_V("mousewheel-scroll",NZ),vH("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]}),vH("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]}),vH("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]}),vH("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]}),vH("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]}),vH("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]}),vH("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]}),vH("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]}),vH("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]}),vH("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]}),vH("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]}),vH("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(t){return!t.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(t){return!t.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]}),vH("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:DZ,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:DZ,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:DZ,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]}),vH("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]}),vH("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:DZ,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:DZ,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:DZ,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]}),vH("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:DZ,action:"path-mask:start"},{trigger:"mousedown",isEnable:DZ,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]}),vH("brush-x-multi",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"mousedown",isEnable:DZ,action:["x-rect-multi-mask:start","x-rect-multi-mask:show"]},{trigger:"mask:dragstart",action:["x-rect-multi-mask:moveStart"]}],processing:[{trigger:"mousemove",isEnable:function(t){return!UV(t)},action:["x-rect-multi-mask:resize"]},{trigger:"multi-mask:change",action:"element-range-highlight:highlight"},{trigger:"mask:drag",action:["x-rect-multi-mask:move"]}],end:[{trigger:"mouseup",action:["x-rect-multi-mask:end"]},{trigger:"mask:dragend",action:["x-rect-multi-mask:moveEnd"]}],rollback:[{trigger:"dblclick",action:["x-rect-multi-mask:clear","cursor:crosshair"]},{trigger:"multi-mask:clearAll",action:["element-range-highlight:clear"]},{trigger:"multi-mask:clearSingle",action:["element-range-highlight:highlight"]}]}),vH("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]}),vH("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(t){return!t.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]}),vH("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]}),vH("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]}),vH("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]}),vH("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]}),vH("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]}),vH("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(t){return BZ(t.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(t){return!BZ(t.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]}),vH("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]}),vH("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var FZ={colorRegExp:null,_nameColors:null,initialize:function(){this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"}},toColor:function(t,e){if(e=e||"rgb",t&&(3===t.length||4===t.length)){if(t=this.map(t,function(t){return t>1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}},convert:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),r[3]=n,this.toColor(r,e)},toRGBA:function(t){return this.convert(t,"rgba")},trim:function(t){return String(t).replace(/\s+/g,"")},normalize:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t},getData:function(t){var e,r,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var i,o=[];if(n[2])i=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(i,function(t){return FZ.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var a=n[4].split(",");r=a[3],i=a.slice(0,3),o=this.map(i,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),FZ.adjust.call(this,t,[0,255])}),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}else if(n[5]||n[6]){var s=(n[5]||n[6]).split(","),u=parseInt(s[0],0)/360,l=s[1],c=s[2];r=s[3],(o=this.map([l,c],function(t){return FZ.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(u),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}return o},map:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t},isCalculableColor:function(t){return t instanceof Array||"string"==typeof t},_HSV_2_RGB:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s=6*i;6===s&&(s=0);var u=0|s,l=a*(1-o),c=a*(1-o*(s-u)),f=a*(1-o*(1-(s-u))),h=0,p=0,d=0;0===u?(h=a,p=f,d=l):1===u?(h=c,p=a,d=l):2===u?(h=l,p=a,d=f):3===u?(h=l,p=c,d=a):4===u?(h=f,p=l,d=a):(h=a,p=l,d=c),e=255*h,r=255*p,n=255*d}return[e,r,n]},_HSL_2_RGB:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+o):a+o-o*a);e=255*this._HUE_2_RGB(u,s,i+1/3),r=255*this._HUE_2_RGB(u,s,i),n=255*this._HUE_2_RGB(u,s,i-1/3)}return[e,r,n]},_HUE_2_RGB:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}};FZ.initialize();var zZ=FZ;function UZ(t){"@babel/helpers - typeof";return(UZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function GZ(){GZ=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==UZ(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function VZ(t,e){return WZ(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||ZZ(t,e)||HZ()}function HZ(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function WZ(t){if(Array.isArray(t))return t}function qZ(t){return function(t){if(Array.isArray(t))return KZ(t)}(t)||YZ(t)||ZZ(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YZ(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function XZ(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ZZ(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ZZ(t,e){if(t){if("string"==typeof t)return KZ(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?KZ(t,e):void 0}}function KZ(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0}function kK(t,e){return EK(t,e)?QZ(QZ({},e),{},{withCredentials:!0}):QZ(QZ({},e),{},{withCredentials:void 0})}function TK(t,e){return CK.apply(this,arguments)}function CK(){return(CK=eK(GZ().mark(function t(e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.url,i=e.dataSourceName,o=e.datasetName,a=e.credential,s={datasetNames:[i+":"+o],getFeatureMode:"SQL",targetEpsgCode:"4326",queryParameter:{name:o+"@"+i}},u="".concat(n.split("featureResults")[0],"datasources/").concat(i,"/datasets/").concat(o),l=kK(u,r),t.next=6,xK(u,a,l);case 6:return c=t.sent,f=c.fieldNames,h=c.fieldTypes,p=dK(n,a),t.next=12,ut.post(p,JSON.stringify(s),l);case 12:return d=t.sent,t.next=15,d.json();case 15:return y=t.sent,t.abrupt("return",{type:"FeatureCollection",features:SK((y||{}).features||[],f,h)});case 17:case"end":return t.stop()}},t)}))).apply(this,arguments)}function OK(t,e){return ut.get(t,null,e).then(function(t){return t.json()}).then(function(t){if(!1===t.succeed)throw t.error.errorMsg;return t})}function AK(t,e){return PK.apply(this,arguments)}function PK(){return(PK=eK(GZ().mark(function t(e,r){var n,i,o,a,s;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,OK(e,r);case 2:if(n=t.sent,o=(i=n||{}).features,a=i.links,!(s=(void 0===a?[]:a).find(function(t){return"next"===t.rel}))){t.next=13;break}return t.t0=o,t.next=9,AK(s.href,r);case 9:return t.t1=t.sent,t.abrupt("return",t.t0.concat.call(t.t0,t.t1));case 13:return t.abrupt("return",o);case 14:case"end":return t.stop()}},t)}))).apply(this,arguments)}function MK(t,e){return IK.apply(this,arguments)}function IK(){return(IK=eK(GZ().mark(function t(e,r){var n,i;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(r.server,"web/datas/").concat(e,"/structureddata/ogc-features/collections/all/items.json?limit=10000&offset=0"),t.next=3,AK(n,r);case 3:return i=t.sent,t.abrupt("return",{type:"FeatureCollection",features:i});case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function LK(t,e,r){if(t===e)return r;if("EPSG:4214"===t&&"EPSG:4326"===e&&180===r[0]){var n=hx(t,e,r);return n[0]=180,n}return hx(t,e,r)}function jK(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"EPSG:4326";if(t&&t.length&&e)return e===r?t:t.map(function(t){var n=function(t,e,r){if("MultiPolygon"===r.type){var n=r.coordinates;return{type:r.type,coordinates:n.map(function(r){return r.map(function(r){return r.map(function(r){return LK(t,e,r)})})})}}if("Polygon"===r.type||"MultiLineString"===r.type){var i=r.coordinates;return{type:r.type,coordinates:i.map(function(r){return r.map(function(r){return LK(t,e,r)})})}}if("MultiPoint"===r.type||"LineString"===r.type){var o=r.coordinates;return{type:r.type,coordinates:o.map(function(r){return LK(t,e,r)})}}if("Point"===r.type)return{type:r.type,coordinates:LK(t,e,r.coordinates)}}(e,r,t.geometry),i=QZ({},t);return n&&Object.assign(i,{geometry:n}),i})}function NK(t,e){return RK.apply(this,arguments)}function RK(){return(RK=eK(GZ().mark(function t(e,r){var n,i,o,a,s;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MK(e.dataId,r);case 2:return n=t.sent,t.next=5,ut.get("".concat(r.server,"web/datas/").concat(e.dataId,"/structureddata.json"),null,r);case 5:return i=t.sent,t.next=8,i.json();case 8:return o=t.sent,"EPSG:4326"!==(a="EPSG:".concat(o.epsgCode))&&(s=jK(n.features,a))&&(n.features=s),t.abrupt("return",n);case 12:case"end":return t.stop()}},t)}))).apply(this,arguments)}function DK(t){return{type:"json",x:t.originX,y:t.originY,x1:t.destinationX,y1:t.destinationY}}function BK(t){var e=t.clusterField,r=t.clusterMethod,n=t.clusterRadius;return[{type:t.clusterType,field:e,method:r&&{avg:"mean"}[r]||r,size:n}]}function FK(t,e,r){return zK.apply(this,arguments)}function zK(){return(zK=eK(GZ().mark(function t(e,r,n){var i,o,a,s,u,l;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.data,o=e.od,a=e.cluster,!i||"FeatureCollection"!==i.type){t.next=3;break}return t.abrupt("return",{data:i});case 3:if(s={"supermap-rest-data":TK,"supermap-structured-data":NK},u=o&&DK(e),l=a&&BK(e),t.t0=s[i.type],!t.t0){t.next=11;break}return t.next=10,s[i.type](e.data,n);case 10:t.t0=t.sent;case 11:return t.t1=t.t0,t.t2=u,t.t3=l,t.abrupt("return",{data:t.t1,parser:t.t2,transforms:t.t3});case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function UK(t,e,r){var n={data:((t||{}).tiles||[])[0],parser:{type:"mvt",extent:t.bounds,sourceLayer:e}};return EK(n.data,r)&&Object.assign(n.parser,{requestParameters:{credentials:"include"}}),n}function GK(t,e,r){var n=t.type,i={vector:UK,geojson:FK};return i[n]&&i[n](t,e,r)}function VK(t){if(t){var e,r=WZ(e=t)||YZ(e)||ZZ(e)||HZ(),n=r[0],i=r.slice(1).filter(function(t){var e=VZ(t,2)[1];return!["$type","$id"].includes(e)}),o=Array.from(new Set(function t(e){var r,n=[],i=XZ(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o instanceof Array&&o[1]&&"string"==typeof o[1])n.push(o[1]);else if(o instanceof Array){var a=t(o);a&&a.length>0&&n.push.apply(n,qZ(a))}}}catch(t){i.e(t)}finally{i.f()}return n}(i))),a=rF([n].concat(qZ(i))),s=a.filter.bind(a);return{field:o,values:function(){for(var t=arguments.length,e=new Array(t),r=0;r1?e-1:0),n=1;n1&&!function(t){return 2===t.length&&1===t[0]&&0===t[1]}(t)?"dash":"solid"}function $K(t,e,r){var n=t.paint,i=t.layout,o=n["circle-color"]||"#EE4D5A",a=n["circle-radius"]||30,s=n["circle-opacity"],u=i["circle-animate-speed"],l=i["circle-animate-rings"];return QZ(QZ({},HK(t)),{},{type:nK.point,source:e,color:WK({value:o,property:"color",map:r}),size:WK({value:a,property:"size",multiple:2,map:r}),shape:{values:"circle"},style:{opacity:s},animate:{enable:!0,speed:u,rings:l}})}function tJ(t,e,r){var n=t.paint,i=t.layout,o=n["radar-color"]||"#EE4D5A",a=n["radar-radius"]||30,s=n["radar-opacity"],u=i["radar-animate-speed"];return QZ(QZ({},HK(t)),{},{type:nK.point,source:e,color:WK({value:o,property:"color",map:r}),size:WK({value:a,property:"size",map:r}),shape:{values:"radar"},style:{opacity:s,speed:u},animate:{enable:!0}})}function eJ(t,e,r){var n=t.paint,i=t.layout,o=i["line-curve-shape"]||i["line-curve-extrusion-shape"],a="arc3d"===o?"line-curve-extrusion":"line-curve",s=n["".concat(a,"-color")]||"#ff6b34",u=n["".concat(a,"-width")]||1,l=n["".concat(a,"-dasharray")],c=n["".concat(a,"-pattern")],f=QZ(QZ({},HK(t)),{},{type:nK.line,source:{data:e.data.features.map(function(t){return t.properties}),parser:e.parser},color:WK({value:s,property:"color",map:r}),size:WK({value:u,property:"size",map:r}),shape:{values:o},style:{lineType:QK(l)}});for(var h in n){var p=qK(a,h);p&&Object.assign(f.style||{},$Z({},p,n[h]))}for(var d in i){var y=qK(a,d);y&&Object.assign(f.style||{},$Z({},y,i[d]));var v=YK(a,d);v&&(f.animate||(f.animate={}),Object.assign(f.animate,$Z({},v,i[d])))}return c&&(f.texture={values:c},Object.assign(f.style||{},{lineTexture:!0})),f}function rJ(t,e,r){var n=t.paint,i=t.layout,o=n["point-extrusion-color"]||"#EE4D5A",a=n["point-extrusion-width"]||12,s=n["point-extrusion-length"]||12,u=n["point-extrusion-height"]||12,l=n["point-extrusion-opacity"],c=n["point-extrusion-source-color"],f=n["point-extrusion-target-color"],h=n["point-extrusion-opacity-linear-direction"],p=i["point-extrusion-shape"]||"cylinder";return QZ(QZ({},HK(t)),{},{type:nK.point,source:e,color:WK({value:o,property:"color",map:r}),size:XK(r,{value:a,multiple:.5},{value:s,multiple:.5},{value:u}),shape:WK({value:p,property:"shape",map:r}),style:{opacity:l,sourceColor:c,targetColor:f,opacityLinear:{enable:!!h,dir:h}}})}function nJ(t,e,r){var n=t.paint,i=t.layout,o=n["line-extrusion-color"]||"#ff6b34",a=n["line-extrusion-width"]||12,s=n["line-extrusion-base"]||0,u=n["line-extrusion-dasharray"],l=n["line-extrusion-pattern"],c=QZ(QZ({},HK(t)),{},{type:nK.line,source:e,color:WK({value:o,property:"color",map:r}),size:XK(r,{value:a,multiple:pK},{value:s}),shape:{values:"line"},style:{lineType:QK(u)}});for(var f in n){var h=iK[f];h&&Object.assign(c.style||{},$Z({},h,n[f]))}for(var p in i){var d=iK[p];d&&Object.assign(c.style||{},$Z({},d,i[p]));var y=oK[p];y&&(c.animate||(c.animate={}),Object.assign(c.animate,$Z({},y,i[p])))}return l&&(c.texture={values:l},Object.assign(c.style||{},{lineTexture:!0})),c}function iJ(t,e){var r=t.paint,n=t.layout,i=r["chart-background-color"],o=r["chart-width"],a=r["chart-height"],s={grid:r["chart-xAxis-grid"],label:r["chart-xAxis-label"],line:r["chart-xAxis-line"]},u={grid:r["chart-yAxis-grid"],label:r["chart-yAxis-label"],line:r["chart-yAxis-line"]},l=n["chart-type"],c=n["chart-attribute-color"],f="line"===l&&c.length>0&&{values:c[0][1]};return QZ(QZ({},HK(t)),{},{type:nK.point,id:t.id,source:e,layerType:aK.MarkerLayer,chartType:l,fields:{values:"bar"===l?ZK(c):function(t){return t.map(function(t){return VZ(t,1)[0]})}(c)},width:{values:o},height:{values:a},background:{values:i},xAxis:{values:s},yAxis:{values:u},color:f})}function oJ(t,e){var r=t.paint,n=t.layout,i=r["chart-radius"],o=r["chart-inner-radius"],a=n["chart-type"],s=n["chart-attribute-color"];return QZ(QZ({},HK(t)),{},{type:nK.point,id:t.id,source:e,layerType:aK.MarkerLayer,chartType:a,fields:{values:ZK(s)},radius:{values:i},innerRadius:{values:o}})}function aJ(t,e,r){var n=t.paint,i=t.layout,o=n["heatmap-color"]||"#EE4D5A",a=n["heatmap-opacity"],s=i["heatmap-shape"],u=i["heatmap-rotate"],l=i["heatmap-coverage"];return QZ(QZ({},HK(t)),{},{type:nK.heatmap,id:t.id,source:e,shape:{values:s},color:WK({value:o,property:"color",map:r}),style:{opacity:a,coverage:l,angle:u}})}function sJ(t,e,r){var n=t.paint,i=t.layout,o=n["heatmap-extrusion-color"]||"#EE4D5A",a=n["heatmap-extrusion-opacity"],s=n["heatmap-extrusion-height"],u=i["heatmap-extrusion-shape"],l=i["heatmap-extrusion-rotate"],c=i["heatmap-extrusion-coverage"];return QZ(QZ({},HK(t)),{},{type:nK.heatmap,id:t.id,source:e,shape:{values:u},size:WK({value:s,property:"size",map:r}),color:WK({value:o,property:"color",map:r}),style:{opacity:a,coverage:c,angle:l}})}function uJ(t,e){var r=t.paint,n=r["heatmap-extrusion-color"],i=r["heatmap-extrusion-opacity"],o=r["heatmap-extrusion-intensity"],a=r["heatmap-extrusion-radius"],s=r["heatmap-extrusion-weight"];return QZ(QZ({},HK(t)),{},{type:nK.heatmap,id:t.id,source:e,size:{field:s,values:[0,1]},shape:{values:"heatmap3D"},style:{rampColors:function(t){var e=pF.paint_heatmap["heatmap-color"],r=hF.createPropertyExpression(t,e);return{positions:r.value._styleExpression.expression.labels,colors:r.value._styleExpression.expression.outputs.map(function(t){return t.value})}}(n),opacity:i,intensity:o,radius:a}})}function lJ(t,e,r,n){var i=t.paint,o=t.layout,a=o["text-field"].split("{")[1].split("}")[0],s={};return Object.keys(function(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return t}(sK,["text-color","text-size","text-field"])).forEach(function(e){var r,n=(t[(r=e,uK.includes(r)?"layout":"paint")]||{})[e];void 0!==n&&(s[sK[e]]=n)}),QZ(QZ({},HK(t)),{},{type:nK.point,id:t.id,source:e,color:WK({value:i["text-color"],property:"color",map:n}),size:WK({value:o["text-size"],property:"size",map:n}),shape:{field:a,values:"text"},style:s})}function cJ(t){return fJ.apply(this,arguments)}function fJ(){return(fJ=eK(GZ().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=e.layers,n=e.sources,i=e.map,o=e.options,a=[],s=XZ(r),t.prev=3,s.s();case 5:if((u=s.n()).done){t.next=23;break}return l=u.value,t.prev=7,c=n[l.source],f=$Z($Z($Z($Z($Z($Z($Z($Z($Z($Z({},rK.animatePoint,$K),rK.radarPoint,tJ),rK.od,eJ),rK.column,rJ),rK.line,nJ),rK.bar,iJ),rK.pie,oJ),rK.heatGrid,aJ),rK.heat3DGrid,sJ),rK.heat3D,uJ),t.next=12,GK(c,l["source-layer"],o);case 12:h=t.sent,p=KK(l),a.push(f[p]&&f[p](l,h,i)||lJ(l,h,(l||{}).visible,i)),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(7),console.error(t.t0),o.emitterEvent("getlayersfailed",{error:t.t0,map:i});case 21:t.next=5;break;case 23:t.next=28;break;case 25:t.prev=25,t.t1=t.catch(3),s.e(t.t1);case 28:return t.prev=28,s.f(),t.finish(28);case 31:return t.abrupt("return",a);case 32:case"end":return t.stop()}},t,null,[[3,25,28,31],[7,17]])}))).apply(this,arguments)}function hJ(t){return pJ.apply(this,arguments)}function pJ(){return(pJ=eK(GZ().mark(function t(e){return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t){e.getL7Scene().then(function(e){t(e)})}));case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}function dJ(t,e){if(e){var r=document.createElement("canvas");r.width=e.width,r.height=e.height;var n=r.getContext("2d");if(n)return n.drawImage(e,0,0),n.getImageData(t.x,t.y,t.width,t.height)}}function yJ(t){var e=VZ(zZ.getData(zZ.toRGBA(t)),4);return{r:e[0],g:e[1],b:e[2],a:e[3]}}function vJ(t,e){return gJ.apply(this,arguments)}function gJ(){return(gJ=eK(GZ().mark(function t(e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,mJ(e);case 2:if(n=t.sent,i=r.color,o=r.rotate,a=document.createElement("canvas"),s=a.getContext("2d"),a.width=n.width,a.height=n.height,s.translate(a.width/2,a.height/2),0!==o&&s.rotate(o*Math.PI/180),s.drawImage(n,-n.width/2,-n.height/2),i){for(u=s.getImageData(0,0,a.width,a.height),l=u.data,c=yJ(i),f=c.r,h=c.g,p=c.b,d=c.a,y=0;y1&&!t.includes("/sprite@2x")?function(t){var e=t.split("/"),r=e.slice(-1)[0];if(!r)return t;var n=r.replace("sprite","sprite@2x");return e.splice(e.length-1,1,n),e.join("/")}(t):t}(r)+".png";return n&&(i+="?token=".concat(n)),i}function SJ(t,e){return new Promise(function(r){var n=_J(t),i=new XMLHttpRequest,o=new Image;o.crossOrigin="",i.responseType="blob",i.open("get",n,!0),i.withCredentials=e.withCredentials,i.setRequestHeader("accept","image/webp,*/*"),i.onreadystatechange=function(){4===i.readyState&&200===i.status&&(o.src=URL.createObjectURL(i.response),o.onload=function(){r(o)},o.onerror=function(){r(null)})},i.send(null)})}function EJ(t,e,r){return kJ.apply(this,arguments)}function kJ(){return(kJ=eK(GZ().mark(function t(e,r,n){var i;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,SJ(e,n);case 2:if(i=t.sent){t.next=5;break}return t.abrupt("return");case 5:return t.abrupt("return",dJ(r,i));case 6:case"end":return t.stop()}},t)}))).apply(this,arguments)}function TJ(t){return CJ.apply(this,arguments)}function CJ(){return(CJ=eK(GZ().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p,d,y,v,g;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=e.layers,n=e.sprite,i=e.spriteJson,o=e.scene,a=e.options,s=+new Date,u=0;case 3:if(!(u2&&void 0!==arguments[2]&&arguments[2],n=[],i=e.properties,o=0;return r&&t.forEach(function(t){var e=i?i[t]:0;o+=e}),t.forEach(function(t){var e=i?i[t]:0,a={x:t,y:e};r&&(a.percent=e/o),n.push(a)}),n}function IJ(t,e,r,n){if(!T){throw console.error("G2 is not define"),new Error("G2 is not define")}var i=new rW({container:t,width:e,height:r,autoFit:!0});return i.legend(!1),i.data(n),i}function LJ(t,e){return new Wj.Marker({element:t}).setLnglat(e)}function jJ(t,e){var r=t.source,n=t.id,i=t.chartType,o=r.data;t.filter&&(o=function(t,e){var r=t.features,n=e.field,i=e.values;return{type:"FeatureCollection",features:r.filter(function(t){var e=n.map(function(e){return(t.properties||{})[e]});return i.apply(void 0,qZ(e))})}}(r.data,t.filter)),function(t,e){var r=OJ.getMarkerLayer(t);r&&(e.removeMarkerLayer(r),OJ.removeMarkerLayer(t))}(n,e);var a=[];if(i===hK.bar){var s=t.fields,u=t.width,l=t.height,c=t.background,f=t.xAxis,h=t.yAxis,p={width:u.values,height:l.values,background:c.values,xAxis:f.values,yAxis:h.values};a=function(t,e,r){var n=e.width,i=e.height,o=e.background,a=e.xAxis,s=e.yAxis,u=r.features,l=Object.keys(t),c=Object.values(t),f=AJ(a),h=AJ(s),p=document.createElement("div");return p.style.backgroundColor=o,u.map(function(t){var e=p.cloneNode(),r=PJ(t),o=MJ(l,t),a=IJ(e,n,i,o);return a.axis("x",f),a.axis("y",h),a.interval().position("x*y").color("x",c),a.render(),LJ(e,r)})}(s.values,p,o)}if(i===hK.line){var d=t.color,y=t.fields,v=t.width,g=t.height,m=t.background,b=t.xAxis,x=t.yAxis,w={width:v.values,height:g.values,background:m.values,xAxis:b.values,yAxis:x.values,color:d.values};a=function(t,e,r){var n=e.color,i=e.width,o=e.height,a=e.background,s=e.xAxis,u=e.yAxis,l=r.features,c=AJ(s),f=AJ(u),h=document.createElement("div");return h.style.background=a,l.map(function(e){var r=h.cloneNode(),a=PJ(e),s=MJ(t,e),u=IJ(r,i,o,s);return u.axis("x",c),u.axis("y",f),u.line().position("x*y").color(n),u.render(),LJ(r,a)})}(y.values,w,o)}if(i===hK.pie){var _=t.fields,S=t.radius,E=t.innerRadius,k={radius:S.values,innerRadius:E.values};a=function(t,e,r){var n=r.features,i=Object.keys(t),o=Object.values(t),a=e.radius,s=e.innerRadius,u=document.createElement("div");return n.map(function(t){var e=u.cloneNode(),r=PJ(t),n=MJ(i,t,!0),l=IJ(e,a,a,n);return l.coord("theta",{innerRadius:s}),l.interval().adjust("stack").position("percent").color("x",o).shape("sliceShape"),l.render(),LJ(e,r)})}(_.values,k,o)}var T=function(t){var e=new Wj.MarkerLayer;return t.forEach(function(t){e.addMarker(t)}),e}(a);return e.addMarkerLayer(T),OJ.setMarkerLayer(n,T),T}function NJ(t){var e=$Z($Z($Z($Z({},nK.line,"LineLayer"),nK.point,"PointLayer"),nK.polygon,"PolygonLayer"),nK.heatmap,"HeatmapLayer"),r=t.source||{},n=new $J({type:e[t.type],options:QZ(QZ({},t.options),{},{layerID:(t.options||{}).name,featureId:"mvt"===(r.parser||{}).type?"smpid":void 0})}),i=n.getL7Layer(),o={},a=t.shape||{};return r.parser&&(o.parser=t.source.parser),r.transforms&&(o.transforms=t.source.transforms),i.source(r.data,o),a.field?i.shape(a.field,a.values):i.shape(a.values),t.texture&&i.texture(t.texture.values),t.size&&(t.size.field?i.size(t.size.field,t.size.values):i.size(t.size.values)),t.color&&(t.color.field?i.color(t.color.field,t.color.values):i.color(t.color.values)),t.style&&i.style(t.style),t.animate&&i.animate(t.animate),t.filter&&i.filter(t.filter.field,t.filter.values),n}function RJ(t){return DJ.apply(this,arguments)}function DJ(){return(DJ=eK(GZ().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p,d;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.map,n=e.webMapInfo,i=e.l7Layers,o=e.spriteDatas,a=e.options,s=n.layers,u=n.sources,l=n.sprite,t.next=4,cJ({layers:i,sources:u,map:r,options:Object.assign({withoutFormatSuffix:!0},a)});case 4:return c=t.sent,t.next=7,hJ(r);case 7:if(f=t.sent,!(Object.keys(o).length>0)){t.next=18;break}return t.prev=9,t.next=12,TJ({layers:c.filter(function(t){return!!t.texture}),spriteJson:o,sprite:l,scene:f,options:a});case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(9),console.error(t.t0),a.emitterEvent("getlayersfailed",{error:t.t0,map:r});case 18:h=XZ(c),t.prev=19,d=GZ().mark(function t(){var e,n,i,o,a;return GZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=p.value,n=s.findIndex(function(t){return t.id===e.id}),i=s.slice(n+1).find(function(t){return!BJ(t)}),e.layerType===aK.MarkerLayer?(o=e,!1!==(e.options||{}).visible&&jJ(o,f),OJ.setSceneChartLayer(e.id,o)):(a=NJ(e),r.getLayer(a.id)||r.addLayer(a,i&&i.id));case 4:case"end":return t.stop()}},t)}),h.s();case 22:if((p=h.n()).done){t.next=26;break}return t.delegateYield(d(),"t1",24);case 24:t.next=22;break;case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(19),h.e(t.t2);case 31:return t.prev=31,h.f(),t.finish(31);case 34:case"end":return t.stop()}},t,null,[[9,14],[19,28,31,34]])}))).apply(this,arguments)}function BJ(t){var e=t.layout||{};return"circle"===t.type&&e["circle-animate-rings"]||"radar"===t.type||"point-extrusion"===t.type||"line-curve"===t.type||"line-curve-extrusion"===t.type||"line-extrusion"===t.type||"chart"===t.type||"heatmap"===t.type&&e["heatmap-shape"]||"heatmap-extrusion"===t.type||"symbol"===t.type&&e["text-z-offset"]>0}function FJ(t){"@babel/helpers - typeof";return(FJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zJ(t){return function(t){if(Array.isArray(t))return VJ(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||GJ(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UJ(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||GJ(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GJ(t,e){if(t){if("string"==typeof t)return VJ(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?VJ(t,e):void 0}}function VJ(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rl.length?e:l}if(!e.length){var c=[[0,0],[this.map.transform.width-1,this.map.transform.height-1]];this.queryRenderedFeatures(c,void 0,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e=t})}return e}},{key:"setSelectedDatas",value:function(t){this.selectedDatas=t instanceof Array?t:[t]}},{key:"_formatListenType",value:function(t){switch(t){case"mouseover":return"mouseenter";case"mouseleave":return"mouseout";default:return t}}},{key:"_formateEvent",value:function(t){return WJ(WJ({},t),{},{originalEvent:t.target,target:this.map,point:O().Point.convert([t.x,t.y])})}},{key:"_transformFilterValues",value:function(t){for(var e=t.fields,r=t.values,n=t.selectedDatas,i=arguments.length,o=new Array(i>1?i-1:0),a=1;at.length)&&(e=t.length);for(var r=0,n=new Array(e);r0}function IQ(t){var e=function(t){var e,r,n=t.paint,i=void 0===n?{}:n,o=t.layout,a=void 0===o?{}:o,s=Object.keys(i).concat(Object.keys(a)),u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=TQ(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(PQ);try{var l=function(){var t=r.value,n=s.some(function(e){return e.startsWith(t.prefix)});if(n)return e=t.type,1};for(u.s();!(r=u.n()).done&&!l(););}catch(t){u.e(t)}finally{u.f()}return e||AQ.symbol}(t);return OQ(OQ(OQ({},AQ.symbol,{type:"layout",name:"icon-image"}),AQ.line,{type:"paint",name:"line-pattern"}),AQ.fill,{type:"paint",name:"fill-pattern"})[e]}var LQ=["array","boolean","collator","format","literal","number","object","string","to-boolean","to-color","to-number","to-string","typeof","feature-state","geometry-type","id","line-progress","properties","at","get","has","length","!","!=","<","<=","==",">",">=","all","any","case","match","coalesce","interpolate","interpolate-hcl","interpolate-lab","step","let","var","concat","downcase","is-supported-script","resolved-locale","upcase","rgb","rgba","-","*","/","%","^","+","abs","acos","asin","atan","ceil","cos","e","floor","ln","ln2","log10","log2","max","min","pi","round","sin","sqrt","tan","zoom","heatmap-density"];function jQ(t){if(t&&t.length>0){var e=kQ(t,1)[0];return"string"==typeof e&&LQ.includes(e)}return!1}function NQ(t){return Object.keys(t).every(function(e){return!jQ(t[e])})}function RQ(t){return(MQ(t)?t:[t]).every(function(t){return NQ(t.paint||{})&&NQ(t.layout||{})})}var DQ=function(t){return["background-color","background-color-transition","background-pattern","background-pattern-transition","background-opacity","background-opacity-transition","fill-antialias","fill-opacity","fill-opacity-transition","fill-color","fill-color-transition","fill-outline-color","fill-outline-color-transition","fill-translate","fill-translate-transition","fill-translate-anchor","fill-pattern","fill-pattern-transition","fill-extrusion-opacity","fill-extrusion-opacity-transition","fill-extrusion-color","fill-extrusion-color-transition","fill-extrusion-translate","fill-extrusion-translate-transition","fill-extrusion-translate-anchor","fill-extrusion-pattern","fill-extrusion-pattern-transition","fill-extrusion-height","fill-extrusion-height-transition","fill-extrusion-base","fill-extrusion-base-transition","fill-extrusion-vertical-gradient","line-opacity","line-opacity-transition","line-color","line-color-transition","line-translate","line-translate-transition","line-translate-anchor","line-width","line-width-transition","line-gap-width","line-gap-width-transition","line-offset","line-offset-transition","line-blur","line-blur-transition","line-dasharray","line-dasharray-transition","line-pattern","line-pattern-transition","line-gradient","icon-opacity","icon-opacity-transition","icon-color","icon-color-transition","icon-halo-color","icon-halo-color-transition","icon-halo-width","icon-halo-width-transition","icon-halo-blur","icon-halo-blur-transition","icon-translate","icon-translate-transition","icon-translate-anchor","text-opacity","text-opacity-transition","text-color","text-color-transition","text-halo-color","text-halo-color-transition","text-halo-width","text-halo-width-transition","text-halo-blur","text-halo-blur-transition","text-translate","text-translate-transition","text-translate-anchor","raster-opacity","raster-opacity-transition","raster-hue-rotate","raster-hue-rotate-transition","raster-brightness-min","raster-brightness-min-transition","raster-brightness-max","raster-brightness-max-transition","raster-saturation","raster-saturation-transition","raster-contrast","raster-contrast-transition","raster-fade-duration","raster-resampling","circle-sort-key","circle-radius","circle-radius-transition","circle-color","circle-color-transition","circle-blur","circle-blur-transition","circle-opacity","circle-opacity-transition","circle-translate","circle-translate-transition","circle-translate-anchor","circle-pitch-scale","circle-pitch-alignment","circle-stroke-width","circle-stroke-width-transition","circle-stroke-color","circle-stroke-color-transition","circle-stroke-opacity","circle-stroke-opacity-transition","heatmap-radius","heatmap-radius-transition","heatmap-weight","heatmap-intensity","heatmap-intensity-transition","heatmap-color","heatmap-opacity","heatmap-opacity-transition","hillshade-illumination-direction","hillshade-illumination-anchor","hillshade-exaggeration","hillshade-exaggeration-transition","hillshade-shadow-color","hillshade-shadow-color-transition","hillshade-highlight-color","hillshade-highlight-color-transition","hillshade-accent-color","hillshade-accent-color-transition"].includes(t)};function BQ(t){"@babel/helpers - typeof";return(BQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FQ(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function zQ(t){for(var e=1;e0}},{key:"removeSymbol",value:function(t){this.symbolManager.removeSymbol(t)}},{key:"getSymbol",value:function(t){return this.symbolManager.getSymbol(t)}},{key:"getLayerIds",value:function(t){return this.compositeSymbolRender.getLayerIds(t)||[]}},{key:"getLayerId",value:function(t){return this.compositeSymbolRender.getLayerId(t)}},{key:"removeLayerId",value:function(t){return this.compositeSymbolRender.removeLayerId(t)}},{key:"getLayer",value:function(t){var e=this.map.getLayerBySymbolBak(t),r=this.getLayerSymbol(t);if(e)return r?zQ(zQ({},e),{},{symbol:r}):e;var n=this.getLayerIds(t);if(n[0]){var i=this.map.getLayerBySymbolBak(n[0]);return i&&zQ(zQ({},i),{},{symbol:r,id:t})}}},{key:"removeLayer",value:function(t){var e=this,r=this.getLayerIds(t);r.length>0?(r.forEach(function(t){return e.map.style.removeLayer(t)}),this.removeLayerId(t)):this.map.style.removeLayer(t)}},{key:"getStyle",value:function(){var t=this,e=this.map.style.serialize();return this.hasSymbol()&&(e.layers=e.layers.reduce(function(e,r){var n=t.getLayerId(r.id);return n?!e.find(function(t){return t.id===n})&&e.push(zQ(zQ({},r),{},{symbol:t.getLayerSymbol(n),id:n})):t.getLayerSymbol(r.id)?e.push(zQ(zQ({},r),{},{symbol:t.getLayerSymbol(r.id)})):e.push(r),e},[])),e}},{key:"getFirstLayerId",value:function(t){return this.getLayerIds(t)[0]}},{key:"moveLayer",value:function(t,e){var r=this,n=this.getLayerIds(t),i=e&&this.map.style.getLayer(e),o=i&&i.id||e&&this.getFirstLayerId(e);n.length>0?n.forEach(function(t){return r.map.style.moveLayer(t,o)}):this.map.style.moveLayer(t,o)}},{key:"setFilter",value:function(t,e,r){var n=this;if(jQ(this.getLayerSymbol(t))){var i=this.getFirstLayerId(t);this.map.style.setFilter(i,e,r);var o=this.getLayerSymbol(t);this.setSymbol(t,o)}else{var a=this.getLayerIds(t);a.length>0?a.forEach(function(t){return n.map.style.setFilter(t,e,r)}):this.map.style.setFilter(t,e,r)}}},{key:"getFilter",value:function(t){var e=this.getFirstLayerId(t);if(this.map.style.getLayer(e))return this.map.style.getFilter(e)}},{key:"setLayerZoomRange",value:function(t,e,r){var n=this,i=this.getLayerIds(t);i.length>0?i.forEach(function(t){return n.map.style.setLayerZoomRange(t,e,r)}):this.map.style.setLayerZoomRange(t,e,r)}},{key:"setPaintProperty",value:function(t,e,r,n){var i=this,o=this.getLayerIds(t);o.length>0?o.forEach(function(t){return i.map.style.setPaintProperty(t,e,r,n)}):this.map.style.setPaintProperty(t,e,r,n)}},{key:"getPaintProperty",value:function(t,e){var r=this.getFirstLayerId(t);return this.map.style.getPaintProperty(r,e)}},{key:"setLayoutProperty",value:function(t,e,r,n){var i=this,o=this.getLayerIds(t);o.length>0?o.forEach(function(t){return i.map.style.setLayoutProperty(t,e,r,n)}):this.map.style.setLayoutProperty(t,e,r,n)}},{key:"getLayoutProperty",value:function(t,e){var r=this.getFirstLayerId(t);return this.map.style.getLayoutProperty(r,e)}},{key:"updateLayerSymbol",value:function(t){var e=this;Object.keys(this._layerSymbols).forEach(function(r){var n=e._layerSymbols[r];n.includes(t)&&e.setSymbol(r,n)})}},{key:"updateSymbol",value:function(t,e){return this.getSymbol(t)?RQ(e)?(this.symbolManager.addSymbol(t,e),void this.updateLayerSymbol(t)):this.map.fire("error",{error:new Error("Symbol is not supported expressions.")}):this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}},{key:"setSymbolProperty",value:function(t,e,r,n){var i=this.getSymbol(t);if(!i)return this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))});if(jQ(n))return this.map.fire("error",{error:new Error("Symbol value is not supported expressions.")});var o=DQ(r)?"paint":"layout";if(i.length>0){var a=i[e];if(!a)return this.map.fire("error",{error:new Error("symbol[".concat(e,"] does not exist."))});a[o]||(a[o]={}),Object.assign(a[o],UQ({},r,n))}else i[o]||(i[o]={}),Object.assign(i[o],UQ({},r,n));this.symbolManager.addSymbol(t,i),this.updateLayerSymbol(t)}},{key:"getSymbolProperty",value:function(t,e,r){var n=this.getSymbol(t);if(n){var i=DQ(r)?"paint":"layout";return n.length>0?n[e]&&n[e][i]&&n[e][i][r]:n[i]&&n[i][r]}this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}}])&&GQ(e.prototype,r),n&&GQ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function WQ(t){"@babel/helpers - typeof";return(WQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qQ(){qQ=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==WQ(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function YQ(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function XQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){YQ(o,n,i,a,s,"next",t)}function s(t){YQ(o,n,i,a,s,"throw",t)}a(void 0)})}}var ZQ=function(){var t=function(t){return O().Map.prototype.symbolHandler||(O().Map.prototype.symbolHandler=new HQ(t)),O().Map.prototype.symbolHandler._update(t)};function e(){return(e=XQ(qQ().mark(function t(e,r){var n,i,o,a,s,u;return qQ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(r.basePath,"/").concat(e,"/").concat(e),t.next=4,ut.get("".concat(n,".json")).then(function(t){return t.ok?t.json():null}).catch(function(){return null});case 4:if(i=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:if(o=i.paint||{},a=i.layout||{},s=o["fill-pattern"]||o["line-pattern"]||a["icon-image"],t.t0=s,!t.t0){t.next=15;break}return t.next=14,new Promise(function(t){var e=new Image;e.src="".concat(n,".png"),e.onload=function(r){t(r?e:null)},e.onerror=function(){t(null)}});case 14:t.t0=t.sent;case 15:return u=t.t0,t.abrupt("return",{value:i,image:u});case 17:case"end":return t.stop()}},t)}))).apply(this,arguments)}function r(r,n){return function(t,r){return e.apply(this,arguments)}(r,n).then(function(e){if(!e)return null;var r=e.value,i=e.image;return i&&t(n).addSymbolImageToMap(r,i),r})}void 0===O().Map.prototype.addLayerBySymbolBak&&(O().Map.prototype.addLayerBySymbolBak=O().Map.prototype.addLayer,O().Map.prototype.addLayer=function(e,r){var n=t(this);if(!(n.getLayerIds(e.id).length>0))return e.symbol?(n.addLayer(e,r),this):(this.addLayerBySymbolBak(e,r),this);this.fire("error",{error:new Error("A layer with this id already exists.")})}),void 0===O().Map.prototype.getLayerBySymbolBak&&(O().Map.prototype.getLayerBySymbolBak=O().Map.prototype.getLayer,O().Map.prototype.getLayer=function(e){return t(this).getLayer(e)}),void 0===O().Map.prototype.moveLayerBySymbolBak&&(O().Map.prototype.moveLayerBySymbolBak=O().Map.prototype.moveLayer,O().Map.prototype.moveLayer=function(e,r){return!this.style.getLayer(e)||r&&!this.style.getLayer(r)?(t(this).moveLayer(e,r),this._update(!0)):this.moveLayerBySymbolBak(e,r)}),void 0===O().Map.prototype.removeLayerBySymbolBak&&(O().Map.prototype.removeLayerBySymbolBak=O().Map.prototype.removeLayer,O().Map.prototype.removeLayer=function(e){return this.style.getLayer(e)?this.removeLayerBySymbolBak(e):t(this).removeLayer(e)}),void 0===O().Map.prototype.setLayoutPropertyBySymbolBak&&(O().Map.prototype.setLayoutPropertyBySymbolBak=O().Map.prototype.setLayoutProperty,O().Map.prototype.setLayoutProperty=function(e,r,n,i){return this.overlayLayersManager[e]||this.style.getLayer(e)?this.setLayoutPropertyBySymbolBak(e,r,n,i):(t(this).setLayoutProperty(e,r,n,i),this._update(!0))}),O().Map.prototype.setSymbol=function(e,r){t(this).setSymbol(e,r)},O().Map.prototype.setStyleBak||(O().Map.prototype.setStyleBak=O().Map.prototype.setStyle,O().Map.prototype.setStyle=function(t,e){var r=this;return this.setStyleBak(t,e),this.style&&this.style.once("style.load",function(){t.layers.filter(function(t){return t.symbol}).forEach(function(t){r.setSymbol(t.id,t.symbol)})}),this}),O().Map.prototype.loadSymbol=(n=XQ(qQ().mark(function t(e,n){var i,o,a,s,u,l,c=this;return qQ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=9;break}return t.next=3,r(e,this);case 3:i=t.sent,o=null,i||(o="Symbol ".concat(e," is not exists")),n(o,i),t.next=21;break;case 9:if(!$.isArray(e)){t.next=20;break}return a=e.map(function(t){return r(t,c)}),t.next=13,Promise.all(a);case 13:s=t.sent,u=null,(l=e.filter(function(t,e){return!s[e]})).length>0&&(u="Symbol ".concat(l.join(",")," is not exists")),n(u,s),t.next=21;break;case 20:n({message:"Symbol id must be a string or string[]."});case 21:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)}),O().Map.prototype.addSymbol=function(e,r){t(this).addSymbol(e,r)},O().Map.prototype.getSymbol=function(e){return t(this).getSymbol(e)},O().Map.prototype.hasSymbol=function(t){return t?!!this.getSymbol(t):(this.fire("error",{error:new Error("Missing required symbol id")}),!1)},O().Map.prototype.removeSymbol=function(e){t(this).removeSymbol(e)},O().Map.prototype.updateSymbol=function(e,r){t(this).updateSymbol(e,r)},O().Map.prototype.setSymbolProperty=function(e,r,n,i){t(this).setSymbolProperty(e,r,n,i)},O().Map.prototype.getSymbolProperty=function(e,r,n){return t(this).getSymbolProperty(e,r,n)},O().Map.prototype.getStyle=function(){if(this.style)return t(this).getStyle()},O().Map.prototype.setFilter=function(e,r,n){return this.style.getLayer(e)?(this.style.setFilter(e,r,n),this._update(!0)):(t(this).setFilter(e,r,n),this._update(!0))},O().Map.prototype.getFilter=function(e){return this.style.getLayer(e)?this.style.getFilter(e):t(this).getFilter(e)},O().Map.prototype.setLayerZoomRange=function(e,r,n){return this.style.getLayer(e)?(this.style.setLayerZoomRange(e,r,n),this._update(!0)):(t(this).setLayerZoomRange(e,r,n),this._update(!0))},O().Map.prototype.setPaintProperty=function(e,r,n,i){return this.style.getLayer(e)?(this.style.setPaintProperty(e,r,n,i),this._update(!0)):(t(this).setPaintProperty(e,r,n,i),this._update(!0))},O().Map.prototype.getPaintProperty=function(e,r){return this.style.getLayer(e)?this.style.getPaintProperty(e,r):t(this).getPaintProperty(e,r)},O().Map.prototype.getLayoutProperty=function(e,r){return this.style.getLayer(e)?this.style.getLayoutProperty(e,r):t(this).getLayoutProperty(e,r)},void 0===O().Map.prototype.onBak&&(O().Map.prototype.onBak=O().Map.prototype.on,O().Map.prototype.on=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.onBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.onBak(e,t,n)}),this)}),void 0===O().Map.prototype.onceBak&&(O().Map.prototype.onceBak=O().Map.prototype.once,O().Map.prototype.once=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.onceBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.onceBak(e,t,n)}),this)}),void 0===O().Map.prototype.offBak&&(O().Map.prototype.offBak=O().Map.prototype.off,O().Map.prototype.off=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.offBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.offBak(e,t,n)}),this)});var n};function KQ(t){"@babel/helpers - typeof";return(KQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function JQ(t,e){for(var r=0;r=0){var e=JSON.parse(t.data);return t.filterParam=e,t.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",t)}var r=JSON.parse(t.data);t.featureResult=r,t.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",t)}},{key:"_connect",value:function(t){return t=Lx.appendCredential(t),"WebSocket"in window?new WebSocket(t):"MozWebSocket"in window?new(0,window.MozWebSocket)(t):(console.log("no WebSocket"),null)}}])&&b0(r.prototype,n),i&&b0(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function T0(t){"@babel/helpers - typeof";return(T0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C0(t,e){for(var r=0;r=0&&n.toIndex>=0&&!i&&(n.url=$.urlAppend(n.url,"fromIndex=".concat(n.fromIndex,"&toIndex=").concat(n.toIndex))),n.returnContent&&(t.returnCountOnly||t.returnDatasetInfoOnly||t.returnFeaturesOnly||console.warn("recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method"),t.returnCountOnly&&(n.url=$.urlAppend(n.url,"returnCountOnly="+t.returnCountOnly)),t.returnDatasetInfoOnly&&(n.url=$.urlAppend(n.url,"returnDatasetInfoOnly="+t.returnDatasetInfoOnly)),t.returnFeaturesOnly&&(n.url=$.urlAppend(n.url,"returnFeaturesOnly="+t.returnFeaturesOnly))),r=n.getJsonParameters(t),n.request({method:"POST",data:r,scope:n,success:e,failure:e})}}},{key:"transformResult",value:function(t,e){t=$.transformResult(t);var r=new di;(this.format===dn.GEOJSON&&t.features&&(t.features=r.toGeoJSON(t.features)),this.returnFeaturesOnly&&Array.isArray(t))&&(t={succeed:t.succeed,features:r.toGeoJSON(t)});return{result:t,options:e}}},{key:"dataFormat",value:function(){return[dn.GEOJSON,dn.ISERVER,dn.FGB]}}])&&F1(r.prototype,n),i&&F1(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Y1(t){"@babel/helpers - typeof";return(Y1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function X1(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}}}])&&r2(r.prototype,n),i&&r2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function c2(t){"@babel/helpers - typeof";return(c2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f2(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null}}])&&R2(r.prototype,n),i&&R2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function H2(t){"@babel/helpers - typeof";return(H2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W2(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.geometry&&(t.geometry.destroy(),t.geometry=null)}}])&&$2(r.prototype,n),i&&$2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function s3(t){"@babel/helpers - typeof";return(s3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u3(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null}}])&&v3(r.prototype,n),i&&v3(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function E3(t){"@babel/helpers - typeof";return(E3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k3(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultStyle&&(t.defaultStyle.destroy(),t.defaultStyle=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=$.copyAttributes(t,this)).defaultStyle&&t.defaultStyle.toServerJSONObject&&(t.defaultStyle=t.defaultStyle.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.rangeExpression=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&I8(r.prototype,n),i&&I8(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function z8(t){"@babel/helpers - typeof";return(z8="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U8(t,e){for(var r=0;r0?t[0].subLayers.layers:null)?r.length:0,this.handleLayers(n,r),{result:t[0],options:e}}},{key:"handleLayers",value:function(t,e){var r;if(t)for(var n=0;n0)this.handleLayers(e[n].subLayers.layers.length,e[n].subLayers.layers);else switch(e[n].ugcLayerType){case"THEME":(r=new w7).fromJson(e[n]),e[n]=r;break;case"GRID":(r=new L7).fromJson(e[n]),e[n]=r;break;case"IMAGE":(r=new U7).fromJson(e[n]),e[n]=r;break;case"VECTOR":(r=new Z7).fromJson(e[n]),e[n]=r}}}}])&&J7(r.prototype,n),i&&J7(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function o9(t){"@babel/helpers - typeof";return(o9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a9(t,e){for(var r=0;r0&&(n+='"subLayers":'+t.toJSON()),n+=',"visible":true,',n+='"name":"'+this.getMapName(this.mapUrl)+'"',n+="}]",r.request({method:"PUT",data:n,scope:r,success:e,failure:e})}}},{key:"createTempLayerComplete",value:function(t,e){return e=e.result?e.result:e,(e=$.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams,t)}},{key:"getMapName",value:function(t){var e=t;"/"===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1));var r=e.lastIndexOf("/");return e.substring(r+1,e.length)}},{key:"transformResult",value:function(t,e){return null!=(t=$.transformResult(t))&&null!=this.lastparams&&null!=this.lastparams.resourceID&&(t.newResourceID=this.lastparams.resourceID),{result:t,options:e}}}])&&D9(r.prototype,n),i&&D9(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function W9(t){"@babel/helpers - typeof";return(W9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q9(t,e){for(var r=0;r=200&&t.code<300||0==t.code||304===t.code,n=t.code&&r;return!t.code||n?{result:t,options:e}:{error:t,options:e}}}])&&ntt(r.prototype,n),i&&ntt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function ftt(t){"@babel/helpers - typeof";return(ftt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function htt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}}])&&Cet(r.prototype,n),i&&Cet(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function jet(t){"@babel/helpers - typeof";return(jet="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Net(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.facilityPathList)return t;var e=new di;return t.facilityPathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&wrt(r.prototype,n),i&&wrt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Ort(t){"@babel/helpers - typeof";return(Ort="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Art(t,e){for(var r=0;r0&&(e+=","),e+=$.toJSON(t[n]);return e+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t)return null;var e=new di;return t.demandResults&&(t.demandResults=e.toGeoJSON(t.demandResults)),t.supplyResults&&(t.supplyResults=e.toGeoJSON(t.supplyResults)),t}}])&&Lrt(r.prototype,n),i&&Lrt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function zrt(t){"@babel/helpers - typeof";return(zrt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Urt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList)return null;var e=new di;return t.pathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&Wrt(r.prototype,n),i&&Wrt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Qrt(t){"@babel/helpers - typeof";return(Qrt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $rt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList||t.pathList.length<1)return null;var e=new di;return t.pathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&nnt(r.prototype,n),i&&nnt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function cnt(t){"@babel/helpers - typeof";return(cnt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fnt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.serviceAreaList)return t;var e=new di;return t.serviceAreaList.map(function(t){return t.serviceRegion&&(t.serviceRegion=e.toGeoJSON(t.serviceRegion)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t.routes&&(t.routes=e.toGeoJSON(t.routes)),t}),t}}])&&ynt(r.prototype,n),i&&ynt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function _nt(t){"@babel/helpers - typeof";return(_nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Snt(t,e){for(var r=0;r0&&(e+=","),e+='{"x":'+i[r].x+',"y":'+i[r].y+"}";o+=e+="]"}else if(!0===t.isAnalyzeById){for(var a="[",s=t.nodes,u=s.length,l=0;l0&&(a+=","),a+=s[l];o+=a+="]"}return o}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.tspPathList)return null;var e=new di;return t.tspPathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&Cnt(r.prototype,n),i&&Cnt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function jnt(t){"@babel/helpers - typeof";return(jnt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nnt(t,e){for(var r=0;r0)for(var e in t.items)t.items[e].destroy(),t.items[e]=null;t.items=null}t.numericPrecision=null,t.rangeMode=null,t.rangeCount=null,t.colorGradientType=null}}])&&bat(e.prototype,r),n&&bat(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _at(t){"@babel/helpers - typeof";return(_at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sat(t,e){for(var r=0;r=0;t--)this.points[t].destroy();this.points=null}}}])&&rvt(r.prototype,n),i&&rvt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function cvt(t){"@babel/helpers - typeof";return(cvt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fvt(t,e){for(var r=0;r0&&(1===i.length?r+="'displayFilter':\""+i[0]+'",':r+="'displayFilter':\""+i[a]+'",'),(o=t.displayOrderBy)&&o.length>0&&(1===o.length?r+="'displayOrderBy':'"+o[0]+"',":r+="'displayOrderBy':'"+o[a]+"',"),(e=t.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+$.toJSON(e)+","),t.joinItems&&t.joinItems.length>0&&t.joinItems[a]&&(r+="'joinItems':["+$.toJSON(t.joinItems[a])+"],"),t.datasetNames&&t.dataSourceNames){var u=t.datasetNames[a]?a:t.datasetNames.length-1,l=t.dataSourceNames[a]?a:t.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+t.datasetNames[u]+"','dataSourceName': '"+t.dataSourceNames[l]+"'}},"}else r+="},"}t.themes&&t.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var c=this.url.split("/");return r+="'name': '"+c[c.length-2]+"'}]"}}])&&Pgt(r.prototype,n),i&&Pgt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Bgt(t){"@babel/helpers - typeof";return(Bgt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fgt(t,e){for(var r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Umt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Gmt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){Umt(o,n,i,a,s,"next",t)}function s(t){Umt(o,n,i,a,s,"throw",t)}a(void 0)})}}function Vmt(t,e){for(var r=0;r0&&i.push(","),r=e[o].geometry,i.push(this.extractGeometry(r));return n&&i.push(")"),i.join("")}},{key:"extractGeometry",value:function(t){var e=t.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[e]?("collection"===e?"GEOMETRYCOLLECTION":e.toUpperCase())+"("+this.extract[e].apply(this,[t])+")":null}}])&&zbt(r.prototype,n),i&&zbt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function qbt(t){"@babel/helpers - typeof";return(qbt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ybt(t,e){for(var r=0;r=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=r.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],r.events=new xa(this,null,this.EVENT_TYPES),r.speed=Number(r.speed),r.frequency=Number(r.frequency),r.startTime=Number(r.startTime),r.endTime=Number(r.endTime),r.startTime=Date.parse(new Date(r.startTime)),r.endTime=Date.parse(new Date(r.endTime)),r.currentTime=r.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"}var e,r,n;return e=t,(r=[{key:"updateOptions",value:function(t){var e=this;(t=t||{}).speed&&t.speed>=0&&(e.speed=t.speed,e.speed=Number(e.speed)),t.speed&&t.frequency>=0&&(e.frequency=t.frequency,e.frequency=Number(e.frequency)),t.startTime&&null!=t.startTime&&(e.startTime=t.startTime,e.startTime=Date.parse(new Date(e.startTime))),t.endTime&&null!=t.endTime&&t.endTime>=e.startTime&&(e.endTime=t.endTime,e.endTime=Date.parse(new Date(e.endTime))),null!=t.repeat&&(e.repeat=t.repeat),null!=t.reverse&&(e.reverse=t.reverse)}},{key:"start",value:function(){var t=this;t.running||(t.running=!0,t.tick(),t.events.triggerEvent("start",t.currentTime))}},{key:"pause",value:function(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}},{key:"stop",value:function(){var t=this;t.currentTime=t.startTime,t.running&&(t.running=!1),t.events.triggerEvent("stop",t.currentTime)}},{key:"toggle",value:function(){this.running?this.pause():this.start()}},{key:"setSpeed",value:function(t){return t>=0&&(this.speed=t,!0)}},{key:"getSpeed",value:function(){return this.speed}},{key:"setFrequency",value:function(t){return t>=0&&(this.frequency=t,!0)}},{key:"getFrequency",value:function(){return this.frequency}},{key:"setStartTime",value:function(t){var e=this;return!((t=Date.parse(new Date(t)))>e.endTime)&&(e.startTime=t,e.currentTime=e.endTime&&(e.currentTime=e.startTime,e.tick()),!0)}},{key:"getEndTime",value:function(){return this.endTime}},{key:"setCurrentTime",value:function(t){var e=this;return e.currentTime=Date.parse(new Date(e.currentTime)),t>=e.startTime&&t<=e.endTime&&(e.currentTime=t,e.startTime=e.currentTime,e.tick(),!0)}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"setRepeat",value:function(t){this.repeat=t}},{key:"getRepeat",value:function(){return this.repeat}},{key:"setReverse",value:function(t){this.reverse=t}},{key:"getReverse",value:function(){return this.reverse}},{key:"getRunning",value:function(){return this.running}},{key:"destroy",value:function(){var t=this;t.speed=null,t.frequency=null,t.startTime=null,t.endTime=null,t.currentTime=null,t.repeat=null,t.running=!1,t.reverse=null}},{key:"tick",value:function(){}}])&&Ybt(e.prototype,r),n&&Ybt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Kbt(t){"@babel/helpers - typeof";return(Kbt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jbt(t,e){for(var r=0;r=t.endTime&&(t.currentTime=t.endTime)}}}])&&Jbt(r.prototype,n),i&&Jbt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function oxt(t){"@babel/helpers - typeof";return(oxt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function axt(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials};return e=Lx.appendCredential(e),ut.commit(t,e,r,n).then(function(t){return t.json()})}}])&&wxt(e.prototype,r),n&&wxt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ext(t){"@babel/helpers - typeof";return(Ext="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kxt(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.reverseColor=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&NSt(r.prototype,n),i&&NSt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function VSt(t){"@babel/helpers - typeof";return(VSt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function HSt(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultcolor&&(t.defaultcolor.destroy(),t.defaultcolor=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=$.copyAttributes(t,this)).defaultcolor&&t.defaultcolor.toServerJSONObject&&(t.defaultcolor=t.defaultcolor.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0&&(t=t.substring(0,t.length-1)),"{"+t+"}"}return null}}])&&sEt(e.prototype,r),n&&sEt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function cEt(t){"@babel/helpers - typeof";return(cEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fEt(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{};return e=Lx.appendCredential(e),n.crossOrigin=this.options.crossOrigin,n.headers=this.options.headers,ut.commit(t,e,r,n).then(function(t){return t.json()})}}])&&pTt(e.prototype,r),n&&pTt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vTt(t){"@babel/helpers - typeof";return(vTt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gTt(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);re.geoFence.radius&&(e.outOfGeoFence&&e.outOfGeoFence(t),e.events.triggerEvent("outOfGeoFence",{data:t})),r})}},{key:"_distance",value:function(t,e,r,n){return Math.sqrt((t-r)*(t-r)+(e-n)*(e-n))}},{key:"_getMeterPerMapUnit",value:function(t){var e;return"meter"===t?e=1:"degree"===t&&(e=2*Math.PI*6378137/360),e}}])&&YTt(e.prototype,r),n&&YTt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function KTt(t){"@babel/helpers - typeof";return(KTt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function JTt(t,e){for(var r=0;r=e)if("RANGE"===r)for(i=0;i=0&&this.getSqrtInterval(t,r):"logarithm"===e?this.getMin(t)>0&&this.getGeometricProgression(t,r):void 0}},{key:"getSum",value:function(t){return this.getInstance(t).sum()}},{key:"getMax",value:function(t){return this.getInstance(t).max()}},{key:"getMin",value:function(t){return this.getInstance(t).min()}},{key:"getMean",value:function(t){return this.getInstance(t).mean()}},{key:"getMedian",value:function(t){return this.getInstance(t).median()}},{key:"getTimes",value:function(t){return t.length}},{key:"getEqInterval",value:function(t,e){return this.getInstance(t).getClassEqInterval(e)}},{key:"getJenks",value:function(t,e){return this.getInstance(t).getClassJenks(e)}},{key:"getSqrtInterval",value:function(t,e){return t=t.map(function(t){return Math.sqrt(t)}),this.getInstance(t).getClassEqInterval(e).map(function(t){return t*t})}},{key:"getGeometricProgression",value:function(t,e){return this.getInstance(t).getClassGeometricProgression(e)}}],(r=null)&&rCt(e.prototype,r),n&&rCt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function oCt(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t.flat()),n=window.Module._malloc(2*e*8);window.Module.HEAPF64.set(r,n/8);var i=window.Module._UGCWasm_Geometry_CreatePoint2DsFromBuffer(n,e);return window.Module._free(n),i}function aCt(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t),n=window.Module._malloc(8*e);window.Module.HEAPF64.set(r,n/8);var i=window.Module._UGCWasm_Helper_CreateDoubleArray(n,e);return window.Module._free(n),i}function sCt(t){var e=window.Module._UGCWasm_Helper_GetDoubleArrayLength(t),r=window.Module._malloc(8*e);window.Module._UGCWasm_Helper_GetBufferFromDoubleArray(t,r);for(var n=new Float64Array(window.Module.HEAPF64.buffer,r,e),i=[],o=0;o1)for(var o=1;o1)for(var l=1;l2&&void 0!==arguments[2]?arguments[2]:1e-6,n=lCt(t),i=lCt(e);return 1===this.module._UGCWasm_Geometrist_IsIdentical(n,i,r)}},{key:"hasIntersection",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=lCt(t),i=lCt(e);return 1===this.module._UGCWasm_Geometrist_HasIntersection(n,i,r)}},{key:"hasTouch",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=lCt(t),i=lCt(e);return 1===this.module._UGCWasm_Geometrist_HasTouch(n,i,r)}},{key:"resample",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6,r=lCt(t);return{type:"Feature",geometry:uCt(this.module._UGCWasm_Geometrist_Resample(r,e))}}},{key:"isParallel",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsParallel(t,e,r,n,i,o,a,s)}},{key:"computePerpendicularPosition",value:function(t,e,r,n,i,o){var a=this.module._UGCWasm_Helper_CreateDoubleArray(0,2);return this.module._UGCWasm_Geometrist_ComputePerpendicularPosition(t,e,r,n,i,o,a),a=sCt(a)}},{key:"isPointOnLine",value:function(t,e,r,n,i,o,a){return 1===this.module._UGCWasm_Geometrist_IsPointOnLine(t,e,r,n,i,o,a)}},{key:"isProjectOnLineSegment",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsProjectOnLineSegment(t,e,r,n,i,o)}},{key:"distanceToLineSegment",value:function(t,e,r,n,i,o){return this.module._UGCWasm_Geometrist_DistanceToLineSegment(t,e,r,n,i,o)}},{key:"nearestPointToVertex",value:function(t,e,r){var n=this.module._UGCWasm_Helper_CreateDoubleArray(0,2),i=lCt(r);return this.module._UGCWasm_Geometrist_NearestPointToVertex(t,e,i,n),n=sCt(n)}},{key:"computeConcaveHullPoints",value:function(t,e,r){var n=aCt(t),i=aCt(e);return{type:"Feature",geometry:uCt(this.module._UGCWasm_Geometrist_ComputeConcaveHullPoints(n,i,t.length,r))}}},{key:"isSegmentIntersect",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsSegmentIntersect(t,e,r,n,i,o,a,s)}},{key:"isIntersectRegionWithRect",value:function(t,e,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e-6,a=lCt(t);return 0!==this.module._UGCWasm_Geometrist_isIntersectRegionWithRect(a,e,r,n,i,o)}},{key:"isOnSameSide",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsOnSameSide(t,e,r,n,i,o,a,s)}},{key:"isRight",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsRight(t,e,r,n,i,o)}},{key:"isLeft",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsLeft(t,e,r,n,i,o)}},{key:"computeGeodesicArea",value:function(t){var e=lCt(t),r=this.module._UGCWasm_Geometry_NewUGPrjCoordSys(4326);return this.module._UGCWasm_Geometrist_ComputeGeodesicArea(e,r)}},{key:"smooth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=lCt(t);return{type:"Feature",geometry:uCt(this.module._UGCWasm_Geometrist_Smooth(r,e))}}},{key:"computeGeodesicDistance",value:function(t,e,r,n){var i=aCt(t),o=aCt(e);return this.module._UGCWasm_Geometrist_ComputeGeodesicDistance(i,o,r,n)}},{key:"computeParallel",value:function(t,e){var r=lCt(t);return{type:"Feature",geometry:uCt(this.module._UGCWasm_Geometrist_ComputeParallel(r,e))}}},{key:"computeConvexHullPoints",value:function(t,e){var r=aCt(t),n=aCt(e);return{type:"Feature",geometry:uCt(this.module._UGCWasm_Geometrist_ComputeConvexHullPoints(r,n,t.length))}}}])&&hCt(r.prototype,n),i&&hCt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();var mCt=r(7820),bCt=r.n(mCt);function xCt(t){"@babel/helpers - typeof";return(xCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wCt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _Ct(t,e){for(var r=0;rl&&(u[i]=u[i].slice(n-l),l=n)}function y(t){var e,o,a,s;if(t instanceof Function)return t.call(c.parsers);if("string"==typeof t)e=r.charAt(n)===t?t:null,o=1,d();else{if(d(),!(e=t.exec(u[i])))return null;o=e[0].length}if(e){var f=n+=o;for(s=n+u[i].length-o;n=0&&"\n"!==n.charAt(a);a--)t.column++;return new Error([t.filename,t.line,t.column,t.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},c={parse:function(o){var a,c=null;if(n=i=l=s=0,u=[],r=o.replace(/\r\n/g,"\n"),e.filename&&(f.env.inputs[e.filename]=r),u=function(t){for(var e,n,i,o,a=0,s=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,u=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,l=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,f=0,h=t[0],p=0;p0?"missing closing `}`":"missing opening `{`"}),t.map(function(t){return t.join("")})}([[]]),c)throw v(c);var h=function(t,e){var r=t.specificity,n=e.specificity;return r[0]!=n[0]?n[0]-r[0]:r[1]!=n[1]?n[1]-r[1]:r[2]!=n[2]?n[2]-r[2]:n[3]-r[3]};return(a=new t.Tree.Ruleset([],y(this.parsers.primary))).root=!0,a.toList=function(t){t.error=function(e){t.errors||(t.errors=new Error("")),t.errors.message?t.errors.message+="\n"+v(e).message:t.errors.message=v(e).message},t.frames=t.frames||[];var e=this.flatten([],[],t);return e.sort(h),e},a},parsers:{primary:function(){for(var t,e=[];(t=y(this.rule)||y(this.ruleset)||y(this.comment))||y(/^[\s\n]+/)||(t=y(this.invalid));)t&&e.push(t);return e},invalid:function(){var e=y(/^[^;\n]*[;\n]/);if(e)return new t.Tree.Invalid(e,a)},comment:function(){var e;if("/"===r.charAt(n))return"/"===r.charAt(n+1)?new t.Tree.Comment(y(/^\/\/.*/),!0):(e=y(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new t.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===r.charAt(n)||"'"===r.charAt(n)){var e=y(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new t.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(y("[")){var e=y(/(^[^\]]+)/);if(y("]"))return e?new t.Tree.Field(e[1]):void 0}},comparison:function(){var t=y(/^=~|=|!=|<=|>=|<|>/);if(t)return t},keyword:function(){var e=y(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new t.Tree.Keyword(e)},call:function(){var e,r;if(e=/^([\w\-]+|%)\(/.exec(u[i])){if("url"===(e=e[1]))return null;n+=e.length;if(y("("),r=y(this.entities.arguments),y(")"))return e?new t.Tree.Call(e,r,n):void 0}},arguments:function(){for(var t,e=[];t=y(this.expression);){e.push(t);if(!y(","))break}return e},literal:function(){return y(this.entities.dimension)||y(this.entities.keywordcolor)||y(this.entities.hexcolor)||y(this.entities.quoted)},url:function(){var e;if("u"===r.charAt(n)&&y(/^url\(/)){e=y(this.entities.quoted)||y(this.entities.variable)||y(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return y(")")?new t.Tree.URL(void 0!==e.value||e instanceof t.Tree.Variable?e:new t.Tree.Quoted(e)):new t.Tree.Invalid(e,a,"Missing closing ) in URL.")}},variable:function(){var i,o=n;if("@"===r.charAt(n)&&(i=y(/^@[\w-]+/)))return new t.Tree.Variable(i,o,e.filename)},hexcolor:function(){var e;if("#"===r.charAt(n)&&(e=y(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new t.Tree.Color(e[1])},keywordcolor:function(){var e=u[i].match(/^[a-z]+/);if(e&&e[0]in t.Tree.Reference.data.colors)return new t.Tree.Color(t.Tree.Reference.data.colors[y(/^[a-z]+/)])},dimension:function(){var e=r.charCodeAt(n);if(!(e>57||e<45||47===e)){var i=y(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return i?new t.Tree.Dimension(i[1],i[2],a):void 0}}},variable:function(){var t;if("@"===r.charAt(n)&&(t=y(/^(@[\w-]+)\s*:/)))return t[1]},entity:function(){var t=y(this.entities.call)||y(this.entities.literal),e=y(this.entities.field)||y(this.entities.variable),r=y(this.entities.url)||y(this.entities.keyword);return t||e||r},end:function(){var t;return y(";")||("string"==typeof(t="}")?r.charAt(n)===t:!!t.test(u[i]))},element:function(){var e=y(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new t.Tree.Element(e)},attachment:function(){var t=y(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(t)return t[1]},selector:function(){for(var e,i,o,s,u,l=[],c=new t.Tree.Filterset,f=[],h=0,p=0;(o=y(this.element))||(u=y(this.zoom))||(s=y(this.filter))||(e=y(this.attachment));){if(h++,o)l.push(o);else if(u)f.push(u),p++;else if(s){var d=c.add(s);if(d)throw v({message:d,index:n-1});p++}else{if(i)throw v({message:"Encountered second attachment name.",index:n-1});i=e}var g=r.charAt(n);if("{"===g||"}"===g||";"===g||","===g)break}if(h)return new t.Tree.Selector(c,f,l,i,p,a)},filter:function(){h();var r,n,i;if(y("[")&&(r=y(/^[a-zA-Z0-9\-_]+/)||y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.keyword)||y(this.entities.field))&&(r instanceof t.Tree.Quoted&&(r=new t.Tree.Field(r.toString())),(n=y(this.entities.comparison))&&(i=y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.dimension)||y(this.entities.keyword)||y(this.entities.field)))){if(!y("]"))throw v({message:"Missing closing ] of filter.",index:a-1});return r.is||(r=new t.Tree.Field(r)),new t.Tree.Filter(r,n,i,a,e.filename)}},zoom:function(){h();var e,r;if(y(/^\[\s*zoom/g)&&(e=y(this.entities.comparison))&&(r=y(this.entities.variable)||y(this.entities.dimension))&&y("]"))return new t.Tree.Zoom(e,r,a);p()},block:function(){var t;if(y("{")&&(t=y(this.primary))&&y("}"))return t},ruleset:function(){var e,r,n=[];for(h();e=y(this.selector);){for(n.push(e);y(this.comment););if(!y(","))break;for(;y(this.comment););}if(e)for(;y(this.comment););if(n.length>0&&(r=y(this.block))){if(1===n.length&&n[0].elements.length&&"Map"===n[0].elements[0].value){var i=new t.Tree.Ruleset(n,r);return i.isMap=!0,i}return new t.Tree.Ruleset(n,r)}p()},rule:function(){var i,o,u=r.charAt(n);if(h(),"."!==u&&"#"!==u&&(i=y(this.variable)||y(this.property))){if((o=y(this.value))&&y(this.end))return new t.Tree.Rule(i,o,a,e.filename);s=n,p()}},font:function(){for(var e,r=[],n=[];e=y(this.entity);)n.push(e);if(r.push(new t.Tree.Expression(n)),y(","))for(;(e=y(this.expression))&&(r.push(e),y(",")););return new t.Tree.Value(r)},value:function(){for(var e,r=[];(e=y(this.expression))&&(r.push(e),y(",")););return r.length>1?new t.Tree.Value(r.map(function(t){return t.value[0]})):1===r.length?new t.Tree.Value(r):void 0},sub:function(){var t;if(y("(")&&(t=y(this.expression))&&y(")"))return t},multiplication:function(){var e,r,n,i;if(e=y(this.operand)){for(;(n=y("/")||y("*")||y("%"))&&(r=y(this.operand));)i=new t.Tree.Operation(n,[i||e,r],a);return i||e}},addition:function(){var e,i,o,s;if(e=y(this.multiplication)){for(;(o=y(/^[-+]\s+/)||" "!=r.charAt(n-1)&&(y("+")||y("-")))&&(i=y(this.multiplication));)s=new t.Tree.Operation(o,[s||e,i],a);return s||e}},operand:function(){return y(this.sub)||y(this.entity)},expression:function(){for(var e,r=[];e=y(this.addition)||y(this.entity);)r.push(e);if(r.length>0)return new t.Tree.Expression(r)},property:function(){var t=y(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(t)return t[1]}}}}},{key:"parse",value:function(t){var e=this.parser;return this.ruleSet=e.parse(t)}},{key:"toShaders",value:function(){if(this.ruleSet){var t=this.ruleSet;if(t){var e=t.toList(this.env);e.reverse();var r={},n=[];this._toShaders(r,n,e);for(var i=[],o={},a=0,s=e.length;a=0){if(!e.featureFilter){var o=i+n.length,a=r.indexOf(")",o+1),s="featureId&&(featureId"+r.substring(o,a)+")";Object.defineProperty(e,"featureFilter",{configurable:!0,enumerable:!1,value:function(t){return!!s}})}return{property:p,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(c[p],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:l}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),i.push(f),o[n[a]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return i}}return null}},{key:"_toShaders",value:function(e,r,n){for(var i=0,o=n.length;i= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};function CCt(t){"@babel/helpers - typeof";return(CCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function OCt(t,e){for(var r=0;r1&&(e=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:t,color:e,mode:r,toString:function(n){return'\n\t"}}},hsl:function(t,e,r){return this.hsla(t,e,r,1)},hsla:function(t,e,r,n){if([t=this.number(t)%360/360,e=this.number(e),r=this.number(r),n=this.number(n)].some(isNaN))return null;var i=r<=.5?r*(e+1):r+e-r*e,o=2*r-i;return this.rgba(255*a(t+1/3),255*a(t),255*a(t-1/3),n);function a(t){return 6*(t=t<0?t+1:t>1?t-1:t)<1?o+(i-o)*t*6:2*t<1?i:3*t<2?o+(i-o)*(2/3-t)*6:o}},hue:function(t){return"toHSL"in t?new kCt.Tree.Dimension(Math.round(t.toHSL().h)):null},saturation:function(t){return"toHSL"in t?new kCt.Tree.Dimension(Math.round(100*t.toHSL().s),"%"):null},lightness:function(t){return"toHSL"in t?new kCt.Tree.Dimension(Math.round(100*t.toHSL().l),"%"):null},alpha:function(t){return"toHSL"in t?new kCt.Tree.Dimension(t.toHSL().a):null},saturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s+=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s-=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l+=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l-=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a+=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a-=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL(),n=(r.h+e.value)%360;return r.h=n<0?360+n:n,this.hsla_simple(r)},replace:function(t,e,r){return"field"===t.is?t.toString+".replace("+e.toString()+", "+r.toString()+")":t.replace(e,r)},mix:function(t,e,r){var n=r.value/100,i=2*n-1,o=t.toHSL().a-e.toHSL().a,a=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,s=1-a,u=[t.rgb[0]*a+e.rgb[0]*s,t.rgb[1]*a+e.rgb[1]*s,t.rgb[2]*a+e.rgb[2]*s],l=t.alpha*n+e.alpha*(1-n);return new kCt.Tree.Color(u,l)},greyscale:function(t){return this.desaturate(t,new kCt.Tree.Dimension(100))},"%":function(t){for(var e=Array.prototype.slice.call(arguments,1),r=t.value,n=0;n.5?l/(2-a-s):l/(a+s),a){case r:t=(n-i)/l+(n=0){if(!t.ppi)return t.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*t.ppi,this.unit="px"}return this}},{key:"toColor",value:function(){return new kCt.Tree.Color([this.value,this.value,this.value])}},{key:"round",value:function(){return this.value=Math.round(this.value),this}},{key:"toString",value:function(){return this.value.toString()}},{key:"operate",value:function(t,e,r){return"%"===this.unit&&"%"!==r.unit?(t.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===e||"/"===e||"%"===e?(t.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new kCt.Tree.Dimension(kCt.Tree.operate(e,this.value,this.value*r.value*.01),this.unit):new kCt.Tree.Dimension(kCt.Tree.operate(e,this.value,r.value),this.unit||r.unit)}}]),t}(),kCt.Tree.Element=function(){function t(e){wCt(this,t),this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")}return SCt(t,[{key:"specificity",value:function(){return["id"===this.type?1:0,"class"===this.type?1:0]}},{key:"toString",value:function(){return this.value}}]),t}(),kCt.Tree.Expression=function(){function t(e){wCt(this,t),this.is="expression",this.value=e}return SCt(t,[{key:"ev",value:function(t){return this.value.length>1?new kCt.Tree.Expression(this.value.map(function(e){return e.ev(t)})):this.value[0].ev(t)}},{key:"toString",value:function(t){return this.value.map(function(e){return e.toString(t)}).join(" ")}}]),t}(),kCt.Tree.Field=function(){function t(e){wCt(this,t),this.is="field",this.value=e||""}return SCt(t,[{key:"toString",value:function(){return'["'+this.value.toUpperCase()+'"]'}},{key:"ev",value:function(){return this}}]),t}(),kCt.Tree.Filter=function(){function t(e,r,n,i,o){wCt(this,t),this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=r,this.val=n,this.index=i,this.filename=o,this.id=this.key+this.op+this.val}return SCt(t,[{key:"ev",value:function(t){return this.key=this.key.ev(t),this.val=this.val.ev(t),this}},{key:"toString",value:function(){return"["+this.id+"]"}}]),t}(),kCt.Tree.Filterset=function(){function t(){wCt(this,t),this.filters={}}return SCt(t,[{key:"toJS",value:function(t){function e(t){var e=t.op;"="===e&&(e="==");var r=t.val;void 0!==t._val&&(r=t._val.toString(!0)),t.key&&"scale"===t.key.value?r=+r:"string"!=typeof r&&"object"!==xCt(r)||(r="'"+r+"'");var n="attributes";return n+"&&"+n+t.key+"&&"+n+t.key+" "+e+r}var r=[];for(var n in this.filters)r.push(e(this.filters[n]));return r.join(" && ")}},{key:"toString",value:function(){var t=[];for(var e in this.filters)t.push(this.filters[e].id);return t.sort().join("\t")}},{key:"ev",value:function(t){for(var e in this.filters)this.filters[e].ev(t);return this}},{key:"clone",value:function(){var t=new kCt.Tree.Filterset;for(var e in this.filters)t.filters[e]=this.filters[e];return t}},{key:"cloneWith",value:function(t){var e=[];for(var r in t.filters){var n=this.addable(t.filters[r]);if(!1===n)return!1;!0===n&&e.push(t.filters[r])}if(!e.length)return null;var i=new kCt.Tree.Filterset;for(r in this.filters)i.filters[r]=this.filters[r];for(;r=e.shift();)i.add(r);return i}},{key:"addable",value:function(t){var e=t.key.toString(),r=t.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),t.op){case"=":return void 0!==this.filters[e+"="]?this.filters[e+"="].val.toString()==r&&null:void 0===this.filters[e+"!="+r]&&(!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val"]&&this.filters[e+">"].val>=r?null:void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val":return e+"="in this.filters?!(this.filters[e+"="].val<=r)&&null:!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)&&(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)||null));case">=":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)||null));case"<":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val>=r)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].valr)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)||null))}}},{key:"conflict",value:function(t){var e=t.key.toString(),r=t.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===t.op&&void 0!==this.filters[e+"="]&&r!=this.filters[e+"="].val.toString()||"!="===t.op&&void 0!==this.filters[e+"="]&&r==this.filters[e+"="].val.toString()||"="===t.op&&void 0!==this.filters[e+"!="]&&r===this.filters[e+"!="].val.toString())&&t.toString()+" added to "+this.toString()+" produces an invalid filter"}},{key:"add",value:function(t,e){var r,n=t.key.toString(),i=t.op,o=this.conflict(t);if(o)return o;if("="===i){for(var a in this.filters)this.filters[a].key===n&&delete this.filters[a];this.filters[n+"="]=t}else if("!="===i)this.filters[n+"!="+t.val]=t;else if("=~"===i)this.filters[n+"=~"+t.val]=t;else if(">"===i){for(var s in this.filters)this.filters[s].key===n&&this.filters[s].val<=t.val&&delete this.filters[s];this.filters[n+">"]=t}else if(">="===i){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===n&&r",this.filters[n+">"]=t):this.filters[n+">="]=t}else if("<"===i){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===n&&r>=t.val&&delete this.filters[l];this.filters[n+"<"]=t}else if("<="===i){for(var c in this.filters)r=+this.filters[c].val.toString(),this.filters[c].key===n&&r>t.val&&delete this.filters[c];void 0!==this.filters[n+"!="+t.val]?(delete this.filters[n+"!="+t.val],t.op="<",this.filters[n+"<"]=t):this.filters[n+"<="]=t}}}]),t}(),kCt.Tree.Fontset=SCt(function t(e,r){wCt(this,t),this.fonts=r,this.name="fontset-"+e.effects.length}),kCt.Tree.Invalid=function(){function t(e,r,n){wCt(this,t),this.is="invalid",this.chunk=e,this.index=r,this.type="syntax",this.message=n||"Invalid code: "+this.chunk}return SCt(t,[{key:"ev",value:function(t){return t.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}}]),t}(),kCt.Tree.Keyword=function(){function t(e){wCt(this,t),this.value=e;var r={transparent:"color",true:"boolean",false:"boolean"};this.is=r[e]?r[e]:"keyword"}return SCt(t,[{key:"ev",value:function(){return this}},{key:"toString",value:function(){return this.value}}]),t}(),kCt.Tree.Literal=function(){function t(e){wCt(this,t),this.value=e||"",this.is="field"}return SCt(t,[{key:"toString",value:function(){return this.value}},{key:"ev",value:function(){return this}}]),t}(),kCt.Tree.Operation=function(){function t(e,r,n){wCt(this,t),this.is="operation",this.op=e.trim(),this.operands=r,this.index=n}return SCt(t,[{key:"ev",value:function(t){var e,r=this.operands[0].ev(t),n=this.operands[1].ev(t);return"undefined"===r.is||"undefined"===n.is?{is:"undefined",value:"undefined"}:(r instanceof kCt.Tree.Dimension&&n instanceof kCt.Tree.Color&&("*"===this.op||"+"===this.op?(e=n,n=r,r=e):t.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof kCt.Tree.Quoted&&n instanceof kCt.Tree.Quoted&&"+"!==this.op?(t.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof kCt.Tree.Field||n instanceof kCt.Tree.Field||r instanceof kCt.Tree.Literal||n instanceof kCt.Tree.Literal?"color"===r.is||"color"===n.is?(t.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new kCt.Tree.Literal(r.ev(t).toString(!0)+this.op+n.ev(t).toString(!0)):void 0===r.operate?(t.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(t,this.op,n))}}]),t}(),kCt.Tree.Quoted=function(){function t(e){wCt(this,t),this.is="string",this.value=e||""}return SCt(t,[{key:"toString",value:function(t){var e=this.value.replace(/&/g,"&"),r=e.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===t?"'"+r+"'":e}},{key:"ev",value:function(){return this}},{key:"operate",value:function(t,e,r){return new kCt.Tree.Quoted(kCt.Tree.operate(e,this.toString(),r.toString(this.contains_field)))}}]),t}(),kCt.Tree.Reference={_validateValue:{font:function(t,e){return!t.validation_data||!t.validation_data.fonts||-1!=t.validation_data.fonts.indexOf(e)}},setData:function(t){this.data=t,this.selector_cache=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])t.symbolizers[r][n].hasOwnProperty("css")&&(e[t.symbolizers[r][n].css]=[t.symbolizers[r][n],r,n]);return e}(t),this.mapnikFunctions=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])if("functions"===t.symbolizers[r][n].type)for(var i=0;i1?Array.prototype.push.apply(r,n.find(new kCt.Tree.Selector(null,null,t.elements.slice(1)),e)):r.push(n);break}}),this._lookups[n]=r)}},{key:"evZooms",value:function(t){for(var e=0;ekCt.Tree.Zoom.maxZoom||e<0)&&t.error({message:"Only zoom levels between 0 and "+kCt.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+e,this;case">":this.zoom="zoom && zoom > "+e;break;case">=":this.zoom="zoom && zoom >= "+e;break;case"<":this.zoom="zoom && zoom < "+e;break;case"<=":this.zoom="zoom && zoom <= "+e}return this}},{key:"toString",value:function(){for(var t="",e=0;e<=kCt.Tree.Zoom.maxZoom;e++)t+=this.zoom&1<=l[2]||l[1]<=l[3])&&(this.DVBOrigonPoint=[l[0],l[3]],this.DVBWidth=Math.abs(l[2]-l[0]),this.DVBHeight=Math.abs(l[1]-l[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}},{key:"resetLocation",value:function(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var r=this.width,n=this.height,i=this.location;return this.chartBounds=new re(i[0]-r/2,i[1]+n/2,i[0]+r/2,i[1]-n/2),this.resetLinearGradient(),i}},{key:"resetLinearGradient",value:function(){}},{key:"shapesConvertToRelativeCoordinate",value:function(){for(var t=this.shapes,e=this.location,r=0,n=t.length;r=0?n.push(parseFloat(i[a].toString()).toFixed(r)):n.push(parseFloat(i[a].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};var qCt=function(t){function e(t,r,n,i,o){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(a=GCt(this,e,[t,r,n,i,o])).CLASS_NAME="SuperMap.Feature.Theme.Bar",a}var r,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&WCt(t,e)}(e,BCt),r=e,(n=[{key:"destroy",value:function(){VCt(HCt(e.prototype),"destroy",this).call(this)}},{key:"assembleShapes",value:function(){var t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},e=this.setting;if(e.barLinearGradient||(e.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var n=this.dataViewBox,i=this.dataValues;if(!(i.length<1)){for(var o=0,a=i.length;or[1])return;var s=this.calculateXShapeInfo();if(s){var u=s.xPositions,l=s.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(mc.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(mc.GraphAxis(this.shapeFactory,n,e,s)));for(var c=0;c=e.length&&(r%=e.length);var u=e[r][0],l=e[r][1],c=(new no).getLinearGradient(a,0,s,0,[[0,u],[1,l]]);i.style.color=c}}}}])&&zCt(r.prototype,n),i&&zCt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function YCt(t){"@babel/helpers - typeof";return(YCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function XCt(t,e){for(var r=0;re[1])return;var a=this.calculateXShapeInfo();if(a){var s=a.xPositions,u=a.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(mc.Background(this.shapeFactory,this.chartBox,t)),(!t.axis3DParameter||isNaN(t.axis3DParameter)||t.axis3DParameter<15)&&(t.axis3DParameter=20),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(mc.GraphAxis(this.shapeFactory,r,t,a)));for(var l=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10,c=0;c=s[2]||s[1]<=s[3])&&(this.DVBOrigonPoint=[s[0],s[3]],this.DVBWidth=Math.abs(s[2]-s[0]),this.DVBHeight=Math.abs(s[1]-s[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-i[0],this.DVBOrigonPoint[1]-i[1]],!0)}}])&&rOt(r.prototype,n),i&&rOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function lOt(t){"@babel/helpers - typeof";return(lOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cOt(t,e){for(var r=0;r0?this.DVBUnitValue=t.maxR/(i[1]-i[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,a=n[0]*o+t.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!i||!(n[0]i[1]))){var s=this.DVBCenterPoint,u=new hl(s[0],s[1],a);u.style=mc.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?u.style.fillColor=t.fillColor:u.style.fillColor="#ff9277",u.highlightStyle=mc.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(u.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(u.clickable=t.circleClickAble),u.refDataID=this.data.id,u.dataInfo={field:this.fields[0],r:a,value:n[0]},this.shapes.push(this.shapeFactory.createShape(u)),this.shapesConvertToRelativeCoordinate()}}}])&&cOt(r.prototype,n),i&&cOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function gOt(t){"@babel/helpers - typeof";return(gOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mOt(t,e){for(var r=0;rr[1])return null;a=u[f],s=e[1]-(i[f]-r[0])/n;var p=new cu(a,s);p.style=mc.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,f,i[f]),p.highlightStyle=mc.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(p.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(p.clickable=t.pointClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[f],value:i[f]},c.push(this.shapeFactory.createShape(p));var d=[a,s];l.push(d)}var y=new mu(l);y.style=mc.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),y.clickable=!1,y.hoverable=!1;var v=this.shapeFactory.createShape(y);this.shapes.push(v),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],o=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=o-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=o/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var o=0,a=0;a=360&&(c=359.9999999);var y=new Gu(u[0],u[1],h,l,c);if(void 0===t.sectorStyleByFields){var v=p%e.length;y.style=mc.ShapeStyleTool(null,t.sectorStyle,e,null,v)}else y.style=mc.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,p,r[p]);y.highlightStyle=mc.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(y.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(y.clickable=t.sectorClickAble),y.refDataID=this.data.id,y.dataInfo={field:this.fields[p],value:r[p]},this.shapes.push(this.shapeFactory.createShape(y)),l=c}this.shapesConvertToRelativeCoordinate()}}}}])&&TOt(r.prototype,n),i&&TOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function LOt(t){"@babel/helpers - typeof";return(LOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jOt(t,e){for(var r=0;rr[1])return null;a=u[l],s=e[1]-(i[l]-r[0])/n;var f=new cu(a,s);f.style=mc.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,l,i[l]),f.highlightStyle=mc.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(f.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(f.clickable=t.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[l],value:i[l]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],o=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=o-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=o/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var o=0,a=0;a=0&&e.innerRingRadius1&&void 0!==arguments[1]?arguments[1]:"warring";"success"===e?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===e?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===e&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=t,this.messageBoxContainer.hidden=!1}}])&&tAt(e.prototype,r),n&&tAt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),nAt=function(){try{return echarts}catch(t){return{}}}(),iAt={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return iAt.code||iAt.setCode(),iAt.code},setCode:function(){var t=this.getLanguageFromCookie();t||(t=iAt.defaultCode,t="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===t.indexOf("zh")&&(t="zh-CN"),0===t.indexOf("en")&&(t="en-US"),iAt.code=t},getLanguageFromCookie:function(){for(var t=document.cookie.split(";"),e=0;e0){var a=o.SheetNames[0],s=oAt.utils.sheet_to_csv(o.Sheets[a]);e&&e.call(n,s)}}catch(t){r&&r.call(n,t)}},i.onerror=function(t){r&&r.call(n,t)},this.rABF&&i.readAsArrayBuffer(t.file)},processDataToGeoJson:function(t,e,r,n,i){var o=null;if("EXCEL"===t||"CSV"===t)o=this.processExcelDataToGeoJson(e),r&&r.call(i,o);else if("JSON"===t||"GEOJSON"===t){var a=e;"string"==typeof a&&(a=JSON.parse(a)),"ISERVER"===a.type?o=a.data.recordsets[0].features:"FeatureCollection"===a.type?o=a:n&&n.call(i,iAt.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(i,o)}else n&&n.call(i,iAt.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson:function(t){for(var e=this.string2Csv(t),r=e.colTitles,n=-1,i=-1,o=0,a=r.length;o0?(n.dataItemServices.forEach(function(n){if("RESTDATA"===n.serviceType&&"PUBLISHED"===n.serviceStatus)i=n;else{if("RESTMAP"!==n.serviceType||"PUBLISHED"!==n.serviceStatus)return void r.getDatafromContent(t,e);i=n}}),i&&r.getDatafromRest(i.serviceType,i.address,e)):r.getDatafromContent(t,e):r._fireFailedEvent(n)}).catch(function(t){console.log(t),r._fireFailedEvent(t)})}},{key:"getDatafromContent",value:function(t,e){var r=this,n={result:{}},i=this;t+="/content.json?pageSize=9999999¤tPage=1",ut.get(t,null,{withCredentials:this.datasets.withCredentials}).then(function(t){return t.json()}).then(function(t){if(!1!==t.succeed){if(t.type){if("JSON"===t.type||"GEOJSON"===t.type){if(t.content=JSON.parse(t.content.trim()),!t.content.features)return void console.log(iAt.i18n("msg_jsonResolveFiled"));var o=r._formatGeoJSON(t.content);n.result.features={type:t.content.type,features:o}}else if("EXCEL"===t.type||"CSV"===t.type){var a=r._excelData2Feature(t.content);n.result.features={type:"FeatureCollection",features:a}}e(n,"content")}}else i._fireFailedEvent(t)},this).catch(function(t){console.log(t),i._fireFailedEvent(t)})}},{key:"getDatafromRest",value:function(t,e,r){var n=this,i=this.datasets.withCredentials;if("RESTDATA"===t){var o,a,s="".concat(e,"/data/datasources");ut.get(s,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){o=t.datasourceNames[0],s="".concat(e,"/data/datasources/").concat(o,"/datasets"),ut.get(s,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){return a=t.datasetNames[0],n.getDatafromRestData("".concat(e,"/data"),[o+":"+a],r),[o+":"+a]}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}else{var u,l,c,f="".concat(e,"/maps");ut.get(f,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){u=t[0].name,c=t[0].path,f=f="".concat(e,"/maps/").concat(u,"/layers"),ut.get(f,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){return l=t[0].subLayers.layers[0].caption,n.getDatafromRestMap(l,c,r),l}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}}},{key:"getDatafromRestData",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(t,e,this.datasets.queryInfo,function(t){r(t,"RESTDATA")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"getDatafromRestMap",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(e,t,this.datasets.queryInfo,null,null,function(t){r(t,"RESTMAP")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"_getFeatureBySQL",value:function(t,e,r,n,i){var o,a,s={name:e.join().replace(":","@")};Object.assign(s,r),o=new K1(s),a=new T2({queryParameter:o,datasetNames:e,fromIndex:0,toIndex:1e5,returnContent:!0}),new j2(t).processAsync(a,function(t){"processCompleted"===t.type?n&&n(t):i&&i(t)})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,i,o,a,s,u,l){var c,f,h={name:e};Object.assign(h,r),c=new K1(h),n&&(c.fields=n);var p={queryParams:[c]};l&&(p.queryOption=gn.ATTRIBUTE),s&&(p.startRecord=s),u&&(p.expectCount=u),i&&(p.prjCoordSys={epsgCode:i}),f=new Mlt(p),this._queryBySQL(t,f,function(t){"processCompleted"===t.type?o(t):a(t)})}},{key:"_queryBySQL",value:function(t,e,r,n){new Flt(t,{format:this._processFormat(n)}).processAsync(e,r)}},{key:"_processFormat",value:function(t){return t||dn.GEOJSON}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){for(var e=t.colTitles,r=-1,n=-1,i=0,o=e.length;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function pAt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&t.forEach(function(t){t.xAxis&&e.xField.push({field:t.xAxis.field,name:t.xAxis.name}),t.yAxis&&e.yField.push({field:t.yAxis.field,name:t.yAxis.name})})}},{key:"getDatasetInfo",value:function(t){var e=this;this.createChart=t,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new cAt(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:function(t){e.events.triggerEvent("getdatafailed",t)}}))}},{key:"_getDatasetInfoSuccess",value:function(t){var e=this.datasets.url,r=e.indexOf("rest");if(r>0){var n=e.indexOf("/",r+5),i=e.substring(r+5,n),o=e.substring(0,r+4)+"/data";if("maps"===i){var a=e.indexOf("/",n+1),s=e.substring(n+1,a);o=e.substring(0,r+4)+"/maps/"+s,t.result.dataUrl=o,this._getLayerFeatures(t)}else"data"===i&&(t.result.dataUrl=o,this._getDataFeatures(t))}}},{key:"_getDataInfoSuccess",value:function(t,e){"RESTMAP"===e?this._getChartDatasFromLayer(t):this._getChartDatas(t)}},{key:"_getDataFeatures",value:function(t){this.chartModel.getDataFeatures(t,this._getChartDatas.bind(this))}},{key:"_getLayerFeatures",value:function(t){this.chartModel.getLayerFeatures(t,this._getChartDatasFromLayer.bind(this))}},{key:"_getChartDatas",value:function(t){if(t){this.features=t.result.features;var e=this.features.features,r={};if(e.length){var n=e[0],i=[],o=[];for(var a in n.properties)i.push(a),o.push(this._getDataType(n.properties[a]));for(var s in r={features:e,fieldCaptions:i,fieldTypes:o,fieldValues:[]},o){var u=[];for(var l in e){var c=e[l],f=r.fieldCaptions[s],h=c.properties[f];u.push(h)}r.fieldValues.push(u)}this.createChart(r)}}}},{key:"_getChartDatasFromLayer",value:function(t){if(t.result.recordsets){var e=t.result.recordsets[0],r=e.features.features;this.features=e.features;var n={};if(r.length){for(var i in(n={features:e.features,fieldCaptions:e.fieldCaptions,fieldTypes:e.fieldTypes,fieldValues:[]}).fieldCaptions){var o=[];for(var a in r){var s=r[a],u=n.fieldCaptions[i],l=s.properties[u];o.push(l)}n.fieldValues.push(o)}this.createChart(n)}}}},{key:"_createChartOptions",value:function(t){return this.calculatedData=this._createChartDatas(t),this.updateChartOptions(this.chartType)}},{key:"changeType",value:function(t){if(t!==this.chartType)return this.chartType=t,this.updateChartOptions(this.chartType)}},{key:"updateData",value:function(t,e,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(e),t.type=t.type||"iServer",t.withCredentials=t.withCredentials||!1,this.datasets=t,this.getDatasetInfo(this._updateDataSuccess.bind(this))}},{key:"_updateDataSuccess",value:function(t){var e=this._createChartOptions(t);this.updateChart(e)}},{key:"updateChartOptions",value:function(t,e){if(this.calculatedData){var r=this.grid,n=this._createChartSeries(this.calculatedData,t),i=[];for(var o in this.calculatedData.XData)i.push({value:this.calculatedData.XData[o].fieldsData});var a={type:"category",name:this.xField[0].name||"X",data:i,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},u={formatter:"{b0}: {c0}"},l="#404a59";return e&&(e.grid&&(r=e.grid),e.tooltip&&(u=e.tooltip),e.backgroundColor&&(l=e.backgroundColor)),{backgroundColor:l,grid:r,series:n,xAxis:a,yAxis:s,tooltip:u}}}},{key:"_createChartDatas",value:function(t){var e=0,r=[],n=t.fieldCaptions,i=this;n.forEach(function(t,r){i.xField[0]&&t===i.xField[0].field&&(e=r)}),this.yFieldName="",this.yField.forEach(function(t,e){0!==e&&(i.yFieldName=i.yFieldName+","),i.yFieldName=i.yFieldName+t.name,n.forEach(function(e,n){e===t.field&&r.push(n)})});var o=this._getAttrData(t,e),a=[];if(r.length>0)r.forEach(function(e){var r=[];for(var n in t.fieldValues[e])r.push({value:t.fieldValues[e][n]});a.push(r)});else{for(var s=[],u=[],l=o.length,c=0;c0;t--)this.header.removeChild(this.header.children[t]),this.content.removeChild(this.content.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r0;e--)this.content.removeChild(this.content.children[e-1]);var r=this.config[t];for(var n in r)this._createCityItem(n,r[n])}},{key:"_createCityItem",value:function(t,e){var r=document.createElement("div"),n=document.createElement("div");n.setAttribute("class","component-citytabpag__py-key"),n.innerHTML=t,r.appendChild(n);var i=document.createElement("div");i.setAttribute("class","component-citytabpag__content");for(var o=0;o0&&this.appendTabs(t),this.rootContainer=e}},{key:"setTabs",value:function(t){this.removeAllTabs(),this.appendTabs(t)}},{key:"appendTabs",value:function(t){for(var e=0;e0;t--)this.navTabsTitle.removeChild(this.navTabsTitle.children[t]),this.navTabsContent.removeChild(this.navTabsContent.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r=0;t--)this.content.removeChild(this.content.children[t])}},{key:"setPageLink",value:function(t){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(t),this._appendPageLink()}},{key:"_createPageLi",value:function(t){for(var e=0;e1;t--)this.link.removeChild(this.link.children[t])}},{key:"_createLink",value:function(t){for(var e=0;e<4;e++){var r=document.createElement("li");r.setAttribute("class","disable");var n=document.createElement("span");r.appendChild(n),0===e?(n.id="first",n.setAttribute("class","supermapol-icons-first")):1===e?(n.id="prev",n.setAttribute("class","supermapol-icons-prev")):2===e?(n.id="next",n.setAttribute("class","supermapol-icons-next")):3===e&&(n.id="last",n.setAttribute("class","supermapol-icons-last")),t.appendChild(r)}}},{key:"_changePageEvent",value:function(t){var e=t.target;if("disable"!==e.parentElement.classList[0]){var r;if(e.id)r=e.id;else{if(!Number(e.innerHTML))return;r=Number(e.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}}},{key:"_changeDisableState",value:function(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}},{key:"_prePageNum",value:function(t){var e=[];if(this.currentPage="first"===t?1:"last"===t?this.pageNumberLis.length:"prev"===t?this.currentPage-1:"next"===t?this.currentPage+1:t,this.pageNumberLis.length<=5)for(var r=0;r=this.pageNumberLis.length-3)for(var i=this.pageNumberLis.length-5;i0&&(this.currentPageNumberLis=e)}}])&&OPt(r.prototype,n),i&&OPt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function jPt(t){"@babel/helpers - typeof";return(jPt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function NPt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function RPt(t){for(var e=1;e|<|=|!/g," ").split(" ").filter(function(t){return t}).forEach(function(t){var n=e.find(function(e){return e===t});if(UPt(t)&&n&&(r=r.replace(n,"$"+n)),n){var i=BPt(n);r=r.replace(n,i)}}),r}function zPt(t){var e={};for(var r in t){var n=r;UPt(r)&&(n="$"+r),e[n=BPt(n)]=t[r]}return e}function UPt(t){return/^\d/.test(t)}Bbt.Lang=iAt,Bbt.i18n=Bbt.Lang.i18n,Bbt.Util=RPt(RPt({},Bbt.Util),$),Bbt.Browser=K,Bbt.INCHES_PER_UNIT=tt,Bbt.METERS_PER_INCH=et,Bbt.DOTS_PER_INCH=96,Bbt.IS_GECKO=Q,Bbt.setCORS=function(t){rt=t},Bbt.isCORS=at,Bbt.setRequestTimeout=function(t){return nt=t},Bbt.getRequestTimeout=st,Bbt.FetchRequest=ut,Bbt.EncryptRequest=wt,Bbt.getServiceKey=_t,Bbt.GeometryAnalysis=gCt,Bbt.inherit=function(t,e){var r,n,i,o=function(){};for(o.prototype=e.prototype,t.prototype=new o,r=2,n=arguments.length;r2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=XPt(this,e)).mapId=t,n.server=r.server,n.withCredentials=r.withCredentials,n.target=r.target,n.mapOptions=i,n._canvgsV=[],n}var r,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&KPt(t,e)}(e,O().Evented),r=e,(n=[{key:"initializeMap",value:function(t){var e=this;if(!["EPSG:4490","EPSG:4214","EPSG:4610","EPSG:3857","EPSG:4326"].find(function(e){return e===t.projection}))throw Error(iAt.i18n("msg_crsunsupport"));this.baseProjection=t.projection,this.mapParams={title:t.title,description:t.description},this._createMap(t);var r=t.layers;this.map.on("load",function(){e._addBaseMap(t),r&&0!==r.length?e._addLayers(r):e._sendMapToUser(0,0)}),this.map.on("remove",function(){e._stopCanvg()})}},{key:"_createMap",value:function(t){var e=[],r=t.layers;r&&r.length>0&&r.forEach(function(t){t.labelStyle&&e.push(t.labelStyle.fontFamily)},this),e.push("supermapol-icons");var n,i=e.join(","),o=t.center,a=t.level||0,s=0;if(t.minScale&&t.maxScale)s=this._transformScaleToZoom(t.minScale,O().CRS?O().CRS.get(this.baseProjection):"EPSG:3857");else{var u=this._getResolution(O().CRS?O().CRS.get(this.baseProjection).getExtent():[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892])/this._getResolution(t.extent);s=+Math.log(u)/Math.LN2.toFixed(2)}a+=s,n=o?gi.unproject([o.x,o.y]):new(O().LngLat)(0,0),this.map=new(O().Map)({container:this.target,center:this.mapOptions.center||n,zoom:this.mapOptions.zoom||a,bearing:this.mapOptions.bearing||0,pitch:this.mapOptions.pitch||0,style:{version:8,sources:{},layers:[]},crs:this.baseProjection,localIdeographFontFamily:i||""}),this.fire("mapinitialized")}},{key:"_addBaseMap",value:function(t){this._createBaseLayer(t)}},{key:"_createBaseLayer",value:function(t){var e=t.baseLayer||t,r=e.layerType;(r.indexOf("TIANDITU_VEC")>-1||r.indexOf("TIANDITU_IMG")>-1||r.indexOf("TIANDITU_TER")>-1)&&(r=r.substr(0,12));var n;switch(r){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":this._createTiandituLayer(t);break;case"BING":this._createBingLayer(e.name);break;case"WMS":this._createWMSLayer(e);break;case"WMTS":this._createWMTSLayer(e);break;case"TILE":case"SUPERMAP_REST":this._createDynamicTiledLayer(e);break;case"CLOUD":case"CLOUD_BLACK":case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":n={CLOUD:"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:"http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"https://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i380072576!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0",GOOGLE_CN:"https://mt{0-3}.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"}[r],this._createXYZLayer(e,n);break;case"MAPBOXSTYLE":this._createMapboxStyle(e)}}},{key:"_createMapboxStyle",value:function(t){var e,r=this,n=t.dataSource,i=void 0===n?{}:n,o=i.serverId,a=i.url;e=void 0!==o?"".concat(this.server,"web/datas/").concat(o,"/download"):a,ut.get(e,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(t){return t.json()}).then(function(t){r._matchStyleObject(t),r.map.setStyle(t)})}},{key:"_matchStyleObject",value:function(t){var e=t.sprite,r=t.glyphs;e&&"object"===WPt(e)&&(t.sprite=Object.values(e)[0]),r&&"object"===WPt(r)&&(t.glyphs=Object.values(r)[0])}},{key:"_createTiandituLayer",value:function(t){var e=this._getTiandituUrl(t),r=t.baseLayer.layerType,n=Boolean(t.baseLayer.labelLayerVisible),i=e.labelUrl,o=e.tiandituUrl;this._addBaselayer(o,"tianditu-layers-"+r),n&&this._addBaselayer(i,"tianditu-label-layers-"+r)}},{key:"_createWMTSLayer",value:function(t){var e=this,r=this._getWMTSUrl(t);this._filterWMTSIsMatched(t,function(n,i){n&&e._addBaselayer([r],"wmts-layers"+t.name,0,i)})}},{key:"_filterWMTSIsMatched",value:function(t,e){var r=this,n=!1,i=22,o=t.url;ut.get(o,null,{withCredentials:!1,withoutFormatSuffix:!0}).then(function(t){return t.text()}).then(function(o){var a=new HPt.XMLParser({numberParseOptions:{hex:!1,leadingZeros:!1,eNotation:!1},alwaysCreateTextNode:!0,textNodeName:"_text"}).parse(o).Capabilities.Contents.TileMatrixSet;Array.isArray(a)||(a=[a]);for(var s=0;s-1)n=!0;else{if(!a[s].WellKnownScaleSet||"Custom"!==a[s].WellKnownScaleSet._text)throw Error(iAt.i18n("msg_tilematrixsetunsupport"));for(var u=[],l="EPSG:3857"===r.map.crs?JPt:QPt,c=0,f=l.length;c-1&&(r.svgDiv||(r.svgDiv=document.createElement("div"),document.body.appendChild(r.svgDiv)),r._getCanvasFromSVG(i.src,r.svgDiv,function(e){var n=e.toDataURL("img/png");n&&r.map.loadImage(n,function(e,n){e&&console.log(e),r.map.addImage(s+"",n),r.map.addLayer({id:u,type:"symbol",source:a,layout:{"icon-image":s+"","icon-size":i.scale,visibility:t.visible}})},r)})),!i.src){var l={layout:{}};"LINESTRING"===n&&i.lineCap&&(n="LINE",l.layout={"line-cap":i.lineCap});var c=t.visible;l.layout.visibility=c,l.style=r._transformStyleToMapBoxGl(i,n),r._addOverlayToMap(n,a,u,l),"POLYGON"===n&&i.strokeColor&&r._addStrokeLineForPoly(i,a,u+"-strokeLine",c)}},this)}},{key:"setFeatureInfo",value:function(t){var e,r=t.dv_v5_markerInfo;if(!r||!r.dataViz_title)return r;e=r;var n=t.properties;for(var i in e)n[i]&&(e[i]=n[i],delete n[i]);return e}},{key:"_createHeatLayer",value:function(t,e){var r=t.themeSetting,n={};n.gradient=r.colors.slice(),n.radius=parseInt(r.radius);var i=r.customSettings;for(var o in i)n.gradient[o]=i[o];r.weight&&this._changeWeight(e,r.weight);var a=["interpolate",["linear"],["heatmap-density"]],s=(1/n.gradient.length).toFixed(2);n.gradient.forEach(function(t,e){a.push(e*s),0===e&&(t=gi.hexToRgba(t,0)),a.push(t)});var u={"heatmap-color":a,"heatmap-radius":r.radius+15,"heatmap-intensity":{base:1,stops:[[0,.8],[22,1]]}};if(e[0].weight&&e.length>=4){var l=[];e.forEach(function(t){l.push(t.weight)});var c=iCt.getMax(l),f=iCt.getMin(l);u["heatmap-weight"]=["interpolate",["linear"],["get","weight"],f,0,c,1]}this.map.addLayer({id:t.layerID,type:"heatmap",source:{type:"geojson",data:{type:"FeatureCollection",features:e}},paint:u})}},{key:"_changeWeight",value:function(t,e){this.fieldMaxValue={},this._getMaxValue(t,e);var r=this.fieldMaxValue[e];t.forEach(function(t){var n=t.properties[e];t.weight=n/r})}},{key:"_getMaxValue",value:function(t,e){var r,n=[],i=e;this.fieldMaxValue[i]||(t.forEach(function(t){(r=t.properties)&&parseFloat(r[i])&&n.push(parseFloat(r[i]))}),this.fieldMaxValue[i]=iCt.getArrayStatistic(n,"Maximum"))}},{key:"_createRangeLayer",value:function(t,e){var r=t.themeSetting.themeField,n=t.style,i=t.featureType,o=this._getRangeStyleGroup(t,e),a={type:"geojson",data:{type:"FeatureCollection",features:e=this._getFiterFeatures(t.filterCondition,e)}},s=["match",["get","index"]];e.forEach(function(t){for(var e=parseFloat(t.properties[r]),n=0;n0&&n.push(o)}return n}},{key:"_replaceFilterCharacter",value:function(t){return t=t.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")}},{key:"_getRangeStyleGroup",value:function(t,e){var r,n=t.featureType,i=t.style,o=[],a=t.themeSetting,s=a.customSettings,u=a.themeField,l=a.segmentCount;e.forEach(function(t){(r=t.properties||t.get("Properties"))?r[u]&&gi.isNumber(r[u])&&o.push(parseFloat(r[u])):t.get(u)&&gi.isNumber(t.get(u))&&t.get(u)&&o.push(parseFloat(t.get(u)))},this);var c=iCt.getArraySegments(o,a.segmentMethod,l);if(c){var f=l;for(var h in r&&c[0]===c[r.length-1]&&(f=1,c.length=2),c){var p=c[h];p=0==h?Math.floor(100*p)/100:Math.ceil(100*p)/100+.1,c[h]=Number(p.toFixed(2))}for(var d=a.colors,y=0;y300||i.height>300||r(i)})}},{key:"_stopCanvg",value:function(){this._canvgsV.forEach(function(t){return t.stop()}),this._canvgsV=[]}},{key:"_addOverlayToMap",value:function(t,e,r,n){"circle"!==(t={POINT:"circle",LINE:"line",POLYGON:"fill"}[t])&&"line"!==t&&"fill"!==t||this.map.addLayer({id:r,type:t,source:e,paint:n.style,layout:n.layout||{}})}},{key:"_addBaselayer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:22,i=arguments.length>4?arguments[4]:void 0;this.map.addLayer({id:e,type:"raster",source:{type:"raster",tiles:t,tileSize:256,rasterSource:i?"iserver":"",prjCoordSys:i?{epsgCode:this.baseProjection.split(":")[1]}:""},minzoom:r,maxzoom:n})}},{key:"_addStrokeLineForPoly",value:function(t,e,r,n){var i={};i.style=this._transformStyleToMapBoxGl(t,"LINE"),i.layout={visibility:n},this._addOverlayToMap("LINE",e,r,i)}},{key:"_parseGeoJsonData2Feature",value:function(t){for(var e=t.allDatas.features,r=[],n=0,i=e.length;n 0"}),o=new T2({queryParameter:i,datasetNames:e,fromIndex:0,toIndex:1e5,returnContent:!0}),new j2(t).processAsync(o,function(t){"processCompleted"===t.type?r(t):n(t)})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,i,o,a,s,u,l){var c,f;c=new K1({name:e,attributeFilter:r}),n&&(c.fields=n);var h={queryParams:[c]};l&&(h.queryOption=gn.ATTRIBUTE),s&&(h.startRecord=s),u&&(h.expectCount=u),i&&(h.prjCoordSys={epsgCode:i}),f=new Mlt(h),new pct(t).queryBySQL(f,function(t){"processCompleted"===t.type?o(t):a(t)})}},{key:"_handleMultyPolygon",value:function(t){return t.forEach(function(t){if("Polygon"===t.geometry.type){var e=t.geometry.coordinates;if(e.length>1){var r=[];e.forEach(function(t){r.push([t])}),t.geometry.coordinates=r,t.geometry.type="MultiPolygon"}}}),t}},{key:"_transformScaleToZoom",value:function(t,e){var r=295829515.2024169;"EPSG:3857"!==(e||this.map.getCRS()).epsgCode&&(r=295295895);var n=t.split(":")[1];return Math.min(24,+Math.log2(r/+n).toFixed(2))}},{key:"_getResolution",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;return t.leftBottom&&t.rightTop?Math.max(t.rightTop.x-t.leftBottom.x,t.rightTop.y-t.leftBottom.y)/e:Math.max(t[2]-t[0],t[3]-t[1])/e}}])&&qPt(r.prototype,n),i&&qPt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function eMt(t){return function(t){if(Array.isArray(t))return oMt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||iMt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rMt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=iMt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function nMt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||iMt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iMt(t,e){if(t){if("string"==typeof t)return oMt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oMt(t,e):void 0}}function oMt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function sMt(t){"@babel/helpers - typeof";return(sMt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uMt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function lMt(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=pMt(this,e)).mapId=t,n.options=r,n.mapOptions=i,n._legendList=[],n._mapResourceInfo={},n._sprite="",n._spriteDatas={},n.excludeSourceNames=["tdt-search-","tdt-route-","smmeasure","mapbox-gl-draw",/tracklayer-\d+-line/],n._appendLayers=!1,n._baseProjection="",n}var r,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yMt(t,e)}(e,O().Evented),r=e,(n=[{key:"initializeMap",value:function(t,e){if(this._mapInfo=t,this._setBaseProjection())return e?(this._appendLayers=!0,this.map=e,void this._initLayers()):void this._createMap()}},{key:"getAppreciableLayers",value:function(){return this._generateLayers()}},{key:"getLayerCatalog",value:function(){return this._generateLayerCatalog()}},{key:"getLegendInfo",value:function(){return this._legendList}},{key:"copyLayer",value:function(){var t=fMt(aMt().mark(function t(e){var r,n,i,o,a,s=arguments;return aMt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=s.length>1&&void 0!==s[1]?s[1]:{},(n=this._mapInfo.layers.find(function(t){return t.id===e}))&&!this.map.getLayer(r.id)){t.next=4;break}return t.abrupt("return");case 4:if(i=r.id||"".concat(n.id,"_copy"),!BJ(o=lMt(lMt(lMt({},n),r),{},{id:i}))){t.next=11;break}return a=[o],t.next=10,RJ({map:this.map,webMapInfo:lMt(lMt({},this._mapInfo),{},{layers:a,sources:this._mapInfo.sources}),l7Layers:a,spriteDatas:this._spriteDatas,options:this.options});case 10:return t.abrupt("return");case 11:"object"===sMt(o.source)&&(this.map.addSource(o.id,o.source),o.source=o.id),this.map.addLayer(o);case 13:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateOverlayLayer",value:function(t,e,r){if("geojson"===t.renderSource.type){var n=t.renderSource.id,i={type:"FeatureCollection",features:e=this._mergeFeatures(n,e,r)};this.map.getSource(n).setData(i)}}},{key:"_mergeFeatures",value:function(t,e,r){if(!(e instanceof Array))return e;if(!(e=e.map(function(t,e){return Object.prototype.hasOwnProperty.call(t.properties,"index")||(t.properties.index=e),t})).length||!r&&e[0].geometry)return e;var n=this.map.getSource(t);if((!n||!n._data.features)&&e[0].geometry)return e;var i=n&&n._data&&n._data.features,o=[];return!r&&i?i:(e.forEach(function(t){var e=i.find(function(e){return isNaN(+e.properties[r])&&isNaN(+t.properties[r])?JSON.stringify(e.properties[r]||"")===JSON.stringify(t.properties[r]||""):+e.properties[r]==+t.properties[r]});e?o.push(lMt(lMt({},e),t)):t.geometry&&o.push(t)}),o)}},{key:"_createMap",value:function(){var t=this,e=this._mapInfo,r=e.name,n=void 0===r?"":r,i=e.center,o=void 0===i?new(O().LngLat)(0,0):i,a=e.zoom,s=void 0===a?0:a,u=e.bearing,l=void 0===u?0:u,c=e.pitch,f=void 0===c?0:c,h=e.minzoom,p=e.maxzoom,d=e.sprite,y=void 0===d?"":d;o=this.mapOptions.center||o,s=this.mapOptions.zoom||s,l=this.mapOptions.bearing||l,f=this.mapOptions.pitch||f;var v=this._getLabelFontFamily(),g=lMt(lMt({transformRequest:function(e,r){var n={url:e};return"Tile"===r&&t.options.iportalServiceProxyUrl&&e.indexOf(t.options.iportalServiceProxyUrl)>=0&&(n.credentials="include"),n}},this.mapOptions),{},{container:this.options.target,crs:this._baseProjection,center:o,zoom:s,style:{sprite:y,name:n,version:8,sources:{},layers:[]},minZoom:h,maxZoom:p,bearing:l,pitch:f,localIdeographFontFamily:v||""});this.map=new(O().Map)(g),this._sprite=y,this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){t._initLayers()})}},{key:"_setBaseProjection",value:function(){var t=this._mapInfo.crs,e=t;if("object"===sMt(t)){if(e=t.name,!O().CRS){var r="The EPSG code ".concat(e," needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362");return this.fire("getmapinfofailed",{error:r}),void console.error(r)}this._setCRS(t)}return this._baseProjection=e,this._baseProjection}},{key:"_setCRS",value:function(t){var e=t.name,r=t.wkt,n=t.extent,i=new(O().CRS)(e,r,n,n[2]>180?"meter":"degree");O().CRS.set(i)}},{key:"_initLayers",value:function(){var t=this;if(!this.map.getCRS||this.map.getCRS().epsgCode===this._baseProjection)return"[object Object]"===Object.prototype.toString.call(this.mapId)?(this.mapParams={title:this._mapInfo.name,description:""},this._createMapRelatedInfo(),void this._addLayersToMap()):void Promise.all([this._getMapRelatedInfo(),this._getSpriteDatas()]).then(function(e){var r=nMt(e,1)[0];t.mapParams={title:t._mapInfo.name,description:r.description},t._mapResourceInfo=JSON.parse(r.projectInfo),t._createMapRelatedInfo(),t._addLayersToMap()}).catch(function(e){t.fire("getmapinfofailed",{error:e}),console.error(e)});this.fire("projectionisnotmatch")}},{key:"_createMapRelatedInfo",value:function(){var t=this._mapInfo.glyphs;for(var e in t)this.map.style.addGlyphs(e,t[e])}},{key:"_getMapRelatedInfo",value:function(){var t=gi.transformUrl(Object.assign({url:"".concat(this.options.server,"web/maps/").concat(this.mapId)},this.options));return ut.get(t,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()})}},{key:"_addLayersToMap",value:function(){var t=fMt(aMt().mark(function t(){var e,r,n,i,o,a,s=this;return aMt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e=this._setUniqueId(this._mapInfo,this._mapResourceInfo),r=e.sources,n=e.layers,i=e.layerCatalog,o=e.catalogs,Object.assign(this._mapInfo,{sources:r,layers:n,metadata:Object.assign(this._mapInfo.metadata,{layerCatalog:i})}),Object.assign(this._mapResourceInfo,{catalogs:o}),n.filter(function(t){return!BJ(t)}).forEach(function(t){t.source&&!s.map.getSource(t.source)&&s.map.addSource(t.source,r[t.source]),"symbol"===t.type&&0===t.layout["text-z-offset"]&&delete t.layout["text-z-offset"],s.map.addLayer(t)}),!((a=n.filter(function(t){return BJ(t)})).length>0)){t.next=10;break}return t.next=10,RJ({map:this.map,webMapInfo:lMt(lMt({},this._mapInfo),{},{layers:n,sources:r}),l7Layers:a,spriteDatas:this._spriteDatas,options:lMt(lMt({},this.options),{},{emitterEvent:this.fire.bind(this)})});case 10:this._createLegendInfo(),this._sendMapToUser(),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),this.fire("getlayersfailed",{error:t.t0,map:this.map}),console.error(t.t0);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"_setUniqueId",value:function(t,e){var r=this._handleUnSupportedLayers(t),n=JSON.parse(JSON.stringify(t.layers)).filter(function(t){return!r.includes(t.id)}),i={},o=[],a="_".concat(+new Date);for(var s in t.sources){var u=s;this.map.getSource(s)&&(u=s+a),i[u]=t.sources[s];var l,c=rMt(n);try{for(c.s();!(l=c.n()).done;){var f=l.value;f.source===s&&(f.source=u)}}catch(t){c.e(t)}finally{c.f()}}var h,p=rMt(n);try{for(p.s();!(h=p.n()).done;){var d=h.value,y=d.id;if(this.map.getLayer(d.id)){var v=d.id+a;d.id=v}o.push({originId:y,renderId:d.id})}}catch(t){p.e(t)}finally{p.f()}var g=JSON.parse(JSON.stringify(t.metadata.layerCatalog),"parts");this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(g)),catalogs:g,layerIdMapList:o,unspportedLayers:r});var m=JSON.parse(JSON.stringify(e.catalogs||[]));return this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(m)),catalogs:m,layerIdMapList:o,catalogTypeField:"catalogType",layerIdsField:"layersContent",unspportedLayers:r}),{sources:i,layers:n,layerCatalog:g,catalogs:m}}},{key:"_deleteLayerCatalog",value:function(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"type",r=[],n=0;n0){var o=this._getLayerInfosFromCatalogs(i,e);r.push.apply(r,eMt(o))}}else r.push(t[n])}return r}},{key:"clean",value:function(){if(this.map){var t=this.map.$l7scene;t&&t.removeAllLayer(),this.map.remove(),this.map=null,this._legendList=[],this._mapResourceInfo={},this._sprite="",this._spriteDatas={},this.mapOptions={},this.options={}}}},{key:"excludeSource",value:function(t){for(var e=0;e0&&(_.themeSetting={themeField:E}),e.push(_),e},[])}},{key:"_renameLayerIdsContent",value:function(t,e){return t?t.map(function(t){return e.find(function(e){return e.originId===t}).renderId}):t}},{key:"_generateLayerCatalog",value:function(){var t=this,e=this._mapInfo.metadata.layerCatalog,r=e.reduce(function(e,r){var n=t._collectChildrenKey([r],["id","parts"]);return e.push.apply(e,eMt(n)),e},[]),n=this._getLayersOnMap().filter(function(t){return!r.some(function(e){return e===t.id})}),i=e.concat(n),o=this.getAppreciableLayers();return this._createFormatCatalogs(i,o)}},{key:"_createFormatCatalogs",value:function(t,e){var r=this,n=OJ.markerLayers;return t.map(function(t){var i,o=t.id,a=t.title,s=void 0===a?o:a,u=t.type,l=t.visible,c=t.children,f=t.parts;if("group"===t.type)i={children:r._createFormatCatalogs(c,e),id:o,title:s,type:u,visible:l};else{var h=e.find(function(t){return t.id===o});i=r._formatLayer({dataSource:h.dataSource,id:o,type:h.type,title:s,visible:h.visible,renderSource:h.renderSource,renderLayers:r._getRenderLayers(f,o),themeSetting:h.themeSetting}),n[o]&&(i.l7MarkerLayer=n[o])}return i})}},{key:"_collectChildrenKey",value:function(t,e){var r,n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=rMt(t);try{var a=function(){var t=r.value;if("group"===t.type)return n._collectChildrenKey(t.children,e,i),1;e.forEach(function(e){if(e in t){var r=t[e];r instanceof Array?i.push.apply(i,eMt(r)):i.push(r)}})};for(o.s();!(r=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}return i}},{key:"_getRenderLayers",value:function(t,e){return t?t.includes(e)?t:[e].concat(eMt(t)):[e]}},{key:"_formatLayer",value:function(t){var e=t.dataSource,r=void 0===e?{}:e,n=t.id,i=t.title,o=t.type,a=t.visible,s=void 0===a||a,u=t.renderSource,l=void 0===u?{}:u,c=t.renderLayers,f=void 0===c?[]:c,h=t.themeSetting;return{dataSource:r,id:n,title:i,type:o,visible:s,renderSource:l,renderLayers:f,themeSetting:void 0===h?{}:h}}},{key:"_parseRendererStyleData",value:function(t){return t instanceof Array?t:[t]}},{key:"_getLabelFontFamily",value:function(){var t=[],e=this._mapInfo.layers;return e&&e.length>0&&e.forEach(function(e){var r=e.layout&&e.layout["text-font"]||[];t.push.apply(t,eMt(r))}),t.join(",")}},{key:"_getSpriteDatas",value:function(){var t=this,e=this._sprite;if(e){if("string"==typeof e){var r=e.replace(/.+(web\/maps\/.+)/,"".concat(this.options.server,"$1"));return ut.get(r,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()}).then(function(e){t._spriteDatas=e})}this._spriteDatas=e}}},{key:"_createLegendInfo",value:function(){var t,e=this,r=this._mapResourceInfo.catalogs,n=void 0===r?[]:r,i=rMt(this._getLayerInfosFromCatalogs(n,"catalogType"));try{var o=function(){var r,n=t.value,i=(n.visualization||{}).renderer;if(!i)return 1;var o,a=e._mapInfo.layers.find(function(t){return t.id===n.id}),s=e._mapInfo.sources[a.source];"clusterField"in s&&(o=s.clusterField);var u=Object.assign({},a,{title:n.title,themeField:o}),l=e._parseRendererStyleData(i).reduce(function(t,r){var n=e._createLayerLegendList(u,r);return n&&t.push.apply(t,eMt(n)),t},[]);(r=e._legendList).push.apply(r,eMt(l))};for(i.s();!(t=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}}},{key:"_getAliasKey",value:function(t,e){return"isoline3D"===t&&"dashArray"===e?"lineDasharray":e}},{key:"_transStyleKeys",value:function(t,e){var r=this;return e.map(function(e){return r._getAliasKey(t,e)})}},{key:"_transStyleSetting",value:function(t,e){for(var r in e){var n=this._getAliasKey(t,r);n!==r&&(e[n]=e[r])}}},{key:"_getLegendSimpleStyle",value:function(t,e){var r={};e&&e.filter(function(e){return t[e]&&"simple"===t[e].type}).forEach(function(e){("outlineColor"!==e||(t.antialias||{}).value)&&(r[e]=(t[e]||{}).value)});return r}},{key:"_getLegendRenderType",value:function(t){switch(t){case"circle":case"symbol":case"column":return mMt.POINT;case"heatGrid":case"heatHexagon":case"heat3DGrid":case"heat3DHexagon":return mMt.BUILTINSYMBOL;case"line":case"isoline3D":return mMt.LINE;case"fill":return mMt.FILL;case"fillExtrusion":return mMt.FILLEXTRUSION;case"animatePoint":return mMt.ANIMATEPOINT;case"line3D":case"animateLine":return mMt.ANIMATELINE;case"radarPoint":return mMt.RADARPOINT}}},{key:"_getLegendShape",value:function(t,e){switch(t){case"circle":case"symbol":return bMt;case"column":return{cylinder:bMt,triangleColumn:TMt,squareColumn:wMt,hexagonColumn:kMt}[e.shape.value]||bMt;case"heatHexagon":case"heat3DHexagon":return kMt;case"line":case"isoline3D":return xMt;case"fill":case"heatGrid":case"heat3DGrid":case"fillExtrusion":return wMt;case"animatePoint":return _Mt;case"animateLine":case"line3D":return SMt;case"radarPoint":return EMt;case"heat":case"heat3D":return CMt}}},{key:"_isShowLegendSingleItem",value:function(t,e){return 0===t.length||1===t.length&&"color"===t[0]&&e}},{key:"_isWebsymbolById",value:function(t){return["line-","polygon-","point-"].some(function(e){return t&&t.startsWith(e)})}},{key:"_getSymbolSDFStatus",value:function(t,e){return!this._isWebsymbolById(t)&&(!!this._getIconById(t)||(e[t]&&e[t].sdf||!1))}},{key:"_isAllPicturePoint",value:function(t,e){var r=this;return"simple"===t.type?!this._getSymbolSDFStatus(t.value.symbolId,e):[].concat(eMt(t.values),[{value:t.defaultValue}]).filter(function(t){return t.value.symbolId}).every(function(t){return!r._getSymbolSDFStatus(t.value.symbolId,e)})}},{key:"_isAllPictureSymbolSaved",value:function(t,e,r){var n=this;return!!e&&("point"===t?this._isAllPicturePoint(e,r):"simple"===e.type?!!this._getImageIdFromValue(e.value.style,NMt[t]).length:e.values.map(function(t){return t.value}).concat(e.defaultValue).every(function(e){return!!n._getImageIdFromValue(e.style,NMt[t]).length}))}},{key:"_createLayerLegendList",value:function(t,e){var r=this,n=t.id,i=t.title,o={themeField:t.themeField||e.field,layerId:n,layerTitle:i},a=e.type||t.type,s=this._getLegendRenderType(a),u=this._getLegendShape(a,e);if(["heat","heat3D"].includes(a)){var l=this._heatColorToGradient((t.paint||{})[{heat:"heatmap-color",heat3D:"heatmap-extrusion-color"}[a]]);return[lMt(lMt({},o),{},{styleGroup:[{style:{type:BMt,shape:u,colors:l}}]})]}var c=PMt[s];if(c){var f=this._transStyleKeys(a,c);this._transStyleSetting(a,e);var h=this._getLegendSimpleStyle(e,f),p=this._parseLegendtyle({legendRenderType:s,customValue:h}),d=f.filter(function(t){return e[t]&&"simple"!==e[t].type});if(s===mMt.ANIMATELINE){var y="replace"===e.textureBlend.value,v=!(!e.symbolsContent.value||!e.symbolsContent.value.symbolId);y&&v&&(d=d.filter(function(t){return"color"!==t}))}else{var g=RMt[t.type];this._isAllPictureSymbolSaved(g,e.symbolsContent,this._spriteDatas)&&(d=d.filter(function(t){return"color"!==t}))}var m=e.color.interpolateInfo&&"linear"===e.color.interpolateInfo.type,b=[];return this._isShowLegendSingleItem(d,m)&&b.push(lMt(lMt({},o),{},{styleGroup:[{fieldValue:i||n,style:lMt(lMt({},p),{},{shape:u})}]})),b.concat(d.map(function(t){var n=e[t],i=r._getSettingStyle(t,n.defaultValue,h),a=[],l=r._getSettingCustom(n),c=r._getSettingInterpolateInfo(n),f={legendRenderType:s,styleField:t,subStyleSetting:n,simpleStyle:h,defaultSetting:i,custom:l,interpolateInfo:c,shape:u};switch(r._getLegendStyleType({styleField:t,currentType:n.type,custom:l,interpolateInfo:c})){case IMt:a=r._parseLinearStyle(f);break;case jMt:a=r._parseRangeStyle(f);break;case LMt:a=r._parseUniqueStyle(f)}return lMt(lMt({},o),{},{themeField:(n.field||[])[0],styleField:t,styleGroup:a})}))}}},{key:"_heatColorToGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return t.forEach(function(r,n){n>5&&n%2==0&&e.push({value:r,key:6===n?0:t[n-1]})}),e}},{key:"_getSettingCustom",value:function(t){var e=t.value,r=t.values;return this._isLinear(t)?e:r}},{key:"_getSettingInterpolateInfo",value:function(t){var e=t.interpolateInfo,r=void 0===e?{}:e;return this._isLinear(t)?{type:"linear"}:r}},{key:"_isLinear",value:function(t){return"linear"===t.type}},{key:"_getLegendStyleType",value:function(t){var e=t.styleField,r=t.currentType,n=t.custom,i=t.interpolateInfo;return["unique","linear"].includes(r)?this._isColorAttr(e)&&"linear"===i.type&&n.length>1?IMt:LMt:jMt}},{key:"_isColorAttr",value:function(t){return["color","textColor","outlineColor","textHaloColor"].includes(t)}},{key:"_parseLinearStyle",value:function(t){var e=t.shape,r=t.custom;return[{styleField:null,style:{type:BMt,shape:e,colors:r}}]}},{key:"_parseUniqueStyle",value:function(t){var e=this,r=t.legendRenderType,n=t.styleField,i=t.simpleStyle,o=t.defaultSetting,a=t.custom,s=t.interpolateInfo,u=t.shape,l=a.map(function(t){var o=e._getSettingStyle(n,t.value,i),a=e._parseLegendtyle({legendRenderType:r,customValue:o});return{fieldValue:t.key,style:lMt(lMt({},a),{},{shape:u})}});if(!s.type||"custom"===s.type){var c=this._parseLegendtyle({legendRenderType:r,customValue:o});l.push({fieldValue:null,style:lMt(lMt({},c),{},{shape:u})})}return l}},{key:"_parseRangeStyle",value:function(t){var e=this,r=t.legendRenderType,n=t.styleField,i=t.simpleStyle,o=t.defaultSetting,a=t.custom,s=t.shape,u=a.map(function(t){var o=e._getSettingStyle(n,t.value,i),a=e._parseLegendtyle({legendRenderType:r,customValue:o});return{start:t.start,end:t.end,style:lMt(lMt({},a),{},{shape:s})}}),l=this._parseLegendtyle({legendRenderType:r,customValue:o});return u.push({start:null,end:null,style:lMt(lMt({},l),{},{shape:s})}),u}},{key:"_getSettingStyle",value:function(t,e,r){var n=Object.assign({},r);return n[t]=e,n}},{key:"_parseLegendtyle",value:function(t){var e=this,r=t.legendRenderType,n=t.customValue,i=lMt({},AMt[r]);Object.keys(i).forEach(function(t){var e=n[OMt[t]||t];([mMt.FILL,mMt.FILLEXTRUSION].includes(r)||e)&&(i[t]=e)});var o=n.symbolsContent||{},a=o.symbolId,s=void 0===a?MMt[r]:a,u=o.style;switch(r){case mMt.POINT:return"BASE"===(this._getIconById(s)?"BASE":"SERVICE")?lMt({type:BMt},i):this._getSpriteStyle(s,i);case mMt.BUILTINSYMBOL:return lMt({type:BMt},i);case mMt.ANIMATEPOINT:case mMt.RADARPOINT:return lMt({type:BMt},i);case mMt.LINE:case mMt.ANIMATELINE:u=u||[];var l=Object.assign({},n);delete l.symbolsContent;var c=lMt(lMt({type:BMt},l),{},{width:100}),f=lMt({},AMt.LINE),h=u instanceof Array?u:[u],p=h.some(function(t){return!!e._getImageIdByLegendType(t,r)}),d=h[0];if(p){var y=this._getImageIdByLegendType(d,r),v=lMt(lMt(lMt({},i),l),{},{height:i.width,width:100});return r===mMt.ANIMATELINE&&"replace"===l.textureBlend&&(v.backgroundColor="transparent"),this._getSpriteStyle(y,v)}if(!n.symbolsContent||r===mMt.ANIMATELINE&&!p)return lMt(lMt({},c),{},{height:n.width||f.height,lineWidth:n.width||f.width,color:n.color||f.backgroundColor});if(n.symbolsContent){var g=this._getLineWidth(h),m=h.map(function(t){return e._transformLineStyle({oldWidth:g,symbol:t,defaultStyle:f,customValue:n})});return lMt(lMt({},c),{},{lineStyles:m})}return;case mMt.FILL:case mMt.FILLEXTRUSION:var b=i.backgroundColor,x=((u||{}).paint||{})["fill-color"],w=lMt({},AMt.FILL);return b||Object.assign(i,{backgroundColor:x}),Object.keys(i).forEach(function(t){["backgroundColor","width","height","opacity"].includes(t)&&!i[t]&&(i[t]=w[t])}),i.outlineColor&&Object.assign(i,{outline:w.outline,marginLeft:"1px"}),this._spriteDatas[s]?this._getSpriteStyle(s,lMt(lMt({},i),{},{backgroundColor:"transparent"})):lMt({type:BMt},i)}}},{key:"_getIconById",value:function(t){if("image"!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"svg")){return[{id:"circle",name:"circle"}].find(function(e){return e.id===t})}}},{key:"_getImageIdFromValue",value:function(t,e){var r=Array.isArray(t)?t:[t],n={symbol:"icon-image",line:"line-pattern",fill:"fill-pattern","fill-extrusion":"fill-pattern"}[e];return"symbol"===e?r.map(function(t){return t.layout&&t.layout[n]}).filter(function(t){return t}):r.map(function(t){return t.paint&&t.paint[n]}).filter(function(t){return t})}},{key:"_getImageIdByLegendType",value:function(t,e){var r={ANIMATELINE:NMt.point,LINE:NMt.line}[e],n=t.paint||{};return r===NMt.line?n["line-pattern"]:r===NMt.polygon?n["fill-pattern"]:(t.layout||{})["icon-image"]}},{key:"_getSpriteStyle",value:function(t,e){if(this._spriteDatas[t]){var r=this._spriteDatas[t];if(r.width&&r.height)return lMt(lMt({type:DMt,sprite:r},e),{},{url:"string"==typeof this._sprite?"".concat(this._sprite,".png"):""})}}},{key:"_transformLineStyle",value:function(t){var e,r=t.oldWidth,n=t.symbol,i=t.defaultStyle,o=t.customValue,a=n.paint,s=void 0===a?{}:a;return void 0!==o.height&&(e=this._updateSingleStyleByWidth(r,o.height,n)),{lineWidth:((e||{}).paint||{})["line-width"]||s["line-width"]||i.height,opacity:o.opacity||s["line-opacity"]||i.opacity,color:o.color||s["line-color"]||i.backgroundColor,lineDash:s["line-dasharray"]||[],lineOffset:s["line-offset"]||0}}},{key:"_updateSingleStyleByWidth",value:function(t,e,r){if(t===e)return r;var n=(r||{}).paint||{};if(0===t)return{paint:Object.assign({},n,{"line-width":Number(e.toFixed(2))})};var i=e/t,o=n["line-width"],a=n["line-offset"]||0,s=n["line-dasharray"]||[],u=this._updateDash(s,i);return{paint:Object.assign({},n,{"line-width":Number((o*i).toFixed(2)),"line-offset":Number((a*i).toFixed(2)),"line-dasharray":u&&u.map(function(t){return Number(t.toFixed(2))})})}}},{key:"_updateDash",value:function(t,e){if(t&&0!==t.length)return t.map(function(t){return t/e})}},{key:"_getLineWidth",value:function(t){return t instanceof Array?this._getWholeWidth(t):(t.paint||{})["line-width"]||0}},{key:"_getWholeWidth",value:function(t){var e,r;return t.forEach(function(t){var n=(t||{}).paint||{},i=n["line-width"],o=n["line-offset"]||0,a=o+i/2,s=o-i/2;(a>e||void 0===e)&&(e=a),(s1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=VMt(this,e)).mapId=t,r.options=Object.assign({},n),r.options.server=r._formatServerUrl(n.server),r.options.target=n.target||"map",r.options.withCredentials=n.withCredentials||!1,r.mapOptions=i,r._createWebMap(),r}var r,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&WMt(t,e)}(e,O().Evented),r=e,(n=[{key:"resize",value:function(){this.map.resize()}},{key:"setMapId",value:function(t){this.mapId=t,this._createWebMap()}},{key:"setWebMapOptions",value:function(t){var e=this._formatServerUrl(t.server);this.options.server=e,this._createWebMap()}},{key:"setMapOptions",value:function(t){var e=t.center,r=t.zoom,n=t.maxBounds,i=t.minZoom,o=t.maxZoom,a=t.isWorldCopy,s=t.bearing,u=t.pitch;e&&e.length&&this.map.setCenter(e),r&&this.map.setZoom(r),n&&this.map.setMaxBounds(n),i&&this.map.setMinZoom(i),o&&this.map.setMaxZoom(o),a&&this.map.setRenderWorldCopies(a),s&&this.map.setBearing(s),u&&this.map.setPitch(u)}},{key:"_createWebMap",value:function(){var t=gi.transformUrl(Object.assign({url:"".concat(this.options.server,"web/maps/").concat(this.mapId,"/map")},this.options));this._getMapInfo(t)}},{key:"_formatServerUrl",value:function(t){var e=t.split("");return"/"!==e[e.length-1]&&(t+="/"),t}},{key:"_getMapInfo",value:function(t){var e=this;ut.get(t,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()}).then(function(t){e.webMapInstance=e._initMap(t),e._registerWebMapEvents(),e.webMapInstance.initializeMap(t)}).catch(function(t){e.fire("getmapfailed",{error:t})})}},{key:"_initMap",value:function(t){var e=new(this._getMapFactory(t.version))(this.mapId,this.options,this.mapOptions);return e.setEventedParent(this),e}},{key:"_getMapFactory",value:function(t){return this._isWebMapV3(t)?FMt:tMt}},{key:"_registerWebMapEvents",value:function(){var t=this;this.webMapInstance&&(this.webMapInstance.on("mapinitialized",function(){t.map=t.webMapInstance.map}),this.webMapInstance.on("addlayerssucceeded",function(e){var r=e.mapparams;t.mapParams=r}))}},{key:"_getWebMapInstance",value:function(){return this.webMapInstance}},{key:"_isWebMapV3",value:function(t){return t.startsWith("3.")}}])&&UMt(r.prototype,n),i&&UMt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function YMt(t){"@babel/helpers - typeof";return(YMt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function XMt(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:22,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=[],i=Math.abs(t.left-t.right)/r,o=0;oMath.abs(t-e[i])&&(r=Math.abs(t-e[i]),n=i);return n}(uf(r,n,i),o)}function $Mt(t){"@babel/helpers - typeof";return($Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tIt(){tIt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==$Mt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function eIt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function rIt(t){for(var e=1;e=1&&(this.beforeLayerId=t.getStyle().layers[0].id),t.addLayer({id:this.id,type:"raster",source:this.id},this.beforeLayerId),this.map.fitBounds([e[1],e[3]]),this._afterAddVideoLayer()}}},{key:"_afterAddVideoLayer",value:function(){this.fire("loaded",{originCoordsRightBottom:this.originCoordsRightBottom,originCoordsLeftTop:this.originCoordsLeftTop,videoWidth:this.videoWidth,videoHeight:this.videoHeight})}},{key:"_calcCoords",value:function(t){var e=this,r=t.width,n=t.height,i=t.videoHeight,o=t.videoWidth||this.videoWidth,a=i||this.videoHeight,s=o/r,u=a/n,l=Math.min(s,u),c=r/2,f=n/2,h=o/l/2,p=a/l/2,d=[[c-h,f-p],[c+h,f-p],[c+h,f+p],[c-h,f+p]].map(function(t){return e.map.unproject(t)});return this.originCoordsLeftTop=d[0],this.originCoordsRightBottom=d[2],d}},{key:"play",value:function(){this.video.play()}},{key:"pause",value:function(){this.video.pause()}},{key:"remove",value:function(){this.id&&(this.map.removeLayer(this.id),this.map.removeSource(this.id),document.body.removeChild(document.getElementById(this.id)))}}])&&pIt(r.prototype,n),i&&pIt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();function bIt(t){return function(t){if(Array.isArray(t))return xIt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return xIt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xIt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xIt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},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 i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function LIt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function jIt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function NIt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=new KMt(ktt,t,e);return r.getMapInfo((n=oIt(tIt().mark(function n(i,o,a){var s,u,l,c,f,h;return tIt().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"processCompleted"!==i.type){n.next=15;break}if(s=i.result,u=s.dynamicProjection,l=s.prjCoordSys,c=l.epsgCode,!JMt(l.type)){n.next=6;break}return a(new Error("mapbox-gl cannot support plane coordinate system.")),n.abrupt("return");case 6:if(3857===c||u||O().CRS){n.next=9;break}return a(new Error("The EPSG code ".concat(c," needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362"))),n.abrupt("return");case 9:return n.next=11,cIt(t,i.result,rIt(rIt({},e),{},{initMapService:r}));case 11:return f=n.sent,(h=new(O().Map)(f)).loaded()?o({map:h}):h.on("load",function(){o({map:h})}),n.abrupt("return");case 15:a(new Error("Fetch mapService is failed.")),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(0),a(n.t0);case 21:case"end":return n.stop()}},n,null,[[0,18]])})),function(t,e,r){return n.apply(this,arguments)}));var n},O().supermap.WebMapV3=FMt,O().supermap.Graphic=nQ,O().supermap.map.getDefaultVectorTileStyle=function(t,e){e=e||{};var r={};r.version=e.version||8,r.layers=e.layers||[],r.light=e.light||{anchor:"viewport",color:"#fcf6ef",intensity:.5,position:[1.15,201,20]};var n={version:r.version,sources:{"vector-tiles":{type:"vector",tiles:[t]}},layers:r.layers,light:r.light};return null!=e.sprite&&(n.sprite=e.sprite),null!=e.glyphs&&(n.glyphs=e.glyphs),n},O().supermap.map.setBackground=function(t,e){e&&t&&t.addLayer({id:"background",type:"background",paint:{"background-color":e}},"background")},O().supermap.map.setPaintProperty=function(t,e,r,n,i,o){if(e&&t){"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);for(var a=0;a=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),g}},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 i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t){return(a="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":s(t)})(t)}function u(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function l(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){u(o,n,i,a,s,"next",t)}function s(t){u(o,n,i,a,s,"throw",t)}a(void 0)})}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var r=0;r=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t){var e=g();return function(){var r,n=y(t);if(e){var i=y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"==s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return w(t)}(this,r)}}function S(){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||T(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||T(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){if(t){if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function A(t){var e=function(t,e){if("object"!=s(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==s(e)?e:String(e)}function P(t,e,r,n){r&&Object.defineProperty(t,e,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function M(t,e,r,n,i){var o={};return Object.keys(n).forEach(function(t){o[t]=n[t]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(t,e,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var I,L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function j(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function N(t,e){return t(e={exports:{}},e.exports),e.exports}!function(t){!function(e){var r="object"==s(L)?L:"object"==("undefined"==typeof self?"undefined":s(self))?self:"object"==s(this)?this:Function("return this;")(),n=i(t);function i(t,e){return function(r,n){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0===r.Reflect?r.Reflect=t:n=i(r.Reflect,n),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!o&&!a,l={create:o?function(){return I(Object.create(null))}:a?function(){return I({__proto__:null})}:function(){return I({})},has:u?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:u?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),f="object"==("undefined"==typeof process?"undefined":s(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=f||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i=0;--r){var n=(0,t[r])(e);if(!w(n)&&!_(n)){if(!C(n))throw new TypeError;e=n}}return e}(t,e)}if(!k(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(n)&&!w(n)&&!_(n))throw new TypeError;return _(n)&&(n=void 0),function(t,e,r,n){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,r,n);if(!w(o)&&!_(o)){if(!S(o))throw new TypeError;n=o}}return n}(t,e,r=E(r),n)}),t("metadata",function(t,e){return function(r,n){if(!S(r))throw new TypeError;if(!w(n)&&!function(t){switch(x(n)){case 3:case 4:return!0;default:return!1}}())throw new TypeError;m(t,e,r,n)}}),t("defineMetadata",function(t,e,r,n){if(!S(r))throw new TypeError;return w(n)||(n=E(n)),m(t,e,r,n)}),t("hasMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),function t(e,r,n){if(v(e,r,n))return!0;var i=M(r);return!_(i)&&t(e,i,n)}(t,e,r)}),t("hasOwnMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),v(t,e,r)}),t("getMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),function t(e,r,n){if(v(e,r,n))return g(e,r,n);var i=M(r);return _(i)?void 0:t(e,i,n)}(t,e,r)}),t("getOwnMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),g(t,e,r)}),t("getMetadataKeys",function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=E(e)),function t(e,r){var n=b(e,r),i=M(e);if(null===i)return n;var o=t(i,r);if(o.length<=0)return n;if(n.length<=0)return o;for(var a=new p,s=[],u=0,l=n;u0)return!0;var i=d.get(e);return i.delete(r),i.size>0||d.delete(e),!0})}(n)}()}(I||(I={}));var R=N(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new function(t,e,r){this.fn=t,this.context=e,this.once=r||!1}(n,i||t,o),s=r?r+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],a]:t._events[s].push(a):(t._events[s]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e0,p=f.length>n.length,d=function(t,e,r,n,o){for(var a=[],s=0;s0?u:t(e,i)}return 0}});j(tt),tt.getFunctionName,tt.getBaseClassDependencyCount,tt.getDependencies;var et=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=function(){function t(t,e,r,n,i){this.id=z.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=r,this.target=i,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===r?new Map:null}return t.prototype.addChildRequest=function(e,r,n){var i=new t(e,this.parentContext,this,r,n);return this.childRequests.push(i),i},t}();e.Request=r});j(et),et.Request;var rt=N(function(t,e){function r(t){return t._bindingDictionary}function n(t,e,r,n,o){var a,s=i(r.container,o.serviceIdentifier);return s.length===H.BindingCount.NoBindingsAvailable&&r.container.options.autoBindInjectable&&"function"==typeof o.serviceIdentifier&&t.getConstructorMetadata(o.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(o.serviceIdentifier).toSelf(),s=i(r.container,o.serviceIdentifier)),a=e?s:s.filter(function(t){var e=new et.Request(t.serviceIdentifier,r,n,t,o);return t.constraint(e)}),function(t,e,r,n){switch(e.length){case H.BindingCount.NoBindingsAvailable:if(r.isOptional())return e;var o=q.getServiceIdentifierAsString(t),a=G.NOT_REGISTERED;throw a+=q.listMetadataForTarget(o,r),a+=q.listRegisteredBindingsForServiceIdentifier(n,o,i),new Error(a);case H.BindingCount.OnlyOneBindingAvailable:if(!r.isArray())return e;case H.BindingCount.MultipleBindingsAvailable:default:if(r.isArray())return e;throw o=q.getServiceIdentifierAsString(t),a=G.AMBIGUOUS_MATCH+" "+o,a+=q.listRegisteredBindingsForServiceIdentifier(n,o,i),new Error(a)}}(o.serviceIdentifier,a,o,r.container),a}function i(t,e){var n=[],o=r(t);return o.hasKey(e)?n=o.get(e):null!==t.parent&&(n=i(t.parent,e)),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=r,e.plan=function(t,e,r,i,o,a,s,u){void 0===u&&(u=!1);var l=new Y.Context(e),c=function(t,e,r,n,i,o){var a=t?B.MULTI_INJECT_TAG:B.INJECT_TAG,s=new X.Metadata(a,r),u=new $.Target(e,n,r,s);if(void 0!==i){var l=new X.Metadata(i,o);u.metadata.push(l)}return u}(r,i,o,"",a,s);try{return function t(e,r,i,o,a,s){var u,l;if(null===a){u=n(e,r,o,null,s),l=new et.Request(i,o,null,u,s);var c=new Z.Plan(o,l);o.addPlan(c)}else u=n(e,r,o,a,s),l=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach(function(r){var n=null;if(s.isArray())n=l.addChildRequest(r.serviceIdentifier,r,s);else{if(r.cache)return;n=l}if(r.type===F.BindingTypeEnum.Instance&&null!==r.implementationType){var i=tt.getDependencies(e,r.implementationType);if(!o.container.options.skipBaseClassChecks){var a=tt.getBaseClassDependencyCount(e,r.implementationType);if(i.length0?(o=e.filter(function(t){return null!==t.target&&t.target.type===F.TargetTypeEnum.ConstructorArgument}).map(n),a=function(t,e,r){var n=e.filter(function(t){return null!==t.target&&t.target.type===F.TargetTypeEnum.ClassProperty}),i=n.map(r);return n.forEach(function(e,r){var n;n=e.target.name.value();var o=i[r];t[n]=o}),t}(a=new((i=t).bind.apply(i,r([void 0],o))),e,n)):a=new t;return function(t,e){if(Reflect.hasMetadata(B.POST_CONSTRUCT,t)){var r=Reflect.getMetadata(B.POST_CONSTRUCT,t);try{e[r.value]()}catch(e){throw new Error(G.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,a),a}});j(nt),nt.resolveInstance;var it=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=function t(e,r,n){try{return n()}catch(t){throw W.isStackOverflowExeption(t)?new Error(G.CIRCULAR_DEPENDENCY_IN_FACTORY(e,r.toString())):t}};e.resolve=function(t){return function t(e){return function(n){n.parentContext.setCurrentRequest(n);var i=n.bindings,o=n.childRequests,a=n.target&&n.target.isArray(),s=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(a&&s)return o.map(function(r){return t(e)(r)});var u=null;if(!n.target.isOptional()||0!==i.length){var l=i[0],c=l.scope===F.BindingScopeEnum.Singleton,f=l.scope===F.BindingScopeEnum.Request;if(c&&l.activated)return l.cache;if(f&&null!==e&&e.has(l.id))return e.get(l.id);if(l.type===F.BindingTypeEnum.ConstantValue)u=l.cache,l.activated=!0;else if(l.type===F.BindingTypeEnum.Function)u=l.cache,l.activated=!0;else if(l.type===F.BindingTypeEnum.Constructor)u=l.implementationType;else if(l.type===F.BindingTypeEnum.DynamicValue&&null!==l.dynamicValue)u=r("toDynamicValue",l.serviceIdentifier,function(){return l.dynamicValue(n.parentContext)});else if(l.type===F.BindingTypeEnum.Factory&&null!==l.factory)u=r("toFactory",l.serviceIdentifier,function(){return l.factory(n.parentContext)});else if(l.type===F.BindingTypeEnum.Provider&&null!==l.provider)u=r("toProvider",l.serviceIdentifier,function(){return l.provider(n.parentContext)});else{if(l.type!==F.BindingTypeEnum.Instance||null===l.implementationType){var h=q.getServiceIdentifierAsString(n.serviceIdentifier);throw new Error(G.INVALID_BINDING_TYPE+" "+h)}u=nt.resolveInstance(l.implementationType,o,t(e))}return"function"==typeof l.onActivation&&(u=l.onActivation(n.parentContext,u)),c&&(l.cache=u,l.activated=!0),f&&null!==e&&!e.has(l.id)&&e.set(l.id,u),u}}}(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}});j(it),it.resolve;var ot=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;e.traverseAncerstors=function t(e,r){var n=e.parentRequest;return null!==n&&(!!r(n)||t(n,r))};var r=function(t){return function(e){var r=function(r){return null!==r&&null!==r.target&&r.target.matchesTag(t)(e)};return r.metaData=new X.Metadata(t,e),r}};e.taggedConstraint=r;var n=r(B.NAMED_TAG);e.namedConstraint=n,e.typeConstraint=function(t){return function(e){var r=null;if(null!==e){if(r=e.bindings[0],"string"==typeof t)return r.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}}});j(ot),ot.typeConstraint,ot.namedConstraint,ot.taggedConstraint,ot.traverseAncerstors;var at=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=ot.namedConstraint(t),new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=ot.taggedConstraint(t)(e),new st.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return ot.typeConstraint(t)(e.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return ot.namedConstraint(t)(e.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(r){return ot.taggedConstraint(t)(e)(r.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,ot.typeConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,ot.typeConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,ot.namedConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,ot.namedConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(r){return ot.traverseAncerstors(r,ot.taggedConstraint(t)(e))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(r){return!ot.traverseAncerstors(r,ot.taggedConstraint(t)(e))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,t)},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,t)},new st.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=r});j(at),at.BindingWhenSyntax;var st=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new at.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=r});j(st),st.BindingOnSyntax;var ut=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new at.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new st.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=r});j(ut),ut.BindingWhenOnSyntax;var lt=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=F.BindingScopeEnum.Request,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=F.BindingScopeEnum.Transient,new ut.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=r});j(lt),lt.BindingInSyntax;var ct=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new at.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new st.BindingOnSyntax(this._binding),this._bindingInSyntax=new lt.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=r});j(ct),ct.BindingInWhenOnSyntax;var ft=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=F.BindingTypeEnum.Instance,this._binding.implementationType=t,new ct.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+G.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=F.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=F.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ct.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=F.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=F.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(G.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=F.BindingTypeEnum.Function,this._binding.scope=F.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=F.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=F.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue(function(e){return e.container.get(t)})},t}();e.BindingToSyntax=r});j(ft),ft.BindingToSyntax;var ht=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,r){var n=new t;return n.bindings=e,n.middleware=r,n},t}();e.ContainerSnapshot=r});j(ht),ht.ContainerSnapshot;var pt=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(G.NULL_ARGUMENT);if(null==e)throw new Error(G.NULL_ARGUMENT);var r=this._map.get(t);void 0!==r?(r.push(e),this._map.set(t,r)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(G.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(G.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(G.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(G.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach(function(r,n){var i=r.filter(function(e){return!t(e)});i.length>0?e._map.set(n,i):e._map.delete(n)})},t.prototype.hasKey=function(t){if(null==t)throw new Error(G.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach(function(t,r){t.forEach(function(t){return e.add(r,t.clone())})}),e},t.prototype.traverse=function(t){this._map.forEach(function(e,r){t(r,e)})},t}();e.Lookup=r});j(pt),pt.Lookup;var dt=N(function(t,e){var r=L&&L.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},n=L&&L.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&It[0]<4?1:+(It[0]+It[1])),!Lt&&de&&(!(It=de.match(/Edge\/(\d+)/))||It[1]>=74)&&(It=de.match(/Chrome\/(\d+)/))&&(Lt=+It[1]);var be=Lt,xe=Rt.String,we=!!Object.getOwnPropertySymbols&&!Dt(function(){var t=Symbol("symbol detection");return!xe(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&be&&be<41}),_e=we&&!Symbol.sham&&"symbol"==s(Symbol.iterator),Se=Object,Ee=_e?function(t){return"symbol"==s(t)}:function(t){var e=he("Symbol");return le(e)&&pe(e.prototype,Se(t))},ke=String,Te=function(t){try{return ke(t)}catch(t){return"Object"}},Ce=TypeError,Oe=function(t){if(le(t))return t;throw new Ce(Te(t)+" is not a function")},Ae=function(t,e){var r=t[e];return re(r)?void 0:Oe(r)},Pe=TypeError,Me=Object.defineProperty,Ie=function(t,e){try{Me(Rt,t,{value:e,configurable:!0,writable:!0})}catch(r){Rt[t]=e}return e},Le=Rt["__core-js_shared__"]||Ie("__core-js_shared__",{}),je=N(function(t){(t.exports=function(t,e){return Le[t]||(Le[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.33.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),Ne=Object,Re=function(t){return Ne(ie(t))},De=Zt({}.hasOwnProperty),Be=Object.hasOwn||function(t,e){return De(Re(t),e)},Fe=0,ze=Math.random(),Ue=Zt(1..toString),Ge=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Ue(++Fe+ze,36)},Ve=Rt.Symbol,He=je("wks"),We=_e?Ve.for||Ve:Ve&&Ve.withoutSetter||Ge,qe=function(t){return Be(He,t)||(He[t]=we&&Be(Ve,t)?Ve[t]:We("Symbol."+t)),He[t]},Ye=TypeError,Xe=qe("toPrimitive"),Ze=function(t,e){if(!fe(t)||Ee(t))return t;var r,n=Ae(t,Xe);if(n){if(void 0===e&&(e="default"),r=Ut(n,t,e),!fe(r)||Ee(r))return r;throw new Ye("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&le(r=t.toString)&&!fe(n=Ut(r,t)))return n;if(le(r=t.valueOf)&&!fe(n=Ut(r,t)))return n;if("string"!==e&&le(r=t.toString)&&!fe(n=Ut(r,t)))return n;throw new Pe("Can't convert object to primitive value")}(t,e)},Ke=function(t){var e=Ze(t,"string");return Ee(e)?e:e+""},Je=Rt.document,Qe=fe(Je)&&fe(Je.createElement),$e=function(t){return Qe?Je.createElement(t):{}},tr=!Bt&&!Dt(function(){return 7!==Object.defineProperty($e("div"),"a",{get:function(){return 7}}).a}),er=Object.getOwnPropertyDescriptor,rr={f:Bt?er:function(t,e){if(t=oe(t),e=Ke(e),tr)try{return er(t,e)}catch(t){}if(Be(t,e))return Wt(!Ut(Ht.f,t,e),t[e])}},nr=Bt&&Dt(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),ir=String,or=TypeError,ar=function(t){if(fe(t))return t;throw new or(ir(t)+" is not an object")},sr=TypeError,ur=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,cr={f:Bt?nr?function(t,e,r){if(ar(t),e=Ke(e),ar(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=lr(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return ur(t,e,r)}:ur:function(t,e,r){if(ar(t),e=Ke(e),ar(r),tr)try{return ur(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new sr("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},fr=Bt?function(t,e,r){return cr.f(t,e,Wt(1,r))}:function(t,e,r){return t[e]=r,t},hr=Function.prototype,pr=Bt&&Object.getOwnPropertyDescriptor,dr=Be(hr,"name"),yr={EXISTS:dr,PROPER:dr&&"something"===function(){}.name,CONFIGURABLE:dr&&(!Bt||Bt&&pr(hr,"name").configurable)},vr=Zt(Function.toString);le(Le.inspectSource)||(Le.inspectSource=function(t){return vr(t)});var gr,mr,br,xr=Le.inspectSource,wr=Rt.WeakMap,_r=le(wr)&&/native code/.test(String(wr)),Sr=je("keys"),Er=function(t){return Sr[t]||(Sr[t]=Ge(t))},kr={},Tr=Rt.TypeError,Cr=Rt.WeakMap;if(_r||Le.state){var Or=Le.state||(Le.state=new Cr);Or.get=Or.get,Or.has=Or.has,Or.set=Or.set,gr=function(t,e){if(Or.has(t))throw new Tr("Object already initialized");return e.facade=t,Or.set(t,e),e},mr=function(t){return Or.get(t)||{}},br=function(t){return Or.has(t)}}else{var Ar=Er("state");kr[Ar]=!0,gr=function(t,e){if(Be(t,Ar))throw new Tr("Object already initialized");return e.facade=t,fr(t,Ar,e),e},mr=function(t){return Be(t,Ar)?t[Ar]:{}},br=function(t){return Be(t,Ar)}}var Pr={set:gr,get:mr,has:br,enforce:function(t){return br(t)?mr(t):gr(t,{})},getterFor:function(t){return function(e){var r;if(!fe(e)||(r=mr(e)).type!==t)throw new Tr("Incompatible receiver, "+t+" required");return r}}},Mr=N(function(t){var e=yr.CONFIGURABLE,r=Pr.enforce,n=Pr.get,i=String,o=Object.defineProperty,a=Zt("".slice),s=Zt("".replace),u=Zt([].join),l=Bt&&!Dt(function(){return 8!==o(function(){},"length",{value:8}).length}),c=String(String).split("String"),f=t.exports=function(t,n,f){"Symbol("===a(i(n),0,7)&&(n="["+s(i(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),f&&f.getter&&(n="get "+n),f&&f.setter&&(n="set "+n),(!Be(t,"name")||e&&t.name!==n)&&(Bt?o(t,"name",{value:n,configurable:!0}):t.name=n),l&&f&&Be(f,"arity")&&t.length!==f.arity&&o(t,"length",{value:f.arity});try{f&&Be(f,"constructor")&&f.constructor?Bt&&o(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var h=r(t);return Be(h,"source")||(h.source=u(c,"string"==typeof n?n:"")),t};Function.prototype.toString=f(function(){return le(this)&&n(this).source||xr(this)},"toString")}),Ir=function(t,e,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:e;if(le(r)&&Mr(r,o,n),n.global)i?t[e]=r:Ie(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:cr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Lr=Math.ceil,jr=Math.floor,Nr=Math.trunc||function(t){var e=+t;return(e>0?jr:Lr)(e)},Rr=function(t){var e=+t;return e!=e||0===e?0:Nr(e)},Dr=Math.max,Br=Math.min,Fr=function(t,e){var r=Rr(t);return r<0?Dr(r+e,0):Br(r,e)},zr=Math.min,Ur=function(t){return t>0?zr(Rr(t),9007199254740991):0},Gr=function(t){return Ur(t.length)},Vr=function(t){return function(e,r,n){var i,o=oe(e),a=Gr(o),s=Fr(n,a);if(t&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},Hr={includes:Vr(!0),indexOf:Vr(!1)},Wr=Hr.indexOf,qr=Zt([].push),Yr=function(t,e){var r,n=oe(t),i=0,o=[];for(r in n)!Be(kr,r)&&Be(n,r)&&qr(o,r);for(;e.length>i;)Be(n,r=e[i++])&&(~Wr(o,r)||qr(o,r));return o},Xr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zr=Xr.concat("length","prototype"),Kr={f:Object.getOwnPropertyNames||function(t){return Yr(t,Zr)}},Jr={f:Object.getOwnPropertySymbols},Qr=Zt([].concat),$r=he("Reflect","ownKeys")||function(t){var e=Kr.f(ar(t)),r=Jr.f;return r?Qr(e,r(t)):e},tn=function(t,e,r){for(var n=$r(e),i=cr.f,o=rr.f,a=0;aa;)cr.f(t,r=i[a++],n[r]);return t}},_n=he("document","documentElement"),Sn=Er("IE_PROTO"),En=function(){},kn=function(t){return"