@marimo-team/frontend 0.13.7-dev8 → 0.13.7-dev9
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/assets/{ConnectedDataExplorerComponent-CLc0tWMC.js → ConnectedDataExplorerComponent-aTL16d4W.js} +1 -1
- package/dist/assets/{VegaLite-DeIA1FjI.js → VegaLite-B8hQHAh-.js} +1 -1
- package/dist/assets/{_baseEach-Cyw-LuDI.js → _baseEach-fsZbP1N8.js} +1 -1
- package/dist/assets/_baseMap-B8cT6cMO.js +1 -0
- package/dist/assets/{_baseUniq-Q2eJnBNa.js → _baseUniq-BNwwWocp.js} +1 -1
- package/dist/assets/{_createAggregator-UrANbXdP.js → _createAggregator-uK9tvoQl.js} +1 -1
- package/dist/assets/{any-language-editor-Cfa0V48Y.js → any-language-editor-D3c0CEB2.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-CP5nWQay.js → architectureDiagram-IEHRJDOE-BCA-d6pH.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-pMp2cXt0.js → blockDiagram-JOT3LUYC-Bl5OSgtT.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-Bn4nvkHl.js → c4Diagram-VJAJSXHY-DHd9cbeI.js} +1 -1
- package/dist/assets/channel-Cah-fknW.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-BVHPUEv5.js → chunk-4BMEZGHF-B2bF-jyl.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-Cr_zhb-n.js → chunk-A2AXSNBT-CRhdQp4F.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-Cw97WREt.js → chunk-AEK57VVT-CRjefC9t.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-CbomMNl3.js → chunk-D6G4REZN-BeAK2ttI.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-D-i5I5dS.js → chunk-RZ5BOZE2-ZaJw1JwS.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-BxAeN6c9.js → chunk-XZIHB7SX-uSPpUSf_.js} +1 -1
- package/dist/assets/{circle-play-NJSP28OU.js → circle-play-DNRu-ReT.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-C-oJMCYG.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-C-oJMCYG.js +1 -0
- package/dist/assets/clone-DXAqsvWp.js +1 -0
- package/dist/assets/{compile-B99z9p1c.js → compile-h-VmVS3n.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-DFwLfrsP.js → dagre-OKDRZEBW-CzO1o7j7.js} +1 -1
- package/dist/assets/{data-editor-BnkfFTyP.js → data-editor-BPCz-RRC.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-DNHawSaS.js → diagram-SSKATNLV-Bu9tmr_l.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-mAGMWxSF.js → diagram-VNBRO52H-B8zB54d2.js} +1 -1
- package/dist/assets/edit-page-l7M3mmCs.js +134 -0
- package/dist/assets/{erDiagram-Q7BY3M3F-B7JQx89Q.js → erDiagram-Q7BY3M3F-GiSZ4Niy.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-CrIteLwE.js → flowDiagram-4HSFHLVR-DBSiHd0m.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-B82yNILY.js → ganttDiagram-APWFNJXF-bMNX-uB5.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-BX1zzD_4.js → gitGraphDiagram-7IBYFJ6S-BvuyR0TB.js} +1 -1
- package/dist/assets/{graph-n5raD8-X.js → graph-B8G81lu0.js} +1 -1
- package/dist/assets/{home-page-CAkv18DE.js → home-page-CAqsUULE.js} +1 -1
- package/dist/assets/{index-DoMH_weu.js → index-2TL38hPv.js} +1 -1
- package/dist/assets/{index-D2X6Wktl.js → index-B14EVG6L.js} +1 -1
- package/dist/assets/{index-BLczHwIF.js → index-B9Btdii4.js} +1 -1
- package/dist/assets/{index-ChvXZz4O.js → index-B9k4MYlq.js} +1 -1
- package/dist/assets/{index-BVjb7S6F.js → index-BDHXY3UE.js} +1 -1
- package/dist/assets/{index-C4VFj4aB.js → index-BJsnjxpc.js} +112 -112
- package/dist/assets/{index-2n81G4S2.js → index-BXbzCGbn.js} +1 -1
- package/dist/assets/{index-Ch51YLFK.js → index-BxkbDbzB.js} +1 -1
- package/dist/assets/{index-CiXJGIA5.js → index-CP8gLM9c.js} +1 -1
- package/dist/assets/index-CSziElQw.css +1 -0
- package/dist/assets/{index-2V-aA6ro.js → index-D1IdseC1.js} +1 -1
- package/dist/assets/{index-CHjC2BHW.js → index-DFpzd1EA.js} +1 -1
- package/dist/assets/{index-CGXa2hxu.js → index-DX1YAcio.js} +1 -1
- package/dist/assets/{index-CVS30d8t.js → index-FkBJMqtJ.js} +1 -1
- package/dist/assets/{index-BaaSOg-V.js → index-REXxtYrd.js} +1 -1
- package/dist/assets/{index-De6_X4XZ.js → index-Wzoc-_uT.js} +1 -1
- package/dist/assets/{index-MuEQoKhf.js → index-_KobMnTy.js} +1 -1
- package/dist/assets/{index-CJD1KDty.js → index-j5SusyE5.js} +1 -1
- package/dist/assets/{index-HeByvlyV.js → index-pmR7FK6S.js} +1 -1
- package/dist/assets/{index-f2YtY2NK.js → index-wqkTZ9mS.js} +1 -1
- package/dist/assets/infoDiagram-PH2N3AL5-Dr_g5e_R.js +2 -0
- package/dist/assets/{journeyDiagram-U35MCT3I-BFBt52HP.js → journeyDiagram-U35MCT3I-BKBrLjyX.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-D6o6rwO8.js → kanban-definition-NDS4AKOZ-B6zYcWR2.js} +1 -1
- package/dist/assets/{layout-BuG044DG.js → layout-DOrZNmX_.js} +1 -1
- package/dist/assets/{linear-HjYCbFKN.js → linear-CCD4VqSh.js} +1 -1
- package/dist/assets/{mermaid-DNnTn1ax.js → mermaid-CMGFQ7sl.js} +4 -4
- package/dist/assets/{min-DUCyIShx.js → min-C21FYuz2.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-CKIhzL5r.js → mindmap-definition-ALO5MXBD-CR7IM-_J.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-Cl9LWE0V.js → pieDiagram-IB7DONF6-C9jxnyRb.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-BWkeBvxF.js → quadrantDiagram-7GDLP6J5-eEYJI1dE.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-DfEvYX9n.js → radar-MK3ICKWK-8ZFTaZOH.js} +1 -1
- package/dist/assets/{react-plotly-DnYa98wl.js → react-plotly-Dp2qjlur.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-B3GypB5w.js → requirementDiagram-KVF5MWMF-CHvk2MiF.js} +1 -1
- package/dist/assets/{run-page-AYFVu0sg.js → run-page-Cm3oi86f.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-Duwbvz1H.js → sankeyDiagram-QLVOVGJD-B1tF5GpG.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-CPZ3p0P0.js → sequenceDiagram-X6HHIX6F-BOpD8Emj.js} +1 -1
- package/dist/assets/{slides-component-ji4ZW29g.js → slides-component-BuPI2hHm.js} +1 -1
- package/dist/assets/{sortBy-Bb9JPW3o.js → sortBy-CI3mVihg.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-DBMoid7W.js → stateDiagram-DGXRK772-IAT7mN_h.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-BlMW5hXj.js +1 -0
- package/dist/assets/{terminal-BvrOH4Uo.js → terminal-BvL9BCIG.js} +1 -1
- package/dist/assets/{time-Dhxp9qd9.js → time-DDarjbSW.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-D3iIxPo0.js → timeline-definition-BDJGKUSR-DNkQnSfP.js} +1 -1
- package/dist/assets/{tracing-gp4drB6-.js → tracing-CgYwDdwx.js} +2 -2
- package/dist/assets/{tree-BMOusOrc.js → tree-D1EDUAby.js} +2 -2
- package/dist/assets/{useMarimoWebSocket-BsUbqg1d.js → useMarimoWebSocket-ChrB5-Uc.js} +3 -3
- package/dist/assets/{vega-component-DZEBlVKg.js → vega-component-ejPpu3Yp.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-lnK1D7Dl.js → xychartDiagram-VJFVF3MP-8Wbh5ytf.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/_baseMap-C1RlaUrw.js +0 -1
- package/dist/assets/channel-pbDhyq1Y.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-DrKh0GDa.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-DrKh0GDa.js +0 -1
- package/dist/assets/clone-DTrfPVDc.js +0 -1
- package/dist/assets/edit-page-DqQ_uRQm.js +0 -134
- package/dist/assets/index-DWX453Nv.css +0 -1
- package/dist/assets/infoDiagram-PH2N3AL5-BEA8jVe9.js +0 -2
- package/dist/assets/stateDiagram-v2-YXO3MK2T-C6Yw638v.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as d,au as v,ai as p,av as b,aw as w,ax as y,H,ay as g,J}from"./index-
|
|
1
|
+
import{at as d,au as v,ai as p,av as b,aw as w,ax as y,H,ay as g,J}from"./index-BJsnjxpc.js";import{a as j}from"./_baseEach-fsZbP1N8.js";import{b as k}from"./_baseMap-B8cT6cMO.js";function q(n,r){if(n!==r){var u=n!==void 0,l=n===null,t=n==n,a=d(n),e=r!==void 0,o=r===null,f=r==r,i=d(r);if(!o&&!i&&!a&&n>r||a&&e&&f&&!o&&!i||l&&e&&f||!u&&f||!t)return 1;if(!l&&!a&&!i&&n<r||i&&u&&t&&!l&&!a||o&&u&&t||!e&&t||!f)return-1}return 0}function z(n,r,u){r=r.length?v(r,function(t){return p(t)?function(a){return b(a,t.length===1?t[0]:t)}:t}):[w];var l=-1;return r=v(r,y(j)),function(t,a){var e=t.length;for(t.sort(a);e--;)t[e]=t[e].value;return t}(k(n,function(t,a,e){return{criteria:v(r,function(o){return o(t)}),index:++l,value:t}}),function(t,a){return function(e,o,f){for(var i=-1,c=e.criteria,h=o.criteria,m=c.length,x=f.length;++i<m;){var s=q(c[i],h[i]);if(s)return i>=x?s:s*(f[i]=="desc"?-1:1)}return e.index-o.index}(t,a,u)})}var A=H(function(n,r){if(n==null)return[];var u=r.length;return u>1&&g(n,r[0],r[1])?r=[]:u>2&&g(r[0],r[1],r[2])&&(r=[r[0]]),z(n,J(r),[])});export{A as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as O,a as P,S as M}from"./chunk-AEK57VVT-Cw97WREt.js";import{_ as f,c as t,l as S,d as R,j as v,u as U}from"./mermaid-DNnTn1ax.js";import{s as T}from"./transform-Cyp0GDF-.js";import{G as C}from"./graph-n5raD8-X.js";import{l as I}from"./layout-BuG044DG.js";import{l as W,k as j}from"./step-BwsUM5iJ.js";import"./chunk-RZ5BOZE2-D-i5I5dS.js";import"./index-C4VFj4aB.js";import"./timer-DFzT7np-.js";import"./_baseUniq-Q2eJnBNa.js";import"./_baseEach-Cyw-LuDI.js";import"./min-DUCyIShx.js";import"./_baseMap-C1RlaUrw.js";import"./sortBy-Bb9JPW3o.js";var m,z={},F=f((e,i)=>{z[e]=i},"set"),J=f(e=>z[e],"get"),D=f(()=>Object.keys(z),"keys"),Y=f(()=>D().length,"size"),$={get:J,set:F,keys:D,size:Y},X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),_=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",2*t().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),q=f((e,i)=>{const o=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),d=o.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",d.width+2*t().state.padding).attr("height",d.height+2*t().state.padding).attr("rx",t().state.radius),o},"drawSimpleState"),Z=f((e,i)=>{const o=f(function(g,y,b){const B=g.append("tspan").attr("x",2*t().state.padding).text(y);b||B.attr("dy",t().state.textHeight)},"addTspan"),d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),n=d.height,c=e.append("text").attr("x",t().state.padding).attr("y",n+.4*t().state.padding+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;i.descriptions.forEach(function(g){l||(o(c,g,a),a=!1),l=!1});const s=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+n+t().state.dividerMargin/2).attr("y2",t().state.padding+n+t().state.dividerMargin/2).attr("class","descr-divider"),x=c.node().getBBox(),h=Math.max(x.width,d.width);return s.attr("x2",h+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",h+2*t().state.padding).attr("height",x.height+n+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),K=f((e,i,o)=>{const d=t().state.padding,n=2*t().state.padding,c=e.node().getBBox(),l=c.width,a=c.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let h,g=Math.max(x,l);g===l&&(g+=n);const y=e.node().getBBox();i.doc,h=a-d,x>l&&(h=(l-g)/2+d),Math.abs(a-y.x)<d&&x>l&&(h=a-(x-l)/2);const b=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",h).attr("y",b).attr("class",o?"alt-composit":"composit").attr("width",g).attr("height",y.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",h+d),x<=l&&s.attr("x",a+(g-n)/2-x/2+d),e.insert("rect",":first-child").attr("x",h).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",3*t().state.textHeight).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",h).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",y.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),Q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),V=f((e,i)=>{let o=t().state.forkWidth,d=t().state.forkHeight;if(i.parentId){let n=o;o=d,d=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",o).attr("height",d).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),tt=f((e,i,o,d)=>{let n=0;const c=d.append("text");c.style("text-anchor","start"),c.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(v.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const x of a){const h=x.trim();if(h.length>0){const g=c.append("tspan");g.text(h),s===0&&(s+=g.node().getBBox().height),n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",o+n+1.25*t().state.noteMargin)}}return{textWidth:c.node().getBBox().width,textHeight:n}},"_drawLongText"),et=f((e,i)=>{i.attr("class","state-note");const o=i.append("rect").attr("x",0).attr("y",t().state.padding),d=i.append("g"),{textWidth:n,textHeight:c}=tt(e,0,0,d);return o.attr("height",c+2*t().state.noteMargin),o.attr("width",n+2*t().state.noteMargin),o},"drawNote"),L=f(function(e,i){const o=i.id,d={id:o,label:i.id,width:0,height:0},n=e.append("g").attr("id",o).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&Q(n),i.type!=="fork"&&i.type!=="join"||V(n,i),i.type==="note"&&et(i.note.text,n),i.type==="divider"&&_(n),i.type==="default"&&i.descriptions.length===0&&q(n,i),i.type==="default"&&i.descriptions.length>0&&Z(n,i);const c=n.node().getBBox();return d.width=c.width+2*t().state.padding,d.height=c.height+2*t().state.padding,$.set(o,d),d},"drawState"),G=0,at=f(function(e,i,o){const d=f(function(s){switch(s){case M.relationType.AGGREGATION:return"aggregation";case M.relationType.EXTENSION:return"extension";case M.relationType.COMPOSITION:return"composition";case M.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,c=W().x(function(s){return s.x}).y(function(s){return s.y}).curve(j),l=e.append("path").attr("d",c(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),l.attr("marker-end","url("+a+"#"+d(M.relationType.DEPENDENCY)+"End)"),o.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x,y:h}=U.calcLabelPosition(i.points),g=v.getRows(o.title);let y=0;const b=[];let B=0,E=0;for(let u=0;u<=g.length;u++){const p=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",x).attr("y",h+y),w=p.node().getBBox();B=Math.max(B,w.width),E=Math.min(E,w.x),S.info(w.x,x,h+y),y===0&&(y=p.node().getBBox().height,S.info("Title height",y,h)),b.push(p)}let N=y*g.length;if(g.length>1){const u=(g.length-1)*y*.5;b.forEach((p,w)=>p.attr("y",h+w*y-u)),N=y*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",x-B/2-t().state.padding/2).attr("y",h-N/2-t().state.padding/2-3.5).attr("width",B+t().state.padding).attr("height",N+t().state.padding),S.info(r)}G++},"drawEdge"),H={},it=f(function(){},"setConf"),rt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),nt=f(function(e,i,o,d){m=t().state;const n=t().securityLevel;let c;n==="sandbox"&&(c=T("#i"+i));const l=T(n==="sandbox"?c.nodes()[0].contentDocument.body:"body"),a=n==="sandbox"?c.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=l.select(`[id='${i}']`);rt(s);const x=d.db.getRootDoc();A(x,s,void 0,!1,l,a,d);const h=m.padding,g=s.node().getBBox(),y=g.width+2*h,b=g.height+2*h;R(s,b,1.75*y,m.useMaxWidth),s.attr("viewBox",`${g.x-m.padding} ${g.y-m.padding} `+y+" "+b)},"draw"),dt=f(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,o,d,n,c,l)=>{const a=new C({compound:!0,multigraph:!0});let s,x=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){x=!1;break}o?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const h=l.db.getStates(),g=l.db.getRelations(),y=Object.keys(h);for(const r of y){const u=h[r];let p;if(o&&(u.parentId=o),u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");p=A(u.doc,w,u.id,!d,n,c,l);{w=K(w,u,d);let k=w.node().getBBox();p.width=k.width,p.height=k.height+m.padding/2,H[u.id]={y:m.compositTitleSize}}}else p=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},k=L(i,w,a);u.note.position==="left of"?(a.setNode(p.id+"-note",k),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",k)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}S.debug("Count=",a.nodeCount(),a);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:m.labelHeight*v.getRows(r.title).length,labelpos:"c"},"id"+b)}),I(a),S.debug("Graph after layout",a.nodes());const B=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+B.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(H[r]?H[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+B.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),c.querySelectorAll("#"+B.id+" #"+r+" .divider").forEach(u=>{const p=u.parentElement;let w=0,k=0;p&&(p.parentElement&&(w=p.parentElement.getBBox().width),k=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),u.setAttribute("x1",0-k+8),u.setAttribute("x2",w-k-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=B.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),at(i,a.edge(r),a.edge(r).relation))}),E=B.getBBox();const N={id:o||"root",label:o||"root",width:0,height:0};return N.width=E.width+2*m.padding,N.height=E.height+2*m.padding,S.debug("Doc rendered",N,a),N},"renderDoc"),st={setConf:it,draw:nt},ot={parser:P,get db(){return new M(1)},renderer:st,styles:O,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ot as diagram};
|
|
1
|
+
import{s as O,a as P,S as M}from"./chunk-AEK57VVT-CRjefC9t.js";import{_ as f,c as t,l as S,d as R,j as v,u as U}from"./mermaid-CMGFQ7sl.js";import{s as T}from"./transform-Cyp0GDF-.js";import{G as C}from"./graph-B8G81lu0.js";import{l as I}from"./layout-DOrZNmX_.js";import{l as W,k as j}from"./step-BwsUM5iJ.js";import"./chunk-RZ5BOZE2-ZaJw1JwS.js";import"./index-BJsnjxpc.js";import"./timer-DFzT7np-.js";import"./_baseUniq-BNwwWocp.js";import"./_baseEach-fsZbP1N8.js";import"./min-C21FYuz2.js";import"./_baseMap-B8cT6cMO.js";import"./sortBy-CI3mVihg.js";var m,z={},F=f((e,i)=>{z[e]=i},"set"),J=f(e=>z[e],"get"),D=f(()=>Object.keys(z),"keys"),Y=f(()=>D().length,"size"),$={get:J,set:F,keys:D,size:Y},X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),_=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",2*t().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),q=f((e,i)=>{const o=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),d=o.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",d.width+2*t().state.padding).attr("height",d.height+2*t().state.padding).attr("rx",t().state.radius),o},"drawSimpleState"),Z=f((e,i)=>{const o=f(function(g,y,b){const B=g.append("tspan").attr("x",2*t().state.padding).text(y);b||B.attr("dy",t().state.textHeight)},"addTspan"),d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),n=d.height,c=e.append("text").attr("x",t().state.padding).attr("y",n+.4*t().state.padding+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;i.descriptions.forEach(function(g){l||(o(c,g,a),a=!1),l=!1});const s=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+n+t().state.dividerMargin/2).attr("y2",t().state.padding+n+t().state.dividerMargin/2).attr("class","descr-divider"),x=c.node().getBBox(),h=Math.max(x.width,d.width);return s.attr("x2",h+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",h+2*t().state.padding).attr("height",x.height+n+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),K=f((e,i,o)=>{const d=t().state.padding,n=2*t().state.padding,c=e.node().getBBox(),l=c.width,a=c.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let h,g=Math.max(x,l);g===l&&(g+=n);const y=e.node().getBBox();i.doc,h=a-d,x>l&&(h=(l-g)/2+d),Math.abs(a-y.x)<d&&x>l&&(h=a-(x-l)/2);const b=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",h).attr("y",b).attr("class",o?"alt-composit":"composit").attr("width",g).attr("height",y.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",h+d),x<=l&&s.attr("x",a+(g-n)/2-x/2+d),e.insert("rect",":first-child").attr("x",h).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",3*t().state.textHeight).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",h).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",y.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),Q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),V=f((e,i)=>{let o=t().state.forkWidth,d=t().state.forkHeight;if(i.parentId){let n=o;o=d,d=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",o).attr("height",d).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),tt=f((e,i,o,d)=>{let n=0;const c=d.append("text");c.style("text-anchor","start"),c.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(v.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const x of a){const h=x.trim();if(h.length>0){const g=c.append("tspan");g.text(h),s===0&&(s+=g.node().getBBox().height),n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",o+n+1.25*t().state.noteMargin)}}return{textWidth:c.node().getBBox().width,textHeight:n}},"_drawLongText"),et=f((e,i)=>{i.attr("class","state-note");const o=i.append("rect").attr("x",0).attr("y",t().state.padding),d=i.append("g"),{textWidth:n,textHeight:c}=tt(e,0,0,d);return o.attr("height",c+2*t().state.noteMargin),o.attr("width",n+2*t().state.noteMargin),o},"drawNote"),L=f(function(e,i){const o=i.id,d={id:o,label:i.id,width:0,height:0},n=e.append("g").attr("id",o).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&Q(n),i.type!=="fork"&&i.type!=="join"||V(n,i),i.type==="note"&&et(i.note.text,n),i.type==="divider"&&_(n),i.type==="default"&&i.descriptions.length===0&&q(n,i),i.type==="default"&&i.descriptions.length>0&&Z(n,i);const c=n.node().getBBox();return d.width=c.width+2*t().state.padding,d.height=c.height+2*t().state.padding,$.set(o,d),d},"drawState"),G=0,at=f(function(e,i,o){const d=f(function(s){switch(s){case M.relationType.AGGREGATION:return"aggregation";case M.relationType.EXTENSION:return"extension";case M.relationType.COMPOSITION:return"composition";case M.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,c=W().x(function(s){return s.x}).y(function(s){return s.y}).curve(j),l=e.append("path").attr("d",c(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),l.attr("marker-end","url("+a+"#"+d(M.relationType.DEPENDENCY)+"End)"),o.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x,y:h}=U.calcLabelPosition(i.points),g=v.getRows(o.title);let y=0;const b=[];let B=0,E=0;for(let u=0;u<=g.length;u++){const p=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",x).attr("y",h+y),w=p.node().getBBox();B=Math.max(B,w.width),E=Math.min(E,w.x),S.info(w.x,x,h+y),y===0&&(y=p.node().getBBox().height,S.info("Title height",y,h)),b.push(p)}let N=y*g.length;if(g.length>1){const u=(g.length-1)*y*.5;b.forEach((p,w)=>p.attr("y",h+w*y-u)),N=y*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",x-B/2-t().state.padding/2).attr("y",h-N/2-t().state.padding/2-3.5).attr("width",B+t().state.padding).attr("height",N+t().state.padding),S.info(r)}G++},"drawEdge"),H={},it=f(function(){},"setConf"),rt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),nt=f(function(e,i,o,d){m=t().state;const n=t().securityLevel;let c;n==="sandbox"&&(c=T("#i"+i));const l=T(n==="sandbox"?c.nodes()[0].contentDocument.body:"body"),a=n==="sandbox"?c.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=l.select(`[id='${i}']`);rt(s);const x=d.db.getRootDoc();A(x,s,void 0,!1,l,a,d);const h=m.padding,g=s.node().getBBox(),y=g.width+2*h,b=g.height+2*h;R(s,b,1.75*y,m.useMaxWidth),s.attr("viewBox",`${g.x-m.padding} ${g.y-m.padding} `+y+" "+b)},"draw"),dt=f(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,o,d,n,c,l)=>{const a=new C({compound:!0,multigraph:!0});let s,x=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){x=!1;break}o?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const h=l.db.getStates(),g=l.db.getRelations(),y=Object.keys(h);for(const r of y){const u=h[r];let p;if(o&&(u.parentId=o),u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");p=A(u.doc,w,u.id,!d,n,c,l);{w=K(w,u,d);let k=w.node().getBBox();p.width=k.width,p.height=k.height+m.padding/2,H[u.id]={y:m.compositTitleSize}}}else p=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},k=L(i,w,a);u.note.position==="left of"?(a.setNode(p.id+"-note",k),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",k)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}S.debug("Count=",a.nodeCount(),a);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:m.labelHeight*v.getRows(r.title).length,labelpos:"c"},"id"+b)}),I(a),S.debug("Graph after layout",a.nodes());const B=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+B.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(H[r]?H[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+B.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),c.querySelectorAll("#"+B.id+" #"+r+" .divider").forEach(u=>{const p=u.parentElement;let w=0,k=0;p&&(p.parentElement&&(w=p.parentElement.getBBox().width),k=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),u.setAttribute("x1",0-k+8),u.setAttribute("x2",w-k-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=B.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),at(i,a.edge(r),a.edge(r).relation))}),E=B.getBBox();const N={id:o||"root",label:o||"root",width:0,height:0};return N.width=E.width+2*m.padding,N.height=E.height+2*m.padding,S.debug("Doc rendered",N,a),N},"renderDoc"),st={setConf:it,draw:nt},ot={parser:P,get db(){return new M(1)},renderer:st,styles:O,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ot as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t,b as a,a as e,S as s}from"./chunk-AEK57VVT-CRjefC9t.js";import{_ as o}from"./mermaid-CMGFQ7sl.js";import"./transform-Cyp0GDF-.js";import"./chunk-RZ5BOZE2-ZaJw1JwS.js";import"./index-BJsnjxpc.js";import"./step-BwsUM5iJ.js";import"./timer-DFzT7np-.js";var i={parser:e,get db(){return new s(2)},renderer:a,styles:t,init:o(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as ve,S as ae,ch as Le,j as pe}from"./index-
|
|
1
|
+
import{R as ve,S as ae,ch as Le,j as pe}from"./index-BJsnjxpc.js";var ge,me={exports:{}},Se,De=ge?me.exports:(ge=1,me.exports=(()=>{var Y={4567:function(B,r,o){var l=this&&this.__decorate||function(e,t,a,f){var u,p=arguments.length,c=p<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,a,f);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(c=(p<3?u(c):p>3?u(t,a,c):u(t,a))||c);return p>3&&c&&Object.defineProperty(t,a,c),c},_=this&&this.__param||function(e,t){return function(a,f){t(a,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),d=o(9924),v=o(844),g=o(4725),h=o(2585),i=o(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(u=>this._handleResize(u.rows))),this.register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(u=>this._handleChar(u))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
2
|
`))),this.register(this._terminal.onA11yTab(u=>this._handleTab(u))),this.register(this._terminal.onKey(u=>this._handleKey(u.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,i.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,v.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const a=this._terminal.buffer,f=a.lines.length.toString();for(let u=e;u<=t;u++){const p=a.lines.get(a.ydisp+u),c=[],m=(p==null?void 0:p.translateToString(!0,void 0,void 0,c))||"",y=(a.ydisp+u+1).toString(),k=this._rowElements[u];k&&(m.length===0?(k.innerText="\xA0",this._rowColumns.set(k,[0,1])):(k.textContent=m,this._rowColumns.set(k,c)),k.setAttribute("aria-posinset",y),k.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const a=e.target,f=this._rowElements[t===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let u,p;if(t===0?(u=a,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(u=this._rowElements.shift(),p=a,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{const c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var m;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===a.node&&t.offset>a.offset)&&([t,a]=[a,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:((m=f.textContent)==null?void 0:m.length)??0}),!this._rowContainer.contains(a.node))return;const u=({node:y,offset:k})=>{const L=y instanceof Text?y.parentNode:y;let w=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(w))return console.warn("row is invalid. Race condition?"),null;const x=this._rowColumns.get(L);if(!x)return console.warn("columns is null. Race condition?"),null;let T=k<x.length?x[k]:x.slice(-1)[0]+1;return T>=this._terminal.cols&&(++w,T=0),{row:w,column:T}},p=u(t),c=u(a);if(p&&c){if(p.row>c.row||p.row===c.row&&p.column>=c.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(c.row-p.row)*this._terminal.cols-p.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=l([_(1,h.IInstantiationService),_(2,g.ICoreBrowserService),_(3,g.IRenderService)],s)},3614:(B,r)=>{function o(d){return d.replace(/\r?\n/g,"\r")}function l(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function _(d,v,g,h){d=l(d=o(d),g.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function n(d,v,g){const h=g.getBoundingClientRect(),i=d.clientX-h.left-10,s=d.clientY-h.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${i}px`,v.style.top=`${s}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=l,r.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,v,g,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),v,g,h)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,v,g,h,i){n(d,v,g),i&&h.rightClickSelect(d),v.value=h.selectionText,v.select()}},7239:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=o(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,l,_,n){o.addEventListener(l,_,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(l,_,n))}}}},3551:function(B,r,o){var l=this&&this.__decorate||function(s,e,t,a){var f,u=arguments.length,p=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var c=s.length-1;c>=0;c--)(f=s[c])&&(p=(u<3?f(p):u>3?f(e,t,p):f(e,t))||p);return u>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const n=o(3656),d=o(8460),v=o(844),g=o(2585),h=o(4725);let i=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,a,f){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{var u;this._lastMouseEvent=void 0,(u=this._activeProviderReplies)==null||u.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let a=0;a<t.length;a++){const f=t[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var a,f;this._activeProviderReplies&&e||((a=this._activeProviderReplies)==null||a.forEach(u=>{u==null||u.forEach(p=>{p.link.dispose&&p.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[u,p]of this._linkProviderService.linkProviders.entries())e?(f=this._activeProviderReplies)!=null&&f.get(u)&&(t=this._checkLinkProviderResult(u,s,t)):p.provideLinks(s.y,c=>{var y,k;if(this._isMouseOut)return;const m=c==null?void 0:c.map(L=>({link:L}));(y=this._activeProviderReplies)==null||y.set(u,m),t=this._checkLinkProviderResult(u,s,t),((k=this._activeProviderReplies)==null?void 0:k.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)})}_removeIntersectingLinks(s,e){const t=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let u=0;u<f.length;u++){const p=f[u],c=p.link.range.start.y<s?0:p.link.range.start.x,m=p.link.range.end.y>s?this._bufferService.cols:p.link.range.end.x;for(let y=c;y<=m;y++){if(t.has(y)){f.splice(u--,1);break}t.add(y)}}}}_checkLinkProviderResult(s,e,t){var u;if(!this._activeProviderReplies)return t;const a=this._activeProviderReplies.get(s);let f=!1;for(let p=0;p<s;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(c=>this._linkAtPosition(c.link,e));p&&(t=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let p=0;p<this._activeProviderReplies.size;p++){const c=(u=this._activeProviderReplies.get(p))==null?void 0:u.find(m=>this._linkAtPosition(m.link,e));if(c){t=!0,this._handleNewLink(c);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,a;return(a=(t=this._currentLink)==null?void 0:t.state)==null?void 0:a.decorations.pointerCursor},set:t=>{var a;(a=this._currentLink)!=null&&a.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,a;return(a=(t=this._currentLink)==null?void 0:t.state)==null?void 0:a.decorations.underline},set:t=>{var a,f,u;(a=this._currentLink)!=null&&a.state&&((u=(f=this._currentLink)==null?void 0:f.state)==null?void 0:u.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const a=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}})))}_linkHover(s,e,t){var a;(a=this._currentLink)!=null&&a.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-a-1,t.end.x,t.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(s,e,t){var a;(a=this._currentLink)!=null&&a.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,a=s.range.end.y*this._bufferService.cols+s.range.end.x,f=e.y*this._bufferService.cols+e.x;return t<=f&&f<=a}_positionFromMouseEvent(s,e,t){const a=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,a,f){return{x1:s,y1:e,x2:t,y2:a,cols:this._bufferService.cols,fg:f}}};r.Linkifier=i=l([_(1,h.IMouseService),_(2,h.IRenderService),_(3,g.IBufferService),_(4,h.ILinkProviderService)],i)},9042:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,r,o){var l=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,f=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,i,s,e);else for(var u=h.length-1;u>=0;u--)(t=h[u])&&(f=(a<3?t(f):a>3?t(i,s,f):t(i,s))||f);return a>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=o(511),d=o(2585);let v=r.OscLinkProvider=class{constructor(h,i,s){this._bufferService=h,this._optionsService=i,this._oscLinkService=s}provideLinks(h,i){var m;const s=this._bufferService.buffer.lines.get(h-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=s.getTrimmedLength();let u=-1,p=-1,c=!1;for(let y=0;y<f;y++)if(p!==-1||s.hasContent(y)){if(s.loadCell(y,a),a.hasExtendedAttrs()&&a.extended.urlId){if(p===-1){p=y,u=a.extended.urlId;continue}c=a.extended.urlId!==u}else p!==-1&&(c=!0);if(c||p!==-1&&y===f-1){const k=(m=this._oscLinkService.getLinkData(u))==null?void 0:m.uri;if(k){const L={start:{x:p+1,y:h},end:{x:y+(c||y!==f-1?0:1),y:h}};let w=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const x=new URL(k);["http:","https:"].includes(x.protocol)||(w=!0)}catch{w=!0}w||e.push({text:k,range:L,activate:(x,T)=>t?t.activate(x,T,L):g(0,T),hover:(x,T)=>{var P;return(P=t==null?void 0:t.hover)==null?void 0:P.call(t,x,T,L)},leave:(x,T)=>{var P;return(P=t==null?void 0:t.leave)==null?void 0:P.call(t,x,T,L)}})}c=!1,a.hasExtendedAttrs()&&a.extended.urlId?(p=y,u=a.extended.urlId):(p=-1,u=-1)}}i(e)}};function g(h,i){if(confirm(`Do you want to navigate to ${i}?
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as B,r as ln,d as C,e as F,C as L,n as d,h as fn}from"./timer-DFzT7np-.js";import{c as pn,a as bn}from"./linear-
|
|
1
|
+
import{R as B,r as ln,d as C,e as F,C as L,n as d,h as fn}from"./timer-DFzT7np-.js";import{c as pn,a as bn}from"./linear-CCD4VqSh.js";import{i as yn}from"./init-DLRA0X12.js";import{aP as vn,aQ as m,aR as M,aS as N,aT as D,aU as Q,aV as wn,aW as T,aX as x,aY as U,aZ as gn,a_ as V,a$ as W,b0 as X,b1 as Z,b2 as _,b3 as $,b4 as mn,b5 as dn,b6 as Mn,b7 as Nn,b8 as Dn,b9 as kn,ba as In}from"./index-BJsnjxpc.js";function Pn(n,i){let a;if(i===void 0)for(const e of n)e!=null&&(a<e||a===void 0&&e>=e)&&(a=e);else{let e=-1;for(let r of n)(r=i(r,++e,n))!=null&&(a<r||a===void 0&&r>=r)&&(a=r)}return a}function xn(n,i){let a;if(i===void 0)for(const e of n)e!=null&&(a>e||a===void 0&&e>=e)&&(a=e);else{let e=-1;for(let r of n)(r=i(r,++e,n))!=null&&(a>r||a===void 0&&r>=r)&&(a=r)}return a}function j(n,i,a,e,r,s){const o=[[m,1,M],[m,5,5*M],[m,15,15*M],[m,30,30*M],[s,1,N],[s,5,5*N],[s,15,15*N],[s,30,30*N],[r,1,D],[r,3,3*D],[r,6,6*D],[r,12,12*D],[e,1,Q],[e,2,2*Q],[a,1,wn],[i,1,T],[i,3,3*T],[n,1,x]];function p(l,u,c){const v=Math.abs(u-l)/c,h=vn(([,,P])=>P).right(o,v);if(h===o.length)return n.every(U(l/x,u/x,c));if(h===0)return gn.every(Math.max(U(l,u,c),1));const[w,I]=o[v/o[h-1][2]<o[h][2]/v?h-1:h];return w.every(I)}return[function(l,u,c){const v=u<l;v&&([l,u]=[u,l]);const h=c&&typeof c.range=="function"?c:p(l,u,c),w=h?h.range(l,+u+1):[];return v?w.reverse():w},p]}const[Rn,Sn]=j(kn,Dn,Nn,Mn,dn,mn),[Yn,qn]=j($,_,Z,X,W,V),z=Math.PI/180,E=180/Math.PI,G=.96422,H=.82521,J=4/29,g=6/29,K=3*g*g,An=g*g*g;function O(n){if(n instanceof b)return new b(n.l,n.a,n.b,n.opacity);if(n instanceof y)return rn(n);n instanceof B||(n=ln(n));var i,a,e=q(n.r),r=q(n.g),s=q(n.b),o=R((.2225045*e+.7168786*r+.0606169*s)/1);return e===r&&r===s?i=a=o:(i=R((.4360747*e+.3850649*r+.1430804*s)/G),a=R((.0139322*e+.0971045*r+.7141733*s)/H)),new b(116*o-16,500*(i-o),200*(o-a),n.opacity)}function nn(n,i,a,e){return arguments.length===1?O(n):new b(n,i,a,e??1)}function b(n,i,a,e){this.l=+n,this.a=+i,this.b=+a,this.opacity=+e}function R(n){return n>An?Math.pow(n,1/3):n/K+J}function S(n){return n>g?n*n*n:K*(n-J)}function Y(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function q(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function k(n,i,a,e){return arguments.length===1?function(r){if(r instanceof y)return new y(r.h,r.c,r.l,r.opacity);if(r instanceof b||(r=O(r)),r.a===0&&r.b===0)return new y(NaN,0<r.l&&r.l<100?0:NaN,r.l,r.opacity);var s=Math.atan2(r.b,r.a)*E;return new y(s<0?s+360:s,Math.sqrt(r.a*r.a+r.b*r.b),r.l,r.opacity)}(n):new y(n,i,a,e??1)}function y(n,i,a,e){this.h=+n,this.c=+i,this.l=+a,this.opacity=+e}function rn(n){if(isNaN(n.h))return new b(n.l,0,0,n.opacity);var i=n.h*z;return new b(n.l,Math.cos(i)*n.c,Math.sin(i)*n.c,n.opacity)}function an(n){return function(i,a){var e=n((i=k(i)).h,(a=k(a)).h),r=d(i.c,a.c),s=d(i.l,a.l),o=d(i.opacity,a.opacity);return function(p){return i.h=e(p),i.c=r(p),i.l=s(p),i.opacity=o(p),i+""}}}C(b,nn,F(L,{brighter(n){return new b(this.l+18*(n??1),this.a,this.b,this.opacity)},darker(n){return new b(this.l-18*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,i=isNaN(this.a)?n:n+this.a/500,a=isNaN(this.b)?n:n-this.b/200;return i=G*S(i),n=1*S(n),a=H*S(a),new B(Y(3.1338561*i-1.6168667*n-.4906146*a),Y(-.9787684*i+1.9161415*n+.033454*a),Y(.0719453*i-.2289914*n+1.4052427*a),this.opacity)}})),C(y,k,F(L,{brighter(n){return new y(this.h,this.c,this.l+18*(n??1),this.opacity)},darker(n){return new y(this.h,this.c,this.l-18*(n??1),this.opacity)},rgb(){return rn(this).rgb()}}));const Bn=an(fn);var Cn=an(d);function en(n,i){var a,e=0,r=(n=n.slice()).length-1,s=n[e],o=n[r];return o<s&&(a=e,e=r,r=a,a=s,s=o,o=a),n[e]=i.floor(s),n[r]=i.ceil(o),n}function Fn(n){return new Date(n)}function Ln(n){return n instanceof Date?+n:+new Date(+n)}function A(n,i,a,e,r,s,o,p,l,u){var c=pn(),v=c.invert,h=c.domain,w=u(".%L"),I=u(":%S"),P=u("%I:%M"),tn=u("%I %p"),sn=u("%a %d"),on=u("%b %d"),un=u("%B"),cn=u("%Y");function hn(t){return(l(t)<t?w:p(t)<t?I:o(t)<t?P:s(t)<t?tn:e(t)<t?r(t)<t?sn:on:a(t)<t?un:cn)(t)}return c.invert=function(t){return new Date(v(t))},c.domain=function(t){return arguments.length?h(Array.from(t,Ln)):h().map(Fn)},c.ticks=function(t){var f=h();return n(f[0],f[f.length-1],t??10)},c.tickFormat=function(t,f){return f==null?hn:u(f)},c.nice=function(t){var f=h();return t&&typeof t.range=="function"||(t=i(f[0],f[f.length-1],t??10)),t?h(en(f,t)):c},c.copy=function(){return bn(c,A(n,i,a,e,r,s,o,p,l,u))},c}function Qn(){return yn.apply(A(Yn,qn,$,_,Z,X,W,V,m,In).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{Pn as a,Rn as b,A as c,E as d,k as e,Cn as h,Bn as i,nn as l,xn as m,en as n,z as r,Qn as t,Sn as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as r,c as yt,l as $,S as gt,T as ft,V as mt,W as xt,B as bt,X as _t,y as kt}from"./mermaid-
|
|
1
|
+
import{_ as r,c as yt,l as $,S as gt,T as ft,V as mt,W as xt,B as bt,X as _t,y as kt}from"./mermaid-CMGFQ7sl.js";import{s as V}from"./transform-Cyp0GDF-.js";import{d as K}from"./arc-Cuwikxov.js";import"./index-BJsnjxpc.js";import"./step-BwsUM5iJ.js";import"./timer-DFzT7np-.js";var G=function(){var n=r(function(s,h,l,p){for(l=l||{},p=s.length;p--;l[s[p]]=h);return l},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],o=[1,10],i=[1,11],a=[1,12],u=[1,13],f=[1,16],d=[1,17],g={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:r(function(s,h,l,p,y,c,k){var x=c.length-1;switch(y){case 1:return c[x-1];case 2:case 6:case 7:this.$=[];break;case 3:c[x-1].push(c[x]),this.$=c[x-1];break;case 4:case 5:this.$=c[x];break;case 8:p.getCommonDb().setDiagramTitle(c[x].substr(6)),this.$=c[x].substr(6);break;case 9:this.$=c[x].trim(),p.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=c[x].trim(),p.getCommonDb().setAccDescription(this.$);break;case 12:p.addSection(c[x].substr(8)),this.$=c[x].substr(8);break;case 15:p.addTask(c[x],0,""),this.$=c[x];break;case 16:p.addEvent(c[x].substr(2)),this.$=c[x]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:o,14:i,16:a,17:u,18:14,19:15,20:f,21:d},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:o,14:i,16:a,17:u,18:14,19:15,20:f,21:d},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:r(function(s,h){if(!h.recoverable){var l=new Error(s);throw l.hash=h,l}this.trace(s)},"parseError"),parse:r(function(s){var h=this,l=[0],p=[],y=[null],c=[],k=this.table,x="",N=0,P=0,D=c.slice.call(arguments,1),b=Object.create(this.lexer),I={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(I.yy[M]=this.yy[M]);b.setInput(s,I.yy),I.yy.lexer=b,I.yy.parser=this,b.yylloc===void 0&&(b.yylloc={});var v=b.yylloc;c.push(v);var A=b.options&&b.options.ranges;function L(){var T;return typeof(T=p.pop()||b.lex()||1)!="number"&&(T instanceof Array&&(T=(p=T).pop()),T=h.symbols_[T]||T),T}typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,r(function(T){l.length=l.length-2*T,y.length=y.length-T,c.length=c.length-T},"popStack"),r(L,"lex");for(var w,E,S,Y,z,C,Z,B,O={};;){if(E=l[l.length-1],this.defaultActions[E]?S=this.defaultActions[E]:(w==null&&(w=L()),S=k[E]&&k[E][w]),S===void 0||!S.length||!S[0]){var J="";for(z in B=[],k[E])this.terminals_[z]&&z>2&&B.push("'"+this.terminals_[z]+"'");J=b.showPosition?"Parse error on line "+(N+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+B.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(N+1)+": Unexpected "+(w==1?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(J,{text:b.match,token:this.terminals_[w]||w,line:b.yylineno,loc:v,expected:B})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+w);switch(S[0]){case 1:l.push(w),y.push(b.yytext),c.push(b.yylloc),l.push(S[1]),w=null,P=b.yyleng,x=b.yytext,N=b.yylineno,v=b.yylloc;break;case 2:if(C=this.productions_[S[1]][1],O.$=y[y.length-C],O._$={first_line:c[c.length-(C||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(C||1)].first_column,last_column:c[c.length-1].last_column},A&&(O._$.range=[c[c.length-(C||1)].range[0],c[c.length-1].range[1]]),(Y=this.performAction.apply(O,[x,P,N,I.yy,S[1],y,c].concat(D)))!==void 0)return Y;C&&(l=l.slice(0,-1*C*2),y=y.slice(0,-1*C),c=c.slice(0,-1*C)),l.push(this.productions_[S[1]][0]),y.push(O.$),c.push(O._$),Z=k[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},_=function(){return{EOF:1,parseError:r(function(s,h){if(!this.yy.parser)throw new Error(s);this.yy.parser.parseError(s,h)},"parseError"),setInput:r(function(s,h){return this.yy=h||this.yy||{},this._input=s,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},"setInput"),input:r(function(){var s=this._input[0];return this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s,s.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),s},"input"),unput:r(function(s){var h=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var p=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),l.length-1&&(this.yylineno-=l.length-1);var y=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:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:r(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var s=this.pastInput(),h=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{u as G,d as N,T as F,aj as J,af as K,S as M,j as s,R as Q,ak as W,al as X,am as O,an as Z,ag as ee,ao as te,ap as A,aq as re,ar as se,as as ie,__tla as oe}from"./index-C4VFj4aB.js";import{P as ae,C as le,f as V,E as ne,a as me,u as pe,__tla as ce}from"./edit-page-DqQ_uRQm.js";import{c as de}from"./compile-B99z9p1c.js";import{r as ue,b as he,__tla as xe}from"./useMarimoWebSocket-BsUbqg1d.js";import{A as ge}from"./tree-BMOusOrc.js";import{C as fe}from"./circle-play-NJSP28OU.js";import"./_createAggregator-UrANbXdP.js";import"./_baseEach-Cyw-LuDI.js";import"./transform-Cyp0GDF-.js";import"./timer-DFzT7np-.js";import"./zoom-COrs4lFh.js";import"./sortBy-Bb9JPW3o.js";import"./_baseMap-C1RlaUrw.js";import"./time-Dhxp9qd9.js";import"./linear-HjYCbFKN.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./arc-Cuwikxov.js";import"./step-BwsUM5iJ.js";import"./index-CJD1KDty.js";import"./index-D2X6Wktl.js";import"./index-HeByvlyV.js";import"./index-DoMH_weu.js";import"./index-De6_X4XZ.js";import"./index-BaaSOg-V.js";import"./index-BLczHwIF.js";import"./index-CVS30d8t.js";import"./index-Ch51YLFK.js";import"./index-CGXa2hxu.js";import"./index-BVjb7S6F.js";import"./index-CHjC2BHW.js";import"./index-MuEQoKhf.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asterisk-B46aRdXb.js";import"./brainfuck-CtZaYBKt.js";import"./clike-BgBwzOhw.js";import"./cmake-DXn5xaP-.js";import"./cobol-stawOqaz.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./crystal-CRzZ78HM.js";import"./cypher-gJDei3ni.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dockerfile-knGOOxt4.js";import"./simple-mode-C3vEBAcb.js";import"./dtd-DI9Herc-.js";import"./dylan-CHJ5qNM_.js";import"./ebnf-B-Df8AvO.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-D7xaZ7Da.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./fcl-CVaBTCzQ.js";import"./forth-Dri_5nFc.js";import"./fortran-DL7KluxX.js";import"./gas-5kEe4nk0.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CmdsSjFB.js";import"./haxe-D25e-2l-.js";import"./http-BKJkqRj4.js";import"./idl-pcmmZuaN.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mathematica-IIbmv7SK.js";import"./mbox-z_N2Mo3d.js";import"./mirc-DkvFAiy5.js";import"./modelica-DSrSSXCg.js";import"./mscgen-B2igx18G.js";import"./mumps-zvxmGV4l.js";import"./nginx-B4hAVlXN.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-FFvkTduk.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./solr-78MBEUkU.js";import"./sparql-BRLJFz69.js";import"./spreadsheet-CGlWr0eM.js";import"./stylus-OdhglgkO.js";import"./swift-B_XXVlXX.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./tiddlywiki-BgR6AEZu.js";import"./tiki-CI-ztowC.js";import"./toml-BQXy8elZ.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./turtle-BkSuIpt-.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./verilog-B4LBqg_1.js";import"./vhdl-CWWH2SUo.js";import"./webidl-CGwyPRYs.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./index-2n81G4S2.js";let U,k,ve=Promise.all([(()=>{try{return oe}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return xe}catch{}})()]).then(async()=>{const Y=G("circle-ellipsis",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]),C="hoveredCellId",$="cellHover",R="startTimestamp",P="endTimestamp";let w,L,E,z,B,H,q,D;w=J(new Map),U=()=>{const t=N.c(28),{runIds:e,runMap:r}=F(ue),l=F(w),{clearRuns:o}=he(),{theme:a}=K(),[i,u]=M.useState("above");let m;t[0]!==i?(m=()=>{u(i==="above"?"sideBySide":"above")},t[0]=i,t[1]=m):m=t[1];const x=m;if(e.length===0){let h;return t[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ae,{title:"No traces",description:s.jsx("span",{children:"Cells that have ran will appear here."}),icon:s.jsx(ge,{})}),t[2]=h):h=t[2],h}let d;t[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("label",{htmlFor:"chartPosition",className:"text-xs",children:"Inline chart"}),t[3]=d):d=t[3];const p=i==="sideBySide";let g,c,y,f,v,I;if(t[4]!==p||t[5]!==x?(g=s.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[d,s.jsx("input",{type:"checkbox",name:"chartPosition",id:"chartPosition",onClick:x,defaultChecked:p,className:"h-3 cursor-pointer"})]}),t[4]=p,t[5]=x,t[6]=g):g=t[6],t[7]!==o?(c=s.jsx(le,{dataTestId:"clear-traces-button",onClick:o}),t[7]=o,t[8]=c):c=t[8],t[9]!==g||t[10]!==c?(y=s.jsxs("div",{className:"flex flex-row justify-end gap-3",children:[g,c]}),t[9]=g,t[10]=c,t[11]=y):y=t[11],t[12]!==i||t[13]!==l||t[14]!==e||t[15]!==r||t[16]!==a){let h;t[18]!==i||t[19]!==l||t[20]!==r||t[21]!==a?(h=(S,n)=>{const j=r.get(S);if(j)return s.jsx(z,{run:j,isExpanded:l.get(j.runId),isMostRecentRun:n===0,chartPosition:i,theme:a},j.runId)},t[18]=i,t[19]=l,t[20]=r,t[21]=a,t[22]=h):h=t[22],f=e.map(h),t[12]=i,t[13]=l,t[14]=e,t[15]=r,t[16]=a,t[17]=f}else f=t[17];return t[23]!==f?(v=s.jsx("div",{className:"flex flex-col gap-3",children:f}),t[23]=f,t[24]=v):v=t[24],t[25]!==y||t[26]!==v?(I=s.jsxs("div",{className:"py-1 px-2 overflow-y-scroll",children:[y,v]}),t[25]=y,t[26]=v,t[27]=I):I=t[27],I},L=Q.lazy(()=>W(()=>import("./index-f2YtY2NK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url).then(t=>({default:t.Vega}))),E=t=>{const e=N.c(10),{ref:r,width:l}=pe(),o=l===void 0?300:l,a=t.theme==="dark"?"dark":void 0,i=o-50;let u,m;return e[0]!==t.height||e[1]!==t.signalListeners||e[2]!==t.vegaSpec||e[3]!==a||e[4]!==i?(u=s.jsx(L,{spec:t.vegaSpec,theme:a,width:i,height:t.height,signalListeners:t.signalListeners,actions:!1}),e[0]=t.height,e[1]=t.signalListeners,e[2]=t.vegaSpec,e[3]=a,e[4]=i,e[5]=u):u=e[5],e[6]!==t.className||e[7]!==r||e[8]!==u?(m=s.jsx("div",{className:t.className,ref:r,children:u}),e[6]=t.className,e[7]=r,e[8]=u,e[9]=m):m=e[9],m},z=({run:t,isMostRecentRun:e,chartPosition:r,isExpanded:l,theme:o})=>{const a=X(w),i=(l=l??e)?re:se,u=s.jsx(i,{height:16,className:"inline"}),m=s.jsxs("span",{className:"text-sm cursor-pointer",onClick:()=>{a(x=>{const d=new Map(x);return d.set(t.runId,!l),d})},children:["Run - ",O(t.runStartTime),u]});return l?s.jsx(B,{run:t,chartPosition:r,theme:o,title:m},t.runId):s.jsx("div",{className:"flex flex-col",children:s.jsx("pre",{className:"font-mono font-semibold",children:m})},t.runId)},B=t=>{const e=N.c(32),{run:r,chartPosition:l,theme:o,title:a}=t,[i,u]=M.useState();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={[$]:(S,n)=>{var _;const j=n,b=(_=j.cell)==null?void 0:_[0];u(b??null)}},e[0]=m):m=e[0];const x=m,d=Z();let p,g;if(e[1]!==d||e[2]!==l||e[3]!==r.cellRuns||e[4]!==r.runId||e[5]!==o){const S=[...r.cellRuns.values()].map(n=>{const j=n.elapsedTime??0;return{cell:n.cellId,cellNum:d.inOrderIds.indexOf(n.cellId),startTimestamp:k(n.startTime),endTimestamp:k(n.startTime+j),elapsedTime:V(1e3*j),status:n.status}});p=`hiddenInputElement-${r.runId}`,g=de(function(n,j,b,_){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",background:_==="dark"?"black":void 0,mark:{type:"bar",cornerRadius:2},params:[{name:C,bind:{element:`#${j}`}},{name:$,select:{type:"point",on:"mouseover",fields:["cell"],clear:"mouseout"}}],height:{step:b==="above"?21:26},encoding:{y:{field:"cellNum",scale:{paddingInner:.2},sort:{field:R},title:"cell",axis:b==="sideBySide"?null:void 0},x:{field:R,type:"temporal",axis:{orient:"top",title:null}},x2:{field:P,type:"temporal"},tooltip:[{field:R,type:"temporal",timeUnit:"hoursminutessecondsmilliseconds",title:"Start"},{field:P,type:"temporal",timeUnit:"hoursminutessecondsmilliseconds",title:"End"}],size:{value:{expr:`${C} == toString(datum.cell) ? 19.5 : 18`}},color:{field:"status",scale:{domain:["success","error"],range:["#37BE5F","red"]},legend:null}},data:{values:n},config:{view:{stroke:"transparent"}}}}(S,p,l,o)),e[1]=d,e[2]=l,e[3]=r.cellRuns,e[4]=r.runId,e[5]=o,e[6]=p,e[7]=g}else p=e[6],g=e[7];const c=g.spec;let y;e[8]!==p||e[9]!==i||e[10]!==r?(y=s.jsx(H,{run:r,hoveredCellId:i,hiddenInputElementId:p}),e[8]=p,e[9]=i,e[10]=r,e[11]=y):y=e[11];const f=y;if(l==="above"){let S,n,j;return e[12]!==o||e[13]!==c?(S=s.jsx(E,{vegaSpec:c,height:120,signalListeners:x,theme:o}),e[12]=o,e[13]=c,e[14]=S):S=e[14],e[15]!==S||e[16]!==a||e[17]!==f?(n=s.jsxs("pre",{className:"font-mono font-semibold",children:[a,S,f]}),e[15]=S,e[16]=a,e[17]=f,e[18]=n):n=e[18],e[19]!==r.runId||e[20]!==n?(j=s.jsx("div",{className:"flex flex-col",children:n},r.runId),e[19]=r.runId,e[20]=n,e[21]=j):j=e[21],j}let v,I,h;return e[22]!==a||e[23]!==f?(v=s.jsxs("pre",{className:"font-mono font-semibold",children:[a,f]}),e[22]=a,e[23]=f,e[24]=v):v=e[24],e[25]!==o||e[26]!==c?(I=s.jsx(E,{className:"-mt-0.5 flex-1",vegaSpec:c,height:100,signalListeners:x,theme:o}),e[25]=o,e[26]=c,e[27]=I):I=e[27],e[28]!==r.runId||e[29]!==v||e[30]!==I?(h=s.jsxs("div",{className:"flex flex-row",children:[v,I]},r.runId),e[28]=r.runId,e[29]=v,e[30]=I,e[31]=h):h=e[31],h},H=t=>{const e=N.c(12),{run:r,hoveredCellId:l,hiddenInputElementId:o}=t,a=M.useRef(null);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c=>{a.current&&(a.current.value=String(c),a.current.dispatchEvent(new Event("input",{bubbles:!0})))},e[0]=i):i=e[0];const u=i,m=l||"";let x,d,p,g;return e[1]!==o||e[2]!==m?(x=s.jsx("input",{type:"text",id:o,defaultValue:m,hidden:!0,ref:a}),e[1]=o,e[2]=m,e[3]=x):x=e[3],e[4]!==r.cellRuns?(d=[...r.cellRuns.values()],e[4]=r.cellRuns,e[5]=d):d=e[5],e[6]!==l||e[7]!==d?(p=d.map(c=>s.jsx(D,{cellRun:c,hovered:c.cellId===l,dispatchHoverEvent:u},c.cellId)),e[6]=l,e[7]=d,e[8]=p):p=e[8],e[9]!==x||e[10]!==p?(g=s.jsxs("div",{className:"text-xs mt-0.5 ml-3 flex flex-col gap-0.5",children:[x,p]}),e[9]=x,e[10]=p,e[11]=g):g=e[11],g},q={success:s.jsx(me,{color:"green",size:14}),running:s.jsx(fe,{color:"var(--blue-10)",size:14}),error:s.jsx(ie,{color:"red",size:14}),queued:s.jsx(Y,{color:"grey",size:14})},D=t=>{const e=N.c(39),{cellRun:r,hovered:l,dispatchHoverEvent:o}=t;let a;e[0]!==r.elapsedTime?(a=r.elapsedTime?V(1e3*r.elapsedTime):"-",e[0]=r.elapsedTime,e[1]=a):a=e[1];const i=a;let u;e[2]!==r.elapsedTime||e[3]!==i?(u=r.elapsedTime?s.jsxs("span",{children:["This cell took ",s.jsx(ne,{elapsedTime:i})," to run"]}):s.jsx("span",{children:"This cell has not been run"}),e[2]=r.elapsedTime,e[3]=i,e[4]=u):u=e[4];const m=u;let x;e[5]!==r.cellId||e[6]!==o?(x=()=>{o(r.cellId)},e[5]=r.cellId,e[6]=o,e[7]=x):x=e[7];const d=x;let p;e[8]!==o?(p=()=>{o(null)},e[8]=o,e[9]=p):p=e[9];const g=p,c=l&&"bg-[var(--gray-3)] opacity-100";let y,f,v,I,h,S,n;e[10]!==c?(y=ee("flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-[var(--gray-3)] hover:opacity-100",c),e[10]=c,e[11]=y):y=e[11],e[12]!==r.startTime?(f=O(r.startTime),e[12]=r.startTime,e[13]=f):f=e[13],e[14]!==f?(v=s.jsxs("span",{className:"text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",f,"]"]}),e[14]=f,e[15]=v):v=e[15],e[16]!==r.cellId?(I=s.jsxs("span",{className:"text-[var(--gray-10)] w-16",children:["(",s.jsx(te,{cellId:r.cellId}),")"]}),e[16]=r.cellId,e[17]=I):I=e[17],e[18]!==r.code?(h=s.jsx("span",{className:"w-40 truncate -ml-1",children:r.code}),e[18]=r.code,e[19]=h):h=e[19],e[20]!==i?(S=s.jsx("span",{className:"text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:i}),e[20]=i,e[21]=S):S=e[21],e[22]!==m||e[23]!==S?(n=s.jsx(A,{content:m,children:S}),e[22]=m,e[23]=S,e[24]=n):n=e[24];const j=q[r.status];let b,_,T;return e[25]!==r.status||e[26]!==j?(b=s.jsx(A,{content:r.status,children:j}),e[25]=r.status,e[26]=j,e[27]=b):b=e[27],e[28]!==n||e[29]!==b?(_=s.jsxs("div",{className:"flex flex-row gap-1 w-16 justify-end -ml-2",children:[n,b]}),e[28]=n,e[29]=b,e[30]=_):_=e[30],e[31]!==d||e[32]!==g||e[33]!==h||e[34]!==_||e[35]!==y||e[36]!==v||e[37]!==I?(T=s.jsxs("div",{className:y,onMouseEnter:d,onMouseLeave:g,children:[v,I,h,_]}),e[31]=d,e[32]=g,e[33]=h,e[34]=_,e[35]=y,e[36]=v,e[37]=I,e[38]=T):T=e[38],T},k=function(t){try{const e=new Date(1e3*t),r=e.getFullYear(),l=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),u=String(e.getSeconds()).padStart(2,"0");return`${r}-${l}-${o} ${a}:${i}:${u}.${String(e.getMilliseconds()).padStart(3,"0")}`}catch{return""}}});export{U as Tracing,ve as __tla,k as formatChartTime};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-wqkTZ9mS.js","./VegaLite-B8hQHAh-.js","./index-BJsnjxpc.js","./index-CSziElQw.css","./compile-h-VmVS3n.js","./time-DDarjbSW.js","./timer-DFzT7np-.js","./linear-CCD4VqSh.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./arc-Cuwikxov.js","./step-BwsUM5iJ.js","./index-BXbzCGbn.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as G,d as N,T as F,aj as J,af as K,S as M,j as s,R as Q,ak as W,al as X,am as O,an as Z,ag as ee,ao as te,ap as A,aq as re,ar as se,as as ie,__tla as oe}from"./index-BJsnjxpc.js";import{P as ae,C as le,f as V,E as ne,a as me,u as pe,__tla as ce}from"./edit-page-l7M3mmCs.js";import{c as de}from"./compile-h-VmVS3n.js";import{r as ue,b as he,__tla as xe}from"./useMarimoWebSocket-ChrB5-Uc.js";import{A as ge}from"./tree-D1EDUAby.js";import{C as fe}from"./circle-play-DNRu-ReT.js";import"./_createAggregator-uK9tvoQl.js";import"./_baseEach-fsZbP1N8.js";import"./transform-Cyp0GDF-.js";import"./timer-DFzT7np-.js";import"./zoom-COrs4lFh.js";import"./sortBy-CI3mVihg.js";import"./_baseMap-B8cT6cMO.js";import"./time-DDarjbSW.js";import"./linear-CCD4VqSh.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./arc-Cuwikxov.js";import"./step-BwsUM5iJ.js";import"./index-j5SusyE5.js";import"./index-B14EVG6L.js";import"./index-pmR7FK6S.js";import"./index-2TL38hPv.js";import"./index-Wzoc-_uT.js";import"./index-REXxtYrd.js";import"./index-B9Btdii4.js";import"./index-FkBJMqtJ.js";import"./index-BxkbDbzB.js";import"./index-DX1YAcio.js";import"./index-BDHXY3UE.js";import"./index-DFpzd1EA.js";import"./index-_KobMnTy.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asterisk-B46aRdXb.js";import"./brainfuck-CtZaYBKt.js";import"./clike-BgBwzOhw.js";import"./cmake-DXn5xaP-.js";import"./cobol-stawOqaz.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./crystal-CRzZ78HM.js";import"./cypher-gJDei3ni.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dockerfile-knGOOxt4.js";import"./simple-mode-C3vEBAcb.js";import"./dtd-DI9Herc-.js";import"./dylan-CHJ5qNM_.js";import"./ebnf-B-Df8AvO.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-D7xaZ7Da.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./fcl-CVaBTCzQ.js";import"./forth-Dri_5nFc.js";import"./fortran-DL7KluxX.js";import"./gas-5kEe4nk0.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CmdsSjFB.js";import"./haxe-D25e-2l-.js";import"./http-BKJkqRj4.js";import"./idl-pcmmZuaN.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mathematica-IIbmv7SK.js";import"./mbox-z_N2Mo3d.js";import"./mirc-DkvFAiy5.js";import"./modelica-DSrSSXCg.js";import"./mscgen-B2igx18G.js";import"./mumps-zvxmGV4l.js";import"./nginx-B4hAVlXN.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-FFvkTduk.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./solr-78MBEUkU.js";import"./sparql-BRLJFz69.js";import"./spreadsheet-CGlWr0eM.js";import"./stylus-OdhglgkO.js";import"./swift-B_XXVlXX.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./tiddlywiki-BgR6AEZu.js";import"./tiki-CI-ztowC.js";import"./toml-BQXy8elZ.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./turtle-BkSuIpt-.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./verilog-B4LBqg_1.js";import"./vhdl-CWWH2SUo.js";import"./webidl-CGwyPRYs.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./index-BXbzCGbn.js";let U,k,ve=Promise.all([(()=>{try{return oe}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return xe}catch{}})()]).then(async()=>{const Y=G("circle-ellipsis",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]),C="hoveredCellId",$="cellHover",R="startTimestamp",P="endTimestamp";let w,L,E,z,B,H,q,D;w=J(new Map),U=()=>{const t=N.c(28),{runIds:e,runMap:r}=F(ue),l=F(w),{clearRuns:o}=he(),{theme:a}=K(),[i,u]=M.useState("above");let m;t[0]!==i?(m=()=>{u(i==="above"?"sideBySide":"above")},t[0]=i,t[1]=m):m=t[1];const x=m;if(e.length===0){let h;return t[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ae,{title:"No traces",description:s.jsx("span",{children:"Cells that have ran will appear here."}),icon:s.jsx(ge,{})}),t[2]=h):h=t[2],h}let d;t[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("label",{htmlFor:"chartPosition",className:"text-xs",children:"Inline chart"}),t[3]=d):d=t[3];const p=i==="sideBySide";let g,c,y,f,v,I;if(t[4]!==p||t[5]!==x?(g=s.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[d,s.jsx("input",{type:"checkbox",name:"chartPosition",id:"chartPosition",onClick:x,defaultChecked:p,className:"h-3 cursor-pointer"})]}),t[4]=p,t[5]=x,t[6]=g):g=t[6],t[7]!==o?(c=s.jsx(le,{dataTestId:"clear-traces-button",onClick:o}),t[7]=o,t[8]=c):c=t[8],t[9]!==g||t[10]!==c?(y=s.jsxs("div",{className:"flex flex-row justify-end gap-3",children:[g,c]}),t[9]=g,t[10]=c,t[11]=y):y=t[11],t[12]!==i||t[13]!==l||t[14]!==e||t[15]!==r||t[16]!==a){let h;t[18]!==i||t[19]!==l||t[20]!==r||t[21]!==a?(h=(S,n)=>{const j=r.get(S);if(j)return s.jsx(z,{run:j,isExpanded:l.get(j.runId),isMostRecentRun:n===0,chartPosition:i,theme:a},j.runId)},t[18]=i,t[19]=l,t[20]=r,t[21]=a,t[22]=h):h=t[22],f=e.map(h),t[12]=i,t[13]=l,t[14]=e,t[15]=r,t[16]=a,t[17]=f}else f=t[17];return t[23]!==f?(v=s.jsx("div",{className:"flex flex-col gap-3",children:f}),t[23]=f,t[24]=v):v=t[24],t[25]!==y||t[26]!==v?(I=s.jsxs("div",{className:"py-1 px-2 overflow-y-scroll",children:[y,v]}),t[25]=y,t[26]=v,t[27]=I):I=t[27],I},L=Q.lazy(()=>W(()=>import("./index-wqkTZ9mS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url).then(t=>({default:t.Vega}))),E=t=>{const e=N.c(10),{ref:r,width:l}=pe(),o=l===void 0?300:l,a=t.theme==="dark"?"dark":void 0,i=o-50;let u,m;return e[0]!==t.height||e[1]!==t.signalListeners||e[2]!==t.vegaSpec||e[3]!==a||e[4]!==i?(u=s.jsx(L,{spec:t.vegaSpec,theme:a,width:i,height:t.height,signalListeners:t.signalListeners,actions:!1}),e[0]=t.height,e[1]=t.signalListeners,e[2]=t.vegaSpec,e[3]=a,e[4]=i,e[5]=u):u=e[5],e[6]!==t.className||e[7]!==r||e[8]!==u?(m=s.jsx("div",{className:t.className,ref:r,children:u}),e[6]=t.className,e[7]=r,e[8]=u,e[9]=m):m=e[9],m},z=({run:t,isMostRecentRun:e,chartPosition:r,isExpanded:l,theme:o})=>{const a=X(w),i=(l=l??e)?re:se,u=s.jsx(i,{height:16,className:"inline"}),m=s.jsxs("span",{className:"text-sm cursor-pointer",onClick:()=>{a(x=>{const d=new Map(x);return d.set(t.runId,!l),d})},children:["Run - ",O(t.runStartTime),u]});return l?s.jsx(B,{run:t,chartPosition:r,theme:o,title:m},t.runId):s.jsx("div",{className:"flex flex-col",children:s.jsx("pre",{className:"font-mono font-semibold",children:m})},t.runId)},B=t=>{const e=N.c(32),{run:r,chartPosition:l,theme:o,title:a}=t,[i,u]=M.useState();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={[$]:(S,n)=>{var _;const j=n,b=(_=j.cell)==null?void 0:_[0];u(b??null)}},e[0]=m):m=e[0];const x=m,d=Z();let p,g;if(e[1]!==d||e[2]!==l||e[3]!==r.cellRuns||e[4]!==r.runId||e[5]!==o){const S=[...r.cellRuns.values()].map(n=>{const j=n.elapsedTime??0;return{cell:n.cellId,cellNum:d.inOrderIds.indexOf(n.cellId),startTimestamp:k(n.startTime),endTimestamp:k(n.startTime+j),elapsedTime:V(1e3*j),status:n.status}});p=`hiddenInputElement-${r.runId}`,g=de(function(n,j,b,_){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",background:_==="dark"?"black":void 0,mark:{type:"bar",cornerRadius:2},params:[{name:C,bind:{element:`#${j}`}},{name:$,select:{type:"point",on:"mouseover",fields:["cell"],clear:"mouseout"}}],height:{step:b==="above"?21:26},encoding:{y:{field:"cellNum",scale:{paddingInner:.2},sort:{field:R},title:"cell",axis:b==="sideBySide"?null:void 0},x:{field:R,type:"temporal",axis:{orient:"top",title:null}},x2:{field:P,type:"temporal"},tooltip:[{field:R,type:"temporal",timeUnit:"hoursminutessecondsmilliseconds",title:"Start"},{field:P,type:"temporal",timeUnit:"hoursminutessecondsmilliseconds",title:"End"}],size:{value:{expr:`${C} == toString(datum.cell) ? 19.5 : 18`}},color:{field:"status",scale:{domain:["success","error"],range:["#37BE5F","red"]},legend:null}},data:{values:n},config:{view:{stroke:"transparent"}}}}(S,p,l,o)),e[1]=d,e[2]=l,e[3]=r.cellRuns,e[4]=r.runId,e[5]=o,e[6]=p,e[7]=g}else p=e[6],g=e[7];const c=g.spec;let y;e[8]!==p||e[9]!==i||e[10]!==r?(y=s.jsx(H,{run:r,hoveredCellId:i,hiddenInputElementId:p}),e[8]=p,e[9]=i,e[10]=r,e[11]=y):y=e[11];const f=y;if(l==="above"){let S,n,j;return e[12]!==o||e[13]!==c?(S=s.jsx(E,{vegaSpec:c,height:120,signalListeners:x,theme:o}),e[12]=o,e[13]=c,e[14]=S):S=e[14],e[15]!==S||e[16]!==a||e[17]!==f?(n=s.jsxs("pre",{className:"font-mono font-semibold",children:[a,S,f]}),e[15]=S,e[16]=a,e[17]=f,e[18]=n):n=e[18],e[19]!==r.runId||e[20]!==n?(j=s.jsx("div",{className:"flex flex-col",children:n},r.runId),e[19]=r.runId,e[20]=n,e[21]=j):j=e[21],j}let v,I,h;return e[22]!==a||e[23]!==f?(v=s.jsxs("pre",{className:"font-mono font-semibold",children:[a,f]}),e[22]=a,e[23]=f,e[24]=v):v=e[24],e[25]!==o||e[26]!==c?(I=s.jsx(E,{className:"-mt-0.5 flex-1",vegaSpec:c,height:100,signalListeners:x,theme:o}),e[25]=o,e[26]=c,e[27]=I):I=e[27],e[28]!==r.runId||e[29]!==v||e[30]!==I?(h=s.jsxs("div",{className:"flex flex-row",children:[v,I]},r.runId),e[28]=r.runId,e[29]=v,e[30]=I,e[31]=h):h=e[31],h},H=t=>{const e=N.c(12),{run:r,hoveredCellId:l,hiddenInputElementId:o}=t,a=M.useRef(null);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c=>{a.current&&(a.current.value=String(c),a.current.dispatchEvent(new Event("input",{bubbles:!0})))},e[0]=i):i=e[0];const u=i,m=l||"";let x,d,p,g;return e[1]!==o||e[2]!==m?(x=s.jsx("input",{type:"text",id:o,defaultValue:m,hidden:!0,ref:a}),e[1]=o,e[2]=m,e[3]=x):x=e[3],e[4]!==r.cellRuns?(d=[...r.cellRuns.values()],e[4]=r.cellRuns,e[5]=d):d=e[5],e[6]!==l||e[7]!==d?(p=d.map(c=>s.jsx(D,{cellRun:c,hovered:c.cellId===l,dispatchHoverEvent:u},c.cellId)),e[6]=l,e[7]=d,e[8]=p):p=e[8],e[9]!==x||e[10]!==p?(g=s.jsxs("div",{className:"text-xs mt-0.5 ml-3 flex flex-col gap-0.5",children:[x,p]}),e[9]=x,e[10]=p,e[11]=g):g=e[11],g},q={success:s.jsx(me,{color:"green",size:14}),running:s.jsx(fe,{color:"var(--blue-10)",size:14}),error:s.jsx(ie,{color:"red",size:14}),queued:s.jsx(Y,{color:"grey",size:14})},D=t=>{const e=N.c(39),{cellRun:r,hovered:l,dispatchHoverEvent:o}=t;let a;e[0]!==r.elapsedTime?(a=r.elapsedTime?V(1e3*r.elapsedTime):"-",e[0]=r.elapsedTime,e[1]=a):a=e[1];const i=a;let u;e[2]!==r.elapsedTime||e[3]!==i?(u=r.elapsedTime?s.jsxs("span",{children:["This cell took ",s.jsx(ne,{elapsedTime:i})," to run"]}):s.jsx("span",{children:"This cell has not been run"}),e[2]=r.elapsedTime,e[3]=i,e[4]=u):u=e[4];const m=u;let x;e[5]!==r.cellId||e[6]!==o?(x=()=>{o(r.cellId)},e[5]=r.cellId,e[6]=o,e[7]=x):x=e[7];const d=x;let p;e[8]!==o?(p=()=>{o(null)},e[8]=o,e[9]=p):p=e[9];const g=p,c=l&&"bg-[var(--gray-3)] opacity-100";let y,f,v,I,h,S,n;e[10]!==c?(y=ee("flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-[var(--gray-3)] hover:opacity-100",c),e[10]=c,e[11]=y):y=e[11],e[12]!==r.startTime?(f=O(r.startTime),e[12]=r.startTime,e[13]=f):f=e[13],e[14]!==f?(v=s.jsxs("span",{className:"text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",f,"]"]}),e[14]=f,e[15]=v):v=e[15],e[16]!==r.cellId?(I=s.jsxs("span",{className:"text-[var(--gray-10)] w-16",children:["(",s.jsx(te,{cellId:r.cellId}),")"]}),e[16]=r.cellId,e[17]=I):I=e[17],e[18]!==r.code?(h=s.jsx("span",{className:"w-40 truncate -ml-1",children:r.code}),e[18]=r.code,e[19]=h):h=e[19],e[20]!==i?(S=s.jsx("span",{className:"text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:i}),e[20]=i,e[21]=S):S=e[21],e[22]!==m||e[23]!==S?(n=s.jsx(A,{content:m,children:S}),e[22]=m,e[23]=S,e[24]=n):n=e[24];const j=q[r.status];let b,_,T;return e[25]!==r.status||e[26]!==j?(b=s.jsx(A,{content:r.status,children:j}),e[25]=r.status,e[26]=j,e[27]=b):b=e[27],e[28]!==n||e[29]!==b?(_=s.jsxs("div",{className:"flex flex-row gap-1 w-16 justify-end -ml-2",children:[n,b]}),e[28]=n,e[29]=b,e[30]=_):_=e[30],e[31]!==d||e[32]!==g||e[33]!==h||e[34]!==_||e[35]!==y||e[36]!==v||e[37]!==I?(T=s.jsxs("div",{className:y,onMouseEnter:d,onMouseLeave:g,children:[v,I,h,_]}),e[31]=d,e[32]=g,e[33]=h,e[34]=_,e[35]=y,e[36]=v,e[37]=I,e[38]=T):T=e[38],T},k=function(t){try{const e=new Date(1e3*t),r=e.getFullYear(),l=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),u=String(e.getSeconds()).padStart(2,"0");return`${r}-${l}-${o} ${a}:${i}:${u}.${String(e.getMilliseconds()).padStart(3,"0")}`}catch{return""}}});export{U as Tracing,ve as __tla,k as formatChartTime};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ca as to,aI as no,u as Y,el as jn,R as qe,d as q,f6 as wn,j as o,bs as ro,ac as Ve,bB as io,dM as et,ap as Ot,f7 as oo,S as w,cx as tt,ag as Ct,f8 as so,eb as nt,aj as Ae,f9 as ao,fa as In,bc as lo,fb as co,L as M,fc as uo,fd as ho,fe as fo,ff as po,fg as Me,ch as go,fh as mo,a8 as Ce,al as rt,bw as Be,bK as it,fi as le,a2 as ie,dI as vo,eB as Sn,a9 as yo,a7 as xo,fj as bo,fk as ye,fl as jo,fm as wo,fn as On,fo as ot,fp as Cn,fq as Io,fr as st,fs as $,ft as So,fu as Oo,di as kt,f0 as Co,fv as Nt,fw as ko,fx as No,fy as kn,fz as Nn,fA as Do,aH as at,T as Re,fB as Dt,bb as Eo,fC as Et,aJ as Dn,e0 as En,fD as Tn,fE as To,bI as oe,fF as _o,fG as _n,fH as Po,a0 as Tt,fI as Ao,fJ as Mo,a3 as Pn,a4 as Ro,a5 as Lo,aE as Fo,fK as An,fL as _t,as as Ho,fM as zo,bt as Mn,fN as Uo,fO as fe,E as qo,fP as Vo,fQ as lt,fR as Bo,fS as Wo,fT as Ko,eZ as Go,fU as Rn,fV as $o,fW as Ln,fX as Yo,fY as Xo,fZ as Fn,f_ as Qo,f$ as T,g0 as _,g1 as E,g2 as P,g3 as R,g4 as pe,g5 as z,g6 as Zo,bJ as ge,g7 as Jo,g8 as es,dG as ct,dz as Hn,bG as ts,g9 as ns,cd as zn,ga as rs,gb as is,eQ as os,gc as Un,gd as qn,ge as ss,gf as Vn,a1 as as,gg as ls,gh as cs,gi as us,gj as ds,gk as hs}from"./index-
|
|
1
|
+
import{ca as to,aI as no,u as Y,el as jn,R as qe,d as q,f6 as wn,j as o,bs as ro,ac as Ve,bB as io,dM as et,ap as Ot,f7 as oo,S as w,cx as tt,ag as Ct,f8 as so,eb as nt,aj as Ae,f9 as ao,fa as In,bc as lo,fb as co,L as M,fc as uo,fd as ho,fe as fo,ff as po,fg as Me,ch as go,fh as mo,a8 as Ce,al as rt,bw as Be,bK as it,fi as le,a2 as ie,dI as vo,eB as Sn,a9 as yo,a7 as xo,fj as bo,fk as ye,fl as jo,fm as wo,fn as On,fo as ot,fp as Cn,fq as Io,fr as st,fs as $,ft as So,fu as Oo,di as kt,f0 as Co,fv as Nt,fw as ko,fx as No,fy as kn,fz as Nn,fA as Do,aH as at,T as Re,fB as Dt,bb as Eo,fC as Et,aJ as Dn,e0 as En,fD as Tn,fE as To,bI as oe,fF as _o,fG as _n,fH as Po,a0 as Tt,fI as Ao,fJ as Mo,a3 as Pn,a4 as Ro,a5 as Lo,aE as Fo,fK as An,fL as _t,as as Ho,fM as zo,bt as Mn,fN as Uo,fO as fe,E as qo,fP as Vo,fQ as lt,fR as Bo,fS as Wo,fT as Ko,eZ as Go,fU as Rn,fV as $o,fW as Ln,fX as Yo,fY as Xo,fZ as Fn,f_ as Qo,f$ as T,g0 as _,g1 as E,g2 as P,g3 as R,g4 as pe,g5 as z,g6 as Zo,bJ as ge,g7 as Jo,g8 as es,dG as ct,dz as Hn,bG as ts,g9 as ns,cd as zn,ga as rs,gb as is,eQ as os,gc as Un,gd as qn,ge as ss,gf as Vn,a1 as as,gg as ls,gh as cs,gi as us,gj as ds,gk as hs}from"./index-BJsnjxpc.js";import{e as fs}from"./index-BXbzCGbn.js";/**
|
|
2
2
|
* @license lucide-react v0.503.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -14,4 +14,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
14
14
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ni(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pc(t,e,n){var r=De(),i=function(a,l){var c=w.useMemo(function(){return new hc(a,l)},[l]);return w.useEffect(function(){c.spec=a},[a]),c}(t,e),s=function(a){var l=a.accept;return w.useMemo(function(){return N(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);Ne(function(){var a=function(u,g,v){var p=v.getRegistry(),h=p.addTarget(u,g);return[h,function(){return p.removeTarget(h)}]}(s,i,r),l=fc(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,i,n,s.map(function(a){return a.toString()}).join("|")])}function gc(t){return w.useMemo(function(){return t.hooks.dropTarget()},[t])}function Di(t,e){var n,r=wi(t,e),i=(n=De(),w.useMemo(function(){return new Yl(n)},[n])),s=function(a){var l=De(),c=w.useMemo(function(){return new ec(l.getBackend())},[l]);return Ne(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return pc(r,i,s),[Ci(r.collect,i,s),gc(s)]}function mc(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Ei(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ei(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
15
15
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ei(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ti(t){var e=null;return function(){return e==null&&(e=t()),e}}function vc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function _i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yc=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),_i(this,"entered",[]),_i(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return vc(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,s){var a=new Set,l=function(d){return a.add(d)};i.forEach(l),s.forEach(l);var c=[];return a.forEach(function(d){return c.push(d)}),c}(this.entered.filter(function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(e))}),[e]),r===0&&this.entered.length>0}},{key:"leave",value:function(e){var n,r,i=this.entered.length;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter(function(s){return s!==r})),i>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),xc=Ti(function(){return/firefox/i.test(navigator.userAgent)}),Pi=Ti(function(){return!!window.safari});function bc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Xe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ai=function(){function t(e,n){(function(H,U){if(!(H instanceof U))throw new TypeError("Cannot call a class as a function")})(this,t),Xe(this,"xs",void 0),Xe(this,"ys",void 0),Xe(this,"c1s",void 0),Xe(this,"c2s",void 0),Xe(this,"c3s",void 0);for(var r=e.length,i=[],s=0;s<r;s++)i.push(s);i.sort(function(H,U){return e[H]<e[U]?-1:1});for(var a,l,c=[],d=[],u=0;u<r-1;u++)a=e[u+1]-e[u],l=n[u+1]-n[u],c.push(a),d.push(l/a);for(var g=[d[0]],v=0;v<c.length-1;v++){var p=d[v],h=d[v+1];if(p*h<=0)g.push(0);else{a=c[v];var f=c[v+1],m=a+f;g.push(3*m/((m+f)/p+(m+a)/h))}}g.push(d[d.length-1]);for(var x,j=[],b=[],C=0;C<g.length-1;C++){x=d[C];var O=g[C],k=1/c[C],D=O+g[C+1]-x-x;j.push((x-O-D)*k),b.push(D*k*k)}this.xs=e,this.ys=n,this.c1s=g,this.c2s=j,this.c3s=b}return bc(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,s=this.c2s,a=this.c3s,l=n.length-1;if(e===n[l])return r[l];for(var c,d=0,u=a.length-1;d<=u;){var g=n[c=Math.floor(.5*(d+u))];if(g<e)d=c+1;else{if(!(g>e))return r[c];u=c-1}}var v=e-n[l=Math.max(0,u)],p=v*v;return r[l]+i[l]*v+s[l]*p+a[l]*v*p}}]),t}();function Mi(t){var e=t.nodeType===1?t:t.parentElement;if(!e)return null;var n=e.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function bt(t){return{x:t.clientX,y:t.clientY}}function jc(t,e,n,r,i){var s,a,l,c=(s=e).nodeName==="IMG"&&(xc()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(s))),d=Mi(c?t:e),u={x:n.x-d.x,y:n.y-d.y},g=t.offsetWidth,v=t.offsetHeight,p=r.anchorX,h=r.anchorY,f=function(O,k,D,H){var U=O?k.width:D,B=O?k.height:H;return Pi()&&O&&(B/=window.devicePixelRatio,U/=window.devicePixelRatio),{dragPreviewWidth:U,dragPreviewHeight:B}}(c,e,g,v),m=f.dragPreviewWidth,x=f.dragPreviewHeight,j=i.offsetX,b=i.offsetY,C=b===0||b;return{x:j===0||j?j:new Ai([0,.5,1],[u.x,u.x/g*m,u.x+m-g]).interpolate(p),y:C?b:(l=new Ai([0,.5,1],[u.y,u.y/v*x,u.y+x-v]).interpolate(h),Pi()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var Ri="__NATIVE_FILE__",Li="__NATIVE_URL__",Fi="__NATIVE_TEXT__",Hi="__NATIVE_HTML__";const zi=Object.freeze(Object.defineProperty({__proto__:null,FILE:Ri,HTML:Hi,TEXT:Fi,URL:Li},Symbol.toStringTag,{value:"Module"}));function un(t,e,n){var r=e.reduce(function(i,s){return i||t.getData(s)},"");return r??n}var Qe;function jt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var dn=(jt(Qe={},Ri,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),jt(Qe,Hi,{exposeProperties:{html:function(t,e){return un(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),jt(Qe,Li,{exposeProperties:{urls:function(t,e){return un(t,e,"").split(`
|
|
16
16
|
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),jt(Qe,Fi,{exposeProperties:{text:function(t,e){return un(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Qe);function wc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ui(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ic=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ui(this,"item",void 0),Ui(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return wc(t,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(e.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var n=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach(function(i){r[i]={value:n.config.exposeProperties[i](e,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,n){return n===e.getSourceId()}},{key:"endDrag",value:function(){}}]),t}();function hn(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(dn).filter(function(n){return dn[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function Sc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function fn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Oc=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),fn(this,"ownerDocument",null),fn(this,"globalContext",void 0),fn(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return Sc(t,[{key:"window",get:function(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}},{key:"document",get:function(){var e;return(e=this.globalContext)!==null&&e!==void 0&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}}]),t}();function qi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qi(Object(n),!0).forEach(function(r){A(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qi(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var pn,kc=function(){function t(e,n,r){var i=this;(function(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")})(this,t),A(this,"options",void 0),A(this,"actions",void 0),A(this,"monitor",void 0),A(this,"registry",void 0),A(this,"enterLeaveCounter",void 0),A(this,"sourcePreviewNodes",new Map),A(this,"sourcePreviewNodeOptions",new Map),A(this,"sourceNodes",new Map),A(this,"sourceNodeOptions",new Map),A(this,"dragStartSourceIds",null),A(this,"dropTargetIds",[]),A(this,"dragEnterTargetIds",[]),A(this,"currentNativeSource",null),A(this,"currentNativeHandle",null),A(this,"currentDragSourceNode",null),A(this,"altKeyPressed",!1),A(this,"mouseMoveTimeoutTimer",null),A(this,"asyncEndDragFrameId",null),A(this,"dragOverTargetIds",null),A(this,"lastClientOffset",null),A(this,"hoverRafId",null),A(this,"getSourceClientOffset",function(s){var a=i.sourceNodes.get(s);return a&&Mi(a)||null}),A(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),A(this,"isNodeInDocument",function(s){return!!(s&&i.document&&i.document.body&&i.document.body.contains(s))}),A(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=i.currentDragSourceNode;s==null||i.isNodeInDocument(s)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),A(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var l=bt(s);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:l});var c=s.dataTransfer,d=hn(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=i.monitor.getSourceId(),g=i.sourceNodes.get(u),v=i.sourcePreviewNodes.get(u)||g;if(v){var p=i.getCurrentSourcePreviewNodeOptions(),h=jc(g,v,l,{anchorX:p.anchorX,anchorY:p.anchorY},{offsetX:p.offsetX,offsetY:p.offsetY});c.setDragImage(v,h.x,h.y)}}try{c==null||c.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(s.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(d)i.beginDragNativeItem(d);else{if(c&&!c.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),A(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleTopDragEnterCapture",function(s){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(s.target)&&!i.monitor.isDragging()){var a=s.dataTransfer,l=hn(a);l&&i.beginDragNativeItem(l,a)}}),A(this,"handleTopDragEnter",function(s){var a=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=s.altKey,a.length>0&&i.actions.hover(a,{clientOffset:bt(s)}),a.some(function(l){return i.monitor.canDropOnTarget(l)})&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),A(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),A(this,"handleTopDragOver",function(s){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return s.preventDefault(),void(s.dataTransfer&&(s.dataTransfer.dropEffect="none"));i.altKeyPressed=s.altKey,i.lastClientOffset=bt(s),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null})),(a||[]).some(function(l){return i.monitor.canDropOnTarget(l)})?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),A(this,"handleTopDragLeaveCapture",function(s){i.isDraggingNativeItem()&&s.preventDefault(),i.enterLeaveCounter.leave(s.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),A(this,"handleTopDropCapture",function(s){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(s.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(s.dataTransfer)):hn(s.dataTransfer)&&s.preventDefault(),i.enterLeaveCounter.reset()}),A(this,"handleTopDrop",function(s){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:bt(s)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleSelectStart",function(s){var a=s.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(s.preventDefault(),a.dragDrop()))}),this.options=new Oc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new yc(this.isNodeInDocument)}return Cc(t,[{key:"profile",value:function(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,n=this.rootElement;n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,n,r){var i=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),function(){i.sourcePreviewNodes.delete(e),i.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,n,r){var i=this;this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);var s=function(l){return i.handleDragStart(l,e)},a=function(l){return i.handleSelectStart(l)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",s),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",s),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,n){var r=this,i=function(l){return r.handleDragEnter(l,e)},s=function(l){return r.handleDragOver(l,e)},a=function(l){return r.handleDrop(l,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",s),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",s),n.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Vi({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Vi({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(zi).some(function(n){return zi[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var s=new Ic(dn[r]);return s.loadDataTransfer(i),s}(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var r;return(r=n.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;return this.currentDragSourceNode=null,this.rootElement&&((e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(e,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(e,n){this.dropTargetIds.unshift(n)}}]),t}(),Nc=function(t,e,n){return new kc(t,e,n)};function Dc(t){const e=ae(),n=e.selectedIds,[r,i,s]=uc(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(He.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(He.dragEnd())}}),[n,t]);return w.useEffect(()=>{s((pn||((pn=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),pn))},[s]),i}function wt(t,e){return{parentId:t||null,index:e}}function Ue(t,e){return{type:"line",index:t,level:e}}function gn(t,e){var n;let r=t;for(;r.parent&&r.level>e;)r=r.parent;return{parentId:((n=r.parent)===null||n===void 0?void 0:n.id)||null,index:Ir(r)+1}}function Bi(t){var e;const n=function(g,v){const p=g.getBoundingClientRect(),h=v.x-Math.round(p.x),f=v.y-Math.round(p.y),m=p.height,x=f<m/2,j=!x,b=m/4,C=f>b&&f<m-b;return{x:h,inTopHalf:x,inBottomHalf:j,inMiddle:C,atTop:!C&&x,atBottom:!C&&j}}(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:s,nextNode:a,prevNode:l}=t,[c,d]=function(g,v,p,h){return g?g.isInternal?h.atTop?[v,g]:h.inMiddle?[g,g]:[g,p]:h.inTopHalf?[v,g]:[g,p]:[v,null]}(s,l,a,n);if(s&&s.isInternal&&n.inMiddle)return{drop:wt(s.id,null),cursor:(u=s.id,{type:"highlight",id:u})};var u;if(!c)return{drop:wt((e=d==null?void 0:d.parent)===null||e===void 0?void 0:e.id,0),cursor:Ue(0,0)};if(xr(c)){const g=pt(i,(d==null?void 0:d.level)||0,c.level);return{drop:gn(c,g),cursor:Ue(c.rowIndex+1,g)}}if(br(c)){const g=pt(i,(d==null?void 0:d.level)||0,c.level);return{drop:gn(c,g),cursor:Ue(c.rowIndex+1,g)}}if(jr(c)){const g=pt(i,0,c.level+1);return g>c.level?{drop:wt(c.id,0),cursor:Ue(c.rowIndex+1,g)}:{drop:gn(c,g),cursor:Ue(c.rowIndex+1,g)}}return{drop:wt(c==null?void 0:c.id,0),cursor:Ue(c.rowIndex+1,c.level+1)}}const Ec=qe.memo(function({index:t,style:e}){yr(),function(){if(w.useContext(gr)===null)throw new Error("Provide a NodesContext")}();const n=ae(),r=function(h){const f=ae(),m=f.at(h);if(!m)throw new Error(`Could not find node for index: ${h}`);return w.useMemo(()=>{const x=m.clone();return f.visibleNodes[h]=x,x},[...Object.values(m.state),m])}(t),i=w.useRef(null),s=Dc(r),a=function(h,f){const m=ae(),[x,j]=Di(()=>({accept:"NODE",canDrop:()=>m.canDrop(),hover:(b,C)=>{const O=C.getClientOffset();if(!h.current||!O)return;const{cursor:k,drop:D}=Bi({element:h.current,offset:O,indent:m.indent,node:f,prevNode:f.prev,nextNode:f.next});D&&m.dispatch(He.hovering(D.parentId,D.index)),C.canDrop()?k&&m.showCursor(k):m.hideCursor()},drop:(b,C)=>{if(!C.canDrop())return null;let{parentId:O,index:k,dragIds:D}=m.state.dnd;Nr(m.props.onMove,{dragIds:D,parentId:O===Ge?null:O,index:k===null?0:k,dragNodes:m.dragNodes,parentNode:m.get(O)}),m.open(O)}}),[f,h.current,m.props]);return j}(i,r),l=w.useCallback(h=>{i.current=h,a(h)},[a]),c=n.indent*r.level,d=w.useMemo(()=>({paddingLeft:c}),[c]),u=w.useMemo(()=>{var h,f;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((f=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[e,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};w.useEffect(()=>{var h;!r.isEditing&&r.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const v=n.renderNode,p=n.renderRow;return o.jsx(p,{node:r,innerRef:l,attrs:g,children:o.jsx(v,{node:r,tree:n,style:d,dragHandle:s})})});let mn="",Wi=null;function Ki(){yr();const t=ae();return o.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var n;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let s=t.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=t.lastNode),t.focus(s,{scroll:!1}),t.delete(Array.from(i))}else{const s=t.focusedNode;if(s){const a=s.nextSibling,l=s.parent;t.focus(a||l,{scroll:!1}),t.delete(s)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void Sr(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void Or(e.currentTarget);if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey)return t.select(t.focusedNode),void t.activate(t.focusedNode);if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const s=t.focusedNode;return void(s?s.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode))}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const s=t.focusedNode;return void(s?s.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode))}}if(e.key==="ArrowRight"){const i=t.focusedNode;return i?void(i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id)):void 0}if(e.key==="ArrowLeft"){const i=t.focusedNode;return!i||i.isRoot?void 0:void(i.isInternal&&i.isOpen?t.close(i.id):((n=i.parent)===null||n===void 0?void 0:n.isRoot)||t.focus(i.parent))}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection)return e.preventDefault(),void t.selectAll();if(e.key==="a"&&!e.metaKey&&t.props.onCreate)return void t.createLeaf();if(e.key==="A"&&!e.metaKey)return t.props.onCreate?void t.createInternal():void 0;if(e.key==="Home")return e.preventDefault(),void t.focus(t.firstNode);if(e.key==="End")return e.preventDefault(),void t.focus(t.lastNode);if(e.key==="Enter"){const i=t.focusedNode;return!i||!i.isEditable||!t.props.onRename?void 0:void setTimeout(()=>{i&&t.edit(i)})}if(e.key===" "){e.preventDefault();const i=t.focusedNode;return i?void(i.isLeaf?(i.select(),i.activate()):i.toggle()):void 0}if(e.key==="*"){const i=t.focusedNode;return i?void t.openSiblings(i):void 0}if(e.key==="PageUp")return e.preventDefault(),void t.pageUp();e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Wi),mn+=e.key,Wi=setTimeout(()=>{mn=""},600);const r=t.visibleNodes.find(i=>{const s=i.data.name;return typeof s=="string"&&s.toLowerCase().startsWith(mn)});r&&t.focus(r.id)},children:o.jsx(il,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var n;return((n=t.visibleNodes[e])===null||n===void 0?void 0:n.id)||e},outerElementType:al,innerElementType:ul,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Ec})})}function Gi(t){return t.isFiltered?function(e,n){const r={},i=[];function s(l){if(!l.isRoot&&n(l)){r[l.id]=!0;let c=l.parent;for(;c;)r[c.id]=!0,c=c.parent}if(l.children)for(let c of l.children)s(c)}function a(l){var c;l.level>=0&&r[l.id]&&i.push(l),l.isOpen&&((c=l.children)===null||c===void 0||c.forEach(a))}return s(e),a(e),i.forEach($i),i}(t.root,t.isMatch.bind(t)):function(e){const n=[];function r(i){var s;i.level>=0&&n.push(i),i.isOpen&&((s=i.children)===null||s===void 0||s.forEach(r))}return r(e),n.forEach($i),n}(t.root)}function $i(t,e){t.rowIndex=e}const Yi=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var vn=function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(u){s(u)}}function l(d){try{c(r.throw(d))}catch(u){s(u)}}function c(d){var u;d.done?i(d.value):(u=d.value,u instanceof n?u:new n(function(g){g(u)})).then(a,l)}c((r=r.apply(t,e||[])).next())})};const{safeRun:G,identify:Ie,identifyNull:me}=Ra;class Ze{constructor(e,n,r,i){this.store=e,this.props=n,this.list=r,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=_r(this),this.visibleNodes=Gi(this),this.idToIndex=Yi(this.visibleNodes)}update(e){this.props=e,this.root=_r(this),this.visibleNodes=Gi(this),this.idToIndex=Yi(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const n=(e=this.props.searchMatch)!==null&&e!==void 0?e:(r,i)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase());return r=>n(r,this.searchTerm)}accessChildren(e){var n;return(n=Ke(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=Ke(e,this.props.idAccessor||"id");if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,n){var r;if(e===null||n===null)return[];const i=(r=this.indexOf(e))!==null&&r!==void 0?r:0,s=this.indexOf(n);if(s===null)return[];const a=Math.min(i,s),l=Math.max(i,s);return this.visibleNodes.slice(a,l+1)}indexOf(e){const n=kr(e);return n?this.idToIndex[n]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return vn(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Tr(this):e.parentId,s=(n=e.index)!==null&&n!==void 0?n:Er(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield G(this.props.onCreate,{type:a,parentId:i,index:s,parentNode:this.get(i)});l&&(this.focus(l),setTimeout(()=>{this.edit(l).then(()=>{this.select(l),this.activate(l)})}))})}delete(e){return vn(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Ie),r=n.map(i=>this.get(i)).filter(i=>!!i);yield G(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Ie(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(Lt(n)),new Promise(r=>{Ze.editPromise=r})}submit(e,n){return vn(this,void 0,void 0,function*(){if(!e)return;const r=Ie(e);yield G(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(Lt(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Lt(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(me(e));n&&G(this.props.onActivate,n)}resolveEdit(e){const n=Ze.editPromise;n&&n(e),Ze.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let n of Array.from(this.selectedIds)){const r=this.get(n);r&&e.push(r)}return e}focus(e,n={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(Le(Ie(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&G(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex-r;let s=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;s=s>r?r:Math.max(r-i,0),this.focus(this.at(s))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,s=i-r;let a=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;a=a<i?i:Math.min(a+s,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=Ie(e);r&&this.dispatch(Le(i)),this.dispatch(Wa(i)),this.dispatch(Rr(i)),this.dispatch(Ht(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Ie(e);this.dispatch(Mr(n)),G(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(me(e));n&&(this.dispatch(Le(n.id)),this.dispatch(Ar(n.id)),this.dispatch(Rr(n.id)),this.dispatch(Ht(n.id)),this.scrollTo(n),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Ie(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Le(n)),this.dispatch(Mr(this.nodesBetween(r,i))),this.dispatch(Ar(this.nodesBetween(r,me(n)))),this.dispatch(Ht(n)),this.scrollTo(n),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),G(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Le((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Ie)),i=me(e.anchor),s=me(e.mostRecent);this.dispatch(Ka({ids:r,anchor:i,mostRecent:s})),G(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return e.type==="highlight"?e.id:null}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const n=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,r=this.dragNodes,i=this.props.disableDrop;for(const s of r)if(!s||!n||s.isInternal&&wr(n,s))return!1;return typeof i=="function"?!i({parentNode:n,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!n.data[i]:typeof i!="boolean"||!i}hideCursor(){this.dispatch(He.cursor({type:"none"}))}showCursor(e){this.dispatch(He.cursor(e))}open(e){const n=me(e);n&&(this.isOpen(n)||(this.dispatch(Ft.open(n,this.isFiltered)),G(this.props.onToggle,n)))}close(e){const n=me(e);n&&this.isOpen(n)&&(this.dispatch(Ft.close(n,this.isFiltered)),G(this.props.onToggle,n))}toggle(e){const n=me(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=me(e);if(!n)return;const r=Rt(this.root,n);let i=r==null?void 0:r.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const n=e.parent;if(n){if(n.children){const r=e.isOpen;for(let i of n.children)i.isInternal&&(r?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){gt(this.root,e=>{e.isInternal&&e.open()})}closeAll(){gt(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=Ie(e);return this.openParents(r),Dr(()=>r in this.idToIndex).then(()=>{var i;const s=this.idToIndex[r];s!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(s,n))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var n,r,i;if(!e)return!1;if(e===Ge)return!0;const s=(n=this.props.openByDefault)===null||n===void 0||n;return this.isFiltered?(r=this.state.nodes.open.filtered[e])===null||r===void 0||r:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:s}isEditable(e){return!Ke(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!Ke(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=me(e);return!!n&&this.state.nodes.drag.id===n}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const n=me(e);if(!n)return!1;const{destinationParentId:r,destinationIndex:i}=this.state.nodes.drag;return n===r&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(Le(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ki}get renderRow(){return this.props.renderRow||Ua}get renderNode(){return this.props.children||qa}get renderDragPreview(){return this.props.renderDragPreview||Lr}get renderCursor(){return this.props.renderCursor||za}}function Q(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Xi=typeof Symbol=="function"&&Symbol.observable||"@@observable",yn=()=>Math.random().toString(36).substring(7).split("").join("."),It={INIT:`@@redux/INIT${yn()}`,REPLACE:`@@redux/REPLACE${yn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yn()}`};function Qi(t,e,n){if(typeof t!="function")throw new Error(Q(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Q(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(Q(1));return n(Qi)(t,e)}let r=t,i=e,s=new Map,a=s,l=0,c=!1;function d(){a===s&&(a=new Map,s.forEach((p,h)=>{a.set(h,p)}))}function u(){if(c)throw new Error(Q(3));return i}function g(p){if(typeof p!="function")throw new Error(Q(4));if(c)throw new Error(Q(5));let h=!0;d();const f=l++;return a.set(f,p),function(){if(h){if(c)throw new Error(Q(6));h=!1,d(),a.delete(f),s=null}}}function v(p){if(!function(h){if(typeof h!="object"||h===null)return!1;let f=h;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(h)===f||Object.getPrototypeOf(h)===null}(p))throw new Error(Q(7));if(p.type===void 0)throw new Error(Q(8));if(typeof p.type!="string")throw new Error(Q(17));if(c)throw new Error(Q(9));try{c=!0,i=r(i,p)}finally{c=!1}return(s=a).forEach(h=>{h()}),p}return v({type:It.INIT}),{dispatch:v,subscribe:g,getState:u,replaceReducer:function(p){if(typeof p!="function")throw new Error(Q(10));r=p,v({type:It.REPLACE})},[Xi]:function(){const p=g;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Q(11));function f(){const m=h;m.next&&m.next(u())}return f(),{unsubscribe:p(f)}},[Xi](){return this}}}}}function Zi(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const a=e[s];typeof t[a]=="function"&&(n[a]=t[a])}const r=Object.keys(n);let i;try{(function(s){Object.keys(s).forEach(a=>{const l=s[a];if(l(void 0,{type:It.INIT})===void 0)throw new Error(Q(12));if(l(void 0,{type:It.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(Q(13))})})(n)}catch(s){i=s}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let d=0;d<r.length;d++){const u=r[d],g=n[u],v=s[u],p=g(v,a);if(p===void 0)throw a&&a.type,new Error(Q(14));c[u]=p,l=l||p!==v}return l=l||r.length!==Object.keys(s).length,l?c:s}}const Tc=Zi({nodes:Zi({focus:function(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t},edit:function(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t},open:function(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:Pr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:Pr(t.unfiltered,e)}):t},selection:function(t=Fe().nodes.selection,e){const n=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(r=>n.add(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(r=>n.delete(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}},drag:function(t=Fe().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}}),dnd:function(t=Fe().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return Fe().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),_c=Fe();function Pc({treeProps:t,imperativeHandle:e,children:n}){const r=w.useRef(null),i=w.useRef(null),s=w.useRef(Qi(Tc,Fe(t))),a=hs.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>_c),l=w.useMemo(()=>new Ze(s.current,t,r,i),[]),c=w.useRef(0);return w.useMemo(()=>{c.current+=1,l.update(t)},[...Object.values(t),a.nodes.open]),w.useImperativeHandle(e,()=>l),w.useEffect(()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()},[l.props.selection]),w.useEffect(()=>{l.props.searchTerm||s.current.dispatch(Ft.clear(!0))},[l.props.searchTerm]),o.jsx(pr.Provider,{value:l,children:o.jsx(vr.Provider,{value:c.current,children:o.jsx(gr.Provider,{value:a.nodes,children:o.jsx(mr.Provider,{value:a.dnd,children:o.jsx(Wl,Object.assign({backend:Nc,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function Ac(t){return function(){const e=ae(),[,n]=Di(()=>({accept:"NODE",canDrop:(r,i)=>!!i.isOver({shallow:!0})&&e.canDrop(),hover:(r,i)=>{if(!i.isOver({shallow:!0}))return;const s=i.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:a,drop:l}=Bi({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});l&&e.dispatch(He.hovering(l.parentId,l.index)),i.canDrop()?a&&e.showCursor(a):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function Mc(){const t=ae().props.renderContainer||Ki;return o.jsx(o.Fragment,{children:o.jsx(t,{})})}function Rc(){const t=ae(),{offset:e,mouse:n,item:r,isDragging:i}=(s=g=>({offset:g.getSourceClientOffset(),mouse:g.getClientOffset(),item:g.getItem(),isDragging:g.isDragging()}),a=De().getMonitor(),l=mc(Si(a,s),2),c=l[0],d=l[1],w.useEffect(function(){return a.subscribeToOffsetChange(d)}),w.useEffect(function(){return a.subscribeToStateChange(d)}),c);var s,a,l,c,d;const u=t.props.renderDragPreview||Lr;return o.jsx(u,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class Ji{constructor(e){this.root=function(n){const r=new eo({id:"ROOT"},null);return r.children=n.map(i=>xn(i,r)),r}(e)}get data(){var e,n;return(n=(e=this.root.children)===null||e===void 0?void 0:e.map(r=>r.data))!==null&&n!==void 0?n:[]}create(e){const n=e.parentId?this.find(e.parentId):this.root;if(!n)return null;n.addChild(e.data,e.index)}move(e){const n=this.find(e.id),r=e.parentId?this.find(e.parentId):this.root;n&&r&&(r.addChild(n.data,e.index),n.drop())}update(e){const n=this.find(e.id);n&&n.update(e.changes)}drop(e){const n=this.find(e.id);n&&n.drop()}find(e,n=this.root){if(!n)return null;if(n.id===e)return n;if(n.children){for(let r of n.children){const i=this.find(e,r);if(i)return i}return null}return null}}function xn(t,e){const n=new eo(t,e);return t.children&&(n.children=t.children.map(r=>xn(r,n))),n}class eo{constructor(e,n){this.data=e,this.parent=n,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,n){var r,i;const s=xn(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,s),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(n,0,e)}removeChild(e){var n,r;(n=this.children)===null||n===void 0||n.splice(e,1),(r=this.data.children)===null||r===void 0||r.splice(e,1)}update(e){if(this.hasParent()){const n=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),n),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let Lc=0;function Fc(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
17
|
-
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,s]=w.useState(r),a=w.useMemo(()=>new Ji(i),[i]);return[i,{onMove:c=>{for(const d of c.dragIds)a.move({id:d,parentId:c.parentId,index:c.index});s(a.data)},onRename:({name:c,id:d})=>{a.update({id:d,changes:{name:c}}),s(a.data)},onCreate:({parentId:c,index:d,type:u})=>{const g={id:"simple-tree-id-"+Lc++,name:""};return u==="internal"&&(g.children=[]),a.create({parentId:c,index:d,data:g}),s(a.data),g},onDelete:c=>{c.ids.forEach(d=>a.drop({id:d})),s(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const Hc=w.forwardRef(function(t,e){const n=Fc(t);return o.jsxs(Pc,{treeProps:n,imperativeHandle:e,children:[o.jsx(Ac,{children:o.jsx(Mc,{})}),o.jsx(Rc,{})]})});export{ps as A,gs as B,Ea as C,bs as G,Js as K,js as L,Pa as M,Os as P,Ds as S,Hc as T,Cs as Y,xs as a,ws as b,_a as c,Xs as d,Bn as e,ut as f,Ys as g,ur as h,zs as i,Zn as j,Mt as k,We as l,er as m,Jn as n,Ws as o,Qs as p,Zs as q,
|
|
17
|
+
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,s]=w.useState(r),a=w.useMemo(()=>new Ji(i),[i]);return[i,{onMove:c=>{for(const d of c.dragIds)a.move({id:d,parentId:c.parentId,index:c.index});s(a.data)},onRename:({name:c,id:d})=>{a.update({id:d,changes:{name:c}}),s(a.data)},onCreate:({parentId:c,index:d,type:u})=>{const g={id:"simple-tree-id-"+Lc++,name:""};return u==="internal"&&(g.children=[]),a.create({parentId:c,index:d,data:g}),s(a.data),g},onDelete:c=>{c.ids.forEach(d=>a.drop({id:d})),s(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const Hc=w.forwardRef(function(t,e){const n=Fc(t);return o.jsxs(Pc,{treeProps:n,imperativeHandle:e,children:[o.jsx(Ac,{children:o.jsx(Mc,{})}),o.jsx(Rc,{})]})});export{ps as A,gs as B,Ea as C,bs as G,Js as K,js as L,Pa as M,Os as P,Ds as S,Hc as T,Cs as Y,xs as a,ws as b,_a as c,Xs as d,Bn as e,ut as f,Ys as g,ur as h,zs as i,Zn as j,Mt as k,We as l,er as m,Jn as n,Ws as o,Qs as p,Zs as q,Wn as r,At as s,nr as t,_s as u,Xn as v,dt as w,Qn as x,Ji as y};
|