@tickernelz/paperclip-pro-ui 2026.1006.0 → 2026.1006.2
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/{AgentAvatar-D6FB0fuO.js → AgentAvatar-lnkDMHMh.js} +1 -1
- package/dist/assets/AgentIdentity-Cpb2VddX.js +1 -0
- package/dist/assets/Agents.production-pGUwDC7r.js +2 -0
- package/dist/assets/CompanyActivity.production-ZGgxxisV.js +1 -0
- package/dist/assets/{CompanyExport-BX6imgeR.js → CompanyExport-GeY3_TXI.js} +4 -4
- package/dist/assets/CompanySkills.production-BN9MKK7o.js +10 -0
- package/dist/assets/{Costs.production-CfN-y0WT.js → Costs.production-B4oABBSg.js} +1 -1
- package/dist/assets/EmptyState-CqqJOoXs.js +1 -0
- package/dist/assets/MarkdownBody-CEnh9lVM.js +16 -0
- package/dist/assets/{MarkdownEditor-BGjNjqa2.js → MarkdownEditor-seU_oAfy.js} +38 -38
- package/dist/assets/{OrgChart.production-BQUvMu4Q.js → OrgChart.production-JOfw43w3.js} +1 -1
- package/dist/assets/{PageSkeleton-CgAHzFTc.js → PageSkeleton-C9WV_Qyq.js} +1 -1
- package/dist/assets/RoutineDetail.production-A472lDXj.js +1 -0
- package/dist/assets/RoutineRunVariablesDialog-yR5DLc68.js +5 -0
- package/dist/assets/Routines.production-LvomJjv8.js +1 -0
- package/dist/assets/{SidebarContext-C7OpDbXX.js → SidebarContext-Dpto7Kf2.js} +1 -1
- package/dist/assets/StatusIcon-BtBa0xK_.js +1 -0
- package/dist/assets/{abnfDiagram-VCTEODGH-wiE_K2ku.js → abnfDiagram-VCTEODGH-CElI5h6o.js} +1 -1
- package/dist/assets/agent-avatar-url-270oGkoO.js +92 -0
- package/dist/assets/agents-BlxRXAz3.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-BkhBoP5_.js → architectureDiagram-5GKGNRK7-DUBpjYei.js} +1 -1
- package/dist/assets/{badge-dhlY-PQY.js → badge-D0Ti-OuU.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-fyVn7r-9.js → blockDiagram-I7D4REHJ-CD5_3VhC.js} +1 -1
- package/dist/assets/bot-CGOpwPIZ.js +1 -0
- package/dist/assets/boxes-xBZV8xLw.js +41 -0
- package/dist/assets/button-DLWREze0.js +1 -0
- package/dist/assets/{c4Diagram-7LVT6UL2-BqC3qTZS.js → c4Diagram-7LVT6UL2-CSASNZeo.js} +1 -1
- package/dist/assets/{card-DmOCHnV1.js → card-Qk8smcrQ.js} +1 -1
- package/dist/assets/channel-CtmRoUn0.js +1 -0
- package/dist/assets/check-5Tuqm2aI.js +1 -0
- package/dist/assets/checkbox-SNvdBfci.js +1 -0
- package/dist/assets/chevron-down-ZMnYk9j3.js +1 -0
- package/dist/assets/chevron-right-Dv6dHZgu.js +1 -0
- package/dist/assets/{chunk-4HAMMTFA-CGGd_Pxz.js → chunk-4HAMMTFA-Duh1dbZg.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-BaPl5WA6.js → chunk-75Z2AOVW-CTyOxDW3.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-2P5iNHqg.js → chunk-DU6HZSFF-mLZ_DAj9.js} +17 -17
- package/dist/assets/{chunk-F27PBJKO-Ci7GmRgM.js → chunk-F27PBJKO-BI6MjXNA.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-BfvaaEBW.js → chunk-GMAD6QVW-Vk29EsOn.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-Cwp_Wpj2.js → chunk-GVQU2GXP-D5bNpR4K.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-BjXu-u1C.js → chunk-IMKFNOWR-DlfITCc_.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-JUd1UqX1.js → chunk-L3NEJ4N5-GADujcju.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-DlrxddG-.js → chunk-OSK3NFVY-BfvIkdmA.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-CjqEi3mx.js → chunk-P2QGCYS3-DD1uZyrA.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-BytmIqFc.js → chunk-POPQ4Y6H-B0MtQqlF.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-CR3rNBNB.js → chunk-PWAF6VOD-DHqPPKbd.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-B1Klag0Z.js → chunk-SHT3W25Y-CorllSkN.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-A4BO1_5v.js → chunk-SVP7TREG-BNLl-Ok9.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-B4lRXha0.js → chunk-TICWLB2K-BWKPkn9E.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-DDCCAOna.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-DDCCAOna.js +1 -0
- package/dist/assets/clipboard-BPoFQAy2.js +1 -0
- package/dist/assets/{company-members-BCWB1iQ_.js → company-members-BKdmkDTe.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-Qp2NNXUx.js → cynefinDiagram-5FMLGOSQ-CGZNoppH.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-C1bu-Sbk.js → dagre-GXQ25YYZ-D0kXJo1b.js} +1 -1
- package/dist/assets/{definition-B0A7Y2Kz.js → definition-DTQCzcR3.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-D0cqRe3j.js → diagram-S7CK7UJ4-BMOu70sn.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-DdEgR6LR.js → diagram-UQ7AKVKN-dAmEsEgr.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-B_APewr5.js → diagram-VSXAHHWV-zD92DhH2.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-B2quR8-z.js → diagram-VX7I27RA-C6F4NzHd.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-BpQRCt5N.js → diagram-Z3DM3KII-BxGljaP6.js} +1 -1
- package/dist/assets/{dist-CJ2IjArq.js → dist-BzPgY729.js} +1 -1
- package/dist/assets/{dist-C0aY0Z9q.js → dist-DvMfIbJ9.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-C9x73jSZ.js → ebnfDiagram-PWID7BFC-DFhVsGcz.js} +1 -1
- package/dist/assets/{environments-DgYKMH7B.js → environments-BNSxsEsE.js} +1 -1
- package/dist/assets/{erDiagram-RLTQ6QDP-Dkp7z94L.js → erDiagram-RLTQ6QDP-CExzemcW.js} +1 -1
- package/dist/assets/external-link-rfTzFbSd.js +1 -0
- package/dist/assets/file-text-dks7zWRZ.js +1 -0
- package/dist/assets/flowDiagram-HODETNUW-DEjrdPyS.js +1 -0
- package/dist/assets/{ganttDiagram-EL5Y4UJY-CJs7mNJX.js → ganttDiagram-EL5Y4UJY-DStsnXzo.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-ByeD7NPE.js → gitGraphDiagram-WWUBYQGX-BejeRC3-.js} +1 -1
- package/dist/assets/health-DsHGAxc8.js +1 -0
- package/dist/assets/heartbeats-DWUL5tSL.js +1 -0
- package/dist/assets/index-Cx882YTU.css +1 -0
- package/dist/assets/index-DTMtHDxt.js +779 -0
- package/dist/assets/{infoDiagram-27XIBGKW-B6sR9qVK.js → infoDiagram-27XIBGKW-Cch-IRh-.js} +1 -1
- package/dist/assets/{input-BYys7uph.js → input-BWYuMr4z.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-HFQ3gYGN.js → ishikawaDiagram-5VMMS53U-DDvnGaeJ.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-BtoNErTz.js → journeyDiagram-3NMN7TZE-rmjbLNr7.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-Y55yoRj4.js → kanban-definition-UXKFOSKX-hvO2tDhG.js} +1 -1
- package/dist/assets/label-TkPoSJhK.js +5 -0
- package/dist/assets/{line-CJEZO7lL.js → line-Dk_ouzM8.js} +1 -1
- package/dist/assets/loader-circle-DiqjntTX.js +1 -0
- package/dist/assets/mention-chips-B_zVTnHY.js +17 -0
- package/dist/assets/{mermaid.core-G_BSi0G0.js → mermaid.core-Be3XJK9z.js} +4 -4
- package/dist/assets/{mindmap-definition-YA3MSWOX-BnlANYwV.js → mindmap-definition-YA3MSWOX-Dislw6JU.js} +1 -1
- package/dist/assets/octagon-alert-HfSAYnSC.js +1 -0
- package/dist/assets/{pegDiagram-XKGWAZYB-CHhCzuLt.js → pegDiagram-XKGWAZYB-CizC38c5.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-CEGI1j0Q.js → pieDiagram-E7YTZNPT-DvHDuZK1.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-BfVC-A1t.js → quadrantDiagram-AXDQQJYC-DTAvsUNT.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-Bwh6snZb.js → railroadDiagram-O6MQD6OU-DGlhxzAn.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-NEvTOdsw.js → requirementDiagram-BXWQKSXE-BzY8WPIy.js} +1 -1
- package/dist/assets/rotate-ccw-C9ZF1aqD.js +1 -0
- package/dist/assets/router-BC2Duaf5.js +15 -0
- package/dist/assets/{sankeyDiagram-P5KCCOFB-AvKb1lr-.js → sankeyDiagram-P5KCCOFB-Be3A08ra.js} +1 -1
- package/dist/assets/save-yPNdO-t7.js +1 -0
- package/dist/assets/select-DsMS_Sad.js +1 -0
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-BP0QZnHN.js → sequenceDiagram-WJ2MYXX4-BJuFaGQ8.js} +1 -1
- package/dist/assets/sheet-CFbmpBhA.js +1 -0
- package/dist/assets/skeleton-DtakB_VA.js +1 -0
- package/dist/assets/{stateDiagram-D77RDMKH-Ce0Wj7yz.js → stateDiagram-D77RDMKH-BWwUdBob.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-P6gPsRNv.js +1 -0
- package/dist/assets/{swimlanes-42K2YHIH-CX7zPtNU.js → swimlanes-42K2YHIH-CMos3UkM.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-BjRksHrL.js +8 -0
- package/dist/assets/{tabs-BTWtgE_e.js → tabs-DCzsHrwQ.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-Bw21rjHm.js → timeline-definition-24CTP7MA-5RQLEOvu.js} +1 -1
- package/dist/assets/triangle-alert-CrLKyTUa.js +1 -0
- package/dist/assets/use-adapter-capabilities-CVwppNII.js +1 -0
- package/dist/assets/useHiddenSettings-COOnS4sa.js +1 -0
- package/dist/assets/{vennDiagram-4TSXK5OY-BuncstTm.js → vennDiagram-4TSXK5OY-BZm-uDwq.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-DOHY7xcd.js → wardleyDiagram-VM6X3IG4-Y317P_uV.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-qOWxoNte.js → xychartDiagram-S5SC5T6Z-DIOiLKNy.js} +1 -1
- package/dist/brands/apps/browser-use.svg +6 -0
- package/dist/brands/apps/cognee.png +0 -0
- package/dist/brands/apps/connection-pool.svg +1 -0
- package/dist/brands/apps/honcho.svg +33 -0
- package/dist/brands/apps/manifest.json +45 -0
- package/dist/brands/apps/neon.png +0 -0
- package/dist/brands/apps/supermemory.png +0 -0
- package/dist/brands/apps/zep.png +0 -0
- package/dist/index.html +108 -46
- package/dist/sw.js +17 -3
- package/package.json +1 -1
- package/dist/assets/AgentIdentity-DjRFrNXO.js +0 -1
- package/dist/assets/Agents.production-BRdUzpF6.js +0 -2
- package/dist/assets/CompanyActivity.production-dD0_52Wu.js +0 -1
- package/dist/assets/CompanySkills.production-DGbZb0AI.js +0 -10
- package/dist/assets/EmptyState-C4lXde64.js +0 -1
- package/dist/assets/MarkdownBody--RIJLCMA.js +0 -16
- package/dist/assets/RoutineDetail.production-Bsf338vO.js +0 -1
- package/dist/assets/RoutineRunVariablesDialog-DP1tcp7X.js +0 -5
- package/dist/assets/Routines.production-BGR6_EI9.js +0 -1
- package/dist/assets/StatusIcon-VpulllGv.js +0 -1
- package/dist/assets/agents-BP_X6XtR.js +0 -1
- package/dist/assets/bot-LA1HiarN.js +0 -1
- package/dist/assets/button-C4DIaoFo.js +0 -1
- package/dist/assets/channel-0B5iAV5A.js +0 -1
- package/dist/assets/check-CYgpX7OA.js +0 -1
- package/dist/assets/checkbox-CKFq766c.js +0 -1
- package/dist/assets/chevron-down-BU9R1R4F.js +0 -1
- package/dist/assets/chevron-right-BmxFehfD.js +0 -1
- package/dist/assets/classDiagram-ZZMXUADV-icHQAbF4.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY-icHQAbF4.js +0 -1
- package/dist/assets/clipboard-DMxSLEQ6.js +0 -1
- package/dist/assets/createLucideIcon-B54j0Sae.js +0 -92
- package/dist/assets/external-link-Bi7tqIF1.js +0 -1
- package/dist/assets/file-text-MN4vnW0c.js +0 -1
- package/dist/assets/flowDiagram-HODETNUW-CDvpIOlT.js +0 -1
- package/dist/assets/health-Cu3NB6y9.js +0 -1
- package/dist/assets/heartbeats-Bjbu1IYj.js +0 -1
- package/dist/assets/index-DRWrweZf.js +0 -737
- package/dist/assets/index-L45mDhY7.css +0 -1
- package/dist/assets/label-_X3u-iq9.js +0 -5
- package/dist/assets/loader-circle-D6KkdGol.js +0 -1
- package/dist/assets/mention-chips-B6d93utO.js +0 -17
- package/dist/assets/octagon-alert-BgFrORnN.js +0 -1
- package/dist/assets/rotate-ccw-DP6ACo04.js +0 -1
- package/dist/assets/router-D63KhMWd.js +0 -15
- package/dist/assets/save-C2ttL8uR.js +0 -1
- package/dist/assets/select-DrSnWvLC.js +0 -1
- package/dist/assets/sheet-CdR6tW8E.js +0 -1
- package/dist/assets/skeleton-C0oo8l5C.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-CREL-f_f.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-B22pD4D6.js +0 -8
- package/dist/assets/triangle-alert-BhrZ1ChK.js +0 -1
- package/dist/assets/use-adapter-capabilities-DHgLdZ1V.js +0 -1
- package/dist/assets/useHiddenSettings-C5RuvqCg.js +0 -1
- package/dist/assets/zap-md9c-4bv.js +0 -41
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as t}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import"./src-Bssc388C.js";import"./chunk-DU6HZSFF-mLZ_DAj9.js";import"./chunk-75Z2AOVW-CTyOxDW3.js";import"./chunk-PWAF6VOD-DHqPPKbd.js";import"./chunk-GMAD6QVW-Vk29EsOn.js";import"./chunk-P2QGCYS3-DD1uZyrA.js";import"./chunk-4HAMMTFA-Duh1dbZg.js";import"./chunk-GVQU2GXP-D5bNpR4K.js";import"./chunk-OSK3NFVY-BfvIkdmA.js";import"./chunk-F27PBJKO-BI6MjXNA.js";import"./chunk-XXDRQBXY-BhrH-9FX.js";import"./chunk-POPQ4Y6H-B0MtQqlF.js";import"./chunk-L3NEJ4N5-GADujcju.js";import{i,n as a,r as s,t as o}from"./chunk-TICWLB2K-BWKPkn9E.js";import"./mermaid.core-Be3XJK9z.js";var A={parser:a,get db(){return new o},renderer:s,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{A as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var n=(a,e)=>d(a,"name",{value:e,configurable:!0});import{t as o}from"./agent-avatar-url-270oGkoO.js";var r={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};r.node;var y=o(r),i={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};i.node;var p=o(i),c={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};c.node;var s=o(c);async function f(a){if((typeof window>"u"||window.isSecureContext!==!1)&&typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(a);return}catch{}if(typeof document>"u")throw new Error("Clipboard unavailable");const e=document.createElement("textarea");e.value=a,e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.style.position="fixed",e.style.top="0",e.style.left="-9999px",document.body.appendChild(e);const t=document.activeElement;try{if(e.focus({preventScroll:!0}),e.select(),e.setSelectionRange(0,a.length),!document.execCommand("copy"))throw new Error("execCommand copy failed")}finally{document.body.removeChild(e),t!==document.activeElement&&typeof t?.focus=="function"&&t.focus({preventScroll:!0})}}n(f,"copyTextToClipboard");export{y as i,s as n,p as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var t=(e,i)=>p(e,"name",{value:i,configurable:!0});import{
|
|
1
|
+
var p=Object.defineProperty;var t=(e,i)=>p(e,"name",{value:i,configurable:!0});import{Lr as s}from"./agent-avatar-url-270oGkoO.js";function l(e){const i=new URLSearchParams;e.state&&i.set("state",e.state),e.limit&&i.set("limit",String(e.limit)),e.offset&&i.set("offset",String(e.offset));const n=i.toString();return n?`?${n}`:""}t(l,"buildInviteListQuery");var I={createCompanyInvite:t((e,i={})=>s.post(`/companies/${e}/invites`,i),"createCompanyInvite"),createOpenClawInvitePrompt:t((e,i={})=>s.post(`/companies/${e}/openclaw/invite-prompt`,i),"createOpenClawInvitePrompt"),getInvite:t(e=>s.get(`/invites/${e}`),"getInvite"),getInviteOnboarding:t(e=>s.get(`/invites/${e}/onboarding`),"getInviteOnboarding"),acceptInvite:t((e,i)=>s.post(`/invites/${e}/accept`,i),"acceptInvite"),listInvites:t((e,i={})=>s.get(`/companies/${e}/invites${l(i)}`),"listInvites"),revokeInvite:t(e=>s.post(`/invites/${e}/revoke`,{}),"revokeInvite"),listJoinRequests:t((e,i="pending_approval",n)=>s.get(`/companies/${e}/join-requests?status=${i}${n?`&requestType=${n}`:""}`),"listJoinRequests"),listMembers:t(e=>s.get(`/companies/${e}/members`),"listMembers"),listUserDirectory:t(e=>s.get(`/companies/${e}/user-directory`),"listUserDirectory"),updateMember:t((e,i,n)=>s.patch(`/companies/${e}/members/${i}`,n),"updateMember"),updateMemberPermissions:t((e,i,n)=>s.patch(`/companies/${e}/members/${i}/permissions`,n),"updateMemberPermissions"),updateMemberAccess:t((e,i,n)=>s.patch(`/companies/${e}/members/${i}/role-and-grants`,n),"updateMemberAccess"),archiveMember:t((e,i,n={})=>s.post(`/companies/${e}/members/${i}/archive`,n),"archiveMember"),approveJoinRequest:t((e,i)=>s.post(`/companies/${e}/join-requests/${i}/approve`,{}),"approveJoinRequest"),rejectJoinRequest:t((e,i)=>s.post(`/companies/${e}/join-requests/${i}/reject`,{}),"rejectJoinRequest"),claimJoinRequestApiKey:t((e,i)=>s.post(`/join-requests/${e}/claim-api-key`,{claimSecret:i}),"claimJoinRequestApiKey"),getBoardClaimStatus:t((e,i)=>s.get(`/board-claim/${e}?code=${encodeURIComponent(i)}`),"getBoardClaimStatus"),claimBoard:t((e,i)=>s.post(`/board-claim/${e}/claim`,{code:i}),"claimBoard"),claimBootstrapAdmin:t(()=>s.post("/bootstrap/claim",{}),"claimBootstrapAdmin"),getCliAuthChallenge:t((e,i)=>s.get(`/cli-auth/challenges/${e}?token=${encodeURIComponent(i)}`),"getCliAuthChallenge"),approveCliAuthChallenge:t((e,i)=>s.post(`/cli-auth/challenges/${e}/approve`,{token:i}),"approveCliAuthChallenge"),cancelCliAuthChallenge:t((e,i)=>s.post(`/cli-auth/challenges/${e}/cancel`,{token:i}),"cancelCliAuthChallenge"),searchAdminUsers:t(e=>s.get(`/admin/users?query=${encodeURIComponent(e)}`),"searchAdminUsers"),promoteInstanceAdmin:t(e=>s.post(`/admin/users/${e}/promote-instance-admin`,{}),"promoteInstanceAdmin"),demoteInstanceAdmin:t(e=>s.post(`/admin/users/${e}/demote-instance-admin`,{}),"demoteInstanceAdmin"),getUserCompanyAccess:t(e=>s.get(`/admin/users/${e}/company-access`),"getUserCompanyAccess"),setUserCompanyAccess:t((e,i)=>s.put(`/admin/users/${e}/company-access`,{companyIds:i}),"setUserCompanyAccess"),getCurrentBoardAccess:t(()=>s.get("/cli-auth/me"),"getCurrentBoardAccess")};function m(e){return e==="local-board"?"Board":e.slice(0,5)}t(m,"fallbackUserLabel");function o(e){const i=e.user?.name?.trim();if(i)return i;const n=e.user?.email?.trim();return n||m(e.principalId)}t(o,"baseMemberLabel");function c(e){const i=new Map;for(const n of e??[])n.status==="active"&&(i.has(n.principalId)||i.set(n.principalId,n));return[...i.values()].sort((n,a)=>o(n).localeCompare(o(a)))}t(c,"activeUniqueMembers");function b(e){const i=new Map;for(const n of e??[])i.set(n.principalId,o(n));return i}t(b,"buildCompanyUserLabelMap");function v(e){const i=new Map;for(const n of e??[])i.set(n.principalId,{label:o(n),image:n.user?.image??null});return i}t(v,"buildCompanyUserProfileMap");function h(e,i){const n=new Set([...i?.excludeUserIds??[]].filter(a=>!!a));return c(e).filter(a=>!n.has(a.principalId)).map(a=>({id:`user:${a.principalId}`,label:o(a),searchText:[a.user?.name,a.user?.email,a.principalId].filter(Boolean).join(" ")}))}t(h,"buildCompanyUserInlineOptions");function u(e){return c(e).map(i=>({id:`user:${i.principalId}`,name:o(i),kind:"user",userId:i.principalId}))}t(u,"buildCompanyUserMentionOptions");function d(e){return e.status!=="terminated"&&e.status!=="pending_approval"&&e.orgChainHealth?.status!=="invalid_org_chain"}t(d,"isAgentTaskTarget");function $(e){const i=[];for(const n of e??[]){const a=n.identifier?.trim();if(!a)continue;const r=n.title?.trim()??"";i.push({id:`issue:${n.id}`,name:r?`${a} ${r}`:a,kind:"issue",issueId:n.id,issueIdentifier:a})}return i}t($,"buildIssueMentionOptions");function C(e){return[...u(e.members),...[...e.agents??[]].filter(d).sort((i,n)=>i.name.localeCompare(n.name)).map(i=>({id:`agent:${i.id}`,name:i.name,kind:"agent",agentId:i.id,agentIcon:i.icon,agentAppearance:i.appearance})),...[...e.projects??[]].sort((i,n)=>i.name.localeCompare(n.name)).map(i=>({id:`project:${i.id}`,name:i.name,kind:"project",projectId:i.id,projectColor:i.color})),...$(e.issues)]}t(C,"buildMarkdownMentionOptions");export{d as a,C as i,b as n,I as o,v as r,h as t};
|
package/dist/assets/{cynefinDiagram-5FMLGOSQ-Qp2NNXUx.js → cynefinDiagram-5FMLGOSQ-CGZNoppH.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var xt=Object.defineProperty;var M=(t,e)=>xt(t,"name",{value:e,configurable:!0});import{n as ht}from"./mermaid-parser.core-CHJSk6z0.js";import{n as i}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as X}from"./src-Bssc388C.js";import{D as at,H as gt,K as $t,U as bt,a as wt,b as K,c as Ct,f as Dt,v as vt,w as kt,y as Tt}from"./chunk-DU6HZSFF-
|
|
1
|
+
var xt=Object.defineProperty;var M=(t,e)=>xt(t,"name",{value:e,configurable:!0});import{n as ht}from"./mermaid-parser.core-CHJSk6z0.js";import{n as i}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as X}from"./src-Bssc388C.js";import{D as at,H as gt,K as $t,U as bt,a as wt,b as K,c as Ct,f as Dt,v as vt,w as kt,y as Tt}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import{i as Q}from"./chunk-75Z2AOVW-CTyOxDW3.js";import{t as At}from"./chunk-JWPE2WC7--HEGjv3t.js";import{f as Bt}from"./mermaid.core-Be3XJK9z.js";var rt=i(()=>({domains:new Map,transitions:[]}),"createDefaultData"),G=rt(),V={getDomains:i(()=>G.domains,"getDomains"),getTransitions:i(()=>G.transitions,"getTransitions"),setDomains:i(t=>{if(t)for(const e of t){const n=e.domain,o=(e.items??[]).map(c=>({label:c.label}));G.domains.set(n,{name:n,items:o})}},"setDomains"),setTransitions:i(t=>{t&&(G.transitions=t.filter(e=>e.from===e.to?(X.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),getConfig:i(()=>Q({...Dt.cynefin,...K().cynefin}),"getConfig"),clear:i(()=>{wt(),G=rt()},"clear"),setAccTitle:bt,getAccTitle:Tt,setDiagramTitle:$t,getDiagramTitle:kt,getAccDescription:vt,setAccDescription:gt},St=i(t=>{At(t,V),V.setDomains(t.domains),V.setTransitions(t.transitions)},"populate"),Mt={parse:i(async t=>{const e=await ht("cynefin",t);X.debug(e),St(e)},"parse")};function Y(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}M(Y,"seededRandom");i(Y,"seededRandom");function it(t){let e=0;for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);e=(e<<5)-e+o,e|=0}return e}M(it,"hashString");i(it,"hashString");function st(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:it(e)}M(st,"resolveSeed");i(st,"resolveSeed");function ct(t,e,n,o){const c=t/2,m=o??t*.015,D=7,P=e/D,d=[];for(let a=0;a<=D;a++){const p=Y(n+a*17)*m*2-m;d.push({x:c+p,y:a*P})}let v=`M${d[0].x},${d[0].y}`;for(let a=0;a<d.length-1;a++){const p=d[a],s=d[a+1],f=(p.y+s.y)/2,b=a%2===0?1:-1,x=m*1.5*b*Y(n+a*31+7),W=p.x+x,R=f,F=s.x-x;v+=` C${W},${R} ${F},${f} ${s.x},${s.y}`}return v}M(ct,"generateFoldPath");i(ct,"generateFoldPath");function lt(t,e,n,o){const c=e/2,m=o??e*.015,D=7,P=t/D,d=[];for(let a=0;a<=D;a++){const p=Y(n+a*23)*m*2-m;d.push({x:a*P,y:c+p})}let v=`M${d[0].x},${d[0].y}`;for(let a=0;a<d.length-1;a++){const p=d[a],s=d[a+1],f=(p.x+s.x)/2,b=a%2===0?1:-1,x=m*1.5*b*Y(n+a*37+11),W=f,R=p.y+x,F=f,H=s.y-x;v+=` C${W},${R} ${F},${H} ${s.x},${s.y}`}return v}M(lt,"generateHorizontalBoundary");i(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,o=e*.5,c=e,m=t*.03;return[`M${n},${o}`,`C${n+m},${o+(c-o)*.2}`,`${n-m*1.5},${o+(c-o)*.55}`,`${n+m*.5},${o+(c-o)*.75}`,`C${n-m},${o+(c-o)*.85}`,`${n+m*.3},${o+(c-o)*.95}`,`${n},${c}`].join(" ")}M(dt,"generateCliffPath");i(dt,"generateCliffPath");function ft(t,e,n,o){return[`M${t-n},${e}`,`A${n},${o} 0 1,1 ${t+n},${e}`,`A${n},${o} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}M(ft,"generateConfusionPath");i(ft,"generateConfusionPath");var ot={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},zt=i((t,e)=>{const n=t/2,o=e/2;return{complex:{cx:n/2,cy:o/2,x:0,y:0,w:n,h:o},complicated:{cx:n+n/2,cy:o/2,x:n,y:0,w:n,h:o},chaotic:{cx:n/2,cy:o+o/2,x:0,y:o,w:n,h:o},clear:{cx:n+n/2,cy:o+o/2,x:n,y:o,w:n,h:o},confusion:{cx:n,cy:o,x:n*.7,y:o*.7,w:n*.6,h:o*.6}}},"getDomainLayouts"),Lt=i(()=>{const t=at(),e=K();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Nt={draw:i((t,e,n,o)=>{const c=o.db,m=c.getDomains(),D=c.getTransitions(),P=c.getDiagramTitle(),d=c.getAccTitle(),v=c.getAccDescription(),a=c.getConfig(),p=Lt();X.debug("Rendering Cynefin diagram");const s=a.width,f=a.height,b=a.padding,x=a.showDomainDescriptions,W=a.boundaryAmplitude,R=s+b*2,F=f+b*2,H={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Bt(e);Ct(k,F,R,a.useMaxWidth??!0),k.attr("viewBox",`0 0 ${R} ${F}`),d&&k.append("title").text(d),v&&k.append("desc").text(v);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),E=zt(s,f),Z=st(a.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),j=["complex","complicated","chaotic","clear"];for(const l of j){const r=E[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",H[l]).attr("fill-opacity",.4).attr("stroke","none")}const U=T.append("g").attr("class","cynefin-boundaries");U.append("path").attr("class","cynefinBoundary").attr("d",ct(s,f,Z,W)).attr("fill","none"),U.append("path").attr("class","cynefinBoundary").attr("d",lt(s,f,Z+100,W)).attr("fill","none"),U.append("path").attr("class","cynefinCliff").attr("d",dt(s,f)).attr("fill","none");const pt=s*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(s/2,f/2,pt,yt)).attr("fill",H.confusion).attr("fill-opacity",.5);const J=T.append("g").attr("class","cynefin-labels");for(const l of j){const r=E[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",x?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",s/2).attr("y",x?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),x){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of j){const u=E[r],y=ot[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",s/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(ot.confusion.practice)}const tt=T.append("g").attr("class","cynefin-items"),_=26;for(const l of["complex","complicated","chaotic","clear","confusion"]){const r=m.get(l);if(!r||r.items.length===0)continue;const u=E[l],y=l==="confusion";let z=r.items,L=0;y&&r.items.length>q&&(L=r.items.length-q,z=r.items.slice(0,q));let A;if(y){const g=x?22:14;A=u.cy+g}else A=u.cy+(x?25:15);if([...z].forEach((g,B)=>{const w=A+B*30,S=tt.append("g"),N=S.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",_/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const h=N.node();if(h&&typeof h.getBBox=="function"){const O=h.getBBox();O.width>0&&($=O.width)}const C=$+20,I=u.cx-C/2;S.attr("transform",`translate(${I}, ${w})`),S.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",_).attr("rx",4).attr("ry",4).attr("fill",H[l]).attr("fill-opacity",.95),N.attr("x",C/2).attr("y",_/2)}),L>0){const g=A+z.length*30,B=`+${L} more`,w=tt.append("g"),S=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",_/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(B);let N=B.length*7;const $=S.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(N=I.width)}const h=N+20,C=u.cx-h/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",h).attr("height",_).attr("rx",4).attr("ry",4).attr("fill",H[l]).attr("fill-opacity",.6),S.attr("x",h/2).attr("y",_/2)}}if(D.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");D.forEach(y=>{const z=E[y.from],L=E[y.to];if(!z||!L)return;if(y.from===y.to){X.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const A=z.cx,g=z.cy,B=L.cx,w=L.cy,S=(A+B)/2,N=(g+w)/2,$=B-A,h=w-g,C=Math.sqrt($*$+h*h),I=C*.15,O=-h/C,ut=$/C,et=S+O*I,nt=N+ut*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${A},${g} Q${et},${nt} ${B},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}P&&T.append("text").attr("class","cynefinTitle").attr("x",s/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(P)},"draw")},It=i(()=>{const t=at(),e=K();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Yt={parser:Mt,db:V,renderer:Nt,styles:i(()=>{const t=It();return`
|
|
2
2
|
.cynefinDomain {
|
|
3
3
|
stroke: none;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as y}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as u}from"./src-Bssc388C.js";import{x as G}from"./chunk-DU6HZSFF-
|
|
1
|
+
import{n as y}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as u}from"./src-Bssc388C.js";import{x as G}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import"./chunk-75Z2AOVW-CTyOxDW3.js";import"./chunk-PWAF6VOD-DHqPPKbd.js";import"./chunk-GMAD6QVW-Vk29EsOn.js";import"./chunk-P2QGCYS3-DD1uZyrA.js";import{s as k}from"./chunk-4HAMMTFA-Duh1dbZg.js";import{a as O,i as N,n as A}from"./chunk-GVQU2GXP-D5bNpR4K.js";import{a as D,c as Y,i as _}from"./chunk-OSK3NFVY-BfvIkdmA.js";import{t as H}from"./graphlib-DHhK3saS.js";import{t as J}from"./dagre-Bnei_7lW.js";import{n as z}from"./chunk-L3NEJ4N5-GADujcju.js";import{a as F,c as T,i as b,l as x,o as W,r as j,s as X}from"./mermaid.core-Be3XJK9z.js";var C=y((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),R=y((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),q=y(r=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),U=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],K=y((r,e,n,s,a)=>{const c=[],g=new Set;if(n.forEach(({start:o,end:t})=>{o!==s&&g.add(o),t!==s&&g.add(t)}),g.forEach(o=>{const t=r.node(o);typeof t?.x=="number"&&typeof t?.y=="number"&&c.push(t)}),c.length===0&&n.forEach(({edge:o})=>{(o.points??[]).forEach(t=>{typeof t?.x=="number"&&typeof t?.y=="number"&&c.push(t)})}),c.length===0)return R(a);const l=c.reduce((o,t)=>({x:o.x+t.x/c.length,y:o.y+t.y/c.length}),{x:0,y:0}),d=l.x-e.x,i=l.y-e.y;return Math.abs(d)>Math.abs(i)?d>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":R(a)},"getSelfLoopSide"),Q=y((r,e="top",n=0,s=0)=>{const a=r.x,c=r.y-n,g=r.width/2,l=r.height/2,d=Math.max(36,Math.min(100,r.width*.8)),i=C(Math.max(s,r.width*.35),36,d),o=C(Math.min(r.width,r.height)*.45,24,48);switch(e){case"bottom":{const t=c+l;return[{x:a-i/2,y:t},{x:a-i/2,y:t+o},{x:a+i/2,y:t+o},{x:a+i/2,y:t}]}case"right":{const t=a+g;return[{x:t,y:c-i/2},{x:t+o,y:c-i/2},{x:t+o,y:c+i/2},{x:t,y:c+i/2}]}case"left":{const t=a-g;return[{x:t,y:c-i/2},{x:t-o,y:c-i/2},{x:t-o,y:c+i/2},{x:t,y:c+i/2}]}default:{const t=c-l;return[{x:a-i/2,y:t},{x:a-i/2,y:t-o},{x:a+i/2,y:t-o},{x:a+i/2,y:t}]}}},"getSelfLoopPoints"),V=y((r,e,n="top",s=0,a={})=>{const g=r.x,l=r.y-s,d=a.width??0,i=a.height??0;switch(n){case"bottom":return{x:g,y:Math.max(...e.map(o=>o.y))+i/2+4};case"right":return{x:Math.max(...e.map(o=>o.x))+d/2+4,y:l};case"left":return{x:Math.min(...e.map(o=>o.x))-d/2-4,y:l};default:return{x:g,y:Math.min(...e.map(o=>o.y))-i/2-4}}},"getSelfLoopLabelPosition"),v=y((r,e=0,{mergeSelfLoops:n=!0}={})=>{const s=new Map,a=[],c=r.graph()?.rankdir;return r.edges().forEach(g=>{const l=r.edge(g);if(n&&l.selfLoop){const d=l.selfLoop.id;s.has(d)||s.set(d,[]),s.get(d).push({edge:l,start:g.v,end:g.w})}else a.push({edge:l,start:g.v,end:g.w})}),s.forEach(g=>{if(g.length!==3){g.forEach(L=>a.push(L));return}g.sort((L,E)=>L.edge.selfLoop.order-E.edge.selfLoop.order);const[l,d,i]=g,o=l.edge.originalEdge??d.edge.originalEdge??i.edge.originalEdge??d.edge,t=r.node(o.start);if(!t){g.forEach(L=>a.push(L));return}const m={width:d.edge.width,height:d.edge.height},w=K(r,t,g,o.start,c),p=Q(t,w,e,m.width??0),f=V(t,p,w,e,m),h={...d.edge,...o,id:o.id,points:p,start:o.start,end:o.end,x:f.x,y:f.y,width:m.width,height:m.height,labelStyle:d.edge.labelStyle,fromCluster:l.edge.fromCluster??d.edge.fromCluster??i.edge.fromCluster,toCluster:l.edge.toCluster??d.edge.toCluster??i.edge.toCluster};delete h.selfLoop,delete h.originalEdge,a.push({edge:h,start:h.start,end:h.end})}),a},"getEdgesToRender"),I=y(async({element:r,graph:e,diagramType:n,id:s,parentCluster:a,siteConfig:c})=>{const g=e.graph().rankdir;u.trace("Dir in recursive render - dir:",g);const{clusters:l,edgePaths:d,edgeLabels:i,nodes:o,rootGroups:t}=W(r,{edgePathsClass:"edgePaths"});e.nodes()?u.info("Recursive render XXX",e.nodes()):u.info("No nodes found for",e),e.edges().length>0&&u.info("Recursive edges",e.edge(e.edges()[0]));const m=q(n);await Promise.all(e.nodes().map(async function(p){const f=e.node(p);if(a!==void 0){const h=JSON.parse(JSON.stringify(a.clusterData));u.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,p,`
|
|
3
3
|
data=`,h.height,`
|
|
4
4
|
Parent cluster`,a.height),e.setNode(a.id,h),e.parent(p)||(u.trace("Setting parent",p,a.id),e.setParent(p,a.id,h))}if(u.info("(Insert) Node XXX"+p+": "+JSON.stringify(e.node(p))),f?.clusterNode){u.info("Cluster identified XBX",p,f.width,e.node(p));const{ranksep:h,nodesep:L}=e.graph();f.graph.setGraph({...f.graph.graph(),ranksep:h+25,nodesep:L});const E=await re({element:o,graph:f.graph,diagramType:n,id:s,parentCluster:e.node(p),siteConfig:c}),S=E.elem;k(f,S),f.diff=E.diff||0,u.info("New compound node after recursive render XAX",p,"width",f.width,"height",f.height),O(S,f)}else e.children(p).length>0?(u.trace("Cluster - the non recursive path XBX",p,f.id,f,f.width,"Graph:",e),u.trace(X(f.id,e)),b.set(f.id,{id:X(f.id,e),node:f})):(u.trace("Node - the non recursive path XAX",p,o,e.node(p),g),await T(o,e.node(p),{config:c,dir:g}))})),await y(async()=>{const p=e.edges().map(async function(f){const h=e.edge(f.v,f.w,f.name);if(u.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(f)),u.info("Edge "+f.v+" -> "+f.w+": ",f," ",JSON.stringify(e.edge(f))),u.info("Fix",b,"ids:",f.v,f.w,"Translating: ",b.get(f.v),b.get(f.w)),m&&h.selfLoop){if(h.selfLoop.order!==1)return;const L={...h.originalEdge,...h,id:h.selfLoop.id,startLabelLeft:h.originalEdge?.startLabelLeft??h.startLabelLeft,startLabelRight:h.originalEdge?.startLabelRight??h.startLabelRight,endLabelLeft:h.originalEdge?.endLabelLeft??h.endLabelLeft,endLabelRight:h.originalEdge?.endLabelRight??h.endLabelRight};await D(i,L),h.width=L.width,h.height=L.height,h.labelStyle=L.labelStyle;return}await D(i,h)});await Promise.all(p)},"processEdges")();const{subGraphTitleTotalMargin:w}=A(c);return{elem:t,graph:e,groups:{clusters:l,edgePaths:d,edgeLabels:i,nodes:o,rootGroups:t},diagramType:n,id:s,mergeSelfLoops:m,subGraphTitleTotalMargin:w}},"measureDagreGraph"),M=y(r=>{u.info("############################################# XXX"),u.info("### Layout ### XXX"),u.info("############################################# XXX"),J(r)},"runDagreGraphLayout"),Z=y((r,e,n)=>{const s=r.node(e);if(!s)return;const a={...s};return s?.clusterNode?a.y=(s.y??0)+n:r.children(e).length>0?a.height=(s.height??0)+n:a.y=(s.y??0)+n/2,a},"normalizeDagreNode"),P=y((r,e)=>{U.forEach(n=>{e[n]!==void 0&&(r[n]=e[n])})},"applyDagreNodeLayout"),$=y((r,e,n,s)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+s:a.y}))}),"normalizeDagreEdge"),ee=y((r,e)=>{const{graph:n,mergeSelfLoops:s,subGraphTitleTotalMargin:a=0}=e,c=new Map(r.nodes.map(l=>[l.id,l]));x(n).forEach(l=>{const d=Z(n,l,a);if(!d)return;P(n.node(l),d);const i=c.get(l);i&&P(i,d)});const g=a/2;return r.edges=v(n,g,{mergeSelfLoops:s}).map(({edge:l,start:d,end:i})=>$(l,d,i,g)),r},"applyDagreLayoutResult"),te=y(async({elem:r,graph:e,groups:{clusters:n,edgePaths:s},diagramType:a,id:c,mergeSelfLoops:g,subGraphTitleTotalMargin:l})=>{let d=0;await Promise.all(x(e).map(async function(o){const t=e.node(o);if(u.info("Position XBX => "+o+": ("+t.x,","+t.y,") width: ",t.width," height: ",t.height),t?.clusterNode)t.y+=l,u.info("A tainted cluster node XBX1",o,t.id,t.width,t.height,t.x,t.y,e.parent(o)),b.get(t.id).node=t,N(t);else if(e.children(o).length>0){u.info("A pure cluster node XBX1",o,t.id,t.x,t.y,t.width,t.height,e.parent(o)),t.height+=l,e.node(t.parentId);const m=t?.padding/2||0,w=t?.labelBBox?.height||0,p=w-m||0;u.debug("OffsetY",p,"labelHeight",w,"halfPadding",m),await z(n,t),b.get(t.id).node=t}else{const m=e.node(t.parentId);t.y+=l/2,u.info("A regular node XBX1 - using the padding",t.id,"parent",t.parentId,t.width,t.height,t.x,t.y,"offsetY",t.offsetY,"parent",m,m?.offsetY,t),N(t)}}));const i=l/2;return v(e,i,{mergeSelfLoops:g}).forEach(function({edge:o,start:t,end:m}){u.info("Edge "+t+" -> "+m+": "+JSON.stringify(o),o),o.points.forEach(h=>h.y+=i);const w=e.node(t),p=e.node(m),f=_(s,o,b,a,w,p,c);Y(o,f)}),e.nodes().forEach(function(o){const t=e.node(o);u.info(o,t.type,t.diff),t.isGroup&&(d=t.diff)}),u.warn("Returning from recursive render XAX",r,d),{elem:r,diff:d}},"paintDagreLayoutCore"),re=y(async r=>{const e=await I(r);return M(e.graph),await te(e)},"renderDagreSubgraph"),B=y(r=>{const e=new H({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach(n=>{e.setNode(n.id,{...n}),n.parentId&&e.setParent(n.id,n.parentId)}),u.debug("Edges:",r.edges),r.edges.forEach(n=>{if(n.start===n.end){const s=n.start,a=s+"---"+s+"---1",c=s+"---"+s+"---2",g=e.node(s);e.setNode(a,{domId:a,id:a,parentId:g.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(a,g.parentId),e.setNode(c,{domId:c,id:c,parentId:g.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(c,g.parentId);const l=structuredClone(n),d=structuredClone(n),i=structuredClone(n),o=structuredClone(n);d.originalEdge=l,d.selfLoop={id:l.id,order:0},i.originalEdge=l,i.selfLoop={id:l.id,order:1},o.originalEdge=l,o.selfLoop={id:l.id,order:2},d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=s+"-cyclic-special-1",i.startLabelRight="",i.startLabelLeft="",i.endLabelLeft="",i.endLabelRight="",i.arrowTypeStart="none",i.arrowTypeEnd="none",i.id=s+"-cyclic-special-mid",o.label="",o.startLabelRight="",o.startLabelLeft="",o.arrowTypeStart="none",g.isGroup&&(d.fromCluster=s,o.toCluster=s),o.id=s+"-cyclic-special-2",o.arrowTypeStart="none",e.setEdge(s,a,d,s+"-cyclic-special-0"),e.setEdge(a,c,i,s+"-cyclic-special-1"),e.setEdge(c,s,o,s+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),j(e),{graph:e}},"prepareLayoutForDagre"),oe=y(async(r,{element:e,preparedLayout:n})=>{const s=n??B(r),a=G(),c=await I({element:e,graph:s.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:a});return s.measuredLayout=c,c},"measureDagreLayout"),ne=y((r,e)=>{const n=e.preparedLayout?.measuredLayout;if(!n)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return M(n.graph),ee(r,n),n},"runDagreLayoutCore"),we=F({prepareLayout:B,measureLayout:oe,runLayoutCore:ne,paintOptions:{clusterDb:b,getNodes:y((r,{measure:e})=>x(e.graph).map(n=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),getEdgeNode:y((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),skipNode:y((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:y((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{ee as applyDagreLayoutResult,v as getEdgesToRender,oe as measureDagreLayout,B as prepareLayoutForDagre,we as render,ne as runDagreLayoutCore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var n=(e,o)=>c(e,"name",{value:o,configurable:!0});import{
|
|
1
|
+
var c=Object.defineProperty;var n=(e,o)=>c(e,"name",{value:o,configurable:!0});import{Vt as p}from"./index-DTMtHDxt.js";import{PAPERCLIP_CHARACTER as a}from"./character-CguPM7IG.js";import{o as l,r as f}from"./model-DL5biheO.js";function b(e,o=!1){const r=p[o?"muted-dream":e.paletteId],i={...a.character,id:"paperclip-cap-v1",name:"Agent",color:r.a,color2:r.b,followCursor:!0,followRotation:!0},s=f({version:1,name:"Paperclip",characters:[i],expressions:a.expressions,animations:a.animations},i);for(const t of s.animations)t.id==="happy"&&(t.loop=!1);return s}n(b,"characterDefinition");function d(e){return e==="success"?"happy":e==="rest"?"idle":e}n(d,"animationId");function C(e,o){if(o==="rest"){const r=e.expressions.find(i=>i.id==="idle")??e.expressions[0];return{pose:{...r.beats[0].pose},blink:0,bob:0,breathe:0,expressionId:r.id,beatIndex:0,stepIndex:0,faceLayers:void 0}}return l(e,d(o),.6)}n(C,"characterStill");export{d as animationId,b as characterDefinition,C as characterStill};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var X=Object.defineProperty;var v=(n,t)=>X(n,"name",{value:t,configurable:!0});import{n as O}from"./mermaid-parser.core-CHJSk6z0.js";import{n as f}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as A}from"./src-Bssc388C.js";import{H as G,K as Y,U as P,a as F,b as E,c as U,f as Z,v as q,w as j,y as K,z as J}from"./chunk-DU6HZSFF-
|
|
1
|
+
var X=Object.defineProperty;var v=(n,t)=>X(n,"name",{value:t,configurable:!0});import{n as O}from"./mermaid-parser.core-CHJSk6z0.js";import{n as f}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as A}from"./src-Bssc388C.js";import{H as G,K as Y,U as P,a as F,b as E,c as U,f as Z,v as q,w as j,y as K,z as J}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import{i as D}from"./chunk-75Z2AOVW-CTyOxDW3.js";import{t as Q}from"./chunk-JWPE2WC7--HEGjv3t.js";import{r as ee,t as te}from"./chunk-PWAF6VOD-DHqPPKbd.js";import{t as ne}from"./chunk-2Q5K7J3B-CkPHWFj-.js";import{f as re}from"./mermaid.core-Be3XJK9z.js";var L=/[─━│┃└┗├┣]/,M=/[└┗├┣]/,ie=/[─━]/,$=/^[\s│┃]+$/,k=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,N=/^\s*%%/,oe=" ";function _(n){return n.some(t=>L.test(t))}v(_,"isBoxDrawingFormat");f(_,"isBoxDrawingFormat");function S(n){for(const t of n){const e=M.exec(t);if(e?.index&&e.index>0)return e.index}return 4}v(S,"inferSegmentWidth");f(S,"inferSegmentWidth");function H(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}v(H,"remapErrorLines");f(H,"remapErrorLines");function R(n){const t=n.split(`
|
|
2
2
|
`),e=new Map;let r=-1;for(const[h,a]of t.entries())if(a.trim()==="treeView-beta"){r=h;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let h=r+1;h<t.length;h++){const a=t[h];a.trim()===""||N.test(a)||k.test(a)||$.test(a)||s.push(a.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=S(s),o=[];let c=0;for(let h=0;h<=r;h++)o.push(t[h]),c++,e.set(c,h+1);for(let h=r+1;h<t.length;h++){const a=t[h],l=a.trim(),d=h+1;if(l===""){o.push(a),c++,e.set(c,d);continue}if(N.test(a)){o.push(a),c++,e.set(c,d);continue}if(k.test(a)){o.push(a),c++,e.set(c,d);continue}if($.test(a))continue;const p=a.replace(/\t/g," "),x=M.exec(p);if(x?.index!==void 0){const u=x.index,m=Math.round(u/i)+1;let g=u+1;for(;g<p.length&&ie.test(p[g]);)g++;for(;g<p.length&&p[g]===" ";)g++;const I=p.slice(g).trimEnd();if(!I)throw new Error(`Line ${d}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=oe.repeat(m);o.push(W+I),c++,e.set(c,d)}else{if(/^[\s─━│┃└┗├┣]+$/.test(p))continue;if(L.test(p))o.push(a),c++,e.set(c,d);else{if(/^\s+/.test(p))throw new Error(`Line ${d}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(a),c++,e.set(c,d)}}}return{text:o.join(`
|
|
3
3
|
`),lineMap:e}}v(R,"preprocessBoxDrawing");f(R,"preprocessBoxDrawing");var w=new ne(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),se=f(()=>{w.reset(),F()},"clear"),ae=f(()=>w.records.stack[0],"getRoot"),ce=f(()=>w.records.cnt,"getCount"),le=Z.treeView,C={clear:se,addNode:f((n,t,e,r,s,i)=>{for(;n<=w.records.stack[w.records.stack.length-1].level;)w.records.stack.pop();const o={id:w.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};w.records.stack[w.records.stack.length-1].children.push(o),w.records.stack.push(o)},"addNode"),getRoot:ae,getCount:ce,getConfig:f(()=>D(le,E().treeView),"getConfig"),getAccTitle:K,getAccDescription:q,getDiagramTitle:j,setAccDescription:G,setAccTitle:P,setDiagramTitle:Y},de=f(n=>{Q(n,C);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,c=t.iconAnnotation,h=c!==void 0?c||"none":void 0,a=t.descAnnotation||void 0,l=a?J(a,E()):void 0;C.addNode(e,r,i,o,h,l)}},"populate"),he={parse:f(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await O("treeView",t);A.debug(r),de(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=H(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function z(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}v(z,"detectIcon");f(z,"detectIcon");function y(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}v(y,"qualifyIcon");f(y,"qualifyIcon");function T(n,t){if(n.icon!=="none"){if(n.icon)return y(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=z(n.name,t);if(e==="none")return;if(e)return y(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}v(T,"getNodeIcon");f(T,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var B=14,pe=4,fe=16,ge=f(async(n,t)=>{const e=[],r=f(i=>{const o=T(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await te(i,{height:B,width:B})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),ue=f((n,t,e,r,s,i)=>{const o=r.append("g");let c="treeView-node-label";e.nodeType==="directory"&&(c+=" treeView-node-dir"),e.cssClass&&(c+=` ${e.cssClass}`);const h=B+pe,a=T(e,s),l=a!==void 0;a&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const d=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",c),{height:p,width:x}=d.node().getBBox(),u=p+s.paddingY*2,m=n+s.paddingX+(l?h:0);d.attr("x",m),d.attr("y",t+u/2);const g=m+x;return e.BBox={x:n,y:t,width:x+s.paddingX*2+(l?h:0),height:u},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:g,centerY:t+u/2}},"positionLabel"),V=f((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=f((n,t,e,r)=>{let s=0,i=0;const o=[],c=f((l,d,p,x)=>{const u=x*(p.rowIndent+p.paddingX),m=ue(u,s,d,l,p,r);o.push(m);const{height:g,width:I}=d.BBox;V(l,u-p.rowIndent,s+g/2,u,s+g/2,p.lineThickness),i=Math.max(i,u+I),s+=g},"drawNode"),h=f((l,d=0)=>{c(n,l,e,d),l.children.forEach(m=>{h(m,d+1)});const{x:p,y:x,height:u}=l.BBox;if(l.children.length){const{y:m,height:g}=l.children[l.children.length-1].BBox;V(n,p+e.paddingX,x+u,p+e.paddingX,m+g/2+e.lineThickness/2,e.lineThickness)}},"processNode");h(t);const a=o.filter(l=>l.node.description);if(a.length>0){const l=Math.max(...o.map(d=>d.labelRightEdge))+fe;for(const d of a){const p=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",l).attr("y",d.centerY).node().getBBox();i=Math.max(i,l+p.width+e.paddingX)}}for(const l of o)if(l.node.cssClass?.split(/\s+/).includes("highlight")){const d=l.nodeGroup.select(".treeView-highlight-bg");if(!d.empty()){const p=i-l.node.BBox.x+8;d.attr("width",p),i=Math.max(i,l.node.BBox.x+p+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),we={draw:f(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
|
|
4
4
|
`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),c=re(t),h=c.append("g");h.attr("class","tree-view");const{totalHeight:a,totalWidth:l}=me(h,i,o,await ge(i,o));c.attr("viewBox",`-${o.lineThickness/2} 0 ${l} ${a}`),U(c,a,l,o.useMaxWidth)},"draw")},xe={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ve={db:C,renderer:we,parser:he,styles:f(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:c}=D(xe,n);return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var R=Object.defineProperty;var h=(a,t)=>R(a,"name",{value:t,configurable:!0});import{n as I}from"./mermaid-parser.core-CHJSk6z0.js";import{n as c}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as b}from"./src-Bssc388C.js";import{D as _,H as D,K as E,U as F,a as P,b as A,c as z,f as G,v as B,w as W,y as H}from"./chunk-DU6HZSFF-
|
|
1
|
+
var R=Object.defineProperty;var h=(a,t)=>R(a,"name",{value:t,configurable:!0});import{n as I}from"./mermaid-parser.core-CHJSk6z0.js";import{n as c}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as b}from"./src-Bssc388C.js";import{D as _,H as D,K as E,U as F,a as P,b as A,c as z,f as G,v as B,w as W,y as H}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import{i as w}from"./chunk-75Z2AOVW-CTyOxDW3.js";import{t as U}from"./chunk-JWPE2WC7--HEGjv3t.js";import{f as V}from"./mermaid.core-Be3XJK9z.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,M={axes:[],curves:[],options:x},p=structuredClone(M),j=G.radar,K=c(()=>w({...j,...A().radar}),"getConfig"),L=c(()=>p.axes,"getAxes"),X=c(()=>p.curves,"getCurves"),N=c(()=>p.options,"getOptions"),Y=c(a=>{p.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{p.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=L();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),v={getAxes:L,getCurves:X,getOptions:N,setAxes:Y,setCurves:Z,setOptions:c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});p.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},p.options.ticks>y&&(b.warn(`Radar diagram ticks (${p.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),p.options.ticks=y)},"setOptions"),getConfig:K,clear:c(()=>{P(),p=structuredClone(M)},"clear"),setAccTitle:F,getAccTitle:H,setDiagramTitle:E,getDiagramTitle:W,getAccDescription:B,setAccDescription:D},J=c(a=>{U(a,v);const{axes:t,curves:e,options:r}=a;v.setAxes(t),v.setCurves(e),v.setOptions(r)},"populate"),Q={parse:c(async a=>{const t=await I("radar",a);b.debug(t),J(t)},"parse")},tt=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),u=et(V(t),o),m=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),g=n.min,$=Math.min(o.width,o.height)/2;at(u,i,$,n.ticks,n.graticule),rt(u,i,$,o),T(u,i,l,g,m,n.graticule,o),O(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),et=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return z(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),at=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,u)=>{const m=2*u*Math.PI/i-Math.PI/2;return`${n*Math.cos(m)},${n*Math.sin(m)}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),rt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const u=o>.01?"start":o<-.01?"end":"middle",m=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",u).attr("dominant-baseline",m).attr("class","radarAxisLabel")}},"drawAxes");function T(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,u)=>{if(d.entries.length!==n)return;const m=d.entries.map((g,$)=>{const f=2*Math.PI*$/n-Math.PI/2,C=S(g,r,s,o);return{x:C*Math.cos(f),y:C*Math.sin(f)}});i==="circle"?a.append("path").attr("d",k(m,l.curveTension)).attr("class",`radarCurve-${u}`):i==="polygon"&&a.append("polygon").attr("points",m.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${u}`)})}h(T,"drawCurves");c(T,"drawCurves");function S(a,t,e,r){return r*(Math.min(Math.max(a,t),e)-t)/(e-t)}h(S,"relativeRadius");c(S,"relativeRadius");function k(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},u={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${u.x},${u.y} ${n.x},${n.y}`}return`${r} Z`}h(k,"closedRoundCurve");c(k,"closedRoundCurve");function O(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}h(O,"drawLegend");c(O,"drawLegend");var st={draw:tt},nt=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
|
2
2
|
.radarCurve-${r} {
|
|
3
3
|
color: ${s};
|
|
4
4
|
fill: ${s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var oe=Object.defineProperty;var l=(e,n)=>oe(e,"name",{value:n,configurable:!0});import{T as se}from"./chunk-FOHPRMQF-7Ogwfo6e.js";import{n as le}from"./mermaid-parser.core-CHJSk6z0.js";import{n as o}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as h,p as de}from"./src-Bssc388C.js";import{H as ce,K as me,U as ue,Y as xe,a as fe,b as S,f as ge,v as he,w as pe,x as T,y as be,z as y}from"./chunk-DU6HZSFF-
|
|
1
|
+
var oe=Object.defineProperty;var l=(e,n)=>oe(e,"name",{value:n,configurable:!0});import{T as se}from"./chunk-FOHPRMQF-7Ogwfo6e.js";import{n as le}from"./mermaid-parser.core-CHJSk6z0.js";import{n as o}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as h,p as de}from"./src-Bssc388C.js";import{H as ce,K as me,U as ue,Y as xe,a as fe,b as S,f as ge,v as he,w as pe,x as T,y as be,z as y}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import{_ as P,i as ve,t as we}from"./chunk-75Z2AOVW-CTyOxDW3.js";import{t as ye}from"./chunk-JWPE2WC7--HEGjv3t.js";var $="position frame",D="frame positioned",M="position relation",C="relation positioned",Pe=o(function(e){h.debug("options str",e)},"setOptions"),Me=o(function(){return{}},"getOptions"),ke=o(function(){N(),fe()},"clear");function N(){B={}}l(N,"reset");o(N,"reset");var Fe=ge.eventmodeling,Se=o(()=>ve({...Fe,...S().eventmodeling}),"getConfig"),B={};function O(){let e=Be;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=V(i,n.dataEntities,t);e=w(e,{$kind:$,index:a,frame:i,textProps:r});let c;K(i)?(h.debug("source frame",i.sourceFrames),c=n.frames.filter(d=>i.sourceFrames.some(m=>m.$refText===d.name)),c.forEach(d=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:d})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}l(O,"getState");o(O,"getState");function W(e){B.ast=e}l(W,"setAst");o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}l(E,"getDiagramProps");o(E,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}l(I,"extractNamespace");o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}l(H,"extractName");o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}l(U,"findSwimlaneByNamespace");o(U,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}l(v,"findNextAvailableIndex");o(v,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}l(_,"calculateSwimlaneProps");o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=S();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}l(L,"calculateEntityVisualProps");o(L,"calculateEntityVisualProps");function V(e,n,t){const i=S(),a=y(H(e.entityIdentifier)??"",i);let r;const c={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let d=`<b>${P(a,t.textMaxWidth,c)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,c),r=r.replaceAll(" "," ")),e.dataReference){const g=n.find(b=>b.name===e.dataReference?.$refText);g&&(r=g.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
2
|
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,c),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(d+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},u=we(d,x),f=m?u.width/3:u.width,p={content:d,width:f,height:u.height};return h.debug(`[${e.name}] ${e.entityIdentifier} text`,p),p}l(V,"calculateTextProps");o(V,"calculateTextProps");function G(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}l(G,"decidePositionFrame");o(G,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}l(X,"calculateX");o(X,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}l(Y,"calculateMaxRight");o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}l(A,"sortedSwimlanesArray");o(A,"sortedSwimlanesArray");function j(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,c=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},m=X(a,c,r),x=m+d.width+s.boxPadding,u=Y(Object.values(e.swimlanes),x);a.r=m+d.width,a.maxHeight=Math.max(a.maxHeight,d.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const f={x:m,y:s.swimlanePadding+a.y,r:x,dimension:d,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},p={...e,boxes:[...e.boxes,f],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:u},g=A(p.swimlanes);g.length>0&&(g[0].y=0);for(let b=1;b<g.length;b++){const re=g[b],R=g[b-1];re.y=R.y+R.height+s.swimlaneGap}return p}l(j,"evolveFramePositioned");o(j,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}l(z,"isFirstFrame");o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}l(K,"hasSourceFrame");o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}l(k,"findBoxByFrame");o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}l(q,"findBoxByLineIndex");o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(se(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:C,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}l(J,"decidePositionRelation");o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}l(Q,"evolveRelationPositioned");o(Q,"evolveRelationPositioned");var Ee={[$]:G,[M]:J},Ae={[D]:j,[C]:Q};function Z(e,n){const t=Ee[n.$kind];if(t==null)return[];const i=t(e,n);return h.debug("decided events",i),i}l(Z,"decide");o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Ae[a.$kind];return r==null?i:r(i,a)},e);return h.debug("evolve events",{state:e,newState:t,events:n}),t}l(ee,"evolve");o(ee,"evolve");function w(e,n){return ee(e,Z(e,n))}l(w,"dispatch");o(w,"dispatch");var F={getConfig:Se,setOptions:Pe,getOptions:Me,clear:ke,setAccTitle:ue,getAccTitle:be,getAccDescription:he,setAccDescription:ce,setDiagramTitle:me,getDiagramTitle:pe,setAst:W,getDiagramProps:E,getState:O},Re={parse:o(async e=>{const n=await le("eventmodeling",e);h.debug(n),F.setAst(n),ye(n,F)},"parse")},Te=T()?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}l(te,"renderD3Box");o(te,"renderD3Box");function ne(e,n){return e>n}l(ne,"dirUpwards");o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,c=a.targetBox.swimlane.y+n.swimlanePadding,d=ne(r,c),m=a.sourceBox.x+a.sourceBox.dimension.width*2/3,x=a.targetBox.x+a.targetBox.dimension.width/3;let u,f;h.debug(`rendering relation up=${d} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),d?(u=r,f=c+a.targetBox.dimension.height):(u=r+a.sourceBox.dimension.height,f=c);const p=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",p).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${m} ${u} L${x} ${f}`)}}l(ie,"renderD3Relation");o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),c=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",c).attr("stroke",d),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}l(ae,"renderD3Swimlane");o(ae,"renderD3Swimlane");var Ue={parser:Re,db:F,renderer:{draw:o(function(e,n,t,i){if(h.debug("in eventmodeling renderer",e+`
|
|
3
3
|
`,"id:",n,t),!Te)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:c}=T(),d=de(`[id="${n}"]`),m=a.getDiagramProps(),x=a.getState(),u=`em-arrowhead-${n}`,f=r.emArrowhead??"#000000";x.sortedSwimlanesArray.forEach(ae(d,x.maxR,m,r)),x.boxes.forEach(te(d,m)),x.relations.forEach(ie(d,m,u,r)),d.append("defs").append("marker").attr("id",u).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",f),xe(void 0,d,c?.padding??30,c?.useMaxWidth)},"draw")},styles:o(e=>"","getStyles")};export{Ue as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ue=Object.defineProperty;var p=(t,a)=>ue(t,"name",{value:a,configurable:!0});import{n as pe}from"./mermaid-parser.core-CHJSk6z0.js";import{n as T}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as Q,p as U}from"./src-Bssc388C.js";import{D as de,H as fe,K as me,U as ge,a as ye,b as te,c as Se,f as ve,v as xe,w as be,y as we}from"./chunk-DU6HZSFF-2P5iNHqg.js";import{t as J}from"./ordinal-BJyFM1v8.js";import{t as W}from"./defaultLocale-C2Bpu8Ih.js";import{i as ee}from"./chunk-75Z2AOVW-BaPl5WA6.js";import{t as Ce}from"./chunk-JWPE2WC7--HEGjv3t.js";import{i as P,n as $e}from"./chunk-P2QGCYS3-CjqEi3mx.js";import{t as Te}from"./chunk-POPQ4Y6H-BytmIqFc.js";import{f as Le}from"./mermaid.core-G_BSi0G0.js";function _e(t){var a=0,n=t.children,r=n&&n.length;if(!r)a=1;else for(;--r>=0;)a+=n[r].value;t.value=a}p(_e,"count");function Ne(){return this.eachAfter(_e)}p(Ne,"count_default");function ke(t,a){let n=-1;for(const r of this)t.call(a,r,++n,this);return this}p(ke,"each_default");function Fe(t,a){for(var n=this,r=[n],l,i,c=-1;n=r.pop();)if(t.call(a,n,++c,this),l=n.children)for(i=l.length-1;i>=0;--i)r.push(l[i]);return this}p(Fe,"eachBefore_default");function Me(t,a){for(var n=this,r=[n],l=[],i,c,u,m=-1;n=r.pop();)if(l.push(n),i=n.children)for(c=0,u=i.length;c<u;++c)r.push(i[c]);for(;n=l.pop();)t.call(a,n,++m,this);return this}p(Me,"eachAfter_default");function ze(t,a){let n=-1;for(const r of this)if(t.call(a,r,++n,this))return r}p(ze,"find_default");function Ae(t){return this.eachAfter(function(a){for(var n=+t(a.data)||0,r=a.children,l=r&&r.length;--l>=0;)n+=r[l].value;a.value=n})}p(Ae,"sum_default");function De(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}p(De,"sort_default");function Ve(t){for(var a=this,n=Pe(a,t),r=[a];a!==n;)a=a.parent,r.push(a);for(var l=r.length;t!==n;)r.splice(l,0,t),t=t.parent;return r}p(Ve,"path_default");function Pe(t,a){if(t===a)return t;var n=t.ancestors(),r=a.ancestors(),l=null;for(t=n.pop(),a=r.pop();t===a;)l=t,t=n.pop(),a=r.pop();return l}p(Pe,"leastCommonAncestor");function Be(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}p(Be,"ancestors_default");function Ee(){return Array.from(this)}p(Ee,"descendants_default");function Ie(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}p(Ie,"leaves_default");function Re(){var t=this,a=[];return t.each(function(n){n!==t&&a.push({source:n.parent,target:n})}),a}p(Re,"links_default");function*We(){var t=this,a,n=[t],r,l,i;do for(a=n.reverse(),n=[];t=a.pop();)if(yield t,r=t.children)for(l=0,i=r.length;l<i;++l)n.push(r[l]);while(n.length)}p(We,"iterator_default");function ae(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Oe)):a===void 0&&(a=Ge);for(var n=new Y(t),r,l=[n],i,c,u,m;r=l.pop();)if((c=a(r.data))&&(m=(c=Array.from(c)).length))for(r.children=c,u=m-1;u>=0;--u)l.push(i=c[u]=new Y(c[u])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(je)}p(ae,"hierarchy");function He(){return ae(this).eachBefore(qe)}p(He,"node_copy");function Ge(t){return t.children}p(Ge,"objectChildren");function Oe(t){return Array.isArray(t)?t[1]:null}p(Oe,"mapChildren");function qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}p(qe,"copyData");function je(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}p(je,"computeHeight");function Y(t){this.data=t,this.depth=this.height=0,this.parent=null}p(Y,"Node");Y.prototype=ae.prototype={constructor:Y,count:Ne,each:ke,eachAfter:Me,eachBefore:Fe,find:ze,sum:Ae,sort:De,path:Ve,ancestors:Be,descendants:Ee,leaves:Ie,links:Re,copy:He,[Symbol.iterator]:We};function Ue(t){if(typeof t!="function")throw new Error;return t}p(Ue,"required");function H(){return 0}p(H,"constantZero");function G(t){return function(){return t}}p(G,"constant_default");function Ye(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}p(Ye,"round_default");function Ke(t,a,n,r,l){for(var i=t.children,c,u=-1,m=i.length,o=t.value&&(r-a)/t.value;++u<m;)c=i[u],c.y0=n,c.y1=l,c.x0=a,c.x1=a+=c.value*o}p(Ke,"dice_default");function Xe(t,a,n,r,l){for(var i=t.children,c,u=-1,m=i.length,o=t.value&&(l-n)/t.value;++u<m;)c=i[u],c.x0=a,c.x1=r,c.y0=n,c.y1=n+=c.value*o}p(Xe,"slice_default");var Ze=(1+Math.sqrt(5))/2;function Je(t,a,n,r,l,i){for(var c=[],u=a.children,m,o,d=0,b=0,s=u.length,x,S,v=a.value,f,g,z,k,A,E,N;d<s;){x=l-n,S=i-r;do f=u[b++].value;while(!f&&b<s);for(g=z=f,E=Math.max(S/x,x/S)/(v*t),N=f*f*E,A=Math.max(z/N,N/g);b<s;++b){if(f+=o=u[b].value,o<g&&(g=o),o>z&&(z=o),N=f*f*E,k=Math.max(z/N,N/g),k>A){f-=o;break}A=k}c.push(m={value:f,dice:x<S,children:u.slice(d,b)}),m.dice?Ke(m,n,r,l,v?r+=S*f/v:i):Xe(m,n,r,v?n+=x*f/v:l,i),v-=f,d=b}return c}p(Je,"squarifyRatio");var Qe=p((function t(a){function n(r,l,i,c,u){Je(a,r,l,i,c,u)}return p(n,"squarify"),n.ratio=function(r){return t((r=+r)>1?r:1)},n}),"custom")(Ze);function et(){var t=Qe,a=!1,n=1,r=1,l=[0],i=H,c=H,u=H,m=H,o=H;function d(s){return s.x0=s.y0=0,s.x1=n,s.y1=r,s.eachBefore(b),l=[0],a&&s.eachBefore(Ye),s}p(d,"treemap");function b(s){var x=l[s.depth],S=s.x0+x,v=s.y0+x,f=s.x1-x,g=s.y1-x;f<S&&(S=f=(S+f)/2),g<v&&(v=g=(v+g)/2),s.x0=S,s.y0=v,s.x1=f,s.y1=g,s.children&&(x=l[s.depth+1]=i(s)/2,S+=o(s)-x,v+=c(s)-x,f-=u(s)-x,g-=m(s)-x,f<S&&(S=f=(S+f)/2),g<v&&(v=g=(v+g)/2),t(s,S,v,f,g))}return p(b,"positionNode"),d.round=function(s){return arguments.length?(a=!!s,d):a},d.size=function(s){return arguments.length?(n=+s[0],r=+s[1],d):[n,r]},d.tile=function(s){return arguments.length?(t=Ue(s),d):t},d.padding=function(s){return arguments.length?d.paddingInner(s).paddingOuter(s):d.paddingInner()},d.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:G(+s),d):i},d.paddingOuter=function(s){return arguments.length?d.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):d.paddingTop()},d.paddingTop=function(s){return arguments.length?(c=typeof s=="function"?s:G(+s),d):c},d.paddingRight=function(s){return arguments.length?(u=typeof s=="function"?s:G(+s),d):u},d.paddingBottom=function(s){return arguments.length?(m=typeof s=="function"?s:G(+s),d):m},d.paddingLeft=function(s){return arguments.length?(o=typeof s=="function"?s:G(+s),d):o},d}p(et,"treemap_default");var le=class{static{p(this,"TreeMapDB")}constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=ge,this.getAccTitle=we,this.setDiagramTitle=me,this.getDiagramTitle=be,this.getAccDescription=xe,this.setAccDescription=fe}static{T(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const t=ve,a=te();return ee({...t.treemap,...a.treemap??{}})}addNode(t,a){this.nodes.push(t),this.levels.set(t,a),a===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},r=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(l=>{$e(l)&&(n?.textStyles?n.textStyles.push(l):n.textStyles=[l]),n?.styles?n.styles.push(l):n.styles=[l]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){ye(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function se(t){if(!t.length)return[];const a=[],n=[];return t.forEach(r=>{const l={name:r.name,children:r.type==="Leaf"?void 0:[]};for(l.classSelector=r?.classSelector,r?.cssCompiledStyles&&(l.cssCompiledStyles=r.cssCompiledStyles),r.type==="Leaf"&&r.value!==void 0&&(l.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();if(n.length===0)a.push(l);else{const i=n[n.length-1].node;i.children?i.children.push(l):i.children=[l]}r.type!=="Leaf"&&n.push({node:l,level:r.level})}),a}p(se,"buildHierarchy");T(se,"buildHierarchy");var tt=T((t,a)=>{Ce(t,a);const n=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const c=i.item;if(!c)continue;const u=i.indent?parseInt(i.indent):0,m=at(c),o=c.classSelector?a.getStylesForClass(c.classSelector):[],d=o.length>0?o:void 0,b={level:u,name:m,type:c.$type,value:c.value,classSelector:c.classSelector,cssCompiledStyles:d};n.push(b)}const r=se(n),l=T((i,c)=>{for(const u of i)a.addNode(u,c),u.children&&u.children.length>0&&l(u.children,c+1)},"addNodesRecursively");l(r,0)},"populate"),at=T(t=>t.name?String(t.name):"","getItemName"),ie={parser:{yy:void 0},parse:T(async t=>{try{const a=await pe("treemap",t);Q.debug("Treemap AST:",a);const n=ie.parser?.yy;if(!(n instanceof le))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");tt(a,n)}catch(a){throw Q.error("Error parsing treemap:",a),a}},"parse")},nt=10,B=10,O=25,rt={draw:T((t,a,n,r)=>{const l=r.db,i=l.getConfig(),c=i.padding??nt,u=l.getDiagramTitle(),m=l.getRoot(),{themeVariables:o}=te();if(!m)return;const d=u?30:0,b=Le(a),s=i.nodeWidth?i.nodeWidth*B:960,x=i.nodeHeight?i.nodeHeight*B:500,S=s,v=x+d;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,i.useMaxWidth);let f;try{const e=i.valueFormat||",";if(e==="$0,0")f=T(h=>"$"+W(",")(h),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const h=/\.\d+/.exec(e),C=h?h[0]:"";f=T(_=>"$"+W(","+C)(_),"valueFormat")}else if(e.startsWith("$")){const h=e.substring(1);f=T(C=>"$"+W(h||"")(C),"valueFormat")}else f=W(e)}catch(e){Q.error("Error creating format function:",e),f=W(",")}const g=J().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),z=J().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),k=J().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);u&&b.append("text").attr("x",S/2).attr("y",d/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const A=b.append("g").attr("transform",`translate(0, ${d})`).attr("class","treemapContainer"),E=ae(m).sum(e=>e.value??0).sort((e,h)=>(h.value??0)-(e.value??0)),N=et().size([s,x]).paddingTop(e=>e.children&&e.children.length>0?O+B:0).paddingInner(c).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),oe=N.descendants().filter(e=>e.children&&e.children.length>0),I=A.selectAll(".treemapSection").data(oe).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);I.append("rect").attr("width",e=>e.x1-e.x0).attr("height",O).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),I.append("clipPath").attr("id",(e,h)=>`clip-section-${a}-${h}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",O),I.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,h)=>`treemapSection section${h}`).attr("fill",e=>g(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>z(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const h=P({cssCompiledStyles:e.data.cssCompiledStyles});return h.nodeStyles+";"+h.borderStyles.join(";")}),I.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",O/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,h)=>`url(#clip-section-${a}-${h})`).attr("style",e=>e.depth===0?"display: none;":"dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).each(function(e){if(e.depth===0)return;const h=U(this),C=e.data.name;h.text(C);const _=e.x1-e.x0,M=6;let L;i.showValues!==!1&&e.value?L=_-10-30-10-M:L=_-M-6;const $=Math.max(15,L),y=h.node();if(y.getComputedTextLength()>$){let w=C;for(;w.length>0;){if(w=C.substring(0,w.length-1),w.length===0){h.text("..."),y.getComputedTextLength()>$&&h.text("");break}if(h.text(w+"..."),y.getComputedTextLength()<=$)break}}}),i.showValues!==!1&&I.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",O/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>e.depth===0?"display: none;":"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"));const ne=N.leaves(),F=ne.length>20,ce=F?16:38,q=F?14:28,D=F?4:8,V=F?4:6,K=F?2:4,re=F?8:10,X=F?1:2,j=A.selectAll(".treemapLeafGroup").data(ne).enter().append("g").attr("class",(e,h)=>`treemapNode treemapLeafGroup leaf${h}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,h)=>`clip-${a}-${h}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${ce}px;fill:`+k(e.data.name)+";"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,h)=>`url(#clip-${a}-${h})`).text(e=>e.data.name).each(function(e){const h=U(this),C=e.x1-e.x0,_=e.y1-e.y0,M=h.node(),L=C-2*K,$=_-2*K;if(L<re||$<re){h.style("display","none");return}let y=parseInt(h.style("font-size"),10);const R=.6;for(;M.getComputedTextLength()>L&&y>D;)y--,h.style("font-size",`${y}px`);let w=Math.max(V,Math.min(q,Math.round(y*R))),Z=y+X+w;for(;Z>$&&y>D&&(y--,w=Math.max(V,Math.min(q,Math.round(y*R))),!(w<V&&y===D));)h.style("font-size",`${y}px`),Z=y+X+w,w<=V&&Z>$;h.style("font-size",`${y}px`),F?(y<D||$<D)&&h.style("display","none"):(M.getComputedTextLength()>L||y<D||$<y)&&h.style("display","none")}),i.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${q}px;fill:`+k(e.data.name)+";"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,h)=>`url(#clip-${a}-${h})`).text(e=>e.value?f(e.value):"").each(function(e){const h=U(this),C=this.parentNode;if(!C){h.style("display","none");return}const _=U(C).select(".treemapLabel");if(_.empty()||_.style("display")==="none"){h.style("display","none");return}const M=parseFloat(_.style("font-size")),L=Math.max(V,Math.min(q,Math.round(M*.6)));h.style("font-size",`${L}px`);const $=(e.y1-e.y0)/2+M/2+X;h.attr("y",$);const y=e.x1-e.x0,R=e.y1-e.y0-4,w=y-2*K;h.node().getComputedTextLength()>w||$+L>R||L<V?h.style("display","none"):h.style("display",null)});const he=i.diagramPadding??8;Te(b,he,"flowchart",i?.useMaxWidth||!1)},"draw"),getClasses:T(function(t,a){return a.db.getClasses()},"getClasses")},lt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},St={parser:ie,get db(){return new le},renderer:rt,styles:T(({treemap:t}={})=>{const a=de(),n=te(),r=ee(a,n.themeVariables),l=ee(lt,t),i=l.titleColor??r.titleColor,c=l.labelColor??r.textColor,u=l.valueColor??r.textColor;return`
|
|
1
|
+
var ue=Object.defineProperty;var p=(t,a)=>ue(t,"name",{value:a,configurable:!0});import{n as pe}from"./mermaid-parser.core-CHJSk6z0.js";import{n as T}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as Q,p as U}from"./src-Bssc388C.js";import{D as de,H as fe,K as me,U as ge,a as ye,b as te,c as Se,f as ve,v as xe,w as be,y as we}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import{t as J}from"./ordinal-BJyFM1v8.js";import{t as W}from"./defaultLocale-C2Bpu8Ih.js";import{i as ee}from"./chunk-75Z2AOVW-CTyOxDW3.js";import{t as Ce}from"./chunk-JWPE2WC7--HEGjv3t.js";import{i as P,n as $e}from"./chunk-P2QGCYS3-DD1uZyrA.js";import{t as Te}from"./chunk-POPQ4Y6H-B0MtQqlF.js";import{f as Le}from"./mermaid.core-Be3XJK9z.js";function _e(t){var a=0,n=t.children,r=n&&n.length;if(!r)a=1;else for(;--r>=0;)a+=n[r].value;t.value=a}p(_e,"count");function Ne(){return this.eachAfter(_e)}p(Ne,"count_default");function ke(t,a){let n=-1;for(const r of this)t.call(a,r,++n,this);return this}p(ke,"each_default");function Fe(t,a){for(var n=this,r=[n],l,i,c=-1;n=r.pop();)if(t.call(a,n,++c,this),l=n.children)for(i=l.length-1;i>=0;--i)r.push(l[i]);return this}p(Fe,"eachBefore_default");function Me(t,a){for(var n=this,r=[n],l=[],i,c,u,m=-1;n=r.pop();)if(l.push(n),i=n.children)for(c=0,u=i.length;c<u;++c)r.push(i[c]);for(;n=l.pop();)t.call(a,n,++m,this);return this}p(Me,"eachAfter_default");function ze(t,a){let n=-1;for(const r of this)if(t.call(a,r,++n,this))return r}p(ze,"find_default");function Ae(t){return this.eachAfter(function(a){for(var n=+t(a.data)||0,r=a.children,l=r&&r.length;--l>=0;)n+=r[l].value;a.value=n})}p(Ae,"sum_default");function De(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}p(De,"sort_default");function Ve(t){for(var a=this,n=Pe(a,t),r=[a];a!==n;)a=a.parent,r.push(a);for(var l=r.length;t!==n;)r.splice(l,0,t),t=t.parent;return r}p(Ve,"path_default");function Pe(t,a){if(t===a)return t;var n=t.ancestors(),r=a.ancestors(),l=null;for(t=n.pop(),a=r.pop();t===a;)l=t,t=n.pop(),a=r.pop();return l}p(Pe,"leastCommonAncestor");function Be(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}p(Be,"ancestors_default");function Ee(){return Array.from(this)}p(Ee,"descendants_default");function Ie(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}p(Ie,"leaves_default");function Re(){var t=this,a=[];return t.each(function(n){n!==t&&a.push({source:n.parent,target:n})}),a}p(Re,"links_default");function*We(){var t=this,a,n=[t],r,l,i;do for(a=n.reverse(),n=[];t=a.pop();)if(yield t,r=t.children)for(l=0,i=r.length;l<i;++l)n.push(r[l]);while(n.length)}p(We,"iterator_default");function ae(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Oe)):a===void 0&&(a=Ge);for(var n=new Y(t),r,l=[n],i,c,u,m;r=l.pop();)if((c=a(r.data))&&(m=(c=Array.from(c)).length))for(r.children=c,u=m-1;u>=0;--u)l.push(i=c[u]=new Y(c[u])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(je)}p(ae,"hierarchy");function He(){return ae(this).eachBefore(qe)}p(He,"node_copy");function Ge(t){return t.children}p(Ge,"objectChildren");function Oe(t){return Array.isArray(t)?t[1]:null}p(Oe,"mapChildren");function qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}p(qe,"copyData");function je(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}p(je,"computeHeight");function Y(t){this.data=t,this.depth=this.height=0,this.parent=null}p(Y,"Node");Y.prototype=ae.prototype={constructor:Y,count:Ne,each:ke,eachAfter:Me,eachBefore:Fe,find:ze,sum:Ae,sort:De,path:Ve,ancestors:Be,descendants:Ee,leaves:Ie,links:Re,copy:He,[Symbol.iterator]:We};function Ue(t){if(typeof t!="function")throw new Error;return t}p(Ue,"required");function H(){return 0}p(H,"constantZero");function G(t){return function(){return t}}p(G,"constant_default");function Ye(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}p(Ye,"round_default");function Ke(t,a,n,r,l){for(var i=t.children,c,u=-1,m=i.length,o=t.value&&(r-a)/t.value;++u<m;)c=i[u],c.y0=n,c.y1=l,c.x0=a,c.x1=a+=c.value*o}p(Ke,"dice_default");function Xe(t,a,n,r,l){for(var i=t.children,c,u=-1,m=i.length,o=t.value&&(l-n)/t.value;++u<m;)c=i[u],c.x0=a,c.x1=r,c.y0=n,c.y1=n+=c.value*o}p(Xe,"slice_default");var Ze=(1+Math.sqrt(5))/2;function Je(t,a,n,r,l,i){for(var c=[],u=a.children,m,o,d=0,b=0,s=u.length,x,S,v=a.value,f,g,z,k,A,E,N;d<s;){x=l-n,S=i-r;do f=u[b++].value;while(!f&&b<s);for(g=z=f,E=Math.max(S/x,x/S)/(v*t),N=f*f*E,A=Math.max(z/N,N/g);b<s;++b){if(f+=o=u[b].value,o<g&&(g=o),o>z&&(z=o),N=f*f*E,k=Math.max(z/N,N/g),k>A){f-=o;break}A=k}c.push(m={value:f,dice:x<S,children:u.slice(d,b)}),m.dice?Ke(m,n,r,l,v?r+=S*f/v:i):Xe(m,n,r,v?n+=x*f/v:l,i),v-=f,d=b}return c}p(Je,"squarifyRatio");var Qe=p((function t(a){function n(r,l,i,c,u){Je(a,r,l,i,c,u)}return p(n,"squarify"),n.ratio=function(r){return t((r=+r)>1?r:1)},n}),"custom")(Ze);function et(){var t=Qe,a=!1,n=1,r=1,l=[0],i=H,c=H,u=H,m=H,o=H;function d(s){return s.x0=s.y0=0,s.x1=n,s.y1=r,s.eachBefore(b),l=[0],a&&s.eachBefore(Ye),s}p(d,"treemap");function b(s){var x=l[s.depth],S=s.x0+x,v=s.y0+x,f=s.x1-x,g=s.y1-x;f<S&&(S=f=(S+f)/2),g<v&&(v=g=(v+g)/2),s.x0=S,s.y0=v,s.x1=f,s.y1=g,s.children&&(x=l[s.depth+1]=i(s)/2,S+=o(s)-x,v+=c(s)-x,f-=u(s)-x,g-=m(s)-x,f<S&&(S=f=(S+f)/2),g<v&&(v=g=(v+g)/2),t(s,S,v,f,g))}return p(b,"positionNode"),d.round=function(s){return arguments.length?(a=!!s,d):a},d.size=function(s){return arguments.length?(n=+s[0],r=+s[1],d):[n,r]},d.tile=function(s){return arguments.length?(t=Ue(s),d):t},d.padding=function(s){return arguments.length?d.paddingInner(s).paddingOuter(s):d.paddingInner()},d.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:G(+s),d):i},d.paddingOuter=function(s){return arguments.length?d.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):d.paddingTop()},d.paddingTop=function(s){return arguments.length?(c=typeof s=="function"?s:G(+s),d):c},d.paddingRight=function(s){return arguments.length?(u=typeof s=="function"?s:G(+s),d):u},d.paddingBottom=function(s){return arguments.length?(m=typeof s=="function"?s:G(+s),d):m},d.paddingLeft=function(s){return arguments.length?(o=typeof s=="function"?s:G(+s),d):o},d}p(et,"treemap_default");var le=class{static{p(this,"TreeMapDB")}constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=ge,this.getAccTitle=we,this.setDiagramTitle=me,this.getDiagramTitle=be,this.getAccDescription=xe,this.setAccDescription=fe}static{T(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const t=ve,a=te();return ee({...t.treemap,...a.treemap??{}})}addNode(t,a){this.nodes.push(t),this.levels.set(t,a),a===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},r=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(l=>{$e(l)&&(n?.textStyles?n.textStyles.push(l):n.textStyles=[l]),n?.styles?n.styles.push(l):n.styles=[l]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){ye(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function se(t){if(!t.length)return[];const a=[],n=[];return t.forEach(r=>{const l={name:r.name,children:r.type==="Leaf"?void 0:[]};for(l.classSelector=r?.classSelector,r?.cssCompiledStyles&&(l.cssCompiledStyles=r.cssCompiledStyles),r.type==="Leaf"&&r.value!==void 0&&(l.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();if(n.length===0)a.push(l);else{const i=n[n.length-1].node;i.children?i.children.push(l):i.children=[l]}r.type!=="Leaf"&&n.push({node:l,level:r.level})}),a}p(se,"buildHierarchy");T(se,"buildHierarchy");var tt=T((t,a)=>{Ce(t,a);const n=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const c=i.item;if(!c)continue;const u=i.indent?parseInt(i.indent):0,m=at(c),o=c.classSelector?a.getStylesForClass(c.classSelector):[],d=o.length>0?o:void 0,b={level:u,name:m,type:c.$type,value:c.value,classSelector:c.classSelector,cssCompiledStyles:d};n.push(b)}const r=se(n),l=T((i,c)=>{for(const u of i)a.addNode(u,c),u.children&&u.children.length>0&&l(u.children,c+1)},"addNodesRecursively");l(r,0)},"populate"),at=T(t=>t.name?String(t.name):"","getItemName"),ie={parser:{yy:void 0},parse:T(async t=>{try{const a=await pe("treemap",t);Q.debug("Treemap AST:",a);const n=ie.parser?.yy;if(!(n instanceof le))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");tt(a,n)}catch(a){throw Q.error("Error parsing treemap:",a),a}},"parse")},nt=10,B=10,O=25,rt={draw:T((t,a,n,r)=>{const l=r.db,i=l.getConfig(),c=i.padding??nt,u=l.getDiagramTitle(),m=l.getRoot(),{themeVariables:o}=te();if(!m)return;const d=u?30:0,b=Le(a),s=i.nodeWidth?i.nodeWidth*B:960,x=i.nodeHeight?i.nodeHeight*B:500,S=s,v=x+d;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,i.useMaxWidth);let f;try{const e=i.valueFormat||",";if(e==="$0,0")f=T(h=>"$"+W(",")(h),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const h=/\.\d+/.exec(e),C=h?h[0]:"";f=T(_=>"$"+W(","+C)(_),"valueFormat")}else if(e.startsWith("$")){const h=e.substring(1);f=T(C=>"$"+W(h||"")(C),"valueFormat")}else f=W(e)}catch(e){Q.error("Error creating format function:",e),f=W(",")}const g=J().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),z=J().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),k=J().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);u&&b.append("text").attr("x",S/2).attr("y",d/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const A=b.append("g").attr("transform",`translate(0, ${d})`).attr("class","treemapContainer"),E=ae(m).sum(e=>e.value??0).sort((e,h)=>(h.value??0)-(e.value??0)),N=et().size([s,x]).paddingTop(e=>e.children&&e.children.length>0?O+B:0).paddingInner(c).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),oe=N.descendants().filter(e=>e.children&&e.children.length>0),I=A.selectAll(".treemapSection").data(oe).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);I.append("rect").attr("width",e=>e.x1-e.x0).attr("height",O).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),I.append("clipPath").attr("id",(e,h)=>`clip-section-${a}-${h}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",O),I.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,h)=>`treemapSection section${h}`).attr("fill",e=>g(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>z(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const h=P({cssCompiledStyles:e.data.cssCompiledStyles});return h.nodeStyles+";"+h.borderStyles.join(";")}),I.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",O/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,h)=>`url(#clip-section-${a}-${h})`).attr("style",e=>e.depth===0?"display: none;":"dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).each(function(e){if(e.depth===0)return;const h=U(this),C=e.data.name;h.text(C);const _=e.x1-e.x0,M=6;let L;i.showValues!==!1&&e.value?L=_-10-30-10-M:L=_-M-6;const $=Math.max(15,L),y=h.node();if(y.getComputedTextLength()>$){let w=C;for(;w.length>0;){if(w=C.substring(0,w.length-1),w.length===0){h.text("..."),y.getComputedTextLength()>$&&h.text("");break}if(h.text(w+"..."),y.getComputedTextLength()<=$)break}}}),i.showValues!==!1&&I.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",O/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>e.depth===0?"display: none;":"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"));const ne=N.leaves(),F=ne.length>20,ce=F?16:38,q=F?14:28,D=F?4:8,V=F?4:6,K=F?2:4,re=F?8:10,X=F?1:2,j=A.selectAll(".treemapLeafGroup").data(ne).enter().append("g").attr("class",(e,h)=>`treemapNode treemapLeafGroup leaf${h}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,h)=>`clip-${a}-${h}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${ce}px;fill:`+k(e.data.name)+";"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,h)=>`url(#clip-${a}-${h})`).text(e=>e.data.name).each(function(e){const h=U(this),C=e.x1-e.x0,_=e.y1-e.y0,M=h.node(),L=C-2*K,$=_-2*K;if(L<re||$<re){h.style("display","none");return}let y=parseInt(h.style("font-size"),10);const R=.6;for(;M.getComputedTextLength()>L&&y>D;)y--,h.style("font-size",`${y}px`);let w=Math.max(V,Math.min(q,Math.round(y*R))),Z=y+X+w;for(;Z>$&&y>D&&(y--,w=Math.max(V,Math.min(q,Math.round(y*R))),!(w<V&&y===D));)h.style("font-size",`${y}px`),Z=y+X+w,w<=V&&Z>$;h.style("font-size",`${y}px`),F?(y<D||$<D)&&h.style("display","none"):(M.getComputedTextLength()>L||y<D||$<y)&&h.style("display","none")}),i.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${q}px;fill:`+k(e.data.name)+";"+P({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,h)=>`url(#clip-${a}-${h})`).text(e=>e.value?f(e.value):"").each(function(e){const h=U(this),C=this.parentNode;if(!C){h.style("display","none");return}const _=U(C).select(".treemapLabel");if(_.empty()||_.style("display")==="none"){h.style("display","none");return}const M=parseFloat(_.style("font-size")),L=Math.max(V,Math.min(q,Math.round(M*.6)));h.style("font-size",`${L}px`);const $=(e.y1-e.y0)/2+M/2+X;h.attr("y",$);const y=e.x1-e.x0,R=e.y1-e.y0-4,w=y-2*K;h.node().getComputedTextLength()>w||$+L>R||L<V?h.style("display","none"):h.style("display",null)});const he=i.diagramPadding??8;Te(b,he,"flowchart",i?.useMaxWidth||!1)},"draw"),getClasses:T(function(t,a){return a.db.getClasses()},"getClasses")},lt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},St={parser:ie,get db(){return new le},renderer:rt,styles:T(({treemap:t}={})=>{const a=de(),n=te(),r=ee(a,n.themeVariables),l=ee(lt,t),i=l.titleColor??r.titleColor,c=l.labelColor??r.textColor,u=l.valueColor??r.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${l.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${l.sectionStrokeWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var B=Object.defineProperty;var b=(t,e)=>B(t,"name",{value:e,configurable:!0});import{n as C}from"./mermaid-parser.core-CHJSk6z0.js";import{n as m}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as u}from"./src-Bssc388C.js";import{H as S,K as D,U as T,a as P,b as z,c as E,f as F,v as A,w as W,y as _}from"./chunk-DU6HZSFF-
|
|
1
|
+
var B=Object.defineProperty;var b=(t,e)=>B(t,"name",{value:e,configurable:!0});import{n as C}from"./mermaid-parser.core-CHJSk6z0.js";import{n as m}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as u}from"./src-Bssc388C.js";import{H as S,K as D,U as T,a as P,b as z,c as E,f as F,v as A,w as W,y as _}from"./chunk-DU6HZSFF-mLZ_DAj9.js";import{i as w}from"./chunk-75Z2AOVW-CTyOxDW3.js";import{t as N}from"./chunk-JWPE2WC7--HEGjv3t.js";import{f as L}from"./mermaid.core-Be3XJK9z.js";var M=F.packet,v=class{static{b(this,"PacketDB")}constructor(){this.packet=[],this.setAccTitle=T,this.getAccTitle=_,this.setDiagramTitle=D,this.getDiagramTitle=W,this.getAccDescription=A,this.setAccDescription=S}static{m(this,"PacketDB")}getConfig(){const t=w({...M,...z().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){P(),this.packet=[]}},Y=1e4,H=m((t,e)=>{N(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,u.debug(`Packet block ${a} - ${r} with label ${c}`);o.length<=l+1&&e.getPacket().length<Y;){const[p,s]=I({start:a,end:i,bits:d,label:c},n,l);if(o.push(p),p.end+1===n*l&&(e.pushWord(o),o=[],n++),!s)break;({start:a,end:i,bits:d,label:c}=s)}}e.pushWord(o)},"populate"),I=m((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:m(async t=>{const e=await C("packet",t),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");u.debug(e),H(e,r)},"parse")},K=m((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),f=d*c+2,k=L(e);k.attr("viewBox",`0 0 ${f} ${g}`),E(k,g,f,l.useMaxWidth);for(const[y,$]of p.entries())O(k,$,y,l);k.append("text").text(s).attr("x",f/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=m((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const f=s.end===s.start,k=p-2;c.append("text").attr("x",h+(f?g/2:0)).attr("y",k).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||c.append("text").attr("x",h+g).attr("y",k).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),U={draw:K},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},tt={parser:x,get db(){return new v},renderer:U,styles:m(({packet:t}={})=>{const e=w(j,t);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${e.byteFontSize};
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ue=Object.defineProperty;var p=(l,e)=>Ue(l,"name",{value:e,configurable:!0});import{i as we}from"./rolldown-runtime-ZpX3ckPj.js";import{$r as We,Qr as Ke,Zr as Ge,a as Te,c as qe,f as $e,i as ze,l as O,m as U,n as Ce,o as X,r as Ie,s as E}from"./createLucideIcon-B54j0Sae.js";import{a as Ye,i as Xe}from"./dist-C0aY0Z9q.js";import{$ as Ze,G as Qe,K as Je,Q as et,U as tt,X as ot,Y as nt,et as rt,q as Oe,tt as ct}from"./zap-md9c-4bv.js";var Ne=we(Ke(),1),o=we(We(),1),d=we(Ge(),1),st=Object.defineProperty,lt=p((l,e)=>st(l,"name",{value:e,configurable:!0}),"__name$3"),De=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),at=o.forwardRef(lt(p(function(e,s){return(0,d.jsx)(O.span,{...e,ref:s,style:{...De,...e.style}})},"VisuallyHidden2"),"VisuallyHidden")),Ft=at,it=Object.defineProperty,dt=p((l,e)=>it(l,"name",{value:e,configurable:!0}),"__name$2");function Le(l){const e=o.useRef({value:l,previous:l});return o.useMemo(()=>(e.current.value!==l&&(e.current.previous=e.current.value,e.current.value=l),e.current.previous),[l])}p(Le,"usePrevious");dt(Le,"usePrevious");var ut=Object.defineProperty,pt=p((l,e)=>ut(l,"name",{value:e,configurable:!0}),"__name$1");function ge(l,[e,s]){return Math.min(s,Math.max(e,l))}p(ge,"clamp");pt(ge,"clamp");var ft=Object.defineProperty,v=p((l,e)=>ft(l,"name",{value:e,configurable:!0}),"__name"),ht=[" ","Enter","ArrowUp","ArrowDown"],mt=[" ","Enter"],se="Select",[fe,he,St]=Ye(se),[te,Ut]=qe(se,[St,Oe]),Pe=Oe(),[vt,Z]=te(se),[gt,xt]=te(se);function Ve(l){const{__scopeSelect:e,children:s,open:t,defaultOpen:u,onOpenChange:r,value:f,defaultValue:n,onValueChange:c,dir:a,name:x,autoComplete:I,disabled:P,required:_,form:y,internal_do_not_use_render:b}=l,i=Pe(e),[g,C]=o.useState(null),[m,h]=o.useState(null),[N,D]=o.useState(!1),le=Xe(a),[V,B]=Te({prop:t,defaultProp:u??!1,onChange:r,caller:se}),[Q,q]=Te({prop:f,defaultProp:n,onChange:c,caller:se}),W=o.useRef(null),K=o.useRef(Q);o.useEffect(()=>{const M=y?g?.ownerDocument.getElementById(y):g?.form;if(M instanceof HTMLFormElement){const F=v(()=>q(K.current),"reset");return M.addEventListener("reset",F),()=>M.removeEventListener("reset",F)}},[y,g,q]);const J=g?!!y||!!g.closest("form"):!0,[G,k]=o.useState(new Set),$=Ie(),z=Array.from(G).map(M=>M.props.value).join(";"),Y=o.useCallback(M=>{k(F=>new Set(F).add(M))},[]),H=o.useCallback(M=>{k(F=>{const re=new Set(F);return re.delete(M),re})},[]),ne={required:_,trigger:g,onTriggerChange:C,valueNode:m,onValueNodeChange:h,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:$,value:Q,onValueChange:q,open:V,onOpenChange:B,dir:le,triggerPointerDownPosRef:W,disabled:P,name:x,autoComplete:I,form:y,nativeOptions:G,nativeSelectKey:z,isFormControl:J};return(0,d.jsx)(Je,{...i,children:(0,d.jsx)(vt,{scope:e,...ne,children:(0,d.jsx)(fe.Provider,{scope:e,children:(0,d.jsx)(gt,{scope:e,onNativeOptionAdd:Y,onNativeOptionRemove:H,children:He(b)?b(ne):s})})})})}p(Ve,"SelectProvider");v(Ve,"SelectProvider");var Wt=v(l=>{const{__scopeSelect:e,children:s,...t}=l;return(0,d.jsx)(Ve,{__scopeSelect:e,...t,internal_do_not_use_render:p(({isFormControl:u})=>(0,d.jsxs)(d.Fragment,{children:[s,u?(0,d.jsx)(Lt,{__scopeSelect:e}):null]}),"internal_do_not_use_render")})},"Select"),wt="SelectTrigger",Kt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,disabled:u=!1,...r}=e,f=Pe(t),n=Z(wt,t),c=n.disabled||u,a=U(s,n.onTriggerChange),x=he(t),I=o.useRef("touch"),[P,_,y]=_e(i=>{const g=x().filter(m=>!m.disabled),C=be(g,i,g.find(m=>m.value===n.value));C!==void 0&&n.onValueChange(C.value)}),b=v(i=>{c||(n.onOpenChange(!0),y()),i&&(n.triggerPointerDownPosRef.current={x:Math.round(i.pageX),y:Math.round(i.pageY)})},"handleOpen");return(0,d.jsx)(tt,{asChild:!0,...f,children:(0,d.jsx)(O.button,{type:"button",role:"combobox","aria-controls":n.open?n.contentId:void 0,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":de(n.value)?"":void 0,...r,ref:a,onClick:E(r.onClick,i=>{i.currentTarget.focus(),I.current!=="mouse"&&b(i)}),onPointerDown:E(r.onPointerDown,i=>{I.current=i.pointerType;const g=i.target;g.hasPointerCapture(i.pointerId)&&g.releasePointerCapture(i.pointerId),i.button===0&&i.ctrlKey===!1&&i.pointerType==="mouse"&&(b(i),i.preventDefault())}),onKeyDown:E(r.onKeyDown,i=>{const g=P.current!=="";!(i.ctrlKey||i.altKey||i.metaKey)&&i.key.length===1&&_(i.key),!(g&&i.key===" ")&&ht.includes(i.key)&&(b(),i.preventDefault())})})})},"SelectTrigger2"),"SelectTrigger")),Ct="SelectValue",Gt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,className:u,style:r,children:f,placeholder:n="",...c}=e,a=Z(Ct,t),{onValueNodeHasChildrenChange:x}=a,I=f!==void 0,P=U(s,a.onValueNodeChange);X(()=>{x(I)},[x,I]);const _=de(a.value);return(0,d.jsx)(O.span,{...c,asChild:_?!1:c.asChild,ref:P,style:{pointerEvents:"none"},children:(0,d.jsx)(o.Fragment,{children:_?n:f},_?"placeholder":"value")})},"SelectValue2"),"SelectValue")),qt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,children:u,...r}=e;return(0,d.jsx)(O.span,{"aria-hidden":!0,...r,ref:s,children:u||"▼"})},"SelectIcon2"),"SelectIcon")),[It,Pt]=te("SelectPortal",{forceMount:void 0}),$t=v(l=>{const{__scopeSelect:e,forceMount:s,...t}=l;return(0,d.jsx)(It,{scope:l.__scopeSelect,forceMount:s,children:(0,d.jsx)(Ze,{asChild:!0,...t})})},"SelectPortal"),ee="SelectContent",zt=o.forwardRef(v(p(function(e,s){const t=Pt(ee,e.__scopeSelect),{forceMount:u=t.forceMount,...r}=e,f=Z(ee,e.__scopeSelect),[n,c]=o.useState();return X(()=>{c(new DocumentFragment)},[]),(0,d.jsx)(ze,{present:u||f.open,children:p(({present:a})=>a?(0,d.jsx)(bt,{...r,ref:s}):(0,d.jsx)(yt,{...r,fragment:n}),"children")})},"SelectContent2"),"SelectContent")),yt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,children:u,fragment:r}=e;return r?Ne.createPortal((0,d.jsx)(Ae,{scope:t,children:(0,d.jsx)(fe.Slot,{scope:t,children:(0,d.jsx)("div",{ref:s,children:u})})}),r):null},"SelectContentFragment2"),"SelectContentFragment")),A=10,[Ae,oe]=te(ee),_t=$e("SelectContent.RemoveScroll"),bt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t}=e,{position:u="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:f,onPointerDownOutside:n,side:c,sideOffset:a,align:x,alignOffset:I,arrowPadding:P,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:i,avoidCollisions:g,...C}=e,m=Z(ee,t),[h,N]=o.useState(null),[D,le]=o.useState(null),V=U(s,N),[B,Q]=o.useState(null),[q,W]=o.useState(null),K=he(t),[J,G]=o.useState(!1),k=o.useRef(!1);o.useEffect(()=>{if(h)return nt(h)},[h]),et();const $=o.useCallback(S=>{const[R,...T]=K().map(L=>L.ref.current),[w]=T.slice(-1),j=document.activeElement;for(const L of S)if(L===j||(L?.scrollIntoView({block:"nearest"}),L===R&&D&&(D.scrollTop=0),L===w&&D&&(D.scrollTop=D.scrollHeight),L?.focus(),document.activeElement!==j))return},[K,D]),z=o.useCallback(()=>$([B,h]),[$,B,h]);o.useEffect(()=>{J&&z()},[J,z]);const{onOpenChange:Y,triggerPointerDownPosRef:H}=m;o.useEffect(()=>{if(h){let S={x:0,y:0};const R=v(w=>{S={x:Math.abs(Math.round(w.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(w.pageY)-(H.current?.y??0))}},"handlePointerMove"),T=v(w=>{S.x<=10&&S.y<=10?w.preventDefault():w.composedPath().includes(h)||Y(!1),document.removeEventListener("pointermove",R),H.current=null},"handlePointerUp");return H.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",T,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",T,{capture:!0})}}},[h,Y,H]),o.useEffect(()=>{const S=v(()=>Y(!1),"close");return window.addEventListener("blur",S),window.addEventListener("resize",S),()=>{window.removeEventListener("blur",S),window.removeEventListener("resize",S)}},[Y]);const[ne,M]=_e(S=>{const R=K().filter(w=>!w.disabled),T=be(R,S,R.find(w=>w.ref.current===document.activeElement));T&&setTimeout(()=>T.ref.current?.focus())}),F=o.useCallback((S,R,T)=>{const w=!k.current&&!T;(m.value!==void 0&&m.value===R||w)&&(Q(S),w&&(k.current=!0))},[m.value]),re=o.useCallback(()=>h?.focus(),[h]),ce=o.useCallback((S,R,T)=>{const w=!k.current&&!T;(m.value!==void 0&&m.value===R||w)&&W(S)},[m.value]),ue=u==="popper"?Re:Tt,ae=ue===Re?{side:c,sideOffset:a,align:x,alignOffset:I,arrowPadding:P,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:i,avoidCollisions:g}:{};return(0,d.jsx)(Ae,{scope:t,content:h,viewport:D,onViewportChange:le,itemRefCallback:F,selectedItem:B,onItemLeave:re,itemTextRefCallback:ce,focusSelectedItem:z,selectedItemText:q,position:u,isPositioned:J,searchRef:ne,children:(0,d.jsx)(ot,{as:_t,allowPinchZoom:!0,children:(0,d.jsx)(rt,{asChild:!0,trapped:m.open,onMountAutoFocus:p(S=>{S.preventDefault()},"onMountAutoFocus"),onUnmountAutoFocus:E(r,S=>{m.trigger?.focus({preventScroll:!0}),S.preventDefault()}),children:(0,d.jsx)(ct,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:n,onFocusOutside:p(S=>S.preventDefault(),"onFocusOutside"),onDismiss:p(()=>m.onOpenChange(!1),"onDismiss"),children:(0,d.jsx)(ue,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p(S=>S.preventDefault(),"onContextMenu"),...C,...ae,onPlaced:p(()=>G(!0),"onPlaced"),ref:V,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:E(C.onKeyDown,S=>{const R=S.ctrlKey||S.altKey||S.metaKey;if(S.key==="Tab"&&S.preventDefault(),!R&&S.key.length===1&&M(S.key),["ArrowUp","ArrowDown","Home","End"].includes(S.key)){let T=K().filter(w=>!w.disabled).map(w=>w.ref.current);if(["ArrowUp","End"].includes(S.key)&&(T=T.slice().reverse()),["ArrowUp","ArrowDown"].includes(S.key)){const w=S.target,j=T.indexOf(w);T=T.slice(j+1)}setTimeout(()=>$(T)),S.preventDefault()}})})})})})})},"SelectContentImpl2"),"SelectContentImpl")),Tt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,onPlaced:u,...r}=e,f=Z(ee,t),n=oe(ee,t),[c,a]=o.useState(null),[x,I]=o.useState(null),P=U(s,I),_=he(t),y=o.useRef(!1),b=o.useRef(!0),{viewport:i,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=n,h=o.useCallback(()=>{if(f.trigger&&f.valueNode&&c&&x&&i&&g&&C){const V=f.trigger.getBoundingClientRect(),B=x.getBoundingClientRect(),Q=f.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(f.dir!=="rtl"){const w=q.left-B.left,j=Q.left-w,L=V.left-j,ie=V.width+L,me=Math.max(ie,B.width),Se=window.innerWidth-A,ve=ge(j,[A,Math.max(A,Se-me)]);c.style.minWidth=ie+"px",c.style.left=ve+"px"}else{const w=B.right-q.right,j=window.innerWidth-Q.right-w,L=window.innerWidth-V.right-j,ie=V.width+L,me=Math.max(ie,B.width),Se=window.innerWidth-A,ve=ge(j,[A,Math.max(A,Se-me)]);c.style.minWidth=ie+"px",c.style.right=ve+"px"}const W=_(),K=window.innerHeight-A*2,J=i.scrollHeight,G=window.getComputedStyle(x),k=parseInt(G.borderTopWidth,10),$=parseInt(G.paddingTop,10),z=parseInt(G.borderBottomWidth,10),Y=parseInt(G.paddingBottom,10),H=k+$+J+Y+z,ne=Math.min(g.offsetHeight*5,H),M=window.getComputedStyle(i),F=parseInt(M.paddingTop,10),re=parseInt(M.paddingBottom,10),ce=V.top+V.height/2-A,ue=K-ce,ae=g.offsetHeight/2,S=g.offsetTop+ae,R=k+$+S,T=H-R;if(R<=ce){const w=W.length>0&&g===W[W.length-1].ref.current;c.style.bottom="0px";const j=x.clientHeight-i.offsetTop-i.offsetHeight,L=R+Math.max(ue,ae+(w?re:0)+j+z);c.style.height=L+"px"}else{const w=W.length>0&&g===W[0].ref.current;c.style.top="0px";const j=Math.max(ce,k+i.offsetTop+(w?F:0)+ae)+T;c.style.height=j+"px",i.scrollTop=R-ce+i.offsetTop}c.style.margin=`${A}px 0`,c.style.minHeight=ne+"px",c.style.maxHeight=K+"px",u?.(),requestAnimationFrame(()=>y.current=!0)}},[_,f.trigger,f.valueNode,c,x,i,g,C,f.dir,u]);X(()=>h(),[h]);const[N,D]=o.useState();X(()=>{x&&D(window.getComputedStyle(x).zIndex)},[x]);const le=o.useCallback(V=>{V&&b.current===!0&&(h(),m?.(),b.current=!1)},[h,m]);return(0,d.jsx)(Rt,{scope:t,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:le,children:(0,d.jsx)("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:(0,d.jsx)(O.div,{...r,ref:P,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})},"SelectItemAlignedPosition2"),"SelectItemAlignedPosition")),Re=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,align:u="start",collisionPadding:r=A,...f}=e,n=Pe(t);return(0,d.jsx)(Qe,{...n,...f,ref:s,align:u,collisionPadding:r,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition2"),"SelectPopperPosition")),[Rt,ye]=te(ee,{}),Ee="SelectViewport",Yt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,nonce:u,...r}=e,f=oe(Ee,t),n=ye(Ee,t),c=U(s,f.onViewportChange),a=o.useRef(0);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),(0,d.jsx)(fe.Slot,{scope:t,children:(0,d.jsx)(O.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,x=>{const I=x.currentTarget,{contentWrapper:P,shouldExpandOnScrollRef:_}=n;if(_?.current&&P){const y=Math.abs(a.current-I.scrollTop);if(y>0){const b=window.innerHeight-A*2,i=parseFloat(P.style.minHeight),g=parseFloat(P.style.height),C=Math.max(i,g);if(C<b){const m=C+y,h=Math.min(b,m),N=m-h;P.style.height=h+"px",P.style.bottom==="0px"&&(I.scrollTop=N>0?N:0,P.style.justifyContent="flex-end")}}}a.current=I.scrollTop})})})]})},"SelectViewport2"),"SelectViewport")),[Et,Mt]=te("SelectGroup"),Xt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e,r=Ie();return(0,d.jsx)(Et,{scope:t,id:r,children:(0,d.jsx)(O.div,{role:"group","aria-labelledby":r,...u,ref:s})})},"SelectGroup2"),"SelectGroup")),jt="SelectLabel",Zt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e,r=Mt(jt,t);return(0,d.jsx)(O.div,{id:r.id,...u,ref:s})},"SelectLabel2"),"SelectLabel")),xe="SelectItem",[Ot,Be]=te(xe),Qt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,value:u,disabled:r=!1,textValue:f,...n}=e,c=Z(xe,t),a=oe(xe,t),x=c.value===u,[I,P]=o.useState(f??""),[_,y]=o.useState(!1),b=Ce(h=>a.itemRefCallback?.(h,u,r)),i=U(s,b),g=Ie(),C=o.useRef("touch"),m=v(()=>{r||(c.onValueChange(u),c.onOpenChange(!1))},"handleSelect");return(0,d.jsx)(Ot,{scope:t,value:u,disabled:r,textId:g,isSelected:x,onItemTextChange:o.useCallback(h=>{P(N=>N||(h?.textContent??"").trim())},[]),children:(0,d.jsx)(fe.ItemSlot,{scope:t,value:u,disabled:r,textValue:I,children:(0,d.jsx)(O.div,{role:"option","aria-labelledby":g,"data-highlighted":_?"":void 0,"aria-selected":x&&_,"data-state":x?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:i,onFocus:E(n.onFocus,()=>y(!0)),onBlur:E(n.onBlur,()=>y(!1)),onClick:E(n.onClick,()=>{C.current!=="mouse"&&m()}),onPointerUp:E(n.onPointerUp,()=>{C.current==="mouse"&&m()}),onPointerDown:E(n.onPointerDown,h=>{C.current=h.pointerType}),onPointerMove:E(n.onPointerMove,h=>{C.current=h.pointerType,r?a.onItemLeave?.():C.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(n.onPointerLeave,h=>{h.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:E(n.onKeyDown,h=>{r||h.target!==h.currentTarget||a.searchRef?.current!==""&&h.key===" "||(mt.includes(h.key)&&m(),h.key===" "&&h.preventDefault())})})})})},"SelectItem2"),"SelectItem")),pe="SelectItemText",Jt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,className:u,style:r,...f}=e,n=Z(pe,t),c=oe(pe,t),a=Be(pe,t),x=xt(pe,t),[I,P]=o.useState(null),_=Ce(m=>c.itemTextRefCallback?.(m,a.value,a.disabled)),y=U(s,P,a.onItemTextChange,_),b=I?.textContent,i=o.useMemo(()=>(0,d.jsx)("option",{value:a.value,disabled:a.disabled,children:b},a.value),[a.disabled,a.value,b]),{onNativeOptionAdd:g,onNativeOptionRemove:C}=x;return X(()=>(g(i),()=>C(i)),[g,C,i]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(O.span,{id:a.textId,...f,ref:y}),a.isSelected&&n.valueNode&&!n.valueNodeHasChildren&&!de(n.value)?Ne.createPortal(f.children,n.valueNode):null]})},"SelectItemText2"),"SelectItemText")),Nt="SelectItemIndicator",eo=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e;return Be(Nt,t).isSelected?(0,d.jsx)(O.span,{"aria-hidden":!0,...u,ref:s}):null},"SelectItemIndicator2"),"SelectItemIndicator")),Me="SelectScrollUpButton",to=o.forwardRef(v(p(function(e,s){const t=oe(Me,e.__scopeSelect),u=ye(Me,e.__scopeSelect),[r,f]=o.useState(!1),n=U(s,u.onScrollButtonChange);return X(()=>{if(t.viewport&&t.isPositioned){let c=p(function(){const x=a.scrollTop>0;f(x)},"handleScroll2");v(c,"handleScroll");const a=t.viewport;return c(),a.addEventListener("scroll",c),()=>a.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?(0,d.jsx)(ke,{...e,ref:n,onAutoScroll:p(()=>{const{viewport:c,selectedItem:a}=t;c&&a&&(c.scrollTop=c.scrollTop-a.offsetHeight)},"onAutoScroll")}):null},"SelectScrollUpButton2"),"SelectScrollUpButton")),je="SelectScrollDownButton",oo=o.forwardRef(v(p(function(e,s){const t=oe(je,e.__scopeSelect),u=ye(je,e.__scopeSelect),[r,f]=o.useState(!1),n=U(s,u.onScrollButtonChange);return X(()=>{if(t.viewport&&t.isPositioned){let c=p(function(){const x=a.scrollHeight-a.clientHeight,I=Math.ceil(a.scrollTop)<x;f(I)},"handleScroll2");v(c,"handleScroll");const a=t.viewport;return c(),a.addEventListener("scroll",c),()=>a.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?(0,d.jsx)(ke,{...e,ref:n,onAutoScroll:p(()=>{const{viewport:c,selectedItem:a}=t;c&&a&&(c.scrollTop=c.scrollTop+a.offsetHeight)},"onAutoScroll")}):null},"SelectScrollDownButton2"),"SelectScrollDownButton")),ke=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,onAutoScroll:u,...r}=e,f=oe("SelectScrollButton",t),n=o.useRef(null),c=he(t),a=o.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return o.useEffect(()=>()=>a(),[a]),X(()=>{c().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,d.jsx)(O.div,{"aria-hidden":!0,...r,ref:s,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(u,50))}),onPointerMove:E(r.onPointerMove,()=>{f.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(u,50))}),onPointerLeave:E(r.onPointerLeave,()=>{a()})})},"SelectScrollButtonImpl2"),"SelectScrollButtonImpl")),no=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e;return(0,d.jsx)(O.div,{"aria-hidden":!0,...u,ref:s})},"SelectSeparator2"),"SelectSeparator")),Dt="SelectBubbleInput",Lt=o.forwardRef(v(p(function({__scopeSelect:e,...s},t){const u=Z(Dt,e),{value:r,onValueChange:f,required:n,disabled:c,name:a,autoComplete:x,form:I}=u,{nativeOptions:P,nativeSelectKey:_}=u,y=o.useRef(null),b=U(t,y),i=r??"",g=Le(i),C=Array.from(P).some(m=>(m.props.value??"")==="");return o.useEffect(()=>{const m=y.current;if(!m)return;const h=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(h,"value").set;if(g!==i&&N){const D=new Event("change",{bubbles:!0});N.call(m,i),m.dispatchEvent(D)}},[g,i]),(0,d.jsxs)(O.select,{"aria-hidden":!0,required:n,tabIndex:-1,name:a,autoComplete:x,disabled:c,form:I,onChange:p(m=>f(m.target.value),"onChange"),...s,style:{...De,...s.style},ref:b,defaultValue:i,children:[de(r)&&!C?(0,d.jsx)("option",{value:""}):null,Array.from(P)]},_)},"SelectBubbleInput2"),"SelectBubbleInput"));function He(l){return typeof l=="function"}p(He,"isFunction");v(He,"isFunction");function de(l){return l===""||l===void 0}p(de,"shouldShowPlaceholder");v(de,"shouldShowPlaceholder");function _e(l){const e=Ce(l),s=o.useRef(""),t=o.useRef(0),u=o.useCallback(f=>{const n=s.current+f;e(n),v(p((function c(a){s.current=a,window.clearTimeout(t.current),a!==""&&(t.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch"),"updateSearch")(n)},[e]),r=o.useCallback(()=>{s.current="",window.clearTimeout(t.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(t.current),[]),[s,u,r]}p(_e,"useTypeaheadSearch");v(_e,"useTypeaheadSearch");function be(l,e,s){const t=e.length>1&&Array.from(e).every(n=>n===e[0])?e[0]:e,u=s?l.indexOf(s):-1;let r=Fe(l,Math.max(u,0));t.length===1&&(r=r.filter(n=>n!==s));const f=r.find(n=>n.textValue.toLowerCase().startsWith(t.toLowerCase()));return f!==s?f:void 0}p(be,"findNextItem");v(be,"findNextItem");function Fe(l,e){return l.map((s,t)=>l[(e+t)%l.length])}p(Fe,"wrapArray");v(Fe,"wrapArray");export{Ft as _,Qt as a,Zt as c,to as d,no as f,ge as g,Yt as h,qt as i,$t as l,Gt as m,zt as n,eo as o,Kt as p,Xt as r,Jt as s,Wt as t,oo as u};
|
|
1
|
+
var Ue=Object.defineProperty;var p=(l,e)=>Ue(l,"name",{value:e,configurable:!0});import{i as we}from"./rolldown-runtime-ZpX3ckPj.js";import{Di as We,Oi as Ke,a as Te,c as Ge,f as qe,i as ze,ki as Ye,l as O,m as U,n as Ce,o as X,r as Ie,s as E}from"./agent-avatar-url-270oGkoO.js";import{a as $e,i as Xe}from"./dist-DvMfIbJ9.js";import{S as Ze,_ as Je,b as Qe,f as et,g as tt,m as Oe,p as ot,u as nt,x as rt,y as ct}from"./boxes-xBZV8xLw.js";var Ne=we(Ke(),1),o=we(Ye(),1),d=we(We(),1),st=Object.defineProperty,lt=p((l,e)=>st(l,"name",{value:e,configurable:!0}),"__name$3"),De=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),at=o.forwardRef(lt(p(function(e,s){return(0,d.jsx)(O.span,{...e,ref:s,style:{...De,...e.style}})},"VisuallyHidden2"),"VisuallyHidden")),Ft=at,it=Object.defineProperty,dt=p((l,e)=>it(l,"name",{value:e,configurable:!0}),"__name$2");function Le(l){const e=o.useRef({value:l,previous:l});return o.useMemo(()=>(e.current.value!==l&&(e.current.previous=e.current.value,e.current.value=l),e.current.previous),[l])}p(Le,"usePrevious");dt(Le,"usePrevious");var ut=Object.defineProperty,pt=p((l,e)=>ut(l,"name",{value:e,configurable:!0}),"__name$1");function ge(l,[e,s]){return Math.min(s,Math.max(e,l))}p(ge,"clamp");pt(ge,"clamp");var ft=Object.defineProperty,v=p((l,e)=>ft(l,"name",{value:e,configurable:!0}),"__name"),ht=[" ","Enter","ArrowUp","ArrowDown"],mt=[" ","Enter"],se="Select",[fe,he,St]=$e(se),[te,Ut]=Ge(se,[St,Oe]),Pe=Oe(),[vt,Z]=te(se),[gt,xt]=te(se);function Ve(l){const{__scopeSelect:e,children:s,open:t,defaultOpen:u,onOpenChange:r,value:f,defaultValue:n,onValueChange:c,dir:a,name:x,autoComplete:I,disabled:P,required:_,form:y,internal_do_not_use_render:b}=l,i=Pe(e),[g,C]=o.useState(null),[m,h]=o.useState(null),[N,D]=o.useState(!1),le=Xe(a),[V,A]=Te({prop:t,defaultProp:u??!1,onChange:r,caller:se}),[J,q]=Te({prop:f,defaultProp:n,onChange:c,caller:se}),W=o.useRef(null),K=o.useRef(J);o.useEffect(()=>{const M=y?g?.ownerDocument.getElementById(y):g?.form;if(M instanceof HTMLFormElement){const F=v(()=>q(K.current),"reset");return M.addEventListener("reset",F),()=>M.removeEventListener("reset",F)}},[y,g,q]);const Q=g?!!y||!!g.closest("form"):!0,[G,B]=o.useState(new Set),z=Ie(),Y=Array.from(G).map(M=>M.props.value).join(";"),$=o.useCallback(M=>{B(F=>new Set(F).add(M))},[]),H=o.useCallback(M=>{B(F=>{const re=new Set(F);return re.delete(M),re})},[]),ne={required:_,trigger:g,onTriggerChange:C,valueNode:m,onValueNodeChange:h,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:z,value:J,onValueChange:q,open:V,onOpenChange:A,dir:le,triggerPointerDownPosRef:W,disabled:P,name:x,autoComplete:I,form:y,nativeOptions:G,nativeSelectKey:Y,isFormControl:Q};return(0,d.jsx)(ot,{...i,children:(0,d.jsx)(vt,{scope:e,...ne,children:(0,d.jsx)(fe.Provider,{scope:e,children:(0,d.jsx)(gt,{scope:e,onNativeOptionAdd:$,onNativeOptionRemove:H,children:He(b)?b(ne):s})})})})}p(Ve,"SelectProvider");v(Ve,"SelectProvider");var Wt=v(l=>{const{__scopeSelect:e,children:s,...t}=l;return(0,d.jsx)(Ve,{__scopeSelect:e,...t,internal_do_not_use_render:p(({isFormControl:u})=>(0,d.jsxs)(d.Fragment,{children:[s,u?(0,d.jsx)(Lt,{__scopeSelect:e}):null]}),"internal_do_not_use_render")})},"Select"),wt="SelectTrigger",Kt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,disabled:u=!1,...r}=e,f=Pe(t),n=Z(wt,t),c=n.disabled||u,a=U(s,n.onTriggerChange),x=he(t),I=o.useRef("touch"),[P,_,y]=_e(i=>{const g=x().filter(m=>!m.disabled),C=be(g,i,g.find(m=>m.value===n.value));C!==void 0&&n.onValueChange(C.value)}),b=v(i=>{c||(n.onOpenChange(!0),y()),i&&(n.triggerPointerDownPosRef.current={x:Math.round(i.pageX),y:Math.round(i.pageY)})},"handleOpen");return(0,d.jsx)(nt,{asChild:!0,...f,children:(0,d.jsx)(O.button,{type:"button",role:"combobox","aria-controls":n.open?n.contentId:void 0,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":de(n.value)?"":void 0,...r,ref:a,onClick:E(r.onClick,i=>{i.currentTarget.focus(),I.current!=="mouse"&&b(i)}),onPointerDown:E(r.onPointerDown,i=>{I.current=i.pointerType;const g=i.target;g.hasPointerCapture(i.pointerId)&&g.releasePointerCapture(i.pointerId),i.button===0&&i.ctrlKey===!1&&i.pointerType==="mouse"&&(b(i),i.preventDefault())}),onKeyDown:E(r.onKeyDown,i=>{const g=P.current!=="";!(i.ctrlKey||i.altKey||i.metaKey)&&i.key.length===1&&_(i.key),!(g&&i.key===" ")&&ht.includes(i.key)&&(b(),i.preventDefault())})})})},"SelectTrigger2"),"SelectTrigger")),Ct="SelectValue",Gt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,className:u,style:r,children:f,placeholder:n="",...c}=e,a=Z(Ct,t),{onValueNodeHasChildrenChange:x}=a,I=f!==void 0,P=U(s,a.onValueNodeChange);X(()=>{x(I)},[x,I]);const _=de(a.value);return(0,d.jsx)(O.span,{...c,asChild:_?!1:c.asChild,ref:P,style:{pointerEvents:"none"},children:(0,d.jsx)(o.Fragment,{children:_?n:f},_?"placeholder":"value")})},"SelectValue2"),"SelectValue")),qt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,children:u,...r}=e;return(0,d.jsx)(O.span,{"aria-hidden":!0,...r,ref:s,children:u||"▼"})},"SelectIcon2"),"SelectIcon")),[It,Pt]=te("SelectPortal",{forceMount:void 0}),zt=v(l=>{const{__scopeSelect:e,forceMount:s,...t}=l;return(0,d.jsx)(It,{scope:l.__scopeSelect,forceMount:s,children:(0,d.jsx)(Qe,{asChild:!0,...t})})},"SelectPortal"),ee="SelectContent",Yt=o.forwardRef(v(p(function(e,s){const t=Pt(ee,e.__scopeSelect),{forceMount:u=t.forceMount,...r}=e,f=Z(ee,e.__scopeSelect),[n,c]=o.useState();return X(()=>{c(new DocumentFragment)},[]),(0,d.jsx)(ze,{present:u||f.open,children:p(({present:a})=>a?(0,d.jsx)(bt,{...r,ref:s}):(0,d.jsx)(yt,{...r,fragment:n}),"children")})},"SelectContent2"),"SelectContent")),yt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,children:u,fragment:r}=e;return r?Ne.createPortal((0,d.jsx)(ke,{scope:t,children:(0,d.jsx)(fe.Slot,{scope:t,children:(0,d.jsx)("div",{ref:s,children:u})})}),r):null},"SelectContentFragment2"),"SelectContentFragment")),k=10,[ke,oe]=te(ee),_t=qe("SelectContent.RemoveScroll"),bt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t}=e,{position:u="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:f,onPointerDownOutside:n,side:c,sideOffset:a,align:x,alignOffset:I,arrowPadding:P,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:i,avoidCollisions:g,...C}=e,m=Z(ee,t),[h,N]=o.useState(null),[D,le]=o.useState(null),V=U(s,N),[A,J]=o.useState(null),[q,W]=o.useState(null),K=he(t),[Q,G]=o.useState(!1),B=o.useRef(!1);o.useEffect(()=>{if(h)return tt(h)},[h]),ct();const z=o.useCallback(S=>{const[R,...T]=K().map(L=>L.ref.current),[w]=T.slice(-1),j=document.activeElement;for(const L of S)if(L===j||(L?.scrollIntoView({block:"nearest"}),L===R&&D&&(D.scrollTop=0),L===w&&D&&(D.scrollTop=D.scrollHeight),L?.focus(),document.activeElement!==j))return},[K,D]),Y=o.useCallback(()=>z([A,h]),[z,A,h]);o.useEffect(()=>{Q&&Y()},[Q,Y]);const{onOpenChange:$,triggerPointerDownPosRef:H}=m;o.useEffect(()=>{if(h){let S={x:0,y:0};const R=v(w=>{S={x:Math.abs(Math.round(w.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(w.pageY)-(H.current?.y??0))}},"handlePointerMove"),T=v(w=>{S.x<=10&&S.y<=10?w.preventDefault():w.composedPath().includes(h)||$(!1),document.removeEventListener("pointermove",R),H.current=null},"handlePointerUp");return H.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",T,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",T,{capture:!0})}}},[h,$,H]),o.useEffect(()=>{const S=v(()=>$(!1),"close");return window.addEventListener("blur",S),window.addEventListener("resize",S),()=>{window.removeEventListener("blur",S),window.removeEventListener("resize",S)}},[$]);const[ne,M]=_e(S=>{const R=K().filter(w=>!w.disabled),T=be(R,S,R.find(w=>w.ref.current===document.activeElement));T&&setTimeout(()=>T.ref.current?.focus())}),F=o.useCallback((S,R,T)=>{const w=!B.current&&!T;(m.value!==void 0&&m.value===R||w)&&(J(S),w&&(B.current=!0))},[m.value]),re=o.useCallback(()=>h?.focus(),[h]),ce=o.useCallback((S,R,T)=>{const w=!B.current&&!T;(m.value!==void 0&&m.value===R||w)&&W(S)},[m.value]),ue=u==="popper"?Re:Tt,ae=ue===Re?{side:c,sideOffset:a,align:x,alignOffset:I,arrowPadding:P,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:i,avoidCollisions:g}:{};return(0,d.jsx)(ke,{scope:t,content:h,viewport:D,onViewportChange:le,itemRefCallback:F,selectedItem:A,onItemLeave:re,itemTextRefCallback:ce,focusSelectedItem:Y,selectedItemText:q,position:u,isPositioned:Q,searchRef:ne,children:(0,d.jsx)(Je,{as:_t,allowPinchZoom:!0,children:(0,d.jsx)(rt,{asChild:!0,trapped:m.open,onMountAutoFocus:p(S=>{S.preventDefault()},"onMountAutoFocus"),onUnmountAutoFocus:E(r,S=>{m.trigger?.focus({preventScroll:!0}),S.preventDefault()}),children:(0,d.jsx)(Ze,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:n,onFocusOutside:p(S=>S.preventDefault(),"onFocusOutside"),onDismiss:p(()=>m.onOpenChange(!1),"onDismiss"),children:(0,d.jsx)(ue,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p(S=>S.preventDefault(),"onContextMenu"),...C,...ae,onPlaced:p(()=>G(!0),"onPlaced"),ref:V,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:E(C.onKeyDown,S=>{const R=S.ctrlKey||S.altKey||S.metaKey;if(S.key==="Tab"&&S.preventDefault(),!R&&S.key.length===1&&M(S.key),["ArrowUp","ArrowDown","Home","End"].includes(S.key)){let T=K().filter(w=>!w.disabled).map(w=>w.ref.current);if(["ArrowUp","End"].includes(S.key)&&(T=T.slice().reverse()),["ArrowUp","ArrowDown"].includes(S.key)){const w=S.target,j=T.indexOf(w);T=T.slice(j+1)}setTimeout(()=>z(T)),S.preventDefault()}})})})})})})},"SelectContentImpl2"),"SelectContentImpl")),Tt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,onPlaced:u,...r}=e,f=Z(ee,t),n=oe(ee,t),[c,a]=o.useState(null),[x,I]=o.useState(null),P=U(s,I),_=he(t),y=o.useRef(!1),b=o.useRef(!0),{viewport:i,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=n,h=o.useCallback(()=>{if(f.trigger&&f.valueNode&&c&&x&&i&&g&&C){const V=f.trigger.getBoundingClientRect(),A=x.getBoundingClientRect(),J=f.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(f.dir!=="rtl"){const w=q.left-A.left,j=J.left-w,L=V.left-j,ie=V.width+L,me=Math.max(ie,A.width),Se=window.innerWidth-k,ve=ge(j,[k,Math.max(k,Se-me)]);c.style.minWidth=ie+"px",c.style.left=ve+"px"}else{const w=A.right-q.right,j=window.innerWidth-J.right-w,L=window.innerWidth-V.right-j,ie=V.width+L,me=Math.max(ie,A.width),Se=window.innerWidth-k,ve=ge(j,[k,Math.max(k,Se-me)]);c.style.minWidth=ie+"px",c.style.right=ve+"px"}const W=_(),K=window.innerHeight-k*2,Q=i.scrollHeight,G=window.getComputedStyle(x),B=parseInt(G.borderTopWidth,10),z=parseInt(G.paddingTop,10),Y=parseInt(G.borderBottomWidth,10),$=parseInt(G.paddingBottom,10),H=B+z+Q+$+Y,ne=Math.min(g.offsetHeight*5,H),M=window.getComputedStyle(i),F=parseInt(M.paddingTop,10),re=parseInt(M.paddingBottom,10),ce=V.top+V.height/2-k,ue=K-ce,ae=g.offsetHeight/2,S=g.offsetTop+ae,R=B+z+S,T=H-R;if(R<=ce){const w=W.length>0&&g===W[W.length-1].ref.current;c.style.bottom="0px";const j=x.clientHeight-i.offsetTop-i.offsetHeight,L=R+Math.max(ue,ae+(w?re:0)+j+Y);c.style.height=L+"px"}else{const w=W.length>0&&g===W[0].ref.current;c.style.top="0px";const j=Math.max(ce,B+i.offsetTop+(w?F:0)+ae)+T;c.style.height=j+"px",i.scrollTop=R-ce+i.offsetTop}c.style.margin=`${k}px 0`,c.style.minHeight=ne+"px",c.style.maxHeight=K+"px",u?.(),requestAnimationFrame(()=>y.current=!0)}},[_,f.trigger,f.valueNode,c,x,i,g,C,f.dir,u]);X(()=>h(),[h]);const[N,D]=o.useState();X(()=>{x&&D(window.getComputedStyle(x).zIndex)},[x]);const le=o.useCallback(V=>{V&&b.current===!0&&(h(),m?.(),b.current=!1)},[h,m]);return(0,d.jsx)(Rt,{scope:t,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:le,children:(0,d.jsx)("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:(0,d.jsx)(O.div,{...r,ref:P,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})},"SelectItemAlignedPosition2"),"SelectItemAlignedPosition")),Re=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,align:u="start",collisionPadding:r=k,...f}=e,n=Pe(t);return(0,d.jsx)(et,{...n,...f,ref:s,align:u,collisionPadding:r,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition2"),"SelectPopperPosition")),[Rt,ye]=te(ee,{}),Ee="SelectViewport",$t=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,nonce:u,...r}=e,f=oe(Ee,t),n=ye(Ee,t),c=U(s,f.onViewportChange),a=o.useRef(0);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),(0,d.jsx)(fe.Slot,{scope:t,children:(0,d.jsx)(O.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,x=>{const I=x.currentTarget,{contentWrapper:P,shouldExpandOnScrollRef:_}=n;if(_?.current&&P){const y=Math.abs(a.current-I.scrollTop);if(y>0){const b=window.innerHeight-k*2,i=parseFloat(P.style.minHeight),g=parseFloat(P.style.height),C=Math.max(i,g);if(C<b){const m=C+y,h=Math.min(b,m),N=m-h;P.style.height=h+"px",P.style.bottom==="0px"&&(I.scrollTop=N>0?N:0,P.style.justifyContent="flex-end")}}}a.current=I.scrollTop})})})]})},"SelectViewport2"),"SelectViewport")),[Et,Mt]=te("SelectGroup"),Xt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e,r=Ie();return(0,d.jsx)(Et,{scope:t,id:r,children:(0,d.jsx)(O.div,{role:"group","aria-labelledby":r,...u,ref:s})})},"SelectGroup2"),"SelectGroup")),jt="SelectLabel",Zt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e,r=Mt(jt,t);return(0,d.jsx)(O.div,{id:r.id,...u,ref:s})},"SelectLabel2"),"SelectLabel")),xe="SelectItem",[Ot,Ae]=te(xe),Jt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,value:u,disabled:r=!1,textValue:f,...n}=e,c=Z(xe,t),a=oe(xe,t),x=c.value===u,[I,P]=o.useState(f??""),[_,y]=o.useState(!1),b=Ce(h=>a.itemRefCallback?.(h,u,r)),i=U(s,b),g=Ie(),C=o.useRef("touch"),m=v(()=>{r||(c.onValueChange(u),c.onOpenChange(!1))},"handleSelect");return(0,d.jsx)(Ot,{scope:t,value:u,disabled:r,textId:g,isSelected:x,onItemTextChange:o.useCallback(h=>{P(N=>N||(h?.textContent??"").trim())},[]),children:(0,d.jsx)(fe.ItemSlot,{scope:t,value:u,disabled:r,textValue:I,children:(0,d.jsx)(O.div,{role:"option","aria-labelledby":g,"data-highlighted":_?"":void 0,"aria-selected":x&&_,"data-state":x?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:i,onFocus:E(n.onFocus,()=>y(!0)),onBlur:E(n.onBlur,()=>y(!1)),onClick:E(n.onClick,()=>{C.current!=="mouse"&&m()}),onPointerUp:E(n.onPointerUp,()=>{C.current==="mouse"&&m()}),onPointerDown:E(n.onPointerDown,h=>{C.current=h.pointerType}),onPointerMove:E(n.onPointerMove,h=>{C.current=h.pointerType,r?a.onItemLeave?.():C.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(n.onPointerLeave,h=>{h.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:E(n.onKeyDown,h=>{r||h.target!==h.currentTarget||a.searchRef?.current!==""&&h.key===" "||(mt.includes(h.key)&&m(),h.key===" "&&h.preventDefault())})})})})},"SelectItem2"),"SelectItem")),pe="SelectItemText",Qt=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,className:u,style:r,...f}=e,n=Z(pe,t),c=oe(pe,t),a=Ae(pe,t),x=xt(pe,t),[I,P]=o.useState(null),_=Ce(m=>c.itemTextRefCallback?.(m,a.value,a.disabled)),y=U(s,P,a.onItemTextChange,_),b=I?.textContent,i=o.useMemo(()=>(0,d.jsx)("option",{value:a.value,disabled:a.disabled,children:b},a.value),[a.disabled,a.value,b]),{onNativeOptionAdd:g,onNativeOptionRemove:C}=x;return X(()=>(g(i),()=>C(i)),[g,C,i]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(O.span,{id:a.textId,...f,ref:y}),a.isSelected&&n.valueNode&&!n.valueNodeHasChildren&&!de(n.value)?Ne.createPortal(f.children,n.valueNode):null]})},"SelectItemText2"),"SelectItemText")),Nt="SelectItemIndicator",eo=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e;return Ae(Nt,t).isSelected?(0,d.jsx)(O.span,{"aria-hidden":!0,...u,ref:s}):null},"SelectItemIndicator2"),"SelectItemIndicator")),Me="SelectScrollUpButton",to=o.forwardRef(v(p(function(e,s){const t=oe(Me,e.__scopeSelect),u=ye(Me,e.__scopeSelect),[r,f]=o.useState(!1),n=U(s,u.onScrollButtonChange);return X(()=>{if(t.viewport&&t.isPositioned){let c=p(function(){const x=a.scrollTop>0;f(x)},"handleScroll2");v(c,"handleScroll");const a=t.viewport;return c(),a.addEventListener("scroll",c),()=>a.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?(0,d.jsx)(Be,{...e,ref:n,onAutoScroll:p(()=>{const{viewport:c,selectedItem:a}=t;c&&a&&(c.scrollTop=c.scrollTop-a.offsetHeight)},"onAutoScroll")}):null},"SelectScrollUpButton2"),"SelectScrollUpButton")),je="SelectScrollDownButton",oo=o.forwardRef(v(p(function(e,s){const t=oe(je,e.__scopeSelect),u=ye(je,e.__scopeSelect),[r,f]=o.useState(!1),n=U(s,u.onScrollButtonChange);return X(()=>{if(t.viewport&&t.isPositioned){let c=p(function(){const x=a.scrollHeight-a.clientHeight,I=Math.ceil(a.scrollTop)<x;f(I)},"handleScroll2");v(c,"handleScroll");const a=t.viewport;return c(),a.addEventListener("scroll",c),()=>a.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?(0,d.jsx)(Be,{...e,ref:n,onAutoScroll:p(()=>{const{viewport:c,selectedItem:a}=t;c&&a&&(c.scrollTop=c.scrollTop+a.offsetHeight)},"onAutoScroll")}):null},"SelectScrollDownButton2"),"SelectScrollDownButton")),Be=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,onAutoScroll:u,...r}=e,f=oe("SelectScrollButton",t),n=o.useRef(null),c=he(t),a=o.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return o.useEffect(()=>()=>a(),[a]),X(()=>{c().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,d.jsx)(O.div,{"aria-hidden":!0,...r,ref:s,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(u,50))}),onPointerMove:E(r.onPointerMove,()=>{f.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(u,50))}),onPointerLeave:E(r.onPointerLeave,()=>{a()})})},"SelectScrollButtonImpl2"),"SelectScrollButtonImpl")),no=o.forwardRef(v(p(function(e,s){const{__scopeSelect:t,...u}=e;return(0,d.jsx)(O.div,{"aria-hidden":!0,...u,ref:s})},"SelectSeparator2"),"SelectSeparator")),Dt="SelectBubbleInput",Lt=o.forwardRef(v(p(function({__scopeSelect:e,...s},t){const u=Z(Dt,e),{value:r,onValueChange:f,required:n,disabled:c,name:a,autoComplete:x,form:I}=u,{nativeOptions:P,nativeSelectKey:_}=u,y=o.useRef(null),b=U(t,y),i=r??"",g=Le(i),C=Array.from(P).some(m=>(m.props.value??"")==="");return o.useEffect(()=>{const m=y.current;if(!m)return;const h=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(h,"value").set;if(g!==i&&N){const D=new Event("change",{bubbles:!0});N.call(m,i),m.dispatchEvent(D)}},[g,i]),(0,d.jsxs)(O.select,{"aria-hidden":!0,required:n,tabIndex:-1,name:a,autoComplete:x,disabled:c,form:I,onChange:p(m=>f(m.target.value),"onChange"),...s,style:{...De,...s.style},ref:b,defaultValue:i,children:[de(r)&&!C?(0,d.jsx)("option",{value:""}):null,Array.from(P)]},_)},"SelectBubbleInput2"),"SelectBubbleInput"));function He(l){return typeof l=="function"}p(He,"isFunction");v(He,"isFunction");function de(l){return l===""||l===void 0}p(de,"shouldShowPlaceholder");v(de,"shouldShowPlaceholder");function _e(l){const e=Ce(l),s=o.useRef(""),t=o.useRef(0),u=o.useCallback(f=>{const n=s.current+f;e(n),v(p((function c(a){s.current=a,window.clearTimeout(t.current),a!==""&&(t.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch"),"updateSearch")(n)},[e]),r=o.useCallback(()=>{s.current="",window.clearTimeout(t.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(t.current),[]),[s,u,r]}p(_e,"useTypeaheadSearch");v(_e,"useTypeaheadSearch");function be(l,e,s){const t=e.length>1&&Array.from(e).every(n=>n===e[0])?e[0]:e,u=s?l.indexOf(s):-1;let r=Fe(l,Math.max(u,0));t.length===1&&(r=r.filter(n=>n!==s));const f=r.find(n=>n.textValue.toLowerCase().startsWith(t.toLowerCase()));return f!==s?f:void 0}p(be,"findNextItem");v(be,"findNextItem");function Fe(l,e){return l.map((s,t)=>l[(e+t)%l.length])}p(Fe,"wrapArray");v(Fe,"wrapArray");export{Ft as _,Jt as a,Zt as c,to as d,no as f,ge as g,$t as h,qt as i,zt as l,Gt as m,Yt as n,eo as o,Kt as p,Xt as r,Qt as s,Wt as t,oo as u};
|