@ohos-ports/stacksjs-stx 0.2.287-beta.0
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/LICENSE.md +21 -0
- package/README.md +1042 -0
- package/dist/a11y.d.ts +256 -0
- package/dist/a11y.js +671 -0
- package/dist/analytics.d.ts +40 -0
- package/dist/analytics.js +159 -0
- package/dist/analyzer.d.ts +68 -0
- package/dist/analyzer.js +240 -0
- package/dist/animation.d.ts +123 -0
- package/dist/animation.js +688 -0
- package/dist/app-shell.d.ts +76 -0
- package/dist/app-shell.js +209 -0
- package/dist/app.d.ts +65 -0
- package/dist/app.js +79 -0
- package/dist/appearance-bootstrap.d.ts +54 -0
- package/dist/appearance-bootstrap.js +92 -0
- package/dist/asset-roots.d.ts +32 -0
- package/dist/asset-roots.js +7 -0
- package/dist/assets.d.ts +21 -0
- package/dist/assets.js +155 -0
- package/dist/ast.d.ts +265 -0
- package/dist/ast.js +630 -0
- package/dist/async-components.d.ts +123 -0
- package/dist/async-components.js +428 -0
- package/dist/auth.d.ts +13 -0
- package/dist/auth.js +12 -0
- package/dist/broadcasting.d.ts +77 -0
- package/dist/broadcasting.js +103 -0
- package/dist/browser-composables.d.ts +348 -0
- package/dist/browser-composables.js +606 -0
- package/dist/browser-core-imports.d.ts +12 -0
- package/dist/browser-core-imports.js +28 -0
- package/dist/build-assets.d.ts +32 -0
- package/dist/build-assets.js +29 -0
- package/dist/build-externalize-repeated.d.ts +34 -0
- package/dist/build-externalize-repeated.js +101 -0
- package/dist/build-externalize.d.ts +73 -0
- package/dist/build-externalize.js +80 -0
- package/dist/build-id.d.ts +57 -0
- package/dist/build-id.js +25 -0
- package/dist/build-message.d.ts +81 -0
- package/dist/build-message.js +65 -0
- package/dist/build-mode-detector.d.ts +26 -0
- package/dist/build-mode-detector.js +50 -0
- package/dist/build-optimizer.d.ts +101 -0
- package/dist/build-optimizer.js +433 -0
- package/dist/build-views.d.ts +56 -0
- package/dist/build-views.js +180 -0
- package/dist/build.d.ts +31 -0
- package/dist/build.js +34 -0
- package/dist/builtins/attrs.d.ts +49 -0
- package/dist/builtins/attrs.js +39 -0
- package/dist/builtins/drawer.d.ts +24 -0
- package/dist/builtins/drawer.js +37 -0
- package/dist/builtins/escape.d.ts +12 -0
- package/dist/builtins/escape.js +3 -0
- package/dist/builtins/icon.d.ts +45 -0
- package/dist/builtins/icon.js +100 -0
- package/dist/builtins/image-delivery.d.ts +16 -0
- package/dist/builtins/image-delivery.js +115 -0
- package/dist/builtins/image-placeholder.d.ts +78 -0
- package/dist/builtins/image-placeholder.js +137 -0
- package/dist/builtins/index.d.ts +26 -0
- package/dist/builtins/index.js +34 -0
- package/dist/builtins/modal.d.ts +26 -0
- package/dist/builtins/modal.js +38 -0
- package/dist/builtins/safe-image.d.ts +44 -0
- package/dist/builtins/safe-image.js +45 -0
- package/dist/builtins/stx-image.d.ts +29 -0
- package/dist/builtins/stx-image.js +222 -0
- package/dist/builtins/stx-link.d.ts +11 -0
- package/dist/builtins/stx-link.js +35 -0
- package/dist/builtins/stx-loading-indicator.d.ts +13 -0
- package/dist/builtins/stx-loading-indicator.js +35 -0
- package/dist/builtins/suspense.d.ts +30 -0
- package/dist/builtins/suspense.js +24 -0
- package/dist/builtins/toast.d.ts +19 -0
- package/dist/builtins/toast.js +42 -0
- package/dist/builtins/tooltip.d.ts +18 -0
- package/dist/builtins/tooltip.js +106 -0
- package/dist/builtins/transition-group.d.ts +27 -0
- package/dist/builtins/transition-group.js +22 -0
- package/dist/bun-shim.js +496 -0
- package/dist/bundle-analyzer/collector.d.ts +66 -0
- package/dist/bundle-analyzer/collector.js +233 -0
- package/dist/bundle-analyzer/index.d.ts +98 -0
- package/dist/bundle-analyzer/index.js +82 -0
- package/dist/bundle-analyzer/report.d.ts +39 -0
- package/dist/bundle-analyzer/report.js +318 -0
- package/dist/bundle-analyzer/treemap.d.ts +19 -0
- package/dist/bundle-analyzer/treemap.js +594 -0
- package/dist/bundle-analyzer.js +499 -0
- package/dist/caching.d.ts +69 -0
- package/dist/caching.js +135 -0
- package/dist/chunk-0y46fbkx.js +3 -0
- package/dist/chunk-122tyfre.js +2 -0
- package/dist/chunk-19nfvxfw.js +43 -0
- package/dist/chunk-1kah92n2.js +3 -0
- package/dist/chunk-1kms3b9d.js +2 -0
- package/dist/chunk-1q4y74mh.js +1194 -0
- package/dist/chunk-248e84r1.js +4 -0
- package/dist/chunk-24ps8kft.js +2 -0
- package/dist/chunk-2et5hxfv.js +2 -0
- package/dist/chunk-2r1rd8f0.js +2 -0
- package/dist/chunk-2tk1zkrz.js +2 -0
- package/dist/chunk-38ejahd9.js +3 -0
- package/dist/chunk-3zv4wz87.js +2 -0
- package/dist/chunk-4122k1bh.js +2 -0
- package/dist/chunk-45az9zht.js +2 -0
- package/dist/chunk-4qr85f07.js +2 -0
- package/dist/chunk-4ww3znrr.js +15 -0
- package/dist/chunk-54st8g2j.js +397 -0
- package/dist/chunk-58f0mthg.js +3 -0
- package/dist/chunk-5a19dhx5.js +2 -0
- package/dist/chunk-5kk8gsj2.js +3 -0
- package/dist/chunk-5w1e3yxs.js +499 -0
- package/dist/chunk-6gdycmxr.js +2 -0
- package/dist/chunk-6hmnaza7.js +4473 -0
- package/dist/chunk-71t0yan0.js +5 -0
- package/dist/chunk-74cv4ta1.js +3 -0
- package/dist/chunk-74v15e8z.js +2 -0
- package/dist/chunk-7b329e5v.js +3 -0
- package/dist/chunk-7q9mwh4v.js +84 -0
- package/dist/chunk-866y9d8b.js +8169 -0
- package/dist/chunk-8fwerspy.js +2 -0
- package/dist/chunk-8mjdpr94.js +147 -0
- package/dist/chunk-92mj1t26.js +60 -0
- package/dist/chunk-9b22663r.js +2 -0
- package/dist/chunk-9hjdgm4d.js +2 -0
- package/dist/chunk-9n0gvfrg.js +4 -0
- package/dist/chunk-9wr7zcad.js +18 -0
- package/dist/chunk-9y0g8kzt.js +358 -0
- package/dist/chunk-a0nfbmeh.js +3 -0
- package/dist/chunk-acn1b56m.js +1280 -0
- package/dist/chunk-awkq3xfx.js +2 -0
- package/dist/chunk-b6ej2fdf.js +1814 -0
- package/dist/chunk-b8rrnqry.js +2 -0
- package/dist/chunk-bfqfs07m.js +3022 -0
- package/dist/chunk-bs6kapy7.js +2 -0
- package/dist/chunk-btav940g.js +2 -0
- package/dist/chunk-bz820epz.js +3 -0
- package/dist/chunk-ccspd3mc.js +2 -0
- package/dist/chunk-csbgwaa5.js +2 -0
- package/dist/chunk-d8t4sjsp.js +2 -0
- package/dist/chunk-dap191q2.js +2 -0
- package/dist/chunk-de7fye10.js +4 -0
- package/dist/chunk-dgrt76d2.js +2 -0
- package/dist/chunk-dhh5q7qt.js +3 -0
- package/dist/chunk-dsffsqnt.js +2 -0
- package/dist/chunk-dtq7y5ym.js +2 -0
- package/dist/chunk-fed3xsp9.js +3 -0
- package/dist/chunk-ferav3bw.js +19 -0
- package/dist/chunk-fvhm8psm.js +3 -0
- package/dist/chunk-g4vpzv6b.js +2 -0
- package/dist/chunk-g9csmj0s.js +2 -0
- package/dist/chunk-gtcrpmz1.js +2 -0
- package/dist/chunk-h4xh8cms.js +4 -0
- package/dist/chunk-h8yqsz9m.js +2 -0
- package/dist/chunk-hcq5dw7a.js +2 -0
- package/dist/chunk-hm0xha6c.js +12 -0
- package/dist/chunk-hpybjwwf.js +8 -0
- package/dist/chunk-jegt35zh.js +2 -0
- package/dist/chunk-jr3jp3ev.js +8 -0
- package/dist/chunk-k56rjjc0.js +24 -0
- package/dist/chunk-kdh37tp8.js +194 -0
- package/dist/chunk-kxzb4et3.js +29 -0
- package/dist/chunk-mf4n3x1j.js +14 -0
- package/dist/chunk-mkd9kjgb.js +3 -0
- package/dist/chunk-mxfh1nxg.js +2 -0
- package/dist/chunk-n3ggrhb3.js +3 -0
- package/dist/chunk-nkb3scg6.js +8 -0
- package/dist/chunk-nnd4wq8j.js +231 -0
- package/dist/chunk-nsp1cw38.js +11 -0
- package/dist/chunk-nx5qkm8k.js +30 -0
- package/dist/chunk-p3242nck.js +2 -0
- package/dist/chunk-p98kfh94.js +2 -0
- package/dist/chunk-pkaabd8h.js +3 -0
- package/dist/chunk-pzm13sdc.js +3 -0
- package/dist/chunk-q4p5k2p3.js +2 -0
- package/dist/chunk-q9n5swx7.js +3 -0
- package/dist/chunk-qc1f74ek.js +3 -0
- package/dist/chunk-qpyjak7z.js +2 -0
- package/dist/chunk-qr82je1m.js +22 -0
- package/dist/chunk-qy73j6m4.js +288 -0
- package/dist/chunk-qzkhpsam.js +505 -0
- package/dist/chunk-r3ayvdz3.js +2 -0
- package/dist/chunk-r7r66978.js +2 -0
- package/dist/chunk-rbb7dvja.js +30 -0
- package/dist/chunk-refwkt87.js +71 -0
- package/dist/chunk-rj4kajww.js +2 -0
- package/dist/chunk-rp4rjjmf.js +2 -0
- package/dist/chunk-se0p17c2.js +898 -0
- package/dist/chunk-sj9pmene.js +2 -0
- package/dist/chunk-sscwkffs.js +2 -0
- package/dist/chunk-svpqxn2c.js +2 -0
- package/dist/chunk-t6nseeb9.js +351 -0
- package/dist/chunk-t8y1ggdy.js +2 -0
- package/dist/chunk-tndhnk9e.js +2 -0
- package/dist/chunk-v5e1gxwm.js +3 -0
- package/dist/chunk-vqxmxgaj.js +4 -0
- package/dist/chunk-vrrax298.js +2 -0
- package/dist/chunk-w3ycm4na.js +3 -0
- package/dist/chunk-wcm80anz.js +321 -0
- package/dist/chunk-wrzwgkbx.js +22 -0
- package/dist/chunk-x650vjcp.js +302 -0
- package/dist/chunk-xgnc1wy6.js +116 -0
- package/dist/chunk-xpp135ad.js +11 -0
- package/dist/chunk-xttsqmkm.js +216 -0
- package/dist/chunk-y11cxbxd.js +3757 -0
- package/dist/chunk-y7m2dpd3.js +341 -0
- package/dist/chunk-y98jsjqq.js +2 -0
- package/dist/chunk-ya386h70.js +2 -0
- package/dist/chunk-ydrz60kr.js +2 -0
- package/dist/chunk-ypmqf7tm.js +4 -0
- package/dist/chunk-z4jhj5e5.js +28 -0
- package/dist/chunk-zg75gjns.js +2 -0
- package/dist/chunk-zqqx1qaj.js +2 -0
- package/dist/cli-flags.d.ts +34 -0
- package/dist/cli-flags.js +20 -0
- package/dist/cli.js +174 -0
- package/dist/client/directive.d.ts +17 -0
- package/dist/client/directive.js +14 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.js +2 -0
- package/dist/client-helpers.d.ts +317 -0
- package/dist/client-helpers.js +312 -0
- package/dist/client-script-bundler.d.ts +103 -0
- package/dist/client-script-bundler.js +390 -0
- package/dist/client-script.d.ts +215 -0
- package/dist/client-script.js +865 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.js +73 -0
- package/dist/codemod.d.ts +33 -0
- package/dist/codemod.js +244 -0
- package/dist/color-mode-boot.d.ts +92 -0
- package/dist/color-mode-boot.js +72 -0
- package/dist/component-client-factories.d.ts +33 -0
- package/dist/component-client-factories.js +77 -0
- package/dist/component-hmr.d.ts +107 -0
- package/dist/component-hmr.js +585 -0
- package/dist/component-library.d.ts +38 -0
- package/dist/component-library.js +994 -0
- package/dist/component-processing.d.ts +198 -0
- package/dist/component-processing.js +677 -0
- package/dist/component-registry.d.ts +127 -0
- package/dist/component-registry.js +90 -0
- package/dist/component-renderer.d.ts +52 -0
- package/dist/component-renderer.js +790 -0
- package/dist/components/StxImage.stx +12 -0
- package/dist/components/StxLink.stx +18 -0
- package/dist/components.d.ts +28 -0
- package/dist/components.js +213 -0
- package/dist/composable-loader.d.ts +62 -0
- package/dist/composable-loader.js +190 -0
- package/dist/composables/index.d.ts +417 -0
- package/dist/composables/index.js +222 -0
- package/dist/composables/use-battery.d.ts +46 -0
- package/dist/composables/use-battery.js +101 -0
- package/dist/composables/use-broadcast-channel.d.ts +59 -0
- package/dist/composables/use-broadcast-channel.js +80 -0
- package/dist/composables/use-channel.d.ts +67 -0
- package/dist/composables/use-channel.js +124 -0
- package/dist/composables/use-clipboard.d.ts +30 -0
- package/dist/composables/use-clipboard.js +90 -0
- package/dist/composables/use-color-mode.d.ts +67 -0
- package/dist/composables/use-color-mode.js +152 -0
- package/dist/composables/use-cookie.d.ts +59 -0
- package/dist/composables/use-cookie.js +86 -0
- package/dist/composables/use-device-orientation.d.ts +116 -0
- package/dist/composables/use-device-orientation.js +181 -0
- package/dist/composables/use-event-listener.d.ts +35 -0
- package/dist/composables/use-event-listener.js +27 -0
- package/dist/composables/use-event-source.d.ts +90 -0
- package/dist/composables/use-event-source.js +166 -0
- package/dist/composables/use-eye-dropper.d.ts +117 -0
- package/dist/composables/use-eye-dropper.js +142 -0
- package/dist/composables/use-fetch.d.ts +59 -0
- package/dist/composables/use-fetch.js +273 -0
- package/dist/composables/use-form.d.ts +91 -0
- package/dist/composables/use-form.js +112 -0
- package/dist/composables/use-fullscreen.d.ts +47 -0
- package/dist/composables/use-fullscreen.js +110 -0
- package/dist/composables/use-geolocation.d.ts +62 -0
- package/dist/composables/use-geolocation.js +101 -0
- package/dist/composables/use-idle.d.ts +102 -0
- package/dist/composables/use-idle.js +182 -0
- package/dist/composables/use-intersection-observer.d.ts +83 -0
- package/dist/composables/use-intersection-observer.js +168 -0
- package/dist/composables/use-keyboard.d.ts +100 -0
- package/dist/composables/use-keyboard.js +224 -0
- package/dist/composables/use-media-query.d.ts +56 -0
- package/dist/composables/use-media-query.js +62 -0
- package/dist/composables/use-meta.d.ts +35 -0
- package/dist/composables/use-meta.js +48 -0
- package/dist/composables/use-mouse.d.ts +65 -0
- package/dist/composables/use-mouse.js +286 -0
- package/dist/composables/use-mutation-observer.d.ts +101 -0
- package/dist/composables/use-mutation-observer.js +129 -0
- package/dist/composables/use-network.d.ts +40 -0
- package/dist/composables/use-network.js +85 -0
- package/dist/composables/use-notification.d.ts +98 -0
- package/dist/composables/use-notification.js +94 -0
- package/dist/composables/use-permissions.d.ts +119 -0
- package/dist/composables/use-permissions.js +132 -0
- package/dist/composables/use-query.d.ts +48 -0
- package/dist/composables/use-query.js +0 -0
- package/dist/composables/use-resize-observer.d.ts +60 -0
- package/dist/composables/use-resize-observer.js +157 -0
- package/dist/composables/use-router.d.ts +80 -0
- package/dist/composables/use-router.js +105 -0
- package/dist/composables/use-scroll-lock.d.ts +13 -0
- package/dist/composables/use-scroll-lock.js +55 -0
- package/dist/composables/use-share.d.ts +74 -0
- package/dist/composables/use-share.js +104 -0
- package/dist/composables/use-speech.d.ts +117 -0
- package/dist/composables/use-speech.js +294 -0
- package/dist/composables/use-storage.d.ts +69 -0
- package/dist/composables/use-storage.js +196 -0
- package/dist/composables/use-text-selection.d.ts +121 -0
- package/dist/composables/use-text-selection.js +205 -0
- package/dist/composables/use-timer.d.ts +92 -0
- package/dist/composables/use-timer.js +193 -0
- package/dist/composables/use-utilities.d.ts +103 -0
- package/dist/composables/use-utilities.js +176 -0
- package/dist/composables/use-wake-lock.d.ts +85 -0
- package/dist/composables/use-wake-lock.js +122 -0
- package/dist/composables/use-websocket.d.ts +70 -0
- package/dist/composables/use-websocket.js +165 -0
- package/dist/composables/use-window.d.ts +84 -0
- package/dist/composables/use-window.js +163 -0
- package/dist/composables.d.ts +287 -0
- package/dist/composables.js +562 -0
- package/dist/composition-api.d.ts +197 -0
- package/dist/composition-api.js +199 -0
- package/dist/compression.d.ts +30 -0
- package/dist/compression.js +107 -0
- package/dist/computed.d.ts +138 -0
- package/dist/computed.js +382 -0
- package/dist/conditionals.d.ts +48 -0
- package/dist/conditionals.js +626 -0
- package/dist/config.d.ts +77 -0
- package/dist/config.js +828 -0
- package/dist/cookie-serialize.d.ts +40 -0
- package/dist/cookie-serialize.js +18 -0
- package/dist/craft-bridge.d.ts +525 -0
- package/dist/craft-bridge.js +511 -0
- package/dist/craft-compiler.d.ts +245 -0
- package/dist/craft-compiler.js +810 -0
- package/dist/craft-components.d.ts +739 -0
- package/dist/craft-components.js +1074 -0
- package/dist/craft-entry.d.ts +6 -0
- package/dist/craft-entry.js +9 -0
- package/dist/craft-ssr.d.ts +147 -0
- package/dist/craft-ssr.js +559 -0
- package/dist/craft.js +9 -0
- package/dist/csp.d.ts +295 -0
- package/dist/csp.js +220 -0
- package/dist/csrf.d.ts +38 -0
- package/dist/csrf.js +38 -0
- package/dist/custom-directives.d.ts +5 -0
- package/dist/custom-directives.js +136 -0
- package/dist/database.d.ts +391 -0
- package/dist/database.js +5 -0
- package/dist/defer.d.ts +28 -0
- package/dist/defer.js +156 -0
- package/dist/deploy/config-generators.d.ts +75 -0
- package/dist/deploy/config-generators.js +214 -0
- package/dist/deploy/index.d.ts +88 -0
- package/dist/deploy/index.js +203 -0
- package/dist/deploy/netlify.d.ts +109 -0
- package/dist/deploy/netlify.js +167 -0
- package/dist/desktop.d.ts +16 -0
- package/dist/desktop.js +1 -0
- package/dist/dev-server/index.d.ts +22 -0
- package/dist/dev-server/index.js +7 -0
- package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
- package/dist/dev-server/keyboard-shortcuts.js +81 -0
- package/dist/dev-server/native-window.d.ts +59 -0
- package/dist/dev-server/native-window.js +91 -0
- package/dist/dev-server/port-utils.d.ts +27 -0
- package/dist/dev-server/port-utils.js +40 -0
- package/dist/dev-server/serve-app.d.ts +15 -0
- package/dist/dev-server/serve-app.js +727 -0
- package/dist/dev-server/serve-file.d.ts +3 -0
- package/dist/dev-server/serve-file.js +443 -0
- package/dist/dev-server/serve-markdown.d.ts +3 -0
- package/dist/dev-server/serve-markdown.js +284 -0
- package/dist/dev-server/serve-multi.d.ts +5 -0
- package/dist/dev-server/serve-multi.js +596 -0
- package/dist/dev-server/terminal-colors.d.ts +56 -0
- package/dist/dev-server/terminal-colors.js +45 -0
- package/dist/dev-server/theme-selector.d.ts +32 -0
- package/dist/dev-server/theme-selector.js +111 -0
- package/dist/dev-server/ts-css.d.ts +108 -0
- package/dist/dev-server/ts-css.js +438 -0
- package/dist/dev-server/types.d.ts +99 -0
- package/dist/dev-server/types.js +43 -0
- package/dist/dev-server.d.ts +6 -0
- package/dist/dev-server.js +4 -0
- package/dist/devtools.d.ts +182 -0
- package/dist/devtools.js +593 -0
- package/dist/directive-api.d.ts +154 -0
- package/dist/directive-api.js +355 -0
- package/dist/docs.d.ts +56 -0
- package/dist/docs.js +567 -0
- package/dist/doctor.d.ts +29 -0
- package/dist/doctor.js +123 -0
- package/dist/document-shell.d.ts +218 -0
- package/dist/document-shell.js +338 -0
- package/dist/dynamic-components.d.ts +23 -0
- package/dist/dynamic-components.js +197 -0
- package/dist/edge-runtime.d.ts +193 -0
- package/dist/edge-runtime.js +525 -0
- package/dist/env.d.ts +3 -0
- package/dist/env.js +9 -0
- package/dist/error-boundaries.d.ts +78 -0
- package/dist/error-boundaries.js +281 -0
- package/dist/error-handling.d.ts +14 -0
- package/dist/error-handling.js +1 -0
- package/dist/errors/codes.d.ts +92 -0
- package/dist/errors/codes.js +97 -0
- package/dist/errors/formatter.d.ts +84 -0
- package/dist/errors/formatter.js +196 -0
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.js +44 -0
- package/dist/errors/logger.d.ts +135 -0
- package/dist/errors/logger.js +250 -0
- package/dist/errors/sanitizer.d.ts +73 -0
- package/dist/errors/sanitizer.js +181 -0
- package/dist/errors/types.d.ts +92 -0
- package/dist/errors/types.js +86 -0
- package/dist/events.d.ts +145 -0
- package/dist/events.js +396 -0
- package/dist/expressions.d.ts +180 -0
- package/dist/expressions.js +719 -0
- package/dist/find-body-tag.d.ts +50 -0
- package/dist/find-body-tag.js +57 -0
- package/dist/formatter.d.ts +19 -0
- package/dist/formatter.js +265 -0
- package/dist/forms-validation.d.ts +189 -0
- package/dist/forms-validation.js +421 -0
- package/dist/forms.d.ts +224 -0
- package/dist/forms.js +729 -0
- package/dist/fragment-container.d.ts +57 -0
- package/dist/fragment-container.js +123 -0
- package/dist/framework-composables.d.ts +73 -0
- package/dist/framework-composables.js +126 -0
- package/dist/head-injection.d.ts +61 -0
- package/dist/head-injection.js +28 -0
- package/dist/head.d.ts +282 -0
- package/dist/head.js +231 -0
- package/dist/heatmap.d.ts +206 -0
- package/dist/heatmap.js +566 -0
- package/dist/hot-reload.d.ts +87 -0
- package/dist/hot-reload.js +373 -0
- package/dist/html-masking.d.ts +125 -0
- package/dist/html-masking.js +196 -0
- package/dist/hydration-runtime.d.ts +44 -0
- package/dist/hydration-runtime.js +195 -0
- package/dist/hydration.d.ts +135 -0
- package/dist/hydration.js +654 -0
- package/dist/i18n.d.ts +342 -0
- package/dist/i18n.js +678 -0
- package/dist/image-optimization/auto-sibling.d.ts +42 -0
- package/dist/image-optimization/auto-sibling.js +88 -0
- package/dist/image-optimization/build-plugin.d.ts +54 -0
- package/dist/image-optimization/build-plugin.js +241 -0
- package/dist/image-optimization/component.d.ts +46 -0
- package/dist/image-optimization/component.js +244 -0
- package/dist/image-optimization/directive.d.ts +30 -0
- package/dist/image-optimization/directive.js +203 -0
- package/dist/image-optimization/index.d.ts +156 -0
- package/dist/image-optimization/index.js +54 -0
- package/dist/image-optimization/processor.d.ts +140 -0
- package/dist/image-optimization/processor.js +262 -0
- package/dist/image-optimization/serve.d.ts +54 -0
- package/dist/image-optimization/serve.js +102 -0
- package/dist/import-rebase.d.ts +16 -0
- package/dist/import-rebase.js +16 -0
- package/dist/imported-signals.d.ts +43 -0
- package/dist/imported-signals.js +35 -0
- package/dist/includes.d.ts +171 -0
- package/dist/includes.js +764 -0
- package/dist/index.d.ts +365 -0
- package/dist/index.js +202 -0
- package/dist/init.d.ts +39 -0
- package/dist/init.js +505 -0
- package/dist/inline-assets.d.ts +28 -0
- package/dist/inline-assets.js +82 -0
- package/dist/interactive.d.ts +14 -0
- package/dist/interactive.js +383 -0
- package/dist/internal-markdown.d.ts +22 -0
- package/dist/internal-markdown.js +141 -0
- package/dist/island-chunking.d.ts +48 -0
- package/dist/island-chunking.js +52 -0
- package/dist/isolated-build.d.ts +12 -0
- package/dist/isolated-build.js +18 -0
- package/dist/js-ts.d.ts +10 -0
- package/dist/js-ts.js +60 -0
- package/dist/jsx-runtime.d.ts +92 -0
- package/dist/jsx-runtime.js +289 -0
- package/dist/keep-alive.d.ts +108 -0
- package/dist/keep-alive.js +421 -0
- package/dist/layout-types.d.ts +45 -0
- package/dist/layout-types.js +56 -0
- package/dist/lazy-loader.d.ts +90 -0
- package/dist/lazy-loader.js +245 -0
- package/dist/lazy-module.d.ts +11 -0
- package/dist/lazy-module.js +18 -0
- package/dist/loading-indicator.d.ts +50 -0
- package/dist/loading-indicator.js +322 -0
- package/dist/loops.d.ts +91 -0
- package/dist/loops.js +690 -0
- package/dist/manifest.d.ts +41 -0
- package/dist/manifest.js +31 -0
- package/dist/markdown-view.d.ts +25 -0
- package/dist/markdown-view.js +39 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.js +68 -0
- package/dist/media/client/blur-up.d.ts +66 -0
- package/dist/media/client/blur-up.js +217 -0
- package/dist/media/client/index.d.ts +93 -0
- package/dist/media/client/index.js +53 -0
- package/dist/media/client/lazy-load.d.ts +74 -0
- package/dist/media/client/lazy-load.js +283 -0
- package/dist/media/client/upload-handler.d.ts +80 -0
- package/dist/media/client/upload-handler.js +354 -0
- package/dist/media/image/component.d.ts +60 -0
- package/dist/media/image/component.js +574 -0
- package/dist/media/image/directive.d.ts +23 -0
- package/dist/media/image/directive.js +160 -0
- package/dist/media/image/editing.d.ts +212 -0
- package/dist/media/image/editing.js +193 -0
- package/dist/media/image/index.d.ts +142 -0
- package/dist/media/image/index.js +80 -0
- package/dist/media/image/placeholder.d.ts +89 -0
- package/dist/media/image/placeholder.js +188 -0
- package/dist/media/image/processor/cache.d.ts +53 -0
- package/dist/media/image/processor/cache.js +51 -0
- package/dist/media/image/processor/index.d.ts +11 -0
- package/dist/media/image/processor/index.js +3 -0
- package/dist/media/image/processor/optimizer.d.ts +24 -0
- package/dist/media/image/processor/optimizer.js +202 -0
- package/dist/media/image/processor/responsive.d.ts +28 -0
- package/dist/media/image/processor/responsive.js +162 -0
- package/dist/media/image/srcset.d.ts +157 -0
- package/dist/media/image/srcset.js +194 -0
- package/dist/media/index.d.ts +331 -0
- package/dist/media/index.js +198 -0
- package/dist/media/manager/embed.d.ts +25 -0
- package/dist/media/manager/embed.js +253 -0
- package/dist/media/protected/component.d.ts +33 -0
- package/dist/media/protected/component.js +235 -0
- package/dist/media/protected/index.d.ts +47 -0
- package/dist/media/protected/index.js +20 -0
- package/dist/media/protected/signature.d.ts +72 -0
- package/dist/media/protected/signature.js +205 -0
- package/dist/media/shared/cache.d.ts +76 -0
- package/dist/media/shared/cache.js +132 -0
- package/dist/media/shared/hash.d.ts +31 -0
- package/dist/media/shared/hash.js +35 -0
- package/dist/media/shared/index.d.ts +7 -0
- package/dist/media/shared/index.js +2 -0
- package/dist/media/types.d.ts +1477 -0
- package/dist/media/types.js +0 -0
- package/dist/media/upload/component.d.ts +9 -0
- package/dist/media/upload/component.js +320 -0
- package/dist/media/upload/index.d.ts +8 -0
- package/dist/media/upload/index.js +1 -0
- package/dist/media/video/directive.d.ts +23 -0
- package/dist/media/video/directive.js +142 -0
- package/dist/media/video/index.d.ts +76 -0
- package/dist/media/video/index.js +583 -0
- package/dist/media/video/processor/cache.d.ts +55 -0
- package/dist/media/video/processor/cache.js +52 -0
- package/dist/media/video/processor/index.d.ts +12 -0
- package/dist/media/video/processor/index.js +4 -0
- package/dist/media/video/processor/streaming.d.ts +26 -0
- package/dist/media/video/processor/streaming.js +197 -0
- package/dist/media/video/processor/thumbnail.d.ts +35 -0
- package/dist/media/video/processor/thumbnail.js +134 -0
- package/dist/media/video/processor/transcoder.d.ts +19 -0
- package/dist/media/video/processor/transcoder.js +283 -0
- package/dist/menubar.d.ts +65 -0
- package/dist/menubar.js +99 -0
- package/dist/method-spoofing.d.ts +20 -0
- package/dist/method-spoofing.js +17 -0
- package/dist/middleware.d.ts +112 -0
- package/dist/middleware.js +40 -0
- package/dist/misc-directives.d.ts +55 -0
- package/dist/misc-directives.js +328 -0
- package/dist/native-build.d.ts +88 -0
- package/dist/native-build.js +575 -0
- package/dist/owned-routes.d.ts +42 -0
- package/dist/owned-routes.js +26 -0
- package/dist/page-action.d.ts +73 -0
- package/dist/page-action.js +91 -0
- package/dist/page-meta.d.ts +38 -0
- package/dist/page-meta.js +16 -0
- package/dist/page-response.d.ts +120 -0
- package/dist/page-response.js +117 -0
- package/dist/parser/directive-parser.d.ts +119 -0
- package/dist/parser/directive-parser.js +249 -0
- package/dist/parser/expression-parser.d.ts +58 -0
- package/dist/parser/expression-parser.js +358 -0
- package/dist/parser/index.d.ts +13 -0
- package/dist/parser/index.js +23 -0
- package/dist/parser/tokenizer.d.ts +77 -0
- package/dist/parser/tokenizer.js +534 -0
- package/dist/partial-hydration.d.ts +123 -0
- package/dist/partial-hydration.js +427 -0
- package/dist/performance-utils.d.ts +318 -0
- package/dist/performance-utils.js +466 -0
- package/dist/placeholder.d.ts +54 -0
- package/dist/placeholder.js +35 -0
- package/dist/plugin-system.d.ts +301 -0
- package/dist/plugin-system.js +214 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.js +174 -0
- package/dist/precompiler.d.ts +43 -0
- package/dist/precompiler.js +670 -0
- package/dist/process.d.ts +16 -0
- package/dist/process.js +879 -0
- package/dist/production-build.d.ts +163 -0
- package/dist/production-build.js +596 -0
- package/dist/production-builder.d.ts +42 -0
- package/dist/production-builder.js +146 -0
- package/dist/production-server.d.ts +19 -0
- package/dist/production-server.js +208 -0
- package/dist/prop-sentinels.d.ts +31 -0
- package/dist/prop-sentinels.js +7 -0
- package/dist/props.d.ts +216 -0
- package/dist/props.js +224 -0
- package/dist/public-env.d.ts +29 -0
- package/dist/public-env.js +19 -0
- package/dist/pwa/audit.d.ts +42 -0
- package/dist/pwa/audit.js +255 -0
- package/dist/pwa/directives.d.ts +38 -0
- package/dist/pwa/directives.js +332 -0
- package/dist/pwa/icons.d.ts +42 -0
- package/dist/pwa/icons.js +109 -0
- package/dist/pwa/index.d.ts +104 -0
- package/dist/pwa/index.js +47 -0
- package/dist/pwa/inject.d.ts +32 -0
- package/dist/pwa/inject.js +102 -0
- package/dist/pwa/manifest.d.ts +104 -0
- package/dist/pwa/manifest.js +186 -0
- package/dist/pwa/offline.d.ts +8 -0
- package/dist/pwa/offline.js +259 -0
- package/dist/pwa/precache.d.ts +35 -0
- package/dist/pwa/precache.js +116 -0
- package/dist/pwa/service-worker.d.ts +33 -0
- package/dist/pwa/service-worker.js +860 -0
- package/dist/pwa/workbox-strategies.d.ts +100 -0
- package/dist/pwa/workbox-strategies.js +167 -0
- package/dist/pwa/workbox.d.ts +51 -0
- package/dist/pwa/workbox.js +382 -0
- package/dist/pwa.d.ts +52 -0
- package/dist/pwa.js +236 -0
- package/dist/reactive-bindings.d.ts +47 -0
- package/dist/reactive-bindings.js +268 -0
- package/dist/reactive-tracking.d.ts +81 -0
- package/dist/reactive-tracking.js +49 -0
- package/dist/reactive.d.ts +117 -0
- package/dist/reactive.js +593 -0
- package/dist/reactivity.d.ts +206 -0
- package/dist/reactivity.js +574 -0
- package/dist/release.d.ts +1 -0
- package/dist/release.js +1 -0
- package/dist/render-memo.d.ts +40 -0
- package/dist/render-memo.js +33 -0
- package/dist/render.d.ts +54 -0
- package/dist/render.js +153 -0
- package/dist/resolve-stx-targets.d.ts +49 -0
- package/dist/resolve-stx-targets.js +38 -0
- package/dist/route-middleware.d.ts +2 -0
- package/dist/route-middleware.js +17 -0
- package/dist/route-types.d.ts +134 -0
- package/dist/route-types.js +24 -0
- package/dist/router.d.ts +9 -0
- package/dist/router.js +9 -0
- package/dist/routes.d.ts +6 -0
- package/dist/routes.js +14 -0
- package/dist/runtime-globals.d.ts +236 -0
- package/dist/runtime-globals.js +230 -0
- package/dist/runtime-injection.d.ts +113 -0
- package/dist/runtime-injection.js +156 -0
- package/dist/runtime.d.ts +140 -0
- package/dist/runtime.js +94 -0
- package/dist/safe-evaluator.d.ts +165 -0
- package/dist/safe-evaluator.js +461 -0
- package/dist/scaffolding.d.ts +113 -0
- package/dist/scaffolding.js +897 -0
- package/dist/screenshot.d.ts +22 -0
- package/dist/screenshot.js +100 -0
- package/dist/script-classifier.d.ts +41 -0
- package/dist/script-classifier.js +51 -0
- package/dist/script-emit.d.ts +50 -0
- package/dist/script-emit.js +11 -0
- package/dist/script-json.d.ts +36 -0
- package/dist/script-json.js +6 -0
- package/dist/script-validation.d.ts +26 -0
- package/dist/script-validation.js +179 -0
- package/dist/seo.d.ts +225 -0
- package/dist/seo.js +486 -0
- package/dist/serve.d.ts +44 -0
- package/dist/serve.js +233 -0
- package/dist/server-bindings.d.ts +39 -0
- package/dist/server-bindings.js +171 -0
- package/dist/server-components.d.ts +138 -0
- package/dist/server-components.js +427 -0
- package/dist/sfc-template.d.ts +17 -0
- package/dist/sfc-template.js +32 -0
- package/dist/signal-processing.d.ts +222 -0
- package/dist/signal-processing.js +1081 -0
- package/dist/signals-api.d.ts +459 -0
- package/dist/signals-api.js +172 -0
- package/dist/signals.d.ts +41 -0
- package/dist/signals.js +8233 -0
- package/dist/site-builder/build.d.ts +18 -0
- package/dist/site-builder/build.js +252 -0
- package/dist/site-builder/i18n.d.ts +104 -0
- package/dist/site-builder/i18n.js +150 -0
- package/dist/site-builder/index.d.ts +27 -0
- package/dist/site-builder/index.js +16 -0
- package/dist/site-builder/robots.d.ts +2 -0
- package/dist/site-builder/robots.js +26 -0
- package/dist/site-builder/router.d.ts +10 -0
- package/dist/site-builder/router.js +27 -0
- package/dist/site-builder/seo.d.ts +8 -0
- package/dist/site-builder/seo.js +67 -0
- package/dist/site-builder/sitemap.d.ts +10 -0
- package/dist/site-builder/sitemap.js +26 -0
- package/dist/site-builder/theme.d.ts +12 -0
- package/dist/site-builder/theme.js +38 -0
- package/dist/site-builder/types.d.ts +74 -0
- package/dist/site-builder/types.js +0 -0
- package/dist/site-url.d.ts +46 -0
- package/dist/site-url.js +70 -0
- package/dist/slots.d.ts +129 -0
- package/dist/slots.js +286 -0
- package/dist/source-maps.d.ts +98 -0
- package/dist/source-maps.js +350 -0
- package/dist/source-signature.d.ts +45 -0
- package/dist/source-signature.js +20 -0
- package/dist/spa-nav.d.ts +49 -0
- package/dist/spa-nav.js +12 -0
- package/dist/spa-shell.d.ts +21 -0
- package/dist/spa-shell.js +34 -0
- package/dist/ssg.d.ts +357 -0
- package/dist/ssg.js +94 -0
- package/dist/ssr.d.ts +116 -0
- package/dist/ssr.js +339 -0
- package/dist/state-dir.d.ts +36 -0
- package/dist/state-dir.js +22 -0
- package/dist/state-management.d.ts +299 -0
- package/dist/state-management.js +519 -0
- package/dist/store-imports.d.ts +47 -0
- package/dist/store-imports.js +16 -0
- package/dist/store-loader.d.ts +15 -0
- package/dist/store-loader.js +111 -0
- package/dist/stores-client.d.ts +70 -0
- package/dist/stores-client.js +132 -0
- package/dist/story/addons.d.ts +123 -0
- package/dist/story/addons.js +261 -0
- package/dist/story/analytics.d.ts +163 -0
- package/dist/story/analytics.js +235 -0
- package/dist/story/auto-stories.d.ts +38 -0
- package/dist/story/auto-stories.js +158 -0
- package/dist/story/bookmarks.d.ts +102 -0
- package/dist/story/bookmarks.js +277 -0
- package/dist/story/bun-test.d.ts +45 -0
- package/dist/story/bun-test.js +102 -0
- package/dist/story/cli.d.ts +132 -0
- package/dist/story/cli.js +155 -0
- package/dist/story/collect/analyzer.d.ts +33 -0
- package/dist/story/collect/analyzer.js +305 -0
- package/dist/story/collect/index.d.ts +31 -0
- package/dist/story/collect/index.js +27 -0
- package/dist/story/collect/parser.d.ts +17 -0
- package/dist/story/collect/parser.js +129 -0
- package/dist/story/collect/scanner.d.ts +17 -0
- package/dist/story/collect/scanner.js +101 -0
- package/dist/story/collect/tree.d.ts +24 -0
- package/dist/story/collect/tree.js +110 -0
- package/dist/story/commands/build.d.ts +19 -0
- package/dist/story/commands/build.js +172 -0
- package/dist/story/commands/dev.d.ts +23 -0
- package/dist/story/commands/dev.js +78 -0
- package/dist/story/commands/index.d.ts +9 -0
- package/dist/story/commands/index.js +3 -0
- package/dist/story/commands/preview.d.ts +21 -0
- package/dist/story/commands/preview.js +56 -0
- package/dist/story/compiled-output.d.ts +27 -0
- package/dist/story/compiled-output.js +151 -0
- package/dist/story/composition.d.ts +47 -0
- package/dist/story/composition.js +261 -0
- package/dist/story/config-watcher.d.ts +33 -0
- package/dist/story/config-watcher.js +67 -0
- package/dist/story/config.d.ts +29 -0
- package/dist/story/config.js +64 -0
- package/dist/story/context.d.ts +27 -0
- package/dist/story/context.js +27 -0
- package/dist/story/controls/index.d.ts +54 -0
- package/dist/story/controls/index.js +320 -0
- package/dist/story/desktop-preview.d.ts +34 -0
- package/dist/story/desktop-preview.js +105 -0
- package/dist/story/docs-generator.d.ts +30 -0
- package/dist/story/docs-generator.js +187 -0
- package/dist/story/errors.d.ts +47 -0
- package/dist/story/errors.js +239 -0
- package/dist/story/figma-export.d.ts +169 -0
- package/dist/story/figma-export.js +224 -0
- package/dist/story/generator.d.ts +21 -0
- package/dist/story/generator.js +165 -0
- package/dist/story/hmr.d.ts +62 -0
- package/dist/story/hmr.js +131 -0
- package/dist/story/hot-swap.d.ts +46 -0
- package/dist/story/hot-swap.js +207 -0
- package/dist/story/index.d.ts +99 -0
- package/dist/story/index.js +49 -0
- package/dist/story/interactions.d.ts +53 -0
- package/dist/story/interactions.js +225 -0
- package/dist/story/keyboard-shortcuts.d.ts +39 -0
- package/dist/story/keyboard-shortcuts.js +345 -0
- package/dist/story/output.d.ts +115 -0
- package/dist/story/output.js +153 -0
- package/dist/story/performance.d.ts +129 -0
- package/dist/story/performance.js +252 -0
- package/dist/story/presets.d.ts +123 -0
- package/dist/story/presets.js +289 -0
- package/dist/story/props-validation.d.ts +45 -0
- package/dist/story/props-validation.js +215 -0
- package/dist/story/renderer.d.ts +69 -0
- package/dist/story/renderer.js +209 -0
- package/dist/story/search-index.d.ts +47 -0
- package/dist/story/search-index.js +106 -0
- package/dist/story/search.d.ts +56 -0
- package/dist/story/search.js +140 -0
- package/dist/story/server.d.ts +31 -0
- package/dist/story/server.js +965 -0
- package/dist/story/setup.d.ts +56 -0
- package/dist/story/setup.js +78 -0
- package/dist/story/snapshots.d.ts +65 -0
- package/dist/story/snapshots.js +171 -0
- package/dist/story/testing.d.ts +83 -0
- package/dist/story/testing.js +164 -0
- package/dist/story/theme.d.ts +68 -0
- package/dist/story/theme.js +170 -0
- package/dist/story/ts-css.d.ts +29 -0
- package/dist/story/ts-css.js +189 -0
- package/dist/story/types.d.ts +342 -0
- package/dist/story/types.js +0 -0
- package/dist/story/ui/code-panel.d.ts +43 -0
- package/dist/story/ui/code-panel.js +175 -0
- package/dist/story/ui/controls-panel.d.ts +25 -0
- package/dist/story/ui/controls-panel.js +168 -0
- package/dist/story/ui/index.d.ts +8 -0
- package/dist/story/ui/index.js +4 -0
- package/dist/story/ui/navigation.d.ts +55 -0
- package/dist/story/ui/navigation.js +250 -0
- package/dist/story/ui/preview.d.ts +46 -0
- package/dist/story/ui/preview.js +251 -0
- package/dist/story/visual-testing.d.ts +45 -0
- package/dist/story/visual-testing.js +248 -0
- package/dist/streaming.d.ts +238 -0
- package/dist/streaming.js +537 -0
- package/dist/strict-lint.d.ts +52 -0
- package/dist/strict-lint.js +269 -0
- package/dist/strip-literals.d.ts +40 -0
- package/dist/strip-literals.js +149 -0
- package/dist/stx-virtual-ts.d.ts +358 -0
- package/dist/stx-virtual-ts.js +670 -0
- package/dist/stx.d.ts +924 -0
- package/dist/style-scoping.d.ts +42 -0
- package/dist/style-scoping.js +82 -0
- package/dist/suspense.d.ts +98 -0
- package/dist/suspense.js +398 -0
- package/dist/teleport.d.ts +31 -0
- package/dist/teleport.js +109 -0
- package/dist/template-compiler.d.ts +33 -0
- package/dist/template-compiler.js +68 -0
- package/dist/template-hydrator.d.ts +28 -0
- package/dist/template-hydrator.js +95 -0
- package/dist/template-tag-balance.d.ts +32 -0
- package/dist/template-tag-balance.js +93 -0
- package/dist/testing.d.ts +330 -0
- package/dist/testing.js +588 -0
- package/dist/theme-tokens.d.ts +88 -0
- package/dist/theme-tokens.js +71 -0
- package/dist/transitions.d.ts +99 -0
- package/dist/transitions.js +443 -0
- package/dist/ts-css-config.d.ts +71 -0
- package/dist/ts-css-config.js +44 -0
- package/dist/type-checker.d.ts +85 -0
- package/dist/type-checker.js +581 -0
- package/dist/typecheck.d.ts +70 -0
- package/dist/typecheck.js +365 -0
- package/dist/types/component-types.d.ts +248 -0
- package/dist/types/component-types.js +0 -0
- package/dist/types/config-types.d.ts +938 -0
- package/dist/types/config-types.js +0 -0
- package/dist/types/context-types.d.ts +122 -0
- package/dist/types/context-types.js +0 -0
- package/dist/types/csp-types.d.ts +83 -0
- package/dist/types/csp-types.js +0 -0
- package/dist/types/directive-types.d.ts +315 -0
- package/dist/types/directive-types.js +3 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.js +1 -0
- package/dist/types/pwa-types.d.ts +338 -0
- package/dist/types/pwa-types.js +0 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +1 -0
- package/dist/typescript-templates.d.ts +156 -0
- package/dist/typescript-templates.js +386 -0
- package/dist/unresolved-identifiers.d.ts +52 -0
- package/dist/unresolved-identifiers.js +148 -0
- package/dist/utils.d.ts +112 -0
- package/dist/utils.js +1170 -0
- package/dist/validator.d.ts +80 -0
- package/dist/validator.js +171 -0
- package/dist/variable-extractor.d.ts +142 -0
- package/dist/variable-extractor.js +1306 -0
- package/dist/view-composers.d.ts +171 -0
- package/dist/view-composers.js +29 -0
- package/dist/virtual-scrolling.d.ts +127 -0
- package/dist/virtual-scrolling.js +454 -0
- package/dist/visual-editor.d.ts +185 -0
- package/dist/visual-editor.js +735 -0
- package/dist/visual-testing.d.ts +135 -0
- package/dist/visual-testing.js +126 -0
- package/dist/vue-template.d.ts +39 -0
- package/dist/vue-template.js +476 -0
- package/dist/web-components/css-scoping.d.ts +64 -0
- package/dist/web-components/css-scoping.js +210 -0
- package/dist/web-components/index.d.ts +29 -0
- package/dist/web-components/index.js +13 -0
- package/dist/web-components/reactive-generator.d.ts +72 -0
- package/dist/web-components/reactive-generator.js +484 -0
- package/dist/web-components.d.ts +253 -0
- package/dist/web-components.js +1466 -0
- package/dist/x-element.d.ts +42 -0
- package/dist/x-element.js +301 -0
- package/package.json +107 -0
- package/stx.d.ts +924 -0
|
@@ -0,0 +1,898 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gv as y}from"./chunk-qc1f74ek.js";function S4(){if(typeof Notification<"u"&&Notification.permission==="granted")return!0;return!1}function jZ(){return typeof window<"u"&&typeof document<"u"}async function w4(){if(typeof Notification>"u")return!1;if(Notification.permission==="granted")return!0;if(Notification.permission==="denied")return!1;return await Notification.requestPermission()==="granted"}var g=new Map;function B4(){return`alert-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function f4(Z){switch(Z){case"info":return"ℹ";case"success":return"✔";case"warning":return"⚠";case"error":return"✖";default:return"ℹ"}}function v4(Z="top-right"){if(!jZ())throw Error("Toast container requires browser environment");try{let $=document.querySelector(`.stx-toast-container[data-position="${Z}"]`);if($)return $}catch{}let Y=document.createElement("div");Y.className=`stx-toast-container ${Z}`,Y.dataset.position=Z;try{if(document.body)document.body.appendChild(Y)}catch{}return Y}function y4(Z){let{options:Y}=Z,$=f4(Y.type),J=Y.type||"info",Q=Y.duration!==0;return`
|
|
3
|
+
<div class="stx-toast ${J}" data-alert-id="${Z.id}" role="alert" aria-live="polite">
|
|
4
|
+
<div class="stx-toast-icon">${$}</div>
|
|
5
|
+
<div class="stx-toast-content">
|
|
6
|
+
${Y.title?`<div class="stx-toast-title">${BZ(Y.title)}</div>`:""}
|
|
7
|
+
<div class="stx-toast-message">${BZ(Y.message)}</div>
|
|
8
|
+
</div>
|
|
9
|
+
${Q?'<button class="stx-toast-close" aria-label="Close">×</button>':""}
|
|
10
|
+
</div>
|
|
11
|
+
`}function BZ(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ZZ(Z){if(Z.timeout)clearTimeout(Z.timeout);if(g.delete(Z.id),Z.element&&jZ())Z.element.classList.add("dismissing"),setTimeout(()=>{Z.element?.remove()},200)}async function OZ(Z){let Y=B4(),$=S4(),J=Z.duration??5000,Q={id:Y,options:Z};if(g.set(Y,Q),$&&Z.type!=="error")try{let X=new Notification(Z.title||"Notification",{body:Z.message,icon:Z.type==="success"?"\u2713":Z.type==="warning"?"\u26A0":"\u2139",tag:Y});if(X.onclick=()=>{if(Z.onClick)Z.onClick();X.close()},J>0)Q.timeout=setTimeout(()=>{X.close(),g.delete(Y)},J);return}catch{}if(jZ())try{let X=v4(Z.position),R=document.createElement("div");R.innerHTML=y4(Q);let z=R.firstElementChild;if(!z){let K=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${K}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`);return}Q.element=z;try{X.appendChild(z)}catch{let K=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${K}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`);return}if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>{try{z.classList.add("visible")}catch{}});try{z.addEventListener("click",(K)=>{if(K.target.classList?.contains("stx-toast-close")){ZZ(Q);return}if(Z.onClick)Z.onClick()})}catch{}if(J>0)Q.timeout=setTimeout(()=>{ZZ(Q)},J)}catch{let X=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${X}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`)}else{let X=(Z.type||"info").toUpperCase();if(console.log(`[stx-alert] ${X}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`),J>0)Q.timeout=setTimeout(()=>{g.delete(Y)},J)}}async function d(Z){return OZ({...Z,position:Z.position||"top-right"})}async function g4(Z,Y=3000){return d({message:Z,type:"info",duration:Y})}async function b4(Z,Y=3000){return d({message:Z,type:"success",duration:Y})}async function u4(Z,Y=3000){return d({message:Z,type:"warning",duration:Y})}async function m4(Z,Y=5000){return d({message:Z,type:"error",duration:Y})}async function h4(Z,Y,$="info"){return OZ({title:Z,message:Y,type:$})}function c4(Z){let Y=g.get(Z);if(Y)ZZ(Y)}function p4(){for(let Z of g.values())ZZ(Z)}function l4(){return g.size}var d4=`
|
|
12
|
+
.stx-toast-container {
|
|
13
|
+
position: fixed;
|
|
14
|
+
z-index: 10001;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
max-width: 400px;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.stx-toast-container.top-left { top: 16px; left: 16px; }
|
|
23
|
+
.stx-toast-container.top-center { top: 16px; left: 50%; transform: translateX(-50%); }
|
|
24
|
+
.stx-toast-container.top-right { top: 16px; right: 16px; }
|
|
25
|
+
.stx-toast-container.bottom-left { bottom: 16px; left: 16px; }
|
|
26
|
+
.stx-toast-container.bottom-center { bottom: 16px; left: 50%; transform: translateX(-50%); }
|
|
27
|
+
.stx-toast-container.bottom-right { bottom: 16px; right: 16px; }
|
|
28
|
+
|
|
29
|
+
.stx-toast {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
padding: 12px 16px;
|
|
34
|
+
background: #fff;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
37
|
+
pointer-events: auto;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: translateY(-10px);
|
|
41
|
+
transition: opacity 0.2s, transform 0.2s;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.stx-toast.visible {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transform: translateY(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.stx-toast.dismissing {
|
|
50
|
+
opacity: 0;
|
|
51
|
+
transform: translateX(100%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (prefers-color-scheme: dark) {
|
|
55
|
+
.stx-toast {
|
|
56
|
+
background: #2d2d2d;
|
|
57
|
+
color: #fff;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.stx-toast-icon {
|
|
62
|
+
font-size: 20px;
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
margin-top: 2px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.stx-toast.info .stx-toast-icon { color: #3498db; }
|
|
68
|
+
.stx-toast.success .stx-toast-icon { color: #27ae60; }
|
|
69
|
+
.stx-toast.warning .stx-toast-icon { color: #f39c12; }
|
|
70
|
+
.stx-toast.error .stx-toast-icon { color: #e74c3c; }
|
|
71
|
+
|
|
72
|
+
.stx-toast-content {
|
|
73
|
+
flex: 1;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.stx-toast-title {
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
margin-bottom: 4px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.stx-toast-message {
|
|
83
|
+
color: #666;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
line-height: 1.4;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media (prefers-color-scheme: dark) {
|
|
89
|
+
.stx-toast-message { color: #aaa; }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.stx-toast-close {
|
|
93
|
+
background: none;
|
|
94
|
+
border: none;
|
|
95
|
+
font-size: 20px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
opacity: 0.5;
|
|
98
|
+
padding: 0;
|
|
99
|
+
line-height: 1;
|
|
100
|
+
color: inherit;
|
|
101
|
+
transition: opacity 0.15s;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.stx-toast-close:hover {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Border accent for different types */
|
|
109
|
+
.stx-toast.info { border-left: 4px solid #3498db; }
|
|
110
|
+
.stx-toast.success { border-left: 4px solid #27ae60; }
|
|
111
|
+
.stx-toast.warning { border-left: 4px solid #f39c12; }
|
|
112
|
+
.stx-toast.error { border-left: 4px solid #e74c3c; }
|
|
113
|
+
`;function _(Z="stx"){return`${Z}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function q(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(...Z){return Z.filter(Boolean).join(" ")}function W(Z){if(!Z)return"";return Object.entries(Z).map(([Y,$])=>`${Y.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${$}`).join("; ")}function r4(Z){let{text:Y,variant:$="primary",size:J="medium",disabled:Q=!1,loading:X=!1,icon:R,iconPosition:z="left",id:K=_("btn"),className:F,style:O}=Z,V=D("stx-button",`stx-button--${$}`,`stx-button--${J}`,Q&&"stx-button--disabled",X&&"stx-button--loading",F),j=W(O),P=R?`<span class="stx-button-icon">${R}</span>`:"",L=X?'<span class="stx-button-spinner"></span>':"",T=z==="left"?`${P}${L}<span class="stx-button-text">${q(Y)}</span>`:`<span class="stx-button-text">${q(Y)}</span>${P}${L}`;return`<button id="${K}" class="${V}" ${Q||X?"disabled":""} ${j?`style='${j}'`:""}>${T}</button>`}function n4(Z){let{value:Y="",placeholder:$="",type:J="text",disabled:Q=!1,readonly:X=!1,maxLength:R,minLength:z,pattern:K,required:F=!1,autocomplete:O,label:V,error:j,hint:P,id:L=_("input"),className:T,style:N}=Z,E=D("stx-input",j&&"stx-input--error",Q&&"stx-input--disabled",T),S=W(N),e=[`type="${J}"`,`id="${L}"`,`class="${E}"`,Y&&`value="${q(Y)}"`,$&&`placeholder="${q($)}"`,Q&&"disabled",X&&"readonly",F&&"required",R&&`maxlength="${R}"`,z&&`minlength="${z}"`,K&&`pattern="${q(K)}"`,O&&`autocomplete="${O}"`,S&&`style="${S}"`].filter(Boolean).join(" "),w="";if(V)w+=`<label class="stx-input-label" for="${L}">${q(V)}</label>`;if(w+=`<input ${e} />`,j)w+=`<div class="stx-input-error">${q(j)}</div>`;else if(P)w+=`<div class="stx-input-hint">${q(P)}</div>`;return`<div class="stx-input-wrapper">${w}</div>`}function o4(Z){let{checked:Y=!1,label:$,disabled:J=!1,indeterminate:Q=!1,id:X=_("checkbox"),className:R,style:z}=Z,K=D("stx-checkbox",J&&"stx-checkbox--disabled",R),F=W(z),O=['type="checkbox"',`id="${X}"`,Y&&"checked",J&&"disabled",Q&&'data-indeterminate="true"'].filter(Boolean).join(" ");return`
|
|
114
|
+
<label class="${K}" ${F?`style="${F}"`:""}>
|
|
115
|
+
<input ${O} />
|
|
116
|
+
<span class="stx-checkbox-box"></span>
|
|
117
|
+
${$?`<span class="stx-checkbox-label">${q($)}</span>`:""}
|
|
118
|
+
</label>
|
|
119
|
+
`}function a4(Z){let{value:Y=50,min:$=0,max:J=100,step:Q=1,disabled:X=!1,label:R,showValue:z=!0,id:K=_("slider"),className:F,style:O}=Z,V=D("stx-slider",X&&"stx-slider--disabled",F),j=W(O),P=['type="range"',`id="${K}"`,`value="${Y}"`,`min="${$}"`,`max="${J}"`,`step="${Q}"`,X&&"disabled"].filter(Boolean).join(" "),L="";if(R)L+=`<label class="stx-slider-label" for="${K}">${q(R)}</label>`;if(L+=`<div class="stx-slider-track"><input ${P} /></div>`,z)L+=`<span class="stx-slider-value">${Y}</span>`;return`<div class="${V}" ${j?`style='${j}'`:""}>${L}</div>`}function i4(Z){let{value:Y,max:$=100,variant:J="default",size:Q="medium",showLabel:X=!1,indeterminate:R=!1,id:z=_("progress"),className:K,style:F}=Z,O=Math.min(100,Math.max(0,Y/$*100)),V=D("stx-progress",`stx-progress--${J}`,`stx-progress--${Q}`,R&&"stx-progress--indeterminate",K),j=W(F);return`
|
|
120
|
+
<div id="${z}" class="${V}" role="progressbar" aria-valuenow="${Y}" aria-valuemin="0" aria-valuemax="${$}" ${j?`style="${j}"`:""}>
|
|
121
|
+
<div class="stx-progress-bar" style="width: ${R?"100%":`${O}%`}"></div>
|
|
122
|
+
${X?`<span class="stx-progress-label">${Math.round(O)}%</span>`:""}
|
|
123
|
+
</div>
|
|
124
|
+
`}function s4(Z){let{text:Y,variant:$="default",size:J="medium",id:Q=_("badge"),className:X,style:R}=Z,z=D("stx-badge",`stx-badge--${$}`,`stx-badge--${J}`,X),K=W(R);return`<span id="${Q}" class="${z}" ${K?`style='${K}'`:""}>${q(Y)}</span>`}function t4(Z){let{src:Y,alt:$="",name:J,size:Q="medium",shape:X="circle",id:R=_("avatar"),className:z,style:K}=Z,F=typeof Q==="number"?"":`stx-avatar--${Q}`,O=typeof Q==="number"?`width: ${Q}px; height: ${Q}px;`:"",V=D("stx-avatar",F,`stx-avatar--${X}`,z),j=[O,W(K)].filter(Boolean).join(" "),P=J?J.split(" ").map((L)=>L[0]).join("").toUpperCase().slice(0,2):"";if(Y)return`<div id="${R}" class="${V}" ${j?`style="${j}"`:""}>
|
|
125
|
+
<img src="${q(Y)}" alt="${q($)}" class="stx-avatar-img" />
|
|
126
|
+
</div>`;return`<div id="${R}" class="${V}" ${j?`style="${j}"`:""}>
|
|
127
|
+
<span class="stx-avatar-initials">${P}</span>
|
|
128
|
+
</div>`}function e4(Z){let{title:Y,subtitle:$,content:J,image:Q,footer:X,variant:R="default",id:z=_("card"),className:K,style:F}=Z,O=D("stx-card",`stx-card--${R}`,K),V=W(F),j="";if(Q)j+=`<div class="stx-card-image"><img src="${q(Q)}" alt="" /></div>`;if(j+='<div class="stx-card-body">',Y)j+=`<h3 class="stx-card-title">${q(Y)}</h3>`;if($)j+=`<p class="stx-card-subtitle">${q($)}</p>`;if(J)j+=`<div class="stx-card-content">${q(J)}</div>`;if(j+="</div>",X)j+=`<div class="stx-card-footer">${q(X)}</div>`;return`<div id="${z}" class="${O}" ${V?`style='${V}'`:""}>${j}</div>`}function ZY(Z){let{tabs:Y,activeTab:$,variant:J="default",id:Q=_("tabs"),className:X,style:R}=Z,z=D("stx-tabs",`stx-tabs--${J}`,X),K=W(R),F=Y.map((O,V)=>{let j=$?O.value===$:V===0;return`<button class="${D("stx-tab",j&&"stx-tab--active",O.disabled&&"stx-tab--disabled")}" data-value="${q(O.value)}" ${O.disabled?"disabled":""} role="tab" aria-selected="${j}">${q(O.label)}</button>`}).join("");return`<div id="${Q}" class="${z}" role="tablist" ${K?`style='${K}'`:""}>${F}</div>`}function YY(Z){let{options:Y,value:$,placeholder:J="Select...",disabled:Q=!1,id:X=_("dropdown"),className:R,style:z}=Z,K=D("stx-dropdown",Q&&"stx-dropdown--disabled",R),F=W(z),O=Y.map((j)=>{let P=j.value===$?"selected":"",L=j.disabled?"disabled":"";return`<option value="${q(j.value)}" ${P} ${L}>${q(j.label)}</option>`}).join(""),V=$?"":`<option value="" disabled selected>${q(J)}</option>`;return`<select id="${X}" class="${K}" ${Q?"disabled":""} ${F?`style='${F}'`:""}>${V}${O}</select>`}function $Y(Z){let{value:Y=0,max:$=5,readonly:J=!1,size:Q="medium",allowHalf:X=!1,id:R=_("rating"),className:z,style:K}=Z,F=D("stx-rating",`stx-rating--${Q}`,J&&"stx-rating--readonly",z),O=W(K),V="";for(let j=1;j<=$;j++){let P=j<=Y,L=X&&j-0.5===Y;V+=`<span class="stx-star ${P?"stx-star--filled":L?"stx-star--half":""}" data-value="${j}">\u2605</span>`}return`<div id="${R}" class="${F}" role="slider" aria-valuenow="${Y}" aria-valuemin="0" aria-valuemax="${$}" ${O?`style='${O}'`:""}>${V}</div>`}function JY(Z){let{value:Y,name:$,checked:J=!1,label:Q,disabled:X=!1,id:R=_("radio"),className:z,style:K}=Z,F=D("stx-radio",X&&"stx-radio--disabled",z),O=W(K),V=['type="radio"',`id="${R}"`,`name="${q($)}"`,`value="${q(Y)}"`,J&&"checked",X&&"disabled"].filter(Boolean).join(" ");return`
|
|
129
|
+
<label class="${F}" ${O?`style="${O}"`:""}>
|
|
130
|
+
<input ${V} />
|
|
131
|
+
<span class="stx-radio-circle"></span>
|
|
132
|
+
${Q?`<span class="stx-radio-label">${q(Q)}</span>`:""}
|
|
133
|
+
</label>
|
|
134
|
+
`}function GY(Z){let{value:Y="#3498db",disabled:$=!1,label:J,presetColors:Q=["#e74c3c","#f39c12","#27ae60","#3498db","#9b59b6","#1abc9c","#34495e","#000000"],id:X=_("color"),className:R,style:z}=Z,K=D("stx-color-picker",$&&"stx-color-picker--disabled",R),F=W(z),O="";if(J)O+=`<label class="stx-color-picker-label" for="${X}">${q(J)}</label>`;if(O+=`<div class="stx-color-picker-input">
|
|
135
|
+
<input type="color" id="${X}" value="${q(Y)}" ${$?"disabled":""} />
|
|
136
|
+
<span class="stx-color-picker-value">${q(Y)}</span>
|
|
137
|
+
</div>`,Q.length>0){O+='<div class="stx-color-picker-presets">';for(let V of Q)O+=`<button class="stx-color-preset" style="background: ${q(V)}" data-color="${q(V)}" ${$?"disabled":""}></button>`;O+="</div>"}return`<div class="${K}" ${F?`style='${F}'`:""}>${O}</div>`}function QY(Z){let{value:Y,min:$,max:J,disabled:Q=!1,label:X,placeholder:R="Select date",showClear:z=!0,id:K=_("date"),className:F,style:O}=Z,V=D("stx-date-picker",Q&&"stx-date-picker--disabled",F),j=W(O),P=Y instanceof Date?Y.toISOString().split("T")[0]:Y||"",L=$ instanceof Date?$.toISOString().split("T")[0]:$,T=J instanceof Date?J.toISOString().split("T")[0]:J,N=['type="date"',`id="${K}"`,P&&`value="${P}"`,L&&`min="${L}"`,T&&`max="${T}"`,Q&&"disabled",`placeholder="${q(R)}"`].filter(Boolean).join(" "),E="";if(X)E+=`<label class="stx-date-picker-label" for="${K}">${q(X)}</label>`;return E+=`<div class="stx-date-picker-input">
|
|
138
|
+
<input ${N} />
|
|
139
|
+
${z&&P?'<button class="stx-date-picker-clear" type="button">×</button>':""}
|
|
140
|
+
</div>`,`<div class="${V}" ${j?`style='${j}'`:""}>${E}</div>`}function XY(Z){let{value:Y="",disabled:$=!1,label:J,step:Q=60,min:X,max:R,id:z=_("time"),className:K,style:F}=Z,O=D("stx-time-picker",$&&"stx-time-picker--disabled",K),V=W(F),j=['type="time"',`id="${z}"`,Y&&`value="${q(Y)}"`,`step="${Q}"`,X&&`min="${q(X)}"`,R&&`max="${q(R)}"`,$&&"disabled"].filter(Boolean).join(" "),P="";if(J)P+=`<label class="stx-time-picker-label" for="${z}">${q(J)}</label>`;return P+=`<input ${j} class="stx-time-picker-input" />`,`<div class="${O}" ${V?`style='${V}'`:""}>${P}</div>`}function zY(Z){let{options:Y,value:$="",placeholder:J="Search...",disabled:Q=!1,label:X,loading:R=!1,id:z=_("autocomplete"),className:K,style:F}=Z,O=D("stx-autocomplete",Q&&"stx-autocomplete--disabled",K),V=W(F),j=Y.find((T)=>T.value===$),P=j?j.label:$,L="";if(X)L+=`<label class="stx-autocomplete-label" for="${z}">${q(X)}</label>`;L+=`<div class="stx-autocomplete-input-wrapper">
|
|
141
|
+
<input type="text" id="${z}" value="${q(P)}" placeholder="${q(J)}" ${Q?"disabled":""} autocomplete="off" class="stx-autocomplete-input" />
|
|
142
|
+
${R?'<span class="stx-autocomplete-spinner"></span>':""}
|
|
143
|
+
</div>`,L+='<ul class="stx-autocomplete-list">';for(let T of Y)L+=`<li class="stx-autocomplete-item ${T.value===$?"stx-autocomplete-item--selected":""}" data-value="${q(T.value)}">${q(T.label)}</li>`;return L+="</ul>",`<div class="${O}" ${V?`style='${V}'`:""}>${L}</div>`}function RY(Z){let{text:Y,htmlFor:$,required:J=!1,size:Q="medium",id:X=_("label"),className:R,style:z}=Z,K=D("stx-label",`stx-label--${Q}`,R),F=W(z);return`<label id="${X}" class="${K}" ${$?`for='${q($)}'`:""} ${F?`style='${F}'`:""}>${q(Y)}${J?'<span class="stx-label-required">*</span>':""}</label>`}function KY(Z){let{src:Y,alt:$="",width:J,height:Q,objectFit:X="cover",fallback:R,loading:z="lazy",id:K=_("image"),className:F,style:O}=Z,V=D("stx-image",F),j={objectFit:X};if(J)j.width=typeof J==="number"?`${J}px`:J;if(Q)j.height=typeof Q==="number"?`${Q}px`:Q;let P=[W(j),W(O)].filter(Boolean).join("; "),L=R?`onerror="this.src='${q(R)}'"`:"";return`<img id="${K}" class="${V}" src="${q(Y)}" alt="${q($)}" loading="${z}" ${P?`style='${P}'`:""} ${L} />`}function FY(Z){let{text:Y,variant:$="default",size:J="medium",removable:Q=!1,icon:X,id:R=_("chip"),className:z,style:K}=Z,F=D("stx-chip",`stx-chip--${$}`,`stx-chip--${J}`,z),O=W(K),V="";if(X)V+=`<span class="stx-chip-icon">${X}</span>`;if(V+=`<span class="stx-chip-text">${q(Y)}</span>`,Q)V+='<button class="stx-chip-remove" type="button">×</button>';return`<span id="${R}" class="${F}" ${O?`style='${O}'`:""}>${V}</span>`}function jY(Z){let{text:Y,position:$="top",delay:J=200,children:Q,id:X=_("tooltip"),className:R,style:z}=Z,K=D("stx-tooltip-wrapper",R),F=W(z);return`<div id="${X}" class="${K}" ${F?`style="${F}"`:""} data-tooltip="${q(Y)}" data-position="${$}" data-delay="${J}">
|
|
144
|
+
${Q}
|
|
145
|
+
<span class="stx-tooltip stx-tooltip--${$}">${q(Y)}</span>
|
|
146
|
+
</div>`}function OY(Z){let{direction:Y="vertical",showScrollbar:$=!0,smooth:J=!0,height:Q,width:X,children:R,id:z=_("scroll"),className:K,style:F}=Z,O=D("stx-scroll-view",`stx-scroll-view--${Y}`,!$&&"stx-scroll-view--hide-scrollbar",J&&"stx-scroll-view--smooth",K),V={};if(Q)V.height=typeof Q==="number"?`${Q}px`:Q;if(X)V.width=typeof X==="number"?`${X}px`:X;let j=[W(V),W(F)].filter(Boolean).join("; ");return`<div id="${z}" class="${O}" ${j?`style='${j}'`:""}>${R}</div>`}function VY(Z){let{direction:Y="horizontal",sizes:$=[50,50],resizable:J=!0,children:Q,id:X=_("split"),className:R,style:z}=Z,K=D("stx-split-view",`stx-split-view--${Y}`,J&&"stx-split-view--resizable",R),F=W(z),O=Y==="horizontal"?"width":"height";return`<div id="${X}" class="${K}" ${F?`style="${F}"`:""}>
|
|
147
|
+
<div class="stx-split-pane" style="${O}: ${$[0]}%">${Q[0]}</div>
|
|
148
|
+
${J?'<div class="stx-split-divider"></div>':""}
|
|
149
|
+
<div class="stx-split-pane" style="${O}: ${$[1]}%">${Q[1]}</div>
|
|
150
|
+
</div>`}function qY(Z){let{items:Y,multiple:$=!1,defaultOpen:J=[],id:Q=_("accordion"),className:X,style:R}=Z,z=D("stx-accordion",X),K=W(R),F="";return Y.forEach((O,V)=>{let j=J.includes(V),P=D("stx-accordion-item",j&&"stx-accordion-item--open",O.disabled&&"stx-accordion-item--disabled");F+=`<div class="${P}" data-index="${V}">
|
|
151
|
+
<button class="stx-accordion-header" ${O.disabled?"disabled":""} aria-expanded="${j}" data-multiple="${$}">
|
|
152
|
+
<span class="stx-accordion-title">${q(O.title)}</span>
|
|
153
|
+
<span class="stx-accordion-icon">\u25BC</span>
|
|
154
|
+
</button>
|
|
155
|
+
<div class="stx-accordion-content" ${j?"":"hidden"}>
|
|
156
|
+
${q(O.content)}
|
|
157
|
+
</div>
|
|
158
|
+
</div>`}),`<div id="${Q}" class="${z}" ${K?`style='${K}'`:""}>${F}</div>`}function UY(Z){let{steps:Y,currentStep:$,orientation:J="horizontal",id:Q=_("stepper"),className:X,style:R}=Z,z=D("stx-stepper",`stx-stepper--${J}`,X),K=W(R),F="";return Y.forEach((O,V)=>{let j=D("stx-step",V<$&&"stx-step--completed",V===$&&"stx-step--active");if(F+=`<div class="${j}" data-step="${V}">
|
|
159
|
+
<div class="stx-step-indicator">
|
|
160
|
+
${V<$?"\u2713":V+1}
|
|
161
|
+
</div>
|
|
162
|
+
<div class="stx-step-content">
|
|
163
|
+
<div class="stx-step-label">${q(O.label)}</div>
|
|
164
|
+
${O.description?`<div class="stx-step-description">${q(O.description)}</div>`:""}
|
|
165
|
+
</div>
|
|
166
|
+
</div>`,V<Y.length-1)F+='<div class="stx-step-connector"></div>'}),`<div id="${Q}" class="${z}" ${K?`style='${K}'`:""}>${F}</div>`}function PY(Z){let{open:Y=!1,title:$,size:J="medium",closable:Q=!0,children:X,footer:R,id:z=_("modal"),className:K,style:F}=Z,O=D("stx-modal-component",`stx-modal-component--${J}`,K),V=W(F);if(!Y)return`<div id="${z}" class="${O} stx-modal-component--hidden" ${V?`style='${V}'`:""}></div>`;let j='<div class="stx-modal-component-overlay">';if(j+='<div class="stx-modal-component-dialog">',$||Q){if(j+='<div class="stx-modal-component-header">',$)j+=`<h3 class="stx-modal-component-title">${q($)}</h3>`;if(Q)j+='<button class="stx-modal-component-close">×</button>';j+="</div>"}if(j+=`<div class="stx-modal-component-body">${X}</div>`,R)j+=`<div class="stx-modal-component-footer">${R}</div>`;return j+="</div></div>",`<div id="${z}" class="${O}" ${V?`style='${V}'`:""}>${j}</div>`}function LY(Z){let{items:Y,selectable:$=!1,multiSelect:J=!1,emptyMessage:Q="No items",id:X=_("list"),className:R,style:z}=Z,K=D("stx-list-view",$&&"stx-list-view--selectable",J&&"stx-list-view--multi",R),F=W(z);if(Y.length===0)return`<div id="${X}" class="${K}" ${F?`style="${F}"`:""}>
|
|
167
|
+
<div class="stx-list-view-empty">${q(Q)}</div>
|
|
168
|
+
</div>`;let O='<ul class="stx-list-view-items">';for(let V of Y){let j=D("stx-list-view-item",V.selected&&"stx-list-view-item--selected");O+=`<li class="${j}" data-id="${q(V.id)}" ${$?'tabindex="0"':""}>${V.content}</li>`}return O+="</ul>",`<div id="${X}" class="${K}" ${F?`style='${F}'`:""}>${O}</div>`}function WY(Z){let{columns:Y,data:$,striped:J=!1,bordered:Q=!1,hoverable:X=!0,sortBy:R,sortOrder:z,id:K=_("table"),className:F,style:O}=Z,V=D("stx-table",J&&"stx-table--striped",Q&&"stx-table--bordered",X&&"stx-table--hoverable",F),j=W(O),P="<table>";P+="<thead><tr>";for(let L of Y){let N=L.key===R?`stx-table-sorted stx-table-sorted--${z}`:"",E=L.sortable?'data-sortable="true"':"",S=L.width?`style="width: ${L.width}"`:"";P+=`<th class="${N}" ${E} ${S} data-key="${q(L.key)}">${q(L.label)}${L.sortable?'<span class="stx-table-sort-icon"></span>':""}</th>`}P+="</tr></thead>",P+="<tbody>";for(let L of $){P+="<tr>";for(let T of Y){let N=L[T.key];P+=`<td>${N!=null?q(String(N)):""}</td>`}P+="</tr>"}return P+="</tbody></table>",`<div id="${K}" class="${V}" ${j?`style='${j}'`:""}>${P}</div>`}function fZ(Z,Y,$,J){let Q=Y.includes(Z.key),X=$.includes(Z.key),R=Z.children&&Z.children.length>0,K=`<div class="${D("stx-tree-node",X&&"stx-tree-node--selected",Z.disabled&&"stx-tree-node--disabled")}" data-key="${q(Z.key)}">`;if(K+='<div class="stx-tree-node-content">',R)K+=`<span class="stx-tree-toggle ${Q?"stx-tree-toggle--expanded":""}">\u25B6</span>`;else K+='<span class="stx-tree-toggle-placeholder"></span>';if(J)K+=`<input type="checkbox" class="stx-tree-checkbox" ${X?"checked":""} ${Z.disabled?"disabled":""} />`;if(Z.icon)K+=`<span class="stx-tree-icon">${Z.icon}</span>`;if(K+=`<span class="stx-tree-label">${q(Z.label)}</span>`,K+="</div>",R&&Q){K+='<div class="stx-tree-children">';for(let F of Z.children)K+=fZ(F,Y,$,J);K+="</div>"}return K+="</div>",K}function DY(Z){let{nodes:Y,expandedKeys:$=[],selectedKeys:J=[],checkable:Q=!1,id:X=_("tree"),className:R,style:z}=Z,K=D("stx-tree-view",Q&&"stx-tree-view--checkable",R),F=W(z),O="";for(let V of Y)O+=fZ(V,$,J,Q);return`<div id="${X}" class="${K}" role="tree" ${F?`style='${F}'`:""}>${O}</div>`}function MY(Z){let{columns:Y,data:$,pagination:J,selectable:Q=!1,id:X=_("datagrid"),className:R,style:z}=Z,K=D("stx-data-grid",Q&&"stx-data-grid--selectable",R),F=W(z),O='<div class="stx-data-grid-table-wrapper">';if(O+='<table class="stx-data-grid-table">',O+="<thead><tr>",Q)O+='<th class="stx-data-grid-select-all"><input type="checkbox" /></th>';for(let V of Y){let j=V.width?`style="width: ${V.width}"`:"";O+=`<th ${j}>
|
|
169
|
+
<div class="stx-data-grid-header-cell">
|
|
170
|
+
<span>${q(V.label)}</span>
|
|
171
|
+
${V.sortable?'<button class="stx-data-grid-sort">\u21C5</button>':""}
|
|
172
|
+
${V.filterable?'<button class="stx-data-grid-filter">\u22BB</button>':""}
|
|
173
|
+
</div>
|
|
174
|
+
</th>`}O+="</tr></thead>",O+="<tbody>";for(let V of $){if(O+="<tr>",Q)O+='<td class="stx-data-grid-select"><input type="checkbox" /></td>';for(let j of Y){let P=V[j.key];O+=`<td>${P!=null?q(String(P)):""}</td>`}O+="</tr>"}if(O+="</tbody></table></div>",J){let V=Math.ceil(J.total/J.pageSize);O+=`<div class="stx-data-grid-pagination">
|
|
175
|
+
<span class="stx-data-grid-page-info">Page ${J.page} of ${V} (${J.total} items)</span>
|
|
176
|
+
<div class="stx-data-grid-page-buttons">
|
|
177
|
+
<button class="stx-data-grid-page-btn" ${J.page<=1?"disabled":""}>\u25C0</button>
|
|
178
|
+
<button class="stx-data-grid-page-btn" ${J.page>=V?"disabled":""}>\u25B6</button>
|
|
179
|
+
</div>
|
|
180
|
+
</div>`}return`<div id="${X}" class="${K}" ${F?`style='${F}'`:""}>${O}</div>`}function _Y(Z){let{type:Y,data:$,options:J={},width:Q="100%",height:X=300,id:R=_("chart"),className:z,style:K}=Z,F=D("stx-chart",`stx-chart--${Y}`,z),O={width:typeof Q==="number"?`${Q}px`:Q,height:typeof X==="number"?`${X}px`:X},V=[W(O),W(K)].filter(Boolean).join("; "),j=JSON.stringify({type:Y,data:$,options:J});return`<div id="${R}" class="${F}" style="${V}" data-chart='${q(j)}'>
|
|
181
|
+
<div class="stx-chart-placeholder">
|
|
182
|
+
${J.title?`<div class="stx-chart-title">${q(J.title)}</div>`:""}
|
|
183
|
+
<div class="stx-chart-type">${Y.charAt(0).toUpperCase()+Y.slice(1)} Chart</div>
|
|
184
|
+
<div class="stx-chart-info">${$.datasets.length} dataset(s), ${$.labels.length} labels</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>`}function TY(Z){let{value:Y="",language:$="plaintext",theme:J="dark",lineNumbers:Q=!0,readOnly:X=!1,height:R=300,tabSize:z=2,wordWrap:K=!1,id:F=_("code"),className:O,style:V}=Z,j=D("stx-code-editor",`stx-code-editor--${J}`,Q&&"stx-code-editor--line-numbers",X&&"stx-code-editor--readonly",K&&"stx-code-editor--wrap",O),P={height:typeof R==="number"?`${R}px`:R},L=[W(P),W(V)].filter(Boolean).join("; "),T=Y.split(`
|
|
187
|
+
`),N="";if(Q){N+='<div class="stx-code-editor-gutter">';for(let E=1;E<=T.length;E++)N+=`<div class="stx-code-editor-line-number">${E}</div>`;N+="</div>"}return N+=`<pre class="stx-code-editor-content"><code class="language-${q($)}">${q(Y)}</code></pre>`,`<div id="${F}" class="${j}" style="${L}" data-language="${q($)}" data-tab-size="${z}">${N}</div>`}function NY(Z){let{src:Y,type:$="video",poster:J,autoplay:Q=!1,loop:X=!1,muted:R=!1,controls:z=!0,width:K,height:F,id:O=_("media"),className:V,style:j}=Z,P=D("stx-media-player",`stx-media-player--${$}`,V),L={};if(K)L.width=typeof K==="number"?`${K}px`:K;if(F)L.height=typeof F==="number"?`${F}px`:F;let T=[W(L),W(j)].filter(Boolean).join("; "),N=[`id="${O}-media"`,`src="${q(Y)}"`,z&&"controls",Q&&"autoplay",X&&"loop",R&&"muted",$==="video"&&J&&`poster="${q(J)}"`].filter(Boolean).join(" "),E=$==="video"?`<video ${N}>Your browser does not support the video tag.</video>`:`<audio ${N}>Your browser does not support the audio tag.</audio>`;return`<div id="${O}" class="${P}" ${T?`style='${T}'`:""}>${E}</div>`}function EY(Z){if(Z===void 0)return"";let Y=["B","KB","MB","GB"],$=Z,J=0;while($>=1024&&J<Y.length-1)$/=1024,J++;return`${$.toFixed(1)} ${Y[J]}`}function AY(Z){let{files:Y,viewMode:$="list",showHidden:J=!1,selectable:Q=!0,id:X=_("files"),className:R,style:z}=Z,K=D("stx-file-explorer",`stx-file-explorer--${$}`,R),F=W(z),O=J?Y:Y.filter((j)=>!j.name.startsWith(".")),V="";if($==="list"){V='<table class="stx-file-explorer-list"><thead><tr><th>Name</th><th>Size</th><th>Modified</th></tr></thead><tbody>';for(let j of O){let P=j.icon||(j.type==="folder"?"\uD83D\uDCC1":"\uD83D\uDCC4"),L=j.type==="file"?EY(j.size):"",T=j.modified?j.modified.toLocaleDateString():"";V+=`<tr class="stx-file-explorer-item ${Q?"stx-file-explorer-item--selectable":""}" data-path="${q(j.path)}" data-type="${j.type}">
|
|
188
|
+
<td><span class="stx-file-explorer-icon">${P}</span>${q(j.name)}</td>
|
|
189
|
+
<td>${L}</td>
|
|
190
|
+
<td>${T}</td>
|
|
191
|
+
</tr>`}V+="</tbody></table>"}else{V='<div class="stx-file-explorer-grid">';for(let j of O){let P=j.icon||(j.type==="folder"?"\uD83D\uDCC1":"\uD83D\uDCC4");V+=`<div class="stx-file-explorer-item ${Q?"stx-file-explorer-item--selectable":""}" data-path="${q(j.path)}" data-type="${j.type}">
|
|
192
|
+
<div class="stx-file-explorer-icon">${P}</div>
|
|
193
|
+
<div class="stx-file-explorer-name">${q(j.name)}</div>
|
|
194
|
+
</div>`}V+="</div>"}return`<div id="${X}" class="${K}" ${F?`style='${F}'`:""}>${V}</div>`}function kY(Z){let{url:Y,width:$="100%",height:J=400,sandbox:Q=!0,allowScripts:X=!0,id:R=_("webview"),className:z,style:K}=Z,F=D("stx-webview",z),O={width:typeof $==="number"?`${$}px`:$,height:typeof J==="number"?`${J}px`:J},V=[W(O),W(K)].filter(Boolean).join("; "),j=[];if(Q){if(j.push("allow-same-origin"),X)j.push("allow-scripts")}let P=Q?`sandbox="${j.join(" ")}"`:"";return`<iframe id="${R}" class="${F}" src="${q(Y)}" style="${V}" ${P} loading="lazy" frameborder="0"></iframe>`}var HY=["Button","TextInput","Checkbox","RadioButton","Slider","ColorPicker","DatePicker","TimePicker","Autocomplete","Label","ImageView","ProgressBar","Avatar","Badge","Chip","Card","Tooltip","Toast","ScrollView","SplitView","Accordion","Stepper","Modal","Tabs","Dropdown","ListView","Table","TreeView","DataGrid","Chart","Rating","CodeEditor","MediaPlayer","FileExplorer","WebView"],xY=`
|
|
195
|
+
/* Button */
|
|
196
|
+
.stx-button {
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
gap: 8px;
|
|
201
|
+
padding: 8px 16px;
|
|
202
|
+
border: none;
|
|
203
|
+
border-radius: 6px;
|
|
204
|
+
font-size: 14px;
|
|
205
|
+
font-weight: 500;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
transition: all 0.15s;
|
|
208
|
+
}
|
|
209
|
+
.stx-button--primary { background: #3498db; color: #fff; }
|
|
210
|
+
.stx-button--primary:hover { background: #2980b9; }
|
|
211
|
+
.stx-button--secondary { background: #6c757d; color: #fff; }
|
|
212
|
+
.stx-button--outline { background: transparent; border: 1px solid #3498db; color: #3498db; }
|
|
213
|
+
.stx-button--ghost { background: transparent; color: #3498db; }
|
|
214
|
+
.stx-button--destructive { background: #e74c3c; color: #fff; }
|
|
215
|
+
.stx-button--small { padding: 4px 8px; font-size: 12px; }
|
|
216
|
+
.stx-button--large { padding: 12px 24px; font-size: 16px; }
|
|
217
|
+
.stx-button--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
218
|
+
.stx-button--loading { pointer-events: none; }
|
|
219
|
+
.stx-button-spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }
|
|
220
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
221
|
+
|
|
222
|
+
/* Input */
|
|
223
|
+
.stx-input-wrapper { display: flex; flex-direction: column; gap: 4px; }
|
|
224
|
+
.stx-input-label { font-size: 14px; font-weight: 500; color: #333; }
|
|
225
|
+
.stx-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.15s; }
|
|
226
|
+
.stx-input:focus { outline: none; border-color: #3498db; }
|
|
227
|
+
.stx-input--error { border-color: #e74c3c; }
|
|
228
|
+
.stx-input-error { font-size: 12px; color: #e74c3c; }
|
|
229
|
+
.stx-input-hint { font-size: 12px; color: #666; }
|
|
230
|
+
|
|
231
|
+
/* Checkbox */
|
|
232
|
+
.stx-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
233
|
+
.stx-checkbox input { display: none; }
|
|
234
|
+
.stx-checkbox-box { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 4px; transition: all 0.15s; }
|
|
235
|
+
.stx-checkbox input:checked + .stx-checkbox-box { background: #3498db; border-color: #3498db; }
|
|
236
|
+
.stx-checkbox--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
237
|
+
|
|
238
|
+
/* Progress */
|
|
239
|
+
.stx-progress { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; position: relative; }
|
|
240
|
+
.stx-progress-bar { height: 100%; background: #3498db; transition: width 0.3s; }
|
|
241
|
+
.stx-progress--success .stx-progress-bar { background: #27ae60; }
|
|
242
|
+
.stx-progress--warning .stx-progress-bar { background: #f39c12; }
|
|
243
|
+
.stx-progress--error .stx-progress-bar { background: #e74c3c; }
|
|
244
|
+
.stx-progress--indeterminate .stx-progress-bar { animation: progress-indeterminate 1.5s infinite; }
|
|
245
|
+
@keyframes progress-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
|
|
246
|
+
|
|
247
|
+
/* Badge */
|
|
248
|
+
.stx-badge { display: inline-flex; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
|
|
249
|
+
.stx-badge--default { background: #e0e0e0; color: #333; }
|
|
250
|
+
.stx-badge--primary { background: #3498db; color: #fff; }
|
|
251
|
+
.stx-badge--success { background: #27ae60; color: #fff; }
|
|
252
|
+
.stx-badge--warning { background: #f39c12; color: #fff; }
|
|
253
|
+
.stx-badge--error { background: #e74c3c; color: #fff; }
|
|
254
|
+
|
|
255
|
+
/* Avatar */
|
|
256
|
+
.stx-avatar { display: inline-flex; align-items: center; justify-content: center; background: #3498db; color: #fff; overflow: hidden; }
|
|
257
|
+
.stx-avatar--circle { border-radius: 50%; }
|
|
258
|
+
.stx-avatar--square { border-radius: 0; }
|
|
259
|
+
.stx-avatar--rounded { border-radius: 8px; }
|
|
260
|
+
.stx-avatar--small { width: 32px; height: 32px; font-size: 12px; }
|
|
261
|
+
.stx-avatar--medium { width: 40px; height: 40px; font-size: 14px; }
|
|
262
|
+
.stx-avatar--large { width: 56px; height: 56px; font-size: 18px; }
|
|
263
|
+
.stx-avatar-img { width: 100%; height: 100%; object-fit: cover; }
|
|
264
|
+
|
|
265
|
+
/* Card */
|
|
266
|
+
.stx-card { background: #fff; border-radius: 8px; overflow: hidden; }
|
|
267
|
+
.stx-card--outlined { border: 1px solid #e0e0e0; }
|
|
268
|
+
.stx-card--elevated { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
|
269
|
+
.stx-card-image img { width: 100%; display: block; }
|
|
270
|
+
.stx-card-body { padding: 16px; }
|
|
271
|
+
.stx-card-title { margin: 0 0 4px; font-size: 18px; }
|
|
272
|
+
.stx-card-subtitle { margin: 0 0 8px; color: #666; font-size: 14px; }
|
|
273
|
+
.stx-card-footer { padding: 12px 16px; border-top: 1px solid #e0e0e0; }
|
|
274
|
+
|
|
275
|
+
/* Tabs */
|
|
276
|
+
.stx-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e0e0e0; }
|
|
277
|
+
.stx-tab { padding: 8px 16px; border: none; background: none; cursor: pointer; color: #666; border-bottom: 2px solid transparent; transition: all 0.15s; }
|
|
278
|
+
.stx-tab:hover { color: #333; }
|
|
279
|
+
.stx-tab--active { color: #3498db; border-bottom-color: #3498db; }
|
|
280
|
+
.stx-tab--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
281
|
+
.stx-tabs--pills { border-bottom: none; }
|
|
282
|
+
.stx-tabs--pills .stx-tab { border-radius: 20px; border-bottom: none; }
|
|
283
|
+
.stx-tabs--pills .stx-tab--active { background: #3498db; color: #fff; }
|
|
284
|
+
|
|
285
|
+
/* Dropdown */
|
|
286
|
+
.stx-dropdown { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; cursor: pointer; min-width: 150px; }
|
|
287
|
+
.stx-dropdown:focus { outline: none; border-color: #3498db; }
|
|
288
|
+
.stx-dropdown--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
289
|
+
|
|
290
|
+
/* Rating */
|
|
291
|
+
.stx-rating { display: inline-flex; gap: 4px; }
|
|
292
|
+
.stx-star { color: #ddd; cursor: pointer; transition: color 0.15s; }
|
|
293
|
+
.stx-star--filled { color: #f1c40f; }
|
|
294
|
+
.stx-star--half { background: linear-gradient(90deg, #f1c40f 50%, #ddd 50%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
295
|
+
.stx-rating--readonly .stx-star { cursor: default; }
|
|
296
|
+
.stx-rating--small .stx-star { font-size: 16px; }
|
|
297
|
+
.stx-rating--medium .stx-star { font-size: 24px; }
|
|
298
|
+
.stx-rating--large .stx-star { font-size: 32px; }
|
|
299
|
+
|
|
300
|
+
/* Slider */
|
|
301
|
+
.stx-slider { display: flex; align-items: center; gap: 12px; }
|
|
302
|
+
.stx-slider-track { flex: 1; }
|
|
303
|
+
.stx-slider input[type="range"] { width: 100%; }
|
|
304
|
+
.stx-slider-value { min-width: 40px; text-align: right; font-size: 14px; }
|
|
305
|
+
|
|
306
|
+
/* Radio Button */
|
|
307
|
+
.stx-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
308
|
+
.stx-radio input { display: none; }
|
|
309
|
+
.stx-radio-circle { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 50%; position: relative; transition: all 0.15s; }
|
|
310
|
+
.stx-radio input:checked + .stx-radio-circle { border-color: #3498db; }
|
|
311
|
+
.stx-radio input:checked + .stx-radio-circle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; background: #3498db; border-radius: 50%; }
|
|
312
|
+
.stx-radio--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
313
|
+
|
|
314
|
+
/* Color Picker */
|
|
315
|
+
.stx-color-picker { display: flex; flex-direction: column; gap: 8px; }
|
|
316
|
+
.stx-color-picker-input { display: flex; align-items: center; gap: 8px; }
|
|
317
|
+
.stx-color-picker-input input[type="color"] { width: 40px; height: 40px; border: none; cursor: pointer; }
|
|
318
|
+
.stx-color-picker-value { font-family: monospace; }
|
|
319
|
+
.stx-color-picker-presets { display: flex; gap: 4px; flex-wrap: wrap; }
|
|
320
|
+
.stx-color-preset { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
|
|
321
|
+
.stx-color-preset:hover { border-color: #333; }
|
|
322
|
+
|
|
323
|
+
/* Date/Time Picker */
|
|
324
|
+
.stx-date-picker, .stx-time-picker { display: flex; flex-direction: column; gap: 4px; }
|
|
325
|
+
.stx-date-picker-input, .stx-time-picker-input { display: flex; align-items: center; gap: 4px; }
|
|
326
|
+
.stx-date-picker-input input, .stx-time-picker-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
|
|
327
|
+
.stx-date-picker-clear { background: none; border: none; cursor: pointer; font-size: 16px; }
|
|
328
|
+
|
|
329
|
+
/* Autocomplete */
|
|
330
|
+
.stx-autocomplete { position: relative; }
|
|
331
|
+
.stx-autocomplete-input-wrapper { position: relative; }
|
|
332
|
+
.stx-autocomplete-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
|
|
333
|
+
.stx-autocomplete-spinner { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: #3498db; border-radius: 50%; animation: spin 0.6s linear infinite; }
|
|
334
|
+
.stx-autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; max-height: 200px; overflow-y: auto; display: none; z-index: 10; }
|
|
335
|
+
.stx-autocomplete:focus-within .stx-autocomplete-list { display: block; }
|
|
336
|
+
.stx-autocomplete-item { padding: 8px 12px; cursor: pointer; }
|
|
337
|
+
.stx-autocomplete-item:hover { background: #f5f5f5; }
|
|
338
|
+
.stx-autocomplete-item--selected { background: #e8f4fc; }
|
|
339
|
+
|
|
340
|
+
/* Label */
|
|
341
|
+
.stx-label { display: inline-block; font-weight: 500; }
|
|
342
|
+
.stx-label--small { font-size: 12px; }
|
|
343
|
+
.stx-label--medium { font-size: 14px; }
|
|
344
|
+
.stx-label--large { font-size: 16px; }
|
|
345
|
+
.stx-label-required { color: #e74c3c; margin-left: 2px; }
|
|
346
|
+
|
|
347
|
+
/* Image */
|
|
348
|
+
.stx-image { display: block; max-width: 100%; }
|
|
349
|
+
|
|
350
|
+
/* Chip */
|
|
351
|
+
.stx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; font-size: 13px; }
|
|
352
|
+
.stx-chip--default { background: #e0e0e0; color: #333; }
|
|
353
|
+
.stx-chip--primary { background: #e8f4fc; color: #3498db; }
|
|
354
|
+
.stx-chip--success { background: #e8f8f0; color: #27ae60; }
|
|
355
|
+
.stx-chip--warning { background: #fef5e7; color: #f39c12; }
|
|
356
|
+
.stx-chip--error { background: #fdebeb; color: #e74c3c; }
|
|
357
|
+
.stx-chip--small { padding: 2px 8px; font-size: 11px; }
|
|
358
|
+
.stx-chip--large { padding: 6px 16px; font-size: 15px; }
|
|
359
|
+
.stx-chip-remove { background: none; border: none; cursor: pointer; opacity: 0.6; padding: 0 2px; }
|
|
360
|
+
.stx-chip-remove:hover { opacity: 1; }
|
|
361
|
+
|
|
362
|
+
/* Tooltip */
|
|
363
|
+
.stx-tooltip-wrapper { position: relative; display: inline-block; }
|
|
364
|
+
.stx-tooltip { position: absolute; background: #333; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; z-index: 1000; }
|
|
365
|
+
.stx-tooltip-wrapper:hover .stx-tooltip { opacity: 1; visibility: visible; }
|
|
366
|
+
.stx-tooltip--top { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; }
|
|
367
|
+
.stx-tooltip--bottom { top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; }
|
|
368
|
+
.stx-tooltip--left { right: 100%; top: 50%; transform: translateY(-50%); margin-right: 8px; }
|
|
369
|
+
.stx-tooltip--right { left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; }
|
|
370
|
+
|
|
371
|
+
/* Scroll View */
|
|
372
|
+
.stx-scroll-view { overflow: auto; }
|
|
373
|
+
.stx-scroll-view--vertical { overflow-x: hidden; overflow-y: auto; }
|
|
374
|
+
.stx-scroll-view--horizontal { overflow-x: auto; overflow-y: hidden; }
|
|
375
|
+
.stx-scroll-view--hide-scrollbar::-webkit-scrollbar { display: none; }
|
|
376
|
+
.stx-scroll-view--hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
|
|
377
|
+
.stx-scroll-view--smooth { scroll-behavior: smooth; }
|
|
378
|
+
|
|
379
|
+
/* Split View */
|
|
380
|
+
.stx-split-view { display: flex; }
|
|
381
|
+
.stx-split-view--horizontal { flex-direction: row; }
|
|
382
|
+
.stx-split-view--vertical { flex-direction: column; }
|
|
383
|
+
.stx-split-pane { overflow: auto; }
|
|
384
|
+
.stx-split-divider { background: #e0e0e0; flex-shrink: 0; }
|
|
385
|
+
.stx-split-view--horizontal .stx-split-divider { width: 4px; cursor: col-resize; }
|
|
386
|
+
.stx-split-view--vertical .stx-split-divider { height: 4px; cursor: row-resize; }
|
|
387
|
+
.stx-split-divider:hover { background: #3498db; }
|
|
388
|
+
|
|
389
|
+
/* Accordion */
|
|
390
|
+
.stx-accordion { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
391
|
+
.stx-accordion-item { border-bottom: 1px solid #e0e0e0; }
|
|
392
|
+
.stx-accordion-item:last-child { border-bottom: none; }
|
|
393
|
+
.stx-accordion-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: none; border: none; cursor: pointer; font-size: 14px; }
|
|
394
|
+
.stx-accordion-header:hover { background: #f5f5f5; }
|
|
395
|
+
.stx-accordion-icon { transition: transform 0.2s; }
|
|
396
|
+
.stx-accordion-item--open .stx-accordion-icon { transform: rotate(180deg); }
|
|
397
|
+
.stx-accordion-content { padding: 0 16px 16px; }
|
|
398
|
+
.stx-accordion-item--disabled { opacity: 0.5; }
|
|
399
|
+
.stx-accordion-item--disabled .stx-accordion-header { cursor: not-allowed; }
|
|
400
|
+
|
|
401
|
+
/* Stepper */
|
|
402
|
+
.stx-stepper { display: flex; }
|
|
403
|
+
.stx-stepper--horizontal { flex-direction: row; align-items: flex-start; }
|
|
404
|
+
.stx-stepper--vertical { flex-direction: column; }
|
|
405
|
+
.stx-step { display: flex; align-items: center; }
|
|
406
|
+
.stx-stepper--vertical .stx-step { flex-direction: row; }
|
|
407
|
+
.stx-step-indicator { width: 32px; height: 32px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; flex-shrink: 0; }
|
|
408
|
+
.stx-step--completed .stx-step-indicator { background: #27ae60; color: #fff; }
|
|
409
|
+
.stx-step--active .stx-step-indicator { background: #3498db; color: #fff; }
|
|
410
|
+
.stx-step-content { margin-left: 12px; }
|
|
411
|
+
.stx-step-label { font-size: 14px; font-weight: 500; }
|
|
412
|
+
.stx-step-description { font-size: 12px; color: #666; }
|
|
413
|
+
.stx-step-connector { flex: 1; height: 2px; background: #e0e0e0; margin: 0 8px; min-width: 20px; }
|
|
414
|
+
.stx-stepper--vertical .stx-step-connector { width: 2px; height: 20px; margin: 8px 0 8px 15px; }
|
|
415
|
+
|
|
416
|
+
/* Modal Component */
|
|
417
|
+
.stx-modal-component--hidden { display: none; }
|
|
418
|
+
.stx-modal-component-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
|
|
419
|
+
.stx-modal-component-dialog { background: #fff; border-radius: 12px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
|
|
420
|
+
.stx-modal-component--small .stx-modal-component-dialog { width: 300px; }
|
|
421
|
+
.stx-modal-component--medium .stx-modal-component-dialog { width: 500px; }
|
|
422
|
+
.stx-modal-component--large .stx-modal-component-dialog { width: 800px; }
|
|
423
|
+
.stx-modal-component--fullscreen .stx-modal-component-dialog { width: 100%; height: 100%; border-radius: 0; }
|
|
424
|
+
.stx-modal-component-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #e0e0e0; }
|
|
425
|
+
.stx-modal-component-title { margin: 0; font-size: 18px; }
|
|
426
|
+
.stx-modal-component-close { background: none; border: none; font-size: 24px; cursor: pointer; opacity: 0.6; }
|
|
427
|
+
.stx-modal-component-close:hover { opacity: 1; }
|
|
428
|
+
.stx-modal-component-body { padding: 16px; overflow-y: auto; flex: 1; }
|
|
429
|
+
.stx-modal-component-footer { padding: 16px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 8px; }
|
|
430
|
+
|
|
431
|
+
/* List View */
|
|
432
|
+
.stx-list-view { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
433
|
+
.stx-list-view-items { list-style: none; margin: 0; padding: 0; }
|
|
434
|
+
.stx-list-view-item { padding: 12px 16px; border-bottom: 1px solid #e0e0e0; }
|
|
435
|
+
.stx-list-view-item:last-child { border-bottom: none; }
|
|
436
|
+
.stx-list-view--selectable .stx-list-view-item { cursor: pointer; }
|
|
437
|
+
.stx-list-view--selectable .stx-list-view-item:hover { background: #f5f5f5; }
|
|
438
|
+
.stx-list-view-item--selected { background: #e8f4fc; }
|
|
439
|
+
.stx-list-view-empty { padding: 24px; text-align: center; color: #666; }
|
|
440
|
+
|
|
441
|
+
/* Table */
|
|
442
|
+
.stx-table { overflow-x: auto; }
|
|
443
|
+
.stx-table table { width: 100%; border-collapse: collapse; }
|
|
444
|
+
.stx-table th, .stx-table td { padding: 12px; text-align: left; }
|
|
445
|
+
.stx-table th { font-weight: 600; background: #f5f5f5; }
|
|
446
|
+
.stx-table--bordered th, .stx-table--bordered td { border: 1px solid #e0e0e0; }
|
|
447
|
+
.stx-table--striped tbody tr:nth-child(even) { background: #f9f9f9; }
|
|
448
|
+
.stx-table--hoverable tbody tr:hover { background: #f5f5f5; }
|
|
449
|
+
.stx-table th[data-sortable] { cursor: pointer; }
|
|
450
|
+
.stx-table-sort-icon::after { content: '\u21C5'; margin-left: 4px; opacity: 0.3; }
|
|
451
|
+
.stx-table-sorted .stx-table-sort-icon::after { opacity: 1; }
|
|
452
|
+
.stx-table-sorted--asc .stx-table-sort-icon::after { content: '\u2191'; }
|
|
453
|
+
.stx-table-sorted--desc .stx-table-sort-icon::after { content: '\u2193'; }
|
|
454
|
+
|
|
455
|
+
/* Tree View */
|
|
456
|
+
.stx-tree-view { font-size: 14px; }
|
|
457
|
+
.stx-tree-node { padding-left: 20px; }
|
|
458
|
+
.stx-tree-node-content { display: flex; align-items: center; gap: 4px; padding: 4px; cursor: pointer; border-radius: 4px; }
|
|
459
|
+
.stx-tree-node-content:hover { background: #f5f5f5; }
|
|
460
|
+
.stx-tree-node--selected > .stx-tree-node-content { background: #e8f4fc; }
|
|
461
|
+
.stx-tree-node--disabled { opacity: 0.5; }
|
|
462
|
+
.stx-tree-toggle { width: 16px; cursor: pointer; transition: transform 0.2s; }
|
|
463
|
+
.stx-tree-toggle--expanded { transform: rotate(90deg); }
|
|
464
|
+
.stx-tree-toggle-placeholder { width: 16px; }
|
|
465
|
+
.stx-tree-children { padding-left: 8px; }
|
|
466
|
+
|
|
467
|
+
/* Data Grid */
|
|
468
|
+
.stx-data-grid { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
469
|
+
.stx-data-grid-table-wrapper { overflow-x: auto; }
|
|
470
|
+
.stx-data-grid-table { width: 100%; border-collapse: collapse; }
|
|
471
|
+
.stx-data-grid-table th, .stx-data-grid-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }
|
|
472
|
+
.stx-data-grid-table th { background: #f5f5f5; }
|
|
473
|
+
.stx-data-grid-header-cell { display: flex; align-items: center; gap: 8px; }
|
|
474
|
+
.stx-data-grid-sort, .stx-data-grid-filter { background: none; border: none; cursor: pointer; opacity: 0.5; }
|
|
475
|
+
.stx-data-grid-sort:hover, .stx-data-grid-filter:hover { opacity: 1; }
|
|
476
|
+
.stx-data-grid-pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid #e0e0e0; }
|
|
477
|
+
.stx-data-grid-page-buttons { display: flex; gap: 4px; }
|
|
478
|
+
.stx-data-grid-page-btn { padding: 4px 8px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; border-radius: 4px; }
|
|
479
|
+
.stx-data-grid-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
480
|
+
|
|
481
|
+
/* Chart */
|
|
482
|
+
.stx-chart { background: #f9f9f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
|
|
483
|
+
.stx-chart-placeholder { text-align: center; padding: 20px; }
|
|
484
|
+
.stx-chart-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
|
|
485
|
+
.stx-chart-type { font-size: 14px; color: #666; }
|
|
486
|
+
.stx-chart-info { font-size: 12px; color: #999; margin-top: 4px; }
|
|
487
|
+
|
|
488
|
+
/* Code Editor */
|
|
489
|
+
.stx-code-editor { display: flex; font-family: 'Monaco', 'Menlo', monospace; font-size: 13px; line-height: 1.5; overflow: hidden; border-radius: 8px; }
|
|
490
|
+
.stx-code-editor--dark { background: #1e1e1e; color: #d4d4d4; }
|
|
491
|
+
.stx-code-editor--light { background: #fff; color: #333; border: 1px solid #e0e0e0; }
|
|
492
|
+
.stx-code-editor-gutter { padding: 12px 8px; background: rgba(0,0,0,0.1); text-align: right; user-select: none; }
|
|
493
|
+
.stx-code-editor-line-number { color: #858585; }
|
|
494
|
+
.stx-code-editor-content { flex: 1; padding: 12px; overflow: auto; }
|
|
495
|
+
.stx-code-editor-content pre { margin: 0; }
|
|
496
|
+
.stx-code-editor--wrap .stx-code-editor-content { white-space: pre-wrap; word-wrap: break-word; }
|
|
497
|
+
|
|
498
|
+
/* Media Player */
|
|
499
|
+
.stx-media-player video, .stx-media-player audio { width: 100%; display: block; }
|
|
500
|
+
.stx-media-player--video { background: #000; }
|
|
501
|
+
|
|
502
|
+
/* File Explorer */
|
|
503
|
+
.stx-file-explorer { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
504
|
+
.stx-file-explorer-list { width: 100%; border-collapse: collapse; }
|
|
505
|
+
.stx-file-explorer-list th { text-align: left; padding: 8px 12px; background: #f5f5f5; font-weight: 500; }
|
|
506
|
+
.stx-file-explorer-list td { padding: 8px 12px; border-top: 1px solid #e0e0e0; }
|
|
507
|
+
.stx-file-explorer-item--selectable { cursor: pointer; }
|
|
508
|
+
.stx-file-explorer-item--selectable:hover { background: #f5f5f5; }
|
|
509
|
+
.stx-file-explorer-icon { margin-right: 8px; }
|
|
510
|
+
.stx-file-explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px; padding: 16px; }
|
|
511
|
+
.stx-file-explorer--grid .stx-file-explorer-item { text-align: center; padding: 12px; border-radius: 8px; }
|
|
512
|
+
.stx-file-explorer--grid .stx-file-explorer-icon { font-size: 32px; display: block; margin-bottom: 8px; }
|
|
513
|
+
.stx-file-explorer--grid .stx-file-explorer-name { font-size: 12px; word-break: break-all; }
|
|
514
|
+
|
|
515
|
+
/* WebView */
|
|
516
|
+
.stx-webview { border: none; display: block; }
|
|
517
|
+
|
|
518
|
+
/* Dark mode support */
|
|
519
|
+
@media (prefers-color-scheme: dark) {
|
|
520
|
+
.stx-input-label { color: #eee; }
|
|
521
|
+
.stx-input { background: #333; border-color: #555; color: #fff; }
|
|
522
|
+
.stx-card { background: #2d2d2d; color: #fff; }
|
|
523
|
+
.stx-card-subtitle { color: #aaa; }
|
|
524
|
+
.stx-progress { background: #444; }
|
|
525
|
+
.stx-dropdown { background: #333; border-color: #555; color: #fff; }
|
|
526
|
+
.stx-accordion { border-color: #444; }
|
|
527
|
+
.stx-accordion-item { border-color: #444; }
|
|
528
|
+
.stx-accordion-header:hover { background: #333; }
|
|
529
|
+
.stx-list-view { border-color: #444; }
|
|
530
|
+
.stx-list-view-item { border-color: #444; }
|
|
531
|
+
.stx-list-view--selectable .stx-list-view-item:hover { background: #333; }
|
|
532
|
+
.stx-table th { background: #333; }
|
|
533
|
+
.stx-table--bordered th, .stx-table--bordered td { border-color: #444; }
|
|
534
|
+
.stx-tree-node-content:hover { background: #333; }
|
|
535
|
+
.stx-data-grid { border-color: #444; }
|
|
536
|
+
.stx-data-grid-table th, .stx-data-grid-table td { border-color: #444; }
|
|
537
|
+
.stx-data-grid-table th { background: #333; }
|
|
538
|
+
.stx-modal-component-dialog { background: #2d2d2d; color: #fff; }
|
|
539
|
+
.stx-modal-component-header, .stx-modal-component-footer { border-color: #444; }
|
|
540
|
+
.stx-file-explorer { border-color: #444; }
|
|
541
|
+
.stx-file-explorer-list th { background: #333; }
|
|
542
|
+
.stx-file-explorer-list td { border-color: #444; }
|
|
543
|
+
.stx-autocomplete-list { background: #333; border-color: #444; }
|
|
544
|
+
.stx-autocomplete-item:hover { background: #444; }
|
|
545
|
+
.stx-chip--default { background: #444; color: #eee; }
|
|
546
|
+
.stx-chip--primary { background: #1a3a52; }
|
|
547
|
+
.stx-chip--success { background: #1a3a2a; }
|
|
548
|
+
.stx-chip--warning { background: #3a2a1a; }
|
|
549
|
+
.stx-chip--error { background: #3a1a1a; }
|
|
550
|
+
}
|
|
551
|
+
`;function CY(){return!1}function VZ(){return typeof window<"u"&&typeof document<"u"}var b=[];function IY(){return`modal-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function SY(Z){switch(Z){case"info":return"ℹ";case"warning":return"⚠";case"error":return"✖";case"success":return"✔";case"question":return"❓";default:return"ℹ"}}function YZ(Z){if(Z==="question")return[{label:"No",style:"default"},{label:"Yes",style:"primary"}];return[{label:"OK",style:"primary"}]}function wY(Z){let{options:Y}=Z,$=SY(Y.type),J=Y.buttons||YZ(Y.type),Q=Y.type||"info",X="";return J.forEach((R,z)=>{let K=R.style==="destructive"?"destructive":R.style==="primary"?"primary":"default",F=z===(Y.defaultButton??J.length-1)?"autofocus":"";X+=`<button class="stx-modal-btn ${K}" data-index="${z}" ${F}>${R.label}</button>`}),`
|
|
552
|
+
<div class="stx-modal-overlay" data-modal-id="${Z.id}">
|
|
553
|
+
<div class="stx-modal ${Q}" role="dialog" aria-modal="true" aria-labelledby="${Z.id}-title">
|
|
554
|
+
<div class="stx-modal-icon">${$}</div>
|
|
555
|
+
<div class="stx-modal-content">
|
|
556
|
+
${Y.title?`<h2 id="${Z.id}-title" class="stx-modal-title">${vZ(Y.title)}</h2>`:""}
|
|
557
|
+
<p class="stx-modal-message">${vZ(Y.message)}</p>
|
|
558
|
+
</div>
|
|
559
|
+
<div class="stx-modal-buttons">${X}</div>
|
|
560
|
+
</div>
|
|
561
|
+
</div>
|
|
562
|
+
`}function vZ(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function C(Z,Y,$=!1){let J=b.indexOf(Z);if(J>-1)b.splice(J,1);if(Z.element&&VZ())Z.element.remove();let X=(Z.options.buttons||YZ(Z.options.type))[Y];if(X?.action)X.action();Z.resolve({buttonIndex:Y,cancelled:$})}async function h(Z){let Y=CY(),$=IY();return new Promise((J)=>{let Q={id:$,options:Z,resolve:J};if(b.push(Q),Y)console.log(`[stx-modal] Showing native modal: ${Z.title||"Modal"}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);else if(VZ())try{let X=document.createElement("div");X.innerHTML=wY(Q);let R=X.firstElementChild;if(!R){console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);return}Q.element=R;try{document.body.appendChild(R)}catch{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);return}try{R.querySelectorAll(".stx-modal-btn").forEach((z)=>{z.addEventListener("click",()=>{let K=Number.parseInt(z.dataset.index||"0",10);C(Q,K,!1)})})}catch{}try{R.addEventListener("click",(z)=>{if(z.target===R){let K=Z.cancelButton??0;C(Q,K,!0)}})}catch{}try{let z=(K)=>{if(K.key==="Escape"){let F=Z.cancelButton??0;C(Q,F,!0),document.removeEventListener("keydown",z)}else if(K.key==="Enter"){let F=Z.defaultButton??(Z.buttons||YZ(Z.type)).length-1;C(Q,F,!1),document.removeEventListener("keydown",z)}};document.addEventListener("keydown",z)}catch{}try{let z=R.querySelector(".stx-modal-btn[autofocus]");if(z)z.focus()}catch{}if(typeof process<"u"&&process.env.BUN_TEST)setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}catch{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}else{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`);let X=Z.buttons||YZ(Z.type);console.log(`[stx-modal] Buttons: ${X.map((R)=>R.label).join(", ")}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}})}async function yZ(Z,Y){return h({title:Z,message:Y,type:"info"})}async function BY(Z,Y){return h({title:Z,message:Y,type:"warning"})}async function fY(Z,Y){return h({title:Z,message:Y,type:"error"})}async function vY(Z,Y){return h({title:Z,message:Y,type:"success"})}async function gZ(Z,Y){return h({title:Z,message:Y,type:"question",buttons:[{label:"No",style:"default"},{label:"Yes",style:"primary"}],defaultButton:1,cancelButton:0})}async function yY(Z,Y="Confirm"){return(await gZ(Y,Z)).buttonIndex===1}async function gY(Z,Y="Alert"){await yZ(Y,Z)}async function bY(Z,Y="",$="Input"){if(VZ()&&typeof window.prompt==="function")return window.prompt(Z,Y);return console.log(`[stx-modal] PROMPT: ${$}`),console.log(`[stx-modal] ${Z}`),console.log(`[stx-modal] Default: ${Y}`),Y}function uY(){return b.length}function mY(){while(b.length>0){let Z=b[b.length-1];C(Z,0,!0)}}var hY=`
|
|
563
|
+
.stx-modal-overlay {
|
|
564
|
+
position: fixed;
|
|
565
|
+
inset: 0;
|
|
566
|
+
background: rgba(0, 0, 0, 0.5);
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: center;
|
|
570
|
+
z-index: 10000;
|
|
571
|
+
animation: stx-modal-fade-in 0.15s ease-out;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
@keyframes stx-modal-fade-in {
|
|
575
|
+
from { opacity: 0; }
|
|
576
|
+
to { opacity: 1; }
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.stx-modal {
|
|
580
|
+
background: #fff;
|
|
581
|
+
border-radius: 12px;
|
|
582
|
+
padding: 24px;
|
|
583
|
+
max-width: 400px;
|
|
584
|
+
width: 90%;
|
|
585
|
+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
|
|
586
|
+
animation: stx-modal-slide-up 0.2s ease-out;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
@keyframes stx-modal-slide-up {
|
|
590
|
+
from { transform: translateY(20px); opacity: 0; }
|
|
591
|
+
to { transform: translateY(0); opacity: 1; }
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
@media (prefers-color-scheme: dark) {
|
|
595
|
+
.stx-modal {
|
|
596
|
+
background: #2d2d2d;
|
|
597
|
+
color: #fff;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.stx-modal-icon {
|
|
602
|
+
font-size: 48px;
|
|
603
|
+
text-align: center;
|
|
604
|
+
margin-bottom: 16px;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.stx-modal.info .stx-modal-icon { color: #3498db; }
|
|
608
|
+
.stx-modal.warning .stx-modal-icon { color: #f39c12; }
|
|
609
|
+
.stx-modal.error .stx-modal-icon { color: #e74c3c; }
|
|
610
|
+
.stx-modal.success .stx-modal-icon { color: #27ae60; }
|
|
611
|
+
.stx-modal.question .stx-modal-icon { color: #9b59b6; }
|
|
612
|
+
|
|
613
|
+
.stx-modal-content {
|
|
614
|
+
text-align: center;
|
|
615
|
+
margin-bottom: 24px;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.stx-modal-title {
|
|
619
|
+
margin: 0 0 8px;
|
|
620
|
+
font-size: 20px;
|
|
621
|
+
font-weight: 600;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.stx-modal-message {
|
|
625
|
+
margin: 0;
|
|
626
|
+
color: #666;
|
|
627
|
+
line-height: 1.5;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
@media (prefers-color-scheme: dark) {
|
|
631
|
+
.stx-modal-message { color: #aaa; }
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.stx-modal-buttons {
|
|
635
|
+
display: flex;
|
|
636
|
+
gap: 8px;
|
|
637
|
+
justify-content: center;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.stx-modal-btn {
|
|
641
|
+
padding: 10px 24px;
|
|
642
|
+
border-radius: 6px;
|
|
643
|
+
font-size: 14px;
|
|
644
|
+
font-weight: 500;
|
|
645
|
+
cursor: pointer;
|
|
646
|
+
border: none;
|
|
647
|
+
transition: background 0.15s, transform 0.1s;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.stx-modal-btn:hover {
|
|
651
|
+
transform: translateY(-1px);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.stx-modal-btn:active {
|
|
655
|
+
transform: translateY(0);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.stx-modal-btn.default {
|
|
659
|
+
background: #e0e0e0;
|
|
660
|
+
color: #333;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.stx-modal-btn.default:hover {
|
|
664
|
+
background: #d0d0d0;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.stx-modal-btn.primary {
|
|
668
|
+
background: #3498db;
|
|
669
|
+
color: #fff;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.stx-modal-btn.primary:hover {
|
|
673
|
+
background: #2980b9;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.stx-modal-btn.destructive {
|
|
677
|
+
background: #e74c3c;
|
|
678
|
+
color: #fff;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.stx-modal-btn.destructive:hover {
|
|
682
|
+
background: #c0392b;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
@media (prefers-color-scheme: dark) {
|
|
686
|
+
.stx-modal-btn.default {
|
|
687
|
+
background: #444;
|
|
688
|
+
color: #fff;
|
|
689
|
+
}
|
|
690
|
+
.stx-modal-btn.default:hover {
|
|
691
|
+
background: #555;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
`;import bZ from"process";function cY(){if(bZ.platform)return bZ.platform;return"unknown"}function mZ(){if(typeof window<"u"&&window.craft?.tray)return!0;return!1}function hZ(Z,Y){if(Z.type==="separator")return{id:`sep-${Y}`,label:"",type:"separator"};let $={id:`item-${Y}-${Z.label.replace(/\s+/g,"-").toLowerCase()}`,label:Z.label,type:Z.type||"normal",enabled:Z.enabled!==!1};if(Z.accelerator)$.shortcut=Z.accelerator;if(Z.type==="checkbox")$.checked=Z.checked||!1;if(Z.type==="submenu"&&Z.submenu)$.submenu=Z.submenu.map((J,Q)=>hZ(J,Q));return $}function qZ(Z){return Z.map((Y,$)=>hZ(Y,$))}function cZ(Z,Y=0){if(Z.type==="separator")return'<hr class="stx-tray-separator" />';let $=" ".repeat(Y),J=Z.enabled===!1?"disabled":"",Q=Z.checked?"\u2713 ":"",X=Z.accelerator?`<span class="accelerator">${Z.accelerator}</span>`:"",R=`${$}<div class="stx-tray-item ${J}" data-action="${Z.label}">`;if(R+=`<span class="label">${Q}${Z.label}</span>${X}`,Z.type==="submenu"&&Z.submenu){R+='<span class="arrow">\u25B8</span>',R+='<div class="stx-tray-submenu">';for(let z of Z.submenu)R+=cZ(z,Y+1);R+="</div>"}return R+="</div>",R}function pY(Z){let Y='<div class="stx-tray-menu">';for(let $ of Z)Y+=cZ($);return Y+="</div>",Y}var v=new Map;function lY(){return`tray-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}var uZ=!1;function dY(){if(uZ||typeof window>"u")return;window.addEventListener("craft:tray:menu",(Z)=>{let{action:Y}=Z.detail;for(let $ of v.values()){let J=$.handlers.get(Y);if(J){J();break}}}),uZ=!0}async function pZ(Z={}){let Y=lY(),$=cY(),J=mZ(),Q={icon:Z.icon||"",tooltip:Z.tooltip||"stx Application",menu:Z.menu||[],visible:!0},X=new Map;for(let z of Z.menu||[]){if(z.type!=="separator"&&z.onClick)X.set(z.label,z.onClick);if(z.type==="submenu"&&z.submenu){for(let K of z.submenu)if(K.type!=="separator"&&K.onClick)X.set(K.label,K.onClick)}}if(v.set(Y,{state:Q,handlers:X}),J){dY();let z=window;try{if(Q.tooltip)await z.craft.tray.setTitle({title:Q.tooltip}),await z.craft.tray.setTooltip({tooltip:Q.tooltip});if(Q.icon)await z.craft.tray.setIcon({icon:Q.icon});let K=qZ(Q.menu);await z.craft.tray.setMenu({items:K}),console.log(`[stx-tray] Native tray created for ${$}`)}catch(K){console.warn("[stx-tray] Failed to create native tray:",K)}}else console.log("[stx-tray] Created simulated tray (not in Craft window)"),console.log(`[stx-tray] ID: ${Y}`),console.log(`[stx-tray] Tooltip: ${Q.tooltip}`),console.log(`[stx-tray] Menu items: ${Q.menu.length}`);return{id:Y,setIcon:(z)=>{if(Q.icon=z,J)window.craft.tray.setIcon({icon:z}).catch((F)=>{console.warn("[stx-tray] Failed to set icon:",F)});console.log(`[stx-tray:${Y}] Icon updated`)},setTooltip:(z)=>{if(Q.tooltip=z,J)window.craft.tray.setTooltip({tooltip:z}).catch((F)=>{console.warn("[stx-tray] Failed to set tooltip:",F)});console.log(`[stx-tray:${Y}] Tooltip: ${z}`)},setMenu:(z)=>{Q.menu=z,X.clear();for(let K of z){if(K.type!=="separator"&&K.onClick)X.set(K.label,K.onClick);if(K.type==="submenu"&&K.submenu){for(let F of K.submenu)if(F.type!=="separator"&&F.onClick)X.set(F.label,F.onClick)}}if(J){let K=window,F=qZ(z);K.craft.tray.setMenu({items:F}).catch((O)=>{console.warn("[stx-tray] Failed to set menu:",O)})}console.log(`[stx-tray:${Y}] Menu updated (${z.length} items)`)},destroy:()=>{if(Q.visible=!1,v.delete(Y),J)window.craft.tray.destroy?.().catch((K)=>{console.warn("[stx-tray] Failed to destroy tray:",K)});console.log(`[stx-tray:${Y}] Destroyed`)}}}var rY=pZ;function nY(){return Array.from(v.keys())}function oY(Z){let Y=v.get(Z);if(!Y)return null;let $=mZ();return{id:Z,setIcon:(J)=>{if(Y.state.icon=J,$)window.craft.tray.setIcon({icon:J}).catch(()=>{})},setTooltip:(J)=>{if(Y.state.tooltip=J,$)window.craft.tray.setTooltip({tooltip:J}).catch(()=>{})},setMenu:(J)=>{if(Y.state.menu=J,$){let Q=window,X=qZ(J);Q.craft.tray.setMenu({items:X}).catch(()=>{})}},destroy:()=>{if(v.delete(Z),$)window.craft.tray.destroy?.().catch(()=>{})}}}function aY(Z,Y){let $=v.get(Z);if(!$)return!1;let J=$.handlers.get(Y);if(J)return J(),!0;return!1}function iY(Z){let Y=v.get(Z);if(!Y)return null;return pY(Y.state.menu)}function sY(){return`
|
|
695
|
+
// STX Desktop Tray Bridge
|
|
696
|
+
// Provides convenient wrappers around window.craft.tray APIs
|
|
697
|
+
window.stxTray = {
|
|
698
|
+
setTitle: (title) => window.craft?.tray?.setTitle({ title }),
|
|
699
|
+
setTooltip: (tooltip) => window.craft?.tray?.setTooltip({ tooltip }),
|
|
700
|
+
setIcon: (icon) => window.craft?.tray?.setIcon({ icon }),
|
|
701
|
+
setMenu: (items) => window.craft?.tray?.setMenu({ items }),
|
|
702
|
+
destroy: () => window.craft?.tray?.destroy(),
|
|
703
|
+
|
|
704
|
+
// Check if tray is available
|
|
705
|
+
isAvailable: () => typeof window.craft?.tray !== 'undefined',
|
|
706
|
+
};
|
|
707
|
+
`}var tY=`
|
|
708
|
+
.stx-tray-menu {
|
|
709
|
+
background: #2d2d2d;
|
|
710
|
+
border-radius: 8px;
|
|
711
|
+
padding: 4px 0;
|
|
712
|
+
min-width: 200px;
|
|
713
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
714
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
715
|
+
font-size: 13px;
|
|
716
|
+
color: #fff;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.stx-tray-item {
|
|
720
|
+
padding: 6px 12px;
|
|
721
|
+
display: flex;
|
|
722
|
+
align-items: center;
|
|
723
|
+
justify-content: space-between;
|
|
724
|
+
cursor: pointer;
|
|
725
|
+
position: relative;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.stx-tray-item:hover {
|
|
729
|
+
background: #3d3d3d;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.stx-tray-item.disabled {
|
|
733
|
+
opacity: 0.5;
|
|
734
|
+
cursor: not-allowed;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.stx-tray-item .label {
|
|
738
|
+
flex: 1;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.stx-tray-item .accelerator {
|
|
742
|
+
margin-left: 20px;
|
|
743
|
+
opacity: 0.6;
|
|
744
|
+
font-size: 12px;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.stx-tray-item .arrow {
|
|
748
|
+
margin-left: 8px;
|
|
749
|
+
font-size: 10px;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.stx-tray-separator {
|
|
753
|
+
margin: 4px 0;
|
|
754
|
+
border: none;
|
|
755
|
+
border-top: 1px solid #444;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.stx-tray-submenu {
|
|
759
|
+
position: absolute;
|
|
760
|
+
left: 100%;
|
|
761
|
+
top: 0;
|
|
762
|
+
background: #2d2d2d;
|
|
763
|
+
border-radius: 8px;
|
|
764
|
+
padding: 4px 0;
|
|
765
|
+
min-width: 150px;
|
|
766
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
767
|
+
display: none;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.stx-tray-item:hover > .stx-tray-submenu {
|
|
771
|
+
display: block;
|
|
772
|
+
}
|
|
773
|
+
`;function lZ(Z){let Y=new Set(Z.properties??[]);if(Z.canChooseDirectories)Y.add("openDirectory");if(Z.canChooseFiles)Y.add("openFile");if(Z.multiSelections)Y.add("multiSelections");if(Z.showHiddenFiles)Y.add("showHiddenFiles");if(Z.canCreateDirectories)Y.add("createDirectory");return{...Z,properties:[...Y]}}function $Z(){if(typeof window<"u"&&window.craft?.dialog)return!0;return!1}async function eY(Z={}){if($Z()){let Y=window;try{return await Y.craft.dialog.showOpenDialog(lZ(Z))}catch($){console.warn("[stx-dialog] Failed to show native open dialog:",$)}}return new Promise((Y)=>{if(typeof document>"u"){Y({canceled:!0,filePaths:[]});return}let $=new Set(lZ(Z).properties),J=document.createElement("input");if(J.type="file",J.multiple=$.has("multiSelections"),Z.filters?.length){let Q=Z.filters.flatMap((X)=>X.extensions.map((R)=>`.${R}`));J.accept=Q.join(",")}if($.has("openDirectory")&&!$.has("openFile"))J.webkitdirectory=!0;J.onchange=()=>{let Q=Array.from(J.files||[]);if(Q.length===0)Y({canceled:!0,filePaths:[]});else{let X=Q.map((R)=>R.name);Y({canceled:!1,filePaths:X})}},J.oncancel=()=>{Y({canceled:!0,filePaths:[]})},J.click()})}async function Z6(Z={}){if($Z()){let $=window;try{return await $.craft.dialog.showSaveDialog(Z)}catch(J){console.warn("[stx-dialog] Failed to show native save dialog:",J)}}if(typeof window<"u"&&"showSaveFilePicker"in window)try{let $=Z.filters?.map((Q)=>({description:Q.name,accept:{"*/*":Q.extensions.map((X)=>`.${X}`)}}));return{canceled:!1,filePath:(await window.showSaveFilePicker({suggestedName:Z.defaultPath,types:$})).name}}catch($){return{canceled:!0}}console.warn("[stx-dialog] Save dialog not available, using prompt fallback");let Y=prompt("Enter filename:",Z.defaultPath||"file.txt");if(Y)return{canceled:!1,filePath:Y};return{canceled:!0}}async function r(Z){if($Z()){let R=window;try{return await R.craft.dialog.showMessageBox(Z)}catch(z){console.warn("[stx-dialog] Failed to show native message box:",z)}}let Y=Z.buttons||["OK"],$=Z.detail?`
|
|
774
|
+
|
|
775
|
+
${Z.detail}`:"",J=`${Z.message}${$}`;if(Y.length===1)return alert(J),{response:0};let Q=Z.cancelButton??Y.length-1,X=Z.defaultButton!==void 0&&Z.defaultButton!==Q?Z.defaultButton:Y.findIndex((R,z)=>z!==Q);if(Y.length>2)console.warn(`[stx-dialog] ${Y.length} buttons requested; a browser confirm offers two. Reachable: "${Y[X]}" and "${Y[Q]}".`);return{response:confirm(J)?X:Q}}async function Y6(Z={}){if($Z()){let Y=window;try{return await Y.craft.dialog.showColorPicker(Z)}catch($){console.warn("[stx-dialog] Failed to show native color picker:",$)}}return new Promise((Y)=>{if(typeof document>"u"){Y({canceled:!0});return}let $=document.createElement("input");$.type="color",$.value=Z.color||"#000000",$.onchange=()=>{Y({canceled:!1,color:$.value})},$.oncancel=()=>{Y({canceled:!0})},$.click()})}async function $6(Z,Y){await r({type:"info",title:Y||"Alert",message:Z,buttons:["OK"]})}async function J6(Z,Y){return(await r({type:"question",title:Y||"Confirm",message:Z,buttons:["OK","Cancel"],defaultButton:0,cancelButton:1})).response===0}async function G6(Z,Y){await r({type:"error",title:Y||"Error",message:Z,buttons:["OK"]})}async function Q6(Z,Y){await r({type:"warning",title:Y||"Warning",message:Z,buttons:["OK"]})}function X6(){return`
|
|
776
|
+
// STX Desktop Dialog Bridge
|
|
777
|
+
// Provides convenient wrappers around window.craft.dialog APIs
|
|
778
|
+
window.stxDialog = {
|
|
779
|
+
// File dialogs
|
|
780
|
+
showOpenDialog: (options) => window.craft?.dialog?.showOpenDialog(options),
|
|
781
|
+
showSaveDialog: (options) => window.craft?.dialog?.showSaveDialog(options),
|
|
782
|
+
|
|
783
|
+
// Message dialogs
|
|
784
|
+
showMessageBox: (options) => window.craft?.dialog?.showMessageBox(options),
|
|
785
|
+
|
|
786
|
+
// Color picker
|
|
787
|
+
showColorPicker: (options) => window.craft?.dialog?.showColorPicker(options),
|
|
788
|
+
|
|
789
|
+
// Font picker
|
|
790
|
+
showFontPicker: (options) => window.craft?.dialog?.showFontPicker(options),
|
|
791
|
+
|
|
792
|
+
// Convenience functions
|
|
793
|
+
alert: async (message, title) => {
|
|
794
|
+
return window.craft?.dialog?.showMessageBox({
|
|
795
|
+
type: 'info',
|
|
796
|
+
title: title || 'Alert',
|
|
797
|
+
message,
|
|
798
|
+
buttons: ['OK'],
|
|
799
|
+
});
|
|
800
|
+
},
|
|
801
|
+
|
|
802
|
+
confirm: async (message, title) => {
|
|
803
|
+
const result = await window.craft?.dialog?.showMessageBox({
|
|
804
|
+
type: 'question',
|
|
805
|
+
title: title || 'Confirm',
|
|
806
|
+
message,
|
|
807
|
+
buttons: ['Cancel', 'OK'],
|
|
808
|
+
});
|
|
809
|
+
return result?.response === 1;
|
|
810
|
+
},
|
|
811
|
+
|
|
812
|
+
error: async (message, title) => {
|
|
813
|
+
return window.craft?.dialog?.showMessageBox({
|
|
814
|
+
type: 'error',
|
|
815
|
+
title: title || 'Error',
|
|
816
|
+
message,
|
|
817
|
+
buttons: ['OK'],
|
|
818
|
+
});
|
|
819
|
+
},
|
|
820
|
+
|
|
821
|
+
// Check if dialog is available
|
|
822
|
+
isAvailable: () => typeof window.craft?.dialog !== 'undefined',
|
|
823
|
+
};
|
|
824
|
+
`}import I from"process";import{existsSync as z6}from"fs";import{dirname as R6,join as K6}from"path";import{craftBinaryNotFoundMessage as dZ,resolveCraftBinary as F6}from"craft-native";var c={};function j6(Z){c={...c,...Z}}function O6(){return{...c}}function V6(){c={}}function UZ(Z){if(!Z.sidebarConfig)return;let Y={...Z.sidebarConfig};if(Y.variant==="desktop")Y.material=Y.material??"sidebar",Y.backgroundEffect=Y.backgroundEffect??"shimmer",Y.allowsVibrancy=Y.allowsVibrancy??!0;return Y}function JZ(){let Z=R6(I.execPath),Y=Z.includes(".app/Contents/MacOS")?K6(Z,"craft"):void 0,$=[I.env.CRAFT_BINARY_PATH,c.craftBinaryPath,...c.additionalSearchPaths||[],Y];for(let J of $)if(J&&z6(J))return J;return F6()}var H=new Map;function PZ(Z){let Y=H.get(Z);if(!Y||Y.closed)return;Y.closed=!0;for(let $ of Y.closeListeners??[])try{$()}catch(J){console.warn(`[stx/desktop] window ${Z} close listener threw:`,J)}Y.closeListeners?.clear()}var q6=50;async function LZ(Z,Y){let $=Y.show().then(()=>({failed:!1}),(Q)=>({failed:!0,error:Q})),J=await Promise.race([$,new Promise((Q)=>setTimeout(()=>Q(null),q6))]);if(J?.failed)throw J.error;$.then(()=>PZ(Z))}function U6(){return Array.from(H.keys())}function P6(Z){let Y=H.get(Z);if(!Y)return null;return GZ(Z,Y.app)}function L6(){for(let[Z,Y]of H)try{Y.app?.close?.()}catch($){console.warn(`Failed to close window ${Z}:`,$)}H.clear()}function GZ(Z,Y){return{id:Z,show:()=>{console.log(`[stx/desktop] Window ${Z} shown`)},hide:()=>{console.log("[stx/desktop] To hide window, use window.craft.window.hide() from inside the webview")},close:()=>{let $=H.get(Z);if($?.app)$.app.close(),PZ(Z),H.delete(Z),console.log(`[stx/desktop] Window ${Z} closed`)},onClosed:($)=>{let J=H.get(Z);if(!J||J.closed)return queueMicrotask($),()=>{};return J.closeListeners??=new Set,J.closeListeners.add($),()=>J.closeListeners?.delete($)},focus:()=>{console.log("[stx/desktop] To focus window, use window.craft.window.focus() from inside the webview")},minimize:()=>{console.log("[stx/desktop] To minimize window, use window.craft.window.minimize() from inside the webview")},maximize:()=>{console.log("[stx/desktop] To maximize window, use window.craft.window.maximize() from inside the webview")},restore:()=>{console.log("[stx/desktop] To restore window, use window.craft.window.show() from inside the webview")},setTitle:($)=>{console.log(`[stx/desktop] To set title, use window.craft.window.setTitle({ title: "${$}" }) from inside the webview`)},loadURL:($)=>{console.log(`[stx/desktop] To navigate, use window.location.href = "${$}" from inside the webview`)},reload:()=>{console.log("[stx/desktop] To reload, use window.craft.window.reload() from inside the webview")}}}function WZ(Z,Y={}){let $=["--url",Z,"--title",Y.title||"stx Desktop","--width",String(Y.width??1200),"--height",String(Y.height??800)];if(Y.darkMode)$.push("--dark");if(Y.hotReload)$.push("--hot-reload");if(Y.resizable===!1)$.push("--no-resize");if(Y.frameless)$.push("--frameless");if(Y.alwaysOnTop)$.push("--always-on-top");if(Y.titlebarHidden)$.push("--titlebar-hidden");if(Y.systemTray)$.push("--system-tray");if(Y.hideDockIcon)$.push("--hide-dock-icon");if(Y.devTools===!1)$.push("--no-devtools");if(Y.nativeSidebar)$.push("--native-sidebar");if(Y.sidebarWidth!==void 0)$.push("--sidebar-width",String(Y.sidebarWidth));let J=UZ(Y);if(J)$.push("--sidebar-config",JSON.stringify(J));return $}async function W6(Z,Y={}){let $=`craft-window-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,J=JZ();try{let{createApp:Q}=await import("craft-native"),X=Q({url:Z,craftPath:J,window:{title:Y.title||"stx Desktop",width:Y.width??1200,height:Y.height??800,darkMode:Y.darkMode??!1,hotReload:Y.hotReload??!1,resizable:Y.resizable??!0,frameless:Y.frameless??!1,alwaysOnTop:Y.alwaysOnTop??!1,titlebarHidden:Y.titlebarHidden??!1,systemTray:Y.systemTray??!1,hideDockIcon:Y.hideDockIcon??!1,devTools:Y.devTools??!1,nativeSidebar:Y.nativeSidebar??!1,sidebarWidth:Y.sidebarWidth,sidebarConfig:UZ(Y)}});return H.set($,{app:X,url:Z,options:Y}),await LZ($,X),GZ($,X)}catch{try{let{spawn:Q}=await import("child_process"),X=Q(J,WZ(Z,Y),{stdio:"inherit"});X.on("error",(z)=>{console.error(z.code==="ENOENT"?dZ(J):`craft child error: ${z.message}`)});let R={close:()=>X.kill()};return H.set($,{app:R,url:Z,options:Y}),X.on("exit",()=>PZ($)),GZ($,R)}catch(Q){return console.error("Failed to spawn craft binary:",Q.message),null}}}async function D6(Z,Y={}){let $=`http://localhost:${Z}/`;if(I.env.NODE_ENV==="test"||I.env.BUN_TEST)return console.warn("\u26A0 Skipping native window in test environment"),console.log("(Skipping browser fallback in test environment)"),!1;try{let{createApp:Q}=await import("craft-native");console.log("\u26A1 Opening native window via craft-native\u2026");let X=!Y.nativeSidebar,R=UZ(Y),z=Q({url:$,craftPath:JZ(),window:{title:Y.title||"stx Development",width:Y.width||1400,height:Y.height||900,resizable:!0,systemTray:X,darkMode:Y.darkMode??!0,hotReload:Y.hotReload??!0,devTools:!0,titlebarHidden:Y.titlebarHidden??!1,nativeSidebar:Y.nativeSidebar??!1,sidebarWidth:Y.sidebarWidth??260,sidebarConfig:R}}),K=`dev-window-${Z}`;return H.set(K,{app:z,url:$,options:Y}),await LZ(K,z),console.log(`\u2713 Native window opened at ${$}`),!0}catch{let Q=JZ();try{console.log(`\u26A1 Opening native window via craft binary (${Q})\u2026`);let{spawn:X}=await import("child_process"),R=X(Q,WZ($,{title:"stx Development",width:1400,height:900,hotReload:!0,...Y}),{stdio:"inherit"});R.on("exit",()=>I.exit(0)),R.on("error",(K)=>{console.warn(K.code==="ENOENT"?dZ(Q):`craft child error: ${K.message}`)});let z=`dev-window-${Z}`;return H.set(z,{app:{close:()=>R.kill()},url:$,options:Y}),console.log(`\u2713 Native window opened at ${$}`),!0}catch(X){console.warn("\u26A0 Could not spawn craft binary:",X.message)}if(I.env.NODE_ENV==="test"||I.env.BUN_TEST)return console.log("(Skipping browser fallback in test environment)"),!1;console.log("\uD83D\uDCF1 Opening in browser instead\u2026");try{let{spawn:X}=await import("child_process"),R=I.platform;return X(R==="darwin"?"open":R==="win32"?"cmd":"xdg-open",R==="win32"?["/c","start",$]:[$],{detached:!0,stdio:"ignore"}).unref(),console.log(`\u2713 Browser opened at ${$}`),!0}catch(X){return console.error("Could not open browser:",X),console.log(`Please open manually: ${$}`),!1}}}async function M6(Z,Y={}){let{title:$="stx Desktop",width:J=1200,height:Q=800,darkMode:X=!1,hotReload:R=!1,resizable:z=!0,frameless:K=!1,alwaysOnTop:F=!1}=Y;try{let{createApp:O}=await import("craft-native"),V=JZ(),j=O({html:Z,craftPath:V,window:{title:$,width:J,height:Q,darkMode:X,hotReload:R,resizable:z,frameless:K,alwaysOnTop:F}}),P=`craft-window-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return H.set(P,{app:j,url:"html-content",options:Y}),await LZ(P,j),GZ(P,j)}catch(O){return console.error("Failed to create window with HTML:",O),null}}function _6(){try{return y.resolve("craft-native"),!0}catch{return!1}}function T6(){return`
|
|
825
|
+
// STX Desktop Window Bridge
|
|
826
|
+
// Provides convenient wrappers around window.craft APIs
|
|
827
|
+
window.stxWindow = {
|
|
828
|
+
// Window control
|
|
829
|
+
hide: () => window.craft?.window?.hide(),
|
|
830
|
+
show: () => window.craft?.window?.show(),
|
|
831
|
+
toggle: () => window.craft?.window?.toggle(),
|
|
832
|
+
close: () => window.craft?.window?.close(),
|
|
833
|
+
minimize: () => window.craft?.window?.minimize(),
|
|
834
|
+
maximize: () => window.craft?.window?.maximize(),
|
|
835
|
+
focus: () => window.craft?.window?.focus(),
|
|
836
|
+
center: () => window.craft?.window?.center(),
|
|
837
|
+
reload: () => window.craft?.window?.reload(),
|
|
838
|
+
toggleFullscreen: () => window.craft?.window?.toggleFullscreen(),
|
|
839
|
+
|
|
840
|
+
// Window properties
|
|
841
|
+
setTitle: (title) => window.craft?.window?.setTitle({ title }),
|
|
842
|
+
setSize: (width, height) => window.craft?.window?.setSize({ width, height }),
|
|
843
|
+
setPosition: (x, y) => window.craft?.window?.setPosition({ x, y }),
|
|
844
|
+
setAlwaysOnTop: (alwaysOnTop) => window.craft?.window?.setAlwaysOnTop({ alwaysOnTop }),
|
|
845
|
+
setResizable: (resizable) => window.craft?.window?.setResizable({ resizable }),
|
|
846
|
+
setOpacity: (opacity) => window.craft?.window?.setOpacity({ opacity }),
|
|
847
|
+
|
|
848
|
+
// macOS-specific
|
|
849
|
+
setVibrancy: (vibrancy) => window.craft?.window?.setVibrancy({ vibrancy }),
|
|
850
|
+
|
|
851
|
+
// App control
|
|
852
|
+
quit: () => window.craft?.app?.quit(),
|
|
853
|
+
isDarkMode: () => window.craft?.app?.isDarkMode(),
|
|
854
|
+
getLocale: () => window.craft?.app?.getLocale(),
|
|
855
|
+
|
|
856
|
+
// Notifications
|
|
857
|
+
notify: (options) => window.craft?.app?.notify(options),
|
|
858
|
+
|
|
859
|
+
// Check if running in Craft
|
|
860
|
+
isCraftAvailable: () => typeof window.craft !== 'undefined',
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// Expose as global for backwards compatibility
|
|
864
|
+
window.desktop = window.stxWindow;
|
|
865
|
+
`}import{pack as N6,packageApp as E6}from"craft-native";import{craftBinaryNotFoundMessage as A6,resolveCraftBinary as k6}from"craft-native";import n from"process";import{spawn as H6}from"child_process";import{AutoUpdater as rZ,canReplaceBundle as x6,clearQuarantine as C6,extractBundle as I6,generateUpdateManifest as nZ,readBundleIdentity as DZ,swapBundle as S6,verifyBundleTrust as w6}from"craft-native";var oZ="update.json";function aZ(Z,Y){return`https://github.com/${Z}/releases/latest/download/${Y}`}function iZ(Z,Y,$){return`https://github.com/${Z}/releases/download/${Y}/${$}`}function sZ(Z){let{repository:Y,manifestAsset:$=oZ,...J}=Z;return new rZ({...J,updateUrl:aZ(Y,$)})}function B6(Z){let Y=Z.tag??`v${Z.version}`,$={};for(let[J,Q]of Object.entries(Z.artifacts)){if(!Q)continue;$[J]={path:Q,url:iZ(Z.repository,Y,Q.split("/").pop())}}return nZ({version:Z.version,releaseNotes:Z.releaseNotes,platforms:$})}function QZ(Z=n.execPath){let Y=Z.split("/");for(let $=0;$<Y.length;$++)if(Y[$].endsWith(".app"))return Y.slice(0,$+1).join("/");return null}async function f6(){let Z=QZ();if(!Z)return null;return(await DZ(Z)).teamId}function tZ(){let Z=n.ppid;if(Z>1)try{n.kill(Z,"SIGTERM");return}catch{}n.exit(0)}function eZ(Z={}){let Y=Z.appPath??QZ(),$=Z.quit??(()=>n.exit(0));if(Y)H6("/usr/bin/open",["-n",Y],{detached:!0,stdio:"ignore"}).unref();let J=Z.quitDelayMs??0;if(J>0){setTimeout($,J).unref?.();return}$()}async function v6(Z){let{appPath:Y,requireSameTeam:$=!0,macos:J,...Q}=Z,X=Y??QZ();if(!X)throw Error("createSelfUpdater: this process is not running from an .app bundle, so there is nothing to update. Pass `appPath` explicitly, or skip the updater in development.");let R=J?.teamId??($?(await DZ(X)).teamId??void 0:void 0);return sZ({...Q,appPath:X,macos:{...J,teamId:R},relaunch:Z.relaunch??((z)=>eZ({appPath:z,quit:tZ,quitDelayMs:250}))})}var MZ=null,A=null;class Z4{_process;_startedAt;_endsAt;_options;_expireHandlers=[];_expireTimer=null;_stopped=!1;constructor(Z,Y){this._process=Z,this._options=Y,this._startedAt=new Date;let $=Y.duration;if($&&$>0){let J=$*60*1000;this._endsAt=new Date(this._startedAt.getTime()+J),this._expireTimer=setTimeout(()=>{this._stopped=!0;for(let Q of this._expireHandlers)try{Q()}catch{}},J)}else this._endsAt=null}get pid(){return this._process.pid}get startedAt(){return this._startedAt}get endsAt(){return this._endsAt}get options(){return{...this._options}}get isActive(){if(this._stopped)return!1;return this._process.exitCode===null}get remainingMs(){if(!this._endsAt)return null;let Z=this._endsAt.getTime()-Date.now();return Math.max(0,Z)}get elapsedMs(){return Date.now()-this._startedAt.getTime()}stop(){if(this._stopped)return;if(this._stopped=!0,this._expireTimer)clearTimeout(this._expireTimer),this._expireTimer=null;try{this._process.kill()}catch{}}onExpire(Z){this._expireHandlers.push(Z)}}function y6(Z={}){Y4();let{duration:Y,preventDisplaySleep:$=!0,preventIdleSleep:J=!0,preventSystemSleep:Q=!0,preventDiskSleep:X=!1,assertUserActivity:R=!0}=Z,z=[];if($)z.push("-d");if(J)z.push("-i");if(Q)z.push("-s");if(X)z.push("-m");if(R)z.push("-u");let K=[...z];if(Y&&Y>0)K.push("-t",String(Y*60));let F=Bun.spawn(["/usr/bin/caffeinate",...K],{stdio:["ignore","ignore","ignore"]}),O=new Z4(F,Z);return MZ=F,A=O,O}function Y4(Z){if(Z){if(Z.stop(),A===Z)MZ=null,A=null;return}if(A)A.stop();MZ=null,A=null}function g6(){return A!==null&&A.isActive}function b6(){if(!A||!A.isActive)return{active:!1,instance:null,startedAt:null,endsAt:null,durationMinutes:null};let Y=A.options.duration;return{active:!0,instance:A,startedAt:A.startedAt,endsAt:A.endsAt,durationMinutes:Y&&Y>0?Y:-1}}function u6(Z){let Y=Z||A;if(!Y||!Y.isActive)return"0:00";let $=Y.remainingMs;if($===null)return"\u221E";let J=Math.ceil($/1000),Q=Math.floor(J/3600),X=Math.floor(J%3600/60),R=J%60;if(Q>0)return`${Q}:${String(X).padStart(2,"0")}:${String(R).padStart(2,"0")}`;return`${X}:${String(R).padStart(2,"0")}`}function m6(Z){if(Z<=0||Z===-1)return"Indefinitely";if(Z<60)return`${Z} minutes`;if(Z===60)return"1 hour";if(Z%60===0)return`${Z/60} hours`;let Y=Math.floor(Z/60),$=Z%60;return`${Y}h ${$}m`}import{existsSync as _Z,mkdirSync as h6,readFileSync as c6,watch as p6,writeFileSync as l6}from"fs";import{homedir as d6,platform as r6}from"os";import{dirname as n6,join as o}from"path";function o6(Z){let Y=r6(),$=d6();switch(Y){case"darwin":return o($,"Library","Application Support",Z);case"win32":return o(process.env.APPDATA||o($,"AppData","Roaming"),Z);default:return o($,".config",Z)}}class $4{_defaults;_data;_path;_changeHandlers=new Map;_anyChangeHandlers=new Set;_watcher=null;_writeTimer=null;_writing=!1;constructor(Z){this._defaults={...Z.defaults};let Y=Z.path?n6(Z.path):o6(Z.name);if(this._path=Z.path||o(Y,"preferences.json"),!_Z(Y))h6(Y,{recursive:!0});if(this._data=this._load(),Z.watch!==!1)this._setupWatcher()}get path(){return this._path}get(Z){if(Z in this._data)return this._data[Z];return this._defaults[Z]}set(Z,Y){let $=this.get(Z);if(JSON.stringify($)===JSON.stringify(Y))return;this._data[Z]=Y,this._scheduleSave(),this._notifyChange(Z,Y,$)}getAll(){return{...this._defaults,...this._data}}has(Z){return Z in this._data}delete(Z){if(!(Z in this._data))return;let Y=this._data[Z];delete this._data[Z],this._scheduleSave(),this._notifyChange(Z,this._defaults[Z],Y)}reset(){let Z={...this._data};this._data={},this._save();for(let Y of Object.keys(Z)){let $=this._defaults[Y];this._notifyChange(Y,$,Z[Y])}}onChange(Z,Y){let $=Z;if(!this._changeHandlers.has($))this._changeHandlers.set($,new Set);return this._changeHandlers.get($).add(Y),()=>{this._changeHandlers.get($)?.delete(Y)}}onAnyChange(Z){return this._anyChangeHandlers.add(Z),()=>{this._anyChangeHandlers.delete(Z)}}close(){if(this._watcher)this._watcher.close(),this._watcher=null;if(this._writeTimer)clearTimeout(this._writeTimer),this._writeTimer=null,this._save()}_load(){try{if(_Z(this._path)){let Z=c6(this._path,"utf-8");return JSON.parse(Z)}}catch{}return{}}_save(){this._writing=!0;try{let Z=JSON.stringify({...this._defaults,...this._data},null,2);l6(this._path,Z,"utf-8")}catch(Z){console.error(`Failed to save preferences to ${this._path}:`,Z)}finally{setTimeout(()=>{this._writing=!1},100)}}_scheduleSave(){if(this._writeTimer)clearTimeout(this._writeTimer);this._writeTimer=setTimeout(()=>{this._writeTimer=null,this._save()},50)}_setupWatcher(){try{if(!_Z(this._path))this._save();this._watcher=p6(this._path,()=>{if(this._writing)return;let Z=this._load(),Y={...this._data};this._data=Z;let $=new Set([...Object.keys(Y),...Object.keys(Z)]);for(let J of $){let Q=J in Y?Y[J]:this._defaults[J],X=J in Z?Z[J]:this._defaults[J];if(JSON.stringify(Q)!==JSON.stringify(X))this._notifyChange(J,X,Q)}})}catch{}}_notifyChange(Z,Y,$){let J=this._changeHandlers.get(Z);if(J)for(let Q of J)try{Q(Y,$)}catch{}for(let Q of this._anyChangeHandlers)try{Q(Z,Y,$)}catch{}}}function a6(Z){return new $4(Z)}import{existsSync as p,mkdirSync as J4,readFileSync as i6,unlinkSync as G4,writeFileSync as Q4}from"fs";import{homedir as XZ,platform as X4}from"os";import{join as l}from"path";function z4(Z){let Y=Z.toLowerCase().replace(/[^a-z0-9]/g,"-");return l(XZ(),"Library","LaunchAgents",`com.${Y}.plist`)}function R4(Z){let Y=process.env.XDG_CONFIG_HOME||l(XZ(),".config");return l(Y,"autostart",`${Z.toLowerCase()}.desktop`)}async function s6(Z,Y){let $=Y.appName||"StxApp",J=z4($),Q=l(XZ(),"Library","LaunchAgents");if(Z){let X=Y.appPath||process.execPath,R=Y.args||[],z=[X,...R],K=`<?xml version="1.0" encoding="UTF-8"?>
|
|
866
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
867
|
+
<plist version="1.0">
|
|
868
|
+
<dict>
|
|
869
|
+
<key>Label</key>
|
|
870
|
+
<string>com.${$.toLowerCase().replace(/[^a-z0-9]/g,"-")}</string>
|
|
871
|
+
<key>ProgramArguments</key>
|
|
872
|
+
<array>
|
|
873
|
+
${z.map((F)=>` <string>${Y8(F)}</string>`).join(`
|
|
874
|
+
`)}
|
|
875
|
+
</array>
|
|
876
|
+
<key>RunAtLoad</key>
|
|
877
|
+
<true/>
|
|
878
|
+
<key>KeepAlive</key>
|
|
879
|
+
<false/>
|
|
880
|
+
${Y.isHidden?` <key>ProcessType</key>
|
|
881
|
+
<string>Background</string>`:""}
|
|
882
|
+
</dict>
|
|
883
|
+
</plist>`;if(!p(Q))J4(Q,{recursive:!0});Q4(J,K,"utf-8")}else if(p(J))G4(J)}async function t6(Z,Y){let $=Y.appName||"StxApp",J=R4($),Q=l(process.env.XDG_CONFIG_HOME||l(XZ(),".config"),"autostart");if(Z){let X=Y.appPath||process.execPath,R=Y.args||[],z=[X,...R].join(" "),K=`[Desktop Entry]
|
|
884
|
+
Type=Application
|
|
885
|
+
Name=${$}
|
|
886
|
+
Exec=${z}
|
|
887
|
+
Terminal=false
|
|
888
|
+
StartupNotify=false
|
|
889
|
+
${Y.isHidden?`X-GNOME-Autostart-enabled=true
|
|
890
|
+
NoDisplay=true`:""}
|
|
891
|
+
`;if(!p(Q))J4(Q,{recursive:!0});Q4(J,K,"utf-8")}else if(p(J))G4(J)}async function e6(Z){return p(z4(Z))}async function Z8(Z){let Y=R4(Z);if(!p(Y))return!1;try{let $=i6(Y,"utf-8");if($.includes("X-GNOME-Autostart-enabled=false"))return!1;if($.includes("Hidden=true"))return!1;return!0}catch{return!1}}function Y8(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function $8(Z,Y={}){let $=X4();switch($){case"darwin":return s6(Z,Y);case"linux":return t6(Z,Y);default:throw Error(`Auto-launch is not yet supported on ${$}`)}}async function J8(Z){let Y=Z||"StxApp";switch(X4()){case"darwin":return e6(Y);case"linux":return Z8(Y);default:return!1}}var B=new Map,G8=0,zZ=!1;function K4(Z){let Y=Z.split("+").map((J)=>J.trim()),$={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let J of Y){let Q=J.toLowerCase();switch(Q){case"cmd":case"command":case"meta":case"\u2318":$.meta=!0;break;case"ctrl":case"control":case"\u2303":$.ctrl=!0;break;case"shift":case"\u21E7":$.shift=!0;break;case"alt":case"option":case"opt":case"\u2325":$.alt=!0;break;case"cmdorctrl":case"commandorcontrol":if(typeof process<"u"&&process.platform==="darwin")$.meta=!0;else $.ctrl=!0;break;default:$.key=Q}}return $}function Q8(Z){let Y=[];if(Z.ctrl)Y.push("\u2303");if(Z.alt)Y.push("\u2325");if(Z.shift)Y.push("\u21E7");if(Z.meta)Y.push("\u2318");return Y.push(Z.key.toUpperCase()),Y.join("")}function X8(Z,Y){if(Y.meta!==Z.metaKey)return!1;if(Y.ctrl!==Z.ctrlKey)return!1;if(Y.shift!==Z.shiftKey)return!1;if(Y.alt!==Z.altKey)return!1;return Z.key.toLowerCase()===Y.key||Z.code.toLowerCase()===`key${Y.key}`}function F4(Z){for(let[,Y]of B)if(X8(Z,Y.parsed)){Z.preventDefault(),Z.stopPropagation();try{Y.handler()}catch{}break}}function z8(){if(zZ)return;if(typeof document>"u")return;document.addEventListener("keydown",F4,!0),zZ=!0}function TZ(){if(!zZ)return;if(typeof document>"u")return;document.removeEventListener("keydown",F4,!0),zZ=!1}async function R8(Z,Y){if(typeof window>"u")return!1;let $=window.craft;if(!$?.hotkeys?.register)return!1;try{return await $.hotkeys.register(Z,Y),!0}catch{return!1}}async function NZ(Z){if(typeof window>"u")return;let Y=window.craft;if(!Y?.hotkeys?.unregister)return;try{await Y.hotkeys.unregister(Z)}catch{}}function K8(Z,Y){let $=`hotkey_${++G8}_${Date.now()}`,J=K4(Z);B.set($,{shortcut:Z,handler:Y,parsed:J}),R8($,Z),z8();let Q={shortcut:Z,id:$,unregister(){j4(Q)}};return Q}function j4(Z){if(B.delete(Z.id),NZ(Z.id),B.size===0)TZ()}function F8(){for(let[Z]of B)NZ(Z);B.clear(),TZ()}function j8(){return Array.from(B.entries()).map(([Z,Y])=>({shortcut:Y.shortcut,id:Z,unregister(){if(B.delete(Z),NZ(Z),B.size===0)TZ()}}))}class O4{_duration;_tickInterval;_remaining;_running=!1;_paused=!1;_complete=!1;_intervalId=null;_lastTick=0;_completionHandlers=new Set;_tickHandlers=new Set;constructor(Z){if(this._duration=Z.duration,this._tickInterval=Z.tickInterval||1000,this._remaining=Z.duration,Z.onComplete)this._completionHandlers.add(Z.onComplete);if(Z.onTick)this._tickHandlers.add(Z.onTick);if(Z.autoStart)this.start()}get isRunning(){return this._running&&!this._paused}get isPaused(){return this._paused}get isComplete(){return this._complete}get remaining(){if(this._running&&!this._paused){let Z=Date.now()-this._lastTick;return Math.max(0,this._remaining-Z)}return Math.max(0,this._remaining)}get elapsed(){return this._duration-this.remaining}get duration(){return this._duration}get progress(){if(this._duration===0)return 1;return Math.min(1,this.elapsed/this._duration)}start(){if(this._running)return;this._running=!0,this._paused=!1,this._complete=!1,this._lastTick=Date.now(),this._startInterval()}stop(){this._clearInterval(),this._running=!1,this._paused=!1,this._remaining=this._duration}pause(){if(!this._running||this._paused)return;let Z=Date.now()-this._lastTick;this._remaining=Math.max(0,this._remaining-Z),this._clearInterval(),this._paused=!0}resume(){if(!this._paused)return;this._paused=!1,this._lastTick=Date.now(),this._startInterval()}reset(){this._clearInterval(),this._running=!1,this._paused=!1,this._complete=!1,this._remaining=this._duration}onComplete(Z){return this._completionHandlers.add(Z),()=>{this._completionHandlers.delete(Z)}}onTick(Z){return this._tickHandlers.add(Z),()=>{this._tickHandlers.delete(Z)}}_startInterval(){this._clearInterval(),this._intervalId=setInterval(()=>{let Z=Date.now(),Y=Z-this._lastTick;this._lastTick=Z,this._remaining=Math.max(0,this._remaining-Y);for(let $ of this._tickHandlers)try{$(this._remaining)}catch{}if(this._remaining<=0){this._clearInterval(),this._running=!1,this._complete=!0;for(let $ of this._completionHandlers)try{$()}catch{}}},this._tickInterval)}_clearInterval(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null}}class V4{_interval;_handler;_immediate;_running=!1;_intervalId=null;constructor(Z){if(this._interval=Z.interval,this._handler=Z.handler,this._immediate=Z.immediate!==!1,this._immediate)this.start()}get isRunning(){return this._running}start(){if(this._running)return;this._running=!0,this._intervalId=setInterval(()=>{try{this._handler()}catch{}},this._interval)}stop(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null;this._running=!1}}function O8(Z){return new O4(Z)}function V8(Z){return new V4(Z)}function q8(Z){return new Promise((Y)=>setTimeout(Y,Z))}function U8(Z){let Y=Math.ceil(Z/1000),$=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if($>0)return`${$}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${J}:${String(Q).padStart(2,"0")}`}function P8(Z){let Y=Math.ceil(Z/1000),$=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if($>0){if(J>0)return`${$}h ${J}m`;return`${$}h`}if(J>0){if(Q>0)return`${J}m ${Q}s`;return`${J}m`}return`${Q}s`}function G(Z){if(typeof window>"u")return!1;let Y=window.craft;return!!(Y&&Y[Z])}function M(Z){if(!G(Z))throw Error(`craft.${Z} is not available \u2014 this API requires a Craft native window`);return window.craft[Z]}function U(Z,Y){if(typeof window>"u")return()=>{};let $=(J)=>Y(J.detail??{});return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var L8={async writeText(Z){if(G("clipboard")){await window.craft.clipboard.writeText(Z);return}if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(Z)},async readText(){if(G("clipboard")){let Z=await window.craft.clipboard.readText();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.readText)try{return await navigator.clipboard.readText()}catch{return""}return""},async writeHTML(Z){if(G("clipboard")){await window.craft.clipboard.writeHTML(Z);return}if(typeof navigator<"u"&&navigator.clipboard?.write)try{let Y=new window.ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([W8(Z)],{type:"text/plain"})});await navigator.clipboard.write([Y])}catch{}},async readHTML(){if(G("clipboard")){let Z=await window.craft.clipboard.readHTML();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.read)try{let Z=await navigator.clipboard.read();for(let Y of Z)if(Y.types.includes("text/html"))return await(await Y.getType("text/html")).text()}catch{}return""},async clear(){if(G("clipboard")){await window.craft.clipboard.clear();return}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText("")}catch{}},async hasText(){if(G("clipboard"))return await window.craft.clipboard.hasText();return(await this.readText()).length>0},async hasHTML(){if(G("clipboard"))return await window.craft.clipboard.hasHTML();return(await this.readHTML()).length>0},async hasImage(){if(G("clipboard"))return await window.craft.clipboard.hasImage();return!1}};function W8(Z){return Z.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<\/?(br|p|div|li|h[1-6])\b[^>]*>/gi,`
|
|
892
|
+
`).replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\n{3,}/g,`
|
|
893
|
+
|
|
894
|
+
`).trim()}var D8={async show(Z){if(!Z.title)throw Error("notification title is required");if(G("notifications")){await window.craft.notifications.show(Z);return}if(typeof window<"u"&&"Notification"in window){let Y=window.Notification;if(Y.permission==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon});else if(Y.permission==="default"){if(await Y.requestPermission()==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon})}}},async schedule(Z){if(G("notifications")){let J={...Z};if(J.triggerAt instanceof Date)J.triggerAt=J.triggerAt.toISOString();await window.craft.notifications.schedule(J);return}let Y=M8(Z.triggerAt),$=Math.max(0,Y-Date.now());setTimeout(()=>{this.show(Z).catch(()=>{})},$)},async cancel(Z){if(G("notifications"))await window.craft.notifications.cancel(Z)},async cancelAll(){if(G("notifications"))await window.craft.notifications.cancelAll()},async setBadge(Z){let Y=Math.max(0,Math.round(Number.isFinite(Z)?Z:0));if(G("notifications")){await window.craft.notifications.setBadge(Y);return}if(typeof navigator<"u"&&navigator.setAppBadge)try{await navigator.setAppBadge(Y)}catch{}},async clearBadge(){if(G("notifications")){await window.craft.notifications.clearBadge();return}if(typeof navigator<"u"&&navigator.clearAppBadge)try{await navigator.clearAppBadge()}catch{}},async requestPermission(){if(G("notifications"))return await window.craft.notifications.requestPermission();if(typeof window<"u"&&"Notification"in window){let Z=window.Notification;if(Z.permission==="granted")return!0;if(Z.permission==="denied")return!1;return await Z.requestPermission()==="granted"}return!1},async registerCategories(Z){if(!Array.isArray(Z)||Z.length===0)return;if(G("notifications")){let Y=window.craft.notifications.registerCategories;if(typeof Y==="function")await Y(Z)}},onActionClicked(Z){return U("craft:notification:actionClicked",Z)},onReply(Z){return U("craft:notification:reply",Z)}};function M8(Z){if(Z==null)return Date.now();if(Z instanceof Date)return Z.getTime();if(typeof Z==="number")return Z;let Y=Date.parse(Z);return Number.isNaN(Y)?Date.now():Y}var _8={async readFile(Z){let Y=await M("fs").readFile(Z);return Y&&Y.data||""},async readBuffer(Z){let Y=await M("fs").readFile(Z),$=Y&&Y.data||"";if(Y&&Y.base64===!0)return N8($);return new TextEncoder().encode($)},async writeFile(Z,Y){await M("fs").writeFile(Z,Y)},async writeBuffer(Z,Y){let $=T8(Y),J=M("fs");if(typeof J.writeFileBytes==="function")await J.writeFileBytes(Z,$);else await J.writeFile(Z,$)},async copy(Z,Y){if(Z===Y)throw Error("fs.copy: source and destination must differ");await M("fs").copy(Z,Y)},async move(Z,Y){if(Z===Y)throw Error("fs.move: source and destination must differ");await M("fs").move(Z,Y)},async appendFile(Z,Y){await M("fs").appendFile(Z,Y)},async deleteFile(Z){await M("fs").deleteFile(Z)},async exists(Z){return await M("fs").exists(Z)},async stat(Z){return E8(await M("fs").stat(Z))},async readDir(Z){let Y=await M("fs").readDir(Z),$=Y&&Y.entries||[],J=Z.endsWith("/")?Z.slice(0,-1):Z;return $.map((Q)=>({name:Q.name,path:`${J}/${Q.name}`,isDirectory:!!Q.isDirectory}))},async mkdir(Z,Y){await M("fs").mkdir(Z,Y)},async rmdir(Z,Y){await M("fs").rmdir(Z,Y)},async watch(Z,Y){await M("fs").watch(Z,Y)},async unwatch(Z){await M("fs").unwatch(Z)},onChange(Z){return U("craft:fs:change",Z)},async watchTree(Z,Y,$){let J=`watch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Q=M("fs");await Q.watch(Z,J,{recursive:!!Y.recursive});let X=Y.kinds&&Y.kinds.length>0?new Set(Y.kinds):null,R=Math.max(0,Math.floor(Y.coalesceMs??0)),z=[],K=null,F=!1,O=()=>{if(K=null,z.length===0)return;let j=z;z=[];try{$(j)}catch{}},V=U("craft:fs:change",(j)=>{if(F)return;if(j.id!==J)return;if(X&&j.kind&&!X.has(j.kind))return;if(z.push(j),R===0){O();return}if(K==null)K=setTimeout(O,R)});return{id:J,async stop(){if(F)return;if(F=!0,V(),K)clearTimeout(K),K=null;if(z.length>0)O();try{await Q.unwatch(J)}catch{}}}},async homeDir(){return await M("fs").homeDir()},async tempDir(){return await M("fs").tempDir()},async appDataDir(){return await M("fs").appDataDir()}};function T8(Z){let Y="";for(let $=0;$<Z.length;$++)Y+=String.fromCharCode(Z[$]);return typeof btoa==="function"?btoa(Y):Buffer.from(Z).toString("base64")}function N8(Z){let Y=typeof atob==="function"?atob(Z):Buffer.from(Z,"base64").toString("binary"),$=new Uint8Array(Y.length);for(let J=0;J<Y.length;J++)$[J]=Y.charCodeAt(J);return $}function E8(Z){return{isFile:!!Z.isFile,isDirectory:!!Z.isDirectory,isSymlink:!!Z.isSymlink,size:Number(Z.size)||0,modifiedAt:Z.modifiedAt!=null?Z.modifiedAt<1000000000000?Z.modifiedAt*1000:Z.modifiedAt:0}}var a=new Set,q4=!1;function A8(){if(q4)return;if(typeof window>"u"||typeof window.addEventListener!=="function")return;window.addEventListener("craft:shell:exit",(Z)=>{let Y=Z.detail;if(Y?.id)a.delete(Y.id)}),q4=!0}var k8=new Set(["javascript:","data:","file:","vbscript:"]),H8={async openExternal(Z){let Y=Z.trim().toLowerCase();for(let $ of k8)if(Y.startsWith($))throw Error(`shell.openExternal: ${$} URLs are blocked for safety`);if(G("shell")){await window.craft.shell.openExternal(Z);return}if(typeof window<"u"&&typeof window.open==="function")window.open(Z,"_blank","noopener,noreferrer")},async openPath(Z){await M("shell").openPath(Z)},async showInFinder(Z){await M("shell").showInFinder(Z)},async spawn(Z,Y,$=[],J={}){if(A8(),!Z||typeof Z!=="string")throw Error("shell.spawn: id must be a non-empty string");if(!Y||typeof Y!=="string")throw Error("shell.spawn: command must be a non-empty string");if(!Array.isArray($))throw Error("shell.spawn: args must be an array");for(let Q of $)if(typeof Q!=="string")throw Error("shell.spawn: args entries must be strings");if(a.has(Z))throw Error(`shell.spawn: id "${Z}" is already in use \u2014 call kill(id) first or pick a different id`);a.add(Z);try{await M("shell").spawn(Z,Y,$,J)}catch(Q){throw a.delete(Z),Q}},async kill(Z){await M("shell").kill(Z),a.delete(Z)},async getEnv(Z){if(G("shell")){let Y=await window.craft.shell.getEnv(Z);return Y==null?void 0:String(Y)}return},async setEnv(Z,Y){await M("shell").setEnv(Z,Y)},onStdout(Z){return U("craft:shell:stdout",Z)},onStderr(Z){return U("craft:shell:stderr",Z)},onExit(Z){return U("craft:shell:exit",Z)}};function u(){return window.craft.shortcuts}var x8={async register(Z,Y,$){if(!G("shortcuts"))return;await u().register(Z,Y,$)},async unregister(Z){if(!G("shortcuts"))return;await u().unregister(Z)},async unregisterAll(){if(!G("shortcuts"))return;await u().unregisterAll()},async enable(Z){if(!G("shortcuts"))return;await u().enable(Z)},async disable(Z){if(!G("shortcuts"))return;await u().disable(Z)},async isRegistered(Z){if(!G("shortcuts"))return!1;return await u().isRegistered(Z)},async list(){if(!G("shortcuts"))return[];return await u().list()},on(Z){return U("craft:shortcut",Z)}};var C8={get(){if(G("theme"))try{return window.craft.theme.get()}catch{}return{appearance:I8()}},onChange(Z){if(Z(this.get()),G("theme"))return U("craft:theme",Z);if(typeof window<"u"&&window.matchMedia){let Y=window.matchMedia("(prefers-color-scheme: dark)"),$=()=>Z({appearance:Y.matches?"dark":"light"});return Y.addEventListener("change",$),()=>Y.removeEventListener("change",$)}return()=>{}},async current(){return this.get()}};function I8(){if(typeof window>"u"||!window.matchMedia)return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}async function S8(Z,Y={}){if(!G("dragOut"))throw Error("dragOut requires a Craft native window");let $=Array.isArray(Z)?Z:[Z];if($.length===0)throw Error("dragOut: at least one path required");await window.craft.dragOut.start($,Y)}function w8(){return G("dragOut")}var B8={onUrl(Z){if(!G("deepLink"))return()=>{};return U("craft:deepLink",Z)},getInitialUrl(){if(typeof window>"u")return null;if(G("deepLink"))try{return window.craft.deepLink.getInitialUrl()}catch{return null}return window.__craftPendingDeepLink||null},consumeInitialUrl(){let Z=this.getInitialUrl();if(typeof window<"u")window.__craftPendingDeepLink=void 0;return Z},isAvailable(){return G("deepLink")}};var f8={async isCharging(){if(G("power"))return await window.craft.power.isCharging();let Z=await RZ();return Z?!!Z.charging:!1},async isPluggedIn(){if(G("power"))return await window.craft.power.isPluggedIn();let Z=await RZ();return Z?!!Z.charging||Z.level>=0.999:!1},async isLowPowerMode(){if(G("power"))return await window.craft.power.isLowPowerMode();return!1},async level(){if(G("power")){let Y=await window.craft.power.batteryLevel();return typeof Y==="number"?Y:null}let Z=await RZ();return Z?Z.level:null},async timeRemaining(){if(G("power")){let $=await window.craft.power.timeRemaining();return typeof $==="number"?$:null}let Z=await RZ();if(!Z)return null;let Y=Z.charging?Z.chargingTime:Z.dischargingTime;return Number.isFinite(Y)?Math.round(Y/60):null},async thermalState(){if(G("power"))return await window.craft.power.thermalState()||"unknown";return"unknown"},async uptimeSeconds(){if(G("power"))return await window.craft.power.uptimeSeconds();if(typeof performance<"u"&&typeof performance.now==="function")return Math.round(performance.now()/1000);return 0},async preventSleep(Z="app is busy"){if(G("power")){await window.craft.power.preventSleep(Z);return}if(typeof navigator>"u"||!navigator.wakeLock)return;let Y=window;if(Y.__craftWebWakeLock?.release){try{await Y.__craftWebWakeLock.release()}catch{}Y.__craftWebWakeLock=null}try{let $=await navigator.wakeLock.request("screen");Y.__craftWebWakeLock=$}catch{}},async allowSleep(){if(G("power")){await window.craft.power.allowSleep();return}let Z=window.__craftWebWakeLock;if(Z&&typeof Z.release==="function"){try{await Z.release()}catch{}window.__craftWebWakeLock=null}},onSleep(Z){return U("craft:powerSleep",Z)},onWake(Z){return U("craft:powerWake",Z)}};async function RZ(){if(typeof navigator>"u")return null;let Z=navigator;if(typeof Z.getBattery!=="function")return null;try{return await Z.getBattery()}catch{return null}}var v8={async connectionType(){if(G("network"))return await window.craft.network.connectionType();return U4()},async wifiSSID(){if(G("network"))return await window.craft.network.wifiSSID()||void 0;return},async wifiSignalStrength(){if(G("network")){let Z=await window.craft.network.wifiSignalStrength();return typeof Z==="number"?Z:void 0}return},async ipAddress(){if(G("network"))return await window.craft.network.ipAddress();return""},async macAddress(){if(G("network"))return await window.craft.network.macAddress();return""},async interfaces(){if(G("network"))return await window.craft.network.interfaces();return[]},async isVPNConnected(){if(G("network"))return await window.craft.network.isVPNConnected();return!1},async proxySettings(){if(G("network"))return await window.craft.network.proxySettings()||{};return{}},async openPreferences(){if(G("network"))await window.craft.network.openPreferences()},onChange(Z){if(G("network"))return U("craft:networkChange",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({type:U4(),online:!0}),$=()=>Z({type:"none",online:!1});return window.addEventListener("online",Y),window.addEventListener("offline",$),()=>{window.removeEventListener("online",Y),window.removeEventListener("offline",$)}}};function U4(){if(typeof navigator>"u")return"unknown";if(navigator.onLine===!1)return"none";let Z=navigator.connection;if(!Z)return"unknown";let Y=String(Z.type||Z.effectiveType||"unknown").toLowerCase();if(Y==="wifi"||Y==="cellular"||Y==="ethernet"||Y==="bluetooth"||Y==="none")return Y;return"unknown"}var y8={async checkForUpdates(){if(!G("updater"))return;await window.craft.updater.checkForUpdates()},async checkInBackground(){if(!G("updater"))return;await window.craft.updater.checkInBackground()},async setAutomaticChecks(Z){if(!G("updater"))return;await window.craft.updater.setAutomaticChecks(Z)},async setCheckInterval(Z){if(!G("updater"))return;if(!Number.isFinite(Z))throw Error("setCheckInterval: must be a finite number");let Y=Z<=0?0:Math.max(60,Math.round(Z));await window.craft.updater.setCheckInterval(Y)},async setFeedURL(Z){if(!G("updater"))return;await window.craft.updater.setFeedURL(Z)},async getLastUpdateCheckDate(){if(!G("updater"))return null;return await window.craft.updater.getLastUpdateCheckDate()||null},async getUpdateInfo(){if(!G("updater"))return null;let Z=await window.craft.updater.getUpdateInfo();if(!Z||typeof Z.version!=="string"||Z.version.length===0)return null;return Z},onAvailable(Z){return U("craft:updateAvailable",Z)},onDownloaded(Z){return U("craft:updateDownloaded",Z)},async verifySignature({payload:Z,signatureB64:Y,publicKeyB64:$}){let J=P4(Z),Q;try{Q=await crypto.subtle.importKey("raw",KZ($),{name:"Ed25519"},!1,["verify"])}catch{return!1}try{return await crypto.subtle.verify("Ed25519",Q,KZ(Y),J)}catch{return!1}},async verifyDownload({url:Z,signatureB64:Y,publicKeyB64:$,fetchInit:J}){let Q;try{Q=await fetch(Z,J)}catch{return{ok:!1,reason:"fetch-failed"}}if(!Q.ok)return{ok:!1,reason:"http-error",status:Q.status};let X=new Uint8Array(await Q.arrayBuffer()),R;try{R=await crypto.subtle.importKey("raw",KZ($),{name:"Ed25519"},!1,["verify"])}catch{return{ok:!1,reason:"bad-key"}}let z=!1;try{z=await crypto.subtle.verify("Ed25519",R,KZ(Y),P4(X))}catch{z=!1}if(!z)return{ok:!1,reason:"bad-signature"};return{ok:!0,payload:X}}};function P4(Z){if(Z instanceof ArrayBuffer)return new Uint8Array(Z);let Y=new ArrayBuffer(Z.byteLength),$=new Uint8Array(Y);return $.set(Z),$}function KZ(Z){if(typeof atob==="function"){let J=atob(Z),Q=new ArrayBuffer(J.length),X=new Uint8Array(Q);for(let R=0;R<J.length;R++)X[R]=J.charCodeAt(R);return X}let Y=Buffer.from(Z,"base64"),$=new ArrayBuffer(Y.length);return new Uint8Array($).set(Y),new Uint8Array($)}var g8={onFocus(Z){if(G("window"))return U("craft:window:focus",()=>Z());return EZ("focus",Z)},onBlur(Z){if(G("window"))return U("craft:window:blur",()=>Z());return EZ("blur",Z)},onResize(Z){if(G("window"))return U("craft:window:resize",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)},onMove(Z){if(G("window"))return U("craft:window:move",Z);return()=>{}},onClose(Z){if(G("window"))return U("craft:window:close",()=>Z());return EZ("beforeunload",Z)},onMinimize(Z){if(G("window"))return U("craft:window:minimize",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="hidden")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)},onRestore(Z){if(G("window"))return U("craft:window:restore",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="visible")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)}};function EZ(Z,Y){if(typeof window>"u")return()=>{};let $=()=>Y();return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var L4={name:"",version:"0.0.0"},b8={async hideDockIcon(){if(G("app"))await window.craft.app.hideDockIcon()},async showDockIcon(){if(G("app"))await window.craft.app.showDockIcon()},async quit(){if(G("app"))await window.craft.app.quit()},async getInfo(){if(!G("app"))return L4;let Z=await window.craft.app.getInfo();return{...L4,...Z||{}}},async notify(Z){if(!Z.title)throw Error("notify: title is required");if(G("app"))await window.craft.app.notify(Z)},async setBadge(Z){if(G("app"))await window.craft.app.setBadge(Z)},async bounce(Z="informational"){if(G("app"))await window.craft.app.bounce(Z)}};var u8={app(Z){return{label:Z,items:[{label:`About ${Z}`,role:"about"},{separator:!0},{label:`Hide ${Z}`,role:"hide",shortcut:"cmd+h"},{label:"Hide Others",role:"hideOthers",shortcut:"cmd+alt+h"},{label:"Show All",role:"showAll"},{separator:!0},{label:`Quit ${Z}`,role:"quit",shortcut:"cmd+q"}]}},edit(){return{label:"Edit",items:[{label:"Undo",role:"undo",shortcut:"cmd+z"},{label:"Redo",role:"redo",shortcut:"cmd+shift+z"},{separator:!0},{label:"Cut",role:"cut",shortcut:"cmd+x"},{label:"Copy",role:"copy",shortcut:"cmd+c"},{label:"Paste",role:"paste",shortcut:"cmd+v"},{label:"Select All",role:"selectAll",shortcut:"cmd+a"}]}},window(){return{label:"Window",items:[{label:"Minimize",role:"minimize",shortcut:"cmd+m"},{label:"Zoom",role:"zoom"},{separator:!0},{label:"Close Window",role:"close",shortcut:"cmd+w"}]}},leading(Z){return[this.app(Z),this.edit()]}},m8=0;function h8(Z){let Y=new Map;return{payload:{menus:Z.menus.map((J)=>({label:J.label,items:J.items.map((Q)=>{let{onClick:X,...R}=Q;if(R.separator)return R;let z=R.id??`stx.menu.${m8++}`;if(X)Y.set(z,X);return{...R,id:z}})}))},handlers:Y}}var AZ=null,c8={async set(Z){if(!G("menu"))return!1;let{payload:Y,handlers:$}=h8(Z);if(AZ?.(),AZ=null,$.size>0)AZ=U("craft:menu:action",(J)=>{$.get(J.id)?.()});return await window.craft.menu.set(Y),!0},async setDock(Z){if(G("menu"))await window.craft.menu.setDock(Z)},async addItem(Z,Y){if(G("menu"))await window.craft.menu.addItem(Z,Y)},async removeItem(Z){if(G("menu"))await window.craft.menu.removeItem(Z)},async enableItem(Z){if(G("menu"))await window.craft.menu.enableItem(Z)},async disableItem(Z){if(G("menu"))await window.craft.menu.disableItem(Z)},async checkItem(Z){if(G("menu"))await window.craft.menu.checkItem(Z)},async uncheckItem(Z){if(G("menu"))await window.craft.menu.uncheckItem(Z)},async setItemLabel(Z,Y){if(G("menu"))await window.craft.menu.setItemLabel(Z,Y)},async clearDock(){if(G("menu"))await window.craft.menu.clearDock()},onAction(Z){return U("craft:menu:action",Z)}};function W4(Z){if(Z.separator)return{id:Z.id||"",title:"",type:"separator"};return{id:Z.id||"",title:Z.title||"",icon:Z.icon,shortcut:Z.shortcut,enabled:Z.disabled?!1:void 0,submenu:Z.submenu?.map(W4)}}var p8={available(){return G("nativeUI")},async show(Z){if(!Z.items||Z.items.length===0)throw Error("contextMenu.show requires at least one item");if(!G("nativeUI"))return!1;return await window.craft.nativeUI.showContextMenu({targetId:Z.targetId||"",targetType:"general",x:Math.round(Z.x),y:Math.round(Z.y),items:Z.items.map(W4)}),!0},onAction(Z){return U("craft:menu:action",Z)}};var l8={accentColor:()=>x("system","accentColor",()=>""),highlightColor:()=>x("system","highlightColor",()=>""),language:()=>x("system","language",()=>{if(typeof navigator>"u")return"";return navigator.language?.split("-")[0]||""}),locale:()=>x("system","locale",()=>{if(typeof navigator>"u")return"";return navigator.language||""}),timezone:()=>x("system","timezone",()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}),is24HourTime:()=>x("system","is24HourTime",()=>{try{let Z=new Intl.DateTimeFormat([],{hour:"numeric"}).resolvedOptions();return Z.hourCycle==="h23"||Z.hourCycle==="h24"}catch{return!1}}),reduceMotion:()=>x("system","reduceMotion",()=>kZ("(prefers-reduced-motion: reduce)")),reduceTransparency:()=>x("system","reduceTransparency",()=>kZ("(prefers-reduced-transparency: reduce)")),increaseContrast:()=>x("system","increaseContrast",()=>kZ("(prefers-contrast: more)")),systemVersion:()=>x("system","systemVersion",()=>""),hostname:()=>x("system","hostname",()=>""),username:()=>x("system","username",()=>""),async openPreferences(){if(G("system"))await window.craft.system.openPreferences()}};async function x(Z,Y,$){if(G(Z))return await window.craft[Z][Y]();return await $()}function kZ(Z){if(typeof window>"u"||!window.matchMedia)return!1;return window.matchMedia(Z).matches}var d8={async getDisplays(){if(G("screen"))return await window.craft.screen.getDisplays();return D4()},async getPrimary(){if(G("screen")){let Z=await window.craft.screen.getPrimary();return Z&&typeof Z.width==="number"?Z:null}return D4()[0]??null},onChange(Z){if(G("screen"))return U("craft:screen:change",()=>Z());if(typeof window>"u")return()=>{};let Y=()=>Z();return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)}};function D4(){if(typeof window>"u"||!window.screen)return[];let Z=window.screen;return[{id:0,x:Z.left??0,y:Z.top??0,width:Z.width||0,height:Z.height||0,workX:Z.availLeft??0,workY:Z.availTop??0,workWidth:Z.availWidth??Z.width??0,workHeight:Z.availHeight??Z.height??0,scaleFactor:window.devicePixelRatio||1}]}var r8={async set(Z,Y,$){if(!Z)throw Error("keychain.set: service is required");if(!Y)throw Error("keychain.set: account is required");await M("keychain").set(Z,Y,$)},async get(Z,Y){if(!Z)throw Error("keychain.get: service is required");if(!Y)throw Error("keychain.get: account is required");let $=await M("keychain").get(Z,Y);return typeof $==="string"?$:null},async delete(Z,Y){if(!Z)throw Error("keychain.delete: service is required");if(!Y)throw Error("keychain.delete: account is required");await M("keychain").delete(Z,Y)},async has(Z,Y){if(!Z)throw Error("keychain.has: service is required");if(!Y)throw Error("keychain.has: account is required");return await M("keychain").has(Z,Y)}};var n8={async check(Z){if(G("permissions"))return await window.craft.permissions.check(Z);return await M4(Z)},async request(Z){if(G("permissions"))return await window.craft.permissions.request(Z);return await o8(Z)},async openSettings(Z){if(G("permissions"))await window.craft.permissions.openSettings(Z)}};async function M4(Z){if(typeof navigator>"u"||!navigator.permissions?.query)return"not-supported";try{let Y=await navigator.permissions.query({name:Z});return a8(Y.state)}catch{return"not-supported"}}async function o8(Z){if(Z==="notifications"&&typeof window<"u"&&"Notification"in window){let Y=await window.Notification.requestPermission();return Y==="granted"?"granted":Y==="denied"?"denied":"undetermined"}return await M4(Z)}function a8(Z){if(Z==="granted")return"granted";if(Z==="denied")return"denied";if(Z==="prompt")return"undetermined";return"undetermined"}var i8={async print(){if(G("printing")){await window.craft.printing.print();return}if(typeof window<"u"&&typeof window.print==="function")window.print()},async printToPDF(Z){if(!Z)throw Error("printToPDF: path is required");let Y=Z.startsWith("/"),$=/^[a-zA-Z]:[\\/]/.test(Z)||Z.startsWith("\\\\");if(!Y&&!$)throw Error("printToPDF: path must be absolute");let J=await M("printing").printToPDF(Z);return{ok:!!(J&&J.ok),path:J?.path}}};var s8={async enable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.enable()},async disable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.disable()},async isEnabled(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.isEnabled()}};function HZ(){if(!G("window"))return null;return window.craft.window}function f(Z){let Y=HZ();if(!Y)return Promise.resolve();try{return Promise.resolve(Z(Y)).then(()=>{return},()=>{return})}catch{return Promise.resolve()}}var t8={get available(){return HZ()!==null},open(Z){let Y=()=>{if(typeof window<"u"&&Z.url)window.open(Z.url,Z.name);return{name:Z.name}},$=HZ();if(!$?.open)return Promise.resolve(Y());return $.open(Z).then((J)=>({name:J?.name||Z.name})).catch(Y)},close:()=>f((Z)=>Z.close?.()),focus:()=>f((Z)=>Z.focus?.()),minimize:()=>f((Z)=>Z.minimize?.()),maximize:()=>f((Z)=>Z.maximize?.()),center:()=>f((Z)=>Z.center?.()),startDrag:()=>f((Z)=>Z.startDrag?.()),setTitle:(Z)=>f((Y)=>Y.setTitle?.(Z)),setSize:(Z,Y)=>f(($)=>$.setSize?.(Z,Y)),setAppearance:(Z)=>f((Y)=>Y.setAppearance?.(Z))};var e8={async addItem(Z){if(G("touchbar"))await window.craft.touchbar.addItem(Z)},async removeItem(Z){if(G("touchbar"))await window.craft.touchbar.removeItem(Z)},async updateItem(Z,Y){if(G("touchbar"))await window.craft.touchbar.updateItem(Z,Y)},async setLabel(Z,Y){if(G("touchbar"))await window.craft.touchbar.setLabel(Z,Y)},async setIcon(Z,Y){if(G("touchbar"))await window.craft.touchbar.setIcon(Z,Y)},async setEnabled(Z,Y){if(G("touchbar"))await window.craft.touchbar.setEnabled(Z,Y)},async setSliderValue(Z,Y){if(G("touchbar"))await window.craft.touchbar.setSliderValue(Z,Y)},async clear(){if(G("touchbar"))await window.craft.touchbar.clear()},async show(){if(G("touchbar"))await window.craft.touchbar.show()},async hide(){if(G("touchbar"))await window.craft.touchbar.hide()},onAction(Z){return U("craft:touchbar:action",Z)}};var Z9=/^[\da-f]*$/i;function Y9(Z,Y){if(typeof Y!=="string"||!Z9.test(Y)||Y.length%2!==0)throw Error(`${Z}: must be a hex string with even length, got ${JSON.stringify(Y)}`)}var $9={async isEnabled(){return G("bluetooth")?await window.craft.bluetooth.isEnabled():!1},async powerState(){return G("bluetooth")?await window.craft.bluetooth.powerState():"unknown"},async connectedDevices(){return G("bluetooth")?await window.craft.bluetooth.connectedDevices():[]},async pairedDevices(){return G("bluetooth")?await window.craft.bluetooth.pairedDevices():[]},async startDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.startDiscovery()},async stopDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.stopDiscovery()},async isDiscovering(){return G("bluetooth")?await window.craft.bluetooth.isDiscovering():!1},async connect(Z){if(G("bluetooth"))await window.craft.bluetooth.connect(Z)},async disconnect(Z){if(G("bluetooth"))await window.craft.bluetooth.disconnect(Z)},async openPreferences(){if(G("bluetooth"))await window.craft.bluetooth.openPreferences()},async discoverServices(Z){if(!Z)throw Error("bluetooth.discoverServices: deviceId is required");if(!G("bluetooth"))return[];let Y=await window.craft.bluetooth.discoverServices(Z);return Array.isArray(Y)?Y:[]},async discoverCharacteristics(Z,Y){if(!Z||!Y)throw Error("bluetooth.discoverCharacteristics: deviceId and serviceUuid are required");if(!G("bluetooth"))return[];let $=await window.craft.bluetooth.discoverCharacteristics(Z,Y);return Array.isArray($)?$:[]},async readCharacteristic(Z,Y,$){if(!Z||!Y||!$)throw Error("bluetooth.readCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.readCharacteristic(Z,Y,$)},async writeCharacteristic(Z,Y,$,J,Q="with-response"){if(!Z||!Y||!$)throw Error("bluetooth.writeCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(Y9("bluetooth.writeCharacteristic.valueHex",J),!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.writeCharacteristic(Z,Y,$,J,Q)},async setCharacteristicNotify(Z,Y,$,J){if(!Z||!Y||!$)throw Error("bluetooth.setCharacteristicNotify: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.setCharacteristicNotify(Z,Y,$,J)},onDeviceFound(Z){return U("craft:bluetooth:deviceFound",Z)},onDeviceConnected(Z){return U("craft:bluetooth:deviceConnected",Z)},onDeviceDisconnected(Z){return U("craft:bluetooth:deviceDisconnected",Z)},onCharacteristicValue(Z){return U("craft:bluetooth:characteristicValue",Z)}};var J9={async speak(Z,Y){if(!Z)throw Error("speech.speak: text is required");if(G("speech")){await window.craft.speech.speak(Z,Y);return}if(typeof window<"u"&&window.speechSynthesis){let $=new window.SpeechSynthesisUtterance(Z);if(Y){if(Y.rate!=null)$.rate=Y.rate;if(Y.pitch!=null)$.pitch=Y.pitch;if(Y.volume!=null)$.volume=Y.volume;if(Y.voice){let Q=window.speechSynthesis.getVoices().find((X)=>X.voiceURI===Y.voice||X.name===Y.voice||X.lang===Y.voice);if(Q)$.voice=Q}}window.speechSynthesis.speak($)}},async stop(){if(G("speech")){await window.craft.speech.stop();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.cancel()},async pause(){if(G("speech")){await window.craft.speech.pause();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.pause()},async resume(){if(G("speech")){await window.craft.speech.resume();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.resume()},async isSpeaking(){if(G("speech"))return await window.craft.speech.isSpeaking();if(typeof window<"u"&&window.speechSynthesis)return!!window.speechSynthesis.speaking;return!1},async getVoices(){if(G("speech"))return await window.craft.speech.getVoices();if(typeof window<"u"&&window.speechSynthesis)return window.speechSynthesis.getVoices().map((Y)=>({id:Y.voiceURI||Y.name,name:Y.name,language:Y.lang||"",quality:"default"}));return[]}};var i=[],xZ=!0,CZ,IZ,s={async report(Z){if(G("crashReporter")){await window.craft.crashReporter.report(Z);return}if(!xZ)return;let Y=Z instanceof Error?{timestamp:Date.now(),severity:"error",message:Z.message,source:"js",stack:Z.stack||"",userId:CZ,appVersion:IZ}:{timestamp:Date.now(),severity:Z.severity||"error",message:Z.message||"",source:Z.source||"js",stack:Z.stack||"",userId:CZ,appVersion:IZ};if(i.length>=64)i.shift();i.push(Y)},async flush(){if(G("crashReporter"))return await window.craft.crashReporter.flush();return[...i]},async clear(){if(G("crashReporter")){await window.craft.crashReporter.clear();return}i.length=0},async setEnabled(Z){if(G("crashReporter")){await window.craft.crashReporter.setEnabled(Z);return}xZ=Z},async isEnabled(){if(G("crashReporter"))return await window.craft.crashReporter.isEnabled();return xZ},async setUser(Z){if(G("crashReporter")){await window.craft.crashReporter.setUser(Z);return}CZ=Z||void 0},async setAppVersion(Z){if(G("crashReporter")){await window.craft.crashReporter.setAppVersion(Z);return}IZ=Z||void 0},attachGlobalHandlers(){if(G("crashReporter")&&window.craft.crashReporter.attachGlobalHandlers)return window.craft.crashReporter.attachGlobalHandlers();if(typeof window>"u")return()=>{};let Z=($)=>{s.report({severity:"error",message:$.message,source:"js",stack:$.error?.stack||`${$.message}
|
|
895
|
+
at ${$.filename}:${$.lineno}:${$.colno}`}).catch(()=>{})},Y=($)=>{let J=$.reason;s.report({severity:"error",message:J?.message||String(J),source:"js",stack:J?.stack||""}).catch(()=>{})};return window.addEventListener("error",Z),window.addEventListener("unhandledrejection",Y),()=>{window.removeEventListener("error",Z),window.removeEventListener("unhandledrejection",Y)}},forwardTo(Z){return K9(Z)}},G9="craft:crashReporter:pending",Q9=/[\w.+-]+@[\w-]+\.[\w.-]+/g,X9=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,z9=/\/(?:Users|home)\/[^\s/'"`]+/g;function T4(Z){let Y=($)=>$.replace(Q9,"<email>").replace(X9,"<ip>").replace(z9,"/<home>");return{...Z,message:Y(Z.message),stack:Y(Z.stack)}}async function N4(Z,Y){let $=new TextEncoder,J=await crypto.subtle.importKey("raw",$.encode(Z),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),Q=await crypto.subtle.sign("HMAC",J,$.encode(Y));return[...new Uint8Array(Q)].map((X)=>X.toString(16).padStart(2,"0")).join("")}function R9(Z){if(!Z||typeof localStorage>"u")return[];try{let Y=localStorage.getItem(Z);if(!Y)return[];let $=JSON.parse(Y);return Array.isArray($)?$:[]}catch{return[]}}function _4(Z,Y){if(!Z||typeof localStorage>"u")return;try{if(Y.length===0)localStorage.removeItem(Z);else localStorage.setItem(Z,JSON.stringify(Y))}catch{}}function K9(Z){let{endpoint:Y,intervalMs:$=60000,signingSecret:J,redact:Q=!0,headers:X={},maxRetries:R=5,persistKey:z}=Z,K=z===null?null:z??G9,F=R9(K),O=!1,V=null,j=null,P=typeof Q==="function"?Q:Q===!1?(N)=>N:T4;async function L(N){let E=JSON.stringify({entries:N}),S={"Content-Type":"application/json",...X};if(J)S["X-Craft-Signature"]=await N4(J,E);let e=0,w=1000;while(!O)try{let m=await fetch(Y,{method:"POST",headers:S,body:E});if(m.ok)return;if(m.status>=400&&m.status<500)return;throw Error(`HTTP ${m.status}`)}catch(m){if(e+=1,e>R)throw F=[...N,...F],_4(K,F),m;await new Promise((I4)=>{setTimeout(I4,w)}),w=Math.min(w*2,60000)}}async function T(){if(O||j)return j??void 0;let N=await s.flush();if(N.length>0)await s.clear();if(F=[...F,...N.map((S)=>P(S))],F.length===0)return;let E=F;return F=[],_4(K,F),j=L(E).catch(()=>{}).finally(()=>{j=null}),j}if($>0)V=setInterval(()=>{T().catch(()=>{})},$);return{async flushNow(){await T()},stop(){if(O=!0,V)clearInterval(V);V=null},pending(){return[...F]}}}var F9={async isAvailable(){if(!G("iap"))return!1;return await window.craft.iap.isAvailable()},async getProducts(Z){if(!G("iap"))return[];let Y=Array.isArray(Z)?Z:[String(Z)];return await window.craft.iap.getProducts(Y)},async purchase(Z){if(!G("iap"))return{queued:!1,productId:Z,reason:"IAP bridge not available"};let Y=await window.craft.iap.purchase(Z);return{queued:!!(Y&&Y.queued),productId:Y?.productId,reason:Y?.reason}},async restorePurchases(){if(!G("iap"))return{ok:!1};let Z=await window.craft.iap.restorePurchases();return{ok:!!(Z&&Z.ok)}},async finishTransaction(Z){if(!G("iap"))return;await window.craft.iap.finishTransaction(Z)},async getReceiptData(){if(!G("iap"))return null;let Z=await window.craft.iap.getReceiptData();return Z?String(Z):null},onPurchased(Z){return U("craft:iap:purchased",Z)},onFailed(Z){return U("craft:iap:failed",Z)},onRestored(Z){return U("craft:iap:restored",Z)},onProductsLoaded(Z){return U("craft:iap:productsLoaded",(Y)=>Z(Y.products||[]))},onRefunded(Z){return U("craft:iap:refunded",Z)},onSubscriptionStatusChanged(Z){return U("craft:iap:subscriptionStatusChanged",Z)},async getActiveSubscriptions(){if(!G("iap"))return[];let Z=window.craft.iap.getActiveSubscriptions;if(typeof Z!=="function")return[];let Y=await Z();return Array.isArray(Y)?Y:[]},async isEligibleForIntroOffer(Z){if(!G("iap"))return!1;let Y=window.craft.iap.isEligibleForIntroOffer;if(typeof Y!=="function")return!1;return!!await Y(Z)}};var t={async startActivity(Z,Y){if(!Z)throw Error("handoff.startActivity: type is required");if(!G("handoff"))return!1;let $=await window.craft.handoff.startActivity(Z,Y);return typeof $==="boolean"?$:!!($&&$.ok)},async updateActivity(Z){if(!G("handoff"))return!1;let Y=await window.craft.handoff.updateActivity(Z);return typeof Y==="boolean"?Y:!!(Y&&Y.ok)},async stopActivity(){if(!G("handoff"))return;await window.craft.handoff.stopActivity()},async getCurrentActivity(){if(!G("handoff"))return null;let Z=await window.craft.handoff.getCurrentActivity();return Z&&typeof Z.type==="string"?Z:null},onIncoming(Z){return U("craft:handoff:incoming",Z)}};var j9={async start(Z,Y){return t.startActivity(Z,{title:Y?.title,webpageURL:Y?.webpageURL,userInfo:Y?.state})},async update(Z){return t.updateActivity({title:Z.title,webpageURL:Z.webpageURL,userInfo:Z.state})},async stop(){await t.stopActivity()}};var O9={async requestPermission(Z="whenInUse"){if(G("location"))return await window.craft.location.requestPermission(Z);if(typeof navigator<"u"&&navigator.geolocation)return"undetermined";return"not-supported"},async getAuthorization(){if(G("location"))return await window.craft.location.getAuthorization();return"unknown"},async getCurrentLocation(){if(G("location"))return await window.craft.location.getCurrentLocation();if(typeof navigator<"u"&&navigator.geolocation)return navigator.geolocation.getCurrentPosition((Z)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:Z.coords.latitude,longitude:Z.coords.longitude,altitude:Z.coords.altitude,horizontalAccuracy:Z.coords.accuracy,verticalAccuracy:Z.coords.altitudeAccuracy,speed:Z.coords.speed}}))},(Z)=>{window.dispatchEvent(new CustomEvent("craft:location:error",{detail:{message:Z.message||String(Z)}}))}),{requested:!0};return{requested:!1}},async startWatching(Z){if(G("location"))return await window.craft.location.startWatching(Z);if(typeof navigator<"u"&&navigator.geolocation){let Y=navigator.geolocation.watchPosition(($)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:$.coords.latitude,longitude:$.coords.longitude,altitude:$.coords.altitude,horizontalAccuracy:$.coords.accuracy,verticalAccuracy:$.coords.altitudeAccuracy,speed:$.coords.speed}}))});return window.__craftWebLocationWatchId=Y,!0}return!1},async stopWatching(){if(G("location")){await window.craft.location.stopWatching();return}if(typeof navigator<"u"&&navigator.geolocation){let Z=window.__craftWebLocationWatchId;if(Z!=null)navigator.geolocation.clearWatch(Z),window.__craftWebLocationWatchId=null}},onUpdate(Z){return U("craft:location:update",Z)},onError(Z){return U("craft:location:error",Z)},onAuthChanged(Z){return U("craft:location:authChanged",Z)}};var V9={async captureScreen(){if(!G("screenCapture"))return null;let Z=await window.craft.screenCapture.captureScreen();return Z?String(Z):null},async captureWindow(Z){if(!G("screenCapture"))return null;if(!Number.isFinite(Z)||Z<=0)throw Error("captureWindow: id must be a positive number");let Y=await window.craft.screenCapture.captureWindow(Z);return Y?String(Y):null},async listWindows(){if(!G("screenCapture"))return[];return await window.craft.screenCapture.listWindows()}};var A4=250,k4=60000,SZ=2000,E4={sharing:!1,signals:{systemScreenShare:!1,remoteSession:!1,conferenceSharing:!1,screenRecording:!1},sources:[]};function q9(){return{...E4,signals:{...E4.signals},sources:[]}}var FZ={async getState(){if(!G("screenSharing"))return q9();return await window.craft.screenSharing.getState()},async watch(Z=SZ){let Y=Math.min(k4,Math.max(A4,Math.round(Z)));if(!G("screenSharing"))return Y;let $=await window.craft.screenSharing.watch(Y);return $&&$.intervalMs||Y},async stop(){if(!G("screenSharing"))return;await window.craft.screenSharing.unwatch()},onChange(Z){return U("craft:screenSharing:change",Z)}};async function U9(Z,Y=SZ){let $=FZ.onChange(Z);return await FZ.watch(Y),()=>{$(),FZ.stop()}}var P9={supported:!1,isFocused:null,authorization:"unsupported"};function H4(){return{ok:!1,error:"Focus control is only available in a Craft window on macOS"}}var wZ={async getStatus(){if(!G("focus"))return{...P9};return await window.craft.focus.getStatus()},async requestAuthorization(){if(!G("focus"))return"unsupported";return await window.craft.focus.requestAuthorization()},async setEnabled(Z,Y={}){if(!G("focus"))return H4();if(!(Z?Y.onShortcut:Y.offShortcut))return{ok:!1,error:`focus.setEnabled: no ${Z?"onShortcut":"offShortcut"} configured`};return await window.craft.focus.setEnabled(Z,Y)},async runShortcut(Z){if(!G("focus"))return H4();if(!Z)throw Error("focus.runShortcut: name is required");return await window.craft.focus.runShortcut(Z)},async listShortcuts(){if(!G("focus"))return[];return await window.craft.focus.listShortcuts()},async listShortcutsResult(){if(!G("focus"))return{canList:!1,shortcuts:[]};let Y=await window.craft.focus.listShortcutsResult?.();return{canList:Boolean(Y?.canList),shortcuts:Y?.shortcuts??[]}}};async function L9(...Z){if(Z.length===0)return!1;let Y=new Set(await wZ.listShortcuts());return Z.every(($)=>Y.has($))}async function W9(...Z){if(Z.length===0)return!1;let{canList:Y,shortcuts:$}=await wZ.listShortcutsResult();if(!Y)return"unknown";let J=new Set($);return Z.every((Q)=>J.has(Q))}var D9={async start(Z=0,Y="127.0.0.1"){if(!G("localServer"))return{port:0,started:!1,reason:"bridge unavailable"};return await window.craft.localServer.start(Z,Y)},async stop(){if(!G("localServer"))return;await window.craft.localServer.stop()},async respond(Z){if(!G("localServer"))return;await window.craft.localServer.respond(Z||{status:200,body:"OK"})},onRequest(Z){return U("craft:localServer:request",Z)},async awaitOAuthCallback(Z={}){M("localServer");let{port:Y=0,host:$="127.0.0.1",timeoutMs:J=300000,successHTML:Q}=Z,X=await this.start(Y,$);if(!X.started)throw Error(`localServer: start failed${X.reason?` \u2014 ${X.reason}`:""}`);return new Promise((R,z)=>{let K=setTimeout(()=>{F(),this.stop().catch(()=>{}),z(Error("localServer: OAuth callback timed out"))},J),F=this.onRequest(({url:O})=>{clearTimeout(K),F();let V=Q??`<!doctype html><meta charset="utf-8"><title>Done</title>
|
|
896
|
+
<style>body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f7}</style>
|
|
897
|
+
<div><h1>You can close this tab.</h1><p>Returning to the app\u2026</p></div>
|
|
898
|
+
<script>setTimeout(()=>window.close(),1500)</script>`;this.respond({status:200,body:V,contentType:"text/html; charset=utf-8"}).catch(()=>{}).finally(()=>this.stop().catch(()=>{})),R({url:O,port:X.port})})})}};var M9={async isAvailable(){if(!G("biometric"))return!1;return await window.craft.biometric.isAvailable()},async getBiometryType(){if(!G("biometric"))return"none";return await window.craft.biometric.getBiometryType()},async evaluate(Z,Y){if(!Z)throw Error("biometric.evaluate: reason is required");if(!G("biometric"))return{success:!1,errorCode:-1};return await window.craft.biometric.evaluate(Z,Y)}};var k=null,_9={async play(Z,Y){if(G("audio"))return await window.craft.audio.play(Z,Y);if(typeof window>"u"||typeof Audio>"u")return!1;if(k)k.pause(),k=null;if(k=new Audio(Z),Y?.volume!=null)k.volume=Y.volume;if(Y?.loops)k.loop=!0;try{return await k.play(),!0}catch{return!1}},async playSystemSound(Z){if(G("audio"))return await window.craft.audio.playSystemSound(Z);if(typeof window>"u"||typeof Audio>"u")return!1;try{return k=new Audio(`/System/Library/Sounds/${Z}.aiff`),await k.play(),!0}catch{return!1}},async stop(){if(G("audio")){await window.craft.audio.stop();return}if(k)k.pause(),k.currentTime=0,k=null},async isPlaying(){if(G("audio"))return await window.craft.audio.isPlaying();return!!(k&&!k.paused)},async startRecording(Z,Y){if(G("audio"))return await window.craft.audio.startRecording(Z,Y);return!1},async stopRecording(){if(G("audio"))await window.craft.audio.stopRecording()},async isRecording(){if(G("audio"))return await window.craft.audio.isRecording();return!1}};var T9={async execute(Z){if(!Z)throw Error("appleScript.execute: source is required");if(!G("appleScript"))return{ok:!1};return await window.craft.appleScript.execute(Z)}};var N9={async getDefault(Z){if(!Z)throw Error("fileAssociations.getDefault: uti is required");if(!G("fileAssociations"))return null;let Y=await window.craft.fileAssociations.getDefault(Z);return Y?String(Y):null},async setDefault(Z,Y){if(!Z||!Y)throw Error("fileAssociations.setDefault: uti and bundleId are required");if(!G("fileAssociations"))return!1;return await window.craft.fileAssociations.setDefault(Z,Y)}};var E9={async get(Z){if(!Z)throw Error("tags.get: path is required");if(!G("tags"))return[];return await window.craft.tags.get(Z)},async set(Z,Y){if(!Z)throw Error("tags.set: path is required");if(!G("tags"))return!1;let $=Array.isArray(Y)?Y:[String(Y)];return await window.craft.tags.set(Z,$)},async clear(Z){if(!Z)throw Error("tags.clear: path is required");if(!G("tags"))return!1;return await window.craft.tags.clear(Z)}};var A9={async countPages(Z){if(!Z)throw Error("pdf.countPages: path is required");if(!G("pdf"))return 0;return await window.craft.pdf.countPages(Z)},async extractText(Z){if(!Z)throw Error("pdf.extractText: path is required");if(!G("pdf"))return"";return await window.craft.pdf.extractText(Z)}};var k9={async debug(Z){if(G("log"))await window.craft.log.debug(Z);else console.debug(Z)},async info(Z){if(G("log"))await window.craft.log.info(Z);else console.info(Z)},async warn(Z){if(G("log"))await window.craft.log.warn(Z);else console.warn(Z)},async error(Z){if(G("log"))await window.craft.log.error(Z);else console.error(Z)}};var H9={async browse(Z){if(!G("bonjour"))return{started:!1,reason:"bridge unavailable"};return await window.craft.bonjour.browse(Z)},async stop(){if(G("bonjour"))await window.craft.bonjour.stop()},onFound(Z){return U("craft:bonjour:found",Z)},onLost(Z){return U("craft:bonjour:lost",Z)}};var x9={async index(Z){if(!G("spotlight"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.spotlight.index(Z)},async remove(Z){if(!G("spotlight"))return{ok:!1};return await window.craft.spotlight.remove(Z)},async removeAll(){if(!G("spotlight"))return{ok:!1};return await window.craft.spotlight.removeAll()}};var C9={async isAvailable(){if(!G("speechRecognition"))return!1;return await window.craft.speechRecognition.isAvailable()},async start(Z){if(!G("speechRecognition"))return{started:!1,reason:"bridge unavailable"};return await window.craft.speechRecognition.start(Z)},async stop(){if(G("speechRecognition"))await window.craft.speechRecognition.stop()},onPartial(Z){return U("craft:speechRecognition:partial",Z)},onFinal(Z){return U("craft:speechRecognition:final",Z)}};var I9={async recognizeText(Z){if(!Z)throw Error("vision.recognizeText: path is required");if(!G("vision"))return[];return await window.craft.vision.recognizeText(Z)},async detectFaces(Z){if(!Z)throw Error("vision.detectFaces: path is required");if(!G("vision"))return[];return await window.craft.vision.detectFaces(Z)},async detectBarcodes(Z){if(!Z)throw Error("vision.detectBarcodes: path is required");if(!G("vision"))return[];return await window.craft.vision.detectBarcodes(Z)}};var S9={async listSources(){if(!G("midi"))return[];return await window.craft.midi.listSources()},async listDestinations(){if(!G("midi"))return[];return await window.craft.midi.listDestinations()},async send(Z,Y){if(!G("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.send(Z,Y)},async subscribe(Z){if(!G("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.subscribe(Z)},async unsubscribe(Z){if(!G("midi"))return{ok:!1};return await window.craft.midi.unsubscribe(Z)},onMessage(Z){return U("craft:midi:message",Z)}};var w9={async loadModel(Z,Y){if(!Z||!Y)throw Error("coreml.loadModel: id and path are required");if(!G("coreml"))return!1;return await window.craft.coreml.loadModel(Z,Y)},async unloadModel(Z){if(!G("coreml"))return;await window.craft.coreml.unloadModel(Z)},async predict(Z,Y){if(!Z)throw Error("coreml.predict: id is required");if(!G("coreml"))return null;return await window.craft.coreml.predict(Z,Y)}};var B9={async listCameras(){if(!G("continuityCamera"))return[];return await window.craft.continuityCamera.listCameras()}};var f9={async register(Z){if(!Z)throw Error("serviceMenu.register: name is required");if(!G("serviceMenu"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serviceMenu.register(Z)},async unregister(Z){if(!Z)throw Error("serviceMenu.unregister: name is required");if(!G("serviceMenu"))return;await window.craft.serviceMenu.unregister(Z)},onInvoked(Z){return U("craft:serviceMenu:invoked",Z)}};var v9={async list(){if(!G("serial"))return[];return await window.craft.serial.list()},async open(Z,Y=9600){if(!Z)throw Error("serial.open: path is required");if(!G("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.open(Z,Y)},async write(Z,Y){if(!Z)throw Error("serial.write: id is required");if(!G("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.write(Z,Y)},async close(Z){if(!G("serial"))return;await window.craft.serial.close(Z)},onData(Z){return U("craft:serial:data",Z)}};var x4=[{name:"fs",support:"native"},{name:"shell",support:"native"},{name:"system",support:"all"},{name:"clipboard",support:"all"},{name:"dialog",support:"all"},{name:"window",support:"native"},{name:"tray",support:"native"},{name:"menu",support:"native"},{name:"theme",support:"all"},{name:"screen",support:"all"},{name:"network",support:"all"},{name:"power",support:"all"},{name:"battery",support:"all"},{name:"notifications",support:"all"},{name:"globalShortcuts",support:"native"},{name:"autolaunch",support:"native"},{name:"appInfo",support:"all"},{name:"localServer",support:"native"},{name:"bluetooth",support:"native"},{name:"crashReporter",support:"all"},{name:"updater",support:"native"},{name:"iap",support:"macos"},{name:"keychain",support:"native"},{name:"log",support:"all"},{name:"biometric",support:"macos"},{name:"location",support:"macos"},{name:"audio",support:"macos"},{name:"deepLink",support:"native"},{name:"handoff",support:"macos"},{name:"liveActivities",support:"macos"},{name:"touchbar",support:"macos"},{name:"dragOut",support:"macos"},{name:"appleScript",support:"macos"},{name:"fileAssociations",support:"native"},{name:"tags",support:"macos"},{name:"pdf",support:"macos"},{name:"bonjour",support:"macos"},{name:"spotlight",support:"macos"},{name:"speechRecognition",support:"macos"},{name:"vision",support:"macos"},{name:"midi",support:"macos"},{name:"coreml",support:"macos"},{name:"continuityCamera",support:"macos"},{name:"serviceMenu",support:"macos"},{name:"serial",support:"native"}];function y9(){return x4.map(({name:Z,support:Y})=>({name:Z,support:Y,available:G(Z)}))}function C4(Z){let Y=x4.find(($)=>$.name===Z);if(!Y)return;return{...Y,available:G(Z)}}function g9(Z){let Y=C4(Z);return!!Y&&Y.available}export{g8 as windowEvents,U9 as watchScreenSharing,I9 as vision,w6 as verifyBundleTrust,y8 as updater,j4 as unregisterHotkey,F8 as unregisterAllHotkeys,aY as triggerTrayAction,e8 as touchbar,C8 as theme,E9 as tags,l8 as system,S6 as swapBundle,u8 as standardMenus,x9 as spotlight,C9 as speechRecognition,J9 as speech,N4 as signPayload,u4 as showWarningToast,BY as showWarningModal,Q6 as showWarningDialog,d as showToast,b4 as showSuccessToast,vY as showSuccessModal,Z6 as showSaveDialog,gZ as showQuestionModal,eY as showOpenDialog,h as showModal,r as showMessageBox,g4 as showInfoToast,yZ as showInfoModal,m4 as showErrorToast,fY as showErrorModal,G6 as showErrorDialog,J6 as showConfirmDialog,Y6 as showColorPicker,$6 as showAlertDialog,OZ as showAlert,H8 as shell,j6 as setDesktopConfig,$8 as setAutoLaunch,f9 as serviceMenu,v9 as serial,FZ as screenSharing,V9 as screenCapture,d8 as screen,f6 as runningBundleTeamId,k6 as resolveCraftBinary,V6 as resetDesktopConfig,w4 as requestNotificationPermission,eZ as relaunchBundle,K8 as registerHotkey,T4 as redactPII,DZ as readBundleIdentity,tZ as quitLauncher,bY as prompt,i8 as printing,n8 as permissions,A9 as pdf,K4 as parseShortcut,E6 as packageApp,N6 as pack,D6 as openDevWindow,h4 as notify,D8 as notifications,v8 as network,t8 as nativeWindow,s8 as nativeAutoLaunch,S9 as midi,c8 as menu,k9 as log,O9 as location,D9 as localServer,j9 as liveActivities,r8 as keychain,_6 as isWebviewAvailable,w8 as isDragOutAvailable,g6 as isCaffeinated,g9 as isAvailable,J8 as isAutoLaunchEnabled,F9 as iap,L9 as hasFocusShortcuts,t as handoff,x8 as globalShortcuts,iZ as githubReleaseAssetUrl,aZ as githubLatestAssetUrl,T6 as getWindowBridgeScript,P6 as getWindow,oY as getTrayInstance,sY as getTrayBridgeScript,iY as getSimulatedTrayHTML,j8 as getRegisteredHotkeys,X6 as getDialogBridgeScript,O6 as getDesktopConfig,C4 as getCapability,y9 as getCapabilities,b6 as getCaffeinateStatus,U6 as getActiveWindowIds,nY as getActiveTrayInstances,uY as getActiveModalCount,l4 as getActiveAlertCount,nZ as generateUpdateManifest,_8 as fs,U8 as formatTime,Q8 as formatShortcut,u6 as formatRemainingTime,m6 as formatDuration,P8 as formatCompact,W9 as focusShortcutsReady,wZ as focus,N9 as fileAssociations,I6 as extractBundle,S8 as dragOut,p4 as dismissAllAlerts,c4 as dismissAlertById,q8 as delay,B8 as deepLinks,Y4 as decaffeinate,M6 as createWindowWithHTML,W6 as createWindow,kY as createWebView,DY as createTreeView,jY as createTooltip,O8 as createTimer,XY as createTimePicker,n4 as createTextInput,ZY as createTabs,WY as createTable,pZ as createSystemTray,UY as createStepper,VY as createSplitView,a4 as createSlider,v6 as createSelfUpdater,OY as createScrollView,$Y as createRating,JY as createRadioButton,i4 as createProgressBar,a6 as createPreferences,PY as createModalComponent,rY as createMenubar,NY as createMediaPlayer,LY as createListView,RY as createLabel,V8 as createInterval,KY as createImageView,sZ as createGitHubUpdater,B6 as createGitHubUpdateManifest,AY as createFileExplorer,YY as createDropdown,QY as createDatePicker,MY as createDataGrid,GY as createColorPicker,TY as createCodeEditor,FY as createChip,o4 as createCheckbox,_Y as createChart,e4 as createCard,r4 as createButton,s4 as createBadge,t4 as createAvatar,zY as createAutocomplete,qY as createAccordion,s as crashReporter,WZ as craftWindowArguments,A6 as craftBinaryNotFoundMessage,w9 as coreml,B9 as continuityCamera,p8 as contextMenu,yY as confirm,L6 as closeAllWindows,mY as closeAllModals,L8 as clipboard,C6 as clearQuarantine,x6 as canReplaceBundle,y6 as caffeinate,QZ as bundlePathForExecutable,H9 as bonjour,$9 as bluetooth,M9 as biometric,f8 as battery,_9 as audio,T9 as appleScript,b8 as appInfo,gY as alert,oZ as UPDATE_MANIFEST_ASSET,tY as TRAY_MENU_STYLES,d4 as TOAST_STYLES,hY as MODAL_STYLES,A4 as MIN_WATCH_INTERVAL_MS,k4 as MAX_WATCH_INTERVAL_MS,SZ as DEFAULT_WATCH_INTERVAL_MS,xY as COMPONENT_STYLES,rZ as AutoUpdater,HY as AVAILABLE_COMPONENTS};
|