@dooc-dev/dooc 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +35 -1
- package/dist/flow.global.js +1031 -1057
- package/dist/graph/{abnfDiagram-S7VZAUFO-ASBULSKE.js → abnfDiagram-S7VZAUFO-GAGCW2J5.js} +1 -1
- package/dist/graph/{architecture-WOLXFQ4H-V57EDXXY.js → architecture-WOLXFQ4H-AWAC3VBS.js} +1 -1
- package/dist/graph/{architectureDiagram-YGSQEFNW-GIMP347N.js → architectureDiagram-YGSQEFNW-WQ7QKSUJ.js} +1 -1
- package/dist/graph/{blockDiagram-APKKGZFW-RDL2T4JW.js → blockDiagram-APKKGZFW-H7ZNJMOM.js} +1 -1
- package/dist/graph/{bpmnIcons-APHXDYXF-TWOSQNUQ.js → bpmnIcons-APHXDYXF-EAVPNTFE.js} +1 -1
- package/dist/graph/{c4Diagram-KJ2TOQU5-75LIUC4F.js → c4Diagram-KJ2TOQU5-3IYS34YL.js} +1 -1
- package/dist/graph/{chunk-KU6GTEMS.js → chunk-3CJU2RDX.js} +1 -1
- package/dist/graph/{chunk-ISO77HML.js → chunk-5N2X2DXU.js} +1 -1
- package/dist/graph/{chunk-YCRLJT2S.js → chunk-67BPVAXC.js} +1 -1
- package/dist/graph/{chunk-26TUJSYJ.js → chunk-6CDZONCA.js} +1 -1
- package/dist/graph/{chunk-I3DMZIHV.js → chunk-7ASYMKN2.js} +1 -1
- package/dist/graph/{chunk-K2KLZU7M.js → chunk-7JQUFVT4.js} +2 -2
- package/dist/graph/{chunk-BBD5CEDC.js → chunk-7LSMJ4VU.js} +1 -1
- package/dist/graph/{chunk-EG5UVNOC.js → chunk-7UKJADAE.js} +1 -1
- package/dist/graph/{chunk-BZAMCJ6B.js → chunk-AARGNXTW.js} +1 -1
- package/dist/graph/{chunk-HOPPTA6H.js → chunk-BOXAA5AP.js} +2 -2
- package/dist/graph/{chunk-N3OHKGRZ.js → chunk-BTMPKSGF.js} +1 -1
- package/dist/graph/{chunk-QCJUF4YA.js → chunk-DIDARDST.js} +1 -1
- package/dist/graph/{chunk-R63JUMUK.js → chunk-EWYECPNJ.js} +1 -1
- package/dist/graph/{chunk-3YJHMOOA.js → chunk-FD7ZFC7R.js} +1 -1
- package/dist/graph/chunk-GWYODWCE.js +1 -0
- package/dist/graph/{chunk-IC23EEF6.js → chunk-HKRJKXEE.js} +1 -1
- package/dist/graph/{chunk-PW2RGZ3O.js → chunk-I5LEUF24.js} +1 -1
- package/dist/graph/{chunk-OFZLK5G4.js → chunk-ICJPOOXG.js} +1 -1
- package/dist/graph/{chunk-KT4VPQD5.js → chunk-IVZHB6RS.js} +2 -2
- package/dist/graph/{chunk-VM2H7G2R.js → chunk-JZGXHT3J.js} +1 -1
- package/dist/graph/{chunk-HJG2HUYJ.js → chunk-LSRL537V.js} +1 -1
- package/dist/graph/{chunk-C6J4A356.js → chunk-N44XPVUD.js} +1 -1
- package/dist/graph/{chunk-JD7ZBJD2.js → chunk-NDAMZVXQ.js} +1 -1
- package/dist/graph/{chunk-QEEA3KYY.js → chunk-QLS7NIYR.js} +1 -1
- package/dist/graph/{chunk-JRSH5GNS.js → chunk-QQIGL7OP.js} +1 -1
- package/dist/graph/chunk-SQE76S5B.js +1 -0
- package/dist/graph/{chunk-ZMCB7VP2.js → chunk-WQHTQAFY.js} +1 -1
- package/dist/graph/{classDiagram-v2-L25IHNXF-JL7LVDZH.js → classDiagram-v2-L25IHNXF-HNTCDTNK.js} +1 -1
- package/dist/graph/{cose-bilkent-JH36ORCC-PNM3EYPB.js → cose-bilkent-JH36ORCC-2GVA7XKO.js} +1 -1
- package/dist/graph/{cynefin-EF2NZ3EQ-PSXP3DXL.js → cynefin-EF2NZ3EQ-TCI65RAQ.js} +1 -1
- package/dist/graph/{cynefinDiagram-L36ESFBY-QVY54CXO.js → cynefinDiagram-L36ESFBY-OKQ5BLVF.js} +1 -1
- package/dist/graph/{dagre-SPEB5RXH-HPGQXBZJ.js → dagre-SPEB5RXH-KZEBD52K.js} +1 -1
- package/dist/graph/{diagram-3B7GL73J-DWH5WS2P.js → diagram-3B7GL73J-ESCBJM3O.js} +1 -1
- package/dist/graph/{diagram-DNEMPZML-TEGH2U5I.js → diagram-DNEMPZML-ZIBUSQZI.js} +1 -1
- package/dist/graph/{diagram-L3MUGCDN-X4MREUWR.js → diagram-L3MUGCDN-IGK62IPN.js} +1 -1
- package/dist/graph/{diagram-LA4NIPWU-NXT746HG.js → diagram-LA4NIPWU-2KZCOFJ5.js} +1 -1
- package/dist/graph/{diagram-MHCOC4E2-JGHXSAGS.js → diagram-MHCOC4E2-EYAAB236.js} +1 -1
- package/dist/graph/{diagram-XPFHEONP-ZHZPBLT4.js → diagram-XPFHEONP-OZ5ARGMG.js} +1 -1
- package/dist/graph/{ebnfDiagram-UZSYDL2S-SMF6KJ43.js → ebnfDiagram-UZSYDL2S-M3XJHARD.js} +1 -1
- package/dist/graph/{erDiagram-EYBAPDEH-B3JNJ357.js → erDiagram-EYBAPDEH-Y7KUBH7A.js} +1 -1
- package/dist/graph/{eventmodeling-K75KTNOO-WG6DDYMC.js → eventmodeling-K75KTNOO-ROLYRDEP.js} +1 -1
- package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
- package/dist/graph/{ganttDiagram-23REXITY-YXBYWFOJ.js → ganttDiagram-23REXITY-JSBTFSSJ.js} +1 -1
- package/dist/graph/{gitGraph-VSP46ZUC-VBFWJBBT.js → gitGraph-VSP46ZUC-ZCBCDVNF.js} +1 -1
- package/dist/graph/{gitGraphDiagram-STJD7YCW-4FZDCFGV.js → gitGraphDiagram-STJD7YCW-3ZA5FT3G.js} +1 -1
- package/dist/graph/{info-OHQRW6UA-ALVDUVYV.js → info-OHQRW6UA-JKJGOQNY.js} +1 -1
- package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
- package/dist/graph/{ishikawaDiagram-M35NCXHK-FRZD2PWQ.js → ishikawaDiagram-M35NCXHK-YLEU44DY.js} +1 -1
- package/dist/graph/{journeyDiagram-OPLOXDXO-7Z66JCPR.js → journeyDiagram-OPLOXDXO-ZHJV66ZT.js} +1 -1
- package/dist/graph/{kanban-definition-BZKZHSQY-NN5AIKTE.js → kanban-definition-BZKZHSQY-SDU25WUM.js} +1 -1
- package/dist/graph/{katex-DXDNVO6V.js → katex-WSLZOTY7.js} +1 -1
- package/dist/graph/{mindmap-definition-I2QAS2VK-HDPCABN2.js → mindmap-definition-I2QAS2VK-XQNBCYHN.js} +1 -1
- package/dist/graph/{packet-JDAUHWVQ-5MQIBWAH.js → packet-JDAUHWVQ-Y3H77ERD.js} +1 -1
- package/dist/graph/{pegDiagram-FD4XPPHP-H2BFNCKT.js → pegDiagram-FD4XPPHP-YO4VWH6V.js} +1 -1
- package/dist/graph/{pie-XZMESJXO-T5VRKHVT.js → pie-XZMESJXO-PRER4XL5.js} +1 -1
- package/dist/graph/{pieDiagram-J4AKIIQI-O3NJSVD3.js → pieDiagram-J4AKIIQI-TJ5WOOSV.js} +1 -1
- package/dist/graph/{quadrantDiagram-XTYBLID2-TMTZJI3P.js → quadrantDiagram-XTYBLID2-G6MSSZLW.js} +1 -1
- package/dist/graph/{radar-ABXABTNO-C6FXIBYW.js → radar-ABXABTNO-M6MV34GM.js} +1 -1
- package/dist/graph/{railroad-I3PHUGI6-ZSO5JXB3.js → railroad-I3PHUGI6-YIWPGN6Q.js} +1 -1
- package/dist/graph/{railroad-abnf-LNEFI6M7-CI4GQRHB.js → railroad-abnf-LNEFI6M7-7JHLZ2R7.js} +1 -1
- package/dist/graph/{railroad-ebnf-DWYD2UWJ-MUENNCGK.js → railroad-ebnf-DWYD2UWJ-V55BXEWY.js} +1 -1
- package/dist/graph/{railroad-peg-JR7BVNR7-N3X5GGIX.js → railroad-peg-JR7BVNR7-XCGKDRMK.js} +1 -1
- package/dist/graph/{railroadDiagram-MRQ6NCDL-JHWS23UO.js → railroadDiagram-MRQ6NCDL-RACSFXC4.js} +1 -1
- package/dist/graph/{requirementDiagram-Y7LWUY3S-7DVLPO4B.js → requirementDiagram-Y7LWUY3S-4LQIQWHQ.js} +1 -1
- package/dist/graph/{sankeyDiagram-WGJFYUXA-Z5L4R5TR.js → sankeyDiagram-WGJFYUXA-K3RXG5FB.js} +1 -1
- package/dist/graph/schema-graph-global.js +4 -4
- package/dist/graph/{sequenceDiagram-5NDRBG5M-RCTU25NT.js → sequenceDiagram-5NDRBG5M-Y6RBHRS3.js} +1 -1
- package/dist/graph/{sizeCapture-INFHLROL-RROY32P5.js → sizeCapture-INFHLROL-TJW3VUGH.js} +1 -1
- package/dist/graph/{stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js → stateDiagram-v2-FJ4FJNEA-4M5WZORG.js} +1 -1
- package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
- package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
- package/dist/graph/{timeline-definition-SEUHKTQE-ZQSMIVAS.js → timeline-definition-SEUHKTQE-IHISQ4Q7.js} +1 -1
- package/dist/graph/{treeView-D4JQ5SDB-42S7U73N.js → treeView-D4JQ5SDB-EVGY4VYS.js} +1 -1
- package/dist/graph/{treemap-SAJKECNS-RUBYQ7XF.js → treemap-SAJKECNS-LN3SMFRX.js} +1 -1
- package/dist/graph/{usecaseDiagram-AFA6YXN4-57RDRYXF.js → usecaseDiagram-AFA6YXN4-B645A3J6.js} +1 -1
- package/dist/graph/{vennDiagram-NNMJR3RB-5C3LVAV6.js → vennDiagram-NNMJR3RB-K3HWMON6.js} +1 -1
- package/dist/graph/{wardley-7MLQ67FV-NV5HXTTC.js → wardley-7MLQ67FV-RRWOELC6.js} +1 -1
- package/dist/graph/{wardleyDiagram-S7YFUSEH-6D5BKXHM.js → wardleyDiagram-S7YFUSEH-DMMWKJEK.js} +1 -1
- package/dist/graph/{xychartDiagram-GGNKY7IX-6ET3ZM67.js → xychartDiagram-GGNKY7IX-K6MUQVXR.js} +1 -1
- package/package.json +10 -2
- package/dist/graph/chunk-3RNHDNP5.js +0 -1
- package/dist/graph/chunk-5UUEAHTN.js +0 -1
- package/dist/graph/chunk-6T55RVVR.js +0 -1
- package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +0 -27
- package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +0 -1
- package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +0 -2
- package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +0 -1
- package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +0 -8
- /package/dist/graph/{chunk-GYT4IYBZ.js → chunk-RJFVWYCA.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as E}from"./chunk-K4I76XBX.js";import{b as _,c as G}from"./chunk-R63JUMUK.js";import{f as x,g as O,h as F,i as D,j as S,k as $,m as j,n as H}from"./chunk-K2KLZU7M.js";import{a as M,b as A,d as X,e as L}from"./chunk-JD7ZBJD2.js";import{a as B}from"./chunk-HOPPTA6H.js";import{q as P}from"./chunk-QEEA3KYY.js";import{$ as T,C as R}from"./chunk-KT4VPQD5.js";import{b as a}from"./chunk-JRSH5GNS.js";import{a as u}from"./chunk-GYT4IYBZ.js";function J(e,{edgePathsClass:n="edges edgePaths"}={}){let t=e.insert("g").attr("class","root"),s=t.insert("g").attr("class","clusters"),r=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:s,edgePaths:r,edgeLabels:i,nodes:c,rootGroups:t}}u(J,"createLayoutElementGroups");async function W(e,n,t){if(n.label){let{shapeSvg:s,bbox:r}=await B(e,t===void 0?n:{...n,width:t});n.labelBBox={width:r.width,height:r.height},s.remove()}else n.labelBBox={width:0,height:0}}u(W,"measureGroupLabel");async function V(e,n,t){let s=await A(e,n,t),r=s.node()?.getBBox()??{width:0,height:0};return n.width=r.width,n.height=r.height,s}u(V,"insertMeasuredNode");function Y(e,n,t){let s=e,r=new Set;for(;s;){if(s.dir)return s.dir;if(!s.parentId||r.has(s.parentId))break;r.add(s.parentId),s=n.get(s.parentId)}return t}u(Y,"resolveNodeDir");async function q(e,n,t={}){let s=new E({multigraph:!0,compound:!0}),r=[...n.edges],i=T(),c=J(e),{edgeLabels:d,nodes:o}=c,g=new Map,b=new Map(n.nodes.map(f=>[f.id,f])),N=n.direction,h=e.node()!=null;await Promise.all(n.nodes.map(async f=>{if(f.isGroup){if(h){let w=t.unwrapGroupLabels&&f.labelType!=="markdown";await W(o,f,w?Number.POSITIVE_INFINITY:void 0)}s.setNode(f.id,{...f})}else{if(h){let w=await V(o,f,{config:i,dir:Y(f,b,N)});g.set(f.id,w)}s.setNode(f.id,{...f})}}));for(let f of r)h&&D(f)&&await S(d,f),s.setEdge(f.start,f.end,{...f},f.id),n.edges.some(v=>v.id===f.id)||n.edges.push(f);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await import("./sizeCapture-INFHLROL-RROY32P5.js");f(e,n)}return{graph:s,groups:c,nodeElements:g}}u(q,"createGraphWithElements");var l=new Map,m=new Map,K=new Map,ge=u(()=>{m.clear(),K.clear(),l.clear()},"clear"),p=u((e,n)=>{let t=m.get(n)||[];return a.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),me=u((e,n)=>{let t=m.get(n)||[];return a.info("Descendants of ",n," is ",t),a.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||p(e.v,n)||p(e.w,n)||t.includes(e.w):(a.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),Q=u((e,n,t,s)=>{a.debug("Copying children of ",e,"root",s,"data",n.node(e),s);let r=n.children(e)||[];e!==s&&r.push(e),a.debug("Copying (nodes) clusterId",e,"nodes",r),r.forEach(i=>{if(n.children(i).length>0)Q(i,n,t,s);else{let c=n.node(i);a.info("cp ",i," to ",s," with parent ",e),t.setNode(i,c),s!==n.parent(i)&&(a.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==s&&i!==e?(a.debug("Setting parent",i,e),t.setParent(i,e)):(a.info("In copy ",e,"root",s,"data",n.node(e),s),a.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==s,"node!==clusterId",i!==e));let d=n.edges(i);a.debug("Copying Edges",d),d.forEach(o=>{a.info("Edge",o);let g=n.edge(o.v,o.w,o.name);a.info("Edge data",g,s);try{me(o,s)?(a.info("Copying as ",o.v,o.w,g,o.name),t.setEdge(o.v,o.w,g,o.name),a.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):a.info("Skipping copy of edge ",o.v,"-->",o.w," rootId: ",s," clusterId:",e)}catch(b){a.error(b)}})}a.debug("Removing node",i),n.removeNode(i)})},"copy"),U=u((e,n)=>{let t=n.children(e),s=[...t];for(let r of t)K.set(r,e),s=[...s,...U(r,n)];return s},"extractDescendants"),be=u((e,n,t)=>{let s=e.edges().filter(o=>o.v===n||o.w===n),r=e.edges().filter(o=>o.v===t||o.w===t),i=s.map(o=>({v:o.v===n?t:o.v,w:o.w===n?n:o.w})),c=r.map(o=>({v:o.v,w:o.w}));return i.filter(o=>c.some(g=>o.v===g.v&&o.w===g.w))},"findCommonEdges"),C=u((e,n,t)=>{let s=n.children(e);if(a.trace("Searching children of id ",e,s),s.length<1)return e;let r;for(let i of s){let c=C(i,n,t),d=be(n,t,c);if(c)if(d.length>0)r=c;else return c}return r},"findNonClusterChild"),z=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Se=u((e,n)=>{if(!e||n>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(a.debug("Cluster identified",t," Replacement id in edges: ",C(t,e,t)),m.set(t,U(t,e)),l.set(t,{id:C(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let s=e.children(t),r=e.edges();s.length>0?(a.debug("Cluster identified",t,m),r.forEach(i=>{let c=p(i.v,t),d=p(i.w,t);c^d&&(a.debug("Edge: ",i," leaves cluster ",t),a.debug("Descendants of XXX ",t,": ",m.get(t)),l.get(t).externalConnections=!0)})):a.debug("Not a cluster ",t,m)});for(let t of l.keys()){let s=l.get(t).id,r=e.parent(s);r!==t&&l.has(r)&&!l.get(r).externalConnections&&(l.get(t).id=r);let i=e.edges().some(c=>c.v===t);if(s&&l.get(t)?.externalConnections&&i&&ee(e,s,t)){let c=he(e,t,e.parent(s));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){let s=e.edge(t);a.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),a.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(a.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(a.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),r=z(t.v),i=z(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let c=e.parent(r);l.get(c).externalConnections=!0,s.fromCluster=t.v}if(i!==t.w){let c=e.parent(i);l.get(c).externalConnections=!0,s.toCluster=t.w}a.debug("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,s,t.name)}}),Z(e,0),a.trace(l)},"adjustClustersAndEdges"),Z=u((e,n)=>{if(n>10){a.error("Bailing out");return}let t=e.nodes(),s=!1;for(let r of t){let i=e.children(r);s=s||i.length>0}if(!s){a.debug("Done, no node has children",e.nodes());return}a.debug("Nodes = ",t,n);for(let r of t)if(a.debug("Extracting node",r,l,l.has(r)&&!l.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",n),!l.has(r))a.debug("Not a cluster",r,n);else if(!l.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){a.debug("Cluster without external connections, without a parent and with children",r,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(r)?.clusterData?.dir&&(c=l.get(r).clusterData.dir,a.debug("Fixing dir",l.get(r).clusterData.dir,c));let d=new E({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Q(r,e,d,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:l.get(r).clusterData,label:l.get(r).label,graph:d})}else a.debug("Cluster ** ",r," **not meeting the criteria !externalConnections:",!l.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),n),a.debug(l);t=e.nodes(),a.debug("New list of nodes",t);for(let r of t){let i=e.node(r);a.debug(" Now next level",r,i),i?.clusterNode&&Z(i.graph,n+1)}},"extractor"),I=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(s=>{let r=e.children(s),i=I(e,r);t=[...t,...i]}),t},"sorter"),ke=u(e=>I(e,e.children()),"sortNodesByHierarchy"),ee=u((e,n,t)=>{let s=e.parent(n);for(;s&&s!==t;){let r=l.get(s);if(r&&!r.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),he=u((e,n,t)=>{let s=e.children(n)??[];for(let r of s){if(r===t||p(r,t))continue;let i=C(r,e,n);if(i&&!ee(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:s,afterPaint:r,paintOptions:i}){let c=n??ne;return u(async function(o,g,b,N){let h=g.select("g");(b?.insertMarkers??H)(h,o.markers,o.type,o.diagramId),te();let f={element:h,helpers:b,options:N};f.preparedLayout=await e?.(o,f);let w=await c(o,f),v=await t(o,f),y={...f,measure:w};s?await s(o,y,v):await re(o,y,i),await r?.(o,y,v)},"render")}u(we,"createCommonLayoutRenderer");function te(){X(),F(),G(),ge()}u(te,"clearLayoutRenderState");async function ne(e,{element:n},t){return await q(n,e,t)}u(ne,"defaultMeasureLayout");async function re(e,n,t={}){let{measure:s}=n,{groups:r}=s;for(let c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await se(r,c,n,t);let i=oe(e.nodes);for(let c of e.edges)ae(c,t)||await ce(r,c,i,e,t,n)}u(re,"paintLayoutData");async function se(e,n,t,s){n.clusterNode?L(n):ie(n,t,s)?await _(e.clusters,n):L(n)}u(se,"paintLayoutNode");function ie(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(ie,"shouldPaintAsCluster");function oe(e){let n=new Map;for(let t of e)t?.id&&n.set(t.id,t);return n}u(oe,"buildNodeLookup");function ae(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(ae,"shouldSkipPaintEdge");async function ce(e,n,t,s,r,i){let c=j(e.edgePaths,{...n},r.clusterDb??new Map,s.type,k(n.start,n,t,i,r),k(n.end,n,t,i,r),s.diagramId,le(n,r),s.layoutAlgorithm);D(n)&&(x.has(n.id)||await S(e.edgeLabels,n),ue(n,c))}u(ce,"paintLayoutEdge");function k(e,n,t,s,r){return r.getEdgeNode?.(e,n,s)??(e?t.get(e)??{}:{})}u(k,"getRenderedNode");function le(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(le,"shouldSkipIntersect");function ue(e,n){let t=n?.updatedPath??n?.originalPath,s=R(),{subGraphTitleTotalMargin:r}=M({flowchart:s.flowchart??{}});if(e.label){let i=x.get(e.id),{x:c,y:d}=$(e,n);i.attr("transform",`translate(${c}, ${d+r/2})`)}for(let[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){let{x:d,y:o}=fe(e,i,t);O.get(e.id)[i].attr("transform",`translate(${d}, ${o})`)}}u(ue,"positionRenderedEdgeLabel");var pe={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function fe(e,n,t){let s=e.terminalLabelCenters?.[n];if(s)return{...s};if(!t)return{x:e.x,y:e.y};let r=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return P.calcTerminalLabelPosition(r?10:0,pe[n],t)}u(fe,"terminalLabelTranslate");export{J as a,V as b,l as c,C as d,Se as e,ke as f,we as g,ne as h};
|
|
1
|
+
import{C as E}from"./chunk-K4I76XBX.js";import{a as _,b as G}from"./chunk-EWYECPNJ.js";import{e as x,f as O,g as F,h as D,i as S,j as $,l as j,m as H}from"./chunk-7JQUFVT4.js";import{a as M,b as A,d as X,e as L}from"./chunk-NDAMZVXQ.js";import{a as B}from"./chunk-BOXAA5AP.js";import{q as P}from"./chunk-QLS7NIYR.js";import{$ as T,C as R}from"./chunk-IVZHB6RS.js";import{b as a}from"./chunk-QQIGL7OP.js";import{a as u}from"./chunk-RJFVWYCA.js";function J(e,{edgePathsClass:n="edges edgePaths"}={}){let t=e.insert("g").attr("class","root"),s=t.insert("g").attr("class","clusters"),r=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:s,edgePaths:r,edgeLabels:i,nodes:c,rootGroups:t}}u(J,"createLayoutElementGroups");async function W(e,n,t){if(n.label){let{shapeSvg:s,bbox:r}=await B(e,t===void 0?n:{...n,width:t});n.labelBBox={width:r.width,height:r.height},s.remove()}else n.labelBBox={width:0,height:0}}u(W,"measureGroupLabel");async function V(e,n,t){let s=await A(e,n,t),r=s.node()?.getBBox()??{width:0,height:0};return n.width=r.width,n.height=r.height,s}u(V,"insertMeasuredNode");function Y(e,n,t){let s=e,r=new Set;for(;s;){if(s.dir)return s.dir;if(!s.parentId||r.has(s.parentId))break;r.add(s.parentId),s=n.get(s.parentId)}return t}u(Y,"resolveNodeDir");async function q(e,n,t={}){let s=new E({multigraph:!0,compound:!0}),r=[...n.edges],i=T(),c=J(e),{edgeLabels:d,nodes:o}=c,g=new Map,b=new Map(n.nodes.map(f=>[f.id,f])),N=n.direction,h=e.node()!=null;await Promise.all(n.nodes.map(async f=>{if(f.isGroup){if(h){let w=t.unwrapGroupLabels&&f.labelType!=="markdown";await W(o,f,w?Number.POSITIVE_INFINITY:void 0)}s.setNode(f.id,{...f})}else{if(h){let w=await V(o,f,{config:i,dir:Y(f,b,N)});g.set(f.id,w)}s.setNode(f.id,{...f})}}));for(let f of r)h&&D(f)&&await S(d,f),s.setEdge(f.start,f.end,{...f},f.id),n.edges.some(v=>v.id===f.id)||n.edges.push(f);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await import("./sizeCapture-INFHLROL-TJW3VUGH.js");f(e,n)}return{graph:s,groups:c,nodeElements:g}}u(q,"createGraphWithElements");var l=new Map,m=new Map,K=new Map,ge=u(()=>{m.clear(),K.clear(),l.clear()},"clear"),p=u((e,n)=>{let t=m.get(n)||[];return a.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),me=u((e,n)=>{let t=m.get(n)||[];return a.info("Descendants of ",n," is ",t),a.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||p(e.v,n)||p(e.w,n)||t.includes(e.w):(a.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),Q=u((e,n,t,s)=>{a.debug("Copying children of ",e,"root",s,"data",n.node(e),s);let r=n.children(e)||[];e!==s&&r.push(e),a.debug("Copying (nodes) clusterId",e,"nodes",r),r.forEach(i=>{if(n.children(i).length>0)Q(i,n,t,s);else{let c=n.node(i);a.info("cp ",i," to ",s," with parent ",e),t.setNode(i,c),s!==n.parent(i)&&(a.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==s&&i!==e?(a.debug("Setting parent",i,e),t.setParent(i,e)):(a.info("In copy ",e,"root",s,"data",n.node(e),s),a.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==s,"node!==clusterId",i!==e));let d=n.edges(i);a.debug("Copying Edges",d),d.forEach(o=>{a.info("Edge",o);let g=n.edge(o.v,o.w,o.name);a.info("Edge data",g,s);try{me(o,s)?(a.info("Copying as ",o.v,o.w,g,o.name),t.setEdge(o.v,o.w,g,o.name),a.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):a.info("Skipping copy of edge ",o.v,"-->",o.w," rootId: ",s," clusterId:",e)}catch(b){a.error(b)}})}a.debug("Removing node",i),n.removeNode(i)})},"copy"),U=u((e,n)=>{let t=n.children(e),s=[...t];for(let r of t)K.set(r,e),s=[...s,...U(r,n)];return s},"extractDescendants"),be=u((e,n,t)=>{let s=e.edges().filter(o=>o.v===n||o.w===n),r=e.edges().filter(o=>o.v===t||o.w===t),i=s.map(o=>({v:o.v===n?t:o.v,w:o.w===n?n:o.w})),c=r.map(o=>({v:o.v,w:o.w}));return i.filter(o=>c.some(g=>o.v===g.v&&o.w===g.w))},"findCommonEdges"),C=u((e,n,t)=>{let s=n.children(e);if(a.trace("Searching children of id ",e,s),s.length<1)return e;let r;for(let i of s){let c=C(i,n,t),d=be(n,t,c);if(c)if(d.length>0)r=c;else return c}return r},"findNonClusterChild"),z=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Se=u((e,n)=>{if(!e||n>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(a.debug("Cluster identified",t," Replacement id in edges: ",C(t,e,t)),m.set(t,U(t,e)),l.set(t,{id:C(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let s=e.children(t),r=e.edges();s.length>0?(a.debug("Cluster identified",t,m),r.forEach(i=>{let c=p(i.v,t),d=p(i.w,t);c^d&&(a.debug("Edge: ",i," leaves cluster ",t),a.debug("Descendants of XXX ",t,": ",m.get(t)),l.get(t).externalConnections=!0)})):a.debug("Not a cluster ",t,m)});for(let t of l.keys()){let s=l.get(t).id,r=e.parent(s);r!==t&&l.has(r)&&!l.get(r).externalConnections&&(l.get(t).id=r);let i=e.edges().some(c=>c.v===t);if(s&&l.get(t)?.externalConnections&&i&&ee(e,s,t)){let c=he(e,t,e.parent(s));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){let s=e.edge(t);a.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),a.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(a.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(a.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),r=z(t.v),i=z(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let c=e.parent(r);l.get(c).externalConnections=!0,s.fromCluster=t.v}if(i!==t.w){let c=e.parent(i);l.get(c).externalConnections=!0,s.toCluster=t.w}a.debug("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,s,t.name)}}),Z(e,0),a.trace(l)},"adjustClustersAndEdges"),Z=u((e,n)=>{if(n>10){a.error("Bailing out");return}let t=e.nodes(),s=!1;for(let r of t){let i=e.children(r);s=s||i.length>0}if(!s){a.debug("Done, no node has children",e.nodes());return}a.debug("Nodes = ",t,n);for(let r of t)if(a.debug("Extracting node",r,l,l.has(r)&&!l.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",n),!l.has(r))a.debug("Not a cluster",r,n);else if(!l.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){a.debug("Cluster without external connections, without a parent and with children",r,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(r)?.clusterData?.dir&&(c=l.get(r).clusterData.dir,a.debug("Fixing dir",l.get(r).clusterData.dir,c));let d=new E({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Q(r,e,d,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:l.get(r).clusterData,label:l.get(r).label,graph:d})}else a.debug("Cluster ** ",r," **not meeting the criteria !externalConnections:",!l.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),n),a.debug(l);t=e.nodes(),a.debug("New list of nodes",t);for(let r of t){let i=e.node(r);a.debug(" Now next level",r,i),i?.clusterNode&&Z(i.graph,n+1)}},"extractor"),I=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(s=>{let r=e.children(s),i=I(e,r);t=[...t,...i]}),t},"sorter"),ke=u(e=>I(e,e.children()),"sortNodesByHierarchy"),ee=u((e,n,t)=>{let s=e.parent(n);for(;s&&s!==t;){let r=l.get(s);if(r&&!r.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),he=u((e,n,t)=>{let s=e.children(n)??[];for(let r of s){if(r===t||p(r,t))continue;let i=C(r,e,n);if(i&&!ee(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:s,afterPaint:r,paintOptions:i}){let c=n??ne;return u(async function(o,g,b,N){let h=g.select("g");(b?.insertMarkers??H)(h,o.markers,o.type,o.diagramId),te();let f={element:h,helpers:b,options:N};f.preparedLayout=await e?.(o,f);let w=await c(o,f),v=await t(o,f),y={...f,measure:w};s?await s(o,y,v):await re(o,y,i),await r?.(o,y,v)},"render")}u(we,"createCommonLayoutRenderer");function te(){X(),F(),G(),ge()}u(te,"clearLayoutRenderState");async function ne(e,{element:n},t){return await q(n,e,t)}u(ne,"defaultMeasureLayout");async function re(e,n,t={}){let{measure:s}=n,{groups:r}=s;for(let c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await se(r,c,n,t);let i=oe(e.nodes);for(let c of e.edges)ae(c,t)||await ce(r,c,i,e,t,n)}u(re,"paintLayoutData");async function se(e,n,t,s){n.clusterNode?L(n):ie(n,t,s)?await _(e.clusters,n):L(n)}u(se,"paintLayoutNode");function ie(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(ie,"shouldPaintAsCluster");function oe(e){let n=new Map;for(let t of e)t?.id&&n.set(t.id,t);return n}u(oe,"buildNodeLookup");function ae(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(ae,"shouldSkipPaintEdge");async function ce(e,n,t,s,r,i){let c=j(e.edgePaths,{...n},r.clusterDb??new Map,s.type,k(n.start,n,t,i,r),k(n.end,n,t,i,r),s.diagramId,le(n,r),s.layoutAlgorithm);D(n)&&(x.has(n.id)||await S(e.edgeLabels,n),ue(n,c))}u(ce,"paintLayoutEdge");function k(e,n,t,s,r){return r.getEdgeNode?.(e,n,s)??(e?t.get(e)??{}:{})}u(k,"getRenderedNode");function le(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(le,"shouldSkipIntersect");function ue(e,n){let t=n?.updatedPath??n?.originalPath,s=R(),{subGraphTitleTotalMargin:r}=M({flowchart:s.flowchart??{}});if(e.label){let i=x.get(e.id),{x:c,y:d}=$(e,n);i.attr("transform",`translate(${c}, ${d+r/2})`)}for(let[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){let{x:d,y:o}=fe(e,i,t);O.get(e.id)[i].attr("transform",`translate(${d}, ${o})`)}}u(ue,"positionRenderedEdgeLabel");var pe={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function fe(e,n,t){let s=e.terminalLabelCenters?.[n];if(s)return{...s};if(!t)return{x:e.x,y:e.y};let r=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return P.calcTerminalLabelPosition(r?10:0,pe[n],t)}u(fe,"terminalLabelTranslate");export{J as a,V as b,l as c,C as d,Se as e,ke as f,we as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as wt}from"./chunk-3RNHDNP5.js";var Rt=wt(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.BLANK_URL=k.relativeFirstCharacters=k.whitespaceEscapeCharsRegex=k.urlSchemeRegex=k.ctrlCharactersRegex=k.htmlCtrlEntityRegex=k.htmlEntitiesRegex=k.invalidProtocolRegex=void 0;k.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;k.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;k.htmlCtrlEntityRegex=/&(newline|tab);/gi;k.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;k.urlSchemeRegex=/^.+(:|:)/gim;k.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;k.relativeFirstCharacters=[".","/"];k.BLANK_URL="about:blank"});var nn=wt(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.sanitizeUrl=tn;var R=Rt();function Gt(t){return R.relativeFirstCharacters.indexOf(t[0])>-1}function Jt(t){var n=t.replace(R.ctrlCharactersRegex,"");return n.replace(R.htmlEntitiesRegex,function(i,e){return String.fromCharCode(e)})}function jt(t){return URL.canParse(t)}function St(t){try{return decodeURIComponent(t)}catch{return t}}function tn(t){if(!t)return R.BLANK_URL;var n,i=St(t.trim());do i=Jt(i).replace(R.htmlCtrlEntityRegex,"").replace(R.ctrlCharactersRegex,"").replace(R.whitespaceEscapeCharsRegex,"").trim(),i=St(i),n=i.match(R.ctrlCharactersRegex)||i.match(R.htmlEntitiesRegex)||i.match(R.htmlCtrlEntityRegex)||i.match(R.whitespaceEscapeCharsRegex);while(n&&n.length>0);var e=i;if(!e)return R.BLANK_URL;if(Gt(e))return e;var o=e.trimStart(),r=o.match(R.urlSchemeRegex);if(!r)return e;var a=r[0].toLowerCase().trim();if(R.invalidProtocolRegex.test(a))return R.BLANK_URL;var s=o.replace(/\\/g,"/");if(a==="mailto:"||a.includes("://"))return s;if(a==="http:"||a==="https:"){if(!jt(s))return R.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}});var H=Math.PI,dt=2*H,F=1e-6,en=dt-F;function Ct(t){this._+=t[0];for(let n=1,i=t.length;n<i;++n)this._+=arguments[n]+t[n]}function sn(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return Ct;let i=10**n;return function(e){this._+=e[0];for(let o=1,r=e.length;o<r;++o)this._+=Math.round(arguments[o]*i)/i+e[o]}}function Et(t,n,i,e){return t===i&&n===e}function on(t){let n=Math.floor(t);if(!(n<=15))return Et;let i=10**n,e=function(o){return Math.round(o*i)};return function(o,r,a,s){return e(o)===e(a)&&e(r)===e(s)}}var V=class{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?Ct:sn(n),this._equal=n==null?Et:on(n)}moveTo(n,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,i){this._append`L${this._x1=+n},${this._y1=+i}`}quadraticCurveTo(n,i,e,o){this._append`Q${+n},${+i},${this._x1=+e},${this._y1=+o}`}bezierCurveTo(n,i,e,o,r,a){this._append`C${+n},${+i},${+e},${+o},${this._x1=+r},${this._y1=+a}`}arcTo(n,i,e,o,r){if(n=+n,i=+i,e=+e,o=+o,r=+r,r<0)throw new Error(`negative radius: ${r}`);let a=this._x1,s=this._y1,l=e-n,_=o-i,h=a-n,p=s-i,u=h*h+p*p;if(this._x1===null)this._append`M${this._x1=n},${this._y1=i}`;else if(u>F)if(!(Math.abs(p*l-_*h)>F)||!r)this._append`L${this._x1=n},${this._y1=i}`;else{let f=e-a,y=o-s,v=l*l+_*_,N=f*f+y*y,m=Math.sqrt(v),b=Math.sqrt(u),T=r*Math.tan((H-Math.acos((v+u-N)/(2*m*b)))/2),g=T/b,w=T/m;Math.abs(g-1)>F&&this._append`L${n+g*h},${i+g*p}`,this._append`A${r},${r},0,0,${+(p*f>h*y)},${this._x1=n+w*l},${this._y1=i+w*_}`}}arc(n,i,e,o,r,a){if(n=+n,i=+i,e=+e,a=!!a,e<0)throw new Error(`negative radius: ${e}`);let s=e*Math.cos(o),l=e*Math.sin(o),_=n+s,h=i+l,p=1^a,u=a?o-r:r-o;if(this._x1===null?this._append`M${_},${h}`:(Math.abs(this._x1-_)>F||Math.abs(this._y1-h)>F)&&this._append`L${_},${h}`,!!e){if(u<0&&(u=u%dt+dt),u>en)this._append`A${e},${e},0,1,${p},${n-s},${i-l}A${e},${e},0,1,${p},${this._x1=_},${this._y1=h}`;else if(u>F){let f=n+e*Math.cos(r),y=i+e*Math.sin(r);if(u>=H&&this._equal(_,h,f,y)){u/=2;let v=o+u;this._append`A${e},${e},0,${+(u>=H)},${p},${n+e*Math.cos(v)},${i+e*Math.sin(v)}`}this._append`A${e},${e},0,${+(u>=H)},${p},${this._x1=f},${this._y1=y}`}}}rect(n,i,e,o){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}h${e=+e}v${+o}h${-e}Z`}toString(){return this._}};function rn(){return new V}rn.prototype=V.prototype;function x(t){return function(){return t}}var Nt=Math.abs,S=Math.atan2,X=Math.cos,hn=Math.max,yt=Math.min,M=Math.sin,P=Math.sqrt,C=1e-12,I=Math.PI,nt=I/2,W=2*I;function an(t){return t>1?0:t<-1?I:Math.acos(t)}function Mt(t){return t>=1?nt:t<=-1?-nt:Math.asin(t)}function Lt(t){let n=3;return t.digits=function(i){if(!arguments.length)return n;if(i==null)n=null;else{let e=Math.floor(i);if(!(e>=0))throw new RangeError(`invalid digits: ${i}`);n=e}return t},()=>new V(n)}function ln(t){return t.innerRadius}function un(t){return t.outerRadius}function _n(t){return t.startAngle}function cn(t){return t.endAngle}function fn(t){return t&&t.padAngle}function pn(t,n,i,e,o,r,a,s){var l=i-t,_=e-n,h=a-o,p=s-r,u=p*l-h*_;if(!(u*u<C))return u=(h*(n-r)-p*(t-o))/u,[t+u*l,n+u*_]}function tt(t,n,i,e,o,r,a){var s=t-i,l=n-e,_=(a?r:-r)/P(s*s+l*l),h=_*l,p=-_*s,u=t+h,f=n+p,y=i+h,v=e+p,N=(u+y)/2,m=(f+v)/2,b=y-u,T=v-f,g=b*b+T*T,w=o-r,E=u*v-y*f,q=(T<0?-1:1)*P(hn(0,w*w*g-E*E)),B=(E*T-b*q)/g,U=(-E*b-T*q)/g,O=(E*T+b*q)/g,A=(-E*b+T*q)/g,$=B-N,c=U-m,d=O-N,Y=A-m;return $*$+c*c>d*d+Y*Y&&(B=O,U=A),{cx:B,cy:U,x01:-h,y01:-p,x11:B*(o/w-1),y11:U*(o/w-1)}}function Sn(){var t=ln,n=un,i=x(0),e=null,o=_n,r=cn,a=fn,s=null,l=Lt(_);function _(){var h,p,u=+t.apply(this,arguments),f=+n.apply(this,arguments),y=o.apply(this,arguments)-nt,v=r.apply(this,arguments)-nt,N=Nt(v-y),m=v>y;if(s||(s=h=l()),f<u&&(p=f,f=u,u=p),!(f>C))s.moveTo(0,0);else if(N>W-C)s.moveTo(f*X(y),f*M(y)),s.arc(0,0,f,y,v,!m),u>C&&(s.moveTo(u*X(v),u*M(v)),s.arc(0,0,u,v,y,m));else{var b=y,T=v,g=y,w=v,E=N,q=N,B=a.apply(this,arguments)/2,U=B>C&&(e?+e.apply(this,arguments):P(u*u+f*f)),O=yt(Nt(f-u)/2,+i.apply(this,arguments)),A=O,$=O,c,d;if(U>C){var Y=Mt(U/u*M(B)),Z=Mt(U/f*M(B));(E-=Y*2)>C?(Y*=m?1:-1,g+=Y,w-=Y):(E=0,g=w=(y+v)/2),(q-=Z*2)>C?(Z*=m?1:-1,b+=Z,T-=Z):(q=0,b=T=(y+v)/2)}var D=f*X(b),K=f*M(b),Q=u*X(w),G=u*M(w);if(O>C){var J=f*X(T),j=f*M(T),at=u*X(g),lt=u*M(g),L;if(N<I)if(L=pn(D,K,at,lt,J,j,Q,G)){var ut=D-L[0],_t=K-L[1],ct=J-L[0],ft=j-L[1],bt=1/M(an((ut*ct+_t*ft)/(P(ut*ut+_t*_t)*P(ct*ct+ft*ft)))/2),kt=P(L[0]*L[0]+L[1]*L[1]);A=yt(O,(u-kt)/(bt-1)),$=yt(O,(f-kt)/(bt+1))}else A=$=0}q>C?$>C?(c=tt(at,lt,D,K,f,$,m),d=tt(J,j,Q,G,f,$,m),s.moveTo(c.cx+c.x01,c.cy+c.y01),$<O?s.arc(c.cx,c.cy,$,S(c.y01,c.x01),S(d.y01,d.x01),!m):(s.arc(c.cx,c.cy,$,S(c.y01,c.x01),S(c.y11,c.x11),!m),s.arc(0,0,f,S(c.cy+c.y11,c.cx+c.x11),S(d.cy+d.y11,d.cx+d.x11),!m),s.arc(d.cx,d.cy,$,S(d.y11,d.x11),S(d.y01,d.x01),!m))):(s.moveTo(D,K),s.arc(0,0,f,b,T,!m)):s.moveTo(D,K),!(u>C)||!(E>C)?s.lineTo(Q,G):A>C?(c=tt(Q,G,J,j,u,-A,m),d=tt(D,K,at,lt,u,-A,m),s.lineTo(c.cx+c.x01,c.cy+c.y01),A<O?s.arc(c.cx,c.cy,A,S(c.y01,c.x01),S(d.y01,d.x01),!m):(s.arc(c.cx,c.cy,A,S(c.y01,c.x01),S(c.y11,c.x11),!m),s.arc(0,0,u,S(c.cy+c.y11,c.cx+c.x11),S(d.cy+d.y11,d.cx+d.x11),m),s.arc(d.cx,d.cy,A,S(d.y11,d.x11),S(d.y01,d.x01),!m))):s.arc(0,0,u,w,g,m)}if(s.closePath(),h)return s=null,h+""||null}return _.centroid=function(){var h=(+t.apply(this,arguments)+ +n.apply(this,arguments))/2,p=(+o.apply(this,arguments)+ +r.apply(this,arguments))/2-I/2;return[X(p)*h,M(p)*h]},_.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:x(+h),_):t},_.outerRadius=function(h){return arguments.length?(n=typeof h=="function"?h:x(+h),_):n},_.cornerRadius=function(h){return arguments.length?(i=typeof h=="function"?h:x(+h),_):i},_.padRadius=function(h){return arguments.length?(e=h==null?null:typeof h=="function"?h:x(+h),_):e},_.startAngle=function(h){return arguments.length?(o=typeof h=="function"?h:x(+h),_):o},_.endAngle=function(h){return arguments.length?(r=typeof h=="function"?h:x(+h),_):r},_.padAngle=function(h){return arguments.length?(a=typeof h=="function"?h:x(+h),_):a},_.context=function(h){return arguments.length?(s=h??null,_):s},_}var Cn=Array.prototype.slice;function qt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Bt(t){this._context=t}Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function Ut(t){return new Bt(t)}function dn(t){return t[0]}function yn(t){return t[1]}function En(t,n){var i=x(!0),e=null,o=Ut,r=null,a=Lt(s);t=typeof t=="function"?t:t===void 0?dn:x(t),n=typeof n=="function"?n:n===void 0?yn:x(n);function s(l){var _,h=(l=qt(l)).length,p,u=!1,f;for(e==null&&(r=o(f=a())),_=0;_<=h;++_)!(_<h&&i(p=l[_],_,l))===u&&((u=!u)?r.lineStart():r.lineEnd()),u&&r.point(+t(p,_,l),+n(p,_,l));if(f)return r=null,f+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:x(+l),s):t},s.y=function(l){return arguments.length?(n=typeof l=="function"?l:x(+l),s):n},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:x(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,e!=null&&(r=o(e)),s):o},s.context=function(l){return arguments.length?(l==null?e=r=null:r=o(e=l),s):e},s}function mn(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function vn(t){return t}function Nn(){var t=vn,n=mn,i=null,e=x(0),o=x(W),r=x(0);function a(s){var l,_=(s=qt(s)).length,h,p,u=0,f=new Array(_),y=new Array(_),v=+e.apply(this,arguments),N=Math.min(W,Math.max(-W,o.apply(this,arguments)-v)),m,b=Math.min(Math.abs(N)/_,r.apply(this,arguments)),T=b*(N<0?-1:1),g;for(l=0;l<_;++l)(g=y[f[l]=l]=+t(s[l],l,s))>0&&(u+=g);for(n!=null?f.sort(function(w,E){return n(y[w],y[E])}):i!=null&&f.sort(function(w,E){return i(s[w],s[E])}),l=0,p=u?(N-_*T)/u:0;l<_;++l,v=m)h=f[l],g=y[h],m=v+(g>0?g*p:0)+T,y[h]={data:s[h],index:l,value:g,startAngle:v,endAngle:m,padAngle:b};return y}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:x(+s),a):t},a.sortValues=function(s){return arguments.length?(n=s,i=null,a):n},a.sort=function(s){return arguments.length?(i=s,n=null,a):i},a.startAngle=function(s){return arguments.length?(e=typeof s=="function"?s:x(+s),a):e},a.endAngle=function(s){return arguments.length?(o=typeof s=="function"?s:x(+s),a):o},a.padAngle=function(s){return arguments.length?(r=typeof s=="function"?s:x(+s),a):r},a}var Mn=gn(Ut);function Xt(t){this._curve=t}Xt.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};function gn(t){function n(i){return new Xt(t(i))}return n._curve=t,n}var it=class{constructor(n,i){this._context=n,this._x=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(n,i){switch(n=+n,i=+i,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,i,n,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,n,this._y0,n,i);break}}this._x0=n,this._y0=i}};function An(t){return new it(t,!0)}function $n(t){return new it(t,!1)}var Pn=P(3);var xn=P(1/3),On=xn*2;var zt=M(I/10)/M(7*I/10),Ln=M(W/10)*zt,qn=-X(W/10)*zt;var Bn=P(3);var Un=P(3);var Xn=P(3)/2,Tn=1/P(12),zn=(Tn/2+1)*3;function z(){}function et(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function rt(t){this._context=t}rt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:et(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:et(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Yn(t){return new rt(t)}function Yt(t){this._context=t}Yt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:et(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Fn(t){return new Yt(t)}function Ft(t){this._context=t}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:et(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function In(t){return new Ft(t)}function It(t,n){this._basis=new rt(t),this._beta=n}It.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e=t[0],o=n[0],r=t[i]-e,a=n[i]-o,s=-1,l;++s<=i;)l=s/i,this._basis.point(this._beta*t[s]+(1-this._beta)*(e+l*r),this._beta*n[s]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Dn=(function t(n){function i(e){return n===1?new rt(e):new It(e,n)}return i.beta=function(e){return t(+e)},i})(.85);function st(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function vt(t,n){this._context=t,this._k=(1-n)/6}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:st(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:st(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Kn=(function t(n){function i(e){return new vt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function gt(t,n){this._context=t,this._k=(1-n)/6}gt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:st(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Vn=(function t(n){function i(e){return new gt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function xt(t,n){this._context=t,this._k=(1-n)/6}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:st(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Wn=(function t(n){function i(e){return new xt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Tt(t,n,i){var e=t._x1,o=t._y1,r=t._x2,a=t._y2;if(t._l01_a>C){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>C){var _=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*_+t._x1*t._l23_2a-n*t._l12_2a)/h,a=(a*_+t._y1*t._l23_2a-i*t._l12_2a)/h}t._context.bezierCurveTo(e,o,r,a,t._x2,t._y2)}function Dt(t,n){this._context=t,this._alpha=n}Dt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Tt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Hn=(function t(n){function i(e){return n?new Dt(e,n):new vt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Kt(t,n){this._context=t,this._alpha=n}Kt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Zn=(function t(n){function i(e){return n?new Kt(e,n):new gt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Vt(t,n){this._context=t,this._alpha=n}Vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Qn=(function t(n){function i(e){return n?new Vt(e,n):new xt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Wt(t){this._context=t}Wt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function Gn(t){return new Wt(t)}function At(t){return t<0?-1:1}function $t(t,n,i){var e=t._x1-t._x0,o=n-t._x1,r=(t._y1-t._y0)/(e||o<0&&-0),a=(i-t._y1)/(o||e<0&&-0),s=(r*o+a*e)/(e+o);return(At(r)+At(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(s))||0}function Pt(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function mt(t,n,i){var e=t._x0,o=t._y0,r=t._x1,a=t._y1,s=(r-e)/3;t._context.bezierCurveTo(e+s,o+s*n,r-s,a-s*i,r,a)}function ot(t){this._context=t}ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:mt(this,this._t0,Pt(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,mt(this,Pt(this,i=$t(this,t,n)),i);break;default:mt(this,this._t0,i=$t(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}};function Ht(t){this._context=new Zt(t)}(Ht.prototype=Object.create(ot.prototype)).point=function(t,n){ot.prototype.point.call(this,n,t)};function Zt(t){this._context=t}Zt.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,o,r){this._context.bezierCurveTo(n,t,e,i,r,o)}};function Jn(t){return new ot(t)}function jn(t){return new Ht(t)}function Qt(t){this._context=t}Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),i===2)this._context.lineTo(t[1],n[1]);else for(var e=Ot(t),o=Ot(n),r=0,a=1;a<i;++r,++a)this._context.bezierCurveTo(e[0][r],o[0][r],e[1][r],o[1][r],t[a],n[a]);(this._line||this._line!==0&&i===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function Ot(t){var n,i=t.length-1,e,o=new Array(i),r=new Array(i),a=new Array(i);for(o[0]=0,r[0]=2,a[0]=t[0]+2*t[1],n=1;n<i-1;++n)o[n]=1,r[n]=4,a[n]=4*t[n]+2*t[n+1];for(o[i-1]=2,r[i-1]=7,a[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=o[n]/r[n-1],r[n]-=e,a[n]-=e*a[n-1];for(o[i-1]=a[i-1]/r[i-1],n=i-2;n>=0;--n)o[n]=(a[n]-o[n+1])/r[n];for(r[i-1]=(t[i]+o[i-1])/2,n=0;n<i-1;++n)r[n]=2*t[n+1]-o[n+1];return[o,r]}function ti(t){return new Qt(t)}function ht(t,n){this._context=t,this._t=n}ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}break}}this._x=t,this._y=n}};function ni(t){return new ht(t,.5)}function ii(t){return new ht(t,0)}function ei(t){return new ht(t,1)}export{nn as a,Sn as b,Ut as c,En as d,Nn as e,An as f,$n as g,Yn as h,Fn as i,In as j,Dn as k,Kn as l,Vn as m,Wn as n,Hn as o,Zn as p,Qn as q,Gn as r,Jn as s,jn as t,ti as u,ni as v,ii as w,ei as x};
|
|
1
|
+
import{a as wt}from"./chunk-SQE76S5B.js";var Rt=wt(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.BLANK_URL=k.relativeFirstCharacters=k.whitespaceEscapeCharsRegex=k.urlSchemeRegex=k.ctrlCharactersRegex=k.htmlCtrlEntityRegex=k.htmlEntitiesRegex=k.invalidProtocolRegex=void 0;k.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;k.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;k.htmlCtrlEntityRegex=/&(newline|tab);/gi;k.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;k.urlSchemeRegex=/^.+(:|:)/gim;k.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;k.relativeFirstCharacters=[".","/"];k.BLANK_URL="about:blank"});var nn=wt(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.sanitizeUrl=tn;var R=Rt();function Gt(t){return R.relativeFirstCharacters.indexOf(t[0])>-1}function Jt(t){var n=t.replace(R.ctrlCharactersRegex,"");return n.replace(R.htmlEntitiesRegex,function(i,e){return String.fromCharCode(e)})}function jt(t){return URL.canParse(t)}function St(t){try{return decodeURIComponent(t)}catch{return t}}function tn(t){if(!t)return R.BLANK_URL;var n,i=St(t.trim());do i=Jt(i).replace(R.htmlCtrlEntityRegex,"").replace(R.ctrlCharactersRegex,"").replace(R.whitespaceEscapeCharsRegex,"").trim(),i=St(i),n=i.match(R.ctrlCharactersRegex)||i.match(R.htmlEntitiesRegex)||i.match(R.htmlCtrlEntityRegex)||i.match(R.whitespaceEscapeCharsRegex);while(n&&n.length>0);var e=i;if(!e)return R.BLANK_URL;if(Gt(e))return e;var o=e.trimStart(),r=o.match(R.urlSchemeRegex);if(!r)return e;var a=r[0].toLowerCase().trim();if(R.invalidProtocolRegex.test(a))return R.BLANK_URL;var s=o.replace(/\\/g,"/");if(a==="mailto:"||a.includes("://"))return s;if(a==="http:"||a==="https:"){if(!jt(s))return R.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}});var H=Math.PI,dt=2*H,F=1e-6,en=dt-F;function Ct(t){this._+=t[0];for(let n=1,i=t.length;n<i;++n)this._+=arguments[n]+t[n]}function sn(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return Ct;let i=10**n;return function(e){this._+=e[0];for(let o=1,r=e.length;o<r;++o)this._+=Math.round(arguments[o]*i)/i+e[o]}}function Et(t,n,i,e){return t===i&&n===e}function on(t){let n=Math.floor(t);if(!(n<=15))return Et;let i=10**n,e=function(o){return Math.round(o*i)};return function(o,r,a,s){return e(o)===e(a)&&e(r)===e(s)}}var V=class{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?Ct:sn(n),this._equal=n==null?Et:on(n)}moveTo(n,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,i){this._append`L${this._x1=+n},${this._y1=+i}`}quadraticCurveTo(n,i,e,o){this._append`Q${+n},${+i},${this._x1=+e},${this._y1=+o}`}bezierCurveTo(n,i,e,o,r,a){this._append`C${+n},${+i},${+e},${+o},${this._x1=+r},${this._y1=+a}`}arcTo(n,i,e,o,r){if(n=+n,i=+i,e=+e,o=+o,r=+r,r<0)throw new Error(`negative radius: ${r}`);let a=this._x1,s=this._y1,l=e-n,_=o-i,h=a-n,p=s-i,u=h*h+p*p;if(this._x1===null)this._append`M${this._x1=n},${this._y1=i}`;else if(u>F)if(!(Math.abs(p*l-_*h)>F)||!r)this._append`L${this._x1=n},${this._y1=i}`;else{let f=e-a,y=o-s,v=l*l+_*_,N=f*f+y*y,m=Math.sqrt(v),b=Math.sqrt(u),T=r*Math.tan((H-Math.acos((v+u-N)/(2*m*b)))/2),g=T/b,w=T/m;Math.abs(g-1)>F&&this._append`L${n+g*h},${i+g*p}`,this._append`A${r},${r},0,0,${+(p*f>h*y)},${this._x1=n+w*l},${this._y1=i+w*_}`}}arc(n,i,e,o,r,a){if(n=+n,i=+i,e=+e,a=!!a,e<0)throw new Error(`negative radius: ${e}`);let s=e*Math.cos(o),l=e*Math.sin(o),_=n+s,h=i+l,p=1^a,u=a?o-r:r-o;if(this._x1===null?this._append`M${_},${h}`:(Math.abs(this._x1-_)>F||Math.abs(this._y1-h)>F)&&this._append`L${_},${h}`,!!e){if(u<0&&(u=u%dt+dt),u>en)this._append`A${e},${e},0,1,${p},${n-s},${i-l}A${e},${e},0,1,${p},${this._x1=_},${this._y1=h}`;else if(u>F){let f=n+e*Math.cos(r),y=i+e*Math.sin(r);if(u>=H&&this._equal(_,h,f,y)){u/=2;let v=o+u;this._append`A${e},${e},0,${+(u>=H)},${p},${n+e*Math.cos(v)},${i+e*Math.sin(v)}`}this._append`A${e},${e},0,${+(u>=H)},${p},${this._x1=f},${this._y1=y}`}}}rect(n,i,e,o){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}h${e=+e}v${+o}h${-e}Z`}toString(){return this._}};function rn(){return new V}rn.prototype=V.prototype;function x(t){return function(){return t}}var Nt=Math.abs,S=Math.atan2,X=Math.cos,hn=Math.max,yt=Math.min,M=Math.sin,P=Math.sqrt,C=1e-12,I=Math.PI,nt=I/2,W=2*I;function an(t){return t>1?0:t<-1?I:Math.acos(t)}function Mt(t){return t>=1?nt:t<=-1?-nt:Math.asin(t)}function Lt(t){let n=3;return t.digits=function(i){if(!arguments.length)return n;if(i==null)n=null;else{let e=Math.floor(i);if(!(e>=0))throw new RangeError(`invalid digits: ${i}`);n=e}return t},()=>new V(n)}function ln(t){return t.innerRadius}function un(t){return t.outerRadius}function _n(t){return t.startAngle}function cn(t){return t.endAngle}function fn(t){return t&&t.padAngle}function pn(t,n,i,e,o,r,a,s){var l=i-t,_=e-n,h=a-o,p=s-r,u=p*l-h*_;if(!(u*u<C))return u=(h*(n-r)-p*(t-o))/u,[t+u*l,n+u*_]}function tt(t,n,i,e,o,r,a){var s=t-i,l=n-e,_=(a?r:-r)/P(s*s+l*l),h=_*l,p=-_*s,u=t+h,f=n+p,y=i+h,v=e+p,N=(u+y)/2,m=(f+v)/2,b=y-u,T=v-f,g=b*b+T*T,w=o-r,E=u*v-y*f,q=(T<0?-1:1)*P(hn(0,w*w*g-E*E)),B=(E*T-b*q)/g,U=(-E*b-T*q)/g,O=(E*T+b*q)/g,A=(-E*b+T*q)/g,$=B-N,c=U-m,d=O-N,Y=A-m;return $*$+c*c>d*d+Y*Y&&(B=O,U=A),{cx:B,cy:U,x01:-h,y01:-p,x11:B*(o/w-1),y11:U*(o/w-1)}}function Sn(){var t=ln,n=un,i=x(0),e=null,o=_n,r=cn,a=fn,s=null,l=Lt(_);function _(){var h,p,u=+t.apply(this,arguments),f=+n.apply(this,arguments),y=o.apply(this,arguments)-nt,v=r.apply(this,arguments)-nt,N=Nt(v-y),m=v>y;if(s||(s=h=l()),f<u&&(p=f,f=u,u=p),!(f>C))s.moveTo(0,0);else if(N>W-C)s.moveTo(f*X(y),f*M(y)),s.arc(0,0,f,y,v,!m),u>C&&(s.moveTo(u*X(v),u*M(v)),s.arc(0,0,u,v,y,m));else{var b=y,T=v,g=y,w=v,E=N,q=N,B=a.apply(this,arguments)/2,U=B>C&&(e?+e.apply(this,arguments):P(u*u+f*f)),O=yt(Nt(f-u)/2,+i.apply(this,arguments)),A=O,$=O,c,d;if(U>C){var Y=Mt(U/u*M(B)),Z=Mt(U/f*M(B));(E-=Y*2)>C?(Y*=m?1:-1,g+=Y,w-=Y):(E=0,g=w=(y+v)/2),(q-=Z*2)>C?(Z*=m?1:-1,b+=Z,T-=Z):(q=0,b=T=(y+v)/2)}var D=f*X(b),K=f*M(b),Q=u*X(w),G=u*M(w);if(O>C){var J=f*X(T),j=f*M(T),at=u*X(g),lt=u*M(g),L;if(N<I)if(L=pn(D,K,at,lt,J,j,Q,G)){var ut=D-L[0],_t=K-L[1],ct=J-L[0],ft=j-L[1],bt=1/M(an((ut*ct+_t*ft)/(P(ut*ut+_t*_t)*P(ct*ct+ft*ft)))/2),kt=P(L[0]*L[0]+L[1]*L[1]);A=yt(O,(u-kt)/(bt-1)),$=yt(O,(f-kt)/(bt+1))}else A=$=0}q>C?$>C?(c=tt(at,lt,D,K,f,$,m),d=tt(J,j,Q,G,f,$,m),s.moveTo(c.cx+c.x01,c.cy+c.y01),$<O?s.arc(c.cx,c.cy,$,S(c.y01,c.x01),S(d.y01,d.x01),!m):(s.arc(c.cx,c.cy,$,S(c.y01,c.x01),S(c.y11,c.x11),!m),s.arc(0,0,f,S(c.cy+c.y11,c.cx+c.x11),S(d.cy+d.y11,d.cx+d.x11),!m),s.arc(d.cx,d.cy,$,S(d.y11,d.x11),S(d.y01,d.x01),!m))):(s.moveTo(D,K),s.arc(0,0,f,b,T,!m)):s.moveTo(D,K),!(u>C)||!(E>C)?s.lineTo(Q,G):A>C?(c=tt(Q,G,J,j,u,-A,m),d=tt(D,K,at,lt,u,-A,m),s.lineTo(c.cx+c.x01,c.cy+c.y01),A<O?s.arc(c.cx,c.cy,A,S(c.y01,c.x01),S(d.y01,d.x01),!m):(s.arc(c.cx,c.cy,A,S(c.y01,c.x01),S(c.y11,c.x11),!m),s.arc(0,0,u,S(c.cy+c.y11,c.cx+c.x11),S(d.cy+d.y11,d.cx+d.x11),m),s.arc(d.cx,d.cy,A,S(d.y11,d.x11),S(d.y01,d.x01),!m))):s.arc(0,0,u,w,g,m)}if(s.closePath(),h)return s=null,h+""||null}return _.centroid=function(){var h=(+t.apply(this,arguments)+ +n.apply(this,arguments))/2,p=(+o.apply(this,arguments)+ +r.apply(this,arguments))/2-I/2;return[X(p)*h,M(p)*h]},_.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:x(+h),_):t},_.outerRadius=function(h){return arguments.length?(n=typeof h=="function"?h:x(+h),_):n},_.cornerRadius=function(h){return arguments.length?(i=typeof h=="function"?h:x(+h),_):i},_.padRadius=function(h){return arguments.length?(e=h==null?null:typeof h=="function"?h:x(+h),_):e},_.startAngle=function(h){return arguments.length?(o=typeof h=="function"?h:x(+h),_):o},_.endAngle=function(h){return arguments.length?(r=typeof h=="function"?h:x(+h),_):r},_.padAngle=function(h){return arguments.length?(a=typeof h=="function"?h:x(+h),_):a},_.context=function(h){return arguments.length?(s=h??null,_):s},_}var Cn=Array.prototype.slice;function qt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Bt(t){this._context=t}Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function Ut(t){return new Bt(t)}function dn(t){return t[0]}function yn(t){return t[1]}function En(t,n){var i=x(!0),e=null,o=Ut,r=null,a=Lt(s);t=typeof t=="function"?t:t===void 0?dn:x(t),n=typeof n=="function"?n:n===void 0?yn:x(n);function s(l){var _,h=(l=qt(l)).length,p,u=!1,f;for(e==null&&(r=o(f=a())),_=0;_<=h;++_)!(_<h&&i(p=l[_],_,l))===u&&((u=!u)?r.lineStart():r.lineEnd()),u&&r.point(+t(p,_,l),+n(p,_,l));if(f)return r=null,f+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:x(+l),s):t},s.y=function(l){return arguments.length?(n=typeof l=="function"?l:x(+l),s):n},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:x(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,e!=null&&(r=o(e)),s):o},s.context=function(l){return arguments.length?(l==null?e=r=null:r=o(e=l),s):e},s}function mn(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function vn(t){return t}function Nn(){var t=vn,n=mn,i=null,e=x(0),o=x(W),r=x(0);function a(s){var l,_=(s=qt(s)).length,h,p,u=0,f=new Array(_),y=new Array(_),v=+e.apply(this,arguments),N=Math.min(W,Math.max(-W,o.apply(this,arguments)-v)),m,b=Math.min(Math.abs(N)/_,r.apply(this,arguments)),T=b*(N<0?-1:1),g;for(l=0;l<_;++l)(g=y[f[l]=l]=+t(s[l],l,s))>0&&(u+=g);for(n!=null?f.sort(function(w,E){return n(y[w],y[E])}):i!=null&&f.sort(function(w,E){return i(s[w],s[E])}),l=0,p=u?(N-_*T)/u:0;l<_;++l,v=m)h=f[l],g=y[h],m=v+(g>0?g*p:0)+T,y[h]={data:s[h],index:l,value:g,startAngle:v,endAngle:m,padAngle:b};return y}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:x(+s),a):t},a.sortValues=function(s){return arguments.length?(n=s,i=null,a):n},a.sort=function(s){return arguments.length?(i=s,n=null,a):i},a.startAngle=function(s){return arguments.length?(e=typeof s=="function"?s:x(+s),a):e},a.endAngle=function(s){return arguments.length?(o=typeof s=="function"?s:x(+s),a):o},a.padAngle=function(s){return arguments.length?(r=typeof s=="function"?s:x(+s),a):r},a}var Mn=gn(Ut);function Xt(t){this._curve=t}Xt.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};function gn(t){function n(i){return new Xt(t(i))}return n._curve=t,n}var it=class{constructor(n,i){this._context=n,this._x=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(n,i){switch(n=+n,i=+i,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,i,n,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,n,this._y0,n,i);break}}this._x0=n,this._y0=i}};function An(t){return new it(t,!0)}function $n(t){return new it(t,!1)}var Pn=P(3);var xn=P(1/3),On=xn*2;var zt=M(I/10)/M(7*I/10),Ln=M(W/10)*zt,qn=-X(W/10)*zt;var Bn=P(3);var Un=P(3);var Xn=P(3)/2,Tn=1/P(12),zn=(Tn/2+1)*3;function z(){}function et(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function rt(t){this._context=t}rt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:et(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:et(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Yn(t){return new rt(t)}function Yt(t){this._context=t}Yt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:et(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Fn(t){return new Yt(t)}function Ft(t){this._context=t}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:et(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function In(t){return new Ft(t)}function It(t,n){this._basis=new rt(t),this._beta=n}It.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e=t[0],o=n[0],r=t[i]-e,a=n[i]-o,s=-1,l;++s<=i;)l=s/i,this._basis.point(this._beta*t[s]+(1-this._beta)*(e+l*r),this._beta*n[s]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Dn=(function t(n){function i(e){return n===1?new rt(e):new It(e,n)}return i.beta=function(e){return t(+e)},i})(.85);function st(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function vt(t,n){this._context=t,this._k=(1-n)/6}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:st(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:st(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Kn=(function t(n){function i(e){return new vt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function gt(t,n){this._context=t,this._k=(1-n)/6}gt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:st(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Vn=(function t(n){function i(e){return new gt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function xt(t,n){this._context=t,this._k=(1-n)/6}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:st(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Wn=(function t(n){function i(e){return new xt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Tt(t,n,i){var e=t._x1,o=t._y1,r=t._x2,a=t._y2;if(t._l01_a>C){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>C){var _=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*_+t._x1*t._l23_2a-n*t._l12_2a)/h,a=(a*_+t._y1*t._l23_2a-i*t._l12_2a)/h}t._context.bezierCurveTo(e,o,r,a,t._x2,t._y2)}function Dt(t,n){this._context=t,this._alpha=n}Dt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Tt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Hn=(function t(n){function i(e){return n?new Dt(e,n):new vt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Kt(t,n){this._context=t,this._alpha=n}Kt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Zn=(function t(n){function i(e){return n?new Kt(e,n):new gt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Vt(t,n){this._context=t,this._alpha=n}Vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Qn=(function t(n){function i(e){return n?new Vt(e,n):new xt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Wt(t){this._context=t}Wt.prototype={areaStart:z,areaEnd:z,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function Gn(t){return new Wt(t)}function At(t){return t<0?-1:1}function $t(t,n,i){var e=t._x1-t._x0,o=n-t._x1,r=(t._y1-t._y0)/(e||o<0&&-0),a=(i-t._y1)/(o||e<0&&-0),s=(r*o+a*e)/(e+o);return(At(r)+At(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(s))||0}function Pt(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function mt(t,n,i){var e=t._x0,o=t._y0,r=t._x1,a=t._y1,s=(r-e)/3;t._context.bezierCurveTo(e+s,o+s*n,r-s,a-s*i,r,a)}function ot(t){this._context=t}ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:mt(this,this._t0,Pt(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,mt(this,Pt(this,i=$t(this,t,n)),i);break;default:mt(this,this._t0,i=$t(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}};function Ht(t){this._context=new Zt(t)}(Ht.prototype=Object.create(ot.prototype)).point=function(t,n){ot.prototype.point.call(this,n,t)};function Zt(t){this._context=t}Zt.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,o,r){this._context.bezierCurveTo(n,t,e,i,r,o)}};function Jn(t){return new ot(t)}function jn(t){return new Ht(t)}function Qt(t){this._context=t}Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),i===2)this._context.lineTo(t[1],n[1]);else for(var e=Ot(t),o=Ot(n),r=0,a=1;a<i;++r,++a)this._context.bezierCurveTo(e[0][r],o[0][r],e[1][r],o[1][r],t[a],n[a]);(this._line||this._line!==0&&i===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function Ot(t){var n,i=t.length-1,e,o=new Array(i),r=new Array(i),a=new Array(i);for(o[0]=0,r[0]=2,a[0]=t[0]+2*t[1],n=1;n<i-1;++n)o[n]=1,r[n]=4,a[n]=4*t[n]+2*t[n+1];for(o[i-1]=2,r[i-1]=7,a[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=o[n]/r[n-1],r[n]-=e,a[n]-=e*a[n-1];for(o[i-1]=a[i-1]/r[i-1],n=i-2;n>=0;--n)o[n]=(a[n]-o[n+1])/r[n];for(r[i-1]=(t[i]+o[i-1])/2,n=0;n<i-1;++n)r[n]=2*t[n+1]-o[n+1];return[o,r]}function ti(t){return new Qt(t)}function ht(t,n){this._context=t,this._t=n}ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}break}}this._x=t,this._y=n}};function ni(t){return new ht(t,.5)}function ii(t){return new ht(t,0)}function ei(t){return new ht(t,1)}export{nn as a,Sn as b,Ut as c,En as d,Nn as e,An as f,$n as g,Yn as h,Fn as i,In as j,Dn as k,Kn as l,Vn as m,Wn as n,Hn as o,Zn as p,Qn as q,Gn as r,Jn as s,jn as t,ti as u,ni as v,ii as w,ei as x};
|