@p4code/cli 0.8.17 → 0.8.18

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 (294) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-C2OtBl3_.mjs → binCli-usgrWcNe.mjs} +150 -43
  3. package/dist/client/.vite/manifest.json +2143 -2143
  4. package/dist/client/assets/AlertDialogRoot-D6ed6zQR.js +2 -0
  5. package/dist/client/assets/{AnimatedHeight-CROd_m0y.js → AnimatedHeight-CO3_zEQw.js} +2 -2
  6. package/dist/client/assets/{AuthSurfaceShell-BFqgU6Cf.js → AuthSurfaceShell-BBPbK1uA.js} +2 -2
  7. package/dist/client/assets/{CSPContext-BUFNSYww.js → CSPContext-D8znCJtI.js} +2 -2
  8. package/dist/client/assets/{ChatGptUsageButton-CAkbdzVa.js → ChatGptUsageButton-Bda8Ir5S.js} +2 -2
  9. package/dist/client/assets/{ChatMarkdown-DRdUETgB.js → ChatMarkdown-BS1t8pnS.js} +4 -4
  10. package/dist/client/assets/{CheckboxIndicator-DS1cy5Y6.js → CheckboxIndicator-D-KUEtIm.js} +2 -2
  11. package/dist/client/assets/{CodexSetupSection.logic-B-Gs8BS6.js → CodexSetupSection.logic-Ed9SDkqP.js} +2 -2
  12. package/dist/client/assets/{CollapsiblePanel-DzlAN8vm.js → CollapsiblePanel-84e9KCIs.js} +2 -2
  13. package/dist/client/assets/{ComboboxClear-D3w2fM_m.js → ComboboxClear-FsZ2LcVw.js} +2 -2
  14. package/dist/client/assets/{CommandBlock-BaaPOUD7.js → CommandBlock-C7ASE_F_.js} +2 -2
  15. package/dist/client/assets/{ComposerPromptEditor-jeEkR9fy.js → ComposerPromptEditor-BGcYrFoa.js} +4 -4
  16. package/dist/client/assets/{CompositeRoot-r9p4LoiQ.js → CompositeRoot-fbPbFqqK.js} +2 -2
  17. package/dist/client/assets/{ConnectionStatusDot-C8T3Smus.js → ConnectionStatusDot-t_vHmaco.js} +2 -2
  18. package/dist/client/assets/{DevicePanel-BG2hk0i3.js → DevicePanel-CS1FTu-C.js} +2 -2
  19. package/dist/client/assets/{DeviceSetup-CKZmblju.js → DeviceSetup-DZAK0_tm.js} +2 -2
  20. package/dist/client/assets/{DialogTitle-Bs5Povma.js → DialogTitle-DnR18OB7.js} +2 -2
  21. package/dist/client/assets/{DiffCommentAnnotation-CX8scC3B.js → DiffCommentAnnotation-Br9sOo_6.js} +2 -2
  22. package/dist/client/assets/{DiffFileTree-BnizHv7v.js → DiffFileTree-DkLJXYZf.js} +2 -2
  23. package/dist/client/assets/{DiffPanel-DxnHaLb1.js → DiffPanel-CGV12wM6.js} +2 -2
  24. package/dist/client/assets/{DiffWorkerPoolProvider-Bn4H-Zao.js → DiffWorkerPoolProvider-DydpPFgM.js} +2 -2
  25. package/dist/client/assets/{EmbeddedDesign-BiW8ewmO.js → EmbeddedDesign--Xz14U92.js} +2 -2
  26. package/dist/client/assets/{EnvironmentMachineIcon-DKzRVCQ4.js → EnvironmentMachineIcon-BMWCDR69.js} +2 -2
  27. package/dist/client/assets/{ExpandableText-BanCMyot.js → ExpandableText-B6Dvgn62.js} +2 -2
  28. package/dist/client/assets/{FieldControl-s_wzlnCP.js → FieldControl-CVOjReHh.js} +2 -2
  29. package/dist/client/assets/{FileDiff-BTx35t8y.js → FileDiff-Dhyt7ZAJ.js} +2 -2
  30. package/dist/client/assets/{FilePreviewPanel-Cii41zwQ.js → FilePreviewPanel-8tUtMikb.js} +2 -2
  31. package/dist/client/assets/{FoldedSettingsSection-BW3s8OMk.js → FoldedSettingsSection-Clo0JgyS.js} +2 -2
  32. package/dist/client/assets/{FormContext-CUlgAi-q.js → FormContext--axmNCbu.js} +2 -2
  33. package/dist/client/assets/{Icons-3I0QXv0W.js → Icons-BYSK3arN.js} +2 -2
  34. package/dist/client/assets/Input-CVwvVqbx.js +2 -0
  35. package/dist/client/assets/{KeybindingsSettings.logic-CSyJIpFu.js → KeybindingsSettings.logic-30fwcukL.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero-Cbnk6tn0.js → NoProjectsHero-Lsb9cuvO.js} +2 -2
  37. package/dist/client/assets/{PanelLayoutControls-Cyag4Tur.js → PanelLayoutControls-DL7sleZ-.js} +4 -4
  38. package/dist/client/assets/{PierreEntryIcon-C5vp6j29.js → PierreEntryIcon-DKHnMJOl.js} +2 -2
  39. package/dist/client/assets/{PopoverHandle-CgOyoBVs.js → PopoverHandle-C-e81PS3.js} +2 -2
  40. package/dist/client/assets/{PreviewPanel-CZ_Qxxvo.js → PreviewPanel-DmaoFTEA.js} +2 -2
  41. package/dist/client/assets/{ProjectDefaultsSettings-BIEY8BOO.js → ProjectDefaultsSettings-CrKY01_P.js} +2 -2
  42. package/dist/client/assets/{ProjectFavicon-DU8VbXX4.js → ProjectFavicon-B5C6TpKj.js} +3 -3
  43. package/dist/client/assets/{ProjectIconPickerDialog-CK8qpgyz.js → ProjectIconPickerDialog-Bxa9i4w_.js} +2 -2
  44. package/dist/client/assets/{ProjectMonogram-BaA9dKQy.js → ProjectMonogram-CYD6eMbI.js} +2 -2
  45. package/dist/client/assets/{ProviderAuthTerminal-AH-Cy_pb.js → ProviderAuthTerminal-Cm88QElc.js} +2 -2
  46. package/dist/client/assets/{ProviderModelPicker-wOdtIBVW.js → ProviderModelPicker-CeB11O3P.js} +2 -2
  47. package/dist/client/assets/{ProviderSettingsForm-DXzJoQR9.js → ProviderSettingsForm-CLYzJJII.js} +2 -2
  48. package/dist/client/assets/{PullRequestCodeTab-CkE2ul9K.js → PullRequestCodeTab-BqH4glgo.js} +2 -2
  49. package/dist/client/assets/{ReadOnlySourcePreview-CBGeBLfB.js → ReadOnlySourcePreview-D2Vkrzyc.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-CgWfZhV9.js → RenderErrorBoundary-BgOA8qma.js} +2 -2
  51. package/dist/client/assets/{ScheduledTasksSettings-CykPbEbT.js → ScheduledTasksSettings-BMQ-_Rms.js} +2 -2
  52. package/dist/client/assets/{ScopedSwitch-Bk5kVayQ.js → ScopedSwitch-BrJEJr8I.js} +2 -2
  53. package/dist/client/assets/{ScrollAreaCorner-CxSOla7S.js → ScrollAreaCorner-BYUnXNwJ.js} +2 -2
  54. package/dist/client/assets/{SecretInput-6K6o0z_j.js → SecretInput-CIbdWrQZ.js} +2 -2
  55. package/dist/client/assets/{SelectScrollUpArrow-DKwyzFlM.js → SelectScrollUpArrow-Cr4PrE_F.js} +2 -2
  56. package/dist/client/assets/{SettingsPanels-CzHOdmoE.js → SettingsPanels-B8q4OSW7.js} +2 -2
  57. package/dist/client/assets/{SettingsPanels.logic-B9MzQwrf.js → SettingsPanels.logic-C5FkY28P.js} +2 -2
  58. package/dist/client/assets/{SettingsScopeNotice-ml10Xbs_.js → SettingsScopeNotice-_WSLtOW4.js} +2 -2
  59. package/dist/client/assets/{T3ConnectAccountPages-DORAp_V3.js → T3ConnectAccountPages-DDSM7QWS.js} +2 -2
  60. package/dist/client/assets/{T3ConnectSidebarSignIn-D4iDcrjK.js → T3ConnectSidebarSignIn-GnkVas23.js} +2 -2
  61. package/dist/client/assets/{ThemeEditorPanel-BiB-1tTU.js → ThemeEditorPanel-DB8D5_6u.js} +2 -2
  62. package/dist/client/assets/{ThreadTerminalDrawer-E3tgtH2-.js → ThreadTerminalDrawer-4huAp-uS.js} +2 -2
  63. package/dist/client/assets/{TooltipViewport-A4hJLsA1.js → TooltipViewport-kqulS2nz.js} +2 -2
  64. package/dist/client/assets/{Virtualizer-YZrA28xX.js → Virtualizer-DjBOkz4F.js} +2 -2
  65. package/dist/client/assets/{WorkspaceBreadcrumb-DRyODQoe.js → WorkspaceBreadcrumb-ClxInGsT.js} +2 -2
  66. package/dist/client/assets/{WorkspacePageContainer-C9d1CC0F.js → WorkspacePageContainer-DwN_ETF0.js} +2 -2
  67. package/dist/client/assets/{WorkspacePageHeader-cjFWAiFR.js → WorkspacePageHeader-BvKCy7v2.js} +2 -2
  68. package/dist/client/assets/{_chat-DcFCVkrG.js → _chat-C2VZmKVT.js} +5 -5
  69. package/dist/client/assets/{_chat.index-D1edR5Y7.js → _chat.index-CQSbFMBa.js} +2 -2
  70. package/dist/client/assets/{_chat.new-CNtY6xfX.js → _chat.new-BxObe9FX.js} +2 -2
  71. package/dist/client/assets/{_chat.pull-requests-B9gYbv3C.js → _chat.pull-requests-JS9EZDI7.js} +2 -2
  72. package/dist/client/assets/{abnfDiagram-VCTEODGH-Bg9Y0ptm.js → abnfDiagram-VCTEODGH-Cv0dw1u8.js} +2 -2
  73. package/dist/client/assets/{alert-C9G2MwuB.js → alert-DYmkyE3l.js} +2 -2
  74. package/dist/client/assets/architecture-7GRP2DOG-Dd1d-ckm.js +1 -0
  75. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DaFWEoVm.js → architectureDiagram-5GKGNRK7-BvQMjhmC.js} +2 -2
  76. package/dist/client/assets/{assets-BngUvpba.js → assets-COg7jyyX.js} +2 -2
  77. package/dist/client/assets/{blockDiagram-I7D4REHJ-BLFoCG7i.js → blockDiagram-I7D4REHJ-DR7f58YJ.js} +2 -2
  78. package/dist/client/assets/{browserHistoryStore-D3jg6lW0.js → browserHistoryStore-_SurQa0e.js} +2 -2
  79. package/dist/client/assets/{browserLinkTarget-BTsZgYV0.js → browserLinkTarget-Bp-zUm0R.js} +2 -2
  80. package/dist/client/assets/{c4Diagram-7LVT6UL2-DI-I8wOH.js → c4Diagram-7LVT6UL2-zgFjNACn.js} +2 -2
  81. package/dist/client/assets/channel-Dsne2IjR.js +2 -0
  82. package/dist/client/assets/{checkbox-BMrBwYAj.js → checkbox-brLYzznm.js} +2 -2
  83. package/dist/client/assets/{chunk-4HAMMTFA-DJYGf4Ym.js → chunk-4HAMMTFA-Q6ZY3Aj6.js} +2 -2
  84. package/dist/client/assets/{chunk-75Z2AOVW-BHc4yRCt.js → chunk-75Z2AOVW-Dv4NtCmQ.js} +2 -2
  85. package/dist/client/assets/{chunk-DU6HZSFF-CxeiyFio.js → chunk-DU6HZSFF-D-pyRDMG.js} +2 -2
  86. package/dist/client/assets/{chunk-F27PBJKO-CoBuXptu.js → chunk-F27PBJKO-BOXrNdwG.js} +2 -2
  87. package/dist/client/assets/{chunk-GMAD6QVW-Djtqr7wA.js → chunk-GMAD6QVW-uYd_Q5lX.js} +2 -2
  88. package/dist/client/assets/{chunk-GVQU2GXP-B_dZvf-D.js → chunk-GVQU2GXP-C3aAR6o_.js} +2 -2
  89. package/dist/client/assets/{chunk-IMKFNOWR-CIZUn2vm.js → chunk-IMKFNOWR-CbCHd80E.js} +2 -2
  90. package/dist/client/assets/{chunk-L3NEJ4N5-DMIPUTzl.js → chunk-L3NEJ4N5-B5jDlsms.js} +2 -2
  91. package/dist/client/assets/{chunk-OSK3NFVY-8kOFeAYp.js → chunk-OSK3NFVY-DgNZQb8q.js} +2 -2
  92. package/dist/client/assets/{chunk-P2QGCYS3-CRs2CVdk.js → chunk-P2QGCYS3-ptp4LKHi.js} +2 -2
  93. package/dist/client/assets/{chunk-POPQ4Y6H-BF0zVulS.js → chunk-POPQ4Y6H-CRBmOW8B.js} +2 -2
  94. package/dist/client/assets/{chunk-PWAF6VOD-pAkrbks5.js → chunk-PWAF6VOD-DHkc8IcS.js} +2 -2
  95. package/dist/client/assets/{chunk-SHT3W25Y-XA9rgPJk.js → chunk-SHT3W25Y-B5XMb9ST.js} +2 -2
  96. package/dist/client/assets/{chunk-SVP7TREG-BLPEkz6O.js → chunk-SVP7TREG-Lt0ZENIq.js} +2 -2
  97. package/dist/client/assets/{chunk-TICWLB2K-BDX6zFln.js → chunk-TICWLB2K-BhZt3DVX.js} +2 -2
  98. package/dist/client/assets/classDiagram-ZZMXUADV-Dazl0CLN.js +2 -0
  99. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Dazl0CLN.js +2 -0
  100. package/dist/client/assets/{color-picker-CHpDpF1q.js → color-picker-D7d1go0g.js} +2 -2
  101. package/dist/client/assets/{combobox-DsEnX06q.js → combobox-DSVavlIH.js} +2 -2
  102. package/dist/client/assets/{command-7JZ4jreB.js → command-DsE3Ju6m.js} +2 -2
  103. package/dist/client/assets/{connect-CrLJN7lo.js → connect-C39BhZ-c.js} +2 -2
  104. package/dist/client/assets/{connect-agent-iD4mBU_q.js → connect-agent-Dj_Cfdx6.js} +2 -2
  105. package/dist/client/assets/{cynefin-OW5HDTMX-BPbkuuD0.js → cynefin-OW5HDTMX-CNKdS-0M.js} +1 -1
  106. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Tg7_4aNX.js → cynefinDiagram-5FMLGOSQ-CoFxzJSW.js} +2 -2
  107. package/dist/client/assets/{dagre-GXQ25YYZ-BO8vBn--.js → dagre-GXQ25YYZ-q0omC4bc.js} +2 -2
  108. package/dist/client/assets/{device-D7crohVQ.js → device-CWgOLpbF.js} +2 -2
  109. package/dist/client/assets/{diagram-S7CK7UJ4-Cw7tf93w.js → diagram-S7CK7UJ4-CdFkGs_B.js} +2 -2
  110. package/dist/client/assets/{diagram-UQ7AKVKN-CWCxivXY.js → diagram-UQ7AKVKN-B0KtokqT.js} +2 -2
  111. package/dist/client/assets/{diagram-VSXAHHWV-obA2VrFx.js → diagram-VSXAHHWV-DjtTeImL.js} +2 -2
  112. package/dist/client/assets/{diagram-VX7I27RA-BZZX0tDC.js → diagram-VX7I27RA-DRYLlkkf.js} +2 -2
  113. package/dist/client/assets/{diagram-Z3DM3KII-BXgCa2au.js → diagram-Z3DM3KII-C-x2EfL6.js} +2 -2
  114. package/dist/client/assets/{dialog-DWCEeJ2c.js → dialog-DYFQxVoN.js} +2 -2
  115. package/dist/client/assets/{diffRendering-BAlsKvkZ.js → diffRendering-6DuM2rGF.js} +2 -2
  116. package/dist/client/assets/{discovery-list-BaMSF62J.js → discovery-list-BvblDG7m.js} +2 -2
  117. package/dist/client/assets/{dist-CtlrzKKg.js → dist-CkgAUeqn.js} +3 -3
  118. package/dist/client/assets/{draft-input-DZZB4KBb.js → draft-input-27erQjx_.js} +2 -2
  119. package/dist/client/assets/{duoViewer-BDT5Pw1R.js → duoViewer-CBnLVCTt.js} +2 -2
  120. package/dist/client/assets/{dynamic-B_1SDXVm.js → dynamic-Cjr9H8t4.js} +2 -2
  121. package/dist/client/assets/{ebnfDiagram-PWID7BFC-C79a3o-h.js → ebnfDiagram-PWID7BFC-UISo4OT-.js} +2 -2
  122. package/dist/client/assets/{embeddedScripts-DWtZjYSD.js → embeddedScripts-Dr-tOtuJ.js} +2 -2
  123. package/dist/client/assets/{empty-CdigxFIr.js → empty-2jxBvPLn.js} +2 -2
  124. package/dist/client/assets/{entities-Cri9JXzU.js → entities-DCbEYTvn.js} +2 -2
  125. package/dist/client/assets/{environments-CXLCfPlP.js → environments-iW64jjyO.js} +2 -2
  126. package/dist/client/assets/{erDiagram-RLTQ6QDP-C_C_xUYl.js → erDiagram-RLTQ6QDP-CeWlUdOf.js} +2 -2
  127. package/dist/client/assets/eventmodeling-NTZA5JFV-B5z8GPGl.js +1 -0
  128. package/dist/client/assets/{fileLinks-gi8wmjAc.js → fileLinks-5NSgRKPU.js} +2 -2
  129. package/dist/client/assets/{fileTreeExpansion-By588Tlp.js → fileTreeExpansion-CA6c4E3-.js} +2 -2
  130. package/dist/client/assets/flowDiagram-HODETNUW-CEpweBDE.js +1 -0
  131. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-vDMTogcH.js → ganttDiagram-EL5Y4UJY-KPPMvqNL.js} +2 -2
  132. package/dist/client/assets/{getDiffFileInput-B20LTLvK.js → getDiffFileInput-CuM1lgsL.js} +2 -2
  133. package/dist/client/assets/{gitGraph-4MIJSDKK-CP2HybJj.js → gitGraph-4MIJSDKK-BGSFaZro.js} +1 -1
  134. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-okkWrJG2.js → gitGraphDiagram-WWUBYQGX-CwYf9r63.js} +2 -2
  135. package/dist/client/assets/{guideRunStore-BuNfL9zT.js → guideRunStore-B3Y6e_nf.js} +2 -2
  136. package/dist/client/assets/{htmlRender-B0nsPoF5.js → htmlRender-BaqdfJ6m.js} +2 -2
  137. package/dist/client/assets/{index-C4eY-csp.js → index-DmPPPGJb.js} +3 -3
  138. package/dist/client/assets/{info-A6RAGUB7-RHhd5N_M.js → info-A6RAGUB7-C831OtOR.js} +1 -1
  139. package/dist/client/assets/{infoDiagram-27XIBGKW-YzE38gXg.js → infoDiagram-27XIBGKW-DVstIW76.js} +2 -2
  140. package/dist/client/assets/{input-RCV7-UKX.js → input-83N8btBC.js} +2 -2
  141. package/dist/client/assets/{input-group-Bcuxz_AQ.js → input-group-Q757vhrD.js} +2 -2
  142. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-Sz6NR02e.js → ishikawaDiagram-5VMMS53U-CJq0N-AL.js} +2 -2
  143. package/dist/client/assets/{journeyDiagram-3NMN7TZE-BQjnHIg3.js → journeyDiagram-3NMN7TZE-D76KCD6f.js} +2 -2
  144. package/dist/client/assets/{kanban-definition-UXKFOSKX-DZUIDXIB.js → kanban-definition-UXKFOSKX-D1kzRMIP.js} +2 -2
  145. package/dist/client/assets/{kbd-CIJ2_Q5W.js → kbd-D8UfTN0o.js} +2 -2
  146. package/dist/client/assets/{keybindings-BpKkzV__.js → keybindings-DLDyoB30.js} +2 -2
  147. package/dist/client/assets/{lazyRouteComponent-BRNgDsba.js → lazyRouteComponent-BCGAjyjO.js} +2 -2
  148. package/dist/client/assets/{line-D2YW2WaY.js → line-QHGhF6Vm.js} +2 -2
  149. package/dist/client/assets/{link-D4TtDnqi.js → link-Bgj44djS.js} +2 -2
  150. package/dist/client/assets/{linkedPrompt-1QsAG0gO.js → linkedPrompt-D1aW6nV5.js} +2 -2
  151. package/dist/client/assets/{main-Co3JeKTg.js → main-lV-t-UZx.js} +7 -7
  152. package/dist/client/assets/{mediaReference-BUHO9ICD.js → mediaReference-CQtke4j3.js} +2 -2
  153. package/dist/client/assets/{mediaSource-CHFugA8_.js → mediaSource-CI2bKK3n.js} +2 -2
  154. package/dist/client/assets/{mermaid-parser.core-Ch6yrkIv.js → mermaid-parser.core-Brqe55KM.js} +4 -4
  155. package/dist/client/assets/{mermaid.core-CDUpMNay.js → mermaid.core-Cdl6aiT5.js} +5 -5
  156. package/dist/client/assets/{mindmap-definition-YA3MSWOX-J5u85Ham.js → mindmap-definition-YA3MSWOX-CcdCCRbd.js} +2 -2
  157. package/dist/client/assets/{number-field-Osl5PZkX.js → number-field-DQIrEOoj.js} +2 -2
  158. package/dist/client/assets/{observeResize-BeeOdDdQ.js → observeResize-BaPAtI3Q.js} +2 -2
  159. package/dist/client/assets/{onboarding-BF9yT3Xi.js → onboarding-ObMsA9VF.js} +2 -2
  160. package/dist/client/assets/{openFileInPreview-C15eoyYZ.js → openFileInPreview-CdBR5kuZ.js} +2 -2
  161. package/dist/client/assets/{p4ProjectFile-CAKJOMUN.js → p4ProjectFile--u7SOSK5.js} +2 -2
  162. package/dist/client/assets/{packet-AYTQ26CC-Cs25hnS9.js → packet-AYTQ26CC-BSuHbq7S.js} +1 -1
  163. package/dist/client/assets/{pair-BA6LcmsK.js → pair-C11lrlzi.js} +2 -2
  164. package/dist/client/assets/{pegDiagram-XKGWAZYB-BMn57iOd.js → pegDiagram-XKGWAZYB-Iy9neoGN.js} +2 -2
  165. package/dist/client/assets/{phoneViewer-C-9G9sMe.js → phoneViewer-iqsNqM8D.js} +2 -2
  166. package/dist/client/assets/{pie-WAS4IAKB-DSKy_d1u.js → pie-WAS4IAKB-BlC5Ctcv.js} +1 -1
  167. package/dist/client/assets/{pieDiagram-E7YTZNPT-DJxOVDr9.js → pieDiagram-E7YTZNPT-CtVgATJF.js} +2 -2
  168. package/dist/client/assets/{pierre-icons-Cp8tJJSF.js → pierre-icons-fSsw9aa-.js} +2 -2
  169. package/dist/client/assets/{popover-B70_-gBS.js → popover-B1MF5i1c.js} +2 -2
  170. package/dist/client/assets/{preview-BHYM-_BL.js → preview-DwLWkMZG.js} +2 -2
  171. package/dist/client/assets/{preview-Dj_ac_jZ.js → preview-ITad1JAy.js} +2 -2
  172. package/dist/client/assets/{previewMiniPlayerStore-DX9IKNL3.js → previewMiniPlayerStore-DN-AYBed.js} +2 -2
  173. package/dist/client/assets/{primary-DHlSwiw_.js → primary-8A8hvHFL.js} +2 -2
  174. package/dist/client/assets/{primaryCloudLinkState-LOtU3kc-.js → primaryCloudLinkState-BP-HZzf2.js} +2 -2
  175. package/dist/client/assets/{projectFilesQueryState-DPo8i5yD.js → projectFilesQueryState-CGllQp_V.js} +2 -2
  176. package/dist/client/assets/{projectScriptEditor-By8EdSYw.js → projectScriptEditor-DwqFzld2.js} +2 -2
  177. package/dist/client/assets/{providerSkills-mKD6o1i5.js → providerSkills-O72EMm0V.js} +2 -2
  178. package/dist/client/assets/{pullRequestDetail.logic-B2AL8Xka.js → pullRequestDetail.logic-CkxKh0fV.js} +2 -2
  179. package/dist/client/assets/{pullRequestIcons-B2-CZ5Ci.js → pullRequestIcons-CSZus-cz.js} +2 -2
  180. package/dist/client/assets/{pullRequestReviewStore-CxOHaJ2U.js → pullRequestReviewStore-78f71w6J.js} +2 -2
  181. package/dist/client/assets/{pullRequests-DDmSd4bP.js → pullRequests-7IQc0VIk.js} +2 -2
  182. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DE0d6o0C.js → quadrantDiagram-AXDQQJYC-kq18RP_F.js} +2 -2
  183. package/dist/client/assets/{queries-DqFudp6N.js → queries-DCKH7ltg.js} +2 -2
  184. package/dist/client/assets/{query-1tRB9OB0.js → query-B1uAr_ii.js} +2 -2
  185. package/dist/client/assets/{radar-RG4KPBEZ-DveMwSB8.js → radar-RG4KPBEZ-Cbkq33o2.js} +1 -1
  186. package/dist/client/assets/{radio-group-BDPDnH4m.js → radio-group-CFJMQH66.js} +2 -2
  187. package/dist/client/assets/{railroad-74A4TZTK-7mru9krG.js → railroad-74A4TZTK-Ba3TZ4Wg.js} +1 -1
  188. package/dist/client/assets/railroad-abnf-HS5TGJTU-l3gFfdc2.js +1 -0
  189. package/dist/client/assets/railroad-ebnf-LZEXJU2U-eiWL8AW4.js +1 -0
  190. package/dist/client/assets/railroad-peg-WCYAUIDC-UK0E-Txe.js +1 -0
  191. package/dist/client/assets/{railroadDiagram-O6MQD6OU-bAzEpkUJ.js → railroadDiagram-O6MQD6OU-BfOnyiaT.js} +2 -2
  192. package/dist/client/assets/{renderScheduler-DM1wgh78.js → renderScheduler-CcWhS7Yq.js} +2 -2
  193. package/dist/client/assets/{requirementDiagram-BXWQKSXE-ClHxFUNg.js → requirementDiagram-BXWQKSXE-DFzAGiJp.js} +2 -2
  194. package/dist/client/assets/{rightPanelStore-DNohe5X6.js → rightPanelStore-DfMWWfvR.js} +2 -2
  195. package/dist/client/assets/runtime-B5cKWtKn.js +2 -0
  196. package/dist/client/assets/{runtime-B7jXrsPs.js → runtime-B9IDNXDU.js} +3 -3
  197. package/dist/client/assets/{runtimeModeConfig-D044rsFH.js → runtimeModeConfig-C3TbI2qR.js} +2 -2
  198. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BwX1Wn_u.js → sankeyDiagram-P5KCCOFB-D9gFGibV.js} +2 -2
  199. package/dist/client/assets/{scheduledTasksSettings.logic-Bw_obRa9.js → scheduledTasksSettings.logic-DVbZRIYJ.js} +2 -2
  200. package/dist/client/assets/{scroll-area-Ckz2bO0L.js → scroll-area-DGS0jgnh.js} +2 -2
  201. package/dist/client/assets/{select-DWT2vKJH.js → select-Dsx46akG.js} +2 -2
  202. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BSpw0E5m.js → sequenceDiagram-WJ2MYXX4-C9pRaNT5.js} +2 -2
  203. package/dist/client/assets/{server-B0y-CZn0.js → server-CoH7V4JL.js} +2 -2
  204. package/dist/client/assets/{session-eKfJi_Kx.js → session-Bo2ZSprC.js} +2 -2
  205. package/dist/client/assets/{session-logic-BAndUZwA.js → session-logic-C4wGF3_E.js} +2 -2
  206. package/dist/client/assets/{settings-D_eUqlLu.js → settings-mrxLMm57.js} +2 -2
  207. package/dist/client/assets/{settings.appearance-kTWXGfao.js → settings.appearance-6ktu9wdJ.js} +2 -2
  208. package/dist/client/assets/settings.archived-Hl4HyrFx.js +2 -0
  209. package/dist/client/assets/{settings.computer-use-BuDMoYe7.js → settings.computer-use-C24sO93u.js} +2 -2
  210. package/dist/client/assets/{settings.connections-DwruajVk.js → settings.connections-CgaYGg_W.js} +2 -2
  211. package/dist/client/assets/{settings.data-controls-Ew7ogbgL.js → settings.data-controls-DNY0fL9E.js} +2 -2
  212. package/dist/client/assets/{settings.decisions-rppoMBkE.js → settings.decisions-kar2kv7T.js} +2 -2
  213. package/dist/client/assets/{settings.diagnostics-BcNTndhm.js → settings.diagnostics-BHSEPjF8.js} +2 -2
  214. package/dist/client/assets/{settings.general-D1vnEzQa.js → settings.general-C1zsJgwK.js} +2 -2
  215. package/dist/client/assets/{settings.integrations-DKEJMS6o.js → settings.integrations-DykwmCf7.js} +2 -2
  216. package/dist/client/assets/{settings.keybindings-BstDnaeV.js → settings.keybindings-CYcsJ6DQ.js} +2 -2
  217. package/dist/client/assets/{settings.open-source-licenses-s96NzjdF.js → settings.open-source-licenses-DnBHlZE2.js} +2 -2
  218. package/dist/client/assets/settings.plugins-B7Nlb85S.js +5 -0
  219. package/dist/client/assets/{settings.projects-BQBJ0eQ0.js → settings.projects-Ob8jKbIh.js} +3 -3
  220. package/dist/client/assets/{settings.providers-C-R4_ra0.js → settings.providers-BIm-8j9C.js} +3 -3
  221. package/dist/client/assets/{settings.scheduled-tasks-WuxBbfP4.js → settings.scheduled-tasks-Bf37L1OK.js} +2 -2
  222. package/dist/client/assets/{settings.snap-shot-D-GpjQxg.js → settings.snap-shot-D37zM8an.js} +2 -2
  223. package/dist/client/assets/{settings.source-control-D_Ipwyto.js → settings.source-control-DmRUgcsk.js} +2 -2
  224. package/dist/client/assets/{settings.storage-DHtjVWHK.js → settings.storage-DmbTXujz.js} +2 -2
  225. package/dist/client/assets/{settingsLayout-B_Bq9Cq9.js → settingsLayout-CqGfrbmD.js} +2 -2
  226. package/dist/client/assets/{sidebar-m0COIl9s.js → sidebar-C_I_pq_E.js} +2 -2
  227. package/dist/client/assets/{sidebarProjectGrouping-BpwyF0h8.js → sidebarProjectGrouping-DrnsFA8t.js} +2 -2
  228. package/dist/client/assets/{skeleton-DxoA_uLH.js → skeleton-0mC3wMw1.js} +2 -2
  229. package/dist/client/assets/{sortable.esm-DAcHa5SQ.js → sortable.esm-DuAaqmgD.js} +2 -2
  230. package/dist/client/assets/{sourceControl-C-R8wmTp.js → sourceControl-D6TEHNpa.js} +2 -2
  231. package/dist/client/assets/{spinner-B1oJASgu.js → spinner-DHOdl-gn.js} +2 -2
  232. package/dist/client/assets/{standalone-page-OuNLgPqS.js → standalone-page-Dx8vGwaJ.js} +2 -2
  233. package/dist/client/assets/{stateDiagram-D77RDMKH-DjLNu-aO.js → stateDiagram-D77RDMKH-D8n56CID.js} +2 -2
  234. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DqXgq-FS.js +2 -0
  235. package/dist/client/assets/{swimlanes-42K2YHIH-BAlKsUJH.js → swimlanes-42K2YHIH-DZZct2ih.js} +2 -2
  236. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DAX63YhZ.js +9 -0
  237. package/dist/client/assets/{terminal-links-B7jzSUaR.js → terminal-links-Di9Ijg8X.js} +2 -2
  238. package/dist/client/assets/{terminalSessions-CHAAF5wF.js → terminalSessions-B8EDcX8b.js} +2 -2
  239. package/dist/client/assets/{textarea-B86ZyXzK.js → textarea-BvPoR1cI.js} +2 -2
  240. package/dist/client/assets/{themePalette-BAR7Sc97.js → themePalette-zFOiBKDi.js} +2 -2
  241. package/dist/client/assets/{threadSort-Dnq059Z5.js → threadSort-Cn23YHH2.js} +2 -2
  242. package/dist/client/assets/{timeline-definition-24CTP7MA-YXaIoqb6.js → timeline-definition-24CTP7MA-BGfuRztb.js} +2 -2
  243. package/dist/client/assets/{toast-e2DHftFl.js → toast-CN7Jd-pG.js} +2 -2
  244. package/dist/client/assets/{toggle-D4IMx5jG.js → toggle-DeCGfzT2.js} +2 -2
  245. package/dist/client/assets/{toggle-group-BWnqiNcg.js → toggle-group-DekLc0Ax.js} +2 -2
  246. package/dist/client/assets/{tooltip-DRGG_vM1.js → tooltip-DaSC-3cL.js} +2 -2
  247. package/dist/client/assets/{treeView-Q6P3EWNA-BKHL242s.js → treeView-Q6P3EWNA-BPM2x-ME.js} +1 -1
  248. package/dist/client/assets/{treemap-WGGIJYW6-DKZHfhNz.js → treemap-WGGIJYW6-sku0fChI.js} +1 -1
  249. package/dist/client/assets/{usage-DZw1xQLa.js → usage-CKRSqJso.js} +2 -2
  250. package/dist/client/assets/{usageAccess-DLbz2bdv.js → usageAccess-BGb3m0YV.js} +2 -2
  251. package/dist/client/assets/{usageFormat-CzWB9UsH.js → usageFormat-H-RgZ0fy.js} +2 -2
  252. package/dist/client/assets/{usageShortcuts-DAEm4s6Q.js → usageShortcuts-C320W17X.js} +2 -2
  253. package/dist/client/assets/{use-atom-command-BEpD82FZ.js → use-atom-command-GpCw1tWF.js} +2 -2
  254. package/dist/client/assets/{useAriaLabelledBy-D6y1qpkp.js → useAriaLabelledBy-C8nSWyQ9.js} +2 -2
  255. package/dist/client/assets/{useHandleNewThread-6AAzzJsA.js → useHandleNewThread-FJLPEfoH.js} +2 -2
  256. package/dist/client/assets/{useLocation-X2uUveT9.js → useLocation-Ccsih1eo.js} +2 -2
  257. package/dist/client/assets/useNavigate-Dhy_1-Mg.js +2 -0
  258. package/dist/client/assets/{useNavigateBack-DoGrCk85.js → useNavigateBack-PnWVFtkU.js} +2 -2
  259. package/dist/client/assets/{useParams-Bschqkhl.js → useParams-CoeDewwU.js} +2 -2
  260. package/dist/client/assets/{usePermissionStatus-DFa5P3Vr.js → usePermissionStatus-mBtsOu9K.js} +2 -2
  261. package/dist/client/assets/{usePullRequestActions-FCnq9KIj.js → usePullRequestActions-_K7fD4Ny.js} +2 -2
  262. package/dist/client/assets/{useRegisterFieldControl-BgyE4_OV.js → useRegisterFieldControl-9rSmWR2W.js} +2 -2
  263. package/dist/client/assets/{useScopedModelAvailability-B8VSCR9i.js → useScopedModelAvailability-DE1E_lbg.js} +2 -2
  264. package/dist/client/assets/{useSettings-CUN8qNLl.js → useSettings-CKA-LDDj.js} +2 -2
  265. package/dist/client/assets/{useT3ConnectAuthPrompt-BgqISbBe.js → useT3ConnectAuthPrompt-ZyPZIXm7.js} +2 -2
  266. package/dist/client/assets/utils-BAPnqm16.js +37 -0
  267. package/dist/client/assets/{vcsRefInvalidation-BWvsbPLB.js → vcsRefInvalidation-DfCz0cGO.js} +2 -2
  268. package/dist/client/assets/{vennDiagram-4TSXK5OY-BN0NlVtY.js → vennDiagram-4TSXK5OY-CjhblZp4.js} +2 -2
  269. package/dist/client/assets/{wardley-WFR3VGLG-DWpJUQkf.js → wardley-WFR3VGLG-Cuf_pn9-.js} +1 -1
  270. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-C_2_0OtT.js → wardleyDiagram-VM6X3IG4-CMQ-_cYv.js} +2 -2
  271. package/dist/client/assets/{welcome-CT583VDG.js → welcome-nE6tva7L.js} +2 -2
  272. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-gSixBfkr.js → xychartDiagram-S5SC5T6Z-BlCqmJgA.js} +2 -2
  273. package/dist/client/index.html +1 -1
  274. package/dist/{renderer-B8qsc7RL.mjs → renderer-7OJ6c0Me.mjs} +2 -2
  275. package/dist/{runtime-CEdmfdaF.mjs → runtime-BHqdsO3Y.mjs} +35 -6
  276. package/package.json +1 -1
  277. package/dist/client/assets/AlertDialogRoot-C4_VBb4J.js +0 -2
  278. package/dist/client/assets/Input-D-VEMFtp.js +0 -2
  279. package/dist/client/assets/architecture-7GRP2DOG-B_DOBvMT.js +0 -1
  280. package/dist/client/assets/channel-D77117oc.js +0 -2
  281. package/dist/client/assets/classDiagram-ZZMXUADV-BOfzjSR1.js +0 -2
  282. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BOfzjSR1.js +0 -2
  283. package/dist/client/assets/eventmodeling-NTZA5JFV-BBNrMOto.js +0 -1
  284. package/dist/client/assets/flowDiagram-HODETNUW-DE4e8-KT.js +0 -1
  285. package/dist/client/assets/railroad-abnf-HS5TGJTU-Ch23A2t1.js +0 -1
  286. package/dist/client/assets/railroad-ebnf-LZEXJU2U-D0diYlkX.js +0 -1
  287. package/dist/client/assets/railroad-peg-WCYAUIDC-CnUWPGXT.js +0 -1
  288. package/dist/client/assets/runtime-B75ae48c.js +0 -2
  289. package/dist/client/assets/settings.archived-By7wX_fc.js +0 -2
  290. package/dist/client/assets/settings.plugins--hNL0lcF.js +0 -5
  291. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Cx2Qu8wY.js +0 -2
  292. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-euVkUgFA.js +0 -9
  293. package/dist/client/assets/useNavigate-B7cVsvjL.js +0 -2
  294. package/dist/client/assets/utils-BgVDKR83.js +0 -37
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$a as n,$i as r,Ca as i,Eo as a,Fa as o,Ia as s,Ln as c,NE as l,Na as u,Nn as d,Pn as f,Pp as p,Qa as m,Ra as h,Sa as g,To as _,Va as v,Wa as y,Xa as b,Ya as x,Za as S,br as ee,ea as te,fa as ne,ia as C,io as w,ja as re,lE as T,ma as E,na as D,no as O,pa as k,sa as A,sp as j,t as M,ta as ie,vo as N,wa as P,wo as ae,zn as F}from"./utils-BgVDKR83.js";import{t as oe}from"./useRegisterFieldControl-BgyE4_OV.js";import{t as se}from"./FormContext-CUlgAi-q.js";import{a as ce}from"./CSPContext-BUFNSYww.js";var I=e(t());function le(){let[,e]=I.useState({});return I.useCallback(()=>{e({})},[])}var ue=I.createContext(void 0);function de(){let e=I.useContext(ue);if(e===void 0)throw Error(a(43));return e}var L={inputValue:()=>null,value:()=>null,...F},fe=new Map;function R(e,t){let n=JSON.stringify({locale:e,options:t}),r=fe.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return fe.set(n,i),i}function z(e,t,n){return e==null?``:R(t,n).format(e)}function pe(e,t,n){return z(e,t,{...n,maximumFractionDigits:20})}var B=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],me={零:`0`,〇:`0`,一:`1`,二:`2`,三:`3`,四:`4`,五:`5`,六:`6`,七:`7`,八:`8`,九:`9`},he=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],V=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],H=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],ge=[`%`,`٪`,`%`,`﹪`],_e=[`‰`,`؉`],ve=[`−`,`-`,`‒`,`–`,`—`,`﹣`],U=[`+`,`﹢`],ye=RegExp(`[${he.join(``)}]`,`g`),W=RegExp(`[${V.join(``)}]`,`g`),be=RegExp(`[${H.join(``)}]`,`g`),xe=RegExp(`[${B.join(``)}]`,`g`),G=RegExp(`[${ge.join(``)}]`),K=RegExp(`[${_e.join(``)}]`),Se=/[٠١٢٣٤٥٦٧٨٩]/,Ce=/[۰۱۲۳۴۵۶۷۸۹]/,we=/[零〇一二三四五六七八九]/,Te=RegExp(`[${H.join(``)}]`),Ee=[`.`,`,`,`.`,`,`,`٫`,`٬`],De=/\p{Zs}/u,Oe=[`+`,...U],ke=[`-`,...ve],q=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ae=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),je=e=>`[${e.map(Ae).join(``)}]`,Me=je([`-`].concat(ve)),Ne=je([`+`].concat(U)),Pe=new RegExp(Me,`gu`),J=new RegExp(Ne,`gu`),Y=new RegExp(Me),X=new RegExp(Ne);function Fe(e,t){let n=R(e,t).formatToParts(11111.1),r={};return n.forEach(e=>{r[e.type]=e.value}),R(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(r[e.type]=e.value)}),r}function Z(e,t,n){if(e==null)return null;let r=String(e).replace(/\p{Cf}/gu,``).trim();r=r.replace(Pe,`-`).replace(J,`+`);let i=!1,a=r.match(/([+-])\s*$/);a&&(a[1]===`-`&&(i=!0),r=r.replace(/([+-])\s*$/,``));let o=r.match(/^\s*([+-])/);o&&(o[1]===`-`&&(i=!0),r=r.replace(/^\s*[+-]/,``));let s=t;s===void 0&&(Se.test(r)||Ce.test(r)?s=`ar`:we.test(r)&&(s=`zh`));let{group:c,decimal:l,currency:u}=Fe(s,n),d=R(s,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>q(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;c&&(p=/\p{Zs}/u.test(c)?/\p{Zs}/gu:c===`'`||c===`’`?/['’]/g:new RegExp(q(c),`g`));let m=[{regex:c?p:null,replacement:``},{regex:l?new RegExp(q(l),`g`):null,replacement:`.`},{regex:/./g,replacement:`.`},{regex:/,/g,replacement:``},{regex:/٫/g,replacement:`.`},{regex:/٬/g,replacement:``},{regex:u?new RegExp(q(u),`g`):null,replacement:``},{regex:f,replacement:``},{regex:ye,replacement:e=>String(he.indexOf(e))},{regex:W,replacement:e=>String(V.indexOf(e))},{regex:be,replacement:e=>String(H.indexOf(e))},{regex:xe,replacement:e=>me[e]}].reduce((e,{regex:t,replacement:n})=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=G.test(e)||v===`percent`;return K.test(e)?_/=1e3:!y&&b&&(_/=100),Number.isNaN(_)?null:_}var Ie=1e-10;function Le(e){let t=R(`en-US`).resolvedOptions(),n=e?.minimumFractionDigits??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max(e?.maximumFractionDigits??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Re(e,t){if(!Number.isFinite(e))return e;let n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Q(e,t){let{maximumFractionDigits:n}=Le(t);return Re(e,n)}function ze(e,t,n,r=`directional`){if(n===0)return e;let i=Math.abs(n),a=Math.sign(n),o=i*Ie*a,s=r===`nearest`?n:i,c=(e-t+o)/s,l;return l=r===`nearest`?Math.round(c):a>0?Math.floor(c):Math.ceil(c),t+l*(r===`nearest`?n:i)}function Be(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:i,format:a,snapOnStep:o,small:s,clamp:c}){if(e===null)return e;let l=c?ce(e,n,r):e;if(t!=null&&o){if(t===0)return Q(l,a);let e=i;return!s&&n!==-(2**53-1)&&(e=n),Q(ze(l,e,t,s?`nearest`:`directional`),a)}return Q(l,a)}var $=e(T()),Ve=I.forwardRef(function(e,t){let{id:n,min:a,max:l,smallStep:u=.1,step:f=1,largeStep:p=10,required:m=!1,disabled:h=!1,readOnly:g=!1,form:_,name:y,defaultValue:b,value:x,onValueChange:S,onValueCommitted:ee,allowWheelScrub:ne=!1,snapOnStep:T=!1,allowOutOfRange:E=!1,format:O,locale:k,render:j,className:M,inputRef:P,style:F,...oe}=e,{setDirty:se,validityData:ce,disabled:de,setFilled:fe,invalid:R,name:pe,state:B,validation:me,shouldValidateOnChange:he}=c(),V=de||h,H=pe??y,ve=f===`any`?1:f,[U,ye]=I.useState(!1),W=a??-(2**53-1),be=l??2**53-1,xe=a??0,G=O?.style,K=I.useRef(null),Se=ae(P,me.inputRef),Ce=d({id:n}),[we,Te]=v({controlled:x,default:b,name:`NumberField`,state:`value`}),q=we??null,Ae=D(q);o(()=>{fe(q!==null)},[fe,q]);let je=le(),Me=D(O),Ne=I.useRef(!1),Pe=s((e,t)=>{Ne.current=!1,ee?.(e,t)}),J=I.useRef(!0),Y=I.useRef(null),[X,Z]=I.useState(()=>x===void 0?z(q,k,O):He(q,k,O)),[Ie,Le]=I.useState(`numeric`),Re=s(()=>{let{decimal:e,group:t,currency:n,literal:r}=Fe(k,O),i=new Set;Ee.forEach(e=>i.add(e)),e&&i.add(e),t&&(i.add(t),De.test(t)&&i.add(` `));let a=G===`percent`||G===`unit`&&O?.unit===`percent`,o=G===`percent`||G===`unit`&&O?.unit===`permille`;return a&&ge.forEach(e=>i.add(e)),o&&_e.forEach(e=>i.add(e)),G===`currency`&&n&&i.add(n),r&&(Array.from(r).forEach(e=>i.add(e)),De.test(r)&&i.add(` `)),Oe.forEach(e=>i.add(e)),W<0&&ke.forEach(e=>i.add(e)),i}),Q=s(e=>e?.altKey?u:e?.shiftKey?p:ve),ze=s((e,t)=>{let n=t.event,r=t.direction,i=t.reason,a=!E||i!==`input-change`&&i!==`input-blur`&&i!==`input-paste`&&i!==`input-clear`&&i!==`none`,o=Be(e,{step:r?Q(n)*r:void 0,format:Me.current,minWithDefault:W,maxWithDefault:be,minWithZeroDefault:xe,snapOnStep:T,small:n?.altKey??!1,clamp:a}),s=t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-blur`||t.reason===`input-paste`||t.reason===`none`,c=o!==q||s&&(e!==q||J.current===!1);if(c){if(Y.current=o,S?.(o,t),t.isCanceled)return c;Te(o),se(o!==ce.initialValue),Ne.current=!0}return J.current&&Z(z(o,k,O)),je(),c}),Ve=s((e,{direction:t,currentValue:n,event:r,reason:o})=>{let s=n??Ae.current,c=typeof s==`number`?s+e*t:Math.max(0,a??0);return ze(c,i(o,r,void 0,{direction:t}))});o(function(){if(!J.current)return;let e=x===void 0?z(q,k,O):He(q,k,O);e!==X&&Z(e)}),o(function(){if(!re)return;let e=`text`;W>=0&&(e=`decimal`),Le(e)},[W,G]),I.useEffect(function(){let e=K.current;if(V||g||!ne||!e)return;function t(e){if(e.ctrlKey||A(ie(K.current))!==K.current)return;e.preventDefault(),J.current=!0;let t=Q(e)??1;Ve(t,{direction:e.deltaY>0?-1:1,event:e,reason:`wheel`})}return C(e,`wheel`,t)},[ne,Ve,V,g,Q]);let Ue=I.useMemo(()=>({...B,disabled:V,readOnly:g,required:m,value:q,inputValue:X,scrubbing:U}),[B,V,g,m,q,X,U]),We=I.useMemo(()=>({inputRef:K,inputValue:X,value:q,minWithDefault:W,maxWithDefault:be,disabled:V,readOnly:g,id:Ce,setValue:ze,incrementValue:Ve,getStepAmount:Q,allowInputSyncRef:J,formatOptionsRef:Me,valueRef:Ae,lastChangedValueRef:Y,hasPendingCommitRef:Ne,name:H,required:m,invalid:R,inputMode:Ie,getAllowedNonNumericKeys:Re,min:a,max:l,setInputValue:Z,locale:k,isScrubbing:U,setIsScrubbing:ye,state:Ue,onValueCommitted:Pe}),[K,X,q,W,be,V,g,Ce,ze,Ve,Q,Me,Ae,H,m,R,Ie,Re,a,l,Z,k,U,Ue,Pe]),Ge=N(`div`,e,{ref:t,state:Ue,props:oe,stateAttributesMapping:L});return(0,$.jsxs)(ue.Provider,{value:We,children:[Ge,(0,$.jsx)(`input`,{...me.getInputValidationProps({onFocus(){K.current?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||V||g){e.preventBaseUIHandler?.();return}let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=i(w,e.nativeEvent);se(n!==ce.initialValue),ze(n,r),he()&&me.commit(n)}}),ref:Se,type:`number`,form:_,name:H,value:q??``,min:a,max:l,step:f,disabled:V,required:m,"aria-hidden":!0,tabIndex:-1,style:H?te:r,suppressHydrationWarning:!0})]})});function He(e,t,n){return n?.maximumFractionDigits!=null||n?.minimumFractionDigits!=null?z(e,t,n):pe(e,t,n)}var Ue=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=de();return N(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:L})}),We=0,Ge=class e extends k{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==We&&(clearInterval(this.currentId),this.currentId=We)}};function Ke(){let e=_(Ge.create).current;return g(e.disposeEffect),e}var qe=60,Je=400,Ye=8,Xe=50,Ze=3;function Qe(e){return e===`touch`||e===`pen`}function $e(e){let{disabled:t,readOnly:n=!1,tick:r,onStop:i,tickDelay:a=qe,startDelay:o=Je,scrollDistance:c=Ye,elementRef:l}=e,u=E(),d=Ke(),f=E(),p=I.useRef(!1),m=I.useRef(0),g=I.useRef({x:0,y:0}),_=I.useRef(!1),v=I.useRef(!1),y=I.useRef(``),b=I.useRef(()=>{}),x=s(()=>{f.clear(),u.clear(),d.clear(),b.current(),m.current=0});function S(e){x();let t=l.current;if(!t)return;let n=h(t);function s(e){e.preventDefault()}if(b.current=C(n,`contextmenu`,s),C(n,`pointerup`,e=>{p.current=!1,x(),i?.(e)},{once:!0}),!r(e)){x();return}u.start(o,()=>{d.start(a,()=>{r(e)||x()})})}return I.useEffect(()=>()=>x(),[x]),{pointerHandlers:{onTouchStart(){_.current=!0},onTouchEnd(){_.current=!1},onPointerDown(e){let r=!e.button||e.button===0;e.defaultPrevented||!r||t||n||(y.current=e.pointerType,v.current=!1,p.current=!0,g.current={x:e.clientX,y:e.clientY},Qe(e.pointerType)?f.start(Xe,()=>{let t=m.current;m.current=0,p.current&&t<Ze?(S(e.nativeEvent),v.current=!0):(v.current=!1,x())}):(e.preventDefault(),S(e.nativeEvent)))},onPointerUp(e){Qe(e.pointerType)&&(p.current=!1)},onPointerMove(e){if(t||n||!Qe(e.pointerType)||!p.current)return;m.current!=null&&(m.current+=1);let{x:r,y:i}=g.current,a=r-e.clientX,o=i-e.clientY;a**2+o**2>c**2&&x()},onMouseEnter(e){e.defaultPrevented||t||n||!p.current||_.current||Qe(y.current)||S(e.nativeEvent)},onMouseLeave(){_.current||x()},onMouseUp(){_.current||x()}},shouldSkipClick:s(e=>e.defaultPrevented?!0:Qe(y.current)?v.current:e.detail!==0)}}function et(e){return e===`touch`||e===`pen`}function tt(e){let{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:a,id:o,incrementValue:s,inputRef:c,inputValue:l,isIncrement:u,locale:d,readOnly:f,setValue:p,valueRef:m,lastChangedValueRef:h,onValueCommitted:g}=e,_=u?x:y;function v(e){t.current=!0;let n=Z(l,d,r.current);n!==null&&(m.current=n,p(n,i(_,e,void 0,{direction:u?1:-1})))}let{pointerHandlers:b,shouldSkipClick:S}=$e({disabled:n||f,elementRef:c,tickDelay:60,startDelay:400,scrollDistance:8,tick(e){let t=a(e)??1;return s(t,{direction:u?1:-1,event:e,reason:_})},onStop(e){let t=h.current??m.current;g(t,P(_,e))}});return{disabled:n,"aria-readonly":f||void 0,"aria-label":u?`Increase`:`Decrease`,"aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:`none`,userSelect:`none`},...b,onClick(e){let t=n||f;if(e.defaultPrevented||t||S(e))return;v(e.nativeEvent);let r=a(e)??1,i=m.current;s(r,{direction:u?1:-1,event:e.nativeEvent,reason:_});let o=h.current??m.current;o!==i&&g(o,P(_,e.nativeEvent))},onPointerDown(e){let t=!e.button||e.button===0;e.defaultPrevented||f||!t||n||(v(e.nativeEvent),et(e.pointerType)||c.current?.focus(),b.onPointerDown(e))}}}var nt=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:d,getStepAmount:f,id:p,incrementValue:m,inputRef:h,inputValue:g,locale:_,maxWithDefault:v,readOnly:y,setValue:b,state:x,value:S,valueRef:ee,lastChangedValueRef:te,onValueCommitted:ne}=de(),C=i||l||S!=null&&S>=v,w=tt({isIncrement:!0,inputRef:h,inputValue:g,disabled:C,readOnly:y,id:p,setValue:b,getStepAmount:f,incrementValue:m,allowInputSyncRef:c,formatOptionsRef:d,valueRef:ee,locale:_,lastChangedValueRef:te,onValueCommitted:ne}),{getButtonProps:re,buttonRef:T}=u({disabled:C,native:a,focusableWhenDisabled:!0}),E=I.useMemo(()=>({...x,disabled:C}),[x,C]);return N(`button`,e,{ref:[t,T],state:E,props:[w,s,re],stateAttributesMapping:L})}),rt=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:d,getStepAmount:f,id:p,incrementValue:m,inputRef:h,inputValue:g,minWithDefault:_,readOnly:v,setValue:y,state:b,value:x,valueRef:S,locale:ee,lastChangedValueRef:te,onValueCommitted:ne}=de(),C=i||l||x!=null&&x<=_,w=tt({isIncrement:!1,inputRef:h,inputValue:g,disabled:C,readOnly:v,id:p,setValue:y,getStepAmount:f,incrementValue:m,allowInputSyncRef:c,formatOptionsRef:d,valueRef:S,locale:ee,lastChangedValueRef:te,onValueCommitted:ne}),{getButtonProps:re,buttonRef:T}=u({disabled:C,native:a,focusableWhenDisabled:!0}),E=I.useMemo(()=>({...b,disabled:C}),[b,C]);return N(`button`,e,{ref:[t,T],state:E,props:[w,s,re],stateAttributesMapping:L})}),it={...F,...L},at=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),ot=I.forwardRef(function(e,t){let{render:r,className:a,style:o,...s}=e,{allowInputSyncRef:l,disabled:u,formatOptionsRef:d,getAllowedNonNumericKeys:p,getStepAmount:h,id:g,incrementValue:_,inputMode:v,inputValue:y,max:x,min:te,name:C,readOnly:w,required:re,setValue:T,state:E,setInputValue:D,locale:k,inputRef:A,value:j,onValueCommitted:M,lastChangedValueRef:ie,hasPendingCommitRef:ae,valueRef:F}=de(),{clearErrors:ce}=se(),{validationMode:le,setTouched:ue,setFocused:L,invalid:fe,shouldValidateOnChange:R,validation:B}=c(),{labelId:me}=f(),he=I.useRef(!1),V=I.useRef(!1);return oe(A,g,j),ee(j,e=>{let t=R();if(ce(C),t&&B.commit(j),!(e===j||t)){if(V.current){V.current=!1;return}B.commit(j,!0)}}),N(`input`,e,{ref:[t,A],state:E,props:[{id:g,required:re,disabled:u,readOnly:w,inputMode:v,value:y,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":fe||void 0,"aria-labelledby":me,suppressHydrationWarning:!0,onFocus(e){if(e.defaultPrevented||w||u||(L(!0),he.current))return;he.current=!0;let t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n)},onBlur(e){if(e.defaultPrevented||w||u)return;ue(!0),L(!1);let t=!l.current,n=ae.current;if(l.current=!0,y.trim()===``){T(null,i(m,e.nativeEvent)),le===`onBlur`&&B.commit(null),M(null,P(m,e.nativeEvent));return}let r=d.current,a=Z(y,k,r);if(a===null)return;let o=r?.maximumFractionDigits!=null||r?.minimumFractionDigits!=null,s=r?.maximumFractionDigits,c=o&&typeof s==`number`?Number(a.toFixed(s)):a,f=P(b,e.nativeEvent),p=j!==c,h=t||p||n;le===`onBlur`&&B.commit(c),p&&(V.current=!0,T(c,i(b,e.nativeEvent))),h&&M(c,f);let g=z(c,k,r);(o||a!==j||y!==pe(a,k,r))&&y!==g&&D(g)},onChange(e){if(e.nativeEvent.defaultPrevented)return;l.current=!1;let t=e.currentTarget.value;if(t.trim()===``){D(t),T(null,i(m,e.nativeEvent));return}let n=p();if(!Array.from(t).every(e=>{let t=e>=`0`&&e<=`9`,r=Se.test(e),i=we.test(e),a=Ce.test(e),o=Te.test(e),s=Y.test(e);return t||r||i||a||o||s||n.has(e)}))return;let r=Z(t,k,d.current);D(t),r!==null&&T(r,i(S,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||w||u)return;let t=e.nativeEvent;l.current=!0;let n=p(),r=n.has(e.key),{decimal:a,currency:o,percentSign:s}=Fe(k,d.current),c=e.currentTarget.selectionStart,f=e.currentTarget.selectionEnd,m=c===0&&f===y.length,g=e=>c!=null&&f!=null&&e>=c&&e<f;if(Y.test(e.key)&&Array.from(n).some(e=>Y.test(e||``))){let e=y.search(Pe),t=e!=null&&e!==-1&&g(e);r=!(Y.test(y)||X.test(y))||m||t}if(X.test(e.key)&&Array.from(n).some(e=>X.test(e||``))){let e=y.search(J),t=e!=null&&e!==-1&&g(e);r=!(Y.test(y)||X.test(y))||m||t}[a,o,s].forEach(t=>{if(e.key===t){let e=y.indexOf(t),n=g(e);r=!y.includes(t)||m||n}});let v=e.key>=`0`&&e.key<=`9`,b=Se.test(e.key),S=we.test(e.key),ee=Ce.test(e.key),C=Te.test(e.key),re=at.has(e.key);if(e.which===229||e.altKey||e.ctrlKey||e.metaKey||r||v||b||C||S||ee||re)return;let E=Z(y,k,d.current),D=h(e)??1;ne(e);let A=P(O,t);e.key===`ArrowUp`?(_(D,{direction:1,currentValue:E,event:t,reason:O}),M(ie.current??F.current,A)):e.key===`ArrowDown`?(_(D,{direction:-1,currentValue:E,event:t,reason:O}),M(ie.current??F.current,A)):e.key===`Home`&&te!=null?(T(te,i(O,t)),M(ie.current??F.current,A)):e.key===`End`&&x!=null&&(T(x,i(O,t)),M(ie.current??F.current,A))},onPaste(e){if(e.defaultPrevented||w||u)return;e.preventDefault();let t=(e.clipboardData||window.Clipboard).getData(`text/plain`),r=Z(t,k,d.current);r!==null&&(l.current=!1,T(r,i(n,e.nativeEvent)),D(t))}},B.getValidationProps(),s],stateAttributesMapping:it})}),st=l();function ct(e){let t=(0,st.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,className:n,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=I.useId(),c=r??s,l;t[5]===n?l=t[6]:(l=M(`flex w-full flex-col items-start gap-2`,n),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==i||t[9]!==o||t[10]!==l?(u=(0,$.jsx)(Ve,{className:l,"data-size":o,"data-slot":`number-field`,id:c,...i}),t[7]=c,t[8]=i,t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function lt(e){let t=(0,st.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,shape:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o=a===`pill`&&`overflow-hidden rounded-xl before:rounded-xl`,s=a===`soft`&&`rounded-lg border-transparent bg-accent shadow-none before:hidden dark:bg-accent`,c;t[4]!==n||t[5]!==o||t[6]!==s?(c=M(`relative flex w-full justify-between rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-inset has-aria-invalid:border-destructive/36 has-autofill:bg-foreground/4 focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/48 data-disabled:pointer-events-none data-disabled:opacity-64 sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-within,[aria-invalid]]:shadow-none`,o,s,n),t[4]=n,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==c?(l=(0,$.jsx)(Ue,{className:c,"data-slot":`number-field-group`,...r}),t[8]=r,t[9]=c,t[10]=l):l=t[10],l}function ut(e){let t=(0,st.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-s-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(j,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(rt,{className:i,"data-slot":`number-field-decrement`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function dt(e){let t=(0,st.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-e-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(p,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(nt,{className:i,"data-slot":`number-field-increment`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ft(e){let t=(0,st.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`h-8.5 in-data-[size=compact]:h-8 in-data-[size=compact]:px-0 in-data-[size=compact]:leading-8 sm:in-data-[size=compact]:h-8 sm:in-data-[size=compact]:leading-8 in-data-[size=lg]:h-9.5 in-data-[size=sm]:h-7.5 w-full min-w-0 grow bg-transparent in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] px-[calc(--spacing(3)-1px)] text-center tabular-nums in-data-[size=lg]:leading-9.5 in-data-[size=sm]:leading-7.5 leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:in-data-[size=lg]:h-8.5 sm:in-data-[size=sm]:h-6.5 sm:in-data-[size=lg]:leading-8.5 sm:in-data-[size=sm]:leading-8.5 sm:leading-7.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(ot,{className:i,"data-slot":`number-field-input`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{ft as a,dt as i,ut as n,lt as r,ct as t};
2
- //# sourceMappingURL=number-field-Osl5PZkX.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$a as n,$i as r,Ca as i,Eo as a,Fa as o,Ia as s,Ln as c,NE as l,Na as u,Nn as d,Pn as f,Pp as p,Qa as m,Ra as h,Sa as g,To as _,Va as v,Wa as y,Xa as b,Ya as x,Za as S,br as ee,ea as te,fa as ne,ia as C,io as w,ja as re,lE as T,ma as E,na as D,no as O,pa as k,sa as A,sp as j,t as M,ta as ie,vo as N,wa as P,wo as ae,zn as F}from"./utils-BAPnqm16.js";import{t as oe}from"./useRegisterFieldControl-9rSmWR2W.js";import{t as se}from"./FormContext--axmNCbu.js";import{a as ce}from"./CSPContext-D8znCJtI.js";var I=e(t());function le(){let[,e]=I.useState({});return I.useCallback(()=>{e({})},[])}var ue=I.createContext(void 0);function de(){let e=I.useContext(ue);if(e===void 0)throw Error(a(43));return e}var L={inputValue:()=>null,value:()=>null,...F},fe=new Map;function R(e,t){let n=JSON.stringify({locale:e,options:t}),r=fe.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return fe.set(n,i),i}function z(e,t,n){return e==null?``:R(t,n).format(e)}function pe(e,t,n){return z(e,t,{...n,maximumFractionDigits:20})}var B=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],me={零:`0`,〇:`0`,一:`1`,二:`2`,三:`3`,四:`4`,五:`5`,六:`6`,七:`7`,八:`8`,九:`9`},he=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],V=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],H=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],ge=[`%`,`٪`,`%`,`﹪`],_e=[`‰`,`؉`],ve=[`−`,`-`,`‒`,`–`,`—`,`﹣`],U=[`+`,`﹢`],ye=RegExp(`[${he.join(``)}]`,`g`),W=RegExp(`[${V.join(``)}]`,`g`),be=RegExp(`[${H.join(``)}]`,`g`),xe=RegExp(`[${B.join(``)}]`,`g`),G=RegExp(`[${ge.join(``)}]`),K=RegExp(`[${_e.join(``)}]`),Se=/[٠١٢٣٤٥٦٧٨٩]/,Ce=/[۰۱۲۳۴۵۶۷۸۹]/,we=/[零〇一二三四五六七八九]/,Te=RegExp(`[${H.join(``)}]`),Ee=[`.`,`,`,`.`,`,`,`٫`,`٬`],De=/\p{Zs}/u,Oe=[`+`,...U],ke=[`-`,...ve],q=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ae=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),je=e=>`[${e.map(Ae).join(``)}]`,Me=je([`-`].concat(ve)),Ne=je([`+`].concat(U)),Pe=new RegExp(Me,`gu`),J=new RegExp(Ne,`gu`),Y=new RegExp(Me),X=new RegExp(Ne);function Fe(e,t){let n=R(e,t).formatToParts(11111.1),r={};return n.forEach(e=>{r[e.type]=e.value}),R(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(r[e.type]=e.value)}),r}function Z(e,t,n){if(e==null)return null;let r=String(e).replace(/\p{Cf}/gu,``).trim();r=r.replace(Pe,`-`).replace(J,`+`);let i=!1,a=r.match(/([+-])\s*$/);a&&(a[1]===`-`&&(i=!0),r=r.replace(/([+-])\s*$/,``));let o=r.match(/^\s*([+-])/);o&&(o[1]===`-`&&(i=!0),r=r.replace(/^\s*[+-]/,``));let s=t;s===void 0&&(Se.test(r)||Ce.test(r)?s=`ar`:we.test(r)&&(s=`zh`));let{group:c,decimal:l,currency:u}=Fe(s,n),d=R(s,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>q(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;c&&(p=/\p{Zs}/u.test(c)?/\p{Zs}/gu:c===`'`||c===`’`?/['’]/g:new RegExp(q(c),`g`));let m=[{regex:c?p:null,replacement:``},{regex:l?new RegExp(q(l),`g`):null,replacement:`.`},{regex:/./g,replacement:`.`},{regex:/,/g,replacement:``},{regex:/٫/g,replacement:`.`},{regex:/٬/g,replacement:``},{regex:u?new RegExp(q(u),`g`):null,replacement:``},{regex:f,replacement:``},{regex:ye,replacement:e=>String(he.indexOf(e))},{regex:W,replacement:e=>String(V.indexOf(e))},{regex:be,replacement:e=>String(H.indexOf(e))},{regex:xe,replacement:e=>me[e]}].reduce((e,{regex:t,replacement:n})=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=G.test(e)||v===`percent`;return K.test(e)?_/=1e3:!y&&b&&(_/=100),Number.isNaN(_)?null:_}var Ie=1e-10;function Le(e){let t=R(`en-US`).resolvedOptions(),n=e?.minimumFractionDigits??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max(e?.maximumFractionDigits??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Re(e,t){if(!Number.isFinite(e))return e;let n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Q(e,t){let{maximumFractionDigits:n}=Le(t);return Re(e,n)}function ze(e,t,n,r=`directional`){if(n===0)return e;let i=Math.abs(n),a=Math.sign(n),o=i*Ie*a,s=r===`nearest`?n:i,c=(e-t+o)/s,l;return l=r===`nearest`?Math.round(c):a>0?Math.floor(c):Math.ceil(c),t+l*(r===`nearest`?n:i)}function Be(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:i,format:a,snapOnStep:o,small:s,clamp:c}){if(e===null)return e;let l=c?ce(e,n,r):e;if(t!=null&&o){if(t===0)return Q(l,a);let e=i;return!s&&n!==-(2**53-1)&&(e=n),Q(ze(l,e,t,s?`nearest`:`directional`),a)}return Q(l,a)}var $=e(T()),Ve=I.forwardRef(function(e,t){let{id:n,min:a,max:l,smallStep:u=.1,step:f=1,largeStep:p=10,required:m=!1,disabled:h=!1,readOnly:g=!1,form:_,name:y,defaultValue:b,value:x,onValueChange:S,onValueCommitted:ee,allowWheelScrub:ne=!1,snapOnStep:T=!1,allowOutOfRange:E=!1,format:O,locale:k,render:j,className:M,inputRef:P,style:F,...oe}=e,{setDirty:se,validityData:ce,disabled:de,setFilled:fe,invalid:R,name:pe,state:B,validation:me,shouldValidateOnChange:he}=c(),V=de||h,H=pe??y,ve=f===`any`?1:f,[U,ye]=I.useState(!1),W=a??-(2**53-1),be=l??2**53-1,xe=a??0,G=O?.style,K=I.useRef(null),Se=ae(P,me.inputRef),Ce=d({id:n}),[we,Te]=v({controlled:x,default:b,name:`NumberField`,state:`value`}),q=we??null,Ae=D(q);o(()=>{fe(q!==null)},[fe,q]);let je=le(),Me=D(O),Ne=I.useRef(!1),Pe=s((e,t)=>{Ne.current=!1,ee?.(e,t)}),J=I.useRef(!0),Y=I.useRef(null),[X,Z]=I.useState(()=>x===void 0?z(q,k,O):He(q,k,O)),[Ie,Le]=I.useState(`numeric`),Re=s(()=>{let{decimal:e,group:t,currency:n,literal:r}=Fe(k,O),i=new Set;Ee.forEach(e=>i.add(e)),e&&i.add(e),t&&(i.add(t),De.test(t)&&i.add(` `));let a=G===`percent`||G===`unit`&&O?.unit===`percent`,o=G===`percent`||G===`unit`&&O?.unit===`permille`;return a&&ge.forEach(e=>i.add(e)),o&&_e.forEach(e=>i.add(e)),G===`currency`&&n&&i.add(n),r&&(Array.from(r).forEach(e=>i.add(e)),De.test(r)&&i.add(` `)),Oe.forEach(e=>i.add(e)),W<0&&ke.forEach(e=>i.add(e)),i}),Q=s(e=>e?.altKey?u:e?.shiftKey?p:ve),ze=s((e,t)=>{let n=t.event,r=t.direction,i=t.reason,a=!E||i!==`input-change`&&i!==`input-blur`&&i!==`input-paste`&&i!==`input-clear`&&i!==`none`,o=Be(e,{step:r?Q(n)*r:void 0,format:Me.current,minWithDefault:W,maxWithDefault:be,minWithZeroDefault:xe,snapOnStep:T,small:n?.altKey??!1,clamp:a}),s=t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-blur`||t.reason===`input-paste`||t.reason===`none`,c=o!==q||s&&(e!==q||J.current===!1);if(c){if(Y.current=o,S?.(o,t),t.isCanceled)return c;Te(o),se(o!==ce.initialValue),Ne.current=!0}return J.current&&Z(z(o,k,O)),je(),c}),Ve=s((e,{direction:t,currentValue:n,event:r,reason:o})=>{let s=n??Ae.current,c=typeof s==`number`?s+e*t:Math.max(0,a??0);return ze(c,i(o,r,void 0,{direction:t}))});o(function(){if(!J.current)return;let e=x===void 0?z(q,k,O):He(q,k,O);e!==X&&Z(e)}),o(function(){if(!re)return;let e=`text`;W>=0&&(e=`decimal`),Le(e)},[W,G]),I.useEffect(function(){let e=K.current;if(V||g||!ne||!e)return;function t(e){if(e.ctrlKey||A(ie(K.current))!==K.current)return;e.preventDefault(),J.current=!0;let t=Q(e)??1;Ve(t,{direction:e.deltaY>0?-1:1,event:e,reason:`wheel`})}return C(e,`wheel`,t)},[ne,Ve,V,g,Q]);let Ue=I.useMemo(()=>({...B,disabled:V,readOnly:g,required:m,value:q,inputValue:X,scrubbing:U}),[B,V,g,m,q,X,U]),We=I.useMemo(()=>({inputRef:K,inputValue:X,value:q,minWithDefault:W,maxWithDefault:be,disabled:V,readOnly:g,id:Ce,setValue:ze,incrementValue:Ve,getStepAmount:Q,allowInputSyncRef:J,formatOptionsRef:Me,valueRef:Ae,lastChangedValueRef:Y,hasPendingCommitRef:Ne,name:H,required:m,invalid:R,inputMode:Ie,getAllowedNonNumericKeys:Re,min:a,max:l,setInputValue:Z,locale:k,isScrubbing:U,setIsScrubbing:ye,state:Ue,onValueCommitted:Pe}),[K,X,q,W,be,V,g,Ce,ze,Ve,Q,Me,Ae,H,m,R,Ie,Re,a,l,Z,k,U,Ue,Pe]),Ge=N(`div`,e,{ref:t,state:Ue,props:oe,stateAttributesMapping:L});return(0,$.jsxs)(ue.Provider,{value:We,children:[Ge,(0,$.jsx)(`input`,{...me.getInputValidationProps({onFocus(){K.current?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||V||g){e.preventBaseUIHandler?.();return}let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=i(w,e.nativeEvent);se(n!==ce.initialValue),ze(n,r),he()&&me.commit(n)}}),ref:Se,type:`number`,form:_,name:H,value:q??``,min:a,max:l,step:f,disabled:V,required:m,"aria-hidden":!0,tabIndex:-1,style:H?te:r,suppressHydrationWarning:!0})]})});function He(e,t,n){return n?.maximumFractionDigits!=null||n?.minimumFractionDigits!=null?z(e,t,n):pe(e,t,n)}var Ue=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=de();return N(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:L})}),We=0,Ge=class e extends k{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==We&&(clearInterval(this.currentId),this.currentId=We)}};function Ke(){let e=_(Ge.create).current;return g(e.disposeEffect),e}var qe=60,Je=400,Ye=8,Xe=50,Ze=3;function Qe(e){return e===`touch`||e===`pen`}function $e(e){let{disabled:t,readOnly:n=!1,tick:r,onStop:i,tickDelay:a=qe,startDelay:o=Je,scrollDistance:c=Ye,elementRef:l}=e,u=E(),d=Ke(),f=E(),p=I.useRef(!1),m=I.useRef(0),g=I.useRef({x:0,y:0}),_=I.useRef(!1),v=I.useRef(!1),y=I.useRef(``),b=I.useRef(()=>{}),x=s(()=>{f.clear(),u.clear(),d.clear(),b.current(),m.current=0});function S(e){x();let t=l.current;if(!t)return;let n=h(t);function s(e){e.preventDefault()}if(b.current=C(n,`contextmenu`,s),C(n,`pointerup`,e=>{p.current=!1,x(),i?.(e)},{once:!0}),!r(e)){x();return}u.start(o,()=>{d.start(a,()=>{r(e)||x()})})}return I.useEffect(()=>()=>x(),[x]),{pointerHandlers:{onTouchStart(){_.current=!0},onTouchEnd(){_.current=!1},onPointerDown(e){let r=!e.button||e.button===0;e.defaultPrevented||!r||t||n||(y.current=e.pointerType,v.current=!1,p.current=!0,g.current={x:e.clientX,y:e.clientY},Qe(e.pointerType)?f.start(Xe,()=>{let t=m.current;m.current=0,p.current&&t<Ze?(S(e.nativeEvent),v.current=!0):(v.current=!1,x())}):(e.preventDefault(),S(e.nativeEvent)))},onPointerUp(e){Qe(e.pointerType)&&(p.current=!1)},onPointerMove(e){if(t||n||!Qe(e.pointerType)||!p.current)return;m.current!=null&&(m.current+=1);let{x:r,y:i}=g.current,a=r-e.clientX,o=i-e.clientY;a**2+o**2>c**2&&x()},onMouseEnter(e){e.defaultPrevented||t||n||!p.current||_.current||Qe(y.current)||S(e.nativeEvent)},onMouseLeave(){_.current||x()},onMouseUp(){_.current||x()}},shouldSkipClick:s(e=>e.defaultPrevented?!0:Qe(y.current)?v.current:e.detail!==0)}}function et(e){return e===`touch`||e===`pen`}function tt(e){let{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:a,id:o,incrementValue:s,inputRef:c,inputValue:l,isIncrement:u,locale:d,readOnly:f,setValue:p,valueRef:m,lastChangedValueRef:h,onValueCommitted:g}=e,_=u?x:y;function v(e){t.current=!0;let n=Z(l,d,r.current);n!==null&&(m.current=n,p(n,i(_,e,void 0,{direction:u?1:-1})))}let{pointerHandlers:b,shouldSkipClick:S}=$e({disabled:n||f,elementRef:c,tickDelay:60,startDelay:400,scrollDistance:8,tick(e){let t=a(e)??1;return s(t,{direction:u?1:-1,event:e,reason:_})},onStop(e){let t=h.current??m.current;g(t,P(_,e))}});return{disabled:n,"aria-readonly":f||void 0,"aria-label":u?`Increase`:`Decrease`,"aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:`none`,userSelect:`none`},...b,onClick(e){let t=n||f;if(e.defaultPrevented||t||S(e))return;v(e.nativeEvent);let r=a(e)??1,i=m.current;s(r,{direction:u?1:-1,event:e.nativeEvent,reason:_});let o=h.current??m.current;o!==i&&g(o,P(_,e.nativeEvent))},onPointerDown(e){let t=!e.button||e.button===0;e.defaultPrevented||f||!t||n||(v(e.nativeEvent),et(e.pointerType)||c.current?.focus(),b.onPointerDown(e))}}}var nt=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:d,getStepAmount:f,id:p,incrementValue:m,inputRef:h,inputValue:g,locale:_,maxWithDefault:v,readOnly:y,setValue:b,state:x,value:S,valueRef:ee,lastChangedValueRef:te,onValueCommitted:ne}=de(),C=i||l||S!=null&&S>=v,w=tt({isIncrement:!0,inputRef:h,inputValue:g,disabled:C,readOnly:y,id:p,setValue:b,getStepAmount:f,incrementValue:m,allowInputSyncRef:c,formatOptionsRef:d,valueRef:ee,locale:_,lastChangedValueRef:te,onValueCommitted:ne}),{getButtonProps:re,buttonRef:T}=u({disabled:C,native:a,focusableWhenDisabled:!0}),E=I.useMemo(()=>({...x,disabled:C}),[x,C]);return N(`button`,e,{ref:[t,T],state:E,props:[w,s,re],stateAttributesMapping:L})}),rt=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:d,getStepAmount:f,id:p,incrementValue:m,inputRef:h,inputValue:g,minWithDefault:_,readOnly:v,setValue:y,state:b,value:x,valueRef:S,locale:ee,lastChangedValueRef:te,onValueCommitted:ne}=de(),C=i||l||x!=null&&x<=_,w=tt({isIncrement:!1,inputRef:h,inputValue:g,disabled:C,readOnly:v,id:p,setValue:y,getStepAmount:f,incrementValue:m,allowInputSyncRef:c,formatOptionsRef:d,valueRef:S,locale:ee,lastChangedValueRef:te,onValueCommitted:ne}),{getButtonProps:re,buttonRef:T}=u({disabled:C,native:a,focusableWhenDisabled:!0}),E=I.useMemo(()=>({...b,disabled:C}),[b,C]);return N(`button`,e,{ref:[t,T],state:E,props:[w,s,re],stateAttributesMapping:L})}),it={...F,...L},at=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),ot=I.forwardRef(function(e,t){let{render:r,className:a,style:o,...s}=e,{allowInputSyncRef:l,disabled:u,formatOptionsRef:d,getAllowedNonNumericKeys:p,getStepAmount:h,id:g,incrementValue:_,inputMode:v,inputValue:y,max:x,min:te,name:C,readOnly:w,required:re,setValue:T,state:E,setInputValue:D,locale:k,inputRef:A,value:j,onValueCommitted:M,lastChangedValueRef:ie,hasPendingCommitRef:ae,valueRef:F}=de(),{clearErrors:ce}=se(),{validationMode:le,setTouched:ue,setFocused:L,invalid:fe,shouldValidateOnChange:R,validation:B}=c(),{labelId:me}=f(),he=I.useRef(!1),V=I.useRef(!1);return oe(A,g,j),ee(j,e=>{let t=R();if(ce(C),t&&B.commit(j),!(e===j||t)){if(V.current){V.current=!1;return}B.commit(j,!0)}}),N(`input`,e,{ref:[t,A],state:E,props:[{id:g,required:re,disabled:u,readOnly:w,inputMode:v,value:y,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":fe||void 0,"aria-labelledby":me,suppressHydrationWarning:!0,onFocus(e){if(e.defaultPrevented||w||u||(L(!0),he.current))return;he.current=!0;let t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n)},onBlur(e){if(e.defaultPrevented||w||u)return;ue(!0),L(!1);let t=!l.current,n=ae.current;if(l.current=!0,y.trim()===``){T(null,i(m,e.nativeEvent)),le===`onBlur`&&B.commit(null),M(null,P(m,e.nativeEvent));return}let r=d.current,a=Z(y,k,r);if(a===null)return;let o=r?.maximumFractionDigits!=null||r?.minimumFractionDigits!=null,s=r?.maximumFractionDigits,c=o&&typeof s==`number`?Number(a.toFixed(s)):a,f=P(b,e.nativeEvent),p=j!==c,h=t||p||n;le===`onBlur`&&B.commit(c),p&&(V.current=!0,T(c,i(b,e.nativeEvent))),h&&M(c,f);let g=z(c,k,r);(o||a!==j||y!==pe(a,k,r))&&y!==g&&D(g)},onChange(e){if(e.nativeEvent.defaultPrevented)return;l.current=!1;let t=e.currentTarget.value;if(t.trim()===``){D(t),T(null,i(m,e.nativeEvent));return}let n=p();if(!Array.from(t).every(e=>{let t=e>=`0`&&e<=`9`,r=Se.test(e),i=we.test(e),a=Ce.test(e),o=Te.test(e),s=Y.test(e);return t||r||i||a||o||s||n.has(e)}))return;let r=Z(t,k,d.current);D(t),r!==null&&T(r,i(S,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||w||u)return;let t=e.nativeEvent;l.current=!0;let n=p(),r=n.has(e.key),{decimal:a,currency:o,percentSign:s}=Fe(k,d.current),c=e.currentTarget.selectionStart,f=e.currentTarget.selectionEnd,m=c===0&&f===y.length,g=e=>c!=null&&f!=null&&e>=c&&e<f;if(Y.test(e.key)&&Array.from(n).some(e=>Y.test(e||``))){let e=y.search(Pe),t=e!=null&&e!==-1&&g(e);r=!(Y.test(y)||X.test(y))||m||t}if(X.test(e.key)&&Array.from(n).some(e=>X.test(e||``))){let e=y.search(J),t=e!=null&&e!==-1&&g(e);r=!(Y.test(y)||X.test(y))||m||t}[a,o,s].forEach(t=>{if(e.key===t){let e=y.indexOf(t),n=g(e);r=!y.includes(t)||m||n}});let v=e.key>=`0`&&e.key<=`9`,b=Se.test(e.key),S=we.test(e.key),ee=Ce.test(e.key),C=Te.test(e.key),re=at.has(e.key);if(e.which===229||e.altKey||e.ctrlKey||e.metaKey||r||v||b||C||S||ee||re)return;let E=Z(y,k,d.current),D=h(e)??1;ne(e);let A=P(O,t);e.key===`ArrowUp`?(_(D,{direction:1,currentValue:E,event:t,reason:O}),M(ie.current??F.current,A)):e.key===`ArrowDown`?(_(D,{direction:-1,currentValue:E,event:t,reason:O}),M(ie.current??F.current,A)):e.key===`Home`&&te!=null?(T(te,i(O,t)),M(ie.current??F.current,A)):e.key===`End`&&x!=null&&(T(x,i(O,t)),M(ie.current??F.current,A))},onPaste(e){if(e.defaultPrevented||w||u)return;e.preventDefault();let t=(e.clipboardData||window.Clipboard).getData(`text/plain`),r=Z(t,k,d.current);r!==null&&(l.current=!1,T(r,i(n,e.nativeEvent)),D(t))}},B.getValidationProps(),s],stateAttributesMapping:it})}),st=l();function ct(e){let t=(0,st.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,className:n,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=I.useId(),c=r??s,l;t[5]===n?l=t[6]:(l=M(`flex w-full flex-col items-start gap-2`,n),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==i||t[9]!==o||t[10]!==l?(u=(0,$.jsx)(Ve,{className:l,"data-size":o,"data-slot":`number-field`,id:c,...i}),t[7]=c,t[8]=i,t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function lt(e){let t=(0,st.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,shape:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o=a===`pill`&&`overflow-hidden rounded-xl before:rounded-xl`,s=a===`soft`&&`rounded-lg border-transparent bg-accent shadow-none before:hidden dark:bg-accent`,c;t[4]!==n||t[5]!==o||t[6]!==s?(c=M(`relative flex w-full justify-between rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-inset has-aria-invalid:border-destructive/36 has-autofill:bg-foreground/4 focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/48 data-disabled:pointer-events-none data-disabled:opacity-64 sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-within,[aria-invalid]]:shadow-none`,o,s,n),t[4]=n,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==c?(l=(0,$.jsx)(Ue,{className:c,"data-slot":`number-field-group`,...r}),t[8]=r,t[9]=c,t[10]=l):l=t[10],l}function ut(e){let t=(0,st.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-s-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(j,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(rt,{className:i,"data-slot":`number-field-decrement`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function dt(e){let t=(0,st.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-e-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(p,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(nt,{className:i,"data-slot":`number-field-increment`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ft(e){let t=(0,st.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`h-8.5 in-data-[size=compact]:h-8 in-data-[size=compact]:px-0 in-data-[size=compact]:leading-8 sm:in-data-[size=compact]:h-8 sm:in-data-[size=compact]:leading-8 in-data-[size=lg]:h-9.5 in-data-[size=sm]:h-7.5 w-full min-w-0 grow bg-transparent in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] px-[calc(--spacing(3)-1px)] text-center tabular-nums in-data-[size=lg]:leading-9.5 in-data-[size=sm]:leading-7.5 leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:in-data-[size=lg]:h-8.5 sm:in-data-[size=sm]:h-6.5 sm:in-data-[size=lg]:leading-8.5 sm:in-data-[size=sm]:leading-8.5 sm:leading-7.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(ot,{className:i,"data-slot":`number-field-input`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{ft as a,dt as i,ut as n,lt as r,ct as t};
2
+ //# sourceMappingURL=number-field-DQIrEOoj.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{va as t}from"./utils-BgVDKR83.js";var n=e(t(),1),r=null,i=new Map;function a(e){let t=new Map;for(let n of e){let e=i.get(n.target);if(!e)continue;let r=e.subscriptions;if(e.waiting){let t=e.last?.contentRect;t?.width===n.contentRect.width&&t.height===n.contentRect.height&&(r=e.waiting),e.waiting=null}e.last=n;for(let e of r){let r=t.get(e);r?r.push(n):t.set(e,[n])}}t.size!==0&&(0,n.flushSync)(()=>{for(let[e,n]of t)if(e.active)try{e.callback(n)}catch(e){queueMicrotask(()=>{throw e})}})}function o(e,t){if(typeof ResizeObserver>`u`)return()=>{};let n=r??=new ResizeObserver(a),o={callback:t,active:!0},s=Array.isArray(e)?e:[e];for(let e of s){let t=i.get(e);if(!t){i.set(e,{subscriptions:new Set([o]),waiting:null,last:null}),n.observe(e);continue}t.subscriptions.add(o),t.last&&((t.waiting??=new Set).add(o),n.unobserve(e),n.observe(e))}return()=>{if(!o.active)return;o.active=!1;let e=s.filter(e=>{let t=i.get(e);return t?.subscriptions.delete(o)?(t.waiting?.delete(o),t.subscriptions.size===0&&i.delete(e)):!1});if(i.size>0)for(let t of e)n.unobserve(t);else r?.disconnect(),r=null}}export{o as t};
2
- //# sourceMappingURL=observeResize-BeeOdDdQ.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{va as t}from"./utils-BAPnqm16.js";var n=e(t(),1),r=null,i=new Map;function a(e){let t=new Map;for(let n of e){let e=i.get(n.target);if(!e)continue;let r=e.subscriptions;if(e.waiting){let t=e.last?.contentRect;t?.width===n.contentRect.width&&t.height===n.contentRect.height&&(r=e.waiting),e.waiting=null}e.last=n;for(let e of r){let r=t.get(e);r?r.push(n):t.set(e,[n])}}t.size!==0&&(0,n.flushSync)(()=>{for(let[e,n]of t)if(e.active)try{e.callback(n)}catch(e){queueMicrotask(()=>{throw e})}})}function o(e,t){if(typeof ResizeObserver>`u`)return()=>{};let n=r??=new ResizeObserver(a),o={callback:t,active:!0},s=Array.isArray(e)?e:[e];for(let e of s){let t=i.get(e);if(!t){i.set(e,{subscriptions:new Set([o]),waiting:null,last:null}),n.observe(e);continue}t.subscriptions.add(o),t.last&&((t.waiting??=new Set).add(o),n.unobserve(e),n.observe(e))}return()=>{if(!o.active)return;o.active=!1;let e=s.filter(e=>{let t=i.get(e);return t?.subscriptions.delete(o)?(t.waiting?.delete(o),t.subscriptions.size===0&&i.delete(e)):!1});if(i.size>0)for(let t of e)n.unobserve(t);else r?.disconnect(),r=null}}export{o as t};
2
+ //# sourceMappingURL=observeResize-BaPAtI3Q.js.map
@@ -1,2 +1,2 @@
1
- import{Ox as e}from"./utils-BgVDKR83.js";import{I as t,k as n}from"./runtime-B7jXrsPs.js";import{t as r,wt as i}from"./runtime-B75ae48c.js";var a=n(),o=t(r,{label:`web:connection:connect-pairing`,scheduler:a,concurrency:{mode:`singleFlight`,key:e=>JSON.stringify(e)},execute:t=>i.pipe(e(e=>e.registerPairing(t)))}),s=t(r,{label:`web:connection:connect-ssh`,scheduler:a,concurrency:{mode:`serial`,key:e=>JSON.stringify(e.target)},execute:t=>i.pipe(e(e=>e.registerSsh(t)))});export{s as n,o as t};
2
- //# sourceMappingURL=onboarding-BF9yT3Xi.js.map
1
+ import{Ox as e}from"./utils-BAPnqm16.js";import{I as t,k as n}from"./runtime-B9IDNXDU.js";import{t as r,wt as i}from"./runtime-B5cKWtKn.js";var a=n(),o=t(r,{label:`web:connection:connect-pairing`,scheduler:a,concurrency:{mode:`singleFlight`,key:e=>JSON.stringify(e)},execute:t=>i.pipe(e(e=>e.registerPairing(t)))}),s=t(r,{label:`web:connection:connect-ssh`,scheduler:a,concurrency:{mode:`serial`,key:e=>JSON.stringify(e.target)},execute:t=>i.pipe(e(e=>e.registerSsh(t)))});export{s as n,o as t};
2
+ //# sourceMappingURL=onboarding-ObMsA9VF.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Bo as n,Io as r,NE as i,Ro as a,Vw as o,Xo as s,Yo as c,dw as l,fw as u,jo as d,ms as f,ys as p,zo as m}from"./utils-BgVDKR83.js";import{L as h,W as g,z as _}from"./runtime-B7jXrsPs.js";import{s as v}from"./vcsRefInvalidation-BWvsbPLB.js";import{s as y}from"./session-eKfJi_Kx.js";import{l as b,o as x}from"./rightPanelStore-DNohe5X6.js";import{t as S}from"./mediaReference-BUHO9ICD.js";import{a as C,c as w,l as T,s as E,t as D}from"./assets-BngUvpba.js";import{S as O,c as k,d as A,s as j,x as M}from"./browserHistoryStore-D3jg6lW0.js";var N=i(),P=e(t(),1);function F(e,t){let n=(0,N.c)(7),r=(0,P.useContext)(s),i=typeof t==`string`?t:t?.label,a=typeof t==`string`?!0:t?.reportFailure??!0,o=typeof t==`string`?!0:t?.reportDefect??!0,c=typeof t==`string`?!1:t?.refresh??!1,l;return n[0]!==i||n[1]!==e||n[2]!==c||n[3]!==r||n[4]!==o||n[5]!==a?(l=t=>{let n=e(t);return h(r,n,{label:i??n.label?.[0]??`atom query`,reportFailure:a,reportDefect:o,refresh:c})},n[0]=i,n[1]=e,n[2]=c,n[3]=r,n[4]=o,n[5]=a,n[6]=l):l=n[6],l}function I(e,t){let n=(0,N.c)(10),r=v(e),i;n[0]!==t||n[1]!==r?(i=w(t,r),n[0]=t,n[1]=r,n[2]=i):i=n[2];let a=i,o=y(e),s;n[3]!==a||n[4]!==e||n[5]!==t?(s=a!==null||e===null||t===null?C:D.createUrl({environmentId:e,input:{resource:t}}),n[3]=a,n[4]=e,n[5]=t,n[6]=s):s=n[6];let l=c(s);if(a!==null)return a;let u=o._tag===`Some`?o.value.httpBaseUrl:null,d;return n[7]!==l||n[8]!==u?(d=E(l,u),n[7]=l,n[8]=u,n[9]=d):d=n[9],d}function L(e,t){let n=(0,N.c)(6),r=y(e),i=r._tag===`Some`?r.value.httpBaseUrl:null,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1,refresh:!0},n[0]=a):a=n[0];let o=F(D.createUrl,a),s;return n[1]!==e||n[2]!==i||n[3]!==o||n[4]!==t?(s=async()=>{if(e===null||t===null||i===null)return null;let n=await o({environmentId:e,input:{resource:t}});if(n._tag===`Failure`)throw g(n);return T(i,n.value.relativeUrl)},n[1]=e,n[2]=i,n[3]=o,n[4]=t,n[5]=s):s=n[5],s}function R(e,t){let n=y(e),{canReadFiles:r}=v(e),i=(0,P.useMemo)(()=>r?t:t.filter(e=>e._tag!==`workspace-file`&&e._tag!==`media-file`&&e._tag!==`draft-workspace-file`),[r,t]),a=c(D.createUrls({environmentId:e,resources:i}));return(0,P.useMemo)(()=>{if(n._tag===`None`)return t.map(()=>null);let e=0;return t.map(t=>{if(!r&&(t._tag===`workspace-file`||t._tag===`media-file`||t._tag===`draft-workspace-file`))return null;let i=a[e++];return i&&p(i)?T(n.value.httpBaseUrl,i.value.relativeUrl):null})},[r,n,t,a])}var z=e=>/\.(?:html?|pdf)$/i.test(e.split(/[?#]/,1)[0]??``),B=class extends o(`BrowserPreviewUnavailableError`){},V=class extends o(`BrowserSettingsReadError`){get message(){return`Saved browser settings could not be loaded.`}};async function H(e){let t=await A().catch(e=>new V({cause:e}));if(t instanceof V)return f(u(t));let i=O(e.threadRef.environmentId),o=r(e.threadRef).activeTabId,s=()=>x(b.getState().byThreadKey,e.threadRef)?.id??null,c=s(),l=await e.openPreview({environmentId:e.threadRef.environmentId,input:{threadId:e.threadRef.threadId,url:e.url,viewport:k(t),profileId:e.profileId??j(t),...i===void 0?{}:{runtime:i}}});return _(l,t=>{if(a(e.threadRef,e.url),e.background){n(e.threadRef,t),o&&r(e.threadRef).activeTabId===t.tabId&&s()===c&&m(e.threadRef,o);return}d(e.threadRef,t),b.getState().openBrowser(e.threadRef,t.tabId)})}async function U(e){if(!M(e.threadRef.environmentId))return f(u(new B({message:`The integrated browser is unavailable in this runtime.`})));let t=S(e.filePath,e.workspaceRoot).relativePath!==void 0,n=await e.createAssetUrl({environmentId:e.threadRef.environmentId,input:{resource:{_tag:t?`workspace-file`:`media-file`,threadId:e.threadRef.threadId,path:e.filePath}}});if(n._tag===`Failure`)return f(n.cause);let r=T(e.httpBaseUrl,n.value.relativeUrl);return r===null?f(l(Error(`The environment returned an invalid asset URL.`))):H({threadRef:e.threadRef,url:r,openPreview:e.openPreview})}export{H as a,R as c,U as i,F as l,V as n,L as o,z as r,I as s,B as t};
2
- //# sourceMappingURL=openFileInPreview-C15eoyYZ.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Bo as n,Io as r,NE as i,Ro as a,Vw as o,Xo as s,Yo as c,dw as l,fw as u,jo as d,ms as f,ys as p,zo as m}from"./utils-BAPnqm16.js";import{L as h,W as g,z as _}from"./runtime-B9IDNXDU.js";import{s as v}from"./vcsRefInvalidation-DfCz0cGO.js";import{s as y}from"./session-Bo2ZSprC.js";import{l as b,o as x}from"./rightPanelStore-DfMWWfvR.js";import{t as S}from"./mediaReference-CQtke4j3.js";import{a as C,c as w,l as T,s as E,t as D}from"./assets-COg7jyyX.js";import{S as O,c as k,d as A,s as j,x as M}from"./browserHistoryStore-_SurQa0e.js";var N=i(),P=e(t(),1);function F(e,t){let n=(0,N.c)(7),r=(0,P.useContext)(s),i=typeof t==`string`?t:t?.label,a=typeof t==`string`?!0:t?.reportFailure??!0,o=typeof t==`string`?!0:t?.reportDefect??!0,c=typeof t==`string`?!1:t?.refresh??!1,l;return n[0]!==i||n[1]!==e||n[2]!==c||n[3]!==r||n[4]!==o||n[5]!==a?(l=t=>{let n=e(t);return h(r,n,{label:i??n.label?.[0]??`atom query`,reportFailure:a,reportDefect:o,refresh:c})},n[0]=i,n[1]=e,n[2]=c,n[3]=r,n[4]=o,n[5]=a,n[6]=l):l=n[6],l}function I(e,t){let n=(0,N.c)(10),r=v(e),i;n[0]!==t||n[1]!==r?(i=w(t,r),n[0]=t,n[1]=r,n[2]=i):i=n[2];let a=i,o=y(e),s;n[3]!==a||n[4]!==e||n[5]!==t?(s=a!==null||e===null||t===null?C:D.createUrl({environmentId:e,input:{resource:t}}),n[3]=a,n[4]=e,n[5]=t,n[6]=s):s=n[6];let l=c(s);if(a!==null)return a;let u=o._tag===`Some`?o.value.httpBaseUrl:null,d;return n[7]!==l||n[8]!==u?(d=E(l,u),n[7]=l,n[8]=u,n[9]=d):d=n[9],d}function L(e,t){let n=(0,N.c)(6),r=y(e),i=r._tag===`Some`?r.value.httpBaseUrl:null,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1,refresh:!0},n[0]=a):a=n[0];let o=F(D.createUrl,a),s;return n[1]!==e||n[2]!==i||n[3]!==o||n[4]!==t?(s=async()=>{if(e===null||t===null||i===null)return null;let n=await o({environmentId:e,input:{resource:t}});if(n._tag===`Failure`)throw g(n);return T(i,n.value.relativeUrl)},n[1]=e,n[2]=i,n[3]=o,n[4]=t,n[5]=s):s=n[5],s}function R(e,t){let n=y(e),{canReadFiles:r}=v(e),i=(0,P.useMemo)(()=>r?t:t.filter(e=>e._tag!==`workspace-file`&&e._tag!==`media-file`&&e._tag!==`draft-workspace-file`),[r,t]),a=c(D.createUrls({environmentId:e,resources:i}));return(0,P.useMemo)(()=>{if(n._tag===`None`)return t.map(()=>null);let e=0;return t.map(t=>{if(!r&&(t._tag===`workspace-file`||t._tag===`media-file`||t._tag===`draft-workspace-file`))return null;let i=a[e++];return i&&p(i)?T(n.value.httpBaseUrl,i.value.relativeUrl):null})},[r,n,t,a])}var z=e=>/\.(?:html?|pdf)$/i.test(e.split(/[?#]/,1)[0]??``),B=class extends o(`BrowserPreviewUnavailableError`){},V=class extends o(`BrowserSettingsReadError`){get message(){return`Saved browser settings could not be loaded.`}};async function H(e){let t=await A().catch(e=>new V({cause:e}));if(t instanceof V)return f(u(t));let i=O(e.threadRef.environmentId),o=r(e.threadRef).activeTabId,s=()=>x(b.getState().byThreadKey,e.threadRef)?.id??null,c=s(),l=await e.openPreview({environmentId:e.threadRef.environmentId,input:{threadId:e.threadRef.threadId,url:e.url,viewport:k(t),profileId:e.profileId??j(t),...i===void 0?{}:{runtime:i}}});return _(l,t=>{if(a(e.threadRef,e.url),e.background){n(e.threadRef,t),o&&r(e.threadRef).activeTabId===t.tabId&&s()===c&&m(e.threadRef,o);return}d(e.threadRef,t),b.getState().openBrowser(e.threadRef,t.tabId)})}async function U(e){if(!M(e.threadRef.environmentId))return f(u(new B({message:`The integrated browser is unavailable in this runtime.`})));let t=S(e.filePath,e.workspaceRoot).relativePath!==void 0,n=await e.createAssetUrl({environmentId:e.threadRef.environmentId,input:{resource:{_tag:t?`workspace-file`:`media-file`,threadId:e.threadRef.threadId,path:e.filePath}}});if(n._tag===`Failure`)return f(n.cause);let r=T(e.httpBaseUrl,n.value.relativeUrl);return r===null?f(l(Error(`The environment returned an invalid asset URL.`))):H({threadRef:e.threadRef,url:r,openPreview:e.openPreview})}export{H as a,R as c,U as i,F as l,V as n,L as o,z as r,I as s,B as t};
2
+ //# sourceMappingURL=openFileInPreview-CdBR5kuZ.js.map
@@ -1,2 +1,2 @@
1
- import{Gs as e,Jg as t,Jy as n,cw as r,mh as i,qg as a,qs as o,rl as s,tl as c,wh as l}from"./utils-BgVDKR83.js";import"./entities-Cri9JXzU.js";import{Sn as u}from"./runtime-B75ae48c.js";import{A as d,S as f}from"./useSettings-CUN8qNLl.js";var p=`\0no-project`;function m(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function h(e){let t=new Set,n=[];for(let r of e){let e=r?.trim();e&&!t.has(e)&&(t.add(e),n.push(e))}return n}function g(e){let t=e.repositoryIdentity?.rootPath?.trim();if(!t)return null;let n=u(e.workspaceRoot),r=u(t);if(n.length===0||r.length===0)return null;if(n===r)return``;let i=`${r}${r.includes(`\\`)?`\\`:`/`}`;return n.startsWith(i)?n.slice(i.length).replaceAll(`\\`,`/`):null}function _(e,t){return`${e}:${u(t)}`}function v(e){return _(e.environmentId,e.workspaceRoot)}function y(e){return v(e)}function b(e){return v(e)}function x(e,t){return t.sidebarProjectGroupingOverrides?.[y(e)]??t.sidebarProjectGroupingMode}function S(e,n){let r=e.repositoryIdentity?t(e.repositoryIdentity):null;if(!r||r.includes(`\0`))return null;if(n===`repository`)return r;let i=g(e);return i===null||i.length===0?r:`${r}::${i}`}function C(t,n){if(n?.groupScratchProjects&&t.isScratch)return p;let r=n?.groupingMode??`repository`;return r===`separate`?v(t):S(t,r)??v(t)??o(e(t.environmentId,t.id))}function w(e,t,n){return C(e,{groupingMode:x(e,t),groupScratchProjects:n?.groupScratchProjects??!1})}function T(e){let t=h(e.members.map(e=>e.title)),n=h(e.members.map(e=>e.repositoryIdentity?a(e.repositoryIdentity):null)),r=h(e.members.map(e=>e.repositoryIdentity?.name)),i=t[0];return t.length===1&&i!==void 0&&!n.includes(i)&&!r.includes(i)?i:n.length===1?n[0]:r.length===1?r[0]:e.representative.title}function E(e){let t=Date.parse(e.updatedAt);if(Number.isFinite(t))return t;let n=Date.parse(e.createdAt);return Number.isFinite(n)?n:0}function D(e,t){let n=E(t)-E(e);return n>0||n===0&&t.id>e.id}function O(e,t){if(t.repositoryIdentity!==null)return t;let n=null;for(let t of e)t.repositoryIdentity!==null&&(n===null||D(n,t))&&(n=t);return n??t}function k(t){let n=new Map;for(let e of t.projects){let t=v(e),r=n.get(t);r?r.push(e):n.set(t,[e])}let r=new Map,i=new Map;for(let[e,a]of n){let n=a.reduce((e,t)=>D(e,t)?t:e),o=C(O(a,n),{groupingMode:x(n,t.settings),groupScratchProjects:t.groupScratchProjects??!1});r.set(e,o);let s={physicalProjectKey:e,project:n},c=i.get(o);c?c.push(s):i.set(o,[s])}let a=new Map,s=new Set;for(let n of t.projects){let i=v(n),c=r.get(i)??w(n,t.settings,{groupScratchProjects:t.groupScratchProjects??!1}),l=o(e(n.environmentId,n.id));if(s.has(l))continue;s.add(l);let u=e(n.environmentId,n.id),d=a.get(c);d?d.push(u):a.set(c,[u])}let c=t.preferredEnvironmentId??null;return Array.from(i,([e,n])=>{let r=(c?n.find(e=>e.project.environmentId===c)?.project:null)??n[0].project;return{key:e,label:t.groupScratchProjects&&r.isScratch?`No project`:n.length>1?T({representative:r,members:n.map(e=>e.project)}):r.title,representative:r,members:n,memberProjectRefs:a.get(e)??[]}})}function A(e,t){let n=new Map;t.forEach((e,t)=>{for(let r of e.memberProjectRefs){let e=`${r.environmentId}\0${r.projectId}`;n.has(e)||n.set(e,t)}});let r=e=>n.get(`${e.environmentId}\0${e.id}`)??t.length;return[...e].sort((e,t)=>r(e)-r(t))}var j={},M=Object.fromEntries(i.map(e=>[e,`environment`]));function N(e,t,n,r){let i=I(e,t,n);return r===void 0?i:P(i,r)}function P(e,t){let n=null,r=null;for(let i of Object.keys(s)){if(e.settings[i]!==null)continue;let{value:a,source:o}=F(i,null,t);n??={...e.settings},r??={...e.sources},n[i]=a,r[i]=o}return n===null||r===null?e:{...e,settings:n,sources:r}}function F(e,t,n){if(t!==null)return{value:t,source:`environment`};let{field:r,builtIn:i}=s[e],a=n?.[r];return a===void 0?{value:i,source:`environment`}:{value:a,source:`p4.json`}}function I(e,t,n){let r=t===null?void 0:e.projectSettingsOverrides[t],a=n==null||e.projectSettingsFolded?r??j:{...n.defaultModelSelection==null?{}:{defaultModelSelection:n.defaultModelSelection},...n.defaultThreadEnvMode==null?{}:{defaultThreadEnvMode:n.defaultThreadEnvMode},...r};if(Object.keys(a).length===0)return{settings:e,sources:M,overrides:j};let o={...M},s={...e};for(let n of i){if(!Object.hasOwn(a,n))continue;let r=a[n];r!==void 0&&(n!==`textGenerationModelSelection`&&n!==`defaultModelSelection`||r==null||l(e,t,r.instanceId))&&(s[n]=r,o[n]=`project`)}let c=s.textGenerationModelSelection;if(!l(e,t,c.instanceId)){let n=f(e.providerInstances,n=>l(e,t,n),{includeConfiguredInstances:!0,defaultModelSelection:s.defaultModelSelection});n!==null&&(s.textGenerationModelSelection=n)}return{settings:s,sources:o,overrides:a}}function L(e){let t=e.projectSettings.settings.defaultThreadEnvMode;if(t===`local`||e.projectHasThreads||e.projectSettings.sources.defaultThreadEnvMode!==`environment`||e.workspaceRoot===null||e.newProjectsRoot==null)return t;let n=u(e.newProjectsRoot),r=u(e.workspaceRoot),i=n.includes(`\\`)?`\\`:`/`,a=n.endsWith(i)?n:`${n}${i}`;return r.startsWith(a)&&r.length>a.length&&!r.slice(a.length).includes(i)?`local`:t}function R(e,t,n){let r=e.projectSettingsOverrides[t];if(r===void 0)return null;let i={...r};for(let e of n)delete i[e];return Object.keys(i).length===0?null:i}function z(e,t){let n=N(e,t).settings.worktreeCleanup;if(n?.mode===`custom`)return n.rules;if(n?.mode===`off`)return{worktreeKeepWhen:e.storageCleanup.worktreeKeepWhen,worktreeAfterDays:null,worktreeOnMerge:!1,worktreeOnDelete:!1,worktreeUnchanged:!1};let{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeOnMerge:a,worktreeOnDelete:o,worktreeUnchanged:s}=e.storageCleanup;return{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeOnMerge:a,worktreeOnDelete:o,worktreeUnchanged:s}}var B=d(c),V=n(B);function H(e){let t=V(e);return r(t)?t.value:null}export{z as a,v as c,b as d,m as f,N as i,_ as l,R as n,k as o,A as p,L as r,w as s,H as t,y as u};
2
- //# sourceMappingURL=p4ProjectFile-CAKJOMUN.js.map
1
+ import{Gs as e,Jg as t,Jy as n,cw as r,mh as i,qg as a,qs as o,rl as s,tl as c,wh as l}from"./utils-BAPnqm16.js";import"./entities-DCbEYTvn.js";import{Sn as u}from"./runtime-B5cKWtKn.js";import{A as d,S as f}from"./useSettings-CKA-LDDj.js";var p=`\0no-project`;function m(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function h(e){let t=new Set,n=[];for(let r of e){let e=r?.trim();e&&!t.has(e)&&(t.add(e),n.push(e))}return n}function g(e){let t=e.repositoryIdentity?.rootPath?.trim();if(!t)return null;let n=u(e.workspaceRoot),r=u(t);if(n.length===0||r.length===0)return null;if(n===r)return``;let i=`${r}${r.includes(`\\`)?`\\`:`/`}`;return n.startsWith(i)?n.slice(i.length).replaceAll(`\\`,`/`):null}function _(e,t){return`${e}:${u(t)}`}function v(e){return _(e.environmentId,e.workspaceRoot)}function y(e){return v(e)}function b(e){return v(e)}function x(e,t){return t.sidebarProjectGroupingOverrides?.[y(e)]??t.sidebarProjectGroupingMode}function S(e,n){let r=e.repositoryIdentity?t(e.repositoryIdentity):null;if(!r||r.includes(`\0`))return null;if(n===`repository`)return r;let i=g(e);return i===null||i.length===0?r:`${r}::${i}`}function C(t,n){if(n?.groupScratchProjects&&t.isScratch)return p;let r=n?.groupingMode??`repository`;return r===`separate`?v(t):S(t,r)??v(t)??o(e(t.environmentId,t.id))}function w(e,t,n){return C(e,{groupingMode:x(e,t),groupScratchProjects:n?.groupScratchProjects??!1})}function T(e){let t=h(e.members.map(e=>e.title)),n=h(e.members.map(e=>e.repositoryIdentity?a(e.repositoryIdentity):null)),r=h(e.members.map(e=>e.repositoryIdentity?.name)),i=t[0];return t.length===1&&i!==void 0&&!n.includes(i)&&!r.includes(i)?i:n.length===1?n[0]:r.length===1?r[0]:e.representative.title}function E(e){let t=Date.parse(e.updatedAt);if(Number.isFinite(t))return t;let n=Date.parse(e.createdAt);return Number.isFinite(n)?n:0}function D(e,t){let n=E(t)-E(e);return n>0||n===0&&t.id>e.id}function O(e,t){if(t.repositoryIdentity!==null)return t;let n=null;for(let t of e)t.repositoryIdentity!==null&&(n===null||D(n,t))&&(n=t);return n??t}function k(t){let n=new Map;for(let e of t.projects){let t=v(e),r=n.get(t);r?r.push(e):n.set(t,[e])}let r=new Map,i=new Map;for(let[e,a]of n){let n=a.reduce((e,t)=>D(e,t)?t:e),o=C(O(a,n),{groupingMode:x(n,t.settings),groupScratchProjects:t.groupScratchProjects??!1});r.set(e,o);let s={physicalProjectKey:e,project:n},c=i.get(o);c?c.push(s):i.set(o,[s])}let a=new Map,s=new Set;for(let n of t.projects){let i=v(n),c=r.get(i)??w(n,t.settings,{groupScratchProjects:t.groupScratchProjects??!1}),l=o(e(n.environmentId,n.id));if(s.has(l))continue;s.add(l);let u=e(n.environmentId,n.id),d=a.get(c);d?d.push(u):a.set(c,[u])}let c=t.preferredEnvironmentId??null;return Array.from(i,([e,n])=>{let r=(c?n.find(e=>e.project.environmentId===c)?.project:null)??n[0].project;return{key:e,label:t.groupScratchProjects&&r.isScratch?`No project`:n.length>1?T({representative:r,members:n.map(e=>e.project)}):r.title,representative:r,members:n,memberProjectRefs:a.get(e)??[]}})}function A(e,t){let n=new Map;t.forEach((e,t)=>{for(let r of e.memberProjectRefs){let e=`${r.environmentId}\0${r.projectId}`;n.has(e)||n.set(e,t)}});let r=e=>n.get(`${e.environmentId}\0${e.id}`)??t.length;return[...e].sort((e,t)=>r(e)-r(t))}var j={},M=Object.fromEntries(i.map(e=>[e,`environment`]));function N(e,t,n,r){let i=I(e,t,n);return r===void 0?i:P(i,r)}function P(e,t){let n=null,r=null;for(let i of Object.keys(s)){if(e.settings[i]!==null)continue;let{value:a,source:o}=F(i,null,t);n??={...e.settings},r??={...e.sources},n[i]=a,r[i]=o}return n===null||r===null?e:{...e,settings:n,sources:r}}function F(e,t,n){if(t!==null)return{value:t,source:`environment`};let{field:r,builtIn:i}=s[e],a=n?.[r];return a===void 0?{value:i,source:`environment`}:{value:a,source:`p4.json`}}function I(e,t,n){let r=t===null?void 0:e.projectSettingsOverrides[t],a=n==null||e.projectSettingsFolded?r??j:{...n.defaultModelSelection==null?{}:{defaultModelSelection:n.defaultModelSelection},...n.defaultThreadEnvMode==null?{}:{defaultThreadEnvMode:n.defaultThreadEnvMode},...r};if(Object.keys(a).length===0)return{settings:e,sources:M,overrides:j};let o={...M},s={...e};for(let n of i){if(!Object.hasOwn(a,n))continue;let r=a[n];r!==void 0&&(n!==`textGenerationModelSelection`&&n!==`defaultModelSelection`||r==null||l(e,t,r.instanceId))&&(s[n]=r,o[n]=`project`)}let c=s.textGenerationModelSelection;if(!l(e,t,c.instanceId)){let n=f(e.providerInstances,n=>l(e,t,n),{includeConfiguredInstances:!0,defaultModelSelection:s.defaultModelSelection});n!==null&&(s.textGenerationModelSelection=n)}return{settings:s,sources:o,overrides:a}}function L(e){let t=e.projectSettings.settings.defaultThreadEnvMode;if(t===`local`||e.projectHasThreads||e.projectSettings.sources.defaultThreadEnvMode!==`environment`||e.workspaceRoot===null||e.newProjectsRoot==null)return t;let n=u(e.newProjectsRoot),r=u(e.workspaceRoot),i=n.includes(`\\`)?`\\`:`/`,a=n.endsWith(i)?n:`${n}${i}`;return r.startsWith(a)&&r.length>a.length&&!r.slice(a.length).includes(i)?`local`:t}function R(e,t,n){let r=e.projectSettingsOverrides[t];if(r===void 0)return null;let i={...r};for(let e of n)delete i[e];return Object.keys(i).length===0?null:i}function z(e,t){let n=N(e,t).settings.worktreeCleanup;if(n?.mode===`custom`)return n.rules;if(n?.mode===`off`)return{worktreeKeepWhen:e.storageCleanup.worktreeKeepWhen,worktreeAfterDays:null,worktreeOnMerge:!1,worktreeOnDelete:!1,worktreeUnchanged:!1};let{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeOnMerge:a,worktreeOnDelete:o,worktreeUnchanged:s}=e.storageCleanup;return{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeOnMerge:a,worktreeOnDelete:o,worktreeUnchanged:s}}var B=d(c),V=n(B);function H(e){let t=V(e);return r(t)?t.value:null}export{z as a,v as c,b as d,m as f,N as i,_ as l,R as n,k as o,A as p,L as r,w as s,H as t,y as u};
2
+ //# sourceMappingURL=p4ProjectFile--u7SOSK5.js.map
@@ -1 +1 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{S as e}from"./mermaid-parser.core-Ch6yrkIv.js";export{e as createPacketServices};
1
+ import"./chunk-FOHPRMQF-DzxwRta7.js";import{S as e}from"./mermaid-parser.core-Brqe55KM.js";export{e as createPacketServices};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{NE as t,lE as n}from"./utils-BgVDKR83.js";import{a as r}from"./useParams-Bschqkhl.js";import{c as i,l as a,u as o}from"./main-Co3JeKTg.js";var s=t(),c=e(n());function l(){let e=(0,s.c)(9),t=r(),{authGateState:n}=i.useRouteContext();if(!n)return null;if(n.status===`hosted-pairing`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(a,{}),e[0]=t):t=e[0],t}let l;e[1]===t.history?l=e[2]:(l=()=>{t.history.replace(`/`),t.history.flush(),window.location.reload()},e[1]=t.history,e[2]=l);let u;e[3]===n.errorMessage?u=e[4]:(u=n.errorMessage?{initialErrorMessage:n.errorMessage}:{},e[3]=n.errorMessage,e[4]=u);let d;return e[5]!==n.auth||e[6]!==l||e[7]!==u?(d=(0,c.jsx)(o,{auth:n.auth,onAuthenticated:l,...u}),e[5]=n.auth,e[6]=l,e[7]=u,e[8]=d):d=e[8],d}export{l as component};
2
- //# sourceMappingURL=pair-BA6LcmsK.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{NE as t,lE as n}from"./utils-BAPnqm16.js";import{a as r}from"./useParams-CoeDewwU.js";import{c as i,l as a,u as o}from"./main-lV-t-UZx.js";var s=t(),c=e(n());function l(){let e=(0,s.c)(9),t=r(),{authGateState:n}=i.useRouteContext();if(!n)return null;if(n.status===`hosted-pairing`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(a,{}),e[0]=t):t=e[0],t}let l;e[1]===t.history?l=e[2]:(l=()=>{t.history.replace(`/`),t.history.flush(),window.location.reload()},e[1]=t.history,e[2]=l);let u;e[3]===n.errorMessage?u=e[4]:(u=n.errorMessage?{initialErrorMessage:n.errorMessage}:{},e[3]=n.errorMessage,e[4]=u);let d;return e[5]!==n.auth||e[6]!==l||e[7]!==u?(d=(0,c.jsx)(o,{auth:n.auth,onAuthenticated:l,...u}),e[5]=n.auth,e[6]=l,e[7]=u,e[8]=d):d=e[8],d}export{l as component};
2
+ //# sourceMappingURL=pair-C11lrlzi.js.map
@@ -1,2 +1,2 @@
1
- import{t as e,u as t}from"./mermaid-parser.core-Ch6yrkIv.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-CxeiyFio.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-BLPEkz6O.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-CDUpMNay.js";var c=t().RailroadPeg.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=n(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=n(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=n(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=n(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=n(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(h(e)))},`populateDb`),_={parser:{parse:n(t=>{o.clear(),r.debug(`[PEG Parser] Starting Langium parse`);let n=c.parse(t);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new e(n);let i=n.value;r.debug(`[PEG Parser] Parsed rules:`,i.rules.length),g(i),r.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{_ as diagram};
2
- //# sourceMappingURL=pegDiagram-XKGWAZYB-BMn57iOd.js.map
1
+ import{t as e,u as t}from"./mermaid-parser.core-Brqe55KM.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-D-pyRDMG.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-Lt0ZENIq.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-Cdl6aiT5.js";var c=t().RailroadPeg.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=n(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=n(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=n(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=n(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=n(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(h(e)))},`populateDb`),_={parser:{parse:n(t=>{o.clear(),r.debug(`[PEG Parser] Starting Langium parse`);let n=c.parse(t);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new e(n);let i=n.value;r.debug(`[PEG Parser] Parsed rules:`,i.rules.length),g(i),r.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{_ as diagram};
2
+ //# sourceMappingURL=pegDiagram-XKGWAZYB-Iy9neoGN.js.map
@@ -1,2 +1,2 @@
1
- import{S as e,x as t}from"./_chat-DcFCVkrG.js";import{B as n,C as r,E as i,F as a,H as o,I as s,L as c,N as l,O as u,R as d,T as f,U as p,_ as m,a as ee,b as te,c as h,d as g,f as _,g as ne,h as v,i as re,j as ie,k as ae,n as oe,o as y,p as se,r as ce,s as b,t as le,u as ue,v as x,w as de,x as S,z as C}from"./renderScheduler-DM1wgh78.js";var w=2.2,T=.075,E=.026,D=.004,O=.008,k=.042499999999999996,A=.07799999999999999,fe=2076/2152,j=e=>Number.isFinite(e)&&e>.75&&e<1.5;function M(e,t,n,r,i=0){let a=t===`left`?-e+n:D/2+i,o=t===`left`?-.004/2-i:e-n,s=-2.2/2+n,c=w/2-n,l=new C;return t===`left`?(l.moveTo(a+r,s),l.lineTo(o,s),l.lineTo(o,c),l.lineTo(a+r,c),l.quadraticCurveTo(a,c,a,c-r),l.lineTo(a,s+r),l.quadraticCurveTo(a,s,a+r,s)):(l.moveTo(a,s),l.lineTo(o-r,s),l.quadraticCurveTo(o,s,o,s+r),l.lineTo(o,c-r),l.quadraticCurveTo(o,c,o-r,c),l.lineTo(a,c)),l.closePath(),l}function N(e,t,n){let r=new C;return r.moveTo(-e/2+n,-t/2),r.lineTo(e/2-n,-t/2),r.quadraticCurveTo(e/2,-t/2,e/2,-t/2+n),r.lineTo(e/2,t/2-n),r.quadraticCurveTo(e/2,t/2,e/2-n,t/2),r.lineTo(-e/2+n,t/2),r.quadraticCurveTo(-e/2,t/2,-e/2,t/2-n),r.lineTo(-e/2,-t/2+n),r.quadraticCurveTo(-e/2,-t/2,-e/2+n,-t/2),r.closePath(),r}function P(e){return N(e-E*2-.02,w-E*2-.04,.07)}function pe(e,t,r,a=fe){let c=w-2*E,d=a*c/2+E,ee=new S,h=new S;ee.add(h);let g=new S,_=new S;h.add(g,_);let v=new ae({color:10726322,metalness:.9,roughness:.28}),re=new ae({color:12896976,metalness:.95,roughness:.16}),ie=new u({color:724240,metalness:.1,roughness:.2,clearcoat:1}),oe=new u({color:2896439,metalness:.35,roughness:.52,clearcoat:.4,clearcoatRoughness:.6}),y=new u({color:1711650,metalness:.55,roughness:.3,clearcoat:1}),ce=new u({color:397346,metalness:.6,roughness:.1,clearcoat:1}),b=new i({color:15919830}),le=new i({map:e,toneMapped:!1}),ue=new i({colorWrite:!1,depthWrite:!1}),x=new i({map:e,toneMapped:!1}),de=[v,re,ie,oe,y,ce,b,le,ue,x];g.position.z=k;let C=new S;C.position.z=-.042499999999999996,g.add(C);function D(e,t,r){let i=new f(new te(M(d,t,O,.1,O),{depth:T-O*2,bevelEnabled:!0,bevelSize:O,bevelThickness:O,bevelSegments:3,curveSegments:12}),v);i.position.z=-.0295,e.add(i);let a=new f(new n(M(d,t,.01,.095,.002),12),ie);a.position.z=.0385,e.add(a);let o=new f(new n(M(d,t===`left`?`right`:`left`,.01,.095,.002),12),r);o.name=`${t}-back`,o.rotation.y=Math.PI,o.position.set(0,0,-.075/2-.001),e.add(o);let s=new n(M(d,t,E,.076));s.computeBoundingBox();let c=new f(s,ue);return c.name=`${t}-inner-screen`,c.position.z=.0405,e.add(c),c}let j=D(C,`left`,ie),pe=D(_,`right`,oe),F=2*(d-E),I=new l(F,c,40,48),L=I.getAttribute(`position`),R=I.getAttribute(`uv`),z=new Float32Array(L.count);for(let e=0;e<L.count;e++){let t=L.getY(e),n=F/2,r=.076,i=Math.max(0,Math.abs(t)-.9980000000000001),a=n-r+Math.sqrt(Math.max(0,r*r-i*i)),o=Math.max(-a,Math.min(a,L.getX(e)));z[e]=o,R.setXY(e,o/F+.5,t/c+.5)}R.needsUpdate=!0;let B=new f(I,le);B.name=`continuous-inner-screen`,h.add(B);let V=.15,H=new f(new m(A,A,2.188,32,1,!1,Math.PI/2+V,Math.PI-V*2),re);H.name=`hinge-spine`,H.position.z=k,h.add(H);let U=new f(new n(P(d)),x);U.name=`cover-screen`,U.position.set(-d/2,0,-.075/2-.003),U.rotation.y=Math.PI,C.add(U);let W=new S;W.name=`rear-camera`;let G=.46,K=.2;W.position.set(d-.07-G/2,w/2-.08-K/2,-.075/2-.002),W.rotation.y=Math.PI,_.add(W);let q=new f(new te(N(G,K,.07),{depth:.02,bevelEnabled:!0,bevelSize:.008,bevelThickness:.006,bevelSegments:3,curveSegments:12}),y);q.name=`camera-plate`,W.add(q);for(let[e,t]of[[-.14,.05],[-.01,.05],[.105,.036]]){let n=new f(new m(t+.012,t+.012,.012,32),v);n.rotation.x=Math.PI/2,n.position.set(e,0,.030000000000000002),W.add(n);let r=new f(new ne(t,32),ce);r.name=`camera-lens`,r.position.set(e,0,.036500000000000005),W.add(r)}let J=new f(new ne(.018,20),b);J.position.set(.185,.045,.026500000000000003),W.add(J);for(let[e,t]of[[.52,.16],[.2,.3]]){let n=new f(new se(.02,t,T*.45),v);n.position.set(d+.008,e,0),_.add(n)}let Y=new s,me=new o,X=new p,Z=null,he=t,Q=r,$=()=>{let e=Q>=90;B.visible=e,j.visible=e,pe.visible=e,U.visible=!e},ge=e=>{Q=Math.max(0,Math.min(180,e)),g.rotation.y=Math.PI*(1-Q/180),H.rotation.y=g.rotation.y/2;let t=g.rotation.y,n=Math.cos(t),r=Math.sin(t),i=-.0010000000000000009;for(let e=0;e<L.count;e++){let t=z[e];t<0?L.setXYZ(e,t*n+i*r,L.getY(e),-t*r+i*n+k):L.setXYZ(e,t,L.getY(e),.041499999999999995)}L.needsUpdate=!0,I.computeBoundingBox(),I.computeBoundingSphere(),$()},_e=(e,t)=>{he=t,le.map=e,x.map=e,U.geometry.computeBoundingBox();let n=U.geometry.boundingBox,r=U.geometry.getAttribute(`uv`),i=U.geometry.getAttribute(`position`);for(let e=0;e<r.count;e++){let t=(i.getX(e)-n.min.x)/(n.max.x-n.min.x),a=(i.getY(e)-n.min.y)/(n.max.y-n.min.y);r.setXY(e,t,a)}r.needsUpdate=!0,$()};return ge(r),_e(e,t),{root:ee,orientation:h,width:d*2,height:w,innerAspect:a,setAngle:ge,setDisplay:_e,screenPoint(e,t,n,r=!1){h.updateWorldMatrix(!0,!0),n.updateMatrixWorld(!0),me.set(e*2-1,1-t*2),Y.setFromCamera(me,n);let i=U.visible?[U]:[j,pe],a=Y.intersectObjects(i,!1)[0];if(!a&&!r)return Z=null,null;let o=a?.object??(Z?.visible?Z:i[0]);if(!o)return null;if(a&&(Z=o),a)X.copy(a.point);else{let e=new p(0,0,1).transformDirection(o.matrixWorld),t=new p().setFromMatrixPosition(o.matrixWorld),n=e.dot(t.clone().sub(Y.ray.origin))/e.dot(Y.ray.direction);if(!Number.isFinite(n))return null;X.copy(Y.ray.direction).multiplyScalar(n).add(Y.ray.origin)}o.worldToLocal(X);let s=o.geometry.boundingBox,c=Math.max(0,Math.min(1,(X.x-s.min.x)/(s.max.x-s.min.x))),l=Math.max(0,Math.min(1,(s.max.y-X.y)/(s.max.y-s.min.y))),u=o===U?c:(o===j?c:1+c)/2;return he.rotation===Math.PI?{x:1-u,y:1-l}:{x:u,y:l}},dispose(){ee.traverse(e=>{e instanceof f&&e.geometry.dispose()});for(let e of de)e.dispose()}}}var F=450,I=850;function L(n){let i=new ue({canvas:n.canvas,alpha:!0,antialias:!0,powerPreference:`low-power`});i.outputColorSpace=c;let o=()=>{let e=new v(n.source);return e.colorSpace=c,e.minFilter=r,e.magFilter=r,e.generateMipmaps=!1,e},s=o(),l=n.source.width,u=n.source.height,f=new d,m=new ie(32,1,.1,30);m.position.z=5.5;let te=new g(16777215,2.4),ne=new x(15003135,5);ne.position.set(-3,4,5);let ae=new x(16777215,4);ae.position.set(3,1,-3);let se=new x(10464468,2);se.position.set(-2,-2,-4),f.add(te,ne,ae,se);let S=null,C=h(S,n.source.width,n.source.height),w=n.profile??e,T=n.foldAngle??null,E=T!==null&&w.id.startsWith(`android`)?0:C.rotation,D=null,O=null,k=n.model??null,A=null,M=null,N=null,P=()=>n.source.width/n.source.height,L=j(P())?P():fe,R=(e,t=C)=>pe(s,t,e,L),z=e=>{if(!N)return e;let t=Math.min(1,(performance.now()-N.startedAt)/I),n=t*t*(3-2*t);return N.from+(N.to-N.from)*n},B=T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);f.add(B.root);let V=!1,H=new a,U=ce({choose:e=>oe(e,[{rotation:new a,yawLimit:Math.PI/3}]).rotation});U.setPose(H,performance.now(),!0);let W=re(),G=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,K={width:0,height:0,pixelRatio:1},q={width:0,height:0,pixelRatio:0},J=null,Y=(e=!1)=>{if(!K.width||!K.height)return;m.aspect=K.width/K.height;let t=new _(new p(-B.width/2,-B.height/2,0),new p(B.width/2,B.height/2,0));O&&M&&t.union(M),t.applyMatrix4(new de().makeRotationZ(E));let r=t.getSize(new p),i=r.x/r.y;i!==J&&(J=i,n.onFramingAspect?.(i)),B.root.updateMatrixWorld(!0),W.setBounds(new _().setFromObject(B.root),m.fov*Math.PI/360,m.aspect,performance.now(),e),me()},me=()=>{m.position.set(W.center.x,W.center.y,W.distance()),m.lookAt(W.center.x,W.center.y,0),m.updateProjectionMatrix()},X=()=>{B.root.quaternion.copy(U.rotation),B.orientation.rotation.z=E},Z=le(()=>{if(!V&&K.width&&K.height)try{(q.width!==K.width||q.height!==K.height||q.pixelRatio!==K.pixelRatio)&&(i.setDrawingBufferSize(K.width,K.height,K.pixelRatio),q=K);let e=performance.now();if(U.advance(e,G())&&(X(),Y(G())),D){let t=Math.min(1,(e-D.startedAt)/F),n=t*t*(3-2*t);E=D.from+(D.to-D.from)*n,t===1&&(D=null),X(),Y(G())}if(N&&`setAngle`in B){let t=Math.min(1,(e-N.startedAt)/I),n=t*t*(3-2*t);B.setAngle(N.from+(N.to-N.from)*n),t===1&&(N=null),Y(G())}W.advance(e,G()),me(),i.render(f,m),(U.needsFrame()||W.needsFrame()||D||N)&&Z.invalidate()}catch{n.onUnavailable()}}),he=(e=w)=>{let t=h(S,n.source.width,n.source.height),r=l!==n.source.width||u!==n.source.height;if(r||e!==w||t.aspect!==C.aspect||t.rawLandscape!==C.rawLandscape||t.rotation!==C.rotation){if(r){let e=s;s=o(),l=n.source.width,u=n.source.height,B.setDisplay(s,t),e.dispose()}let i=P(),a=j(i)&&i!==L;if(a&&(L=i),!O&&`setAngle`in B&&a){let e=z(T??180);f.remove(B.root),B.dispose(),B=R(e,t),f.add(B.root)}else!O&&!(`setAngle`in B)&&(e!==w||t.aspect!==C.aspect)?(f.remove(B.root),B.dispose(),B=b(s,t,e),f.add(B.root)):B.setDisplay(s,t);if(t.rotation!==C.rotation){if(e.id.startsWith(`android`)&&!(`setAngle`in B)&&!G()){let e=Math.atan2(Math.sin(t.rotation-E),Math.cos(t.rotation-E));D={from:E,to:E+e,startedAt:performance.now()}}else D=null,E=`setAngle`in B?0:t.rotation}C=t,w=e,X(),Y(!D)}X()},Q=t({load:y,onError:n.onModelError,install(e){let t=V?null:e?ee(e.asset,s,C):T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);N=null,f.remove(B.root),B.dispose(),O=e,t&&(B=t,f.add(B.root),A&&(O?B.orientation.add(A.asset):A.asset.removeFromParent()),X(),Y(!0),Z.invalidate())}}),$=t({load:y,onError:n.onModelError,install(e){let t=e?new _().setFromObject(e.asset):null;if(t&&(t.isEmpty()||![...t.min.toArray(),...t.max.toArray()].every(Number.isFinite)))throw Error(`Device accessory has invalid bounds`);A?.asset.removeFromParent(),A=e,M=t,!V&&(O&&A&&B.orientation.add(A.asset),Y(!0),Z.invalidate())}}),ge=e=>{$.set(e?.modelId===k?.id?e:null)},_e=e=>{e.preventDefault(),n.onUnavailable()};return n.canvas.addEventListener(`webglcontextlost`,_e),X(),Q.set(n.model??null),ge(n.accessory??null),{setModel(e){(e?.id!==k?.id||e?.url!==k?.url)&&$.set(null),k=e,Q.set(e)},setAccessory:ge,setFoldAngle(e){if(V||e===T)return;let t=T;if(T=e,!O){if(e===null||!(`setAngle`in B))f.remove(B.root),B.dispose(),B=e===null?b(s,C,w):R(e),f.add(B.root),D=null,E=e===null?C.rotation:0,N=null,X(),Y(!0);else{let n=z(t??e);G()?(N=null,B.setAngle(e),Y(!0)):N={from:n,to:e,startedAt:performance.now()}}Z.invalidate()}},frameUpdated(){V||(he(),s.needsUpdate=!0,Z.invalidate())},setScreen(e,t=w){V||(S=e,he(t),Z.invalidate())},resize(e,t,n){if(V||![e,t,n].every(Number.isFinite)||e<=0||t<=0)return;let r=Math.min(2,Math.max(1,n));(K.width!==e||K.height!==t||K.pixelRatio!==r)&&(K={width:e,height:t,pixelRatio:r},Y(!0),Z.invalidate())},screenPoint(e,t,n=!1){return V?null:(X(),B.screenPoint(e,t,m,n))},orbit(e,t){V||(U.orbit(e*K.width,t*K.height,performance.now()),Z.invalidate())},setInteractionActive(e,t){if(V)return;let n=performance.now();t===`orbit`?U.dragActive(e,n):(U.hold(e,n),W.hold(e,n)),Z.invalidate()},resetPose(){V||(U.reset(H,performance.now()),Z.invalidate())},dispose(){if(V)return;V=!0,Z.dispose();let e=O!==null;$.dispose(),Q.dispose(),n.canvas.removeEventListener(`webglcontextlost`,_e),f.remove(B.root),e||B.dispose(),s.dispose(),i.dispose(),i.forceContextLoss()}}}export{L as createPhoneViewer};
2
- //# sourceMappingURL=phoneViewer-C-9G9sMe.js.map
1
+ import{S as e,x as t}from"./_chat-C2VZmKVT.js";import{B as n,C as r,E as i,F as a,H as o,I as s,L as c,N as l,O as u,R as d,T as f,U as p,_ as m,a as ee,b as te,c as h,d as g,f as _,g as ne,h as v,i as re,j as ie,k as ae,n as oe,o as y,p as se,r as ce,s as b,t as le,u as ue,v as x,w as de,x as S,z as C}from"./renderScheduler-CcWhS7Yq.js";var w=2.2,T=.075,E=.026,D=.004,O=.008,k=.042499999999999996,A=.07799999999999999,fe=2076/2152,j=e=>Number.isFinite(e)&&e>.75&&e<1.5;function M(e,t,n,r,i=0){let a=t===`left`?-e+n:D/2+i,o=t===`left`?-.004/2-i:e-n,s=-2.2/2+n,c=w/2-n,l=new C;return t===`left`?(l.moveTo(a+r,s),l.lineTo(o,s),l.lineTo(o,c),l.lineTo(a+r,c),l.quadraticCurveTo(a,c,a,c-r),l.lineTo(a,s+r),l.quadraticCurveTo(a,s,a+r,s)):(l.moveTo(a,s),l.lineTo(o-r,s),l.quadraticCurveTo(o,s,o,s+r),l.lineTo(o,c-r),l.quadraticCurveTo(o,c,o-r,c),l.lineTo(a,c)),l.closePath(),l}function N(e,t,n){let r=new C;return r.moveTo(-e/2+n,-t/2),r.lineTo(e/2-n,-t/2),r.quadraticCurveTo(e/2,-t/2,e/2,-t/2+n),r.lineTo(e/2,t/2-n),r.quadraticCurveTo(e/2,t/2,e/2-n,t/2),r.lineTo(-e/2+n,t/2),r.quadraticCurveTo(-e/2,t/2,-e/2,t/2-n),r.lineTo(-e/2,-t/2+n),r.quadraticCurveTo(-e/2,-t/2,-e/2+n,-t/2),r.closePath(),r}function P(e){return N(e-E*2-.02,w-E*2-.04,.07)}function pe(e,t,r,a=fe){let c=w-2*E,d=a*c/2+E,ee=new S,h=new S;ee.add(h);let g=new S,_=new S;h.add(g,_);let v=new ae({color:10726322,metalness:.9,roughness:.28}),re=new ae({color:12896976,metalness:.95,roughness:.16}),ie=new u({color:724240,metalness:.1,roughness:.2,clearcoat:1}),oe=new u({color:2896439,metalness:.35,roughness:.52,clearcoat:.4,clearcoatRoughness:.6}),y=new u({color:1711650,metalness:.55,roughness:.3,clearcoat:1}),ce=new u({color:397346,metalness:.6,roughness:.1,clearcoat:1}),b=new i({color:15919830}),le=new i({map:e,toneMapped:!1}),ue=new i({colorWrite:!1,depthWrite:!1}),x=new i({map:e,toneMapped:!1}),de=[v,re,ie,oe,y,ce,b,le,ue,x];g.position.z=k;let C=new S;C.position.z=-.042499999999999996,g.add(C);function D(e,t,r){let i=new f(new te(M(d,t,O,.1,O),{depth:T-O*2,bevelEnabled:!0,bevelSize:O,bevelThickness:O,bevelSegments:3,curveSegments:12}),v);i.position.z=-.0295,e.add(i);let a=new f(new n(M(d,t,.01,.095,.002),12),ie);a.position.z=.0385,e.add(a);let o=new f(new n(M(d,t===`left`?`right`:`left`,.01,.095,.002),12),r);o.name=`${t}-back`,o.rotation.y=Math.PI,o.position.set(0,0,-.075/2-.001),e.add(o);let s=new n(M(d,t,E,.076));s.computeBoundingBox();let c=new f(s,ue);return c.name=`${t}-inner-screen`,c.position.z=.0405,e.add(c),c}let j=D(C,`left`,ie),pe=D(_,`right`,oe),F=2*(d-E),I=new l(F,c,40,48),L=I.getAttribute(`position`),R=I.getAttribute(`uv`),z=new Float32Array(L.count);for(let e=0;e<L.count;e++){let t=L.getY(e),n=F/2,r=.076,i=Math.max(0,Math.abs(t)-.9980000000000001),a=n-r+Math.sqrt(Math.max(0,r*r-i*i)),o=Math.max(-a,Math.min(a,L.getX(e)));z[e]=o,R.setXY(e,o/F+.5,t/c+.5)}R.needsUpdate=!0;let B=new f(I,le);B.name=`continuous-inner-screen`,h.add(B);let V=.15,H=new f(new m(A,A,2.188,32,1,!1,Math.PI/2+V,Math.PI-V*2),re);H.name=`hinge-spine`,H.position.z=k,h.add(H);let U=new f(new n(P(d)),x);U.name=`cover-screen`,U.position.set(-d/2,0,-.075/2-.003),U.rotation.y=Math.PI,C.add(U);let W=new S;W.name=`rear-camera`;let G=.46,K=.2;W.position.set(d-.07-G/2,w/2-.08-K/2,-.075/2-.002),W.rotation.y=Math.PI,_.add(W);let q=new f(new te(N(G,K,.07),{depth:.02,bevelEnabled:!0,bevelSize:.008,bevelThickness:.006,bevelSegments:3,curveSegments:12}),y);q.name=`camera-plate`,W.add(q);for(let[e,t]of[[-.14,.05],[-.01,.05],[.105,.036]]){let n=new f(new m(t+.012,t+.012,.012,32),v);n.rotation.x=Math.PI/2,n.position.set(e,0,.030000000000000002),W.add(n);let r=new f(new ne(t,32),ce);r.name=`camera-lens`,r.position.set(e,0,.036500000000000005),W.add(r)}let J=new f(new ne(.018,20),b);J.position.set(.185,.045,.026500000000000003),W.add(J);for(let[e,t]of[[.52,.16],[.2,.3]]){let n=new f(new se(.02,t,T*.45),v);n.position.set(d+.008,e,0),_.add(n)}let Y=new s,me=new o,X=new p,Z=null,he=t,Q=r,$=()=>{let e=Q>=90;B.visible=e,j.visible=e,pe.visible=e,U.visible=!e},ge=e=>{Q=Math.max(0,Math.min(180,e)),g.rotation.y=Math.PI*(1-Q/180),H.rotation.y=g.rotation.y/2;let t=g.rotation.y,n=Math.cos(t),r=Math.sin(t),i=-.0010000000000000009;for(let e=0;e<L.count;e++){let t=z[e];t<0?L.setXYZ(e,t*n+i*r,L.getY(e),-t*r+i*n+k):L.setXYZ(e,t,L.getY(e),.041499999999999995)}L.needsUpdate=!0,I.computeBoundingBox(),I.computeBoundingSphere(),$()},_e=(e,t)=>{he=t,le.map=e,x.map=e,U.geometry.computeBoundingBox();let n=U.geometry.boundingBox,r=U.geometry.getAttribute(`uv`),i=U.geometry.getAttribute(`position`);for(let e=0;e<r.count;e++){let t=(i.getX(e)-n.min.x)/(n.max.x-n.min.x),a=(i.getY(e)-n.min.y)/(n.max.y-n.min.y);r.setXY(e,t,a)}r.needsUpdate=!0,$()};return ge(r),_e(e,t),{root:ee,orientation:h,width:d*2,height:w,innerAspect:a,setAngle:ge,setDisplay:_e,screenPoint(e,t,n,r=!1){h.updateWorldMatrix(!0,!0),n.updateMatrixWorld(!0),me.set(e*2-1,1-t*2),Y.setFromCamera(me,n);let i=U.visible?[U]:[j,pe],a=Y.intersectObjects(i,!1)[0];if(!a&&!r)return Z=null,null;let o=a?.object??(Z?.visible?Z:i[0]);if(!o)return null;if(a&&(Z=o),a)X.copy(a.point);else{let e=new p(0,0,1).transformDirection(o.matrixWorld),t=new p().setFromMatrixPosition(o.matrixWorld),n=e.dot(t.clone().sub(Y.ray.origin))/e.dot(Y.ray.direction);if(!Number.isFinite(n))return null;X.copy(Y.ray.direction).multiplyScalar(n).add(Y.ray.origin)}o.worldToLocal(X);let s=o.geometry.boundingBox,c=Math.max(0,Math.min(1,(X.x-s.min.x)/(s.max.x-s.min.x))),l=Math.max(0,Math.min(1,(s.max.y-X.y)/(s.max.y-s.min.y))),u=o===U?c:(o===j?c:1+c)/2;return he.rotation===Math.PI?{x:1-u,y:1-l}:{x:u,y:l}},dispose(){ee.traverse(e=>{e instanceof f&&e.geometry.dispose()});for(let e of de)e.dispose()}}}var F=450,I=850;function L(n){let i=new ue({canvas:n.canvas,alpha:!0,antialias:!0,powerPreference:`low-power`});i.outputColorSpace=c;let o=()=>{let e=new v(n.source);return e.colorSpace=c,e.minFilter=r,e.magFilter=r,e.generateMipmaps=!1,e},s=o(),l=n.source.width,u=n.source.height,f=new d,m=new ie(32,1,.1,30);m.position.z=5.5;let te=new g(16777215,2.4),ne=new x(15003135,5);ne.position.set(-3,4,5);let ae=new x(16777215,4);ae.position.set(3,1,-3);let se=new x(10464468,2);se.position.set(-2,-2,-4),f.add(te,ne,ae,se);let S=null,C=h(S,n.source.width,n.source.height),w=n.profile??e,T=n.foldAngle??null,E=T!==null&&w.id.startsWith(`android`)?0:C.rotation,D=null,O=null,k=n.model??null,A=null,M=null,N=null,P=()=>n.source.width/n.source.height,L=j(P())?P():fe,R=(e,t=C)=>pe(s,t,e,L),z=e=>{if(!N)return e;let t=Math.min(1,(performance.now()-N.startedAt)/I),n=t*t*(3-2*t);return N.from+(N.to-N.from)*n},B=T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);f.add(B.root);let V=!1,H=new a,U=ce({choose:e=>oe(e,[{rotation:new a,yawLimit:Math.PI/3}]).rotation});U.setPose(H,performance.now(),!0);let W=re(),G=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,K={width:0,height:0,pixelRatio:1},q={width:0,height:0,pixelRatio:0},J=null,Y=(e=!1)=>{if(!K.width||!K.height)return;m.aspect=K.width/K.height;let t=new _(new p(-B.width/2,-B.height/2,0),new p(B.width/2,B.height/2,0));O&&M&&t.union(M),t.applyMatrix4(new de().makeRotationZ(E));let r=t.getSize(new p),i=r.x/r.y;i!==J&&(J=i,n.onFramingAspect?.(i)),B.root.updateMatrixWorld(!0),W.setBounds(new _().setFromObject(B.root),m.fov*Math.PI/360,m.aspect,performance.now(),e),me()},me=()=>{m.position.set(W.center.x,W.center.y,W.distance()),m.lookAt(W.center.x,W.center.y,0),m.updateProjectionMatrix()},X=()=>{B.root.quaternion.copy(U.rotation),B.orientation.rotation.z=E},Z=le(()=>{if(!V&&K.width&&K.height)try{(q.width!==K.width||q.height!==K.height||q.pixelRatio!==K.pixelRatio)&&(i.setDrawingBufferSize(K.width,K.height,K.pixelRatio),q=K);let e=performance.now();if(U.advance(e,G())&&(X(),Y(G())),D){let t=Math.min(1,(e-D.startedAt)/F),n=t*t*(3-2*t);E=D.from+(D.to-D.from)*n,t===1&&(D=null),X(),Y(G())}if(N&&`setAngle`in B){let t=Math.min(1,(e-N.startedAt)/I),n=t*t*(3-2*t);B.setAngle(N.from+(N.to-N.from)*n),t===1&&(N=null),Y(G())}W.advance(e,G()),me(),i.render(f,m),(U.needsFrame()||W.needsFrame()||D||N)&&Z.invalidate()}catch{n.onUnavailable()}}),he=(e=w)=>{let t=h(S,n.source.width,n.source.height),r=l!==n.source.width||u!==n.source.height;if(r||e!==w||t.aspect!==C.aspect||t.rawLandscape!==C.rawLandscape||t.rotation!==C.rotation){if(r){let e=s;s=o(),l=n.source.width,u=n.source.height,B.setDisplay(s,t),e.dispose()}let i=P(),a=j(i)&&i!==L;if(a&&(L=i),!O&&`setAngle`in B&&a){let e=z(T??180);f.remove(B.root),B.dispose(),B=R(e,t),f.add(B.root)}else!O&&!(`setAngle`in B)&&(e!==w||t.aspect!==C.aspect)?(f.remove(B.root),B.dispose(),B=b(s,t,e),f.add(B.root)):B.setDisplay(s,t);if(t.rotation!==C.rotation){if(e.id.startsWith(`android`)&&!(`setAngle`in B)&&!G()){let e=Math.atan2(Math.sin(t.rotation-E),Math.cos(t.rotation-E));D={from:E,to:E+e,startedAt:performance.now()}}else D=null,E=`setAngle`in B?0:t.rotation}C=t,w=e,X(),Y(!D)}X()},Q=t({load:y,onError:n.onModelError,install(e){let t=V?null:e?ee(e.asset,s,C):T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);N=null,f.remove(B.root),B.dispose(),O=e,t&&(B=t,f.add(B.root),A&&(O?B.orientation.add(A.asset):A.asset.removeFromParent()),X(),Y(!0),Z.invalidate())}}),$=t({load:y,onError:n.onModelError,install(e){let t=e?new _().setFromObject(e.asset):null;if(t&&(t.isEmpty()||![...t.min.toArray(),...t.max.toArray()].every(Number.isFinite)))throw Error(`Device accessory has invalid bounds`);A?.asset.removeFromParent(),A=e,M=t,!V&&(O&&A&&B.orientation.add(A.asset),Y(!0),Z.invalidate())}}),ge=e=>{$.set(e?.modelId===k?.id?e:null)},_e=e=>{e.preventDefault(),n.onUnavailable()};return n.canvas.addEventListener(`webglcontextlost`,_e),X(),Q.set(n.model??null),ge(n.accessory??null),{setModel(e){(e?.id!==k?.id||e?.url!==k?.url)&&$.set(null),k=e,Q.set(e)},setAccessory:ge,setFoldAngle(e){if(V||e===T)return;let t=T;if(T=e,!O){if(e===null||!(`setAngle`in B))f.remove(B.root),B.dispose(),B=e===null?b(s,C,w):R(e),f.add(B.root),D=null,E=e===null?C.rotation:0,N=null,X(),Y(!0);else{let n=z(t??e);G()?(N=null,B.setAngle(e),Y(!0)):N={from:n,to:e,startedAt:performance.now()}}Z.invalidate()}},frameUpdated(){V||(he(),s.needsUpdate=!0,Z.invalidate())},setScreen(e,t=w){V||(S=e,he(t),Z.invalidate())},resize(e,t,n){if(V||![e,t,n].every(Number.isFinite)||e<=0||t<=0)return;let r=Math.min(2,Math.max(1,n));(K.width!==e||K.height!==t||K.pixelRatio!==r)&&(K={width:e,height:t,pixelRatio:r},Y(!0),Z.invalidate())},screenPoint(e,t,n=!1){return V?null:(X(),B.screenPoint(e,t,m,n))},orbit(e,t){V||(U.orbit(e*K.width,t*K.height,performance.now()),Z.invalidate())},setInteractionActive(e,t){if(V)return;let n=performance.now();t===`orbit`?U.dragActive(e,n):(U.hold(e,n),W.hold(e,n)),Z.invalidate()},resetPose(){V||(U.reset(H,performance.now()),Z.invalidate())},dispose(){if(V)return;V=!0,Z.dispose();let e=O!==null;$.dispose(),Q.dispose(),n.canvas.removeEventListener(`webglcontextlost`,_e),f.remove(B.root),e||B.dispose(),s.dispose(),i.dispose(),i.forceContextLoss()}}}export{L as createPhoneViewer};
2
+ //# sourceMappingURL=phoneViewer-iqsNqM8D.js.map
@@ -1 +1 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{b as e}from"./mermaid-parser.core-Ch6yrkIv.js";export{e as createPieServices};
1
+ import"./chunk-FOHPRMQF-DzxwRta7.js";import{b as e}from"./mermaid-parser.core-Brqe55KM.js";export{e as createPieServices};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./mermaid-parser.core-Ch6yrkIv.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-oBChb5qS.js";import{H as r,K as i,U as a,a as o,c as s,f as c,v as l,w as u,x as d,y as f}from"./chunk-DU6HZSFF-CxeiyFio.js";import{t as p}from"./ordinal-BDEzSJ7C.js";import{n as m}from"./path-fybaL0A-.js";import{m as h}from"./dist-B_J_HbC0.js";import{t as g}from"./arc-DgcGdgmL.js";import{t as _}from"./array-BifhSqXX.js";import{i as v,p as y}from"./chunk-75Z2AOVW-BHc4yRCt.js";import{t as b}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as x}from"./mermaid.core-CDUpMNay.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,t=S,n=null,r=m(0),i=m(h),a=m(0);function o(o){var s,c=(o=_(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),g=Math.min(h,Math.max(-h,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,a.apply(this,arguments)),b=y*(g<0?-1:1),x;for(s=0;s<c;++s)(x=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=x);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(g-c*b)/d:0;s<c;++s,m=v)l=f[s],x=p[l],v=m+(x>0?x*u:0)+b,p[l]={data:o[l],index:s,value:x,startAngle:m,endAngle:v,padAngle:y};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:m(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:m(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:m(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:m(+e),o):a},o}var T=c.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:t(()=>structuredClone(k),`getConfig`),clear:t(()=>{D=new Map,O=E.showData,o()},`clear`),setDiagramTitle:i,getDiagramTitle:u,setAccTitle:a,getAccTitle:f,setAccDescription:r,getAccDescription:l,addSection:t(({label:e,value:t})=>{if(t<0)throw Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,t),n.debug(`added new section: ${e}, with value: ${t}`))},`addSection`),getSections:t(()=>D,`getSections`),setShowData:t(e=>{O=e},`setShowData`),getShowData:t(()=>O,`getShowData`)},j=t((e,t)=>{b(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:t(async t=>{let r=await e(`pie`,t);n.debug(r),j(r,A)},`parse`)},N=t(e=>`
1
+ import{n as e}from"./mermaid-parser.core-Brqe55KM.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-oBChb5qS.js";import{H as r,K as i,U as a,a as o,c as s,f as c,v as l,w as u,x as d,y as f}from"./chunk-DU6HZSFF-D-pyRDMG.js";import{t as p}from"./ordinal-BDEzSJ7C.js";import{n as m}from"./path-fybaL0A-.js";import{m as h}from"./dist-B_J_HbC0.js";import{t as g}from"./arc-DgcGdgmL.js";import{t as _}from"./array-BifhSqXX.js";import{i as v,p as y}from"./chunk-75Z2AOVW-Dv4NtCmQ.js";import{t as b}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as x}from"./mermaid.core-Cdl6aiT5.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,t=S,n=null,r=m(0),i=m(h),a=m(0);function o(o){var s,c=(o=_(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),g=Math.min(h,Math.max(-h,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,a.apply(this,arguments)),b=y*(g<0?-1:1),x;for(s=0;s<c;++s)(x=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=x);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(g-c*b)/d:0;s<c;++s,m=v)l=f[s],x=p[l],v=m+(x>0?x*u:0)+b,p[l]={data:o[l],index:s,value:x,startAngle:m,endAngle:v,padAngle:y};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:m(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:m(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:m(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:m(+e),o):a},o}var T=c.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:t(()=>structuredClone(k),`getConfig`),clear:t(()=>{D=new Map,O=E.showData,o()},`clear`),setDiagramTitle:i,getDiagramTitle:u,setAccTitle:a,getAccTitle:f,setAccDescription:r,getAccDescription:l,addSection:t(({label:e,value:t})=>{if(t<0)throw Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,t),n.debug(`added new section: ${e}, with value: ${t}`))},`addSection`),getSections:t(()=>D,`getSections`),setShowData:t(e=>{O=e},`setShowData`),getShowData:t(()=>O,`getShowData`)},j=t((e,t)=>{b(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:t(async t=>{let r=await e(`pie`,t);n.debug(r),j(r,A)},`parse`)},N=t(e=>`
2
2
  .pieCircle{
3
3
  stroke: ${e.pieStrokeColor};
4
4
  stroke-width : ${e.pieStrokeWidth};
@@ -37,4 +37,4 @@ import{n as e}from"./mermaid-parser.core-Ch6yrkIv.js";import{n as t}from"./chunk
37
37
  }
38
38
  `,`getStyles`),P=t(e=>{let t=[...e.values()].reduce((e,t)=>e+t,0),n=[...e.entries()].map(([e,t])=>({label:e,value:t})).filter(e=>e.value/t*100>=1);return w().value(e=>e.value).sort(null)(n)},`createPieArcs`),F={parser:M,db:A,renderer:{draw:t((e,t,r,i)=>{n.debug(`rendering pie chart
39
39
  `+e);let a=i.db,o=d(),c=v(a.getConfig(),o.pie),l=x(t),u=l.append(`g`);u.attr(`transform`,`translate(225,225)`);let{themeVariables:f}=o,[m]=y(f.pieOuterStrokeWidth);m??=2;let h=c.legendPosition,_=c.textPosition,b=c.donutHole>0&&c.donutHole<=.9?c.donutHole:0,S=g().innerRadius(b*185).outerRadius(185),C=g().innerRadius(185*_).outerRadius(185*_),w=u.append(`g`);w.append(`circle`).attr(`cx`,0).attr(`cy`,0).attr(`r`,185+m/2).attr(`class`,`pieOuterCircle`);let T=a.getSections(),E=P(T),D=[f.pie1,f.pie2,f.pie3,f.pie4,f.pie5,f.pie6,f.pie7,f.pie8,f.pie9,f.pie10,f.pie11,f.pie12],O=0;T.forEach(e=>{O+=e});let k=E.filter(e=>(e.data.value/O*100).toFixed(0)!==`0`),A=p(D).domain([...T.keys()]);w.selectAll(`mySlices`).data(k).enter().append(`path`).attr(`d`,S).attr(`fill`,e=>A(e.data.label)).attr(`class`,e=>{let t=`pieCircle`;return c.highlightSlice===`hover`?t+=` highlightedOnHover`:c.highlightSlice===e.data.label&&(t+=` highlighted`),t}),w.selectAll(`mySlices`).data(k).enter().append(`text`).text(e=>(e.data.value/O*100).toFixed(0)+`%`).attr(`transform`,e=>`translate(`+C.centroid(e)+`)`).style(`text-anchor`,`middle`).attr(`class`,`slice`);let j=u.append(`text`).text(a.getDiagramTitle()).attr(`x`,0).attr(`y`,-200).attr(`class`,`pieTitleText`),M=[...T.entries()].map(([e,t])=>({label:e,value:t})),N=u.selectAll(`.legend`).data(M).enter().append(`g`).attr(`class`,`legend`);N.append(`rect`).attr(`width`,18).attr(`height`,18).style(`fill`,e=>A(e.label)).style(`stroke`,e=>A(e.label)),N.append(`text`).attr(`x`,22).attr(`y`,14).text(e=>a.getShowData()?`${e.label} [${e.value}]`:e.label);let F=Math.max(...N.selectAll(`text`).nodes().map(e=>e?.getBoundingClientRect().width??0)),I=450,L=490,R=M.length*22;switch(h){case`center`:N.attr(`transform`,(e,t)=>{let n=22*M.length/2,r=-F/2-22,i=t*22-n;return`translate(`+r+`,`+i+`)`});break;case`top`:I+=R,N.attr(`transform`,(e,t)=>`translate(${-F/2-22}, ${t*22-185})`),w.attr(`transform`,()=>`translate(0, ${R+22})`);break;case`bottom`:I+=R,N.attr(`transform`,(e,t)=>{let n=-F/2-22,r=t*22- -207;return`translate(`+n+`,`+r+`)`});break;case`left`:L+=22+F,N.attr(`transform`,(e,t)=>{let n=22*M.length/2;return`translate(-207,`+(t*22-n)+`)`}),w.attr(`transform`,()=>`translate(${F+18+4}, 0)`);break;default:L+=22+F,N.attr(`transform`,(e,t)=>{let n=22*M.length/2;return`translate(216,`+(t*22-n)+`)`})}let z=j.node()?.getBoundingClientRect().width??0,B=225-z/2,V=225+z/2,H=Math.min(0,B),U=Math.max(L,V)-H;l.attr(`viewBox`,`${H} 0 ${U} ${I}`),s(l,I,U,c.useMaxWidth)},`draw`)},styles:N};export{F as diagram};
40
- //# sourceMappingURL=pieDiagram-E7YTZNPT-DJxOVDr9.js.map
40
+ //# sourceMappingURL=pieDiagram-E7YTZNPT-CtVgATJF.js.map
@@ -1,4 +1,4 @@
1
- import{At as e}from"./utils-BgVDKR83.js";import{c as t}from"./runtime-B75ae48c.js";var n=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1
+ import{At as e}from"./utils-BAPnqm16.js";import{c as t}from"./runtime-B5cKWtKn.js";var n=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2
2
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
3
3
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
4
4
  </symbol>
@@ -231,4 +231,4 @@ import{At as e}from"./utils-BgVDKR83.js";import{c as t}from"./runtime-B75ae48c.j
231
231
  <path style="fill: light-dark(#84848a, #adadb1)" d="M.014 0h5.34v2.652H2.888v18.681h2.468V24H.015V0Zm17.622 5.049v2.78h-4.274v12.935h-3.008V7.83H6.059V5.05h11.577ZM23.986 24h-5.34v-2.652h2.467V2.667h-2.468V0h5.34v24Z" />
232
232
  </symbol>
233
233
  </svg>`,Z={set:`complete`,colored:!0,spriteSheet:X,byFileName:{"package.json":`file-tree-builtin-npm`,"tsconfig.json":`file-tree-builtin-typescript`,"agents.md":`t3-file-icon-agents`,"pnpm-lock.yaml":`t3-file-icon-pnpm`,"pnpm-workspace.yaml":`t3-file-icon-pnpm`},byFileExtension:{...Object.fromEntries(e.map(e=>[e,`t3-file-icon-video`])),cs:`t3-file-icon-csharp`,csx:`t3-file-icon-csharp`,dart:`t3-file-icon-dart`,diff:`t3-file-icon-diff`,patch:`t3-file-icon-diff`,ex:`t3-file-icon-elixir`,exs:`t3-file-icon-elixir`,hs:`t3-file-icon-haskell`,lhs:`t3-file-icon-haskell`,java:`t3-file-icon-java`,kt:`t3-file-icon-kotlin`,kts:`t3-file-icon-kotlin`,lua:`t3-file-icon-lua`,php:`t3-file-icon-php`,ps1:`t3-file-icon-powershell`,psm1:`t3-file-icon-powershell`,psd1:`t3-file-icon-powershell`,r:`t3-file-icon-r`,scala:`t3-file-icon-scala`,toml:`t3-file-icon-toml`,xml:`t3-file-icon-xml`}},Q=J(Z),De={bash:`sh`,csharp:`cs`,elixir:`ex`,haskell:`hs`,javascript:`js`,jsx:`jsx`,kotlin:`kt`,markdown:`md`,mdx:`mdx`,plaintext:`txt`,powershell:`ps1`,python:`py`,ruby:`rb`,rust:`rs`,shell:`sh`,shellscript:`sh`,swift:`swift`,typescript:`ts`,tsx:`tsx`,yaml:`yml`};function Oe(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}var ke={dockerfile:`Dockerfile`};function Ae(e){let t=e.toLowerCase();return ke[t]??`file.${De[t]??t}`}function $(e,n,r){if(n===`directory`)return null;let i=Q.resolveIcon(`file-tree-icon-file`,e);return i?.token==="default"&&r?Q.resolveIcon(`file-tree-icon-file`,t(e,r)):i}function je(e){return $(e,`file`)?.token!=="default"}function Me(){if(typeof document>`u`||document.getElementById(Y))return;let e=document.createElement(`div`);e.id=Y,e.setAttribute(`aria-hidden`,`true`),e.style.position=`absolute`,e.style.width=`0`,e.style.height=`0`,e.style.overflow=`hidden`,e.style.pointerEvents=`none`,e.innerHTML=`${G(`complete`)}${X}`,document.body.prepend(e)}export{$ as a,K as c,je as i,G as l,Oe as n,Ae as o,Me as r,J as s,Z as t,xe as u};
234
- //# sourceMappingURL=pierre-icons-Cp8tJJSF.js.map
234
+ //# sourceMappingURL=pierre-icons-fSsw9aa-.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ca as n,NE as r,Na as i,Ta as a,Ua as o,lE as s,t as c,vo as l}from"./utils-BgVDKR83.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v}from"./PopoverHandle-CgOyoBVs.js";var y=e(t()),b=y.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,{store:s}=p(),c=a(o.id);return s.useSyncedValueWithCleanup(`titleElementId`,c),l(`h2`,e,{ref:t,props:[{id:c},o]})}),x=y.forwardRef(function(e,t){let{render:r,className:a,style:s,disabled:c=!1,nativeButton:u=!0,...d}=e,{buttonRef:m,getButtonProps:h}=i({disabled:c,focusableWhenDisabled:!1,native:u}),{store:g}=p();return f(),l(`button`,e,{ref:[t,m],props:[{onClick(e){g.setOpen(!1,n(o,e.nativeEvent))}},d,h]})}),S=r(),C=e(s(),1),w=v,T=d;function E(e){let t=(0,S.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,C.jsx)(_,{className:r,"data-slot":`popover-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var D={auto:``,sm:`w-64`,md:`w-80`,lg:`w-96`},O={default:`py-4 [--viewport-inline-padding:--spacing(4)]`,compact:`py-2 [--viewport-inline-padding:--spacing(3)]`,none:`rounded-[calc(var(--radius-2xl)-1px)] py-0 [--viewport-inline-padding:0px]`};function k(e){let t=(0,S.c)(51),n,r,i,a,o,s,l,d,f,p,_,v,y,b,x;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],d=t[8],f=t[9],p=t[10],_=t[11],v=t[12],y=t[13],b=t[14],x=t[15]):({children:r,className:i,padding:s,scrollbar:d,variant:f,width:p,side:_,align:v,sideOffset:y,alignOffset:b,collisionAvoidance:a,tooltipStyle:x,keepMounted:l,anchor:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=d,t[9]=f,t[10]=p,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x);let w=s===void 0?`default`:s,T=d===void 0?`auto`:d,E=f===void 0?`default`:f,k=p===void 0?`auto`:p,A=_===void 0?`bottom`:_,j=v===void 0?`center`:v,M=y===void 0?4:y,N=b===void 0?0:b,P=x!==void 0&&x,F=l!==void 0&&l,I=F?`div`:m,L=E===`panel`?0:void 0,R=E===`panel`?`z-(--z-sheet) w-[min(calc(var(--thread-details-panel-width)+--spacing(4)),calc(var(--anchor-width)---spacing(2)))] transition-[top] duration-150 ease-out data-instant:transition-[top] motion-reduce:transition-none motion-reduce:data-instant:transition-none`:`z-[130]`,z;t[16]===R?z=t[17]:(z=c(`h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-transform data-instant:transition-none`,R),t[16]=R,t[17]=z);let B=E!==`panel`&&`dropdown-glass`,V=P&&`w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`,H=!P&&E!==`panel`&&`shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)]`,U;t[18]!==i||t[19]!==B||t[20]!==V||t[21]!==H||t[22]!==E||t[23]!==k?(U=c(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-2xl text-popover-foreground outline-none transition-[width,height,scale,opacity] motion-reduce:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,B,V,H,k!==`auto`&&[`max-w-[calc(100vw-2rem)]`,D[k]],E===`panel`&&`w-full overflow-visible rounded-none border-0 bg-transparent shadow-none before:hidden [backdrop-filter:none] [-webkit-backdrop-filter:none]`,i),t[18]=i,t[19]=B,t[20]=V,t[21]=H,t[22]=E,t[23]=k,t[24]=U):U=t[24];let W=P&&w==="default"?`py-1 [--viewport-inline-padding:--spacing(2)]`:O[w],G=!P&&`not-data-transitioning:overflow-y-auto`,K=T===`hidden`&&`[scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,q=E===`panel`&&`overflow-visible py-2 [--viewport-inline-padding:--spacing(2)]`,J;t[25]!==W||t[26]!==G||t[27]!==K||t[28]!==q?(J=c(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,W,G,K,q),t[25]=W,t[26]=G,t[27]=K,t[28]=q,t[29]=J):J=t[29];let Y;t[30]!==I||t[31]!==r||t[32]!==J?(Y=(0,C.jsx)(I,{className:J,"data-slot":`popover-viewport`,children:r}),t[30]=I,t[31]=r,t[32]=J,t[33]=Y):Y=t[33];let X;t[34]!==o||t[35]!==U||t[36]!==Y?(X=(0,C.jsx)(g,{className:U,"data-slot":`popover-popup`,...o,children:Y}),t[34]=o,t[35]=U,t[36]=Y,t[37]=X):X=t[37];let Z;t[38]!==j||t[39]!==N||t[40]!==n||t[41]!==a||t[42]!==A||t[43]!==M||t[44]!==L||t[45]!==z||t[46]!==X?(Z=(0,C.jsx)(u,{align:j,alignOffset:N,anchor:n,collisionAvoidance:a,collisionPadding:L,className:z,"data-slot":`popover-positioner`,side:A,sideOffset:M,children:X}),t[38]=j,t[39]=N,t[40]=n,t[41]=a,t[42]=A,t[43]=M,t[44]=L,t[45]=z,t[46]=X,t[47]=Z):Z=t[47];let Q;return t[48]!==F||t[49]!==Z?(Q=(0,C.jsx)(h,{keepMounted:F,children:Z}),t[48]=F,t[49]=Z,t[50]=Q):Q=t[50],Q}function A(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(x,{"data-slot":`popover-close`,...n}),t[2]=n,t[3]=r),r}function j(e){let t=(0,S.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`font-semibold text-sm leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(b,{className:i,"data-slot":`popover-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{j as a,k as i,A as n,E as o,w as r,T as t};
2
- //# sourceMappingURL=popover-B70_-gBS.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ca as n,NE as r,Na as i,Ta as a,Ua as o,lE as s,t as c,vo as l}from"./utils-BAPnqm16.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v}from"./PopoverHandle-C-e81PS3.js";var y=e(t()),b=y.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,{store:s}=p(),c=a(o.id);return s.useSyncedValueWithCleanup(`titleElementId`,c),l(`h2`,e,{ref:t,props:[{id:c},o]})}),x=y.forwardRef(function(e,t){let{render:r,className:a,style:s,disabled:c=!1,nativeButton:u=!0,...d}=e,{buttonRef:m,getButtonProps:h}=i({disabled:c,focusableWhenDisabled:!1,native:u}),{store:g}=p();return f(),l(`button`,e,{ref:[t,m],props:[{onClick(e){g.setOpen(!1,n(o,e.nativeEvent))}},d,h]})}),S=r(),C=e(s(),1),w=v,T=d;function E(e){let t=(0,S.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,C.jsx)(_,{className:r,"data-slot":`popover-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var D={auto:``,sm:`w-64`,md:`w-80`,lg:`w-96`},O={default:`py-4 [--viewport-inline-padding:--spacing(4)]`,compact:`py-2 [--viewport-inline-padding:--spacing(3)]`,none:`rounded-[calc(var(--radius-2xl)-1px)] py-0 [--viewport-inline-padding:0px]`};function k(e){let t=(0,S.c)(51),n,r,i,a,o,s,l,d,f,p,_,v,y,b,x;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],d=t[8],f=t[9],p=t[10],_=t[11],v=t[12],y=t[13],b=t[14],x=t[15]):({children:r,className:i,padding:s,scrollbar:d,variant:f,width:p,side:_,align:v,sideOffset:y,alignOffset:b,collisionAvoidance:a,tooltipStyle:x,keepMounted:l,anchor:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=d,t[9]=f,t[10]=p,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x);let w=s===void 0?`default`:s,T=d===void 0?`auto`:d,E=f===void 0?`default`:f,k=p===void 0?`auto`:p,A=_===void 0?`bottom`:_,j=v===void 0?`center`:v,M=y===void 0?4:y,N=b===void 0?0:b,P=x!==void 0&&x,F=l!==void 0&&l,I=F?`div`:m,L=E===`panel`?0:void 0,R=E===`panel`?`z-(--z-sheet) w-[min(calc(var(--thread-details-panel-width)+--spacing(4)),calc(var(--anchor-width)---spacing(2)))] transition-[top] duration-150 ease-out data-instant:transition-[top] motion-reduce:transition-none motion-reduce:data-instant:transition-none`:`z-[130]`,z;t[16]===R?z=t[17]:(z=c(`h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-transform data-instant:transition-none`,R),t[16]=R,t[17]=z);let B=E!==`panel`&&`dropdown-glass`,V=P&&`w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`,H=!P&&E!==`panel`&&`shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)]`,U;t[18]!==i||t[19]!==B||t[20]!==V||t[21]!==H||t[22]!==E||t[23]!==k?(U=c(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-2xl text-popover-foreground outline-none transition-[width,height,scale,opacity] motion-reduce:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,B,V,H,k!==`auto`&&[`max-w-[calc(100vw-2rem)]`,D[k]],E===`panel`&&`w-full overflow-visible rounded-none border-0 bg-transparent shadow-none before:hidden [backdrop-filter:none] [-webkit-backdrop-filter:none]`,i),t[18]=i,t[19]=B,t[20]=V,t[21]=H,t[22]=E,t[23]=k,t[24]=U):U=t[24];let W=P&&w==="default"?`py-1 [--viewport-inline-padding:--spacing(2)]`:O[w],G=!P&&`not-data-transitioning:overflow-y-auto`,K=T===`hidden`&&`[scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,q=E===`panel`&&`overflow-visible py-2 [--viewport-inline-padding:--spacing(2)]`,J;t[25]!==W||t[26]!==G||t[27]!==K||t[28]!==q?(J=c(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,W,G,K,q),t[25]=W,t[26]=G,t[27]=K,t[28]=q,t[29]=J):J=t[29];let Y;t[30]!==I||t[31]!==r||t[32]!==J?(Y=(0,C.jsx)(I,{className:J,"data-slot":`popover-viewport`,children:r}),t[30]=I,t[31]=r,t[32]=J,t[33]=Y):Y=t[33];let X;t[34]!==o||t[35]!==U||t[36]!==Y?(X=(0,C.jsx)(g,{className:U,"data-slot":`popover-popup`,...o,children:Y}),t[34]=o,t[35]=U,t[36]=Y,t[37]=X):X=t[37];let Z;t[38]!==j||t[39]!==N||t[40]!==n||t[41]!==a||t[42]!==A||t[43]!==M||t[44]!==L||t[45]!==z||t[46]!==X?(Z=(0,C.jsx)(u,{align:j,alignOffset:N,anchor:n,collisionAvoidance:a,collisionPadding:L,className:z,"data-slot":`popover-positioner`,side:A,sideOffset:M,children:X}),t[38]=j,t[39]=N,t[40]=n,t[41]=a,t[42]=A,t[43]=M,t[44]=L,t[45]=z,t[46]=X,t[47]=Z):Z=t[47];let Q;return t[48]!==F||t[49]!==Z?(Q=(0,C.jsx)(h,{keepMounted:F,children:Z}),t[48]=F,t[49]=Z,t[50]=Q):Q=t[50],Q}function A(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(x,{"data-slot":`popover-close`,...n}),t[2]=n,t[3]=r),r}function j(e){let t=(0,S.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`font-semibold text-sm leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(b,{className:i,"data-slot":`popover-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{j as a,k as i,A as n,E as o,w as r,T as t};
2
+ //# sourceMappingURL=popover-B1MF5i1c.js.map
@@ -1,2 +1,2 @@
1
- import{Lc as e}from"./utils-BgVDKR83.js";import{M as t,N as n,P as r,k as i}from"./runtime-B7jXrsPs.js";import{t as a}from"./runtime-B75ae48c.js";function o(a){let o=i(),s=i(),c={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId])};return{list:n(a,{label:`environment-data:preview:list`,tag:e.previewList,staleTimeMs:5e3}),events:r(a,{label:`environment-data:preview:events`,tag:e.subscribePreviewEvents}),discoveredServers:r(a,{label:`environment-data:preview:discovered-servers`,tag:e.subscribeDiscoveredLocalServers,idleTtlMs:0}),open:t(a,{label:`environment-data:preview:open`,tag:e.previewOpen,scheduler:o,concurrency:c}),navigate:t(a,{label:`environment-data:preview:navigate`,tag:e.previewNavigate,scheduler:o,concurrency:c}),resize:t(a,{label:`environment-data:preview:resize`,tag:e.previewResize,scheduler:o,concurrency:c}),adjust:t(a,{label:`environment-data:preview:adjust`,tag:e.previewAdjust,scheduler:o,concurrency:c}),refresh:t(a,{label:`environment-data:preview:refresh`,tag:e.previewRefresh,scheduler:o,concurrency:c}),close:t(a,{label:`environment-data:preview:close`,tag:e.previewClose,scheduler:o,concurrency:c}),clearProfile:t(a,{label:`environment-data:preview:clear-profile`,tag:e.previewClearProfile}),reportProfiles:t(a,{label:`environment-data:preview:report-profiles`,tag:e.previewReportProfiles,concurrency:{mode:`latest`,key:({environmentId:e})=>e}}),reportStatus:t(a,{label:`environment-data:preview:report-status`,tag:e.previewReportStatus,scheduler:s,concurrency:{mode:`latest`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId,t.tabId])}})}}var s=o(a);export{s as t};
2
- //# sourceMappingURL=preview-BHYM-_BL.js.map
1
+ import{Lc as e}from"./utils-BAPnqm16.js";import{M as t,N as n,P as r,k as i}from"./runtime-B9IDNXDU.js";import{t as a}from"./runtime-B5cKWtKn.js";function o(a){let o=i(),s=i(),c={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId])};return{list:n(a,{label:`environment-data:preview:list`,tag:e.previewList,staleTimeMs:5e3}),events:r(a,{label:`environment-data:preview:events`,tag:e.subscribePreviewEvents}),discoveredServers:r(a,{label:`environment-data:preview:discovered-servers`,tag:e.subscribeDiscoveredLocalServers,idleTtlMs:0}),open:t(a,{label:`environment-data:preview:open`,tag:e.previewOpen,scheduler:o,concurrency:c}),navigate:t(a,{label:`environment-data:preview:navigate`,tag:e.previewNavigate,scheduler:o,concurrency:c}),resize:t(a,{label:`environment-data:preview:resize`,tag:e.previewResize,scheduler:o,concurrency:c}),adjust:t(a,{label:`environment-data:preview:adjust`,tag:e.previewAdjust,scheduler:o,concurrency:c}),refresh:t(a,{label:`environment-data:preview:refresh`,tag:e.previewRefresh,scheduler:o,concurrency:c}),close:t(a,{label:`environment-data:preview:close`,tag:e.previewClose,scheduler:o,concurrency:c}),clearProfile:t(a,{label:`environment-data:preview:clear-profile`,tag:e.previewClearProfile}),reportProfiles:t(a,{label:`environment-data:preview:report-profiles`,tag:e.previewReportProfiles,concurrency:{mode:`latest`,key:({environmentId:e})=>e}}),reportStatus:t(a,{label:`environment-data:preview:report-status`,tag:e.previewReportStatus,scheduler:s,concurrency:{mode:`latest`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId,t.tabId])}})}}var s=o(a);export{s as t};
2
+ //# sourceMappingURL=preview-DwLWkMZG.js.map
@@ -1,2 +1,2 @@
1
- import{By as e,Cy as t,Iy as n,Ny as r,Oy as i,db as a,ib as o}from"./utils-BgVDKR83.js";var s=new Set([`localhost`,`127.0.0.1`,`0.0.0.0`,`::1`]);[...s];var c=/^(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1?\])(?::|\/|$)/i;function l(e){return!!(s.has(e)||e===`[::1]`)}var u=class extends e()(`PreviewUrlNormalizationError`,{inputLength:r,reason:i([`empty`,`parse`,`unsupported-protocol`]),protocol:a(n),cause:a(t())}){get message(){let e=this.protocol===void 0?``:`: ${this.protocol}`;return`Invalid preview URL (${this.reason}${e}; input length ${this.inputLength}).`}};o(u);function d(e){return/^([A-Za-z][A-Za-z\d+.-]*):/.exec(e)?.[1]?.toLowerCase().concat(`:`)}var f=`https://duckduckgo.com/?q=`,p=/^(?:localhost|\d{1,3}(?:\.\d{1,3}){3}|\[[\da-f:.]+\])$/i,m=/^[^/?#:@]+:\d+(?:[/?#]|$)/,h=new Set([`about:`,`blob:`,`chrome:`,`data:`,`file:`,`ftp:`,`javascript:`,`mailto:`,`sms:`,`ssh:`,`tel:`,`view-source:`,`ws:`,`wss:`]);function g(e){let t=e.trim();if(/^[a-z][a-z\d+.-]*:\/\//i.test(t)||t.length===0)return _(t);if(!/\s/.test(t)){let n=d(t);if(n!==void 0&&(h.has(n)||!m.test(t))){if(n!==`http:`&&n!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:n});return _(t)}let r=t.split(/[/?#]/,1)[0]??``,i=r.replace(/^[^@]*@/,``).replace(/:\d+$/,``);if(i.length<r.replace(/^[^@]*@/,``).length||p.test(i)||/^[^.]+(?:\.[^.]+)+\.?$/.test(i))try{return _(t)}catch{}}return`${f}${encodeURIComponent(t)}`}function _(e){let t=e.trim();if(t.length===0)throw new u({inputLength:e.length,reason:`empty`});let n=c.test(t),r=t.includes(`://`)?t:`${n?`http`:`https`}://${t}`,i;try{i=new URL(r)}catch(t){throw new u({inputLength:e.length,reason:`parse`,protocol:d(r),cause:t})}if(i.protocol!==`http:`&&i.protocol!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:i.protocol});return i.href}export{_ as n,g as r,l as t};
2
- //# sourceMappingURL=preview-Dj_ac_jZ.js.map
1
+ import{By as e,Cy as t,Iy as n,Ny as r,Oy as i,db as a,ib as o}from"./utils-BAPnqm16.js";var s=new Set([`localhost`,`127.0.0.1`,`0.0.0.0`,`::1`]);[...s];var c=/^(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1?\])(?::|\/|$)/i;function l(e){return!!(s.has(e)||e===`[::1]`)}var u=class extends e()(`PreviewUrlNormalizationError`,{inputLength:r,reason:i([`empty`,`parse`,`unsupported-protocol`]),protocol:a(n),cause:a(t())}){get message(){let e=this.protocol===void 0?``:`: ${this.protocol}`;return`Invalid preview URL (${this.reason}${e}; input length ${this.inputLength}).`}};o(u);function d(e){return/^([A-Za-z][A-Za-z\d+.-]*):/.exec(e)?.[1]?.toLowerCase().concat(`:`)}var f=`https://duckduckgo.com/?q=`,p=/^(?:localhost|\d{1,3}(?:\.\d{1,3}){3}|\[[\da-f:.]+\])$/i,m=/^[^/?#:@]+:\d+(?:[/?#]|$)/,h=new Set([`about:`,`blob:`,`chrome:`,`data:`,`file:`,`ftp:`,`javascript:`,`mailto:`,`sms:`,`ssh:`,`tel:`,`view-source:`,`ws:`,`wss:`]);function g(e){let t=e.trim();if(/^[a-z][a-z\d+.-]*:\/\//i.test(t)||t.length===0)return _(t);if(!/\s/.test(t)){let n=d(t);if(n!==void 0&&(h.has(n)||!m.test(t))){if(n!==`http:`&&n!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:n});return _(t)}let r=t.split(/[/?#]/,1)[0]??``,i=r.replace(/^[^@]*@/,``).replace(/:\d+$/,``);if(i.length<r.replace(/^[^@]*@/,``).length||p.test(i)||/^[^.]+(?:\.[^.]+)+\.?$/.test(i))try{return _(t)}catch{}}return`${f}${encodeURIComponent(t)}`}function _(e){let t=e.trim();if(t.length===0)throw new u({inputLength:e.length,reason:`empty`});let n=c.test(t),r=t.includes(`://`)?t:`${n?`http`:`https`}://${t}`,i;try{i=new URL(r)}catch(t){throw new u({inputLength:e.length,reason:`parse`,protocol:d(r),cause:t})}if(i.protocol!==`http:`&&i.protocol!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:i.protocol});return i.href}export{_ as n,g as r,l as t};
2
+ //# sourceMappingURL=preview-ITad1JAy.js.map
@@ -1,2 +1,2 @@
1
- import{Js as e,W as t}from"./utils-BgVDKR83.js";var n=(e,t)=>{let n=Object.entries(t.query);return n.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams(n).toString()}`};function r(e){return e.kind===`browser`?`browser:${e.tabId}`:`device:${encodeURIComponent(e.hostId)}:${encodeURIComponent(e.deviceId)}`}var i=e=>({kind:`browser`,tabId:e}),a=t()(t=>({byThreadKey:{},open:(n,i)=>t(t=>{let a=e(n),o=t.byThreadKey[a];return o&&r(o.source)===r(i)?t:{byThreadKey:{...t.byThreadKey,[a]:{source:i,position:o?.position??null,width:o?.width??null,lastInteraction:o?.lastInteraction??`drag`}}}}),close:n=>t(t=>{let r=e(n);if(!(r in t.byThreadKey))return t;let{[r]:i,...a}=t.byThreadKey;return{byThreadKey:a}}),move:(n,i,a)=>t(t=>{let o=e(n),s=t.byThreadKey[o];return!s||r(s.source)!==i||s.position?.x===a.x&&s.position.y===a.y&&s.lastInteraction===`drag`?t:{byThreadKey:{...t.byThreadKey,[o]:{...s,position:a,lastInteraction:`drag`}}}}),resize:(n,i,a,o)=>t(t=>{let s=e(n),c=t.byThreadKey[s];return!c||r(c.source)!==i||c.width===a&&c.lastInteraction===`resize`&&(!o||c.position?.x===o.x&&c.position.y===o.y)?t:{byThreadKey:{...t.byThreadKey,[s]:{...c,width:a,position:o??c.position,lastInteraction:`resize`}}}}),removeThread:n=>t(t=>{let r=e(n);if(!(r in t.byThreadKey))return t;let{[r]:i,...a}=t.byThreadKey;return{byThreadKey:a}})}));function o(t,n){return n?t[e(n)]??null:null}export{n as a,a as i,r as n,o as r,i as t};
2
- //# sourceMappingURL=previewMiniPlayerStore-DX9IKNL3.js.map
1
+ import{Js as e,W as t}from"./utils-BAPnqm16.js";var n=(e,t)=>{let n=Object.entries(t.query);return n.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams(n).toString()}`};function r(e){return e.kind===`browser`?`browser:${e.tabId}`:`device:${encodeURIComponent(e.hostId)}:${encodeURIComponent(e.deviceId)}`}var i=e=>({kind:`browser`,tabId:e}),a=t()(t=>({byThreadKey:{},open:(n,i)=>t(t=>{let a=e(n),o=t.byThreadKey[a];return o&&r(o.source)===r(i)?t:{byThreadKey:{...t.byThreadKey,[a]:{source:i,position:o?.position??null,width:o?.width??null,lastInteraction:o?.lastInteraction??`drag`}}}}),close:n=>t(t=>{let r=e(n);if(!(r in t.byThreadKey))return t;let{[r]:i,...a}=t.byThreadKey;return{byThreadKey:a}}),move:(n,i,a)=>t(t=>{let o=e(n),s=t.byThreadKey[o];return!s||r(s.source)!==i||s.position?.x===a.x&&s.position.y===a.y&&s.lastInteraction===`drag`?t:{byThreadKey:{...t.byThreadKey,[o]:{...s,position:a,lastInteraction:`drag`}}}}),resize:(n,i,a,o)=>t(t=>{let s=e(n),c=t.byThreadKey[s];return!c||r(c.source)!==i||c.width===a&&c.lastInteraction===`resize`&&(!o||c.position?.x===o.x&&c.position.y===o.y)?t:{byThreadKey:{...t.byThreadKey,[s]:{...c,width:a,position:o??c.position,lastInteraction:`resize`}}}}),removeThread:n=>t(t=>{let r=e(n);if(!(r in t.byThreadKey))return t;let{[r]:i,...a}=t.byThreadKey;return{byThreadKey:a}})}));function o(t,n){return n?t[e(n)]??null:null}export{n as a,a as i,r as n,o as r,i as t};
2
+ //# sourceMappingURL=previewMiniPlayerStore-DN-AYBed.js.map
@@ -1,2 +1,2 @@
1
- import{$o as e,Aw as t,By as n,Cy as r,Go as i,Iy as a,NE as o,NT as s,Nl as c,Ny as l,Ol as u,Ox as d,Oy as ee,Ss as f,VS as p,Yo as m,ag as h,db as g,fS as _,ib as v,is as y,rs as b,ss as x,zS as S}from"./utils-BgVDKR83.js";import{b as C,n as w,w as T}from"./runtime-B7jXrsPs.js";import{Dt as E,Tt as D}from"./runtime-B75ae48c.js";var te=ee([`fetch-session-state`,`exchange-bootstrap-credential`,`fetch-environment-descriptor`,`create-pairing-credential`,`list-pairing-links`,`revoke-pairing-link`,`list-client-sessions`,`revoke-client-session`,`revoke-other-client-sessions`]),O=class e extends n()(`PrimaryEnvironmentRequestError`,{operation:te,status:l,pairingLinkId:g(a),sessionId:g(a),cause:r()}){static fromCause(t){let n=ne(t.cause)??500;return new e({operation:t.operation,status:n,...t.pairingLinkId===void 0?{}:{pairingLinkId:t.pairingLinkId},...t.sessionId===void 0?{}:{sessionId:t.sessionId},cause:t.cause})}get message(){return`Primary environment request failed during ${this.operation} (HTTP ${this.status}).`}},k=v(O),A=class extends n()(`PrimaryEnvironmentPairingCredentialRejectedError`,{providedLength:l,cause:r()}){get message(){return`Invalid pairing token. Check the token and try again.`}};v(A);var j=class extends n()(`PrimaryEnvironmentAuthSessionTimeoutError`,{timeoutMs:l,elapsedMs:l}){get message(){return`Timed out waiting for authenticated session after bootstrap.`}},M=class extends n()(`PrimaryEnvironmentPairingCredentialRequiredError`,{providedLength:l}){get message(){return`Enter a pairing token to continue.`}},N=v(c),P=null,F=null,I=!1,L=2e3,R=100;function z(){return D(new URL(window.location.href))}function B(){let e=new URL(window.location.href),t=E(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}function V(){let e=z();return e?(B(),e):null}function H(){let e=(window.desktopBridge?.getLocalEnvironmentBootstraps()??[]).find(e=>e.id===u);return typeof e?.bootstrapToken==`string`&&e.bootstrapToken.length>0?e.bootstrapToken:null}async function U(){return X(async()=>{try{return await w(C.pipe(d(e=>e.auth.session({headers:{}}))))}catch(e){throw O.fromCause({operation:`fetch-session-state`,cause:e})}})}function ne(e){return N(e)?W(e):h(e)&&e.response!==void 0?e.response.status:null}function W(e){switch(e._tag){case`EnvironmentRequestInvalidError`:return 400;case`EnvironmentAuthInvalidError`:return 401;case`EnvironmentScopeRequiredError`:case`EnvironmentOperationForbiddenError`:return 403;case`EnvironmentResourceNotFoundError`:return 404;case`EnvironmentInternalError`:return 500}}async function G(e){return X(async()=>{try{return await w(C.pipe(d(t=>t.auth.browserSession({payload:{credential:e}}))))}catch(t){throw N(t)&&t._tag===`EnvironmentAuthInvalidError`&&t.reason===`invalid_credential`?new A({providedLength:e.length,cause:t}):O.fromCause({operation:`exchange-bootstrap-credential`,cause:t})}})}async function K(){let e=Date.now();for(;;){let t=await U();if(t.authenticated)return t;let n=Date.now()-e;if(n>=L)throw new j({timeoutMs:L,elapsedMs:n});await Z(R)}}var q=new Set([502,503,504]),J=15e3,Y=500;async function X(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(!re(e)||Date.now()-t>=J)throw e;await Z(Y)}}function Z(e){return new Promise(t=>{setTimeout(t,e)})}function re(e){return k(e)?q.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}async function Q(e){let t=await U();if(t.authenticated&&!e)return{status:`authenticated`};let n=e??H();if(!n)return{status:`requires-auth`,auth:t.auth};try{return await G(n),await K(),{status:`authenticated`}}catch(e){return{status:`requires-auth`,auth:t.auth,errorMessage:e instanceof Error?e.message:`Authentication failed.`}}}async function ie(e){let t=e.trim();if(!t)throw new M({providedLength:e.length});F=null,await G(t),await K(),F={status:`authenticated`},P=null,I=!1,B()}async function ae(e){let t=e?.label?.trim();try{return await w(C.pipe(d(n=>n.auth.pairingCredential({headers:{},payload:{...t?{label:t}:{},...e?.scopes?{scopes:e.scopes}:{}}}))))}catch(e){throw O.fromCause({operation:`create-pairing-credential`,cause:e})}}async function oe(e){try{await w(C.pipe(d(t=>t.auth.revokePairingLink({headers:{},payload:{id:e}}))))}catch(t){throw O.fromCause({operation:`revoke-pairing-link`,pairingLinkId:e,cause:t})}}async function se(e){try{await w(C.pipe(d(t=>t.auth.revokeClient({headers:{},payload:{sessionId:e}}))))}catch(t){throw O.fromCause({operation:`revoke-client-session`,sessionId:e,cause:t})}}async function ce(){try{return(await w(C.pipe(d(e=>e.auth.revokeOtherClients({headers:{}}))))).revokedCount}catch(e){throw O.fromCause({operation:`revoke-other-client-sessions`,cause:e})}}async function le(){if(window.location.pathname.replace(/\/+$/,``)===`/pair`?z()&&(I=!0):I=!1,I)return{status:`requires-auth`,auth:(await U()).auth};let e=V(),t=P;if(e)F=null;else{if(t)return t;if(F?.status===`authenticated`)return F}let n=t?t.catch(()=>void 0).then(()=>(F=null,Q(e))):Q(e);return P=n,n.then(e=>(P===n&&e.status===`authenticated`&&(F=e),e)).finally(()=>{P===n&&(P=null)})}var ue=o(),$=e(p(()=>T()?S(null):_(U))).pipe(y({staleTime:5e3,revalidateOnMount:!0}),b(3e5),x(`primary-environment:session`));function de(){i.refresh($)}function fe(){let e=(0,ue.c)(8),n=m($),r=pe,i=null;if(n._tag===`Failure`){let r;e[0]===n.cause?r=e[1]:(r=t(n.cause),e[0]=n.cause,e[1]=r);let a=r;i=a instanceof Error?a.message:`Could not read environment session.`}let a;e[2]===n?a=e[3]:(a=s(f(n)),e[2]=n,e[3]=a);let o;return e[4]!==i||e[5]!==n.waiting||e[6]!==a?(o={data:a,error:i,isPending:n.waiting,refresh:r},e[4]=i,e[5]=n.waiting,e[6]=a,e[7]=o):o=e[7],o}function pe(){de()}export{ce as a,B as c,le as i,ie as l,ae as n,se as o,z as r,oe as s,fe as t};
2
- //# sourceMappingURL=primary-DHlSwiw_.js.map
1
+ import{$o as e,Aw as t,By as n,Cy as r,Go as i,Iy as a,NE as o,NT as s,Nl as c,Ny as l,Ol as u,Ox as d,Oy as ee,Ss as f,VS as p,Yo as m,ag as h,db as g,fS as _,ib as v,is as y,rs as b,ss as x,zS as S}from"./utils-BAPnqm16.js";import{b as C,n as w,w as T}from"./runtime-B9IDNXDU.js";import{Dt as E,Tt as D}from"./runtime-B5cKWtKn.js";var te=ee([`fetch-session-state`,`exchange-bootstrap-credential`,`fetch-environment-descriptor`,`create-pairing-credential`,`list-pairing-links`,`revoke-pairing-link`,`list-client-sessions`,`revoke-client-session`,`revoke-other-client-sessions`]),O=class e extends n()(`PrimaryEnvironmentRequestError`,{operation:te,status:l,pairingLinkId:g(a),sessionId:g(a),cause:r()}){static fromCause(t){let n=ne(t.cause)??500;return new e({operation:t.operation,status:n,...t.pairingLinkId===void 0?{}:{pairingLinkId:t.pairingLinkId},...t.sessionId===void 0?{}:{sessionId:t.sessionId},cause:t.cause})}get message(){return`Primary environment request failed during ${this.operation} (HTTP ${this.status}).`}},k=v(O),A=class extends n()(`PrimaryEnvironmentPairingCredentialRejectedError`,{providedLength:l,cause:r()}){get message(){return`Invalid pairing token. Check the token and try again.`}};v(A);var j=class extends n()(`PrimaryEnvironmentAuthSessionTimeoutError`,{timeoutMs:l,elapsedMs:l}){get message(){return`Timed out waiting for authenticated session after bootstrap.`}},M=class extends n()(`PrimaryEnvironmentPairingCredentialRequiredError`,{providedLength:l}){get message(){return`Enter a pairing token to continue.`}},N=v(c),P=null,F=null,I=!1,L=2e3,R=100;function z(){return D(new URL(window.location.href))}function B(){let e=new URL(window.location.href),t=E(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}function V(){let e=z();return e?(B(),e):null}function H(){let e=(window.desktopBridge?.getLocalEnvironmentBootstraps()??[]).find(e=>e.id===u);return typeof e?.bootstrapToken==`string`&&e.bootstrapToken.length>0?e.bootstrapToken:null}async function U(){return X(async()=>{try{return await w(C.pipe(d(e=>e.auth.session({headers:{}}))))}catch(e){throw O.fromCause({operation:`fetch-session-state`,cause:e})}})}function ne(e){return N(e)?W(e):h(e)&&e.response!==void 0?e.response.status:null}function W(e){switch(e._tag){case`EnvironmentRequestInvalidError`:return 400;case`EnvironmentAuthInvalidError`:return 401;case`EnvironmentScopeRequiredError`:case`EnvironmentOperationForbiddenError`:return 403;case`EnvironmentResourceNotFoundError`:return 404;case`EnvironmentInternalError`:return 500}}async function G(e){return X(async()=>{try{return await w(C.pipe(d(t=>t.auth.browserSession({payload:{credential:e}}))))}catch(t){throw N(t)&&t._tag===`EnvironmentAuthInvalidError`&&t.reason===`invalid_credential`?new A({providedLength:e.length,cause:t}):O.fromCause({operation:`exchange-bootstrap-credential`,cause:t})}})}async function K(){let e=Date.now();for(;;){let t=await U();if(t.authenticated)return t;let n=Date.now()-e;if(n>=L)throw new j({timeoutMs:L,elapsedMs:n});await Z(R)}}var q=new Set([502,503,504]),J=15e3,Y=500;async function X(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(!re(e)||Date.now()-t>=J)throw e;await Z(Y)}}function Z(e){return new Promise(t=>{setTimeout(t,e)})}function re(e){return k(e)?q.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}async function Q(e){let t=await U();if(t.authenticated&&!e)return{status:`authenticated`};let n=e??H();if(!n)return{status:`requires-auth`,auth:t.auth};try{return await G(n),await K(),{status:`authenticated`}}catch(e){return{status:`requires-auth`,auth:t.auth,errorMessage:e instanceof Error?e.message:`Authentication failed.`}}}async function ie(e){let t=e.trim();if(!t)throw new M({providedLength:e.length});F=null,await G(t),await K(),F={status:`authenticated`},P=null,I=!1,B()}async function ae(e){let t=e?.label?.trim();try{return await w(C.pipe(d(n=>n.auth.pairingCredential({headers:{},payload:{...t?{label:t}:{},...e?.scopes?{scopes:e.scopes}:{}}}))))}catch(e){throw O.fromCause({operation:`create-pairing-credential`,cause:e})}}async function oe(e){try{await w(C.pipe(d(t=>t.auth.revokePairingLink({headers:{},payload:{id:e}}))))}catch(t){throw O.fromCause({operation:`revoke-pairing-link`,pairingLinkId:e,cause:t})}}async function se(e){try{await w(C.pipe(d(t=>t.auth.revokeClient({headers:{},payload:{sessionId:e}}))))}catch(t){throw O.fromCause({operation:`revoke-client-session`,sessionId:e,cause:t})}}async function ce(){try{return(await w(C.pipe(d(e=>e.auth.revokeOtherClients({headers:{}}))))).revokedCount}catch(e){throw O.fromCause({operation:`revoke-other-client-sessions`,cause:e})}}async function le(){if(window.location.pathname.replace(/\/+$/,``)===`/pair`?z()&&(I=!0):I=!1,I)return{status:`requires-auth`,auth:(await U()).auth};let e=V(),t=P;if(e)F=null;else{if(t)return t;if(F?.status===`authenticated`)return F}let n=t?t.catch(()=>void 0).then(()=>(F=null,Q(e))):Q(e);return P=n,n.then(e=>(P===n&&e.status===`authenticated`&&(F=e),e)).finally(()=>{P===n&&(P=null)})}var ue=o(),$=e(p(()=>T()?S(null):_(U))).pipe(y({staleTime:5e3,revalidateOnMount:!0}),b(3e5),x(`primary-environment:session`));function de(){i.refresh($)}function fe(){let e=(0,ue.c)(8),n=m($),r=pe,i=null;if(n._tag===`Failure`){let r;e[0]===n.cause?r=e[1]:(r=t(n.cause),e[0]=n.cause,e[1]=r);let a=r;i=a instanceof Error?a.message:`Could not read environment session.`}let a;e[2]===n?a=e[3]:(a=s(f(n)),e[2]=n,e[3]=a);let o;return e[4]!==i||e[5]!==n.waiting||e[6]!==a?(o={data:a,error:i,isPending:n.waiting,refresh:r},e[4]=i,e[5]=n.waiting,e[6]=a,e[7]=o):o=e[7],o}function pe(){de()}export{ce as a,B as c,le as i,ie as l,ae as n,se as o,z as r,oe as s,fe as t};
2
+ //# sourceMappingURL=primary-8A8hvHFL.js.map
@@ -1,2 +1,2 @@
1
- import{$o as e,$x as t,Aw as n,By as r,DC as i,Ev as a,Fl as o,Go as s,HS as c,IT as l,Il as u,Iy as d,Lc as f,Ll as ee,Ml as te,NE as ne,NT as p,Oy as m,Pl as h,Qo as g,Ss as _,Vw as re,Vx as v,Wy as ie,YS as ae,Yo as oe,Zo as se,Zx as ce,_u as y,bv as le,db as ue,ec as b,ib as de,is as fe,jl as pe,kl as me,ns as he,oT as ge,pS as x,px as S,rs as C,ss as w,tC as T,tS as E,uy as D,x_ as O,xs as k,xx as A}from"./utils-BgVDKR83.js";import{$ as j,Nn as M,Z as N,dt as P,mn as F,o as I,r as L,s as _e,v as R}from"./runtime-B7jXrsPs.js";import"./runtime-B75ae48c.js";import{o as ve}from"./environments-CXLCfPlP.js";import{i as ye,n as z}from"./session-eKfJi_Kx.js";var be=ne(),xe=class extends r()(`RelayClientInstallConfirmationConflictError`,{requestedVersion:d,activeVersion:d,activeDialogStatus:m([`confirming`,`installing`,`closing`]),activeInstallStage:ue(me)}){get message(){return`Cannot confirm relay client installation ${this.requestedVersion}; installation ${this.activeVersion} has dialog status ${this.activeDialogStatus}.`}},B={status:`idle`},V=B,H=null,U=new Set;function W(e){V=e;for(let e of U)e()}function Se(){return V}function Ce(e){return U.add(e),()=>{U.delete(e)}}function we(e){if(V.status!==`idle`){let t=V.status===`closing`?V.view:V;return Promise.reject(new xe({requestedVersion:e,activeVersion:t.version,activeDialogStatus:V.status,...t.status===`installing`?{activeInstallStage:t.stage}:{}}))}return W({status:`confirming`,version:e}),new Promise(e=>{H=e})}function Te(e){if(V.status!==`confirming`||!H)return;let t=H;H=null,W(e?{status:`installing`,version:V.version,stage:`checking`}:{status:`closing`,view:V}),t(e)}function Ee(e){V.status===`installing`&&e.type===`progress`&&W({...V,stage:e.stage})}function De(){H?.(!1),H=null,(V.status===`confirming`||V.status===`installing`)&&W({status:`closing`,view:V})}function Oe(){V.status===`closing`&&W(B)}function G(){return _e().relayUrl}var K=class extends re(`CloudEnvironmentLinkError`){},q=e=>t=>new K({message:e,cause:t});function ke(e){return v(function*(){let t=yield*P,n=yield*t.run(e,N(f.cloudGetRelayClientStatus,{})).pipe(E(q(`Could not check relay client availability.`)));if(n.status===`available`)return;if(n.status===`unsupported`)return yield*new K({message:`P4 Code cannot install the relay client automatically on ${n.platform}-${n.arch}.`});if(!(yield*ae({try:()=>we(n.version),catch:q(`Could not confirm relay client installation.`)})))return yield*new K({message:`Relay client installation was cancelled.`});let r=yield*t.runStream(e,j(f.cloudInstallRelayClient,{}).pipe(a(e=>c(()=>Ee(e))))).pipe(le,E(q(`Could not install the relay client.`)),A(c(De)));if(l(r)||r.value.type!==`complete`)return yield*new K({message:`The relay client install completed without a final status.`});let i=r.value.status;if(i.status!==`available`)return yield*new K({message:i.status===`unsupported`?`P4 Code cannot install the relay client automatically on ${i.platform}-${i.arch}.`:`The relay client is still unavailable after installation.`})})}var Ae=de(ie([te,ee,o,h,u,pe]));function J(e){return t=>{let n=t._tag===`ManagedRelayRequestFailedError`?t:void 0,r=n?.traceId,i=n?M(n):null;return new K({message:i?`${e}: ${i}`:e,cause:t,...r?{traceId:r}:{}})}}function Y(e){return Ae(e)?e:typeof e!=`object`||!e?null:`cause`in e?Y(e.cause):null}var X=e=>t=>{let n=Y(t);return new K({message:n?`${e.replace(/[.:]$/,``)}: ${n.message}`:e,cause:t})};function je(e){let t=new URL(e);return{localHttpHost:`127.0.0.1`,localHttpPort:Number(t.port||(t.protocol===`https:`?443:80))}}var Me=`cloudflare_tunnel`;function Ne(e){return e.link.environmentId===e.expectedEnvironmentId?e.link.endpoint.providerKind===e.expectedProviderKind?T:new K({message:`Relay returned credentials for a different endpoint provider.`}):new K({message:`Relay returned credentials for a different environment.`})}function Pe(e){return v(function*(){return yield*(yield*b(e.target.httpBaseUrl)).connect.linkState({headers:{}}).pipe(E(X(`Could not read environment cloud link state.`)))}).pipe(x(R))}function Fe(e){return v(function*(){let t=yield*b(e.target.httpBaseUrl),{target:n,...r}=e;return yield*t.connect.preferences({headers:{},payload:r}).pipe(E(X(`Could not update environment cloud preferences.`)))}).pipe(x(R))}function Ie(e){return v(function*(){yield*(yield*b(e.target.httpBaseUrl)).connect.unlink({headers:{}}).pipe(E(X(`Could not unlink the environment from cloud.`))),G()&&e.clerkToken&&(yield*(yield*F).unlinkEnvironment({clerkToken:e.clerkToken,environmentId:D.make(e.target.environmentId)}).pipe(S(e=>ce(`Could not revoke cloud environment link after local unlink.`,{cause:e}))))}).pipe(x(R))}var Z=`manual`;function Le(e){return v(function*(){let t=G();if(!t)return yield*new K({message:`P4CODE_RELAY_URL is not configured.`});let n=(e.mode??`managed`)===`managed`,r=n?Me:Z,i=yield*F,a=yield*b(e.target.httpBaseUrl);n&&(yield*ke(D.make(e.target.environmentId)));let o=yield*i.createEnvironmentLinkChallenge({clerkToken:e.clerkToken,payload:{notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(E(J(`${t}/v1/client/environment-link-challenges failed`))),s=yield*a.connect.linkProof({headers:{},payload:{challenge:o.challenge,relayIssuer:t,endpoint:{httpBaseUrl:e.target.httpBaseUrl,wsBaseUrl:e.target.wsBaseUrl,providerKind:r},origin:je(e.target.httpBaseUrl)}}).pipe(E(X(`Could not obtain environment link proof.`))),c=yield*i.linkEnvironment({clerkToken:e.clerkToken,payload:{proof:s,notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(E(J(`${t}/v1/client/environment-links failed`)));yield*Ne({expectedEnvironmentId:e.target.environmentId,expectedProviderKind:r,link:c}),yield*a.connect.relayConfig({headers:{},payload:{relayUrl:t,relayIssuer:c.relayIssuer,cloudUserId:c.cloudUserId,environmentCredential:c.environmentCredential,cloudMintPublicKey:c.cloudMintPublicKey,endpointRuntime:c.endpointRuntime}}).pipe(E(X(`Could not configure environment relay access.`)))}).pipe(x(R))}var Re=he(i(y,L.contextEffect.pipe(t(e=>ge(e,y))))),Q=se(e=>{let t=JSON.parse(e);return Re.atom(Pe({target:t})).pipe(fe({staleTime:5e3,revalidateOnMount:!0}),C(3e5),w(`primary-cloud-link:${t.environmentId}`))}),ze=e(k(null)).pipe(g,w(`primary-cloud-link:null`));function $(e){return JSON.stringify(e)}function Be(e){e&&z(D.make(e.environmentId),`relay:read`)&&s.refresh(Q($(e)))}function Ve(e){if(!z(D.make(e.environmentId),`relay:read`))return null;let t=s.get(Q($(e)));return t._tag===`Success`?t.value:null}function He(){let e=(0,be.c)(17),t=ve(),r=ye(t?.environmentId??null,O),i;e[0]===t?i=e[1]:(i=t?.entry.target._tag===`PrimaryConnectionTarget`?{environmentId:t.environmentId,label:t.label,httpBaseUrl:t.entry.target.httpBaseUrl,wsBaseUrl:t.entry.target.wsBaseUrl}:null,e[0]=t,e[1]=i);let a=i,o;e[2]!==r||e[3]!==a?(o=a&&I()&&r?Q($(a)):ze,e[2]=r,e[3]=a,e[4]=o):o=e[4];let s=oe(o),c;e[5]===a?c=e[6]:(c=()=>{Be(a)},e[5]=a,e[6]=c);let l=c,u=null;if(s._tag===`Failure`){let t;e[7]===s.cause?t=e[8]:(t=n(s.cause),e[7]=s.cause,e[8]=t);let r=t;u=r instanceof Error?r.message:`Could not read P4 Connect link state.`}let d;e[9]===s?d=e[10]:(d=s._tag===`Failure`?null:p(_(s)),e[9]=s,e[10]=d);let f;return e[11]!==u||e[12]!==l||e[13]!==s.waiting||e[14]!==d||e[15]!==a?(f={data:d,error:u,isPending:s.waiting,refresh:l,target:a},e[11]=u,e[12]=l,e[13]=s.waiting,e[14]=d,e[15]=a,e[16]=f):f=e[16],f}export{Fe as a,Te as c,Ie as i,Ce as l,He as n,Oe as o,Le as r,Se as s,Ve as t};
2
- //# sourceMappingURL=primaryCloudLinkState-LOtU3kc-.js.map
1
+ import{$o as e,$x as t,Aw as n,By as r,DC as i,Ev as a,Fl as o,Go as s,HS as c,IT as l,Il as u,Iy as d,Lc as f,Ll as ee,Ml as te,NE as ne,NT as p,Oy as m,Pl as h,Qo as g,Ss as _,Vw as re,Vx as v,Wy as ie,YS as ae,Yo as oe,Zo as se,Zx as ce,_u as y,bv as le,db as ue,ec as b,ib as de,is as fe,jl as pe,kl as me,ns as he,oT as ge,pS as x,px as S,rs as C,ss as w,tC as T,tS as E,uy as D,x_ as O,xs as k,xx as A}from"./utils-BAPnqm16.js";import{$ as j,Nn as M,Z as N,dt as P,mn as F,o as I,r as L,s as _e,v as R}from"./runtime-B9IDNXDU.js";import"./runtime-B5cKWtKn.js";import{o as ve}from"./environments-iW64jjyO.js";import{i as ye,n as z}from"./session-Bo2ZSprC.js";var be=ne(),xe=class extends r()(`RelayClientInstallConfirmationConflictError`,{requestedVersion:d,activeVersion:d,activeDialogStatus:m([`confirming`,`installing`,`closing`]),activeInstallStage:ue(me)}){get message(){return`Cannot confirm relay client installation ${this.requestedVersion}; installation ${this.activeVersion} has dialog status ${this.activeDialogStatus}.`}},B={status:`idle`},V=B,H=null,U=new Set;function W(e){V=e;for(let e of U)e()}function Se(){return V}function Ce(e){return U.add(e),()=>{U.delete(e)}}function we(e){if(V.status!==`idle`){let t=V.status===`closing`?V.view:V;return Promise.reject(new xe({requestedVersion:e,activeVersion:t.version,activeDialogStatus:V.status,...t.status===`installing`?{activeInstallStage:t.stage}:{}}))}return W({status:`confirming`,version:e}),new Promise(e=>{H=e})}function Te(e){if(V.status!==`confirming`||!H)return;let t=H;H=null,W(e?{status:`installing`,version:V.version,stage:`checking`}:{status:`closing`,view:V}),t(e)}function Ee(e){V.status===`installing`&&e.type===`progress`&&W({...V,stage:e.stage})}function De(){H?.(!1),H=null,(V.status===`confirming`||V.status===`installing`)&&W({status:`closing`,view:V})}function Oe(){V.status===`closing`&&W(B)}function G(){return _e().relayUrl}var K=class extends re(`CloudEnvironmentLinkError`){},q=e=>t=>new K({message:e,cause:t});function ke(e){return v(function*(){let t=yield*P,n=yield*t.run(e,N(f.cloudGetRelayClientStatus,{})).pipe(E(q(`Could not check relay client availability.`)));if(n.status===`available`)return;if(n.status===`unsupported`)return yield*new K({message:`P4 Code cannot install the relay client automatically on ${n.platform}-${n.arch}.`});if(!(yield*ae({try:()=>we(n.version),catch:q(`Could not confirm relay client installation.`)})))return yield*new K({message:`Relay client installation was cancelled.`});let r=yield*t.runStream(e,j(f.cloudInstallRelayClient,{}).pipe(a(e=>c(()=>Ee(e))))).pipe(le,E(q(`Could not install the relay client.`)),A(c(De)));if(l(r)||r.value.type!==`complete`)return yield*new K({message:`The relay client install completed without a final status.`});let i=r.value.status;if(i.status!==`available`)return yield*new K({message:i.status===`unsupported`?`P4 Code cannot install the relay client automatically on ${i.platform}-${i.arch}.`:`The relay client is still unavailable after installation.`})})}var Ae=de(ie([te,ee,o,h,u,pe]));function J(e){return t=>{let n=t._tag===`ManagedRelayRequestFailedError`?t:void 0,r=n?.traceId,i=n?M(n):null;return new K({message:i?`${e}: ${i}`:e,cause:t,...r?{traceId:r}:{}})}}function Y(e){return Ae(e)?e:typeof e!=`object`||!e?null:`cause`in e?Y(e.cause):null}var X=e=>t=>{let n=Y(t);return new K({message:n?`${e.replace(/[.:]$/,``)}: ${n.message}`:e,cause:t})};function je(e){let t=new URL(e);return{localHttpHost:`127.0.0.1`,localHttpPort:Number(t.port||(t.protocol===`https:`?443:80))}}var Me=`cloudflare_tunnel`;function Ne(e){return e.link.environmentId===e.expectedEnvironmentId?e.link.endpoint.providerKind===e.expectedProviderKind?T:new K({message:`Relay returned credentials for a different endpoint provider.`}):new K({message:`Relay returned credentials for a different environment.`})}function Pe(e){return v(function*(){return yield*(yield*b(e.target.httpBaseUrl)).connect.linkState({headers:{}}).pipe(E(X(`Could not read environment cloud link state.`)))}).pipe(x(R))}function Fe(e){return v(function*(){let t=yield*b(e.target.httpBaseUrl),{target:n,...r}=e;return yield*t.connect.preferences({headers:{},payload:r}).pipe(E(X(`Could not update environment cloud preferences.`)))}).pipe(x(R))}function Ie(e){return v(function*(){yield*(yield*b(e.target.httpBaseUrl)).connect.unlink({headers:{}}).pipe(E(X(`Could not unlink the environment from cloud.`))),G()&&e.clerkToken&&(yield*(yield*F).unlinkEnvironment({clerkToken:e.clerkToken,environmentId:D.make(e.target.environmentId)}).pipe(S(e=>ce(`Could not revoke cloud environment link after local unlink.`,{cause:e}))))}).pipe(x(R))}var Z=`manual`;function Le(e){return v(function*(){let t=G();if(!t)return yield*new K({message:`P4CODE_RELAY_URL is not configured.`});let n=(e.mode??`managed`)===`managed`,r=n?Me:Z,i=yield*F,a=yield*b(e.target.httpBaseUrl);n&&(yield*ke(D.make(e.target.environmentId)));let o=yield*i.createEnvironmentLinkChallenge({clerkToken:e.clerkToken,payload:{notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(E(J(`${t}/v1/client/environment-link-challenges failed`))),s=yield*a.connect.linkProof({headers:{},payload:{challenge:o.challenge,relayIssuer:t,endpoint:{httpBaseUrl:e.target.httpBaseUrl,wsBaseUrl:e.target.wsBaseUrl,providerKind:r},origin:je(e.target.httpBaseUrl)}}).pipe(E(X(`Could not obtain environment link proof.`))),c=yield*i.linkEnvironment({clerkToken:e.clerkToken,payload:{proof:s,notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(E(J(`${t}/v1/client/environment-links failed`)));yield*Ne({expectedEnvironmentId:e.target.environmentId,expectedProviderKind:r,link:c}),yield*a.connect.relayConfig({headers:{},payload:{relayUrl:t,relayIssuer:c.relayIssuer,cloudUserId:c.cloudUserId,environmentCredential:c.environmentCredential,cloudMintPublicKey:c.cloudMintPublicKey,endpointRuntime:c.endpointRuntime}}).pipe(E(X(`Could not configure environment relay access.`)))}).pipe(x(R))}var Re=he(i(y,L.contextEffect.pipe(t(e=>ge(e,y))))),Q=se(e=>{let t=JSON.parse(e);return Re.atom(Pe({target:t})).pipe(fe({staleTime:5e3,revalidateOnMount:!0}),C(3e5),w(`primary-cloud-link:${t.environmentId}`))}),ze=e(k(null)).pipe(g,w(`primary-cloud-link:null`));function $(e){return JSON.stringify(e)}function Be(e){e&&z(D.make(e.environmentId),`relay:read`)&&s.refresh(Q($(e)))}function Ve(e){if(!z(D.make(e.environmentId),`relay:read`))return null;let t=s.get(Q($(e)));return t._tag===`Success`?t.value:null}function He(){let e=(0,be.c)(17),t=ve(),r=ye(t?.environmentId??null,O),i;e[0]===t?i=e[1]:(i=t?.entry.target._tag===`PrimaryConnectionTarget`?{environmentId:t.environmentId,label:t.label,httpBaseUrl:t.entry.target.httpBaseUrl,wsBaseUrl:t.entry.target.wsBaseUrl}:null,e[0]=t,e[1]=i);let a=i,o;e[2]!==r||e[3]!==a?(o=a&&I()&&r?Q($(a)):ze,e[2]=r,e[3]=a,e[4]=o):o=e[4];let s=oe(o),c;e[5]===a?c=e[6]:(c=()=>{Be(a)},e[5]=a,e[6]=c);let l=c,u=null;if(s._tag===`Failure`){let t;e[7]===s.cause?t=e[8]:(t=n(s.cause),e[7]=s.cause,e[8]=t);let r=t;u=r instanceof Error?r.message:`Could not read P4 Connect link state.`}let d;e[9]===s?d=e[10]:(d=s._tag===`Failure`?null:p(_(s)),e[9]=s,e[10]=d);let f;return e[11]!==u||e[12]!==l||e[13]!==s.waiting||e[14]!==d||e[15]!==a?(f={data:d,error:u,isPending:s.waiting,refresh:l,target:a},e[11]=u,e[12]=l,e[13]=s.waiting,e[14]=d,e[15]=a,e[16]=f):f=e[16],f}export{Fe as a,Te as c,Ie as i,Ce as l,He as n,Oe as o,Le as r,Se as s,Ve as t};
2
+ //# sourceMappingURL=primaryCloudLinkState-BP-HZzf2.js.map
@@ -1,2 +1,2 @@
1
- import{$o as e,Aw as t,FT as n,Go as r,Jo as i,NE as a,NT as o,Ss as s,Yo as c,ib as l,kg as u,nl as d,ss as f,vs as p}from"./utils-BgVDKR83.js";import{L as m}from"./runtime-B7jXrsPs.js";import{s as h}from"./vcsRefInvalidation-BWvsbPLB.js";import{W as g}from"./entities-Cri9JXzU.js";import{o as _}from"./queries-DqFudp6N.js";var v=a(),y=``,b=e(p(!1)),x=e(p(!1)).pipe(f(`project-file-query:empty`));function S(e,t,n){return g.optimisticFile({environmentId:e,cwd:t,relativePath:n})}var C=new Map;function w(e){let t=C.get(e);C.delete(e),t?.()}function T(e,t,n){return g.listEntries({environmentId:e,input:{cwd:t,...n===void 0?{}:{directoryPath:n}}})}function E(e,t,n){return g.readFile({environmentId:e,input:{cwd:t,relativePath:n??y}})}function D(e,t,n){return g.readConfiguration({environmentId:e,input:{cwd:t,relativePath:n}})}function O(e,t,n,i){let a=S(e,t,n);C.has(a)||C.set(a,r.mount(a)),r.set(a,{confirmedAgainst:void 0,data:{relativePath:n,contents:i,byteLength:new TextEncoder().encode(i).byteLength,truncated:!1}})}function k(e,t,n){return r.get(S(e,t,n))?.data??null}function A(e,t,i){let a=k(e,t,i);if(a)return a.contents;let o=r.get(E(e,t,i));return n(s(o))?.contents}function j(e,t,n){let i=r.get(S(e,t,n));return i?.confirmedAgainst===void 0?i?.data??null:null}function M(e,t,n,i){let a=S(e,t,n),o=r.get(a);if(o?.data.contents!==i)return!1;let s=E(e,t,n),c={...o,confirmedAgainst:r.get(s)};return r.set(a,c),w(a),r.refresh(s),m(r,s,{reportDefect:!1,reportFailure:!1}).then(async i=>{if(n===`p4.json`||n===`t3.json`){let n=D(e,t,d);r.refresh(n),await m(r,n,{reportDefect:!1,reportFailure:!1})}i._tag===`Success`&&r.get(a)===c&&r.set(a,null)}),!0}function N(e,t,n,i){return n===null?i:r.get(S(e,t,n))?.data??i}function P(e){return e._tag===`Failure`?t(e.cause):null}function F(e){return e===null?null:e instanceof Error?e.message:`Workspace query failed.`}var I=l(u);function L(e,t,n){let r=(0,v.c)(19),a=h(e),{canReadFiles:l}=a,u;r[0]!==l||r[1]!==t||r[2]!==n||r[3]!==e?(u=l?T(e,t,n):b,r[0]=l,r[1]=t,r[2]=n,r[3]=e,r[4]=u):u=r[4];let d=u,f=c(d),p=i(d),m;r[5]===p?m=r[6]:(m=()=>p(),r[5]=p,r[6]=m);let g=m,_;r[7]===f?_=r[8]:(_=o(s(f)),r[7]=f,r[8]=_);let y;r[9]!==l||r[10]!==a.error||r[11]!==a.isPending||r[12]!==f?(y=a.isPending?null:l?F(P(f)):a.error??`This connection cannot read host files.`,r[9]=l,r[10]=a.error,r[11]=a.isPending,r[12]=f,r[13]=y):y=r[13];let x=a.isPending||f.waiting,S;return r[14]!==g||r[15]!==_||r[16]!==y||r[17]!==x?(S={data:_,error:y,isPending:x,refresh:g},r[14]=g,r[15]=_,r[16]=y,r[17]=x,r[18]=S):S=r[18],S}function R(e,t,n,r,i){let a=(0,v.c)(16),o;a[0]===i?.imageOnly?o=a[1]:(o=i?.imageOnly?{imageOnly:!0}:{},a[0]=i?.imageOnly,a[1]=o);let s;a[2]!==t||a[3]!==e||a[4]!==n||a[5]!==o?(s={environmentId:e,cwd:t,query:n,kind:`file`,...o},a[2]=t,a[3]=e,a[4]=n,a[5]=o,a[6]=s):s=a[6];let c;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(c={allowEmptyQuery:!0},a[7]=c):c=a[7];let l=_(s,r,c),u;a[8]!==l.entries||a[9]!==l.isPending?(u=l.isPending?[]:l.entries,a[8]=l.entries,a[9]=l.isPending,a[10]=u):u=a[10];let d;return a[11]!==l.error||a[12]!==l.isPending||a[13]!==l.searchedQuery||a[14]!==u?(d={entries:u,error:l.error,isPending:l.isPending,matchedQuery:l.searchedQuery},a[11]=l.error,a[12]=l.isPending,a[13]=l.searchedQuery,a[14]=u,a[15]=d):d=a[15],d}function z(e,t,n,r,a){let l=(0,v.c)(36),u=r===void 0||r,f=a!==void 0&&a,p=h(e),{canReadFiles:m}=p,g=u,_;l[0]!==m||l[1]!==f||l[2]!==t||l[3]!==u||l[4]!==e||l[5]!==n?(_=u&&m?f&&n!==null?D(e,t,n):E(e,t,n):x,l[0]=m,l[1]=f,l[2]=t,l[3]=u,l[4]=e,l[5]=n,l[6]=_):_=l[6];let b=_,C=c(b),w=i(b),T;l[7]===w?T=l[8]:(T=()=>w(),l[7]=w,l[8]=T);let O=T,k;l[9]===C?k=l[10]:(k=o(s(C)),l[9]=C,l[10]=k);let A=k,j=A?.relativePath??n??y,M;l[11]!==t||l[12]!==e||l[13]!==j?(M=S(e,t,j),l[11]=t,l[12]=e,l[13]=j,l[14]=M):M=l[14];let N=c(M),L=f?d:y,R;l[15]!==t||l[16]!==e||l[17]!==L?(R=S(e,t,L),l[15]=t,l[16]=e,l[17]=L,l[18]=R):R=l[18];let z=c(R),B=n===null?null:f?z??N:N,V,H,U;if(l[19]!==m||l[20]!==A||l[21]!==p.error||l[22]!==p.isPending||l[23]!==g||l[24]!==B?.data||l[25]!==C){let e=P(C);V=I(e)?e:null,U=m?B?.data??A:null,H=!g||p.isPending?null:m?F(e):p.error??`This connection cannot read host files.`,l[19]=m,l[20]=A,l[21]=p.error,l[22]=p.isPending,l[23]=g,l[24]=B?.data,l[25]=C,l[26]=V,l[27]=H,l[28]=U}else V=l[26],H=l[27],U=l[28];let W=g&&(p.isPending||C.waiting),G=V?.failure===`path_not_file`,K;return l[29]!==V||l[30]!==O||l[31]!==H||l[32]!==W||l[33]!==G||l[34]!==U?(K={data:U,error:H,isPending:W,readError:V,isNotFile:G,refresh:O},l[29]=V,l[30]=O,l[31]=H,l[32]=W,l[33]=G,l[34]=U,l[35]=K):K=l[35],K}export{E as a,N as c,R as d,z as f,A as i,O as l,k as n,j as o,D as r,S as s,M as t,L as u};
2
- //# sourceMappingURL=projectFilesQueryState-DPo8i5yD.js.map
1
+ import{$o as e,Aw as t,FT as n,Go as r,Jo as i,NE as a,NT as o,Ss as s,Yo as c,ib as l,kg as u,nl as d,ss as f,vs as p}from"./utils-BAPnqm16.js";import{L as m}from"./runtime-B9IDNXDU.js";import{s as h}from"./vcsRefInvalidation-DfCz0cGO.js";import{W as g}from"./entities-DCbEYTvn.js";import{o as _}from"./queries-DCKH7ltg.js";var v=a(),y=``,b=e(p(!1)),x=e(p(!1)).pipe(f(`project-file-query:empty`));function S(e,t,n){return g.optimisticFile({environmentId:e,cwd:t,relativePath:n})}var C=new Map;function w(e){let t=C.get(e);C.delete(e),t?.()}function T(e,t,n){return g.listEntries({environmentId:e,input:{cwd:t,...n===void 0?{}:{directoryPath:n}}})}function E(e,t,n){return g.readFile({environmentId:e,input:{cwd:t,relativePath:n??y}})}function D(e,t,n){return g.readConfiguration({environmentId:e,input:{cwd:t,relativePath:n}})}function O(e,t,n,i){let a=S(e,t,n);C.has(a)||C.set(a,r.mount(a)),r.set(a,{confirmedAgainst:void 0,data:{relativePath:n,contents:i,byteLength:new TextEncoder().encode(i).byteLength,truncated:!1}})}function k(e,t,n){return r.get(S(e,t,n))?.data??null}function A(e,t,i){let a=k(e,t,i);if(a)return a.contents;let o=r.get(E(e,t,i));return n(s(o))?.contents}function j(e,t,n){let i=r.get(S(e,t,n));return i?.confirmedAgainst===void 0?i?.data??null:null}function M(e,t,n,i){let a=S(e,t,n),o=r.get(a);if(o?.data.contents!==i)return!1;let s=E(e,t,n),c={...o,confirmedAgainst:r.get(s)};return r.set(a,c),w(a),r.refresh(s),m(r,s,{reportDefect:!1,reportFailure:!1}).then(async i=>{if(n===`p4.json`||n===`t3.json`){let n=D(e,t,d);r.refresh(n),await m(r,n,{reportDefect:!1,reportFailure:!1})}i._tag===`Success`&&r.get(a)===c&&r.set(a,null)}),!0}function N(e,t,n,i){return n===null?i:r.get(S(e,t,n))?.data??i}function P(e){return e._tag===`Failure`?t(e.cause):null}function F(e){return e===null?null:e instanceof Error?e.message:`Workspace query failed.`}var I=l(u);function L(e,t,n){let r=(0,v.c)(19),a=h(e),{canReadFiles:l}=a,u;r[0]!==l||r[1]!==t||r[2]!==n||r[3]!==e?(u=l?T(e,t,n):b,r[0]=l,r[1]=t,r[2]=n,r[3]=e,r[4]=u):u=r[4];let d=u,f=c(d),p=i(d),m;r[5]===p?m=r[6]:(m=()=>p(),r[5]=p,r[6]=m);let g=m,_;r[7]===f?_=r[8]:(_=o(s(f)),r[7]=f,r[8]=_);let y;r[9]!==l||r[10]!==a.error||r[11]!==a.isPending||r[12]!==f?(y=a.isPending?null:l?F(P(f)):a.error??`This connection cannot read host files.`,r[9]=l,r[10]=a.error,r[11]=a.isPending,r[12]=f,r[13]=y):y=r[13];let x=a.isPending||f.waiting,S;return r[14]!==g||r[15]!==_||r[16]!==y||r[17]!==x?(S={data:_,error:y,isPending:x,refresh:g},r[14]=g,r[15]=_,r[16]=y,r[17]=x,r[18]=S):S=r[18],S}function R(e,t,n,r,i){let a=(0,v.c)(16),o;a[0]===i?.imageOnly?o=a[1]:(o=i?.imageOnly?{imageOnly:!0}:{},a[0]=i?.imageOnly,a[1]=o);let s;a[2]!==t||a[3]!==e||a[4]!==n||a[5]!==o?(s={environmentId:e,cwd:t,query:n,kind:`file`,...o},a[2]=t,a[3]=e,a[4]=n,a[5]=o,a[6]=s):s=a[6];let c;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(c={allowEmptyQuery:!0},a[7]=c):c=a[7];let l=_(s,r,c),u;a[8]!==l.entries||a[9]!==l.isPending?(u=l.isPending?[]:l.entries,a[8]=l.entries,a[9]=l.isPending,a[10]=u):u=a[10];let d;return a[11]!==l.error||a[12]!==l.isPending||a[13]!==l.searchedQuery||a[14]!==u?(d={entries:u,error:l.error,isPending:l.isPending,matchedQuery:l.searchedQuery},a[11]=l.error,a[12]=l.isPending,a[13]=l.searchedQuery,a[14]=u,a[15]=d):d=a[15],d}function z(e,t,n,r,a){let l=(0,v.c)(36),u=r===void 0||r,f=a!==void 0&&a,p=h(e),{canReadFiles:m}=p,g=u,_;l[0]!==m||l[1]!==f||l[2]!==t||l[3]!==u||l[4]!==e||l[5]!==n?(_=u&&m?f&&n!==null?D(e,t,n):E(e,t,n):x,l[0]=m,l[1]=f,l[2]=t,l[3]=u,l[4]=e,l[5]=n,l[6]=_):_=l[6];let b=_,C=c(b),w=i(b),T;l[7]===w?T=l[8]:(T=()=>w(),l[7]=w,l[8]=T);let O=T,k;l[9]===C?k=l[10]:(k=o(s(C)),l[9]=C,l[10]=k);let A=k,j=A?.relativePath??n??y,M;l[11]!==t||l[12]!==e||l[13]!==j?(M=S(e,t,j),l[11]=t,l[12]=e,l[13]=j,l[14]=M):M=l[14];let N=c(M),L=f?d:y,R;l[15]!==t||l[16]!==e||l[17]!==L?(R=S(e,t,L),l[15]=t,l[16]=e,l[17]=L,l[18]=R):R=l[18];let z=c(R),B=n===null?null:f?z??N:N,V,H,U;if(l[19]!==m||l[20]!==A||l[21]!==p.error||l[22]!==p.isPending||l[23]!==g||l[24]!==B?.data||l[25]!==C){let e=P(C);V=I(e)?e:null,U=m?B?.data??A:null,H=!g||p.isPending?null:m?F(e):p.error??`This connection cannot read host files.`,l[19]=m,l[20]=A,l[21]=p.error,l[22]=p.isPending,l[23]=g,l[24]=B?.data,l[25]=C,l[26]=V,l[27]=H,l[28]=U}else V=l[26],H=l[27],U=l[28];let W=g&&(p.isPending||C.waiting),G=V?.failure===`path_not_file`,K;return l[29]!==V||l[30]!==O||l[31]!==H||l[32]!==W||l[33]!==G||l[34]!==U?(K={data:U,error:H,isPending:W,readError:V,isNotFile:G,refresh:O},l[29]=V,l[30]=O,l[31]=H,l[32]=W,l[33]=G,l[34]=U,l[35]=K):K=l[35],K}export{E as a,N as c,R as d,z as f,A as i,O as l,k as n,j as o,D as r,S as s,M as t,L as u};
2
+ //# sourceMappingURL=projectFilesQueryState-CGllQp_V.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$y as n,C_ as r,Ef as i,Lg as a,NE as o,Vm as s,__ as c,if as l,in as u,jp as d,lE as f,nl as p,sd as m,sr as h,zf as g}from"./utils-BgVDKR83.js";import{R as ee,W as te}from"./runtime-B7jXrsPs.js";import{i as _,n as v}from"./session-eKfJi_Kx.js";import{t as ne}from"./textarea-B86ZyXzK.js";import{t as y}from"./input-RCV7-UKX.js";import{a as re,c as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./dialog-DWCEeJ2c.js";import{D as b,O as ue}from"./keybindings-BpKkzV__.js";import{i as de,o as fe,t as pe}from"./popover-B70_-gBS.js";import{f as x}from"./projectFilesQueryState-DPo8i5yD.js";import{t as S}from"./p4ProjectFile-CAKJOMUN.js";import{l as me}from"./KeybindingsSettings.logic-CSyJIpFu.js";import{Ar as he,Fr as C,Ir as ge,La as w,Mr as _e,Ni as T,Nr as ve,Pr as ye,jr as be}from"./main-Co3JeKTg.js";function E(e,t){let n=e.projectSettingsOverrides[t.id]?.defaultProjectScripts;if(n!==void 0)return n;if(e.projectSettingsFolded)return e.defaultProjectScripts;let r=e.projectScriptOverrides[t.id];return r===null?e.defaultProjectScripts:r??(t.scripts.length>0?t.scripts:e.defaultProjectScripts)}function D(e){return e.worktreePath??e.project.cwd}function O(e){let t={P4CODE_PROJECT_ROOT:e.project.cwd};return e.worktreePath&&(t.P4CODE_WORKTREE_PATH=e.worktreePath),e.extraEnv?{...t,...e.extraEnv}:t}function k(e){let t=[...e.runOnWorktreeCreate?[`setup`]:[],...e.runOnSettle?[`on settle`]:[]];return t.length===0?e.name:`${e.name} (${t.join(`, `)})`}var A=e(t(),1),j=o(),M=`Invalid keybinding.`,N=n(a);function P(e){let t=e?.trim()??``;return t.length>0?t:null}function F(e){let t=P(e.keybinding);if(!t)return null;if(e.command===null)throw Error(M);let n=N({key:t,command:e.command});if(n._tag===`None`)throw Error(M);return n.value}function I(e,t){if(t===null)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(!r||r.command!==t)continue;let i=[];r.shortcut.modKey&&i.push(`mod`),r.shortcut.ctrlKey&&i.push(`ctrl`),r.shortcut.metaKey&&i.push(`meta`),r.shortcut.altKey&&i.push(`alt`),r.shortcut.shiftKey&&i.push(`shift`);let a=r.shortcut.key===` `?`space`:r.shortcut.key===`escape`?`esc`:r.shortcut.key;return i.push(a),i.join(`+`)}return null}var L=[];function R(e,t){let n=(0,j.c)(8),r=x(e,t??``,p,t!==null,!0),i=r.data&&!r.data.truncated?r.data.contents:null,a=r.isPending,o;bb0:{if(i===null){let e=a?`loading`:`missing`,t;n[0]===e?t=n[1]:(t={status:e,file:null,scripts:L},n[0]=e,n[1]=t),o=t;break bb0}let e;n[2]===i?e=n[3]:(e=S(i),n[2]=i,n[3]=e);let t=e;if(t===null){let e;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={status:`invalid`,file:null,scripts:L},n[4]=e):e=n[4],o=e;break bb0}let r=t.scripts??L,s;n[5]!==t||n[6]!==r?(s={status:`valid`,file:t,scripts:r},n[5]=t,n[6]=r,n[7]=s):s=n[7],o=s}return o}function z(e,t){return R(e,t).scripts}var B=e(f(),1),xe=[{id:`play`,label:`Play`},{id:`test`,label:`Test`},{id:`lint`,label:`Lint`},{id:`configure`,label:`Configure`},{id:`build`,label:`Build`},{id:`debug`,label:`Debug`}];function V(e){let t=(0,j.c)(12),{icon:n,className:r}=e,a=r===void 0?`size-3.5`:r;if(n===`test`){let e;return t[0]===a?e=t[1]:(e=(0,B.jsx)(l,{className:a}),t[0]=a,t[1]=e),e}if(n===`lint`){let e;return t[2]===a?e=t[3]:(e=(0,B.jsx)(g,{className:a}),t[2]=a,t[3]=e),e}if(n===`configure`){let e;return t[4]===a?e=t[5]:(e=(0,B.jsx)(s,{className:a}),t[4]=a,t[5]=e),e}if(n===`build`){let e;return t[6]===a?e=t[7]:(e=(0,B.jsx)(i,{className:a}),t[6]=a,t[7]=e),e}if(n===`debug`){let e;return t[8]===a?e=t[9]:(e=(0,B.jsx)(m,{className:a}),t[8]=a,t[9]=e),e}let o;return t[10]===a?o=t[11]:(o=(0,B.jsx)(d,{className:a}),t[10]=a,t[11]=o),o}var H={name:``,command:``,icon:`play`,runOnWorktreeCreate:!1,waitForSetup:!1,runOnSettle:!1,keybinding:null,previewUrl:null,autoOpenPreview:!1};function U(e,t){return{scriptId:e.id,initial:{name:e.name,command:e.command,icon:e.icon,runOnWorktreeCreate:e.runOnWorktreeCreate,waitForSetup:e.runOnWorktreeCreate&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:I(t,b(e.id)),previewUrl:e.previewUrl??null,autoOpenPreview:e.autoOpenPreview??!1}}}function W({environmentId:e,editScope:t=c,request:n,scripts:i,onSubmit:a,onDelete:o,onClose:s}){let l=_(e,t),d=_(e,r),f=A.useId(),[p,m]=(0,A.useState)(``),[g,x]=(0,A.useState)(``),[S,E]=(0,A.useState)(`play`),[D,O]=u(!l),[k,j]=(0,A.useState)(!1),[M,N]=(0,A.useState)(!1),[P,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(``),[z,H]=(0,A.useState)(``),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(null),[q,J]=u(!l),[Se,Y]=(0,A.useState)(null),X=(0,A.useRef)(null),Ce=n!==null,Z=n?.scriptId!=null,Q=n!==null&&Se===n;(0,A.useLayoutEffect)(()=>()=>{X.current?.request===n&&(X.current=null)},[n]),(0,A.useEffect)(()=>{n&&(m(n.initial.name),x(n.initial.command),E(n.initial.icon),O(!1),j(n.initial.runOnWorktreeCreate),N(n.initial.waitForSetup),I(n.initial.runOnSettle),R(n.initial.keybinding??``),H(n.initial.previewUrl??``),W(n.initial.autoOpenPreview),K(n.error??null),Y(null))},[n,O]);let $=()=>{X.current=null,Y(null),O(!1),s()};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(le,{open:Ce,onOpenChange:e=>{e||$()},children:(0,B.jsxs)(ce,{children:[(0,B.jsxs)(re,{children:[(0,B.jsx)(ie,{children:Z?`Edit Action`:`Add Action`}),(0,B.jsx)(se,{children:`Actions are project-scoped commands you can run from the top bar or keybindings.`})]}),(0,B.jsx)(oe,{children:(0,B.jsx)(`form`,{id:f,onSubmit:async o=>{if(o.preventDefault(),!n||X.current!==null)return;if(!v(e,t)){K(`This connection cannot change project actions.`);return}let s=(L.trim()||null)!==(n.initial.keybinding?.trim()||null),c=v(e,r);if(s&&!c){K(`This connection cannot change keyboard shortcuts.`);return}let l=p.trim(),u=g.trim();if(l.length===0){K(`Name is required.`);return}if(u.length===0){K(`Command is required.`);return}K(null);let d;try{let e=n.scriptId??ue(l,i.map(e=>e.id)),t=F({keybinding:L,command:b(e)}),r=z.trim();d={name:l,command:u,icon:S,runOnWorktreeCreate:k,waitForSetup:k&&M,runOnSettle:P,...n.scriptId===null&&c||s?{keybinding:t?.key??null}:{},previewUrl:r.length>0?r:null,autoOpenPreview:r.length>0&&U}}catch(e){K(e instanceof Error?e.message:`Failed to save action.`);return}let f={request:n};X.current=f,Y(n),O(!1);try{let e=await a(n.scriptId,d);if(X.current===f){if(e._tag===`Failure`){if(!ee(e)){let t=te(e);K(t instanceof Error?t.message:`Failed to save action.`)}}else $()}}catch(e){X.current===f&&K(e instanceof Error?e.message:`Failed to save action.`)}X.current===f&&(X.current=null,Y(null))},children:(0,B.jsxs)(`fieldset`,{className:`space-y-4`,disabled:Q||!l,children:[(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-name`,children:`Name`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(pe,{onOpenChange:O,open:D,children:[(0,B.jsx)(fe,{render:(0,B.jsx)(h,{type:`button`,variant:`outline`,className:`size-9 shrink-0`,"aria-label":`Choose icon`}),children:(0,B.jsx)(V,{icon:S,className:`size-4.5`})}),(0,B.jsx)(de,{align:`start`,children:(0,B.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:xe.map(e=>{let t=e.id===S;return(0,B.jsxs)(`button`,{type:`button`,className:`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs dark:border-transparent ${t?`border-primary/70 bg-primary/10 ring-inset dark:ring-1 dark:ring-primary/30`:`border-border/70 hover:bg-accent/60 dark:bg-white/[0.035]`}`,onClick:()=>{E(e.id),O(!1)},children:[(0,B.jsx)(V,{icon:e.id,className:`size-4`}),(0,B.jsx)(`span`,{children:e.label})]},e.id)})})})]}),(0,B.jsx)(y,{id:`script-name`,autoFocus:!0,placeholder:`Test`,value:p,onChange:e=>m(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-keybinding`,children:`Keybinding`}),(0,B.jsx)(y,{disabled:!d,id:`script-keybinding`,placeholder:`Press shortcut`,value:L,readOnly:!0,onKeyDown:n=>{if(!v(e,t)||!v(e,`settings:write`)||n.key===`Tab`)return;if(n.preventDefault(),n.key===`Backspace`||n.key===`Delete`){R(``);return}let r=me(n,navigator.platform);r&&R(r)}}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Press a shortcut. Use `,(0,B.jsx)(`code`,{children:`Backspace`}),` to clear. Shortcuts are environment-wide. Projects using the same action share its shortcut.`]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-command`,children:`Command`}),(0,B.jsx)(ne,{id:`script-command`,placeholder:`bun test`,value:g,onChange:e=>x(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-preview-url`,children:`Preview URL (optional)`}),(0,B.jsx)(y,{id:`script-preview-url`,placeholder:`http://localhost:5173`,value:z,onChange:e=>H(e.target.value)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open this URL in the in-app preview when this action runs.`})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run automatically on worktree creation`}),(0,B.jsx)(w,{checked:k,onCheckedChange:e=>j(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${k?``:`opacity-60`}`,children:[(0,B.jsx)(`span`,{children:`Wait for it to finish before the agent starts`}),(0,B.jsx)(w,{checked:M,disabled:!k,onCheckedChange:e=>N(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run in the thread's worktree when the thread settles`}),(0,B.jsx)(w,{checked:P,onCheckedChange:e=>I(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${z.trim().length===0?`opacity-60`:``}`,children:[(0,B.jsx)(`span`,{children:`Open preview automatically when this action runs`}),(0,B.jsx)(w,{checked:U,disabled:z.trim().length===0,onCheckedChange:e=>W(!!e)})]}),G&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:G})]})})}),(0,B.jsxs)(ae,{variant:`bare`,children:[Z&&(0,B.jsx)(h,{type:`button`,variant:`destructive-outline`,className:`mr-auto`,disabled:Q||!l,onClick:()=>J(!0),children:`Delete`}),(0,B.jsx)(h,{type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,B.jsx)(h,{form:f,type:`submit`,disabled:Q||!l,children:Q?`Saving…`:Z?`Save changes`:`Save action`})]})]})}),(0,B.jsx)(he,{open:q&&l,onOpenChange:J,children:(0,B.jsxs)(C,{children:[(0,B.jsxs)(ye,{children:[(0,B.jsxs)(ge,{children:[`Delete action "`,p,`"?`]}),(0,B.jsx)(_e,{children:`This action cannot be undone.`})]}),(0,B.jsxs)(ve,{children:[(0,B.jsx)(be,{render:(0,B.jsx)(h,{variant:`outline`}),children:`Cancel`}),(0,B.jsx)(h,{variant:`destructive`,disabled:Q||!l,onClick:()=>{if(n?.scriptId){if(!v(e,t)){K(`This connection cannot change project actions.`);return}J(!1),$(),o(n.scriptId)}},children:`Delete action`})]})]})})]})}export{z as a,I as c,O as d,E as f,U as i,D as l,W as n,R as o,V as r,F as s,H as t,k as u};
2
- //# sourceMappingURL=projectScriptEditor-By8EdSYw.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$y as n,C_ as r,Ef as i,Lg as a,NE as o,Vm as s,__ as c,if as l,in as u,jp as d,lE as f,nl as p,sd as m,sr as h,zf as g}from"./utils-BAPnqm16.js";import{R as ee,W as te}from"./runtime-B9IDNXDU.js";import{i as _,n as v}from"./session-Bo2ZSprC.js";import{t as ne}from"./textarea-BvPoR1cI.js";import{t as y}from"./input-83N8btBC.js";import{a as re,c as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./dialog-DYFQxVoN.js";import{D as b,O as ue}from"./keybindings-DLDyoB30.js";import{i as de,o as fe,t as pe}from"./popover-B1MF5i1c.js";import{f as x}from"./projectFilesQueryState-CGllQp_V.js";import{t as S}from"./p4ProjectFile--u7SOSK5.js";import{l as me}from"./KeybindingsSettings.logic-30fwcukL.js";import{Ar as he,Fr as C,Ir as ge,La as w,Mr as _e,Ni as T,Nr as ve,Pr as ye,jr as be}from"./main-lV-t-UZx.js";function E(e,t){let n=e.projectSettingsOverrides[t.id]?.defaultProjectScripts;if(n!==void 0)return n;if(e.projectSettingsFolded)return e.defaultProjectScripts;let r=e.projectScriptOverrides[t.id];return r===null?e.defaultProjectScripts:r??(t.scripts.length>0?t.scripts:e.defaultProjectScripts)}function D(e){return e.worktreePath??e.project.cwd}function O(e){let t={P4CODE_PROJECT_ROOT:e.project.cwd};return e.worktreePath&&(t.P4CODE_WORKTREE_PATH=e.worktreePath),e.extraEnv?{...t,...e.extraEnv}:t}function k(e){let t=[...e.runOnWorktreeCreate?[`setup`]:[],...e.runOnSettle?[`on settle`]:[]];return t.length===0?e.name:`${e.name} (${t.join(`, `)})`}var A=e(t(),1),j=o(),M=`Invalid keybinding.`,N=n(a);function P(e){let t=e?.trim()??``;return t.length>0?t:null}function F(e){let t=P(e.keybinding);if(!t)return null;if(e.command===null)throw Error(M);let n=N({key:t,command:e.command});if(n._tag===`None`)throw Error(M);return n.value}function I(e,t){if(t===null)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(!r||r.command!==t)continue;let i=[];r.shortcut.modKey&&i.push(`mod`),r.shortcut.ctrlKey&&i.push(`ctrl`),r.shortcut.metaKey&&i.push(`meta`),r.shortcut.altKey&&i.push(`alt`),r.shortcut.shiftKey&&i.push(`shift`);let a=r.shortcut.key===` `?`space`:r.shortcut.key===`escape`?`esc`:r.shortcut.key;return i.push(a),i.join(`+`)}return null}var L=[];function R(e,t){let n=(0,j.c)(8),r=x(e,t??``,p,t!==null,!0),i=r.data&&!r.data.truncated?r.data.contents:null,a=r.isPending,o;bb0:{if(i===null){let e=a?`loading`:`missing`,t;n[0]===e?t=n[1]:(t={status:e,file:null,scripts:L},n[0]=e,n[1]=t),o=t;break bb0}let e;n[2]===i?e=n[3]:(e=S(i),n[2]=i,n[3]=e);let t=e;if(t===null){let e;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={status:`invalid`,file:null,scripts:L},n[4]=e):e=n[4],o=e;break bb0}let r=t.scripts??L,s;n[5]!==t||n[6]!==r?(s={status:`valid`,file:t,scripts:r},n[5]=t,n[6]=r,n[7]=s):s=n[7],o=s}return o}function z(e,t){return R(e,t).scripts}var B=e(f(),1),xe=[{id:`play`,label:`Play`},{id:`test`,label:`Test`},{id:`lint`,label:`Lint`},{id:`configure`,label:`Configure`},{id:`build`,label:`Build`},{id:`debug`,label:`Debug`}];function V(e){let t=(0,j.c)(12),{icon:n,className:r}=e,a=r===void 0?`size-3.5`:r;if(n===`test`){let e;return t[0]===a?e=t[1]:(e=(0,B.jsx)(l,{className:a}),t[0]=a,t[1]=e),e}if(n===`lint`){let e;return t[2]===a?e=t[3]:(e=(0,B.jsx)(g,{className:a}),t[2]=a,t[3]=e),e}if(n===`configure`){let e;return t[4]===a?e=t[5]:(e=(0,B.jsx)(s,{className:a}),t[4]=a,t[5]=e),e}if(n===`build`){let e;return t[6]===a?e=t[7]:(e=(0,B.jsx)(i,{className:a}),t[6]=a,t[7]=e),e}if(n===`debug`){let e;return t[8]===a?e=t[9]:(e=(0,B.jsx)(m,{className:a}),t[8]=a,t[9]=e),e}let o;return t[10]===a?o=t[11]:(o=(0,B.jsx)(d,{className:a}),t[10]=a,t[11]=o),o}var H={name:``,command:``,icon:`play`,runOnWorktreeCreate:!1,waitForSetup:!1,runOnSettle:!1,keybinding:null,previewUrl:null,autoOpenPreview:!1};function U(e,t){return{scriptId:e.id,initial:{name:e.name,command:e.command,icon:e.icon,runOnWorktreeCreate:e.runOnWorktreeCreate,waitForSetup:e.runOnWorktreeCreate&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:I(t,b(e.id)),previewUrl:e.previewUrl??null,autoOpenPreview:e.autoOpenPreview??!1}}}function W({environmentId:e,editScope:t=c,request:n,scripts:i,onSubmit:a,onDelete:o,onClose:s}){let l=_(e,t),d=_(e,r),f=A.useId(),[p,m]=(0,A.useState)(``),[g,x]=(0,A.useState)(``),[S,E]=(0,A.useState)(`play`),[D,O]=u(!l),[k,j]=(0,A.useState)(!1),[M,N]=(0,A.useState)(!1),[P,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(``),[z,H]=(0,A.useState)(``),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(null),[q,J]=u(!l),[Se,Y]=(0,A.useState)(null),X=(0,A.useRef)(null),Ce=n!==null,Z=n?.scriptId!=null,Q=n!==null&&Se===n;(0,A.useLayoutEffect)(()=>()=>{X.current?.request===n&&(X.current=null)},[n]),(0,A.useEffect)(()=>{n&&(m(n.initial.name),x(n.initial.command),E(n.initial.icon),O(!1),j(n.initial.runOnWorktreeCreate),N(n.initial.waitForSetup),I(n.initial.runOnSettle),R(n.initial.keybinding??``),H(n.initial.previewUrl??``),W(n.initial.autoOpenPreview),K(n.error??null),Y(null))},[n,O]);let $=()=>{X.current=null,Y(null),O(!1),s()};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(le,{open:Ce,onOpenChange:e=>{e||$()},children:(0,B.jsxs)(ce,{children:[(0,B.jsxs)(re,{children:[(0,B.jsx)(ie,{children:Z?`Edit Action`:`Add Action`}),(0,B.jsx)(se,{children:`Actions are project-scoped commands you can run from the top bar or keybindings.`})]}),(0,B.jsx)(oe,{children:(0,B.jsx)(`form`,{id:f,onSubmit:async o=>{if(o.preventDefault(),!n||X.current!==null)return;if(!v(e,t)){K(`This connection cannot change project actions.`);return}let s=(L.trim()||null)!==(n.initial.keybinding?.trim()||null),c=v(e,r);if(s&&!c){K(`This connection cannot change keyboard shortcuts.`);return}let l=p.trim(),u=g.trim();if(l.length===0){K(`Name is required.`);return}if(u.length===0){K(`Command is required.`);return}K(null);let d;try{let e=n.scriptId??ue(l,i.map(e=>e.id)),t=F({keybinding:L,command:b(e)}),r=z.trim();d={name:l,command:u,icon:S,runOnWorktreeCreate:k,waitForSetup:k&&M,runOnSettle:P,...n.scriptId===null&&c||s?{keybinding:t?.key??null}:{},previewUrl:r.length>0?r:null,autoOpenPreview:r.length>0&&U}}catch(e){K(e instanceof Error?e.message:`Failed to save action.`);return}let f={request:n};X.current=f,Y(n),O(!1);try{let e=await a(n.scriptId,d);if(X.current===f){if(e._tag===`Failure`){if(!ee(e)){let t=te(e);K(t instanceof Error?t.message:`Failed to save action.`)}}else $()}}catch(e){X.current===f&&K(e instanceof Error?e.message:`Failed to save action.`)}X.current===f&&(X.current=null,Y(null))},children:(0,B.jsxs)(`fieldset`,{className:`space-y-4`,disabled:Q||!l,children:[(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-name`,children:`Name`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(pe,{onOpenChange:O,open:D,children:[(0,B.jsx)(fe,{render:(0,B.jsx)(h,{type:`button`,variant:`outline`,className:`size-9 shrink-0`,"aria-label":`Choose icon`}),children:(0,B.jsx)(V,{icon:S,className:`size-4.5`})}),(0,B.jsx)(de,{align:`start`,children:(0,B.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:xe.map(e=>{let t=e.id===S;return(0,B.jsxs)(`button`,{type:`button`,className:`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs dark:border-transparent ${t?`border-primary/70 bg-primary/10 ring-inset dark:ring-1 dark:ring-primary/30`:`border-border/70 hover:bg-accent/60 dark:bg-white/[0.035]`}`,onClick:()=>{E(e.id),O(!1)},children:[(0,B.jsx)(V,{icon:e.id,className:`size-4`}),(0,B.jsx)(`span`,{children:e.label})]},e.id)})})})]}),(0,B.jsx)(y,{id:`script-name`,autoFocus:!0,placeholder:`Test`,value:p,onChange:e=>m(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-keybinding`,children:`Keybinding`}),(0,B.jsx)(y,{disabled:!d,id:`script-keybinding`,placeholder:`Press shortcut`,value:L,readOnly:!0,onKeyDown:n=>{if(!v(e,t)||!v(e,`settings:write`)||n.key===`Tab`)return;if(n.preventDefault(),n.key===`Backspace`||n.key===`Delete`){R(``);return}let r=me(n,navigator.platform);r&&R(r)}}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Press a shortcut. Use `,(0,B.jsx)(`code`,{children:`Backspace`}),` to clear. Shortcuts are environment-wide. Projects using the same action share its shortcut.`]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-command`,children:`Command`}),(0,B.jsx)(ne,{id:`script-command`,placeholder:`bun test`,value:g,onChange:e=>x(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-preview-url`,children:`Preview URL (optional)`}),(0,B.jsx)(y,{id:`script-preview-url`,placeholder:`http://localhost:5173`,value:z,onChange:e=>H(e.target.value)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open this URL in the in-app preview when this action runs.`})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run automatically on worktree creation`}),(0,B.jsx)(w,{checked:k,onCheckedChange:e=>j(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${k?``:`opacity-60`}`,children:[(0,B.jsx)(`span`,{children:`Wait for it to finish before the agent starts`}),(0,B.jsx)(w,{checked:M,disabled:!k,onCheckedChange:e=>N(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run in the thread's worktree when the thread settles`}),(0,B.jsx)(w,{checked:P,onCheckedChange:e=>I(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${z.trim().length===0?`opacity-60`:``}`,children:[(0,B.jsx)(`span`,{children:`Open preview automatically when this action runs`}),(0,B.jsx)(w,{checked:U,disabled:z.trim().length===0,onCheckedChange:e=>W(!!e)})]}),G&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:G})]})})}),(0,B.jsxs)(ae,{variant:`bare`,children:[Z&&(0,B.jsx)(h,{type:`button`,variant:`destructive-outline`,className:`mr-auto`,disabled:Q||!l,onClick:()=>J(!0),children:`Delete`}),(0,B.jsx)(h,{type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,B.jsx)(h,{form:f,type:`submit`,disabled:Q||!l,children:Q?`Saving…`:Z?`Save changes`:`Save action`})]})]})}),(0,B.jsx)(he,{open:q&&l,onOpenChange:J,children:(0,B.jsxs)(C,{children:[(0,B.jsxs)(ye,{children:[(0,B.jsxs)(ge,{children:[`Delete action "`,p,`"?`]}),(0,B.jsx)(_e,{children:`This action cannot be undone.`})]}),(0,B.jsxs)(ve,{children:[(0,B.jsx)(be,{render:(0,B.jsx)(h,{variant:`outline`}),children:`Cancel`}),(0,B.jsx)(h,{variant:`destructive`,disabled:Q||!l,onClick:()=>{if(n?.scriptId){if(!v(e,t)){K(`This connection cannot change project actions.`);return}J(!1),$(),o(n.scriptId)}},children:`Delete action`})]})]})})]})}export{z as a,I as c,O as d,E as f,U as i,D as l,W as n,R as o,V as r,F as s,H as t,k as u};
2
+ //# sourceMappingURL=projectScriptEditor-DwqFzld2.js.map