@xopcai/xopc 0.0.427 → 0.0.430
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-D_DXNHba.js → activity-store-WqnVruhY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CjaQxFQt.js → agent-avatar-dicebear-CSiO9c2F.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-6Z4m31Fz.js → agent-avatar-display-D-yds6wG.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D4ClP_DJ.js → agent-defaults-settings-panel-_UT9C7bg.js} +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DVzYXsAy.js +1 -0
- package/dist/gateway/static/root/assets/{agents-B9slUA_1.js → agents-Ds7K3D7T.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-u5c3GREg.js → agents-admin-api-Bgv4lJ9Y.js} +1 -1
- package/dist/gateway/static/root/assets/{api-C3Tp9MkF.js → api-C-9J9ghT.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CRT9ZyH0.js → api-Dv6Cn-Rs.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-XqoIBF2H.js → app-management-settings-panel-BXJrrjH5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-9ZtqCASo.js → appearance-settings-oYjAVulT.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DUeu_7iC.js → apps-page-D95yzj-f.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BCQnOkV8.js → archive-plugin-DBPu3xCJ.js} +1 -1
- package/dist/gateway/static/root/assets/automation-api-DAou8Kji.js +1 -0
- package/dist/gateway/static/root/assets/{automation-result-state-CMfVTv_i.js → automation-result-state-CA7LV098.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-DIjI_Y1X.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-DMIyWsP0.js → automations-page-BQwSCkmd.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BUFTTjBq.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CIB5cbvQ.js → binary-plugins-D25P9ZxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CXdlNAmZ.js → block-editor-BI105p1U.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Fxo7HbK6.js → browser-automation-inputs-DhDRvWQE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Dn3LN5wo.js → browser-automations-page-CCPi1Bvy.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-CbbPvhHR.js → browser-control-api-BN4F-bM1.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-Cpm9fEPV.js → browser-settings-page-BZXUZpjp.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BEvywfF9.js → capabilities-LC-yEQYo.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-BCzsIzvC.js → capabilities-page-B8UgQ4dD.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Bxn8HtEO.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-u2z_KFRt.js +1 -0
- package/dist/gateway/static/root/assets/{channels-CA5z5dGY.js → channels-9Uaa-IN0.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-D8YS5amE.js → chat-agents-api-Cffxfzi1.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-B39npsXj.js → chat-chart-block-Bbk0b3TV.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-e-xCsrdS.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DjFnElAM.js → chat-terminal-dock-CQMuG-Bz.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-Dijix7V6.js → command-palette-api-BRxfFgGA.js} +1 -1
- package/dist/gateway/static/root/assets/composer-payload-handoff-_9L2A5AZ.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-MkqyKyf3.js → computer-settings-page-BIHbjBVt.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-BSvKP2u-.js → connected-providers-grid-B7ktDgqt.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DlIl9bLx.js → connector-service-page-BVMEg8n-.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DEJU8mgn.js → connectors-api-B07yoCzk.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-hPKaJUWY.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-BIfjfOTM.js → date-picker-BvEnSGZK.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DFNehTtd.js → desktop-pet-C1z9YDEg.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BDjsFown.js → desktop-pet-settings-CbbVb8GY.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-CeZZLOc6.js → dev-view-store-38EmUIEC.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DH_uJ698.js → device-pairing-wizard-Wb1EKiXA.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DiZXY7jF.js → directory-picker-path-field-BvKDrKc4.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BXqNuZnx.js → discussion-annotation-sync-BfVzIwe2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-myQqsol2.js → extension-debug-page-CB9Lu3Sq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-DaL-OcTw.js → extension-iframe-host-BzjrVAUR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DRBszrCR.js → extension-marketplace-api-DigziAgd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DvlGhZLa.js → extension-page-DUa9MeaZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-fOi6V6Cr.js → extension-provider-301x0rh-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DOGlQpkx.js → extension-settings-page-CP9ciZUI.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-DfkXvFnc.js → file-preview-surface-BaMGmCbw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BOCt_zOo.js → gateway-config-swr-BD4Bf8uu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BL_Cf0OQ.js → gateway-realtime-CSd9VB7Z.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bxkv62qs.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CHf8qY7H.js → gateway-restart-CIUCTKYR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Di41peSM.js → gateway-settings-CCqF1uZv.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CvkJYurV.js → gateway-startup-retry-BsU5k8oi.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BWMbKu72.js → global-defaults-api-asOZQeM8.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Bb_RC1O9.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Ce-IY7Ug.js → image-generation-api-CdwYgzhU.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-W7_cDbxy.js → imports-page-CVnoGUyp.js} +1 -1
- package/dist/gateway/static/root/assets/index-C5BhE5cA.js +11 -0
- package/dist/gateway/static/root/assets/index-Cz-VjTNd.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DWVl9ekV.js → install-connector-dialog-DXVOHMhS.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Doyu0Q9e.js → keyboard-shortcuts-settings-BCl90SrD.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-B3h3P6aI.js → local-app-workbench-page-CcJc9xLJ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-D6D2bZGW.js → local-apps-page-CdAKoWfg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BJ1B1dQ7.js → local-session-drafts-nRGeybku.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Br7IfbXK.js → locale-store-B7y-RVe8.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-qiXos_12.js → logs-page-McbSQwJI.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-C0WcSdK7.js → management-settings-BIR0BwNV.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Ck5s16p9.js → markdown-view-DFHa8rUg.js} +1 -1
- package/dist/gateway/static/root/assets/mcp-conversation-setup-page-Dwx4TuIr.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-Ba6vUE4J.js → media-plugins-BzzLV7wW.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYDkJvXj.js +3 -0
- package/dist/gateway/static/root/assets/model-selector-YsCHu1Gn.js +1 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-Bd-fYUrV.js → models-hub-cache-BUapaPTN.js} +1 -1
- package/dist/gateway/static/root/assets/new-chat-navigation-B6NPQ4h4.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-CnuxqWMd.js → note-detail-panel-CJ-dPovd.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-ClPkeHe5.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-8kp0X1x6.js → notes-api-ulup1oFS.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-XMdy-H3H.js → notes-page-BaFNplIr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-DMMdeaNd.js → oauth-api-DINa08-z.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-CfOK8mPM.js → oauth-provider-connect-C0PVEHC2.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CKlKWSJ7.js → page-context-capture-button-CGfR0dsc.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-LF33STHC.js → page-context-draft-DhRNxc0v.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-CoKMiYoi.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-D6CzIIfo.js → personal-avatar-DiVFO2Aw.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CIMMSI25.js → personal-page-Cvd-v9kT.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-wKdlrfPq.js → personal-settings-panel-Ds4ntiqu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CDhk5277.js → phone-dependencies-card-B3R6L5Qu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-DZ-ZunPz.js → phone-model-connection-BieYnAJ5.js} +1 -1
- package/dist/gateway/static/root/assets/phone-model-picker-Bkex4Sre.js +1 -0
- package/dist/gateway/static/root/assets/{phone-settings-page-0u0GQl_R.js → phone-settings-page-D8PuvEuJ.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-SN7hfddU.js → phone-workspace-store-Cmes9gQ4.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-Bfc-Wmrd.js → plugin-details-dialog-DblFhnuC.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BKeHZLXZ.js → preference-select-fields-D2-QfMN5.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BPur0vyo.js → product-automation-feedback-BzY3z8zu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Bfd7R483.js → product-open-page-BKw6H0Mn.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Bnq68oVw.js → product-preview-content-VcvxaO2S.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BPmTeweh.js → product-preview-modal-Ym6bomTW.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-CFbXWvcd.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-DLvxAoTT.js → project-understanding-CrSkrJnM.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BGy1pw9a.js → projects-page-Cp91_KzA.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-DOnNfkwQ.js → providers-api-CBSC3jdu.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-CHFJbqW1.js → recording-upload-DBHAGKZj.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DFDvOTg4.js → registry-api-QZEjziDq.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BVqwnOqO.js → remote-access-hub-BdXxFQfH.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-TQcRCpAg.js → resource-unavailable-BTNhcOHF.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-C-VRKwB1.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-9o3Wfji1.js → runtime-tools-api-BDTUD8Rj.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-ccVBG-bZ.js → runtime-tools-settings-panel-CYEzIrDf.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CNghOavt.js → service-recommendation-list-CfeYH6lK.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Bs3r_d2_.js → session-api-DVXLCZX2.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-Bnq3qpqy.js → session-manager-DjRWxXJG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CyBj1Xw2.js → sessions-page-C2CH-55n.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BMHe9uwy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-DwpPPxT0.js → settings-advanced-section-BmrbHgQa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CiRpsdTJ.js → settings-mode-store-Bk_hzwPK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Cd8Ermnn.js → settings-page-B6vrcc6f.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BZl4AMiN.js → settings-page-header-BLKI3_9N.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-onhEgq-K.js → settings-page-layout-BqBVrkC9.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-Cvvj6JyV.js → setup-interaction-page-BDPte58u.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-D4qgE7QM.js → setup-status-panel-DEefuWo3.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-DA0QuFOD.js → share-link-dialog-C2LyeNzj.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-YDpIY4dC.js → share-preview-page-BFwEr7Ws.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-D8Q-m46d.js → shares-api-CTFkLQxq.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DUvjOMmA.js → shares-settings-CpK3yhtc.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-uKU4sRiv.js → skill-api-DpicfA6o.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BzKzG-xG.js → skill-list-api-B8fegRLZ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DkUXekcd.js → skill-reload-api-VmC8ySUy.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-ClyNSh-7.js → skills-page-BIWXS6Ki.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BN6sUX0H.js → system-settings-panel-BmoA92oX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CC3Rzqq9.js +3 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-DKygspo2.js → task-result-evidence-BV-6hBVU.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DJVC7HqA.js → terminal-panel-store-BGdKE9hU.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Dlnmgryi.js → theme-store-Dvv79Wb2.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-Bs76WeoF.js → tracing-settings-page-B4uA4Pnz.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-B7nx0NQJ.js → tunnel-api-BurZtvqx.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-C4bblRnQ.js → understanding-activity-store-C1cLL8zq.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BvCj9-Ue.js → understanding-refresh-store-C3Lr_pjY.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-anU5gslJ.js → usage-page-C91ZzLm9.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-YHxQ-UZg.js → use-autosave-zkzRuUtx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DYY3Yz4a.js → use-composer-attachments-CoiQAgjo.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-CYgWzDnv.js → use-file-preview-expanded-DFzy6iVy.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-D2Un8G1L.js → use-personal-profile-BB10h9ED.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Dkg9tUr4.js → use-workspace-tree-sF5DcONt.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-WFnD5utO.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BUes-Jlp.js → voice-api-key-field-Bqa4PeZx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CrULrSKC.js → voice-config-api-LNO2xXHk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DFMNIyy4.js → voice-input-shortcut-events-AzfhxBX7.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-Dy4hfftb.js → voice-transcribe-api-Cb8i6dLb.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CFF4cRFl.js → work-discovery-overlay-CdQUiV-a.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BnYaVH3V.js → work-discovery-page-HcUloXxf.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-GFwVefVA.js → working-directory-picker-modal-Dv1HUipe.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-BdB4NEOh.js → workspace-api-Am2ee4R6.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CqHcVFhS.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-NRL3YRjg.js → workspace-file-preview-dialog-z5Q00v92.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Dcij7wvJ.js → workspace-open-location-menu-4ONYaGy0.js} +1 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-DimGN59n.js +1 -0
- package/dist/gateway/static/root/index.html +80 -80
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +1 -0
- package/dist/packages/gateway-contract/src/capabilities.js +6 -2
- package/dist/packages/gateway-contract/src/home.js +12 -2
- package/dist/src/agent/agent-manager.js +18 -18
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +12 -7
- package/dist/src/agent/background-review/run-background-review.js +24 -15
- package/dist/src/agent/child-agent-factory.js +2 -2
- package/dist/src/agent/coding/run-verification.d.ts +1 -0
- package/dist/src/agent/coding/run-verification.js +1 -1
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +7 -5
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.js +1 -1
- package/dist/src/agent/embedded/configuration-capability-correction.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
- package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +6 -6
- package/dist/src/agent/embedded/run-turn.js +42 -23
- package/dist/src/agent/embedded/session-runner.js +8 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js +1 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +4 -4
- package/dist/src/agent/external-tools/composio-provider.js +4 -4
- package/dist/src/agent/external-tools/endpoint-provider.js +6 -6
- package/dist/src/agent/external-tools/extension-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +3 -3
- package/dist/src/agent/external-tools/memory-provider.js +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +2 -2
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/independent-execution.js +2 -2
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/mcp/connection-drafts.d.ts +2 -1
- package/dist/src/agent/mcp/connection-drafts.js +4 -3
- package/dist/src/agent/mcp/connection-setup.d.ts +15 -1
- package/dist/src/agent/mcp/connection-setup.js +219 -106
- package/dist/src/agent/mcp/continuation-guard.d.ts +3 -0
- package/dist/src/agent/mcp/continuation-guard.js +54 -0
- package/dist/src/agent/mcp/continuation-input.d.ts +4 -0
- package/dist/src/agent/mcp/continuation-input.js +13 -0
- package/dist/src/agent/mcp/conversation-setup.d.ts +121 -2
- package/dist/src/agent/mcp/conversation-setup.js +275 -40
- package/dist/src/agent/mcp/discovery.d.ts +102 -0
- package/dist/src/agent/mcp/discovery.js +219 -0
- package/dist/src/agent/mcp/native-mcp.js +8 -1
- package/dist/src/agent/mcp/setup-plan.d.ts +76 -0
- package/dist/src/agent/mcp/setup-plan.js +93 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +2 -0
- package/dist/src/agent/mcp/tool-catalog.js +7 -1
- package/dist/src/agent/mcp/transport.d.ts +20 -0
- package/dist/src/agent/mcp/transport.js +188 -0
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/delegation-scope.d.ts +2 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
- package/dist/src/agent/prompt/conversational-configuration-guide.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
- package/dist/src/agent/prompt/system-prompt-params.js +1 -1
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +16 -12
- package/dist/src/agent/service/process-direct-streaming.js +7 -6
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +27 -23
- package/dist/src/agent/session/session-config-service.js +2 -2
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +8 -8
- package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +2 -2
- package/dist/src/agent/tool-manuals/xopc-configuration.js +37 -4
- package/dist/src/agent/tools/create-share-tool.js +2 -2
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/exec-command.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +20 -20
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +2 -2
- package/dist/src/agent/tools/index.js +4 -4
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/mcp-setup-tool.js +6 -2
- package/dist/src/agent/tools/personal-attention-tool.js +2 -2
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +4 -4
- package/dist/src/agent/tools/personal-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.js +5 -5
- package/dist/src/agent/tools/phone-use-tool.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +2 -2
- package/dist/src/agent/tools/web.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/xopc-use-tool.js +32 -11
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/api/routes.js +15 -7
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/read.js +31 -3
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +1 -1
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/domain/types.d.ts +2 -0
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.d.ts +7 -0
- package/dist/src/automations/service/automation-service.js +11 -4
- package/dist/src/automations/storage/automation-run-repository.d.ts +11 -2
- package/dist/src/automations/storage/automation-run-repository.js +28 -24
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension.js +2 -2
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +3 -3
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +5 -5
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +3 -3
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/flows.js +1 -1
- package/dist/src/computer/model-adapter.js +1 -1
- package/dist/src/computer/model-policy.js +1 -1
- package/dist/src/computer/runtime.js +4 -4
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.d.ts +6 -0
- package/dist/src/config/models-json.js +10 -5
- package/dist/src/config/schema.d.ts +3 -0
- package/dist/src/config/schema.js +3 -2
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -2
- package/dist/src/connectors/connected-source-understanding.js +5 -5
- package/dist/src/connectors/connection-recovery-service.js +4 -4
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/instances.js +1 -1
- package/dist/src/connectors/runtime-adapter-registry.js +2 -2
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/agent-plugins/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/setup.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/setup.js +1 -0
- package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/device-routes.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
- package/dist/src/gateway/hono/routes/models.js +16 -9
- package/dist/src/gateway/hono/routes/notes.js +3 -3
- package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +3 -2
- package/dist/src/gateway/hono/routes/phone.js +3 -2
- package/dist/src/gateway/hono/routes/projects.js +5 -5
- package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +5 -5
- package/dist/src/gateway/hono/routes/sessions.js +3 -3
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -6
- package/dist/src/gateway/hono/routes/user-model.js +7 -7
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/provider-model-setup.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +6 -7
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +44 -43
- package/dist/src/gateway/session-context-summary.js +4 -4
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +5 -2
- package/dist/src/home-intelligence/evidence-presentation.d.ts +3 -0
- package/dist/src/home-intelligence/evidence-presentation.js +30 -0
- package/dist/src/home-intelligence/generator.d.ts +8 -0
- package/dist/src/home-intelligence/generator.js +17 -6
- package/dist/src/home-intelligence/policy.js +3 -0
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/imports/inventory.js +2 -2
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/imports/runtime.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +9 -9
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/service.js +3 -3
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/memory-learning/repository.d.ts +6 -1
- package/dist/src/memory-learning/repository.js +10 -5
- package/dist/src/memory-learning/service.js +23 -1
- package/dist/src/memory-learning/source-learning.js +5 -5
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +3 -3
- package/dist/src/observability/runtime.d.ts +2 -0
- package/dist/src/observability/runtime.js +12 -1
- package/dist/src/personal-agent/capability-service.js +2 -2
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +7 -7
- package/dist/src/personal-agent/prompt-context.js +7 -7
- package/dist/src/personal-agent/prompts.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +9 -9
- package/dist/src/personal-agent/request-delivery.js +2 -2
- package/dist/src/personal-agent/request-service.js +7 -7
- package/dist/src/personal-agent/result-reader.js +1 -1
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/phone/contracts.d.ts +2 -0
- package/dist/src/phone/contracts.js +1 -0
- package/dist/src/phone/model-adapter.d.ts +1 -1
- package/dist/src/phone/model-adapter.js +30 -7
- package/dist/src/phone/model-policy.d.ts +4 -0
- package/dist/src/phone/model-policy.js +30 -0
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/runtime.js +4 -4
- package/dist/src/phone/structured-model.d.ts +6 -0
- package/dist/src/phone/structured-model.js +87 -0
- package/dist/src/process/mcp-stdio-supervisor.d.ts +1 -0
- package/dist/src/process/mcp-stdio-supervisor.js +14 -0
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-service.js +2 -2
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-catalog-types.d.ts +1 -1
- package/dist/src/providers/model-reference-auditor.js +3 -2
- package/dist/src/providers/presentation.js +5 -3
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +2 -2
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/store.js +5 -5
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/session-share-service.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/upgrades/261_session_input_task_origins.sql +6 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +2 -2
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/index.js +5 -5
- package/dist/src/tasks/task-allocation-service.js +5 -5
- package/dist/src/tasks/task-application-service.js +5 -5
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-contract-planner.js +2 -2
- package/dist/src/tasks/task-criterion-review-repository.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +4 -4
- package/dist/src/tasks/task-main-update-decision-service.js +3 -3
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-research-result.js +4 -4
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +3 -3
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -12
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui.js +5 -5
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-context/extraction/registry.js +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.d.ts +1 -0
- package/dist/src/user-model/capture/executor.js +7 -7
- package/dist/src/user-model/capture/semantic.d.ts +3 -0
- package/dist/src/user-model/capture/semantic.js +14 -4
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/voice/platform-catalog.d.ts +1 -1
- package/dist/src/voice/realtime/memory-context.js +5 -5
- package/dist/src/voice/realtime/omniRoute.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +4 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/bailian-plan-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/bailian-plan-speech.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/service.js +7 -7
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-m1A8wF9p.js +0 -1
- package/dist/gateway/static/root/assets/automation-api-hRsGx-qe.js +0 -1
- package/dist/gateway/static/root/assets/automation-task-card-Bur78p68.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-DEkDjxeU.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-Bo2qEJhH.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cr67ziwX.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-D92AWJbh.js +0 -72
- package/dist/gateway/static/root/assets/composer-payload-handoff-BQXlFKf4.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Vx8-MY0Y.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +0 -1
- package/dist/gateway/static/root/assets/home-page-B3sgqrl3.js +0 -2
- package/dist/gateway/static/root/assets/index-D4B6O8B3.js +0 -11
- package/dist/gateway/static/root/assets/index-DGWBJDAM.css +0 -1
- package/dist/gateway/static/root/assets/mcp-conversation-setup-page-CENs3hGU.js +0 -1
- package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +0 -3
- package/dist/gateway/static/root/assets/model-selector-DCBmsHzj.js +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-BFKZ7qJr.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +0 -1
- package/dist/gateway/static/root/assets/phone-model-picker-DuZc5jYO.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-D9nnyvrI.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-DI43HQV_.js +0 -2
- package/dist/gateway/static/root/assets/send-1f1Ntw6E.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CS9m7Ipo.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-DIgPL3tN.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +0 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-DC9aG7Pl.js +0 -1
|
@@ -6,10 +6,10 @@ import { getProviderAuthService, init_provider_auth_service } from "../../../pro
|
|
|
6
6
|
import { captureCloudUsageResponse } from "../../../usage/cloud-receipts.js";
|
|
7
7
|
import { cloudCreditBudgetHeaders, rejectUnbudgetedCloudTransport, reportCloudCreditError } from "../../../providers/xopc-cloud-credit-budget.js";
|
|
8
8
|
import { compareCatalogModels } from "../../../providers/model-catalog-ranking.js";
|
|
9
|
+
import { registerSpeechProvider } from "../speech-registry.js";
|
|
9
10
|
import { trackCloudCapabilityUsage } from "../../../usage/cloud-capability.js";
|
|
10
11
|
import { openPlatformTts } from "../../platform-streams.js";
|
|
11
12
|
import { requirePlatformVoiceModel } from "../../platform-catalog.js";
|
|
12
|
-
import { registerSpeechProvider } from "../speech-registry.js";
|
|
13
13
|
//#region src/voice/tts/providers/xopc-cloud-speech.ts
|
|
14
14
|
init_model_catalog_store();
|
|
15
15
|
init_voice();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { assertProviderUsage, init_model_usage, isProviderUsageScopeError } from "../../providers/model-usage.js";
|
|
4
|
-
import { parseTtsDirectives } from "./directives.js";
|
|
5
4
|
import { resolveSpeechProvider, resolveSpeechProviderChain } from "./factory.js";
|
|
5
|
+
import { parseTtsDirectives } from "./directives.js";
|
|
6
6
|
import { preprocessText } from "./preprocess.js";
|
|
7
7
|
import { summarizeForTts } from "./summarize.js";
|
|
8
8
|
//#region src/voice/tts/speak-core.ts
|
|
@@ -5,19 +5,19 @@ import { createContextEvidence } from "../storage/sqlite/context-evidence-reposi
|
|
|
5
5
|
import { ensureSessionRecord, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
6
6
|
import "../storage/sqlite/index.js";
|
|
7
7
|
import { ActivityService } from "../activity/service.js";
|
|
8
|
-
import {
|
|
8
|
+
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
9
9
|
import { init_session_key, resolveConversationId } from "../routing/session-key.js";
|
|
10
|
-
import {
|
|
11
|
-
import "../
|
|
10
|
+
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
11
|
+
import "../user-model/index.js";
|
|
12
|
+
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
13
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
12
14
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
13
15
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
14
16
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
15
17
|
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
16
|
-
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
17
|
-
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
18
|
-
import "../user-model/index.js";
|
|
19
|
-
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
20
18
|
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
19
|
+
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
20
|
+
import "../knowledge-memory/index.js";
|
|
21
21
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
22
22
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
23
23
|
import { clusterActivityTopics } from "../user-context/sources/activity-clustering.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,t as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as s,n as c,o as l}from"./locale-store-Br7IfbXK.js";import{t as u}from"./messages-ByFlEbsu.js";import{a as d,i as f,o as p,r as m,s as h,t as g}from"./dist-BGTk37IG.js";import{t as _}from"./arrow-left-D880xG-P.js";import{t as v}from"./chevron-down-ccbiQQz_.js";import{t as y}from"./working-directory-picker-modal-GFwVefVA.js";import{t as b}from"./circle-alert-BEjgurr2.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as te}from"./circle-BoO4YvTx.js";import{t as x}from"./file-archive-DanfQJNe.js";import{t as S}from"./folder-open-CyzJ19I9.js";import{t as ne}from"./loader-circle-CifKLtgG.js";import{t as re}from"./package-wATCyihJ.js";import{t as C}from"./shield-check-BU58siTV.js";import{t as w}from"./upload-rrb46c3c.js";import{t as T}from"./cn-0WouolD0.js";import{t as ie}from"./skeleton-BI5TyibZ.js";import{a as E}from"./vendor-swr-CdRzEUwF.js";import{t as D}from"./button-Cc4hUNTt.js";import{t as ae}from"./capability-links-DzQWK1Fh.js";import{t as O}from"./browser-BLJWD7WI.js";import{t as k}from"./capability-icon-DVoZxEgW.js";var oe=n(),A=r();function j(e){let t=(0,oe.c)(30),{data:n,zh:r}=e,i=r?`插件内容与范围`:`Contents and access`,a;t[0]===i?a=t[1]:(a=(0,A.jsx)(`h4`,{className:`font-medium text-fg`,children:i}),t[0]=i,t[1]=a);let o=r?`新增技能:`:`Skills: `,s;t[2]!==n.latestVersion.componentIndex?.skills||t[3]!==r?(s=n.latestVersion.componentIndex?.skills.join(`, `)||(r?`目录未提供清单`:`Not listed in catalog`),t[2]=n.latestVersion.componentIndex?.skills,t[3]=r,t[4]=s):s=t[4];let c;t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`p`,{children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l=r?`工具连接:`:`Tool connections: `,u;t[8]!==n.latestVersion.componentIndex?.mcpServers||t[9]!==r?(u=n.latestVersion.componentIndex?.mcpServers.map(M).join(`, `)||(r?`目录未提供清单`:`Not listed in catalog`),t[8]=n.latestVersion.componentIndex?.mcpServers,t[9]=r,t[10]=u):u=t[10];let d;t[11]!==l||t[12]!==u?(d=(0,A.jsxs)(`p`,{children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13];let f=r?`运行范围:`:`Runtime scope: `,p=n.latestVersion.riskTier===`local-exec`?r?`包含本机代码执行,可能访问本机文件或网络`:`Includes local code execution; may access local files or networks`:n.latestVersion.riskTier===`network`?r?`包含网络服务调用;数据范围取决于账号授权`:`Includes network service calls; data scope depends on authorization`:n.latestVersion.riskTier===`content`?r?`目录标记为内容能力`:`Catalog classifies this as content capabilities`:r?`目录未声明,请查看说明与来源`:`Not declared; review documentation and source`,m;t[14]!==p||t[15]!==f?(m=(0,A.jsxs)(`p`,{children:[f,p]}),t[14]=p,t[15]=f,t[16]=m):m=t[16];let h=r?`授权与来源`:`Authorization and source`,g;t[17]===h?g=t[18]:(g=(0,A.jsx)(`summary`,{className:`w-fit cursor-pointer rounded focus-visible:outline-accent`,children:h}),t[17]=h,t[18]=g);let _=r?`发布者认证只验证来源,不授予操作权限。账号授权与依赖需另行设置。未列出权限不代表没有文件或外部访问。`:`Publisher verification does not grant permissions. Accounts and dependencies require separate setup. Missing scope metadata does not mean no file or external access.`,v;t[19]===_?v=t[20]:(v=(0,A.jsx)(`p`,{className:`mt-2 leading-5`,children:_}),t[19]=_,t[20]=v);let y;t[21]!==g||t[22]!==v?(y=(0,A.jsxs)(`details`,{className:`text-xs`,children:[g,v]}),t[21]=g,t[22]=v,t[23]=y):y=t[23];let b;return t[24]!==m||t[25]!==y||t[26]!==a||t[27]!==c||t[28]!==d?(b=(0,A.jsxs)(`section`,{className:`mt-4 space-y-2 rounded-lg border border-edge p-4 text-sm text-fg-muted`,children:[a,c,d,m,y]}),t[24]=m,t[25]=y,t[26]=a,t[27]=c,t[28]=d,t[29]=b):b=t[29],b}function M(e){return`${e.name} (${e.transport})`}var N=e(O(),1),P=e(t(),1);function F(e){let t=(0,oe.c)(6),{fields:n,values:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=Object.entries(n),t[0]=n,t[1]=a);let o;return t[2]!==i||t[3]!==a||t[4]!==r?(o=(0,A.jsx)(A.Fragment,{children:a.map(e=>{let[t,n]=e;return(0,A.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[(0,A.jsxs)(`span`,{children:[n.title,n.required?` *`:``]}),n.type===`boolean`?(0,A.jsx)(`input`,{type:`checkbox`,checked:r[t]===!0,onChange:e=>i({...r,[t]:e.target.checked})}):(0,A.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,type:n.sensitive?`password`:n.type===`number`?`number`:`text`,required:n.required,autoComplete:`off`,value:String(r[t]??``),onChange:e=>i({...r,[t]:n.type===`number`?Number(e.target.value):e.target.value})})]},t)})}),t[2]=i,t[3]=a,t[4]=r,t[5]=o):o=t[5],o}function se(e){let t=(0,oe.c)(62),{account:n,fields:r,zh:i,busy:a,attempt:o,initialMethod:s,onBack:c,onConnect:l,onSave:u,onRedirect:d,onSkip:f}=e,[p,m]=(0,P.useState)(s&&n.methods.some(e=>e.id===s)?s:n.methods[0]?.id??``),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={},t[0]=h):h=t[0];let[g,v]=(0,P.useState)(h),[y,b]=(0,P.useState)(``),[ee,te]=(0,P.useState)(),x;t[1]===p?x=t[2]:(x=e=>e.id===p,t[1]=p,t[2]=x);let S=n.methods.find(x),re;t[3]===i?re=t[4]:(re=(e,t)=>i?e:t,t[3]=i,t[4]=re);let C=re,w=o?.challenge?.type===`qr`?o.challenge.url:void 0,T,E;t[5]===w?(T=t[6],E=t[7]):(T=()=>{let e=!1;return te(void 0),w&&N.toDataURL(w,{width:240,margin:2}).then(t=>{e||te(t)}).catch(L),()=>{e=!0}},E=[w],t[5]=w,t[6]=T,t[7]=E),(0,P.useEffect)(T,E);let ae;t[8]===o?ae=t[9]:(ae=o&&![`cancelled`,`error`,`connected`].includes(o.state),t[8]=o,t[9]=ae);let O=ae,k=o?.authorizationUrl??o?.challenge?.url,j=`连接 ${n.title}`,M=`Connect ${n.title}`,se;t[10]!==C||t[11]!==j||t[12]!==M?(se=C(j,M),t[10]=C,t[11]=j,t[12]=M,t[13]=se):se=t[13];let R;t[14]===C?R=t[15]:(R=C(`返回插件详情`,`Back to plugin details`),t[14]=C,t[15]=R);let z;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,A.jsx)(_,{className:`size-4`}),t[16]=z):z=t[16];let B;t[17]!==c||t[18]!==R?(B=(0,A.jsx)(D,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":R,children:z}),t[17]=c,t[18]=R,t[19]=B):B=t[19];let V;t[20]===C?V=t[21]:(V=C(`连接 `,`Connect `),t[20]=C,t[21]=V);let H;t[22]!==n.title||t[23]!==V?(H=(0,A.jsxs)(`h3`,{className:`text-base font-semibold`,children:[V,n.title]}),t[22]=n.title,t[23]=V,t[24]=H):H=t[24];let U;t[25]!==n.description||t[26]!==C?(U=n.description??C(`完成授权后自动检查连接。也可以稍后在详情页继续。`,`The connection is checked after authorization. You can also continue later in plugin details.`),t[25]=n.description,t[26]=C,t[27]=U):U=t[27];let W;t[28]===U?W=t[29]:(W=(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:U}),t[28]=U,t[29]=W);let G;t[30]!==H||t[31]!==W?(G=(0,A.jsxs)(`div`,{children:[H,W]}),t[30]=H,t[31]=W,t[32]=G):G=t[32];let K;t[33]!==B||t[34]!==G?(K=(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[B,G]}),t[33]=B,t[34]=G,t[35]=K):K=t[35];let q;t[36]!==n.methods||t[37]!==O||t[38]!==a||t[39]!==p||t[40]!==C?(q=n.methods.length>1?(0,A.jsx)(`div`,{role:`tablist`,"aria-label":C(`授权方式`,`Authorization methods`),className:`flex flex-wrap gap-2 rounded-lg bg-surface-inset p-1.5`,children:n.methods.map(e=>(0,A.jsx)(`button`,{role:`tab`,type:`button`,"aria-selected":p===e.id,className:`min-h-10 rounded-md px-3 text-sm ${p===e.id?`bg-surface-panel font-medium text-fg`:`text-fg-muted`}`,disabled:a||!!O,onClick:()=>{m(e.id),v({})},children:e.title},e.id))}):null,t[36]=n.methods,t[37]=O,t[38]=a,t[39]=p,t[40]=C,t[41]=q):q=t[41];let J=S?.instructions?.length||S?.helpUrl?(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge bg-surface-inset p-4 text-sm text-fg-muted`,children:[S.instructions?.length?(0,A.jsx)(`ol`,{className:`list-decimal space-y-2 pl-5`,children:S.instructions.map(I)}):null,S.helpUrl?(0,A.jsx)(`a`,{className:`text-accent underline`,href:S.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:C(`打开官方配置说明`,`Open setup instructions`)}):null]}):null,Y=(S?.type===`form`||S?.fields?.length)&&!O?(0,A.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),u(S.id,g)},children:[(0,A.jsx)(F,{fields:Object.fromEntries((S.fields??[]).filter(e=>r[e]).map(e=>[e,{...r[e],required:!0}])),values:g,onChange:v}),(0,A.jsxs)(D,{type:`submit`,disabled:a||!S.fields?.every(e=>g[e]!==void 0&&g[e]!==``),children:[a?(0,A.jsx)(ne,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,C(`保存并连接`,`Save and connect`)]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[O?null:(0,A.jsx)(D,{disabled:a,onClick:()=>l(p),children:C(`连接账号`,`Connect account`)}),O?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:o.challenge?.message??(o.state===`preparing`?C(`正在准备登录…`,`Preparing sign-in…`):C(`请完成登录,返回后会自动继续。`,`Finish signing in. Installation continues automatically.`))}):null,w&&O?ee?(0,A.jsx)(`img`,{src:ee,alt:C(`使用 ${n.title} 扫码授权`,`Scan to authorize ${n.title}`),className:`mx-auto size-60 max-w-full rounded-lg`}):(0,A.jsx)(ie,{className:`mx-auto size-60`}):null,k&&O?(0,A.jsx)(`a`,{href:k,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block text-sm text-accent underline`,children:w?C(`也可以打开授权页面`,`Or open the authorization page`):C(`打开登录页面`,`Open sign-in page`)}):null,o?.expiresAt&&O?(0,A.jsxs)(`p`,{className:`text-center text-xs text-fg-muted`,children:[C(`本次授权有效期至 `,`This sign-in expires at `),new Date(o.expiresAt).toLocaleTimeString()]}):null,o?.error?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:o.error}):null,o?.acceptsRedirect&&O?(0,A.jsxs)(`details`,{className:`text-sm`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:C(`登录后没有自动返回?`,`Did sign-in not return automatically?`)}),(0,A.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:e=>{e.preventDefault(),d(y)},children:[(0,A.jsxs)(`label`,{children:[C(`登录回调地址`,`Sign-in callback URL`),(0,A.jsx)(`input`,{value:y,onChange:e=>b(e.target.value),className:`mt-1 w-full rounded-lg border border-edge bg-surface-inset p-2`})]}),(0,A.jsx)(D,{type:`submit`,disabled:a||!y,children:C(`继续登录`,`Continue sign-in`)})]})]}):null]}),X;t[42]===C?X=t[43]:(X=C(`暂时跳过`,`Skip for now`),t[42]=C,t[43]=X);let Z;t[44]!==a||t[45]!==f||t[46]!==X?(Z=(0,A.jsx)(D,{variant:`secondary`,disabled:a,onClick:f,children:X}),t[44]=a,t[45]=f,t[46]=X,t[47]=Z):Z=t[47];let Q;t[48]===C?Q=t[49]:(Q=C(`相关功能暂不可用,可随时在插件详情中授权。`,`Features requiring this account stay unavailable. Connect later in plugin details.`),t[48]=C,t[49]=Q);let ce;t[50]===Q?ce=t[51]:(ce=(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Q}),t[50]=Q,t[51]=ce);let le;t[52]!==Z||t[53]!==ce?(le=(0,A.jsxs)(`div`,{className:`border-t border-edge pt-4`,children:[Z,ce]}),t[52]=Z,t[53]=ce,t[54]=le):le=t[54];let ue;return t[55]!==se||t[56]!==K||t[57]!==q||t[58]!==J||t[59]!==Y||t[60]!==le?(ue=(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":se,children:[K,q,J,Y,le]}),t[55]=se,t[56]=K,t[57]=q,t[58]=J,t[59]=Y,t[60]=le,t[61]=ue):ue=t[61],ue}function I(e,t){return(0,A.jsx)(`li`,{children:e},t)}function L(){}async function R(e,t=`GET`,n){let r=await l(s(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function z({extension:e,zh:t,onChanged:n,onStart:r,onInstalled:i,initialConnect:o=!1}){let s=`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,[c,l]=(0,P.useState)(),[u,d]=(0,P.useState)({}),[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(``),[g,_]=(0,P.useState)({}),[v,y]=(0,P.useState)(null),[x,S]=(0,P.useState)(``),[re,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(!1),E=(0,P.useRef)(new Set),ae=(0,P.useRef)(new Set),O=(0,P.useRef)(void 0),k=(0,P.useRef)(null),oe=(0,P.useRef)(new Set),j=(e,n)=>t?e:n,M=e.setup?.authorizations??[],N=new Set(M.flatMap(e=>e.servers)),I=[...M,...(c?.connections??[]).filter(t=>!N.has(t.name)&&(e.components?.mcp.find(e=>e.name===t.name)?.type!==`stdio`||t.state===`token_required`)).map(t=>{let n=t.state===`token_required`||e.components?.mcp.find(e=>e.name===t.name)?.connectionAuth?.mode===`api-key`;return{id:t.name,title:t.name,servers:[t.name],methods:[{id:n?`api-key`:`oauth`,title:n?j(`访问令牌`,`Access token`):j(`浏览器登录`,`Browser sign-in`),type:n?`form`:`oauth`,...n?{fields:[`__apiKey`]}:{server:t.name}}]}})],L=e=>e.servers.every(e=>c?.connections.find(t=>t.name===e)?.state===`connected`)&&(!M.some(t=>t.id===e.id)||c?.authorizations?.find(t=>t.id===e.id)?.state===`connected`),z=(c?.authorizations??[]).flatMap(e=>(e.issues??[]).map(t=>({...t,account:I.find(t=>t.id===e.id)}))),B=I.filter(e=>!L(e)),V=c?.installed||c?.state===`completed`,H=e.setup?.userConfig??{},U=new Set(M.flatMap(e=>e.methods.flatMap(e=>e.fields??[]))),W=Object.fromEntries(Object.entries(H).filter(([e])=>!U.has(e))),G=c?.error===`Connection verification failed. Check the credentials or login status and try again.`?j(`连接验证未通过,请检查凭据或登录状态后重试。`,c.error):c?.error,K=Object.fromEntries(Object.entries(H).filter(([e])=>c?.missingConfig?.includes(e))),q=f||c?.state===`running`,J=I.find(e=>e.id===re);(0,P.useEffect)(()=>{let e=!1;return R(`${s}/setup`).then(t=>{e||l(t)}).catch(t=>{e||(l(null),h(String(t)))}),()=>{e=!0}},[s]),(0,P.useEffect)(()=>{if(c?.state!==`running`)return;let e=!1,t=!1,r=setInterval(()=>{t||(t=!0,R(`${s}/setup`).then(t=>{e||(l(t),t?.state!==`running`&&n())}).catch(t=>{e||h(String(t))}).finally(()=>{t=!1}))},750);return()=>{e=!0,clearInterval(r)}},[s,c?.state]),(0,P.useEffect)(()=>{if(!c||!c.connections.some(e=>[`oauth_required`,`error`].includes(e.state)))return;let e=!1;return R(`${s}/setup/reusable`).then(t=>{e||_(t)}).catch(()=>{e||_({})}),()=>{e=!0}},[s,c?.revision]),(0,P.useEffect)(()=>{if(!x||c?.state===`completed`)return;let e=!1,t=!1,n=async()=>{if(!t){t=!0;try{let t=await R(`${s}/setup/auth/${encodeURIComponent(x)}`);e||y(t)}catch(t){e||h(String(t))}finally{t=!1}}};n();let r=setInterval(()=>void n(),1500),i=()=>void n();return window.addEventListener(`focus`,i),()=>{e=!0,clearInterval(r),window.removeEventListener(`focus`,i)}},[s,x,c?.state]),(0,P.useEffect)(()=>{let e=v?.authorizationUrl??(v?.challenge?.type===`url`?v.challenge.url:void 0);if(!v)return;if(v.error||[`cancelled`,`error`,`connected`].includes(v.state)){k.current?.close(),k.current=null;return}if(!e){v.challenge?.type===`qr`&&(k.current?.close(),k.current=null);return}let t=`${v.id}:${e}`;if(oe.current.has(t))return;oe.current.add(t);let n=k.current;k.current=null,n&&!n.closed?n.location.replace(e):window.open(e,`_blank`,`noopener,noreferrer`)},[v]);async function Y(e,t={},r=c?.revision){p(!0),h(``);try{let a=await R(`${s}/setup`,`POST`,{action:e,expectedRevision:r,...e===`start`?{}:{idempotencyKey:crypto.randomUUID()},...t}),o=e===`configure`&&M.find(e=>e.id===t.authorization)?.methods.some(e=>e.id===t.method&&e.type===`cli`);return([`reuse`,`start`].includes(e)||e===`configure`&&!o)&&(d({}),T(!1),a=await R(`${s}/setup`,`POST`,{action:`prepare`,expectedRevision:a.revision,idempotencyKey:crypto.randomUUID()})),l(a),await n(),[`complete`,`defer`].includes(e)&&(C(null),y(null),S(``),k.current?.close(),k.current=null,i?.()),a}catch(e){h(e instanceof Error?e.message:String(e));try{l(await R(`${s}/setup`))}catch{}return null}finally{p(!1)}}(0,P.useEffect)(()=>{if(!c||q||m||[`cancelled`,`running`,`failed`].includes(c.state)||c.state===`completed`)return;let e,t=``;if(c.state===`pending`?(e=`prepare`,t=`prepare:${s}:${c.revision}`):v?.state===`connected`&&(e=`prepare`,t=`auth:${s}:${v.id}`),e&&!E.current.has(t)){E.current.add(t),Y(e);return}c.resources===`ready`&&!c.missingConfig?.length&&!c.partial&&c.connections.every(e=>e.state===`connected`)&&(c.authorizations??[]).every(e=>e.state===`connected`)&&(t=`complete:${s}:${c.revision}`,E.current.has(t)||(E.current.add(t),Y(`complete`)))},[c,v,q,m,s]),(0,P.useEffect)(()=>{q||!c||c.state===`cancelled`||(J&&c.revision!==O.current&&L(J)?(C(null),y(null),S(``)):(!V||o)&&c.resources===`ready`&&(!c.missingConfig?.length||o&&!c.missingConfig.some(e=>e in W))&&!re&&B[0]&&!ae.current.has(B[0].id)&&(ae.current.add(B[0].id),O.current=c.revision,C(B[0].id)))},[c,q,V,re,o]);function X(e,t){let n=e.methods.find(e=>e.id===t),r=n?.type===`oauth`||n?.type===`cli`?window.open(`about:blank`,`_blank`):null;r&&(r.opener=null),k.current=r,y(null),Y(`authorize`,{server:e.id,...M.some(t=>t.id===e.id)?{method:t}:{}}).then(t=>{t?S(e.id):(r?.close(),k.current=null)})}async function Z(t,n,r){if(n===`api-key`&&!M.some(e=>e.id===t.id)){p(!0),h(``);try{let n=e.components?.mcp.find(e=>e.name===t.id);await R(`${s}/mcp/${encodeURIComponent(t.id)}/auth`,`PUT`,{mode:`api-key`,secrets:[{target:n.type===`stdio`?`env`:`headers`,key:n.connectionAuth?.headerName??(n.type===`stdio`?`API_KEY`:`Authorization`),prefix:n.connectionAuth?.prefix??(n.type===`stdio`?``:`Bearer `),value:r.__apiKey}]});let i=await R(`${s}/setup`);l(i),p(!1),await Y(`prepare`,{},i.revision);return}catch(e){h(String(e)),p(!1);return}p(!1)}else if(t.methods.find(e=>e.id===n)?.type===`cli`){let e=window.open(`about:blank`,`_blank`);e&&(e.opener=null),k.current=e,y(null);let i=await Y(`configure`,{authorization:t.id,method:n,values:r},c?.revision);i&&await Y(`authorize`,{server:t.id,method:n},i.revision)?S(t.id):(e?.close(),k.current=null)}else await Y(`configure`,{authorization:t.id,method:n,values:r})}if(c===void 0)return(0,A.jsx)(ie,{className:`h-40 w-full`});let Q=()=>{Y(`defer`)};return J?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(se,{initialMethod:c?.authorizations?.find(e=>e.id===J.id)?.method,account:J,fields:{...H,__apiKey:{type:`string`,title:j(`访问令牌`,`Access token`),required:!0,sensitive:!0}},zh:t,busy:q,attempt:v,onBack:()=>C(null),onConnect:e=>X(J,e),onSave:(e,t)=>void Z(J,e,t),onRedirect:e=>{p(!0),R(`${s}/setup/auth/${encodeURIComponent(x)}/redirect`,`POST`,{url:e}).catch(e=>h(String(e))).finally(()=>p(!1))},onSkip:Q},`${J.id}:${c?.authorizations?.find(e=>e.id===J.id)?.method??``}`),g[J.id]?.map(e=>(0,A.jsxs)(D,{disabled:q,variant:`secondary`,onClick:()=>void Y(`reuse`,{server:J.id,sourceServerId:e.id}),children:[j(`使用已登录账号:`,`Use signed-in account: `),e.name]},e.id)),m||G&&J.servers.some(e=>c?.connections.find(t=>t.name===e)?.state===`error`)?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:m||G}):null]}):(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":j(`插件安装与授权`,`Plugin setup`),children:[V?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:j(`安装完成`,`Installation complete`)}),(0,A.jsx)(`p`,{role:`status`,className:`mt-1 text-sm text-fg-muted`,children:e.activationEligible===!1?j(`插件已停用。`,`Plugin is disabled.`):c?.partial||B.length||z.length||c?.missingConfig?.length?j(`插件已安装,部分功能仍需要授权。`,`Plugin installed. Some features still need authorization.`):j(`所有 Agent 均可使用。可在 Agent 设置中单独调整。`,`Available to all agents. Customize individual agents in Agent settings.`)})]}):(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge p-4`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:j(`安装准备`,`Installation setup`)}),(0,A.jsx)(`ol`,{className:`mt-4 space-y-4 text-sm`,"aria-live":`polite`,children:[{name:j(`准备资源`,`Prepare resources`),done:c?.resources===`ready`,running:q&&c?.resources!==`ready`},{name:j(`授权账号`,`Authorize accounts`),done:c?.resources===`ready`&&!c?.missingConfig?.length&&B.length===0,running:!1},{name:j(`加载可用工具`,`Load available tools`),done:!1,running:q&&c?.resources===`ready`}].map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-3`,children:[e.done?(0,A.jsx)(ee,{className:`size-5 text-accent`,"aria-hidden":!0}):e.running?(0,A.jsx)(ne,{className:`size-5 animate-spin text-accent`,"aria-hidden":!0}):(0,A.jsx)(te,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),e.name]},e.name))}),(0,A.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:j(`安装后所有 Agent 均可使用,可在各自的设置中调整。`,`Available to all agents after installation. Customize individual agents in Agent settings.`)})]}),!c||c.state===`cancelled`?(0,A.jsx)(D,{disabled:f||e.readiness===`blocked`,onClick:()=>void Y(`start`),children:j(`继续安装`,`Continue installation`)}):(0,A.jsxs)(A.Fragment,{children:[c.missingConfig?.length||w?(0,A.jsxs)(`form`,{className:`space-y-4 rounded-xl border border-edge p-4`,onSubmit:e=>{e.preventDefault(),Y(`configure`,{values:u})},children:[(0,A.jsx)(`h4`,{className:`font-medium`,children:j(`补充配置`,`Required configuration`)}),(0,A.jsx)(F,{fields:w?W:K,values:u,onChange:d}),(0,A.jsx)(D,{type:`submit`,disabled:q||!Object.keys(u).length,children:j(`继续`,`Continue`)})]}):null,V&&(B.length||c.missingConfig?.length)?(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(b,{className:`mt-0.5 size-5 shrink-0`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium`,children:j(`需要授权`,`Authorization required`)}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:j(`授权后即可使用相关功能。已就绪的功能可继续使用。`,`Connect these accounts to use their features. Ready features remain available.`)})]})]}):null,z.length?(0,A.jsx)(`div`,{className:`space-y-3`,"aria-label":j(`需要补充权限`,`Additional permissions required`),children:z.map(e=>(0,A.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`text-fg-muted`,children:j(`账号已连接,以下权限尚未就绪;其他已授权功能可继续使用。`,`Account connected. These permissions are not ready; other authorized features remain available.`)}),e.scopes.length?(0,A.jsx)(`p`,{className:`break-all font-mono text-xs`,children:e.scopes.join(`, `)}):null,(0,A.jsx)(`ol`,{className:`list-inside list-decimal space-y-1 text-fg-muted`,children:e.instructions.map(e=>(0,A.jsx)(`li`,{children:e},e))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.helpUrl?(0,A.jsx)(D,{variant:`secondary`,asChild:!0,children:(0,A.jsx)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:j(`前往开通应用权限`,`Open application permissions`)})}):null,e.method&&e.account?(0,A.jsx)(D,{disabled:q,onClick:()=>{O.current=c.revision,C(e.account.id),X(e.account,e.method)},children:j(`补充授权`,`Grant missing permissions`)}):null,(0,A.jsx)(D,{variant:`secondary`,disabled:q,onClick:()=>void Y(`prepare`),children:j(`重新检查权限`,`Check permissions again`)})]})]},`${e.account?.id}:${e.id}`))}):null,I.length?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h4`,{className:`text-sm font-medium`,children:j(`账号与连接`,`Accounts and connections`)}),I.map(e=>(0,A.jsxs)(`div`,{role:`group`,"aria-label":e.title,className:`flex items-center justify-between gap-3 rounded-lg border border-edge p-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:L(e)?j(`已连接`,`Connected`):j(`需要授权`,`Authorization required`)})]}),(0,A.jsx)(D,{variant:L(e)?`secondary`:`primary`,disabled:q||c.resources!==`ready`,onClick:()=>{y(null),S(``),O.current=c.revision,C(e.id)},children:L(e)?j(`重新授权`,`Reconnect`):j(`连接账号`,`Connect account`)})]},e.id))]}):null,!V&&c.resources===`ready`?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(D,{variant:`secondary`,disabled:q,onClick:Q,children:j(`暂时跳过`,`Skip for now`)}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:j(`先完成安装,稍后在详情页授权。未授权的功能暂不可用。`,`Finish installation and connect later in plugin details. Unauthenticated features remain unavailable.`)})]}):null,V&&Object.keys(W).length&&!w?(0,A.jsx)(D,{variant:`ghost`,disabled:q,onClick:()=>T(!0),children:j(`修改插件配置`,`Edit plugin configuration`)}):null,V&&!z.length&&M.some(e=>e.methods.some(e=>e.type===`cli`))?(0,A.jsx)(D,{variant:`secondary`,disabled:q,onClick:()=>void Y(`prepare`),children:j(`检查连接与权限`,`Check connection and permissions`)}):null,!q&&(m||[`failed`,`interrupted`].includes(c.state)||c.connections.some(e=>e.state===`error`))?(0,A.jsx)(D,{variant:`secondary`,onClick:()=>void Y(`prepare`),children:j(`重试检查`,`Retry checks`)}):null,V?null:(0,A.jsx)(D,{variant:`ghost`,disabled:f,onClick:()=>void Y(`cancel`),children:j(`取消安装`,`Cancel installation`)}),V&&!B.length&&!c.missingConfig?.length?e.setup?.tasks?.map(t=>(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-inset p-4 text-sm`,children:[(0,A.jsx)(`p`,{children:t}),(0,A.jsx)(D,{asChild:!0,disabled:!e.active,children:(0,A.jsx)(a,{to:`/chat/new?${new URLSearchParams({draft:t,projectScope:`none`})}`,state:{forceNewChat:!0},onClick:t=>{e.active?r?.():t.preventDefault()},children:j(`开始这个任务`,`Start this task`)})})]},t)):null]}),q?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:j(`正在准备,可关闭后继续。`,`Preparing. You can close this window and resume.`)}):null,c?.error&&!c.deferred&&!c.missingConfig?.length?(0,A.jsx)(`p`,{className:`text-sm text-fg-muted`,children:G}):null,m?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:m}):null]})}var B=`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;function V(e,t){if(e.startsWith(`content.skills:`)){let n=e.slice(15);return t?`提供技能:${n}`:`Add skill: ${n}`}if(e.startsWith(`runtime.mcp.stdio:`)){let n=e.slice(18).split(`:`,1)[0];return t?`在 Gateway 上运行工具服务:${n}`:`Run a tool service on the Gateway: ${n}`}if(e.startsWith(`network.mcp:`)){let n=e.slice(12).split(`:`,1)[0];return t?`连接外部工具服务:${n}`:`Connect to an external tool service: ${n}`}return e.startsWith(`runtime.capability-access:`)?t?`按账号授权启用相关技能和工具`:`Enable skills and tools according to account authorization`:e.startsWith(`runtime.authorization:`)?t?`在本机运行账号登录程序:${e.split(`:`)[1]}`:`Run account sign-in locally: ${e.split(`:`)[1]}`:e.startsWith(`runtime.resource:`)?t?`下载可执行资源:${e.split(`:`)[1]}`:`Download executable resource: ${e.split(`:`)[1]}`:e.startsWith(`network.resource:`)?t?`下载并校验资源:${e.split(`:`)[1]}`:`Download and verify resource: ${e.split(`:`)[1]}`:e}function H(e,t){return t?.publisher?.verification!==`verified`||t.latestVersion.riskTier&&t.latestVersion.riskTier!==`content`?!0:e.addedCapabilities.some(e=>!e.startsWith(`content.skills:`))}async function U(e,t,n){let r=await l(s(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function W({extension:e,onClose:t,onUninstalled:n,initialSource:r=``,marketplace:a,autoInstall:s=!1}){let l=c(e=>e.language),_=l.startsWith(`zh`),b=a?.localizations?.[_?`zh-CN`:`en`],te=b?.displayName??a?.name,ie=b?.description??a?.description,O=(0,P.useId)(),{mutate:oe}=E(),[M,N]=(0,P.useState)(e),[F,se]=(0,P.useState)(r||e?.installationSource||``),[I,L]=(0,P.useState)(null),[R,W]=(0,P.useState)([]),[G,K]=(0,P.useState)(!1),[q,J]=(0,P.useState)(``),[Y,X]=(0,P.useState)(!1),[Z,Q]=(0,P.useState)(!1),[ce,le]=(0,P.useState)(!1),[ue,de]=(0,P.useState)(!1),[fe,pe]=(0,P.useState)(!1),[me,he]=(0,P.useState)(!1),ge=o(),_e=i(),[ve,ye]=(0,P.useState)(!1),be=(0,P.useRef)(!1),xe=`/api/extensions/agent-plugins/${encodeURIComponent(M?.pluginId??``)}`,Se=F.trim().startsWith(`store:`),Ce=()=>oe(`gateway-extensions-list`);async function $(e){K(!0),J(``);try{await e()}catch(e){J(e instanceof Error?e.message:String(e))}finally{K(!1)}}function we(e){se(e),L(null),W([]),J(``)}let Te=typeof window<`u`?window.electronAPI?.file:void 0,Ee=/^(?:\/|[A-Za-z]:[\\/])/.test(F.trim())?F.trim():void 0;async function De(){if(!Te?.openDirectory){pe(!0);return}let e=await Te.openDirectory(Ee?{defaultPath:Ee}:void 0);e&&we(e)}async function Oe(){if(!Te?.openFile){pe(!0);return}let e=await Te.openFile({...Ee?{defaultPath:Ee}:{},extensions:[`zip`]});e&&we(e)}function ke(e){return[...e.dataTransfer.types].some(e=>e===`Files`||e===`text/plain`||e===`text/uri-list`)}function Ae(e){if(!ke(e))return;e.preventDefault(),de(!1);let t=Array.from(e.dataTransfer.files);if(t.length){if(t.length>1){J(_?`一次只能选择一个插件目录或 ZIP。`:`Choose one plugin directory or ZIP at a time.`);return}let e=Te?.getPathForFile?.(t[0]);e?we(e):J(_?`浏览器无法读取本机文件路径,请使用“选择文件或目录”选择安装包。`:`The browser cannot read local file paths. Use Choose file or folder to select the package.`);return}let n=e.dataTransfer.getData(`text/uri-list`)||e.dataTransfer.getData(`text/plain`);n.trim()&&we(n.trim().split(/\r?\n/)[0])}async function je(e){let t=await U(`${xe}/activation`,`POST`,{enabled:e});N(t),await Ce()}async function Me(e){let t=!M,n=await U(t?`/api/extensions/install`:`${xe}/update`,`POST`,{source:F,reviewHash:e.reviewHash,...e.layout?{setup:!0}:{}});N(n),await Ce(),!e.layout&&t&&!n.activationEligible&&n.readiness!==`blocked`&&n.pluginId&&(n=await U(`/api/extensions/agent-plugins/${encodeURIComponent(n.pluginId)}/activation`,`POST`,{enabled:!0}),N(n),await Ce()),L(null),ye(!e.layout&&t&&n.activationEligible===!0)}async function Ne(){let e=await U(`/api/extensions/inspect`,`POST`,{source:F});if(H(e,a)){L(e);return}await Me(e)}(0,P.useEffect)(()=>{e&&!e.setup&&N(e)},[e]),(0,P.useEffect)(()=>{if(!e?.setup||!e.pluginId)return;let t=!1;return U(`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,`GET`).then(e=>{t||N(e)}).catch(()=>{}),()=>{t=!0}},[e?.pluginId]),(0,P.useEffect)(()=>{!s||M||!Se||be.current||(be.current=!0,$(Ne))},[s,M,Se]);let Pe=s&&!M&&Se&&!be.current;return(0,A.jsx)(g,{defaultOpen:!0,onOpenChange:e=>!e&&t(),children:(0,A.jsxs)(p,{children:[(0,A.jsx)(d,{className:`fixed inset-0 z-[130] bg-scrim`}),(0,A.jsxs)(m,{className:`fixed left-1/2 top-1/2 z-[131] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(38rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsx)(k,{iconUrl:M?.branding?.iconUrl??a?.branding?.iconUrl,fallback:re}),(0,A.jsx)(h,{className:`font-semibold`,children:M?.name??te??(_?`安装插件`:`Install plugin`)})]}),(0,A.jsx)(D,{variant:`ghost`,onClick:t,children:_?`关闭`:`Close`})]}),(0,A.jsx)(f,{className:`sr-only`,children:_?`安装、组件、账号连接和权限`:`Installation, components, connections and permissions`}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-auto space-y-4 overflow-y-auto overscroll-contain p-4`,children:[!M&&Se?(0,A.jsxs)(`section`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsx)(C,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:te??I?.manifest.name??F.slice(6)}),ie?(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:ie}):null,(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:a?.publisher?.verification===`verified`?_?`已认证发布者 · 安装后所有智能体均可使用`:`Verified publisher · available to all agents after installation`:_?`安装前会检查来源和所需权限`:`Source and required permissions are checked before installation`})]})]}),a?(0,A.jsx)(j,{data:a,zh:_}):null,I?null:(0,A.jsxs)(D,{className:`w-full`,disabled:G||Pe,onClick:()=>void $(Ne),children:[G||Pe?(0,A.jsx)(ne,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,G||Pe?_?`正在安全检查并安装…`:`Checking and installing…`:_?`一键安装`:`Install`]})]}):null,M?(0,A.jsxs)(A.Fragment,{children:[ve?(0,A.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-4`,children:[(0,A.jsx)(ee,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:_?`插件已安装并启用`:`Plugin installed and enabled`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:_?`请继续检查账号连接、依赖与可用状态,再在对话中试用。`:`It is ready to use in your conversations.`})]})]}):null,(!M.setup||M.readiness!==`setup_required`)&&!M.activationEligible?(0,A.jsxs)(`div`,{role:`status`,className:`space-y-3 rounded-lg border border-accent/25 bg-accent-soft p-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-accent-fg`,children:_?`插件已安装,当前尚未启用`:`Plugin installed. It is not enabled yet.`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:_?`启用后,Skills 和 MCP 才会加入 Agent 运行时。`:`Enable it to make its skills and MCP servers available to the Agent runtime.`})]}),(0,A.jsx)(D,{disabled:G||M.readiness===`blocked`,onClick:()=>void $(()=>je(!0)),children:_?`启用插件`:`Enable plugin`})]}):null,M.setup?(0,A.jsx)(z,{extension:M,zh:_,onStart:t,onInstalled:()=>{t(),ge(ae(M.pluginId,`installed`,!1,_e.pathname+_e.search))},onChanged:async()=>{let e=await U(`${xe}`,`GET`);N(e),await Ce()}}):null,(0,A.jsxs)(`details`,{className:`rounded-lg border border-edge p-3`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:_?`插件详情`:`Plugin details`}),(0,A.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[_?`插件`:`Plugin`,` · `,M.version,` · `,M.readiness&&{ready:_?`已就绪`:`Ready`,setup_required:_?`待连接`:`Setup required`,degraded:_?`部分不可用`:`Partially available`,blocked:_?`已阻止`:`Blocked`}[M.readiness]]}),M.provenance?(0,A.jsxs)(`p`,{className:`break-words text-xs text-fg-muted`,children:[M.provenance.publisherVerification===`verified`?_?`已认证发布者`:`Verified publisher`:_?`社区发布者`:`Community publisher`,` · `,M.provenance.packageName,`@`,M.provenance.version,` · SHA-256 `,M.provenance.sha256.slice(0,12),`…`,M.provenance.riskTier?` · ${M.provenance.riskTier}`:``]}):null,(0,A.jsx)(`p`,{className:`text-sm`,children:M.description}),M.installationSource?(0,A.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[_?`来源:`:`Source: `,M.installationSource,M.resolvedCommit?` · ${M.resolvedCommit.slice(0,12)}`:``]}):null,M.activationEligible?(0,A.jsx)(D,{disabled:G,variant:`secondary`,onClick:()=>void $(()=>je(!1)),children:_?`停用`:`Disable`}):null,M.canRollback?(0,A.jsx)(D,{disabled:G,variant:`secondary`,onClick:()=>void $(async()=>{N(await U(`${xe}/rollback`,`POST`)),await Ce()}),children:_?`回滚上一版本`:`Roll back`}):null]})]}),M.diagnostics?.map((e,t)=>(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.component,`: `,e.message]},t))]}):null,M?(0,A.jsxs)(D,{variant:`ghost`,className:`px-0`,"aria-expanded":me,onClick:()=>he(e=>!e),children:[(0,A.jsx)(v,{className:T(`size-4 transition-transform motion-reduce:transition-none`,me&&`rotate-180`),"aria-hidden":!0}),_?`高级操作`:`Advanced actions`]}):null,!M&&!Se||me?(0,A.jsxs)(`form`,{className:T(`space-y-3`,M&&`border-t border-edge pt-4`),onSubmit:e=>{e.preventDefault(),$(async()=>{let e=await U(`/api/extensions/inspect`,`POST`,{source:F});e.candidates?(W(e.candidates),L(null)):(W([]),L(e))})},children:[(0,A.jsxs)(`div`,{"data-testid":`plugin-source-dropzone`,className:T(`rounded-xl border border-dashed p-3 transition-colors`,ue?`border-accent bg-accent-soft`:`border-edge bg-surface-inset/40`),onDragEnter:e=>{ke(e)&&(e.preventDefault(),de(!0))},onDragOver:e=>{ke(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,de(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||de(!1)},onDrop:Ae,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2`,children:[(0,A.jsx)(w,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:O,className:`block text-sm font-medium`,children:M?_?`更新包来源`:`Update package source`:_?`安装包来源`:`Package source`}),(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:_?`输入 github:组织/仓库、Git / ZIP 地址或宿主目录;marketplace 可选择插件。`:`Enter github:owner/repo, a Git / ZIP URL or a Gateway directory. Marketplaces let you choose a plugin.`})]})]}),(0,A.jsx)(`input`,{id:O,className:B,value:F,onChange:e=>we(e.target.value),placeholder:_?`/插件目录/或/插件.zip`:`/plugin/folder/or/plugin.zip`,autoComplete:`off`,spellCheck:!1,required:!0}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Te?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(D,{type:`button`,variant:`secondary`,disabled:G,onClick:()=>void $(De),children:[(0,A.jsx)(S,{className:`size-4`,"aria-hidden":!0}),_?`选择目录`:`Choose directory`]}),(0,A.jsxs)(D,{type:`button`,variant:`secondary`,disabled:G,onClick:()=>void $(Oe),children:[(0,A.jsx)(x,{className:`size-4`,"aria-hidden":!0}),_?`选择 ZIP`:`Choose ZIP`]})]}):(0,A.jsxs)(D,{type:`button`,variant:`secondary`,disabled:G,onClick:()=>pe(!0),children:[(0,A.jsx)(S,{className:`size-4`,"aria-hidden":!0}),_?`选择文件或目录`:`Choose file or folder`]})})]}),(0,A.jsx)(D,{type:`submit`,variant:`secondary`,disabled:G||!F,children:_?`检查安装包`:`Inspect package`})]}):null,R.length?(0,A.jsx)(`div`,{className:`space-y-2`,"aria-label":_?`选择插件`:`Choose a plugin`,children:R.map(e=>(0,A.jsx)(D,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>{we(e.source),$(async()=>L(await U(`/api/extensions/inspect`,`POST`,{source:e.source})))},children:e.name},e.source))}):null,I?(0,A.jsxs)(`div`,{role:`region`,"aria-labelledby":`plugin-authorization-title`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(C,{className:`mt-0.5 size-5 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{id:`plugin-authorization-title`,className:`font-medium text-fg`,children:_?`需要你的授权`:`Your authorization is required`}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:_?`此插件需要以下新增能力。确认后自动准备资源,按需登录账号,所有智能体均可使用。`:`Review these capabilities. Resources are prepared automatically; sign in if needed. Available to all agents.`})]})]}),(0,A.jsx)(`ul`,{tabIndex:0,"aria-label":_?`插件新增能力`:`Added plugin capabilities`,className:`max-h-[min(28vh,14rem)] space-y-2 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-panel p-3 break-words focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:I.addedCapabilities.map(e=>(0,A.jsxs)(`li`,{className:`flex gap-2`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`•`}),(0,A.jsx)(`span`,{children:V(e,_)})]},e))}),I.diagnostics.map((e,t)=>(0,A.jsxs)(`p`,{children:[e.component,`: `,e.message]},t))]}):null,M&&me?(0,A.jsx)(`div`,{className:`border-t border-edge pt-4`,children:ce?(0,A.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,A.jsx)(`p`,{children:_?`卸载保留账号凭据;服务端授权需到相应服务撤销。`:`Credentials are retained. Revoke provider authorization in the service itself.`}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:Y,onChange:e=>X(e.target.checked)}),_?`同时删除插件数据`:`Also delete plugin data`]}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:Z,onChange:e=>Q(e.target.checked)}),_?`同时删除本地凭据`:`Also delete local credentials`]}),(0,A.jsx)(D,{disabled:G,onClick:()=>void $(async()=>{await U(xe,`DELETE`,{removeData:Y,removeCredentials:Z}),await Ce(),(n??t)()}),children:_?`确认卸载`:`Confirm uninstall`})]}):(0,A.jsx)(D,{variant:`ghost`,disabled:G,onClick:()=>le(!0),children:_?`卸载插件`:`Uninstall`})}):null,q?(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-fg-muted`,children:q}):null]}),I?(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge p-4`,children:[(0,A.jsx)(D,{variant:`ghost`,disabled:G,onClick:()=>L(null),children:_?`取消`:`Cancel`}),(0,A.jsxs)(D,{disabled:G||!!M&&I.manifest.name!==M.name,onClick:()=>void $(()=>Me(I)),children:[G?(0,A.jsx)(ne,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,_?`授权并安装`:`Authorize and install`]})]}):null]}),Te?null:(0,A.jsx)(y,{open:fe,onOpenChange:pe,initialAbsolutePath:Ee,onConfirm:async e=>we(e),wd:u(l).chat.workingDirectory,selectKind:`file-or-directory`,fileExtensions:[`zip`],title:_?`选择插件安装包`:`Choose plugin package`,description:_?`选择插件目录或 ZIP 文件。`:`Choose a plugin directory or ZIP file.`,confirmLabel:_?`使用此来源`:`Use this source`,nested:!0})]})})}export{z as n,j as r,W as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t}from"./locale-store-Br7IfbXK.js";var n={get:n=>t(e(`/api/automations/${encodeURIComponent(n)}`)),configuration:n=>t(e(`/api/automations/configuration-conversations/${encodeURIComponent(n)}`)),openConfiguration:n=>t(e(`/api/automations/configuration-conversations`),{method:`POST`,body:JSON.stringify(n)}),tasks:()=>t(e(`/api/tasks?limit=200`)),list:n=>{let r=new URLSearchParams;n?.projectId&&r.set(`projectId`,n.projectId);let i=r.toString();return t(e(`/api/automations${i?`?${i}`:``}`))},metrics:()=>t(e(`/api/automations/metrics`)),draft:(n,r=crypto.randomUUID())=>t(e(`/api/automations/draft`),{method:`POST`,headers:{"Idempotency-Key":r},body:JSON.stringify(n)}),simulate:n=>t(e(`/api/automations/simulate`),{method:`POST`,body:JSON.stringify(n)}),create:n=>t(e(`/api/automations`),{method:`POST`,body:JSON.stringify(n)}),update:(n,r)=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)}),remove:n=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`DELETE`}),runNow:n=>t(e(`/api/automations/${encodeURIComponent(n)}/run`),{method:`POST`}),pause:n=>t(e(`/api/automations/${encodeURIComponent(n)}/pause`),{method:`POST`}),resume:n=>t(e(`/api/automations/${encodeURIComponent(n)}/resume`),{method:`POST`}),runs:(n=50,r,i)=>{let a=new URLSearchParams({limit:String(n)});return r&&a.set(`automationId`,r),!r&&i?.projectId&&a.set(`projectId`,i.projectId),t(e(`/api/automation-runs?${a.toString()}`))},productEventRuns:n=>{let r=new URLSearchParams({eventType:n.eventType,limit:String(n.limit??5)});return n.source&&r.set(`source`,n.source),n.payloadKey&&r.set(`payloadKey`,n.payloadKey),n.payloadValue!==void 0&&r.set(`payloadValue`,n.payloadValue),t(e(`/api/automation-runs/product-events?${r.toString()}`))},events:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.type&&r.set(`type`,n.type),n.source&&r.set(`source`,n.source),t(e(`/api/automation-events?${r.toString()}`))},deliveries:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.runId&&r.set(`runId`,n.runId),n.status&&r.set(`status`,n.status),t(e(`/api/automation-deliveries?${r.toString()}`))},getRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}`)),runEvents:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/events`)),rerun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/rerun`),{method:`POST`}),repairDraft:(n,r,i=crypto.randomUUID())=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/repair-draft`),{method:`POST`,headers:{"Idempotency-Key":i},body:JSON.stringify(r)}),cancelRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/cancel`),{method:`POST`}),markRunRead:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/read`),{method:`POST`}),markAllRunsRead:n=>t(e(`/api/automation-runs/read-all${n?`?projectId=${encodeURIComponent(n)}`:``}`),{method:`POST`})};export{n as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{l as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as c}from"./messages-ByFlEbsu.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{t as g}from"./calendar-clock-D-quYVPe.js";import{t as _}from"./check-DUBLcKHA.js";import{t as v}from"./chevron-down-ccbiQQz_.js";import{c as y,l as ee,n as b,r as x,u as te}from"./popover-select-CEMWIrtY.js";import{t as S}from"./clock-3-DnrAnuyZ.js";import{D as ne}from"./markdown-view-Ck5s16p9.js";import{t as C}from"./message-circle-Badhj-4D.js";import{t as w}from"./pencil-DmIY3Oa-.js";import{t as re}from"./x-B_N4OPjy.js";import{t as ie}from"./cn-0WouolD0.js";import{t as ae}from"./skeleton-BI5TyibZ.js";import{i as T,o as oe}from"./vendor-swr-CdRzEUwF.js";import{t as se}from"./chat-agents-api-D8YS5amE.js";import{t as E}from"./button-Cc4hUNTt.js";import{c as ce,s as D}from"./dist-GJ8-1PAx.js";import{n as le}from"./model-selector-DCBmsHzj.js";import{t as ue}from"./date-picker-BIfjfOTM.js";import{t as de}from"./automation-api-hRsGx-qe.js";var O=r(),k=e(n(),1),A=i();function j({label:e,children:t}){let n=(0,k.useId)(),r,i=k.Children.map(t,(e,t)=>{if(!(0,k.isValidElement)(e)||e.type!==`input`&&e.type!==`textarea`&&e.type!==`select`&&e.type!==b)return e;let i=e,a=i.props.id??`${n}-${t}`;return r??=a,(0,k.cloneElement)(i,{id:a,...!i.props[`aria-label`]&&!i.props[`aria-labelledby`]?{"aria-labelledby":`${n}-label`}:{}})});return(0,A.jsxs)(`div`,{className:`grid gap-1.5`,role:`group`,"aria-labelledby":`${n}-label`,children:[r?(0,A.jsx)(`label`,{id:`${n}-label`,htmlFor:r,className:`text-xs font-medium text-fg-muted`,children:e}):(0,A.jsx)(`span`,{id:`${n}-label`,className:`text-xs font-medium text-fg-muted`,children:e}),i]})}var fe=Array.from({length:24},(e,t)=>t);function pe(e){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hour:n,minute:r}}function me(){let e=new Date;return{hour:e.getHours(),minute:e.getMinutes()}}function he(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function ge(e){let t=(0,O.c)(81),{value:n,onChange:r,disabled:i,allowEmpty:a,clearLabel:o,ariaLabel:s,ariaLabelledBy:c,className:l,triggerClassName:u,id:d,name:f,minuteStep:p}=e,m=a!==void 0&&a,h=p===void 0?1:p,g=pe(n),v=g??me(),[b,x]=(0,k.useState)(!1),[ne,C]=(0,k.useState)(null),[w,ae]=(0,k.useState)(v.hour),[T,oe]=(0,k.useState)(v.minute),se=(0,k.useRef)([]),E=(0,k.useRef)([]),le=ee(),ue=y(ne),de=te(le,ue!==null),j=Math.max(1,Math.min(60,Math.round(h))),ge=Array.from({length:Math.ceil(60/j)},(e,t)=>t*j).filter(M),ve;t[0]===r?ve=t[1]:(ve=(e,t,n)=>{let i=n!==void 0&&n;ae(e),oe(t),r(he(e,t)),i&&x(!1)},t[0]=r,t[1]=ve);let N=ve,ye=_e,P;t[2]===l?P=t[3]:(P=ie(`relative min-w-0`,l),t[2]=l,t[3]=P);let be=ce,xe;t[4]===n?xe=t[5]:(xe=e=>{if(e){let e=pe(n)??me();ae(e.hour),oe(e.minute)}x(e)},t[4]=n,t[5]=xe);let Se=m&&n&&`pr-9`,Ce=i&&`cursor-not-allowed opacity-50 hover:border-edge`,we;t[6]!==Se||t[7]!==Ce||t[8]!==u?(we=ie(`box-border flex h-10 w-full min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 text-left text-sm text-fg`,`transition-colors hover:border-edge-strong focus-visible:border-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/20`,Se,Ce,u),t[6]=Se,t[7]=Ce,t[8]=u,t[9]=we):we=t[9];let Te;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,A.jsx)(S,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`}),t[10]=Te):Te=t[10];let Ee=!g&&`text-fg-subtle`,F;t[11]===Ee?F=t[12]:(F=ie(`tabular-nums`,Ee),t[11]=Ee,t[12]=F);let De=g?he(g.hour,g.minute):`--:--`,Oe;t[13]!==F||t[14]!==De?(Oe=(0,A.jsx)(`span`,{className:F,children:De}),t[13]=F,t[14]=De,t[15]=Oe):Oe=t[15];let ke;t[16]!==s||t[17]!==c||t[18]!==i||t[19]!==d||t[20]!==Oe||t[21]!==we?(ke=(0,A.jsx)(D,{asChild:!0,children:(0,A.jsxs)(`button`,{ref:C,id:d,type:`button`,disabled:i,"aria-label":s,"aria-labelledby":c,"aria-haspopup":`listbox`,className:we,children:[Te,Oe]})}),t[16]=s,t[17]=c,t[18]=i,t[19]=d,t[20]=Oe,t[21]=we,t[22]=ke):ke=t[22];let Ae=ce,je=ue??void 0,I=ce,Me=ue??void 0,L=ie(de,`max-h-[var(--radix-popover-content-available-height)] w-[18rem] overflow-y-auto rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`),Ne=e=>{e.preventDefault(),requestAnimationFrame(()=>se.current[w]?.focus())},R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,A.jsx)(S,{className:`size-3.5`,"aria-hidden":`true`}),t[23]=R):R=t[23];let Pe=s??`HH:mm`,Fe;t[24]===Pe?Fe=t[25]:(Fe=(0,A.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[R,Pe]}),t[24]=Pe,t[25]=Fe);let Ie;t[26]!==w||t[27]!==T?(Ie=he(w,T),t[26]=w,t[27]=T,t[28]=Ie):Ie=t[28];let Le;t[29]===Ie?Le=t[30]:(Le=(0,A.jsx)(`span`,{className:`font-mono text-base font-semibold tabular-nums text-fg`,children:Ie}),t[29]=Ie,t[30]=Le);let Re;t[31]!==Fe||t[32]!==Le?(Re=(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle bg-surface-inset px-3 py-2.5`,children:[Fe,Le]}),t[31]=Fe,t[32]=Le,t[33]=Re):Re=t[33];let ze;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,A.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`HH`}),t[34]=ze):ze=t[34];let z=`${s??`HH:mm`} HH`,B=fe.map((e,t)=>(0,A.jsx)(`button`,{ref:e=>{se.current[t]=e},type:`button`,role:`option`,"aria-selected":w===e,tabIndex:w===e?0:-1,className:ie(`relative flex h-8 items-center justify-center rounded-md text-xs tabular-nums text-fg-muted transition-colors`,`hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,w===e&&`bg-accent-soft font-semibold text-accent-fg`),onClick:()=>N(e,T),onKeyDown:e=>ye(e,fe,w,e=>N(e,T),se),children:String(e).padStart(2,`0`)},e)),V;t[35]!==z||t[36]!==B?(V=(0,A.jsxs)(`div`,{className:`pr-2`,children:[ze,(0,A.jsx)(`div`,{role:`listbox`,"aria-label":z,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:B})]}),t[35]=z,t[36]=B,t[37]=V):V=t[37];let H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,A.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`MM`}),t[38]=H):H=t[38];let Be=`${s??`HH:mm`} MM`,Ve=ge.map((e,t)=>(0,A.jsxs)(`button`,{ref:e=>{E.current[t]=e},type:`button`,role:`option`,"aria-selected":T===e,tabIndex:T===e?0:-1,className:ie(`relative flex h-8 items-center justify-center rounded-md text-xs tabular-nums text-fg-muted transition-colors`,`hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,T===e&&`bg-accent-soft font-semibold text-accent-fg`),onClick:()=>N(w,e,!0),onKeyDown:e=>ye(e,ge,T,e=>N(w,e),E),children:[(0,A.jsx)(_,{className:ie(`absolute left-0.5 size-3`,T!==e&&`invisible`),"aria-hidden":`true`}),String(e).padStart(2,`0`)]},e)),He;t[39]!==Be||t[40]!==Ve?(He=(0,A.jsx)(`div`,{role:`listbox`,"aria-label":Be,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:Ve}),t[39]=Be,t[40]=Ve,t[41]=He):He=t[41];let Ue;t[42]!==H||t[43]!==He?(Ue=(0,A.jsxs)(`div`,{className:`pl-2`,children:[H,He]}),t[42]=H,t[43]=He,t[44]=Ue):Ue=t[44];let We;t[45]!==V||t[46]!==Ue?(We=(0,A.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-edge-subtle p-2`,children:[V,Ue]}),t[45]=V,t[46]=Ue,t[47]=We):We=t[47];let U;t[48]!==I.Content||t[49]!==Me||t[50]!==L||t[51]!==Ne||t[52]!==Re||t[53]!==We?(U=(0,A.jsxs)(I.Content,{side:`bottom`,align:`start`,sideOffset:6,collisionPadding:12,collisionBoundary:Me,className:L,onOpenAutoFocus:Ne,children:[Re,We]}),t[48]=I.Content,t[49]=Me,t[50]=L,t[51]=Ne,t[52]=Re,t[53]=We,t[54]=U):U=t[54];let W;t[55]!==Ae.Portal||t[56]!==je||t[57]!==U?(W=(0,A.jsx)(Ae.Portal,{container:je,children:U}),t[55]=Ae.Portal,t[56]=je,t[57]=U,t[58]=W):W=t[58];let Ge;t[59]!==b||t[60]!==ke||t[61]!==W||t[62]!==be.Root||t[63]!==xe?(Ge=(0,A.jsxs)(be.Root,{open:b,onOpenChange:xe,children:[ke,W]}),t[59]=b,t[60]=ke,t[61]=W,t[62]=be.Root,t[63]=xe,t[64]=Ge):Ge=t[64];let Ke;t[65]!==m||t[66]!==s||t[67]!==o||t[68]!==i||t[69]!==r||t[70]!==n?(Ke=m&&n?(0,A.jsx)(`button`,{type:`button`,disabled:i,"aria-label":o??s,title:o,className:`absolute right-1.5 top-1/2 flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30 disabled:pointer-events-none`,onClick:()=>r(``),children:(0,A.jsx)(re,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[65]=m,t[66]=s,t[67]=o,t[68]=i,t[69]=r,t[70]=n,t[71]=Ke):Ke=t[71];let G;t[72]!==i||t[73]!==f||t[74]!==n?(G=f?(0,A.jsx)(`input`,{type:`hidden`,name:f,value:n,disabled:i}):null,t[72]=i,t[73]=f,t[74]=n,t[75]=G):G=t[75];let qe;return t[76]!==P||t[77]!==Ge||t[78]!==Ke||t[79]!==G?(qe=(0,A.jsxs)(`div`,{className:P,children:[Ge,Ke,G]}),t[76]=P,t[77]=Ge,t[78]=Ke,t[79]=G,t[80]=qe):qe=t[80],qe}function _e(e,t,n,r,i){let a=null,o=Math.max(0,t.indexOf(n));if((e.key===`ArrowDown`||e.key===`ArrowRight`)&&(a=(o+1)%t.length),(e.key===`ArrowUp`||e.key===`ArrowLeft`)&&(a=(o-1+t.length)%t.length),e.key===`Home`&&(a=0),e.key===`End`&&(a=t.length-1),a===null)return;e.preventDefault();let s=t[a];r(s),i.current?.[a]?.focus()}function M(e){return e<60}var ve=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),N=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronField=void 0,e.CronField=class e{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:``};static get min(){throw Error(`min must be overridden`)}static get max(){throw Error(`max must be overridden`)}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,n={rawValue:``}){if(!Array.isArray(t))throw Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??``},this.#r=[...t].sort(e.sorter),this.#n=this.options.wildcard===void 0?this.#i():this.options.wildcard,this.#e=this.options.rawValue.includes(`L`)||t.includes(`L`),this.#t=this.options.rawValue.includes(`?`)||t.includes(`?`)}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:!n&&!r?e.localeCompare(t):n?-1:1}static findNearestValueInList(e,t,n){if(n){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}for(let n=0;n<e.length;n++)if(e[n]>t)return e[n];return null}findNearestValue(e,t){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join(``)}`:``,n=e=>t=>RegExp(`^\\d{0,2}${t}$`).test(e);if(!this.#r.every(t=>(e=t,typeof t==`number`?t>=this.min&&t<=this.max:this.chars.some(n(t)))))throw Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let r=this.#r.find((e,t)=>this.#r.indexOf(e)!==t);if(r!==void 0)throw Error(`${this.constructor.name} Validation error, duplicate values found: ${r}`)}#i(){return this.options.rawValue.length>0?[`*`,`?`].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}})),ye=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{},n=class extends t{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},r=class extends t{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},i=class extends t{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},a=class extends t{},o=class extends t{constructor(e){super(`Invalid unit ${e}`)}},s=class extends t{},c=class extends t{constructor(){super(`Zone is an abstract class`)}},l=`numeric`,u=`short`,d=`long`,f={year:l,month:l,day:l},p={year:l,month:u,day:l},m={year:l,month:u,day:l,weekday:u},h={year:l,month:d,day:l},g={year:l,month:d,day:l,weekday:d},_={hour:l,minute:l},v={hour:l,minute:l,second:l},y={hour:l,minute:l,second:l,timeZoneName:u},ee={hour:l,minute:l,second:l,timeZoneName:d},b={hour:l,minute:l,hourCycle:`h23`},x={hour:l,minute:l,second:l,hourCycle:`h23`},te={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},S={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},ne={year:l,month:l,day:l,hour:l,minute:l},C={year:l,month:l,day:l,hour:l,minute:l,second:l},w={year:l,month:u,day:l,hour:l,minute:l},re={year:l,month:u,day:l,hour:l,minute:l,second:l},ie={year:l,month:u,day:l,weekday:u,hour:l,minute:l},ae={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},T={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},oe={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},se={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},E=class{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}},ce=null,D=class e extends E{static get instance(){return ce===null&&(ce=new e),ce}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Ot(e,t,n)}formatOffset(e,t){return Mt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},le=new Map;function ue(e){let t=le.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,era:`short`}),le.set(e,t)),t}var de={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function O(e,t){let n=e.format(t).replace(/\u200E/g,``),[,r,i,a,o,s,c,l]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);return[a,r,i,o,s,c,l]}function k(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=de[t];t===`era`?r[a]=i:K(a)||(r[a]=parseInt(i,10))}return r}var A=new Map,j=class e extends E{static create(t){let n=A.get(t);return n===void 0&&A.set(t,n=new e(t)),n}static resetCache(){A.clear(),le.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=e.isValidZone(t)}get type(){return`iana`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Ot(e,t,n,this.name)}formatOffset(e,t){return Mt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=ue(this.name),[r,i,a,o,s,c,l]=n.formatToParts?k(n,t):O(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=wt({year:r,month:i,day:a,hour:s===24?0:s,minute:c,second:l,millisecond:0}),d=+t,f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/(60*1e3)}equals(e){return e.type===`iana`&&e.name===this.name}get isValid(){return this.valid}},fe={};function pe(e,t={}){let n=JSON.stringify([e,t]),r=fe[n];return r||(r=new Intl.ListFormat(e,t),fe[n]=r),r}var me=new Map;function he(e,t={}){let n=JSON.stringify([e,t]),r=me.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),me.set(n,r)),r}var ge=new Map;function _e(e,t={}){let n=JSON.stringify([e,t]),r=ge.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),ge.set(n,r)),r}var M=new Map;function ve(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=M.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),M.set(i,a)),a}var N=null;function ye(){return N||(N=new Intl.DateTimeFormat().resolvedOptions().locale,N)}var P=new Map;function be(e){let t=P.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),P.set(e,t)),t}var xe=new Map;function Se(e){let t=xe.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...je,...t}),xe.set(e,t)}return t}function Ce(e){let t=e.indexOf(`-x-`);t!==-1&&(e=e.substring(0,t));let n=e.indexOf(`-u-`);if(n===-1)return[e];{let t,r;try{t=he(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=he(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function we(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function Te(e){let t=[];for(let n=1;n<=12;n++){let r=$.utc(2009,n,1);t.push(e(r))}return t}function Ee(e){let t=[];for(let n=1;n<=7;n++){let r=$.utc(2016,11,13+n);t.push(e(r))}return t}function F(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function De(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||be(e.locale).numberingSystem===`latn`}var Oe=class{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){let t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=_e(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}else return Y(this.floor?Math.floor(e):bt(e,3),this.padTo)}},ke=class{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type===`fixed`){let t=-1*(e.offset/60),n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;e.offset!==0&&j.create(n).valid?(r=n,this.dt=e):(r=`UTC`,this.dt=e.offset===0?e:e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type===`system`?this.dt=e:e.zone.type===`iana`?(this.dt=e,r=e.zone.name):(r=`UTC`,this.dt=e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=he(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(``):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if(e.type===`timeZoneName`){let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}else return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Ae=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&<()&&(this.rtf=ve(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):Zt(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},je={firstDay:1,minimalDays:4,weekend:[6,7]},I=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){let o=t||U.defaultLocale,s=o||(a?`en-US`:ye()),c=n||U.defaultNumberingSystem,l=r||U.defaultOutputCalendar,u=ht(i)||U.defaultWeekSettings;return new e(s,c,l,u,o)}static resetCache(){N=null,me.clear(),ge.clear(),M.clear(),P.clear(),xe.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return e.create(t,n,r,i)}constructor(e,t,n,r,i){let[a,o,s]=Ce(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=we(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached??=De(this),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem===`latn`)&&(this.outputCalendar===null||this.outputCalendar===`gregory`);return e&&t?`en`:`intl`}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ht(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return F(this,e,Lt,()=>{let n=this.intl===`ja`||this.intl.startsWith(`ja-`);t&=!n;let r=t?{month:e,day:`numeric`}:{month:e},i=t?`format`:`standalone`;if(!this.monthsCache[i][e]){let t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,`month`);this.monthsCache[i][e]=Te(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return F(this,e,Vt,()=>{let n=t?{weekday:e,year:`numeric`,month:`long`,day:`numeric`}:{weekday:e},r=t?`format`:`standalone`;return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=Ee(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return F(this,void 0,()=>Ht,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[$.utc(2016,11,13,9),$.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return F(this,e,Kt,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[$.utc(-40,1,1),$.utc(2017,1,1)].map(e=>this.extract(e,t,`era`))),this.eraCache[e]})}extract(e,t,n){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new Oe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new ke(e,this.intl,t)}relFormatter(e={}){return new Ae(this.intl,this.isEnglish(),e)}listFormatter(e={}){return pe(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||be(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:ut()?Se(this.locale):je}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Me=null,L=class e extends E{static get utcInstance(){return Me===null&&(Me=new e(0)),Me}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new e(kt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Mt(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Mt(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Mt(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type===`fixed`&&e.fixed===this.fixed}get isValid(){return!0}},Ne=class extends E{constructor(e){super(),this.zoneName=e}get type(){return`invalid`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return``}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function R(e,t){if(K(e)||e===null)return t;if(e instanceof E)return e;if(st(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?D.instance:n===`utc`||n===`gmt`?L.utcInstance:L.parseSpecifier(n)||j.create(e)}else if(q(e))return L.instance(e);else if(typeof e==`object`&&`offset`in e&&typeof e.offset==`function`)return e;else return new Ne(e)}var Pe={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},Fe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ie=Pe.hanidec.replace(/[\[|\]]/g,``).split(``);function Le(e){let t=parseInt(e,10);if(isNaN(t)){t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(e[n].search(Pe.hanidec)!==-1)t+=Ie.indexOf(e[n]);else for(let e in Fe){let[n,i]=Fe[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}else return t}var Re=new Map;function ze(){Re.clear()}function z({numberingSystem:e},t=``){let n=e||`latn`,r=Re.get(n);r===void 0&&(r=new Map,Re.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${Pe[n]}${t}`),r.set(t,i)),i}var B=()=>Date.now(),V=`system`,H=null,Be=null,Ve=null,He=60,Ue,We=null,U=class{static get now(){return B}static set now(e){B=e}static set defaultZone(e){V=e}static get defaultZone(){return R(V,D.instance)}static get defaultLocale(){return H}static set defaultLocale(e){H=e}static get defaultNumberingSystem(){return Be}static set defaultNumberingSystem(e){Be=e}static get defaultOutputCalendar(){return Ve}static set defaultOutputCalendar(e){Ve=e}static get defaultWeekSettings(){return We}static set defaultWeekSettings(e){We=ht(e)}static get twoDigitCutoffYear(){return He}static set twoDigitCutoffYear(e){He=e%100}static get throwOnInvalid(){return Ue}static set throwOnInvalid(e){Ue=e}static resetCaches(){I.resetCache(),j.resetCache(),$.resetCache(),ze()}},W=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Ge=[0,31,59,90,120,151,181,212,243,273,304,334],Ke=[0,31,60,91,121,152,182,213,244,274,305,335];function G(e,t){return new W(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function qe(e,t,n){let r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function Je(e,t,n){return n+(xt(e)?Ke:Ge)[t-1]}function Ye(e,t){let n=xt(e)?Ke:Ge,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function Xe(e,t){return(e-t+7)%7+1}function Ze(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=Je(r,i,a),s=Xe(qe(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=Et(l,t,n)):c>Et(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Nt(e)}}function Qe(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=Xe(qe(r,1,t),n),s=St(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=St(l)):c>s?(l=r+1,c-=St(r)):l=r;let{month:u,day:d}=Ye(l,c);return{year:l,month:u,day:d,...Nt(e)}}function $e(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:Je(t,n,r),...Nt(e)}}function et(e){let{year:t,ordinal:n}=e,{month:r,day:i}=Ye(t,n);return{year:t,month:r,day:i,...Nt(e)}}function tt(e,t){if(!K(e.localWeekday)||!K(e.localWeekNumber)||!K(e.localWeekYear)){if(!K(e.weekday)||!K(e.weekNumber)||!K(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return K(e.localWeekday)||(e.weekday=e.localWeekday),K(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),K(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function nt(e,t=4,n=1){let r=ot(e.weekYear),i=J(e.weekNumber,1,Et(e.weekYear,t,n)),a=J(e.weekday,1,7);return r?i?!a&&G(`weekday`,e.weekday):G(`week`,e.weekNumber):G(`weekYear`,e.weekYear)}function rt(e){let t=ot(e.year),n=J(e.ordinal,1,St(e.year));return t?!n&&G(`ordinal`,e.ordinal):G(`year`,e.year)}function it(e){let t=ot(e.year),n=J(e.month,1,12),r=J(e.day,1,Ct(e.year,e.month));return t?n?!r&&G(`day`,e.day):G(`month`,e.month):G(`year`,e.year)}function at(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=J(t,0,23)||t===24&&n===0&&r===0&&i===0,o=J(n,0,59),s=J(r,0,59),c=J(i,0,999);return a?o?s?!c&&G(`millisecond`,i):G(`second`,r):G(`minute`,n):G(`hour`,t)}function K(e){return e===void 0}function q(e){return typeof e==`number`}function ot(e){return typeof e==`number`&&e%1==0}function st(e){return typeof e==`string`}function ct(e){return Object.prototype.toString.call(e)===`[object Date]`}function lt(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function ut(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function dt(e){return Array.isArray(e)?e:[e]}function ft(e,t,n){if(e.length!==0)return e.reduce((e,r)=>{let i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function pt(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function mt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ht(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!J(e.firstDay,1,7)||!J(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!J(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function J(e,t,n){return ot(e)&&e>=t&&e<=n}function gt(e,t){return e-t*Math.floor(e/t)}function Y(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function _t(e){if(!(K(e)||e===null||e===``))return parseInt(e,10)}function vt(e){if(!(K(e)||e===null||e===``))return parseFloat(e)}function yt(e){if(!(K(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function bt(e,t,n=`round`){let r=10**t;switch(n){case`expand`:return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case`trunc`:return Math.trunc(e*r)/r;case`round`:return Math.round(e*r)/r;case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${n} is out of range`)}}function xt(e){return e%4==0&&(e%100!=0||e%400==0)}function St(e){return xt(e)?366:365}function Ct(e,t){let n=gt(t-1,12)+1,r=e+(t-n)/12;return n===2?xt(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function wt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Tt(e,t,n){return-Xe(qe(e,1,t),n)+t-1}function Et(e,t=4,n=1){let r=Tt(e,t,n),i=Tt(e+1,t,n);return(St(e)-r+i)/7}function Dt(e){return e>99?e:e>U.twoDigitCutoffYear?1900+e:2e3+e}function Ot(e,t,n,r=null){let i=new Date(e),a={hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`};r&&(a.timeZone=r);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>e.type.toLowerCase()===`timezonename`);return s?s.value:null}function kt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);let r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function At(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function jt(e,t){let n={};for(let r in e)if(mt(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=At(i)}return n}function Mt(e,t){let n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?`+`:`-`;switch(t){case`short`:return`${i}${Y(n,2)}:${Y(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${Y(n,2)}${Y(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Nt(e){return pt(e,[`hour`,`minute`,`second`,`millisecond`])}var Pt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Ft=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],It=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function Lt(e){switch(e){case`narrow`:return[...It];case`short`:return[...Ft];case`long`:return[...Pt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`];case`2-digit`:return[`01`,`02`,`03`,`04`,`05`,`06`,`07`,`08`,`09`,`10`,`11`,`12`];default:return null}}var Rt=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],zt=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Bt=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Vt(e){switch(e){case`narrow`:return[...Bt];case`short`:return[...zt];case`long`:return[...Rt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var Ht=[`AM`,`PM`],Ut=[`Before Christ`,`Anno Domini`],Wt=[`BC`,`AD`],Gt=[`B`,`A`];function Kt(e){switch(e){case`narrow`:return[...Gt];case`short`:return[...Wt];case`long`:return[...Ut];default:return null}}function qt(e){return Ht[e.hour<12?0:1]}function Jt(e,t){return Vt(t)[e.weekday-1]}function Yt(e,t){return Lt(t)[e.month-1]}function Xt(e,t){return Kt(t)[e.year<0?0:1]}function Zt(e,t,n=`always`,r=!1){let i={years:[`year`,`yr.`],quarters:[`quarter`,`qtr.`],months:[`month`,`mo.`],weeks:[`week`,`wk.`],days:[`day`,`day`,`days`],hours:[`hour`,`hr.`],minutes:[`minute`,`min.`],seconds:[`second`,`sec.`]},a=[`hours`,`minutes`,`seconds`].indexOf(e)===-1;if(n===`auto`&&a){let n=e===`days`;switch(t){case 1:return n?`tomorrow`:`next ${i[e][0]}`;case-1:return n?`yesterday`:`last ${i[e][0]}`;case 0:return n?`today`:`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),c=s===1,l=i[e],u=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function Qt(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var $t={D:f,DD:p,DDD:h,DDDD:g,t:_,tt:v,ttt:y,tttt:ee,T:b,TT:x,TTT:te,TTTT:S,f:ne,ff:w,fff:ae,ffff:oe,F:C,FF:re,FFF:T,FFFF:se},en=class e{static create(t,n={}){return new e(t,n)}static parseFormat(e){let t=null,n=``,r=!1,i=[];for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`'`?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:n===``?`'`:n}),t=null,n=``,r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return $t[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return Y(e,t);let r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(t,n){let r=this.loc.listingMode()===`en`,i=this.loc.outputCalendar&&this.loc.outputCalendar!==`gregory`,a=(e,n)=>this.loc.extract(t,e,n),o=e=>t.isOffsetFixed&&t.offset===0&&e.allowZ?`Z`:t.isValid?t.zone.formatOffset(t.ts,e.format):``,s=()=>r?qt(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?Yt(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?Jt(t,e):a(n?{weekday:e}:{weekday:e,month:`long`,day:`numeric`},`weekday`),u=n=>{let r=e.macroTokenToFormatOpts(n);return r?this.formatWithSystemDefault(t,r):n},d=e=>r?Xt(t,e):a({era:e},`era`);return Qt(e.parseFormat(n),e=>{switch(e){case`S`:return this.num(t.millisecond);case`u`:case`SSS`:return this.num(t.millisecond,3);case`s`:return this.num(t.second);case`ss`:return this.num(t.second,2);case`uu`:return this.num(Math.floor(t.millisecond/10),2);case`uuu`:return this.num(Math.floor(t.millisecond/100));case`m`:return this.num(t.minute);case`mm`:return this.num(t.minute,2);case`h`:return this.num(t.hour%12==0?12:t.hour%12);case`hh`:return this.num(t.hour%12==0?12:t.hour%12,2);case`H`:return this.num(t.hour);case`HH`:return this.num(t.hour,2);case`Z`:return o({format:`narrow`,allowZ:this.opts.allowZ});case`ZZ`:return o({format:`short`,allowZ:this.opts.allowZ});case`ZZZ`:return o({format:`techie`,allowZ:this.opts.allowZ});case`ZZZZ`:return t.zone.offsetName(t.ts,{format:`short`,locale:this.loc.locale});case`ZZZZZ`:return t.zone.offsetName(t.ts,{format:`long`,locale:this.loc.locale});case`z`:return t.zoneName;case`a`:return s();case`d`:return i?a({day:`numeric`},`day`):this.num(t.day);case`dd`:return i?a({day:`2-digit`},`day`):this.num(t.day,2);case`c`:return this.num(t.weekday);case`ccc`:return l(`short`,!0);case`cccc`:return l(`long`,!0);case`ccccc`:return l(`narrow`,!0);case`E`:return this.num(t.weekday);case`EEE`:return l(`short`,!1);case`EEEE`:return l(`long`,!1);case`EEEEE`:return l(`narrow`,!1);case`L`:return i?a({month:`numeric`,day:`numeric`},`month`):this.num(t.month);case`LL`:return i?a({month:`2-digit`,day:`numeric`},`month`):this.num(t.month,2);case`LLL`:return c(`short`,!0);case`LLLL`:return c(`long`,!0);case`LLLLL`:return c(`narrow`,!0);case`M`:return i?a({month:`numeric`},`month`):this.num(t.month);case`MM`:return i?a({month:`2-digit`},`month`):this.num(t.month,2);case`MMM`:return c(`short`,!1);case`MMMM`:return c(`long`,!1);case`MMMMM`:return c(`narrow`,!1);case`y`:return i?a({year:`numeric`},`year`):this.num(t.year);case`yy`:return i?a({year:`2-digit`},`year`):this.num(t.year.toString().slice(-2),2);case`yyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,4);case`yyyyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,6);case`G`:return d(`short`);case`GG`:return d(`long`);case`GGGGG`:return d(`narrow`);case`kk`:return this.num(t.weekYear.toString().slice(-2),2);case`kkkk`:return this.num(t.weekYear,4);case`W`:return this.num(t.weekNumber);case`WW`:return this.num(t.weekNumber,2);case`n`:return this.num(t.localWeekNumber);case`nn`:return this.num(t.localWeekNumber,2);case`ii`:return this.num(t.localWeekYear.toString().slice(-2),2);case`iiii`:return this.num(t.localWeekYear,4);case`o`:return this.num(t.ordinal);case`ooo`:return this.num(t.ordinal,3);case`q`:return this.num(t.quarter);case`qq`:return this.num(t.quarter,2);case`X`:return this.num(Math.floor(t.ts/1e3));case`x`:return this.num(t.ts);default:return u(e)}})}formatDurationFromString(t,n){let r=this.opts.signMode===`negativeLargestOnly`?-1:1,i=e=>{switch(e[0]){case`S`:return`milliseconds`;case`s`:return`seconds`;case`m`:return`minutes`;case`h`:return`hours`;case`d`:return`days`;case`w`:return`weeks`;case`M`:return`months`;case`y`:return`years`;default:return null}},a=(e,t)=>n=>{let a=i(n);if(a){let i=t.isNegativeDuration&&a!==t.largestUnit?r:1,o;return o=this.opts.signMode===`negativeLargestOnly`&&a!==t.largestUnit?`never`:this.opts.signMode===`all`?`always`:`auto`,this.num(e.get(a)*i,n.length,o)}else return n},o=e.parseFormat(n),s=o.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),c=t.shiftTo(...s.map(i).filter(e=>e));return Qt(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},tn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function nn(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function rn(...e){return t=>e.reduce(([e,n,r],i)=>{let[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function an(e,...t){if(e==null)return[null,null];for(let[n,r]of t){let t=n.exec(e);if(t)return r(t)}return[null,null]}function on(...e){return(t,n)=>{let r={},i;for(i=0;i<e.length;i++)r[e[i]]=_t(t[n+i]);return[r,null,n+i]}}var sn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,cn=`(?:${sn.source}?(?:\\[(${tn.source})\\])?)?`,ln=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,un=RegExp(`${ln.source}${cn}`),dn=RegExp(`(?:[Tt]${un.source})?`),fn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,pn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,mn=/(\d{4})-?(\d{3})/,hn=on(`weekYear`,`weekNumber`,`weekDay`),gn=on(`year`,`ordinal`),_n=/(\d{4})-(\d\d)-(\d\d)/,vn=RegExp(`${ln.source} ?(?:${sn.source}|(${tn.source}))?`),yn=RegExp(`(?: ${vn.source})?`);function bn(e,t,n){let r=e[t];return K(r)?n:_t(r)}function xn(e,t){return[{year:bn(e,t),month:bn(e,t+1,1),day:bn(e,t+2,1)},null,t+3]}function Sn(e,t){return[{hours:bn(e,t,0),minutes:bn(e,t+1,0),seconds:bn(e,t+2,0),milliseconds:yt(e[t+3])},null,t+4]}function Cn(e,t){let n=!e[t]&&!e[t+1],r=kt(e[t+1],e[t+2]);return[{},n?null:L.instance(r),t+3]}function wn(e,t){return[{},e[t]?j.create(e[t]):null,t+1]}var Tn=RegExp(`^T?${ln.source}$`),En=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Dn(e){let[t,n,r,i,a,o,s,c,l]=e,u=t[0]===`-`,d=c&&c[0]===`-`,f=(e,t=!1)=>e!==void 0&&(t||e&&u)?-e:e;return[{years:f(vt(n)),months:f(vt(r)),weeks:f(vt(i)),days:f(vt(a)),hours:f(vt(o)),minutes:f(vt(s)),seconds:f(vt(c),c===`-0`),milliseconds:f(yt(l),d)}]}var On={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function kn(e,t,n,r,i,a,o){let s={year:t.length===2?Dt(_t(t)):_t(t),month:Ft.indexOf(n)+1,day:_t(r),hour:_t(i),minute:_t(a)};return o&&(s.second=_t(o)),e&&(s.weekday=e.length>3?Rt.indexOf(e)+1:zt.indexOf(e)+1),s}var An=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function jn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=kn(t,i,r,n,a,o,s),p;return p=c?On[c]:l?0:kt(u,d),[f,new L(p)]}function Mn(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Nn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Pn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Fn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function In(e){let[,t,n,r,i,a,o,s]=e;return[kn(t,i,r,n,a,o,s),L.utcInstance]}function Ln(e){let[,t,n,r,i,a,o,s]=e;return[kn(t,s,n,r,i,a,o),L.utcInstance]}var Rn=nn(fn,dn),zn=nn(pn,dn),Bn=nn(mn,dn),Vn=nn(un),Hn=rn(xn,Sn,Cn,wn),Un=rn(hn,Sn,Cn,wn),Wn=rn(gn,Sn,Cn,wn),Gn=rn(Sn,Cn,wn);function Kn(e){return an(e,[Rn,Hn],[zn,Un],[Bn,Wn],[Vn,Gn])}function qn(e){return an(Mn(e),[An,jn])}function Jn(e){return an(e,[Nn,In],[Pn,In],[Fn,Ln])}function Yn(e){return an(e,[En,Dn])}var Xn=rn(Sn);function Zn(e){return an(e,[Tn,Xn])}var Qn=nn(_n,yn),$n=nn(vn),er=rn(Sn,Cn,wn);function tr(e){return an(e,[Qn,Hn],[$n,er])}var nr=`Invalid Duration`,rr={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},ir={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...rr},X=146097/400,ar=146097/4800,or={years:{quarters:4,months:12,weeks:X/7,days:X,hours:X*24,minutes:X*24*60,seconds:X*24*60*60,milliseconds:X*24*60*60*1e3},quarters:{months:3,weeks:X/28,days:X/4,hours:X*24/4,minutes:X*24*60/4,seconds:X*24*60*60/4,milliseconds:X*24*60*60*1e3/4},months:{weeks:ar/7,days:ar,hours:ar*24,minutes:ar*24*60,seconds:ar*24*60*60,milliseconds:ar*24*60*60*1e3},...rr},sr=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],cr=sr.slice(0).reverse();function lr(e,t,n=!1){return new Z({values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function ur(e,t){let n=t.milliseconds??0;for(let r of cr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function dr(e,t){let n=ur(e,t)<0?-1:1;sr.reduceRight((r,i)=>{if(K(t[i]))return r;if(r){let a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),sr.reduce((n,r)=>{if(K(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function fr(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var Z=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?or:ir;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||I.create(),this.conversionAccuracy=t?`longterm`:`casual`,this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,n){return e.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(typeof t!=`object`||!t)throw new s(`Duration.fromObject: argument expected to be an object, got ${t===null?`null`:typeof t}`);return new e({values:jt(t,e.normalizeUnit),loc:I.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(q(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t==`object`)return e.fromObject(t);throw new s(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){let[r]=Yn(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){let[r]=Zn(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Duration is invalid`);let r=t instanceof W?t:new W(t,n);if(U.throwOnInvalid)throw new i(r);return new e({invalid:r})}static normalizeUnit(e){let t={year:`years`,years:`years`,quarter:`quarters`,quarters:`quarters`,month:`months`,months:`months`,week:`weeks`,weeks:`weeks`,day:`days`,days:`days`,hour:`hours`,hours:`hours`,minute:`minutes`,minutes:`minutes`,second:`seconds`,seconds:`seconds`,millisecond:`milliseconds`,milliseconds:`milliseconds`}[e&&e.toLowerCase()];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?en.create(this.loc,n).formatDurationFromString(this,e):nr}toHuman(e={}){if(!this.isValid)return nr;let t=e.showZeros!==!1,n=sr.map(n=>{let r=this.values[n];return K(r)||r===0&&!t?null:this.loc.numberFormatter({style:`unit`,unitDisplay:`long`,...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:`conjunction`,style:e.listStyle||`narrow`,...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e=`P`;return this.years!==0&&(e+=this.years+`Y`),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+`M`),this.weeks!==0&&(e+=this.weeks+`W`),this.days!==0&&(e+=this.days+`D`),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+=`T`),this.hours!==0&&(e+=this.hours+`H`),this.minutes!==0&&(e+=this.minutes+`M`),(this.seconds!==0||this.milliseconds!==0)&&(e+=bt(this.seconds+this.milliseconds/1e3,3)+`S`),e===`P`&&(e+=`T0S`),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:`extended`,...e,includeOffset:!1},$.fromMillis(t,{zone:`UTC`}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?ur(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t),r={};for(let e of sr)(mt(n.values,e)||mt(this.values,e))&&(r[e]=n.get(e)+this.get(e));return lr(this,{values:r},!0)}minus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let n of Object.keys(this.values))t[n]=At(e(this.values[n],n));return lr(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...jt(t,e.normalizeUnit)};return lr(this,{values:n})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return lr(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return dr(this.matrix,e),lr(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=fr(this.normalize().shiftToAll().toObject());return lr(this,{values:e},!0)}shiftTo(...t){if(!this.isValid||t.length===0)return this;t=t.map(t=>e.normalizeUnit(t));let n={},r={},i=this.toObject(),a;for(let e of sr)if(t.indexOf(e)>=0){a=e;let t=0;for(let n in r)t+=this.matrix[n][e]*r[n],r[n]=0;q(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else q(i[e])&&(r[e]=i[e]);for(let e in r)r[e]!==0&&(n[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return dr(this.matrix,n),lr(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo(`years`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return lr(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=fr(this.values);return lr(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(e,t){return e===void 0||e===0?t===void 0||t===0:e===t}for(let n of sr)if(!t(this.values[n],e.values[n]))return!1;return!0}},pr=`Invalid Interval`;function mr(e,t){return!e||!e.isValid?hr.invalid(`missing or invalid start`):!t||!t.isValid?hr.invalid(`missing or invalid end`):t<e?hr.invalid(`end before start`,`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var hr=class e{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Interval is invalid`);let i=t instanceof W?t:new W(t,n);if(U.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=_i(t),i=_i(n);return mr(r,i)??new e({start:r,end:i})}static after(t,n){let r=Z.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=Z.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i.minus(r),i)}static fromISO(t,n){let[r,i]=(t||``).split(`/`,2);if(r&&i){let t,a;try{t=$.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=$.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=Z.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=Z.fromISO(r,n);if(t.isValid)return e.before(o,t)}}return e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e=`milliseconds`){return this.isValid?this.toDuration(e).get(e):NaN}count(e=`milliseconds`,t){if(!this.isValid)return NaN;let n=this.start.startOf(e,t),r;return r=t!=null&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:t,end:n}={}){return this.isValid?e.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];let n=t.map(_i).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:i}=this,a=0;for(;i<this.e;){let t=n[a]||this.e,o=+t>+this.e?this.e:t;r.push(e.fromDateTimes(i,o)),i=o,a+=1}return r}splitBy(t){let n=Z.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as(`milliseconds`)===0)return[];let{s:r}=this,i=1,a,o=[];for(;r<this.e;){let t=this.start.plus(n.mapUnits(e=>e*i));a=+t>+this.e?this.e:t,o.push(e.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(t){if(!this.isValid)return this;let n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:e.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;let n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)}static merge(e){let[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(t){let n=null,r=0,i=[],a=t.map(e=>[{time:e.s,type:`s`},{time:e.e,type:`e`}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(let t of o)r+=t.type===`s`?1:-1,r===1?n=t.time:(n&&+n!=+t.time&&i.push(e.fromDateTimes(n,t.time)),n=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:pr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?en.create(this.s.loc.clone(t),e).formatInterval(this):pr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:pr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:pr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:pr}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:pr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Z.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},gr=class{static hasDST(e=U.defaultZone){let t=$.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return j.isValidZone(e)}static normalizeZone(e){return R(e,U.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||I.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||I.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||I.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||I.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||I.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||I.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||I.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return I.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return I.create(t,null,`gregory`).eras(e)}static features(){return{relative:lt(),localeWeek:ut()}}};function _r(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(Z.fromMillis(r).as(`days`))}function vr(e,t,n){let r=[[`years`,(e,t)=>t.year-e.year],[`quarters`,(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],[`months`,(e,t)=>t.month-e.month+(t.year-e.year)*12],[`weeks`,(e,t)=>{let n=_r(e,t);return(n-n%7)/7}],[`days`,_r]],i={},a=e,o,s;for(let[c,l]of r)n.indexOf(c)>=0&&(o=c,i[c]=l(e,t),s=a.plus(i),s>t?(i[c]--,e=a.plus(i),e>t&&(s=e,i[c]--,e=a.plus(i))):e=s);return[e,i,s,o]}function yr(e,t,n,r){let[i,a,o,s]=vr(e,t,n),c=t-i,l=n.filter(e=>[`hours`,`minutes`,`seconds`,`milliseconds`].indexOf(e)>=0);l.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+c/(o-i)));let u=Z.fromObject(a,r);return l.length>0?Z.fromMillis(c,r).shiftTo(...l).plus(u):u}var br=`missing Intl.DateTimeFormat.formatToParts support`;function Q(e,t=e=>e){return{regex:e,deser:([e])=>t(Le(e))}}var xr=`[ \xA0]`,Sr=new RegExp(xr,`g`);function Cr(e){return e.replace(/\./g,`\\.?`).replace(Sr,xr)}function wr(e){return e.replace(/\./g,``).replace(Sr,` `).toLowerCase()}function Tr(e,t){return e===null?null:{regex:RegExp(e.map(Cr).join(`|`)),deser:([n])=>e.findIndex(e=>wr(n)===wr(e))+t}}function Er(e,t){return{regex:e,deser:([,e,t])=>kt(e,t),groups:t}}function Dr(e){return{regex:e,deser:([e])=>e}}function Or(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function kr(e,t){let n=z(t),r=z(t,`{2}`),i=z(t,`{3}`),a=z(t,`{4}`),o=z(t,`{6}`),s=z(t,`{1,2}`),c=z(t,`{1,3}`),l=z(t,`{1,6}`),u=z(t,`{1,9}`),d=z(t,`{2,4}`),f=z(t,`{4,6}`),p=e=>({regex:RegExp(Or(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return Tr(t.eras(`short`),0);case`GG`:return Tr(t.eras(`long`),0);case`y`:return Q(l);case`yy`:return Q(d,Dt);case`yyyy`:return Q(a);case`yyyyy`:return Q(f);case`yyyyyy`:return Q(o);case`M`:return Q(s);case`MM`:return Q(r);case`MMM`:return Tr(t.months(`short`,!0),1);case`MMMM`:return Tr(t.months(`long`,!0),1);case`L`:return Q(s);case`LL`:return Q(r);case`LLL`:return Tr(t.months(`short`,!1),1);case`LLLL`:return Tr(t.months(`long`,!1),1);case`d`:return Q(s);case`dd`:return Q(r);case`o`:return Q(c);case`ooo`:return Q(i);case`HH`:return Q(r);case`H`:return Q(s);case`hh`:return Q(r);case`h`:return Q(s);case`mm`:return Q(r);case`m`:return Q(s);case`q`:return Q(s);case`qq`:return Q(r);case`s`:return Q(s);case`ss`:return Q(r);case`S`:return Q(c);case`SSS`:return Q(i);case`u`:return Dr(u);case`uu`:return Dr(s);case`uuu`:return Q(n);case`a`:return Tr(t.meridiems(),0);case`kkkk`:return Q(a);case`kk`:return Q(d,Dt);case`W`:return Q(s);case`WW`:return Q(r);case`E`:case`c`:return Q(n);case`EEE`:return Tr(t.weekdays(`short`,!1),1);case`EEEE`:return Tr(t.weekdays(`long`,!1),1);case`ccc`:return Tr(t.weekdays(`short`,!0),1);case`cccc`:return Tr(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Er(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Er(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return Dr(/[a-z_+-/]{1,256}?/i);case` `:return Dr(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:br};return m.token=e,m}var Ar={year:{"2-digit":`yy`,numeric:`yyyyy`},month:{numeric:`M`,"2-digit":`MM`,short:`MMM`,long:`MMMM`},day:{numeric:`d`,"2-digit":`dd`},weekday:{short:`EEE`,long:`EEEE`},dayperiod:`a`,dayPeriod:`a`,hour12:{numeric:`h`,"2-digit":`hh`},hour24:{numeric:`H`,"2-digit":`HH`},minute:{numeric:`m`,"2-digit":`mm`},second:{numeric:`s`,"2-digit":`ss`},timeZoneName:{long:`ZZZZZ`,short:`ZZZ`}};function jr(e,t,n){let{type:r,value:i}=e;if(r===`literal`){let e=/^\s+$/.test(i);return{literal:!e,val:e?` `:i}}let a=t[r],o=r;r===`hour`&&(o=t.hour12==null?t.hourCycle==null?n.hour12?`hour12`:`hour24`:t.hourCycle===`h11`||t.hourCycle===`h12`?`hour12`:`hour24`:t.hour12?`hour12`:`hour24`);let s=Ar[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Mr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Nr(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(mt(n,i)){let a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}else return[r,{}]}function Pr(e){let t=e=>{switch(e){case`S`:return`millisecond`;case`s`:return`second`;case`m`:return`minute`;case`h`:case`H`:return`hour`;case`d`:return`day`;case`o`:return`ordinal`;case`L`:case`M`:return`month`;case`y`:return`year`;case`E`:case`c`:return`weekday`;case`W`:return`weekNumber`;case`k`:return`weekYear`;case`q`:return`quarter`;default:return null}},n=null,r;return K(e.z)||(n=j.create(e.z)),K(e.Z)||(n||=new L(e.Z),r=e.Z),K(e.q)||(e.M=(e.q-1)*3+1),K(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),K(e.u)||(e.S=yt(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var Fr=null;function Ir(){return Fr||=$.fromMillis(1555555555555),Fr}function Lr(e,t){if(e.literal)return e;let n=Hr(en.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function Rr(e,t){return Array.prototype.concat(...e.map(e=>Lr(e,t)))}var zr=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Rr(en.parseFormat(t),e),this.units=this.tokens.map(t=>kr(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Mr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Nr(e,this.regex,this.handlers),[r,i,o]=n?Pr(n):[null,null,void 0];if(mt(n,`a`)&&mt(n,`H`))throw new a(`Can't include meridiem when specifying 24-hour format`);return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Br(e,t,n){return new zr(e,n).explainFromTokens(t)}function Vr(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=Br(e,t,n);return[r,i,a,o]}function Hr(e,t){if(!e)return null;let n=en.create(t,e).dtFormatter(Ir()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>jr(t,e,i))}var Ur=`Invalid DateTime`,Wr=864e13;function Gr(e){return new W(`unsupported zone`,`the zone "${e.name}" is not supported`)}function Kr(e){return e.weekData===null&&(e.weekData=Ze(e.c)),e.weekData}function qr(e){return e.localWeekData===null&&(e.localWeekData=Ze(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Jr(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new $({...n,...t,old:n})}function Yr(e,t,n){let r=e-t*60*1e3,i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;let a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Xr(e,t){e+=t*60*1e3;let n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Zr(e,t,n){return Yr(wt(e),t,n)}function Qr(e,t){let n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Ct(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Z.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(`milliseconds`),[s,c]=Yr(wt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function $r(e,t,n,r,i,a){let{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){let r=t||s,i=$.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}else return $.invalid(new W(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function ei(e,t,n=!0){return e.isValid?en.create(I.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ti(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=Y(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=Y(e.c.month),n===`month`)return i;i+=`-`}else if(i+=Y(e.c.month),n===`month`)return i;return i+=Y(e.c.day),i}function ni(e,t,n,r,i,a,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,c=``;switch(o){case`day`:case`month`:case`year`:break;default:if(c+=Y(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=Y(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=Y(e.c.second))}else{if(c+=Y(e.c.minute),o===`minute`)break;s&&(c+=Y(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=Y(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=Y(Math.trunc(-e.o/60)),c+=`:`,c+=Y(Math.trunc(-e.o%60))):(c+=`+`,c+=Y(Math.trunc(e.o/60)),c+=`:`,c+=Y(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var ri={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ii={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ai={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oi=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],si=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],ci=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function li(e){let t={year:`year`,years:`year`,month:`month`,months:`month`,day:`day`,days:`day`,hour:`hour`,hours:`hour`,minute:`minute`,minutes:`minute`,quarter:`quarter`,quarters:`quarter`,second:`second`,seconds:`second`,millisecond:`millisecond`,milliseconds:`millisecond`,weekday:`weekday`,weekdays:`weekday`,weeknumber:`weekNumber`,weeksnumber:`weekNumber`,weeknumbers:`weekNumber`,weekyear:`weekYear`,weekyears:`weekYear`,ordinal:`ordinal`}[e.toLowerCase()];if(!t)throw new o(e);return t}function ui(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return li(e)}}function di(e){if(hi===void 0&&(hi=U.now()),e.type!==`iana`)return e.offset(hi);let t=e.name,n=gi.get(t);return n===void 0&&(n=e.offset(hi),gi.set(t,n)),n}function fi(e,t){let n=R(t.zone,U.defaultZone);if(!n.isValid)return $.invalid(Gr(n));let r=I.fromObject(t),i,a;if(K(e.year))i=U.now();else{for(let t of oi)K(e[t])&&(e[t]=ri[t]);let t=it(e)||at(e);if(t)return $.invalid(t);let r=di(n);[i,a]=Zr(e,r,n)}return new $({ts:i,zone:n,loc:r,o:a})}function pi(e,t,n){let r=K(n.round)?!0:n.round,i=K(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=bt(e,r||n.calendary?0:2,n.calendary?`round`:i),t.loc.clone(n).relFormatter(n).format(e,a)),o=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(o(n.unit),n.unit);for(let e of n.units){let t=o(e);if(Math.abs(t)>=1)return a(t,e)}return a(e>t?-0:0,n.units[n.units.length-1])}function mi(e){let t={},n;return e.length>0&&typeof e[e.length-1]==`object`?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var hi,gi=new Map,$=class e{constructor(e){let t=e.zone||U.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new W(`invalid input`):null)||(t.isValid?null:Gr(t));this.ts=K(e.ts)?U.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{let a=q(e.o)&&!e.old?e.o:t.offset(this.ts);r=Xr(this.ts,a),n=Number.isNaN(r.year)?new W(`invalid input`):null,r=n?null:r,i=n?null:a}this._zone=t,this.loc=e.loc||I.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return e.zone=L.utcInstance,fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=ct(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=R(n.zone,U.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:I.fromObject(n)}):e.invalid(Gr(i))}static fromMillis(t,n={}){if(!q(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>Wr?e.invalid(`Timestamp out of range`):new e({ts:t,zone:R(n.zone,U.defaultZone),loc:I.fromObject(n)})}static fromSeconds(t,n={}){if(q(t))return new e({ts:t*1e3,zone:R(n.zone,U.defaultZone),loc:I.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=R(n.zone,U.defaultZone);if(!r.isValid)return e.invalid(Gr(r));let i=I.fromObject(n),o=jt(t,ui),{minDaysInFirstWeek:s,startOfWeek:c}=tt(o,i),l=U.now(),u=K(n.specificOffset)?r.offset(l):n.specificOffset,d=!K(o.ordinal),f=!K(o.year),p=!K(o.month)||!K(o.day),m=f||p,h=o.weekYear||o.weekNumber;if((m||d)&&h)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(p&&d)throw new a(`Can't mix ordinal dates with month/day`);let g=h||o.weekday&&!m,_,v,y=Xr(l,u);g?(_=si,v=ii,y=Ze(y,s,c)):d?(_=ci,v=ai,y=$e(y)):(_=oi,v=ri);let ee=!1;for(let e of _){let t=o[e];K(t)?ee?o[e]=v[e]:o[e]=y[e]:ee=!0}let b=(g?nt(o,s,c):d?rt(o):it(o))||at(o);if(b)return e.invalid(b);let[x,te]=Zr(g?Qe(o,s,c):d?et(o):o,u,r),S=new e({ts:x,zone:r,o:te,loc:i});return o.weekday&&m&&t.weekday!==S.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${S.toISO()}`):S.isValid?S:e.invalid(S.invalid)}static fromISO(e,t={}){let[n,r]=Kn(e);return $r(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=qn(e);return $r(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=Jn(e);return $r(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(K(t)||K(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=Vr(I.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):$r(o,c,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return e.fromFormat(t,n,r)}static fromSQL(e,t={}){let[n,r]=tr(e);return $r(n,r,t,`SQL`,e)}static invalid(t,r=null){if(!t)throw new s(`need to specify a reason the DateTime is invalid`);let i=t instanceof W?t:new W(t,r);if(U.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=Hr(e,I.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return Rr(en.parseFormat(e),I.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){hi=void 0,gi.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Kr(this).weekYear:NaN}get weekNumber(){return this.isValid?Kr(this).weekNumber:NaN}get weekday(){return this.isValid?Kr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?qr(this).weekday:NaN}get localWeekNumber(){return this.isValid?qr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?qr(this).weekYear:NaN}get ordinal(){return this.isValid?$e(this.c).ordinal:NaN}get monthShort(){return this.isValid?gr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?gr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?gr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?gr.weekdays(`long`,{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:`short`,locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:`long`,locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,n=wt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];let s=n-a*t,c=n-o*t,l=Xr(s,a),u=Xr(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[Jr(this,{ts:s}),Jr(this,{ts:c})]:[this]}get isInLeapYear(){return xt(this.year)}get daysInMonth(){return Ct(this.year,this.month)}get daysInYear(){return this.isValid?St(this.year):NaN}get weeksInWeekYear(){return this.isValid?Et(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Et(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=en.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(L.instance(e),t)}toLocal(){return this.setZone(U.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=R(t,U.defaultZone),t.equals(this.zone))return this;if(t.isValid){let e=this.ts;if(n||r){let n=t.offset(this.ts),r=this.toObject();[e]=Zr(r,n,t)}return Jr(this,{ts:e,zone:t})}else return e.invalid(Gr(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return Jr(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=jt(e,ui),{minDaysInFirstWeek:n,startOfWeek:r}=tt(t,this.loc),i=!K(t.weekYear)||!K(t.weekNumber)||!K(t.weekday),o=!K(t.ordinal),s=!K(t.year),c=!K(t.month)||!K(t.day),l=s||c,u=t.weekYear||t.weekNumber;if((l||o)&&u)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(c&&o)throw new a(`Can't mix ordinal dates with month/day`);let d;i?d=Qe({...Ze(this.c,n,r),...t},n,r):K(t.ordinal)?(d={...this.toObject(),...t},K(t.day)&&(d.day=Math.min(Ct(d.year,d.month),d.day))):d=et({...$e(this.c),...t});let[f,p]=Zr(d,this.o,this.zone);return Jr(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=Z.fromDurationLike(e);return Jr(this,Qr(this,t))}minus(e){if(!this.isValid)return this;let t=Z.fromDurationLike(e).negate();return Jr(this,Qr(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=Z.normalizeUnit(e);switch(r){case`years`:n.month=1;case`quarters`:case`months`:n.day=1;case`weeks`:case`days`:n.hour=0;case`hours`:n.minute=0;case`minutes`:n.second=0;case`seconds`:n.millisecond=0;break}if(r===`weeks`)if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;return r===`quarters`&&(n.month=(Math.ceil(this.month/3)-1)*3+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?en.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Ur}toLocaleString(e=f,t={}){return this.isValid?en.create(this.loc.clone(t),e).formatDateTime(this):Ur}toLocaleParts(e={}){return this.isValid?en.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e=`extended`,suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:a=`milliseconds`}={}){if(!this.isValid)return null;a=li(a);let o=e===`extended`,s=ti(this,o,a);return oi.indexOf(a)>=3&&(s+=`T`),s+=ni(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?ti(this,e===`extended`,li(t)):null}toISOWeekDate(){return ei(this,`kkkk-'W'WW-c`)}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a=`extended`,precision:o=`milliseconds`}={}){return this.isValid?(o=li(o),(r&&oi.indexOf(o)>=3?`T`:``)+ni(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return ei(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return ei(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?ti(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r=`HH:mm:ss.SSS`;return(t||e)&&(n&&(r+=` `),t?r+=`z`:e&&(r+=`ZZ`)),ei(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Ur}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t=`milliseconds`,n={}){if(!this.isValid||!e.isValid)return Z.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=dt(t).map(Z.normalizeUnit),a=e.valueOf()>this.valueOf(),o=yr(a?this:e,a?e:this,i,r);return a?o.negate():o}diffNow(t=`milliseconds`,n={}){return this.diff(e.now(),t,n)}until(e){return this.isValid?hr.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;let r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(t={}){if(!this.isValid)return null;let n=t.base||e.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0,i=[`years`,`months`,`days`,`hours`,`minutes`,`seconds`],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),pi(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?pi(t.base||e.fromObject({},{zone:this.zone}),this,{...t,numeric:`auto`,units:[`years`,`months`,`days`],calendary:!0}):null}static min(...t){if(!t.every(e.isDateTime))throw new s(`min requires all arguments be DateTimes`);return ft(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return ft(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return Br(I.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(t,n,r={}){return e.fromFormatExplain(t,n,r)}static buildFormatParser(e,t={}){let{locale:n=null,numberingSystem:r=null}=t;return new zr(I.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(K(t)||K(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=I.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new s(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:c,zone:l,specificOffset:u,invalidReason:d}=n.explainFromTokens(t);return d?e.invalid(d):$r(c,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return f}static get DATE_MED(){return p}static get DATE_MED_WITH_WEEKDAY(){return m}static get DATE_FULL(){return h}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return _}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return y}static get TIME_WITH_LONG_OFFSET(){return ee}static get TIME_24_SIMPLE(){return b}static get TIME_24_WITH_SECONDS(){return x}static get TIME_24_WITH_SHORT_OFFSET(){return te}static get TIME_24_WITH_LONG_OFFSET(){return S}static get DATETIME_SHORT(){return ne}static get DATETIME_SHORT_WITH_SECONDS(){return C}static get DATETIME_MED(){return w}static get DATETIME_MED_WITH_SECONDS(){return re}static get DATETIME_MED_WITH_WEEKDAY(){return ie}static get DATETIME_FULL(){return ae}static get DATETIME_FULL_WITH_SECONDS(){return T}static get DATETIME_HUGE(){return oe}static get DATETIME_HUGE_WITH_SECONDS(){return se}};function _i(e){if($.isDateTime(e))return e;if(e&&e.valueOf&&q(e.valueOf()))return $.fromJSDate(e);if(e&&typeof e==`object`)return $.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=$,e.Duration=Z,e.FixedOffsetZone=L,e.IANAZone=j,e.Info=gr,e.Interval=hr,e.InvalidZone=Ne,e.Settings=U,e.SystemZone=D,e.VERSION=`3.7.2`,e.Zone=E})),P=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=ye(),n;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.Day=`Day`,e.Month=`Month`,e.Year=`Year`})(n||(e.TimeUnit=n={}));var r;(function(e){e.Add=`Add`,e.Subtract=`Subtract`})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var i=class i{#e;#t=null;#n=null;#r=null;constructor(e,n){let r={zone:n};if(e?e instanceof i?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n,this.#r=e.#r):e instanceof Date?this.#e=t.DateTime.fromJSDate(e,r):typeof e==`number`?this.#e=t.DateTime.fromMillis(e,r):(this.#e=t.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(e,`EEE, d MMM yyyy HH:mm:ss`,r))):this.#e=t.DateTime.local(),!this.#e.isValid)throw Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#i(e){return e%4==0&&e%100!=0||e%400==0}get dstStart(){return this.#t}get dstStartLandingHour(){return this.#n}clearDstStart(){this.#t=null,this.#n=null}get dstEnd(){return this.#r}set dstEnd(e){this.#r=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf(`month`)}addDay(){this.#e=this.#e.plus({days:1}).startOf(`day`)}addHour(){this.#e=this.#e.plus({hours:1}).startOf(`hour`)}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf(`minute`)}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf(`month`).startOf(`second`)}subtractDay(){this.#e=this.#e.minus({days:1}).endOf(`day`).startOf(`second`)}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf(`hour`).startOf(`second`)}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf(`minute`).startOf(`second`)}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){switch(e){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(e){switch(e){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(e,t){if(e===r.Add){this.addUnit(t);return}if(e===r.Subtract){this.subtractUnit(t);return}throw Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf(`day`)}setEndOfDay(){this.#e=this.#e.endOf(`day`)}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#a().day}getUTCFullYear(){return this.#a().year}getUTCDay(){let e=this.#a().weekday;return e===7?0:e}getUTCMonth(){return this.#a().month-1}getUTCHours(){return this.#a().hour}getUTCMinutes(){return this.#a().minute}getUTCSeconds(){return this.#a().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:t,month:n}=this.#e;if(n===2){let r=i.#i(this.#e.year);return t===e.DAYS_IN_MONTH[n-1]-+!r}return t===e.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:t,month:n}=this.#e,r;return r=n===2?e.DAYS_IN_MONTH[n-1]-+!i.#i(this.#e.year):e.DAYS_IN_MONTH[n-1],t>r-7}applyDateOperation(e,t,i){if(t===n.Month||t===n.Day){this.invokeDateOperation(e,t);return}let a=this.getHours(),o=this.getUTCOffset();this.invokeDateOperation(e,t);let s=this.getHours(),c=(s-a+24)%24;e===r.Add&&this.getUTCOffset()>o&&c>=2?i!==24&&(this.#t=(a+1)%24,this.#n=s):c===0&&this.getMinutes()===0&&this.getSeconds()===0&&i!==24&&(this.dstEnd=s)}#a(){return this.#e.toUTC()}};e.CronDate=i,e.default=i})),be=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=P(),n=N(),r=1,i=12,a=Object.freeze([]);e.CronMonth=class extends n.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get daysInMonth(){return t.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),xe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=N(),n=be(),r=1,i=31,a=Object.freeze([`L`]);e.CronDayOfMonth=class e extends t.CronField{static fromMonth(t,r,i){if(t.length!==1)return new e(r,i);let a=n.CronMonth.daysInMonth[t[0]-1],o=r.filter(e=>typeof e!=`number`||e<=a);return new e(o.length>0?o:r,i)}static get min(){return r}static get max(){return i}static get chars(){return a}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Se=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=N(),n=0,r=7,i=Object.freeze([`L`]);e.CronDayOfWeek=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){if(super(e,t),this.validate(),this.values.some(e=>e===`L`))throw Error(`${this.constructor.name} Validation error, unexpected standalone L`)}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}})),Ce=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=N(),n=0,r=23,i=Object.freeze([]);e.CronHour=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),we=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=N(),n=0,r=59,i=Object.freeze([]);e.CronMinute=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Te=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=N(),n=0,r=59,i=Object.freeze([]);e.CronSecond=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Ee=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(ve(),e),n(xe(),e),n(Se(),e),n(N(),e),n(Ce(),e),n(we(),e),n(be(),e),n(Te(),e)})),F=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=Ee();e.CronFieldCollection=class e{#e;#t;#n;#r;#i;#a;static from(n,r){return new e({second:this.resolveField(t.CronSecond,n.second,r.second),minute:this.resolveField(t.CronMinute,n.minute,r.minute),hour:this.resolveField(t.CronHour,n.hour,r.hour),dayOfMonth:this.resolveField(t.CronDayOfMonth,n.dayOfMonth,r.dayOfMonth),month:this.resolveField(t.CronMonth,n.month,r.month),dayOfWeek:this.resolveField(t.CronDayOfWeek,n.dayOfWeek,r.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof t.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:a,dayOfWeek:o}){if(!e)throw Error(`Validation error, Field second is missing`);if(!n)throw Error(`Validation error, Field minute is missing`);if(!r)throw Error(`Validation error, Field hour is missing`);if(!i)throw Error(`Validation error, Field dayOfMonth is missing`);if(!a)throw Error(`Validation error, Field month is missing`);if(!o)throw Error(`Validation error, Field dayOfWeek is missing`);if(a.values.length===1&&!i.hasLastChar&&o.isWildcard&&!(parseInt(i.values[0],10)<=t.CronMonth.daysInMonth[a.values[0]-1]))throw Error(`Invalid explicit day of month definition`);this.#e=e,this.#t=n,this.#n=r,this.#i=a,this.#a=o,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#a}static compactField(e){if(e.length===0)return[];let t=[],n;return e.forEach((e,r,i)=>{if(n===void 0){n={start:e,count:1};return}let a=i[r-1]||n.start,o=i[r+1];if(e===`L`||e===`W`){t.push(n),t.push({start:e,count:1}),n=void 0;return}if(n.step===void 0&&o!==void 0){let t=e-a;if(t<=o-e){n={...n,count:2,end:e,step:t};return}n.step=1}e-(n.end??0)===n.step?(n.count++,n.end=e):(n.count===1?t.push({start:n.start,count:1}):n.count===2?(t.push({start:n.start,count:1}),t.push({start:n.end??a,count:1})):t.push(n),n={start:e,count:1})}),n&&t.push(n),t}static#o(e,n,r){let i=n.step;return i?i===1&&n.start===e.min&&n.end&&n.end>=r?(e instanceof t.CronDayOfMonth||e instanceof t.CronDayOfWeek)&&!e.isWildcard?null:e.hasQuestionMarkChar?`?`:`*`:i!==1&&n.start===e.min&&n.end&&n.end>=r-i+1?`*/${i}`:null:null}static#s(e){let t=e.step;if(t===1)return`${e.start}-${e.end}`;let n=e.start===0?e.count-1:e.count;if(!t)throw Error(`Unexpected range step`);if(!e.end)throw Error(`Unexpected range end`);if(t*n>e.end){let n=(n,r)=>{if(typeof e.start!=`number`)throw Error(`Unexpected range start`);return r%t===0?e.start+r:null};if(typeof e.start!=`number`)throw Error(`Unexpected range start`);let r={length:e.end-e.start+1};return Array.from(r,n).filter(e=>e!==null).join(`,`)}return`${e.start}-${e.end}/${t}`}stringifyField(n){let r=n.max,i=n.values;if(n instanceof t.CronDayOfWeek){r=6;let e=this.#a.values;i=e[e.length-1]===7?e.slice(0,-1):e}n instanceof t.CronDayOfMonth&&(r=this.#i.values.length===1?t.CronMonth.daysInMonth[this.#i.values[0]-1]:n.max);let a=e.compactField(i);if(a.length===1){let t=e.#o(n,a[0],r);if(t)return t}return a.map(r=>{let i=r.count===1?r.start.toString():e.#s(r);return n instanceof t.CronDayOfWeek&&n.nthDay>0?`${i}#${n.nthDay}`:i}).join(`,`)}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#a)),t.join(` `)}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#a.serialize()}}}})),De=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var t=P();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=`Out of the time span range`,e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=`Invalid expression, loop limit exceeded`;var n=1e4,r=class r{#e;#t;#n;#r;#i;#a;#o=null;#s=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new t.CronDate(n.startDate,this.#t):null,this.#i=n.endDate?new t.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let e=new t.CronDate(r,this.#t);this.#r&&e.getTime()<this.#r.getTime()?r=this.#r:this.#i&&e.getTime()>this.#i.getTime()&&(r=this.#i)}this.#n=new t.CronDate(r,this.#t),this.#a=e}get fields(){return this.#a}static fieldsToExpression(e,t){return new r(e,t||{})}static#c(e,t){return t.some(t=>t===e)}#l(e,t){return e[t?e.length-1:0]}#u(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#o===n)return this.#s;let r=new t.CronDate(e);r.setStartOfDay();let i=new t.CronDate(e);return i.setEndOfDay(),this.#o=n,this.#s=r.getUTCOffset()!==i.getUTCOffset(),this.#s}#d(e,n,r){let i=this.#a.second.values,a=e.getSeconds(),o=this.#a.second.findNearestValue(a,r);if(o!==null){e.setSeconds(o);return}e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))}#f(e,n,r){let i=this.#a.minute.values,a=this.#a.second.values,o=e.getMinutes(),s=this.#a.minute.findNearestValue(o,r);if(s!==null){e.setMinutes(s),e.setSeconds(this.#l(a,r));return}e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(a,r))}static#p(e,t){if(!t.isLastWeekdayOfMonth())return!1;let n=t.getDay();return e.some(e=>n===parseInt(e.toString().charAt(0),10)%7)}static#m(e,t){return e<=0||Math.ceil(t.getDate()/7)===e}next(){return this.#v()}prev(){return this.#v(!0)}hasNext(){let e=this.#n;try{return this.#v(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#v(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let t=[];if(e>=0)for(let n=0;n<e;n++)try{t.push(this.next())}catch{return t}else for(let n=0;n>e;n--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new t.CronDate(e||this.#e.currentDate,this.#t)}stringify(e=!1){return this.#a.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:a}=this.#a,o=new t.CronDate(e,this.#t);return!(!n.values.includes(o.getSeconds())||!r.values.includes(o.getMinutes())||!i.values.includes(o.getHours())||!a.values.includes(o.getMonth()+1)||!this.#h(o))}toString(){return this.#e.expression||this.stringify(!0)}#h(e){let t=this.#a.dayOfMonth.isWildcard,n=!t,i=this.#a.dayOfWeek.isWildcard,a=!i,o=r.#c(e.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=this.#a.dayOfWeek.nthDay,c=r.#c(e.getDay(),this.#a.dayOfWeek.values)&&r.#m(s,e)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,e);return!!(n&&a&&(o||c)||o&&!a||t&&!i&&c)}#g(e,n,i){let a=this.#a.hour.values,o=a,s=e.getHours(),c=r.#c(s,a),l=e.dstEnd===s;if(e.dstStart!==null&&e.dstStartLandingHour===s){for(let t=e.dstStart;t!==s;t=(t+1)%24)if(r.#c(t,a))return!0}if(l&&!i)return e.dstEnd=null,e.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,o.length),!1;if(c)return!0;e.clearDstStart();let u=this.#a.hour.findNearestValue(s,i);if(u===null)return e.applyDateOperation(n,t.TimeUnit.Day,o.length),!1;if(this.#u(e)){let r=i?s-u:u-s;for(let a=0;a<r&&(e.applyDateOperation(n,t.TimeUnit.Hour,o.length),!(!i&&e.getHours()>=u||i&&e.getHours()<=u));a++);}else e.setHours(u);return e.setMinutes(this.#l(this.#a.minute.values,i)),e.setSeconds(this.#l(this.#a.second.values,i)),!1}#_(t){if(!this.#r&&!this.#i)return;let n=t.getTime();if(this.#r&&n<this.#r.getTime()||this.#i&&n>this.#i.getTime())throw Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#v(i=!1){let a=i?t.DateMathOp.Subtract:t.DateMathOp.Add,o=new t.CronDate(this.#n),s=o.getTime();o.getMilliseconds()>0&&(o.setMilliseconds(0),i||o.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Second,this.#a.hour.values.length));let c=0;for(;++c<n;){if(this.#_(o),!this.#h(o)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(o.getMonth()+1,this.#a.month.values)){o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#g(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values)){this.#f(o,a,i);continue}if(!r.#c(o.getSeconds(),this.#a.second.values)){this.#d(o,a,i);continue}if(s===o.getTime()){o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(c>=n)throw Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return this.#n=o,o}[Symbol.iterator](){return{next:()=>{try{return{value:this.#v(),done:!1}}catch{return{value:void 0,done:!0}}}}}};e.CronExpression=r,e.default=r})),Oe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.seededRandom=r;function t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return()=>t>>>0}function n(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function r(e){return n(e?t(e)():Math.floor(Math.random()*1e10))}})),ke=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=F(),n=De(),r=Oe(),i=Ee(),a;(function(e){e[`@yearly`]=`0 0 0 1 1 *`,e[`@annually`]=`0 0 0 1 1 *`,e[`@monthly`]=`0 0 0 1 * *`,e[`@weekly`]=`0 0 0 * * 0`,e[`@daily`]=`0 0 0 * * *`,e[`@hourly`]=`0 0 * * * *`,e[`@minutely`]=`0 * * * * *`,e[`@secondly`]=`* * * * * *`,e[`@weekdays`]=`0 0 0 * * 1-5`,e[`@weekends`]=`0 0 0 * * 0,6`})(a||(e.PredefinedExpressions=a={}));var o;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.DayOfMonth=`DayOfMonth`,e.Month=`Month`,e.DayOfWeek=`DayOfWeek`})(o||(e.CronUnit=o={}));var s;(function(e){e[e.jan=1]=`jan`,e[e.feb=2]=`feb`,e[e.mar=3]=`mar`,e[e.apr=4]=`apr`,e[e.may=5]=`may`,e[e.jun=6]=`jun`,e[e.jul=7]=`jul`,e[e.aug=8]=`aug`,e[e.sep=9]=`sep`,e[e.oct=10]=`oct`,e[e.nov=11]=`nov`,e[e.dec=12]=`dec`})(s||(e.Months=s={}));var c;(function(e){e[e.sun=0]=`sun`,e[e.mon=1]=`mon`,e[e.tue=2]=`tue`,e[e.wed=3]=`wed`,e[e.thu=4]=`thu`,e[e.fri=5]=`fri`,e[e.sat=6]=`sat`})(c||(e.DayOfWeek=c={}));var l=256,u=1024;e.CronExpressionParser=class e{static parse(s,c={}){let{strict:l=!1,hashSeed:u}=c,d=(0,r.seededRandom)(u);s=a[s]||s;let f=e.#e(s,l);if(!(f.dayOfMonth===`*`||f.dayOfWeek===`*`||!l))throw Error(`Cannot use both dayOfMonth and dayOfWeek together in strict mode!`);let p=e.#t(o.Second,f.second,i.CronSecond.constraints,d,l),m=e.#t(o.Minute,f.minute,i.CronMinute.constraints,d,l),h=e.#t(o.Hour,f.hour,i.CronHour.constraints,d,l),g=e.#t(o.Month,f.month,i.CronMonth.constraints,d,l),_=e.#t(o.DayOfMonth,f.dayOfMonth,i.CronDayOfMonth.constraints,d,l),{dayOfWeek:v,nthDayOfWeek:y}=e.#h(f.dayOfWeek),ee=e.#t(o.DayOfWeek,v,i.CronDayOfWeek.constraints,d,l),b=new t.CronFieldCollection({second:new i.CronSecond(p,{rawValue:f.second}),minute:new i.CronMinute(m,{rawValue:f.minute}),hour:new i.CronHour(h,{rawValue:f.hour}),dayOfMonth:i.CronDayOfMonth.fromMonth(g,_,{rawValue:f.dayOfMonth}),month:new i.CronMonth(g,{rawValue:f.month}),dayOfWeek:new i.CronDayOfWeek(ee,{rawValue:f.dayOfWeek,nthDayOfWeek:y})});return new n.CronExpression(b,{...c,expression:s})}static#e(e,t){if(t&&!e.length)throw Error(`Invalid cron expression`);if(e||=`0 * * * * *`,e.length>u)throw Error(`Invalid cron expression, too long, expected at most ${u} characters`);let n=e.trim().split(/\s+/);if(t&&n.length<6)throw Error(`Invalid cron expression, expected 6 fields`);if(n.length>6)throw Error(`Invalid cron expression, too many fields`);let r=[`0`,`*`,`*`,`*`,`*`,`*`];n.length<r.length&&n.unshift(...r.slice(0,r.length-n.length));let[i,a,o,s,c,l]=n;return{second:i,minute:a,hour:o,dayOfMonth:s,month:c,dayOfWeek:l}}static#t(e,t,n,r,i){if((e===o.Month||e===o.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,e=>{e=e.toLowerCase();let t=s[e]||c[e];if(t===void 0)throw Error(`Validation error, cannot resolve alias "${e}"`);return t.toString()})),!n.validChars.test(t))throw Error(`Invalid characters, got value: ${t}`);return t=this.#n(t,n),t=this.#r(t,n,r,e,i),this.#l(e,t,n)}static#n(e,t){return e.replace(/[*?]/g,t.min+`-`+t.max)}static#r(t,n,r,i,a){let o=r(),s=0;return t.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(t,r,c,l)=>{if(r&&c&&l){let t=parseInt(r,10),u=parseInt(c,10),d=parseInt(l,10);if(d<=0)throw Error(`Invalid step: ${d}, must be positive`);let f=e.#o(t,u,n,i,a);return s+=Math.ceil((f.max-f.min+1)/d),e.#c(i,s),e.#s(o,f.min,f.max,d,i,a)}else if(r&&c){let t=parseInt(r,10),s=parseInt(c,10),l=e.#o(t,s,n,i,a);return String(e.#i(o,l.min,l.max))}else if(l){let t=parseInt(l,10);if(t<=0)throw Error(`Invalid step: ${t}, must be positive`);return s+=Math.ceil((n.max-n.min+1)/t),e.#c(i,s),e.#s(o,n.min,n.max,t,i,a)}else return String(e.#i(o,n.min,n.max))})}static#i(e,t,n){return Math.floor(e*(n-t+1))+t}static#a(e){return e.charAt(0).toLowerCase()+e.slice(1)}static#o(t,n,r,i,a){if(t>n)throw Error(`Invalid range: ${t}-${n}, min > max`);if(a&&(t<r.min||n>r.max))throw Error(`Invalid range: ${t}-${n}, outside the ${r.min}-${r.max} range of the ${e.#a(i)} field`);let o=Math.max(t,r.min),s=Math.min(n,r.max);if(o>s)throw Error(`Invalid range: ${t}-${n}, no usable value in the ${e.#a(i)} field`);return{min:o,max:s}}static#s(t,n,r,i,a,o){if(o&&i>r-n+1)throw Error(`Invalid step: ${i}, wider than the ${n}-${r} range of the ${e.#a(a)} field`);let s=Math.floor(t*i),c=[];for(let e=Math.floor(n/i)*i+s;e<=r;e+=i)e>=n&&c.push(e);return c.length===0?String(e.#i(t,n,r)):c.join(`,`)}static#c(e,t){if(t>l)throw Error(`Constraint error, too many values in ${e} field, expected at most ${l}`)}static#l(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#g(r,n))i.push(n);else{let e=parseInt(n.toString(),10);if(!(e>=r.min&&e<=r.max))throw Error(`Constraint error, got value ${n} expected range ${r.min}-${r.max}`);i.push(t===o.DayOfWeek?e%7:n)}}let s=n.split(`,`);for(let n of s){if(e.#c(t,i.length),!(n.length>0))throw Error(`Invalid list value format`);a(e.#u(t,n,r),r)}return i}static#u(t,n,r){let i=n.split(`/`);if(i.length>2)throw Error(`Invalid repeat: ${n}`);return i.length===2?(i[0].includes(`-`)||(i[0]=`${i[0]}-${r.max}`),e.#m(t,i[0],parseInt(i[1],10),r)):e.#m(t,n,1,r)}static#d(e,t,n){if(!(!isNaN(e)&&!isNaN(t)&&e>=n.min&&t<=n.max))throw Error(`Constraint error, got range ${e}-${t} expected range ${n.min}-${n.max}`);if(e>t)throw Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#f(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#p(e,t,n,r){let i=[];e===o.DayOfWeek&&n%7==0&&(n-t)%r===0&&i.push(0);for(let e=t;e<=n;e+=r)i.indexOf(e)===-1&&i.push(e);return i}static#m(e,t,n,r){let i=t.split(`-`);if(i.length<=1)return isNaN(+t)?t:+t;let[a,o]=i.map(e=>parseInt(e,10));return this.#d(a,o,r),this.#f(n),this.#p(e,a,o,n)}static#h(e){let t=e.split(`#`);if(t.length<=1)return{dayOfWeek:t[0]};let n=+t[t.length-1],r=e.match(/([,\-/])/);if(r!==null)throw Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw Error(`Constraint error, invalid dayOfWeek occurrence number (#)`);return{dayOfWeek:t[0],nthDayOfWeek:n}}static#g(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),Ae=t(((e,t)=>{t.exports={}})),je=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var t=ke();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=Ae(),r=await n(t,`utf8`);return e.#e(r)}static parseFileSync(t){let{readFileSync:n}=Ae(),r=n(t,`utf8`);return e.#e(r)}static#e(t){let n=t.split(`
|
|
2
|
-
`),r={variables:{},expressions:[],errors:{}};for(let t of n){let n=t.trim();if(n.length===0||n.startsWith(`#`))continue;let i=n.match(/^(.*)=(.*)$/);if(i){let[,e,t]=i;r.variables[e]=t.replace(/["']/g,``);continue}try{let t=e.#t(n);r.expressions.push(t.interval)}catch(e){r.errors[n]=e}}return r}static#t(e){let n=e.split(/\s+/);return{interval:t.CronExpressionParser.parse(n.slice(0,5).join(` `)),command:n.slice(5,n.length)}}}})),I=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var r=ke(),i=P();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=F();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=De();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=ke();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=je();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(Ee(),e),e.default=r.CronExpressionParser}))();function Me(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`).sort((e,t)=>e-t):[]}function L(e){if(e.length<2)return null;let t=e[1]-e[0];if(t<=0)return null;for(let n=2;n<e.length;n++)if(e[n]-e[n-1]!==t)return null;return t}function Ne(e,t,n){let r=new Date;return r.setHours(e,t,0,0),r.toLocaleTimeString(n,{hour:`numeric`,minute:`2-digit`})}function R(e,t){let n=e===7?0:e;return new Date(Date.UTC(2023,0,1)+n*864e5).toLocaleDateString(t,{weekday:`short`,timeZone:`UTC`})}function Pe(e,t){return e.length<=1?e[0]??``:t.startsWith(`zh`)?e.join(`、`):e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}function Fe(e){return e.length===5&&e.every((e,t)=>e===t+1)}function Ie(e){if(e.length!==2)return!1;let t=[...e].toSorted((e,t)=>e-t);return t[0]===0&&t[1]===6}function Le(e,t,n,r){try{let i=I.CronExpressionParser.parse(e,{...r?.timezone?{tz:r.timezone}:{}}).fields,a=Me(i.minute.values),o=Me(i.hour.values),s=Me(i.dayOfWeek.values),c=Me(i.dayOfMonth.values);if(a.length===60&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard)return n.everyMinute;if(!i.minute.isWildcard&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard&&a.length>1){let e=L(a);if(e!=null&&e>0)return n.everyNMinutes.replace(`{{n}}`,String(e))}if(!i.minute.isWildcard&&a.length===1&&!i.hour.isWildcard&&o.length>1&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard){let e=L(o);if(e!=null&&e>0)return n.everyNHours.replace(`{{n}}`,String(e))}if(!i.minute.isWildcard&&a.length===1&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard&&o.length===24)return n.hourly;let l=!i.minute.isWildcard&&a.length===1&&!i.hour.isWildcard&&o.length===1?Ne(o[0],a[0],t):``;if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard)return n.dailyAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&Fe(s))return n.weekdaysAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&Ie(s))return n.weekendsAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length===1){let e=R(s[0],t);return n.weeklyOn.replace(`{{day}}`,e).replace(`{{time}}`,l)}if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length>1){let e=Pe(s.map(e=>R(e,t)),t);return n.daysAt.replace(`{{days}}`,e).replace(`{{time}}`,l)}return l&&!i.dayOfMonth.isWildcard&&c.length===1&&i.month.isWildcard&&i.dayOfWeek.isWildcard?n.monthlyAt.replace(`{{day}}`,String(c[0])).replace(`{{time}}`,l):n.customSchedule}catch{return null}}function Re(e,t,n,r){let i=e.trim();return i?Le(i,t,n,r)||ze(r?.nextRun,t)||n.customSchedule:ze(r?.nextRun,t)||`—`}function ze(e,t){if(!e)return``;let n=new Date(e);return Number.isNaN(n.getTime())?``:n.toLocaleString(t,{weekday:`short`,hour:`numeric`,minute:`2-digit`})}var z=1e3,B=60*z,V=60*B,H=24*V,Be=7*H,Ve=new Intl.ListFormat(`en-US`,{type:`conjunction`}),He=Object.fromEntries([`second`,`minute`,`hour`,`day`,`week`].map(e=>[e,new Intl.NumberFormat(`en-US`,{style:`unit`,unit:e,unitDisplay:`long`})])),Ue={en:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),zh:new Intl.DateTimeFormat(`zh-CN`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})},We={en:new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`}),zh:new Intl.DateTimeFormat(`zh-CN`,{hour:`2-digit`,minute:`2-digit`})},U={minute:B,hour:V,day:H,week:Be};function W(e){return e===`zh`?`zh-CN`:`en-US`}function Ge(e,t,n){return n===`zh`?`${e} ${t===`week`?`周`:t===`day`?`天`:t===`hour`?`小时`:t===`minute`?`分钟`:`秒`}`:He[String(t)].format(e)}function Ke(e,t){return t===`zh`?e.join(` `):Ve.format(e)}function G(e,t){let n=typeof e==`number`?e:Number.parseFloat(e);return Math.max(B,Math.round((Number.isFinite(n)&&n>0?n:1)*U[t]))}function qe(e,t,n){let r=typeof e==`number`?e:Number.parseFloat(e),i=Number.isFinite(r)&&r>0?r:1;return String(Number.parseFloat((i*U[t]/U[n]).toFixed(6)))}function Je(e,t){let n=Math.max(z,Math.round(e)),r=n===H?[{unit:`hour`,ms:V}]:n>=Be&&n%Be===0?[{unit:`week`,ms:Be}]:n>=H?[{unit:`day`,ms:H},{unit:`hour`,ms:V},{unit:`minute`,ms:B},{unit:`second`,ms:z}]:n>=V?[{unit:`hour`,ms:V},{unit:`minute`,ms:B},{unit:`second`,ms:z}]:n>=B?[{unit:`minute`,ms:B},{unit:`second`,ms:z}]:[{unit:`second`,ms:z}],i=n,a=[];for(let{unit:e,ms:n}of r){let r=Math.floor(i/n);r<=0||(a.push(Ge(r,e,t)),i%=n)}return Ke(a,t)}function Ye(e,t){let n=Je(e,t);return t===`zh`?`每 ${n}运行一次`:`Runs every ${n}`}function Xe(e,t){return Ue[t].format(new Date(e))}function Ze(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}function Qe(e,t,n=Date.now()){let r=new Date(e),i=Math.round((Ze(r)-Ze(new Date(n)))/H),a=We[t].format(r);return i===0?t===`zh`?`今天 ${a}`:`today at ${a}`:i===1?t===`zh`?`明天 ${a}`:`tomorrow at ${a}`:i===-1?t===`zh`?`昨天 ${a}`:`yesterday at ${a}`:Xe(e,t)}function $e(e,t){return e.eventType===`task.attention_required.v2`&&e.payloadMatch?.reason===`blocked`?t.trigger.taskBlockedWhen:e.eventType===`note.created`?t.trigger.noteCreatedWhen:e.eventType===`session.transcript.updated`?t.trigger.sessionUpdatedWhen:t.trigger.eventWithType.replace(`{type}`,e.eventType)}function et(e,t,n,r){if(e.kind===`manual`)return t.trigger.manualWhen;if(e.kind===`webhook`)return t.trigger.webhookWhen;if(e.kind===`event`)return $e(e,t);let i=e.schedule;return i.kind===`once`?t.trigger.onceAt.replace(`{time}`,Qe(Date.parse(i.at),r)):i.kind===`interval`?Ye(i.everyMs,r):Re(i.expr,W(r),n.scheduleBadge,{timezone:i.tz})}function tt(e,t,n,r=Date.now()){return e.enabled?e.state.nextRunAtMs?Qe(e.state.nextRunAtMs,n,r):e.trigger.kind===`manual`?t.info.noAutomaticTrigger:e.trigger.kind===`event`||e.trigger.kind===`webhook`?t.info.waitingForTrigger:t.info.noUpcomingRun:t.info.pausedNoAutomaticRuns}function nt(e,t,n,r=Date.now()){if(!e.state.lastRunAtMs)return t.info.notRunYet;let i=Qe(e.state.lastRunAtMs,n,r),a=e.state.lastRunStatus;return a?`${i} · ${t.status[a]}`:i}function rt(e){return!e.enabled&&e.trigger.kind===`schedule`&&e.trigger.schedule.kind===`once`&&e.state.lastRunStatus===`succeeded`&&(e.state.lastRunAtMs??0)>=Date.parse(e.trigger.schedule.at)&&!e.state.runningRunId}async function it(e){let{conversationId:t}=await de.openConfiguration({automationId:e.automationId?.trim()||void 0,projectId:e.projectId?.trim()||void 0,...e.runId?{runId:e.runId}:{}}),n=new URLSearchParams(e.automationId?{automation:e.automationId.trim()}:{new:`1`,setupChat:t});return e.projectId?.trim()&&n.set(`projectId`,e.projectId.trim()),e.prompt?.trim()&&n.set(`chatDraft`,e.prompt.trim()),`/automations?${n.toString()}`}var at={name:``,description:``,projectId:``,triggerMode:`daily`,time:`09:00`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,weekday:`1`,intervalValue:`1`,intervalUnit:`hour`,cronExpr:`0 9 * * *`,webhookSecretId:``,onceAt:``,eventType:``,eventSource:``,eventPayloadMatch:``,actionMode:`agent`,agentId:``,model:``,instruction:``,taskId:``,browserAutomationId:``,browserAutomationInputs:{},safetyMode:`suggest_only`,timeoutSeconds:`1800`,conversationMode:`new_session`,notificationPolicy:`attention`,resultWebhookEndpoint:``,resultWebhookSecretId:``,disableAfterFailures:`3`},K=[{value:`15`,unit:`minute`},{value:`30`,unit:`minute`},{value:`1`,unit:`hour`},{value:`6`,unit:`hour`},{value:`24`,unit:`hour`}];function q(e){let[t,n]=e.time.split(`:`),r=Number.parseInt(t||`9`,10),i=Number.parseInt(n||`0`,10),a;if(e.triggerMode===`manual`)a={kind:`manual`};else if(e.triggerMode===`once`)a={kind:`schedule`,schedule:{kind:`once`,at:new Date(e.onceAt).toISOString()}};else if(e.triggerMode===`webhook`)a={kind:`webhook`,...e.webhookSecretId.trim()?{secretId:e.webhookSecretId.trim()}:{}};else if(e.triggerMode===`taskBlocked`)a={kind:`event`,eventType:`task.attention_required.v2`,source:`tasks`,payloadMatch:{reason:`blocked`}};else if(e.triggerMode===`noteCreated`)a={kind:`event`,eventType:`note.created`,source:`notes`};else if(e.triggerMode===`sessionUpdated`)a={kind:`event`,eventType:`session.transcript.updated`,source:`sessions`};else if(e.triggerMode===`event`){let t=e.eventPayloadMatch.trim()?JSON.parse(e.eventPayloadMatch):void 0;a={kind:`event`,eventType:e.eventType.trim(),...e.eventSource.trim()?{source:e.eventSource.trim()}:{},...t?{payloadMatch:t}:{}}}else a=e.triggerMode===`interval`?{kind:`schedule`,schedule:{kind:`interval`,everyMs:G(e.intervalValue,e.intervalUnit)}}:e.triggerMode===`weekly`?{kind:`schedule`,schedule:{kind:`cron`,...e.timezone?.trim()?{tz:e.timezone.trim()}:{},expr:`${i} ${r} * * ${e.weekday}`}}:e.triggerMode===`cron`?{kind:`schedule`,schedule:{kind:`cron`,...e.timezone?.trim()?{tz:e.timezone.trim()}:{},expr:e.cronExpr.trim()}}:{kind:`schedule`,schedule:{kind:`cron`,...e.timezone?.trim()?{tz:e.timezone.trim()}:{},expr:`${i} ${r} * * *`}};let o=e.actionMode===`browser_automation`||e.actionMode===`task_command`?`auto_apply`:e.safetyMode,s;return s=e.actionMode===`browser_automation`?{kind:`browser_automation`,automationId:e.browserAutomationId.trim(),inputs:e.browserAutomationInputs}:e.actionMode===`task_command`?{kind:`task_command`,taskId:e.taskId.trim(),command:{type:`start`,executor:{kind:`agent`,agentId:e.agentId.trim()}}}:{kind:`agent`,instruction:e.instruction.trim(),...e.agentId.trim()?{agentId:e.agentId.trim()}:{},...e.model.trim()?{model:e.model.trim()}:{}},{name:e.name.trim(),...e.description.trim()?{description:e.description.trim()}:{},...e.projectId.trim()?{projectId:e.projectId.trim()}:{},trigger:a,action:s,safety:{mode:o},conversationMode:e.conversationMode,delivery:{notificationPolicy:e.notificationPolicy,destinations:[{key:`gateway_event`,kind:`gateway_event`},...e.resultWebhookEndpoint.trim()&&e.resultWebhookSecretId.trim()?[{key:`result_webhook`,kind:`webhook`,endpoint:e.resultWebhookEndpoint.trim(),secretId:e.resultWebhookSecretId.trim()}]:[]]},reliability:{executionTimeoutSeconds:Math.max(1,Number.parseInt(e.timeoutSeconds,10)||1800),disableAfterConsecutiveFailures:Math.max(1,Number.parseInt(e.disableAfterFailures,10)||3)}}}function ot(e){let t=e.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+\*$/);if(t)return{triggerMode:`daily`,time:`${t[2].padStart(2,`0`)}:${t[1].padStart(2,`0`)}`,weekday:`1`,cronExpr:e};let n=e.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+([0-6])$/);return n?{triggerMode:`weekly`,time:`${n[2].padStart(2,`0`)}:${n[1].padStart(2,`0`)}`,weekday:n[3],cronExpr:e}:{triggerMode:`cron`,time:at.time,weekday:at.weekday,cronExpr:e}}function st(e){let t=[[`week`,10080*6e4],[`day`,1440*6e4],[`hour`,60*6e4],[`minute`,6e4]],[n,r]=t.find(([,t])=>e>=t&&e%t===0)??t.at(-1);return{intervalValue:String(e/r),intervalUnit:n}}function ct(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=t.getTimezoneOffset()*6e4;return new Date(t.getTime()-n).toISOString().slice(0,16)}function lt(e){let t=e.payloadMatch;return e.eventType===`task.attention_required.v2`&&e.source===`tasks`&&t?.reason===`blocked`?{triggerMode:`taskBlocked`}:e.eventType===`note.created`&&e.source===`notes`&&!t?{triggerMode:`noteCreated`}:e.eventType===`session.transcript.updated`&&e.source===`sessions`&&!t?{triggerMode:`sessionUpdated`}:{triggerMode:`event`,eventType:e.eventType,eventSource:e.source??``,eventPayloadMatch:t?JSON.stringify(t,null,2):``}}function ut(e){if(!e.trim())return!0;try{let t=JSON.parse(e);return!!t&&typeof t==`object`&&!Array.isArray(t)&&Object.values(t).every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))}catch{return!1}}function dt(e){let t={triggerMode:`manual`};if(e.trigger.kind===`webhook`)t={triggerMode:`webhook`,webhookSecretId:e.trigger.secretId??``};else if(e.trigger.kind===`event`)t=lt(e.trigger);else if(e.trigger.kind===`schedule`){let n=e.trigger.schedule;n.kind===`cron`&&(t={...ot(n.expr),timezone:n.tz??``}),n.kind===`interval`&&(t={triggerMode:`interval`,...st(n.everyMs)}),n.kind===`once`&&(t={triggerMode:`once`,onceAt:ct(n.at)})}let n=e.action,r=e.reliability?.executionTimeoutSeconds??(`timeoutSeconds`in n?n.timeoutSeconds:void 0)??(n.kind===`browser_automation`?600:1800);return{...at,...t,name:e.name,description:e.description??``,projectId:e.projectId??``,actionMode:n.kind===`system`?`agent`:n.kind,agentId:n.kind===`agent`?n.agentId??``:n.kind===`task_command`&&n.command.type===`start`&&n.command.executor.kind===`agent`?n.command.executor.agentId:``,model:n.kind===`agent`?n.model??``:``,instruction:n.kind===`agent`?n.instruction:``,taskId:n.kind===`task_command`?n.taskId:``,browserAutomationId:n.kind===`browser_automation`?n.automationId:``,browserAutomationInputs:n.kind===`browser_automation`?n.inputs??{}:{},safetyMode:e.safety?.mode??`auto_apply`,timeoutSeconds:String(r),conversationMode:e.conversationMode??`new_session`,notificationPolicy:e.delivery.notificationPolicy,resultWebhookEndpoint:e.delivery.destinations.find(e=>e.kind===`webhook`)?.endpoint??``,resultWebhookSecretId:e.delivery.destinations.find(e=>e.kind===`webhook`)?.secretId??``,disableAfterFailures:String(e.reliability?.disableAfterConsecutiveFailures??3)}}function ft(e,t){let n=q(t),r=e.trigger.kind===`schedule`&&n.trigger.kind===`schedule`&&e.trigger.schedule.kind===n.trigger.schedule.kind?{...n.trigger,schedule:{...e.trigger.schedule,...n.trigger.schedule}}:n.trigger,i=n.action;e.action.kind===`agent`&&n.action.kind===`agent`?i={...e.action,...n.action,agentId:n.action.agentId,model:n.action.model}:e.action.kind===`browser_automation`&&n.action.kind===`browser_automation`?i={...e.action,...n.action}:e.action.kind===`task_command`&&n.action.kind===`task_command`&&(i=n.action);let a=e.delivery.destinations.filter(e=>e.kind===`gateway_event`),o=e.delivery.destinations.filter(e=>e.kind===`webhook`);return{...n,description:t.description.trim(),projectId:t.projectId.trim(),delivery:{notificationPolicy:t.notificationPolicy,destinations:[...a.length>0?a:[{key:`gateway_event`,kind:`gateway_event`}],...e.delivery.destinations.filter(e=>e.kind===`file`||e.kind===`card`),...o.slice(1),...t.resultWebhookEndpoint.trim()&&t.resultWebhookSecretId.trim()?[{key:o[0]?.key??`result_webhook`,kind:`webhook`,endpoint:t.resultWebhookEndpoint.trim(),secretId:t.resultWebhookSecretId.trim()}]:[]]},trigger:r,action:i,reliability:{...e.reliability,...n.reliability}}}function pt(e,t=new Date){let n=q(e);if(n.trigger.kind!==`schedule`||n.trigger.schedule.kind!==`cron`||!n.trigger.schedule.tz)return[];let r=I.CronExpressionParser.parse(n.trigger.schedule.expr,{currentDate:t,tz:n.trigger.schedule.tz});return[new Date(r.next().getTime()).toISOString(),new Date(r.next().getTime()).toISOString(),new Date(r.next().getTime()).toISOString()]}function mt(e){let t=(0,O.c)(35),{form:n,onChange:r,language:i}=e;if(![`daily`,`weekly`,`cron`,`once`].includes(n.triggerMode))return null;let a=i===`zh`;if(n.triggerMode===`once`){let e=a?`按当前浏览器时区输入,保存为绝对时间:`:`Entered in this browser timezone and stored as an absolute time: `,n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=Intl.DateTimeFormat().resolvedOptions(),t[0]=n):n=t[0];let r;return t[1]!==e||t[2]!==n.timeZone?(r=(0,A.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e,n.timeZone]}),t[1]=e,t[2]=n.timeZone,t[3]=r):r=t[3],r}let o,s,c,l,u,d;if(t[4]!==n||t[5]!==r||t[6]!==a){let e=[],i=!1;try{e=pt(n)}catch{i=!0}u=`rounded-lg bg-surface-base p-3`;let f=a?`时区与接下来的运行时间`:`Timezone and upcoming runs`,p=n.timezone?` · ${n.timezone}`:``;t[13]!==f||t[14]!==p?(d=(0,A.jsxs)(`summary`,{className:`cursor-pointer text-xs text-fg-muted focus-visible:outline-accent`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=d):d=t[15],o=`mt-3 space-y-2`;let m=a?`时区`:`Timezone`,h=n.timezone??``,g;t[16]===r?g=t[17]:(g=e=>r({timezone:e.target.value}),t[16]=r,t[17]=g);let _;t[18]!==h||t[19]!==g?(_=(0,A.jsx)(`input`,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,value:h,placeholder:`Asia/Shanghai`,onChange:g,"aria-invalid":i}),t[18]=h,t[19]=g,t[20]=_):_=t[20],t[21]!==_||t[22]!==m?(s=(0,A.jsx)(j,{label:m,children:_}),t[21]=_,t[22]=m,t[23]=s):s=t[23];let v=n.timezone?a?`按 ${n.timezone} 运行;下方显示执行时区时间与当前浏览器的当地时间。`:`Runs in ${n.timezone}; schedule-zone and browser-local times follow.`:a?`此规则未指定时区,沿用服务所在电脑的时区。指定时区后可预览;更改前请确认原定时间。`:`This legacy rule uses the service computer timezone. Specify a timezone to preview; confirm the intended schedule before changing it.`;t[24]===v?c=t[25]:(c=(0,A.jsx)(`p`,{className:`text-xs text-fg-muted`,children:v}),t[24]=v,t[25]=c),l=i?(0,A.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:a?`请检查时区和定时规则。`:`Check the timezone and schedule expression.`}):(0,A.jsx)(`ol`,{className:`space-y-1 text-xs text-fg-muted`,children:e.map(e=>(0,A.jsxs)(`li`,{children:[new Date(e).toLocaleString(a?`zh-CN`:`en-US`,{timeZone:n.timezone,timeZoneName:`short`}),` · `,a?`你这里:`:`Your local time: `,new Date(e).toLocaleString(a?`zh-CN`:`en-US`,{timeZoneName:`short`})]},e))}),t[4]=n,t[5]=r,t[6]=a,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d}else o=t[7],s=t[8],c=t[9],l=t[10],u=t[11],d=t[12];let f;t[26]!==o||t[27]!==s||t[28]!==c||t[29]!==l?(f=(0,A.jsxs)(`div`,{className:o,children:[s,c,l]}),t[26]=o,t[27]=s,t[28]=c,t[29]=l,t[30]=f):f=t[30];let p;return t[31]!==u||t[32]!==d||t[33]!==f?(p=(0,A.jsxs)(`details`,{className:u,children:[d,f]}),t[31]=u,t[32]=d,t[33]=f,t[34]=p):p=t[34],p}async function ht(){await oe(e=>typeof e==`string`?e.startsWith(`automation`):Array.isArray(e)&&typeof e[0]==`string`&&e[0].startsWith(`automation`))}var J=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-accent`;function gt({automation:e,projectId:t,language:n,onClose:r,onCreated:i}){let{data:a,error:o}=T(`automation-chat-agents`,se),s=(0,k.useRef)(null),[g]=(0,k.useState)(()=>document.activeElement instanceof HTMLElement?document.activeElement:null),[_,y]=(0,k.useState)(e),[ee,te]=(0,k.useState)(()=>e?dt(e):{...at,projectId:t??``,safetyMode:`auto_apply`}),[S,ne]=(0,k.useState)(ee),[C,w]=(0,k.useState)(!1),[ie,ae]=(0,k.useState)(``),[oe,ce]=(0,k.useState)(!1),D=n===`zh`,O=e=>ne(t=>({...t,...e})),fe=()=>{C||JSON.stringify(S)!==JSON.stringify(ee)&&!window.confirm(D?`放弃尚未保存的修改?`:`Discard unsaved changes?`)||r()},pe=async()=>{w(!0),ae(``),ce(!1);try{let e=!_||[`triggerMode`,`onceAt`,`time`,`weekday`,`timezone`,`cronExpr`,`intervalValue`,`intervalUnit`].some(e=>S[e]!==ee[e]);if((e||_?.enabled)&&S.triggerMode===`once`&&(!S.onceAt||!Number.isFinite(new Date(S.onceAt).getTime())||new Date(S.onceAt).getTime()<=Date.now()))throw Error(D?`请选择未来的运行时间。`:`Choose a future run time.`);if(_&&_.action.kind!==`agent`)throw Error(D?`请在任务页编辑此类型任务。`:`Edit this task type on the task page.`);if([`daily`,`weekly`].includes(S.triggerMode)&&!/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(S.time))throw Error(D?`请选择有效的运行时间。`:`Choose a valid run time.`);if(S.triggerMode===`interval`&&G(S.intervalValue,S.intervalUnit)<6e4)throw Error(D?`运行间隔至少为一分钟。`:`Use an interval of at least one minute.`);pt(S);let t=S.name.trim()||S.instruction.trim().split(`
|
|
3
|
-
`)[0].slice(0,80),n=q({...S,name:t});if(_&&_.action.kind===`agent`)await de.update(_.id,{expectedRevision:_.updatedAtMs,name:t,action:{..._.action,instruction:S.instruction.trim(),agentId:S.agentId.trim()||void 0,model:S.model.trim()||void 0},...e?{trigger:n.trigger}:{},conversationMode:S.conversationMode,delivery:{..._.delivery,notificationPolicy:S.notificationPolicy}});else{let e=await de.create({...n,enabled:!0});i?.(e.automation)}await ht(),r()}catch(e){ce(e?.status===409),ae(e?.status===409?D?`任务已在其他地方更新,请核对最新设置后再保存。`:`This task changed elsewhere. Review the latest settings before saving.`:e instanceof Error?e.message:String(e))}finally{w(!1)}},me=async()=>{if(!(!_||!window.confirm(D?`载入最新设置将替换当前未保存的修改,是否继续?`:`Loading the latest settings replaces your unsaved edits. Continue?`))){w(!0);try{let{automation:e}=await de.get(_.id),t=dt(e);y(e),te(t),ne(t),ae(``),ce(!1)}catch{ae(D?`暂时无法载入最新设置,请重试。`:`Could not load the latest settings. Try again.`)}finally{w(!1)}}},he=S.timezone||(D?`默认时区`:`Default timezone`);try{he=D&&S.timezone===`Asia/Shanghai`?`中国时间`:new Intl.DateTimeFormat(D?`zh-CN`:`en-US`,{timeZone:he,timeZoneName:`shortGeneric`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value||he}catch{}let _e=``;try{let e=pt(S)[0];e&&S.timezone!==Intl.DateTimeFormat().resolvedOptions().timeZone&&(_e=`${D?`你这里的下次时间:`:`Next run in your timezone: `}${new Date(e).toLocaleString(D?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`})}`)}catch{}let M=`flex min-h-12 items-center justify-between gap-4 border-b border-edge last:border-b-0`,ve=`min-h-10 w-32 shrink-0 justify-end border-0 bg-transparent py-2 pl-3 pr-0 text-right text-sm text-fg-muted shadow-none`;return(0,A.jsx)(h,{open:!0,onOpenChange:e=>{e||fe()},children:(0,A.jsxs)(f,{children:[(0,A.jsx)(l,{className:`fixed inset-0 z-65 bg-scrim`}),(0,A.jsxs)(p,{onCloseAutoFocus:e=>{e.preventDefault(),g?.isConnected&&g.focus()},onOpenAutoFocus:e=>{e.preventDefault(),s.current?.focus()},style:{height:`min(${_?600:440}px, calc(100dvh - 2rem))`},className:`fixed left-1/2 top-1/2 z-66 flex w-[min(42.5rem,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,A.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between px-5 pb-3 pt-5`,children:[(0,A.jsx)(m,{className:`text-base font-semibold text-fg`,children:_?D?`编辑定时任务`:`Edit scheduled task`:D?`设定定时任务`:`Schedule a task`}),(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(E,{variant:`ghost`,disabled:C,"aria-label":D?`关闭`:`Close`,children:(0,A.jsx)(re,{className:`size-4`})})})]}),(0,A.jsx)(u,{className:`sr-only`,children:D?`描述要做的事,选择重复频率和时间。`:`Describe the task and choose its frequency and time.`}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-3`,children:[_?(0,A.jsx)(`input`,{"aria-label":D?`任务名称`:`Task name`,className:`w-full rounded-xl border border-edge bg-transparent px-4 py-3 text-sm text-fg focus-visible:outline-accent`,value:S.name,onChange:e=>O({name:e.target.value})}):null,(0,A.jsxs)(`label`,{className:`block`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:D?`要做什么`:`What should happen`}),(0,A.jsx)(`textarea`,{ref:s,"aria-label":D?`任务说明`:`Task description`,placeholder:D?`希望定期帮你做什么?`:`What would you like done regularly?`,className:`block h-32 w-full resize-none rounded-xl border border-edge bg-transparent px-4 py-3 text-sm leading-6 text-fg placeholder:text-fg-subtle focus-visible:outline-accent`,value:S.instruction,onChange:e=>O({instruction:e.target.value})})]}),(0,A.jsxs)(`section`,{"aria-label":D?`运行时间`:`Schedule`,className:`rounded-xl border border-edge px-4`,children:[(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`span`,{className:`text-sm text-fg`,children:D?`重复`:`Repeat`}),(0,A.jsxs)(b,{"aria-label":D?`重复`:`Repeat`,className:ve,value:S.triggerMode,onChange:e=>O({triggerMode:e.target.value}),children:[(0,A.jsx)(x,{value:`once`,children:D?`仅一次`:`Once`}),(0,A.jsx)(x,{value:`daily`,children:D?`每天`:`Daily`}),(0,A.jsx)(x,{value:`weekly`,children:D?`每周`:`Weekly`}),(0,A.jsx)(x,{value:`interval`,children:D?`固定间隔`:`At intervals`}),(0,A.jsx)(x,{value:`cron`,children:D?`自定义`:`Custom`}),[`once`,`daily`,`weekly`,`interval`,`cron`].includes(S.triggerMode)?null:(0,A.jsx)(x,{value:S.triggerMode,children:D?`保持当前触发方式`:`Keep current trigger`})]})]}),[`daily`,`weekly`].includes(S.triggerMode)?(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`span`,{className:`text-sm text-fg`,children:D?`时间`:`Time`}),(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`truncate text-xs`,children:he}),(0,A.jsx)(ge,{value:S.time,onChange:e=>O({time:e}),ariaLabel:D?`时间`:`Time`,className:`w-auto`,triggerClassName:`w-auto border-0 bg-transparent px-0 shadow-none`})]})]}):null,S.triggerMode===`weekly`?(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`span`,{className:`text-sm text-fg`,children:D?`星期`:`Day`}),(0,A.jsx)(b,{"aria-label":D?`星期`:`Day`,className:ve,value:S.weekday,onChange:e=>O({weekday:e.target.value}),children:Object.entries(D?{1:`星期一`,2:`星期二`,3:`星期三`,4:`星期四`,5:`星期五`,6:`星期六`,0:`星期日`}:{1:`Monday`,2:`Tuesday`,3:`Wednesday`,4:`Thursday`,5:`Friday`,6:`Saturday`,0:`Sunday`}).map(([e,t])=>(0,A.jsx)(x,{value:e,children:t},e))})]}):null,S.triggerMode===`once`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`span`,{className:`text-sm text-fg`,children:D?`日期`:`Date`}),(0,A.jsx)(ue,{ariaLabel:D?`运行日期`:`Run date`,className:`w-auto bg-transparent text-fg-muted`,value:S.onceAt.split(`T`)[0],onChange:e=>O({onceAt:`${e}T${S.onceAt.split(`T`)[1]||S.time}`})})]}),(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`span`,{className:`text-sm text-fg`,children:D?`时间`:`Time`}),(0,A.jsx)(ge,{ariaLabel:D?`运行时间`:`Run time`,value:S.onceAt.split(`T`)[1]||S.time,onChange:e=>O({onceAt:`${S.onceAt.split(`T`)[0]}T${e}`}),triggerClassName:`border-0 bg-transparent text-fg-muted shadow-none`})]})]}):null,S.triggerMode===`cron`?(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`label`,{htmlFor:`automation-cron`,className:`text-sm text-fg`,children:D?`时间规则`:`Schedule`}),(0,A.jsx)(`input`,{id:`automation-cron`,className:`min-w-0 bg-transparent py-3 text-right text-sm text-fg-muted`,value:S.cronExpr,onChange:e=>O({cronExpr:e.target.value})})]}):null,S.triggerMode===`interval`?(0,A.jsxs)(`div`,{className:M,children:[(0,A.jsx)(`label`,{htmlFor:`automation-interval`,className:`text-sm text-fg`,children:D?`每隔`:`Every`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`input`,{id:`automation-interval`,type:`number`,min:`1`,"aria-label":D?`间隔数值`:`Interval value`,className:`w-16 bg-transparent text-right text-sm text-fg-muted`,value:S.intervalValue,onChange:e=>O({intervalValue:e.target.value})}),(0,A.jsxs)(b,{"aria-label":D?`间隔单位`:`Interval unit`,className:ve,value:S.intervalUnit,onChange:e=>O({intervalUnit:e.target.value}),children:[(0,A.jsx)(x,{value:`minute`,children:D?`分钟`:`Minutes`}),(0,A.jsx)(x,{value:`hour`,children:D?`小时`:`Hours`}),(0,A.jsx)(x,{value:`day`,children:D?`天`:`Days`}),(0,A.jsx)(x,{value:`week`,children:D?`周`:`Weeks`})]})]})]}):null]}),_e?(0,A.jsx)(`p`,{className:`text-xs text-fg-muted`,role:`status`,children:_e}):null,S.triggerMode===`once`?(0,A.jsx)(`p`,{className:`text-xs text-fg-muted`,children:D?`按你所在时区输入,换时区后仍在同一时刻运行。`:`Enter your local time. Changing timezone keeps the same instant.`}):null,(0,A.jsxs)(`details`,{className:`group`,children:[(0,A.jsxs)(`summary`,{className:`flex w-fit cursor-pointer list-none items-center gap-1 rounded-md px-1 py-2 text-sm text-fg-muted focus-visible:outline-accent`,children:[D?`高级`:`Advanced`,(0,A.jsx)(v,{className:`size-3.5 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,A.jsxs)(`div`,{className:`mt-2 grid gap-4 pb-2`,children:[_?null:(0,A.jsx)(j,{label:D?`任务名称(可选)`:`Task name (optional)`,children:(0,A.jsx)(`input`,{className:J,value:S.name,onChange:e=>O({name:e.target.value}),placeholder:D?`根据说明自动命名`:`Named from your description`})}),(0,A.jsx)(j,{label:D?`时区`:`Timezone`,children:(0,A.jsx)(`input`,{className:J,value:S.timezone??``,placeholder:`Asia/Shanghai`,onChange:e=>O({timezone:e.target.value})})}),(0,A.jsxs)(j,{label:D?`执行助手`:`Run with`,children:[(0,A.jsxs)(b,{"aria-label":D?`执行助手`:`Run with`,className:J,value:S.agentId,onChange:e=>O({agentId:e.target.value}),children:[(0,A.jsx)(x,{value:``,children:D?`默认助手`:`Default assistant`}),S.agentId&&!a?.items.some(e=>e.id===S.agentId)?(0,A.jsx)(x,{value:S.agentId,children:S.agentId}):null,a?.items.map(e=>(0,A.jsx)(x,{value:e.id,children:e.name||e.id},e.id))]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o?D?`暂时无法加载助手,请稍后重试。`:`Could not load assistants. Try again later.`:D?`从下次运行生效,切换时衔接最近的执行结果。`:`Applies to the next run, carrying over the latest result when switching.`})]}),(0,A.jsx)(j,{label:D?`使用模型`:`Model`,children:(0,A.jsx)(le,{value:S.model,onChange:e=>O({model:e}),allowEmpty:!0,placeholder:c(n).automations.form.defaultModel,searchPlaceholder:c(n).automations.form.searchModels,noMatches:c(n).automations.form.noModels,emptyLabel:D?`默认模型`:`Default model`,ariaLabel:D?`使用模型`:`Model`})}),(0,A.jsx)(j,{label:D?`运行上下文`:`Run context`,children:(0,A.jsxs)(b,{className:J,value:S.conversationMode,onChange:e=>O({conversationMode:e.target.value}),children:[(0,A.jsx)(x,{value:`new_session`,children:D?`每次独立运行`:`Independent runs`}),(0,A.jsx)(x,{value:`continuous`,children:D?`延续之前的运行`:`Continue previous runs`})]})}),(0,A.jsx)(j,{label:D?`通知我`:`Notify me`,children:(0,A.jsxs)(b,{className:J,value:S.notificationPolicy,onChange:e=>O({notificationPolicy:e.target.value}),children:[(0,A.jsx)(x,{value:`attention`,children:D?`需要关注时`:`When attention is needed`}),(0,A.jsx)(x,{value:`all`,children:D?`每次完成时`:`After every run`}),(0,A.jsx)(x,{value:`none`,children:D?`不通知`:`Never`})]})})]})]}),ie?(0,A.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-danger`,children:[(0,A.jsx)(`p`,{children:ie}),oe?(0,A.jsx)(E,{variant:`secondary`,disabled:C,onClick:()=>void me(),children:D?`载入最新设置`:`Load latest settings`}):null,(0,A.jsx)(`p`,{children:D?`内容已保留,请核对后重试。`:`Your edits are preserved. Review and retry.`})]}):null]}),(0,A.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 px-5 pb-5 pt-3`,children:[(0,A.jsx)(E,{variant:`ghost`,className:`rounded-full bg-surface-base px-4`,disabled:C,onClick:fe,children:D?`取消`:`Cancel`}),(0,A.jsx)(E,{variant:`primary`,className:`rounded-full px-4 disabled:bg-surface-active disabled:text-fg-subtle disabled:opacity-100`,disabled:C||!S.instruction.trim(),onClick:()=>void pe(),children:C?D?`保存中…`:`Saving…`:_?D?`保存`:`Save`:D?`创建`:`Create`})]})]})]})})}function Y({automationId:e,runId:t,language:n,inConfiguration:r=!1}){let i=a(),l=s(),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(!1),[m,h]=(0,k.useState)(``),{data:_,error:v,isLoading:y,mutate:ee}=T([`automation-card`,e],()=>de.get(e),{refreshInterval:5e3,shouldRetryOnError:!1}),b=n===`zh`,x=_?.automation,te=c(n);if(y&&!x)return(0,A.jsx)(ae,{className:`my-3 h-20 w-full rounded-xl`});if(v||!x)return(0,A.jsxs)(`div`,{className:`my-3 rounded-xl border border-edge p-4 text-sm text-fg-muted`,children:[(0,A.jsx)(`p`,{children:b?`任务已删除或暂时无法读取。`:`This task was deleted or is unavailable.`}),(0,A.jsx)(`button`,{type:`button`,className:`mt-2 underline`,onClick:()=>void ee(),children:b?`重试`:`Retry`})]});if(t)return(0,A.jsxs)(`div`,{className:`my-3 flex items-center gap-3 rounded-xl border border-edge p-3`,"data-product-delivery":`automation`,children:[(0,A.jsx)(g,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:x.name}),(0,A.jsx)(o,{className:`shrink-0 rounded-lg border border-edge px-3 py-2 text-xs text-fg hover:bg-surface-hover`,to:ne(`${i.pathname}${i.search}`,`/automations?automation=${encodeURIComponent(x.id)}&view=run&run=${encodeURIComponent(t)}`),children:b?`查看运行情况`:`View run`})]});let S=async()=>{p(!0),h(``);try{l(await it({automationId:x.id}))}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}};return(0,A.jsxs)(`div`,{className:`my-3 overflow-hidden rounded-xl border border-edge bg-surface-panel`,"data-product-delivery":`automation`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-3`,children:[(0,A.jsx)(g,{className:`size-6 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:x.name}),(0,A.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[et(x.trigger,te.automations,te.cron,n),x.trigger.kind===`schedule`&&x.trigger.schedule.kind===`cron`&&x.trigger.schedule.tz?` · ${x.trigger.schedule.tz}`:``,` · `,rt(x)?b?`已完成`:`Completed`:x.enabled?te.automations.enabled:te.automations.paused]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:x.enabled?`${b?`下次:`:`Next: `}${tt(x,te.automations,n)}`:rt(x)?b?`这项一次性任务已完成`:`This one-time task is complete`:b?`恢复后将按计划运行`:`Resume to run on schedule`})]}),!x.management&&x.action.kind===`agent`?(0,A.jsxs)(E,{variant:`ghost`,onClick:()=>d(!0),children:[(0,A.jsx)(w,{className:`size-4`,"aria-hidden":!0}),b?`编辑`:`Edit`]}):null,!r&&!x.management&&x.action.kind!==`system`?(0,A.jsxs)(E,{variant:`ghost`,disabled:f,onClick:()=>void S(),children:[(0,A.jsx)(C,{className:`size-4`,"aria-hidden":!0}),b?`继续对话`:`Continue in chat`]}):null,(0,A.jsx)(o,{className:`rounded-md border border-edge px-3 py-2 text-xs text-fg hover:bg-surface-hover`,to:`/automations?automation=${encodeURIComponent(x.id)}`,children:b?`打开`:`Open`})]}),[`failed`,`timeout`].includes(x.state.lastRunStatus??``)?(0,A.jsx)(`p`,{className:`px-4 pb-3 text-xs text-fg-muted`,children:b?`上次运行未完成。可以在对话中说明“帮我修复”,再试运行。`:`The last run did not finish. Ask in chat to fix it, then try again.`}):null,m?(0,A.jsx)(`p`,{role:`alert`,className:`px-4 pb-3 text-sm text-danger`,children:m}):null,u?(0,A.jsx)(gt,{automation:x,language:n,onClose:()=>d(!1)}):null]})}function _t(e){let t=(0,O.c)(22),{conversationId:n,language:r,running:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):(a=[`automation-configuration`,n],o=()=>de.configuration(n),t[0]=n,t[1]=a,t[2]=o);let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={refreshInterval:3e3,shouldRetryOnError:!1},t[3]=s):s=t[3];let{data:c,error:l,mutate:u}=T(a,o,s),d;t[4]!==u||t[5]!==i?(d=()=>{i||(u(),ht())},t[4]=u,t[5]=i,t[6]=d):d=t[6];let f;if(t[7]!==n||t[8]!==u||t[9]!==i?(f=[i,n,u],t[7]=n,t[8]=u,t[9]=i,t[10]=f):f=t[10],(0,k.useEffect)(d,f),l){let e;t[11]===u?e=t[12]:(e=()=>void u(),t[11]=u,t[12]=e);let n=r===`zh`?`任务配置暂时无法读取,点击重试`:`Task configuration unavailable. Retry`,i;return t[13]!==e||t[14]!==n?(i=(0,A.jsx)(`button`,{type:`button`,className:`mb-4 text-sm text-fg-muted underline`,onClick:e,children:n}),t[13]=e,t[14]=n,t[15]=i):i=t[15],i}if(!c){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,A.jsx)(ae,{className:`mb-4 h-20 rounded-xl`}),t[16]=e):e=t[16],e}if(c.deleted){let e=r===`zh`?`这个定时任务已删除,配置讨论仍可查看。`:`This scheduled task was deleted. Its configuration discussion is preserved.`,n;return t[17]===e?n=t[18]:(n=(0,A.jsx)(`p`,{className:`mb-4 text-sm text-fg-muted`,children:e}),t[17]=e,t[18]=n),n}let p;return t[19]!==c.automation||t[20]!==r?(p=c.automation?(0,A.jsx)(Y,{automationId:c.automation.id,language:r,inConfiguration:!0}):null,t[19]=c.automation,t[20]=r,t[21]=p):p=t[21],p}function vt({automationId:e,language:t,runId:n,variant:r=`primary`}){let i=s(),[a,o]=(0,k.useState)(!1),[c,l]=(0,k.useState)(``),u=async()=>{o(!0),l(``);try{i(await it({automationId:e,runId:n,prompt:n?t===`zh`?`帮我看看这次为什么没有完成,并修复问题。`:`Help me understand why this did not finish and fix the problem.`:void 0}))}catch(e){l(e instanceof Error?e.message:String(e))}finally{o(!1)}};return(0,A.jsxs)(`span`,{children:[(0,A.jsxs)(E,{variant:r,disabled:a,onClick:()=>void u(),children:[(0,A.jsx)(C,{className:`size-4`,"aria-hidden":!0}),n?t===`zh`?`对话修复`:`Fix in chat`:t===`zh`?`继续对话`:`Continue in chat`]}),c?(0,A.jsx)(`span`,{role:`alert`,className:`ml-2 text-xs text-danger`,children:c}):null]})}export{rt as C,Qe as S,j as T,et as _,mt as a,Je as b,ft as c,at as d,ut as f,tt as g,nt as h,Y as i,q as l,G as m,vt as n,pt as o,it as p,gt as r,K as s,_t as t,dt as u,qe as v,ge as w,Ye as x,Xe as y};
|