@p4code/cli 0.9.15 → 0.9.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AcpMcpStdioBridge-Bv41U5Ym.mjs +3 -0
- package/dist/{AcpMcpStdioBridge-BPNHFfTr.mjs → AcpMcpStdioBridge-CvhQaaYj.mjs} +3 -3
- package/dist/{Effect-COOccdaU.mjs → Effect-_Rz7VLdg.mjs} +33 -2
- package/dist/{Schema-BXiVImR2.mjs → Schema-APnY3Ozr.mjs} +2 -2
- package/dist/{Stream-D2XZdzH6.mjs → Stream-CJtpwu3-.mjs} +2 -2
- package/dist/bin.mjs +2 -2
- package/dist/{binCli-06acKUH_.mjs → binCli-B298WI-F.mjs} +6254 -4331
- package/dist/claude-history-worker.mjs +1 -1
- package/dist/{claudeHistoryWorker-BJKXFgWC.mjs → claudeHistoryWorker-Dgk6e0nY.mjs} +2 -2
- package/dist/client/.vite/manifest.json +2296 -2067
- package/dist/client/assets/{2NI2N5EU-CzVcbH89.js → 2NI2N5EU-D4f5i1y_.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-DS3UFSUE.js → 4UO7MD6I-RrpAQ0X1.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-lbor_c4_.js → 5B3SVYGG-ClZSmzf_.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-DufacBFC.js → 5GK6JWQ2-B1md9I9Z.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-B3iWX-TC.js → 5N7A7DKN-BQIARO23.js} +2 -2
- package/dist/client/assets/{5OC2THR4-DoDDWXtD.js → 5OC2THR4-351ZCzKk.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-7n94quvm.js → 5S6HY5KT-DmJkK7tt.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-CqcR9lZq.js → 6IMQ5BUJ-BpvNx_p4.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-BeCI6be_.js → 6OLKWJ4F-C2xPWRsp.js} +2 -2
- package/dist/client/assets/{74OO7NKP-XWvi4Kgp.js → 74OO7NKP--xC0IYpN.js} +2 -2
- package/dist/client/assets/{75O6YZUN-BbbGiqdI.js → 75O6YZUN-CK0ONIHW.js} +2 -2
- package/dist/client/assets/{77XECAW3-BVGMXOi_.js → 77XECAW3-BcsWkjLy.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-D4oehH5y.js → ABYRPUBD-D3uBdyxY.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-CPanDrss.js +2 -0
- package/dist/client/assets/{AnimatedHeight-DT585xP0.js → AnimatedHeight-CVfEvZ5q.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-C312CXz7.js → AuthSurfaceShell-Cfzl0v4C.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-BkFcdWkE.js → BB2UYUI2-BOnjWgZo.js} +2 -2
- package/dist/client/assets/{BUM34MOA-DK6xDbTB.js → BUM34MOA-B7RHMom2.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-rLn9wSBN.js → CEQABKGZ-Cc9Oxare.js} +2 -2
- package/dist/client/assets/{CXAC5362-C1eQCQMX.js → CXAC5362-BNdOJTpr.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-xIp-6pmC.js +2 -0
- package/dist/client/assets/{ChatMarkdown-BUoR67CT.js → ChatMarkdown-Bueup3X5.js} +24 -24
- package/dist/client/assets/CheckboxIndicator-Bx7Oi3gX.js +2 -0
- package/dist/client/assets/ClippedText-CIorIVl7.js +2 -0
- package/dist/client/assets/CodexSetupSection.logic-C7e1n48R.js +2 -0
- package/dist/client/assets/ComboboxClear-HZ-hIKnq.js +2 -0
- package/dist/client/assets/ComboboxGroupLabel-DUYNaL5F.js +2 -0
- package/dist/client/assets/{CommandBlock-40eSIrOe.js → CommandBlock-4iMcWKQI.js} +2 -2
- package/dist/client/assets/CompositeRoot-BBK88_pH.js +2 -0
- package/dist/client/assets/ConnectAgentSurface-BWOV2eWU.js +2 -0
- package/dist/client/assets/{ConnectionStatusDot-7Tjfknn6.js → ConnectionStatusDot-ChSEZVFH.js} +2 -2
- package/dist/client/assets/DRACOLoader-DluumOSd.js +3 -0
- package/dist/client/assets/{DRLTVNUE-BPoomdQn.js → DRLTVNUE-DFsymRUq.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-BVvdA84B.js → DYY6UVD2-CBGlYjYj.js} +2 -2
- package/dist/client/assets/DevicePanel-DbUlYPs5.js +2 -0
- package/dist/client/assets/DeviceSetup-DwoJ9gYG.js +2 -0
- package/dist/client/assets/DialogTitle-CZ-x-t6r.js +2 -0
- package/dist/client/assets/{DiffCommentAnnotation-C28NAT6f.js → DiffCommentAnnotation-I1NLNQ4a.js} +3 -3
- package/dist/client/assets/{DiffFileTree-DNP9E3To.js → DiffFileTree-D2Less6B.js} +2 -2
- package/dist/client/assets/DiffPanel-CbeaPGl7.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-TgqbZJCv.js → DiffWorkerPoolProvider-Ed_Eu_5j.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-B4RMmwTG.css → EmbeddedDesign-2h_Gl1nY.css} +1 -1
- package/dist/client/assets/EmbeddedDesign-cg069GMG.js +22 -0
- package/dist/client/assets/{EnvironmentMachineIcon-B81Bujkx.js → EnvironmentMachineIcon-DX1kvIxN.js} +2 -2
- package/dist/client/assets/{ExpandableText-CViqRFUp.js → ExpandableText-DjawxN-Z.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-CmMgcKnc.js → FNOVOB4O-CyUhwNfJ.js} +2 -2
- package/dist/client/assets/FieldControl-HtKPFtzy.js +2 -0
- package/dist/client/assets/{FileDiff-BnZVGRTP.js → FileDiff-B-y5La4j.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BUTTBdpa.js → FilePreviewPanel-c9WvfrZ_.js} +6 -6
- package/dist/client/assets/{FoldedSettingsSection-CioXtXIT.js → FoldedSettingsSection-BJZLAjOM.js} +2 -2
- package/dist/client/assets/FormContext-CXpUoAJn.js +2 -0
- package/dist/client/assets/GLTFLoader-DL026JyV.js +3833 -0
- package/dist/client/assets/{HDGCDEEZ-BsN0BbNt.js → HDGCDEEZ-Bl6z86eT.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-Bn8VFRt5.js → HSJLKHB7-Cfn1dqKq.js} +2 -2
- package/dist/client/assets/{Icons-D_LFMxsj.js → Icons-CnCqDzcX.js} +2 -2
- package/dist/client/assets/Input-DivTTwcy.js +2 -0
- package/dist/client/assets/IntervalSecondsField-BEYqyqtO.js +2 -0
- package/dist/client/assets/JZOYTAAL-5Iy_ls5m.js +1 -0
- package/dist/client/assets/{K3MD6TGW-BEaTend7.js → K3MD6TGW-DbKn4Q-g.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-Ca837W6z.js → K7RP3OMA-C2LcLP3I.js} +2 -2
- package/dist/client/assets/KeybindingsSettings.logic-BBUqSPsh.js +2 -0
- package/dist/client/assets/{LHDIQX7Q-kLYZmy22.js → LHDIQX7Q-D15jphae.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-C6-9ARpy.js → LUXOKEGN-a5epevQp.js} +2 -2
- package/dist/client/assets/LinkMachineSelect-BeDb1a2o.js +2 -0
- package/dist/client/assets/{MathTypeset-CO0wlzDm.js → MathTypeset-wh9NB-6n.js} +2 -2
- package/dist/client/assets/ModelLiveLayer-vM3B8fTs.js +3 -0
- package/dist/client/assets/{N3JZAHOW-BFAKVTw8.js → N3JZAHOW-CnXyo2Xv.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-DJg3tvBl.js → NUIALGQ3-Be5ePBJU.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-ClDVFY0-.js → NoProjectsHero-D-hOorzE.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-C5dkxqix.js → O65XPQGZ-B6ecTWo6.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-BUT403yQ.js → O7XIQ6OM-DvY9hhop.js} +2 -2
- package/dist/client/assets/{OFQON5FD-BPK3FXUG.js → OFQON5FD-Csir9i2q.js} +2 -2
- package/dist/client/assets/P4ConnectAccountPages-0UQXNoHX.js +2 -0
- package/dist/client/assets/{P4ConnectSidebarSignIn-D7BBbl_u.js → P4ConnectSidebarSignIn-DNS-Ar_U.js} +2 -2
- package/dist/client/assets/{PJQHF43J-DrfICuu-.js → PJQHF43J-DDRN0fWF.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-1wZHYpgc.js +216 -0
- package/dist/client/assets/PierreEntryIcon-C-UBRZGs.js +2 -0
- package/dist/client/assets/PopoverHandle-AuBayEmY.js +2 -0
- package/dist/client/assets/PreviewPanel-5UQIDtjs.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-BuSgjMGJ.js +2 -0
- package/dist/client/assets/{ProjectFavicon-BbtNdeB8.js → ProjectFavicon-Rj7LmbUX.js} +3 -3
- package/dist/client/assets/ProjectIconPickerDialog-75VZboJk.js +2 -0
- package/dist/client/assets/{ProjectMonogram-CjAGnMXr.js → ProjectMonogram-o7ZBa1RK.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-83vDClUK.js → ProviderAuthTerminal-884jYkPg.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-446NiacH.js +2 -0
- package/dist/client/assets/ProviderSettingsForm-CBS1Dlfm.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-DQzL88wU.js +6 -0
- package/dist/client/assets/{RHNBAITX-CzAdLNMd.js → RHNBAITX-DkWE42El.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-CRy5hHfx.js → ReadOnlySourcePreview-DwfiVQrm.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-B-u4PB3I.js → RedactedSensitiveText-DCu9USVF.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-BbxLD-66.js → RenderErrorBoundary-ZQ6mGx7s.js} +3 -3
- package/dist/client/assets/RightPanelResizeHandle-8oJQkwcU.js +2 -0
- package/dist/client/assets/RoomEnvironment-Iz7-KYrN.js +2 -0
- package/dist/client/assets/{SLD4V6NK-DIFaAadw.js → SLD4V6NK-DTdKN7s4.js} +2 -2
- package/dist/client/assets/ScheduledTasksSettings-BFBxrkf4.js +6 -0
- package/dist/client/assets/{ScopedSwitch-sSIKDf2q.js → ScopedSwitch-BC1gPotW.js} +2 -2
- package/dist/client/assets/ScrollAreaCorner-C2BGnFEt.js +2 -0
- package/dist/client/assets/{SecretInput-DxjaAnSE.js → SecretInput-CTGlsesz.js} +2 -2
- package/dist/client/assets/SelectScrollUpArrow-BCdPJCNh.js +2 -0
- package/dist/client/assets/SelfImproveSettingsSection-DrWeWHZ3.js +2 -0
- package/dist/client/assets/SettingsPanels-dLjfE4mE.js +46 -0
- package/dist/client/assets/SettingsPanels.logic-DmWR8tPG.js +2 -0
- package/dist/client/assets/{SettingsScopeNotice-B1JDmqM6.js → SettingsScopeNotice-C3QzVYEB.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-Bbv3JBlJ.js → SidebarStageBackdrop-B1pFHa1_.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-CACWvOHn.js → T3PCR2KE-17rNrwIa.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-DpiGaVko.js → TKWO2OVW-duPpJj5d.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-Cs6g4gXN.js → TSHNXIZL-DU0_NvP6.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-w-RJEK3t.js → ThemeEditorPanel-75j9OkFZ.js} +3 -3
- package/dist/client/assets/{ThreadDetailsItemsMenu-DEwUOoLt.js → ThreadDetailsItemsMenu-D9bVwLRx.js} +45 -45
- package/dist/client/assets/ThreadTerminalDrawer-CdfREoC-.js +5 -0
- package/dist/client/assets/TooltipProvider-BUHMH_xT.js +2 -0
- package/dist/client/assets/{UQJE5E4I-C2gKDRv_.js → UQJE5E4I-B6R9z_Jl.js} +2 -2
- package/dist/client/assets/{USNYFO5S-CQ8LfY6F.js → USNYFO5S-CoqkxDVj.js} +2 -2
- package/dist/client/assets/{Virtualizer-DsEq6qUF.js → Virtualizer-CmU5Fo0Z.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-DK2GTAKk.js → WEVWDWVA-C_7PWsV9.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-BImJJpuo.js → WorkspaceBreadcrumb-wSY6JpgP.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-BlYFBUKE.js → WorkspacePageContainer-Bv3Si0zJ.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-B7O16593.js → WorkspacePageHeader-D35ZiFO-.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-sPxDCIwv.js → X5RFHQXM-BUhlFLY4.js} +2 -2
- package/dist/client/assets/{X62E3GBT-DVWr270S.js → X62E3GBT-BpMRLXKj.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-C4ZNtSrU.js → XBNEOJTC-BRtSarTS.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-aSYUfq9n.js → YHV2MVVZ-Csy6jL8n.js} +2 -2
- package/dist/client/assets/{YURCZMG2-fnxZxUja.js → YURCZMG2-BWgVyhae.js} +2 -2
- package/dist/client/assets/{YVG2LODB-DxaZKaXT.js → YVG2LODB-BaRjN-Cm.js} +2 -2
- package/dist/client/assets/_chat-3NFUtZzk.js +47 -0
- package/dist/client/assets/_chat.design-CPUGyCaX.js +2 -0
- package/dist/client/assets/{_chat.index-D1csjyRQ.js → _chat.index-BMWR9-dz.js} +2 -2
- package/dist/client/assets/_chat.new-CFxwzp_c.js +4 -0
- package/dist/client/assets/_chat.pull-requests-BeA7vnLo.js +2 -0
- package/dist/client/assets/alert-DNQ3Wqlu.js +2 -0
- package/dist/client/assets/{alert-dialog-BCq0Qme9.js → alert-dialog-BRZulAlJ.js} +2 -2
- package/dist/client/assets/{assetUrls-CpRsTTqn.js → assetUrls-C1PZWceM.js} +2 -2
- package/dist/client/assets/assets-DPxWpbK1.js +2 -0
- package/dist/client/assets/browserHistoryStore-or0m8nek.js +2 -0
- package/dist/client/assets/{browserLinkTarget-IOprEiHF.js → browserLinkTarget-DE8VZ118.js} +2 -2
- package/dist/client/assets/{checkbox-CGhJug34.js → checkbox-Cz3A131i.js} +2 -2
- package/dist/client/assets/{color-picker-CRaqqL5F.js → color-picker-BqJjpRIx.js} +2 -2
- package/dist/client/assets/combobox-D28ATySv.js +2 -0
- package/dist/client/assets/{command-06bu9QoQ.js → command-BjQ8TOGE.js} +2 -2
- package/dist/client/assets/{connect-7OV1IEwO.js → connect-CpfP9Azm.js} +2 -2
- package/dist/client/assets/connect-agent-19TQkO9t.js +2 -0
- package/dist/client/assets/design-Bz1IpqHZ.js +2 -0
- package/dist/client/assets/device-DuASmK9r.js +2 -0
- package/dist/client/assets/dialog-BJ3R7bWN.js +2 -0
- package/dist/client/assets/diffPanelStore-Yh6lox6N.js +2 -0
- package/dist/client/assets/{diffRendering-DAzPanqh.js → diffRendering-CeqwU9XS.js} +2 -2
- package/dist/client/assets/{dist-BuxsAlG0.js → dist-C2W3DEZU.js} +3 -3
- package/dist/client/assets/draco_decoder-DZ63_CFx.js +2 -0
- package/dist/client/assets/draco_decoder-Z1_iN-Ht.wasm +0 -0
- package/dist/client/assets/draco_wasm_wrapper-9cRAE0qV.js +2 -0
- package/dist/client/assets/draco_wasm_wrapper-fZCQGLGb.js +116 -0
- package/dist/client/assets/draft-input-D7yqLT1A.js +2 -0
- package/dist/client/assets/duoViewer-DQzDc4Z4.js +2 -0
- package/dist/client/assets/{dynamic-wBSCLNxy.js → dynamic-Dz4eLTaa.js} +3 -3
- package/dist/client/assets/{embeddedScripts-ZebptRJ0.js → embeddedScripts-DZ2Ii9dE.js} +2 -2
- package/dist/client/assets/empty-BwsFVBxJ.js +2 -0
- package/dist/client/assets/entities-CNmVqAZs.js +2 -0
- package/dist/client/assets/{fileLinks-BfcK2bJU.js → fileLinks-E3IIVHgM.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-DjiK1m5s.js → fileTreeExpansion-gTas243c.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-XE3jyXxK.js → getDiffFileInput-CUXcOkYa.js} +2 -2
- package/dist/client/assets/{htmlRender-DGe3WaPg.js → htmlRender-DSw3CY7L.js} +2 -2
- package/dist/client/assets/hubAccess-CsZ8CNmg.js +2 -0
- package/dist/client/assets/image-up-f7X837EZ.js +2 -0
- package/dist/client/assets/{index-CurDuwfz.js → index-Bxj8VaXa.js} +3 -3
- package/dist/client/assets/{input-CQaedaQh.js → input-BwujRX3Y.js} +2 -2
- package/dist/client/assets/input-group-euoW8Z7h.js +2 -0
- package/dist/client/assets/{kbd-DQRicdHu.js → kbd-GiLKf_On.js} +2 -2
- package/dist/client/assets/keybindings-CCmLKtII.js +2 -0
- package/dist/client/assets/{lazy-DmPH_lNd.js → lazy-JsFnphfP.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-CE6uW_5p.js → lazyRouteComponent-DZOLCSfI.js} +2 -2
- package/dist/client/assets/{link-CKfckeju.js → link-ByE5ZkNW.js} +2 -2
- package/dist/client/assets/{linkedPrompt-68_t5vwh.js → linkedPrompt-Dv_ZP8G8.js} +2 -2
- package/dist/client/assets/main-D8lKEPYS.js +37 -0
- package/dist/client/assets/main-DIHqY9YX.css +2 -0
- package/dist/client/assets/{mediaReference-DQ6GIZY7.js → mediaReference-DKsJ-9R8.js} +2 -2
- package/dist/client/assets/mediaSource-CF8tZyds.js +2 -0
- package/dist/client/assets/meshopt_decoder.module-BE7cuDBs.js +2 -0
- package/dist/client/assets/modelScene-DxcxMNRA.js +3 -0
- package/dist/client/assets/number-field-CWsDuEfo.js +2 -0
- package/dist/client/assets/{observeResize-BbXolq6K.js → observeResize-BxfFu2qN.js} +2 -2
- package/dist/client/assets/onboarding-DbYQeYSX.js +2 -0
- package/dist/client/assets/openFileInPreview-BiuuqQ-l.js +2 -0
- package/dist/client/assets/orbit-CTbdaXs-.js +2 -0
- package/dist/client/assets/p4ProjectFile-CZQao9GZ.js +2 -0
- package/dist/client/assets/{pair-BpCo33SH.js → pair-JgOCPd7m.js} +2 -2
- package/dist/client/assets/pause-5XtmSS7L.js +2 -0
- package/dist/client/assets/{pendingSendStore-Ba--K6cH.js → pendingSendStore-Bf499-Oy.js} +2 -2
- package/dist/client/assets/phoneViewer-Bqeu_y-d.js +2 -0
- package/dist/client/assets/{pierre-icons-BdcegjLq.js → pierre-icons-tmWDDsbZ.js} +2 -2
- package/dist/client/assets/popover-D2KZg7__.js +2 -0
- package/dist/client/assets/preview-eatXH_DC.js +2 -0
- package/dist/client/assets/preview-rGycedjV.js +2 -0
- package/dist/client/assets/previewMiniPlayerStore-7pQoYbpL.js +2 -0
- package/dist/client/assets/primary-C0adlG4a.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-DStOgXZ7.js +2 -0
- package/dist/client/assets/projectFilesQueryState-CXzO_JXd.js +2 -0
- package/dist/client/assets/projectScriptEditor-B9Q_BBbL.js +2 -0
- package/dist/client/assets/providerSkills-BYU6vU9U.js +2 -0
- package/dist/client/assets/pullRequestDetail.logic-CAA5BrcO.js +10 -0
- package/dist/client/assets/{pullRequestIcons-CbDg0o8q.js → pullRequestIcons-D0TNfVUp.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-0WIH92NQ.js → pullRequestReviewStore-szmuenZj.js} +2 -2
- package/dist/client/assets/pullRequests-tu-Mn-gv.js +2 -0
- package/dist/client/assets/queries-BhrI_odm.js +2 -0
- package/dist/client/assets/query-DmYgeaGK.js +2 -0
- package/dist/client/assets/radio-group-YcYZQjQu.js +2 -0
- package/dist/client/assets/relay-DcCuBtiq.js +2 -0
- package/dist/client/assets/renderScheduler-BgdSr0UC.js +2 -0
- package/dist/client/assets/rightPanelStore-BpUwMEU6.js +2 -0
- package/dist/client/assets/runtime-DciS6GP9.js +7 -0
- package/dist/client/assets/{runtimeModeConfig-CRXk0H6e.js → runtimeModeConfig-B8OcO6E5.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-Dw_swg_M.js → scheduledTasksSettings.logic-Cnm8G_wO.js} +3 -3
- package/dist/client/assets/{scroll-area-Cm9XZdHp.js → scroll-area-D7wKdOM7.js} +2 -2
- package/dist/client/assets/select--26O8gr7.js +2 -0
- package/dist/client/assets/selfImproveFindings-CQHbA_SP.js +2 -0
- package/dist/client/assets/server-DKB_3xTN.js +2 -0
- package/dist/client/assets/session-D_OiLzln.js +2 -0
- package/dist/client/assets/session-logic-lUPcTQRy.js +26 -0
- package/dist/client/assets/{settings-Yvo1RMvg.js → settings-BDigjNQr.js} +2 -2
- package/dist/client/assets/{settings.appearance-ONDNW-gc.js → settings.appearance-pv_RhojI.js} +2 -2
- package/dist/client/assets/settings.archived-UHO0BqSp.js +2 -0
- package/dist/client/assets/settings.computer-use-C7FCVkB8.js +2 -0
- package/dist/client/assets/settings.connections-MCKul-Qb.js +2 -0
- package/dist/client/assets/settings.data-controls-DHSiH1XK.js +2 -0
- package/dist/client/assets/settings.decisions-DVAZFuiP.js +2 -0
- package/dist/client/assets/settings.designs-Cq_57Bul.js +2 -0
- package/dist/client/assets/settings.diagnostics-D3vvP_U2.js +2 -0
- package/dist/client/assets/{settings.general-Cf_bIbyH.js → settings.general-BVlKme_0.js} +2 -2
- package/dist/client/assets/settings.integrations-CfX639cu.js +2 -0
- package/dist/client/assets/settings.keybindings-C4ufqFiE.js +2 -0
- package/dist/client/assets/{settings.open-source-licenses-DlqO6HBa.js → settings.open-source-licenses-C7SQX7_o.js} +2 -2
- package/dist/client/assets/settings.plugins-JB-_3lB3.js +5 -0
- package/dist/client/assets/settings.projects-HbUqS8EQ.js +4 -0
- package/dist/client/assets/settings.providers-DDaicTRG.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-BIaHEXVF.js → settings.scheduled-tasks-CsfZkMNc.js} +2 -2
- package/dist/client/assets/settings.secrets-DmkUTUBC.js +2 -0
- package/dist/client/assets/settings.snap-shot-CxBBb3GG.js +2 -0
- package/dist/client/assets/settings.source-control-Buh1svx1.js +2 -0
- package/dist/client/assets/settings.storage-BoCdHcfz.js +2 -0
- package/dist/client/assets/settingsLayout-EWRSNE9F.js +3 -0
- package/dist/client/assets/sidebar-B2McbSnM.js +2 -0
- package/dist/client/assets/{sidebarProjectGrouping-Cy06FqQF.js → sidebarProjectGrouping-ManvShfB.js} +2 -2
- package/dist/client/assets/skeleton-CfxEpnM8.js +2 -0
- package/dist/client/assets/sourceControl-2E-torWB.js +2 -0
- package/dist/client/assets/sourceControlClients-DTwwk4H6.js +2 -0
- package/dist/client/assets/spinner-DiQtYQvU.js +2 -0
- package/dist/client/assets/src-aYUfWMsw.js +15 -0
- package/dist/client/assets/{terminal-links-DkNuyYrs.js → terminal-links-DalIS_T6.js} +2 -2
- package/dist/client/assets/terminalSessions-BXRGhdwO.js +2 -0
- package/dist/client/assets/textarea-CgJxMEC6.js +2 -0
- package/dist/client/assets/{themePalette-1UQmJk98.js → themePalette-BAJL8JDR.js} +3 -3
- package/dist/client/assets/threadCheckpoints-A01VyLzN.js +2 -0
- package/dist/client/assets/toggle-fVPE0kyD.js +2 -0
- package/dist/client/assets/toggle-group-BQBgK4Fh.js +2 -0
- package/dist/client/assets/{tooltip-C7NAkYG3.js → tooltip-DDv-MvO4.js} +2 -2
- package/dist/client/assets/{uiStateStore-FYiLqqos.js → uiStateStore-Cyle2Grh.js} +2 -2
- package/dist/client/assets/usage-DfkVwFPy.js +2 -0
- package/dist/client/assets/usageAccess-DGGNF6kP.js +2 -0
- package/dist/client/assets/usageFormat-DvpnUmwI.js +2 -0
- package/dist/client/assets/{usageShortcuts-BJyp1xT6.js → usageShortcuts-BefcatkO.js} +2 -2
- package/dist/client/assets/{use-atom-command-BbFDhw_c.js → use-atom-command-Bfi4daMj.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-BJnK5b5h.js → useAriaLabelledBy-DjrGw7Iw.js} +2 -2
- package/dist/client/assets/useHandleNewThread-idXLHXR7.js +2 -0
- package/dist/client/assets/{useLocation-NTw9A5XQ.js → useLocation-fNQqSFar.js} +2 -2
- package/dist/client/assets/{useNavigate-DV9bXnWr.js → useNavigate-DwXZ6yA7.js} +2 -2
- package/dist/client/assets/{useNavigateBack-D62rsj_4.js → useNavigateBack-mLGu4w8K.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-Bj5GIxgy.js → useP4ConnectAuthPrompt-BXgvqiOd.js} +2 -2
- package/dist/client/assets/{useParams-jklHVL7l.js → useParams-qFbmBdAa.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-DaCu90iN.js → usePermissionStatus-CTyZ03Js.js} +2 -2
- package/dist/client/assets/usePopupViewport-Dc46kF33.js +2 -0
- package/dist/client/assets/usePullRequestActions-DJ1WiiLA.js +3 -0
- package/dist/client/assets/useRegisterFieldControl-BL6Ml_ar.js +2 -0
- package/dist/client/assets/useRender-BP5vR6yH.js +2 -0
- package/dist/client/assets/{useScopedModelAvailability-hsJL85Tg.js → useScopedModelAvailability-CLTKL2Jf.js} +2 -2
- package/dist/client/assets/useSettings-CnHpxSBo.js +3 -0
- package/dist/client/assets/utils-CtzgibkN.js +24 -0
- package/dist/client/assets/vcsRefInvalidation-BewBnMos.js +2 -0
- package/dist/client/assets/welcome-BkJ7M2_8.js +2 -0
- package/dist/client/index.html +1 -1
- package/dist/{renderer-D9dDeERN.mjs → renderer-7PhJbGDm.mjs} +19 -4
- package/dist/{runtime-C3UJDGLb.mjs → runtime-Dbm6Vqjj.mjs} +511 -233
- package/package.json +1 -1
- package/dist/AcpMcpStdioBridge-CtXfvrFO.mjs +0 -3
- package/dist/client/assets/AlertDialogRoot-BI19p1Pb.js +0 -2
- package/dist/client/assets/ChatGptUsageButton-BldpBXxU.js +0 -2
- package/dist/client/assets/CheckboxIndicator-C4iAbUMh.js +0 -2
- package/dist/client/assets/ClippedText-TtLeyAVc.js +0 -2
- package/dist/client/assets/CodexSetupSection.logic-BO6ZAijp.js +0 -2
- package/dist/client/assets/ComboboxClear-CtNsa8Al.js +0 -2
- package/dist/client/assets/ComboboxGroupLabel-vQ7y8c50.js +0 -2
- package/dist/client/assets/CompositeRoot-CL7X20MU.js +0 -2
- package/dist/client/assets/ConnectAgentSurface-B_AYPHWs.js +0 -2
- package/dist/client/assets/DevicePanel-Cqexcbm2.js +0 -2
- package/dist/client/assets/DeviceSetup-Cdyw5Z9a.js +0 -2
- package/dist/client/assets/DialogTitle-CFYK6V6-.js +0 -2
- package/dist/client/assets/DiffPanel-CrswOKS6.js +0 -2
- package/dist/client/assets/EmbeddedDesign-Bdq5oAfI.js +0 -21
- package/dist/client/assets/FieldControl-95mCsa0m.js +0 -2
- package/dist/client/assets/FormContext-BcA1kdFD.js +0 -2
- package/dist/client/assets/Input-C9KIhPlP.js +0 -2
- package/dist/client/assets/JZOYTAAL-B8H2VC7A.js +0 -1
- package/dist/client/assets/KeybindingsSettings.logic-DwMUZYvv.js +0 -2
- package/dist/client/assets/LinkMachineSelect-BVNnYUBb.js +0 -2
- package/dist/client/assets/P4ConnectAccountPages-ChT866qO.js +0 -2
- package/dist/client/assets/PanelLayoutControls-DMUv135M.js +0 -216
- package/dist/client/assets/PierreEntryIcon-DLXDEcqA.js +0 -2
- package/dist/client/assets/PopoverHandle-D8JhsX32.js +0 -2
- package/dist/client/assets/PreviewPanel-D7YWnWZS.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-BZSw74tU.js +0 -2
- package/dist/client/assets/ProjectIconPickerDialog-7vur_TCX.js +0 -2
- package/dist/client/assets/ProviderModelPicker-af7MWLPO.js +0 -2
- package/dist/client/assets/ProviderSettingsForm-B4N4tsxv.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-B07M_QW4.js +0 -6
- package/dist/client/assets/RightPanelResizeHandle-BODMyZa6.js +0 -2
- package/dist/client/assets/ScheduledTasksSettings-BTi69FRq.js +0 -6
- package/dist/client/assets/ScrollAreaCorner-CsKGemsf.js +0 -2
- package/dist/client/assets/SelectScrollUpArrow-BMZtcPXM.js +0 -2
- package/dist/client/assets/SelfImproveSettingsSection-Dx6spJXh.js +0 -2
- package/dist/client/assets/SettingsPanels-DhuEF0_Y.js +0 -46
- package/dist/client/assets/SettingsPanels.logic-D5Fnq4gS.js +0 -2
- package/dist/client/assets/ThreadTerminalDrawer-CY2qHldP.js +0 -5
- package/dist/client/assets/TooltipProvider-Czzm7ro-.js +0 -2
- package/dist/client/assets/_chat-BeJoXsdK.js +0 -47
- package/dist/client/assets/_chat.design-AJz30uXq.js +0 -2
- package/dist/client/assets/_chat.new-IhhWgwNo.js +0 -4
- package/dist/client/assets/_chat.pull-requests-B84LUHIv.js +0 -2
- package/dist/client/assets/alert-D6MFRWZv.js +0 -2
- package/dist/client/assets/assets-Dh1LFwqL.js +0 -2
- package/dist/client/assets/browserHistoryStore-BVEWgOnh.js +0 -2
- package/dist/client/assets/combobox-5RzytEjd.js +0 -2
- package/dist/client/assets/connect-agent-B6pgZuy8.js +0 -2
- package/dist/client/assets/design-DSoix9e1.js +0 -2
- package/dist/client/assets/device-DQmQm4GC.js +0 -2
- package/dist/client/assets/dialog-DTVhbEqi.js +0 -2
- package/dist/client/assets/draft-input-BTetoXSt.js +0 -2
- package/dist/client/assets/duoViewer-DxmaOmHS.js +0 -2
- package/dist/client/assets/empty-B4h5DyMQ.js +0 -2
- package/dist/client/assets/entities-CWtNgawi.js +0 -2
- package/dist/client/assets/guideRunStore-CzF0q6A8.js +0 -2
- package/dist/client/assets/image-up-BN-uYqtM.js +0 -2
- package/dist/client/assets/input-group-BQ_2ox-w.js +0 -2
- package/dist/client/assets/keybindings-tgj8XFFz.js +0 -2
- package/dist/client/assets/main-B1sXOjZZ.js +0 -37
- package/dist/client/assets/main-CbkvDRKP.css +0 -2
- package/dist/client/assets/mediaSource-DfTsMdqm.js +0 -2
- package/dist/client/assets/number-field-xEi5ylvp.js +0 -2
- package/dist/client/assets/onboarding-CkdZxdNL.js +0 -2
- package/dist/client/assets/openFileInPreview-BHhDd-id.js +0 -2
- package/dist/client/assets/orbit-aOr6_vTe.js +0 -2
- package/dist/client/assets/p4ProjectFile-5VDI-yAx.js +0 -2
- package/dist/client/assets/pause-C-5l1Ug3.js +0 -2
- package/dist/client/assets/phoneViewer-C1aGY-h1.js +0 -2
- package/dist/client/assets/popover-BB2K1---.js +0 -2
- package/dist/client/assets/preview-B4_sjsUX.js +0 -2
- package/dist/client/assets/preview-DgXn94k5.js +0 -2
- package/dist/client/assets/previewMiniPlayerStore-DguWdL1f.js +0 -2
- package/dist/client/assets/primary-BDoRkJqU.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-Cc0Xobh6.js +0 -2
- package/dist/client/assets/projectFilesQueryState-BdfD5cZ2.js +0 -2
- package/dist/client/assets/projectScriptEditor-faOsFlds.js +0 -2
- package/dist/client/assets/providerSkills-C8PrnHb-.js +0 -2
- package/dist/client/assets/pullRequestDetail.logic-kOhR5jr9.js +0 -10
- package/dist/client/assets/pullRequests-Cf9E2kW-.js +0 -2
- package/dist/client/assets/queries-Cl508kPw.js +0 -2
- package/dist/client/assets/query-D3KVoW9G.js +0 -2
- package/dist/client/assets/radio-group-BnZVD-CO.js +0 -2
- package/dist/client/assets/relay-Do9UB5iT.js +0 -2
- package/dist/client/assets/renderScheduler-DsjkE3rh.js +0 -3833
- package/dist/client/assets/rightPanelStore-DB1OP4MT.js +0 -2
- package/dist/client/assets/runtime-BBYIQ0f-.js +0 -7
- package/dist/client/assets/select-Cz_1ByI4.js +0 -2
- package/dist/client/assets/selfImproveFindings-DtoTFNL_.js +0 -2
- package/dist/client/assets/server-Dkj4NeYG.js +0 -2
- package/dist/client/assets/session-CBEVNHld.js +0 -2
- package/dist/client/assets/session-logic-DB_ei-pn.js +0 -26
- package/dist/client/assets/settings.archived-CjdyCMyi.js +0 -2
- package/dist/client/assets/settings.computer-use-97ffp9C_.js +0 -2
- package/dist/client/assets/settings.connections-w3qKRKGa.js +0 -2
- package/dist/client/assets/settings.data-controls-C8ozSexu.js +0 -2
- package/dist/client/assets/settings.decisions-BvR3_OTv.js +0 -2
- package/dist/client/assets/settings.designs-CB8PWHwW.js +0 -2
- package/dist/client/assets/settings.diagnostics-DdInPrq0.js +0 -2
- package/dist/client/assets/settings.integrations-pj9KVvtd.js +0 -2
- package/dist/client/assets/settings.keybindings-3diGciV1.js +0 -2
- package/dist/client/assets/settings.plugins-DpaJJH_J.js +0 -5
- package/dist/client/assets/settings.projects-Bfh3CJ1a.js +0 -4
- package/dist/client/assets/settings.providers-DNiEeQYT.js +0 -3
- package/dist/client/assets/settings.secrets-BSNXem5A.js +0 -2
- package/dist/client/assets/settings.snap-shot-Ds0ywKhE.js +0 -2
- package/dist/client/assets/settings.source-control-C41AVNSm.js +0 -2
- package/dist/client/assets/settings.storage-B-Hm5vEC.js +0 -2
- package/dist/client/assets/settingsLayout-BbEwQ6Fy.js +0 -3
- package/dist/client/assets/sidebar-B70J7v16.js +0 -2
- package/dist/client/assets/skeleton-BavPX8IL.js +0 -2
- package/dist/client/assets/sourceControl-De64nxc-.js +0 -2
- package/dist/client/assets/sourceControlClients-BofXnV5S.js +0 -2
- package/dist/client/assets/spinner-BiCpg0TU.js +0 -2
- package/dist/client/assets/terminalSessions-BLnAzTpE.js +0 -2
- package/dist/client/assets/textarea-DPWqoJRQ.js +0 -2
- package/dist/client/assets/threadCheckpoints-C5aLz9nv.js +0 -2
- package/dist/client/assets/toggle-DERKSGyC.js +0 -2
- package/dist/client/assets/toggle-group-DYSJFIn3.js +0 -2
- package/dist/client/assets/usage-CtcqAwlu.js +0 -2
- package/dist/client/assets/usageAccess-2Wks5kIN.js +0 -2
- package/dist/client/assets/usageFormat-BZJ9qCn4.js +0 -2
- package/dist/client/assets/useHandleNewThread-C6MtV3AM.js +0 -2
- package/dist/client/assets/usePopupViewport-D1lXH2SQ.js +0 -2
- package/dist/client/assets/usePullRequestActions-WFmep5Tm.js +0 -3
- package/dist/client/assets/useRegisterFieldControl-BtJcyaxh.js +0 -2
- package/dist/client/assets/useSettings-EYJbJzT3.js +0 -3
- package/dist/client/assets/utils-DjbLtxuo.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-DkXoQApH.js +0 -2
- package/dist/client/assets/welcome-uKSqaFeK.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ds as i,Fl as a,Jo as o,Ku as s,Ol as c,Qn as l,Ts as u,Wo as d,Yd as f,Zn as p,Zo as m,_f as h,es as g,fr as _,hr as v,if as y,ls as b,mr as x,rp as S,rr as C,sr as w,t as T,tr as E,ws as D}from"./utils-CtzgibkN.js";import{Ba as O,Hc as k,Xc as A,Ys as j,hc as M,ic as N,na as P,sh as F,ua as I}from"./src-aYUfWMsw.js";import{Dr as L,Or as R,wr as z,xr as B}from"./runtime-DciS6GP9.js";import{a as V,c as H,o as ee,s as te,t as ne}from"./select--26O8gr7.js";import{t as re}from"./useNavigateBack-mLGu4w8K.js";import{rt as ie}from"./useSettings-CnHpxSBo.js";import{f as ae,s as oe}from"./server-DKB_3xTN.js";import{n as U,t as W}from"./session-D_OiLzln.js";import{t as se}from"./use-atom-command-Bfi4daMj.js";import{a as ce,c as le,d as G,f as K,i as ue,l as q,n as de,o as fe,r as J,s as Y,t as pe,u as me}from"./usageFormat-DvpnUmwI.js";import{t as he}from"./env-BfPir1X4.js";import{a as ge,n as _e,t as ve}from"./tooltip-DDv-MvO4.js";import{t as X}from"./skeleton-CfxEpnM8.js";import{n as ye,t as be}from"./toggle-group-BQBgK4Fh.js";import{t as xe}from"./input-BwujRX3Y.js";import{t as Se}from"./scroll-area-D7wKdOM7.js";import{a as Ce,c as we,i as Te,o as Ee,r as De,s as Oe,t as ke}from"./dialog-BJ3R7bWN.js";import{o as Ae}from"./sidebar-B2McbSnM.js";import{t as je}from"./observeResize-BxfFu2qN.js";import{y as Me}from"./keybindings-CCmLKtII.js";import{i as Ne,o as Pe,t as Fe}from"./popover-D2KZg7__.js";import{S as Ie,n as Le,t as Re}from"./ChatGptUsageButton-xIp-6pmC.js";import{t as ze}from"./WorkspacePageContainer-Bv3Si0zJ.js";import{n as Be,r as Ve,t as He}from"./usageShortcuts-BefcatkO.js";import{Hr as Ue,Na as We,Ur as Ge,Vr as Ke,Wo as qe,Wr as Je,ba as Ye,pi as Xe}from"./main-D8lKEPYS.js";import{t as Ze}from"./WorkspacePageHeader-D35ZiFO-.js";import{i as Qe,n as $e,r as et,t as tt}from"./WorkspaceBreadcrumb-wSY6JpgP.js";import{t as nt}from"./usageAccess-DGGNF6kP.js";var Z=e(t(),1),Q=n(),rt=k(R);function it(e,t){return e?.sources.some(e=>e.action===`enableCursorKeychain`)===!0&&t?.some(e=>e.driver===`cursor`&&e.status===`ready`)===!0}function at(e){return e.some(e=>e.summary?.sources.some(e=>e.fingerprint.provider===`cursor`&&e.fingerprint.hostId===`cursor.com`))?[]:e.filter(e=>e.needsCursorKeychainAccess)}function ot(e,t){return t===void 0?e:{...e,modelFilter:t}}var st=new Map,ct=new Map;async function lt(e,t,n=!1,r=!1){let i=ct.get(e);if(i!==void 0){if(r){try{await i}catch{}return lt(e,t,!1,!0)}return n?void 0:await i}let a=st.get(e)??0;if(n&&Date.now()<a)return;let o=Promise.resolve().then(t).finally(()=>{ct.delete(e),st.set(e,Date.now()+3e5)});return ct.set(e,o),await o}async function ut({registry:e,server:t,presentations:n,environmentIds:r,input:i}){await Promise.all(r.map(async r=>{let a=t.usageSummary({environmentId:r,input:ot(i,e.get(t.usageModelFilterAtom(r)))}),o=n.presentationAtom(r),s=new AbortController,c=()=>{e.get(o)?.connection.phase!==`connected`&&s.abort()},l=e.subscribe(o,c);c();try{let n=await z(e,t.refreshUsageRates,{environmentId:r,input:{}},{reportFailure:!1}),i=n._tag===`Failure`&&rt(L(n));if(e.refresh(a),i||s.signal.aborted)return;await B(e,a,{reportFailure:!1,signal:s.signal})}finally{l()}}))}function dt(e,t=!1){let{summary:n}=e;if(!e.isConnected||e.error!==null)return{phase:`inactive`};if(n===null)return{phase:`loading`};if(t)return{phase:`stale`};if(!e.isPending)return{phase:`ready`};let r=[...new Set(n.sources.flatMap(e=>e.refreshing?[e.fingerprint.provider]:[]))];return r.length>0?{phase:`partway`,providers:r}:{phase:`stale`}}function ft(e,t){return e.length===1?`Updating ${t(e[0])}…`:`Updating ${e.length} providers…`}function pt(e,t=!1){let n=new Set,r=!1;for(let i of e){let e=dt(i,t);if((e.phase===`loading`||e.phase===`stale`)&&(r=!0),e.phase===`partway`)for(let t of e.providers)n.add(t)}return{partial:r||n.size>0,everyProvider:r,providers:n}}function mt(e){return e.records>0&&e.unpricedRecords>=e.records}function ht(e){return[e.hostId,e.provider,e.resolvedHomePath,e.volumeId].join(` `)}function gt(e,t){let n=e.sources.filter(e=>e.fingerprint.provider===t.fingerprint.provider);return e.buckets.filter(e=>e.provider===t.fingerprint.provider&&(e.sourcePath===t.fingerprint.resolvedHomePath||e.sourcePath===void 0&&n.length===1))}function _t(e){return JSON.stringify([e.day,e.hourStart??null,e.provider,e.model])}function vt(e){let t=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=[],s=[...e].sort((e,t)=>(Date.parse(t.summary.readAt)||0)-(Date.parse(e.summary.readAt)||0)||e.environmentId.localeCompare(t.environmentId));for(let e of[`ok`,`partial`,`failed`])for(let r of s)for(let i of r.summary.sources){if(i.status!==e)continue;let s=ht(i.fingerprint);t.has(s)?o.push(`${r.label}: ${i.fingerprint.resolvedHomePath}`):(t.set(s,r.environmentId),n.set(s,{environment:r,source:i}),a.set(s,i.distinctSessions))}for(let e of s)for(let t of e.summary.sources){if(t.status!==`partial`)continue;let o=ht(t.fingerprint),s=n.get(o);if(s?.source.status!==`ok`||Date.parse(e.summary.readAt)<=Date.parse(s.environment.summary.readAt)||JSON.stringify(e.summary.modelFilter)!==JSON.stringify(s.environment.summary.modelFilter))continue;let c=r.get(o);c===void 0&&(c=new Set(gt(s.environment.summary,s.source).map(_t)),r.set(o,c));let l=i.get(e.environmentId)??new Set,u=!1;for(let n of gt(e.summary,t)){let e=_t(n);c.has(e)||(c.add(e),l.add(n),u=!0)}u&&(i.set(e.environmentId,l),a.set(o,Math.max(a.get(o)??0,t.distinctSessions)))}return{ownerByFingerprint:t,supplementalBucketsByEnvironment:i,sessionsByFingerprint:a,duplicates:o}}function yt(e,t,n,r){let i=new Set,a=new Set,o=new Map;for(let n of e.summary.sources){if(n.status===`missing`)continue;let s=ht(n.fingerprint);if(t.get(s)===e.environmentId){let e=n.fingerprint.provider;i.add(e),a.add(`${e}\u0000${n.fingerprint.resolvedHomePath}`),o.set(e,(o.get(e)??0)+(r.get(s)??n.distinctSessions))}}return{buckets:e.summary.buckets.filter(e=>n.has(e)||(e.sourcePath===void 0?i.has(e.provider):a.has(`${e.provider}\u0000${e.sourcePath}`))),sessionsByProvider:o}}function bt(e){return e.totals.uncachedInputTokens+e.totals.cachedInputTokens+e.totals.cacheCreationTokens+e.totals.outputTokens}function xt(e,t){return e>=4&&e<=t}var St={costUsd:0,uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,records:0,sessions:0,providers:[],models:[],daily:[],hourly:[],costQuality:{providerReportedShare:0,modelPricedShare:0,unpricedShare:0,cacheSavingsUsd:0},categoryCost:{input:0,cacheRead:0,cacheWrite:0,output:0,unsplit:0},speedCost:{standard:0,fast:0,ultrafast:0,premium:0},duplicateSources:[],contributingEnvironments:[],contractMismatches:[]};function Ct(e,t){if(e.length===0)return St;let n=[],r=[];for(let i of e)xt(i.summary.contractVersion,t)?n.push(i):r.push({environmentId:i.environmentId,direction:i.summary.contractVersion<t?`serverBehind`:`clientBehind`,contractVersion:i.summary.contractVersion});let{ownerByFingerprint:i,supplementalBucketsByEnvironment:a,sessionsByFingerprint:o,duplicates:s}=vt(n),c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y={input:0,cacheRead:0,cacheWrite:0,output:0},b={fast:0,ultrafast:0,premium:0},x=new Map,S=new Map,C=new Map,w=new Map,T=[];for(let e of n){let{buckets:t,sessionsByProvider:n}=yt(e,i,a.get(e.environmentId)??new Set,o);t.length>0&&T.push(e.environmentId);for(let[e,t]of n){if(h+=t,t===0)continue;let n=x.get(e)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.sessions+=t,x.set(e,n)}for(let e of t){let t=bt(e);c+=e.costUsd,g+=e.cacheSavingsUsd,l+=e.totals.uncachedInputTokens,u+=e.totals.cachedInputTokens,d+=e.totals.cacheCreationTokens,f+=e.totals.outputTokens,p+=e.totals.reasoningTokens,m+=e.records,v+=e.unpricedRecords,e.costSource===`providerReported`&&(_+=e.records),e.categoryCostUsd!==void 0&&(y.input+=e.categoryCostUsd.input,y.cacheRead+=e.categoryCostUsd.cacheRead,y.cacheWrite+=e.categoryCostUsd.cacheWrite,y.output+=e.categoryCostUsd.output),b.fast+=e.fastCostUsd??0,b.ultrafast+=e.ultrafastCostUsd??0,b.premium+=e.speedPremiumUsd??0;let n=x.get(e.provider)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.costUsd+=e.costUsd,n.totalTokens+=t,n.records+=e.records,x.set(e.provider,n);let r=`${e.provider} ${e.model}`,i=S.get(r)??{provider:e.provider,costUsd:0,totalTokens:0,tokens:{uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0},records:0,unpricedRecords:0,unpricedTokens:0};i.costUsd+=e.costUsd,i.totalTokens+=t,i.tokens={uncachedInputTokens:i.tokens.uncachedInputTokens+e.totals.uncachedInputTokens,cachedInputTokens:i.tokens.cachedInputTokens+e.totals.cachedInputTokens,cacheCreationTokens:i.tokens.cacheCreationTokens+e.totals.cacheCreationTokens,outputTokens:i.tokens.outputTokens+e.totals.outputTokens,reasoningTokens:i.tokens.reasoningTokens+e.totals.reasoningTokens},i.records+=e.records,i.unpricedRecords+=e.unpricedRecords,e.records>0&&(i.unpricedTokens+=t*e.unpricedRecords/e.records),S.set(r,i);let a=C.get(e.day)??{costUsd:0,totalTokens:0,byProvider:new Map};a.costUsd+=e.costUsd,a.totalTokens+=t;let o=a.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};if(o.costUsd+=e.costUsd,o.totalTokens+=t,a.byProvider.set(e.provider,o),C.set(e.day,a),e.hourStart!==void 0){let n=w.get(e.hourStart)??{day:e.day,hourStart:e.hourStart,costUsd:0,totalTokens:0,byProvider:new Map};n.costUsd+=e.costUsd,n.totalTokens+=t;let r=n.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};r.costUsd+=e.costUsd,r.totalTokens+=t,n.byProvider.set(e.provider,r),w.set(e.hourStart,n)}}}let E=l+u+d+f,D=[...x.entries()].map(([e,t])=>({provider:e,costUsd:t.costUsd,totalTokens:t.totalTokens,records:t.records,sessions:t.sessions,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd),O=[...S.entries()].map(([e,t])=>({model:e.slice(e.indexOf(` `)+1),provider:t.provider,costUsd:t.costUsd,totalTokens:t.totalTokens,tokens:t.tokens,records:t.records,unpricedRecords:t.unpricedRecords,unpricedTokens:t.unpricedTokens,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd||t.totalTokens-e.totalTokens),k=[...C.entries()].map(([e,t])=>({day:e,costUsd:t.costUsd,totalTokens:t.totalTokens,byProvider:t.byProvider})).sort((e,t)=>e.day.localeCompare(t.day)),A=[...w.values()].sort((e,t)=>e.hourStart.localeCompare(t.hourStart));return{costUsd:c,uncachedInputTokens:l,cachedInputTokens:u,cacheCreationTokens:d,outputTokens:f,reasoningTokens:p,totalTokens:E,records:m,sessions:h,providers:D,models:O,daily:k,hourly:A,costQuality:{providerReportedShare:m===0?0:_/m,unpricedShare:m===0?0:v/m,modelPricedShare:m===0?0:(m-_-v)/m,cacheSavingsUsd:g},categoryCost:{...y,unsplit:Math.max(0,c-y.input-y.cacheRead-y.cacheWrite-y.output)},speedCost:{...b,standard:Math.max(0,c-b.fast-b.ultrafast)},duplicateSources:s,contributingEnvironments:T,contractMismatches:r}}var wt=m(e=>g(t=>{let n=JSON.parse(e),r=t(ie.presentationsAtom),i=[];for(let[e,a]of r){let r=a.connection.phase===`connected`,o=t(W.sessionStateAtom(e)),s=nt({connectionPhase:a.connection.phase,session:F(D(o)),hasSessionError:o._tag===`Failure`});if(!s.canReadDiagnostics){i.push({environmentId:e,label:a.entry.target.label,isConnected:r,...s,summary:null,needsCursorKeychainAccess:!1});continue}let c=t(ae.usageSummary({environmentId:e,input:ot(n,t(ae.usageModelFilterAtom(e)))})),l=F(D(c));i.push({environmentId:e,label:a.entry.target.label,isPending:c.waiting,canReadDiagnostics:!0,isConnected:r,error:c._tag===`Failure`?`This environment could not report usage.`:null,summary:l,needsCursorKeychainAccess:it(l,t(ae.providersValueAtom(e)))})}return i}).pipe(b(`web-usage:window:${e}`)));function Tt(e,t){return Ct(e.flatMap(({environmentId:e,label:n,summary:r})=>r===null?[]:[{environmentId:e,label:n,summary:t===void 0?r:{...r,buckets:r.buckets.filter(t)}}]),6)}var Et=new Set;function Dt(e,t){return t.size===0?e:e.map(e=>e.summary===null?e:{...e,summary:{...e.summary,buckets:e.summary.buckets.filter(e=>!t.has(e.provider)),sources:e.summary.sources.filter(e=>!t.has(e.fingerprint.provider))}})}function Ot(e,t,n){let r=(0,Q.c)(36),i=t===void 0?null:t,a=n===void 0?Et:n,s;r[0]!==e.resolution||r[1]!==e.sinceDay||r[2]!==e.sinceTime||r[3]!==e.timeZone||r[4]!==e.untilDay||r[5]!==e.untilTime?(s=JSON.stringify({sinceDay:e.sinceDay,untilDay:e.untilDay,timeZone:e.timeZone,resolution:e.resolution,sinceTime:e.sinceTime,untilTime:e.untilTime}),r[0]=e.resolution,r[1]=e.sinceDay,r[2]=e.sinceTime,r[3]=e.timeZone,r[4]=e.untilDay,r[5]=e.untilTime,r[6]=s):s=r[6];let c=s,l;r[7]===c?l=r[8]:(l=wt(c),r[7]=c,r[8]=l);let u=o(l),f;r[9]!==u||r[10]!==i?(f=i===null?u:u.filter(e=>i.has(e.environmentId)),r[9]=u,r[10]=i,r[11]=f):f=r[11];let p=f,m;r[12]!==p||r[13]!==c?(m=e=>ut({registry:d,server:ae,presentations:ie,environmentIds:p.filter(Mt).map(jt),input:e??JSON.parse(c)}),r[12]=p,r[13]=c,r[14]=m):m=r[14];let h=m,g;r[15]!==a||r[16]!==p?(g=Tt(Dt(p,a)),r[15]=a,r[16]=p,r[17]=g):g=r[17];let _=g,v;r[18]===p?v=r[19]:(v=p.filter(At),r[18]=p,r[19]=v);let y=v.length,b;r[20]===p?b=r[21]:(b=p.filter(kt),r[20]=p,r[21]=b);let x=b.length,S=y===0&&x>0,[C,w]=(0,Z.useState)(null);y>0&&(C?.merged!==_||C.window!==e||C.selection!==i||C.hidden!==a)&&w({window:e,merged:_,selection:i,hidden:a});let T=C?.selection===i&&C.hidden===a?C:null,E;r[22]!==y||r[23]!==e||r[24]!==S||r[25]!==T||r[26]!==_?(E=y>0?{window:e,merged:_}:T??(S?null:{window:e,merged:_}),r[22]=y,r[23]=e,r[24]=S,r[25]=T,r[26]=_,r[27]=E):E=r[27];let D=E,O=y>0&&x>0,k;return r[28]!==u||r[29]!==S||r[30]!==_||r[31]!==h||r[32]!==p||r[33]!==D||r[34]!==O?(k={merged:_,environments:u,selectedEnvironments:p,isPending:S,shown:D,isPartial:O,refresh:h},r[28]=u,r[29]=S,r[30]=_,r[31]=h,r[32]=p,r[33]=D,r[34]=O,r[35]=k):k=r[35],k}function kt(e){return e.summary===null&&e.error===null}function At(e){return e.summary!==null}function jt(e){let{environmentId:t}=e;return t}function Mt(e){return e.canReadDiagnostics&&U(e.environmentId,`diagnostics:read`)}var $=e(r(),1);function Nt(e){let t=(0,Q.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=T(`w-full caption-bottom text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,$.jsx)(`table`,{"data-slot":`table`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pt(e){let t=(0,Q.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=T(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ft(e){let t=(0,Q.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=T(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function It(e){let t=(0,Q.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=T(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tr`,{"data-slot":`table-row`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Lt(e){let t=(0,Q.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=T(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`th`,{"data-slot":`table-head`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rt(e){let t=(0,Q.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=T(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var zt=[{key:`inputCostPerMillionTokens`,label:`Input`,optional:!1},{key:`outputCostPerMillionTokens`,label:`Output`,optional:!1},{key:`cacheReadCostPerMillionTokens`,label:`Cache read`,optional:!0},{key:`cacheWriteCostPerMillionTokens`,label:`Cache write`,optional:!0}];function Bt(e=``,t){return{model:e,inputCostPerMillionTokens:t?.inputCostPerMillionTokens.toString()??``,outputCostPerMillionTokens:t?.outputCostPerMillionTokens.toString()??``,cacheReadCostPerMillionTokens:t?.cacheReadCostPerMillionTokens?.toString()??``,cacheWriteCostPerMillionTokens:t?.cacheWriteCostPerMillionTokens?.toString()??``}}function Vt(e){let t=e.model.trim();if(t.length===0)return null;let n={};for(let t of zt){let r=e[t.key].trim().replace(`,`,`.`);if(r===``){if(t.optional)continue;return null}if(!/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(r))return null;let i=Number(r);if(!Number.isFinite(i)||i<0)return null;n[t.key]=i}return n.inputCostPerMillionTokens===void 0||n.outputCostPerMillionTokens===void 0?null:{model:t,price:{inputCostPerMillionTokens:n.inputCostPerMillionTokens,outputCostPerMillionTokens:n.outputCostPerMillionTokens,...n.cacheReadCostPerMillionTokens===void 0?{}:{cacheReadCostPerMillionTokens:n.cacheReadCostPerMillionTokens},...n.cacheWriteCostPerMillionTokens===void 0?{}:{cacheWriteCostPerMillionTokens:n.cacheWriteCostPerMillionTokens}}}}function Ht(e){return e.isNew&&e.model.trim()===``&&(e.alias??``).trim()===``&&Object.values(e.values).every(e=>e.trim()===``)}function Ut(e,t){return e.prices&&Object.hasOwn(e.prices,t)?e.prices[t]:void 0}function Wt(e,t){return e.aliases&&Object.hasOwn(e.aliases,t)?e.aliases[t]:void 0}function Gt(e,t){if(e.some(e=>e.aliases===null))return{value:``,placeholder:`Unavailable`};let n=e.map(e=>Wt(e,t)??``);return n.some(e=>e!==n[0])?{value:``,placeholder:`Mixed`}:{value:n[0]??``,placeholder:`None`}}function Kt(e,t,n){let r=zt.find(e=>e.key===n).optional,i=e.map(e=>Ut(e,t)?Bt(t,Ut(e,t))[n]:null);return e.some(e=>e.prices===null)?{value:``,placeholder:`Unavailable`}:i.some(e=>e!==i[0])?{value:``,placeholder:`Mixed`}:{value:i[0]??``,placeholder:i[0]===null?`Automatic`:r?`Input rate`:`0.00`}}function qt(e,t){let n=[],r=new Map;for(let i of t){if(Ht(i))continue;let t=i.model.trim(),a=Wt(e,t);if(i.removed){Ut(e,t)&&n.push({model:t,price:null}),a!==void 0&&n.push({model:t,alias:null});continue}let o=(i.alias??a??``).trim();if(o!==``){if(i.alias===void 0&&Object.keys(i.values).length>0){r.set(i.id,`${e.label} maps this model. Remove it from "Apply to" or clear its mapping first.`);continue}t===``?r.set(i.id,`Enter a model ID.`):o===t?r.set(i.id,`Map to a different model.`):(o!==a&&n.push({model:t,alias:o}),Ut(e,t)&&n.push({model:t,price:null}));continue}if(a!==void 0&&(n.push({model:t,alias:null}),!Ut(e,t)&&Object.values(i.values).every(e=>e.trim()===``)))continue;let s=Bt(t,Ut(e,t)),c={...s,...i.values},l=Vt(c);if(l===null){let n=zt.find(e=>!e.optional&&c[e.key].trim()===``);r.set(i.id,t===``?`Enter a model ID.`:n?`${n.label} is required on ${e.label}.`:`Use non-negative numbers for prices.`);continue}let u=Bt(t,l.price);zt.some(e=>s[e.key]!==u[e.key])&&n.push(l)}let i=new Map(Object.entries(e.aliases??{}));for(let e of n)`alias`in e&&(e.alias===null?i.delete(e.model):i.set(e.model,e.alias));for(let n of t){if(n.removed||r.has(n.id))continue;let t=n.model.trim(),a=new Set;for(;i.has(t);){if(a.has(t)){r.set(n.id,`Model mappings cannot form a cycle on ${e.label}.`);break}a.add(t),t=i.get(t)}}return{changes:n,errors:r}}function Jt(e,t){return new Map(e.filter(e=>e.unavailable===null&&e.prices!==null).flatMap(e=>[...qt(e,t).errors]))}async function Yt(e){await Promise.all(e.targets.map(async t=>{let n,r=e.changes.get(t.environmentId)??[],i=r.flatMap(e=>`price`in e?[[e.model,e.price]]:[]),a=r.flatMap(e=>`alias`in e?[[e.model,e.alias]]:[]);if(t.unavailable!==null)n={status:`failed`,error:t.unavailable};else if(a.length>0&&t.aliases===null)n={status:`failed`,error:`Update server to map models`};else try{n=(r.length===0?{_tag:`Success`}:await e.write({environmentId:t.environmentId,input:{patch:{...i.length>0?{usagePriceOverrides:Object.fromEntries(i)}:{},...a.length>0?{usageModelAliases:Object.fromEntries(a)}:{}}}}))._tag===`Success`?{status:`saved`}:{status:`failed`,error:`Could not save. Try again.`}}catch{n={status:`failed`,error:`Could not save. Try again.`}}e.onResult(t.environmentId,n)}))}var Xt=g(e=>[...e(ie.presentationsAtom)].map(([t,n])=>{let r=e(ae.settingsValueAtom(t)),i=e(W.sessionStateAtom(t)),a=F(D(i)),o=i._tag===`Failure`?`denied`:a===null?i.waiting?`pending`:`denied`:O(a,`settings:write`)?`granted`:`denied`;return{environmentId:t,label:n.entry.target.label,prices:r?.usagePriceOverrides??null,aliases:n.serverConfig?.environment.capabilities.usageModelAliases===!0?r?.usageModelAliases??null:null,unavailable:n.connection.phase===`connected`?r===null?`Prices not loaded`:n.serverConfig?.environment.capabilities.usagePriceOverrides===!0?o===`pending`?`Checking permissions…`:o===`denied`?`Read-only access`:null:`Update server to edit prices`:`Offline`}}));function Zt(e){let t=(0,Q.c)(119),{usage:n,initialSelectedEnvironmentIds:r,initialModel:i,onOpenChange:a}=e,s=o(Xt),[u,d]=(0,Z.useState)(r),m;if(t[0]!==s||t[1]!==u){let e;t[3]===u?e=t[4]:(e=e=>u===null||u.has(e.environmentId),t[3]=u,t[4]=e),m=s.filter(e),t[0]=s,t[1]=u,t[2]=m}else m=t[2];let h=m,g;t[5]!==i||t[6]!==h?(g=()=>i===void 0||h.some(e=>Object.hasOwn(e.prices??{},i)||Object.hasOwn(e.aliases??{},i))?[]:[{id:`new:initial`,model:i,isNew:!0,values:{}}],t[5]=i,t[6]=h,t[7]=g):g=t[7];let[v,b]=(0,Z.useState)(g),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(null),A=(0,Z.useRef)(null),j=(0,Z.useRef)(0),M;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(M={reportFailure:!1},t[8]=M):M=t[8];let N=se(ae.updateSettings,M),P,F,I,L,R,z,B,V,H,ee,te,ne,re,ie,oe;if(t[9]!==O||t[10]!==v||t[11]!==s||t[12]!==a||t[13]!==E||t[14]!==h||t[15]!==u||t[16]!==N||t[17]!==n){let e=[...new Set(h.flatMap(hn))].sort(),r;t[33]===h?r=t[34]:(r=e=>h.some(t=>t.environmentId===e.environmentId),t[33]=h,t[34]=r);let i=[...new Set([...e,...n.filter(r).flatMap(pn)])].sort(),o;t[35]===v?o=t[36]:(o=new Set(v.filter(fn).map(dn)),t[35]=v,t[36]=o);let m=o,g;t[37]!==O||t[38]!==m?(g=e=>O===null||!m.has(e),t[37]=O,t[38]=m,t[39]=g):g=t[39];let M=[...e.filter(g).map(e=>v.find(t=>t.id===`model:${e}`)??{id:`model:${e}`,model:e,isNew:!1,values:{}}),...v.filter(un)],ae=v.filter(ln);z=Jt(h,ae);for(let t of ae)t.isNew&&(t.model.trim()===``?z.set(t.id,`Enter a model ID.`):O===null&&(e.includes(t.model.trim())||v.some(e=>e.id!==t.id&&e.model.trim()===t.model.trim()))&&z.set(t.id,`This model already has a row. Edit its prices there.`));B=O?.destinations.filter(e=>O.results.get(e.environmentId)?.status===`failed`)??[];let W=E||B.length>0;V=ae.length>0,L=h.length===1?h[0].label:`${h.length} environments`;let se=u===null?`All environments`:L,ce;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>{b([]),k(null)},t[40]=ce):ce=t[40],R=ce;let le;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{d(e),k(null)},t[41]=le):le=t[41];let G=le,K;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>{b(t=>t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),k(null)},t[42]=K):K=t[42];let ue=K,q=cn,de;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{!e.isNew&&Object.keys(e.values).length===0&&e.alias===void 0?b(t=>t.filter(t=>t.id!==e.id)):ue(e)},t[43]=de):de=t[43];let fe=de,J;t[44]===h?J=t[45]:(J=(e,t,n)=>{let r={...e.values,[t]:n},i=Kt(h,e.model,t);q(e,i,n)&&delete r[t],fe({...e,values:r})},t[44]=h,t[45]=J);let Y=J,pe;t[46]===h?pe=t[47]:(pe=(e,t)=>{let{alias:n,...r}=e,i=Gt(h,e.model);fe(q(e,i,t)?r:{...r,alias:t})},t[46]=h,t[47]=pe);let me=pe;H=async e=>{let t=e!==void 0&&e;if(E)return;let n=t?B:h,r=t&&O?O.drafts:ae;if(n.length===0||r.length===0)return;let i=n.map(e=>s.find(t=>t.environmentId===e.environmentId)??{...e,prices:null,aliases:null,unavailable:`Environment removed`}),a=new Map(i.map(e=>[e.environmentId,qt(e,r)]));D(!0),k(e=>({drafts:r,destinations:t&&e?e.destinations:i,results:new Map([...t&&e?e.results:[],...i.map(sn)])}));let o=!1;await Yt({targets:i.map(e=>({...e,unavailable:e.unavailable??[...a.get(e.environmentId).errors.values()][0]??null})),changes:new Map([...a].map(on)),write:async e=>U(e.environmentId,`settings:write`)?N(e):{_tag:`Failure`},onResult:(e,t)=>{t.status===`failed`&&(o=!0),k(n=>n===null?null:{...n,results:new Map(n.results).set(e,t)})}}),D(!1),o||b([])},I=ke,ie=!0,t[48]!==a||t[49]!==E?(oe=e=>{E||a(e)},t[48]=a,t[49]=E,t[50]=oe):oe=t[50],F=Oe,ne=`max-w-4xl`,t[51]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsxs)(Ce,{children:[(0,$.jsx)(we,{children:`Custom model prices`}),(0,$.jsx)(De,{children:`Prices and mappings apply to all past and future usage on the environments you select.`})]}),t[51]=re):re=t[51],P=Ee;let he;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,$.jsx)(Ye,{id:`usage-prices-apply-label`,className:`shrink-0`,children:`Apply to`}),t[52]=he):he=t[52];let X;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(x,{variant:`outline`,size:`sm`,className:`min-w-0`}),t[53]=X):X=t[53];let ye=E||V,be;t[54]===se?be=t[55]:(be=(0,$.jsx)(`span`,{id:`usage-prices-selection`,className:`truncate`,children:se}),t[54]=se,t[55]=be);let Se;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,$.jsx)(c,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[56]=Se):Se=t[56];let Te;t[57]!==ye||t[58]!==be?(Te=(0,$.jsxs)(_,{render:X,"aria-labelledby":`usage-prices-apply-label usage-prices-selection`,disabled:ye,children:[be,Se]}),t[57]=ye,t[58]=be,t[59]=Te):Te=t[59];let Ae=u===null,je;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(je=e=>G(e?null:new Set),t[60]=je):je=t[60];let Me;t[61]===Ae?Me=t[62]:(Me=(0,$.jsx)(l,{checked:Ae,closeOnClick:!1,onCheckedChange:je,children:`All environments`}),t[61]=Ae,t[62]=Me);let Ne;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,$.jsx)(w,{}),t[63]=Ne):Ne=t[63];let Pe;if(t[64]!==s||t[65]!==h||t[66]!==u){let e;t[68]!==s.length||t[69]!==h||t[70]!==u?(e=e=>(0,$.jsx)(l,{checked:u===null||u.has(e.environmentId),closeOnClick:!1,onCheckedChange:t=>{let n=new Set(h.map(an));t?n.add(e.environmentId):n.delete(e.environmentId),G(n.size===s.length?null:n)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.unavailable?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.unavailable}):null]})},e.environmentId),t[68]=s.length,t[69]=h,t[70]=u,t[71]=e):e=t[71],Pe=s.map(e),t[64]=s,t[65]=h,t[66]=u,t[67]=Pe}else Pe=t[67];let Fe;t[72]!==Me||t[73]!==Pe?(Fe=(0,$.jsxs)(C,{align:`start`,children:[Me,Ne,Pe]}),t[72]=Me,t[73]=Pe,t[74]=Fe):Fe=t[74];let Ie;t[75]!==Te||t[76]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[he,(0,$.jsxs)(p,{children:[Te,Fe]})]}),t[75]=Te,t[76]=Fe,t[77]=Ie):Ie=t[77];let Le;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`USD / million tokens`}),t[78]=Le):Le=t[78],t[79]===Ie?ee=t[80]:(ee=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[Ie,Le]}),t[79]=Ie,t[80]=ee),te=h.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s.length===0?`Connect an environment to set model prices.`:`Select an environment to see and change its model prices.`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border`,children:(0,$.jsxs)(Nt,{className:`min-w-180 table-fixed`,"aria-label":`Custom model prices`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-[22%]`}),(0,$.jsx)(`col`,{className:`w-[18%]`}),zt.map(rn),(0,$.jsx)(`col`,{className:`w-10`})]}),(0,$.jsx)(Pt,{children:(0,$.jsxs)(It,{children:[(0,$.jsx)(Lt,{children:`Model ID`}),(0,$.jsx)(Lt,{children:`Map to`}),zt.map(nn),(0,$.jsx)(Lt,{children:(0,$.jsx)(x,{size:`icon-xs`,variant:`ghost`,"aria-label":`Add model price`,disabled:W,onClick:()=>{j.current+=1;let e=`new:${j.current}`;A.current=e,ue({id:e,model:``,isNew:!0,values:{}})},children:(0,$.jsx)(f,{"aria-hidden":!0})})})]})}),(0,$.jsx)(Ft,{children:M.length===0?(0,$.jsx)(It,{children:(0,$.jsx)(Rt,{colSpan:7,className:`text-center whitespace-normal`,children:(0,$.jsx)(`p`,{className:`py-6 text-muted-foreground`,children:h.some(tn)?`Some environment prices are unavailable.`:`No custom prices or mappings. Add a row to set one.`})})}):M.map(e=>{let t=Gt(h,e.model),n=(e.alias??t.value).trim();return(0,$.jsxs)(It,{"data-row-id":e.id,children:[(0,$.jsxs)(Rt,{className:`whitespace-normal`,children:[e.isNew?(0,$.jsx)(xe,{size:`compact`,value:e.model,ref:t=>{t&&A.current===e.id&&(t.focus(),A.current=null)},"aria-label":`New model ID`,"aria-invalid":e.model.trim()!==``&&z.has(e.id)||void 0,list:`usage-price-models`,placeholder:`Model ID`,autoComplete:`off`,spellCheck:!1,disabled:W,onChange:t=>ue({...e,model:t.target.value})}):(0,$.jsx)(`span`,{className:T(`block break-all`,e.removed&&`text-muted-foreground line-through`),children:e.model}),z.has(e.id)&&(e.model.trim()!==``||Object.values(e.values).some(en))?(0,$.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-destructive`,children:z.get(e.id)}):null]}),e.removed?(0,$.jsx)(Rt,{colSpan:5,children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Automatic pricing after saving`})}):(0,$.jsx)(Rt,{children:(0,$.jsx)(xe,{size:`compact`,value:e.alias??t.value,"aria-label":`Map ${e.model||`new model`} to model`,list:`usage-alias-models`,placeholder:e.isNew?`Optional`:t.placeholder,autoComplete:`off`,spellCheck:!1,disabled:W,onChange:t=>me(e,t.target.value)})}),e.removed?null:n===``?zt.map(t=>{let n=Kt(h,e.model,t.key);return(0,$.jsx)(Rt,{children:(0,$.jsx)(xe,{size:`compact`,inputMode:`decimal`,"aria-label":`${t.label} price for ${e.model||`new model`}`,value:e.values[t.key]??(e.isNew?``:n.value),placeholder:e.isNew?t.optional?`Input rate`:`0.00`:n.placeholder,autoComplete:`off`,disabled:W,font:`mono`,onChange:n=>Y(e,t.key,n.target.value)})},t.key)}):(0,$.jsx)(Rt,{colSpan:4,className:`whitespace-normal`,children:(0,$.jsxs)(`span`,{className:`break-all text-muted-foreground`,children:[`Counted as `,n]})}),(0,$.jsx)(Rt,{children:(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(x,{size:`icon-xs`,variant:`ghost`}),disabled:W,"aria-label":e.removed?`Undo reset for ${e.model}`:e.isNew?`Remove new model`:`Reset price for ${e.model} to automatic`,onClick:()=>{e.isNew?b(t=>t.filter(t=>t.id!==e.id)):e.removed?fe({...e,removed:!1}):ue({...e,removed:!0})},children:e.isNew?(0,$.jsx)(S,{"aria-hidden":!0}):(0,$.jsx)(y,{"aria-hidden":!0})}),(0,$.jsx)(_e,{children:e.removed?`Undo reset`:e.isNew?`Remove row`:`Reset to automatic`})]})})]},e.id)})})]})}),(0,$.jsx)(`datalist`,{id:`usage-price-models`,children:i.filter(t=>!e.includes(t)).map($t)}),(0,$.jsx)(`datalist`,{id:`usage-alias-models`,children:i.filter(e=>h.every(t=>!Object.hasOwn(t.aliases??{},e))).map(Qt)}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Blank cache rates use the input price. Enter 0 for free tokens. A mapped model’s usage counts as the model it maps to.`,h.length>1?` Mixed cells keep each environment’s rate until you edit them.`:``]})]}),t[9]=O,t[10]=v,t[11]=s,t[12]=a,t[13]=E,t[14]=h,t[15]=u,t[16]=N,t[17]=n,t[18]=P,t[19]=F,t[20]=I,t[21]=L,t[22]=R,t[23]=z,t[24]=B,t[25]=V,t[26]=H,t[27]=ee,t[28]=te,t[29]=ne,t[30]=re,t[31]=ie,t[32]=oe}else P=t[18],F=t[19],I=t[20],L=t[21],R=t[22],z=t[23],B=t[24],V=t[25],H=t[26],ee=t[27],te=t[28],ne=t[29],re=t[30],ie=t[31],oe=t[32];let W;t[81]===O?W=t[82]:(W=O?(0,$.jsx)(`div`,{role:`status`,className:`grid gap-1 text-xs`,children:O.destinations.map(e=>{let t=O.results.get(e.environmentId);return(0,$.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:t?.status===`failed`?`text-right text-destructive`:`text-muted-foreground`,children:t?.status===`failed`?`Not saved · ${t.error}`:t?.status===`saved`?`Saved`:`Saving…`})]},e.environmentId)})}):null,t[81]=O,t[82]=W);let ce;t[83]!==P||t[84]!==W||t[85]!==ee||t[86]!==te?(ce=(0,$.jsxs)(P,{children:[ee,te,W]}),t[83]=P,t[84]=W,t[85]=ee,t[86]=te,t[87]=ce):ce=t[87];let le=V?`Changes apply to ${L}`:``,G;t[88]===le?G=t[89]:(G=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:le}),t[88]=le,t[89]=G);let K;t[90]!==R||t[91]!==B.length||t[92]!==V||t[93]!==E?(K=V?(0,$.jsx)(x,{variant:`ghost`,disabled:E,onClick:R,children:B.length>0?`Discard pending changes`:`Discard changes`}):null,t[90]=R,t[91]=B.length,t[92]=V,t[93]=E,t[94]=K):K=t[94];let ue=E||!V&&B.length===0||B.length===0&&(z.size>0||h.length===0),q;t[95]!==B.length||t[96]!==H?(q=()=>void H(B.length>0),t[95]=B.length,t[96]=H,t[97]=q):q=t[97];let de=E?`Saving…`:B.length>0?`Retry failed saves`:`Save changes`,fe;t[98]!==ue||t[99]!==q||t[100]!==de?(fe=(0,$.jsx)(x,{disabled:ue,onClick:q,children:de}),t[98]=ue,t[99]=q,t[100]=de,t[101]=fe):fe=t[101];let J;t[102]!==K||t[103]!==fe?(J=(0,$.jsxs)(`div`,{className:`flex w-full flex-wrap justify-end gap-2 sm:w-auto`,children:[K,fe]}),t[102]=K,t[103]=fe,t[104]=J):J=t[104];let Y;t[105]!==G||t[106]!==J?(Y=(0,$.jsxs)(Te,{variant:`bare`,className:`items-center sm:justify-between`,children:[G,J]}),t[105]=G,t[106]=J,t[107]=Y):Y=t[107];let pe;t[108]!==F||t[109]!==ce||t[110]!==Y||t[111]!==ne||t[112]!==re?(pe=(0,$.jsxs)(F,{className:ne,children:[re,ce,Y]}),t[108]=F,t[109]=ce,t[110]=Y,t[111]=ne,t[112]=re,t[113]=pe):pe=t[113];let me;return t[114]!==I||t[115]!==pe||t[116]!==ie||t[117]!==oe?(me=(0,$.jsx)(I,{open:ie,onOpenChange:oe,children:pe}),t[114]=I,t[115]=pe,t[116]=ie,t[117]=oe,t[118]=me):me=t[118],me}function Qt(e){return(0,$.jsx)(`option`,{value:e},e)}function $t(e){return(0,$.jsx)(`option`,{value:e},e)}function en(e){return e!==``}function tn(e){return e.prices===null}function nn(e){return(0,$.jsx)(Lt,{children:e.label},e.key)}function rn(e){return(0,$.jsx)(`col`,{},e.key)}function an(e){return e.environmentId}function on(e){let[t,n]=e;return[t,n.changes]}function sn(e){return[e.environmentId,{status:`saving`}]}function cn(e,t,n){return!e.isNew&&t.placeholder!==`Mixed`&&t.placeholder!==`Unavailable`&&n===t.value}function ln(e){return!Ht(e)}function un(e){return e.isNew}function dn(e){return e.model.trim()}function fn(e){return e.isNew}function pn(e){return e.summary?.buckets.map(mn)??[]}function mn(e){return e.model}function hn(e){return[...Object.keys(e.prices??{}),...Object.keys(e.aliases??{})]}var gn=960,_n=260,vn=4,yn=8,bn=new Set;function xn(e,t,n){let r=e?.byProvider.get(t);return r===void 0?0:n===`tokens`?r.totalTokens:r.costUsd}function Sn(e,t,n){return e.map(e=>{let r=t.get(e),i=Ue.map(e=>({provider:e,value:xn(r,e,n)}));return{bands:i,total:i.reduce((e,t)=>e+t.value,0)}})}function Cn(e){let t=e.length;if(t<2)return[0];let n=[];for(let r=0;r<t-1;r+=1){let t=(e[r+1]?.x??0)-(e[r]?.x??0),i=(e[r+1]?.y??0)-(e[r]?.y??0);n.push(t===0?0:i/t)}let r=Array.from({length:t},()=>0);r[0]=n[0]??0,r[t-1]=n[t-2]??0;for(let e=1;e<t-1;e+=1){let t=n[e-1]??0,i=n[e]??0;r[e]=t*i<=0?0:(t+i)/2}for(let e=0;e<t-1;e+=1){let t=n[e]??0;if(t===0){r[e]=0,r[e+1]=0;continue}let i=(r[e]??0)/t,a=(r[e+1]??0)/t,o=i*i+a*a;if(o>9){let n=3/Math.sqrt(o);r[e]=n*i*t,r[e+1]=n*a*t}}return r}function wn(e){if(e.length<2)return[];let t=Cn(e),n=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],a=e[r+1];if(i===void 0||a===void 0)continue;let o=a.x-i.x;n.push({from:i,c1:{x:i.x+o/3,y:i.y+(t[r]??0)*o/3},c2:{x:a.x-o/3,y:a.y-(t[r+1]??0)*o/3},to:a})}return n}function Tn(e){let t=e[0];if(t===void 0)return``;let n=`M${t.from.x.toFixed(2)},${t.from.y.toFixed(2)}`;for(let t of e)n+=` C${t.c1.x.toFixed(2)},${t.c1.y.toFixed(2)} ${t.c2.x.toFixed(2)},${t.c2.y.toFixed(2)} ${t.to.x.toFixed(2)},${t.to.y.toFixed(2)}`;return n}function En(e){return e===``?``:`${e} L${gn},${_n} L0,${_n} Z`}function Dn(e,t){if(e<=0)return{max:0,ticks:[0]};let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r,a=(i>5?10:i>2?5:i>1?2:1)*r,o=Math.ceil(e/a)*a,s=[];for(let e=0;e<=o+a*1e-6;e+=a)s.push(e);return{max:o,ticks:s}}var On=Array.from({length:5},(e,t)=>t);function kn(e,t){let n=e.reduce((e,t)=>t.bands.reduce((e,t)=>Math.max(e,t.value),e),0);return n===0&&t.size>0?{max:vn,ticks:On,labeled:!1}:{...Dn(n,vn),labeled:!0}}function An(e,t){return t===0?_n:_n-e/t*252}function jn(e,t,n,r,i){let a=Sn(e,t,n),o=kn(a,i),s=e.length<2?0:gn/(e.length-1);return{columns:a,scale:o,stepX:s,paths:r.map(e=>{let t=Ue.indexOf(e),n=Tn(wn(a.map((e,n)=>({x:n*s,y:An(e.bands[t]?.value??0,o.max)}))));return{provider:e,loading:i.has(e),total:a.reduce((e,n)=>e+(n.bands[t]?.value??0),0),line:n,area:En(n)}}).toSorted((e,t)=>t.total-e.total)}}function Mn(e){let t=(0,Q.c)(97),{providers:n,loadingProviders:r,days:i,daily:a,hours:o,hourly:s,metric:c,referenceTime:l,resolution:u,timeZone:d}=e,f=r===void 0?bn:r,p=u===`hour`?o:i,m;t[0]!==a||t[1]!==s||t[2]!==u?(m=u===`hour`?new Map(s.map(Fn)):new Map(a.map(Pn)),t[0]=a,t[1]=s,t[2]=u,t[3]=m):m=t[3];let h=m,[g,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x;t[4]!==h||t[5]!==f||t[6]!==c||t[7]!==p||t[8]!==n?(x=jn(p,h,c,n,f),t[4]=h,t[5]=f,t[6]=c,t[7]=p,t[8]=n,t[9]=x):x=t[9];let{columns:S,scale:C,paths:w,stepX:E}=x,D;t[10]===C.max?D=t[11]:(D=e=>An(e,C.max),t[10]=C.max,t[11]=D);let O=D,k=Nn,A=c===`tokens`?q:G,j;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{let e=v.current,t=y.current,n=b.current;if(e===null||t===null||n===null)return;let r=t.offsetWidth,i=t.offsetHeight,a=e.clientWidth,o=e.clientHeight,s=n.x+12+r<=a?n.x+12:n.x-12-r,c=n.y+12+i<=o?n.y+12:n.y-12-i,l=Math.min(Math.max(0,s),Math.max(0,a-r)),u=Math.min(Math.max(0,c),Math.max(0,o-i));e.style.setProperty(`--usage-tooltip-left`,`${l}px`),e.style.setProperty(`--usage-tooltip-top`,`${u}px`)},t[12]=j):j=t[12];let M=j,N,P;t[13]===g?(N=t[14],P=t[15]):(N=()=>{if(g===null)return;M();let e=v.current,t=y.current;if(e!==null&&t!==null)return je([e,t],M)},P=[g,M],t[13]=g,t[14]=N,t[15]=P),(0,Z.useLayoutEffect)(N,P);let F;t[16]===p.length?F=t[17]:(F=e=>{let t=v.current;if(t===null||p.length===0)return;let n=t.getBoundingClientRect();if(n.width===0)return;let r=Math.min(n.width,Math.max(0,e.clientX-n.left)),i=Math.min(n.height,Math.max(0,e.clientY-n.top)),a=r/n.width,o=Math.round(a*(p.length-1));b.current={x:r,y:i},M(),_(Math.min(p.length-1,Math.max(0,o)))},t[16]=p.length,t[17]=F);let I=F,L=g===null?void 0:p[g],R=g===null?void 0:S[g],z;if(t[18]!==f||t[19]!==n){let e;t[21]===f?e=t[22]:(e=e=>f.has(e),t[21]=f,t[22]=e),z=n.some(e),t[18]=f,t[19]=n,t[20]=z}else z=t[20];let B=z,V;t[23]!==u||t[24]!==d?(V=e=>u===`hour`?fe(e,d):ce(e),t[23]=u,t[24]=d,t[25]=V):V=t[25];let H=V,ee;t[26]!==H||t[27]!==l||t[28]!==u||t[29]!==d?(ee=e=>u===`hour`&&l!==void 0?le(e,l,d):H(e),t[26]=H,t[27]=l,t[28]=u,t[29]=d,t[30]=ee):ee=t[30];let te=ee,ne;t[31]!==A||t[32]!==C.labeled||t[33]!==C.ticks||t[34]!==O?(ne=C.labeled?C.ticks.map(e=>(0,$.jsx)(`span`,{className:`absolute right-0 -translate-y-1/2 text-3xs text-muted-foreground tabular-nums`,style:{top:`${O(e)/_n*100}%`},children:e===0?`0`:A(e)},e)):null,t[31]=A,t[32]=C.labeled,t[33]=C.ticks,t[34]=O,t[35]=ne):ne=t[35];let re;t[36]===ne?re=t[37]:(re=(0,$.jsx)(`div`,{className:`relative h-56 w-14 shrink-0`,children:ne}),t[36]=ne,t[37]=re);let ie;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{b.current=null,_(null)},t[38]=ie):ie=t[38];let ae=`${u===`hour`?`Hourly`:`Daily`} ${c===`tokens`?`processed tokens`:`cost`} by provider`,oe;if(t[39]!==C.ticks||t[40]!==O){let e;t[42]===O?e=t[43]:(e=e=>{let t=O(e);return(0,$.jsx)(`line`,{x1:0,x2:gn,y1:t,y2:t,stroke:`currentColor`,strokeWidth:1,className:`text-border`,vectorEffect:`non-scaling-stroke`},e)},t[42]=O,t[43]=e),oe=C.ticks.map(e),t[39]=C.ticks,t[40]=O,t[41]=oe}else oe=t[41];let U;if(t[44]!==w){let e;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,area:r}=e;return(0,$.jsx)(`path`,{d:r,className:k(n),fill:Ge[t].color,fillOpacity:.12},t)},t[46]=e):e=t[46],U=w.map(e),t[44]=w,t[45]=U}else U=t[45];let W;if(t[47]!==w){let e;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,line:r}=e;return(0,$.jsx)(`path`,{d:r,className:k(n),fill:`none`,stroke:Ge[t].color,strokeWidth:2,vectorEffect:`non-scaling-stroke`},t)},t[49]=e):e=t[49],W=w.map(e),t[47]=w,t[48]=W}else W=t[48];let se;t[50]!==g||t[51]!==E?(se=g===null?null:(0,$.jsx)(`line`,{x1:g*E,x2:g*E,y1:yn,y2:_n,stroke:`currentColor`,strokeWidth:1,className:`text-muted-foreground`,vectorEffect:`non-scaling-stroke`}),t[50]=g,t[51]=E,t[52]=se):se=t[52];let K;t[53]!==ae||t[54]!==oe||t[55]!==U||t[56]!==W||t[57]!==se?(K=(0,$.jsxs)(`svg`,{className:`h-full w-full`,viewBox:`0 0 ${gn} ${_n}`,preserveAspectRatio:`none`,role:`img`,"aria-label":ae,children:[oe,U,W,se]}),t[53]=ae,t[54]=oe,t[55]=U,t[56]=W,t[57]=se,t[58]=K):K=t[58];let ue;t[59]!==A||t[60]!==te||t[61]!==R?.bands||t[62]!==R?.total||t[63]!==L||t[64]!==f||t[65]!==B||t[66]!==n?(ue=L===void 0?null:(0,$.jsxs)(`div`,{ref:y,className:`surface-glass pointer-events-none absolute z-10 min-w-36 max-w-full rounded-xl border border-border/50 px-2.5 py-2 text-xs shadow-lg`,style:{left:`var(--usage-tooltip-left, 0px)`,top:`var(--usage-tooltip-top, 0px)`},children:[(0,$.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:te(L)}),n.map(e=>{let{label:t,driverKind:n}=Ge[e];return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,$.jsx)(Le,{driverKind:n,displayName:t,iconClassName:`size-3`}),t]}),(0,$.jsx)(`span`,{className:T(`tabular-nums`,f.has(e)?`text-muted-foreground`:`text-foreground`),children:A(R?.bands.find(t=>t.provider===e)?.value??0)})]},e)}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-3 border-t border-border pt-1`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Total`}),(0,$.jsx)(`span`,{className:T(`tabular-nums`,B?`text-muted-foreground`:`text-foreground`),children:A(R?.total??0)})]})]}),t[59]=A,t[60]=te,t[61]=R?.bands,t[62]=R?.total,t[63]=L,t[64]=f,t[65]=B,t[66]=n,t[67]=ue):ue=t[67];let de;t[68]!==I||t[69]!==K||t[70]!==ue?(de=(0,$.jsxs)(`div`,{ref:v,className:`relative h-56 flex-1`,onMouseMove:I,onMouseLeave:ie,children:[K,ue]}),t[68]=I,t[69]=K,t[70]=ue,t[71]=de):de=t[71];let J;t[72]!==re||t[73]!==de?(J=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[re,de]}),t[72]=re,t[73]=de,t[74]=J):J=t[74];let Y;t[75]!==H||t[76]!==p[0]?(Y=p[0]===void 0?``:H(p[0]),t[75]=H,t[76]=p[0],t[77]=Y):Y=t[77];let pe;t[78]===Y?pe=t[79]:(pe=(0,$.jsx)(`span`,{children:Y}),t[78]=Y,t[79]=pe);let me;t[80]!==H||t[81]!==p?(me=p[Math.floor(p.length/2)]===void 0?``:H(p[Math.floor(p.length/2)]??``),t[80]=H,t[81]=p,t[82]=me):me=t[82];let he;t[83]===me?he=t[84]:(he=(0,$.jsx)(`span`,{children:me}),t[83]=me,t[84]=he);let ge;t[85]!==H||t[86]!==p?(ge=p[p.length-1]===void 0?``:H(p[p.length-1]??``),t[85]=H,t[86]=p,t[87]=ge):ge=t[87];let _e;t[88]===ge?_e=t[89]:(_e=(0,$.jsx)(`span`,{children:ge}),t[88]=ge,t[89]=_e);let ve;t[90]!==pe||t[91]!==he||t[92]!==_e?(ve=(0,$.jsxs)(`div`,{className:`flex justify-between pl-16 text-3xs text-muted-foreground uppercase`,children:[pe,he,_e]}),t[90]=pe,t[91]=he,t[92]=_e,t[93]=ve):ve=t[93];let X;return t[94]!==J||t[95]!==ve?(X=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[J,ve]}),t[94]=J,t[95]=ve,t[96]=X):X=t[96],X}function Nn(e){return T(`transition-opacity`,e&&`opacity-40 delay-150`)}function Pn(e){return[e.day,e]}function Fn(e){return[e.hourStart,e]}function In(e){let t=(0,Q.c)(30),{label:n,segments:r,format:i,aside:a}=e,o,s,c,l,u,d;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.filter(Rn),f=e.reduce(Ln,0);if(f<=0){d=null;break bb0}c=`flex min-w-0 flex-col gap-2.5`;let p;t[10]===n?p=t[11]:(p=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:n}),t[10]=n,t[11]=p),t[12]!==a||t[13]!==p?(l=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[p,a]}),t[12]=a,t[13]=p,t[14]=l):l=t[14];let m;t[15]===i?m=t[16]:(m=e=>`${e.label} ${i(e.value)}`,t[15]=i,t[16]=m);let h;t[17]!==i||t[18]!==f?(h=e=>(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(`div`,{className:`h-full min-w-1 rounded-xs first:rounded-l-full last:rounded-r-full`,style:{flex:`${e.value} 1 0`,backgroundColor:e.color}})}),(0,$.jsxs)(_e,{children:[e.label,` · `,i(e.value),` · `,Y(e.value/f)]})]},e.label),t[17]=i,t[18]=f,t[19]=h):h=t[19],u=(0,$.jsx)(`div`,{role:`img`,"aria-label":`${n}: ${e.map(m).join(`, `)}`,className:`flex h-2 gap-0.5`,children:e.map(h)}),o=`flex flex-wrap gap-x-4 gap-y-1 text-xs`;let g;t[20]===i?g=t[21]:(g=e=>(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-xs`,style:{backgroundColor:e.color}}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:i(e.value)})]},e.label),t[20]=i,t[21]=g),s=e.map(g)}t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;t[22]!==o||t[23]!==s?(f=(0,$.jsx)(`div`,{className:o,children:s}),t[22]=o,t[23]=s,t[24]=f):f=t[24];let p;return t[25]!==c||t[26]!==l||t[27]!==u||t[28]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[25]=c,t[26]=l,t[27]=u,t[28]=f,t[29]=p):p=t[29],p}function Ln(e,t){return e+t.value}function Rn(e){return e.value>0}function zn(e){return e.toSorted((e,t)=>t.totalTokens-e.totalTokens||t.costUsd-e.costUsd)}function Bn(e,t){return t===`tokens`?e.tokenShare:mt(e)?null:e.costShare}function Vn({tokens:e}){let t=e.uncachedInputTokens+e.cachedInputTokens+e.cacheCreationTokens;return t===0?null:e.cachedInputTokens/t}function Hn(e){let t=e.totalTokens-e.unpricedTokens;return t<=0||mt(e)?null:e.costUsd/t*1e6}var Un=e=>`color-mix(in oklab, var(--foreground) ${e}%, var(--background))`,Wn={input:Un(60),cacheRead:Un(30),cacheWrite:Un(72),output:Un(100),other:Un(44)};function Gn(e){return[{label:`Input`,value:e.input,color:Wn.input},{label:`Cache read`,value:e.cacheRead,color:Wn.cacheRead},{label:`Cache write`,value:e.cacheWrite,color:Wn.cacheWrite},{label:`Output`,value:e.output,color:Wn.output},{label:`Other`,value:e.unsplit>=.005?e.unsplit:0,color:Wn.other}]}function Kn(e){return[{label:`Input`,value:e.uncachedInputTokens,color:Wn.input},{label:`Cache read`,value:e.cachedInputTokens,color:Wn.cacheRead},{label:`Cache write`,value:e.cacheCreationTokens,color:Wn.cacheWrite},{label:`Output`,value:e.outputTokens,color:Wn.output}]}function qn(e){return[{label:`Standard`,value:e.standard,color:Un(34)},{label:`Fast`,value:e.fast,color:Un(66)},{label:`Ultrafast`,value:e.ultrafast,color:Un(100)}]}function Jn(e){let t=(0,Q.c)(80),{model:n,environments:r,metric:i,chartWindow:a,onSetPrice:o,onClose:s}=e,c;t[0]!==n.model||t[1]!==n.provider?(c=e=>e.provider===n.provider&&e.model===n.model,t[0]=n.model,t[1]=n.provider,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==c?(l=Tt(r,c),t[3]=r,t[4]=c,t[5]=l):l=t[5];let u=l,d;t[6]===n.provider?d=t[7]:(d=[n.provider],t[6]=n.provider,t[7]=d);let f=d,p=Ge[n.provider],m;t[8]===n?m=t[9]:(m=mt(n),t[8]=n,t[9]=m);let h=m,g;if(t[10]!==h||t[11]!==n){let e=Vn(n),r=Hn(n),i;t[13]!==h||t[14]!==n.costUsd?(i=h?`Unpriced`:G(n.costUsd),t[13]=h,t[14]=n.costUsd,t[15]=i):i=t[15];let a;t[16]===i?a=t[17]:(a={label:`Cost`,value:i},t[16]=i,t[17]=a);let o;t[18]===n.totalTokens?o=t[19]:(o=q(n.totalTokens),t[18]=n.totalTokens,t[19]=o);let s;t[20]===o?s=t[21]:(s={label:`Tokens`,value:o},t[20]=o,t[21]=s),g=[a,s,r===null?null:{label:`Per 1M tokens`,value:G(r)},e===null?null:{label:`Cache hit`,value:Y(e)}].filter(Xn),t[10]=h,t[11]=n,t[12]=g}else g=t[12];let _=g,v;t[22]===s?v=t[23]:(v=e=>{e||s()},t[22]=s,t[23]=v);let y;t[24]!==p.driverKind||t[25]!==p.label?(y=(0,$.jsx)(Le,{driverKind:p.driverKind,displayName:p.label,iconClassName:`size-5`}),t[24]=p.driverKind,t[25]=p.label,t[26]=y):y=t[26];let b;t[27]===n.model?b=t[28]:(b=(0,$.jsx)(we,{children:n.model}),t[27]=n.model,t[28]=b);let S;t[29]!==y||t[30]!==b?(S=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,b]}),t[29]=y,t[30]=b,t[31]=S):S=t[31];let C;t[32]!==h||t[33]!==n.costShare?(C=h?``:` · ${Y(n.costShare)} of cost`,t[32]=h,t[33]=n.costShare,t[34]=C):C=t[34];let w;t[35]!==p.label||t[36]!==C?(w=(0,$.jsxs)(De,{children:[p.label,C]}),t[35]=p.label,t[36]=C,t[37]=w):w=t[37];let T;t[38]!==w||t[39]!==S?(T=(0,$.jsxs)(Ce,{children:[S,w]}),t[38]=w,t[39]=S,t[40]=T):T=t[40];let E;t[41]===_?E=t[42]:(E=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4`,children:_.map(Yn)}),t[41]=_,t[42]=E);let D=h?`tokens`:i,O;t[43]!==a.days||t[44]!==a.hours||t[45]!==a.referenceTime||t[46]!==a.resolution||t[47]!==a.timeZone||t[48]!==f||t[49]!==D||t[50]!==u.daily||t[51]!==u.hourly?(O=(0,$.jsx)(Mn,{providers:f,days:a.days,daily:u.daily,hours:a.hours,hourly:u.hourly,metric:D,referenceTime:a.referenceTime,resolution:a.resolution,timeZone:a.timeZone}),t[43]=a.days,t[44]=a.hours,t[45]=a.referenceTime,t[46]=a.resolution,t[47]=a.timeZone,t[48]=f,t[49]=D,t[50]=u.daily,t[51]=u.hourly,t[52]=O):O=t[52];let k;t[53]!==h||t[54]!==u.categoryCost?(k=h?null:(0,$.jsx)(In,{label:`Cost by type`,segments:Gn(u.categoryCost),format:G}),t[53]=h,t[54]=u.categoryCost,t[55]=k):k=t[55];let A;t[56]===n.tokens?A=t[57]:(A=Kn(n.tokens),t[56]=n.tokens,t[57]=A);let j;t[58]===A?j=t[59]:(j=(0,$.jsx)(In,{label:`Tokens by type`,segments:A,format:q}),t[58]=A,t[59]=j);let M;t[60]===u.speedCost?M=t[61]:(M=u.speedCost.fast+u.speedCost.ultrafast>0?(0,$.jsx)(In,{label:`Cost by speed`,segments:qn(u.speedCost),format:G,aside:(0,$.jsx)(Zn,{premiumUsd:u.speedCost.premium})}):null,t[60]=u.speedCost,t[61]=M);let N;t[62]!==k||t[63]!==j||t[64]!==M?(N=(0,$.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 sm:grid-cols-2`,children:[k,j,M]}),t[62]=k,t[63]=j,t[64]=M,t[65]=N):N=t[65];let P;t[66]!==E||t[67]!==O||t[68]!==N?(P=(0,$.jsx)(Ee,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[E,O,N]})}),t[66]=E,t[67]=O,t[68]=N,t[69]=P):P=t[69];let F;t[70]!==n.unpricedTokens||t[71]!==o?(F=n.unpricedTokens>0?(0,$.jsxs)(Te,{variant:`bare`,className:`items-center sm:justify-between`,children:[(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[q(n.unpricedTokens),` tokens have no known price`]}),(0,$.jsx)(x,{onClick:o,children:`Set price`})]}):null,t[70]=n.unpricedTokens,t[71]=o,t[72]=F):F=t[72];let I;t[73]!==T||t[74]!==P||t[75]!==F?(I=(0,$.jsxs)(Oe,{className:`max-w-3xl`,children:[T,P,F]}),t[73]=T,t[74]=P,t[75]=F,t[76]=I):I=t[76];let L;return t[77]!==I||t[78]!==v?(L=(0,$.jsx)(ke,{open:!0,onOpenChange:v,children:I}),t[77]=I,t[78]=v,t[79]=L):L=t[79],L}function Yn(e){return(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-2xl font-semibold text-foreground`,children:e.value})]},e.label)}function Xn(e){return e!==null}function Zn(e){let t=(0,Q.c)(4),{premiumUsd:n}=e,r;t[0]===n?r=t[1]:(r=G(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Premium `,(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:r})]}),t[2]=r,t[3]=i),i}var Qn=`p4code:usage-page-preferences:v1`,$n=M({metric:N([`cost`,`tokens`,`limits`]),windowDays:N([1,7,30,90]),hiddenProviders:A(j(P))}),er={metric:`limits`,windowDays:30};function tr(){try{return u(Qn,$n)??er}catch(e){return console.error(`Could not read Usage page preferences.`,e),er}}function nr(e){try{i(Qn,e,$n)}catch(e){console.error(`Could not save Usage page preferences.`,e)}}function rr(e){return He.some(t=>t.value===e)}function ir(e){return Be.some(t=>t.days===e)}var ar=e=>Ge[e].label;function or(){let[e,t]=(0,Z.useState)(tr);re();let n=o(oe),r=e=>{let t=Me(n,e.command,{context:{usagePageOpen:!0}});return t?`${e.label} (${t})`:e.label},[i,a]=(0,Z.useState)(()=>({days:e.windowDays,window:K(e.windowDays,void 0,e.windowDays===1?`hour`:`day`)})),c=e.metric,l=c===`limits`,[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(()=>Date.now()),m=(0,Z.useRef)(!1),[h,g]=(0,Z.useState)(`model`),[_,y]=(0,Z.useState)(null),[b,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(null),E=(0,Z.useMemo)(()=>new Set(e.hiddenProviders),[e.hiddenProviders]),{days:D,window:O}=i,k=D===1,{merged:A,environments:j,selectedEnvironments:M,shown:N,isPartial:P,refresh:F}=Ot(O,C,E),I=N?.merged??A,L=N?.window??O,R=L.resolution===`hour`,z=u&&!l,B=N!==null&&N.window!==O,U=(0,Z.useMemo)(()=>{if(B)return{partial:!0,everyProvider:!0,providers:new Set};let e=pt(M,z),t=new Set([...e.providers].filter(e=>!E.has(e)));return{partial:e.everyProvider||t.size>0,everyProvider:e.everyProvider,providers:t}},[B,z,M,E]),W=e=>U.everyProvider||U.providers.has(e),le=o(ie.presentationsAtom),me=(0,Z.useMemo)(()=>new Map([...le].filter(([,e])=>e.entry.enabled&&e.entry.unsupportedReason===void 0)),[le]),ge=E.has(`cursor`)?[]:at(M),_e=[...new Set(M.flatMap(e=>e.summary?.sources.flatMap(e=>e.message&&!e.action&&!E.has(e.fingerprint.provider)&&(e.status===`partial`||e.status===`failed`||e.fingerprint.provider===`cursor`)?[e.message]:[])??[]))],ve=se(ae.refreshProviders,{reportFailure:!1}),X=M.some(e=>e.canReadDiagnostics),xe=(0,Z.useMemo)(()=>pe(L.sinceDay,L.untilDay),[L.sinceDay,L.untilDay]),Ce=(0,Z.useMemo)(()=>L.sinceTime===void 0||L.untilTime===void 0?[]:de(L.sinceTime,L.untilTime),[L.sinceTime,L.untilTime]),we=(0,Z.useMemo)(()=>(R?I.hourly:I.daily).toReversed(),[R,I.daily,I.hourly]),Te=(0,Z.useMemo)(()=>h===`model`&&c===`tokens`?zn(I.models):I.models,[h,I.models,c]),Ee=(0,Z.useMemo)(()=>Je(I.providers),[I.providers]),De=(0,Z.useMemo)(()=>Ue.filter(e=>Ee.includes(e)||U.providers.has(e)),[U.providers,Ee]),Oe=(0,Z.useMemo)(()=>new Set(De.filter(e=>U.everyProvider||U.providers.has(e))),[De,U.everyProvider,U.providers]),ke=b===null?void 0:I.models.find(e=>`${e.provider}:${e.model}`===b),je=Te.reduce((e,t)=>Math.max(e,c===`tokens`?t.totalTokens:t.costUsd),0),Le=De.map(e=>({kind:`usage`,provider:e})),Ye=Math.max(De.indexOf(`codex`),De.indexOf(`claude`))+1;Le.splice(Ye,0,...ge.map(e=>({kind:`enable`,environment:e})));let Qe=`${60/(De.length+2)}%`,nt=n=>{let r={...e,...n};t(r),nr(r)},Q=e=>{ir(e)&&(nt({windowDays:e}),a({days:e,window:K(e,void 0,e===1?`hour`:`day`)}))},rt=e=>{e===`limits`&&p(Date.now()),nt({metric:e})},it=async(e=!1,t=!1)=>{try{await Promise.all(Array.from(me,([n,r])=>{if((C===null||C.has(n))&&r.connection.phase===`connected`&&r.serverConfig!==null)return lt(n,()=>ve({environmentId:n,input:{}}),e,t)}))}finally{p(Date.now())}},ot=(0,Z.useEffectEvent)(e=>{if(e.defaultPrevented||e.repeat||e.isComposing||Xe()||We())return;let t=Ve(e,n),r=He.find(e=>e.command===t),i=Be.find(e=>e.command===t);(r||i)&&(e.preventDefault(),e.stopPropagation(),r&&rt(r.value),i&&!l&&Q(i.days))});(0,Z.useEffect)(()=>(globalThis.window.addEventListener(`keydown`,ot,!0),()=>globalThis.window.removeEventListener(`keydown`,ot,!0)),[]);let st=()=>{if(m.current)return;if(l){m.current=!0,d(!0),it().finally(()=>{m.current=!1,d(!1)});return}let e=K(D,void 0,k?`hour`:`day`);(e.sinceDay!==O.sinceDay||e.untilDay!==O.untilDay||e.sinceTime!==O.sinceTime||e.untilTime!==O.untilTime)&&a({days:D,window:e}),m.current=!0,d(!0),F(e).finally(()=>{m.current=!1,d(!1)})},ct=[...me].filter(([e,t])=>t.connection.phase===`connected`&&t.serverConfig!==null&&(C===null||C.has(e))).map(([e])=>e).sort().join(`,`),ut=(0,Z.useEffectEvent)(()=>{it(!0)});(0,Z.useEffect)(()=>{l&&ct&&ut()},[l,ct]);let dt=R&&L.sinceTime!==void 0&&L.untilTime!==void 0?`${ue(L.sinceTime,L.timeZone)} to ${ue(L.untilTime,L.timeZone)}`:`${ce(L.sinceDay)} to ${ce(L.untilDay)}`,ft=(0,$.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 py-2 @4xl/usage-header:flex`,children:[(0,$.jsxs)(tt,{ariaLabel:`Usage breadcrumb`,className:`min-w-0`,children:[(0,$.jsx)($e,{children:(0,$.jsx)(`h1`,{children:`Usage`})}),(0,$.jsx)(et,{}),(0,$.jsx)($e,{className:`min-w-10 shrink`,children:(0,$.jsx)(yr,{environments:j,selectedEnvironments:M,selectedEnvironmentIds:C,onSelectionChange:w,showUsageStatus:!l,refreshing:z,isPartial:P,duplicateSources:I.duplicateSources,contractMismatches:I.contractMismatches,onOpenModelPrices:()=>y({})})}),(0,$.jsx)(et,{}),(0,$.jsx)($e,{current:!0,className:`min-w-10`,children:(0,$.jsx)(Sr,{hiddenProviders:E,onChange:e=>nt({hiddenProviders:e})})})]}),l?null:(0,$.jsx)(`span`,{className:`hidden min-w-0 truncate text-xs text-muted-foreground @7xl/usage-header:block`,children:dt}),(0,$.jsxs)(`div`,{className:`ms-auto hidden shrink-0 items-center justify-end gap-2 @4xl/usage-header:flex`,children:[(0,$.jsx)(ye,{"aria-label":`Usage metric`,variant:`segmented`,value:[c],onValueChange:e=>{let t=e[0];rr(t)&&rt(t)},children:He.map(e=>(0,$.jsx)(be,{value:e.value,title:r(e),children:e.label},e.value))}),(0,$.jsx)(ye,{"aria-label":`Usage period`,variant:`segmented`,value:[String(D)],disabled:l,onValueChange:e=>{let t=e[0];t&&Q(Number(t))},children:Be.map(e=>(0,$.jsx)(be,{value:String(e.days),title:r(e),children:e.label},e.days))}),(0,$.jsx)(x,{onClick:st,"aria-label":l?`Refresh limits`:`Refresh usage`,"aria-busy":u,disabled:u||!l&&!X,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(qe,{size:`sm`,refreshing:u})})]}),(0,$.jsxs)(`div`,{className:`ms-auto flex shrink-0 items-center justify-end gap-1 @4xl/usage-header:hidden`,children:[(0,$.jsxs)(ne,{value:c,onValueChange:e=>{rr(e)&&rt(e)},children:[(0,$.jsx)(te,{"aria-label":`Usage metric`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(H,{children:He.find(e=>e.value===c)?.label})}),(0,$.jsx)(ee,{align:`end`,alignItemWithTrigger:!1,children:He.map(e=>(0,$.jsx)(V,{value:e.value,title:r(e),children:e.label},e.value))})]}),(0,$.jsxs)(ne,{value:String(D),disabled:l,onValueChange:e=>Q(Number(e)),children:[(0,$.jsx)(te,{"aria-label":`Usage period`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(H,{children:Be.find(e=>e.days===D)?.label})}),(0,$.jsx)(ee,{align:`end`,alignItemWithTrigger:!1,children:Be.map(e=>(0,$.jsx)(V,{value:String(e.days),title:r(e),children:e.label},e.days))})]}),(0,$.jsx)(x,{onClick:st,"aria-label":l?`Refresh limits`:`Refresh usage`,"aria-busy":u,disabled:u||!l&&!X,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(qe,{size:`sm`,refreshing:u})})]})]});return(0,$.jsxs)(Ae,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none isolate`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground`,children:[(0,$.jsx)(Ze,{electron:he,className:`@container/usage-header`,children:ft}),(0,$.jsx)(Se,{className:`min-h-0 flex-1`,children:(0,$.jsx)(ze,{width:`wide`,children:M.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:j.length===0?`Connect an environment to see ${l?`limits`:`usage`}.`:`Select an environment to see ${l?`limits`:`usage`}.`}):l?(0,$.jsx)(Ke,{selectedEnvironmentIds:C,hiddenProviders:E,now:f,cursorPrompt:ge.length>0?(0,$.jsx)(ur,{environments:ge,onEnabled:()=>{F(),it(!1,!0)}}):null}):N===null?(0,$.jsx)(Cr,{}):X?(0,$.jsxs)(`div`,{"aria-busy":U.partial,className:`flex flex-col gap-6`,children:[_e.map(e=>(0,$.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:e},e)),(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:T(`text-4xl font-semibold text-foreground tabular-nums`,fr(U.partial)),children:c===`cost`?G(I.costUsd):q(I.totalTokens)}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsxs)(`span`,{className:fr(U.partial),children:[J(I.sessions),` sessions`]}),c===`cost`&&` · API estimate`]}),c===`cost`&&I.costQuality.unpricedShare>0&&(0,$.jsxs)(Fe,{children:[(0,$.jsx)(Pe,{openOnHover:!0,render:(0,$.jsx)(v,{tone:`muted`}),"aria-label":`Unpriced usage details`,children:(0,$.jsx)(s,{className:`size-3`,"aria-hidden":!0})}),(0,$.jsxs)(Ne,{side:`top`,tooltipStyle:!0,children:[`API estimate excludes`,` `,Y(I.costQuality.unpricedShare),` unpriced records.`]})]})]})]}),!E.has(`codex`)&&[...me].some(([e,t])=>(C===null||C.has(e))&&t.serverConfig?.providers.some(Ie))?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:`ChatGPT shared usage`}),(0,$.jsx)(Re,{size:`xs`})]}):null,Le.map(e=>{if(e.kind===`enable`)return(0,$.jsx)(lr,{environmentId:e.environment.environmentId,label:e.environment.label,showEnvironment:M.length>1,onEnabled:()=>{F(),it(!1,!0)}},`enable:${e.environment.environmentId}`);let t=e.provider,n=I.providers.find(e=>e.provider===t),r=c===`cost`?n?.costShare??0:n?.tokenShare??0,i=n?.sessions??0,a=`${J(i)} ${i===1?`session`:`sessions`}`,o=W(t),s=o&&!Ee.includes(t);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Ge[t].color}}),(0,$.jsx)(dr,{provider:t,className:`size-4`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:Ge[t].label}),(0,$.jsx)(`span`,{className:T(`shrink-0 whitespace-nowrap text-2xs text-muted-foreground tabular-nums`,fr(o),s&&`invisible`),children:a})]})]}),(0,$.jsx)(`span`,{className:T(`shrink-0 text-sm font-medium text-foreground tabular-nums`,fr(o)),children:s?`—`:c===`cost`?G(n?.costUsd??0):q(n?.totalTokens??0)})]}),(0,$.jsx)(`span`,{className:T(`text-xs text-muted-foreground`,fr(o),s&&`invisible`),children:c===`cost`?`${Y(r)} of cost · ${q(n?.totalTokens??0)} tokens`:`${Y(r)} of tokens · ${G(n?.costUsd??0)}`})]},t)})]}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,$.jsxs)(`h2`,{className:`text-sm font-medium text-foreground`,children:[R?`Hourly`:`Daily`,` `,c===`tokens`?`processed tokens`:`cost`]}),(0,$.jsx)(Mn,{providers:De,loadingProviders:Oe,days:xe,daily:I.daily,hours:Ce,hourly:I.hourly,metric:c,referenceTime:L.untilTime,resolution:R?`hour`:`day`,timeZone:L.timeZone})]})]}),(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:[(0,$.jsx)(pr,{loading:U.partial,label:`Processed tokens`,value:q(I.totalTokens)}),(0,$.jsx)(pr,{loading:U.partial,label:`Cached input`,value:q(I.cachedInputTokens)}),(0,$.jsx)(pr,{loading:U.partial,label:`Uncached input`,value:q(I.uncachedInputTokens)}),(0,$.jsx)(pr,{loading:U.partial,label:`Output`,value:q(I.outputTokens)}),(0,$.jsx)(pr,{loading:U.partial,label:`Cache savings`,value:G(I.costQuality.cacheSavingsUsd)})]})]}),I.totalTokens>0?(0,$.jsx)(`section`,{className:T(`grid gap-x-12 gap-y-8 lg:grid-cols-2`,fr(U.partial)),children:c===`tokens`?(0,$.jsx)(In,{label:`Tokens by type`,segments:Kn(I),format:q}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(In,{label:`Cost by type`,segments:Gn(I.categoryCost),format:G}),I.speedCost.fast+I.speedCost.ultrafast>0?(0,$.jsx)(In,{label:`Cost by speed`,segments:qn(I.speedCost),format:G,aside:(0,$.jsx)(Zn,{premiumUsd:I.speedCost.premium})}):null]})}):null,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(ye,{"aria-label":`Usage breakdown`,variant:`segmented`,value:[h],onValueChange:e=>{let t=e[0];(t===`model`||t===`time`)&&g(t)},children:[{value:`model`,label:`Model`},{value:`time`,label:R?`Hour`:`Day`}].map(e=>(0,$.jsx)(be,{value:e.value,children:e.label},e.value))})]}),h===`model`?(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-right text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 pr-3 text-left font-normal`,children:`#`}),(0,$.jsx)(`th`,{className:`w-full py-2 text-left font-normal`,children:`Model`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Cost`}),(0,$.jsx)(`th`,{className:`hidden py-2 pl-6 font-normal sm:table-cell`,children:`Share`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:Te.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:5,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):Te.map((e,t)=>{let n=`${e.provider}:${e.model}`,r=c===`tokens`?e.totalTokens:e.costUsd,i=Bn(e,c===`tokens`?`tokens`:`cost`),a=fr(W(e.provider));return(0,$.jsxs)(`tr`,{className:`relative border-b border-border/50 text-right whitespace-nowrap text-muted-foreground tabular-nums transition-colors hover:bg-muted/50 has-focus-visible:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2.5 pr-3 text-left text-xs`,children:t+1}),(0,$.jsxs)(`td`,{className:`py-2.5 text-left whitespace-normal`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S(n),className:`flex items-center gap-2 text-left text-foreground outline-none after:absolute after:inset-0`,children:[(0,$.jsx)(dr,{provider:e.provider,className:`size-3.5`}),e.model]}),(0,$.jsx)(`div`,{"aria-hidden":!0,className:T(`mt-1.5 h-0.5 max-w-48`,a),children:(0,$.jsx)(`div`,{className:`h-full rounded-full`,style:{width:r>0&&je>0?`max(0.5rem, ${r/je*100}%)`:0,backgroundColor:Ge[e.provider].color}})})]}),(0,$.jsx)(`td`,{className:T(`py-2.5 pl-6 text-foreground`,a),children:mt(e)?(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Unpriced`}):G(e.costUsd)}),(0,$.jsx)(`td`,{className:T(`hidden py-2.5 pl-6 sm:table-cell`,a),children:i===null?``:Y(i)}),(0,$.jsx)(`td`,{className:T(`py-2.5 pl-6`,a),children:q(e.totalTokens)})]},n)})})]}):(0,$.jsxs)(`table`,{className:`w-full table-fixed text-sm`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-2/5`}),De.map(e=>(0,$.jsx)(`col`,{style:{width:Qe}},e)),(0,$.jsx)(`col`,{style:{width:Qe}}),(0,$.jsx)(`col`,{style:{width:Qe}})]}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-left text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 font-normal`,children:R?`Hour`:`Day`}),De.map(e=>(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:Ge[e].label},e)),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Total`}),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:we.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:De.length+3,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):we.map(e=>(0,$.jsxs)(`tr`,{className:`border-b border-border/50 transition-colors hover:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2 text-foreground`,children:`hourStart`in e?fe(e.hourStart,L.timeZone):ce(e.day)}),De.map(t=>(0,$.jsx)(`td`,{className:T(`py-2 text-right text-muted-foreground tabular-nums`,fr(W(t))),children:G(e.byProvider.get(t)?.costUsd??0)},t)),(0,$.jsx)(`td`,{className:T(`py-2 text-right text-foreground tabular-nums`,fr(U.partial)),children:G(e.costUsd)}),(0,$.jsx)(`td`,{className:T(`py-2 text-right text-muted-foreground tabular-nums`,fr(U.partial)),children:q(e.totalTokens)})]},`hourStart`in e?e.hourStart:e.day))})]})]})]}):(0,$.jsx)(`div`,{className:`space-y-2 py-12 text-center text-sm text-muted-foreground`,children:M.map(e=>(0,$.jsxs)(`p`,{children:[M.length>1?`${e.label}: `:null,e.error]},e.environmentId))})})})]}),ke!==void 0&&!l?(0,$.jsx)(Jn,{model:ke,environments:M,metric:c===`tokens`?`tokens`:`cost`,chartWindow:{days:xe,hours:Ce,resolution:R?`hour`:`day`,timeZone:L.timeZone,referenceTime:L.untilTime},onSetPrice:()=>{S(null),y({model:ke.model})},onClose:()=>S(null)}):null,_?(0,$.jsx)(Zt,{usage:j,initialSelectedEnvironmentIds:C,initialModel:_.model,onOpenChange:e=>{e||y(null)}}):null]})}var sr=`Requires access to your Cursor login in macOS Keychain.`;function cr({environmentId:e,label:t,onEnabled:n,tooltip:r,buttonText:i=`Enable`}){let a=se(ae.updateSettings,{label:`enable Cursor account usage`}),[o,s]=(0,Z.useState)(!1),c=async()=>{s(!0);try{(await a({environmentId:e,input:{patch:{cursorKeychainUsageEnabled:!0}}}))._tag===`Success`&&n()}finally{s(!1)}},l=r?(0,$.jsx)(v,{disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i}):(0,$.jsx)(x,{size:`sm`,variant:`outline`,disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i});return r?(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:l}),(0,$.jsx)(_e,{children:sr})]}):l}function lr(e){let t=(0,Q.c)(11),{environmentId:n,label:r,showEnvironment:i,onEnabled:a}=e,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Ge.cursor.color}}),s=(0,$.jsx)(dr,{provider:`cursor`,className:`size-4`}),t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c=i?` · ${r}`:``,l;t[2]===c?l=t[3]:(l=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[o,s,(0,$.jsxs)(`span`,{className:`truncate`,children:[`Cursor`,c]})]}),t[2]=c,t[3]=l);let u;t[4]!==n||t[5]!==r||t[6]!==a?(u=(0,$.jsx)(cr,{environmentId:n,label:r,onEnabled:a,tooltip:!0}),t[4]=n,t[5]=r,t[6]=a,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==u?(d=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-4 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function ur(e){let t=(0,Q.c)(10),{environments:n,onEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,$.jsx)(Le,{driverKind:I.make(`cursor`),displayName:`Cursor`,indicatorBackground:`var(--background)`,className:`size-5`,iconClassName:`size-4 text-foreground/80`}),`Cursor`]}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:sr}),t[1]=a):a=t[1];let o;if(t[2]!==n||t[3]!==r){let e;t[5]!==n.length||t[6]!==r?(e=e=>(0,$.jsx)(cr,{environmentId:e.environmentId,label:e.label,buttonText:n.length>1?`Enable on ${e.label}`:`Enable`,onEnabled:r,tooltip:!1},e.environmentId),t[5]=n.length,t[6]=r,t[7]=e):e=t[7],o=n.map(e),t[2]=n,t[3]=r,t[4]=o}else o=t[4];let s;return t[8]===o?s=t[9]:(s=(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[i,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-lg border border-border/60 p-4`,children:[a,(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o})]})]}),t[8]=o,t[9]=s),s}function dr(e){let t=(0,Q.c)(4),{provider:n,className:r}=e,i=Ge[n],a;return t[0]!==r||t[1]!==i.driverKind||t[2]!==i.label?(a=(0,$.jsx)(Le,{driverKind:i.driverKind,displayName:i.label,iconClassName:r}),t[0]=r,t[1]=i.driverKind,t[2]=i.label,t[3]=a):a=t[3],a}function fr(e){return T(`transition-opacity`,e&&`opacity-40 delay-150`)}function pr(e){let t=(0,Q.c)(10),{label:n,value:r,loading:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=T(`text-base font-medium text-foreground tabular-nums`,fr(i)),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,$.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function mr(e){let t=(0,Q.c)(14),{environments:n,duplicateSources:r,contractMismatches:i}=e,a,o,s,c;if(t[0]!==i||t[1]!==r||t[2]!==n){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=n.filter(vr),t=new Map(i.map(_r)),l=n.flatMap(e=>{let n=t.get(e.environmentId);return n===void 0?[]:[{environment:e,mismatch:n}]});if(e.length===0&&l.length===0&&r.length===0){c=null;break bb0}a=`flex flex-col gap-1 border-t border-border px-2 py-2 text-xs text-muted-foreground`,o=e.map(gr),s=l.map(hr)}t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let l;t[7]===r?l=t[8]:(l=r.length>0?(0,$.jsxs)(`span`,{children:[`Counted once across environments sharing a transcript directory:`,` `,r.join(`, `)]}):null,t[7]=r,t[8]=l);let u;return t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==l?(u=(0,$.jsxs)(`div`,{className:a,children:[o,s,l]}),t[9]=a,t[10]=o,t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function hr(e){let{environment:t,mismatch:n}=e;return(0,$.jsx)(`span`,{children:me(t.label,n)},t.environmentId)}function gr(e){return(0,$.jsxs)(`span`,{children:[e.label,`: `,e.error]},e.label)}function _r(e){return[e.environmentId,e]}function vr(e){return e.error!==null}function yr(e){let t=(0,Q.c)(56),{environments:n,selectedEnvironments:r,selectedEnvironmentIds:i,onSelectionChange:o,showUsageStatus:s,refreshing:u,isPartial:d,duplicateSources:f,contractMismatches:m,onOpenModelPrices:g}=e,y=i===null,b=y?`All environments`:r.length===1?r[0].label:`${r.length} environments`,x;t[0]!==m||t[1]!==r?(x=r.some(xr)||m.length>0,t[0]=m,t[1]=r,t[2]=x):x=t[2];let S=x,D;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(v,{}),t[3]=D):D=t[3];let O;t[4]===b?O=t[5]:(O=(0,$.jsx)(Qe,{children:b}),t[4]=b,t[5]=O);let k;t[6]!==S||t[7]!==s?(k=(0,$.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center text-muted-foreground`,children:s&&S?(0,$.jsx)(a,{className:`size-3.5 text-warning-foreground`,"aria-label":`Some environments could not report usage`}):(0,$.jsx)(c,{className:`size-3.5 opacity-0 transition-opacity group-hover/usage-environment:opacity-100 group-focus-visible/usage-environment:opacity-100 group-data-popup-open/usage-environment:opacity-100`,"aria-hidden":!0})}),t[6]=S,t[7]=s,t[8]=k):k=t[8];let A;t[9]!==O||t[10]!==k?(A=(0,$.jsxs)(_,{render:D,className:`group/usage-environment min-w-0 max-w-full`,children:[O,k]}),t[9]=O,t[10]=k,t[11]=A):A=t[11];let j;t[12]===o?j=t[13]:(j=e=>o(e?null:new Set),t[12]=o,t[13]=j);let M;t[14]!==y||t[15]!==j?(M=(0,$.jsx)(l,{checked:y,closeOnClick:!1,onCheckedChange:j,children:`All environments`}),t[14]=y,t[15]=j,t[16]=M):M=t[16];let N;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(w,{}),t[17]=N):N=t[17];let P;if(t[18]!==n||t[19]!==o||t[20]!==u||t[21]!==i||t[22]!==r||t[23]!==s){let e;t[25]!==n.length||t[26]!==o||t[27]!==u||t[28]!==i||t[29]!==r||t[30]!==s?(e=e=>{let t=i===null||i.has(e.environmentId),a=dt(e,u),c=e.error===null?e.summary!==null&&!xt(e.summary.contractVersion,6)?`Update required`:e.isConnected?a.phase===`loading`?`Scanning…`:a.phase===`stale`?`Refreshing…`:a.phase===`partway`?ft(a.providers,ar):`Ready`:`Connecting…`:`Unavailable`;return(0,$.jsx)(l,{checked:t,closeOnClick:!1,onCheckedChange:t=>{let i=new Set(r.map(br));t?i.add(e.environmentId):i.delete(e.environmentId),o(i.size===n.length?null:i)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),s?(0,$.jsx)(`span`,{className:T(`shrink-0 text-xs text-muted-foreground`,e.error!==null&&`text-destructive`),children:c}):null]})},e.environmentId)},t[25]=n.length,t[26]=o,t[27]=u,t[28]=i,t[29]=r,t[30]=s,t[31]=e):e=t[31],P=n.map(e),t[18]=n,t[19]=o,t[20]=u,t[21]=i,t[22]=r,t[23]=s,t[24]=P}else P=t[24];let F;t[32]===n.length?F=t[33]:(F=n.length===0?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No environments connected.`}):null,t[32]=n.length,t[33]=F);let I;t[34]!==d||t[35]!==s?(I=s&&d?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`Totals are partial while selected environments scan.`}):null,t[34]=d,t[35]=s,t[36]=I):I=t[36];let L;t[37]!==m||t[38]!==f||t[39]!==r||t[40]!==s?(L=s?(0,$.jsx)(mr,{environments:r,duplicateSources:f,contractMismatches:m}):null,t[37]=m,t[38]=f,t[39]=r,t[40]=s,t[41]=L):L=t[41];let R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(w,{}),t[42]=R):R=t[42];let z;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(h,{"aria-hidden":!0}),t[43]=z):z=t[43];let B;t[44]===g?B=t[45]:(B=(0,$.jsxs)(E,{onClick:g,children:[z,`Model prices`]}),t[44]=g,t[45]=B);let V;t[46]!==F||t[47]!==I||t[48]!==L||t[49]!==B||t[50]!==M||t[51]!==P?(V=(0,$.jsxs)(C,{align:`start`,children:[M,N,P,F,I,L,R,B]}),t[46]=F,t[47]=I,t[48]=L,t[49]=B,t[50]=M,t[51]=P,t[52]=V):V=t[52];let H;return t[53]!==V||t[54]!==A?(H=(0,$.jsxs)(p,{children:[A,V]}),t[53]=V,t[54]=A,t[55]=H):H=t[55],H}function br(e){return e.environmentId}function xr(e){return e.error!==null}function Sr(e){let t=(0,Q.c)(23),{hiddenProviders:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=Ue.filter(e=>!n.has(e)),t[0]=n,t[1]=i);let a=i,o=a.length===Ue.length?`All providers`:a.length===0?`No providers`:a.length===1?Ge[a[0]].label:`${a.length} providers`,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(v,{}),t[2]=s):s=t[2];let u;t[3]===o?u=t[4]:(u=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:o}),t[3]=o,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(c,{className:`size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/usage-provider:opacity-100 group-focus-visible/usage-provider:opacity-100 group-data-popup-open/usage-provider:opacity-100`,"aria-hidden":!0}),t[5]=d):d=t[5];let f;t[6]===u?f=t[7]:(f=(0,$.jsxs)(_,{render:s,className:`group/usage-provider min-w-0 max-w-full`,children:[u,d]}),t[6]=u,t[7]=f);let m=n.size===0,h;t[8]===r?h=t[9]:(h=e=>r(e?[]:Ue),t[8]=r,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,$.jsx)(l,{checked:m,closeOnClick:!1,onCheckedChange:h,children:`All providers`}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(w,{}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==r?(b=Ue.map(e=>(0,$.jsx)(l,{checked:!n.has(e),closeOnClick:!1,onCheckedChange:t=>r(Ue.filter(r=>r===e?!t:n.has(r))),children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(dr,{provider:e,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`truncate`,children:Ge[e].label})]})},e)),t[14]=n,t[15]=r,t[16]=b):b=t[16];let x;t[17]!==b||t[18]!==g?(x=(0,$.jsxs)(C,{align:`start`,children:[g,y,b]}),t[17]=b,t[18]=g,t[19]=x):x=t[19];let S;return t[20]!==x||t[21]!==f?(S=(0,$.jsxs)(p,{children:[f,x]}),t[20]=x,t[21]=f,t[22]=S):S=t[22],S}function Cr(){let e=(0,Q.c)(7),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`h-10 w-36`}),(0,$.jsx)(X,{className:`h-4 w-32`})]}),Ue.map(wr)]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(X,{className:`h-5 w-24`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[t,(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n,(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`ml-16 h-56`}),(0,$.jsx)(X,{className:`ml-16 h-4`})]})]})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[i,(0,$.jsx)(Tr,{labels:[`Processed tokens`,`Cached input`,`Uncached input`,`Output`,`Cache savings`]})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`section`,{className:`grid gap-x-12 gap-y-8 lg:grid-cols-2`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsx)(X,{className:`h-5 w-28`}),(0,$.jsx)(X,{className:`h-2`}),(0,$.jsx)(X,{className:`h-4 w-72`})]})}),e[5]=o):o=e[5];let s;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)($.Fragment,{children:[r,a,o,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(X,{shape:`card`,className:`h-7 w-28`})]}),(0,$.jsx)(X,{className:`h-44`})]})]}),e[6]=s):s=e[6],s}function wr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(X,{shape:`pill`,className:`size-2 shrink-0`}),(0,$.jsx)(X,{shape:`pill`,className:`size-4 shrink-0`}),(0,$.jsx)(X,{className:`h-3.5 w-20`})]}),(0,$.jsx)(X,{className:`h-3.5 w-14`})]}),(0,$.jsx)(X,{className:`h-4 w-36`})]},e)}function Tr(e){let t=(0,Q.c)(4),{labels:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Er),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:r}),t[2]=r,t[3]=i),i}function Er(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,$.jsx)(X,{className:`h-6 w-16`})]},e)}var Dr=or;export{Dr as component};
|
|
2
|
+
//# sourceMappingURL=usage-DfkVwFPy.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ba as e,va as t}from"./src-aYUfWMsw.js";function n(n){if(n.hasSessionError)return{canReadDiagnostics:!1,isPending:!1,error:`Could not check this connection's access to diagnostics and usage.`};if(n.session===null){let e=n.connectionPhase===`connected`||n.connectionPhase===`connecting`||n.connectionPhase===`reconnecting`;return{canReadDiagnostics:!1,isPending:e,error:e?null:`This environment is not connected.`}}let r=e(n.session,t);return{canReadDiagnostics:r,isPending:!1,error:r?null:`This connection does not have access to diagnostics and usage.`}}export{n as t};
|
|
2
|
+
//# sourceMappingURL=usageAccess-DGGNF6kP.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ta as e}from"./src-aYUfWMsw.js";var t=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),n=new Intl.NumberFormat(`en-US`);function r(e){return t.format(e)}function i(e){return n.format(Math.round(e))}function a(e){let t=Math.abs(e);return t>=0xe8d4a51000?`${o(e/0xe8d4a51000)}T`:t>=1e9?`${o(e/1e9)}B`:t>=1e6?`${o(e/1e6)}M`:t>=1e3?`${o(e/1e3)}K`:n.format(Math.round(e))}function o(e){let t=Math.abs(e),n=t>=100?0:t>=10?1:2;return e.toFixed(n).replace(/\.0+$/,``)}function s(e,t=1){let n=e*100,r=10**-t;return n>0&&n<r?`<${r.toFixed(t)}%`:`${n.toFixed(t)}%`}function c(e,t){return t.direction===`serverBehind`?`${e} runs an older server version and is excluded from totals.`:`This client is older than the server on ${e}; its usage is excluded from totals.`}function l(e){let[t,n,r]=e.split(`-`).map(e=>Number(e));return t===void 0||n===void 0||r===void 0?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][n-1]??``} ${r}`}function u(e,t){let n=[],r=Date.parse(`${e}T00:00:00Z`),i=Date.parse(`${t}T00:00:00Z`);if(Number.isNaN(r)||Number.isNaN(i)||i<r)return n;for(let e=r;e<=i;e+=864e5)n.push(new Date(e).toISOString().slice(0,10));return n}var d=36e5,f=new Map;function p(e,t){if(t.timeZone===void 0)return new Intl.DateTimeFormat(e,t);let n=JSON.stringify([e,t]),r=f.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),f.size>=16&&f.clear(),f.set(n,r)),r}function m(e,t){let n=[],r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i)||i<=r)return n;for(let e=r;e<i;e+=d)n.push(new Date(e).toISOString());return n}function h(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;let r=t===void 0?{}:{timeZone:t},i=p(`en-US`,{...r,hour:`numeric`}),a=p(`en-CA`,{...r,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,hourCycle:`h23`}),o=a.format(n);return[-36e5,d].some(e=>a.format(new Date(n.getTime()+e))===o)?p(`en-US`,{...t===void 0?{}:{timeZone:t},hour:`numeric`,timeZoneName:`short`}).format(n):i.format(n)}function g(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e:p(`en-US`,{...t===void 0?{}:{timeZone:t},month:`short`,day:`numeric`,hour:`numeric`}).format(n)}function _(e,t,n){let r=new Date(e),i=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(i.getTime()))return g(e,n);let a=p(`en-CA`,{...n===void 0?{}:{timeZone:n},year:`numeric`,month:`2-digit`,day:`2-digit`}),o=Date.parse(`${a.format(r)}T00:00:00Z`),s=Date.parse(`${a.format(i)}T00:00:00Z`),c=Math.round((s-o)/(24*d)),l=h(e,n);return c===0?`${l} today`:c===1?`${l} yesterday`:g(e,n)}function v(t,n=new Date,r=`day`){let i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,a;try{a=new Intl.DateTimeFormat(`en-CA`,{timeZone:i,year:`numeric`,month:`2-digit`,day:`2-digit`})}catch{i=`UTC`,a=new Intl.DateTimeFormat(`en-CA`,{timeZone:`UTC`,year:`numeric`,month:`2-digit`,day:`2-digit`})}let o=a.format(n);if(r===`hour`){let t=Math.floor(n.getTime()/6e4)*6e4,o=t-24*d,s=new Date(o),c=new Date(t);return{sinceDay:e.make(a.format(s)),untilDay:e.make(a.format(c)),timeZone:i,resolution:r,sinceTime:s.toISOString(),untilTime:c.toISOString()}}let[s=0,c=1,l=1]=o.split(`-`).map(e=>Number.parseInt(e,10)),u=new Date(Date.UTC(s,c-1,l-(t-1)));return{sinceDay:e.make(u.toISOString().slice(0,10)),untilDay:e.make(o),timeZone:i,resolution:r}}export{l as a,_ as c,r as d,v as f,g as i,a as l,m as n,h as o,i as r,s,u as t,c as u};
|
|
2
|
+
//# sourceMappingURL=usageFormat-DvpnUmwI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e}from"./keybindings-
|
|
2
|
-
//# sourceMappingURL=usageShortcuts-
|
|
1
|
+
import{_ as e}from"./keybindings-CCmLKtII.js";var t=[{value:`cost`,label:`Cost`,command:`usage.cost`},{value:`tokens`,label:`Tokens`,command:`usage.tokens`},{value:`limits`,label:`Limits`,command:`usage.limits`}],n=[{days:1,label:`Past 24h`,command:`usage.period.day`},{days:7,label:`7 days`,command:`usage.period.week`},{days:30,label:`30 days`,command:`usage.period.month`},{days:90,label:`90 days`,command:`usage.period.quarter`}];function r(t,n){let r=t.target;return r instanceof HTMLElement&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.tagName===`SELECT`||r.isContentEditable||r.closest(`[role="dialog"], [aria-modal="true"], [data-slot$="popup"]`))?null:e(t,n,{context:{usagePageOpen:!0}})}export{n,r,t};
|
|
2
|
+
//# sourceMappingURL=usageShortcuts-BefcatkO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{
|
|
2
|
-
//# sourceMappingURL=use-atom-command-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Yo as r}from"./utils-CtzgibkN.js";import{wr as i}from"./runtime-DciS6GP9.js";var a=n(),o=e(t(),1);function s(e,t){let n=(0,a.c)(6),s=(0,o.useContext)(r),c=typeof t==`string`?t:t?.label??e.label,l=typeof t==`string`?!0:t?.reportFailure??!0,u=typeof t==`string`?!0:t?.reportDefect??!0,d;return n[0]!==e||n[1]!==c||n[2]!==s||n[3]!==u||n[4]!==l?(d=t=>i(s,e,t,{label:c,reportFailure:l,reportDefect:u}),n[0]=e,n[1]=c,n[2]=s,n[3]=u,n[4]=l,n[5]=d):d=n[5],d}export{s as t};
|
|
2
|
+
//# sourceMappingURL=use-atom-command-Bfi4daMj.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{
|
|
2
|
-
//# sourceMappingURL=useAriaLabelledBy-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{Na as n,Ua as r}from"./utils-CtzgibkN.js";var i=e(t());function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=n(c?`${c}-label`:void 0),f=e??t??l;return r(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
|
|
2
|
+
//# sourceMappingURL=useAriaLabelledBy-DjrGw7Iw.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{C as r,D as i,Jo as a,Js as o,Wo as s,Ys as c,c as l,g as u,i as d,qs as f,s as p}from"./utils-CtzgibkN.js";import{Nn as m,x as h}from"./src-aYUfWMsw.js";import{Mn as g,Sr as _,Vn as v,bt as ee,pt as y,xr as b}from"./runtime-DciS6GP9.js";import{C as x,O as S,d as C,f as te,l as ne,u as re}from"./entities-CNmVqAZs.js";import{a as ie,t as ae}from"./useParams-qFbmBdAa.js";import{f as w}from"./relay-DcCuBtiq.js";import{s as T}from"./useSettings-CnHpxSBo.js";import{n as oe}from"./server-DKB_3xTN.js";import{p as E}from"./session-logic-lUPcTQRy.js";import{a as D,i as O,n as k,o as A}from"./threadSort-Bd2rijEy.js";import{c as j,r as M}from"./projectFilesQueryState-CXzO_JXd.js";import{d as N,f as P,i as F,r as se,s as ce,t as I}from"./p4ProjectFile-CZQao9GZ.js";import{r as L,t as R}from"./uiStateStore-Cyle2Grh.js";var z=e(t(),1),B=n(),V=`[data-thread-item], [data-thread-selection-safe]`,H=3,U=160;function W(e){let t=(0,B.c)(6),[n,r]=z.useState(null),[i,a]=z.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${U}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),z.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function G(e,t){let n=z.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function K(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function q(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(_(i))break;n??=i}else t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function J(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i)n.push(o);else return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function Y(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function le(e,t,n){let r=ee(e);return e.filter(e=>e.archivedAt===null&&!y({environmentId:e.environmentId,threadId:e.id},e.lineage,n)&&r(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var ue={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function de(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{n?r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs)):(a(),r&&(r=!1,e.onVisibilityChange(!1)))},dispose:()=>{a()}}}function fe(){let e=(0,B.c)(5),[t,n]=z.useState(!1),r=z.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=de({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),z.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function pe(e,t){return e===void 0?t:e??void 0}function me(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function he(e){return e===null||!e.closest(V)}function ge(e){return e>1}function _e(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function ve(e){return typeof e!=`object`||!e?!1:_e(e,`a[href]`)!==null||_e(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function ye(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function be(e,t=H){return e.slice(0,Math.max(0,t))}function xe(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function Se(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Ce(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function we(e,t){let n=D(e,t),r=n.filter(e=>e.pinnedAt!=null);return r.length===0?n:[...O(r),...n.filter(e=>e.pinnedAt==null)]}function Te(e,t){let n=l(t);if(n.length===0)return!1;let r=l(v(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function Ee(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:g(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&E(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:me(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function De(e){let t=null;for(let n of e)n!==null&&(t===null||ue[n.label]>ue[t.label])&&(t=n);return t}function Oe(e,t){return t.projectExpanded?t.isThreadListExpanded||e.length<=t.previewCount?e:e.slice(0,t.previewCount):[]}function ke(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);return a?D(i.filter(e=>e.projectId===a.projectId&&e.id!==t&&!n?.has(e.id)),r)[0]?.id??null:null}function Ae(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,k(t,n)),-1/0):n===`created_at`?A(e.createdAt)??-1/0:A(e.updatedAt??e.createdAt)??-1/0}function X(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Ae(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function je(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return X(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function Me(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return X(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function Ne(e,t,n,r){return Me(e,le(t,null,r),n)}function Pe(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return X(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function Z(e){return e.envMode!==`local`&&e.newWorktreesStartFromOrigin}function Fe(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function Ie(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function Le(e){return e.activeThread?f(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?f(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function Re(e){let t=Le(e);return t?(await e.handleNewThread(t),!0):!1}async function ze(e,t){let n=await b(s,M(e,t,h),{reportDefect:!1,reportFailure:!1}),r=j(e,t,h,j(e,t,n._tag===`Success`?n.value.relativePath:h,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:I(r.contents)}function Q(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function $(){let e=(0,B.c)(7),t=a(oe),n=T(P),s=ie(),l;e[0]===s.state.matches?l=e[1]:(l=()=>{let e=s.state.matches[s.state.matches.length-1]?.params??{};return w(e)},e[0]=s.state.matches,e[1]=l);let f=l,h;return e[2]!==t||e[3]!==f||e[4]!==n||e[5]!==s?(h=(e,a)=>{let l=re(),h=t.get(e.environmentId)?.settings??m,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:ee,applyStickyState:y,setDraftThreadContext:b,setLogicalProjectDraftThreadId:x,setModelSelection:S}=i.getState(),ie=s.state.location.href,ae=()=>s.state.location.href!==ie,w=f(),T=w?.kind===`server`?C(w.threadRef):null,oe=w?.kind===`draft`?v(w.draftId):null,E=w?g(w.kind===`server`?w.threadRef:w.draftId):null,D=E?.activeProvider??null,O=(D?E?.modelSelectionByProvider[D]??null:null)??T?.modelSelection??null,k=E?.interactionMode??T?.interactionMode??oe?.interactionMode??null,A=l.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),j=()=>ae()||A!==void 0&&ne(e)===null,M=F(h,A?.id??null,A),N=M.settings.defaultModelSelection,P=M.settings.defaultRuntimeMode,I=e=>Fe({projectDefaultSelection:N??null,carrySelection:O,carrySourceDraftId:w?.kind===`draft`?w.draftId:null,destinationDraftId:e}),L=async()=>{let n=A!==void 0&&M.settings.defaultThreadEnvMode===null?await ze(A.environmentId,A.workspaceRoot):null;return se({projectSettings:F(h,A?.id??null,A,n),workspaceRoot:A?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:te().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},R=A?ce(A,n):c(e),z=a?.branch!==void 0,B=a?.worktreePath!==void 0,V=a?.envMode!==void 0,H=a?.startFromOrigin!==void 0,U=_(R),W=U?o(U.environmentId,U.threadId):null,G=U!==null&&U.promotedTo==null&&W!==null&&C(W)===null?U:null;W&&G===null&&r(W);let K=G&&!u(g(G.draftId))?G:null,q=w?w.kind===`server`?ee(w.threadRef):v(w.draftId):null;if(K)return(async()=>{let t=w?.kind===`draft`&&w.draftId===K.draftId,n=z||B||V||H,r=null;if(n)r=Q(a);else if(!t){let e=await L();if(j())return null;let t=f(),n=t?.kind===`draft`&&t.draftId===K.draftId,i=W!==null&&C(W)!==null,a=_(R)?.draftId!==K.draftId,o=u(g(K.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:Z({envMode:e,newWorktreesStartFromOrigin:M.settings.newWorktreesStartFromOrigin})}}if(r&&b(K.draftId,{...r,...t?{}:{runtimeMode:P},...k?{interactionMode:k}:{}}),!Ie(g(K.draftId))){y(K.draftId);let e=I(K.draftId);e&&S(K.draftId,e,{replaceOptions:!0})}x(R,e,K.draftId,{threadId:K.threadId,...r,...t?{}:{runtimeMode:P},...k?{interactionMode:k}:{}});let i={draftId:K.draftId,threadId:K.threadId},o=f();return o?.kind===`draft`&&o.draftId===K.draftId||await s.navigate({to:`/draft/$draftId`,params:{draftId:K.draftId},replace:a?.replace??!1}),i})();if(q&&w?.kind===`draft`&&q.logicalProjectKey===R&&q.promotedTo==null&&!u(g(w.draftId)))return(z||B||V||H)&&b(w.draftId,Q(a)),x(R,e,w.draftId,{threadId:q.threadId,createdAt:q.createdAt,runtimeMode:q.runtimeMode,interactionMode:q.interactionMode,...Q(a)}),Promise.resolve({draftId:w.draftId,threadId:q.threadId});let J=d(),Y=p(),le=new Date().toISOString();return(async()=>{let t=a?.envMode??await L();if(j())return null;let n=_(R);if(n&&n.draftId!==U?.draftId&&C(o(n.environmentId,n.threadId))===null)return x(R,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...Q(a)}),await s.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:a?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};x(R,e,J,{threadId:Y,createdAt:le,branch:a?.branch??null,worktreePath:a?.worktreePath??null,envMode:t,startFromOrigin:a?.startFromOrigin??Z({envMode:t,newWorktreesStartFromOrigin:M.settings.newWorktreesStartFromOrigin}),runtimeMode:P,...k?{interactionMode:k}:{}}),y(J);let r=I(J);return r&&S(J,r,{replaceOptions:!0}),await s.navigate({to:`/draft/$draftId`,params:{draftId:J},replace:a?.replace??!1}),{draftId:J,threadId:Y}})()},e[2]=t,e[3]=f,e[4]=n,e[5]=s,e[6]=h):h=e[6],h}function Be(){let e=(0,B.c)(16),t=L(We),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:Ue},e[0]=n):n=e[0];let r=ae(n),a=r?.kind===`server`?r.threadRef:null,o=r?.kind===`draft`?r.draftId:null,s=S(a),c=i(He),l;e[1]!==c||e[2]!==r?(l=()=>r?r.kind===`server`?c(r.threadRef):i.getState().getDraftSession(r.draftId):null,e[1]=c,e[2]=r,e[3]=l):l=e[3];let u=i(l),d=x(),p;e[4]!==t||e[5]!==d?(p=ye({items:d,preferredIds:t,getId:N,getPreferenceIds:Ve}),e[4]=t,e[5]=d,e[6]=p):p=e[6];let m=p,h=$(),g;e[7]===m[0]?g=e[8]:(g=m[0]?f(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==u||e[10]!==s||e[11]!==h||e[12]!==o||e[13]!==a||e[14]!==g?(_={activeDraftThread:u,activeThread:s,defaultProjectRef:g,handleNewThread:h,routeDraftId:o,routeThreadRef:a},e[9]=u,e[10]=s,e[11]=h,e[12]=o,e[13]=a,e[14]=g,e[15]=_):_=e[15],_}function Ve(e){return[N(e),R(e.workspaceRoot)]}function He(e){return e.getDraftThread}function Ue(e){return w(e)}function We(e){return e.projectOrder}export{G as A,Ee as C,Pe as D,je as E,fe as M,Ne as O,pe as S,Me as T,xe as _,Le as a,K as b,Y as c,be as d,Se as f,Te as g,ye as h,Z as i,W as j,we as k,q as l,ge as m,$ as n,Re as o,ve as p,Ie as r,J as s,Be as t,ke as u,De as v,he as w,Ce as x,Oe as y};
|
|
2
|
+
//# sourceMappingURL=useHandleNewThread-idXLHXR7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{a as n,r,x as i}from"./useParams-
|
|
2
|
-
//# sourceMappingURL=useLocation-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{a as n,r,x as i}from"./useParams-qFbmBdAa.js";var a=e(t(),1);function o(e){let t=n(),o=(0,a.useRef)(void 0);return r(t.stores.location,n=>{let r=e?.select?e.select(n):n;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=i(o.current,r);return o.current=e,e}return r})}export{o as t};
|
|
2
|
+
//# sourceMappingURL=useLocation-fNQqSFar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{a as n}from"./useParams-
|
|
2
|
-
//# sourceMappingURL=useNavigate-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{a as n}from"./useParams-qFbmBdAa.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
|
|
2
|
+
//# sourceMappingURL=useNavigate-DwXZ6yA7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{a as r,r as i}from"./useParams-
|
|
2
|
-
//# sourceMappingURL=useNavigateBack-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{a as r,r as i}from"./useParams-qFbmBdAa.js";import{t as a}from"./useNavigate-DwXZ6yA7.js";function o(){let e=r();return i(e.stores.location,e=>e.state.__TSR_index!==0)}var s=n(),c=e(t(),1);function l(){let e=(0,s.c)(3),t=a(),n=o(),r;return e[0]!==n||e[1]!==t?(r=()=>{n?window.history.back():t({to:`/`})},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function u(e){let t=(0,s.c)(3),n=l(),r=e??n,i,a;t[0]===r?(i=t[1],a=t[2]):(i=()=>{let e=e=>{if(e.defaultPrevented||e.repeat||e.isComposing||e.key!==`Escape`)return;e.preventDefault();let t=document.activeElement;t instanceof HTMLElement&&t.blur(),r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},a=[r],t[0]=r,t[1]=i,t[2]=a),(0,c.useEffect)(i,a)}export{u as t};
|
|
2
|
+
//# sourceMappingURL=useNavigateBack-mLGu4w8K.js.map
|
package/dist/client/assets/{useP4ConnectAuthPrompt-Bj5GIxgy.js → useP4ConnectAuthPrompt-BXgvqiOd.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{t}from"./env-BfPir1X4.js";import{i as n}from"./dist-
|
|
2
|
-
//# sourceMappingURL=useP4ConnectAuthPrompt-
|
|
1
|
+
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{t}from"./env-BfPir1X4.js";import{i as n}from"./dist-C2W3DEZU.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
|
|
2
|
+
//# sourceMappingURL=useP4ConnectAuthPrompt-BXgvqiOd.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{
|
|
2
|
-
//# sourceMappingURL=useParams-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{ji as n}from"./utils-CtzgibkN.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function c(e){for(let t in e)if(o.call(e,t))return!0;return!1}var l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let s=a?e:f(e);if(!s)return i;let c=a?i:f(i);if(!c)return i;let l=s.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let s=a?t:c[t],u=e[s],f=i[s];if(u===f){m[s]=u,(a?t<l:o.call(e,s))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[s]=f;continue}let p=d(u,f,n,r+1);m[s]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!s.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!s.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function y(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function b(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function x(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return b(t)}var S=[`http:`,`https:`,`mailto:`,`tel:`];function C(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function w(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=x(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=x(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function T(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function E(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function D(){throw Error(`Invariant failed`)}var O=n(),k=e(t(),1),A=k.createContext(null);function j(e){return k.useContext(A)}var M=k.createContext(void 0),N=k.createContext(void 0);function P(e,t){return e===t}function F(e,t,n=P){let r=(0,k.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,k.useCallback)(()=>e?.get(),[e]);return(0,O.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var I={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function L(e){let t=j(),n=k.useContext(e.from?N:M),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=k.useRef(void 0);return F(i??I,n=>{if((e.shouldThrow??!0)&&!n&&D(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function R(e){return L({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}export{v as _,j as a,u as b,S as c,w as d,g as f,C as g,c as h,M as i,E as l,a as m,L as n,A as o,T as p,F as r,D as s,R as t,_ as u,y as v,d as x,r as y};
|
|
2
|
+
//# sourceMappingURL=useParams-qFbmBdAa.js.map
|
package/dist/client/assets/{usePermissionStatus-DaCu90iN.js → usePermissionStatus-CTyZ03Js.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{
|
|
2
|
-
//# sourceMappingURL=usePermissionStatus-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ll as i,mr as a}from"./utils-CtzgibkN.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(i,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
|
|
2
|
+
//# sourceMappingURL=usePermissionStatus-CTyZ03Js.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ea as r,Ga as i,Ja as a,Rr as o,Ta as s,Ua as c,Wa as l,aa as u,ka as d,la as f,zr as p}from"./utils-CtzgibkN.js";import{c as m,s as h}from"./useRender-BP5vR6yH.js";import{t as g}from"./usePreviousValue-Dx4Nv0v8.js";var _=e(t()),v=e(r());function y(e){let t=i(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=a(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r;return(u(n)!==s||u(r)!==c)&&(n=s,r=c),{width:n,height:r}}var b=()=>!0;function x(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=b,onMeasureLayout:o,onMeasureLayoutComplete:u,side:f,direction:p}=e,g=s(t,!0,!1),v=d(),x=_.useRef(null),E=_.useRef(null),D=_.useRef(!0),O=_.useRef(m),k=l(o),A=l(u),j=_.useMemo(()=>{let e=f===`top`,t=f===`left`;return p===`rtl`?(e||=f===`inline-end`,t||=f===`inline-end`):(e||=f===`inline-start`,t||=f===`inline-start`),e?{position:`absolute`,[f===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:h},[f,p]);c(()=>{if(!i||!a()||typeof ResizeObserver!=`function`){O.current=m,D.current=!0,x.current=null,E.current=null;return}if(!t||!n)return;O.current=C(t,j);let e=new ResizeObserver(e=>{let t=e[0];t&&(E.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),w(t,`auto`);let r=S(t,`position`,`static`),o=S(t,`transform`,`none`),s=S(t,`scale`,`1`),c=C(n,{"--available-width":`max-content`,"--available-height":`max-content`});function l(){r(),o(),c()}function u(){l(),s()}if(k?.(),D.current||x.current===null){T(n,`max-content`);let r=y(t);return x.current=r,T(n,r),u(),A?.(null,r),D.current=!1,()=>{e.disconnect(),O.current(),O.current=m}}w(t,`auto`),T(n,`max-content`);let d=x.current??E.current,f=y(t);if(x.current=f,!d)return T(n,f),u(),A?.(null,f),()=>{e.disconnect(),v.cancel(),O.current(),O.current=m};w(t,d),u(),A?.(d,f),T(n,f);let p=new AbortController;return v.request(()=>{w(t,f),g(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},p.signal)}),()=>{e.disconnect(),p.abort(),v.cancel(),O.current(),O.current=m}},[r,t,n,g,v,a,i,k,A,j])}function S(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function C(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(S(e,r,i));return n.length?()=>{n.forEach(e=>e())}:m}function w(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function T(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var E=e(n());function D(e){let{store:t,side:n,cssVars:r,children:i}=e,a=o(),u=t.useState(`activeTriggerElement`),m=t.useState(`activeTriggerId`),h=t.useState(`open`),y=t.useState(`payload`),b=t.useState(`mounted`),S=t.useState(`popupElement`),C=t.useState(`positionerElement`),w=g(h?u:null),T=j(m,y),D=_.useRef(null),[k,M]=_.useState(null),[N,P]=_.useState(null),F=_.useRef(null),I=_.useRef(null),L=s(F,!0,!1),R=d(),[z,B]=_.useState(null),[V,H]=_.useState(!1);c(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let U=l(()=>{F.current?.style.setProperty(`animation`,`none`),F.current?.style.setProperty(`transition`,`none`),I.current?.style.setProperty(`display`,`none`)}),W=l(e=>{F.current?.style.removeProperty(`animation`),F.current?.style.removeProperty(`transition`),I.current?.style.removeProperty(`display`),e&&B(e)}),G=_.useRef(null);c(()=>{if(u&&w&&u!==w&&G.current!==u&&D.current){M(D.current),H(!0);let e=A(w,u);P(e),R.request(()=>{v.flushSync(()=>{H(!1)}),L(()=>{M(null),B(null),D.current=null})}),G.current=u}},[u,w,k,L,R]),c(()=>{let e=F.current;if(!e)return;let t=f(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));D.current=t});let K=k!=null,q;q=K?(0,E.jsxs)(_.Fragment,{children:[(0,E.jsx)(`div`,{"data-previous":!0,inert:p(!0),ref:I,style:{...z?{[r.popupWidth]:`${z.width}px`,[r.popupHeight]:`${z.height}px`}:null,position:`absolute`},"data-ending-style":V?void 0:``},`previous`),(0,E.jsx)(`div`,{"data-current":!0,ref:F,"data-starting-style":V?``:void 0,children:i},T)]}):(0,E.jsx)(`div`,{"data-current":!0,ref:F,children:i},T),c(()=>{let e=I.current;e&&k&&e.replaceChildren(...Array.from(k.childNodes))},[k]),x({popupElement:S,positionerElement:C,mounted:b,content:y,onMeasureLayout:U,onMeasureLayoutComplete:W,side:n,direction:a});let J={activationDirection:O(N),transitioning:K};return{children:q,state:J}}function O(e){if(e)return`${k(e.horizontal,5,`right`,`left`)} ${k(e.vertical,5,`down`,`up`)}`}function k(e,t,n,r){return e>t?n:e<-t?r:``}function A(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function j(e,t){let[n,r]=_.useState(0),i=_.useRef(e),a=_.useRef(t),o=_.useRef(!1);return c(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{D as t};
|
|
2
|
+
//# sourceMappingURL=usePopupViewport-Dc46kF33.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{D as r,Jo as i,Wo as a,gs as o,qs as s,ws as c,xs as l}from"./utils-CtzgibkN.js";import{Cp as u,La as d,Ma as f,Ta as p,n as m,sh as h}from"./src-aYUfWMsw.js";import{Dr as g,_r as _,gr as v,t as y}from"./runtime-DciS6GP9.js";import{a as b,i as ee}from"./vcsRefInvalidation-BewBnMos.js";import{C as te}from"./entities-CNmVqAZs.js";import{a as x}from"./relay-DcCuBtiq.js";import{f as S,k as C,s as w}from"./useSettings-CnHpxSBo.js";import{i as T,n as E}from"./session-D_OiLzln.js";import{n as D}from"./query-DmYgeaGK.js";import{t as O}from"./use-atom-command-Bfi4daMj.js";import{d as k,l as A,u as j}from"./queries-BhrI_odm.js";import{t as M}from"./sourceControl-2E-torWB.js";import{r as N,w as P}from"./pullRequests-tu-Mn-gv.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-CAA5BrcO.js";import{n as ie}from"./useHandleNewThread-idXLHXR7.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-CZQao9GZ.js";import{t as z}from"./sidebarProjectGrouping-ManvShfB.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:m.gitResolvePullRequest}),preparePullRequestThread:v(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:m.gitPreparePullRequestThread,scheduler:b,concurrency:ee})}}var U=H(y),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,f),n=W[e.kind],r=i(A.stateAtom(e.scope)),s=r.operation===n,c=(0,B.useCallback)(()=>{A.resetError(a,e.scope,n)},[e.scope,n]),p=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return o(u(new d({requiredScope:f,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return l(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():A.track(a,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:s?r.error:null,isPending:s&&r.isRunning,resetError:c,run:p}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let a=i(r),o;return n[2]!==t||n[3]!==a.isRunning||n[4]!==a.operation?(o=a.isRunning&&a.operation!==null&&t.some(e=>W[e]===a.operation),n[2]=t,n[3]=a.isRunning,n[4]=a.operation,n[5]=o):o=n[5],o}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?o(u(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,s;return t[4]!==a||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),s;t[4]!==r||t[5]!==e?(s=async()=>{let t=K(e);return t===null?o(u(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==a.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:a.refresh},t[7]=c,t[8]=e,t[9]=a.refresh,t[10]=l):l=t[10],G(l)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),a;t[3]!==e.cwd||t[4]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=a):a=t[5];let s=D(a),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?o(u(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l=c,d;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(d={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=d):d=t[12],G(d)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),s;t[4]!==r||t[5]!==e?(s=async t=>{let n=K(e);return n===null?o(u(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==a.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:a.refresh},t[7]=c,t[8]=e,t[9]=a.refresh,t[10]=l):l=t[10],G(l)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),i;t[1]!==r||t[2]!==e?(i=async t=>{let n=K(e);return n===null?o(u(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?o(u(new d({requiredScope:p,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,s;return t[4]!==a||t[5]!==e?(s={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=s):s=t[6],G(s)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:h(c(a.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=S(e,r),a=w(de),o=w(I),s=te(),c=C(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(N.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw g(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(N.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=P(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw g(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(P(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
|
|
2
|
+
`)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:n,detail:i}=e,a=ie(),o=i?.workspaceRoot??null,c;t[0]!==n||t[1]!==o?(c={environmentId:n,cwd:o},t[0]=n,t[1]=o,t[2]=c):c=t[2];let l=Y(c),[u,d]=(0,B.useState)(null),f;t[3]===a?f=t[4]:(f=async(e,t,n)=>{let i=n??await a(e).then(xe,be);if(i===null)return null;let o=r.getState();if(t===null)return i;let s=o.getComposerDraft(i.draftId),c=s?.reviewComments??[],l=re({prompt:s?.prompt??``,lastHandoffPrompt:$.get(i.draftId)},t.prompt);return $.set(i.draftId,t.prompt),o.setPrompt(i.draftId,l),o.setReviewComments(i.draftId,ne(c,t.reviewComments??[])),i},t[3]=a,t[4]=f);let p=f,m;t[5]!==i||t[6]!==n||t[7]!==u||t[8]!==p?(m=async(e,t)=>{if(!i||u!==null)return;d(e);let r=s(n,i.projectId),a=await p(r,t);d(null),a===null?x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):x.add({type:`success`,title:`Asked in a thread`,description:t.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},t[5]=i,t[6]=n,t[7]=u,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==i||t[11]!==n||t[12]!==u||t[13]!==a||t[14]!==p||t[15]!==l?(g=async(e,t,r)=>{let o=r===void 0?`worktree`:r;if(!i||u!==null)return;d(e);let c=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),f=s(n,i.projectId),m=await a(f).then(ye,ve);if(m===null){d(null),x.update(c,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await l.run({reference:i.url,mode:o,threadId:m.threadId});if(h._tag===`Failure`){d(null);let e=l.error instanceof Error?l.error.message:null;x.update(c,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await a(f,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){d(null),x.update(c,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}d(null);let g={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};t===null?x.update(c,h.value.isOnPullRequestHead?{type:`success`,title:o===`local`?`Checked out here`:`Checked out`,description:o===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:g):(await p(f,t,m),x.update(c,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g))},t[10]=i,t[11]=n,t[12]=u,t[13]=a,t[14]=p,t[15]=l,t[16]=g):g=t[16];let _=g,v;return t[17]!==u||t[18]!==h||t[19]!==_?(v={handoff:u,startAsk:h,startHandoff:_},t[17]=u,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
|
|
3
|
+
//# sourceMappingURL=usePullRequestActions-DJ1WiiLA.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{Ua as n,Un as r}from"./utils-CtzgibkN.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=r(),l=i.useRef(null);l.current||=Symbol(),n(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
|
|
2
|
+
//# sourceMappingURL=useRegisterFieldControl-BL6Ml_ar.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r)}return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}var i=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,a=r,o=(e,t)=>n=>{if(t?.variants==null)return a(e,n?.class,n?.className);let{variants:r,defaultVariants:o}=t,s=Object.keys(r).map(e=>{let t=n?.[e],a=o?.[e];if(t===null)return null;let s=i(t)||i(a);return r[e][s]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return a(e,s,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...c}[t]):{...o,...c}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},s=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},c=(e,t)=>({classGroupId:e,validator:t}),l=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),u=`-`,d=[],ee=`arbitrary..`,f=e=>{let t=h(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return m(e);let n=e.split(u);return p(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?s(i,t):t:i||d}return n[e]||d}}},p=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=p(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(u):e.slice(t).join(u),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},m=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ee+r:void 0})(),h=e=>{let{theme:t,classGroups:n}=e;return te(n,t)},te=(e,t)=>{let n=l();for(let r in e){let i=e[r];g(i,n,r,t)}return n},g=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];_(i,t,n,r)}},_=(e,t,n,r)=>{typeof e==`string`?v(e,t,n):typeof e==`function`?ne(e,t,n,r):re(e,t,n,r)},v=(e,t,n)=>{let r=e===``?t:y(t,e);r.classGroupId=n},ne=(e,t,n,r)=>{b(e)?g(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(c(n,e)))},re=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];g(o,y(t,a),n,r)}},y=(e,t)=>{let n=e,r=t.split(u),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=l(),n.nextPart.set(t,i)),n=i}return n},b=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,x=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},S=`!`,ie=`:`,C=[],ae=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),oe=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ie){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(S)?(c=s.slice(0,-1),l=!0):s.startsWith(S)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ae(t,l,c,u)};if(t){let e=t+ie,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ae(C,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},w=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},T=e=>({cache:x(e.cacheSize),parseClassName:oe(e),sortModifiers:w(e),postfixLookupClassGroupIds:E(e),...f(e)}),E=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},se=/\s+/,ce=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(se),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:ee,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let m=!!p,h;if(m){h=r(f.substring(0,p));let e=h&&o[h]?r(f):void 0;e&&e!==h&&(h=e,m=!1)}else h=r(f);if(!h){if(!m||(h=r(f),!h)){l=t+(l.length>0?` `+l:l);continue}m=!1}let te=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),g=ee?te+S:te,_=g+h;if(s.indexOf(_)>-1)continue;s.push(_);let v=i(h,m);for(let e=0;e<v.length;++e){let t=v[e];s.push(g+t)}l=t+(l.length>0?` `+l:l)}return l},D=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=le(n))&&(i&&(i+=` `),i+=r);return i},le=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=le(e[r]))&&(n&&(n+=` `),n+=t);return n},O=(e,...t)=>{let n,r,i,a,o=o=>(n=T(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ce(e,n);return i(e,a),a};return a=o,(...e)=>a(D(...e))},ue=[],k=e=>{let t=t=>t[e]||ue;return t.isThemeGetter=!0,t},A=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,j=/^\((?:(\w[\w-]*):)?(.+)\)$/i,M=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,N=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,de=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>M.test(e),L=e=>!!e&&!Number.isNaN(Number(e)),R=e=>!!e&&Number.isInteger(Number(e)),pe=e=>e.endsWith(`%`)&&L(e.slice(0,-1)),z=e=>N.test(e),me=()=>!0,B=e=>de.test(e)&&!P.test(e),V=()=>!1,H=e=>fe.test(e),he=e=>F.test(e),ge=e=>!U(e)&&!K(e),_e=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ve=e=>J(e,Me,V),U=e=>A.test(e),W=e=>J(e,Ne,B),ye=e=>J(e,Pe,L),be=e=>J(e,Ie,me),xe=e=>J(e,Fe,V),Se=e=>J(e,Ae,V),Ce=e=>J(e,je,he),G=e=>J(e,Le,H),K=e=>j.test(e),q=e=>Y(e,Ne),we=e=>Y(e,Fe),Te=e=>Y(e,Ae),Ee=e=>Y(e,Me),De=e=>Y(e,je),Oe=e=>Y(e,Le,!0),ke=e=>Y(e,Ie,!0),J=(e,t,n)=>{let r=A.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Y=(e,t,n=!1)=>{let r=j.exec(e);return r?r[1]?t(r[1]):n:!1},Ae=e=>e===`position`||e===`percentage`,je=e=>e===`image`||e===`url`,Me=e=>e===`length`||e===`size`||e===`bg-size`,Ne=e=>e===`length`,Pe=e=>e===`number`,Fe=e=>e===`family-name`,Ie=e=>e===`number`||e===`weight`,Le=e=>e===`shadow`,Re=()=>{let e=k(`color`),t=k(`font`),n=k(`text`),r=k(`font-weight`),i=k(`tracking`),a=k(`leading`),o=k(`breakpoint`),s=k(`container`),c=k(`spacing`),l=k(`radius`),u=k(`shadow`),d=k(`inset-shadow`),ee=k(`text-shadow`),f=k(`drop-shadow`),p=k(`blur`),m=k(`perspective`),h=k(`aspect`),te=k(`ease`),g=k(`animate`),_=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],v=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],ne=()=>[...v(),K,U],re=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],y=()=>[`auto`,`contain`,`none`],b=()=>[K,U,c],x=()=>[I,`full`,`auto`,...b()],S=()=>[R,`none`,`subgrid`,K,U],ie=()=>[`auto`,{span:[`full`,R,K,U]},R,K,U],C=()=>[R,`auto`,K,U],ae=()=>[`auto`,`min`,`max`,`fr`,K,U],oe=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],w=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],T=()=>[`auto`,...b()],E=()=>[I,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...b()],se=()=>[I,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...b()],ce=()=>[I,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...b()],D=()=>[e,K,U],le=()=>[...v(),Te,Se,{position:[K,U]}],O=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,Ee,ve,{size:[K,U]}],A=()=>[pe,q,W],j=()=>[``,`none`,`full`,l,K,U],M=()=>[``,L,q,W],N=()=>[`solid`,`dashed`,`dotted`,`double`],de=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[L,pe,Te,Se],fe=()=>[``,`none`,p,K,U],F=()=>[`none`,L,K,U],B=()=>[`none`,L,K,U],V=()=>[L,K,U],H=()=>[I,`full`,...b()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[z],breakpoint:[z],color:[me],container:[z],"drop-shadow":[z],ease:[`in`,`out`,`in-out`],font:[ge],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[z],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[z],shadow:[z],spacing:[`px`,L],text:[z],"text-shadow":[z],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,I,U,K,h]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,U]}],"container-named":[_e],columns:[{columns:[L,U,K,s]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:ne()}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:y()}],"overscroll-x":[{"overscroll-x":y()}],"overscroll-y":[{"overscroll-y":y()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{"inset-s":x(),start:x()}],end:[{"inset-e":x(),end:x()}],"inset-bs":[{"inset-bs":x()}],"inset-be":[{"inset-be":x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[R,`auto`,K,U]}],basis:[{basis:[I,`full`,`auto`,s,...b()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[L,I,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,L,K,U]}],shrink:[{shrink:[``,L,K,U]}],order:[{order:[R,`first`,`last`,`none`,K,U]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...oe(),`normal`]}],"justify-items":[{"justify-items":[...w(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...w()]}],"align-content":[{content:[`normal`,...oe()]}],"align-items":[{items:[...w(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...w(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...w(),`baseline`]}],"place-self":[{"place-self":[`auto`,...w()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mbs:[{mbs:T()}],mbe:[{mbe:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":b()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":b()}],"space-y-reverse":[`space-y-reverse`],size:[{size:E()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...E()]}],"min-w":[{"min-w":[s,`screen`,`none`,...E()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...E()]}],h:[{h:[`screen`,`lh`,...E()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...E()]}],"max-h":[{"max-h":[`screen`,`lh`,...E()]}],"font-size":[{text:[`base`,n,q,W]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ke,be]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,pe,U]}],"font-family":[{font:[we,xe,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,U]}],"line-clamp":[{"line-clamp":[L,`none`,K,ye]}],leading:[{leading:[a,...b()]}],"list-image":[{"list-image":[`none`,K,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...N(),`wavy`]}],"text-decoration-thickness":[{decoration:[L,`from-font`,`auto`,K,W]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[L,`auto`,K,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:b()}],"tab-size":[{tab:[R,K,U]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},R,K,U],radial:[``,K,U],conic:[R,K,U]},De,Ce]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-bs":[{"border-bs":M()}],"border-w-be":[{"border-be":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":M()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...N(),`hidden`,`none`]}],"divide-style":[{divide:[...N(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...N(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[L,K,U]}],"outline-w":[{outline:[``,L,q,W]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,Oe,G]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,Oe,G]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:M()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[L,W]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,ee,Oe,G]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[L,K,U]}],"mix-blend":[{"mix-blend":[...de(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[L]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[K,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[L]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,U]}],filter:[{filter:[``,`none`,K,U]}],blur:[{blur:fe()}],brightness:[{brightness:[L,K,U]}],contrast:[{contrast:[L,K,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,f,Oe,G]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,L,K,U]}],"hue-rotate":[{"hue-rotate":[L,K,U]}],invert:[{invert:[``,L,K,U]}],saturate:[{saturate:[L,K,U]}],sepia:[{sepia:[``,L,K,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,U]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[L,K,U]}],"backdrop-contrast":[{"backdrop-contrast":[L,K,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,L,K,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[L,K,U]}],"backdrop-invert":[{"backdrop-invert":[``,L,K,U]}],"backdrop-opacity":[{"backdrop-opacity":[L,K,U]}],"backdrop-saturate":[{"backdrop-saturate":[L,K,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,L,K,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[L,`initial`,K,U]}],ease:[{ease:[`linear`,`initial`,te,K,U]}],delay:[{delay:[L,K,U]}],animate:[{animate:[`none`,g,K,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[m,K,U]}],"perspective-origin":[{"perspective-origin":ne()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[K,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:ne()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[R,K,U]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,U]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[L,q,W,ye]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},ze=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(X(e,`cacheSize`,t),X(e,`prefix`,n),X(e,`experimentalParseClassName`,r),Be(e.theme,a.theme),Be(e.classGroups,a.classGroups),Be(e.conflictingClassGroups,a.conflictingClassGroups),Be(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),X(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),X(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),Ve(e.theme,i.theme),Ve(e.classGroups,i.classGroups),Ve(e.conflictingClassGroups,i.conflictingClassGroups),Ve(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),He(e,i,`postfixLookupClassGroups`),He(e,i,`orderSensitiveModifiers`),e),X=(e,t,n)=>{n!==void 0&&(e[t]=n)},Be=(e,t)=>{if(t)for(let n in t)X(e,n,t[n])},Ve=(e,t)=>{if(t)for(let n in t)He(e,t,n)},He=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},Ue=(e,...t)=>typeof e==`function`?O(Re,e,...t):O(()=>ze(Re(),e),...t),We=O(Re);function Ge(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Ke=Ge(`https://base-ui.com/production-error`,`Base UI`),Z=e(t()),qe={};function Je(e,t){let n=Z.useRef(qe);return n.current===qe&&(n.current=e(t)),n}function Ye(e,t,n,r){let i=Je(Ze).current;return Qe(i,e,t,n,r)&&et(i,[e,t,n,r]),i.callback}function Xe(e){let t=Je(Ze).current;return $e(t,e)&&et(t,e),t.callback}function Ze(){return{callback:null,cleanup:null,refs:[]}}function Qe(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function $e(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function et(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var tt=19;function nt(e){return tt>=e}function rt(e){if(!Z.isValidElement(e))return null;let t=e,n=t.props;return(nt(19)?n?.ref:t.ref)??null}function it(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function at(){}var ot=Object.freeze([]),Q=Object.freeze({});function st(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ct(e,t){return typeof e==`function`?e(t):e}function lt(e,t){return typeof e==`function`?e(t):e}var ut={};function dt(e,t,n,r,i){if(!n&&!r&&!i&&!e)return pt(t);let a=pt(e);return t&&(a=$(a,t)),n&&(a=$(a,n)),r&&(a=$(a,r)),i&&(a=$(a,i)),a}function ft(e){if(e.length===0)return ut;if(e.length===1)return pt(e[0]);let t=pt(e[0]);for(let n=1;n<e.length;n+=1)t=$(t,e[n]);return t}function pt(e){return _t(e)?{...vt(e,ut)}:mt(e)}function $(e,t){return _t(t)?vt(t,e):ht(e,t)}function mt(e){let t={...e};for(let e in t){let n=t[e];gt(e,n)&&(t[e]=bt(n))}return t}function ht(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=it(e.style,r);break;case`className`:e[n]=St(e.className,r);break;default:e[n]=gt(n,r)?yt(e[n],r):r}}return e}function gt(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function _t(e){return typeof e==`function`}function vt(e,t){return _t(e)?e(t):e??ut}function yt(e,t){return t?e?(...n)=>{let r=n[0];if(Ct(r)){let i=r;xt(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:bt(t):e}function bt(e){return e&&((...t)=>{let n=t[0];return Ct(n)&&xt(n),e(...t)})}function xt(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function St(e,t){return t?e?t+` `+e:t:e}function Ct(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function wt(e,t,n={}){let r=t.render,i=Tt(t,n);return n.enabled===!1?null:Ot(e,r,i,n.state??Q)}function Tt(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Q,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ct(n,a):void 0,d=l?lt(r,a):void 0,ee=l?st(a,c):Q,f=l&&s?Et(s):void 0,p=l?it(ee,f)??{}:Q;return typeof document<`u`&&(l?p.ref=Array.isArray(o)?Xe([p.ref,rt(i),...o]):Ye(p.ref,rt(i),o):Ye(null,null)),l?(u!==void 0&&(p.className=St(p.className,u)),d!==void 0&&(p.style=it(p.style,d)),p):Q}function Et(e){return Array.isArray(e)?ft(e):dt(void 0,e)}var Dt=Symbol.for(`react.lazy`);function Ot(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=dt(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Dt&&(i=Z.Children.toArray(t)[0]),Z.cloneElement(i,e)}if(e&&typeof e==`string`)return kt(e,n);throw Error(Ke(8))}function kt(e,t){return e===`button`?(0,Z.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,Z.createElement)(`img`,{alt:``,...t,key:t.key}):Z.createElement(e,t)}function At(e){return wt(e.defaultTagName??`div`,e,e)}export{lt as a,at as c,Je as d,Ke as f,a as g,o as h,dt as i,nt as l,We as m,wt as n,ot as o,Ue as p,xt as r,Q as s,At as t,Ye as u};
|
|
2
|
+
//# sourceMappingURL=useRender-BP5vR6yH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-
|
|
2
|
-
//# sourceMappingURL=useScopedModelAvailability-
|
|
1
|
+
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-CtzgibkN.js";import{D as i,i as a}from"./useSettings-CnHpxSBo.js";import{V as o}from"./settingsLayout-EWRSNE9F.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=n(r(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
|
|
2
|
+
//# sourceMappingURL=useScopedModelAvailability-CLTKL2Jf.js.map
|