@cline/cli-windows-arm64 3.0.52 → 3.0.53

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.
Files changed (138) hide show
  1. package/bin/cline.exe +0 -0
  2. package/cline-hub/webview/assets/Chat-5-m425Jp.js +197 -0
  3. package/cline-hub/webview/assets/DialogTitle-jgZKJpfs.js +1 -0
  4. package/cline-hub/webview/assets/{abnfDiagram-VRR7QNED-BmZn7QAr.js → abnfDiagram-VRR7QNED-BLFmc_AX.js} +1 -1
  5. package/cline-hub/webview/assets/{arc-C6pGbJrV.js → arc-DD7eF3YX.js} +1 -1
  6. package/cline-hub/webview/assets/{architectureDiagram-ZJ3FMSHR-Dgv4VGlE.js → architectureDiagram-ZJ3FMSHR-DvcvwqFE.js} +2 -2
  7. package/cline-hub/webview/assets/badge-DJicQweE.js +1 -0
  8. package/cline-hub/webview/assets/{blockDiagram-677ZJIJ3-D7Rb3u2m.js → blockDiagram-677ZJIJ3-D2G4QuxG.js} +5 -5
  9. package/cline-hub/webview/assets/{bundle-mjs-CO994-RQ.js → bundle-mjs-CSP5ngA5.js} +1 -1
  10. package/cline-hub/webview/assets/{c4Diagram-LMCZKHZV-Dkvth2jj.js → c4Diagram-LMCZKHZV-C6Nuiq7M.js} +3 -3
  11. package/cline-hub/webview/assets/channel-CSeXS2Ai.js +1 -0
  12. package/cline-hub/webview/assets/{chunk-32BRIVSS-CSG4V8l0.js → chunk-32BRIVSS-BsAqn4xZ.js} +1 -1
  13. package/cline-hub/webview/assets/chunk-52WLFC77-BWe_4R7D.js +10 -0
  14. package/cline-hub/webview/assets/chunk-BO2N2NFS-DhZuH4Af.js +131 -0
  15. package/cline-hub/webview/assets/{chunk-C7G6YPKG-hGGgXHCs.js → chunk-C7G6YPKG-CV2Ol95R.js} +1 -1
  16. package/cline-hub/webview/assets/{chunk-EX3LRPZG-C3BlUnKc.js → chunk-EX3LRPZG-C7pvEKxc.js} +3 -3
  17. package/cline-hub/webview/assets/{chunk-FWX5IMBZ-CBBxPYoo.js → chunk-FWX5IMBZ-wv8Fkt1d.js} +2 -2
  18. package/cline-hub/webview/assets/{chunk-HOUHSVGY-BK-KWdyz.js → chunk-HOUHSVGY-CFjt2s0d.js} +1 -1
  19. package/cline-hub/webview/assets/chunk-ICXQ74PX-COcWu1Sq.js +2 -0
  20. package/cline-hub/webview/assets/{chunk-MOJQB5TN-CxW5bRIS.js → chunk-MOJQB5TN-D44BZz7X.js} +1 -1
  21. package/cline-hub/webview/assets/chunk-OGEWGWER-BVna3Z_8.js +1 -0
  22. package/cline-hub/webview/assets/{chunk-PUDLZKDR-7amIl78k.js → chunk-PUDLZKDR-CE01riew.js} +5 -5
  23. package/cline-hub/webview/assets/{chunk-Q4XR5HBZ-DyEQflKV.js → chunk-Q4XR5HBZ-CtUzoHvJ.js} +6 -6
  24. package/cline-hub/webview/assets/chunk-RYQCIY6F-AfEdSVyS.js +1 -0
  25. package/cline-hub/webview/assets/{chunk-V7JOEXUC-7L1bQwIr.js → chunk-V7JOEXUC-C4XkVjGi.js} +3 -3
  26. package/cline-hub/webview/assets/chunk-VAUOI2AC-BlqTQL33.js +1 -0
  27. package/cline-hub/webview/assets/{chunk-VR4S4FIN-Be22cetl.js → chunk-VR4S4FIN-CbCTOh7J.js} +1 -1
  28. package/cline-hub/webview/assets/{chunk-WYO6CB5R-BQDKJ2Op.js → chunk-WYO6CB5R-B91ryJFB.js} +3 -3
  29. package/cline-hub/webview/assets/{chunk-XXDRQBXY-DlK_iNGL.js → chunk-XXDRQBXY-DR-hrsFH.js} +1 -1
  30. package/cline-hub/webview/assets/{chunk-ZGVPDNZ5-D0HhTn0b.js → chunk-ZGVPDNZ5-D5I51kcE.js} +2 -2
  31. package/cline-hub/webview/assets/{chunk-ZIRB5QZD-C6fEPe3t.js → chunk-ZIRB5QZD-BpeS1aZ7.js} +3 -3
  32. package/cline-hub/webview/assets/classDiagram-OUVF2IWQ-BC75njhg.js +1 -0
  33. package/cline-hub/webview/assets/classDiagram-v2-EOCWNBFH-BC75njhg.js +1 -0
  34. package/cline-hub/webview/assets/{cose-bilkent-JH36ORCC-Ovgghq0g.js → cose-bilkent-JH36ORCC-Do63cWW-.js} +1 -1
  35. package/cline-hub/webview/assets/cynefinDiagram-TSTJHNR4-DxiC1jLj.js +62 -0
  36. package/cline-hub/webview/assets/{dagre-VKFMJZFB-VZxqrogn.js → dagre-VKFMJZFB-D4MnrU54.js} +2 -2
  37. package/cline-hub/webview/assets/defaultLocale-BFoDCU3G.js +1 -0
  38. package/cline-hub/webview/assets/{desktop-client-bYADwT3y.js → desktop-client-Cc9yU7GV.js} +1 -1
  39. package/cline-hub/webview/assets/{diagram-FQU43EPY-ZqBQCTGG.js → diagram-FQU43EPY-D6nNqFiO.js} +1 -1
  40. package/cline-hub/webview/assets/{diagram-G47NLZAW-DG_j92Nl.js → diagram-G47NLZAW-C8pCvnUn.js} +13 -13
  41. package/cline-hub/webview/assets/{diagram-NH7WQ7WH-Bt4tNl-h.js → diagram-NH7WQ7WH-BjRb6vlK.js} +1 -1
  42. package/cline-hub/webview/assets/{diagram-OA4YK3LP-v40q0J0R.js → diagram-OA4YK3LP-BOaPe4YT.js} +1 -1
  43. package/cline-hub/webview/assets/{diagram-WEI45ONY-CZSSbGFC.js → diagram-WEI45ONY-C2gh4ORi.js} +2 -2
  44. package/cline-hub/webview/assets/{dist-BH9bKIvu.js → dist-BDCdLWk4.js} +1 -1
  45. package/cline-hub/webview/assets/{ebnfDiagram-CCIWWBDH-BQguzKyi.js → ebnfDiagram-CCIWWBDH-CjkO8TQF.js} +1 -1
  46. package/cline-hub/webview/assets/{erDiagram-Q63AITRT-CXNNdhob.js → erDiagram-Q63AITRT-BMK30ekD.js} +3 -3
  47. package/cline-hub/webview/assets/extensions-view-Cd8F5xpl.js +1 -0
  48. package/cline-hub/webview/assets/flowDiagram-23GEKE2U-BntOZ8ZE.js +1 -0
  49. package/cline-hub/webview/assets/{ganttDiagram-NO4QXBWP-BeutZoFO.js → ganttDiagram-NO4QXBWP-BiXN4AZg.js} +3 -3
  50. package/cline-hub/webview/assets/{gitGraphDiagram-IHSO6WYX-DwtCBJ_d.js → gitGraphDiagram-IHSO6WYX-G9vFn-Jf.js} +3 -3
  51. package/cline-hub/webview/assets/{highlighted-body-OFNGDK62-BOW3kov6.js → highlighted-body-OFNGDK62-CgYHG1rO.js} +1 -1
  52. package/cline-hub/webview/assets/index-CfNkVILD.js +10 -0
  53. package/cline-hub/webview/assets/{infoDiagram-FWYZ7A6U-CBIO2hmL.js → infoDiagram-FWYZ7A6U-DKv-n7tl.js} +1 -1
  54. package/cline-hub/webview/assets/init-C-OQMol4.js +1 -0
  55. package/cline-hub/webview/assets/{ishikawaDiagram-FXEZZL3T-6y2h3Opo.js → ishikawaDiagram-FXEZZL3T-CR3RSn8R.js} +2 -2
  56. package/cline-hub/webview/assets/{journeyDiagram-5HDEW3XC-ClvGKUe-.js → journeyDiagram-5HDEW3XC-DLH3FDEU.js} +3 -3
  57. package/cline-hub/webview/assets/{kanban-definition-HUTT4EX6-BqBCyQU9.js → kanban-definition-HUTT4EX6-CfNVdKZg.js} +3 -3
  58. package/cline-hub/webview/assets/label-CFn0VYsb.js +1 -0
  59. package/cline-hub/webview/assets/{line-Bw8gqOPe.js → line-CJ_JkFXf.js} +1 -1
  60. package/cline-hub/webview/assets/{linear-BiXMiKrI.js → linear-B87ngFcg.js} +1 -1
  61. package/cline-hub/webview/assets/mermaid-GHXKKRXX-DWw3cmjX.js +1 -0
  62. package/cline-hub/webview/assets/mermaid-layout-C3UvhD5t.js +321 -0
  63. package/cline-hub/webview/assets/{mermaid-layout-D67Npcks.js → mermaid-layout-C40rDmm9.js} +1 -1
  64. package/cline-hub/webview/assets/mermaid-layout-CKcc_JPx.js +1 -0
  65. package/cline-hub/webview/assets/mermaid-layout-DI4ft-3R.js +1 -0
  66. package/cline-hub/webview/assets/mermaid-layout-db2zCT1P.js +1 -0
  67. package/cline-hub/webview/assets/mermaid-markup-aLwrmF5_.js +259 -0
  68. package/cline-hub/webview/assets/mermaid-parser-Bjbk52nf.js +1 -0
  69. package/cline-hub/webview/assets/{mermaid-parser-CsKqUYKE.js → mermaid-parser-C0ihgYQ9.js} +1 -1
  70. package/cline-hub/webview/assets/{mermaid-parser-CUZ6GPid.js → mermaid-parser-CJzh8iAc.js} +2 -2
  71. package/cline-hub/webview/assets/mermaid-parser-CWbpbwPR.js +1 -0
  72. package/cline-hub/webview/assets/{mermaid-parser-B5HHdaKy.js → mermaid-parser-CeG4Jv6J.js} +1 -1
  73. package/cline-hub/webview/assets/{mermaid-parser-BDUXySIN.js → mermaid-parser-D7YKh_-X.js} +1 -1
  74. package/cline-hub/webview/assets/{mermaid-parser-Dj-OpFgW.js → mermaid-parser-DEvma7oi.js} +24 -24
  75. package/cline-hub/webview/assets/mermaid-parser-N1OWR5wr.js +1 -0
  76. package/cline-hub/webview/assets/{mermaid-parser-B1PyAFXY.js → mermaid-parser-vz6fNr8n.js} +1 -1
  77. package/cline-hub/webview/assets/mermaid.core-Be9B_pr2.js +11 -0
  78. package/cline-hub/webview/assets/{mindmap-definition-LN4V7U3C--xTAn35A.js → mindmap-definition-LN4V7U3C-DUQyLHrD.js} +3 -3
  79. package/cline-hub/webview/assets/{ordinal-CopWnP7w.js → ordinal-DtR4qwUh.js} +1 -1
  80. package/cline-hub/webview/assets/{path-BWPyau1x.js → path-COt_16Va.js} +1 -1
  81. package/cline-hub/webview/assets/{pegDiagram-2B236MQR-5kpPEH6L.js → pegDiagram-2B236MQR-DOgBowT1.js} +1 -1
  82. package/cline-hub/webview/assets/{pieDiagram-ENE6RG2P-BFaL_bCO.js → pieDiagram-ENE6RG2P-DRfeiass.js} +2 -2
  83. package/cline-hub/webview/assets/{quadrantDiagram-ABIIQ3AL-DeQgeOJA.js → quadrantDiagram-ABIIQ3AL-BgPT8pIn.js} +2 -2
  84. package/cline-hub/webview/assets/{railroadDiagram-RFXS5EU6-D6A3-IXZ.js → railroadDiagram-RFXS5EU6-8wt-q6c9.js} +1 -1
  85. package/cline-hub/webview/assets/{requirementDiagram-TGXJPOKE-D3J4J8f0.js → requirementDiagram-TGXJPOKE-DRTUm7Qo.js} +2 -2
  86. package/cline-hub/webview/assets/{rolldown-runtime-CNC7AqOf.js → rolldown-runtime-B0Z9INg1.js} +1 -1
  87. package/cline-hub/webview/assets/{rough.esm-CSKSodPl.js → rough.esm-By172zw-.js} +1 -1
  88. package/cline-hub/webview/assets/{sankeyDiagram-HTMAVEWB-Csrr--Ku.js → sankeyDiagram-HTMAVEWB-CeY3Y_ll.js} +2 -2
  89. package/cline-hub/webview/assets/sequenceDiagram-DBY2YBRQ-DSUB2OM4.js +162 -0
  90. package/cline-hub/webview/assets/settings-view-DS30eWav.js +76 -0
  91. package/cline-hub/webview/assets/src-BY_WSiz7.js +1 -0
  92. package/cline-hub/webview/assets/{stateDiagram-2N3HPSRC-BAGoUKsk.js → stateDiagram-2N3HPSRC-B2x_vEZe.js} +1 -1
  93. package/cline-hub/webview/assets/stateDiagram-v2-6OUMAXLB-BchjBw5_.js +1 -0
  94. package/cline-hub/webview/assets/swimlanes-5IMT3BWC-D4vQUhBS.js +2 -0
  95. package/cline-hub/webview/assets/swimlanesDiagram-G3AALYLV-FXn7KRqH.js +8 -0
  96. package/cline-hub/webview/assets/switch-1OAUgxzd.js +1 -0
  97. package/cline-hub/webview/assets/{timeline-definition-FHXFAJF6-CQNgmTIt.js → timeline-definition-FHXFAJF6-B-Cz6AFL.js} +3 -3
  98. package/cline-hub/webview/assets/{vennDiagram-L72KCM5P-CXc-iN33.js → vennDiagram-L72KCM5P-BHMfdY1b.js} +3 -3
  99. package/cline-hub/webview/assets/vscode-tfEHsPTc.js +1 -0
  100. package/cline-hub/webview/assets/{wardleyDiagram-EHGQE667-DTibNvqD.js → wardleyDiagram-EHGQE667-BgTZ-C-Z.js} +22 -22
  101. package/cline-hub/webview/assets/{xychartDiagram-FW5EYKEG-CO2qnUyw.js → xychartDiagram-FW5EYKEG-B9lKc__k.js} +4 -4
  102. package/cline-hub/webview/index.html +5 -3
  103. package/package.json +1 -1
  104. package/cline-hub/webview/assets/Chat-Byz21shc.js +0 -201
  105. package/cline-hub/webview/assets/badge-tZD_60cv.js +0 -1
  106. package/cline-hub/webview/assets/channel-BLdg_aiM.js +0 -1
  107. package/cline-hub/webview/assets/chunk-52WLFC77-hXd71QCM.js +0 -10
  108. package/cline-hub/webview/assets/chunk-BO2N2NFS-DJS94hax.js +0 -131
  109. package/cline-hub/webview/assets/chunk-ICXQ74PX-C1naCh7h.js +0 -2
  110. package/cline-hub/webview/assets/chunk-OGEWGWER-IbFWtSr3.js +0 -1
  111. package/cline-hub/webview/assets/chunk-RYQCIY6F-L4N6kLKj.js +0 -1
  112. package/cline-hub/webview/assets/chunk-VAUOI2AC-IC4V3R7w.js +0 -1
  113. package/cline-hub/webview/assets/classDiagram-OUVF2IWQ-Cx3KaYH1.js +0 -1
  114. package/cline-hub/webview/assets/classDiagram-v2-EOCWNBFH-Cx3KaYH1.js +0 -1
  115. package/cline-hub/webview/assets/cynefinDiagram-TSTJHNR4-ck16KLo6.js +0 -62
  116. package/cline-hub/webview/assets/defaultLocale-C8Fc0cco.js +0 -1
  117. package/cline-hub/webview/assets/extensions-view-B6Z6Tf6l.js +0 -1
  118. package/cline-hub/webview/assets/flowDiagram-23GEKE2U-cbrTqCtr.js +0 -1
  119. package/cline-hub/webview/assets/index-Cw6Kg0MD.js +0 -10
  120. package/cline-hub/webview/assets/init-D6jRqBbL.js +0 -1
  121. package/cline-hub/webview/assets/label-B4VTGFzI.js +0 -1
  122. package/cline-hub/webview/assets/mermaid-GHXKKRXX-CoORZYz7.js +0 -1
  123. package/cline-hub/webview/assets/mermaid-layout-BClsMEZU.js +0 -1
  124. package/cline-hub/webview/assets/mermaid-layout-CQFVGiJu.js +0 -321
  125. package/cline-hub/webview/assets/mermaid-layout-Gej8MFKI.js +0 -1
  126. package/cline-hub/webview/assets/mermaid-layout-mOwqmNjF.js +0 -1
  127. package/cline-hub/webview/assets/mermaid-markup-WcaG3JKD.js +0 -259
  128. package/cline-hub/webview/assets/mermaid-parser-0bma_2tB.js +0 -1
  129. package/cline-hub/webview/assets/mermaid-parser-BaBV8uvS.js +0 -1
  130. package/cline-hub/webview/assets/mermaid-parser-BzOFf4CL.js +0 -1
  131. package/cline-hub/webview/assets/mermaid.core-CnkePiBs.js +0 -11
  132. package/cline-hub/webview/assets/sequenceDiagram-DBY2YBRQ-DgI2RFHU.js +0 -162
  133. package/cline-hub/webview/assets/settings-view-DvSMyQzo.js +0 -76
  134. package/cline-hub/webview/assets/src-Cz8bXOH0.js +0 -1
  135. package/cline-hub/webview/assets/stateDiagram-v2-6OUMAXLB-_KKwgh9O.js +0 -1
  136. package/cline-hub/webview/assets/swimlanes-5IMT3BWC-DZ_1nFLY.js +0 -2
  137. package/cline-hub/webview/assets/swimlanesDiagram-G3AALYLV-BEQ5I-gs.js +0 -8
  138. package/cline-hub/webview/assets/switch-DeaHMo5o.js +0 -1
@@ -1,9 +1,9 @@
1
- import{n as e,t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-Cz8bXOH0.js";import{$ as i,J as a,a as o,b as s,et as c,nt as l,o as u,x as d}from"./chunk-WYO6CB5R-BQDKJ2Op.js";import{t as f}from"./arc-C6pGbJrV.js";import{p}from"./chunk-ICXQ74PX-C1naCh7h.js";import{t as m}from"./chunk-VAUOI2AC-IC4V3R7w.js";var h=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(n,[2,5],{5:6}),t(n,[2,2]),t(n,[2,3]),t(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,10],{1:[2,1]}),t(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,8]),t(n,[2,9]),t(n,[2,11]),{16:[1,22]},{18:[1,23]},t(n,[2,14]),t(n,[2,15]),t(n,[2,16]),t(n,[2,17]),t(n,[2,18]),t(n,[2,19]),t(n,[2,7]),t(n,[2,12]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e,t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-BY_WSiz7.js";import{$ as i,J as a,a as o,b as s,et as c,nt as l,o as u,x as d}from"./chunk-WYO6CB5R-B91ryJFB.js";import{t as f}from"./arc-DD7eF3YX.js";import{p}from"./chunk-ICXQ74PX-COcWu1Sq.js";import{t as m}from"./chunk-VAUOI2AC-BlqTQL33.js";var h=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s]}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(n,[2,5],{5:6}),t(n,[2,2]),t(n,[2,3]),t(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,10],{1:[2,1]}),t(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,8]),t(n,[2,9]),t(n,[2,11]),{16:[1,22]},{18:[1,23]},t(n,[2,14]),t(n,[2,15]),t(n,[2,16]),t(n,[2,17]),t(n,[2,18]),t(n,[2,19]),t(n,[2,7]),t(n,[2,12]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};u.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
- `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin(`acc_title`),15;case 10:return this.popState(),`acc_title_value`;case 11:return this.begin(`acc_descr`),17;case 12:return this.popState(),`acc_descr_value`;case 13:this.begin(`acc_descr_multiline`);break;case 14:this.popState();break;case 15:return`acc_descr_multiline_value`;case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}})();function d(){this.yy={}}return e(d,`Parser`),d.prototype=u,u.Parser=d,new d})();h.parser=h;var g=h,_={};t(_,{addEvent:()=>M,addSection:()=>O,addTask:()=>j,addTaskOrg:()=>N,clear:()=>T,default:()=>ee,getCommonDb:()=>w,getDirection:()=>D,getSections:()=>k,getTasks:()=>A,setDirection:()=>E});var v=``,y=0,b=`LR`,x=[],S=[],C=[],w=e(()=>u,`getCommonDb`),T=e(function(){x.length=0,S.length=0,v=``,C.length=0,b=`LR`,o()},`clear`),E=e(function(e){b=e},`setDirection`),D=e(function(){return b},`getDirection`),O=e(function(e){v=e,x.push(e)},`addSection`),k=e(function(){return x},`getSections`),A=e(function(){let e=P(),t=0;for(;!e&&t<100;)e=P(),t++;return S.push(...C),S},`getTasks`),j=e(function(e,t,n){let r={id:y++,section:v,type:v,task:e,score:t||0,events:n?[n]:[]};C.push(r)},`addTask`),M=e(function(e){C.find(e=>e.id===y-1).events.push(e)},`addEvent`),N=e(function(e){let t={section:v,type:v,description:e,task:e,classes:[]};S.push(t)},`addTaskOrg`),P=e(function(){let t=e(function(e){return C[e].processed},`compileTask`),n=!0;for(let[e,r]of C.entries())t(e),n&&=r.processed;return n},`compileTasks`),ee={clear:T,getCommonDb:w,getDirection:D,setDirection:E,addSection:O,getSections:k,getTasks:A,addTask:j,addTaskOrg:N,addEvent:M},F=0,I=e(function(e,t){let n=e.append(`rect`);return n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),n.attr(`rx`,t.rx),n.attr(`ry`,t.ry),t.class!==void 0&&n.attr(`class`,t.class),n},`drawRect`),te=e(function(t,n){let r=t.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=t.append(`g`);i.append(`circle`).attr(`cx`,n.cx-15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}e(a,`smile`);function o(e){let t=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}e(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),ne=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),L=e(function(e,t){let n=t.text.replace(/<br\s*\/?>/gi,` `),r=e.append(`text`);r.attr(`x`,t.x),r.attr(`y`,t.y),r.attr(`class`,`legend`),r.style(`text-anchor`,t.anchor),t.class!==void 0&&r.attr(`class`,t.class);let i=r.append(`tspan`);return i.attr(`x`,t.x+t.textMargin*2),i.text(n),r},`drawText`),re=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,L(t,n)},`drawLabel`),R=e(function(e,t,n){let r=e.append(`g`),i=B();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,I(r,i),V(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,ie=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),te(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=B();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,I(a,o),V(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),ae=e(function(e,t){I(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:`rect`}).lower()},`drawBackgroundRect`),oe=e(function(){return{x:0,y:0,fill:void 0,"text-anchor":`start`,width:100,height:100,textMargin:0,rx:0,ry:0}},`getTextObj`),B=e(function(){return{x:0,y:0,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),V=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),se=e(function(e,t){F=0,z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`);function H(e,t){e.each(function(){var e=r(this),n=e.text().split(/(\s+|<br>)/).reverse(),i,a=[],o=1.1,s=e.attr(`y`),c=parseFloat(e.attr(`dy`)),l=e.text(null).append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,c+`em`);for(let r=0;r<n.length;r++)i=n[n.length-1-r],a.push(i),l.text(a.join(` `).trim()),(l.node().getComputedTextLength()>t||i===`<br>`)&&(a.pop(),l.text(a.join(` `).trim()),a=i===`<br>`?[``]:[i],l=e.append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,o+`em`).text(i))})}e(H,`wrap`);var ce=e(function(e,t,n,i,a,o=!1){let{theme:s,look:c}=i,l=s?.includes(`redux`),u=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=e.append(`g`);t.section=u,d.attr(`class`,(t.class?t.class+` `:``)+`timeline-node `+(`section-`+u));let f=d.append(`g`),p=d.append(`g`),m=p.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(H,t.width).node().getBBox(),h=i.fontSize?.replace?i.fontSize.replace(`px`,``):i.fontSize;if(t.height=m.height+h*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width+=2*t.padding,p.attr(`transform`,`translate(`+t.width/2+`, `+t.padding/2+`)`),l&&p.attr(`transform`,`translate(${t.width/2}, ${o?t.padding/2+3:t.padding})`),ue(f,t,u,a,i),c===`neo`&&(d.attr(`data-look`,`neo`),l)){let t=s.includes(`dark`),n=r(e.node()?.ownerSVGElement??e.node()),i=n.attr(`id`)??``,a=i?`${i}-drop-shadow`:`drop-shadow`;if(n.select(`#${a}`).empty()){let e=n.select(`defs`);(e.empty()?n.append(`defs`):e).append(`filter`).attr(`id`,a).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,t?`0.2`:`0.06`).attr(`flood-color`,t?`#FFFFFF`:`#000000`)}}return t},`drawNode`),le=e(function(e,t,n){let r=e.append(`g`),i=r.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(H,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace(`px`,``):n.fontSize;return r.remove(),i.height+a*1.1*.5+t.padding},`getVirtualNodeHeight`),ue=e(function(e,t,n,r,i){let{theme:a}=i,o=a?.includes(`redux`)?0:5,s=o>0?`M0 ${t.height-5} v${-t.height+10} q0,-${o},${o},-${o} h${t.width-10} q${o},0,${o},${o} v${t.height-5} H0 Z`:`M0 ${t.height-5} v${-(t.height-5)} h${t.width} v${t.height} H0 Z`;e.append(`path`).attr(`id`,r+`-node-`+F++).attr(`class`,`node-bkg node-`+t.type).attr(`d`,s),a?.includes(`redux`)||e.append(`line`).attr(`class`,`node-line-`+n).attr(`x1`,0).attr(`y1`,t.height).attr(`x2`,t.width).attr(`y2`,t.height)},`defaultBkg`),U={drawRect:I,drawCircle:ne,drawSection:R,drawText:L,drawLabel:re,drawTask:ie,drawBackgroundRect:ae,getTextObj:oe,getNoteRect:B,initGraphics:se,drawNode:ce,getVirtualNodeHeight:le},de=e(function(e,t,i,o){let s=d(),{look:c,theme:l,themeVariables:u}=s,{useGradient:f,gradientStart:p,gradientStop:m}=u,h=s.timeline?.leftMargin??50;n.debug(`timeline`,o.db);let g=s.securityLevel,_;g===`sandbox`&&(_=r(`#i`+t));let v=r(g===`sandbox`?_.nodes()[0].contentDocument.body:`body`).select(`#`+t);v.append(`g`);let y=o.db.getTasks(),b=o.db.getCommonDb().getDiagramTitle();n.debug(`task`,y),U.initGraphics(v,t);let x=o.db.getSections();n.debug(`sections`,x);let S=0,C=0,w=0,T=0,E=50+h,D=50;T=50;let O=0,k=!0;x.forEach(function(e){let t={number:O,descr:e,section:O,width:150,padding:20,maxHeight:S},r=U.getVirtualNodeHeight(v,t,s);n.debug(`sectionHeight before draw`,r),S=Math.max(S,r+20)});let A=0,j=0;n.debug(`tasks.length`,y.length);for(let[e,t]of y.entries()){let r={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:C},i=U.getVirtualNodeHeight(v,r,s);n.debug(`taskHeight before draw`,i),C=Math.max(C,i+20),A=Math.max(A,t.events.length);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=U.getVirtualNodeHeight(v,n,s)}t.events.length>0&&(a+=(t.events.length-1)*10),j=Math.max(j,a)}n.debug(`maxSectionHeight before draw`,S),n.debug(`maxTaskHeight before draw`,C),x&&x.length>0?x.forEach(e=>{let r=y.filter(t=>t.section===e),i={number:O,descr:e,section:O,width:200*Math.max(r.length,1)-50,padding:20,maxHeight:S};n.debug(`sectionNode`,i);let a=v.append(`g`),o=U.drawNode(a,i,O,s,t);n.debug(`sectionNode output`,o),a.attr(`transform`,`translate(${E}, ${T})`),D+=S+50,r.length>0&&W(v,r,O,E,D,C,s,A,j,S,!1,t),E+=200*Math.max(r.length,1),D=T,O++}):(k=!1,W(v,y,O,E,D,C,s,A,j,S,!0,t));let M=v.node().getBBox();if(n.debug(`bounds`,M),b&&v.append(`text`).text(b).attr(`x`,c===`neo`?M.x*2+h:M.width/2-h).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),w=k?S+C+150:C+100,v.append(`g`).attr(`class`,`lineWrapper`).append(`line`).attr(`x1`,h).attr(`y1`,w).attr(`x2`,M.width+3*h).attr(`y2`,w).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#${t}-arrowhead)`),c===`neo`&&f&&l!==`neutral`){let e=v.select(`defs`),t=(e.empty()?v.append(`defs`):e).append(`linearGradient`).attr(`id`,v.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,p).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,m).attr(`stop-opacity`,1)}a(void 0,v,s.timeline?.padding??50,s.timeline?.useMaxWidth??!1)},`draw`),W=e(function(e,t,r,i,a,o,s,c,l,u,d,f){for(let c of t){let t={descr:c.task,section:r,number:r,width:150,padding:20,maxHeight:o};n.debug(`taskNode`,t);let u=e.append(`g`).attr(`class`,`taskWrapper`),p=U.drawNode(u,t,r,s,f).height;if(n.debug(`taskHeight after draw`,p),u.attr(`transform`,`translate(${i}, ${a})`),o=Math.max(o,p),c.events){let t=e.append(`g`).attr(`class`,`lineWrapper`),n=o;a+=100,n+=fe(e,c.events,r,i,a,s,f),a-=100,t.append(`line`).attr(`x1`,i+190/2).attr(`y1`,a+o).attr(`x2`,i+190/2).attr(`y2`,a+o+100+l+100).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#${f}-arrowhead)`).attr(`stroke-dasharray`,`5,5`)}i+=200,d&&!s.timeline?.disableMulticolor&&r++}a-=10},`drawTasks`),fe=e(function(e,t,r,i,a,o,s){let c=0,l=a;a+=100;for(let l of t){let t={descr:l,section:r,number:r,width:150,padding:20,maxHeight:50};n.debug(`eventNode`,t);let u=e.append(`g`).attr(`class`,`eventWrapper`),d=U.drawNode(u,t,r,o,s,!0).height;c+=d,u.attr(`transform`,`translate(${i}, ${a})`),a=a+10+d}return a=l,c},`drawEvents`),pe={setConf:e(()=>{},`setConf`),draw:de},G=200,K=5,me=G+K*2,q=G+100,he=q+K*2,J=10,ge=0,Y=20,X=20,Z=30,Q=50,_e=e(function(e,t,r,i){let o=d(),s=o.timeline?.leftMargin??50;n.debug(`timeline`,i.db);let c=m(t);c.append(`g`);let l=i.db.getTasks(),u=i.db.getCommonDb().getDiagramTitle();n.debug(`task`,l),U.initGraphics(c);let f=i.db.getSections();n.debug(`sections`,f);let h=0,g=0,_=50+s,v=50,y=v,b=_,x=me+X,S=he+Q,C=b+x,w=0,T=f&&f.length>0,E=T?C:_+x,D=Math.max(50,x+S-K*2);f.forEach(function(e){let t={number:w,descr:e,section:w,width:D,padding:K,maxHeight:h},r=U.getVirtualNodeHeight(c,t,o);n.debug(`sectionHeight before draw`,r),h=Math.max(h,r)});let O=0;n.debug(`tasks.length`,l.length);for(let[e,t]of l.entries()){let r={number:e,descr:t,section:t.section,width:G,padding:K,maxHeight:g},i=U.getVirtualNodeHeight(c,r,o);n.debug(`taskHeight before draw`,i),g=Math.max(g,i);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:q,padding:K,maxHeight:50};a+=U.getVirtualNodeHeight(c,n,o)}t.events.length>0&&(a+=(t.events.length-1)*J),O=Math.max(O,a)+ge}n.debug(`maxSectionHeight before draw`,h),n.debug(`maxTaskHeight before draw`,g);let k=Math.max(g,O)+Z;T?f.forEach(e=>{let t=l.filter(t=>t.section===e),r={number:w,descr:e,section:w,width:D,padding:K,maxHeight:h};n.debug(`sectionNode`,r);let i=c.append(`g`),a=U.drawNode(i,r,w,o);n.debug(`sectionNode output`,a);let s=E-x;i.attr(`transform`,`translate(${s}, ${v})`);let u=v+a.height+Y;t.length>0&&$(c,t,w,E,u,g,o,k,!1);let d=t.length,f=a.height+Y+k*Math.max(d,1)-(d>0?Z*2:0);v+=f,w++}):$(c,l,w,E,v,g,o,k,!0);let A=c.node()?.getBBox();if(!A)throw Error(`bbox not found`);if(n.debug(`bounds`,A),u){if(c.append(`text`).text(u).attr(`x`,A.width/2-s).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),A=c.node()?.getBBox(),!A)throw Error(`bbox not found`);n.debug(`bounds after title`,A)}let[j]=p(o.fontSize),M=(j??16)*2,N=(j??16)*.5+20,P=c.append(`g`).attr(`class`,`lineWrapper`);P.append(`line`).attr(`x1`,E).attr(`y1`,y-M).attr(`x2`,E).attr(`y2`,A.y+A.height+N).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`),P.lower(),a(void 0,c,o.timeline?.padding??50,o.timeline?.useMaxWidth??!1)},`draw`),$=e(function(e,t,r,i,a,o,s,c,l){for(let u of t){let t={descr:u.task,section:r,number:r,width:G,padding:K,maxHeight:o};n.debug(`taskNode`,t);let d=e.append(`g`).attr(`class`,`taskWrapper`),f=U.drawNode(d,t,r,s),p=f.height;n.debug(`taskHeight after draw`,p);let m=i-X-f.width;if(d.attr(`transform`,`translate(${m}, ${a})`),o=Math.max(o,p),u.events&&u.events.length>0){let t=a,n=i+Q;ve(e,u.events,r,i,n,t,s)}a+=c,l&&!s.timeline?.disableMulticolor&&r++}},`drawTasks`),ve=e(function(e,t,r,i,a,o,s){let c=o;for(let o of t){let t={descr:o,section:r,number:r,width:q,padding:K,maxHeight:0};n.debug(`eventNode`,t);let l=e.append(`g`).attr(`class`,`eventWrapper`),u=U.drawNode(l,t,r,s).height;l.attr(`transform`,`translate(${a}, ${c})`);let d=e.append(`g`).attr(`class`,`lineWrapper`),f=c+u/2;d.append(`line`).attr(`x1`,i).attr(`y1`,f).attr(`x2`,a).attr(`y2`,f).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`).attr(`stroke-dasharray`,`5,5`),c=c+u+J}return c-o},`drawEvents`),ye={setConf:e(()=>{},`setConf`),draw:_e},be=e(e=>{let{theme:t}=s(),n=t?.includes(`dark`),r=t?.includes(`color`),i=e.svgId?.replace(/^#/,``)??``,a=i?`url(#${i}-drop-shadow)`:e.dropShadow??`none`,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let i=`${17-3*t}`,s=r?e.borderColorArray[t]:e.mainBkg,c=r?e.borderColorArray[t]:e.nodeBorder;o+=`
5
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin(`acc_title`),15;case 10:return this.popState(),`acc_title_value`;case 11:return this.begin(`acc_descr`),17;case 12:return this.popState(),`acc_descr_value`;case 13:this.begin(`acc_descr_multiline`);break;case 14:this.popState();break;case 15:return`acc_descr_multiline_value`;case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}})();function d(){this.yy={}}return e(d,`Parser`),d.prototype=u,u.Parser=d,new d})();h.parser=h;var g=h,_={};t(_,{addEvent:()=>M,addSection:()=>O,addTask:()=>j,addTaskOrg:()=>N,clear:()=>T,default:()=>ee,getCommonDb:()=>w,getDirection:()=>D,getSections:()=>k,getTasks:()=>A,setDirection:()=>E});var v=``,y=0,b=`LR`,x=[],S=[],C=[],w=e(()=>u,`getCommonDb`),T=e(function(){x.length=0,S.length=0,v=``,C.length=0,b=`LR`,o()},`clear`),E=e(function(e){b=e},`setDirection`),D=e(function(){return b},`getDirection`),O=e(function(e){v=e,x.push(e)},`addSection`),k=e(function(){return x},`getSections`),A=e(function(){let e=P(),t=0;for(;!e&&t<100;)e=P(),t++;return S.push(...C),S},`getTasks`),j=e(function(e,t,n){let r={id:y++,section:v,type:v,task:e,score:t||0,events:n?[n]:[]};C.push(r)},`addTask`),M=e(function(e){C.find(e=>e.id===y-1).events.push(e)},`addEvent`),N=e(function(e){let t={section:v,type:v,description:e,task:e,classes:[]};S.push(t)},`addTaskOrg`),P=e(function(){let t=e(function(e){return C[e].processed},`compileTask`),n=!0;for(let[e,r]of C.entries())t(e),n&&=r.processed;return n},`compileTasks`),ee={clear:T,getCommonDb:w,getDirection:D,setDirection:E,addSection:O,getSections:k,getTasks:A,addTask:j,addTaskOrg:N,addEvent:M},F=0,I=e(function(e,t){let n=e.append(`rect`);return n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),n.attr(`rx`,t.rx),n.attr(`ry`,t.ry),t.class!==void 0&&n.attr(`class`,t.class),n},`drawRect`),te=e(function(t,n){let r=t.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=t.append(`g`);i.append(`circle`).attr(`cx`,n.cx-15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}e(a,`smile`);function o(e){let t=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}e(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),ne=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),L=e(function(e,t){let n=t.text.replace(/<br\s*\/?>/gi,` `),r=e.append(`text`);r.attr(`x`,t.x),r.attr(`y`,t.y),r.attr(`class`,`legend`),r.style(`text-anchor`,t.anchor),t.class!==void 0&&r.attr(`class`,t.class);let i=r.append(`tspan`);return i.attr(`x`,t.x+t.textMargin*2),i.text(n),r},`drawText`),re=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,L(t,n)},`drawLabel`),R=e(function(e,t,n){let r=e.append(`g`),i=B();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,I(r,i),V(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,ie=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),te(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=B();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,I(a,o),V(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),ae=e(function(e,t){I(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:`rect`}).lower()},`drawBackgroundRect`),oe=e(function(){return{x:0,y:0,fill:void 0,"text-anchor":`start`,width:100,height:100,textMargin:0,rx:0,ry:0}},`getTextObj`),B=e(function(){return{x:0,y:0,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),V=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),se=e(function(e,t){F=0,z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`);function H(e,t){e.each(function(){var e=r(this),n=e.text().split(/(\s+|<br>)/).reverse(),i,a=[],o=1.1,s=e.attr(`y`),c=parseFloat(e.attr(`dy`)),l=e.text(null).append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,c+`em`);for(let r=0;r<n.length;r++)i=n[n.length-1-r],a.push(i),l.text(a.join(` `).trim()),(l.node().getComputedTextLength()>t||i===`<br>`)&&(a.pop(),l.text(a.join(` `).trim()),a=i===`<br>`?[``]:[i],l=e.append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,o+`em`).text(i))})}e(H,`wrap`);var ce=e(function(e,t,n,i,a,o=!1){let{theme:s,look:c}=i,l=s?.includes(`redux`),u=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=e.append(`g`);t.section=u,d.attr(`class`,(t.class?t.class+` `:``)+`timeline-node `+(`section-`+u));let f=d.append(`g`),p=d.append(`g`),m=p.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(H,t.width).node().getBBox(),h=i.fontSize?.replace?i.fontSize.replace(`px`,``):i.fontSize;if(t.height=m.height+h*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width+=2*t.padding,p.attr(`transform`,`translate(`+t.width/2+`, `+t.padding/2+`)`),l&&p.attr(`transform`,`translate(${t.width/2}, ${o?t.padding/2+3:t.padding})`),ue(f,t,u,a,i),c===`neo`&&(d.attr(`data-look`,`neo`),l)){let t=s.includes(`dark`),n=e.node()?.ownerSVGElement??e.node(),i=r(n),a=i.attr(`id`)??``,o=a?`${a}-drop-shadow`:`drop-shadow`;if(i.select(`#${o}`).empty()){let e=i.select(`defs`);(e.empty()?i.append(`defs`):e).append(`filter`).attr(`id`,o).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,t?`0.2`:`0.06`).attr(`flood-color`,t?`#FFFFFF`:`#000000`)}}return t},`drawNode`),le=e(function(e,t,n){let r=e.append(`g`),i=r.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(H,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace(`px`,``):n.fontSize;return r.remove(),i.height+a*1.1*.5+t.padding},`getVirtualNodeHeight`),ue=e(function(e,t,n,r,i){let{theme:a}=i,o=a?.includes(`redux`)?0:5,s=o>0?`M0 ${t.height-5} v${-t.height+10} q0,-${o},${o},-${o} h${t.width-10} q${o},0,${o},${o} v${t.height-5} H0 Z`:`M0 ${t.height-5} v${-(t.height-5)} h${t.width} v${t.height} H0 Z`;e.append(`path`).attr(`id`,r+`-node-`+F++).attr(`class`,`node-bkg node-`+t.type).attr(`d`,s),a?.includes(`redux`)||e.append(`line`).attr(`class`,`node-line-`+n).attr(`x1`,0).attr(`y1`,t.height).attr(`x2`,t.width).attr(`y2`,t.height)},`defaultBkg`),U={drawRect:I,drawCircle:ne,drawSection:R,drawText:L,drawLabel:re,drawTask:ie,drawBackgroundRect:ae,getTextObj:oe,getNoteRect:B,initGraphics:se,drawNode:ce,getVirtualNodeHeight:le},de=e(function(e,t,i,o){let s=d(),{look:c,theme:l,themeVariables:u}=s,{useGradient:f,gradientStart:p,gradientStop:m}=u,h=s.timeline?.leftMargin??50;n.debug(`timeline`,o.db);let g=s.securityLevel,_;g===`sandbox`&&(_=r(`#i`+t));let v=r(g===`sandbox`?_.nodes()[0].contentDocument.body:`body`).select(`#`+t);v.append(`g`);let y=o.db.getTasks(),b=o.db.getCommonDb().getDiagramTitle();n.debug(`task`,y),U.initGraphics(v,t);let x=o.db.getSections();n.debug(`sections`,x);let S=0,C=0,w=0,T=0,E=50+h,D=50;T=50;let O=0,k=!0;x.forEach(function(e){let t={number:O,descr:e,section:O,width:150,padding:20,maxHeight:S},r=U.getVirtualNodeHeight(v,t,s);n.debug(`sectionHeight before draw`,r),S=Math.max(S,r+20)});let A=0,j=0;n.debug(`tasks.length`,y.length);for(let[e,t]of y.entries()){let r={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:C},i=U.getVirtualNodeHeight(v,r,s);n.debug(`taskHeight before draw`,i),C=Math.max(C,i+20),A=Math.max(A,t.events.length);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=U.getVirtualNodeHeight(v,n,s)}t.events.length>0&&(a+=(t.events.length-1)*10),j=Math.max(j,a)}n.debug(`maxSectionHeight before draw`,S),n.debug(`maxTaskHeight before draw`,C),x&&x.length>0?x.forEach(e=>{let r=y.filter(t=>t.section===e),i={number:O,descr:e,section:O,width:200*Math.max(r.length,1)-50,padding:20,maxHeight:S};n.debug(`sectionNode`,i);let a=v.append(`g`),o=U.drawNode(a,i,O,s,t);n.debug(`sectionNode output`,o),a.attr(`transform`,`translate(${E}, ${T})`),D+=S+50,r.length>0&&W(v,r,O,E,D,C,s,A,j,S,!1,t),E+=200*Math.max(r.length,1),D=T,O++}):(k=!1,W(v,y,O,E,D,C,s,A,j,S,!0,t));let M=v.node().getBBox();if(n.debug(`bounds`,M),b&&v.append(`text`).text(b).attr(`x`,c===`neo`?M.x*2+h:M.width/2-h).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),w=k?S+C+150:C+100,v.append(`g`).attr(`class`,`lineWrapper`).append(`line`).attr(`x1`,h).attr(`y1`,w).attr(`x2`,M.width+3*h).attr(`y2`,w).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#${t}-arrowhead)`),c===`neo`&&f&&l!==`neutral`){let e=v.select(`defs`),t=(e.empty()?v.append(`defs`):e).append(`linearGradient`).attr(`id`,v.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,p).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,m).attr(`stop-opacity`,1)}a(void 0,v,s.timeline?.padding??50,s.timeline?.useMaxWidth??!1)},`draw`),W=e(function(e,t,r,i,a,o,s,c,l,u,d,f){for(let c of t){let t={descr:c.task,section:r,number:r,width:150,padding:20,maxHeight:o};n.debug(`taskNode`,t);let u=e.append(`g`).attr(`class`,`taskWrapper`),p=U.drawNode(u,t,r,s,f).height;if(n.debug(`taskHeight after draw`,p),u.attr(`transform`,`translate(${i}, ${a})`),o=Math.max(o,p),c.events){let t=e.append(`g`).attr(`class`,`lineWrapper`),n=o;a+=100,n+=fe(e,c.events,r,i,a,s,f),a-=100,t.append(`line`).attr(`x1`,i+190/2).attr(`y1`,a+o).attr(`x2`,i+190/2).attr(`y2`,a+o+100+l+100).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#${f}-arrowhead)`).attr(`stroke-dasharray`,`5,5`)}i+=200,d&&!s.timeline?.disableMulticolor&&r++}a-=10},`drawTasks`),fe=e(function(e,t,r,i,a,o,s){let c=0,l=a;a+=100;for(let l of t){let t={descr:l,section:r,number:r,width:150,padding:20,maxHeight:50};n.debug(`eventNode`,t);let u=e.append(`g`).attr(`class`,`eventWrapper`),d=U.drawNode(u,t,r,o,s,!0).height;c+=d,u.attr(`transform`,`translate(${i}, ${a})`),a=a+10+d}return a=l,c},`drawEvents`),pe={setConf:e(()=>{},`setConf`),draw:de},G=200,K=5,me=G+K*2,q=G+100,he=q+K*2,J=10,ge=0,Y=20,X=20,Z=30,Q=50,_e=e(function(e,t,r,i){let o=d(),s=o.timeline?.leftMargin??50;n.debug(`timeline`,i.db);let c=m(t);c.append(`g`);let l=i.db.getTasks(),u=i.db.getCommonDb().getDiagramTitle();n.debug(`task`,l),U.initGraphics(c);let f=i.db.getSections();n.debug(`sections`,f);let h=0,g=0,_=50+s,v=50,y=v,b=_,x=me+X,S=he+Q,C=b+x,w=0,T=f&&f.length>0,E=T?C:_+x,D=Math.max(50,x+S-K*2);f.forEach(function(e){let t={number:w,descr:e,section:w,width:D,padding:K,maxHeight:h},r=U.getVirtualNodeHeight(c,t,o);n.debug(`sectionHeight before draw`,r),h=Math.max(h,r)});let O=0;n.debug(`tasks.length`,l.length);for(let[e,t]of l.entries()){let r={number:e,descr:t,section:t.section,width:G,padding:K,maxHeight:g},i=U.getVirtualNodeHeight(c,r,o);n.debug(`taskHeight before draw`,i),g=Math.max(g,i);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:q,padding:K,maxHeight:50};a+=U.getVirtualNodeHeight(c,n,o)}t.events.length>0&&(a+=(t.events.length-1)*J),O=Math.max(O,a)+ge}n.debug(`maxSectionHeight before draw`,h),n.debug(`maxTaskHeight before draw`,g);let k=Math.max(g,O)+Z;T?f.forEach(e=>{let t=l.filter(t=>t.section===e),r={number:w,descr:e,section:w,width:D,padding:K,maxHeight:h};n.debug(`sectionNode`,r);let i=c.append(`g`),a=U.drawNode(i,r,w,o);n.debug(`sectionNode output`,a);let s=E-x;i.attr(`transform`,`translate(${s}, ${v})`);let u=v+a.height+Y;t.length>0&&$(c,t,w,E,u,g,o,k,!1);let d=t.length,f=a.height+Y+k*Math.max(d,1)-(d>0?Z*2:0);v+=f,w++}):$(c,l,w,E,v,g,o,k,!0);let A=c.node()?.getBBox();if(!A)throw Error(`bbox not found`);if(n.debug(`bounds`,A),u){if(c.append(`text`).text(u).attr(`x`,A.width/2-s).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),A=c.node()?.getBBox(),!A)throw Error(`bbox not found`);n.debug(`bounds after title`,A)}let[j]=p(o.fontSize),M=(j??16)*2,N=(j??16)*.5+20,P=c.append(`g`).attr(`class`,`lineWrapper`);P.append(`line`).attr(`x1`,E).attr(`y1`,y-M).attr(`x2`,E).attr(`y2`,A.y+A.height+N).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`),P.lower(),a(void 0,c,o.timeline?.padding??50,o.timeline?.useMaxWidth??!1)},`draw`),$=e(function(e,t,r,i,a,o,s,c,l){for(let u of t){let t={descr:u.task,section:r,number:r,width:G,padding:K,maxHeight:o};n.debug(`taskNode`,t);let d=e.append(`g`).attr(`class`,`taskWrapper`),f=U.drawNode(d,t,r,s),p=f.height;n.debug(`taskHeight after draw`,p);let m=i-X-f.width;if(d.attr(`transform`,`translate(${m}, ${a})`),o=Math.max(o,p),u.events&&u.events.length>0){let t=a,n=i+Q;ve(e,u.events,r,i,n,t,s)}a+=c,l&&!s.timeline?.disableMulticolor&&r++}},`drawTasks`),ve=e(function(e,t,r,i,a,o,s){let c=o;for(let o of t){let t={descr:o,section:r,number:r,width:q,padding:K,maxHeight:0};n.debug(`eventNode`,t);let l=e.append(`g`).attr(`class`,`eventWrapper`),u=U.drawNode(l,t,r,s).height;l.attr(`transform`,`translate(${a}, ${c})`);let d=e.append(`g`).attr(`class`,`lineWrapper`),f=c+u/2;d.append(`line`).attr(`x1`,i).attr(`y1`,f).attr(`x2`,a).attr(`y2`,f).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`).attr(`stroke-dasharray`,`5,5`),c=c+u+J}return c-o},`drawEvents`),ye={setConf:e(()=>{},`setConf`),draw:_e},be=e(e=>{let{theme:t}=s(),n=t?.includes(`dark`),r=t?.includes(`color`),i=e.svgId?.replace(/^#/,``)??``,a=i?`url(#${i}-drop-shadow)`:e.dropShadow??`none`,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let i=`${17-3*t}`,s=r?e.borderColorArray[t]:e.mainBkg,c=r?e.borderColorArray[t]:e.nodeBorder;o+=`
7
7
  .section-${t-1} rect,
8
8
  .section-${t-1} path,
9
9
  .section-${t-1} circle {
@@ -1,14 +1,14 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as t}from"./src-Cz8bXOH0.js";import{$ as n,H as r,K as i,U as a,a as o,b as s,c,et as l,f as u,nt as d,tt as f,v as p,w as m,y as h}from"./chunk-WYO6CB5R-BQDKJ2Op.js";import{i as g}from"./chunk-ICXQ74PX-C1naCh7h.js";import{t as _}from"./chunk-VAUOI2AC-IC4V3R7w.js";import{t as v}from"./rough.esm-CSKSodPl.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as t}from"./src-BY_WSiz7.js";import{$ as n,H as r,K as i,U as a,a as o,b as s,c,et as l,f as u,nt as d,tt as f,v as p,w as m,y as h}from"./chunk-WYO6CB5R-B91ryJFB.js";import{i as g}from"./chunk-ICXQ74PX-COcWu1Sq.js";import{t as _}from"./chunk-VAUOI2AC-BlqTQL33.js";import{t as v}from"./rough.esm-By172zw-.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
2
2
  M`,e,t),r.push(`
3
3
  m`,-n,0),r.push(`
4
4
  a`,n,n,0,1,0,n*2,0),r.push(`
5
5
  a`,n,n,0,1,0,-n*2,0),r.join(` `)}function be(e){let t=e.split(` `);return{x:Number.parseFloat(t[1]),y:Number.parseFloat(t[2]),radius:-Number.parseFloat(t[4])}}function xe(e){if(e.length===0)return[];let t={};return x(e,t),t.arcs}function Se(e,t){if(e.length===0)return`M 0 0`;let n=10**(t||0),r=t==null?e=>e:e=>Math.round(e*n)/n;if(e.length==1){let t=e[0].circle;return ye(r(t.x),r(t.y),r(t.radius))}let i=[`
6
6
  M`,r(e[0].p2.x),r(e[0].p2.y)];for(let t of e){let e=r(t.circle.radius);i.push(`
7
- A`,e,e,0,+!!t.large,+!!t.sweep,r(t.p1.x),r(t.p1.y))}return i.join(` `)}function Ce(e,t){return Se(xe(e),t)}function we(e,t={}){let{lossFunction:n,layoutFunction:r=ee,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:o,width:s=600,height:c=350,padding:l=15,scaleToFit:u=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=t,m=r(e,{lossFunction:n==="default"||!n?B:n===`logRatio`?ce:n,distinct:f});i&&(m=de(m,a,o));let h=fe(m,s,c,l,u),g=ve(h,e,d),_=new Map(Object.keys(h).map(e=>[e,{set:e,x:h[e].x,y:h[e].y,radius:h[e].radius}])),v=e.map(e=>{let t=e.sets.map(e=>_.get(e)),n=xe(t);return{circles:t,arcs:n,path:Se(n,p),area:e,has:new Set(e.sets)}});function y(e){let t=``;for(let n of v)n.has.size>e.length&&e.every(e=>n.has.has(e))&&(t+=` `+n.path);return t}return v.map(({circles:e,arcs:t,path:n,area:r})=>({data:r,text:g[r.sets],circles:e,arcs:t,path:n,distinctPath:n+y(r.sets)}))}var W=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[5,8],r=[7,8,11,12,17,19,22,24],i=[1,17],a=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],c=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],d=[1,56],f=[1,58],p=[1,59],m=[1,60],h=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],g={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:`error`,5:`VENN`,7:`EOF`,8:`NEWLINE`,11:`TITLE`,12:`SET`,14:`BRACKET_LABEL`,15:`COLON`,16:`NUMERIC`,17:`UNION`,19:`TEXT`,20:`IDENTIFIER`,21:`STRING`,22:`INDENT_TEXT`,24:`STYLE`,27:`COMMA`,31:`HEXCOLOR`,32:`RGBCOLOR`,33:`RGBACOLOR`},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 3:case 4:this.$=[];break;case 5:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=a[s];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:r.addSubsetData([a[s]],void 0,void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 10:r.addSubsetData([a[s-1]],a[s],void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 11:r.addSubsetData([a[s-2]],void 0,parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 12:r.addSubsetData([a[s-3]],a[s-2],parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 13:if(a[s].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s]),r.addSubsetData(a[s],void 0,void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 14:if(a[s-1].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s-1]),r.addSubsetData(a[s-1],a[s],void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 15:if(a[s-2].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s-2]),r.addSubsetData(a[s-2],void 0,parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 16:if(a[s-3].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s-3]),r.addSubsetData(a[s-3],a[s-2],parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 17:case 18:case 19:r.addTextData(a[s-1],a[s],void 0);break;case 20:case 21:r.addTextData(a[s-2],a[s-1],a[s]);break;case 23:r.addStyleData(a[s-1],a[s]);break;case 24:case 25:case 26:var c=r.getCurrentSets();if(!c)throw Error(`text requires set`);r.addTextData(c,a[s],void 0);break;case 27:case 28:var c=r.getCurrentSets();if(!c)throw Error(`text requires set`);r.addTextData(c,a[s-1],a[s]);break;case 29:case 41:this.$=[a[s]];break;case 30:case 42:this.$=[...a[s-2],a[s]];break;case 31:this.$=[a[s-2],a[s]];break;case 33:this.$=a[s].join(` `);break;case 34:this.$=[a[s]];break;case 35:a[s-1].push(a[s]),this.$=a[s-1];break;case 43:case 44:this.$=a[s];break}},`anonymous`),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:i,21:a},{13:20,18:19,20:i,21:a},{13:20,18:21,20:i,21:a},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:i,21:a},t(r,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:c,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:i,21:a},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(o,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:c,26:51},{16:u,20:d,21:[1,53],28:52,29:54,30:55,31:f,32:p,33:m},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:d,31:f,32:p,33:m}),t(h,[2,34]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),t(h,[2,39]),t(h,[2,40]),t(h,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
7
+ A`,e,e,0,+!!t.large,+!!t.sweep,r(t.p1.x),r(t.p1.y))}return i.join(` `)}function Ce(e,t){return Se(xe(e),t)}function we(e,t={}){let{lossFunction:n,layoutFunction:r=ee,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:o,width:s=600,height:c=350,padding:l=15,scaleToFit:u=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=t,m=r(e,{lossFunction:n==="default"||!n?B:n===`logRatio`?ce:n,distinct:f});i&&(m=de(m,a,o));let h=fe(m,s,c,l,u),g=ve(h,e,d),_=new Map(Object.keys(h).map(e=>[e,{set:e,x:h[e].x,y:h[e].y,radius:h[e].radius}])),v=e.map(e=>{let t=e.sets.map(e=>_.get(e)),n=xe(t);return{circles:t,arcs:n,path:Se(n,p),area:e,has:new Set(e.sets)}});function y(e){let t=``;for(let n of v)n.has.size>e.length&&e.every(e=>n.has.has(e))&&(t+=` `+n.path);return t}return v.map(({circles:e,arcs:t,path:n,area:r})=>({data:r,text:g[r.sets],circles:e,arcs:t,path:n,distinctPath:n+y(r.sets)}))}var W=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[5,8],r=[7,8,11,12,17,19,22,24],i=[1,17],a=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],c=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],d=[1,56],f=[1,58],p=[1,59],m=[1,60],h=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],g={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:`error`,5:`VENN`,7:`EOF`,8:`NEWLINE`,11:`TITLE`,12:`SET`,14:`BRACKET_LABEL`,15:`COLON`,16:`NUMERIC`,17:`UNION`,19:`TEXT`,20:`IDENTIFIER`,21:`STRING`,22:`INDENT_TEXT`,24:`STYLE`,27:`COMMA`,31:`HEXCOLOR`,32:`RGBCOLOR`,33:`RGBACOLOR`},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 3:case 4:this.$=[];break;case 5:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=a[s];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:r.addSubsetData([a[s]],void 0,void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 10:r.addSubsetData([a[s-1]],a[s],void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 11:r.addSubsetData([a[s-2]],void 0,parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 12:r.addSubsetData([a[s-3]],a[s-2],parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 13:if(a[s].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s]),r.addSubsetData(a[s],void 0,void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 14:if(a[s-1].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s-1]),r.addSubsetData(a[s-1],a[s],void 0),r.setIndentMode&&r.setIndentMode(!0);break;case 15:if(a[s-2].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s-2]),r.addSubsetData(a[s-2],void 0,parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 16:if(a[s-3].length<2)throw Error(`union requires multiple identifiers`);r.validateUnionIdentifiers&&r.validateUnionIdentifiers(a[s-3]),r.addSubsetData(a[s-3],a[s-2],parseFloat(a[s])),r.setIndentMode&&r.setIndentMode(!0);break;case 17:case 18:case 19:r.addTextData(a[s-1],a[s],void 0);break;case 20:case 21:r.addTextData(a[s-2],a[s-1],a[s]);break;case 23:r.addStyleData(a[s-1],a[s]);break;case 24:case 25:case 26:var c=r.getCurrentSets();if(!c)throw Error(`text requires set`);r.addTextData(c,a[s],void 0);break;case 27:case 28:var c=r.getCurrentSets();if(!c)throw Error(`text requires set`);r.addTextData(c,a[s-1],a[s]);break;case 29:case 41:this.$=[a[s]];break;case 30:case 42:this.$=[...a[s-2],a[s]];break;case 31:this.$=[a[s-2],a[s]];break;case 33:this.$=a[s].join(` `);break;case 34:this.$=[a[s]];break;case 35:a[s-1].push(a[s]),this.$=a[s-1];break;case 43:case 44:this.$=a[s]}},`anonymous`),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:i,21:a},{13:20,18:19,20:i,21:a},{13:20,18:21,20:i,21:a},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:i,21:a},t(r,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:c,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:i,21:a},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(o,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:c,26:51},{16:u,20:d,21:[1,53],28:52,29:54,30:55,31:f,32:p,33:m},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:d,31:f,32:p,33:m}),t(h,[2,34]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),t(h,[2,39]),t(h,[2,40]),t(h,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
8
8
  `+h.showPosition()+`
9
9
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};g.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
10
10
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
11
- `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
11
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
12
12
  `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:break;case 3:if(e.getIndentMode&&e.getIndentMode())return e.consumeIndentText=!0,this.begin(`INITIAL`),22;break;case 4:break;case 5:e.setIndentMode&&e.setIndentMode(!1),this.begin(`INITIAL`),this.unput(t.yytext);break;case 6:return this.begin(`bol`),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(e.consumeIndentText)e.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return t.yytext=t.yytext.slice(2,-2),14;case 17:return t.yytext=t.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}})();function _(){this.yy={}}return e(_,`Parser`),_.prototype=g,g.Parser=_,new _})();W.parser=W;var Te=W,G=[],K=[],q=[],J=new Set,Y,X=!1,Ee=e((e,t,n)=>{let r=Q(e).sort(),i=n??10/e.length**2;Y=r,r.length===1&&J.add(r[0]),G.push({sets:r,size:i,label:t?Z(t):void 0})},`addSubsetData`),De=e(()=>G,`getSubsetData`),Z=e(e=>{let t=e.trim();return t.length>=2&&t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t},`normalizeText`),Oe=e(e=>e&&Z(e),`normalizeStyleValue`),ke=e((e,t,n)=>{let r=Z(t);K.push({sets:Q(e).sort(),id:r,label:n?Z(n):void 0})},`addTextData`),Ae=e((e,t)=>{let n=Q(e).sort(),r={};for(let[e,n]of t)r[e]=Oe(n)??n;q.push({targets:n,styles:r})},`addStyleData`),je=e(()=>q,`getStyleData`),Q=e(e=>e.map(e=>Z(e)),`normalizeIdentifierList`),Me=e(e=>{let t=Q(e).filter(e=>!J.has(e));if(t.length>0)throw Error(`unknown set identifier: ${t.join(`, `)}`)},`validateUnionIdentifiers`),Ne=e(()=>K,`getTextData`),Pe=e(()=>Y,`getCurrentSets`),Fe=e(()=>X,`getIndentMode`),Ie=e(e=>{X=e},`setIndentMode`),Le=u.venn;function Re(){return g(Le,s().venn)}e(Re,`getConfig`);var ze={getConfig:Re,clear:e(()=>{o(),G.length=0,K.length=0,q.length=0,J.clear(),Y=void 0,X=!1},`customClear`),setAccTitle:a,getAccTitle:h,setDiagramTitle:i,getDiagramTitle:m,getAccDescription:p,setAccDescription:r,addSubsetData:Ee,getSubsetData:De,addTextData:ke,addStyleData:Ae,validateUnionIdentifiers:Me,getTextData:Ne,getStyleData:je,getCurrentSets:Pe,getIndentMode:Fe,setIndentMode:Ie},Be=e(e=>`
13
13
  .venn-title {
14
14
  font-size: 32px;
@@ -0,0 +1 @@
1
+ import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{a as n,i as r,n as i,r as a,t as o}from"./bundle-mjs-CSP5ngA5.js";var s=e(n(),1),c={};function l(e,t){let n=s.useRef(c);return n.current===c&&(n.current=e(t)),n}var u=e(r(),1),d=[],f=void 0;function p(){return f}function m(e){d.push(e)}function h(e){let t=(t,n)=>{let r=l(_).current,i;try{f=r;for(let e of d)e.before(r);i=e(t,n);for(let e of d)e.after(r);r.didInitialize=!0}finally{f=void 0}return i};return t.displayName=e.displayName||e.name,t}function g(e){return s.forwardRef(h(e))}function _(){return{didInitialize:!1}}function v(){}var y=Object.freeze([]),b=Object.freeze({}),x=typeof document<`u`?s.useLayoutEffect:()=>{};function S(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var C=S(`https://base-ui.com/production-error`,`Base UI`);function w(e){s.useEffect(e,y)}var T=0,E=class e{static create(){return new e}currentId=T;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=T,t()},e)}isStarted(){return this.currentId!==T}clear=()=>{this.currentId!==T&&(clearTimeout(this.currentId),this.currentId=T)};disposeEffect=()=>this.clear};function D(){let e=l(E.create).current;return w(e.disposeEffect),e}function O(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:k,platform:A,maxTouchPoints:j}=O(),M=k.toLowerCase(),N=A.toLowerCase(),P=/^i(os$|p)/.test(N)||N===`macintel`&&j>1,F=`android`,I=N===F||M.includes(F),L=!P&&N.startsWith(`mac`);N.startsWith(`win`),!I&&/^(linux|chrome os)/.test(N);var R=L||P,z=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),B=!z&&M.includes(`firefox`);!z&&M.includes(`chrom`);var ee=R,te=/jsdom|happydom/.test(M);function ne(e){e.preventDefault(),e.stopPropagation()}function re(e){return`nativeEvent`in e}function V(e){return e.pointerType===``&&e.isTrusted?!0:I&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ie(e){return te?!1:!I&&e.width===0&&e.height===0||I&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ae(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function oe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function se(){return typeof window<`u`}function H(e){return ce(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){return((ce(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ce(e){return se()?e instanceof Node||e instanceof U(e).Node:!1}function G(e){return se()?e instanceof Element||e instanceof U(e).Element:!1}function K(e){return se()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function le(e){return!se()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}function ue(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function de(e){return/^(table|td|th)$/.test(H(e))}function fe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var pe=/transform|translate|scale|rotate|perspective|filter/,me=/paint|layout|strict|content/,q=e=>!!e&&e!==`none`,he;function ge(e){let t=G(e)?J(e):e;return q(t.transform)||q(t.translate)||q(t.scale)||q(t.rotate)||q(t.perspective)||!ve()&&(q(t.backdropFilter)||q(t.filter))||pe.test(t.willChange||``)||me.test(t.contain||``)}function _e(e){let t=xe(e);for(;K(t)&&!ye(t);){if(ge(t))return t;if(fe(t))return null;t=xe(t)}return null}function ve(){return he??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),he}function ye(e){return/^(html|body|#document)$/.test(H(e))}function J(e){return U(e).getComputedStyle(e)}function be(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xe(e){if(H(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||le(e)&&e.host||W(e);return le(t)?t.host:t}function Se(e){let t=xe(e);return ye(t)?(e.ownerDocument||e).body:K(t)&&ue(t)?t:Se(t)}function Ce(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Se(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=we(a);return t.concat(a,a.visualViewport||[],ue(r)?r:[],e&&n?Ce(e):[])}return t.concat(r,Ce(r,[],n))}function we(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Te=`data-base-ui-focusable`,Ee=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,De=`ArrowLeft`,Oe=`ArrowRight`,ke=`ArrowUp`,Ae=`ArrowDown`;function je(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&le(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Me(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ne(e,t){if(!G(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Pe(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Fe(e){return e.matches(`html,body`)}function Ie(e){return K(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Le(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ee}`)!=null}function Re(e){return e?e.getAttribute(`role`)===`combobox`&&Ie(e):!1}function ze(e){if(!e||te)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Be(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var Ve=`none`,He=`trigger-press`,Ue=`trigger-hover`,We=`trigger-focus`,Ge=`outside-press`,Ke=`item-press`,qe=`close-press`,Je=`clear-press`,Ye=`input-change`,Xe=`input-clear`,Ze=`input-press`,Qe=`focus-out`,$e=`escape-key`,et=`list-navigation`,tt=`keyboard`,nt=`pointer`,rt=`cancel-open`,it=`sibling-open`,at=`disabled`,ot=`imperative-action`,st=`window-resize`;function ct(e,t,n,r){let i=!1,a=!1,o=r??b;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function lt(e,t,n){let r=n??b;return{reason:e,event:t??new Event(`base-ui`),...r}}function X(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ut(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function dt(e,t,n,r){let i=l(pt).current;return mt(i,e,t,n,r)&&gt(i,[e,t,n,r]),i.callback}function ft(e){let t=l(pt).current;return ht(t,e)&&gt(t,e),t.callback}function pt(){return{callback:null,cleanup:null,refs:[]}}function mt(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ht(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function gt(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function _t(e){let t=l(vt,e).current;return t.next=e,x(t.effect),t}function vt(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var yt={...s},bt=yt.useInsertionEffect,xt=bt&&bt!==yt.useLayoutEffect?bt:e=>e();function Z(e){let t=l(St).current;return t.next=e,xt(t.effect),t.trampoline}function St(){let e={next:void 0,callback:Ct,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ct(){}var wt=null;globalThis.requestAnimationFrame;var Tt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Et=class e{static create(){return new e}static request(e){return Tt.request(e)}static cancel(e){return Tt.cancel(e)}currentId=wt;request(e){this.cancel(),this.currentId=Tt.request(()=>{this.currentId=wt,e()})}cancel=()=>{this.currentId!==wt&&(Tt.cancel(this.currentId),this.currentId=wt)};disposeEffect=()=>this.cancel};function Dt(){let e=l(Et.create).current;return w(e.disposeEffect),e}function Q(e){return e?.ownerDocument||document}var Ot={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},kt={...Ot,position:`fixed`,top:0,left:0},At={...Ot,position:`absolute`},$=a(),jt=s.forwardRef(function(e,t){let[n,r]=s.useState();x(()=>{ee&&z&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,$.jsx)(`span`,{...e,ref:t,style:kt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Mt=Math.min,Nt=Math.max,Pt=Math.round,Ft=Math.floor,It=e=>({x:e,y:e}),Lt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Rt(e,t,n){return Nt(e,Mt(t,n))}function zt(e,t){return typeof e==`function`?e(t):e}function Bt(e){return e.split(`-`)[0]}function Vt(e){return e.split(`-`)[1]}function Ht(e){return e===`x`?`y`:`x`}function Ut(e){return e===`y`?`height`:`width`}function Wt(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Gt(e){return Ht(Wt(e))}function Kt(e,t,n){n===void 0&&(n=!1);let r=Vt(e),i=Gt(e),a=Ut(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=tn(o)),[o,tn(o)]}function qt(e){let t=tn(e);return[Jt(e),t,Jt(t)]}function Jt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yt=[`left`,`right`],Xt=[`right`,`left`],Zt=[`top`,`bottom`],Qt=[`bottom`,`top`];function $t(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xt:Yt:t?Yt:Xt;case`left`:case`right`:return t?Zt:Qt;default:return[]}}function en(e,t,n,r){let i=Vt(e),a=$t(Bt(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jt)))),a}function tn(e){let t=Bt(e);return Lt[t]+e.slice(t.length)}function nn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:nn(e)}function an(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function on(e,t,n){return Math.floor(e/t)!==n}function sn(e,t){return t<0||t>=e.length}function cn(e,t){return un(e.current,{disabledIndices:t})}function ln(e,t){return un(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function un(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&fn(e,a,r));return a}function dn(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!fn(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Ft(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!fn(e,r,s))return r}};d&&ne(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=un(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=un(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}sn(e,f)&&(f=u)}if(n===`both`){let n=Ft(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&ne(t),u%o===o-1?r&&(f=un(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=un(e,{startingIndex:u,disabledIndices:s}),r&&on(f,o,n)&&(f=un(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),on(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&ne(t),u%o===0?r&&(f=un(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=un(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&on(f,o,n)&&(f=un(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),on(f,o,n)&&(f=u));let c=Ft(l/o)===n;sn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:un(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function fn(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!mn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function pn(e){return e.visibility===`hidden`||e.visibility===`collapse`}function mn(e,t=e?J(e):null){return!e||!e.isConnected||!t||pn(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var hn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function gn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return le(n)?n.host:null}function _n(e){for(let t of Array.from(e.children))if(H(t)===`summary`)return t;return null}function vn(e,t){let n=_n(t);return!!n&&(e===n||Y(n,e))}function yn(e){let t=e?H(e):``;return e!=null&&e.matches(hn)&&(t!==`summary`||e.parentElement!=null&&H(e.parentElement)===`details`&&_n(e.parentElement)===e)&&(t!==`details`||_n(e)==null)&&(t!==`input`||e.type!==`hidden`)}function bn(e){if(!yn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=gn(t)){let n=t!==e,r=H(t)===`slot`;if(t.hasAttribute(`inert`)||n&&H(t)===`details`&&!t.open&&!vn(e,t)||t.hasAttribute(`hidden`)||!r&&!xn(t,n))return!1}return!0}function xn(e,t){let n=J(e);return t?n.display!==`none`:mn(e,n)}function Sn(e){let t=e.tabIndex;if(t<0){let t=H(e);if(t===`details`||t===`audio`||t===`video`||K(e)&&e.isContentEditable)return 0}return t}function Cn(e){if(H(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function wn(e,t){let n=Cn(e);if(!n)return!0;let r=t.find(e=>{let t=Cn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Cn(e);return t?.name===n.name&&t.form===n.form})===n}function Tn(e){if(K(e)&&H(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return K(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function En(e,t){Tn(e).forEach(e=>{yn(e)&&t.push(e),En(e,t)})}function Dn(e,t,n){Tn(e).forEach(e=>{K(e)&&e.matches(t)&&n.push(e),Dn(e,t,n)})}function On(e){return bn(e)&&Sn(e)>=0}function kn(e){let t=[];return En(e,t),t.filter(bn)}function An(e){let t=kn(e);return t.filter(e=>Sn(e)>=0&&wn(e,t))}function jn(e,t){let n=An(e),r=n.length;if(r===0)return;let i=je(Q(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Mn(e){return jn(Q(e).body,1)||e}function Nn(e){return jn(Q(e).body,-1)||e}function Pn(e,t){if(!e)return null;let n=An(Q(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Fn(e){return Pn(e,1)}function In(e){return Pn(e,-1)}function Ln(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function Rn(e){An(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function zn(e){let t=[];Dn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Bn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Bn(e,t.id,n)])}function Vn(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Hn(e){return`data-base-ui-${e}`}var Un=0;function Wn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Un);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),v;let o=requestAnimationFrame(a);return Un=o,()=>{Un===o&&(cancelAnimationFrame(o),Un=0)}}var Gn={inert:new WeakMap,"aria-hidden":new WeakMap},Kn=`data-base-ui-inert`,qn={inert:new WeakSet,"aria-hidden":new WeakSet},Jn=new WeakMap,Yn=0;function Xn(e){return qn[e]}function Zn(e){return e?le(e)?e.host:Zn(e.parentNode):null}var Qn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Zn(t);return e.contains(n)?n:null}).filter(e=>e!=null),$n=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},er=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{H(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function tr(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Qn(t,e),l=i?er(t,$n(c),new Set(c)):[],u=[],d=[];if(a){let e=Gn[a],n=Xn(a);s=n,o=e;let r=Qn(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);er(t,$n(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Jn.get(e)||0)+1;Jn.set(e,t),d.push(e),t===1&&e.setAttribute(Kn,``)}),Yn+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Jn.get(e)||0)-1;Jn.set(e,t),t||e.removeAttribute(Kn)}),--Yn,Yn||(Gn.inert=new WeakMap,Gn[`aria-hidden`]=new WeakMap,qn.inert=new WeakSet,qn[`aria-hidden`]=new WeakSet,Jn=new WeakMap)}}function nr(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Q(e[0]).body;return tr(e,a,n,r,{mark:i})}var rr=0;function ir(e,t=`mui`){let[n,r]=s.useState(e),i=e||n;return s.useEffect(()=>{n??(rr+=1,r(`${t}-${rr}`))},[n,t]),i}var ar=yt.useId;function or(e,t){if(ar!==void 0){let n=ar();return e??(t?`${t}-${n}`:n)}return ir(e,t)}var sr=19;function cr(e){return sr>=e}function lr(e){if(!s.isValidElement(e))return null;let t=e,n=t.props;return(cr(19)?n?.ref:t.ref)??null}function ur(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function dr(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function fr(e,t){return typeof e==`function`?e(t):e}function pr(e,t){return typeof e==`function`?e(t):e}var mr={};function hr(e,t,n,r,i){if(!n&&!r&&!i&&!e)return _r(t);let a=_r(e);return t&&(a=vr(a,t)),n&&(a=vr(a,n)),r&&(a=vr(a,r)),i&&(a=vr(a,i)),a}function gr(e){if(e.length===0)return mr;if(e.length===1)return _r(e[0]);let t=_r(e[0]);for(let n=1;n<e.length;n+=1)t=vr(t,e[n]);return t}function _r(e){return Sr(e)?{...Cr(e,mr)}:yr(e)}function vr(e,t){return Sr(t)?Cr(t,e):br(e,t)}function yr(e){let t={...e};for(let e in t){let n=t[e];xr(e,n)&&(t[e]=Tr(n))}return t}function br(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ur(e.style,r);break;case`className`:e[n]=Dr(e.className,r);break;default:e[n]=xr(n,r)?wr(e[n],r):r}}return e}function xr(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Sr(e){return typeof e==`function`}function Cr(e,t){return Sr(e)?e(t):e??mr}function wr(e,t){return t?e?(...n)=>{let r=n[0];if(Or(r)){let i=r;Er(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Tr(t):e}function Tr(e){return e&&((...t)=>{let n=t[0];return Or(n)&&Er(n),e(...t)})}function Er(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Dr(e,t){return t?e?t+` `+e:t:e}function Or(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function kr(e,t,n={}){let r=t.render,i=Ar(t,n);return n.enabled===!1?null:Nr(e,r,i,n.state??b)}function Ar(e,t={}){let{className:n,style:r,render:i}=e,{state:a=b,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?fr(n,a):void 0,d=l?pr(r,a):void 0,f=l?dr(a,c):b,p=l&&s?jr(s):void 0,m=l?ur(f,p)??{}:b;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ft([m.ref,lr(i),...o]):dt(m.ref,lr(i),o):dt(null,null)),l?(u!==void 0&&(m.className=Dr(m.className,u)),d!==void 0&&(m.style=ur(m.style,d)),m):b}function jr(e){return Array.isArray(e)?gr(e):hr(void 0,e)}var Mr=Symbol.for(`react.lazy`);function Nr(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=hr(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Mr&&(i=s.Children.toArray(t)[0]),s.cloneElement(i,e)}if(e&&typeof e==`string`)return Pr(e,n);throw Error(C(8))}function Pr(e,t){return e===`button`?(0,s.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,s.createElement)(`img`,{alt:``,...t,key:t.key}):s.createElement(e,t)}var Fr={style:{transition:`none`}},Ir=`data-base-ui-click-trigger`,Lr={fallbackAxisSide:`none`},Rr={fallbackAxisSide:`end`},zr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Br=s.createContext(null),Vr=()=>s.useContext(Br),Hr=Hn(`portal`);function Ur(e={}){let{ref:t,container:n,componentProps:r=b,elementProps:i}=e,a=or(),o=Vr()?.portalNode,[c,l]=s.useState(null),[d,f]=s.useState(null),p=Z(e=>{e!==null&&f(e)}),m=s.useRef(null);x(()=>{if(n===null){m.current&&(m.current=null,f(null),l(null));return}let e=(n&&(ce(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,f(null),l(null));return}m.current!==e&&(m.current=e,f(null),l(e))},[n,o]);let h=kr(`div`,r,{ref:[t,p],props:[{id:a,[Hr]:``},i]}),g=c&&h?u.createPortal(h,c):null;return{node:d,nodeId:s.isValidElement(h)?h.props.id:void 0,subtree:g}}var Wr=s.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...c}=e,{node:l,nodeId:d,subtree:f}=Ur({container:o,ref:t,componentProps:e,elementProps:c}),p=s.useRef(null),m=s.useRef(null),h=s.useRef(null),g=s.useRef(null),[_,v]=s.useState(null),y=s.useRef(!1),b=_?.modal,S=_?.open,C=!!_&&!_.modal&&_.open&&!!l;s.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&Ln(e)&&(e.type===`focusin`?y.current&&=(zn(l),!1):(Rn(l),y.current=!0))}return ut(X(l,`focusin`,e,!0),X(l,`focusout`,e,!0))},[l,b]),x(()=>{!l||S!==!0||!y.current||(zn(l),y.current=!1)},[S,l]);let w=s.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return(0,$.jsxs)(s.Fragment,{children:[f,(0,$.jsxs)(Br.Provider,{value:w,children:[C&&l&&(0,$.jsx)(jt,{"data-type":`outside`,ref:p,onFocus:e=>{Ln(e,l)?h.current?.focus():Nn(_?_.domReference:null)?.focus()}}),C&&l&&(0,$.jsx)(`span`,{"aria-owns":d,style:zr}),l&&u.createPortal(a,l),C&&l&&(0,$.jsx)(jt,{"data-type":`outside`,ref:m,onFocus:e=>{Ln(e,l)?g.current?.focus():(Mn(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,ct(`focus-out`,e.nativeEvent)))}})]})]})});function Gr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Kr=class{nodesRef={current:[]};events=Gr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},qr=s.createContext(null),Jr=s.createContext(null),Yr=()=>s.useContext(qr)?.id||null,Xr=e=>{let t=s.useContext(Jr);return e??t};function Zr(e){let t=or(),n=Xr(e),r=Yr();return x(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Qr(e){let{children:t,id:n}=e,r=Yr();return(0,$.jsx)(qr.Provider,{value:s.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $r(e){let{children:t,externalTree:n}=e,r=l(()=>n??new Kr).current;return(0,$.jsx)(Jr.Provider,{value:r,children:t})}function ei(e){return e==null?e:`current`in e?e.current:e}function ti(e,t){let n=U(Me(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ni=20,ri=[];function ii(){ri=ri.filter(e=>e.deref()?.isConnected)}function ai(e){ii(),e&&H(e)!==`body`&&(ri.push(new WeakRef(e)),ri.length>ni&&(ri=ri.slice(-20)))}function oi(){return ii(),ri[ri.length-1]?.deref()}function si(e){return e?On(e)?e:An(e)[0]||e:null}function ci(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=kn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return On(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function li(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:S}=g.context,C=Z(()=>S.current.floatingContext?.nodeId),w=i===!1,T=Re(v)&&w,E=_t(i),O=_t(a),k=_t(u),A=_t(_),j=Xr(m),M=Vr(),N=s.useRef(!1),P=s.useRef(!1),F=s.useRef(!1),I=s.useRef(null),L=s.useRef(``),R=s.useRef(``),B=s.useRef(null),ee=s.useRef(null),te=dt(B,p,M?.beforeInsideRef),re=dt(ee,M?.afterInsideRef),ae=D(),oe=D(),se=Dt(),U=M!=null,W=Be(y),ce=Z((e=W)=>e?An(e):[]),G=Z(()=>h?.().filter(e=>e!=null)??[]);s.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Y(W,je(Q(W)))&&ce().length===0&&!T&&ne(e)}return X(Q(W),`keydown`,e)},[r,W,c,T,ce]),s.useEffect(()=>{if(r||!_)return;let e=Q(W);function t(){F.current=!1}function n(e){let t=Me(e),n=G(),r=Y(y,t)||Y(v,t)||Y(M?.portalNode,t)||n.some(e=>e===t||Y(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(P.current=!0,oe.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return ut(X(e,`pointerdown`,n,!0),X(e,`pointerup`,t,!0),X(e,`pointercancel`,t,!0),X(e,`keydown`,i,!0),t)},[r,y,v,W,_,M,oe,G]),s.useEffect(()=>{if(r||!l)return;let e=Q(W);function t(){P.current=!0,oe.start(0,()=>{P.current=!1})}function n(e){let t=Me(e);On(t)&&(I.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Me(t);c&&n==null&&i!=null&&Y(y,i)&&ai(i),queueMicrotask(()=>{let a=C(),s=g.context.triggerElements,l=G(),u=n?.hasAttribute(Hn(`focus-guard`))&&[B.current,ee.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,ei(f),ei(d)].includes(n),p=!(Y(v,n)||Y(y,n)||Y(n,y)||Y(M?.portalNode,n)||l.some(e=>e===n||Y(e,n))||s.hasMatchingElement(e=>Y(e,n))||u||j&&(Bn(j.nodesRef.current,a).find(e=>Y(e.context?.elements.floating,n)||Y(e.context?.elements.domReference,n))||Vn(j.nodesRef.current,a).find(e=>[e.context?.elements.floating,Be(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&W&&ci(W),o&&r!==v&&!mn(i)&&je(e)===e.body){if(K(W)&&(W.focus(),o===`popup`)){se.request(()=>{W.focus()});return}let e=ce(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;K(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!c)&&n&&p&&!P.current&&(T||n!==oi())&&(N.current=!0,g.setOpen(!1,ct(Qe,t)))})}function a(){F.current||(S.current.insideReactTree=!0,ae.start(0,()=>{S.current.insideReactTree=!1}))}let s=K(v)?v:null;if(!(!y&&!s))return ut(s&&X(s,`focusout`,i),s&&X(s,`pointerdown`,t),y&&X(y,`focusin`,n),y&&X(y,`focusout`,i),y&&M&&X(y,`focusout`,a,!0))},[r,v,y,W,c,j,M,g,l,o,ce,T,C,S,ae,oe,se,d,f,G]),s.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Hn(`portal`)}]`)||[]),t=(j?Vn(j.nodesRef.current,C()):[]).find(e=>Re(e.context?.elements.domReference||null))?.context?.elements.domReference,n=nr([y,...e,B.current,ee.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...G(),t,ei(f),ei(d),T?v:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=nr([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,M,T,j,C,d,f,G]),x(()=>{if(!_||r||!K(W))return;L.current=``,R.current=``;let e=Q(W),t=je(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Y(W,t))return;let i=null,a=()=>(i??=ce(W),i[0]||W),o;o=r===!0||r===null?a():ei(r),o||=a();let s=Y(W,je(e));Wn(o,{preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=je(e);return!(t!==o&&Y(W,t))}})})},[r,_,W,ce,E,k,A]),x(()=>{if(r||!W)return;let e=Q(W),t=je(e),n=k.current==null;ai(t);function i(e){if(e.open||(L.current=ti(e.nativeEvent,R.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(N.current=!0),e.reason===`outside-press`)if(e.nested)N.current=!1;else if(V(e.nativeEvent)||ie(e.nativeEvent))N.current=!1;else{let e=!1;Q(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}b.on(`openchange`,i);function a(e){let r=O.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&H(t)!==`body`?t:null,s=n?o||a:a||o;return s||=oi()||null,typeof i==`boolean`?s:ei(i)||s||null}return()=>{b.off(`openchange`,i);let t=je(e),n=G(),r=Y(y,t)||n.some(e=>e===t||Y(e,t))||j&&Bn(j.nodesRef.current,C(),!1).some(e=>Y(e.context?.elements.floating,t)),o=O.current,s=L.current,c=a(s);queueMicrotask(()=>{let n=si(c),i=typeof o!=`boolean`;if(o&&!N.current&&K(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,y,W,O,k,b,j,v,C,G]),x(()=>{if(!z||_||!y)return;let e=je(Q(y));!K(e)||!Ie(e)||Y(y,e)&&e.blur()},[_,y]),x(()=>{if(!(r||!M))return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{M.setFocusManagerState(null)}},[r,M,c,_,g,l,v]),x(()=>{if(!(r||!W))return ci(W),()=>{queueMicrotask(ii)}},[r,W]);let le=!r&&(!c||!T)&&(U||c);return(0,$.jsxs)(s.Fragment,{children:[le&&(0,$.jsx)(jt,{"data-type":`inside`,ref:te,onFocus:e=>{if(c){let e=ce();Wn(e[e.length-1])}else M?.portalNode&&(N.current=!1,Ln(e,M.portalNode)?Mn(v)?.focus():ei(f??M.beforeOutsideRef)?.focus())}}),n,le&&(0,$.jsx)(jt,{"data-type":`inside`,ref:re,onFocus:e=>{c?Wn(ce()[0]):M?.portalNode&&(l&&(N.current=!0),Ln(e,M.portalNode)?Nn(v)?.focus():ei(d??M.afterOutsideRef)?.focus())}})]})}function ui(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:c=0,reason:l=He}=t,u=`rootStore`in e?e.rootStore:e,d=u.context.dataRef,f=s.useRef(void 0),p=Dt(),m=D(),h=s.useMemo(()=>{function e(e,t,n,r){let i=ct(l,t,n);e&&r===`touch`&&c>0?m.start(c,()=>{u.setOpen(!0,i)}):u.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,a=u.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){f.current=ae(e.pointerType,!0)&&ie(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=f.current,o=n.nativeEvent,s=u.select(`open`);if(n.button!==0||r===`click`||ae(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),l=Me(o);if(Ie(l)){e(c,o,l,i);return}let d=n.currentTarget;p.request(()=>{e(c,o,d,i)})},onClick(n){if(r===`mousedown-only`)return;let i=f.current;if(r===`mousedown`&&i){f.current=void 0;return}ae(i,!0)&&a||e(t(u.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){f.current=void 0}}},[d,r,a,l,u,o,i,p,m,c]);return s.useMemo(()=>n?{reference:h}:b,[n,h])}function di(){return!1}function fi(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function pi(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=di,bubbles:c,externalTree:l}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=u.useState(`floatingElement`),{dataRef:p}=u.context,m=Xr(l),h=Z(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Z(()=>a),{escapeKey:y,outsidePress:b}=fi(c),x=s.useRef(!1),S=s.useRef(!1),C=s.useRef(!1),w=s.useRef(!1),T=s.useRef(``),O=s.useRef(null),k=D(),A=D(),j=Z(()=>{A.clear(),p.current.insideReactTree=!1}),M=Z(e=>{let t=p.current.floatingContext?.nodeId;return(m?Bn(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Z(e=>Pe(e,u.select(`floatingElement`))||Pe(e,u.select(`domReferenceElement`))),P=Z(e=>{o()&&u.setOpen(!1,ct(He,e.nativeEvent))}),F=Z(e=>{if(!d||!n||!r||e.key!==`Escape`||w.current||!y&&M(`__escapeKeyBubbles`))return;let t=ct($e,re(e)?e.nativeEvent:e);u.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Z(()=>{p.current.insideReactTree=!0,A.start(0,j)}),L=Z(e=>{if(!d||!n||e.button!==0)return;let t=Me(e.nativeEvent);Y(u.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),R=Z(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});s.useEffect(()=>{if(!d||!n)return j;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new E,t=new E;function i(){e.clear(),w.current=!0}function a(){e.start(z?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function l(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=p.current.floatingContext?.nodeId,n=m&&Bn(m.nodesRef.current,t).some(t=>Pe(e,t.context?.elements.floating));return N(e)||n}function D(e){if(l(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(p.current.insideReactTree){j();return}let n=Me(e),r=`[${Hn(`inert`)}]`,i=G(n)?n.getRootNode():null,a=Array.from((le(i)?i:Q(u.select(`floatingElement`))).querySelectorAll(r)),o=u.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Y(e,n))))return;let s=G(n)?n:null;for(;s&&!ye(s);){let e=xe(s);if(ye(e)||!G(e))break;s=e}if(!(a.length&&G(n)&&!Fe(n)&&!Y(n,u.select(`floatingElement`))&&a.every(e=>!Y(s,e)))){if(K(n)&&!(`touches`in e)){let t=ye(n),r=J(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!h(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof g==`function`&&!g(e)||M(`__outsidePressBubbles`)||(u.setOpen(!1,ct(Ge,e)),j())}}}function A(e){c()!==`sloppy`||e.pointerType===`touch`||!u.select(`open`)||!n||N(e)||D(e)}function P(e){if(c()!==`sloppy`||!u.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function I(e,t){let n=Me(e);if(!n)return;let r=X(n,e.type,()=>{t(e),r()})}function L(e){T.current=`touch`,I(e,P)}function R(e){k.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&O.current&&!O.current.dismissOnMouseDown)&&I(e,e=>{e.type===`pointerdown`?A(e):D(e)})}function B(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,j())}}}function ee(e){if(c()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(D(e),k.clear(),O.current=null)}function te(e){I(e,ee)}function ne(e){c()!==`sloppy`||!O.current||N(e)||(O.current.dismissOnTouchEnd&&D(e),k.clear(),O.current=null)}function re(e){I(e,ne)}let V=Q(f),ie=ut(r&&ut(X(V,`keydown`,F),X(V,`compositionstart`,i),X(V,`compositionend`,a)),_&&ut(X(V,`click`,R,!0),X(V,`pointerdown`,R,!0),X(V,`pointerup`,B,!0),X(V,`pointercancel`,B,!0),X(V,`mousedown`,R,!0),X(V,`mouseup`,B,!0),X(V,`touchstart`,L,!0),X(V,`touchmove`,te,!0),X(V,`touchend`,re,!0)));return()=>{ie(),e.clear(),t.clear(),s(),C.current=!1,j()}},[p,f,r,_,g,d,n,y,b,F,j,v,M,N,m,u,k]);let B=s.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=s.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return s.useMemo(()=>n?{reference:B,floating:ee,trigger:B}:{},[n,B,ee])}function mi(e,t,n){let{reference:r,floating:i}=e,a=Wt(t),o=Gt(t),s=Ut(o),c=Bt(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function hi(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zt(t,e),p=rn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=an(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=an(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var gi=50,_i=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:hi},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=mi(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<gi&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=mi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},vi=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bt(r),_=Wt(o),v=Bt(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[tn(o)]:qt(o)),x=p!==`none`;!d&&x&&b.push(...en(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Kt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wt(t)||T.every(e=>Wt(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wt(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},yi=new Set([`left`,`top`]);async function bi(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bt(n),s=Vt(n),c=Wt(n)===`y`,l=yi.has(o)?-1:1,u=a&&c?-1:1,d=zt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var xi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await bi(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Si=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wt(i),p=Ht(f),m=u[p],h=u[f],g=(e,t)=>Rt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ci=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=zt(e,t),u={x:n,y:r},d=Wt(i),f=Ht(d),p=u[f],m=u[d],h=zt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=yi.has(Bt(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},wi=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=zt(e,t),c=await i.detectOverflow(t,s),l=Bt(n),u=Vt(n),d=Wt(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Mt(p-c[m],g),y=Mt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Nt(c.left,c.right):S=p-2*Nt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ti(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Pt(n)!==a||Pt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ei(e){return G(e)?e:e.contextElement}function Di(e){let t=Ei(e);if(!K(t))return It(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ti(t),o=(a?Pt(n.width):n.width)/r,s=(a?Pt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Oi=It(0);function ki(e){let t=U(e);return!ve()||!t.visualViewport?Oi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ai(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===U(e)}function ji(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ei(e),o=It(1);t&&(r?G(r)&&(o=Di(r)):o=Di(e));let s=Ai(a,n,r)?ki(a):It(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=U(a),t=G(r)?U(r):r,n=e,i=we(n);for(;i&&t!==n;){let e=Di(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=U(i),i=we(n)}}return an({width:u,height:d,x:c,y:l})}function Mi(e,t){let n=be(e).scrollLeft;return t?t.left+n:ji(W(e)).left+n}function Ni(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Mi(e,n),y:n.top+t.scrollTop}}function Pi(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=W(r),s=t?fe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=It(1),u=It(0),d=K(r);if((d||!a)&&((H(r)!==`body`||ue(o))&&(c=be(r)),d)){let e=ji(r);l=Di(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ni(o,c):It(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Fi(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ii(e){let t=be(e),n=e.ownerDocument.body,r=Nt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Nt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Mi(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=Nt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Li=25;function Ri(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=U(e),a=W(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ve()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Mi(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Li&&(s-=o)}return{width:s,height:c,x:l,y:u}}function zi(e,t){let n=ji(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Di(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Bi(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ri(e,n,t);else if(t===`document`)r=Ii(W(e));else if(G(t))r=zi(t,n);else{let n=ki(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return an(r)}function Vi(e,t){let n=t.get(e);if(n)return n;let r=Ce(e,[],!1).filter(e=>G(e)&&H(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?xe(e):e;for(;G(o)&&!ye(o);){let e=J(o),t=ge(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=xe(o)}return t.set(e,r),r}function Hi(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?fe(t)?[]:Vi(t,this._c):[].concat(n),r],o=Bi(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Bi(t,a[e],i);s=Nt(n.top,s),c=Mt(n.right,c),l=Mt(n.bottom,l),u=Nt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ui(e){let{width:t,height:n}=Ti(e);return{width:t,height:n}}function Wi(e,t,n){let r=K(t),i=W(t),a=n===`fixed`,o=ji(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=It(0);if((r||!a)&&((H(t)!==`body`||ue(i))&&(s=be(t)),r)){let e=ji(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Mi(i));let l=i&&!r&&!a?Ni(i,s):It(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Gi(e){return J(e).position===`static`}function Ki(e,t){if(!K(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function qi(e,t){let n=U(e);if(fe(e))return n;if(!K(e)){let t=xe(e);for(;t&&!ye(t);){if(G(t)&&!Gi(t))return t;t=xe(t)}return n}let r=Ki(e,t);for(;r&&de(r)&&Gi(r);)r=Ki(r,t);return r&&ye(r)&&Gi(r)&&!ge(r)?n:r||_e(e)||n}var Ji=async function(e){let t=this.getOffsetParent||qi,n=this.getDimensions,r=await n(e.floating);return{reference:Wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yi(e){return J(e).direction===`rtl`}var Xi={convertOffsetParentRelativeRectToViewportRelativeRect:Pi,getDocumentElement:W,getClippingRect:Hi,getOffsetParent:qi,getElementRects:Ji,getClientRects:Fi,getDimensions:Ui,getScale:Di,isElement:G,isRTL:Yi};function Zi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qi(e,t,n){let r=null,i,a=W(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ft(d),h=Ft(a.clientWidth-(u+f)),g=Ft(a.clientHeight-(d+p)),_=Ft(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Nt(0,Mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Zi(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=U(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function $i(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ei(e),u=i||a?[...l?Ce(l):[],...t?Ce(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Qi(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ji(e):null;c&&g();function g(){let t=ji(e);h&&!Zi(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ea=xi,ta=Si,na=vi,ra=wi,ia=Ci,aa=(e,t,n)=>{let r=new Map,i=n??{},a={...Xi,...i.platform,_c:r};return _i(e,t,{...i,platform:a})},oa=typeof document<`u`?s.useLayoutEffect:function(){};function sa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sa(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!sa(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ca(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function la(e,t){let n=ca(e);return Math.round(t*n)/n}function ua(e){let t=s.useRef(e);return oa(()=>{t.current=e}),t}function da(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);sa(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=l!=null,O=ua(l),k=ua(i),A=ua(d),j=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),aa(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!sa(E.current,t)&&(E.current=t,u.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);oa(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=s.useRef(!1);oa(()=>(M.current=!0,()=>{M.current=!1}),[]),oa(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=s.useMemo(()=>({reference:S,floating:C}),[S,C]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=la(P.floating,f.x),r=la(P.floating,f.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ca(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var fa=(e,t)=>{let n=ea(e);return{name:n.name,fn:n.fn,options:[e,t]}},pa=(e,t)=>{let n=ta(e);return{name:n.name,fn:n.fn,options:[e,t]}},ma=(e,t)=>({fn:ia(e).fn,options:[e,t]}),ha=(e,t)=>{let n=na(e);return{name:n.name,fn:n.fn,options:[e,t]}},ga=(e,t)=>{let n=ra(e);return{name:n.name,fn:n.fn,options:[e,t]}},_a=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),va=t(((e,t)=>{t.exports=_a()})),ya=t((e=>{var t=n(),r=va();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),ba=t(((e,t)=>{t.exports=ya()})),xa=va(),Sa=ba(),Ca=cr(19)?Ea:Da;function wa(e,t,n,r,i){return Ca(e,t,n,r,i)}function Ta(e,t,n,r,i){let a=s.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,xa.useSyncExternalStore)(e.subscribe,a,a)}m({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,xa.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ea(e,t,n,r,i){let a=p();if(!a)return Ta(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Da(e,t,n,r,i){return(0,Sa.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Oa=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return wa(this,e,t,n,r)}},ka=class extends Oa{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){s.useDebugValue(e);let n=this;x(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;x(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;x(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){s.useDebugValue(e);let n=this,r=t!==void 0;x(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return s.useDebugValue(e),wa(this,this.selectors[e],t,n,r)}useContextCallback(e,t){s.useDebugValue(e);let n=Z(t??v);this.context[e]=n}useStateSetter(e){let t=s.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Aa={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},ja=class extends ka{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Gr(),nested:n,triggerElements:i},Aa),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&oe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ma(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,c=t.useState(`open`),l=t.useState(`activeTriggerElement`),u=t.useState(n?`popupElement`:`positionerElement`),d=t.context.triggerElements,f=o,p=s.useRef(null);r===void 0&&p.current===null&&(p.current=new ja({open:c,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:i,syncOnly:!0,nested:a}));let m=r??p.current;return t.useSyncedValue(`floatingId`,i),x(()=>{let e={open:c,floatingId:i,referenceElement:l,floatingElement:u};G(l)&&(e.domReferenceElement=l),m.state.positionReference===m.state.referenceElement&&(e.positionReference=l),m.update(e)},[c,i,l,u,m]),m.context.onOpenChange=f,m.context.nested=a,m}function Na(e,t=!1,n=!1){let[r,i]=s.useState(e&&t?`idle`:void 0),[a,o]=s.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),x(()=>{if(!e&&a&&r!==`ending`&&n){let e=Et.request(()=>{i(`ending`)});return()=>{Et.cancel(e)}}},[e,a,r,n]),x(()=>{if(!e||t)return;let n=Et.request(()=>{i(void 0)});return()=>{Et.cancel(n)}},[t,e]),x(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Et.request(()=>{i(`idle`)});return()=>{Et.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Pa(e,t=!1){let n=Dt();return Z((r,i=null)=>{n.cancel();let a=ei(e);if(a==null)return;let o=a,s=()=>{u.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function Fa(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Z(i),o=Pa(r,n);s.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Ia={tabIndex:-1,[Te]:``};function La(e){return t=>t!==`touch`||e.current}function Ra(e,t=!1){let n=or(),r=Yr()!=null,i=l(()=>e(n,r)).current;return Ma({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function za({handle:e,store:t}){return x(()=>e.attachStore(t),[e,t]),null}function Ba(e,t){let n=s.useRef(null),r=s.useRef(null);return s.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Va(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Ha(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ua(e,t,n,r={}){let i=n.reason,a=i===Ue,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Ha(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),Va(i,t,n.trigger,c()),e.update(i)};a?u.flushSync(l):l()}function Wa(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Ba(e,n),o=Z(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),c=s.useCallback(e=>{a(e),e&&o(e)},[a,o]);return x(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:i}}function Ga(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=s.useRef(null),i=e.useState(`open`);x(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ct(Ve);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Ka(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Na(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Z(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Fa({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function qa(e,t){e.useSyncedValues(t),x(()=>()=>{e.update({activeTriggerProps:b,inactiveTriggerProps:b,popupProps:b})},[e])}function Ja(e,t){x(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),x(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ya=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Xa(){return new ja({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Ya,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Za(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Xa(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:b,inactiveTriggerProps:b,popupProps:b}}function Qa(e,t,n=!1){return new ja({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var $a=e=>e.triggerIdProp??e.activeTriggerId,eo=e=>e.openProp??e.open,to=e=>(e.popupElement?.id??e.floatingId)||void 0;function no(e,t){return t!==void 0&&eo(e)&&$a(e)===t}function ro(e,t){return no(e,t)?!0:t!==void 0&&eo(e)&&$a(e)==null&&e.triggerCount===1}var io={open:eo,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:$a,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:to,isTriggerActive:(e,t)=>t!==void 0&&$a(e)===t,isOpenedByTrigger:(e,t)=>no(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&$a(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ro(e,t)?to(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ao(e){let t=s.useCallback(t=>e===void 0?v:e.subscribeStore(t),[e]),n=s.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,xa.useSyncExternalStore)(t,n,()=>e?.serverStore)}function oo(e){return so(e,e.rootContext)}function so(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),c=t.useState(`open`),l=t.useState(`floatingId`),[u,d]=s.useState(null),[f,p]=s.useState(void 0),[m,h]=s.useState(void 0),g=s.useRef(null),_=Xr(r),v=s.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=da({...e,elements:{...v,...u&&{reference:u}}}),b=G(f)?f:null,S=m===void 0?t.state.floatingElement:m;t.useSyncedValue(`referenceElement`,f??null),t.useSyncedValue(`domReferenceElement`,f===void 0?o:b),t.useSyncedValue(`floatingElement`,S);let C=s.useCallback(e=>{let t=G(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),w=s.useCallback(e=>{(G(e)||e===null)&&(g.current=e,p(e)),(G(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!G(e))&&y.refs.setReference(e)},[y.refs,p]),T=s.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),E=s.useMemo(()=>({...y.refs,setReference:w,setFloating:T,setPositionReference:C,domReference:g}),[y.refs,w,T,C]),D=s.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),O=s.useMemo(()=>({...y,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:E,elements:D,nodeId:n,rootStore:t}),[y,E,D,n,t,c,l]);return x(()=>{o&&(g.current=o)},[o]),x(()=>{t.context.dataRef.current.floatingContext=O;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=O)}),s.useMemo(()=>({...y,context:O,refs:E,elements:D,rootStore:t}),[y,E,D,O,t])}var co=`Escape`;function lo(e){return z&&e.movementX===0&&e.movementY===0}function uo(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function fo(e,t){return uo(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function po(e,t,n){return uo(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function mo(e,t,n){return uo(t,n?e===De:e===Oe,e===Ae)}function ho(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===co:uo(t,n?e===Oe:e===De,e===ke)}function go(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:S,grid:C}=t,w=C!=null,T=`rootStore`in e?e.rootStore:e,E=T.useState(`open`),D=T.useState(`floatingElement`),O=T.useState(`domReferenceElement`),k=T.context.dataRef,A=Be(D),j=Re(O),M=_t(A),N=Yr(),P=Xr(S),F=s.useRef(p),I=s.useRef(o??-1),L=s.useRef(null),R=s.useRef(!0),z=Z(e=>{i(I.current===-1?null:I.current,e)}),B=s.useRef(!!D),ee=s.useRef(E),te=s.useRef(!1),re=s.useRef(!1),ae=s.useRef(null),oe=_t(g),se=_t(E),H=_t(o),U=_t(b),W=Dt(),ce=Dt(),G=Z(()=>{function e(e){f?P?.events.emit(`virtualfocus`,e):ae.current=Wn(e,{sync:te.current,preventScroll:!0})}let t=n.current[I.current],r=re.current;t&&e(t),(te.current?e=>e():e=>W.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),me&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});x(()=>{k.current.orientation=_},[k,_]),x(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(re.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),x(()=>{if(a){if(!E){te.current=!1;return}if(D)if(r==null){if(te.current=!1,H.current!=null)return;if(B.current&&(I.current=-1,G()),(!ee.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||po(L.current,_,d)||u?cn(n):ln(n),L.current=null,z())};t()}}else sn(n.current,r)||(I.current=r,G(),re.current=!1)}},[a,E,D,r,H,u,n,_,d,z,G,ce]),x(()=>{if(!a||D||!P||f||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=je(Q(O??t??null)),r=e.some(e=>e.context&&Y(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,f]),x(()=>{ee.current=E,B.current=!!D}),x(()=>{E||(L.current=null,F.current=p)},[E,p]);let le=r!=null,ue=Z(e=>{if(!se.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),de=Z(()=>v??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),fe=Z(()=>cn(n,oe.current)),pe=Z(e=>{if(R.current=!1,te.current=!0,e.which===229||!se.current&&e.currentTarget===M.current)return;if(u&&ho(e.key,_,d,w)){fo(e.key,de())||ne(e),T.setOpen(!1,ct(et,e.nativeEvent)),K(O)&&(f?P?.events.emit(`virtualfocus`,O):O.focus());return}let t=I.current,r=cn(n,g),i=ln(n,g);if(j||(e.key===`Home`&&(ne(e),I.current=r,z(e)),e.key===`End`&&(ne(e),I.current=i,z(e))),C!=null){let t=C(e,I.current,n,_,l,d,g,r,i);if(t!=null&&(I.current=t,z(e)),_===`both`)return}if(fo(e.key,_)){if(ne(e),E&&!f&&je(e.currentTarget.ownerDocument)===e.currentTarget){I.current=po(e.key,_,d)?r:i,z(e);return}po(e.key,_,d)?l?t>=i?c&&t!==n.current.length?I.current=-1:(te.current=!1,I.current=r):I.current=un(n.current,{startingIndex:t,disabledIndices:g}):I.current=Math.min(i,un(n.current,{startingIndex:t,disabledIndices:g})):l?t<=r?c&&t!==-1?I.current=n.current.length:(te.current=!1,I.current=i):I.current=un(n.current,{startingIndex:t,decrement:!0,disabledIndices:g}):I.current=Math.max(r,un(n.current,{startingIndex:t,decrement:!0,disabledIndices:g})),sn(n.current,I.current)&&(I.current=-1),z(e)}}),me=s.useMemo(()=>({onFocus(e){te.current=!0,ue(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){lo(e)||(te.current=!0,re.current=!1,m&&ue(e))},onPointerLeave(e){if(!se.current||!R.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(!(!m||n.current.includes(t))&&U.current&&(ae.current?.(),ae.current=null,I.current=-1,z(e),!f)){let e=M.current,t=je(Q(e));e&&Y(e,t)&&e.focus({preventScroll:!0})}}}),[ue,se,M,m,n,z,U,f]),q=s.useMemo(()=>f&&E&&le&&{"aria-activedescendant":`${y}-${r}`},[f,E,le,y,r]),he=s.useMemo(()=>({"aria-orientation":_===`both`?void 0:_,...j?{}:q,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&E&&!f){let t=Me(e.nativeEvent);if(t&&!Y(M.current,t))return;ne(e),T.setOpen(!1,ct(Qe,e.nativeEvent)),K(O)&&O.focus();return}pe(e)},onPointerMove(e){lo(e)||(R.current=!0)}}),[q,pe,M,_,j,T,E,f,O]),ge=s.useMemo(()=>{function e(e){T.setOpen(!0,ct(et,e.nativeEvent,e.currentTarget))}function t(e){p===`auto`&&V(e.nativeEvent)&&(F.current=!f)}function n(e){F.current=p,p===`auto`&&ie(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(t){let n=T.select(`open`);R.current=!1;let r=t.key.startsWith(`Arrow`),i=mo(t.key,de(),d),a=fo(t.key,_),o=(u?i:a)||t.key===`Enter`||t.key.trim()===``;if(f&&n)return pe(t);if(!(!n&&!h&&r)){if(o){let e=fo(t.key,de());L.current=u&&e?null:t.key}if(u){i&&(ne(t),n?(I.current=fe(),z(t)):e(t));return}a&&(H.current!=null&&(I.current=H.current),ne(t),!n&&h?e(t):pe(t),n&&z(t))}},onFocus(e){T.select(`open`)&&!f&&(I.current=-1,z(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[pe,p,fe,u,z,T,h,_,de,d,H,f]),_e=s.useMemo(()=>({...q,...ge}),[q,ge]);return s.useMemo(()=>a?{reference:_e,floating:he,item:me,trigger:ge}:{},[a,_e,he,ge,me])}function _o(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=D(),h=s.useRef(``),g=s.useRef(d??i??-1),_=s.useRef(null),v=Z(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!mn(n)||n?.matches(`:disabled`)?!1:o==null||!fn(y,e,o)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!s(n)))return n}return-1}let f=n.current;if(h.current.length>0&&e.key===` `&&(ne(e),c?.(!0)),h.current.length>0&&h.current[0]!==` `&&l(f,h.current)===-1&&e.key!==` `&&c?.(!1),f==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(ne(e),c?.(!0));let v=h.current===``;v&&(g.current=d??i??-1),f.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,c?.(!1)});let b=((v?d??i??-1:g.current)??0)+1,x=l(f,h.current,b);x===-1?e.key!==` `&&(h.current=``,c?.(!1)):(a?.(x),_.current=x)}),b=Z(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);Y(n,t)||Y(r,t)||(m.clear(),h.current=``,g.current=_.current,c?.(!1))});x(()=>{!p&&d!==null||(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[p,d,m]);let S=s.useMemo(()=>({onKeyDown:v,onBlur:b}),[v,b]);return s.useMemo(()=>l?{reference:S,floating:S}:{},[l,S])}var vo=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),yo={"data-starting-style":``},bo={"data-ending-style":``},xo={transitionStatus(e){return e===`starting`?yo:e===`ending`?bo:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=vo.startingStyle]=`startingStyle`,e[e.endingStyle=vo.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var So={"data-popup-open":``},Co={"data-popup-open":``,"data-pressed":``},wo={"data-open":``},To={"data-closed":``},Eo={"data-anchor-hidden":``},Do={open(e){return e?So:null}},Oo={open(e){return e?Co:null}},ko={open(e){return e?wo:To},anchorHidden(e){return e?Eo:null}},Ao={...ko,...xo};function jo(e){return or(e,`base-ui`)}var Mo=s.createContext(void 0);function No(){return s.useContext(Mo)?.direction??`ltr`}var Po=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=zt(e,t)||{};if(l==null)return{};let f=rn(u),p={x:n,y:r},m=Gt(i),h=Ut(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Rt(k,j,A),N=!c.arrow&&Vt(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Fo=(e,t)=>({...Po(e),options:[e,t]}),Io={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Lo={sideX:`left`,sideY:`top`},Ro=`--available-width`,zo=`--available-height`;function Bo(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Vo(e,t,n){let{rects:r,placement:i}=e;return{side:Bo(t,Bt(i),n),align:Vt(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ho(e){return Uo(e,oo)}function Uo(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,collisionBoundary:l,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,[T,E]=s.useState(null);!_&&T!==null&&E(null);let D=v.side||`flip`,O=v.align||`flip`,k=v.fallbackAxisSide||`end`,A=y?.crossAxis??!1,j=y?.rootBoundary,M=typeof n==`function`?n:void 0,N=Z(M),P=M?N:n,F=_t(n),I=_t(_),L=No()===`rtl`,R=T||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=o===`center`?R:`${R}-${o}`,B=u;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),re=+(i===`left`),V={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:B},ie=s.useRef(null),ae=_t(a),oe=_t(c),se=typeof a==`function`?0:a,H=typeof c==`function`?0:c,W=[];m&&W.push(m),W.push(fa(e=>{let t=Vo(e,i,L),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,H,L,i]));let ce=O===`none`&&D!==`shift`,G=!ce&&(d||A||D===`shift`),K=D===`none`?null:ha({...V,padding:{top:B.top+1+ee,right:B.right+1+re,bottom:B.bottom+1+te,left:B.left+1+ne},mainAxis:!A&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k}),le=ce?null:pa({...V,rootBoundary:j,mainAxis:O!==`none`,crossAxis:G,limiter:d||A?void 0:ma(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Wt(Bt(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[V,d,A,j,B,O]);D===`shift`||O===`shift`||o===`center`?W.push(le,K):W.push(K,le),W.push(ga({...V,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!I.current)return;let i=e.style;i.setProperty(Ro,`${t}px`),i.setProperty(zo,`${n}px`);let a=U(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Fo(e=>({element:ie.current||Q(e.elements.floating).createElement(`div`),padding:f,offsetParent:`floating`}),[f]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Bt(r),l=Wt(c),u=ie.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(Vo(e,i,L)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,G&&l===`y`&&b?S:x),{}}},Io,S),x(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let ue=s.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:de,elements:fe,x:pe,y:me,middlewareData:q,update:he,placement:ge,context:_e,isPositioned:ve,floatingStyles:ye}=t({rootContext:g,open:h?_:void 0,placement:z,middleware:W,strategy:r,whileElementsMounted:h?void 0:(...e)=>$i(...e,ue),nodeId:b,externalTree:w}),{sideX:J,sideY:be}=q.adaptiveOrigin||Lo,xe=ve?r:`fixed`,Se=s.useMemo(()=>{let e;return e=ve?S?{position:xe,[J]:pe,[be]:me}:{...ye,position:xe}:{position:xe,top:0,left:0},e[Ro]=`100vw`,e[zo]=`100vh`,ve||(e.opacity=0),e},[S,xe,J,pe,be,me,ye,ve]),Ce=s.useRef(null);x(()=>{if(!_)return;let e=F.current,t=typeof e==`function`?e():e,n=(Wo(t)?t.current:t)||null;n!==Ce.current&&(de.setPositionReference(n),Ce.current=n)},[_,de,P,F]),s.useEffect(()=>{if(!_)return;let e=F.current;typeof e!=`function`&&Wo(e)&&e.current!==Ce.current&&(de.setPositionReference(e.current),Ce.current=e.current)},[_,de,P,F]),s.useEffect(()=>{if(h&&_&&fe.reference&&fe.floating)return $i(fe.reference,fe.floating,he,ue)},[h,_,fe,he,ue]);let we=Bt(ge),Te=Bo(i,we,L),Ee=Vt(ge)||`center`,De=!!q.hide?.referenceHidden;x(()=>{C&&_&&ve&&we!==R&&E(we)},[C,_,ve,we,R]);let Oe=s.useMemo(()=>({position:`absolute`,top:q.arrow?.y,left:q.arrow?.x}),[q.arrow]),ke=q.arrow?.centerOffset!==0;return s.useMemo(()=>({positionerStyles:Se,arrowStyles:Oe,arrowRef:ie,arrowUncentered:ke,side:Te,align:Ee,physicalSide:we,anchorHidden:De,refs:de,context:_e,isPositioned:ve,update:he}),[Se,Oe,ie,ke,Te,Ee,we,De,de,_e,ve,he])}function Wo(e){return e!=null&&`current`in e}function Go(e){return e===`starting`?Fr:b}function Ko(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),kr(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Go(r),i],stateAttributesMapping:ko})}function qo(e){return cr(19)?e:e?`true`:void 0}function Jo(...e){return o(i(e))}var Yo=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xo=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Zo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Qo=e=>{let t=Zo(e);return t.charAt(0).toUpperCase()+t.slice(1)},$o={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},es=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ts=(0,s.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...c},l)=>(0,s.createElement)(`svg`,{ref:l,...$o,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yo(`lucide`,i),...!a&&!es(c)&&{"aria-hidden":`true`},...c},[...o.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(a)?a:[a]])),ns=(e,t)=>{let n=(0,s.forwardRef)(({className:n,...r},i)=>(0,s.createElement)(ts,{ref:i,iconNode:t,className:Yo(`lucide-${Xo(Qo(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Qo(e),n},rs=ns(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),is=ns(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),as={},os={},ss=``;function cs(e,t){return ue(e)?e:t}function ls(e,t,n){return/hidden|clip/.test(e.getComputedStyle(cs(t,n)).overflowY)}function us(e){if(typeof document>`u`)return!1;let t=Q(e);return U(t).innerWidth-t.documentElement.clientWidth>0}function ds(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Q(e),n=t.documentElement,r=t.body,i=cs(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function fs(e){let t=Q(e),n=t.documentElement,r=t.body,i=cs(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function ps(e){let t=Q(e),n=t.documentElement,r=t.body,i=U(n),a=0,o=0,s=!1,c=Et.create();if(z&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,as={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ss=n.style.scrollBehavior,os={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=cs(n,r);if(s=ds(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,as),Object.assign(r.style,os),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ss)}function d(){u(),c.request(l)}l();let f=X(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ms=new class{lockCount=0;restore=null;timeoutLock=E.create();timeoutUnlock=E.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Q(e),n=t.documentElement,r=t.body,i=U(n);if(ls(i,n,r)){let t=new i.MutationObserver(()=>{ls(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=P||!us(e);this.restore=a?fs(e):ps(e)}};function hs(e=!0,t=null){x(()=>{if(e)return ms.acquire(t)},[e,t])}var gs=s.createContext(void 0);function _s(e=!1){let t=s.useContext(gs);if(t===void 0&&!e)throw Error(C(16));return t}function vs(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,c=r&&t===!1;return{props:s.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||c)&&(e.disabled=n),e},[r,n,t,o,c,a,i])}}function ys(e,t,{detail:n=0}={}){e.dispatchEvent(new(U(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function bs(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=s.useRef(null),c=_s(!0),l=a??c!==void 0,{props:u}=vs({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),d=s.useCallback(()=>{let e=o.current;xs(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return x(d,[d]),{getButtonProps:s.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...c}=e;return hr({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Er(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=xs(r),s=!i&&Ss(r),c=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),ys(r,e));return}if(!c||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ys(r,e)))},onKeyUp(e){if(!t){if(Er(e),a?.(e),e.target===e.currentTarget&&i&&l&&xs(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ys(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},u,c)},[t,u,l,i]),buttonRef:Z(e=>{o.current=e,d()})}}function xs(e){return K(e)&&e.tagName===`BUTTON`}function Ss(e){return K(e)&&e.tagName===`A`&&!!e.href}var Cs=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),ws=s.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,$.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Ts(e){let t=s.useRef(``),n=s.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:s.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Es(e,t){let n=s.useRef(e),r=Z(t);x(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ds(e,t){let{onClick:n,onPointerDown:r}=Ts(Z((n,r)=>{(typeof e==`function`?e():e)||t(r||(P?`touch`:``))}));return s.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Os(e){let[t,n]=s.useState(null),r=Ds(e,n);return Es(e,t=>{t&&!e&&n(null)}),s.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var ks=s.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=bs({disabled:i,focusableWhenDisabled:a,native:o});return kr(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),As=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,js=i,Ms=(e,t)=>n=>{if(t?.variants==null)return js(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=As(t)||As(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return js(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ns=Ms(`group/button cursor-pointer inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted/50 hover:text-foreground aria-expanded:bg-muted/50 aria-expanded:text-foreground/50 dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Ps({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,$.jsx)(ks,{"data-slot":`button`,className:Jo(Ns({variant:t,size:n,className:e})),...r})}function Fs({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=s.useRef(e!==void 0),[a,o]=s.useState(t);return[i?e:a,s.useCallback(e=>{i||o(e)},[])]}var Is=s.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Ls(){return s.useContext(Is)}function Rs(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:c,subscribeMapChange:l,nextIndexRef:u}=Ls(),d=s.useRef(-1),[f,p]=s.useState(a==null&&t?()=>{if(d.current===-1){let e=u.current;u.current+=1,d.current=e}return d.current}:-1),m=a??f,h=s.useRef(null),g=s.useCallback(e=>{let t=h.current;t&&c(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,c,r,n,i]);return x(()=>{if(a==null)return l(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&p(t)})},[a,l]),{ref:g,index:m}}var zs=s.createContext(void 0);function Bs(e){let t=s.useContext(zs);if(t===void 0&&!e)throw Error(C(69));return t}function Vs(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Z(i),[,o]=s.useState(!1),c=l(Us).current,u=l(Hs).current,d=s.useRef(0),f=s.useRef(!0),p=s.useRef([]),m=s.useRef(null),h=Z(()=>{f.current||(f.current=!0,o(e=>!e))}),g=Z((e,t)=>{u.set(e,t),h()}),_=Z(e=>{u.delete(e),h()}),v=Z(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),d.current=n.current.length,t});function y(e){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Ks(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&qs(r,n)>0){t.disconnect(),h();return}r=n}});m.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Gs(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let b=Z(()=>{let[e,t]=Ws(u),n=v(e);y(t),p.current=e,f.current=!1,c.forEach(e=>e(n)),a(n)});x(()=>(f.current||v(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,v]),x(()=>{f.current&&b()}),x(()=>()=>{m.current?.disconnect(),f.current=!0},[]);let S=Z(e=>(c.add(e),()=>{c.delete(e)})),C=s.useMemo(()=>({register:g,unregister:_,subscribeMapChange:S,nextIndexRef:d}),[g,_,S,d]);return(0,$.jsx)(Is.Provider,{value:C,children:t})}function Hs(){return new Map}function Us(){return new Set}function Ws(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>qs(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Gs(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Ks(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function qs(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Js=20;function Ys(e,t,n,r){let[i,a]=s.useState(!1);x(()=>{if(!e||!t||n==null){a(!1);return}let r=Q(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Js)},[e,t,n]),hs(e&&(!t||i),r)}var Xs=5;function Zs(e,t){let n=Qs(t);return e.clientX>=n.left-Xs&&e.clientX<=n.right+Xs&&e.clientY>=n.top-Xs&&e.clientY<=n.bottom+Xs}function Qs(e){let t=e.getBoundingClientRect(),n=U(e);if(te)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var $s={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ec={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},tc={disabled:!1,...ec},nc={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},rc={invalid:void 0,name:void 0,validityData:{state:$s,errors:[],error:``,value:``,initialValue:null},setValidityData:v,disabled:void 0,setTouched:v,setDirty:v,setFilled:v,setFocused:v,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:tc,registerFieldControl:v,validation:{getValidationProps:(e,t=b)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:v,getInputControl:()=>null,commit:async()=>{},change:v}},ic=s.createContext(rc);function ac(e=!0){let t=s.useContext(ic);if(t.setValidityData===v&&!e)throw Error(C(28));return t}var oc=s.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:v,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function sc(){return s.useContext(oc)}var cc=s.createContext({controlId:void 0,registerControlId:v,labelId:void 0,setLabelId:v,messageIds:[],setMessageIds:v,getDescriptionProps:e=>e});function lc(){return s.useContext(cc)}function uc(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=lc(),o=jo(t),c=n?i:void 0,u=l(()=>Symbol()),d=s.useRef(!1),f=s.useRef(t!=null),p=Z(()=>{!d.current||a===v||(d.current=!1,a(u.current,void 0))});return x(()=>{if(a===v)return;let e;if(n){let n=r?.current;e=G(n)&&n.closest(`label`)!=null?t??null:c??o}else if(t!=null)f.current=!0,e=t;else if(f.current)e=o;else{p();return}if(e===void 0){p();return}d.current=!0,a(u.current,e)},[t,r,c,a,n,o,u,p]),s.useEffect(()=>p,[p]),i??o}function dc(e,t,n,r,i=!0,a){let{registerFieldControl:o}=ac(),s=l(()=>Symbol());x(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),x(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var fc=s.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:S,validationMode:C,validation:w}=ac(),{clearErrors:T}=sc(),E=g||c,D=h??a,O={...m,disabled:E},{labelId:k}=lc(),A=uc({id:i});x(()=>{let e=o!=null;w.inputRef.current?.value||e&&o!==``?S(!0):e&&o===``&&S(!1)},[w.inputRef,S,o]);let j=s.useRef(null);x(()=>{d&&j.current===je(Q(j.current))&&b(!0)},[d,b]);let[M]=Fs({controlled:o,default:u,name:`FieldControl`,state:`value`}),N=o!==void 0,P=N?M:void 0,F=Z(()=>w.inputRef.current?.value);return dc(w.inputRef,A,P,F,!E,a),kr(`input`,e,{ref:[t,j],state:O,props:[{id:A,disabled:E,name:D,ref:w.inputRef,"aria-labelledby":k,autoFocus:d,...N?{value:P}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,ct(Ve,e.nativeEvent)),v(t!==(y.initialValue??``)),S(t!==``),e.nativeEvent.defaultPrevented||(T(D),w.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),C===`onBlur`&&w.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),w.commit(e.currentTarget.value))}},p,e=>w.getValidationProps(E,e)],stateAttributesMapping:nc})}),pc=s.forwardRef(function(e,t){return(0,$.jsx)(fc,{ref:t,...e})});function mc({className:e,type:t,...n}){return(0,$.jsx)(pc,{type:t,"data-slot":`input`,className:Jo(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var hc=`base-ui-disable-scrollbar`,gc={className:hc,getElement(e){return(0,$.jsx)(`style`,{nonce:e,href:hc,precedence:`base-ui:low`,children:`.${hc}{scrollbar-width:none}.${hc}::-webkit-scrollbar{display:none}`})}},_c=s.createContext(void 0),vc={disableStyleElements:!1};function yc(){return s.useContext(_c)??vc}function bc(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function xc(e,t){return Math.max(0,e-t)}function Sc(e,t){if(t<=0)return 0;let n=bc(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var Cc,wc,Tc=[],Ec=`cline-hub-webview-state`;function Dc(e){window.dispatchEvent(new MessageEvent(`message`,{data:e}))}function Oc(){return new URLSearchParams(window.location.search).get(`roomSecret`)?.trim()||void 0}function kc(){if(wc&&(wc.readyState===WebSocket.OPEN||wc.readyState===WebSocket.CONNECTING))return wc;let e=window.location.protocol===`https:`?`wss:`:`ws:`,t=new URLSearchParams,n=Oc();n&&t.set(`roomSecret`,n);let r=t.toString(),i=`${e}//${window.location.host}/browser${r?`?${r}`:``}`;return wc=new WebSocket(i),wc.addEventListener(`open`,()=>{for(let e of Tc.splice(0))wc?.send(JSON.stringify(e))}),wc.addEventListener(`message`,e=>{try{Dc(JSON.parse(String(e.data)))}catch{Tc.splice(0),Dc({type:`error`,text:`Received an invalid message from the Cline Hub server.`})}}),wc.addEventListener(`close`,()=>{Tc.splice(0),Dc({type:`status`,text:`Disconnected from the Cline Hub server.`})}),wc.addEventListener(`error`,()=>{Tc.splice(0),Dc({type:`error`,text:`Failed to connect to the Cline Hub server.`})}),wc}function Ac(){return{postMessage(e){let t=kc();if(t.readyState===WebSocket.OPEN){t.send(JSON.stringify(e));return}Tc.push(e)},getState(){try{let e=window.localStorage.getItem(Ec);return e?JSON.parse(e):void 0}catch{return}},setState(e){try{window.localStorage.setItem(Ec,JSON.stringify(e??{}))}catch{}}}}function jc(){return Cc||(typeof window.acquireVsCodeApi==`function`?(Cc=window.acquireVsCodeApi(),Cc):(Cc=Ac(),Cc))}function Mc(e){jc()?.postMessage(e)}export{ao as $,P as $n,kt as $t,Cs as A,He as An,Zr as At,Ko as B,J as Bn,hr as Bt,Fs as C,et as Cn,wa as Ct,Ds as D,it as Dn,li as Dt,Os as E,nt as En,ui as Et,is as F,Ie as Fn,Ur as Ft,ko as G,K as Gn,Mn as Gt,Ho as H,xe as Hn,or as Ht,rs as I,ze as In,Ir as It,Do as J,V as Jn,Ln as Jt,Ao as K,ye as Kn,Fn as Kt,ns as L,je as Ln,Lr as Lt,ys as M,Be as Mn,Xr as Mt,_s as N,Le as Nn,Kr as Nt,Es as O,We as On,Qr as Ot,hs as P,Ne as Pn,Wr as Pt,go as Q,I as Qn,jt as Qt,Jo as R,Y as Rn,Rr as Rt,Rs as S,tt as Sn,Oa as St,Ms as T,Ge as Tn,pi as Tt,No as U,U as Un,Hn as Ut,Go as V,Ce as Vn,pr as Vt,jo as W,G as Wn,Bn as Wt,xo as X,B as Xn,sn as Xt,vo as Y,ne as Yn,dn as Yt,_o as Z,z as Zn,an as Zt,nc as _,ot as _n,Pa as _t,bc as a,_t as an,x as ar,za as at,Vs as b,Ze as bn,ja as bt,mc as c,X as cn,v as cr,La as ct,lc as d,rt as dn,l as dr,Ka as dt,At as en,L as er,Za as et,sc as f,Je as fn,qa as ft,ec as g,Qe as gn,Fa as gt,ac as h,$e as hn,Wa as ht,Sc as i,Z as in,C as ir,Ia as it,bs as j,st as jn,Yr as jt,ws as k,Ue as kn,$r as kt,dc as l,ct as ln,h as lr,Va as lt,ic as m,at as mn,Ja as mt,Mc as n,Et as nn,D as nr,io as nt,yc as o,dt as on,y as or,Ua as ot,rc as p,qe as pn,Ra as pt,Oo as q,ae as qn,In as qt,xc as r,Dt as rn,w as rr,Ya as rt,gc as s,ut as sn,b as sr,Ha as st,jc as t,Q as tn,E as tr,Qa as tt,uc as u,lt as un,g as ur,Ga as ut,Zs as v,Ye as vn,Na as vt,Ps as w,Ve as wn,Xi as wt,Bs as x,Ke as xn,ka as xt,Ys as y,Xe as yn,Ma as yt,qo as z,Me as zn,kr as zt};