@stacksjs/actions 0.70.44 → 0.70.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6x1m5rkr.js → chunk-4fz2qb8b.js} +1 -1
- package/dist/{chunk-wv5yb5wb.js → chunk-4p0rjazd.js} +2 -2
- package/dist/{chunk-tc935b45.js → chunk-77pta9ww.js} +1 -1
- package/dist/{chunk-aw6d8zr3.js → chunk-cqedfbaf.js} +1 -1
- package/dist/{chunk-h93n2j40.js → chunk-d5yxdz7e.js} +1 -1
- package/dist/{chunk-60qjz7zb.js → chunk-h0hfqr1p.js} +1 -1
- package/dist/{chunk-67y94dzt.js → chunk-h5rff0v9.js} +1 -1
- package/dist/chunk-jbvvb45k.js +3 -0
- package/dist/chunk-kr2k0h74.js +16 -0
- package/dist/chunk-s03z9zn3.js +920 -0
- package/dist/{chunk-n1y0gpv6.js → chunk-sxp97zys.js} +1 -1
- package/dist/{chunk-7bpdkc40.js → chunk-tzx3h4r8.js} +1 -1
- package/dist/{chunk-n2x7v39b.js → chunk-vek18p55.js} +1 -1
- package/dist/{chunk-wnrgcx3d.js → chunk-yh15ydty.js} +1 -1
- package/dist/{chunk-x471rxrn.js → chunk-yvva7qsg.js} +1 -1
- package/dist/{chunk-rdajkt2s.js → chunk-zaw01rqz.js} +1 -1
- package/dist/{chunk-schcaf73.js → chunk-zbhjh5sz.js} +1 -1
- package/dist/src/action.js +1 -1
- package/dist/src/actions.js +1 -1
- package/dist/src/add.js +1 -1
- package/dist/src/ai/request-model-access.js +1 -1
- package/dist/src/build.js +1 -1
- package/dist/src/commit.js +1 -1
- package/dist/src/deploy/index.js +2 -2
- package/dist/src/dev/api.js +1 -1
- package/dist/src/dev/dashboard-globals.js +1 -1
- package/dist/src/dev/dashboard-utils.js +1 -1
- package/dist/src/dev/dashboard.js +4 -4
- package/dist/src/dev/index.js +1 -1
- package/dist/src/dev/views.js +1 -1
- package/dist/src/discover-packages.js +1 -1
- package/dist/src/examples.js +1 -1
- package/dist/src/generate/component-meta.js +1 -1
- package/dist/src/generate/env-files.js +1 -1
- package/dist/src/generate/ide-helpers.js +1 -1
- package/dist/src/generate/index.js +1 -1
- package/dist/src/generate/lib-entries.js +1 -1
- package/dist/src/generate/vscode-custom-data.js +1 -1
- package/dist/src/helpers/component-meta.js +1 -1
- package/dist/src/helpers/index.js +1 -1
- package/dist/src/helpers/lib-entries.js +1 -1
- package/dist/src/helpers/package-json.js +1 -1
- package/dist/src/helpers/utils.js +1 -1
- package/dist/src/helpers/vscode-custom-data.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/make-command.js +1 -1
- package/dist/src/make-job.js +1 -1
- package/dist/src/make-policy.js +1 -1
- package/dist/src/make-resource.js +1 -1
- package/dist/src/make.js +1 -1
- package/dist/src/orm/base.js +1 -1
- package/dist/src/release.js +1 -1
- package/dist/src/run-action.js +1 -1
- package/dist/src/scaffold-crud.js +1 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/ssl.js +1 -1
- package/dist/src/stacks.js +1 -1
- package/dist/src/templates.js +1 -1
- package/dist/src/types.js +1 -1
- package/dist/src/upgrade/dependencies.js +1 -1
- package/dist/src/upgrade/framework-utils.js +1 -1
- package/dist/src/upgrade/framework.js +1 -1
- package/dist/src/upgrade/index.js +1 -1
- package/dist/src/upgrade.js +1 -1
- package/package.json +16 -16
- package/dist/chunk-96b7fcmd.js +0 -3
|
@@ -0,0 +1,920 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fb as v0,ib as j}from"./chunk-jbvvb45k.js";import{execFile as f0,spawn as m0}from"child_process";import{mkdtempSync as p0,readFileSync as c0,writeFileSync as d0}from"fs";import{tmpdir as l0}from"os";import{join as TJ}from"path";import{promisify as n0}from"util";import{existsSync as lJ}from"fs";import{exec as i0,spawn as e}from"child_process";import{chmodSync as o,copyFileSync as d,cpSync as o0,createWriteStream as a0,existsSync as NJ,mkdirSync as P,mkdtempSync as kJ,rmSync as l,writeFileSync as g}from"fs";import{homedir as t0,tmpdir as IJ}from"os";import{basename as e0,join as L}from"path";import{EventEmitter as F8}from"events";import{EventEmitter as T8}from"events";import{createReadStream as C0,createWriteStream as m$,existsSync as Z0,mkdirSync as X0,readFileSync as SJ,statSync as Y0,unlinkSync as p,writeFileSync as p$}from"fs";import{join as MJ,basename as c$,dirname as EJ}from"path";import{execFileSync as S,spawn as i}from"child_process";import{createHash as RJ}from"crypto";import{EventEmitter as d$}from"events";var h0=Object.defineProperty,u0=(J)=>J;function g0(J,$){this[J]=u0.bind(null,$)}var q0=(J,$)=>{for(var Z in $)h0(J,Z,{get:$[Z],enumerable:!0,configurable:!0,set:g0.bind($,Z)})};function s0(J){if(J){if(!lJ(J))throw Error(`Custom Craft binary path not found: ${J}`);return J}let $=typeof process<"u"?process.env.CRAFT_BIN:void 0;if($){if(!lJ($))throw Error(`CRAFT_BIN points to ${$}, which does not exist`);return $}return"craft"}function r0(J){return[`Craft native binary not found (tried "${J}").`,"","Craft ships through the pantry package registry. Install it with:",""," pantry install craft","","or, in a project, declare it in deps.yaml / pantry.jsonc and run"," pantry install","","See https://pantry.dev/quickstart for pantry installation instructions.","For monorepo development you can also point CRAFT_BIN at a local build."].join(`
|
|
3
|
+
`)}var OJ=null;async function J8(){if(!OJ){let J=await import("./chunk-kr2k0h74.js").then((m)=>v0(m.default,1));OJ=J.default??J}return OJ}async function $8(J){let $=[];if(!J.binaryPath||!NJ(J.binaryPath))throw Error(`Binary not found: ${J.binaryPath}`);let Z=J.platforms||[z0()],X=J.outDir||L(process.cwd(),"dist");if(!NJ(X))P(X,{recursive:!0});for(let Y of Z)switch(Y){case"macos":$.push(...await Z8(J,X));break;case"windows":$.push(...await X8(J,X));break;case"linux":$.push(...await Y8(J,X));break}return $}async function Z8(J,$){let Z=[],{name:X,version:Y,bundleId:Q=`com.myapp.${X.toLowerCase()}`}=J,q=J.macos||{},z=L($,`${X}.app`),H=Q8({name:X,version:Y,bundleId:Q,binaryPath:J.binaryPath,iconPath:J.iconPath,outputPath:z});if(!H.success)return Z.push({success:!1,platform:"macos",format:"app",error:H.error}),Z;if(q.dmg!==!1){let K=await G8({appBundlePath:z,outputPath:L($,`${X}-${Y}.dmg`),volumeName:X});Z.push({success:K.success,platform:"macos",format:"dmg",outputPath:K.outputPath,error:K.error})}if(q.pkg){let K=await U8({appBundlePath:z,outputPath:L($,`${X}-${Y}.pkg`),identifier:Q,version:Y});Z.push({success:K.success,platform:"macos",format:"pkg",outputPath:K.outputPath,error:K.error})}return Z}async function X8(J,$){let Z=[],{name:X,version:Y}=J,Q=J.windows||{};if(Q.msi!==!1){let q=await q8({name:X,version:Y,binaryPath:J.binaryPath,outputPath:L($,`${X}-${Y}.msi`),manufacturer:J.author||"Unknown"});Z.push({success:q.success,platform:"windows",format:"msi",outputPath:q.outputPath,error:q.error})}if(Q.zip||Q.msi===!1){let q=await z8({name:X,version:Y,binaryPath:J.binaryPath,outputPath:L($,`${X}-${Y}-windows.zip`)});Z.push({success:q.success,platform:"windows",format:"zip",outputPath:q.outputPath,error:q.error})}return Z}async function Y8(J,$){let Z=[],{name:X,version:Y}=J,Q=J.linux||{};if(Q.deb!==!1){let q=await K8({name:X,version:Y,binaryPath:J.binaryPath,outputPath:L($,`${X}_${Y}_amd64.deb`),description:J.description||"",maintainer:J.author||"Unknown",dependencies:Q.debDependencies||["libgtk-3-0","libwebkit2gtk-4.1-37"]});Z.push({success:q.success,platform:"linux",format:"deb",outputPath:q.outputPath,error:q.error})}if(Q.rpm){let q=await H8({name:X,version:Y,binaryPath:J.binaryPath,outputPath:L($,`${X}-${Y}-1.x86_64.rpm`),description:J.description||"",requires:Q.rpmDependencies||["gtk3","webkit2gtk3"]});Z.push({success:q.success,platform:"linux",format:"rpm",outputPath:q.outputPath,error:q.error})}if(Q.appImage){let q=await W8({name:X,version:Y,binaryPath:J.binaryPath,outputPath:L($,`${X}-${Y}-x86_64.AppImage`),iconPath:J.iconPath});Z.push({success:q.success,platform:"linux",format:"appimage",outputPath:q.outputPath,error:q.error})}return Z}function Q8(J){try{let{name:$,version:Z,bundleId:X,binaryPath:Y,outputPath:Q}=J;P(L(Q,"Contents","MacOS"),{recursive:!0}),P(L(Q,"Contents","Resources"),{recursive:!0}),d(Y,L(Q,"Contents","MacOS",$)),o(L(Q,"Contents","MacOS",$),493);let q=`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5
|
+
<plist version="1.0">
|
|
6
|
+
<dict>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>${$}</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>${X}</string>
|
|
11
|
+
<key>CFBundleName</key>
|
|
12
|
+
<string>${$}</string>
|
|
13
|
+
<key>CFBundleShortVersionString</key>
|
|
14
|
+
<string>${Z}</string>
|
|
15
|
+
<key>CFBundleVersion</key>
|
|
16
|
+
<string>${Z}</string>
|
|
17
|
+
<key>CFBundlePackageType</key>
|
|
18
|
+
<string>APPL</string>
|
|
19
|
+
<key>NSHighResolutionCapable</key>
|
|
20
|
+
<true/>
|
|
21
|
+
</dict>
|
|
22
|
+
</plist>`;return g(L(Q,"Contents","Info.plist"),q),{success:!0}}catch($){return{success:!1,error:$.message}}}async function G8(J){return new Promise(($)=>{if(!/^[^/:\n]{1,27}$/.test(J.volumeName)){$({success:!1,error:`Invalid DMG volume name "${J.volumeName}"; must be 1..27 chars without /, :, or newline`});return}let Z=e("hdiutil",["create","-volname",J.volumeName,"-srcfolder",J.appBundlePath,"-ov","-format","UDZO",J.outputPath]);Z.on("close",(X)=>{if(X===0)$({success:!0,outputPath:J.outputPath});else $({success:!1,error:`hdiutil exited with code ${X}`})}),Z.on("error",(X)=>{$({success:!1,error:X.message})})})}async function U8(J){return new Promise(($)=>{if(!/^[a-zA-Z0-9._-]+$/.test(J.identifier)||!J.identifier.includes(".")){$({success:!1,error:`Invalid pkg identifier "${J.identifier}"; expected reverse-DNS like com.example.app`});return}if(!/^[A-Za-z0-9._+-]+$/.test(J.version)){$({success:!1,error:`Invalid pkg version "${J.version}"`});return}let Z=kJ(L(IJ(),"craft-pkg-")),X=L(Z,"Applications");P(X,{recursive:!0}),o0(J.appBundlePath,L(X,e0(J.appBundlePath)),{recursive:!0});let Y=e("pkgbuild",["--root",Z,"--identifier",J.identifier,"--version",J.version,"--install-location","/",J.outputPath]);Y.on("close",(Q)=>{if(l(Z,{recursive:!0,force:!0}),Q===0)$({success:!0,outputPath:J.outputPath});else $({success:!1,error:`pkgbuild exited with code ${Q}`})}),Y.on("error",(Q)=>{l(Z,{recursive:!0,force:!0}),$({success:!1,error:Q.message})})})}async function q8(J){return new Promise(($)=>{i0("candle.exe -?",(Z)=>{if(Z)$({success:!1,error:"WiX Toolset not found. Install from https://wixtoolset.org/"});else $({success:!1,error:"MSI creation requires Windows platform and WiX Toolset"})})})}async function z8(J){let $=await J8();return new Promise((Z)=>{let X=a0(J.outputPath),Y=$("zip",{zlib:{level:9}}),Q=!1,q=(z)=>{if(Q)return;Q=!0,Z(z)};X.on("close",()=>{q({success:!0,outputPath:J.outputPath})}),X.on("error",(z)=>{q({success:!1,error:`Failed to write ZIP: ${z.message}`})}),Y.on("error",(z)=>{q({success:!1,error:z.message})}),Y.pipe(X),Y.file(J.binaryPath,{name:`${J.name}.exe`}),Y.finalize()})}async function K8(J){return new Promise(($)=>{try{let Z=J.name.toLowerCase(),X=/^[a-z0-9._+-]+$/,Y=/^[A-Za-z0-9._+-]+$/;if(!X.test(Z)){$({success:!1,error:`DEB package name must match ${X} (got: ${Z})`});return}if(!Y.test(J.version)){$({success:!1,error:`DEB version must match ${Y} (got: ${J.version})`});return}let Q=(I)=>I.replace(/[\r\n]+/g," ").trim(),q=Q(J.description),z=Q(J.maintainer);for(let I of J.dependencies)if(!/^[a-z0-9._+-]+(?:\s*\([^)\n,]+\))?$/i.test(I)){$({success:!1,error:`Invalid DEB dependency "${I}"`});return}let H=kJ(L(IJ(),"craft-deb-")),K=L(H,"DEBIAN"),V=L(H,"usr","bin"),R=L(H,"usr","share","applications");P(K,{recursive:!0}),P(V,{recursive:!0}),P(R,{recursive:!0});let F=Z;d(J.binaryPath,L(V,F)),o(L(V,F),493);let D=`Package: ${Z}
|
|
23
|
+
Version: ${J.version}
|
|
24
|
+
Section: utils
|
|
25
|
+
Priority: optional
|
|
26
|
+
Architecture: amd64
|
|
27
|
+
Depends: ${J.dependencies.join(", ")}
|
|
28
|
+
Maintainer: ${z}
|
|
29
|
+
Description: ${q||J.name}
|
|
30
|
+
`;g(L(K,"control"),D);let O=`[Desktop Entry]
|
|
31
|
+
Type=Application
|
|
32
|
+
Name=${J.name}
|
|
33
|
+
Exec=/usr/bin/${F}
|
|
34
|
+
Terminal=false
|
|
35
|
+
Categories=Utility;
|
|
36
|
+
`;g(L(R,`${F}.desktop`),O);let M=e("dpkg-deb",["--build",H,J.outputPath]);M.on("close",(I)=>{if(l(H,{recursive:!0,force:!0}),I===0)$({success:!0,outputPath:J.outputPath});else $({success:!1,error:`dpkg-deb exited with code ${I}`})}),M.on("error",(I)=>{l(H,{recursive:!0,force:!0}),$({success:!1,error:I.message})})}catch(Z){$({success:!1,error:Z.message})}})}async function H8(J){return new Promise(($)=>{try{let Z=L(t0(),"rpmbuild"),X=L(Z,"SPECS"),Y=L(Z,"SOURCES"),Q=L(Z,"BUILD"),q=L(Z,"RPMS");P(X,{recursive:!0}),P(Y,{recursive:!0}),P(Q,{recursive:!0}),P(q,{recursive:!0});let z=/^[a-z0-9._+-]+$/i,H=/^[A-Za-z0-9._+-]+$/,K=J.name.toLowerCase();if(!z.test(K))return $({success:!1,error:`RPM package name must match ${z} (got: ${K})`});if(!H.test(J.version))return $({success:!1,error:`RPM version must match ${H} (got: ${J.version})`});let R=((x)=>x.replace(/[\r\n]+/g," ").replace(/%/g,"%%"))(J.description||J.name),F=(J.description||J.name).split(/\r?\n/).map((x)=>x.replace(/%/g,"%%")).join(`
|
|
37
|
+
`),D=J.requires.map((x)=>{if(!z.test(x))throw Error(`RPM Requires entry must match ${z} (got: ${x})`);return x}).join(", ");d(J.binaryPath,L(Y,K));let O=`Name: ${K}
|
|
38
|
+
Version: ${J.version}
|
|
39
|
+
Release: 1%{?dist}
|
|
40
|
+
Summary: ${R}
|
|
41
|
+
License: MIT
|
|
42
|
+
Requires: ${D}
|
|
43
|
+
|
|
44
|
+
%description
|
|
45
|
+
${F}
|
|
46
|
+
|
|
47
|
+
%install
|
|
48
|
+
mkdir -p %{buildroot}/usr/bin
|
|
49
|
+
install -m 755 %{SOURCE0} %{buildroot}/usr/bin/${K}
|
|
50
|
+
|
|
51
|
+
%files
|
|
52
|
+
/usr/bin/${K}
|
|
53
|
+
`,M=L(X,`${J.name.toLowerCase()}.spec`);g(M,O);let I=e("rpmbuild",["-bb",M]);I.on("close",(x)=>{if(x===0){let XJ=`${J.name.toLowerCase()}-${J.version}-1.x86_64.rpm`,AJ=L(q,"x86_64",XJ);try{d(AJ,J.outputPath),$({success:!0,outputPath:J.outputPath})}catch{$({success:!1,error:"Failed to copy built RPM"})}}else $({success:!1,error:`rpmbuild exited with code ${x}`})}),I.on("error",(x)=>{$({success:!1,error:x.message})})}catch(Z){$({success:!1,error:Z.message})}})}async function W8(J){return new Promise(($)=>{try{let Z=kJ(L(IJ(),"craft-appimage-")),X=L(Z,`${J.name}.AppDir`),Y=L(X,"usr","bin"),Q=L(X,"usr","share");P(Y,{recursive:!0}),P(Q,{recursive:!0});let q=J.name.toLowerCase();d(J.binaryPath,L(Y,q)),o(L(Y,q),493);let z=`#!/bin/bash
|
|
54
|
+
SELF=$(readlink -f "$0")
|
|
55
|
+
HERE=\${SELF%/*}
|
|
56
|
+
export PATH="\${HERE}/usr/bin/:\${PATH}"
|
|
57
|
+
exec "\${HERE}/usr/bin/${q}" "$@"
|
|
58
|
+
`;g(L(X,"AppRun"),z),o(L(X,"AppRun"),493);let H=`[Desktop Entry]
|
|
59
|
+
Type=Application
|
|
60
|
+
Name=${J.name}
|
|
61
|
+
Exec=${q}
|
|
62
|
+
Terminal=false
|
|
63
|
+
Categories=Utility;
|
|
64
|
+
Icon=${q}
|
|
65
|
+
`;if(g(L(X,`${q}.desktop`),H),J.iconPath&&NJ(J.iconPath))d(J.iconPath,L(X,`${q}.png`));else{let V=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);g(L(X,`${q}.png`),V)}let K=e("appimagetool",[X,J.outputPath],{env:{...process.env,ARCH:"x86_64"}});K.on("close",(V)=>{if(l(Z,{recursive:!0,force:!0}),V===0)o(J.outputPath,493),$({success:!0,outputPath:J.outputPath});else $({success:!1,error:`appimagetool exited with code ${V}. Install from https://appimage.github.io/appimagetool/`})}),K.on("error",(V)=>{l(Z,{recursive:!0,force:!0}),$({success:!1,error:`appimagetool not found: ${V.message}`})})}catch(Z){$({success:!1,error:Z.message})}})}function z0(){switch(process.platform){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}async function UZ(J){return $8({...J,platforms:[z0()]})}class V8{backgroundAudio=null;toneFrequencies={bell:880,chime:1046.5,gong:440,gentle:523.25};async playTone(J,$=1.5){let Z=null;try{if(Z=new(window.AudioContext||window.webkitAudioContext),Z.state==="suspended"&&typeof Z.resume==="function")await Z.resume();let X=Z.createOscillator(),Y=Z.createGain();X.connect(Y),Y.connect(Z.destination),X.frequency.value=this.toneFrequencies[J],X.type="sine";let Q=Z.currentTime;Y.gain.setValueAtTime(0.3,Q),Y.gain.exponentialRampToValueAtTime(0.01,Q+$),X.start(Q),X.stop(Q+$),X.onended=()=>{Z.close().catch(()=>{})}}catch(X){throw console.error("Failed to play tone:",X),Z?.close().catch(()=>{}),X instanceof Error?X:Error(String(X))}}playBackgroundNoise(J,$=0.5){this.stopBackgroundNoise();try{let Z=new(window.AudioContext||window.webkitAudioContext),X=Z.createGain();switch(X.gain.value=$,J){case"whitenoise":this.generateWhiteNoise(Z,X);break;case"brownnoise":this.generateBrownNoise(Z,X);break;case"ocean":this.generateOceanWaves(Z,X);break;case"rain":this.generateRain(Z,X);break;case"forest":this.generateForest(Z,X);break}}catch(Z){console.error("Failed to generate background noise:",Z)}}stopBackgroundNoise(){if(this.backgroundAudio)try{if(this.backgroundAudio.source)this.backgroundAudio.source.stop();if(this.backgroundAudio.source2)this.backgroundAudio.source2.stop();if(this.backgroundAudio.context)this.backgroundAudio.context.close();this.backgroundAudio=null}catch(J){console.error("Failed to stop background noise:",J)}}setVolume(J){if(this.backgroundAudio&&this.backgroundAudio.gain)this.backgroundAudio.gain.gain.value=J}generateWhiteNoise(J,$){let Z=2*J.sampleRate,X=J.createBuffer(1,Z,J.sampleRate),Y=X.getChannelData(0);for(let q=0;q<Z;q++)Y[q]=Math.random()*2-1;let Q=J.createBufferSource();Q.buffer=X,Q.loop=!0,Q.connect($),$.connect(J.destination),Q.start(0),this.backgroundAudio={source:Q,context:J,gain:$}}generateBrownNoise(J,$){let Z=2*J.sampleRate,X=J.createBuffer(1,Z,J.sampleRate),Y=X.getChannelData(0),Q=0;for(let z=0;z<Z;z++){let H=Math.random()*2-1;Y[z]=(Q+0.02*H)/1.02,Q=Y[z],Y[z]*=3.5}let q=J.createBufferSource();q.buffer=X,q.loop=!0,q.connect($),$.connect(J.destination),q.start(0),this.backgroundAudio={source:q,context:J,gain:$}}generateOceanWaves(J,$){let Z=2*J.sampleRate,X=J.createBuffer(1,Z,J.sampleRate),Y=X.getChannelData(0),Q=0;for(let V=0;V<Z;V++){let R=Math.random()*2-1;Y[V]=(Q+0.02*R)/1.02,Q=Y[V],Y[V]*=2}let q=J.createBufferSource();q.buffer=X,q.loop=!0;let z=J.createBiquadFilter();z.type="lowpass",z.frequency.value=800,z.Q.value=1;let H=J.createOscillator();H.frequency.value=0.15;let K=J.createGain();K.gain.value=0.3,q.connect(z),z.connect($),H.connect(K),K.connect($.gain),$.connect(J.destination),q.start(0),H.start(0),this.backgroundAudio={source:q,source2:H,context:J,gain:$}}generateRain(J,$){let Z=2*J.sampleRate,X=J.createBuffer(1,Z,J.sampleRate),Y=X.getChannelData(0);for(let z=0;z<Z;z++){let H=Math.random()>0.98?2:1;Y[z]=(Math.random()*2-1)*H}let Q=J.createBufferSource();Q.buffer=X,Q.loop=!0;let q=J.createBiquadFilter();q.type="highpass",q.frequency.value=400,q.Q.value=0.5,Q.connect(q),q.connect($),$.connect(J.destination),Q.start(0),this.backgroundAudio={source:Q,context:J,gain:$}}generateForest(J,$){let Z=2*J.sampleRate,X=J.createBuffer(1,Z,J.sampleRate),Y=X.getChannelData(0),Q=0,q=0,z=0,H=0,K=0,V=0,R=0;for(let O=0;O<Z;O++){let M=Math.random()*2-1;Q=0.99886*Q+M*0.0555179,q=0.99332*q+M*0.0750759,z=0.969*z+M*0.153852,H=0.8665*H+M*0.3104856,K=0.55*K+M*0.5329522,V=-0.7616*V-M*0.016898,Y[O]=(Q+q+z+H+K+V+R+M*0.5362)*0.11,R=M*0.115926}let F=J.createBufferSource();F.buffer=X,F.loop=!0;let D=J.createBiquadFilter();D.type="bandpass",D.frequency.value=1200,D.Q.value=0.8,F.connect(D),D.connect($),$.connect(J.destination),F.start(0),this.backgroundAudio={source:F,context:J,gain:$}}}function qZ(){return typeof window<"u"&&!!window.craft}function K0(){if(typeof window>"u")return null;return window.craft??null}function zZ(){return K0()?.bridge?.call??null}function L8(J){return`${J} not available. Must run in Craft environment.`}function KZ(J){let $=K0();if(!$)throw Error(L8(J));return $}function _J(){return typeof globalThis<"u"&&typeof globalThis.localStorage<"u"}class R8{key;defaults;constructor(J,$){this.key=J,this.defaults=$}load(){if(!_J())return this.defaults;try{let J=localStorage.getItem(this.key);if(J){let $=JSON.parse(J);if(Array.isArray($)||Array.isArray(this.defaults))return $;if($!==null&&typeof $==="object"&&this.defaults!==null&&typeof this.defaults==="object")return{...this.defaults,...$};return $}}catch(J){console.error(`Failed to load ${this.key}:`,J)}return this.defaults}save(J){if(!_J())return;try{localStorage.setItem(this.key,JSON.stringify(J))}catch($){console.error(`Failed to save ${this.key}:`,$)}}update(J){let $=this.load();if($!==null&&typeof $==="object"&&!Array.isArray($)&&J!==null&&typeof J==="object"&&!Array.isArray(J)){this.save({...$,...J});return}this.save(J)}clear(){if(!_J())return;try{localStorage.removeItem(this.key)}catch(J){console.error(`Failed to clear ${this.key}:`,J)}}}class c{duration;onTick;onComplete;intervalId=null;timeRemaining=0;isRunning=!1;endAt=0;static now=()=>Date.now();constructor(J,$,Z){this.duration=J,this.onTick=$,this.onComplete=Z,this.timeRemaining=J}start(){if(this.isRunning)return;this.isRunning=!0,this.endAt=c.now()+this.timeRemaining*1000,this.intervalId=setInterval(()=>{let J=Math.max(0,this.endAt-c.now());if(this.timeRemaining=Math.ceil(J/1000),this.onTick(this.timeRemaining),this.timeRemaining<=0)this.pause(),this.onComplete?.()},250)}pause(){if(!this.isRunning)return;if(this.isRunning=!1,this.intervalId)clearInterval(this.intervalId),this.intervalId=null}reset(){this.pause(),this.timeRemaining=this.duration,this.endAt=c.now()+this.duration*1000,this.onTick(this.timeRemaining)}setDuration(J){if(this.duration=J,this.timeRemaining=J,this.isRunning)this.endAt=c.now()+J*1000}getTimeRemaining(){return this.timeRemaining}running(){return this.isRunning}static formatTime(J){let $=Math.max(0,Math.floor(J)),Z=Math.floor($/60),X=$%60;return`${Z}:${X.toString().padStart(2,"0")}`}static _setClockForTests(J){c.now=J??(()=>Date.now())}}function BJ(){let J=globalThis.crypto;if(J&&typeof J.randomUUID==="function")return J.randomUUID();if(J&&typeof J.getRandomValues==="function"){let $=new Uint8Array(16);J.getRandomValues($),$[6]=$[6]&15|64,$[8]=$[8]&63|128;let Z=Array.from($,(X)=>X.toString(16).padStart(2,"0")).join("");return`${Z.slice(0,8)}-${Z.slice(8,12)}-${Z.slice(12,16)}-${Z.slice(16,20)}-${Z.slice(20,32)}`}throw Error("[Craft] No Web Crypto available; cannot generate secure IDs")}var N={UNKNOWN:-1,TIMEOUT:-2,QUEUE_FULL:-3,BINARY_DISABLED:-4,EXPECTED_BINARY:-5,BRIDGE_DESTROYED:-6,BUSY:-7,PROTOCOL_MISMATCH:-8,DISCONNECTED:-9},DJ=1;function j8(J,$){return`${J}_${Date.now().toString(36)}_${$.toString(36)}`}class H0 extends F8{config;pendingRequests=new Map;offlineQueue=[];connected=!1;streams=new Map;batchBuffer=[];batchTimer=null;destroyed=!1;idPrefix=`msg-${BJ().slice(0,8)}`;idCounter=Math.floor(Math.random()*1e9);nextMessageId(){if(this.idCounter>=Number.MAX_SAFE_INTEGER-1)this.idCounter=Math.floor(Math.random()*1e9);return this.idCounter++,j8(this.idPrefix,this.idCounter)}boundHandleMessage=null;craftReadyHandler=null;constructor(J={}){super();this.setMaxListeners(100),this.config={timeout:30000,retries:3,retryDelay:1000,queueSize:1000,batchSize:10,batchDelay:50,enableOfflineQueue:!0,enableBinaryTransfer:!0,maxConcurrentRequests:1e4,parentOrigin:null,...J},this.setupBridge()}setupBridge(){if(typeof window>"u")return;if(this.boundHandleMessage=this.handleMessage.bind(this),window.addEventListener("message",this.boundHandleMessage),window.addEventListener("craft-bridge-message",this.boundHandleMessage),window.craft)Promise.resolve().then(()=>this.setConnected(!0));else this.craftReadyHandler=()=>{if(this.craftReadyHandler)window.removeEventListener("craft:ready",this.craftReadyHandler),this.craftReadyHandler=null;this.setConnected(!0)},window.addEventListener("craft:ready",this.craftReadyHandler,{once:!0})}teardownBridgeListeners(){if(typeof window>"u")return;if(this.boundHandleMessage)window.removeEventListener("message",this.boundHandleMessage),window.removeEventListener("craft-bridge-message",this.boundHandleMessage),this.boundHandleMessage=null;if(this.craftReadyHandler)window.removeEventListener("craft:ready",this.craftReadyHandler),this.craftReadyHandler=null}handleMessage(J){let $;try{$="detail"in J?J.detail:typeof J.data==="string"?JSON.parse(J.data):J.data}catch(Z){console.warn("[Craft Bridge] Failed to parse message:",Z);return}if(!$||!$.id)return;if($.type==="response"&&!this.isOwnId($.id))return;switch($.type){case"response":this.handleResponse($);break;case"event":this.handleEvent($);break;case"stream":this.handleStream($);break}}isOwnId(J){return typeof J==="string"&&J.startsWith(`${this.idPrefix}_`)}handleResponse(J){let $=this.pendingRequests.get(J.id);if(!$)return;if(clearTimeout($.timeout),this.pendingRequests.delete(J.id),J.error)$.reject(new E(J.error.message,J.error.code,J.error.data));else $.resolve(J.result)}handleEvent(J){if(J.method)this.emit(J.method,J.params)}handleStream(J){if(!J.streamId)return;let $=this.streams.get(J.streamId);if(!$)return;switch(J.streamEvent){case"data":$.onData(J.result);break;case"end":$.onEnd(),this.streams.delete(J.streamId);break;case"error":$.onError(Error(J.error?.message||"Stream error")),this.streams.delete(J.streamId);break}}async request(J,$,Z){return this.requestWithRetry(J,$,this.config.retries,Z?.timeout)}async requestWithRetry(J,$,Z,X){try{return await this.sendRequest(J,$,X)}catch(Y){if(Z>0&&this.isRetryableError(Y))return await this.delay(this.config.retryDelay),this.requestWithRetry(J,$,Z-1,X);throw Y}}isRetryableError(J){if(J instanceof E)return J.code===N.UNKNOWN||J.code===N.TIMEOUT;return!1}async sendRequest(J,$,Z){if(this.destroyed)throw new E("Bridge destroyed",N.BRIDGE_DESTROYED);if(this.pendingRequests.size>=this.config.maxConcurrentRequests)throw new E(`Bridge busy: ${this.pendingRequests.size} in-flight requests exceeds maxConcurrentRequests=${this.config.maxConcurrentRequests}`,N.BUSY);let X=Z??this.config.timeout,Y={id:this.nextMessageId(),type:"request",method:J,params:$};if(!this.connected&&this.config.enableOfflineQueue){if(this.offlineQueue.length>=this.config.queueSize)throw new E("Offline queue full",N.QUEUE_FULL);return this.offlineQueue.push(Y),new Promise((Q,q)=>{this.pendingRequests.set(Y.id,{resolve:Q,reject:q,timeout:setTimeout(()=>{this.pendingRequests.delete(Y.id);let z=this.offlineQueue.findIndex((H)=>H.id===Y.id);if(z>=0)this.offlineQueue.splice(z,1);q(new E("Request timeout (offline)",N.TIMEOUT))},X)})})}return new Promise((Q,q)=>{let z=setTimeout(()=>{this.pendingRequests.delete(Y.id),q(new E("Request timeout",N.TIMEOUT))},X);if(this.pendingRequests.set(Y.id,{resolve:Q,reject:q,timeout:z}),!this.send(Y))clearTimeout(z),this.pendingRequests.delete(Y.id),q(new E("No bridge transport available \u2014 not running inside a Craft host",N.UNKNOWN))})}async handshake(){let J=await this.request("_handshake",{sdkVersion:DJ});if(J?.version!==DJ)throw new E(`Bridge protocol mismatch: SDK speaks v${DJ}, native speaks v${J?.version??"unknown"}`,N.PROTOCOL_MISMATCH);return{nativeVersion:J.version}}notify(J,$){let Z={id:this.nextMessageId(),type:"request",method:J,params:$};this.send(Z)}stream(J,$,Z){let X=Z?.bufferLimit??1000,Y=this.nextMessageId(),Q={id:this.nextMessageId(),type:"request",method:J,params:$,streamId:Y},q=[],z=!1,H,K=!1,V=null,R=null,F=null,D={onData:(O)=>{V=O;while(q.length>0)O(q.shift())},onEnd:(O)=>{if(R=O,z)O()},onError:(O)=>{if(F=O,H)O(H)},cancel:()=>{if(K)return;if(K=!0,!this.streams.has(Y))return;this.streams.delete(Y),this.send({id:this.nextMessageId(),type:"request",method:"_cancelStream",params:{streamId:Y}})}};return this.streams.set(Y,{onData:(O)=>{if(V){V(O);return}if(q.length>=X){let M=new E(`Stream buffer overflow: ${q.length} events buffered with no consumer (limit=${X})`,N.BUSY);if(H=M,F)F(M);this.streams.delete(Y),this.send({id:this.nextMessageId(),type:"request",method:"_cancelStream",params:{streamId:Y}});return}q.push(O)},onEnd:()=>{if(z=!0,R)R()},onError:(O)=>{if(H=O,F)F(O)}}),this.send(Q),D}async sendBinary(J,$){if(!this.config.enableBinaryTransfer)throw new E("Binary transfer not enabled",N.BINARY_DISABLED);let Z=this.arrayBufferToBase64($ instanceof ArrayBuffer?new Uint8Array($):$);await this.request(J,{_binary:!0,data:Z})}async receiveBinary(J,$){if(!this.config.enableBinaryTransfer)throw new E("Binary transfer not enabled",N.BINARY_DISABLED);let Z=await this.request(J,$);if(Z._binary)return this.base64ToArrayBuffer(Z.data);throw new E("Expected binary response",N.EXPECTED_BINARY)}async batch(J){return this.request("_batch",{requests:J})}addToBatch(J,$){if(this.batchBuffer.push({id:this.nextMessageId(),type:"request",method:J,params:$}),this.batchBuffer.length>=this.config.batchSize)this.flushBatch();else if(!this.batchTimer)this.batchTimer=setTimeout(()=>this.flushBatch(),this.config.batchDelay)}flushBatch(){if(this.batchTimer)clearTimeout(this.batchTimer),this.batchTimer=null;if(this.destroyed){this.batchBuffer=[];return}if(this.batchBuffer.length===0)return;let J=this.batchBuffer;if(this.batchBuffer=[],!this.connected){if(this.config.enableOfflineQueue)for(let $ of J){if(this.offlineQueue.length>=this.config.queueSize)break;this.offlineQueue.push($)}return}this.send({id:this.nextMessageId(),type:"request",method:"_batch",params:{requests:J}})}setConnected(J){let $=this.connected;if(this.connected=J,J&&!$)this.emit("connected"),this.flushOfflineQueue();else if(!J&&$){this.emit("disconnected");for(let[Z,X]of this.pendingRequests)clearTimeout(X.timeout),X.reject(new E("Bridge disconnected",N.DISCONNECTED)),this.pendingRequests.delete(Z)}}flushOfflineQueue(){let J=this.offlineQueue;this.offlineQueue=[];for(let $ of J)this.send($)}send(J){let $;try{$=JSON.stringify(J)}catch(Z){return this.failPendingForMessage(J,new E(`Failed to serialize bridge message: ${Z.message}`,N.UNKNOWN,{originalError:String(Z)})),!1}try{if(typeof window<"u"){if(window.webkit?.messageHandlers?.craft)return window.webkit.messageHandlers.craft.postMessage(J),!0;if(window.CraftBridge)return window.CraftBridge.postMessage($),!0;if(window.craftIPC)return window.craftIPC.send("bridge-message",J),!0;if(window.parent!==window&&this.config.parentOrigin)return window.parent.postMessage(J,this.config.parentOrigin),!0}if(typeof process<"u"&&typeof process.send==="function")return process.send(J),!0;return!1}catch(Z){return this.failPendingForMessage(J,new E(`Bridge transport rejected the message: ${Z.message}`,N.UNKNOWN)),!1}}failPendingForMessage(J,$){let Z=this.pendingRequests.get(J.id);if(!Z)return;clearTimeout(Z.timeout),this.pendingRequests.delete(J.id),Z.reject($)}delay(J){return new Promise(($)=>setTimeout($,J))}arrayBufferToBase64(J){let $=[],Z=8192;for(let X=0;X<J.byteLength;X+=8192)$.push(String.fromCharCode(...J.subarray(X,X+8192)));return btoa($.join(""))}base64ToArrayBuffer(J){let $=atob(J),Z=new ArrayBuffer($.length),X=new Uint8Array(Z);for(let Y=0;Y<$.length;Y++)X[Y]=$.charCodeAt(Y);return Z}destroy(){if(this.destroyed)return;this.destroyed=!0;for(let[,J]of this.pendingRequests)clearTimeout(J.timeout),J.reject(new E("Bridge destroyed",N.BRIDGE_DESTROYED));if(this.pendingRequests.clear(),this.streams.clear(),this.offlineQueue=[],this.batchBuffer=[],this.batchTimer)clearTimeout(this.batchTimer),this.batchTimer=null;this.teardownBridgeListeners(),this.removeAllListeners()}}class E extends Error{code;data;constructor(J,$,Z){super(J);this.name="BridgeError",this.code=$,this.data=Z}}var YJ=null,QJ=null;function _(J){if(!YJ)return YJ=new H0(J),QJ=J??null,YJ;if(J&&QJ&&!A8(J,QJ))console.warn("[Craft Bridge] getBridge() ignored a follow-up config that differs from the "+"original \u2014 the singleton was already constructed. Use createBridge() for "+"independent instances, or call resetGlobalBridge() first.");else if(J&&!QJ)console.warn("[Craft Bridge] getBridge() ignored a follow-up config \u2014 singleton already "+"exists with no recorded config. Use createBridge() for independent instances.");return YJ}function A8(J,$){let Z=new Set([...Object.keys(J),...Object.keys($)]);for(let X of Z)if(J[X]!==$[X])return!1;return!0}var O8=30000;function W0(){if(typeof window>"u")return null;return window}function _8(){let J=W0();if(!J)return;if(J.__craftBridgePending=J.__craftBridgePending||{},!J.__craftBridgeResolve)J.__craftBridgeResolve=($,Z)=>{let X=J.__craftBridgePending[$];if(!X||X.length===0)return!1;return X.shift().resolve(Z),!0};if(!J.__craftBridgeReject)J.__craftBridgeReject=($,Z)=>{let X=J.__craftBridgePending[$];if(!X||X.length===0)return!1;return X.shift().reject(Z instanceof Error?Z:Error(String(Z))),!0}}function T(){return typeof window<"u"&&!!window.webkit?.messageHandlers?.craft}function wJ(J){if(!T())return!1;return window.webkit.messageHandlers.craft.postMessage(J),!0}function C(J,$,Z={}){if(!T())return Promise.reject(Error("No WKWebView host"));_8();let X=Z.timeoutMs??O8,Y=W0();return new Promise((Q,q)=>{let z=!1,H=Y.__craftBridgePending[J]=Y.__craftBridgePending[J]||[],K,V={resolve:(R)=>{if(z)return;z=!0,clearTimeout(K);let F=H.indexOf(V);if(F>=0)H.splice(F,1);Q(R)},reject:(R)=>{if(z)return;z=!0,clearTimeout(K);let F=H.indexOf(V);if(F>=0)H.splice(F,1);q(R)}};H.push(V),K=setTimeout(()=>{V.reject(Error(`[WKWebView] ${J} timed out after ${X}ms`))},X);try{window.webkit.messageHandlers.craft.postMessage($)}catch(R){V.reject(R)}})}class KJ{_id;_listeners=new Map;_closed=!1;_domListeners=[];constructor(J){this._id=J,this._setupEventListeners()}get id(){return this._id}get isClosed(){return this._closed}_setupEventListeners(){if(typeof nJ<"u")["show","hide","focus","blur","minimize","maximize","unmaximize","restore","resize","move","close","closed","enter-fullscreen","leave-fullscreen","ready-to-show"].forEach(($)=>{let Z=(Y)=>{if(Y.detail?.windowId===this._id||!Y.detail?.windowId)this._emit($,Y.detail?.data)},X=`craft:window:${$}`;globalThis.window.addEventListener(X,Z),this._domListeners.push({type:X,handler:Z})})}_cleanupEventListeners(){if(typeof nJ<"u"){for(let{type:J,handler:$}of this._domListeners)globalThis.window.removeEventListener(J,$);this._domListeners=[]}}_emit(J,$){let Z=this._listeners.get(J);if(Z)Z.forEach((X)=>X($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>{this._listeners.get(J)?.delete($)}}once(J,$){let Z=(X)=>{this._listeners.get(J)?.delete(Z),$(X)};return this.on(J,Z)}off(J,$){this._listeners.get(J)?.delete($)}async show(){await this._call("show")}async hide(){await this._call("hide")}async toggle(){await this._call("toggle")}async focus(){await this._call("focus")}async blur(){await this._call("blur")}async minimize(){await this._call("minimize")}async maximize(){await this._call("maximize")}async unmaximize(){await this._call("unmaximize")}async restore(){await this._call("restore")}async close(){await this._call("close"),this._closed=!0,this._cleanupEventListeners()}async destroy(){await this._call("destroy"),this._closed=!0,this._cleanupEventListeners()}async setFullscreen(J=!0){await this._call("setFullscreen",{fullscreen:J})}async toggleFullscreen(){await this._call("toggleFullscreen")}async setTitle(J){await this._call("setTitle",{title:J})}async getTitle(){return this._call("getTitle")}async setSize(J,$,Z){await this._call("setSize",{width:J,height:$,animate:Z})}async getSize(){return this._call("getSize")}async setMinimumSize(J,$){await this._call("setMinimumSize",{width:J,height:$})}async setMaximumSize(J,$){await this._call("setMaximumSize",{width:J,height:$})}async setPosition(J,$,Z){await this._call("setPosition",{x:J,y:$,animate:Z})}async getPosition(){return this._call("getPosition")}async setBounds(J,$){await this._call("setBounds",{...J,animate:$})}async getBounds(){return this._call("getBounds")}async center(){await this._call("center")}async setAlwaysOnTop(J,$){await this._call("setAlwaysOnTop",{alwaysOnTop:J,level:$})}async isAlwaysOnTop(){return this._call("isAlwaysOnTop")}async setResizable(J){await this._call("setResizable",{resizable:J})}async isResizable(){return this._call("isResizable")}async setMovable(J){await this._call("setMovable",{movable:J})}async isMovable(){return this._call("isMovable")}async setMinSize(J,$){await this._call("setMinSize",{width:J,height:$})}async setMaxSize(J,$){await this._call("setMaxSize",{width:J,height:$})}async setOpacity(J){await this._call("setOpacity",{opacity:Math.max(0,Math.min(1,J))})}async getOpacity(){return this._call("getOpacity")}async setBackgroundColor(J){await this._call("setBackgroundColor",{color:J})}async getState(){return this._call("getState")}async setVibrancy(J){await this._call("setVibrancy",{vibrancy:J})}async setTrafficLightPosition(J){await this._call("setTrafficLightPosition",J)}async setWindowLevel(J){await this._call("setWindowLevel",{level:J})}async setHasShadow(J){await this._call("setHasShadow",{hasShadow:J})}async setBackgroundMaterial(J){await this._call("setBackgroundMaterial",{material:J})}async flashFrame(J){await this._call("flashFrame",{flash:J})}async setOverlayIcon(J,$){await this._call("setOverlayIcon",{icon:J,description:$})}async loadHTML(J){await this._call("loadHTML",{html:J})}async loadURL(J){await this._call("loadURL",{url:J})}async reload(){await this._call("reload")}async executeJavaScript(J){return this._call("executeJavaScript",{code:J})}async _call(J,$){if(T())return C(`window.${J}`,{type:"window",action:J,windowId:this._id,data:$});return _().request(`window.${J}`,{windowId:this._id,...$})}}class V0{_windows=new Map;_currentWindow=null;_idCounter=0;constructor(){if(typeof globalThis.window<"u")this._currentWindow=new KJ("main"),this._windows.set("main",this._currentWindow)}get current(){if(!this._currentWindow)this._currentWindow=new KJ("main"),this._windows.set("main",this._currentWindow);return this._currentWindow}get all(){return Array.from(this._windows.values())}get(J){return this._windows.get(J)}async create(J={}){let $=`window_${++this._idCounter}_${Date.now()}`;await _().request("window.create",{id:$,...J});let X=new KJ($);return this._windows.set($,X),X}async getFocused(){let $=await _().request("window.getFocused");return $?this._windows.get($)||null:null}show=()=>this.current.show();hide=()=>this.current.hide();toggle=()=>this.current.toggle();minimize=()=>this.current.minimize();maximize=()=>this.current.maximize();close=()=>this.current.close();focus=()=>this.current.focus();center=()=>this.current.center();setFullscreen=(J)=>this.current.setFullscreen(J);toggleFullscreen=()=>this.current.toggleFullscreen();setTitle=(J)=>this.current.setTitle(J);setSize=(J,$,Z)=>this.current.setSize(J,$,Z);setPosition=(J,$,Z)=>this.current.setPosition(J,$,Z);setBounds=(J,$)=>this.current.setBounds(J,$);setAlwaysOnTop=(J)=>this.current.setAlwaysOnTop(J);setOpacity=(J)=>this.current.setOpacity(J);setBackgroundColor=(J)=>this.current.setBackgroundColor(J);setVibrancy=(J)=>this.current.setVibrancy(J);setResizable=(J)=>this.current.setResizable(J);getState=()=>this.current.getState();on=(J,$)=>this.current.on(J,$);once=(J,$)=>this.current.once(J,$)}var PJ=new V0,WZ=PJ,nJ=PJ;function VZ(J={},$={}){let Z=typeof J==="string"?{...$,html:J}:J;return PJ.create(Z)}class WJ{_id;_options;_listeners=new Map;_menuHandlers=new Map;_destroyed=!1;_domListeners=[];constructor(J,$={}){this._id=J,this._options=$,this._setupEventListeners()}get id(){return this._id}get isDestroyed(){return this._destroyed}_isForThisTray(J){if(!J)return!0;let $=J.trayId??J.id;if($===void 0||$===null)return!0;return $===this._id}_addDomListener(J,$){if(typeof window>"u")return;window.addEventListener(J,$),this._domListeners.push({type:J,handler:$})}_setupEventListeners(){if(typeof window<"u")this._addDomListener("craft:tray:click",(J)=>{if(this._isForThisTray(J.detail))this._emit("click",J.detail)}),this._addDomListener("craft:tray:rightClick",(J)=>{if(this._isForThisTray(J.detail))this._emit("right-click",J.detail)}),this._addDomListener("craft:tray:doubleClick",(J)=>{if(this._isForThisTray(J.detail))this._emit("double-click",J.detail)}),this._addDomListener("craft:tray:menuAction",(J)=>{if(!this._isForThisTray(J.detail))return;let $=J.detail?.action;this._emit("menu-click",{menuId:$,action:$});let Z=this._menuHandlers.get($);if(Z)Z()}),this._addDomListener("craft:tray:dropFiles",(J)=>{if(this._isForThisTray(J.detail))this._emit("drop-files",{files:J.detail?.files||[]})}),this._addDomListener("craft:tray:dropText",(J)=>{if(this._isForThisTray(J.detail))this._emit("drop-text",{text:J.detail?.text||""})})}_teardownDomListeners(){if(typeof window>"u")return;for(let{type:J,handler:$}of this._domListeners)window.removeEventListener(J,$);this._domListeners=[]}_emit(J,$){let Z=this._listeners.get(J);if(Z)Z.forEach((X)=>X($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>{this._listeners.get(J)?.delete($)}}once(J,$){let Z=(X)=>{this._listeners.get(J)?.delete(Z),$(X)};return this.on(J,Z)}off(J,$){this._listeners.get(J)?.delete($)}async setTitle(J){this._options.title=J,await this._call("setTitle",J)}getTitle(){return this._options.title||""}async setIcon(J){this._options.icon=J,await this._call("setIcon",J)}async setTooltip(J){this._options.tooltip=J,await this._call("setTooltip",J)}async setMenu(J){this._options.menu=J;let $=(X)=>{return X.map((Y,Q)=>{let q={...Y};if(!q.id&&q.label)q.id=`menu_${Q}_${Date.now()}`;if(q.submenu)q.submenu=$(q.submenu);return q})},Z=$(J);await this._call("setMenu",JSON.stringify(Z))}async updateMenuItem(J,$){await this._call("updateMenuItem",JSON.stringify({id:J,updates:$}))}onMenuAction(J,$){return this._menuHandlers.set(J,$),()=>{this._menuHandlers.delete(J)}}async show(){await this._call("show","")}async hide(){await this._call("hide","")}async setHighlightMode(J){await this._call("setHighlightMode",J)}async displayBalloon(J){await this._call("displayBalloon",JSON.stringify(J))}async removeBalloon(){await this._call("removeBalloon","")}async getBounds(){return this._call("getBounds","")}async destroy(){await this._call("destroy",""),this._destroyed=!0,this._listeners.clear(),this._menuHandlers.clear(),this._teardownDomListeners()}onClickShowWindow(){return this.on("click",()=>{if(typeof window<"u"&&window.craft?.window?.show)window.craft.window.show()})}onClickToggleWindow(){return this.on("click",()=>{if(typeof window<"u"&&window.craft?.window?.toggle)window.craft.window.toggle()})}async _call(J,$){if(typeof window<"u"&&window.webkit?.messageHandlers?.craft)return new Promise((X,Y)=>{try{window.webkit.messageHandlers.craft.postMessage({type:"tray",action:J,data:typeof $==="string"?$:JSON.stringify($)}),X(void 0)}catch(Q){Y(Q)}});return _().request(`tray.${J}`,{data:$})}}class L0{_tray;_config;_windowVisible=!1;constructor(J={}){this._config={showWindowOnClick:!0,windowWidth:320,windowHeight:400,windowPosition:"trayBottomCenter",hideDockIcon:!0,...J},this._tray=new WJ("menubar",{title:J.title,icon:J.icon,tooltip:J.tooltip,menu:J.menu}),this._setupBehavior()}get tray(){return this._tray}get isWindowVisible(){return this._windowVisible}_setupBehavior(){if(this._config.showWindowOnClick)this._tray.on("click",()=>{this.toggleWindow()});if(this._config.hideDockIcon)this._hideDockIcon()}async _hideDockIcon(){if(typeof window<"u"&&window.craft?.app?.hideDockIcon)await window.craft.app.hideDockIcon()}async showWindow(){if(typeof window<"u"&&window.craft?.window?.show)await window.craft.window.show(),this._windowVisible=!0}async hideWindow(){if(typeof window<"u"&&window.craft?.window?.hide)await window.craft.window.hide(),this._windowVisible=!1}async toggleWindow(){if(this._windowVisible)await this.hideWindow();else await this.showWindow()}setTitle(J){return this._tray.setTitle(J)}setIcon(J){return this._tray.setIcon(J)}setMenu(J){return this._tray.setMenu(J)}onMenuAction(J,$){return this._tray.onMenuAction(J,$)}async quit(){if(typeof window<"u"&&window.craft?.app?.quit)await window.craft.app.quit()}}class R0{_trays=new Map;_mainTray=null;get main(){if(!this._mainTray)this._mainTray=new WJ("main"),this._trays.set("main",this._mainTray);return this._mainTray}create(J,$={}){let Z=new WJ(J,$);if(this._trays.set(J,Z),!this._mainTray)this._mainTray=Z;return Z}get(J){return this._trays.get(J)}async destroy(J){let $=this._trays.get(J);if($){if(await $.destroy(),this._trays.delete(J),this._mainTray?.id===J)this._mainTray=null}}async destroyAll(){for(let J of this._trays.values())await J.destroy();this._trays.clear(),this._mainTray=null}setTitle=(J)=>this.main.setTitle(J);setIcon=(J)=>this.main.setIcon(J);setTooltip=(J)=>this.main.setTooltip(J);setMenu=(J)=>this.main.setMenu(J);onMenuAction=(J,$)=>this.main.onMenuAction(J,$);onClick=(J)=>this.main.on("click",J);onRightClick=(J)=>this.main.on("right-click",J);onClickToggleWindow=()=>this.main.onClickToggleWindow()}var D8=new R0,LZ=D8;function RZ(J){return new L0(J)}function FZ(...J){return J}function jZ(){return{type:"separator"}}function AZ(J,$={}){return{label:J,type:"normal",...$}}function OZ(J,$,Z={}){return{label:J,type:"checkbox",checked:$,...Z}}function _Z(J,$,Z={}){return{label:J,type:"submenu",submenu:$,...Z}}class F0{_listeners=new Map;_shortcuts=new Map;_info=null;_preferences=null;_domListeners=[];_mediaQuery=null;_mediaQueryHandler=null;constructor(){this._setupEventListeners()}_addDomListener(J,$){if(typeof window>"u")return;window.addEventListener(J,$),this._domListeners.push({type:J,handler:$})}destroy(){if(typeof window<"u"){for(let{type:J,handler:$}of this._domListeners)window.removeEventListener(J,$);if(this._domListeners=[],this._mediaQuery&&this._mediaQueryHandler)this._mediaQuery.removeEventListener("change",this._mediaQueryHandler),this._mediaQuery=null,this._mediaQueryHandler=null}this._listeners.clear(),this._shortcuts.clear(),this._info=null,this._preferences=null}_setupEventListeners(){if(typeof window<"u"){["ready","activate","deactivate","will-quit","quit","before-quit","window-all-closed","open-file","open-url","theme-changed","accent-color-changed","display-added","display-removed","display-metrics-changed","power-suspend","power-resume","power-on-ac","power-on-battery","lock-screen","unlock-screen","user-did-become-active","user-did-resign-active"].forEach((Z)=>{let X=(Y)=>{if(Z==="theme-changed"||Z==="accent-color-changed"||Z==="display-added"||Z==="display-removed"||Z==="display-metrics-changed")this._preferences=null;this._emit(Z,Y.detail)};this._addDomListener(`craft:app:${Z}`,X)});let $=(Z)=>{let X=Z.detail?.accelerator,Y=this._shortcuts.get(X);if(Y)Y()};if(this._addDomListener("craft:shortcut",$),window.matchMedia)this._mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._mediaQueryHandler=(Z)=>{this._preferences=null,this._emit("theme-changed",{theme:Z.matches?"dark":"light"})},this._mediaQuery.addEventListener("change",this._mediaQueryHandler)}}_emit(J,$){let Z=this._listeners.get(J);if(Z)Z.forEach((X)=>X($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>{this._listeners.get(J)?.delete($)}}once(J,$){let Z=(X)=>{this._listeners.get(J)?.delete(Z),$(X)};return this.on(J,Z)}off(J,$){this._listeners.get(J)?.delete($)}async quit(){await this._call("quit")}async exit(J=0){await this._call("exit",{code:J})}async relaunch(J){await this._call("relaunch",J)}async hide(){await this._call("hide")}async show(){await this._call("show")}async focus(){await this._call("focus")}async hideDockIcon(){await this._call("hideDockIcon")}async showDockIcon(){await this._call("showDockIcon")}async setBadge(J){await this._call("setBadge",{badge:J?.toString()??""})}async getBadge(){return this._call("getBadge")}async bounce(J="informational"){return this._call("bounce",{type:J})}async cancelBounce(J){await this._call("cancelBounce",{id:J})}async setDockIcon(J){await this._call("setDockIcon",{icon:J})}async getInfo(){if(!this._info)this._info=await this._call("getInfo");return this._info}async getName(){return(await this.getInfo()).name}async getVersion(){return(await this.getInfo()).version}async getAppPath(){return(await this.getInfo()).appPath}async getPath(J){return this._call("getPath",{name:J})}async getSystemPreferences(){if(!this._preferences)this._preferences=await this._call("getSystemPreferences");return this._preferences}async isDarkMode(){if(typeof window<"u"&&window.matchMedia)return window.matchMedia("(prefers-color-scheme: dark)").matches;return(await this.getSystemPreferences()).isDarkMode}async getAccentColor(){return(await this.getSystemPreferences()).accentColor}async isReducedMotion(){if(typeof window<"u"&&window.matchMedia)return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return(await this.getSystemPreferences()).reducedMotion}async getLocale(){if(typeof navigator<"u")return navigator.language||"en-US";return(await this.getSystemPreferences()).locale}async getDisplays(){return this._call("getDisplays")}async getPrimaryDisplay(){return this._call("getPrimaryDisplay")}async getDisplayAtPoint(J,$){return this._call("getDisplayAtPoint",{x:J,y:$})}async notify(J){await this._call("notify",J)}async isNotificationSupported(){if(typeof Notification<"u")return Notification.permission!=="denied";return this._call("isNotificationSupported")}async registerShortcut(J,$){return this._shortcuts.set(J,$),this._call("registerShortcut",{accelerator:J})}async unregisterShortcut(J){this._shortcuts.delete(J),await this._call("unregisterShortcut",{accelerator:J})}async unregisterAllShortcuts(){this._shortcuts.clear(),await this._call("unregisterAllShortcuts")}async isShortcutRegistered(J){return this._call("isShortcutRegistered",{accelerator:J})}async setAppearance(J){await this._call("setAppearance",{appearance:J})}async getAppearance(){return this._call("getAppearance")}async startPowerSaveBlocker(J){return this._call("startPowerSaveBlocker",{type:J})}async stopPowerSaveBlocker(J){await this._call("stopPowerSaveBlocker",{id:J})}async isPowerSaveBlockerActive(J){return this._call("isPowerSaveBlockerActive",{id:J})}async getIdleTime(){return this._call("getIdleTime")}async setLoginItemSettings(J){await this._call("setLoginItemSettings",J)}async getLoginItemSettings(){return this._call("getLoginItemSettings")}async _call(J,$){if(T())return C(`app.${J}`,{type:"app",action:J,data:$});return _().request(`app.${J}`,$)}}var B=new F0,DZ=B,MZ=()=>B.quit(),EZ=()=>B.hide(),TZ=()=>B.focus(),NZ=()=>B.hideDockIcon(),BZ=()=>B.showDockIcon(),xZ=(J)=>B.setBadge(J),SZ=()=>B.getInfo(),kZ=()=>B.getVersion(),IZ=()=>B.getName(),wZ=(J)=>B.getPath(J),PZ=()=>B.isDarkMode(),CZ=()=>B.getLocale(),bZ=(J)=>B.notify(J),yZ=(J,$)=>B.registerShortcut(J,$),vZ=(J)=>B.unregisterShortcut(J);function f(){if(typeof window<"u"&&window.craft?.fs)return window.craft.fs;return null}async function w(J,$){return _().request(J,$)}function k(J,$){if(typeof J!=="string"||J.length===0)throw Error("Invalid path: must be a non-empty string");if(J.includes("\x00"))throw Error("Invalid path: contains null byte");let Z=J;try{Z=decodeURIComponent(J)}catch{throw Error("Invalid path: malformed percent-encoding")}let X=Z.replace(/\\/g,"/").split("/");for(let Y of X)if(Y==="..")throw Error(`Path traversal detected: "${J}" contains a ".." segment`);if($){let Y=$.endsWith("/")?$:`${$}/`,Q=Z.startsWith("/")?Z:`${Y}${Z}`;if(!Q.startsWith(Y)&&Q!==$)throw Error(`Path escapes root: "${J}" not within "${$}"`)}}function M8(J){let $=[],Z=32768;for(let X=0;X<J.byteLength;X+=32768)$.push(String.fromCharCode(...J.subarray(X,X+32768)));if(typeof btoa==="function")return btoa($.join(""));return Buffer.from(J).toString("base64")}function E8(J){if(typeof atob==="function"){let $=atob(J),Z=new Uint8Array($.length);for(let X=0;X<$.length;X++)Z[X]=$.charCodeAt(X);return Z}return new Uint8Array(Buffer.from(J,"base64"))}var hZ={async readFile(J){k(J);let $=f();if($)return $.readFile(J);if(typeof window<"u"&&window.craft)return w("fs.readFile",{path:J});let{readFile:Z}=await import("fs/promises");return Z(J,"utf-8")},async writeFile(J,$){k(J);let Z=f();if(Z)return Z.writeFile(J,$);if(typeof window<"u"&&window.craft){await w("fs.writeFile",{path:J,content:$});return}let{writeFile:X}=await import("fs/promises");return X(J,$,"utf-8")},async readDir(J){k(J);let $=(Y)=>Y.filter((Q)=>Q!=="."&&Q!==".."),Z=f();if(Z)return $(await Z.readDir(J));if(typeof window<"u"&&window.craft)return $(await w("fs.readDir",{path:J}));let{readdir:X}=await import("fs/promises");return $(await X(J))},async mkdir(J){k(J);let $=f();if($)return $.mkdir(J);if(typeof window<"u"&&window.craft){await w("fs.mkdir",{path:J});return}let{mkdir:Z}=await import("fs/promises");await Z(J,{recursive:!0})},async remove(J){k(J);let $=f();if($)return $.remove(J);if(typeof window<"u"&&window.craft){await w("fs.remove",{path:J});return}let{rm:Z}=await import("fs/promises");return Z(J,{recursive:!0,force:!0})},async exists(J){k(J);let $=f();if($)return $.exists(J);if(typeof window<"u"&&window.craft)return w("fs.exists",{path:J});let{access:Z}=await import("fs/promises");try{return await Z(J),!0}catch{return!1}}};async function uZ(J){if(k(J),typeof window<"u"&&window.craft){let Z=await w("fs.readBinaryFile",{path:J});return E8(Z.data)}let{readFile:$}=await import("fs/promises");return $(J)}async function gZ(J,$){if(k(J),typeof window<"u"&&window.craft){await w("fs.writeBinaryFile",{path:J,_binary:!0,data:M8($)});return}let{writeFile:Z}=await import("fs/promises");return Z(J,$)}async function fZ(J){if(k(J),typeof window<"u"&&window.craft){let X=await w("fs.stat",{path:J});return{size:X.size,isFile:X.isFile,isDirectory:X.isDirectory,modifiedAt:new Date(X.modifiedAt),createdAt:new Date(X.createdAt)}}let{stat:$}=await import("fs/promises"),Z=await $(J);return{size:Z.size,isFile:Z.isFile(),isDirectory:Z.isDirectory(),modifiedAt:Z.mtime,createdAt:Z.birthtime}}async function mZ(J,$){if(k(J),k($),typeof window<"u"&&window.craft){await w("fs.copy",{src:J,dest:$});return}let{cp:Z}=await import("fs/promises");return Z(J,$,{recursive:!0,dereference:!1,verbatimSymlinks:!0})}async function pZ(J,$){if(k(J),k($),typeof window<"u"&&window.craft){await w("fs.move",{src:J,dest:$});return}let{rename:Z}=await import("fs/promises");return Z(J,$)}var sJ=!1;async function cZ(J,$,Z={}){k(J);let X=Z.recursive??!0;if(typeof window<"u"&&window.craft){let z=typeof globalThis.crypto<"u"&&"randomUUID"in globalThis.crypto?globalThis.crypto.randomUUID():`${Date.now()}_${performance.now()}`;await w("fs.watch",{path:J,watchId:z,recursive:X});let H=(K)=>{if(K.detail.watchId===z)$(K.detail.eventType,K.detail.filename)};return window.addEventListener("craft:fs:watch",H),()=>{window.removeEventListener("craft:fs:watch",H),w("fs.unwatch",{watchId:z})}}let Y=await import("fs"),Q=typeof process<"u"?process.platform:"";if(X&&Q==="linux"&&!sJ)sJ=!0,console.warn("[Craft fs.watch] recursive watching is not supported by node:fs.watch on linux; only direct children of the path will fire events. Use the Craft bridge for true recursion.");let q=Y.watch(J,{recursive:X&&Q!=="linux"},(z,H)=>{if(H)$(z,H)});return()=>q.close()}async function GJ(J,$){return _().request(J,$)}var N8=/^\s*(?:--[^\n]*\n\s*)*(INSERT|UPDATE|DELETE|REPLACE|DROP|CREATE|ALTER|TRUNCATE|ATTACH|DETACH|VACUUM|REINDEX|PRAGMA)\b/i,B8=new T8().setMaxListeners(0),rJ=64;function UJ(J,$="identifier"){if(typeof J!=="string"||J.length===0)throw Error(`Invalid ${$} name: must be a non-empty string`);if(J.length>rJ)throw Error(`Invalid ${$} name: "${J.slice(0,16)}\u2026" exceeds ${rJ} characters`);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(J))throw Error(`Invalid ${$} name: "${J}". ${$} names must contain only letters, numbers, and underscores.`)}function x8(J){if(J===null||J===void 0)return"NULL";if(typeof J==="boolean")return J?"1":"0";if(typeof J==="number"){if(!Number.isFinite(J))throw Error(`Invalid DEFAULT: ${J} is not a finite number`);return String(J)}if(typeof J==="string")return`'${J.replace(/'/g,"''")}'`;throw Error(`Invalid DEFAULT: ${typeof J} cannot be encoded as a SQL literal`)}var lZ={async execute(J,$){if(typeof window<"u"&&window.craft?.db)return window.craft.db.execute(J,$);throw Error("Database API not available. Must run in Craft environment.")},async query(J,$){if(typeof window<"u"&&window.craft?.db)return window.craft.db.query(J,$);throw Error("Database API not available. Must run in Craft environment.")},async beginTransaction(){if(typeof window<"u"&&window.craft?.db)return window.craft.db.beginTransaction();throw Error("Database API not available. Must run in Craft environment.")},async commit(){if(typeof window<"u"&&window.craft?.db)return window.craft.db.commit();throw Error("Database API not available. Must run in Craft environment.")},async rollback(){if(typeof window<"u"&&window.craft?.db)return window.craft.db.rollback();throw Error("Database API not available. Must run in Craft environment.")}};async function nZ(J){let $=J.replace(/\\/g,"/");if($.includes("/../")||$.startsWith("../")||$.endsWith("/..")||$===".."||J.includes("\x00"))throw Error(`Invalid database name: "${J}" contains path traversal or invalid characters`);return new j0(J)}class j0{name;isOpen=!1;readOnly;_inTransactionHelper=!1;constructor(J,$){this.name=J,this.readOnly=$?.readOnly===!0}isReadOnly(){return this.readOnly}async open(){if(typeof window<"u"&&window.craft){await GJ("db.open",{name:this.name}),this.isOpen=!0;return}throw Error("Database API not available. Must run in Craft environment.")}async close(){if(typeof window<"u"&&window.craft){await GJ("db.close",{name:this.name}),this.isOpen=!1;return}throw Error("Database API not available. Must run in Craft environment.")}async execute(J,$){if(!this.isOpen)await this.open();if(B8.emit("db:execute",{name:this.name,sql:J,paramsCount:$?.length??0,readOnly:this.readOnly}),this.readOnly&&N8.test(J))throw Error(`Database "${this.name}" is read-only; rejected mutating statement: ${J.slice(0,64)}`);if(typeof window<"u"&&window.craft){let Z=await GJ("db.execute",{name:this.name,sql:J,params:$||[]});return{rowsAffected:Z.rowsAffected,lastInsertId:Z.lastInsertId}}throw Error("Database API not available. Must run in Craft environment.")}async query(J,$){if(!this.isOpen)await this.open();if(typeof window<"u"&&window.craft)return GJ("db.query",{name:this.name,sql:J,params:$||[]});throw Error("Database API not available. Must run in Craft environment.")}async get(J,$){let Z=await this.query(J,$);return Z.length>0?Z[0]:null}async transaction(J){if(this._inTransactionHelper)throw Error("[Craft DB] transaction() is already active on this connection. "+"Nested transactions are not supported \u2014 refactor inner code to take "+"an existing handle, or use SAVEPOINT directly.");this._inTransactionHelper=!0;try{await this.execute("BEGIN TRANSACTION");try{let $=await J();return await this.execute("COMMIT"),$}catch($){try{await this.execute("ROLLBACK")}catch(Z){if(console.error("[Craft DB] ROLLBACK failed after transaction error:",Z),$ instanceof Error)$.cause=Z}throw $}}finally{this._inTransactionHelper=!1}}async createTable(J,$){UJ(J,"table");let Z=$.map((Y)=>{UJ(Y.name,"column");let Q=`${Y.name} ${Y.type}`;if(Y.primaryKey)Q+=" PRIMARY KEY";if(Y.autoIncrement)Q+=" AUTOINCREMENT";if(Y.notNull)Q+=" NOT NULL";if(Y.unique)Q+=" UNIQUE";if(Y.default!==void 0)Q+=` DEFAULT ${x8(Y.default)}`;return Q}),X=`CREATE TABLE IF NOT EXISTS ${J} (${Z.join(", ")})`;await this.execute(X)}async dropTable(J){UJ(J,"table"),await this.execute(`DROP TABLE IF EXISTS ${J}`)}async tableExists(J){return UJ(J,"table"),(await this.query("SELECT name FROM sqlite_master WHERE type='table' AND name=?",[J])).length>0}}class S8{db;tableName;constructor(J,$="kv_store"){this.db=J,this.tableName=$}async init(){await this.db.createTable(this.tableName,[{name:"key",type:"TEXT",primaryKey:!0},{name:"value",type:"TEXT"},{name:"updated_at",type:"INTEGER"}])}async get(J){let $=await this.db.get(`SELECT value FROM ${this.tableName} WHERE key = ?`,[J]);if($)try{return JSON.parse($.value)}catch(Z){return console.debug("[Craft DB] Failed to parse stored value for key, returning raw:",Z),$.value}return null}async set(J,$){let Z=JSON.stringify($);await this.db.execute(`INSERT OR REPLACE INTO ${this.tableName} (key, value, updated_at) VALUES (?, ?, ?)`,[J,Z,Date.now()])}async delete(J){await this.db.execute(`DELETE FROM ${this.tableName} WHERE key = ?`,[J])}async has(J){return await this.db.get(`SELECT key FROM ${this.tableName} WHERE key = ?`,[J])!==null}async keys(){return(await this.db.query(`SELECT key FROM ${this.tableName}`)).map(($)=>$.key)}async clear(){await this.db.execute(`DELETE FROM ${this.tableName}`)}}function k8(J){if(J===void 0||J===null)return{kind:"none",value:void 0};if(typeof J==="string")return{kind:"string",value:J};if(J instanceof ArrayBuffer)return{kind:"binary",value:J};if(ArrayBuffer.isView(J))return{kind:"binary",value:J};if(typeof Blob<"u"&&J instanceof Blob)return{kind:"binary",value:J};if(typeof FormData<"u"&&J instanceof FormData)return{kind:"form",value:J};if(typeof URLSearchParams<"u"&&J instanceof URLSearchParams)return{kind:"form",value:J};if(typeof ReadableStream<"u"&&J instanceof ReadableStream)return{kind:"binary",value:J};if(J!==null&&typeof J==="object"&&J[Symbol.asyncIterator]!==void 0)return{kind:"binary",value:J};return{kind:"json",value:JSON.stringify(J)}}function I8(J,$){let Z=$.toLowerCase();for(let X of Object.keys(J))if(X.toLowerCase()===Z)return!0;return!1}var w8={async fetch(J,$){if(typeof window<"u"&&window.craft?.http)return window.craft.http.fetch(J,$);return globalThis.fetch(J,$)},async download(J,$,Z){if(typeof window<"u"&&window.craft?.http){let X=Z,Y=Z?(Q)=>X?.(Q):void 0;try{return await window.craft.http.download(J,$,Y)}finally{X=void 0}}throw Error("Download API requires Craft environment")},async upload(J,$,Z){if(typeof window<"u"&&window.craft?.http){let X=Z,Y=Z?(Q)=>X?.(Q):void 0;try{return await window.craft.http.upload(J,$,Y)}finally{X=void 0}}throw Error("Upload API requires Craft environment")}};class A0{baseUrl;defaultHeaders;timeout;constructor(J={}){this.baseUrl=J.baseUrl||"",this.defaultHeaders=J.headers||{},this.timeout=J.timeout||30000}async get(J,$){return this.request("GET",J,$)}async post(J,$,Z){return this.request("POST",J,{...Z,body:$})}async put(J,$,Z){return this.request("PUT",J,{...Z,body:$})}async patch(J,$,Z){return this.request("PATCH",J,{...Z,body:$})}async delete(J,$){return this.request("DELETE",J,$)}async head(J,$){return this.request("HEAD",J,$)}async request(J,$,Z={}){let X=this.buildUrl($,Z.params),Y={...this.defaultHeaders,...Z.headers},Q=k8(Z.body);if(Q.kind==="json"&&!I8(Y,"content-type"))Y["Content-Type"]="application/json";let q=Z.timeout||this.timeout,z=new AbortController,H=setTimeout(()=>z.abort(),q);try{let K=await w8.fetch(X,{method:J,headers:Y,body:Q.value,signal:z.signal,...typeof Z.timeout==="number"||typeof this.timeout==="number"?{timeoutMs:q}:{}}),V,R=K.headers.get("content-type")??"";if(R.includes("application/json"))try{V=await K.json()}catch{V=await K.text()}else if(R.startsWith("text/"))V=await K.text();else if(R.includes("octet-stream")||R.startsWith("image/")||R.startsWith("audio/")||R.startsWith("video/")||R.startsWith("application/"))V=await K.arrayBuffer();else if(K.body===null)V=null;else V=await K.text();return{data:V,status:K.status,statusText:K.statusText,headers:Object.fromEntries(K.headers.entries()),ok:K.ok}}catch(K){if(K instanceof Error&&K.name==="AbortError")throw new O0("Request timeout",0,"TIMEOUT");throw K}finally{clearTimeout(H)}}buildUrl(J,$){let Z=J.startsWith("http")?J:`${this.baseUrl}${J}`;if($){let X=new URLSearchParams;for(let[Q,q]of Object.entries($))X.append(Q,String(q));let Y=X.toString();if(Y)Z+=(Z.includes("?")?"&":"?")+Y}return Z}setHeader(J,$){this.defaultHeaders[J]=$}removeHeader(J){delete this.defaultHeaders[J]}setBearerToken(J){this.setHeader("Authorization",`Bearer ${J}`)}}class O0 extends Error{status;code;constructor(J,$,Z="HTTP_ERROR"){super(J);this.name="HttpError",this.status=$,this.code=Z}}class P8{ws=null;url;reconnectAttempts=0;maxReconnectAttempts;reconnectDelay;handlers=new Map;messageHandler=null;constructor(J,$={}){this.url=J,this.maxReconnectAttempts=$.maxReconnectAttempts||5,this.reconnectDelay=$.reconnectDelay||1000}connect(){return new Promise((J,$)=>{this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.reconnectAttempts=0,J()},this.ws.onerror=(Z)=>{$(Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.attemptReconnect()},this.messageHandler=(Z)=>{try{let X=JSON.parse(Z.data),Y=X.type||"message",Q=this.handlers.get(Y);if(Q)Q.forEach((q)=>q(X.payload||X))}catch{let X=this.handlers.get("message");if(X)X.forEach((Y)=>Y(Z.data))}},this.ws.onmessage=this.messageHandler})}disconnect(){if(this.maxReconnectAttempts=0,this.ws)this.ws.close(),this.ws=null}send(J,$){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw Error("WebSocket not connected");this.ws.send(JSON.stringify({type:J,payload:$}))}sendRaw(J){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw Error("WebSocket not connected");this.ws.send(J)}on(J,$){if(!this.handlers.has(J))this.handlers.set(J,new Set);return this.handlers.get(J).add($),()=>{this.handlers.get(J)?.delete($)}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts++;let J=this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);setTimeout(()=>{this.connect().catch(()=>{})},J)}get connected(){return this.ws?.readyState===WebSocket.OPEN}}function sZ(J){return new A0(J)}class v extends Error{name="CraftCryptoError";cause;constructor(J,$){super(J,$);if($&&"cause"in $)this.cause=$.cause}}class _0 extends v{name="LegacyCiphertextError";constructor(){super("Ciphertext was produced by a pre-versioning Craft crypto release. Re-encrypt the value with the current API to migrate to the v1 wire format.")}}var iJ=1,m=16,qJ=12,xJ=16,VJ=600000,a={async randomBytes(J){if(typeof window<"u"&&window.craft?.crypto)return window.craft.crypto.randomBytes(J);if(typeof globalThis.crypto<"u"&&typeof globalThis.crypto.getRandomValues==="function"){let Z=new Uint8Array(J),X=65536;for(let Y=0;Y<J;Y+=65536){let Q=Z.subarray(Y,Math.min(Y+65536,J));globalThis.crypto.getRandomValues(Q)}return Z}let{randomBytes:$}=await import("crypto");return new Uint8Array($(J))},async hash(J,$){if(typeof window<"u"&&window.craft?.crypto)return window.craft.crypto.hash(J,$);if(J==="md5"){if(!(typeof process<"u"&&process.versions?.node))throw new v("MD5 is not available in this runtime \u2014 WebCrypto does not implement it. "+"Use sha256/sha512, or call this from Node.");let{createHash:Y}=await import("crypto");return Y("md5").update($).digest("hex")}if(typeof globalThis.crypto<"u"&&globalThis.crypto.subtle){let Y=new TextEncoder().encode($),Q=await globalThis.crypto.subtle.digest(J==="sha256"?"SHA-256":"SHA-512",Y);return D0(Q)}let{createHash:Z}=await import("crypto");return Z(J).update($).digest("hex")},async encrypt(J,$){if(typeof window<"u"&&window.craft?.crypto)return window.craft.crypto.encrypt(J,$);let Z=await a.randomBytes(m),X=await a.randomBytes(qJ),Y=await oJ($,Z),Q=await C8(Y,X,new TextEncoder().encode(J)),q=new Uint8Array(1+Z.length+X.length+Q.length);return q[0]=iJ,q.set(Z,1),q.set(X,1+Z.length),q.set(Q,1+Z.length+X.length),HJ(q.buffer)},async decrypt(J,$){if(typeof window<"u"&&window.craft?.crypto)return window.craft.crypto.decrypt(J,$);let Z=M0(J);if(Z.length<1+m+qJ+xJ)throw new v("Ciphertext too short to be valid");if(Z[0]!==iJ)throw new _0;let Y=Z.slice(1,1+m),Q=Z.slice(1+m,1+m+qJ),q=Z.slice(1+m+qJ),z=await oJ($,Y);try{let H=await b8(z,Q,q);return new TextDecoder().decode(H)}catch(H){throw new v("Decryption failed (wrong key or corrupted data)",{cause:H})}}};function n(J){return J}async function oJ(J,$){if(typeof globalThis.crypto<"u"&&globalThis.crypto.subtle){let X=new TextEncoder,Y=await globalThis.crypto.subtle.importKey("raw",X.encode(J),"PBKDF2",!1,["deriveKey"]);return globalThis.crypto.subtle.deriveKey({name:"PBKDF2",salt:n($),iterations:VJ,hash:"SHA-256"},Y,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}let{pbkdf2Sync:Z}=await import("crypto");return new Uint8Array(Z(J,$,VJ,32,"sha256"))}async function C8(J,$,Z){if(J instanceof Uint8Array){let{createCipheriv:Y}=await import("crypto"),Q=Y("aes-256-gcm",J,$),q=Q.update(Z),z=Q.final(),H=Q.getAuthTag(),K=new Uint8Array(q.length+z.length+H.length);return K.set(q,0),K.set(z,q.length),K.set(H,q.length+z.length),K}let X=await globalThis.crypto.subtle.encrypt({name:"AES-GCM",iv:n($)},J,n(Z));return new Uint8Array(X)}async function b8(J,$,Z){if(J instanceof Uint8Array){let{createDecipheriv:Y}=await import("crypto"),Q=Z.subarray(Z.length-xJ),q=Z.subarray(0,Z.length-xJ),z=Y("aes-256-gcm",J,$);z.setAuthTag(Q);let H=z.update(q),K=z.final(),V=new Uint8Array(H.length+K.length);return V.set(H,0),V.set(K,H.length),V}let X=await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:n($)},J,n(Z));return new Uint8Array(X)}function D0(J){return Array.from(new Uint8Array(J)).map(($)=>$.toString(16).padStart(2,"0")).join("")}function HJ(J){let $=new Uint8Array(J),Z=[],X=8192;for(let Y=0;Y<$.byteLength;Y+=8192)Z.push(String.fromCharCode(...$.subarray(Y,Y+8192)));if(typeof btoa<"u")return btoa(Z.join(""));return Buffer.from($).toString("base64")}function M0(J){if(typeof atob<"u"){let $;try{$=atob(J)}catch(X){throw new v("Invalid base64 input",{cause:X})}let Z=new Uint8Array($.length);for(let X=0;X<$.length;X++)Z[X]=$.charCodeAt(X);return Z}return new Uint8Array(Buffer.from(J,"base64"))}function rZ(){if(typeof globalThis.crypto<"u"&&"randomUUID"in globalThis.crypto)return globalThis.crypto.randomUUID();let J=new Uint8Array(16);globalThis.crypto.getRandomValues(J),J[6]=J[6]&15|64,J[8]=J[8]&63|128;let $=Array.from(J,(Z)=>Z.toString(16).padStart(2,"0")).join("");return`${$.slice(0,8)}-${$.slice(8,12)}-${$.slice(12,16)}-${$.slice(16,20)}-${$.slice(20,32)}`}async function iZ(J,$){let Z=$??"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";if(Z.length===0)throw new v("randomString: charset cannot be empty");if(!Number.isInteger(J)||J<0)throw new v("randomString: length must be a non-negative integer");if(J===0)return"";let X=256-256%Z.length,Y=await a.randomBytes(J*2),Q="",q=0;while(Q.length<J){if(q>=Y.length)Y=await a.randomBytes(J*2),q=0;if(Y[q]<X)Q+=Z[Y[q]%Z.length];q++}return Q}async function oZ(J,$,Z){if(typeof globalThis.crypto<"u"&&globalThis.crypto.subtle){let Y=new TextEncoder,Q=await globalThis.crypto.subtle.importKey("raw",Y.encode($),{name:"HMAC",hash:J==="sha256"?"SHA-256":"SHA-512"},!1,["sign"]),q=await globalThis.crypto.subtle.sign("HMAC",Q,Y.encode(Z));return D0(q)}return(await import("crypto")).createHmac(J,$).update(Z).digest("hex")}function y8(J,$){let Z=new TextEncoder,X=Z.encode(J),Y=Z.encode($),Q=Math.max(X.length,Y.length),q=X.length^Y.length;for(let z=0;z<Q;z++)q|=(X[z]??0)^(Y[z]??0);return q===0}async function v8(J,$){let Z;if($)try{Z=M0($)}catch(Q){throw new v("hashPassword: salt must be base64-encoded",{cause:Q})}else Z=await a.randomBytes(16);let X=HJ(Z.buffer.slice(Z.byteOffset,Z.byteOffset+Z.byteLength));if(typeof globalThis.crypto<"u"&&globalThis.crypto.subtle){let Q=new TextEncoder,q=await globalThis.crypto.subtle.importKey("raw",Q.encode(J),"PBKDF2",!1,["deriveBits"]),z=await globalThis.crypto.subtle.deriveBits({name:"PBKDF2",salt:n(Z),iterations:VJ,hash:"SHA-256"},q,256);return{hash:HJ(z),salt:X}}let{pbkdf2:Y}=await import("crypto");return new Promise((Q,q)=>{Y(J,Z,VJ,32,"sha256",(z,H)=>{if(z)q(z);else Q({hash:HJ(H.buffer.slice(H.byteOffset,H.byteOffset+H.byteLength)),salt:X})})})}async function aZ(J,$,Z){let X=await v8(J,Z);return y8(X.hash,$)}async function h(J,$){return _().request(J,$)}var u=typeof process<"u"?process.env:{},tZ=new Proxy(u,{get(J,$){return u[$]},set(J,$,Z){return u[$]=Z,!0},deleteProperty(J,$){return delete u[$],!0},ownKeys(){return Reflect.ownKeys(u)},getOwnPropertyDescriptor(J,$){return Object.getOwnPropertyDescriptor(u,$)},has(J,$){return $ in u}});function G(){if(typeof globalThis<"u"){let J=globalThis;if(J.craft?._platform)return J.craft._platform;if(J.__CRAFT_PLATFORM__)return J.__CRAFT_PLATFORM__}if(typeof process<"u"&&process.platform)return process.platform;if(typeof navigator<"u"&&typeof navigator.userAgent==="string"){let J=navigator.userAgent.toLowerCase();if(J.includes("iphone")||J.includes("ipad"))return"ios";if(J.includes("android"))return"android";if(J.includes("mac"))return"darwin";if(J.includes("win"))return"win32";if(J.includes("linux"))return"linux"}return"unknown"}function eZ(){let J=G();return J==="darwin"||J==="macos"||J==="win32"||J==="windows"||J==="linux"}function JX(){let J=G();return J==="ios"||J==="android"}function U(){return typeof window<"u"&&typeof window.craft<"u"}async function $X(){if(typeof window<"u"&&window.craft)return h("process.getSystemInfo");if(typeof process<"u"){let $=await import("os");return{platform:process.platform,arch:process.arch,osVersion:$.release(),hostname:$.hostname(),cpuCount:$.cpus().length,totalMemory:$.totalmem(),freeMemory:$.freemem(),uptime:$.uptime()}}let J=typeof navigator<"u"&&typeof navigator.hardwareConcurrency==="number"?navigator.hardwareConcurrency:1;return{platform:G(),arch:"unknown",osVersion:"unknown",hostname:"unknown",cpuCount:J,totalMemory:0,freeMemory:0,uptime:0}}async function ZX(J,$){if(typeof window<"u"&&window.craft)return h("process.exec",{command:J,...$});let{exec:Z}=await import("child_process"),{promisify:X}=await import("util"),Y=X(Z);try{let{stdout:Q,stderr:q}=await Y(J,{cwd:$?.cwd,env:$?.env?{...process.env,...$.env}:void 0,timeout:$?.timeout,maxBuffer:$?.maxBuffer||1048576});return{stdout:Q,stderr:q,exitCode:0}}catch(Q){return{stdout:Q.stdout||"",stderr:Q.stderr||Q.message,exitCode:Q.code||1}}}class E0{command;args;options;processId=null;onStdoutHandlers=[];onStderrHandlers=[];onExitHandlers=[];domListeners=[];exited=!1;constructor(J,$=[],Z={}){this.command=J,this.args=$,this.options=Z}addDomListener(J,$){if(typeof window>"u")return;window.addEventListener(J,$),this.domListeners.push({type:J,handler:$})}removeDomListeners(){if(typeof window>"u")return;for(let{type:J,handler:$}of this.domListeners)window.removeEventListener(J,$);this.domListeners=[]}get pid(){return this.processId}async start(){if(typeof window<"u"&&window.craft){let J=await h("process.spawn",{command:this.command,args:this.args,...this.options});this.processId=J.pid;let $=(Y)=>{if(Y.detail.pid===this.processId)this.onStdoutHandlers.forEach((Q)=>Q(Y.detail.data))},Z=(Y)=>{if(Y.detail.pid===this.processId)this.onStderrHandlers.forEach((Q)=>Q(Y.detail.data))},X=(Y)=>{if(Y.detail.pid===this.processId)this.exited=!0,this.onExitHandlers.forEach((Q)=>Q(Y.detail.code)),this.removeDomListeners()};this.addDomListener("craft:process:stdout",$),this.addDomListener("craft:process:stderr",Z),this.addDomListener("craft:process:exit",X);return}throw Error("spawn() requires Craft environment")}async write(J){if(typeof window<"u"&&window.craft&&this.processId)await h("process.stdin",{pid:this.processId,data:J})}async kill(J="SIGTERM"){if(typeof window<"u"&&window.craft&&this.processId){if(await h("process.kill",{pid:this.processId,signal:J}),this.exited)this.removeDomListeners()}}onStdout(J){return this.onStdoutHandlers.push(J),()=>{let $=this.onStdoutHandlers.indexOf(J);if($>=0)this.onStdoutHandlers.splice($,1)}}onStderr(J){return this.onStderrHandlers.push(J),()=>{let $=this.onStderrHandlers.indexOf(J);if($>=0)this.onStderrHandlers.splice($,1)}}onExit(J){return this.onExitHandlers.push(J),()=>{let $=this.onExitHandlers.indexOf(J);if($>=0)this.onExitHandlers.splice($,1)}}}function XX(J,$,Z){return new E0(J,$,Z)}function YX(){if(typeof process<"u")return process.cwd();return"/"}async function QX(){if(typeof window<"u"&&window.craft)return h("process.homeDir");if(typeof process<"u")return(await import("os")).homedir();return"/"}async function GX(){if(typeof window<"u"&&window.craft)return h("process.tempDir");if(typeof process<"u")return(await import("os")).tmpdir();return"/tmp"}function UX(J=0){if(typeof window<"u"){let $=window.craft?.app;if($&&typeof $.quit==="function"){$.quit(J);return}}if(typeof process<"u"&&typeof process.exit==="function")process.exit(J)}function qX(){if(typeof process<"u")return process.argv;return[]}async function zX(J){if(typeof window<"u"&&window.craft){await h("process.open",{target:J});return}let $=G(),{execFile:Z}=await import("child_process"),{promisify:X}=await import("util"),Y=X(Z);switch($){case"darwin":case"macos":await Y("open",[J]);return;case"win32":case"windows":await Y("cmd.exe",["/c","start",'""',J]);return;case"linux":await Y("xdg-open",[J]);return;default:throw Error(`Unsupported platform: ${$}`)}}var aJ="__craft_web_device_id__";function h8(){if(typeof globalThis<"u"&&globalThis.localStorage)try{let J=globalThis.localStorage,$=J.getItem(aJ);if($&&/^web-[0-9a-f-]+$/i.test($))return $;let Z=`web-${BJ()}`;return J.setItem(aJ,Z),Z}catch{}return`web-${BJ()}`}var KX={async getInfo(){let J=A();if(typeof window<"u"&&J?.device)return J.device.getInfo();return{platform:zJ(),osVersion:"unknown",model:"unknown",manufacturer:"unknown",deviceId:h8(),isTablet:!1,screen:{width:typeof window<"u"?window.innerWidth||0:0,height:typeof window<"u"?window.innerHeight||0:0,scale:typeof window<"u"?window.devicePixelRatio||1:1},battery:{level:100,isCharging:!1},network:{type:"wifi",isConnected:typeof navigator<"u"?navigator.onLine??!0:!0}}},async getCapabilities(){let J=A();if(typeof window<"u"&&J?.device)return J.device.getCapabilities();return{camera:!0,biometrics:!1,nfc:!1,bluetooth:!1,gps:"geolocation"in navigator,accelerometer:!1,gyroscope:!1,haptics:"vibrate"in navigator,ar:!1,faceId:!1,touchId:!1}},isMobile(){let J=zJ();return J==="ios"||J==="android"},isIOS(){return zJ()==="ios"},isAndroid(){return zJ()==="android"},getLocale(){return navigator?.language||"en-US"},getTimezone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}},HX={async impact(J="medium"){let $=A();if(typeof window<"u"&&$?.haptics)return $.haptics.impact(J);if("vibrate"in navigator){let Z={light:10,medium:20,heavy:30,soft:5,rigid:25}[J];navigator.vibrate(Z)}},async notification(J="success"){let $=A();if(typeof window<"u"&&$?.haptics)return $.haptics.notification(J);if("vibrate"in navigator){let Z={success:[10,30,10],warning:[30,30,30],error:[50,50,50,50,50]};navigator.vibrate(Z[J])}},async selection(){let J=A();if(typeof window<"u"&&J?.haptics)return J.haptics.selection();if("vibrate"in navigator)navigator.vibrate(5)},async vibrate(J){let $=A();if(typeof window<"u"&&$?.haptics)return $.haptics.vibrate(J);if("vibrate"in navigator)navigator.vibrate(J)}},WX={async check(J){let $=A();if(typeof window<"u"&&$?.permissions)return $.permissions.check(J);try{let Z=u8(J);if(Z&&navigator.permissions){let X=await navigator.permissions.query({name:Z});return g8(X.state)}}catch{}return"undetermined"},async request(J){let $=A();if(typeof window<"u"&&$?.permissions)return $.permissions.request(J);try{if(J==="camera"||J==="microphone"){let Z={};if(J==="camera")Z.video=!0;if(J==="microphone")Z.audio=!0;return(await navigator.mediaDevices.getUserMedia(Z)).getTracks().forEach((Y)=>Y.stop()),"granted"}if(J==="location")return new Promise((Z)=>{navigator.geolocation.getCurrentPosition(()=>Z("granted"),()=>Z("denied"))});if(J==="notifications")return await Notification.requestPermission()==="granted"?"granted":"denied"}catch{return"denied"}return"undetermined"},async checkMultiple(J){let $={};for(let Z of J)$[Z]=await this.check(Z);return $},async requestMultiple(J){let $={};for(let Z of J)$[Z]=await this.request(Z);return $},async openSettings(){let J=A();if(typeof window<"u"&&J?.permissions)return J.permissions.openSettings()}},VX={async takePicture(J={}){let $=A();if(typeof window<"u"&&$?.camera)return $.camera.takePicture(J);throw Error("Camera API not available. Must run in Craft environment.")},async pickImage(){let J=A();if(typeof window<"u"&&J?.camera)return J.camera.pickImage();return new Promise(($,Z)=>{let X=document.createElement("input");X.type="file",X.accept="image/*",X.onchange=async()=>{let Y=X.files?.[0];if(Y){let Q=new FileReader;Q.onload=()=>{let q=Q.result.split(",")[1];$({base64:q,uri:URL.createObjectURL(Y),width:0,height:0,mimeType:Y.type})},Q.onerror=()=>Z(Error("Failed to read file")),Q.readAsDataURL(Y)}else Z(Error("No file selected"))},X.click()})},async pickMultiple(J={}){let $=A();if(typeof window<"u"&&$?.camera)return $.camera.pickMultiple(J);throw Error("Camera API not available. Must run in Craft environment.")},async isAvailable(){let J=A();if(typeof window<"u"&&J?.camera)return J.camera.isAvailable();try{return(await navigator.mediaDevices.enumerateDevices()).some((Z)=>Z.kind==="videoinput")}catch{return!1}}},LX={async isAvailable(){let J=A();if(typeof window<"u"&&J?.biometrics)return J.biometrics.isAvailable();return!1},async getBiometricType(){let J=A();if(typeof window<"u"&&J?.biometrics)return J.biometrics.getBiometricType();return null},async authenticate(J){let $=A();if(typeof window<"u"&&$?.biometrics)return $.biometrics.authenticate(J);throw Error("Biometrics not available")}},RX={async set(J,$){let Z=A();if(typeof window<"u"&&Z?.secureStorage)return Z.secureStorage.set(J,$);localStorage.setItem(`secure_${J}`,$)},async get(J){let $=A();if(typeof window<"u"&&$?.secureStorage)return $.secureStorage.get(J);return localStorage.getItem(`secure_${J}`)},async delete(J){let $=A();if(typeof window<"u"&&$?.secureStorage)return $.secureStorage.delete(J);localStorage.removeItem(`secure_${J}`)},async clear(){let J=A();if(typeof window<"u"&&J?.secureStorage)return J.secureStorage.clear();Object.keys(localStorage).filter(($)=>$.startsWith("secure_")).forEach(($)=>localStorage.removeItem($))}},FX={async getCurrentPosition(J={}){let $=A();if(typeof window<"u"&&$?.location)return $.location.getCurrentPosition(J);return new Promise((Z,X)=>{navigator.geolocation.getCurrentPosition((Y)=>Z({latitude:Y.coords.latitude,longitude:Y.coords.longitude,altitude:Y.coords.altitude??void 0,accuracy:Y.coords.accuracy,heading:Y.coords.heading??void 0,speed:Y.coords.speed??void 0,timestamp:Y.timestamp}),X,{enableHighAccuracy:J.enableHighAccuracy,timeout:J.timeout,maximumAge:J.maximumAge})})},watchPosition(J,$={}){let Z=A();if(typeof window<"u"&&Z?.location)return Z.location.watchPosition(J,$);return navigator.geolocation.watchPosition((X)=>J({latitude:X.coords.latitude,longitude:X.coords.longitude,altitude:X.coords.altitude??void 0,accuracy:X.coords.accuracy,heading:X.coords.heading??void 0,speed:X.coords.speed??void 0,timestamp:X.timestamp}),console.error,{enableHighAccuracy:$.enableHighAccuracy,timeout:$.timeout,maximumAge:$.maximumAge})},clearWatch(J){let $=A();if(typeof window<"u"&&$?.location)return $.location.clearWatch(J);navigator.geolocation.clearWatch(J)}},jX={async share(J){let $=A();if(typeof window<"u"&&$?.share)return $.share.share(J);if(navigator.share)await navigator.share({title:J.title,text:J.text,url:J.url});else throw Error("Share API not available")},isAvailable(){let J=A();if(typeof window<"u"&&J?.share)return!0;return"share"in navigator}},AX={getState(){let J=A();if(typeof window<"u"&&J?.lifecycle)return J.lifecycle.getState();return document.visibilityState==="visible"?"active":"background"},onStateChange(J){let $=A();if(typeof window<"u"&&$?.lifecycle)return $.lifecycle.onStateChange(J);let Z=()=>{J(document.visibilityState==="visible"?"active":"background")};return document.addEventListener("visibilitychange",Z),()=>document.removeEventListener("visibilitychange",Z)}},OX={async show(J){let $=A();if(typeof window<"u"&&$?.notifications)return $.notifications.show(J);if("Notification"in window&&Notification.permission==="granted")new Notification(J.title,{body:J.body})},async schedule(J){let $=A();if(typeof window<"u"&&$?.notifications)return $.notifications.schedule(J);throw Error("Scheduled notifications not available in web")},async cancelAll(){let J=A();if(typeof window<"u"&&J?.notifications)return J.notifications.cancelAll()},async setBadge(J){let $=A();if(typeof window<"u"&&$?.notifications)return $.notifications.setBadge(J)}};function zJ(){if(typeof window>"u")return"linux";let J=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(J))return"ios";if(/android/.test(J))return"android";if(/macintosh|mac os x/.test(J))return"macos";if(/windows/.test(J))return"windows";return"linux"}function u8(J){return{camera:"camera",microphone:"microphone",location:"geolocation",notifications:"notifications"}[J]||null}function g8(J){return{granted:"granted",denied:"denied",prompt:"undetermined"}[J]}function A(){if(typeof window<"u")return window.craft;return}var _X={async isAvailable(){if(!U()||G()!=="ios")return!1;return window.craft?.carplay?.isAvailable?.()??!1},async isConnected(){if(!U()||G()!=="ios")return!1;return window.craft?.carplay?.isConnected?.()??!1},onConnect(J){if(!U()||G()!=="ios")return;window.craft?.carplay?.onConnect?.(J)},onDisconnect(J){if(!U()||G()!=="ios")return;window.craft?.carplay?.onDisconnect?.(J)},async pushTemplate(J,$=!0){if(!U()||G()!=="ios")return;return window.craft?.carplay?.pushTemplate?.(J,$)},async popTemplate(J=!0){if(!U()||G()!=="ios")return;return window.craft?.carplay?.popTemplate?.(J)},async popToRootTemplate(J=!0){if(!U()||G()!=="ios")return;return window.craft?.carplay?.popToRootTemplate?.(J)},async presentTemplate(J,$=!0){if(!U()||G()!=="ios")return;return window.craft?.carplay?.presentTemplate?.(J,$)},async dismissTemplate(J=!0){if(!U()||G()!=="ios")return;return window.craft?.carplay?.dismissTemplate?.(J)},onSelectListItem(J){if(!U()||G()!=="ios")return;window.craft?.carplay?.onSelectListItem?.(J)},onSelectGridItem(J){if(!U()||G()!=="ios")return;window.craft?.carplay?.onSelectGridItem?.(J)},async updateNowPlaying(J){if(!U()||G()!=="ios")return;return window.craft?.carplay?.updateNowPlaying?.(J)}},DX={isAppClip(){if(!U()||G()!=="ios")return!1;return window.craft?.appClips?.isAppClip?.()??!1},onInvoke(J){if(!U()||G()!=="ios")return;window.craft?.appClips?.onInvoke?.(J)},async getInvocation(){if(!U()||G()!=="ios")return null;return window.craft?.appClips?.getInvocation?.()},async promptToInstallFullApp(){if(!U()||G()!=="ios")return;return window.craft?.appClips?.promptToInstallFullApp?.()},async requestEphemeralNotificationPermission(){if(!U()||G()!=="ios")return!1;return window.craft?.appClips?.requestEphemeralNotificationPermission?.()??!1},async confirmLocation(J){if(!U()||G()!=="ios")return!1;return window.craft?.appClips?.confirmLocation?.(J)??!1}},MX={async areSupported(){if(!U()||G()!=="ios")return!1;return window.craft?.liveActivities?.areSupported?.()??!1},async areEnabled(){if(!U()||G()!=="ios")return!1;return window.craft?.liveActivities?.areEnabled?.()??!1},async start(J){if(!U()||G()!=="ios")return{id:`mock-${Date.now()}`};return window.craft?.liveActivities?.start?.(J)??{id:`mock-${Date.now()}`}},async update(J,$,Z){if(!U()||G()!=="ios")return;return window.craft?.liveActivities?.update?.(J,$,Z)},async end(J,$,Z){if(!U()||G()!=="ios")return;return window.craft?.liveActivities?.end?.(J,$,Z)},async getAll(){if(!U()||G()!=="ios")return[];return window.craft?.liveActivities?.getAll?.()??[]},async requestPushToken(J){if(!U()||G()!=="ios")return null;return window.craft?.liveActivities?.requestPushToken?.(J)}},EX={async isAvailable(){if(!U()||G()!=="ios")return!1;return window.craft?.sharePlay?.isAvailable?.()??!1},async getSessionState(){if(!U()||G()!=="ios")return null;return window.craft?.sharePlay?.getSessionState?.()},async getParticipants(){if(!U()||G()!=="ios")return[];return window.craft?.sharePlay?.getParticipants?.()??[]},async startActivity(J){if(!U()||G()!=="ios")return!1;return window.craft?.sharePlay?.startActivity?.(J)??!1},async endActivity(){if(!U()||G()!=="ios")return;return window.craft?.sharePlay?.endActivity?.()},async broadcast(J){if(!U()||G()!=="ios")return;return window.craft?.sharePlay?.broadcast?.(J)},async send(J,$){if(!U()||G()!=="ios")return;return window.craft?.sharePlay?.send?.(J,$)},onMessage(J){if(!U()||G()!=="ios")return;window.craft?.sharePlay?.onMessage?.(J)},onSessionStateChange(J){if(!U()||G()!=="ios")return;window.craft?.sharePlay?.onSessionStateChange?.(J)},onParticipantsChange(J){if(!U()||G()!=="ios")return;window.craft?.sharePlay?.onParticipantsChange?.(J)},async coordinatePlayback(J){if(!U()||G()!=="ios")return;return window.craft?.sharePlay?.coordinatePlayback?.(J)}},TX={async getProducts(J){if(!U()||G()!=="ios")return[];return window.craft?.storeKit?.getProducts?.(J)??[]},async purchase(J,$){if(!U()||G()!=="ios")return{success:!1,error:"StoreKit not available"};return window.craft?.storeKit?.purchase?.(J,$)??{success:!1}},async isEntitled(J){if(!U()||G()!=="ios")return!1;return window.craft?.storeKit?.isEntitled?.(J)??!1},async getCurrentEntitlements(){if(!U()||G()!=="ios")return[];return window.craft?.storeKit?.getCurrentEntitlements?.()??[]},async getTransactionHistory(J){if(!U()||G()!=="ios")return[];return window.craft?.storeKit?.getTransactionHistory?.(J)??[]},async restorePurchases(){if(!U()||G()!=="ios")return;return window.craft?.storeKit?.restorePurchases?.()},async finishTransaction(J){if(!U()||G()!=="ios")return;return window.craft?.storeKit?.finishTransaction?.(J)},async getSubscriptionStatus(J){if(!U()||G()!=="ios")return null;return window.craft?.storeKit?.getSubscriptionStatus?.(J)},async presentOfferCodeRedemption(){if(!U()||G()!=="ios")return;return window.craft?.storeKit?.presentOfferCodeRedemption?.()},async presentManageSubscriptions(){if(!U()||G()!=="ios")return;return window.craft?.storeKit?.presentManageSubscriptions?.()},async beginRefundRequest(J){if(!U()||G()!=="ios")return"failed";return window.craft?.storeKit?.beginRefundRequest?.(J)??"failed"},onTransactionUpdate(J){if(!U()||G()!=="ios")return;window.craft?.storeKit?.onTransactionUpdate?.(J)},async showPriceConsentIfNeeded(){if(!U()||G()!=="ios")return;return window.craft?.storeKit?.showPriceConsentIfNeeded?.()}},NX={register(J){if(!U()||G()!=="ios")return;window.craft?.appIntents?.register?.(J)},unregister(J){if(!U()||G()!=="ios")return;window.craft?.appIntents?.unregister?.(J)},onPerform(J,$){if(!U()||G()!=="ios")return;window.craft?.appIntents?.onPerform?.(J,$)},async donate(J,$){if(!U()||G()!=="ios")return;return window.craft?.appIntents?.donate?.(J,$)},async deleteDonations(J){if(!U()||G()!=="ios")return;return window.craft?.appIntents?.deleteDonations?.(J)},async updateSpotlightIndex(J,$){if(!U()||G()!=="ios")return;return window.craft?.appIntents?.updateSpotlightIndex?.(J,$)}},BX={async configure(J){if(!U()||G()!=="ios")return;return window.craft?.tipKit?.configure?.(J)},register(J){if(!U()||G()!=="ios")return;window.craft?.tipKit?.register?.(J)},async shouldShow(J){if(!U()||G()!=="ios")return!1;return window.craft?.tipKit?.shouldShow?.(J)??!1},async invalidate(J,$){if(!U()||G()!=="ios")return;return window.craft?.tipKit?.invalidate?.(J,$)},async trackEvent(J){if(!U()||G()!=="ios")return;return window.craft?.tipKit?.trackEvent?.(J)},async setParameter(J,$){if(!U()||G()!=="ios")return;return window.craft?.tipKit?.setParameter?.(J,$)},async showPopover(J,$){if(!U()||G()!=="ios")return;return window.craft?.tipKit?.showPopover?.(J,$)},onAction(J,$){if(!U()||G()!=="ios")return;window.craft?.tipKit?.onAction?.(J,$)},async resetDatastore(){if(!U()||G()!=="ios")return;return window.craft?.tipKit?.resetDatastore?.()}},xX={async getAuthorizationStatus(){if(!U()||G()!=="ios")return"notDetermined";return window.craft?.focusFilters?.getAuthorizationStatus?.()??"notDetermined"},async requestAuthorization(){if(!U()||G()!=="ios")return!1;return window.craft?.focusFilters?.requestAuthorization?.()??!1},async getFocusStatus(){if(!U()||G()!=="ios")return{isFocusActive:!1};return window.craft?.focusFilters?.getFocusStatus?.()??{isFocusActive:!1}},register(J){if(!U()||G()!=="ios")return;window.craft?.focusFilters?.register?.(J)},async getCurrentFilterSettings(){if(!U()||G()!=="ios")return null;return window.craft?.focusFilters?.getCurrentFilterSettings?.()},onFocusChange(J){if(!U()||G()!=="ios")return;window.craft?.focusFilters?.onFocusChange?.(J)},onFilterChange(J){if(!U()||G()!=="ios")return;window.craft?.focusFilters?.onFilterChange?.(J)}},SX={async isSupported(){if(!U()||G()!=="android")return!1;return window.craft?.materialYou?.isSupported?.()??!1},async getColors(J=!1){if(!U()||G()!=="android")return null;return window.craft?.materialYou?.getColors?.(J)},async getColorsFromSource(J){if(!U()||G()!=="android")return null;return window.craft?.materialYou?.getColorsFromSource?.(J)},onColorsChange(J){if(!U()||G()!=="android")return;window.craft?.materialYou?.onColorsChange?.(J)},async applyToSystemBars(J){if(!U()||G()!=="android")return;return window.craft?.materialYou?.applyToSystemBars?.(J)},async generateScheme(J,$=!1){if(!U()||G()!=="android")return null;return window.craft?.materialYou?.generateScheme?.(J,$)}},kX={async isAvailable(){if(!U()||G()!=="android")return!1;return window.craft?.photoPicker?.isAvailable?.()??!1},async pickImage(){if(!U()||G()!=="android")return null;return window.craft?.photoPicker?.pickImage?.()},async pickImages(J=10){if(!U()||G()!=="android")return[];return window.craft?.photoPicker?.pickImages?.(J)??[]},async pickVideo(){if(!U()||G()!=="android")return null;return window.craft?.photoPicker?.pickVideo?.()},async pickVideos(J=10){if(!U()||G()!=="android")return[];return window.craft?.photoPicker?.pickVideos?.(J)??[]},async pickMedia(J){if(!U()||G()!=="android")return[];return window.craft?.photoPicker?.pickMedia?.(J)??[]},async getPersistedUri(J){if(!U()||G()!=="android")return null;return window.craft?.photoPicker?.getPersistedUri?.(J)}},IX={async enqueue(J){if(!U()||G()!=="android")return`mock-${Date.now()}`;return window.craft?.workManager?.enqueue?.(J)??`mock-${Date.now()}`},async enqueueUnique(J,$){if(!U()||G()!=="android")return`mock-${Date.now()}`;return window.craft?.workManager?.enqueueUnique?.(J,$)??`mock-${Date.now()}`},async cancelByName(J){if(!U()||G()!=="android")return;return window.craft?.workManager?.cancelByName?.(J)},async cancelById(J){if(!U()||G()!=="android")return;return window.craft?.workManager?.cancelById?.(J)},async cancelByTag(J){if(!U()||G()!=="android")return;return window.craft?.workManager?.cancelByTag?.(J)},async cancelAll(){if(!U()||G()!=="android")return;return window.craft?.workManager?.cancelAll?.()},async getWorkInfo(J){if(!U()||G()!=="android")return null;return window.craft?.workManager?.getWorkInfo?.(J)},async getWorkInfoById(J){if(!U()||G()!=="android")return null;return window.craft?.workManager?.getWorkInfoById?.(J)},async getWorkInfoByTag(J){if(!U()||G()!=="android")return[];return window.craft?.workManager?.getWorkInfoByTag?.(J)??[]},observeWork(J,$){if(!U()||G()!=="android")return()=>{};return window.craft?.workManager?.observeWork?.(J,$)??(()=>{})},async pruneWork(){if(!U()||G()!=="android")return;return window.craft?.workManager?.pruneWork?.()},onWork(J,$){if(!U()||G()!=="android")return;window.craft?.workManager?.onWork?.(J,$)}},wX={async start(J){if(!U()||G()!=="android")return;return window.craft?.foregroundService?.start?.(J)},async stop(){if(!U()||G()!=="android")return;return window.craft?.foregroundService?.stop?.()},async updateNotification(J){if(!U()||G()!=="android")return;return window.craft?.foregroundService?.updateNotification?.(J)},async isRunning(){if(!U()||G()!=="android")return!1;return window.craft?.foregroundService?.isRunning?.()??!1},onAction(J){if(!U()||G()!=="android")return;window.craft?.foregroundService?.onAction?.(J)}},PX={async isSupported(){if(!U()||G()!=="android")return!1;return window.craft?.predictiveBack?.isSupported?.()??!1},enable(){if(!U()||G()!=="android")return;window.craft?.predictiveBack?.enable?.()},disable(){if(!U()||G()!=="android")return;window.craft?.predictiveBack?.disable?.()},onStart(J){if(!U()||G()!=="android")return;window.craft?.predictiveBack?.onStart?.(J)},onProgress(J){if(!U()||G()!=="android")return;window.craft?.predictiveBack?.onProgress?.(J)},onCommit(J){if(!U()||G()!=="android")return;window.craft?.predictiveBack?.onCommit?.()},onCancel(J){if(!U()||G()!=="android")return;window.craft?.predictiveBack?.onCancel?.(J)}},CX={async isSupported(){if(!U()||G()!=="android")return!1;return window.craft?.appLanguage?.isSupported?.()??!1},async getAvailableLanguages(){if(!U()||G()!=="android")return[];return window.craft?.appLanguage?.getAvailableLanguages?.()??[]},async getCurrentLanguage(){if(!U()||G()!=="android")return null;return window.craft?.appLanguage?.getCurrentLanguage?.()},async setLanguage(J){if(!U()||G()!=="android")return;return window.craft?.appLanguage?.setLanguage?.(J)},async resetToSystem(){if(!U()||G()!=="android")return;return window.craft?.appLanguage?.resetToSystem?.()},async openSettings(){if(!U()||G()!=="android")return;return window.craft?.appLanguage?.openSettings?.()}},bX={async getActiveWidgets(J){if(!U()||G()!=="android")return[];return window.craft?.widgets?.getActiveWidgets?.(J)??[]},async updateWidget(J,$){if(!U()||G()!=="android")return;return window.craft?.widgets?.updateWidget?.(J,$)},async updateAllWidgets(J,$){if(!U()||G()!=="android")return;return window.craft?.widgets?.updateAllWidgets?.(J,$)},async requestPin(J){if(!U()||G()!=="android")return!1;return window.craft?.widgets?.requestPin?.(J)??!1},async isSupported(){if(!U()||G()!=="android")return!1;return window.craft?.widgets?.isSupported?.()??!1},onUpdate(J,$){if(!U()||G()!=="android")return;window.craft?.widgets?.onUpdate?.(J,$)},onInteraction(J){if(!U()||G()!=="android")return;window.craft?.widgets?.onInteraction?.(J)},onResize(J){if(!U()||G()!=="android")return;window.craft?.widgets?.onResize?.(J)},onDelete(J){if(!U()||G()!=="android")return;window.craft?.widgets?.onDelete?.(J)}},yX={async connect(){if(!U()||G()!=="android")return!1;return window.craft?.playBilling?.connect?.()??!1},async disconnect(){if(!U()||G()!=="android")return;return window.craft?.playBilling?.disconnect?.()},async getProducts(J,$){if(!U()||G()!=="android")return[];return window.craft?.playBilling?.getProducts?.(J,$)??[]},async purchase(J,$){if(!U()||G()!=="android")return{success:!1,error:"Play Billing not available"};return window.craft?.playBilling?.purchase?.(J,$)??{success:!1}},async getPurchases(J){if(!U()||G()!=="android")return[];return window.craft?.playBilling?.getPurchases?.(J)??[]},async acknowledgePurchase(J){if(!U()||G()!=="android")return!1;return window.craft?.playBilling?.acknowledgePurchase?.(J)??!1},async consumePurchase(J){if(!U()||G()!=="android")return!1;return window.craft?.playBilling?.consumePurchase?.(J)??!1},async isSubscribed(J){if(!U()||G()!=="android")return!1;return window.craft?.playBilling?.isSubscribed?.(J)??!1},onPurchasesUpdated(J){if(!U()||G()!=="android")return;window.craft?.playBilling?.onPurchasesUpdated?.(J)},async showSubscriptionManagement(J){if(!U()||G()!=="android")return;return window.craft?.playBilling?.showSubscriptionManagement?.(J)}},vX={async isAvailable(){if(!U()||G()!=="macos")return!1;return window.craft?.touchBar?.isAvailable?.()??!1},set(J){if(!U()||G()!=="macos")return;window.craft?.touchBar?.set?.(J)},updateItem(J,$){if(!U()||G()!=="macos")return;window.craft?.touchBar?.updateItem?.(J,$)},clear(){if(!U()||G()!=="macos")return;window.craft?.touchBar?.clear?.()},onTap(J,$){if(!U()||G()!=="macos")return;window.craft?.touchBar?.onTap?.(J,$)},onSliderChange(J,$){if(!U()||G()!=="macos")return;window.craft?.touchBar?.onSliderChange?.(J,$)},onColorChange(J,$){if(!U()||G()!=="macos")return;window.craft?.touchBar?.onColorChange?.(J,$)},onScrubberSelect(J,$){if(!U()||G()!=="macos")return;window.craft?.touchBar?.onScrubberSelect?.(J,$)},onSegmentSelect(J,$){if(!U()||G()!=="macos")return;window.craft?.touchBar?.onSegmentSelect?.(J,$)},setEscapeKeyVisible(J){if(!U()||G()!=="macos")return;window.craft?.touchBar?.setEscapeKeyVisible?.(J)}},hX={async isSupported(){if(!U()||G()!=="macos")return!1;return window.craft?.desktopWidgets?.isSupported?.()??!1},register(J){if(!U()||G()!=="macos")return;window.craft?.desktopWidgets?.register?.(J)},provideTimeline(J,$){if(!U()||G()!=="macos")return;window.craft?.desktopWidgets?.provideTimeline?.(J,$)},async reloadTimeline(J){if(!U()||G()!=="macos")return;return window.craft?.desktopWidgets?.reloadTimeline?.(J)},async reloadAllTimelines(){if(!U()||G()!=="macos")return;return window.craft?.desktopWidgets?.reloadAllTimelines?.()},async getCurrentConfigurations(J){if(!U()||G()!=="macos")return[];return window.craft?.desktopWidgets?.getCurrentConfigurations?.(J)??[]},onWidgetURL(J,$){if(!U()||G()!=="macos")return;window.craft?.desktopWidgets?.onWidgetURL?.(J,$)}},uX={async isActive(){if(!U()||G()!=="macos")return!1;return window.craft?.stageManager?.isActive?.()??!1},async isAvailable(){if(!U()||G()!=="macos")return!1;return window.craft?.stageManager?.isAvailable?.()??!1},async getActiveSet(){if(!U()||G()!=="macos")return[];return window.craft?.stageManager?.getActiveSet?.()??[]},async createSet(J){if(!U()||G()!=="macos")return;return window.craft?.stageManager?.createSet?.(J)},async addToCurrentSet(J){if(!U()||G()!=="macos")return;return window.craft?.stageManager?.addToCurrentSet?.(J)},async removeFromCurrentSet(J){if(!U()||G()!=="macos")return;return window.craft?.stageManager?.removeFromCurrentSet?.(J)},onActiveSetChange(J){if(!U()||G()!=="macos")return;window.craft?.stageManager?.onActiveSetChange?.(J)},onStateChange(J){if(!U()||G()!=="macos")return;window.craft?.stageManager?.onStateChange?.(J)}},gX={startActivity(J){if(!U()||G()!=="macos")return;window.craft?.handoff?.startActivity?.(J)},updateActivity(J){if(!U()||G()!=="macos")return;window.craft?.handoff?.updateActivity?.(J)},invalidateActivity(){if(!U()||G()!=="macos")return;window.craft?.handoff?.invalidateActivity?.()},onContinue(J){if(!U()||G()!=="macos")return;window.craft?.handoff?.onContinue?.(J)},async hasRemoteClipboardContent(){if(!U()||G()!=="macos")return!1;return window.craft?.handoff?.hasRemoteClipboardContent?.()??!1},async shareViaAirDrop(J){if(!U()||G()!=="macos")return!1;return window.craft?.handoff?.shareViaAirDrop?.(J)??!1},async isAvailable(){if(!U()||G()!=="macos")return!1;return window.craft?.handoff?.isAvailable?.()??!1}},fX={async isAvailable(){if(!U()||G()!=="macos")return!1;return window.craft?.sidecar?.isAvailable?.()??!1},async getAvailableDevices(){if(!U()||G()!=="macos")return[];return window.craft?.sidecar?.getAvailableDevices?.()??[]},async getConnectedDevice(){if(!U()||G()!=="macos")return null;return window.craft?.sidecar?.getConnectedDevice?.()},async connect(J){if(!U()||G()!=="macos")return!1;return window.craft?.sidecar?.connect?.(J)??!1},async disconnect(){if(!U()||G()!=="macos")return;return window.craft?.sidecar?.disconnect?.()},async moveWindowToSidecar(J){if(!U()||G()!=="macos")return;return window.craft?.sidecar?.moveWindowToSidecar?.(J)},onConnectionChange(J){if(!U()||G()!=="macos")return;window.craft?.sidecar?.onConnectionChange?.(J)}},mX={async indexItems(J){if(!U()||G()!=="macos")return;return window.craft?.spotlight?.indexItems?.(J)},async deleteItems(J){if(!U()||G()!=="macos")return;return window.craft?.spotlight?.deleteItems?.(J)},async deleteItemsInDomain(J){if(!U()||G()!=="macos")return;return window.craft?.spotlight?.deleteItemsInDomain?.(J)},async deleteAllItems(){if(!U()||G()!=="macos")return;return window.craft?.spotlight?.deleteAllItems?.()},onContinueActivity(J){if(!U()||G()!=="macos")return;window.craft?.spotlight?.onContinueActivity?.(J)},async getIndexingStatus(){if(!U()||G()!=="macos")return{isIndexing:!1,itemCount:0};return window.craft?.spotlight?.getIndexingStatus?.()??{isIndexing:!1,itemCount:0}}},pX={register(J){if(!U()||G()!=="macos")return;window.craft?.quickActions?.register?.(J)},unregister(J){if(!U()||G()!=="macos")return;window.craft?.quickActions?.unregister?.(J)},onInvoke(J,$){if(!U()||G()!=="macos")return;window.craft?.quickActions?.onInvoke?.(J,$)}},cX={onReceive(J){if(!U()||G()!=="macos")return;window.craft?.shareExtension?.onReceive?.(J)},async complete(J=!0){if(!U()||G()!=="macos")return;return window.craft?.shareExtension?.complete?.(J)},async cancel(){if(!U()||G()!=="macos")return;return window.craft?.shareExtension?.cancel?.()}},dX={enableTabs(){if(!U()||G()!=="macos")return;window.craft?.windowManagement?.enableTabs?.()},disableTabs(){if(!U()||G()!=="macos")return;window.craft?.windowManagement?.disableTabs?.()},async newTab(J){if(!U()||G()!=="macos")return"";return window.craft?.windowManagement?.newTab?.(J)??""},async closeTab(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.closeTab?.()},async getTabGroups(){if(!U()||G()!=="macos")return[];return window.craft?.windowManagement?.getTabGroups?.()??[]},async selectTab(J){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.selectTab?.(J)},async moveTabToNewWindow(J){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.moveTabToNewWindow?.(J)},async mergeAllWindows(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.mergeAllWindows?.()},async enterFullScreen(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.enterFullScreen?.()},async exitFullScreen(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.exitFullScreen?.()},async toggleFullScreen(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.toggleFullScreen?.()},async createSplitView(J,$){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.createSplitView?.(J,$)},async exitSplitView(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.exitSplitView?.()},async tileLeft(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.tileLeft?.()},async tileRight(){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.tileRight?.()},async moveToSpace(J){if(!U()||G()!=="macos")return;return window.craft?.windowManagement?.moveToSpace?.(J)},onTabChange(J){if(!U()||G()!=="macos")return;window.craft?.windowManagement?.onTabChange?.(J)},onFullScreenChange(J){if(!U()||G()!=="macos")return;window.craft?.windowManagement?.onFullScreenChange?.(J)}},lX={async isSupported(){if(!U()||G()!=="windows")return!1;return window.craft?.jumpList?.isSupported?.()??!1},async set(J){if(!U()||G()!=="windows")return;return window.craft?.jumpList?.set?.(J)},async clear(){if(!U()||G()!=="windows")return;return window.craft?.jumpList?.clear?.()},async addToRecent(J){if(!U()||G()!=="windows")return;return window.craft?.jumpList?.addToRecent?.(J)},async clearRecent(){if(!U()||G()!=="windows")return;return window.craft?.jumpList?.clearRecent?.()},async addToFrequent(J){if(!U()||G()!=="windows")return;return window.craft?.jumpList?.addToFrequent?.(J)},async clearFrequent(){if(!U()||G()!=="windows")return;return window.craft?.jumpList?.clearFrequent?.()},onItemClick(J){if(!U()||G()!=="windows")return;window.craft?.jumpList?.onItemClick?.(J)}},nX={async setState(J){if(!U()||G()!=="windows")return;return window.craft?.taskbarProgress?.setState?.(J)},async setProgress(J){if(!U()||G()!=="windows")return;return window.craft?.taskbarProgress?.setProgress?.(Math.max(0,Math.min(1,J)))},async clear(){if(!U()||G()!=="windows")return;return window.craft?.taskbarProgress?.clear?.()},async flash(J){if(!U()||G()!=="windows")return;return window.craft?.taskbarProgress?.flash?.(J)},async stopFlash(){if(!U()||G()!=="windows")return;return window.craft?.taskbarProgress?.stopFlash?.()},async setOverlayIcon(J,$){if(!U()||G()!=="windows")return;return window.craft?.taskbarProgress?.setOverlayIcon?.(J,$)}},sX={async isSupported(){if(!U()||G()!=="windows")return!1;return window.craft?.toastNotifications?.isSupported?.()??!1},async show(J,$){if(!U()||G()!=="windows")return;return window.craft?.toastNotifications?.show?.(J,$)},async update(J,$){if(!U()||G()!=="windows")return;return window.craft?.toastNotifications?.update?.(J,$)},async hide(J){if(!U()||G()!=="windows")return;return window.craft?.toastNotifications?.hide?.(J)},async hideGroup(J){if(!U()||G()!=="windows")return;return window.craft?.toastNotifications?.hideGroup?.(J)},async clearAll(){if(!U()||G()!=="windows")return;return window.craft?.toastNotifications?.clearAll?.()},async getHistory(){if(!U()||G()!=="windows")return[];return window.craft?.toastNotifications?.getHistory?.()??[]},onActivated(J){if(!U()||G()!=="windows")return;window.craft?.toastNotifications?.onActivated?.(J)},onDismissed(J){if(!U()||G()!=="windows")return;window.craft?.toastNotifications?.onDismissed?.(J)}},rX={async getAvailability(){if(!U()||G()!=="windows")return{isAvailable:!1,biometricTypes:[],supportsCompanionDevice:!1};return window.craft?.windowsHello?.getAvailability?.()??{isAvailable:!1,biometricTypes:[],supportsCompanionDevice:!1}},async authenticate(J){if(!U()||G()!=="windows")return{success:!1,error:"notConfigured"};return window.craft?.windowsHello?.authenticate?.(J)??{success:!1}},async createCredential(J,$){if(!U()||G()!=="windows")return{success:!1,error:"Windows Hello not available"};return window.craft?.windowsHello?.createCredential?.(J,$)??{success:!1}},async signWithCredential(J,$,Z){if(!U()||G()!=="windows")return{success:!1,error:"Windows Hello not available"};return window.craft?.windowsHello?.signWithCredential?.(J,$,Z)??{success:!1}},async deleteCredential(J){if(!U()||G()!=="windows")return!1;return window.craft?.windowsHello?.deleteCredential?.(J)??!1},async hasCredential(J){if(!U()||G()!=="windows")return!1;return window.craft?.windowsHello?.hasCredential?.(J)??!1}},iX={async isSupported(){if(!U()||G()!=="windows")return!1;return window.craft?.windowsWidgets?.isSupported?.()??!1},register(J){if(!U()||G()!=="windows")return;window.craft?.windowsWidgets?.register?.(J)},unregister(J){if(!U()||G()!=="windows")return;window.craft?.windowsWidgets?.unregister?.(J)},onContentRequested(J,$){if(!U()||G()!=="windows")return;window.craft?.windowsWidgets?.onContentRequested?.(J,$)},async updateContent(J,$){if(!U()||G()!=="windows")return;return window.craft?.windowsWidgets?.updateContent?.(J,$)},onAction(J,$){if(!U()||G()!=="windows")return;window.craft?.windowsWidgets?.onAction?.(J,$)},onCustomize(J,$){if(!U()||G()!=="windows")return;window.craft?.windowsWidgets?.onCustomize?.(J,$)}},oX={async getCurrentVersion(){if(!U()||G()!=="windows")return null;return window.craft?.msixUpdate?.getCurrentVersion?.()},async checkForUpdates(){if(!U()||G()!=="windows")return{isAvailable:!1,isMandatory:!1};return window.craft?.msixUpdate?.checkForUpdates?.()??{isAvailable:!1,isMandatory:!1}},async downloadAndInstall(J){if(!U()||G()!=="windows")return{success:!1,error:"MSIX not available"};return window.craft?.msixUpdate?.downloadAndInstall?.(J)??{success:!1}},onDownloadProgress(J){if(!U()||G()!=="windows")return;window.craft?.msixUpdate?.onDownloadProgress?.(J)},async isPackaged(){if(!U()||G()!=="windows")return!1;return window.craft?.msixUpdate?.isPackaged?.()??!1},async getInstallLocation(){if(!U()||G()!=="windows")return null;return window.craft?.msixUpdate?.getInstallLocation?.()}},aX={onShare(J){if(!U()||G()!=="windows")return;window.craft?.shareTarget?.onShare?.(J)},async wasLaunchedAsShareTarget(){if(!U()||G()!=="windows")return!1;return window.craft?.shareTarget?.wasLaunchedAsShareTarget?.()??!1},async getSharedData(){if(!U()||G()!=="windows")return[];return window.craft?.shareTarget?.getSharedData?.()??[]}},tX={async getState(){if(!U()||G()!=="windows")return"disabled";return window.craft?.startupTask?.getState?.()??"disabled"},async request(){if(!U()||G()!=="windows")return"disabled";return window.craft?.startupTask?.request?.()??"disabled"},async disable(){if(!U()||G()!=="windows")return;return window.craft?.startupTask?.disable?.()}},eX={async isSupported(){if(!U()||G()!=="windows")return!1;return window.craft?.secondaryTiles?.isSupported?.()??!1},async pin(J){if(!U()||G()!=="windows")return!1;return window.craft?.secondaryTiles?.pin?.(J)??!1},async unpin(J){if(!U()||G()!=="windows")return!1;return window.craft?.secondaryTiles?.unpin?.(J)??!1},async exists(J){if(!U()||G()!=="windows")return!1;return window.craft?.secondaryTiles?.exists?.(J)??!1},async getAll(){if(!U()||G()!=="windows")return[];return window.craft?.secondaryTiles?.getAll?.()??[]},async updateTile(J,$){if(!U()||G()!=="windows")return;return window.craft?.secondaryTiles?.updateTile?.(J,$)},async updateBadge(J,$){if(!U()||G()!=="windows")return;return window.craft?.secondaryTiles?.updateBadge?.(J,$)},async clearTile(J){if(!U()||G()!=="windows")return;return window.craft?.secondaryTiles?.clearTile?.(J)},onLaunch(J){if(!U()||G()!=="windows")return;window.craft?.secondaryTiles?.onLaunch?.(J)}},CJ=300000,bJ=3600000;async function f8(J={}){let $=J.multiple?"openFiles":"openFile";if(T()){let X=await C($,{type:"dialog",action:$,data:J},{timeoutMs:CJ}),Y=!!(X&&X.canceled===!0),Q=Array.isArray(X?.filePaths)?X.filePaths:[];return{canceled:Y,filePaths:Q}}return _().request(`dialog.${$}`,J)}async function m8(J={}){if(T()){let Z=await C("openFolder",{type:"dialog",action:"openFolder",data:J},{timeoutMs:CJ}),X=!!(Z&&Z.canceled===!0),Y=Array.isArray(Z?.filePaths)?Z.filePaths:[];return{canceled:X,filePaths:Y}}return _().request("dialog.openFolder",J)}async function p8(J={}){if(T()){let Z=await C("saveFile",{type:"dialog",action:"saveFile",data:J},{timeoutMs:CJ}),X=!!(Z&&Z.canceled===!0),Y=typeof Z?.filePath==="string"?Z.filePath:void 0;return{canceled:X,filePath:Y}}return _().request("dialog.saveFile",J)}async function c8(J){let $=typeof J==="string"?{title:J}:J;if(T()){let X=await C("showAlert",{type:"dialog",action:"showAlert",data:$},{timeoutMs:bJ});if(X&&typeof X.buttonIndex==="number")return X.buttonIndex;return 0}return _().request("dialog.showAlert",$)}async function d8(J){let $=typeof J==="string"?{title:J}:J;if(T()){let X=await C("showConfirm",{type:"dialog",action:"showConfirm",data:$},{timeoutMs:bJ});return!!(X&&X.ok===!0)}return _().request("dialog.showConfirm",$)}async function l8(J,$){if(T()){let X=await C("showPrompt",{type:"dialog",action:"showPrompt",data:{title:J,defaultValue:$}},{timeoutMs:bJ});if(X&&typeof X.value==="string")return X.value;return null}return _().request("dialog.showPrompt",{title:J,defaultValue:$})}var J9={openFile:f8,openFolder:m8,saveFile:p8,showAlert:c8,showConfirm:d8,showPrompt:l8},JJ=5000;async function T0(J){if(T()){wJ({type:"clipboard",action:"writeText",data:{text:J}});return}return _().request("clipboard.writeText",{text:J})}async function N0(){if(T()){let $=await C("readText",{type:"clipboard",action:"readText"},{timeoutMs:JJ});return $&&typeof $.text==="string"?$.text:""}return _().request("clipboard.readText")}async function B0(J){if(T()){wJ({type:"clipboard",action:"writeHTML",data:{html:J}});return}return _().request("clipboard.writeHTML",{html:J})}async function x0(){if(T()){let $=await C("readHTML",{type:"clipboard",action:"readHTML"},{timeoutMs:JJ});return $&&typeof $.html==="string"?$.html:""}return _().request("clipboard.readHTML")}async function n8(){if(T()){wJ({type:"clipboard",action:"clear"});return}return _().request("clipboard.clear")}async function s8(){if(T()){let $=await C("hasText",{type:"clipboard",action:"hasText"},{timeoutMs:JJ});return!!($&&$.value===!0)}return _().request("clipboard.hasText")}async function r8(){if(T()){let $=await C("hasHTML",{type:"clipboard",action:"hasHTML"},{timeoutMs:JJ});return!!($&&$.value===!0)}return _().request("clipboard.hasHTML")}async function i8(){if(T()){let $=await C("hasImage",{type:"clipboard",action:"hasImage"},{timeoutMs:JJ});return!!($&&$.value===!0)}return _().request("clipboard.hasImage")}async function o8(J){let $=[];if(J.text)$.push(T0(J.text));if(J.html)$.push(B0(J.html));await Promise.all($)}async function a8(){let[J,$]=await Promise.all([N0().catch((Z)=>{console.debug("[Craft Clipboard] readText failed:",Z);return}),x0().catch((Z)=>{console.debug("[Craft Clipboard] readHTML failed:",Z);return})]);return{text:J||void 0,html:$||void 0}}var $9={writeText:T0,readText:N0,writeHTML:B0,readHTML:x0,clear:n8,hasText:s8,hasHTML:r8,hasImage:i8,write:o8,read:a8};async function tJ(J,$){if(typeof navigator>"u"||!navigator.mediaDevices)return!1;try{if(navigator.permissions)try{let Y=await navigator.permissions.query({name:J});if(Y.state==="granted")return!0;if(Y.state==="denied")return!1}catch{}let X=(await navigator.mediaDevices.enumerateDevices()).filter((Y)=>Y.kind===$);if(X.length===0)return!1;return X.some((Y)=>typeof Y.label==="string"&&Y.label.length>0)}catch{return!1}}var Z9={async enumerateDevices(){if(typeof navigator>"u"||!navigator.mediaDevices)return[];try{return(await navigator.mediaDevices.enumerateDevices()).map(($)=>({deviceId:$.deviceId,groupId:$.groupId,kind:$.kind,label:$.label||`${$.kind} (${$.deviceId.slice(0,8)}...)`}))}catch{return[]}},async getCameras(){return(await this.enumerateDevices()).filter(($)=>$.kind==="videoinput")},async getMicrophones(){return(await this.enumerateDevices()).filter(($)=>$.kind==="audioinput")},async getSpeakers(){return(await this.enumerateDevices()).filter(($)=>$.kind==="audiooutput")},async getCamera(J){if(typeof navigator>"u"||!navigator.mediaDevices)throw Error("Media devices not available");let $={video:J?{deviceId:J.deviceId?{exact:J.deviceId}:void 0,facingMode:J.facingMode,width:J.width,height:J.height,frameRate:J.frameRate,aspectRatio:J.aspectRatio}:!0,audio:!1};return navigator.mediaDevices.getUserMedia($)},async getMicrophone(J){if(typeof navigator>"u"||!navigator.mediaDevices)throw Error("Media devices not available");let $={video:!1,audio:J?{deviceId:J.deviceId?{exact:J.deviceId}:void 0,echoCancellation:J.echoCancellation,noiseSuppression:J.noiseSuppression,autoGainControl:J.autoGainControl,sampleRate:J.sampleRate,channelCount:J.channelCount}:!0};return navigator.mediaDevices.getUserMedia($)},async getMediaStream(J){if(typeof navigator>"u"||!navigator.mediaDevices)throw Error("Media devices not available");let $={video:J.video===!0?!0:J.video?this._buildVideoConstraints(J.video):!1,audio:J.audio===!0?!0:J.audio?this._buildAudioConstraints(J.audio):!1};return navigator.mediaDevices.getUserMedia($)},async hasCameraAccess(){return tJ("camera","videoinput")},async hasMicrophoneAccess(){return tJ("microphone","audioinput")},async requestPermission(J={}){let{camera:$=!1,microphone:Z=!1}=J;if(!$&&!Z)return!0;try{return(await this.getMediaStream({video:$,audio:Z})).getTracks().forEach((Y)=>Y.stop()),!0}catch{return!1}},stopStream(J){J.getTracks().forEach(($)=>$.stop())},onDeviceChange(J){if(typeof navigator>"u"||!navigator.mediaDevices)return()=>{};return navigator.mediaDevices.addEventListener("devicechange",J),()=>navigator.mediaDevices.removeEventListener("devicechange",J)},_buildVideoConstraints(J){return{deviceId:J.deviceId?{exact:J.deviceId}:void 0,facingMode:J.facingMode,width:J.width,height:J.height,frameRate:J.frameRate,aspectRatio:J.aspectRatio}},_buildAudioConstraints(J){return{deviceId:J.deviceId?{exact:J.deviceId}:void 0,echoCancellation:J.echoCancellation,noiseSuppression:J.noiseSuppression,autoGainControl:J.autoGainControl,sampleRate:J.sampleRate,channelCount:J.channelCount}}};function t8(J){switch(J){case"macos":case"darwin":return{width:220,platform:{macos:{vibrancy:!0,material:"sidebar",trafficLightsInSidebar:!1,hideTitlebarSeparator:!1}}};case"windows":case"win32":return{width:200,platform:{windows:{material:"mica",rounded:!0}}};case"linux":return{width:200,platform:{linux:{theme:"auto"}}};default:return{width:220}}}function e8(J,$){let X=`
|
|
66
|
+
.craft-sidebar {
|
|
67
|
+
width: ${J.width||220}px;
|
|
68
|
+
height: 100%;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
user-select: none;
|
|
72
|
+
font-family: var(--craft-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
|
|
73
|
+
font-size: var(--craft-font-size, 13px);
|
|
74
|
+
}
|
|
75
|
+
.craft-sidebar-header {
|
|
76
|
+
padding: 12px 16px;
|
|
77
|
+
border-bottom: 1px solid var(--craft-border);
|
|
78
|
+
}
|
|
79
|
+
.craft-sidebar-header-title {
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
}
|
|
83
|
+
.craft-sidebar-header-subtitle {
|
|
84
|
+
font-size: 11px;
|
|
85
|
+
opacity: 0.7;
|
|
86
|
+
margin-top: 2px;
|
|
87
|
+
}
|
|
88
|
+
.craft-sidebar-search {
|
|
89
|
+
padding: 8px 12px;
|
|
90
|
+
}
|
|
91
|
+
.craft-sidebar-search input {
|
|
92
|
+
width: 100%;
|
|
93
|
+
padding: 6px 10px;
|
|
94
|
+
border-radius: var(--craft-radius, 6px);
|
|
95
|
+
border: 1px solid var(--craft-border);
|
|
96
|
+
background: var(--craft-input-bg);
|
|
97
|
+
color: var(--craft-text);
|
|
98
|
+
font-size: 13px;
|
|
99
|
+
outline: none;
|
|
100
|
+
}
|
|
101
|
+
.craft-sidebar-search input:focus {
|
|
102
|
+
border-color: var(--craft-accent);
|
|
103
|
+
}
|
|
104
|
+
.craft-sidebar-content {
|
|
105
|
+
flex: 1;
|
|
106
|
+
overflow-y: auto;
|
|
107
|
+
overflow-x: hidden;
|
|
108
|
+
padding: 4px 0;
|
|
109
|
+
}
|
|
110
|
+
.craft-sidebar-section {
|
|
111
|
+
margin-bottom: 8px;
|
|
112
|
+
}
|
|
113
|
+
.craft-sidebar-section-header {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
padding: 6px 12px;
|
|
117
|
+
font-size: 11px;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
text-transform: uppercase;
|
|
120
|
+
letter-spacing: 0.5px;
|
|
121
|
+
opacity: 0.6;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
}
|
|
124
|
+
.craft-sidebar-section-header:hover {
|
|
125
|
+
opacity: 0.8;
|
|
126
|
+
}
|
|
127
|
+
.craft-sidebar-section-chevron {
|
|
128
|
+
width: 12px;
|
|
129
|
+
height: 12px;
|
|
130
|
+
margin-right: 4px;
|
|
131
|
+
transition: transform 0.15s;
|
|
132
|
+
}
|
|
133
|
+
.craft-sidebar-section-header.collapsed .craft-sidebar-section-chevron {
|
|
134
|
+
transform: rotate(-90deg);
|
|
135
|
+
}
|
|
136
|
+
.craft-sidebar-section-items {
|
|
137
|
+
transition: max-height 0.2s ease-out, opacity 0.15s;
|
|
138
|
+
}
|
|
139
|
+
.craft-sidebar-section-items.collapsed {
|
|
140
|
+
max-height: 0;
|
|
141
|
+
opacity: 0;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
.craft-sidebar-item {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
padding: 6px 12px 6px 16px;
|
|
148
|
+
margin: 1px 8px;
|
|
149
|
+
border-radius: var(--craft-radius, 6px);
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
gap: 8px;
|
|
152
|
+
transition: background 0.1s;
|
|
153
|
+
}
|
|
154
|
+
.craft-sidebar-item:hover {
|
|
155
|
+
background: var(--craft-hover);
|
|
156
|
+
}
|
|
157
|
+
.craft-sidebar-item.selected {
|
|
158
|
+
background: var(--craft-accent);
|
|
159
|
+
color: var(--craft-accent-text, #fff);
|
|
160
|
+
}
|
|
161
|
+
.craft-sidebar-item-icon {
|
|
162
|
+
width: 16px;
|
|
163
|
+
height: 16px;
|
|
164
|
+
flex-shrink: 0;
|
|
165
|
+
}
|
|
166
|
+
.craft-sidebar-item-label {
|
|
167
|
+
flex: 1;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
text-overflow: ellipsis;
|
|
171
|
+
}
|
|
172
|
+
.craft-sidebar-item-badge {
|
|
173
|
+
padding: 2px 6px;
|
|
174
|
+
border-radius: 10px;
|
|
175
|
+
font-size: 11px;
|
|
176
|
+
font-weight: 500;
|
|
177
|
+
background: var(--craft-badge-bg);
|
|
178
|
+
}
|
|
179
|
+
.craft-sidebar-item.selected .craft-sidebar-item-badge {
|
|
180
|
+
background: rgba(255,255,255,0.25);
|
|
181
|
+
}
|
|
182
|
+
.craft-sidebar-footer {
|
|
183
|
+
padding: 8px 12px;
|
|
184
|
+
border-top: 1px solid var(--craft-border);
|
|
185
|
+
display: flex;
|
|
186
|
+
gap: 4px;
|
|
187
|
+
}
|
|
188
|
+
`,Y="";if($==="macos"||$==="darwin"){let Q=J.platform?.macos;Y=`
|
|
189
|
+
:root {
|
|
190
|
+
--craft-font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
|
|
191
|
+
--craft-bg: ${Q?.vibrancy?"rgba(246,246,246,0.8)":"#f6f6f6"};
|
|
192
|
+
--craft-bg-dark: ${Q?.vibrancy?"rgba(30,30,30,0.8)":"#1e1e1e"};
|
|
193
|
+
--craft-text: #1d1d1f;
|
|
194
|
+
--craft-text-dark: #f5f5f7;
|
|
195
|
+
--craft-border: rgba(0,0,0,0.1);
|
|
196
|
+
--craft-border-dark: rgba(255,255,255,0.1);
|
|
197
|
+
--craft-hover: rgba(0,0,0,0.04);
|
|
198
|
+
--craft-hover-dark: rgba(255,255,255,0.06);
|
|
199
|
+
--craft-accent: #007aff;
|
|
200
|
+
--craft-accent-text: #fff;
|
|
201
|
+
--craft-input-bg: rgba(0,0,0,0.05);
|
|
202
|
+
--craft-input-bg-dark: rgba(255,255,255,0.08);
|
|
203
|
+
--craft-badge-bg: rgba(0,0,0,0.08);
|
|
204
|
+
--craft-badge-bg-dark: rgba(255,255,255,0.1);
|
|
205
|
+
--craft-radius: 6px;
|
|
206
|
+
}
|
|
207
|
+
.craft-sidebar {
|
|
208
|
+
background: var(--craft-bg);
|
|
209
|
+
color: var(--craft-text);
|
|
210
|
+
${Q?.vibrancy?"backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);":""}
|
|
211
|
+
border-right: 1px solid var(--craft-border);
|
|
212
|
+
}
|
|
213
|
+
@media (prefers-color-scheme: dark) {
|
|
214
|
+
.craft-sidebar {
|
|
215
|
+
background: var(--craft-bg-dark);
|
|
216
|
+
color: var(--craft-text-dark);
|
|
217
|
+
border-color: var(--craft-border-dark);
|
|
218
|
+
}
|
|
219
|
+
.craft-sidebar-item:hover { background: var(--craft-hover-dark); }
|
|
220
|
+
.craft-sidebar-search input { background: var(--craft-input-bg-dark); }
|
|
221
|
+
.craft-sidebar-item-badge { background: var(--craft-badge-bg-dark); }
|
|
222
|
+
}
|
|
223
|
+
`}else if($==="windows"||$==="win32"){let Q=J.platform?.windows;Y=`
|
|
224
|
+
:root {
|
|
225
|
+
--craft-font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
|
|
226
|
+
--craft-bg: ${Q?.material==="mica"?"rgba(243,243,243,0.9)":"#f3f3f3"};
|
|
227
|
+
--craft-bg-dark: ${Q?.material==="mica"?"rgba(32,32,32,0.9)":"#202020"};
|
|
228
|
+
--craft-text: #1a1a1a;
|
|
229
|
+
--craft-text-dark: #fff;
|
|
230
|
+
--craft-border: rgba(0,0,0,0.08);
|
|
231
|
+
--craft-border-dark: rgba(255,255,255,0.08);
|
|
232
|
+
--craft-hover: rgba(0,0,0,0.04);
|
|
233
|
+
--craft-hover-dark: rgba(255,255,255,0.06);
|
|
234
|
+
--craft-accent: #0078d4;
|
|
235
|
+
--craft-accent-text: #fff;
|
|
236
|
+
--craft-input-bg: #fff;
|
|
237
|
+
--craft-input-bg-dark: rgba(255,255,255,0.06);
|
|
238
|
+
--craft-badge-bg: rgba(0,0,0,0.05);
|
|
239
|
+
--craft-badge-bg-dark: rgba(255,255,255,0.08);
|
|
240
|
+
--craft-radius: ${Q?.rounded?"4px":"0"};
|
|
241
|
+
}
|
|
242
|
+
.craft-sidebar {
|
|
243
|
+
background: var(--craft-bg);
|
|
244
|
+
color: var(--craft-text);
|
|
245
|
+
${Q?.material!=="none"?"backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);":""}
|
|
246
|
+
}
|
|
247
|
+
@media (prefers-color-scheme: dark) {
|
|
248
|
+
.craft-sidebar {
|
|
249
|
+
background: var(--craft-bg-dark);
|
|
250
|
+
color: var(--craft-text-dark);
|
|
251
|
+
}
|
|
252
|
+
.craft-sidebar-item:hover { background: var(--craft-hover-dark); }
|
|
253
|
+
.craft-sidebar-search input { background: var(--craft-input-bg-dark); border-color: var(--craft-border-dark); }
|
|
254
|
+
.craft-sidebar-item-badge { background: var(--craft-badge-bg-dark); }
|
|
255
|
+
}
|
|
256
|
+
`}else Y=`
|
|
257
|
+
:root {
|
|
258
|
+
--craft-font-family: 'Cantarell', 'Ubuntu', sans-serif;
|
|
259
|
+
--craft-bg: #f6f5f4;
|
|
260
|
+
--craft-bg-dark: #303030;
|
|
261
|
+
--craft-text: #2e3436;
|
|
262
|
+
--craft-text-dark: #fff;
|
|
263
|
+
--craft-border: rgba(0,0,0,0.12);
|
|
264
|
+
--craft-border-dark: rgba(255,255,255,0.12);
|
|
265
|
+
--craft-hover: rgba(0,0,0,0.05);
|
|
266
|
+
--craft-hover-dark: rgba(255,255,255,0.08);
|
|
267
|
+
--craft-accent: #3584e4;
|
|
268
|
+
--craft-accent-text: #fff;
|
|
269
|
+
--craft-input-bg: #fff;
|
|
270
|
+
--craft-input-bg-dark: rgba(255,255,255,0.08);
|
|
271
|
+
--craft-badge-bg: rgba(0,0,0,0.08);
|
|
272
|
+
--craft-badge-bg-dark: rgba(255,255,255,0.12);
|
|
273
|
+
--craft-radius: 6px;
|
|
274
|
+
}
|
|
275
|
+
.craft-sidebar {
|
|
276
|
+
background: var(--craft-bg);
|
|
277
|
+
color: var(--craft-text);
|
|
278
|
+
border-right: 1px solid var(--craft-border);
|
|
279
|
+
}
|
|
280
|
+
@media (prefers-color-scheme: dark) {
|
|
281
|
+
.craft-sidebar {
|
|
282
|
+
background: var(--craft-bg-dark);
|
|
283
|
+
color: var(--craft-text-dark);
|
|
284
|
+
border-color: var(--craft-border-dark);
|
|
285
|
+
}
|
|
286
|
+
.craft-sidebar-item:hover { background: var(--craft-hover-dark); }
|
|
287
|
+
.craft-sidebar-search input { background: var(--craft-input-bg-dark); border-color: var(--craft-border-dark); }
|
|
288
|
+
.craft-sidebar-item-badge { background: var(--craft-badge-bg-dark); }
|
|
289
|
+
}
|
|
290
|
+
`;return X+Y}function y(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J$(J){let $=(X)=>`
|
|
291
|
+
<div class="craft-sidebar-item${X.selected?" selected":""}" data-id="${y(X.id)}">
|
|
292
|
+
${X.icon?`<span class="craft-sidebar-item-icon">${$$(X.icon,X.tintColor)}</span>`:""}
|
|
293
|
+
<span class="craft-sidebar-item-label">${y(X.label)}</span>
|
|
294
|
+
${X.badge!==void 0?`<span class="craft-sidebar-item-badge">${y(String(X.badge))}</span>`:""}
|
|
295
|
+
</div>
|
|
296
|
+
`,Z=(X)=>`
|
|
297
|
+
<div class="craft-sidebar-section" data-section="${y(X.id)}">
|
|
298
|
+
${X.title?`
|
|
299
|
+
<div class="craft-sidebar-section-header${X.collapsed?" collapsed":""}" data-section-toggle="${y(X.id)}">
|
|
300
|
+
${X.collapsible!==!1?'<svg class="craft-sidebar-section-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m9 18 6-6-6-6"/></svg>':""}
|
|
301
|
+
${y(X.title)}
|
|
302
|
+
</div>
|
|
303
|
+
`:""}
|
|
304
|
+
<div class="craft-sidebar-section-items${X.collapsed?" collapsed":""}" data-section-items="${y(X.id)}">
|
|
305
|
+
${X.items.map($).join("")}
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
`;return`
|
|
309
|
+
<aside class='craft-sidebar'>
|
|
310
|
+
${J.headerTitle?`
|
|
311
|
+
<div class='craft-sidebar-header'>
|
|
312
|
+
<div class='craft-sidebar-header-title'>${y(J.headerTitle)}</div>
|
|
313
|
+
${J.headerSubtitle?`<div class="craft-sidebar-header-subtitle">${y(J.headerSubtitle)}</div>`:""}
|
|
314
|
+
</div>
|
|
315
|
+
`:""}
|
|
316
|
+
${J.showSearch?`
|
|
317
|
+
<div class='craft-sidebar-search'>
|
|
318
|
+
<input type='text' placeholder='${y(J.searchPlaceholder||"Search")}' data-sidebar-search>
|
|
319
|
+
</div>
|
|
320
|
+
`:""}
|
|
321
|
+
<div class='craft-sidebar-content'>
|
|
322
|
+
${J.sections?.map(Z).join("")||""}
|
|
323
|
+
${J.items?.map($).join("")||""}
|
|
324
|
+
</div>
|
|
325
|
+
</aside>
|
|
326
|
+
`}function $$(J,$){let Z=y($||"currentColor"),X={folder:`<svg viewBox='0 0 24 24' fill='${Z}'><path d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/></svg>`,file:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/><polyline points='13 2 13 9 20 9'/></svg>`,home:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/></svg>`,download:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>`,cloud:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z'/></svg>`,star:`<svg viewBox='0 0 24 24' fill='${Z}'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>`,settings:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><circle cx='12' cy='12' r='3'/><path d='M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72 1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/></svg>`,user:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>`,users:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M23 21v-2a4 4 0 0 0-3-3.87m-4-12a4 4 0 0 1 0 7.75'/></svg>`,clock:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>`,computer:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><rect x='2' y='3' width='20' height='14' rx='2' ry='2'/><line x1='8' y1='21' x2='16' y2='21'/><line x1='12' y1='17' x2='12' y2='21'/></svg>`,globe:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><circle cx='12' cy='12' r='10'/><line x1='2' y1='12' x2='22' y2='12'/><path d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/></svg>`,tag:`<svg viewBox='0 0 24 24' fill='${Z}'><circle cx='12' cy='12' r='8'/></svg>`,wifi:`<svg viewBox='0 0 24 24' fill='none' stroke='${Z}' stroke-width='2'><path d='M5 12.55a11 11 0 0 1 14.08 0M1.42 9a16 16 0 0 1 21.16 0M8.53 16.11a6 6 0 0 1 6.95 0M12 20h.01'/></svg>`};return X[J]||X.file}class $J{config;element=null;onSelectHandler;onSearchHandler;listenerCleanups=[];constructor(J={}){let $=G(),Z=t8($);this.config={...Z,...J}}render(){let J=G();return{html:J$(this.config),css:e8(this.config,J)}}mount(J="body"){let $=typeof J==="string"?document.querySelector(J):J;if(!$){console.error("[Sidebar] Container not found");return}let{html:Z,css:X}=this.render(),Y=document.createElement("style");Y.textContent=X,document.head.appendChild(Y),$.insertAdjacentHTML("afterbegin",Z),this.element=$.querySelector(".craft-sidebar"),this.attachEventListeners()}update(J){if(this.config={...this.config,...J},this.element){this.detachEventListeners();let{html:$}=this.render();this.element.outerHTML=$,this.element=document.querySelector(".craft-sidebar"),this.attachEventListeners()}}destroy(){if(this.detachEventListeners(),this.element)this.element.remove(),this.element=null}detachEventListeners(){for(let J of this.listenerCleanups)J();this.listenerCleanups=[]}selectItem(J){if(!this.element)return;this.element.querySelectorAll(".craft-sidebar-item").forEach(($)=>{$.classList.toggle("selected",$.getAttribute("data-id")===J)})}onSelect(J){this.onSelectHandler=J}onSearch(J){this.onSearchHandler=J}attachEventListeners(){if(!this.element)return;let J=(Z,X,Y)=>{Z.addEventListener(X,Y),this.listenerCleanups.push(()=>Z.removeEventListener(X,Y))};this.element.querySelectorAll(".craft-sidebar-item").forEach((Z)=>{J(Z,"click",()=>{let X=Z.getAttribute("data-id");if(!X)return;if(this.element?.querySelectorAll(".craft-sidebar-item").forEach((Y)=>{Y.classList.remove("selected")}),Z.classList.add("selected"),this.onSelectHandler){let Y=this.findItem(X);this.onSelectHandler({itemId:X,item:Y||{id:X,label:""}})}})}),this.element.querySelectorAll("[data-section-toggle]").forEach((Z)=>{J(Z,"click",()=>{let X=Z.getAttribute("data-section-toggle"),Y=this.element?.querySelector(`[data-section-items='${X}']`);if(Y)Z.classList.toggle("collapsed"),Y.classList.toggle("collapsed")})});let $=this.element.querySelector("[data-sidebar-search]");if($){let Z=this.config.searchDebounceMs??80,X=null;this.listenerCleanups.push(()=>{if(X)clearTimeout(X)}),J($,"input",()=>{let Y=$.value.toLowerCase();if(this.element?.querySelectorAll(".craft-sidebar-item").forEach((Q)=>{let q=Q.querySelector(".craft-sidebar-item-label")?.textContent?.toLowerCase()||"";Q.style.display=q.includes(Y)?"":"none"}),!this.onSearchHandler)return;if(Z<=0){this.onSearchHandler({query:$.value});return}if(X)clearTimeout(X);X=setTimeout(()=>{X=null,this.onSearchHandler?.({query:$.value})},Z)})}}findItem(J){let $=(Z)=>{for(let X of Z){if(X.id===J)return X;if(X.children){let Y=$(X.children);if(Y)return Y}}};if(this.config.items){let Z=$(this.config.items);if(Z)return Z}for(let Z of this.config.sections||[]){let X=$(Z.items);if(X)return X}}}function Z$(J={}){return new $J(J)}function X$(J){let $=G(),Z=$==="macos"||$==="darwin";return new $J({sections:J||[{id:"favorites",title:"Favorites",collapsible:!0,items:[{id:"home",label:"Home",icon:"home"},{id:"desktop",label:"Desktop",icon:"computer"},{id:"documents",label:"Documents",icon:"folder"},{id:"downloads",label:"Downloads",icon:"download"}]},{id:"cloud",title:Z?"iCloud":"Cloud",collapsible:!0,items:[{id:"cloud-drive",label:Z?"iCloud Drive":"Cloud Storage",icon:"cloud"}]},{id:"locations",title:"Locations",collapsible:!0,items:[{id:"this-pc",label:Z?"This Mac":"This PC",icon:"computer"},{id:"network",label:"Network",icon:"globe"}]}],showSearch:!0,searchPlaceholder:"Search"})}function Y$(J){return new $J({items:J,showSearch:!0,searchPlaceholder:"Search settings",platform:{macos:{vibrancy:!0,trafficLightsInSidebar:!0,hideTitlebarSeparator:!0},windows:{material:"mica",rounded:!0}}})}var X9={create:Z$,file:X$,settings:Y$,Sidebar:$J},Q$={};q0(Q$,{updateTouchBarItem:()=>S$,updateToolbarItem:()=>N$,tahoeStyle:()=>yJ,sidebarSeparator:()=>W$,sidebarSection:()=>H$,sidebarItem:()=>K$,showQuickLook:()=>j$,showFontPicker:()=>D$,showDatePicker:()=>M$,showColorPicker:()=>_$,setTouchBar:()=>x$,setToolbarVisible:()=>B$,setToolbar:()=>T$,orbstackStyle:()=>hJ,hideQuickLook:()=>A$,default:()=>P$,createTahoeSidebar:()=>G$,createTableView:()=>F$,createSplitView:()=>V$,createSidebar:()=>z$,createProgress:()=>E$,createOutlineView:()=>R$,createOrbStackSidebar:()=>q$,createFileBrowser:()=>L$,createArcSidebar:()=>U$,canQuickLook:()=>O$,arcStyle:()=>vJ,TableViewInstance:()=>mJ,StyleSheet:()=>k0,SplitViewInstance:()=>uJ,Sidebar:()=>r,ProgressInstance:()=>pJ,Platform:()=>S0,OutlineViewInstance:()=>fJ,FileBrowserInstance:()=>gJ,Animated:()=>w0});var yJ={style:"tahoe",width:220,minWidth:150,maxWidth:350,collapsible:!0,collapsedWidth:0,resizable:!0,background:"sidebar",showSeparator:!1,searchable:!0,searchPlaceholder:"Search",dragAndDrop:!0},vJ={style:"arc",width:260,minWidth:48,maxWidth:320,collapsible:!0,collapsedWidth:48,resizable:!0,background:"under-window",showSeparator:!0,searchable:!0,searchPlaceholder:"Search tabs...",dragAndDrop:!0},hJ={style:"orbstack",width:200,minWidth:160,maxWidth:280,collapsible:!0,collapsedWidth:0,resizable:!1,background:"#1a1a1a",showSeparator:!0,separatorColor:"#333",searchable:!1,dragAndDrop:!1};class r{_id;_config;_listeners=new Map;_items=new Map;_selectedId=null;_destroyed=!1;constructor(J={}){this._id=`sidebar_${Date.now()}`,this._config=this._applyStylePreset(J),this._indexItems(),this._setupEventListeners()}get id(){return this._id}get config(){return{...this._config}}get selectedId(){return this._selectedId}get selectedItem(){return this._selectedId?this._items.get(this._selectedId)||null:null}get isCollapsed(){return this._config.collapsed||!1}_applyStylePreset(J){let $={};switch(J.style){case"tahoe":$=yJ;break;case"arc":$=vJ;break;case"orbstack":$=hJ;break}return{...$,...J}}_indexItems(){this._items.clear();let J=($)=>{if(!$)return;$.forEach((Z)=>{if(this._items.set(Z.id,Z),Z.children)J(Z.children)})};J(this._config.items),this._config.sections?.forEach(($)=>{J($.items)})}_setupEventListeners(){if(typeof window<"u")["select","double-click","context-menu","expand","collapse","resize","search","drag-start","drag-end","drop","reorder","header-action","footer-action"].forEach(($)=>{window.addEventListener(`craft:sidebar:${$}`,(Z)=>{if(Z.detail?.sidebarId===this._id){if($==="select")this._selectedId=Z.detail?.item?.id||null;this._emit($,Z.detail)}})})}_emit(J,$){let Z=this._listeners.get(J);if(Z)Z.forEach((X)=>X($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>{this._listeners.get(J)?.delete($)}}once(J,$){let Z=(X)=>{this._listeners.get(J)?.delete(Z),$(X)};return this.on(J,Z)}off(J,$){this._listeners.get(J)?.delete($)}async create(){await this._call("create",{config:this._config})}async update(J){this._config={...this._config,...J},this._indexItems(),await this._call("update",{config:this._config})}async collapse(){this._config.collapsed=!0,await this._call("collapse")}async expand(){this._config.collapsed=!1,await this._call("expand")}async toggle(){if(this._config.collapsed)await this.expand();else await this.collapse()}async setWidth(J){this._config.width=Math.max(this._config.minWidth||0,Math.min(J,this._config.maxWidth||1/0)),await this._call("setWidth",{width:this._config.width})}async destroy(){await this._call("destroy"),this._destroyed=!0,this._listeners.clear()}async select(J){this._selectedId=J,await this._call("select",{itemId:J})}async clearSelection(){this._selectedId=null,await this._call("clearSelection")}getItem(J){return this._items.get(J)}async addItem(J,$){this._items.set(J.id,J),await this._call("addItem",{item:J,...$})}async updateItem(J,$){let Z=this._items.get(J);if(Z)Object.assign(Z,$),await this._call("updateItem",{itemId:J,updates:$})}async removeItem(J){if(this._items.delete(J),this._selectedId===J)this._selectedId=null;await this._call("removeItem",{itemId:J})}async setItems(J){this._config.items=J,this._indexItems(),await this._call("setItems",{items:J})}async setSections(J){this._config.sections=J,this._indexItems(),await this._call("setSections",{sections:J})}async expandItem(J){let $=this._items.get(J);if($)$.expanded=!0,await this._call("expandItem",{itemId:J})}async collapseItem(J){let $=this._items.get(J);if($)$.expanded=!1,await this._call("collapseItem",{itemId:J})}async scrollToItem(J){await this._call("scrollToItem",{itemId:J})}async setBadge(J,$){let Z=this._items.get(J);if(Z)Z.badge=$??void 0,await this._call("setBadge",{itemId:J,badge:$})}async addSection(J,$){if(!this._config.sections)this._config.sections=[];if($!==void 0)this._config.sections.splice($,0,J);else this._config.sections.push(J);J.items.forEach((Z)=>this._items.set(Z.id,Z)),await this._call("addSection",{section:J,index:$})}async updateSection(J,$){let Z=this._config.sections?.find((X)=>X.id===J);if(Z){if(Object.assign(Z,$),$.items)$.items.forEach((X)=>this._items.set(X.id,X));await this._call("updateSection",{sectionId:J,updates:$})}}async removeSection(J){let $=this._config.sections?.findIndex((Z)=>Z.id===J);if($!==void 0&&$>=0&&this._config.sections)this._config.sections[$].items.forEach((X)=>this._items.delete(X.id)),this._config.sections.splice($,1),await this._call("removeSection",{sectionId:J})}async collapseSection(J){let $=this._config.sections?.find((Z)=>Z.id===J);if($)$.collapsed=!0,await this._call("collapseSection",{sectionId:J})}async expandSection(J){let $=this._config.sections?.find((Z)=>Z.id===J);if($)$.collapsed=!1,await this._call("expandSection",{sectionId:J})}async setSearchQuery(J){await this._call("setSearchQuery",{query:J})}async clearSearch(){await this._call("clearSearch")}async focusSearch(){await this._call("focusSearch")}async _call(J,$){let Z={sidebarId:this._id,...$};if(typeof window<"u"&&window.webkit?.messageHandlers?.craft)return new Promise((Y,Q)=>{try{window.webkit.messageHandlers.craft.postMessage({type:"sidebar",action:J,data:Z}),Y(void 0)}catch(q){Q(q)}});return _().request(`sidebar.${J}`,Z)}}function G$(J={}){return new r({...yJ,...J,style:"tahoe"})}function U$(J={}){return new r({...vJ,...J,style:"arc"})}function q$(J={}){return new r({...hJ,...J,style:"orbstack"})}function z$(J={}){return new r(J)}function K$(J,$,Z={}){return{id:J,label:$,...Z}}function H$(J,$,Z={}){return{id:J,items:$,...Z}}function W$(J){return{id:J||`separator_${Date.now()}`,label:"",disabled:!0}}var eJ=0;function ZJ(J){return eJ++,`${J}_${Date.now()}_${eJ}`}async function V$(J={}){let $=J.id||ZJ("splitview");return await W("component.createSplitView",{id:$,config:J}),new uJ($,J)}class uJ{id;type="splitView";_config;_listeners=new Map;constructor(J,$){this.id=J,this._config=$,this._setupListeners()}_setupListeners(){if(typeof window<"u")window.addEventListener(`craft:splitView:${this.id}:resize`,(J)=>{this._emit("resize",J.detail)})}_emit(J,$){this._listeners.get(J)?.forEach((Z)=>Z($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>this._listeners.get(J)?.delete($)}async update(J){Object.assign(this._config,J),await W("component.update",{id:this.id,props:J})}async destroy(){await W("component.destroy",{id:this.id})}async show(){await W("component.show",{id:this.id})}async hide(){await W("component.hide",{id:this.id})}async focus(){await W("component.focus",{id:this.id})}async setPosition(J,$){this._config.position=J,await W("splitView.setPosition",{id:this.id,position:J,animated:$})}async getPosition(){return W("splitView.getPosition",{id:this.id})}async collapsePane(J){await W("splitView.collapsePane",{id:this.id,index:J})}async expandPane(J){await W("splitView.expandPane",{id:this.id,index:J})}}async function L$(J={}){let $=J.id||ZJ("filebrowser");return await W("component.createFileBrowser",{id:$,config:J}),new gJ($,J)}class gJ{id;type="fileBrowser";_config;_listeners=new Map;constructor(J,$){this.id=J,this._config=$,this._setupListeners()}_setupListeners(){if(typeof window<"u")["select","open","navigate","context-menu"].forEach(($)=>{window.addEventListener(`craft:fileBrowser:${this.id}:${$}`,(Z)=>{this._emit($,Z.detail)})})}_emit(J,$){this._listeners.get(J)?.forEach((Z)=>Z($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>this._listeners.get(J)?.delete($)}async update(J){Object.assign(this._config,J),await W("component.update",{id:this.id,props:J})}async destroy(){await W("component.destroy",{id:this.id})}async show(){await W("component.show",{id:this.id})}async hide(){await W("component.hide",{id:this.id})}async focus(){await W("component.focus",{id:this.id})}async getSelection(){return W("fileBrowser.getSelection",{id:this.id})}async setSelection(J){await W("fileBrowser.setSelection",{id:this.id,paths:J})}async navigateTo(J){await W("fileBrowser.navigateTo",{id:this.id,path:J})}async goBack(){await W("fileBrowser.goBack",{id:this.id})}async goForward(){await W("fileBrowser.goForward",{id:this.id})}async goUp(){await W("fileBrowser.goUp",{id:this.id})}async refresh(){await W("fileBrowser.refresh",{id:this.id})}async createFolder(J){return W("fileBrowser.createFolder",{id:this.id,name:J})}async deleteSelection(J){await W("fileBrowser.deleteSelection",{id:this.id,moveToTrash:J})}async getCurrentPath(){return W("fileBrowser.getCurrentPath",{id:this.id})}}async function R$(J={}){let $=J.id||ZJ("outlineview");return await W("component.createOutlineView",{id:$,config:J}),new fJ($,J)}class fJ{id;type="outlineView";_config;_listeners=new Map;constructor(J,$){this.id=J,this._config=$,this._setupListeners()}_setupListeners(){if(typeof window<"u")["select","double-click","expand","collapse","reorder","edit"].forEach(($)=>{window.addEventListener(`craft:outlineView:${this.id}:${$}`,(Z)=>{this._emit($,Z.detail)})})}_emit(J,$){this._listeners.get(J)?.forEach((Z)=>Z($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>this._listeners.get(J)?.delete($)}async update(J){Object.assign(this._config,J),await W("component.update",{id:this.id,props:J})}async destroy(){await W("component.destroy",{id:this.id})}async show(){await W("component.show",{id:this.id})}async hide(){await W("component.hide",{id:this.id})}async focus(){await W("component.focus",{id:this.id})}async setItems(J){this._config.items=J,await W("outlineView.setItems",{id:this.id,items:J})}async addItem(J,$,Z){await W("outlineView.addItem",{id:this.id,item:J,parentId:$,index:Z})}async updateItem(J,$){await W("outlineView.updateItem",{id:this.id,itemId:J,updates:$})}async removeItem(J){await W("outlineView.removeItem",{id:this.id,itemId:J})}async expandItem(J){await W("outlineView.expandItem",{id:this.id,itemId:J})}async collapseItem(J){await W("outlineView.collapseItem",{id:this.id,itemId:J})}async selectItem(J){await W("outlineView.selectItem",{id:this.id,itemId:J})}async getSelection(){return W("outlineView.getSelection",{id:this.id})}async scrollToItem(J){await W("outlineView.scrollToItem",{id:this.id,itemId:J})}}async function F$(J={}){let $=J.id||ZJ("tableview");return await W("component.createTableView",{id:$,config:J}),new mJ($,J)}class mJ{id;type="tableView";_config;_listeners=new Map;constructor(J,$){this.id=J,this._config=$,this._setupListeners()}_setupListeners(){if(typeof window<"u")["select","double-click","sort","edit","column-resize","column-reorder"].forEach(($)=>{window.addEventListener(`craft:tableView:${this.id}:${$}`,(Z)=>{this._emit($,Z.detail)})})}_emit(J,$){this._listeners.get(J)?.forEach((Z)=>Z($))}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>this._listeners.get(J)?.delete($)}async update(J){Object.assign(this._config,J),await W("component.update",{id:this.id,props:J})}async destroy(){await W("component.destroy",{id:this.id})}async show(){await W("component.show",{id:this.id})}async hide(){await W("component.hide",{id:this.id})}async focus(){await W("component.focus",{id:this.id})}async setColumns(J){this._config.columns=J,await W("tableView.setColumns",{id:this.id,columns:J})}async setRows(J){this._config.rows=J,await W("tableView.setRows",{id:this.id,rows:J})}async addRow(J,$){await W("tableView.addRow",{id:this.id,row:J,index:$})}async updateRow(J,$){await W("tableView.updateRow",{id:this.id,rowId:J,values:$})}async removeRow(J){await W("tableView.removeRow",{id:this.id,rowId:J})}async getSelection(){return W("tableView.getSelection",{id:this.id})}async selectRows(J){await W("tableView.selectRows",{id:this.id,rowIds:J})}async sortBy(J,$){await W("tableView.sortBy",{id:this.id,columnId:J,direction:$})}async scrollToRow(J){await W("tableView.scrollToRow",{id:this.id,rowId:J})}}async function j$(J){await W("quickLook.show",J)}async function A$(){await W("quickLook.hide",{})}async function O$(J){return W("quickLook.canPreview",{path:J})}async function _$(J={}){return W("colorPicker.show",J)}async function D$(J={}){return W("fontPicker.show",J)}async function M$(J={}){let $=await W("datePicker.show",J);return $?new Date($):null}async function E$(J={}){let $=J.id||ZJ("progress");return await W("component.createProgress",{id:$,config:J}),new pJ($,J)}class pJ{id;type="progress";_config;_listeners=new Map;constructor(J,$){this.id=J,this._config=$}on(J,$){if(!this._listeners.has(J))this._listeners.set(J,new Set);return this._listeners.get(J).add($),()=>this._listeners.get(J)?.delete($)}async update(J){Object.assign(this._config,J),await W("component.update",{id:this.id,props:J})}async destroy(){await W("component.destroy",{id:this.id})}async show(){await W("component.show",{id:this.id})}async hide(){await W("component.hide",{id:this.id})}async focus(){await W("component.focus",{id:this.id})}async setValue(J){this._config.value=J,await W("progress.setValue",{id:this.id,value:J})}async startAnimation(){await W("progress.startAnimation",{id:this.id})}async stopAnimation(){await W("progress.stopAnimation",{id:this.id})}}async function T$(J){await W("toolbar.set",J)}async function N$(J,$){await W("toolbar.updateItem",{itemId:J,updates:$})}async function B$(J){await W("toolbar.setVisible",{visible:J})}async function x$(J){await W("touchBar.set",J)}async function S$(J,$){await W("touchBar.updateItem",{itemId:J,updates:$})}async function W(J,$){if(typeof window<"u"&&window.webkit?.messageHandlers?.craft)return new Promise((X,Y)=>{try{window.webkit.messageHandlers.craft.postMessage({type:"native-ui",method:J,params:$}),X(void 0)}catch(Q){Y(Q)}});return _().request(J,$)}var S0={OS:k$(),Version:I$(),isIOS(){return this.OS==="ios"},isAndroid(){return this.OS==="android"},isWeb(){return this.OS==="web"},select(J){if(this.OS==="ios"&&J.ios!==void 0)return J.ios;if(this.OS==="android"&&J.android!==void 0)return J.android;if(this.OS==="web"&&J.web!==void 0)return J.web;return J.default}},k0={create(J){return J},flatten(J){if(!J)return;if(Array.isArray(J))return Object.assign({},...J);return J},absoluteFill:{position:"absolute",top:0,left:0,right:0,bottom:0},hairlineWidth:typeof window<"u"?1/(window.devicePixelRatio||1):1};class I0{_value;_listeners=[];constructor(J){this._value=J}setValue(J){this._value=J,this._listeners.forEach(($)=>$(J))}getValue(){return this._value}addListener(J){return this._listeners.push(J),String(this._listeners.length-1)}removeListener(J){let $=parseInt(J,10);if($>=0&&$<this._listeners.length)this._listeners.splice($,1)}removeAllListeners(){this._listeners=[]}}function J0(J,$){return{start(Z){let X=J.getValue(),Y=Date.now(),Q=$.duration||300,q=()=>{let z=Date.now()-Y-($.delay||0);if(z<0){requestAnimationFrame(q);return}let H=Math.min(z/Q,1),K=$.easing?$.easing(H):H,V=X+($.toValue-X)*K;if(J.setValue(V),H<1)requestAnimationFrame(q);else Z?.({finished:!0})};requestAnimationFrame(q)},stop(){}}}var w0={Value:I0,timing:J0,spring(J,$){return{start(Z){let X=300*($.friction||7)/7;J0(J,{toValue:$.toValue,duration:X,easing:(Y)=>1-(1-Y)**3,useNativeDriver:$.useNativeDriver}).start(Z)},stop(){}}},parallel(J){return{start($){let Z=0,X=J.length;if(X===0){$?.({finished:!0});return}J.forEach((Y)=>{Y.start(()=>{if(Z++,Z===X)$?.({finished:!0})})})},stop(){}}},sequence(J){return{start($){let Z=(X)=>{if(X>=J.length){$?.({finished:!0});return}J[X].start(()=>Z(X+1))};Z(0)},stop(){}}}};function k$(){if(typeof window>"u")return"web";let J=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(J))return"ios";if(/android/.test(J))return"android";return"web"}function I$(){if(typeof window>"u")return"unknown";let J=navigator.userAgent,$=J.match(/(?:iPhone|iPad|iPod).*?OS (\d+)/)||J.match(/Android (\d+)/);return $?$[1]:"unknown"}var w$={Platform:S0,StyleSheet:k0,Animated:w0},P$=w$;function C$(J,...$){let Z="";for(let X=0;X<J.length;X++)if(Z+=J[X],X<$.length)Z+=String($[X]);return Z.replace(/\s+/g," ").trim()}function P0(...J){let $=[];for(let Z of J){if(!Z)continue;if(typeof Z==="string"||typeof Z==="number")$.push(String(Z));else if(Array.isArray(Z)){let X=P0(...Z);if(X)$.push(X)}else if(typeof Z==="object"){for(let[X,Y]of Object.entries(Z))if(Y)$.push(X)}}return $.join(" ")}function b$(J){return($={})=>{let Z=[];if(J.base)Z.push(J.base);for(let[X,Y]of Object.entries(J.variants)){let Q=$[X]??J.defaultVariants?.[X];if(Q!==void 0&&Y[Q])Z.push(Y[Q])}if(J.compoundVariants)for(let X of J.compoundVariants){let{className:Y,...Q}=X,q=!0;for(let[z,H]of Object.entries(Q))if(($[z]??J.defaultVariants?.[z])!==H){q=!1;break}if(q&&Y)Z.push(Y)}if($.className)Z.push($.className);return Z.join(" ")}}function Y9(J){let $={},Z=J.split(/\s+/).filter(Boolean);for(let X of Z){let Y=y$(X);if(Y)Object.assign($,Y)}return $}function y$(J){let $=J.match(/^([pm])([trblxy])?-(\d+(?:\.\d+)?|px)$/);if($){let[,K,V,R]=$,F=R==="px"?1:parseFloat(R)*4,D=K==="p"?"padding":"margin";if(!V)return{[D]:F};if(V==="x")return{[`${D}Left`]:F,[`${D}Right`]:F};if(V==="y")return{[`${D}Top`]:F,[`${D}Bottom`]:F};return{[`${D}${{t:"Top",r:"Right",b:"Bottom",l:"Left"}[V]}`]:F}}let Z=J.match(/^(w|h|min-w|max-w|min-h|max-h)-(\d+|full|screen|auto)$/);if(Z){let[,K,V]=Z,R={w:"width",h:"height","min-w":"minWidth","max-w":"maxWidth","min-h":"minHeight","max-h":"maxHeight"},D={full:"100%",screen:"100vh",auto:"auto"}[V]??parseFloat(V)*4;return{[R[K]]:D}}if(J==="flex")return{display:"flex"};if(J==="flex-1")return{flex:1};if(J==="flex-row")return{flexDirection:"row"};if(J==="flex-col")return{flexDirection:"column"};if(J==="flex-wrap")return{flexWrap:"wrap"};if(J==="items-center")return{alignItems:"center"};if(J==="items-start")return{alignItems:"flex-start"};if(J==="items-end")return{alignItems:"flex-end"};if(J==="justify-center")return{justifyContent:"center"};if(J==="justify-start")return{justifyContent:"flex-start"};if(J==="justify-end")return{justifyContent:"flex-end"};if(J==="justify-between")return{justifyContent:"space-between"};if(J==="justify-around")return{justifyContent:"space-around"};let X=J.match(/^gap-(\d+(?:\.\d+)?)$/);if(X)return{gap:parseFloat(X[1])*4};let Y={"rounded-none":0,"rounded-sm":2,rounded:4,"rounded-md":6,"rounded-lg":8,"rounded-xl":12,"rounded-2xl":16,"rounded-3xl":24,"rounded-full":9999};if(Y[J]!==void 0)return{borderRadius:Y[J]};let Q={"text-xs":12,"text-sm":14,"text-base":16,"text-lg":18,"text-xl":20,"text-2xl":24,"text-3xl":30,"text-4xl":36};if(Q[J])return{fontSize:Q[J]};let q={"font-thin":"100","font-extralight":"200","font-light":"300","font-normal":"400","font-medium":"500","font-semibold":"600","font-bold":"700","font-extrabold":"800","font-black":"900"};if(q[J])return{fontWeight:q[J]};if(J==="text-left")return{textAlign:"left"};if(J==="text-center")return{textAlign:"center"};if(J==="text-right")return{textAlign:"right"};let z=J.match(/^(bg|text|border)-(\w+)-(\d{2,3})$/);if(z){let[,K,V,R]=z,F=v$(V,parseInt(R,10));if(F)return{[{bg:"backgroundColor",text:"color",border:"borderColor"}[K]]:F}}if(J==="bg-white")return{backgroundColor:"#ffffff"};if(J==="bg-black")return{backgroundColor:"#000000"};if(J==="bg-transparent")return{backgroundColor:"transparent"};if(J==="text-white")return{color:"#ffffff"};if(J==="text-black")return{color:"#000000"};let H=J.match(/^opacity-(\d+)$/);if(H)return{opacity:parseInt(H[1],10)/100};if(J==="relative")return{position:"relative"};if(J==="absolute")return{position:"absolute"};if(J==="hidden")return{display:"none"};if(J==="block")return{display:"block"};if(J==="inline")return{display:"inline"};if(J==="overflow-hidden")return{overflow:"hidden"};if(J==="overflow-scroll")return{overflow:"scroll"};if(J==="overflow-auto")return{overflow:"auto"};return null}function v$(J,$){return{slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"}}[J]?.[$]??null}function Q9(J){return JSON.stringify({content:J.content,output:J.output,minify:J.minify??!1,darkMode:J.darkMode??"class",jit:J.jit??!0,theme:J.theme??{}},null,2)}async function G9(J){if(typeof window<"u"){console.warn("buildCSS can only be run in Node.js environment");return}let{exec:$}=await import("child_process"),{promisify:Z}=await import("util"),X=Z($),Y=["build","--content",J.content.join(","),"--output",J.output];if(J.minify)Y.push("--minify");try{await X(`headwind ${Y.join(" ")}`),console.log(`CSS built successfully: ${J.output}`)}catch(Q){throw console.error("Failed to build CSS:",Q),Q}}var LJ={sidebar:`
|
|
327
|
+
w-56 h-full flex flex-col
|
|
328
|
+
bg-white/70 dark:bg-neutral-900/70
|
|
329
|
+
backdrop-blur-xl backdrop-saturate-150
|
|
330
|
+
border-r border-black/5 dark:border-white/5
|
|
331
|
+
select-none
|
|
332
|
+
`,content:`
|
|
333
|
+
flex-1 overflow-y-auto overflow-x-hidden
|
|
334
|
+
py-2 px-2
|
|
335
|
+
scrollbar-thin scrollbar-thumb-black/10 dark:scrollbar-thumb-white/10
|
|
336
|
+
`,section:`
|
|
337
|
+
mb-4
|
|
338
|
+
`,sectionHeader:`
|
|
339
|
+
px-2 py-1.5 mb-1
|
|
340
|
+
text-[11px] font-semibold uppercase tracking-wider
|
|
341
|
+
text-neutral-500 dark:text-neutral-400
|
|
342
|
+
`,sectionHeaderCollapsible:`
|
|
343
|
+
px-2 py-1.5 mb-1 flex items-center gap-1 cursor-pointer
|
|
344
|
+
text-[11px] font-semibold uppercase tracking-wider
|
|
345
|
+
text-neutral-500 dark:text-neutral-400
|
|
346
|
+
hover:text-neutral-700 dark:hover:text-neutral-200
|
|
347
|
+
transition-colors duration-150
|
|
348
|
+
`,collapseChevron:`
|
|
349
|
+
w-3 h-3 transition-transform duration-200
|
|
350
|
+
`,item:`
|
|
351
|
+
flex items-center gap-2.5 px-2 py-1.5 mx-1 rounded-md
|
|
352
|
+
text-[13px] text-neutral-700 dark:text-neutral-200
|
|
353
|
+
cursor-pointer transition-all duration-150
|
|
354
|
+
hover:bg-black/5 dark:hover:bg-white/5
|
|
355
|
+
`,itemSelected:`
|
|
356
|
+
flex items-center gap-2.5 px-2 py-1.5 mx-1 rounded-md
|
|
357
|
+
text-[13px] text-white
|
|
358
|
+
cursor-pointer
|
|
359
|
+
bg-blue-500 dark:bg-blue-600
|
|
360
|
+
shadow-sm
|
|
361
|
+
`,itemIcon:`
|
|
362
|
+
w-4 h-4 flex-shrink-0
|
|
363
|
+
text-neutral-500 dark:text-neutral-400
|
|
364
|
+
`,itemIconSelected:`
|
|
365
|
+
w-4 h-4 flex-shrink-0
|
|
366
|
+
text-white/90
|
|
367
|
+
`,itemLabel:`
|
|
368
|
+
flex-1 truncate
|
|
369
|
+
`,itemBadge:`
|
|
370
|
+
px-1.5 py-0.5 rounded-full text-[10px] font-medium
|
|
371
|
+
bg-neutral-200 dark:bg-neutral-700
|
|
372
|
+
text-neutral-600 dark:text-neutral-300
|
|
373
|
+
`,itemBadgeSelected:`
|
|
374
|
+
px-1.5 py-0.5 rounded-full text-[10px] font-medium
|
|
375
|
+
bg-white/20 text-white
|
|
376
|
+
`,children:`
|
|
377
|
+
ml-4 mt-0.5 border-l border-neutral-200 dark:border-neutral-700
|
|
378
|
+
`,dragIndicator:`
|
|
379
|
+
absolute left-0 right-0 h-0.5 bg-blue-500
|
|
380
|
+
pointer-events-none
|
|
381
|
+
`,searchContainer:`
|
|
382
|
+
px-2 pb-2
|
|
383
|
+
`,searchInput:`
|
|
384
|
+
w-full px-3 py-1.5 rounded-md
|
|
385
|
+
text-[13px] placeholder:text-neutral-400
|
|
386
|
+
bg-black/5 dark:bg-white/5
|
|
387
|
+
border border-transparent
|
|
388
|
+
focus:outline-none focus:border-blue-500/50 focus:bg-white dark:focus:bg-neutral-800
|
|
389
|
+
transition-all duration-150
|
|
390
|
+
`,header:`
|
|
391
|
+
px-3 py-3 border-b border-black/5 dark:border-white/5
|
|
392
|
+
flex items-center gap-3
|
|
393
|
+
`,headerAvatar:`
|
|
394
|
+
w-8 h-8 rounded-full bg-gradient-to-br from-blue-400 to-blue-600
|
|
395
|
+
flex items-center justify-center text-white text-sm font-medium
|
|
396
|
+
`,headerTitle:`
|
|
397
|
+
text-[13px] font-medium text-neutral-800 dark:text-neutral-100
|
|
398
|
+
`,headerSubtitle:`
|
|
399
|
+
text-[11px] text-neutral-500 dark:text-neutral-400
|
|
400
|
+
`,footer:`
|
|
401
|
+
px-2 py-2 border-t border-black/5 dark:border-white/5
|
|
402
|
+
flex items-center gap-2
|
|
403
|
+
`,footerButton:`
|
|
404
|
+
p-1.5 rounded-md
|
|
405
|
+
text-neutral-500 dark:text-neutral-400
|
|
406
|
+
hover:bg-black/5 dark:hover:bg-white/5
|
|
407
|
+
hover:text-neutral-700 dark:hover:text-neutral-200
|
|
408
|
+
transition-colors duration-150
|
|
409
|
+
`},cJ={sidebar:`
|
|
410
|
+
w-64 h-full flex flex-col
|
|
411
|
+
bg-neutral-100 dark:bg-neutral-900
|
|
412
|
+
border-r border-neutral-200 dark:border-neutral-800
|
|
413
|
+
transition-all duration-300 ease-out
|
|
414
|
+
select-none
|
|
415
|
+
`,sidebarCollapsed:`
|
|
416
|
+
w-12 h-full flex flex-col
|
|
417
|
+
bg-neutral-100 dark:bg-neutral-900
|
|
418
|
+
border-r border-neutral-200 dark:border-neutral-800
|
|
419
|
+
transition-all duration-300 ease-out
|
|
420
|
+
select-none
|
|
421
|
+
`,topBar:`
|
|
422
|
+
h-10 px-2 flex items-center justify-between
|
|
423
|
+
border-b border-neutral-200 dark:border-neutral-800
|
|
424
|
+
`,collapseButton:`
|
|
425
|
+
p-1.5 rounded-lg
|
|
426
|
+
text-neutral-500 dark:text-neutral-400
|
|
427
|
+
hover:bg-neutral-200 dark:hover:bg-neutral-800
|
|
428
|
+
transition-colors duration-150
|
|
429
|
+
`,newTabButton:`
|
|
430
|
+
p-1.5 rounded-lg
|
|
431
|
+
text-neutral-500 dark:text-neutral-400
|
|
432
|
+
hover:bg-neutral-200 dark:hover:bg-neutral-800
|
|
433
|
+
transition-colors duration-150
|
|
434
|
+
`,content:`
|
|
435
|
+
flex-1 overflow-y-auto overflow-x-hidden
|
|
436
|
+
py-2
|
|
437
|
+
scrollbar-thin scrollbar-thumb-neutral-300 dark:scrollbar-thumb-neutral-700
|
|
438
|
+
`,pinnedSection:`
|
|
439
|
+
px-2 pb-3 mb-2 border-b border-neutral-200 dark:border-neutral-800
|
|
440
|
+
`,pinnedLabel:`
|
|
441
|
+
px-2 py-1 text-[10px] font-semibold uppercase tracking-wider
|
|
442
|
+
text-neutral-400 dark:text-neutral-500
|
|
443
|
+
`,sectionHeader:`
|
|
444
|
+
px-3 py-2 flex items-center justify-between
|
|
445
|
+
text-[11px] font-semibold uppercase tracking-wider
|
|
446
|
+
text-neutral-500 dark:text-neutral-400
|
|
447
|
+
`,space:`
|
|
448
|
+
mb-3
|
|
449
|
+
`,spaceHeader:`
|
|
450
|
+
px-2 py-1.5 mx-2 rounded-lg flex items-center gap-2
|
|
451
|
+
cursor-pointer
|
|
452
|
+
hover:bg-neutral-200/50 dark:hover:bg-neutral-800/50
|
|
453
|
+
transition-colors duration-150
|
|
454
|
+
`,spaceIcon:`
|
|
455
|
+
w-5 h-5 rounded-md flex items-center justify-center text-xs
|
|
456
|
+
`,spaceName:`
|
|
457
|
+
flex-1 text-[12px] font-medium text-neutral-700 dark:text-neutral-200
|
|
458
|
+
`,spaceCount:`
|
|
459
|
+
text-[11px] text-neutral-400 dark:text-neutral-500
|
|
460
|
+
`,item:`
|
|
461
|
+
flex items-center gap-2.5 px-3 py-2 mx-2 rounded-xl
|
|
462
|
+
text-[13px] text-neutral-700 dark:text-neutral-300
|
|
463
|
+
cursor-pointer transition-all duration-200
|
|
464
|
+
hover:bg-neutral-200/70 dark:hover:bg-neutral-800/70
|
|
465
|
+
group
|
|
466
|
+
`,itemSelected:`
|
|
467
|
+
flex items-center gap-2.5 px-3 py-2 mx-2 rounded-xl
|
|
468
|
+
text-[13px] text-white font-medium
|
|
469
|
+
cursor-pointer transition-all duration-200
|
|
470
|
+
bg-gradient-to-r from-purple-500 to-pink-500
|
|
471
|
+
shadow-lg shadow-purple-500/25
|
|
472
|
+
`,itemCollapsed:`
|
|
473
|
+
flex items-center justify-center p-2.5 mx-1.5 rounded-xl
|
|
474
|
+
cursor-pointer transition-all duration-200
|
|
475
|
+
hover:bg-neutral-200/70 dark:hover:bg-neutral-800/70
|
|
476
|
+
group relative
|
|
477
|
+
`,itemCollapsedSelected:`
|
|
478
|
+
flex items-center justify-center p-2.5 mx-1.5 rounded-xl
|
|
479
|
+
cursor-pointer transition-all duration-200
|
|
480
|
+
bg-gradient-to-r from-purple-500 to-pink-500
|
|
481
|
+
shadow-lg shadow-purple-500/25
|
|
482
|
+
`,itemFavicon:`
|
|
483
|
+
w-4 h-4 rounded flex-shrink-0
|
|
484
|
+
bg-neutral-300 dark:bg-neutral-700
|
|
485
|
+
`,itemFaviconSelected:`
|
|
486
|
+
w-4 h-4 rounded flex-shrink-0
|
|
487
|
+
`,itemLabel:`
|
|
488
|
+
flex-1 truncate
|
|
489
|
+
`,itemClose:`
|
|
490
|
+
p-0.5 rounded opacity-0 group-hover:opacity-100
|
|
491
|
+
text-neutral-400 hover:text-neutral-600
|
|
492
|
+
dark:text-neutral-500 dark:hover:text-neutral-300
|
|
493
|
+
hover:bg-neutral-300/50 dark:hover:bg-neutral-700/50
|
|
494
|
+
transition-all duration-150
|
|
495
|
+
`,itemCloseSelected:`
|
|
496
|
+
p-0.5 rounded opacity-0 group-hover:opacity-100
|
|
497
|
+
text-white/60 hover:text-white
|
|
498
|
+
hover:bg-white/20
|
|
499
|
+
transition-all duration-150
|
|
500
|
+
`,tooltip:`
|
|
501
|
+
absolute left-full ml-2 px-2 py-1 rounded-md
|
|
502
|
+
text-[12px] text-white bg-neutral-800 dark:bg-neutral-700
|
|
503
|
+
whitespace-nowrap opacity-0 group-hover:opacity-100
|
|
504
|
+
pointer-events-none transition-opacity duration-150
|
|
505
|
+
z-50
|
|
506
|
+
`,todaySection:`
|
|
507
|
+
px-2 pt-2
|
|
508
|
+
`,todayLabel:`
|
|
509
|
+
px-2 py-1 text-[10px] font-semibold uppercase tracking-wider
|
|
510
|
+
text-neutral-400 dark:text-neutral-500
|
|
511
|
+
`,bottomBar:`
|
|
512
|
+
px-2 py-2 border-t border-neutral-200 dark:border-neutral-800
|
|
513
|
+
flex items-center gap-1
|
|
514
|
+
`,bottomButton:`
|
|
515
|
+
flex-1 py-2 rounded-lg flex items-center justify-center gap-2
|
|
516
|
+
text-[12px] text-neutral-600 dark:text-neutral-400
|
|
517
|
+
hover:bg-neutral-200 dark:hover:bg-neutral-800
|
|
518
|
+
transition-colors duration-150
|
|
519
|
+
`,spaceColors:{red:"bg-red-500",orange:"bg-orange-500",yellow:"bg-yellow-500",green:"bg-green-500",blue:"bg-blue-500",purple:"bg-purple-500",pink:"bg-pink-500"},selectedGradients:{purple:"bg-gradient-to-r from-purple-500 to-pink-500 shadow-purple-500/25",blue:"bg-gradient-to-r from-blue-500 to-cyan-500 shadow-blue-500/25",green:"bg-gradient-to-r from-green-500 to-emerald-500 shadow-green-500/25",orange:"bg-gradient-to-r from-orange-500 to-amber-500 shadow-orange-500/25",red:"bg-gradient-to-r from-red-500 to-rose-500 shadow-red-500/25"}},dJ={sidebar:`
|
|
520
|
+
w-52 h-full flex flex-col
|
|
521
|
+
bg-[#1a1a1a] dark:bg-[#1a1a1a]
|
|
522
|
+
border-r border-[#2a2a2a]
|
|
523
|
+
select-none
|
|
524
|
+
`,header:`
|
|
525
|
+
h-12 px-3 flex items-center justify-between
|
|
526
|
+
border-b border-[#2a2a2a]
|
|
527
|
+
`,headerTitle:`
|
|
528
|
+
text-[13px] font-semibold text-white
|
|
529
|
+
`,headerAction:`
|
|
530
|
+
p-1 rounded
|
|
531
|
+
text-neutral-500 hover:text-neutral-300
|
|
532
|
+
hover:bg-white/5
|
|
533
|
+
transition-colors duration-150
|
|
534
|
+
`,content:`
|
|
535
|
+
flex-1 overflow-y-auto overflow-x-hidden
|
|
536
|
+
py-1
|
|
537
|
+
scrollbar-thin scrollbar-thumb-neutral-700 scrollbar-track-transparent
|
|
538
|
+
`,section:`
|
|
539
|
+
py-1
|
|
540
|
+
`,sectionHeader:`
|
|
541
|
+
px-3 py-2 flex items-center justify-between
|
|
542
|
+
text-[11px] font-medium uppercase tracking-wider
|
|
543
|
+
text-neutral-500
|
|
544
|
+
`,sectionHeaderClickable:`
|
|
545
|
+
px-3 py-2 flex items-center justify-between cursor-pointer
|
|
546
|
+
text-[11px] font-medium uppercase tracking-wider
|
|
547
|
+
text-neutral-500 hover:text-neutral-400
|
|
548
|
+
transition-colors duration-150
|
|
549
|
+
`,sectionCount:`
|
|
550
|
+
text-[10px] px-1.5 py-0.5 rounded
|
|
551
|
+
bg-neutral-800 text-neutral-400
|
|
552
|
+
`,divider:`
|
|
553
|
+
my-1 mx-3 border-t border-[#2a2a2a]
|
|
554
|
+
`,item:`
|
|
555
|
+
flex items-center gap-2.5 px-3 py-1.5
|
|
556
|
+
text-[13px] text-neutral-300
|
|
557
|
+
cursor-pointer transition-colors duration-150
|
|
558
|
+
hover:bg-white/5 hover:text-white
|
|
559
|
+
`,itemSelected:`
|
|
560
|
+
flex items-center gap-2.5 px-3 py-1.5
|
|
561
|
+
text-[13px] text-white font-medium
|
|
562
|
+
cursor-pointer
|
|
563
|
+
bg-white/10
|
|
564
|
+
`,itemWithIndicator:`
|
|
565
|
+
flex items-center gap-2.5 px-3 py-1.5
|
|
566
|
+
text-[13px] text-neutral-300
|
|
567
|
+
cursor-pointer transition-colors duration-150
|
|
568
|
+
hover:bg-white/5 hover:text-white
|
|
569
|
+
relative
|
|
570
|
+
`,runningIndicator:`
|
|
571
|
+
w-1.5 h-1.5 rounded-full bg-green-500
|
|
572
|
+
absolute left-1
|
|
573
|
+
`,stoppedIndicator:`
|
|
574
|
+
w-1.5 h-1.5 rounded-full bg-neutral-600
|
|
575
|
+
absolute left-1
|
|
576
|
+
`,itemIcon:`
|
|
577
|
+
w-4 h-4 flex-shrink-0
|
|
578
|
+
text-neutral-500
|
|
579
|
+
`,itemIconSelected:`
|
|
580
|
+
w-4 h-4 flex-shrink-0
|
|
581
|
+
text-white
|
|
582
|
+
`,itemLabel:`
|
|
583
|
+
flex-1 truncate
|
|
584
|
+
`,itemStatus:`
|
|
585
|
+
text-[11px] text-neutral-500
|
|
586
|
+
`,itemActions:`
|
|
587
|
+
flex items-center gap-1 opacity-0 group-hover:opacity-100
|
|
588
|
+
transition-opacity duration-150
|
|
589
|
+
`,itemActionButton:`
|
|
590
|
+
p-1 rounded
|
|
591
|
+
text-neutral-500 hover:text-white
|
|
592
|
+
hover:bg-white/10
|
|
593
|
+
transition-colors duration-150
|
|
594
|
+
`,group:`
|
|
595
|
+
group
|
|
596
|
+
`,groupHeader:`
|
|
597
|
+
flex items-center gap-2 px-3 py-1.5 cursor-pointer
|
|
598
|
+
text-[13px] text-neutral-400
|
|
599
|
+
hover:bg-white/5 hover:text-neutral-200
|
|
600
|
+
transition-colors duration-150
|
|
601
|
+
`,groupChevron:`
|
|
602
|
+
w-3 h-3 text-neutral-600
|
|
603
|
+
transition-transform duration-200
|
|
604
|
+
`,groupChevronExpanded:`
|
|
605
|
+
w-3 h-3 text-neutral-600
|
|
606
|
+
transition-transform duration-200
|
|
607
|
+
rotate-90
|
|
608
|
+
`,groupContent:`
|
|
609
|
+
overflow-hidden transition-all duration-200
|
|
610
|
+
`,footer:`
|
|
611
|
+
px-3 py-2 border-t border-[#2a2a2a]
|
|
612
|
+
flex items-center justify-between
|
|
613
|
+
`,footerText:`
|
|
614
|
+
text-[11px] text-neutral-500
|
|
615
|
+
`,footerButton:`
|
|
616
|
+
p-1.5 rounded
|
|
617
|
+
text-neutral-500 hover:text-white
|
|
618
|
+
hover:bg-white/10
|
|
619
|
+
transition-colors duration-150
|
|
620
|
+
`,contextMenu:`
|
|
621
|
+
min-w-40 py-1 rounded-lg
|
|
622
|
+
bg-[#252525] border border-[#3a3a3a]
|
|
623
|
+
shadow-xl shadow-black/50
|
|
624
|
+
`,contextMenuItem:`
|
|
625
|
+
px-3 py-1.5 flex items-center gap-2
|
|
626
|
+
text-[13px] text-neutral-300
|
|
627
|
+
cursor-pointer
|
|
628
|
+
hover:bg-white/10
|
|
629
|
+
transition-colors duration-100
|
|
630
|
+
`,contextMenuItemDanger:`
|
|
631
|
+
px-3 py-1.5 flex items-center gap-2
|
|
632
|
+
text-[13px] text-red-400
|
|
633
|
+
cursor-pointer
|
|
634
|
+
hover:bg-red-500/10
|
|
635
|
+
transition-colors duration-100
|
|
636
|
+
`,contextMenuDivider:`
|
|
637
|
+
my-1 border-t border-[#3a3a3a]
|
|
638
|
+
`,emptyState:`
|
|
639
|
+
flex flex-col items-center justify-center py-8
|
|
640
|
+
text-neutral-500
|
|
641
|
+
`,emptyStateIcon:`
|
|
642
|
+
w-8 h-8 mb-2 text-neutral-600
|
|
643
|
+
`,emptyStateText:`
|
|
644
|
+
text-[13px]
|
|
645
|
+
`,loadingSpinner:`
|
|
646
|
+
w-4 h-4 border-2 border-neutral-600 border-t-neutral-400
|
|
647
|
+
rounded-full animate-spin
|
|
648
|
+
`},U9={transitionFast:"transition-all duration-150",transitionNormal:"transition-all duration-200",transitionSlow:"transition-all duration-300",scrollbarThin:"scrollbar-thin scrollbar-track-transparent",scrollbarLight:"scrollbar-thumb-black/10 hover:scrollbar-thumb-black/20",scrollbarDark:"scrollbar-thumb-white/10 hover:scrollbar-thumb-white/20",focusRing:"focus:outline-none focus:ring-2 focus:ring-blue-500/50",focusRingInset:"focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/50",truncate:"truncate",lineClamp2:"line-clamp-2",flexCenter:"flex items-center justify-center",flexBetween:"flex items-center justify-between",flexStart:"flex items-center justify-start",hideScrollbar:"scrollbar-none [-ms-overflow-style:none] [scrollbar-width:none]"},q9=`
|
|
649
|
+
:root {
|
|
650
|
+
/* Tahoe style variables */
|
|
651
|
+
--sidebar-tahoe-bg: rgba(255, 255, 255, 0.7);
|
|
652
|
+
--sidebar-tahoe-bg-dark: rgba(30, 30, 30, 0.7);
|
|
653
|
+
--sidebar-tahoe-border: rgba(0, 0, 0, 0.05);
|
|
654
|
+
--sidebar-tahoe-border-dark: rgba(255, 255, 255, 0.05);
|
|
655
|
+
--sidebar-tahoe-text: #404040;
|
|
656
|
+
--sidebar-tahoe-text-dark: #e5e5e5;
|
|
657
|
+
--sidebar-tahoe-text-muted: #737373;
|
|
658
|
+
--sidebar-tahoe-text-muted-dark: #a3a3a3;
|
|
659
|
+
--sidebar-tahoe-selected: #3b82f6;
|
|
660
|
+
--sidebar-tahoe-hover: rgba(0, 0, 0, 0.05);
|
|
661
|
+
--sidebar-tahoe-hover-dark: rgba(255, 255, 255, 0.05);
|
|
662
|
+
|
|
663
|
+
/* Arc style variables */
|
|
664
|
+
--sidebar-arc-bg: #f5f5f5;
|
|
665
|
+
--sidebar-arc-bg-dark: #171717;
|
|
666
|
+
--sidebar-arc-border: #e5e5e5;
|
|
667
|
+
--sidebar-arc-border-dark: #262626;
|
|
668
|
+
--sidebar-arc-selected-from: #a855f7;
|
|
669
|
+
--sidebar-arc-selected-to: #ec4899;
|
|
670
|
+
--sidebar-arc-hover: rgba(0, 0, 0, 0.05);
|
|
671
|
+
--sidebar-arc-hover-dark: rgba(255, 255, 255, 0.05);
|
|
672
|
+
|
|
673
|
+
/* OrbStack style variables */
|
|
674
|
+
--sidebar-orb-bg: #1a1a1a;
|
|
675
|
+
--sidebar-orb-border: #2a2a2a;
|
|
676
|
+
--sidebar-orb-text: #d4d4d4;
|
|
677
|
+
--sidebar-orb-text-muted: #737373;
|
|
678
|
+
--sidebar-orb-selected: rgba(255, 255, 255, 0.1);
|
|
679
|
+
--sidebar-orb-hover: rgba(255, 255, 255, 0.05);
|
|
680
|
+
--sidebar-orb-accent: #22c55e;
|
|
681
|
+
}
|
|
682
|
+
`;function z9(J){switch(J){case"tahoe":return LJ;case"arc":return cJ;case"orbstack":return dJ;default:return LJ}}var b={home:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'/></svg>",folder:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z'/></svg>",document:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/></svg>",star:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z'/></svg>",download:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4'/></svg>",cloud:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z'/></svg>",settings:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z'/><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/></svg>",plus:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4v16m8-8H4'/></svg>",search:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/></svg>",chevronRight:"<svg class='h-3 w-3' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/></svg>",chevronDown:"<svg class='h-3 w-3' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/></svg>",x:"<svg class='h-3 w-3' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'/></svg>",menu:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/></svg>",container:"<svg class='h-4 w-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4'/></svg>",linux:"<svg class='h-4 w-4' fill='currentColor' viewBox='0 0 24 24'><path d='M12.504 0c-.155 0-.311.001-.465.003-.653.014-1.304.07-1.952.17-1.328.205-2.607.596-3.796 1.157-1.189.56-2.28 1.293-3.234 2.174-.954.88-1.757 1.9-2.384 3.022-.627 1.122-1.07 2.342-1.313 3.608-.244 1.266-.286 2.575-.126 3.855.16 1.28.519 2.517 1.066 3.666.547 1.149 1.274 2.197 2.152 3.105.877.908 1.9 1.666 3.025 2.249 1.126.583 2.349.984 3.609 1.192 1.261.208 2.555.218 3.82.029 1.265-.189 2.497-.576 3.642-1.148 1.145-.572 2.187-1.32 3.086-2.212.898-.892 1.643-1.922 2.212-3.045.568-1.123.952-2.332 1.138-3.577.186-1.245.176-2.518-.03-3.766-.206-1.248-.607-2.462-1.191-3.588-.583-1.125-1.343-2.15-2.25-3.029-.907-.879-1.957-1.607-3.1-2.156-1.142-.548-2.377-.913-3.643-1.078-.653-.085-1.31-.125-1.966-.125z'/></svg>"};function s(J){return b[J]||b.document}function h$(J){let $=LJ,Z=(Y,Q=0)=>{let q=Y.selected,z=q?$.itemSelected:$.item,H=q?$.itemIconSelected:$.itemIcon,K=q?$.itemBadgeSelected:$.itemBadge,V=`
|
|
683
|
+
<div class='${z}' data-id='${Y.id}' style='padding-left: ${8+Q*16}px'>
|
|
684
|
+
<span class='${H}'>${s(Y.icon||"document")}</span>
|
|
685
|
+
<span class='${$.itemLabel}'>${Y.label}</span>
|
|
686
|
+
${Y.badge?`<span class='${K}'>${Y.badge}</span>`:""}
|
|
687
|
+
</div>
|
|
688
|
+
`;if(Y.children&&Y.expanded)V+=`<div class='${$.children}'>`,Y.children.forEach((R)=>{V+=Z(R,Q+1)}),V+="</div>";return V},X=(Y)=>{return`
|
|
689
|
+
<div class='${$.section}'>
|
|
690
|
+
${Y.title?`
|
|
691
|
+
<div class="${Y.collapsible?$.sectionHeaderCollapsible:$.sectionHeader}" data-section="${Y.id}">
|
|
692
|
+
${Y.collapsible?`<span class="${$.collapseChevron}${Y.collapsed?"":" rotate-90"}">${b.chevronRight}</span>`:""}
|
|
693
|
+
${Y.title}
|
|
694
|
+
</div>
|
|
695
|
+
`:""}
|
|
696
|
+
${!Y.collapsed?Y.items.map((Q)=>Z(Q)).join(""):""}
|
|
697
|
+
</div>
|
|
698
|
+
`};return`
|
|
699
|
+
<div class='${$.sidebar}'>
|
|
700
|
+
${J.header?`
|
|
701
|
+
<div class='${$.header}'>
|
|
702
|
+
${J.header.avatar?`
|
|
703
|
+
<div class="${$.headerAvatar}">${J.header.avatar}</div>
|
|
704
|
+
`:""}
|
|
705
|
+
<div>
|
|
706
|
+
${J.header.title?`<div class="${$.headerTitle}">${J.header.title}</div>`:""}
|
|
707
|
+
${J.header.subtitle?`<div class="${$.headerSubtitle}">${J.header.subtitle}</div>`:""}
|
|
708
|
+
</div>
|
|
709
|
+
</div>
|
|
710
|
+
`:""}
|
|
711
|
+
|
|
712
|
+
${J.showSearch?`
|
|
713
|
+
<div class='${$.searchContainer}'>
|
|
714
|
+
<input type='text' class='${$.searchInput}' placeholder='${J.searchPlaceholder||"Search"}' />
|
|
715
|
+
</div>
|
|
716
|
+
`:""}
|
|
717
|
+
|
|
718
|
+
<div class='${$.content}'>
|
|
719
|
+
${J.sections?J.sections.map((Y)=>X(Y)).join(""):""}
|
|
720
|
+
${J.items?J.items.map((Y)=>Z(Y)).join(""):""}
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
${J.footer?`
|
|
724
|
+
<div class='${$.footer}'>
|
|
725
|
+
${J.footer.items?.map((Y)=>`
|
|
726
|
+
<button class="${$.footerButton}" data-id="${Y.id}">
|
|
727
|
+
${s(Y.icon||"settings")}
|
|
728
|
+
</button>
|
|
729
|
+
`).join("")||""}
|
|
730
|
+
</div>
|
|
731
|
+
`:""}
|
|
732
|
+
</div>
|
|
733
|
+
`}function u$(J,$=!1){let Z=cJ,X=$?Z.sidebarCollapsed:Z.sidebar,Y=(q)=>{let z=q.selected;if($)return`
|
|
734
|
+
<div class='${z?Z.itemCollapsedSelected:Z.itemCollapsed}' data-id='${q.id}'>
|
|
735
|
+
<span class="${z?Z.itemFaviconSelected:Z.itemFavicon}">
|
|
736
|
+
${q.icon?s(q.icon):""}
|
|
737
|
+
</span>
|
|
738
|
+
<div class='${Z.tooltip}'>${q.label}</div>
|
|
739
|
+
</div>
|
|
740
|
+
`;let H=z?Z.itemSelected:Z.item,K=z?Z.itemCloseSelected:Z.itemClose;return`
|
|
741
|
+
<div class='${H} group' data-id='${q.id}'>
|
|
742
|
+
<span class="${z?Z.itemFaviconSelected:Z.itemFavicon}">
|
|
743
|
+
${q.icon?s(q.icon):""}
|
|
744
|
+
</span>
|
|
745
|
+
<span class='${Z.itemLabel}'>${q.label}</span>
|
|
746
|
+
<button class='${K}'>${b.x}</button>
|
|
747
|
+
</div>
|
|
748
|
+
`},Q=(q)=>{let z=Z.spaceColors[q.color]||Z.spaceColors.purple;return`
|
|
749
|
+
<div class='${Z.space}'>
|
|
750
|
+
<div class='${Z.spaceHeader}' data-space='${q.id}'>
|
|
751
|
+
<div class='${z} ${Z.spaceIcon}'>${q.title?.[0]||"\u2022"}</div>
|
|
752
|
+
${!$?`
|
|
753
|
+
<span class='${Z.spaceName}'>${q.title}</span>
|
|
754
|
+
<span class='${Z.spaceCount}'>${q.items.length}</span>
|
|
755
|
+
`:""}
|
|
756
|
+
</div>
|
|
757
|
+
${!q.collapsed?q.items.map((H)=>Y(H)).join(""):""}
|
|
758
|
+
</div>
|
|
759
|
+
`};return`
|
|
760
|
+
<div class='${X}'>
|
|
761
|
+
<div class='${Z.topBar}'>
|
|
762
|
+
<button class='${Z.collapseButton}' id='arc-collapse-toggle'>
|
|
763
|
+
${b.menu}
|
|
764
|
+
</button>
|
|
765
|
+
${!$?`
|
|
766
|
+
<button class='${Z.newTabButton}'>
|
|
767
|
+
${b.plus}
|
|
768
|
+
</button>
|
|
769
|
+
`:""}
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
<div class='${Z.content}'>
|
|
773
|
+
${J.sections?.[0]?.title==="Pinned"?`
|
|
774
|
+
<div class='${Z.pinnedSection}'>
|
|
775
|
+
${!$?`<div class="${Z.pinnedLabel}">Pinned</div>`:""}
|
|
776
|
+
${J.sections[0].items.map((q)=>Y(q)).join("")}
|
|
777
|
+
</div>
|
|
778
|
+
`:""}
|
|
779
|
+
|
|
780
|
+
${J.sections?.slice(J.sections[0]?.title==="Pinned"?1:0).map((q)=>Q(q)).join("")||""}
|
|
781
|
+
${J.items?J.items.map((q)=>Y(q)).join(""):""}
|
|
782
|
+
</div>
|
|
783
|
+
|
|
784
|
+
<div class='${Z.bottomBar}'>
|
|
785
|
+
${!$?`
|
|
786
|
+
<button class='${Z.bottomButton}'>
|
|
787
|
+
${b.download}
|
|
788
|
+
<span>Downloads</span>
|
|
789
|
+
</button>
|
|
790
|
+
`:`
|
|
791
|
+
<button class='${Z.collapseButton}'>
|
|
792
|
+
${b.download}
|
|
793
|
+
</button>
|
|
794
|
+
`}
|
|
795
|
+
</div>
|
|
796
|
+
</div>
|
|
797
|
+
`}function g$(J){let $=dJ,Z=(Q)=>{let q=Q.selected,z=q?$.itemSelected:$.item,H=q?$.itemIconSelected:$.itemIcon,K=Q.status&&Q.status!=="none",V=Q.status==="running"?$.runningIndicator:$.stoppedIndicator;return`
|
|
798
|
+
<div class='${z} group' data-id='${Q.id}' ${K?"style='padding-left: 20px'":""}>
|
|
799
|
+
${K?`<div class='${V}'></div>`:""}
|
|
800
|
+
<span class='${H}'>${s(Q.icon||"container")}</span>
|
|
801
|
+
<span class='${$.itemLabel}'>${Q.label}</span>
|
|
802
|
+
${Q.status?`<span class='${$.itemStatus}'>${Q.status}</span>`:""}
|
|
803
|
+
<div class='${$.itemActions}'>
|
|
804
|
+
<button class='${$.itemActionButton}'>${b.settings}</button>
|
|
805
|
+
</div>
|
|
806
|
+
</div>
|
|
807
|
+
`},X=(Q)=>{return`
|
|
808
|
+
<div class='${$.section}'>
|
|
809
|
+
${Q.title?`
|
|
810
|
+
<div class="${Q.collapsible?$.sectionHeaderClickable:$.sectionHeader}" data-section="${Q.id}">
|
|
811
|
+
<span>${Q.title}</span>
|
|
812
|
+
${Q.items.length>0?`<span class="${$.sectionCount}">${Q.items.length}</span>`:""}
|
|
813
|
+
</div>
|
|
814
|
+
`:""}
|
|
815
|
+
${!Q.collapsed?Q.items.map((q)=>Z(q)).join(""):""}
|
|
816
|
+
</div>
|
|
817
|
+
`},Y=(Q)=>{let q=Q.expanded?$.groupChevronExpanded:$.groupChevron;return`
|
|
818
|
+
<div class='${$.group}'>
|
|
819
|
+
<div class='${$.groupHeader}' data-group='${Q.id}'>
|
|
820
|
+
<span class='${q}'>${b.chevronRight}</span>
|
|
821
|
+
<span class='${$.itemIcon}'>${s(Q.icon||"folder")}</span>
|
|
822
|
+
<span class='${$.itemLabel}'>${Q.label}</span>
|
|
823
|
+
</div>
|
|
824
|
+
${Q.expanded&&Q.children?`
|
|
825
|
+
<div class='${$.groupContent}'>
|
|
826
|
+
${Q.children.map((z)=>Z(z)).join("")}
|
|
827
|
+
</div>
|
|
828
|
+
`:""}
|
|
829
|
+
</div>
|
|
830
|
+
`};return`
|
|
831
|
+
<div class='${$.sidebar}'>
|
|
832
|
+
<div class='${$.header}'>
|
|
833
|
+
<span class='${$.headerTitle}'>${J.header?.title||"OrbStack"}</span>
|
|
834
|
+
<button class='${$.headerAction}'>${b.plus}</button>
|
|
835
|
+
</div>
|
|
836
|
+
|
|
837
|
+
<div class='${$.content}'>
|
|
838
|
+
${J.sections?J.sections.map((Q)=>X(Q)).join(""):""}
|
|
839
|
+
${J.items?J.items.map((Q)=>Q.children?Y(Q):Z(Q)).join(""):""}
|
|
840
|
+
</div>
|
|
841
|
+
|
|
842
|
+
<div class='${$.footer}'>
|
|
843
|
+
<span class='${$.footerText}'>v4.0.0</span>
|
|
844
|
+
<button class='${$.footerButton}'>${b.settings}</button>
|
|
845
|
+
</div>
|
|
846
|
+
</div>
|
|
847
|
+
`}var K9={header:{title:"MacBook Pro",subtitle:"256 GB available",avatar:"\uD83D\uDCBB"},showSearch:!0,searchPlaceholder:"Search",sections:[{id:"favorites",title:"Favorites",collapsible:!0,items:[{id:"airdrop",label:"AirDrop",icon:"cloud"},{id:"recents",label:"Recents",icon:"document",badge:12},{id:"applications",label:"Applications",icon:"folder"},{id:"desktop",label:"Desktop",icon:"home",selected:!0},{id:"documents",label:"Documents",icon:"folder"},{id:"downloads",label:"Downloads",icon:"download",badge:3}]},{id:"icloud",title:"iCloud",collapsible:!0,items:[{id:"icloud-drive",label:"iCloud Drive",icon:"cloud"},{id:"shared",label:"Shared",icon:"folder"}]},{id:"tags",title:"Tags",collapsible:!0,collapsed:!0,items:[{id:"red",label:"Red"},{id:"orange",label:"Orange"}]}],footer:{items:[{id:"settings",label:"Settings",icon:"settings"}]}},H9={sections:[{id:"pinned",title:"Pinned",items:[{id:"github",label:"GitHub",icon:"document",selected:!0},{id:"twitter",label:"Twitter",icon:"document"},{id:"figma",label:"Figma",icon:"document"}]},{id:"work",title:"Work",items:[{id:"slack",label:"Slack - Acme Inc",icon:"document"},{id:"notion",label:"Notion",icon:"document"},{id:"linear",label:"Linear",icon:"document"}]},{id:"personal",title:"Personal",items:[{id:"youtube",label:"YouTube",icon:"document"},{id:"spotify",label:"Spotify",icon:"document"}]}]},W9={header:{title:"OrbStack"},sections:[{id:"machines",title:"Machines",items:[{id:"ubuntu",label:"ubuntu",icon:"linux",status:"running",selected:!0},{id:"fedora",label:"fedora",icon:"linux",status:"stopped"},{id:"alpine",label:"alpine",icon:"linux",status:"stopped"}]},{id:"containers",title:"Containers",items:[{id:"postgres",label:"postgres:15",icon:"container",status:"running"},{id:"redis",label:"redis:7",icon:"container",status:"running"},{id:"nginx",label:"nginx:latest",icon:"container",status:"stopped"}]}]};function V9(J,$){return`
|
|
848
|
+
<!DOCTYPE html>
|
|
849
|
+
<html lang="en" class="${$==="orbstack"?"dark":""}">
|
|
850
|
+
<head>
|
|
851
|
+
<meta charset='UTF-8'>
|
|
852
|
+
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
|
853
|
+
<title>Craft Sidebar - ${$}</title>
|
|
854
|
+
<script src='https://cdn.tailwindcss.com'></script>
|
|
855
|
+
<style>
|
|
856
|
+
/* Custom scrollbar */
|
|
857
|
+
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
|
|
858
|
+
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
|
|
859
|
+
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
|
|
860
|
+
.dark .scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
|
|
861
|
+
.scrollbar-none::-webkit-scrollbar { display: none; }
|
|
862
|
+
|
|
863
|
+
/* Backdrop blur fallback */
|
|
864
|
+
@supports not (backdrop-filter: blur(1px)) {
|
|
865
|
+
.backdrop-blur-xl { background: rgba(255,255,255,0.95); }
|
|
866
|
+
.dark .backdrop-blur-xl { background: rgba(30,30,30,0.95); }
|
|
867
|
+
}
|
|
868
|
+
</style>
|
|
869
|
+
</head>
|
|
870
|
+
<body class='flex min-h-screen ${$==="orbstack"?"bg-[#0f0f0f]":"bg-neutral-50 dark:bg-neutral-900"}'>
|
|
871
|
+
${J}
|
|
872
|
+
<div class='flex-1 p-8'>
|
|
873
|
+
<div class='text-neutral-400 dark:text-neutral-500'>
|
|
874
|
+
Content area - select items in the sidebar
|
|
875
|
+
</div>
|
|
876
|
+
</div>
|
|
877
|
+
<script>
|
|
878
|
+
// Add click handlers
|
|
879
|
+
document.querySelectorAll('[data-id]').forEach(el => {
|
|
880
|
+
el.addEventListener('click', () => {
|
|
881
|
+
console.log('Selected:', el.dataset.id);
|
|
882
|
+
// You would update selection state here
|
|
883
|
+
});
|
|
884
|
+
});
|
|
885
|
+
</script>
|
|
886
|
+
</body>
|
|
887
|
+
</html>
|
|
888
|
+
`}var L9={tw:C$,cx:P0,variants:b$,sidebar:{tahoe:LJ,arc:cJ,orbstack:dJ},templates:{tahoe:h$,arc:u$,orbstack:g$}},R9={configureProduction(J={}){if(typeof window<"u"){if(!J.enableDevTools)window.__REACT_DEVTOOLS_GLOBAL_HOOK__={isDisabled:!0}}},createLazyFactory(){return(J,$={})=>{let Z=null,X=async()=>{if(!Z)Z=J();await Z};if($.preload)if(typeof requestIdleCallback<"u")requestIdleCallback(()=>X());else setTimeout(()=>X(),0);return{load:X}}},createDebouncedValueHook(J){let $=null,Z;return(X)=>{if($)clearTimeout($);return $=setTimeout(()=>{Z=X,$=null},J),Z??X}},createThrottle(J,$){let Z=0;return(...X)=>{let Y=Date.now();if(Y-Z>=$)J(...X),Z=Y}}},F9={configureProduction(J,$={}){if(!J?.config)return;if(!$.enableDevTools&&J.config.devtools!==void 0)J.config.devtools=!1;if(J.config.performance!==void 0)J.config.performance=$.performance||!1;if($.errorHandler)J.config.errorHandler=$.errorHandler;if($.warnHandler)J.config.warnHandler=$.warnHandler},createAsyncConfig(J={}){let{delay:$=200,timeout:Z=30000,retries:X=3}=J;return{delay:$,timeout:Z,onError(Y,Q,q,z){if(z<=X)Q();else q()}}},createCacheFactory(J={}){let{maxAge:$=0,maxEntries:Z=1000}=J;if(!Number.isInteger(Z)||Z<1)throw Error(`createCacheFactory: maxEntries must be a positive integer (got ${Z})`);let X=new Map;return{cache:X,get(Y,Q){let q=Date.now(),z=X.get(Y);if(z&&($===0||q-z.timestamp<$))return X.delete(Y),X.set(Y,z),z.value;let H=Q();X.set(Y,{value:H,timestamp:q});while(X.size>Z){let K=X.keys().next().value;if(K===void 0)break;X.delete(K)}return H},invalidate(Y){if(Y)X.delete(Y);else X.clear()}}}},j9={createMemoizer(J,$){let Z,X;return(Y)=>{if(Z!==void 0&&Z===Y&&X!==void 0)return X;let Q=J(Y);if(X!==void 0&&$&&$(X,Q))return X;return Z=Y,X=Q,Q}},createDebouncedSetter(J=300){let $;return{set(Z,X){if($)clearTimeout($);$=setTimeout(()=>{X(Z),$=void 0},J)},cancel(){if($)clearTimeout($),$=void 0}}},createThrottledSetter(J=100){let $=0,Z,X;return{set(Y,Q){let q=Date.now();if(q-$>=J)Q(Y),$=q;else if(Z={value:Y,callback:Q},!X)X=setTimeout(()=>{if(Z)Z.callback(Z.value),Z=void 0;$=Date.now(),X=void 0},J-(q-$))}}},createLazyActionConfig(J={}){return{threshold:J.threshold??0,rootMargin:J.rootMargin??"50px"}},createAcceleratedTransitionConfig(J,$={}){let{duration:Z=300,easing:X="cubic-bezier(0.4, 0, 0.2, 1)"}=$;return{type:J,duration:Z,easing:X,willChange:{fade:"opacity",slide:"transform, opacity",scale:"transform, opacity"}[J]}}},$0={defer(J){if(typeof requestIdleCallback<"u")requestIdleCallback(J);else setTimeout(J,0)},preload(J,$){if(typeof document>"u")return;J.forEach((Z)=>{let X=document.createElement("link");if(X.rel="preload",X.href=Z,X.as=$,$==="font")X.crossOrigin="anonymous";document.head.appendChild(X)})},prefetch(J){if(typeof document>"u")return;J.forEach(($)=>{let Z=document.createElement("link");Z.rel="prefetch",Z.href=$,document.head.appendChild(Z)})},createLazyLoader(J,$={}){if(typeof IntersectionObserver>"u")return null;return new IntersectionObserver((Z)=>{Z.forEach((X)=>{if(X.isIntersecting)J(X)})},{rootMargin:"50px",threshold:0,...$})},measureRender(J){let $;return{start(){if(typeof performance<"u")$=performance.now(),performance.mark(`${J}-start`)},end(){if(typeof performance<"u"&&$){let Z=performance.now();if(performance.mark(`${J}-end`),performance.measure(J,`${J}-start`,`${J}-end`),typeof process<"u"&&process.env?.NODE_ENV==="development")console.log(`[Craft] ${J} rendered in ${(Z-$).toFixed(2)}ms`)}}}},memoize(J,$={}){let{maxSize:Z=100,ttl:X=0}=$,Y=new Map,Q=[];return(...q)=>{let z=JSON.stringify(q),H=Date.now(),K=Y.get(z);if(K){if(X===0||H-K.timestamp<X)return K.value;Y.delete(z),Q.splice(Q.indexOf(z),1)}let V=J(...q);Y.set(z,{value:V,timestamp:H}),Q.push(z);while(Q.length>Z){let R=Q.shift();Y.delete(R)}return V}},batchDOMUpdates(J){if(typeof requestAnimationFrame<"u")requestAnimationFrame(()=>{J.forEach(($)=>$())});else J.forEach(($)=>$())},debounce(J,$){let Z,X=(...Y)=>{if(Z)clearTimeout(Z);Z=setTimeout(()=>{J(...Y),Z=void 0},$)};return X.cancel=()=>{if(Z)clearTimeout(Z),Z=void 0},X},throttle(J,$){let Z=0;return(...X)=>{let Y=Date.now();if(Y-Z>=$)J(...X),Z=Y}},detectReducedMotion(){if(typeof window>"u")return!1;return window.matchMedia("(prefers-reduced-motion: reduce)").matches},detectLowEndDevice(){if(typeof navigator>"u")return!1;let J=navigator.deviceMemory;if(J&&J<4)return!0;let $=navigator.hardwareConcurrency;if($&&$<4)return!0;if(navigator.connection?.saveData)return!0;return!1},getAdaptiveQuality(){let J=$0.detectLowEndDevice(),$=$0.detectReducedMotion();if(J||$)return"low";if(typeof window<"u"){if((window.devicePixelRatio||1)>=2)return"high"}return"medium"}},f$={};q0(f$,{updaterCommand:()=>n$,generateUpdateManifest:()=>l$,default:()=>s$,DeltaGenerator:()=>t,AutoUpdater:()=>FJ});function Q0(J,$,Z){let X=S("find",[J,"-name",$,"-type",Z,"-print0"]),Y=String.fromCharCode(0);return X.toString("utf-8").split(Y).filter((q)=>q.length>0)[0]??""}class FJ extends d${config;updateInfo=null;downloadPath=null;checkTimer=null;cachedEtag=null;cachedLastModified=null;cachedManifest=null;constructor(J){super();let $=J.updateUrl;if(typeof $!=="string"||$.length===0)throw Error("Updater: updateUrl is required");if(!/^(?:https:|file:)\/\//i.test($))throw Error(`Updater: updateUrl must use https:// (got: ${$})`);this.config={autoDownload:!0,autoInstall:!1,channel:"stable",checkInterval:3600000,...J}}startAutoCheck(){if(this.checkForUpdates(),this.config.checkInterval)this.checkTimer=setInterval(()=>{this.checkForUpdates()},this.config.checkInterval)}stopAutoCheck(){if(this.checkTimer)clearInterval(this.checkTimer),this.checkTimer=null}async checkForUpdates(){this.emit("checking-for-update");try{let J=this.getPlatform(),$=`${this.config.updateUrl}?v=${this.config.currentVersion}&channel=${this.config.channel}&platform=${J}`,Z={};if(this.cachedEtag)Z["If-None-Match"]=this.cachedEtag;if(this.cachedLastModified)Z["If-Modified-Since"]=this.cachedLastModified;let X=await fetch($,{headers:Z});if(X.status===304&&this.cachedManifest){if(this.isNewerVersion(this.cachedManifest.version,this.config.currentVersion))return this.updateInfo=this.cachedManifest,this.emit("update-available",this.cachedManifest),this.cachedManifest;return this.emit("update-not-available"),null}if(!X.ok)throw Error(`HTTP ${X.status}`);let Y=await X.json();if(this.cachedEtag=X.headers.get("etag")||null,this.cachedLastModified=X.headers.get("last-modified")||null,this.cachedManifest=Y,this.isNewerVersion(Y.version,this.config.currentVersion)){if(Y.minVersion&&this.isNewerVersion(Y.minVersion,this.config.currentVersion))console.log(`Update requires minimum version ${Y.minVersion}`);if(this.updateInfo=Y,this.emit("update-available",Y),this.config.autoDownload)await this.downloadUpdate();return Y}else return this.emit("update-not-available"),null}catch(J){return this.emit("error",J),null}}async downloadUpdate(){if(!this.updateInfo)throw Error("No update available");let J=this.getPlatform(),$=this.updateInfo.platforms[J];if(!$)throw Error(`No update available for platform: ${J}`);let Z=$.delta?.find((K)=>K.fromVersion===this.config.currentVersion),X=Z||$,Y=Z?.url||$.url,Q=Z?.size||$.size,q=Z?.sha256||$.sha256,z=MJ(this.config.appPath,"..",".craft-updates");X0(z,{recursive:!0});let H=c$(Y);this.downloadPath=MJ(z,H);try{let K=await fetch(Y);if(!K.ok)throw Error(`Download failed: HTTP ${K.status}`);let R=parseInt(K.headers.get("content-length")||"0",10)||Q,F=0,D=Date.now(),O=m$(this.downloadPath),M=K.body?.getReader();if(!M)throw Error("Failed to get response reader");while(!0){let{done:x,value:XJ}=await M.read();if(x)break;O.write(XJ),F+=XJ.length;let AJ=(Date.now()-D)/1000,b0=F/AJ,y0={phase:"downloading",percent:Math.round(F/R*100),bytesDownloaded:F,bytesTotal:R,speed:b0};this.emit("download-progress",y0)}if(O.end(),await this.computeFileHash(this.downloadPath)!==q)throw p(this.downloadPath),Error("Download verification failed: hash mismatch");if(this.config.publicKeyPem&&!$.signature)throw p(this.downloadPath),Error("Updater: publicKeyPem is configured but the manifest entry has no signature. Refusing to install unsigned update.");if($.signature){if(!await this.verifySignature(this.downloadPath,$.signature))throw p(this.downloadPath),Error("Download verification failed: invalid signature")}if(this.emit("update-downloaded",{path:this.downloadPath,version:this.updateInfo.version,isDelta:!!Z}),this.config.autoInstall)await this.installUpdate();return this.downloadPath}catch(K){return this.emit("error",K),null}}async installUpdate(J=!0){if(!this.downloadPath||!Z0(this.downloadPath))throw Error("No update downloaded");if(this.updateInfo){let X=this.getPlatform(),Y=this.updateInfo.platforms[X];if(Y){if(await this.computeFileHash(this.downloadPath)!==Y.sha256){try{p(this.downloadPath)}catch{}throw Error(`Updater.installUpdate: pre-install hash mismatch on ${this.downloadPath}. `+"The downloaded bundle changed between download and install \u2014 refusing to run installer.")}if(this.config.publicKeyPem&&!Y.signature)throw Error("Updater.installUpdate: publicKeyPem is configured but manifest has no signature. Refusing to install unsigned update.");if(Y.signature){if(!await this.verifySignature(this.downloadPath,Y.signature)){try{p(this.downloadPath)}catch{}throw Error("Updater.installUpdate: invalid signature on downloaded bundle")}}}}this.emit("before-quit-for-update");let $=this.getPlatform(),Z={phase:"installing",percent:0};this.emit("download-progress",Z);try{switch($){case"darwin":await this.installMacOSUpdate();break;case"win32":await this.installWindowsUpdate();break;case"linux":await this.installLinuxUpdate();break}if(this.downloadPath&&Z0(this.downloadPath))p(this.downloadPath);if(Z.phase="done",Z.percent=100,this.emit("download-progress",Z),J)this.restartApp()}catch(X){Z.phase="error",this.emit("error",X)}}async installMacOSUpdate(){let J=this.downloadPath,$=this.config.appPath;if(J.endsWith(".zip")){let Z=MJ(EJ(J),"extracted");X0(Z,{recursive:!0}),S("unzip",["-o",J,"-d",Z]);let X=Q0(Z,"*.app","d");if(X){let{rmSync:Q,renameSync:q}=await import("fs");Q($,{recursive:!0,force:!0}),q(X,$)}let{rmSync:Y}=await import("fs");Y(Z,{recursive:!0,force:!0})}else if(J.endsWith(".dmg")){let X=S("hdiutil",["attach",J,"-nobrowse"]).toString().match(/\/Volumes\/[^\n]+/)?.[0];if(X){let Y=Q0(X,"*.app","d");if(Y){let{rmSync:Q,cpSync:q}=await import("fs");Q($,{recursive:!0,force:!0}),q(Y,$,{recursive:!0})}S("hdiutil",["detach",X])}}else if(J.endsWith(".pkg")){try{S("pkgutil",["--check-signature",J],{stdio:"pipe"})}catch(Z){throw Error(`Refusing to install ${J}: pkgutil --check-signature failed. The .pkg is not signed by a trusted Apple certificate chain. Underlying error: ${Z.message}`)}S("sudo",["installer","-pkg",J,"-target","/"])}}async installWindowsUpdate(){let J=this.downloadPath;if(J.endsWith(".exe"))i(J,["/S","/SILENT","/VERYSILENT"],{detached:!0,stdio:"ignore"});else if(J.endsWith(".msi"))i("msiexec",["/i",J,"/quiet","/norestart"],{detached:!0,stdio:"ignore"});else if(J.endsWith(".zip")){let $=EJ(this.config.appPath);S("powershell",["-NoProfile","-NonInteractive","-Command","Expand-Archive -Force -Path $env:CRAFT_UPDATE_SRC -DestinationPath $env:CRAFT_UPDATE_DST"],{env:{...process.env,CRAFT_UPDATE_SRC:J,CRAFT_UPDATE_DST:$}})}}async installLinuxUpdate(){let J=this.downloadPath;if(J.endsWith(".AppImage")){S("chmod",["+x",J]);let{renameSync:$}=await import("fs");$(J,this.config.appPath)}else if(J.endsWith(".deb"))S("sudo",["dpkg","-i",J]);else if(J.endsWith(".rpm"))S("sudo",["rpm","-U",J]);else if(J.endsWith(".tar.gz")){let $=EJ(this.config.appPath);S("tar",["-xzf",J,"-C",$])}}restartApp(){let J=this.getPlatform(),$=this.config.appPath;switch(J){case"darwin":i("open",["-n",$],{detached:!0,stdio:"ignore"});break;case"win32":i($,[],{detached:!0,stdio:"ignore"});break;case"linux":i($,[],{detached:!0,stdio:"ignore"});break}process.exit(0)}getPlatform(){switch(process.platform){case"darwin":return"darwin";case"win32":return"win32";default:return"linux"}}isNewerVersion(J,$){let Z=J.split(".").map(Number),X=$.split(".").map(Number);for(let Y=0;Y<Math.max(Z.length,X.length);Y++){let Q=Z[Y]||0,q=X[Y]||0;if(Q>q)return!0;if(Q<q)return!1}return!1}async computeFileHash(J){return new Promise(($,Z)=>{let X=RJ("sha256"),Y=C0(J);Y.on("data",(Q)=>X.update(Q)),Y.on("end",()=>$(X.digest("hex"))),Y.on("error",Z)})}async verifySignature(J,$){let Z=this.config.publicKeyPem;if(!Z)throw Error("Updater.verifySignature: publicKeyPem is not configured. Refusing to install signed update without a verification key.");let X=this.config.signatureAlgorithm??"ed25519",{createPublicKey:Y,verify:Q,createVerify:q}=await import("crypto"),z;try{z=Y({key:Z,format:"pem"})}catch(R){throw Error(`Updater.verifySignature: invalid publicKeyPem: ${R.message}`)}let H;try{H=Buffer.from($,"base64")}catch{return!1}let K=SJ(J);if(X==="ed25519")return Q(null,K,z,H);let V=q("SHA256");return V.update(K),V.end(),V.verify(z,H)}getUpdateInfo(){return this.updateInfo}getDownloadPath(){return this.downloadPath}}class t{static async generate(J,$,Z){try{S("bsdiff",[J,$,Z]);let X=Y0(Z),Y=await t.computeHash(Z);return{size:X.size,sha256:Y}}catch{S("xdelta3",["-e","-s",J,$,Z]);let X=Y0(Z),Y=await t.computeHash(Z);return{size:X.size,sha256:Y}}}static async apply(J,$,Z){try{S("bspatch",[J,Z,$])}catch{S("xdelta3",["-d","-s",J,$,Z])}}static async computeHash(J){return new Promise(($,Z)=>{let X=RJ("sha256"),Y=C0(J);Y.on("data",(Q)=>X.update(Q)),Y.on("end",()=>$(X.digest("hex"))),Y.on("error",Z)})}}function l$(J){let $={version:J.version,releaseDate:new Date().toISOString(),releaseNotes:J.releaseNotes,platforms:{}};for(let[Z,X]of Object.entries(J.platforms)){if(!X)continue;let Y=SJ(X.path),Q=RJ("sha256").update(Y).digest("hex");$.platforms[Z]={url:X.url,size:Y.length,sha256:Q,delta:[]};let q=J.deltas?.filter((z)=>z.platform===Z)||[];for(let z of q){let H=SJ(z.path),K=RJ("sha256").update(H).digest("hex");$.platforms[Z].delta.push({fromVersion:z.fromVersion,url:z.url,size:H.length,sha256:K})}}return $}async function n$(J){let[$,...Z]=J;switch($){case"check":{let X=Z[0],Y=Z[1]||"0.0.0";if(!X)console.error("Usage: craft updater check <update-url> [current-version]"),process.exit(1);let q=await new FJ({updateUrl:X,currentVersion:Y,appPath:process.cwd(),autoDownload:!1}).checkForUpdates();if(q){if(console.log(`Update available: ${q.version}`),console.log(`Release date: ${q.releaseDate}`),q.releaseNotes)console.log(`
|
|
889
|
+
Release notes:
|
|
890
|
+
${q.releaseNotes}`)}else console.log("No updates available");break}case"generate-delta":{let X=Z[0],Y=Z[1],Q=Z[2];if(!X||!Y||!Q)console.error("Usage: craft updater generate-delta <old-file> <new-file> <output>"),process.exit(1);console.log("Generating delta update...");let q=await t.generate(X,Y,Q);console.log(`Delta generated: ${Q}`),console.log(`Size: ${q.size} bytes`),console.log(`SHA256: ${q.sha256}`);break}case"generate-manifest":{let X=Z[0],Y=Z[1]||"update.json";if(!X)console.error("Usage: craft updater generate-manifest <version> [output]"),process.exit(1);let Q={version:X,releaseDate:new Date().toISOString(),platforms:{}};p$(Y,JSON.stringify(Q,null,2)),console.log(`Manifest generated: ${Y}`),console.log("Edit the file to add platform-specific update URLs");break}default:console.log(`
|
|
891
|
+
Craft Auto-Updater
|
|
892
|
+
|
|
893
|
+
Usage: craft updater <command> [options]
|
|
894
|
+
|
|
895
|
+
Commands:
|
|
896
|
+
check <url> [version] Check for updates
|
|
897
|
+
generate-delta <old> <new> <output> Generate delta update
|
|
898
|
+
generate-manifest <version> [output] Generate update manifest
|
|
899
|
+
|
|
900
|
+
Examples:
|
|
901
|
+
craft updater check https://api.example.com/updates 1.0.0
|
|
902
|
+
craft updater generate-delta app-1.0.0.zip app-1.1.0.zip delta-1.0.0-1.1.0.patch
|
|
903
|
+
craft updater generate-manifest 1.1.0 update.json
|
|
904
|
+
`)}}var s$=FJ,r$=n0(f0),G0=!1;function i$(){try{let J=TJ(import.meta.dir,"..","package.json");return JSON.parse(c0(J,"utf-8")).version??"unknown"}catch{return"unknown"}}async function o$(J){if(G0)return;try{let{stdout:$}=await r$(J,["--version"],{timeout:2000}),Z=$.trim().replace(/^v/,""),X=i$();if(X!=="unknown"&&Z&&Z!==X)G0=!0,console.warn(`\u26A0\uFE0F Craft binary/SDK version mismatch: SDK=${X}, native=${Z}.
|
|
905
|
+
This is usually fine across patch releases but may produce surprising behavior across minors.`)}catch{}}function U0(){if(typeof process>"u")return!1;let J=(process.env.CRAFT_ENV||"").toLowerCase();if(J==="development"||J==="dev")return!0;if(J==="production"||J==="prod")return!1;let $="development".toLowerCase();if($==="development"||$==="dev")return!0;if($==="production"||$==="prod")return!1;let Z=process;if(Z.pkg||Z.isPackaged)return!1;return!0}class jJ{process;config;constructor(J={}){if(J.window?.width!==void 0&&(J.window.width<100||J.window.width>1e4))throw Error(`Invalid window width: ${J.window.width}. Must be between 100 and 10000 pixels.`);if(J.window?.height!==void 0&&(J.window.height<100||J.window.height>1e4))throw Error(`Invalid window height: ${J.window.height}. Must be between 100 and 10000 pixels.`);if(J.html&&J.url)console.warn("\u26A0\uFE0F Both html and url provided. URL will take precedence.");this.config={...J,window:{title:"Craft App",width:800,height:600,resizable:!0,frameless:!1,transparent:!1,alwaysOnTop:!1,fullscreen:!1,hotReload:U0(),devTools:U0(),systemTray:!1,...J.window}}}async show(J){if(J)this.config.html=J;if(!this.config.window?.menubarOnly&&!this.config.html&&!this.config.url)throw Error(`No content to display. Provide either html or url:
|
|
906
|
+
show(html, options) or loadURL(url, options)`);let $=this.buildArgs(),Z=await this.findCraftBinary();return o$(Z),this.process=m0(Z,$,{stdio:this.config.quiet?"ignore":"inherit"}),new Promise((X,Y)=>{this.process?.on("error",(Q)=>{if(Q.code==="ENOENT"){Y(Error(r0(Z)));return}if(Q.code==="EACCES"){Y(Error(`\u274C Failed to start Craft process: ${Q.message}
|
|
907
|
+
|
|
908
|
+
Permission denied on the binary at ${Z}.
|
|
909
|
+
Re-run \`pantry install craft\` to restore correct permissions, or chmod +x the file directly.`));return}Y(Error(`\u274C Failed to start Craft process: ${Q.message}
|
|
910
|
+
|
|
911
|
+
For troubleshooting, visit:
|
|
912
|
+
https://github.com/home-lang/craft/issues`))}),this.process?.on("exit",(Q)=>{if(Q===0||Q===null)X();else Y(Error(`\u274C Craft process exited with code ${Q}
|
|
913
|
+
|
|
914
|
+
This may indicate:
|
|
915
|
+
`+` \u2022 Invalid window configuration
|
|
916
|
+
`+` \u2022 Malformed HTML content
|
|
917
|
+
`+` \u2022 System resource constraints
|
|
918
|
+
|
|
919
|
+
`+"Check the console output above for more details."))})})}async loadURL(J){return this.config.url=J,this.show()}close(){if(this.process)this.process.kill()}buildArgs(){let J=[],{window:$,html:Z,url:X}=this.config;if(!$?.menubarOnly){if(X)J.push("--url",X);else if(Z)J.push("--html",Z)}if($?.title)J.push("--title",$.title);if($?.width)J.push("--width",String($.width));if($?.height)J.push("--height",String($.height));if($?.x!==void 0)J.push("--x",String($.x));if($?.y!==void 0)J.push("--y",String($.y));if($?.frameless)J.push("--frameless");if($?.transparent)J.push("--transparent");if($?.alwaysOnTop)J.push("--always-on-top");if($?.fullscreen)J.push("--fullscreen");if(!$?.resizable)J.push("--no-resize");if($?.darkMode)J.push("--dark");if($?.hotReload)J.push("--hot-reload");if($?.devTools===!1)J.push("--no-devtools");if($?.systemTray)J.push("--system-tray");if($?.hideDockIcon)J.push("--hide-dock-icon");if($?.menubarOnly)J.push("--menubar-only");if($?.titlebarHidden)J.push("--titlebar-hidden");if($?.icon)J.push("--icon",$.icon);if($?.nativeSidebar){if(J.push("--native-sidebar"),$?.sidebarWidth)J.push("--sidebar-width",String($.sidebarWidth));let Y=$?.sidebarConfig?{...$.sidebarConfig,variant:$.sidebarConfig.variant??$.sidebarVariant,material:$.sidebarConfig.material??$.sidebarMaterial,backgroundEffect:$.sidebarConfig.backgroundEffect??$.sidebarBackgroundEffect,allowsVibrancy:$.sidebarConfig.allowsVibrancy??$.sidebarAllowsVibrancy}:void 0;if(Y?.variant==="desktop")Y.material=Y.material??"sidebar",Y.backgroundEffect=Y.backgroundEffect??"shimmer",Y.allowsVibrancy=Y.allowsVibrancy??!0;if(Y){let Q;try{Q=JSON.stringify(Y)}catch(H){throw Error(`Failed to serialize sidebarConfig: ${H.message}`)}let q=262144;if(Q.length<=q&&!Q.includes(`
|
|
920
|
+
`)&&!Q.includes("\r"))J.push("--sidebar-config",Q);else{let H=p0(TJ(l0(),"craft-sidebar-")),K=TJ(H,"sidebar-config.json");d0(K,Q,"utf-8"),J.push("--sidebar-config-file",K)}}}if(this.config.quiet)J.push("--quiet");return J}async findCraftBinary(){return s0(this.config.craftPath)}}function E9(J){return new jJ(J)}async function T9(J,$){return new jJ({html:J,window:$}).show()}async function N9(J,$){return new jJ({url:J,window:$}).show()}export{T0 as writeText,B0 as writeHTML,gZ as writeBinaryFile,IX as workManager,iX as windowsWidgets,rX as windowsHello,PJ as windowManager,dX as windowManagement,nJ as window,WZ as win,cZ as watch,F9 as vueOptimizations,aZ as verifyPassword,b$ as variants,rZ as uuid,f$ as updater,S$ as updateTouchBarItem,N$ as updateToolbarItem,vZ as unregisterShortcut,C$ as tw,D8 as trayManager,LZ as tray,vX as touchBar,sX as toastNotifications,BX as tipKit,y8 as timingSafeEqual,GX as tempDir,nX as taskbarProgress,LJ as tahoeStyles,yJ as tahoeStyle,K9 as tahoeDemoData,j9 as svelteOptimizations,_Z as submenu,L9 as styles,Y9 as style,TX as storeKit,fZ as stat,tX as startupTask,uX as stageManager,mX as spotlight,XX as spawn,fX as sidecar,U9 as sidebarUtils,W$ as sidebarSeparator,H$ as sidebarSection,K$ as sidebarItem,q9 as sidebarCSSVariables,X9 as sidebar,j$ as showQuickLook,l8 as showPrompt,D$ as showFontPicker,BZ as showDockIcon,M$ as showDatePicker,d8 as showConfirm,_$ as showColorPicker,c8 as showAlert,T9 as show,aX as shareTarget,EX as sharePlay,cX as shareExtension,jX as share,x$ as setTouchBar,B$ as setToolbarVisible,T$ as setToolbar,xZ as setBadge,jZ as separator,RX as secureStorage,eX as secondaryTiles,p8 as saveFile,KZ as requireCraftRuntime,h$ as renderTahoeSidebar,g$ as renderOrbStackSidebar,u$ as renderArcSidebar,yZ as registerShortcut,N0 as readText,x0 as readHTML,uZ as readBinaryFile,R9 as reactOptimizations,iZ as randomString,MZ as quit,pX as quickActions,PX as predictiveBack,yX as playBilling,kX as photoPicker,WX as permissions,$8 as packageApp,UZ as pack,dJ as orbstackStyles,hJ as orbstackStyle,W9 as orbstackDemoData,m8 as openFolder,f8 as openFile,nZ as openDatabase,zX as open,bZ as notify,OX as notifications,OX as notification,oX as msixUpdate,pZ as move,AZ as menuItem,Z9 as media,SX as materialYou,FX as location,N9 as loadURL,MX as liveActivities,AX as lifecycle,lX as jumpList,JX as isMobile,eZ as isDesktop,PZ as isDarkMode,qZ as isCraftRuntime,U as isCraft,w8 as http,QX as homeDir,oZ as hmac,A$ as hideQuickLook,NZ as hideDockIcon,EZ as hide,v8 as hashPassword,HX as haptics,gX as handoff,kZ as getVersion,$X as getSystemInfo,z9 as getSidebarStyle,G as getPlatform,wZ as getPath,zZ as getNativeBridgeCall,IZ as getName,CZ as getLocale,SZ as getInfo,V9 as getFullPageHTML,K0 as getCraft,Q9 as generateConfig,hZ as fs,wX as foregroundService,xX as focusFilters,TZ as focus,UX as exit,ZX as exec,tZ as env,J9 as dialog,KX as device,hX as desktopWidgets,lZ as db,P0 as cx,YX as cwd,a as crypto,VZ as createWindow,G$ as createTahoeSidebar,F$ as createTableView,V$ as createSplitView,Z$ as createSidebar,Y$ as createSettingsSidebar,E$ as createProgress,R$ as createOutlineView,q$ as createOrbStackSidebar,RZ as createMenubarApp,X$ as createFileSidebar,L$ as createFileBrowser,sZ as createClient,U$ as createArcSidebar,E9 as createApp,L8 as craftUnavailableMessage,mZ as copy,Q$ as components,$0 as commonOptimizations,P0 as clsx,$9 as clipboard,OZ as checkbox,_X as carplay,O$ as canQuickLook,VX as camera,FZ as buildMenu,G9 as buildCSS,LX as biometrics,qX as argv,cJ as arcStyles,vJ as arcStyle,H9 as arcDemoData,B as appManager,CX as appLanguage,NX as appIntents,DX as appClips,DZ as app,bX as androidWidgets,KJ as Window,P8 as WebSocketClient,c as Timer,mJ as TableViewInstance,WJ as SystemTray,k0 as StyleSheet,R8 as Storage,uJ as SplitViewInstance,$J as Sidebar,pJ as ProgressInstance,fJ as OutlineViewInstance,L0 as MenubarApp,S8 as KeyValueStore,O0 as HttpError,A0 as HttpClient,gJ as FileBrowserInstance,j0 as Database,jJ as CraftApp,E0 as ChildProcess,V8 as AudioManager,w0 as Animated};
|