diff --git a/.gitignore b/.gitignore index ab76528..a498e95 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,7 @@ /.codegraph/ # Local AI runtime state .atl/ -# Generated frontend bundle embedded by the Wails composition root. It is -# versioned so direct Go builds and tests have the same runtime assets. -!/cmd/x6configurator/frontend/ -!/cmd/x6configurator/frontend/dist/ -!/cmd/x6configurator/frontend/dist/** +# Generated frontend bundle embedded by the Wails composition root. +/cmd/x6configurator/frontend/dist/ /bin/ /frontend/node_modules/ diff --git a/.opencode/skills/wails-backend/SKILL.md b/.opencode/skills/wails-backend/SKILL.md index 59c7235..dc90612 100644 --- a/.opencode/skills/wails-backend/SKILL.md +++ b/.opencode/skills/wails-backend/SKILL.md @@ -54,7 +54,7 @@ Wails service (`internal/desktop/service.go`), emitting live events, or changing 3. In `cmd`, ensure the real emitter is attached (`AttachListener`) and the listener is started/stopped with the app lifecycle. 4. Regenerate bindings; update `frontend/src/wails-service.ts` facade. -5. Run `go build ./...` and `(cd frontend && npm run build)`. +5. Run `(cd frontend && npm ci && npm run build)` before `go build ./...`, Go tests, or `go vet ./...`; `//go:embed frontend/dist` requires the generated assets. ## Output Contract Report the method/binding added, the event name emitted, the lifecycle wiring diff --git a/.opencode/skills/wails-backend/references/wails-backend.md b/.opencode/skills/wails-backend/references/wails-backend.md index 402c0d6..3d1cefc 100644 --- a/.opencode/skills/wails-backend/references/wails-backend.md +++ b/.opencode/skills/wails-backend/references/wails-backend.md @@ -19,7 +19,7 @@ app := application.New(application.Options{ }) ``` -Assets come from `//go:embed frontend/dist` (`main.go:20`). +Assets come from `//go:embed frontend/dist` (`main.go:20`). Generate them on a clean checkout with `(cd frontend && npm ci && npm run build)` before any Go build, test, or vet command; the output is generated and ignored rather than versioned. ## 2. Bridge events without importing Wails into `desktop` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26bddc7..7490ad1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,10 +50,14 @@ cd attack-shark-linux The hidraw tests run against a fake device — no hardware needed: ```sh +(cd frontend && npm ci && npm run build) go build ./... go test ./... ``` +Generate the embedded frontend first on every clean checkout, before any Go +build, test, vet, or release check. + To test against the real dongle, install the udev policy first ([docs/linux-usb-prerequisites.md](docs/linux-usb-prerequisites.md)). @@ -82,12 +86,15 @@ Branch naming: **Tests must pass before merge.** CI enforces this automatically. ```sh +# Required before backend checks on a clean checkout +(cd frontend && npm ci && npm run build) + # Backend go test ./... # unit tests (fake hidraw, no device needed) go vet ./... # static analysis # Frontend -(cd frontend && npm ci && npm test) +(cd frontend && npm test) ``` ### Test conventions @@ -139,6 +146,7 @@ body. ### PR checklist (required) +- [ ] `(cd frontend && npm ci && npm run build)` completes before Go checks - [ ] `go build ./...` compiles without errors - [ ] `go test ./...` unit tests pass - [ ] `go vet ./...` passes diff --git a/Makefile b/Makefile index 1243ebe..beb29ea 100644 --- a/Makefile +++ b/Makefile @@ -17,21 +17,21 @@ install-deps: ## Install native Ubuntu/Debian dependencies required by Wails frontend-install: ## Install frontend dependencies deterministically cd $(FRONTEND_DIR) && npm ci -frontend-build: ## Build frontend assets +frontend-build: frontend-install ## Build frontend assets cd $(FRONTEND_DIR) && npm run build frontend-test: ## Run frontend tests cd $(FRONTEND_DIR) && npm test -go-test: ## Run Go tests +go-test: frontend-build ## Run Go tests go test ./... -vet: ## Run Go vet +vet: frontend-build ## Run Go vet go vet ./... test: go-test frontend-test ## Run Go and frontend tests -build: ## Build the Wails desktop application +build: frontend-build ## Build the Wails desktop application cd $(APP_DIR) && $(WAILS) build dev: ## Start the Wails development application diff --git a/README.md b/README.md index 2e7458f..e7d73b3 100644 --- a/README.md +++ b/README.md @@ -35,20 +35,25 @@ Go + [Wails v3](https://wails.io) (backend) and React + Vite (frontend). ## Building -Requirements: Go 1.25+, Node.js (for the frontend). +Requirements: Go 1.25+, Node.js (for the frontend), and [Task](https://taskfile.dev). ```sh +# Generate the embedded frontend before any Go build, test, or vet command. +(cd frontend && npm ci && npm run build) + # Backend + embedded frontend -task build # taskfile at cmd/x6configurator +task --dir cmd/x6configurator build -# Or manually: +# Or build the Go packages manually: go build ./... -(cd frontend && npm ci && npm run build) ``` ## Testing ```sh +# Required once per clean checkout, before Go checks: +(cd frontend && npm ci && npm run build) + go test ./... # backend unit tests (hidraw tests use a fake, no device needed) go vet ./... # static analysis (cd frontend && npm test) # frontend unit tests (vitest) diff --git a/cmd/x6configurator/frontend/dist/assets/index-CU8R5TZP.css b/cmd/x6configurator/frontend/dist/assets/index-CU8R5TZP.css deleted file mode 100644 index 874eef9..0000000 --- a/cmd/x6configurator/frontend/dist/assets/index-CU8R5TZP.css +++ /dev/null @@ -1 +0,0 @@ -:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--accent:#1d9e75;--bg:#1e1e1c;--rail:#292a27;--surface:#30312e;--raised:#393a36;--line:#4a4b46;--text:#f2f1ed;--muted:#b6b7b1;--dim:#8b8c86;--ok:#55c590;--danger:#e05f65;--shadow:0 12px 36px #0005;--surface-canvas:var(--bg);--surface-panel:var(--raised);--surface-raised:var(--surface);--text-primary:var(--text);--text-secondary:var(--muted);--accent-primary:var(--accent);--accent-subtle:#244b3e;--accent-on-primary:#09261d;--status-success:var(--ok);--status-danger:var(--danger);--border-subtle:var(--line);--border-strong:#55564f;--focus-ring:#77dabe;--radius-sm:6px;--radius-md:9px;--radius-lg:13px;--radius-window:18px;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--motion-fast:.12s;--motion-standard:.18s;--motion-deliberate:.24s;--ease-standard:cubic-bezier(.2, .8, .2, 1)}.window,.workspace-shell{background:var(--surface);width:100vw;height:100vh;box-shadow:none;border:none;border-radius:0;grid-template:48px minmax(0,1fr)/218px minmax(0,1fr);margin:0;display:grid;position:relative;overflow:hidden}.workspace-shell-content{display:contents}.titlebar,.top-bar{background:#272825;border-bottom:1px solid #40413d;grid-column:1/-1;justify-content:space-between;align-items:center;padding:0 14px 0 17px;display:flex}.appname,.brand{align-items:center;gap:9px;font-weight:500;display:flex}.app-icon{background:var(--accent);color:#113f32;border-radius:7px;place-items:center;width:22px;height:22px;font-size:13px;font-weight:700;display:grid}.titlebar small,.top-bar small{color:var(--muted);margin-left:4px;font-size:12px}.icon-button{width:29px;height:29px;color:var(--muted);background:0 0;border:0;border-radius:8px;font-size:17px}.icon-button:hover:not(:disabled){color:var(--text);background:#40413d}aside,.workspace-rail{background:var(--rail);border-right:1px solid #464741;flex-direction:column;gap:3px;width:218px;min-width:0;padding:16px 10px 12px;display:flex}.device-name{padding:4px 10px 15px}.device-name strong{color:var(--text);font-size:15px;display:block}.device-name span{color:var(--dim);margin-top:2px;font-size:12px;display:block}.workspace-rail nav,nav[aria-label=Workspace\ sections]{flex-direction:column;gap:3px;display:flex}.nav,.workspace-rail a{width:100%;color:var(--muted);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:9px;align-items:center;gap:11px;padding:9px 10px;font-size:13px;font-weight:400;text-decoration:none;display:flex}.nav:hover,.workspace-rail a:hover{color:var(--text);background:#363733}.nav.active,.nav[aria-current=page],.workspace-rail a[aria-current=page]{color:var(--text);background:#454640;font-weight:500}.glyph{width:20px;color:var(--accent);text-align:center;font-size:16px}.connection{color:#b7ead4;background:#213b31;border:1px solid #315b4a;border-radius:10px;margin-top:auto;padding:10px;font-size:12px}.connection b{color:var(--ok);margin-bottom:2px;display:block}.connection.offline{color:#ead4d4;background:#3b2121;border-color:#5b3131}.connection.offline b{color:var(--danger)}.dot{background:var(--ok);border-radius:50%;width:8px;height:8px;margin-right:6px;display:inline-block}.dot.offline{background:var(--danger)}main,.main{background:linear-gradient(130deg,#333430,#2e2f2c);min-width:0;min-height:0;padding:26px 30px 34px;overflow:auto}.view,.workspace-view{min-height:650px;display:none}.view.active,.workspace-view[data-active=true]{display:block}.workspace-view[data-active=false]{display:none}.heading{justify-content:space-between;align-items:start;gap:20px;margin-bottom:22px;display:flex}.heading h1,.heading h2{letter-spacing:-.03em;color:var(--text);margin:0;font-size:26px;font-weight:600}.heading p{color:var(--muted);margin:4px 0 0;font-size:13px}.placeholder{color:var(--dim);white-space:nowrap;padding-top:5px;font-size:12px}.placeholder:before{content:"";background:var(--accent);border-radius:50%;width:7px;height:7px;margin-right:6px;display:inline-block}.stack{gap:14px;display:grid}.configuration-overlay{z-index:1000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);color:var(--text);cursor:wait;-webkit-user-select:none;user-select:none;background:#1e1e1cb8;place-items:center;font-size:1.1rem;font-weight:600;display:grid;position:absolute;inset:0}@media (width<=700px){.window,.workspace-shell{border:0;border-radius:0;width:100%;height:auto;min-height:100vh;margin:0;display:block}.titlebar,.top-bar{z-index:3;height:48px;position:sticky;top:0}.titlebar small,.top-bar small{display:none}aside,.workspace-rail{z-index:2;border-bottom:1px solid #464741;border-right:0;flex-direction:row;width:100%;padding:8px;position:sticky;top:48px;overflow-x:auto}.device-name,.connection{display:none}.nav,.workspace-rail a{gap:6px;width:auto;min-width:max-content;padding:7px 9px;font-size:12px}.glyph{width:auto}main,.main{padding:20px 16px 30px;overflow:visible}.view,.workspace-view{min-height:calc(100vh - 130px)}.heading{margin-bottom:16px}.heading h1,.heading h2{font-size:23px}}.card,.panel,.panel-section,.lighting-control,.device-status{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--raised);padding:17px 18px}.card h2,.card h3,.panel-title{color:var(--text);margin:0;font-size:15px;font-weight:600}.hint,.panel-subtitle,.polling-guidance{color:var(--muted);margin:3px 0 14px;font-size:12px}.card-head,.panel-header{justify-content:space-between;align-items:center;gap:16px;display:flex}.value{color:var(--text);font:500 20px ui-monospace,Cascadia Mono,monospace}.value small{color:var(--muted);margin-left:2px;font:500 12px system-ui}.stages,.stage-indicator{grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;margin:17px 0;display:grid}.stage,.stage-dot{border-radius:var(--radius-md);color:var(--muted);text-align:center;cursor:pointer;background:#2d2e2b;border:1px solid #0000;padding:8px 4px;font-size:12px}.stage b{color:inherit;margin-top:2px;font-size:11px;display:block}.stage.selected,.stage.active,.stage-dot.active{border-color:var(--accent);color:#c0f0dc;background:#244b3e}.stage:disabled{opacity:.5;cursor:not-allowed}.range-row{color:var(--dim);align-items:center;gap:11px;font:12px ui-monospace,monospace;display:flex}.range-row input[type=range],.stage-slider{min-width:0;accent-color:var(--accent);cursor:pointer;flex:1}.range-row input[type=range]:disabled,.stage-slider:disabled{opacity:.5;cursor:not-allowed}.segmented,.polling-options{background:var(--rail);border-radius:10px;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:3px;display:grid}.segmented button,.polling-option{border-radius:var(--radius-md);color:var(--muted);text-align:center;cursor:pointer;background:#2d2e2b;border:1px solid #0000;padding:8px 4px;font-size:12px}.segmented button:hover:not(:disabled),.polling-option:hover:not(:disabled){color:var(--text);background:#363733}.segmented button.selected,.segmented button[aria-checked=true]{border-color:var(--accent);color:#c0f0dc;background:#244b3e}.polling-option:has(input:checked){border-color:var(--accent);color:#c0f0dc;background:#244b3e}.segmented button:disabled{opacity:.5;cursor:not-allowed}.polling-option:has(input:disabled){opacity:.5;cursor:not-allowed}.group{border:1px solid var(--line);background:#2b2c29;border-radius:10px;padding:14px}.group+.group{margin-top:12px}.group h2{margin:0 0 10px;font-size:15px}.rows{margin-top:12px;display:grid}.row{border-top:1px solid var(--line);justify-content:space-between;align-items:center;gap:16px;padding:12px 0;display:flex}.row:first-child{border-top:0;padding-top:0}.row:last-child{padding-bottom:0}.row label strong{color:var(--text);font-weight:500;display:block}.row label span{color:var(--muted);font-size:12px}.switch{appearance:none;cursor:pointer;background:#676862;border-radius:20px;flex-shrink:0;width:38px;height:22px;margin:0;transition:all .18s;position:relative}.switch:after{content:"";background:#fff;border-radius:50%;width:16px;height:16px;transition:all .18s;position:absolute;top:3px;left:3px}.switch:checked{background:var(--accent)}.switch:checked:after{transform:translate(16px)}.switch:disabled{opacity:.5;cursor:not-allowed}.select,select{border-radius:var(--radius-md);max-width:100%;min-height:2.4rem;color:var(--text);background:#292a27;border:1px solid #565751;padding:7px 10px;font-size:13px}select option{color:#f2f1ed!important;background-color:#292a27!important}.select:disabled,select:disabled{opacity:.5;cursor:not-allowed}.gnome-select-wrapper{width:160px;position:relative}.gnome-select-trigger{cursor:pointer;text-align:left;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}.gnome-select-value{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.gnome-select-arrow{color:var(--dim);font-size:11px}.gnome-select-popup{border-radius:var(--radius-md);z-index:100;border:1px solid #565751;width:max-content;min-width:100%;max-width:220px;max-height:220px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 30px #0009;background:#393a36!important}.gnome-select-option{color:var(--text);cursor:pointer;white-space:nowrap;background:0 0;border-radius:6px;padding:8px 10px;font-size:13px}.gnome-select-option:hover,.gnome-select-option.active{background:#454640}.gnome-select-option.selected{color:#c0f0dc;background:#244b3e;font-weight:500}.actions{justify-content:flex-end;gap:8px;margin-top:15px;display:flex}.button,.apply-lighting-btn,.reset-btn{border-radius:var(--radius-md);color:var(--text);cursor:pointer;background:#474843;border:1px solid #62635d;padding:8px 13px;font-size:13px;font-weight:500}.button:hover:not(:disabled),.reset-btn:hover:not(:disabled){background:#52534d;border-color:#72736c}.button.primary,.apply-lighting-btn{border-color:var(--accent);background:var(--accent);color:#09261d}.button.primary:hover:not(:disabled),.apply-lighting-btn:hover:not(:disabled){background:#23ba8b;border-color:#23ba8b}.button:disabled,.reset-btn:disabled,.apply-lighting-btn:disabled{opacity:.5;cursor:not-allowed}.binding{border-top:1px solid var(--line);grid-template-columns:minmax(0,1fr) 150px;align-items:center;gap:12px;padding:10px 0;display:grid}.binding:first-of-type{border-top:0}.binding b{color:var(--text);font-size:13px}.binding span{color:var(--muted);font-size:12px;display:block}.status,.polling-state,.power-settings-state,.lighting-state,.notice{color:var(--muted);margin-top:12px;font-size:12px}.status strong,.connection b{color:var(--ok)}.status.offline strong,.status [role=alert],[role=alert]{color:var(--danger)}.lighting-effect-combobox{width:100%;position:relative}.lighting-effect-trigger{border-radius:var(--radius-md);width:100%;min-height:2.4rem;color:var(--text);text-align:left;cursor:pointer;background:#292a27;border:1px solid #565751;padding:7px 10px;font-size:13px}.lighting-effect-trigger:disabled{opacity:.5;cursor:not-allowed}.lighting-effect-listbox{z-index:1000;border-radius:var(--radius-md);max-height:16rem;color:var(--text);background-color:#393a36;border:1px solid #55564f;padding:4px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow:auto;box-shadow:0 8px 24px #0008}.lighting-effect-option{cursor:pointer;border-radius:6px;align-items:center;min-height:2.2rem;padding:6px 10px;font-size:13px;display:flex}.lighting-effect-option.is-active,.lighting-effect-option:hover{color:#c0f0dc;background-color:#244b3e}.lighting-colors{border:0;margin:14px 0 0;padding:0}.lighting-options{flex-wrap:wrap;gap:10px;margin-top:10px;display:flex}.lighting-option{cursor:pointer;background:#292a27;border:1px solid #565751;border-radius:50%;justify-content:center;align-items:center;width:38px;height:38px;display:flex;position:relative}.lighting-option input[type=radio]{opacity:0;cursor:pointer;width:100%;height:100%;margin:0;position:absolute}.lighting-option:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 2px var(--accent)}.lighting-option:has(input:disabled){opacity:.4;cursor:not-allowed}.lighting-color-swatch,.color-swatch{border-radius:50%;width:22px;height:22px;display:inline-block}.lighting-color-swatch.is-disabled{opacity:.4}:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}.workspace-rail{transition:width var(--motion-deliberate) var(--ease-standard), padding var(--motion-deliberate) var(--ease-standard)}.workspace-rail a,button,select,.polling-option,.lighting-option{transition:background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard)}button:not(:disabled):active{transform:translateY(1px)}:is(.polling-option:has(input:not(:disabled)):hover,.lighting-option:has(input:not(:disabled)):hover){transform:translateY(-1px)}.workspace-view{animation:view-enter var(--motion-standard) var(--ease-standard) both}.status,.inventory-device,.configuration-state,[role=status],.notice{animation:feedback-enter var(--motion-fast) var(--ease-standard) both}.pending-spinner{border:2px solid var(--border-strong);border-top-color:var(--accent-primary);width:.8rem;height:.8rem;animation:pending-spin var(--motion-deliberate) linear infinite;border-radius:50%;display:inline-block}@keyframes view-enter{0%{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:translateY(0)}}@keyframes feedback-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}@keyframes pending-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}.workspace-view,.status,.inventory-device,.configuration-state,[role=status],.notice,button:not(:disabled):active,.polling-option:active,.lighting-option:active{transform:none!important}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;color:var(--text);background:var(--bg);font:14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Cantarell,Segoe UI,sans-serif}*{box-sizing:border-box}body{background:var(--surface);width:100vw;height:100vh;color:var(--text);margin:0;font:14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Cantarell,Segoe UI,sans-serif;overflow:hidden}button,input,select{font:inherit}button{color:inherit;cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}.app-shell{min-height:100vh;color:var(--muted);justify-content:center;align-items:center;font-size:1.1rem;display:flex} diff --git a/cmd/x6configurator/frontend/dist/assets/index-DG8SNgAN.js b/cmd/x6configurator/frontend/dist/assets/index-DG8SNgAN.js deleted file mode 100644 index 6db647f..0000000 --- a/cmd/x6configurator/frontend/dist/assets/index-DG8SNgAN.js +++ /dev/null @@ -1,14 +0,0 @@ -var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,ee||(ee=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var ee=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-tet&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():ee=!1}}}var T;if(typeof y==`function`)T=function(){y(w)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=w,T=function(){ie.postMessage(null)}}else T=function(){_(w,0)};function ae(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,T()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ne(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function w(e,t){return ne(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=w(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{t.exports=a()})),s=t((e=>{var t=o();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=t((e=>{var t=i(),n=o(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1fe||(e.current=de[fe],de[fe]=null,fe--)}function k(e,t){fe++,de[fe]=e.current,e.current=t}var me=pe(null),he=pe(null),ge=pe(null),_e=pe(null);function ve(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}O(me),k(me,e)}function ye(){O(me),O(he),O(ge)}function be(e){e.memoizedState!==null&&k(_e,e);var t=me.current,n=Hd(t,e.type);t!==n&&(k(he,e),k(me,n))}function xe(e){he.current===e&&(O(me),O(he)),_e.current===e&&(O(_e),Qf._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function et(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rt(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,A=null;function Cn(){if(A)return A;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.textContent,a=i.length;for(e=0;e=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=Cn(),A=Sn=xn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gt(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Fr=vn&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==Gt(r)||(r=Ir,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&kr(Rr,r)||(Rr=r,r=Ed(Lr,`onSelect`),0>=o,i-=o,ji=1<<32-Ke(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),F&&Ni(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),F&&Ni(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&Ni(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),F&&Ni(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ja(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),Ra(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ja(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,La(o),c);if(o.$$typeof===S)return b(e,r,oa(e,o),c);za(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=b(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ua=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};E.T=s,Is(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ya(c,r),pu(e)):Fs(e,t,r,pu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ds(e).queue;ws(e,i,t,ue,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},pu())}function ks(){return aa(Qf)}function As(){return V().memoizedState}function js(){return V().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ka(n);var r=qa(t,e,n);r!==null&&(hu(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=si(e,t,n,r),n!==null&&(hu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,pu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o))return oi(e,t,i,0),K===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return hu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(a(479))}else t=si(e,n,r,2),t!==null&&hu(t,e,2)}function Ls(e){var t=e.alternate;return e===R||t!==null&&t===R}function Rs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var Bs={readContext:aa,use:Fo,useCallback:B,useContext:B,useEffect:B,useImperativeHandle:B,useLayoutEffect:B,useInsertionEffect:B,useMemo:B,useReducer:B,useRef:B,useState:B,useDebugValue:B,useDeferredValue:B,useTransition:B,useSyncExternalStore:B,useId:B,useHostTransitionStatus:B,useFormState:B,useActionState:B,useOptimistic:B,useMemoCache:B,useCacheRefresh:B};Bs.useEffectEvent=B;var Vs={readContext:aa,use:Fo,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:aa,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(yo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(yo){Ge(!0);try{n(t)}finally{Ge(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(Mo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,R,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,i=Mo();if(F){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),K===null)throw Error(a(349));J&127||Ho(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=K.identifierPrefix;if(F){var n=Mi,r=ji;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[ht]=t,o[gt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return H(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ge.current,Gi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ri,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Hi(t,!0)}else e=Bd(e).createTextNode(r),e[ht]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Gi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ht]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(a(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Gi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[ht]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),i=!1}else i=qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),H(t),null);case 4:return ye(),e===null&&Sd(t.stateNode.containerInfo),H(t),null;case 10:return $i(t.type),H(t),null;case 19:if(O(L),r=t.memoizedState,r===null)return H(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)zc(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=mo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return k(L,L.current&1|2),F&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>tu&&(t.flags|=128,i=!0,zc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=mo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!F)return H(t),null}else 2*Pe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,i=!0,zc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(H(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=L.current,k(L,i?n&1|2:n&1),F&&Ni(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&O(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),$i(I),H(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Vc(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $i(I),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(a(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(L),null;case 4:return ye(),null;case 10:return $i(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&O(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $i(I),null;case 25:return null;default:return null}}function Hc(e,t){switch(Ii(t),t.tag){case 3:$i(I),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:O(L);break;case 10:$i(t.type);break;case 22:case 23:po(t),ao(),e!==null&&O(xa);break;case 24:$i(I)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){Z(e,e.return,t)}}}function Kc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[gt]=t}catch(t){Z(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ht]=e,t[gt]=n}catch(t){Z(e,e.return,t)}}var nl=!1,U=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[ht]=e,Ot(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=jr(s,h),v=jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,E.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(a(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{D.p=i,E.T=r,Vu(e,t)}}function Wu(e,t,n){t=Ci(n,t),t=ec(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(at(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=Ci(n,e),n=tc(2),r=qa(t,n,2),r!==null&&(nc(n,r,t,e),at(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>Pe()-$l?!(G&2)&&Su(e,0):ql|=n,Yl===J&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=rt()),e=ci(e,t),e!==null&&(at(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ae(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=et(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Pe(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Dt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ot(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ot(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ot(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=ge.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Dt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Dt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Dt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+qt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Ot(t),e.head.appendChild(t))}function Pf(e){return`[src="`+qt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,Ot(i),i):(r=n,(i=mf.get(o))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ot(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()}))(),d=o(),f=`DPI applied.`,p=`Polling applied.`;function m(e){let[t,n]=(0,d.useState)(),[r,i]=(0,d.useState)(),[a,o]=(0,d.useState)(),[s,c]=(0,d.useState)(),[l,u]=(0,d.useState)(),[m,_]=(0,d.useState)(),[v,y]=(0,d.useState)(),[b,x]=(0,d.useState)(``),[ee,S]=(0,d.useState)(!1),[C,te]=(0,d.useState)(0),ne=(0,d.useRef)(null),w=()=>{e.RefreshStatus().then(n),e.GetPollingSnapshot().then(i),e.GetDebounceSnapshot().then(o),e.GetLightingSnapshot().then(c),e.GetNormalSleepSnapshot().then(u),e.GetRemapSnapshot().then(_)};(0,d.useEffect)(()=>{w()},[e]),(0,d.useEffect)(()=>{e.RefreshInventory().then(e=>{y(e),w()})},[e]),(0,d.useEffect)(()=>{ne.current=v?.Selected??null},[v]),(0,d.useEffect)(()=>e.OnStatusEvent(e=>{n(t=>t&&g(ne.current,e)?h(t,e):t)}),[e]),(0,d.useEffect)(()=>e.OnConfiguration(t=>{g(ne.current,t.Binding)&&(n(t.Snapshot),e.GetPollingSnapshot().then(i),e.GetDebounceSnapshot().then(o),e.GetNormalSleepSnapshot().then(u))}),[e]),(0,d.useEffect)(()=>e.OnPollingConfiguration(e=>{g(ne.current,e.Binding)&&i(e.Snapshot)}),[e]),(0,d.useEffect)(()=>e.OnRemapConfiguration(e=>{g(ne.current,e.Binding)&&_(e.Snapshot)}),[e]);let T=e=>(te(e=>e+1),e().finally(()=>te(e=>Math.max(0,e-1)))),re=t=>void T(()=>e.StageDPI(t).then(t=>{if(n(t),!t.Error.Code)return e.ApplyDPI().then(e=>(n(e),x(e.Firmware===`failed`?`DPI application failed.`:f),e))}));return{model:{snapshot:t,polling:r,debounce:a,lighting:s,normalSleep:l,remap:m,inventory:v,ready:v?.Selected!=null,notice:b,resetConfirmation:ee,automaticApplyBusy:C>0},actions:{selectDevice:t=>{let n=v?.Devices.find(e=>e.ID.Serial===t);n&&e.SelectDevice(n.ID).then(e=>{y(e),w()})},stageDPI:(e,n)=>t&&re({...t.Pending,DPI:t.Pending.DPI.map((t,r)=>r===e?n:t)}),selectStage:e=>t&&re({...t.Pending,ActiveStage:e+1}),stageFeature:e=>t&&re({...t.Pending,...e}),stagePollingRate:t=>void T(()=>e.StagePollingRate(t).then(t=>(i(t),t.Error?.Code?t:e.ApplyPollingRate().then(e=>(i(e),x(e.Firmware===`failed`?`Polling application failed.`:p),e))))),stageDebounce:t=>void T(()=>e.StageDebounce(t).then(t=>(o(t),t.Error.Code?t:e.ApplyDebounce().then(e=>(o(e),x(e.Firmware===`failed`?`Key response time application failed.`:`Key response time applied.`),e))))),retryDebouncePersistence:()=>void e.RetryDebouncePersistence().then(o),stageNormalSleep:t=>void T(()=>e.StageNormalSleep(t).then(t=>(u(t),t.Error.Code?t:e.ApplyNormalSleep().then(e=>(u(e),e))))),retryNormalSleepPersistence:()=>void e.RetryNormalSleepPersistence().then(u),stageLighting:t=>void T(()=>e.StageLighting(t).then(t=>(c(t),t.Error?.Code?t:e.ApplyLighting().then(e=>(c(e),e))))),stageRemap:(e,t)=>_(n=>n&&{...n,Pending:{...n.Pending,Buttons:n.Pending.Buttons.map(n=>n.Button===e?{...n,Action:t,PreservedDefault:``}:n)}}),applyRemap:()=>m&&void e.ApplyRemap(m.Pending).then(e=>{_(e),x(`Button remapping applied.`)}),discardRemap:()=>_(e=>e&&{...e,Pending:e.Applied}),requestReset:()=>S(!0),cancelReset:()=>S(!1),confirmReset:()=>void e.ResetToFactory().then(t=>{if(S(!1),t.Cleanup.State!==`success`){x(`Factory reset failed: ${t.Error.Code}.`);return}x(`Factory reset completed.`),e.GetSnapshot().then(n),e.GetPollingSnapshot().then(i)}),retryPersistence:()=>void e.RetryPersistence().then(n),retryPollingPersistence:()=>void e.RetryPollingPersistence().then(i)}}}function h(e,t){let n={...e,Applied:{...e.Applied},Pending:{...e.Pending}};return t.Connection!==void 0&&(n.Connection=t.Connection),t.Battery!=null&&(n.Battery=t.Battery),t.ActiveStage!=null&&(n.ObservedStage=t.ActiveStage,n.ObservedDPI=n.Applied.StageMask>>t.ActiveStage-1&1?n.Applied.DPI[t.ActiveStage-1]:null),n}function g(e,t){return!e||!t.ID||e.ID.VendorID===t.ID.VendorID&&e.ID.ProductID===t.ID.ProductID&&e.ID.Serial===t.ID.Serial&&e.Path===t.Path&&e.InventoryRevision===t.InventoryRevision}var _=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=t(((e,t)=>{t.exports=_()}))(),y=[{id:`performance`,label:`Performance`,glyph:`◉`},{id:`lighting`,label:`Lighting`,glyph:`☼`},{id:`controls`,label:`Controls`,glyph:`⌁`},{id:`remapping`,label:`Button remapping`,glyph:`↺`},{id:`device`,label:`Device`,glyph:`▣`}];function b({activeView:e,onNavigate:t}){return(0,v.jsx)(`nav`,{"aria-label":`Workspace sections`,children:y.map(n=>(0,v.jsxs)(`a`,{href:`#workspace-view-${n.id}`,className:`nav${e===n.id?` active`:``}`,"data-view":n.id,"aria-controls":`workspace-view-${n.id}`,"aria-current":e===n.id?`page`:void 0,onClick:e=>{e.preventDefault(),t(n.id)},children:[(0,v.jsx)(`span`,{className:`glyph`,"aria-hidden":`true`,children:n.glyph}),n.label]},n.id))})}function x({title:e=`Mouse configuration`,subtitle:t=`Attack Shark X6`,children:n}){return(0,v.jsxs)(`header`,{className:`titlebar top-bar`,children:[(0,v.jsxs)(`div`,{className:`appname brand`,children:[(0,v.jsx)(`span`,{className:`app-icon`,"aria-hidden":`true`,children:`✦`}),e,t&&(0,v.jsx)(`small`,{children:t})]}),n]})}var ee=(0,d.createContext)({activeView:`performance`});function S({children:e,busy:t=!1,activeView:n,onNavigate:r,deviceName:i=`Attack Shark X6`,deviceSubtitle:a=`Gaming Mouse`,connectionStatus:o,titlebar:s}){let[c,l]=(0,d.useState)(`performance`),u=n??c,f=e=>{l(e),r?.(e)},p=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;return(0,v.jsxs)(`div`,{className:`window workspace-shell`,"aria-busy":t,children:[(0,v.jsxs)(`div`,{className:`workspace-shell-content`,inert:t?!0:void 0,children:[s??(0,v.jsx)(x,{}),(0,v.jsxs)(`aside`,{className:`workspace-rail`,"aria-label":`Workspace sections`,children:[(0,v.jsxs)(`div`,{className:`device-name`,children:[(0,v.jsx)(`strong`,{children:i}),(0,v.jsx)(`span`,{children:a})]}),(0,v.jsx)(b,{activeView:u,onNavigate:f}),o??(0,v.jsxs)(`div`,{className:`connection`,children:[(0,v.jsxs)(`b`,{children:[(0,v.jsx)(`span`,{className:`dot`,"aria-hidden":`true`}),`Device available`]}),(0,v.jsx)(`span`,{children:`Connected via receiver`})]})]}),(0,v.jsx)(`main`,{className:`main`,"data-motion":p?`reduced`:`full`,children:(0,v.jsx)(ee,{value:{activeView:u},children:e})})]}),t&&(0,v.jsx)(`div`,{className:`configuration-overlay`,role:`status`,"aria-label":`Applying configuration…`,"aria-live":`polite`,children:`Applying configuration…`})]})}function C({id:e,title:t,subtitle:n,placeholder:r,children:i}){let{activeView:a}=(0,d.useContext)(ee),o=(0,d.useRef)(null),s=a===e;return(0,d.useEffect)(()=>{s&&o.current?.focus()},[s]),(0,v.jsxs)(`section`,{id:`workspace-view-${e}`,className:`view workspace-view${s?` active`:``}`,"data-active":s,"aria-label":t,"aria-labelledby":`workspace-view-${e}-title`,children:[(0,v.jsxs)(`div`,{className:`heading`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h1`,{id:`workspace-view-${e}-title`,ref:o,tabIndex:-1,children:t}),n&&(0,v.jsx)(`p`,{children:n})]}),r&&(0,v.jsx)(`span`,{className:`placeholder`,children:r})]}),i]})}var te=50,ne=26e3,w=50,T=e=>Math.round(Math.max(0,Math.min(1,(e-te)/25950))*1e3)/10;function re({stages:e,activeIndex:t=0,activeDPI:n,activeColor:r,colorFor:i,ready:a=!0,onSelectStage:o,onStageDPI:s,children:c}){if(c)return(0,v.jsx)(`section`,{id:`dpi`,className:`card panel`,"aria-labelledby":`dpi-title`,children:c});let l=(e??[]).slice(0,6),u=l.find(e=>e.index===t)??l[0];return(0,v.jsxs)(`article`,{id:`dpi`,className:`card`,"aria-labelledby":`dpi-title`,children:[(0,v.jsxs)(`div`,{className:`card-head`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h2`,{id:`dpi-title`,children:`Active DPI stage`}),(0,v.jsx)(`p`,{className:`hint`,children:t>=0?n==null?`Active DPI: unknown`:(0,v.jsxs)(v.Fragment,{children:[`Active DPI: `,n,r&&(0,v.jsx)(`span`,{className:`color-swatch`,style:{background:`rgb(${r.join(`, `)})`,marginLeft:6}})]}):`No active DPI stage`})]}),(0,v.jsxs)(`div`,{className:`value`,children:[n??`—`,` `,(0,v.jsx)(`small`,{children:`DPI`})]})]}),(0,v.jsx)(`div`,{className:`stages`,role:`group`,"aria-label":`Active stage`,children:l.map(({index:e,dpi:n})=>{let r=e===t,s=i?i(e):null;return(0,v.jsxs)(`button`,{type:`button`,className:`stage${r?` selected active`:``}`,"aria-pressed":r,"aria-label":`Stage ${e+1}${r?`, active`:``}`,disabled:!a,onClick:()=>o?.(e),style:{"--dot-color":s??`#3b82f6`},children:[`Stage `,e+1,(0,v.jsx)(`b`,{children:n})]},e)})}),u&&(0,v.jsxs)(`div`,{className:`range-row`,children:[(0,v.jsx)(`span`,{children:te}),(0,v.jsx)(`input`,{type:`range`,className:`stage-slider`,"aria-label":`Stage ${u.index+1} DPI`,min:te,max:ne,step:w,value:u.dpi,disabled:!a,onChange:e=>s?.(u.index,Number(e.target.value)),style:{"--fill":`${T(u.dpi)}%`,"--stage-color":i?i(u.index)??`#3b82f6`:`#3b82f6`}}),(0,v.jsx)(`span`,{children:`26,000`})]})]})}function ie({snapshot:e,ready:t=!0,onStagePollingRate:n,onRetry:r,children:i}){return i?(0,v.jsx)(`section`,{id:`polling`,className:`card panel-section`,children:i}):e?(0,v.jsxs)(`article`,{id:`polling`,className:`card`,"aria-labelledby":`polling-title`,children:[(0,v.jsx)(`h2`,{id:`polling-title`,children:`Polling rate`}),(0,v.jsx)(`p`,{className:`hint`,children:`Higher rates favor responsiveness; lower rates favor battery life.`}),(0,v.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-label":`Polling rate`,children:[125,250,500,1e3].map(r=>{let i=e.Desired===r,a=r>=1e3?`1,000 Hz`:`${r} Hz`;return(0,v.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":i,"aria-label":`${r} Hz`,className:i?`selected`:``,disabled:!t,onClick:()=>n?.(r),children:a},r)})}),(0,v.jsxs)(`div`,{className:`status`,role:`status`,"aria-label":`Polling status`,children:[e.Firmware===`pending`?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`pending-spinner`,"aria-hidden":`true`}),`Applying…`]}):e.Firmware===`failed`?(0,v.jsx)(v.Fragment,{children:`Polling change failed`}):(0,v.jsxs)(v.Fragment,{children:[`Applied `,e.Applied,` Hz`]}),e.Persistence===`failed`&&(0,v.jsx)(`span`,{children:` Polling preference was not saved.`}),e.RetryAvailable&&(0,v.jsx)(`button`,{type:`button`,className:`button`,style:{marginLeft:8},onClick:r,children:`Retry polling persistence`})]})]}):null}function ae({value:e,appliedValue:t,firmwareStatus:n,persistenceStatus:r,retryAvailable:i,disabled:a=!1,onChange:o,onRetry:s}){return(0,v.jsxs)(`div`,{className:`group`,children:[(0,v.jsx)(`h2`,{children:`Key response time`}),(0,v.jsx)(`p`,{className:`hint`,children:`Lower values reduce click response latency.`}),(0,v.jsxs)(`div`,{className:`range-row`,children:[(0,v.jsx)(`span`,{children:`2 ms`}),(0,v.jsx)(`input`,{type:`range`,"aria-label":`Key response time`,min:`2`,max:`32`,step:`2`,value:e,disabled:a,onChange:e=>o(Number(e.target.value))}),(0,v.jsx)(`span`,{children:`32 ms`})]}),(0,v.jsxs)(`div`,{className:`power-settings-state status`,role:`status`,"aria-label":`Key response time status`,children:[n===`pending`?`Applying…`:n===`failed`?`Key response time change failed`:`Applied ${t??e} ms`,r===`failed`&&(0,v.jsx)(`span`,{children:` Key response time was not saved.`}),i&&(0,v.jsx)(`button`,{type:`button`,className:`button`,style:{marginLeft:8},onClick:s,children:`Retry key response persistence`})]})]})}function oe({snapshot:e,ready:t,onStage:n,onRetry:r}){return(0,v.jsxs)(`article`,{id:`normal-sleep`,className:`card`,"aria-labelledby":`sleep-title`,children:[(0,v.jsx)(`h2`,{id:`sleep-title`,children:`Normal sleep`}),(0,v.jsxs)(`p`,{className:`hint`,children:[`Sleep after: `,e.Pending,` `,e.Pending===1?`minute`:`minutes`]}),(0,v.jsxs)(`div`,{className:`range-row`,children:[(0,v.jsx)(`span`,{children:`0.5`}),(0,v.jsx)(`input`,{type:`range`,"aria-label":`Normal sleep duration`,min:`0.5`,max:`60`,step:`0.5`,value:e.Pending,disabled:!t,onChange:e=>n(Number(e.target.value))}),(0,v.jsx)(`span`,{children:`60 minutes`})]}),(0,v.jsxs)(`div`,{className:`status`,role:`status`,"aria-label":`Normal sleep status`,children:[e.Firmware===`pending`?`Applying…`:e.Firmware===`failed`?`Normal sleep application failed`:`Applied ${e.Applied} minutes`,e.Persistence===`failed`&&(0,v.jsx)(`span`,{children:` Sleep preference was not saved.`}),e.RetryAvailable&&(0,v.jsx)(`button`,{type:`button`,className:`button`,style:{marginLeft:8},onClick:r,children:`Retry sleep persistence`})]})]})}function se({angleSnap:e=!1,rippleControl:t=!1,liftDistance:n=1,disabled:r=!1,onAngleSnapChange:i,onRippleControlChange:a,onLiftDistanceChange:o,children:s}){return s?(0,v.jsx)(`div`,{className:`group`,role:`group`,"aria-label":`Mouse features`,children:s}):(0,v.jsxs)(`div`,{className:`group`,role:`group`,"aria-label":`Mouse features`,children:[(0,v.jsx)(`h2`,{children:`Mouse features`}),(0,v.jsxs)(`div`,{className:`rows`,children:[(0,v.jsxs)(`div`,{className:`row`,children:[(0,v.jsxs)(`label`,{htmlFor:`angle-snap-toggle`,children:[(0,v.jsx)(`strong`,{children:`Angle snap`}),(0,v.jsx)(`span`,{children:`Align sensor movement to straight lines`})]}),(0,v.jsx)(`input`,{id:`angle-snap-toggle`,className:`switch`,type:`checkbox`,"aria-label":`Angle snap`,checked:e,disabled:r,onChange:e=>i?.(e.target.checked)})]}),(0,v.jsxs)(`div`,{className:`row`,children:[(0,v.jsxs)(`label`,{htmlFor:`ripple-control-toggle`,children:[(0,v.jsx)(`strong`,{children:`Ripple control`}),(0,v.jsx)(`span`,{children:`Smooth sensor jitter at high DPI values`})]}),(0,v.jsx)(`input`,{id:`ripple-control-toggle`,className:`switch`,type:`checkbox`,"aria-label":`Ripple control`,checked:t,disabled:r,onChange:e=>a?.(e.target.checked)})]}),(0,v.jsxs)(`div`,{className:`row`,children:[(0,v.jsxs)(`label`,{htmlFor:`lod-select`,children:[(0,v.jsx)(`strong`,{children:`Lift-off distance`}),(0,v.jsx)(`span`,{children:`Sensor tracking cutoff height`})]}),(0,v.jsxs)(`select`,{id:`lod-select`,className:`select`,"aria-label":`Lift-off distance`,value:String(n),disabled:r,onChange:e=>o?.(Number(e.target.value)),children:[(0,v.jsx)(`option`,{value:`1`,children:`1 mm`}),(0,v.jsx)(`option`,{value:`0`,children:`2 mm`})]})]})]})]})}function ce({children:e}){return(0,v.jsx)(`div`,{id:`lighting`,className:`stack`,children:e})}function le({effects:e,value:t,disabled:n=!1,onChange:r}){let i=(0,d.useRef)(null),a=(0,d.useId)(),o=e.findIndex(e=>e.Mode===t),s=o>=0?o:0,c=e[o],[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(s);(0,d.useEffect)(()=>{l||p(s)},[s,l]),(0,d.useEffect)(()=>{if(!l)return;let e=e=>{i.current?.contains(e.target)||u(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[l]);let m=e=>{r(e),u(!1)};return(0,v.jsxs)(`div`,{className:`lighting-effect-combobox`,ref:i,children:[(0,v.jsx)(`button`,{type:`button`,className:`lighting-effect-trigger`,role:`combobox`,"aria-label":`Lighting effect`,"aria-expanded":l,"aria-haspopup":`listbox`,"aria-controls":a,"aria-activedescendant":l&&e[f]?`${a}-option-${f}`:void 0,disabled:n,onClick:()=>{u(e=>!e),p(s)},onKeyDown:t=>{if(!n){if(t.key===`Escape`){l&&(t.preventDefault(),u(!1));return}if(t.key===`Enter`||t.key===` `){t.preventDefault(),l?e[f]&&m(e[f]):(u(!0),p(s));return}if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(t.preventDefault(),!l){u(!0),p(s);return}let n=t.key===`ArrowDown`?1:-1;p(t=>e.length?(t+n+e.length)%e.length:0);return}l&&(t.key===`Home`||t.key===`End`)&&(t.preventDefault(),p(t.key===`Home`?0:Math.max(0,e.length-1)))}},children:c?.Label??`Select effect`}),l&&(0,v.jsx)(`div`,{className:`lighting-effect-listbox`,id:a,role:`listbox`,"aria-label":`Lighting effect`,children:e.map((e,t)=>(0,v.jsx)(`div`,{className:`lighting-effect-option${t===f?` is-active`:``}`,id:`${a}-option-${t}`,role:`option`,"aria-selected":t===o,onClick:()=>m(e),onMouseEnter:()=>p(t),children:e.Label},e.Mode))})]})}function E({id:e,"aria-label":t,value:n,placeholder:r,options:i,disabled:a=!1,className:o=``,onChange:s}){let c=(0,d.useRef)(null),l=(0,d.useId)(),[u,f]=(0,d.useState)(!1),p=i.findIndex(e=>e.value===n),m=p>=0?p:0,[h,g]=(0,d.useState)(m),_=p>=0?i[p]:void 0;(0,d.useEffect)(()=>{u||g(m)},[m,u]),(0,d.useEffect)(()=>{if(!u)return;let e=e=>{c.current?.contains(e.target)||f(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]);let y=e=>{s(e),f(!1)};return(0,v.jsxs)(`div`,{className:`gnome-select-wrapper ${o}`,ref:c,children:[(0,v.jsxs)(`button`,{id:e,type:`button`,className:`select gnome-select-trigger`,role:`combobox`,"aria-label":t,"aria-expanded":u,"aria-haspopup":`listbox`,"aria-controls":l,"aria-activedescendant":u&&i[h]?`${l}-opt-${h}`:void 0,disabled:a,onClick:()=>{a||(f(e=>!e),g(m))},onKeyDown:e=>{if(!a){if(e.key===`Escape`){u&&(e.preventDefault(),f(!1));return}if(e.key===`Enter`||e.key===` `){e.preventDefault(),u?i[h]&&y(i[h].value):(f(!0),g(m));return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!u){f(!0),g(m);return}let t=e.key===`ArrowDown`?1:-1;g(e=>i.length?(e+t+i.length)%i.length:0);return}u&&(e.key===`Home`||e.key===`End`)&&(e.preventDefault(),g(e.key===`Home`?0:Math.max(0,i.length-1)))}},children:[(0,v.jsx)(`span`,{className:`gnome-select-value`,children:_?.label??r??n}),(0,v.jsx)(`span`,{className:`gnome-select-arrow`,"aria-hidden":`true`,children:`▾`})]}),u&&(0,v.jsx)(`div`,{id:l,className:`gnome-select-popup`,role:`listbox`,"aria-label":t,children:i.map((e,t)=>{let r=e.value===n,i=t===h;return(0,v.jsx)(`div`,{id:`${l}-opt-${t}`,role:`option`,"aria-selected":r,className:`gnome-select-option ${r?`selected`:``} ${i?`active`:``}`,onClick:()=>y(e.value),onMouseEnter:()=>g(t),children:e.label},e.value)})})]})}var D=e=>({off:`Off`,left:`Left`,right:`Right`,middle:`Middle`,forward:`Forward`,backward:`Backward`,double_click:`Double Click`,fire:`Fire`})[e];function ue({remap:e,ready:t,onStage:n,onApply:r=()=>{},onDiscard:i=()=>{}}){return(0,v.jsxs)(`article`,{id:`remapping-card`,className:`card`,"aria-labelledby":`button-remap-title`,tabIndex:0,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),r()),e.key===`Escape`&&(e.preventDefault(),i())},children:[(0,v.jsx)(`h2`,{id:`button-remap-title`,children:`Button remapping`}),(0,v.jsx)(`p`,{className:`hint`,children:`Review the complete assignment below, then apply or discard it.`}),e.Pending.Buttons.map(r=>(0,v.jsxs)(`div`,{className:`binding`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`b`,{children:[`Button `,r.Button,r.PreservedDefault?` (${r.PreservedDefault})`:``]}),(0,v.jsx)(`span`,{children:r.Action?D(r.Action):r.PreservedDefault||`Default`})]}),(0,v.jsx)(E,{"aria-label":`Button ${r.Button} action`,disabled:!t,value:r.Action??``,placeholder:r.PreservedDefault||`Default`,options:e.Actions.map(e=>({value:e,label:D(e)})),onChange:e=>n(r.Button,e)})]},r.Button)),(0,v.jsx)(`p`,{"aria-label":`Remap assignment summary`,className:`hint`,style:{marginTop:14},children:e.Pending.Buttons.map(e=>`Button ${e.Button}: ${e.Action?D(e.Action):e.PreservedDefault}`).join(`, `)}),(0,v.jsxs)(`div`,{className:`actions`,children:[(0,v.jsx)(`button`,{type:`button`,className:`button`,disabled:!t,onClick:i,children:`Discard remap`}),(0,v.jsx)(`button`,{type:`button`,className:`button primary`,disabled:!t,onClick:r,children:`Apply remap`})]}),(0,v.jsx)(`div`,{className:`status`,role:`status`,children:e.Firmware===`success`?`Button remapping applied`:e.Firmware===`failed`?`Button remapping failed: ${e.Error.Code}`:`Remap draft pending confirmation`})]})}function de({connectionType:e,battery:t,serial:n,children:r}){return r?(0,v.jsx)(`article`,{className:`card device-status`,children:r}):(0,v.jsxs)(`article`,{className:`card device-status`,children:[(0,v.jsx)(`h2`,{children:`Status`}),(0,v.jsxs)(`div`,{className:`rows`,children:[(0,v.jsxs)(`div`,{className:`row`,children:[(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`strong`,{children:`Interface`}),(0,v.jsx)(`span`,{children:`Active physical interface`})]}),(0,v.jsx)(`b`,{children:e||`unavailable`})]}),(0,v.jsxs)(`div`,{className:`row`,children:[(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`strong`,{children:`Battery charge`}),(0,v.jsx)(`span`,{children:`Remaining battery capacity`})]}),(0,v.jsx)(`b`,{children:t==null?`unavailable`:`${t}%`})]}),(0,v.jsxs)(`div`,{className:`row`,children:[(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`strong`,{children:`Serial identifier`}),(0,v.jsx)(`span`,{children:`Hardware identity`})]}),(0,v.jsx)(`b`,{children:n||`unavailable`})]})]})]})}function fe({confirmation:e,ready:t=!0,onRequestReset:n,onConfirm:r,onCancel:i,children:a}){return(0,v.jsxs)(`article`,{id:`reset`,className:`card`,"aria-labelledby":`reset-title`,children:[(0,v.jsxs)(`div`,{className:`card-head`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h2`,{id:`reset-title`,children:`Reset to factory`}),(0,v.jsx)(`p`,{className:`hint`,style:{margin:`3px 0 0`},children:`This resets DPI, polling, and button remapping on the selected device.`})]}),a??(0,v.jsx)(`button`,{type:`button`,className:`button`,disabled:!t,onClick:n,children:`Reset to factory`})]}),e&&(0,v.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm factory reset`,className:`group`,style:{marginTop:14},children:[(0,v.jsx)(`p`,{style:{margin:0},children:`This resets DPI, polling, and button remapping on the selected device.`}),(0,v.jsxs)(`div`,{className:`actions`,children:[(0,v.jsx)(`button`,{type:`button`,className:`button`,onClick:i,children:`Cancel factory reset`}),(0,v.jsx)(`button`,{type:`button`,className:`button primary`,onClick:r,children:`Confirm factory reset`})]})]})]})}var pe=e=>`Serial ${e.ID.Serial||`unavailable`}`,O=e=>e===`stale_binding`?`Device connection changed. Refresh the device list and select the mouse again before saving.`:e.replaceAll(`_`,` `),k=[`#00FF00`,`#FE5EF9`,`#FF7F00`,`#FFFF00`],me=(e,t)=>{if(!e)return Array.from({length:5},(e,t)=>({label:`Unavailable color ${t+1}`,disabled:!0}));let n=e.ColorTemplates.slice(0,4).map(e=>({label:e.CSSColor,color:e.CSSColor,templateID:e.TemplateID,disabled:!1})),r=e=>({label:`Unavailable color ${e+1}`,color:k[e],disabled:!0});return[...n,...Array.from({length:4-n.length},(e,t)=>r(n.length+t)),{label:`Effect controlled`,color:t?.length?`rgb(${t[0].join(`, `)})`:void 0,disabled:!0}]},he=(e,t)=>t>1?`${Math.round(e/(t-1)*100)}%`:`0%`;function ge({service:e}){let{model:t,actions:n}=m(e),{snapshot:r,polling:i,debounce:a,lighting:o,normalSleep:s,remap:c,inventory:l,ready:u,notice:d,resetConfirmation:f,automaticApplyBusy:p}=t;if(!r)return(0,v.jsx)(`main`,{className:`app-shell`,"aria-busy":`true`,children:`Loading configuration…`});let h=u,g=l?.Error.Code||r.Error.Code,_=r.Pending,y=_.DPI.map((e,t)=>({index:t,dpi:e})).filter(({index:e})=>(_.StageMask??0)>>e&1),b=r.ObservedStage==null?_.ActiveStage-1:r.ObservedStage-1,ee=r.ObservedStage==null?_.DPI[b]??null:r.ObservedDPI??null,te=b>=0&&r.Applied.Colors?r.Applied.Colors[b]:null,ne=e=>r.Applied.Colors&&r.Applied.Colors[e]?`rgb(${r.Applied.Colors[e].join(`, `)})`:null,w=o?.Effects.find(e=>e.Mode===o.Pending.Mode),T=Math.max(0,w?.SpeedVariants.findIndex(e=>e.TemplateID===o.Pending.TemplateID)??0),E=me(w,r.Applied.Colors),D=l?.Devices.filter(e=>e.Eligible)??[],k=(0,v.jsxs)(x,{title:`Mouse configuration`,subtitle:`Attack Shark X6`,children:[D.length>1&&(0,v.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12},children:[(0,v.jsx)(`span`,{children:`Mouse device`}),(0,v.jsxs)(`select`,{className:`select`,"aria-label":`Mouse device`,value:l?.Selected?.ID.Serial??``,onChange:e=>n.selectDevice(e.target.value),children:[(0,v.jsx)(`option`,{value:``,disabled:!0,children:`Select a mouse`}),D.map(e=>(0,v.jsx)(`option`,{value:e.ID.Serial,children:e.ID.Serial},e.ID.Serial))]})]}),(0,v.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:12},children:[r.Firmware&&(0,v.jsx)(`span`,{role:`status`,"aria-label":r.Firmware===`success`?`Firmware applied`:r.Firmware===`pending`?`Firmware synchronization queued`:`Firmware synchronization failed`,children:r.Firmware===`success`?`Firmware applied`:r.Firmware===`pending`?`Firmware synchronization queued`:`Firmware synchronization failed`}),r.Persistence&&(0,v.jsx)(`span`,{role:`status`,children:r.Persistence===`success`?`Persistence saved`:`Persistence failed`}),r.RetryAvailable&&(0,v.jsx)(`button`,{type:`button`,className:`button`,onClick:n.retryPersistence,children:`Retry local persistence`})]})]}),ge=(0,v.jsxs)(`div`,{id:`device`,"aria-live":`polite`,className:`connection${h?``:` offline`}`,children:[(0,v.jsxs)(`b`,{children:[(0,v.jsx)(`span`,{className:`dot${h?``:` offline`}`,"aria-hidden":`true`}),h?`Device available`:`Device unavailable`]}),(0,v.jsx)(`span`,{children:r.Battery==null?`Battery unavailable`:`Battery ${r.Battery}%`}),g&&(0,v.jsx)(`span`,{role:`alert`,style:{display:`block`,color:`var(--danger)`,marginTop:4},children:O(g)})]});return(0,v.jsxs)(S,{busy:p,deviceName:`Attack Shark X6`,deviceSubtitle:`Wireless Gaming Mouse`,titlebar:k,connectionStatus:ge,children:[(0,v.jsx)(C,{id:`performance`,title:`Performance`,subtitle:`DPI, polling rate, and normal sleep.`,placeholder:`Device values`,children:(0,v.jsxs)(`div`,{className:`stack`,children:[(0,v.jsx)(re,{stages:y,activeIndex:b,activeDPI:ee,activeColor:te,colorFor:ne,ready:u,onSelectStage:n.selectStage,onStageDPI:n.stageDPI}),i&&(0,v.jsx)(ie,{snapshot:i,ready:u,onStagePollingRate:n.stagePollingRate,onRetry:n.retryPollingPersistence}),s&&(0,v.jsx)(oe,{snapshot:s,ready:u,onStage:n.stageNormalSleep,onRetry:n.retryNormalSleepPersistence})]})}),(0,v.jsx)(C,{id:`lighting`,title:`Lighting`,subtitle:`Select an effect, its available speed, and lighting color.`,placeholder:`Available effects`,children:o&&(0,v.jsxs)(ce,{children:[(0,v.jsxs)(`article`,{className:`card`,children:[(0,v.jsx)(`h2`,{id:`lighting-title`,children:`Effect`}),(0,v.jsx)(`p`,{className:`hint`,children:`Effect labels are supplied by the device.`}),(0,v.jsxs)(`label`,{className:`lighting-effect-select`,children:[(0,v.jsx)(`span`,{className:`sr-only`,children:`Effect`}),(0,v.jsx)(le,{effects:o.Effects,value:o.Pending.Mode,disabled:!u,onChange:e=>n.stageLighting({Mode:e.Mode,TemplateID:e.DefaultTemplateID})})]})]}),(0,v.jsxs)(`article`,{className:`card`,children:[(0,v.jsx)(`h2`,{children:`Lighting color`}),(0,v.jsx)(`p`,{className:`hint`,children:`Colors are supplied by the selected effect.`}),w&&w.SpeedVariants.length>1&&(0,v.jsxs)(`div`,{className:`range-row`,style:{marginBottom:14},children:[(0,v.jsxs)(`span`,{children:[w.Label,` speed`]}),(0,v.jsx)(`input`,{type:`range`,"aria-label":`${w.Label} speed`,min:0,max:w.SpeedVariants.length-1,step:1,value:T,disabled:!u,style:{"--fill":he(T,w.SpeedVariants.length)},onChange:e=>{let t=w.SpeedVariants[Number(e.target.value)];t&&n.stageLighting({Mode:w.Mode,TemplateID:t.TemplateID})}}),(0,v.jsxs)(`span`,{children:[T+1,` / `,w.SpeedVariants.length]})]}),(0,v.jsxs)(`fieldset`,{className:`lighting-colors`,disabled:!u,children:[(0,v.jsx)(`legend`,{style:{fontWeight:600,marginBottom:8},children:`Lighting color`}),(0,v.jsx)(`div`,{className:`lighting-options`,role:`radiogroup`,"aria-label":`Lighting color`,children:E.map((e,t)=>(0,v.jsxs)(`label`,{className:`lighting-option`,children:[(0,v.jsx)(`input`,{type:`radio`,name:`lighting-color`,"aria-label":e.label,checked:e.templateID!=null&&o?.Pending.TemplateID===e.templateID,disabled:e.disabled,onChange:()=>e.templateID!=null&&w&&n.stageLighting({Mode:w.Mode,TemplateID:e.templateID})}),(0,v.jsx)(`span`,{className:`lighting-color-swatch${e.disabled?` is-disabled`:``}`,"aria-hidden":`true`,style:e.color?{backgroundColor:e.color}:void 0})]},`${e.label}-${t}`))})]})]}),(0,v.jsx)(`div`,{className:`lighting-state status`,role:`status`,"aria-label":`Lighting status`,children:o.Firmware===`success`?`Lighting applied`:o.Firmware===`failed`?(0,v.jsxs)(`span`,{role:`alert`,children:[`Lighting application failed: `,O(o.Error.Code)]}):`Lighting selection pending`})]})}),(0,v.jsx)(C,{id:`controls`,title:`Controls`,subtitle:`Mouse features and key response time.`,placeholder:`Pending settings`,children:(0,v.jsxs)(`article`,{className:`card`,children:[(0,v.jsx)(se,{angleSnap:_.AngleControl===!0,rippleControl:_.RippleControl===!0,liftDistance:_.LiftDistance??1,disabled:!u,onAngleSnapChange:e=>n.stageFeature({AngleControl:e}),onRippleControlChange:e=>n.stageFeature({RippleControl:e}),onLiftDistanceChange:e=>n.stageFeature({LiftDistance:e})}),a&&(0,v.jsx)(ae,{value:a.Desired,appliedValue:a.Applied,firmwareStatus:a.Firmware,persistenceStatus:a.Persistence,retryAvailable:a.RetryAvailable,disabled:!u,onChange:n.stageDebounce,onRetry:n.retryDebouncePersistence})]})}),(0,v.jsx)(C,{id:`remapping`,title:`Button remapping`,subtitle:`Review the complete assignment, then apply or discard it.`,placeholder:`Pending assignment`,children:c&&(0,v.jsx)(ue,{remap:c,ready:u,onStage:n.stageRemap,onApply:n.applyRemap,onDiscard:n.discardRemap})}),(0,v.jsx)(C,{id:`device`,title:`Device`,subtitle:`Connection, battery, inventory, and factory reset.`,placeholder:`Device status`,children:(0,v.jsxs)(`div`,{className:`stack`,children:[(0,v.jsx)(de,{connectionType:r.Connection,battery:r.Battery,serial:l?.Selected?.ID.Serial||void 0,inventory:l,errorCode:g,feedbackFor:O,onSelectDevice:n.selectDevice}),l&&(0,v.jsxs)(`article`,{className:`card`,children:[(0,v.jsx)(`h2`,{children:`Device inventory`}),(0,v.jsx)(`div`,{"aria-label":`Device inventory`,className:`rows`,children:l.Devices.map(e=>(0,v.jsxs)(`div`,{className:`inventory-device row`,children:[(0,v.jsx)(`span`,{children:pe(e)}),!e.Eligible&&(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{style:{marginRight:8},children:`Connection: ${e.Connection||`unavailable`}`}),(0,v.jsx)(`span`,{children:e.Warning||`not eligible`})]})]},`${e.Path}:${e.ID.Serial}`))})]}),l&&!u&&(0,v.jsx)(`p`,{className:`configuration-state status`,role:`status`,children:`Receiver detected, configuration unavailable.`}),(0,v.jsx)(fe,{confirmation:f,ready:u,onRequestReset:n.requestReset,onConfirm:n.confirmReset,onCancel:n.cancelReset})]})}),(0,v.jsx)(`p`,{"aria-live":`polite`,className:`notice`,children:d})]})}var _e=typeof window<`u`&&typeof document<`u`,ve=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ye(e=21){let t=typeof crypto<`u`&&typeof crypto.getRandomValues==`function`?crypto:null;if(t){let n=new Uint8Array(e);t.getRandomValues(n);let r=``;for(let t=0;txe?await Oe(i,o,s):await fetch(i,{method:`POST`,headers:o,body:s}),!c.ok){if(c.headers.get(`Content-Type`)?.includes(`application/json`)){let e=await c.json(),t;switch(e.kind){case`ReferenceError`:t=ReferenceError(e.message);break;case`TypeError`:t=TypeError(e.message);break;case`RuntimeError`:t=new Se(e.message);break;default:t=Error(e.message)}throw t.cause=e.cause,t}throw Error(await c.text())}return(c.headers.get(`Content-Type`)?.indexOf(`application/json`)??-1)===-1?c.text():c.json()}async function Oe(e,t,n){let r=ye(),i=new TextEncoder().encode(n),a=Math.ceil(i.length/xe);for(let n=0;n{let i=e.get(t);if(i){if(e.delete(t),r){i.reject(Error(r));return}try{let e=JSON.parse(n??`{}`);if(!e.ok){i.reject(Error(e.error??`unknown runtime call error`));return}i.resolve(`text`in e?e.text:e.data)}catch(e){i.reject(e)}}},Te={call(t,n,r,i){return new Promise((a,o)=>{let s=ye();e.set(s,{resolve:a,reject:o});try{ke.invokeAsync(s,JSON.stringify({object:t,method:n,windowName:r,args:i??null,clientId:we}))}catch(t){e.delete(s),o(t)}})}}}Ce.System;var Ae=(function(){try{if(window.chrome?.webview?.postMessage)return window.chrome.webview.postMessage.bind(window.chrome.webview);if(window.webkit?.messageHandlers?.external?.postMessage)return window.webkit.messageHandlers.external.postMessage.bind(window.webkit.messageHandlers.external);if(window.wails?.invoke)return e=>window.wails.invoke(typeof e==`string`?e:JSON.stringify(e))}catch{}return console.warn(` -%c⚠️ Browser Environment Detected %c - -%cOnly UI previews are available in the browser. For full functionality, please run the application in desktop mode. -More information at: https://v3.wails.io/learn/build/#using-a-browser-for-development -`,`background: #ffffff; color: #000000; font-weight: bold; padding: 4px 8px; border-radius: 4px; border: 2px solid #000000;`,`background: transparent;`,`color: #ffffff; font-style: italic; font-weight: bold;`),null})();function je(e){Ae?.(e)}function Me(){return window._wails?.environment?.OS===`windows`}function Ne(){return window._wails?.environment?.OS===`linux`}function Pe(){return window._wails?.environment?.OS===`darwin`}function Fe(){return!!window._wails?.environment?.Debug}function Ie(){return new MouseEvent(`mousedown`).buttons===0}function Le(e){return e.target instanceof HTMLElement?e.target:!(e.target instanceof HTMLElement)&&e.target instanceof Node?e.target.parentElement??document.body:document.body}var Re=!1;_e&&document.addEventListener(`DOMContentLoaded`,()=>{Re=!0});function ze(e){Re||document.readyState===`complete`?e():document.addEventListener(`DOMContentLoaded`,e)}_e&&window.addEventListener(`contextmenu`,Ue);var Be=Ee(Ce.ContextMenu),Ve=0;function He(e,t,n,r){Be(Ve,{id:e,x:t,y:n,data:r})}function Ue(e){let t=Le(e),n=window.getComputedStyle(t).getPropertyValue(`--custom-contextmenu`).trim();if(n){e.preventDefault();let r=window.getComputedStyle(t).getPropertyValue(`--custom-contextmenu-data`);He(n,e.clientX,e.clientY,r)}else We(e,t)}function We(e,t){if(Fe())return;switch(window.getComputedStyle(t).getPropertyValue(`--default-contextmenu`).trim()){case`show`:return;case`hide`:e.preventDefault();return}if(t.isContentEditable)return;let n=window.getSelection(),r=n&&n.toString().length>0;if(r)for(let e=0;e{Je=e,Je||(Ye=Xe=!1,pt())});var tt=!1;function nt(){let e=window._wails?.environment?.OS;if(e===`ios`||e===`android`)return!0;let t=navigator.userAgent||navigator.vendor||window.opera||``;return/android|iphone|ipad|ipod|iemobile|wpdesktop/i.test(t)}function rt(){if(!tt&&!nt()){window.addEventListener(`mousedown`,lt,{capture:!0}),window.addEventListener(`mousemove`,lt,{capture:!0}),window.addEventListener(`mouseup`,lt,{capture:!0});for(let e of[`click`,`contextmenu`,`dblclick`])window.addEventListener(e,it,{capture:!0});tt=!0}}if(_e){rt(),document.addEventListener(`DOMContentLoaded`,rt,{once:!0});let e=0,t=window.setInterval(()=>{if(tt){window.clearInterval(t);return}rt(),++e>100&&window.clearInterval(t)},50)}function it(e){if(e.type===`dblclick`&&Pe()&&window===window.top&&at(e)){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),je(`wails:drag:doubleclick`);return}(qe||Xe)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())}function at(e){let t=Le(e);return window.getComputedStyle(t).getPropertyValue(`--wails-draggable`).trim()===`drag`&&e.offsetX>=0&&e.offsetX=0&&e.offsetY`u`)return;xt??=new ResizeObserver(At);let t=new Set(e);for(let e of bt)t.has(e)||xt.unobserve(e);for(let e of t)bt.has(e)||xt.observe(e);bt=t}function kt(){vt=!1;let e=Dt(),t=[],n=[];for(let r of e){let e=Et(r);e&&(t.push(e),n.push(r))}Ot(n);let r=JSON.stringify({version:1,regions:t});r!==yt&&(yt=r,je(`wails:non-client-region:`+r))}function At(){vt||(vt=!0,window.requestAnimationFrame(kt))}function jt(){var e,t;St||(St=!0,At(),new MutationObserver(At).observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0}),window.addEventListener(`resize`,At),window.addEventListener(`scroll`,At,!0),(e=window.visualViewport)==null||e.addEventListener(`resize`,At),(t=window.visualViewport)==null||t.addEventListener(`scroll`,At))}function Mt(){let e=window._wails.environment?.OS;if(e===void 0)return!1;let t=window._wails.flags?.nonClientRegionTracking;return e===`windows`&&t===!0&&ze(jt),!0}_e&&!Mt()&&window.addEventListener(gt,Mt,{once:!0});var Nt=Function.prototype.toString,Pt=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,Ft,It;if(typeof Pt==`function`&&typeof Object.defineProperty==`function`)try{Ft=Object.defineProperty({},"length",{get:function(){throw It}}),It={},Pt(function(){throw 42},null,Ft)}catch(e){e!==It&&(Pt=null)}else Pt=null;var Lt=/^\s*class\b/,Rt=function(e){try{var t=Nt.call(e);return Lt.test(t)}catch{return!1}},zt=function(e){try{return!Rt(e)&&(Nt.call(e),!0)}catch{return!1}},Bt=Object.prototype.toString,Vt=`[object Object]`,Ht=`[object Function]`,Ut=`[object GeneratorFunction]`,Wt=`[object HTMLAllCollection]`,Gt=`[object HTML document.all class]`,Kt=`[object HTMLCollection]`,qt=typeof Symbol==`function`&&!!Symbol.toStringTag,Jt=!(0 in[,]),Yt=function(){return!1};if(typeof document==`object`){var Xt=document.all;Bt.call(Xt)===Bt.call(document.all)&&(Yt=function(e){if((Jt||!e)&&(e===void 0||typeof e==`object`))try{var t=Bt.call(e);return(t===Wt||t===Gt||t===Kt||t===Vt)&&e(``)==null}catch{}return!1})}function Zt(e){if(Yt(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{Pt(e,null,Ft)}catch(e){if(e!==It)return!1}return!Rt(e)&&zt(e)}function Qt(e){if(Yt(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(qt)return zt(e);if(Rt(e))return!1;var t=Bt.call(e);return t!==Ht&&t!==Ut&&!/^\[object HTML/.test(t)?!1:zt(e)}var $t=Pt?Zt:Qt,en=class extends Error{constructor(e,t){super(e,t),this.name=`CancelError`}},tn=class extends Error{constructor(e,t,n){super((n??`Unhandled rejection in cancelled promise.`)+` Reason: `+pn(t),{cause:t}),this.promise=e,this.name=`CancelledRejectionError`}},nn=Symbol(`barrier`),rn=Symbol(`cancelImpl`),an=Symbol.species??Symbol(`speciesPolyfill`),on=class e extends Promise{constructor(e,t){let n,r;if(super((e,t)=>{n=e,r=t}),this.constructor[an]!==Promise)throw TypeError(`CancellablePromise does not support transparent subclassing. Please refrain from overriding the [Symbol.species] static property.`);let i={promise:this,resolve:n,reject:r,get oncancelled(){return t??null},set oncancelled(e){t=e??void 0}},a={get root(){return a},resolving:!1,settled:!1};Object.defineProperties(this,{[nn]:{configurable:!1,enumerable:!1,writable:!0,value:null},[rn]:{configurable:!1,enumerable:!1,writable:!1,value:sn(i,a)}});let o=ln(i,a);try{e(cn(i,a),o)}catch(e){a.resolving?console.log(`Unhandled exception in CancellablePromise executor.`,e):o(e)}}cancel(t){return new e(e=>{Promise.all([this[rn](new en(`Promise cancelled.`,{cause:t})),mn(this)]).then(()=>e(),()=>e())})}cancelOn(e){return e.aborted?this.cancel(e.reason):e.addEventListener(`abort`,()=>void this.cancel(e.reason),{capture:!0}),this}then(t,n,r){if(!(this instanceof e))throw TypeError(`CancellablePromise.prototype.then called on an invalid object.`);if($t(t)||(t=dn),$t(n)||(n=fn),t===dn&&n==fn)return new e(e=>e(this));let i={};return this[nn]=i,new e((e,r)=>{super.then(n=>{var a;this[nn]===i&&(this[nn]=null),(a=i.resolve)==null||a.call(i);try{e(t(n))}catch(e){r(e)}},t=>{var a;this[nn]===i&&(this[nn]=null),(a=i.resolve)==null||a.call(i);try{e(n(t))}catch(e){r(e)}})},async e=>{try{return r?.(e)}finally{await this.cancel(e)}})}catch(e,t){return this.then(void 0,e,t)}finally(t,n){if(!(this instanceof e))throw TypeError(`CancellablePromise.prototype.finally called on an invalid object.`);return $t(t)?this.then(n=>e.resolve(t()).then(()=>n),n=>e.resolve(t()).then(()=>{throw n}),n):this.then(t,t,n)}static get[an](){return Promise}static all(t){let n=Array.from(t),r=n.length===0?e.resolve(n):new e((e,t)=>{Promise.all(n).then(e,t)},e=>un(r,n,e));return r}static allSettled(t){let n=Array.from(t),r=n.length===0?e.resolve(n):new e((e,t)=>{Promise.allSettled(n).then(e,t)},e=>un(r,n,e));return r}static any(t){let n=Array.from(t),r=n.length===0?e.resolve(n):new e((e,t)=>{Promise.any(n).then(e,t)},e=>un(r,n,e));return r}static race(t){let n=Array.from(t),r=new e((e,t)=>{Promise.race(n).then(e,t)},e=>un(r,n,e));return r}static cancel(t){let n=new e(()=>{});return n.cancel(t),n}static timeout(t,n){let r=new e(()=>{});return AbortSignal&&typeof AbortSignal==`function`&&AbortSignal.timeout&&typeof AbortSignal.timeout==`function`?AbortSignal.timeout(t).addEventListener(`abort`,()=>void r.cancel(n)):setTimeout(()=>void r.cancel(n),t),r}static sleep(t,n){return new e(e=>{setTimeout(()=>e(n),t)})}static reject(t){return new e((e,n)=>n(t))}static resolve(t){return t instanceof e?t:new e(e=>e(t))}static withResolvers(){let t={oncancelled:null};return t.promise=new e((e,n)=>{t.resolve=e,t.reject=n},e=>{var n;(n=t.oncancelled)==null||n.call(t,e)}),t}};function sn(e,t){let n;return r=>{if(t.settled||(t.settled=!0,t.reason=r,e.reject(r),Promise.prototype.then.call(e.promise,void 0,e=>{if(e!==r)throw e})),!(!t.reason||!e.oncancelled))return n=new Promise(n=>{try{n(e.oncancelled(t.reason.cause))}catch(t){Promise.reject(new tn(e.promise,t,`Unhandled exception in oncancelled callback.`))}}).catch(t=>{Promise.reject(new tn(e.promise,t,`Unhandled rejection in oncancelled callback.`))}),e.oncancelled=null,n}}function cn(e,t){return n=>{if(!t.resolving){if(t.resolving=!0,n===e.promise){if(t.settled)return;t.settled=!0,e.reject(TypeError(`A promise cannot be resolved with itself.`));return}if(n!=null&&(typeof n==`object`||typeof n==`function`)){let r;try{r=n.then}catch(n){t.settled=!0,e.reject(n);return}if($t(r)){try{let r=n.cancel;if($t(r)){let i=e=>{Reflect.apply(r,n,[e])};t.reason?sn(Object.assign(Object.assign({},e),{oncancelled:i}),t)(t.reason):e.oncancelled=i}}catch{}let i={root:t.root,resolving:!1,get settled(){return this.root.settled},set settled(e){this.root.settled=e},get reason(){return this.root.reason}},a=ln(e,i);try{Reflect.apply(r,n,[cn(e,i),a])}catch(e){a(e)}return}}t.settled||(t.settled=!0,e.resolve(n))}}}function ln(e,t){return n=>{if(!t.resolving){if(t.resolving=!0,t.settled){try{if(n instanceof en&&t.reason instanceof en&&Object.is(n.cause,t.reason.cause))return}catch{}Promise.reject(new tn(e.promise,n))}else t.settled=!0,e.reject(n)}}}function un(e,t,n){let r=[];for(let i of t){let t;try{if(!$t(i.then)||(t=i.cancel,!$t(t)))continue}catch{continue}let a;try{a=Reflect.apply(t,i,[n])}catch(t){Promise.reject(new tn(e,t,`Unhandled exception in cancel method.`));continue}a&&r.push((a instanceof Promise?a:Promise.resolve(a)).catch(t=>{Promise.reject(new tn(e,t,`Unhandled rejection in cancel method.`))}))}return Promise.all(r)}function dn(e){return e}function fn(e){throw e}function pn(e){try{if(e instanceof Error||typeof e!=`object`||e.toString!==Object.prototype.toString)return``+e}catch{}try{return JSON.stringify(e)}catch{}try{return Object.prototype.toString.call(e)}catch{}return``}function mn(e){let t=e[nn]??{};return`promise`in t||Object.assign(t,hn()),e[nn]??(t.resolve(),e[nn]=t),t.promise}var hn=Promise.withResolvers;hn=hn&&typeof hn==`function`?hn.bind(Promise):function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},_e&&(window._wails=window._wails||{});var gn=Ee(Ce.Call),_n=Ee(Ce.CancelCall),vn=new Map,yn=0,bn=0;function xn(){let e;do e=ye();while(vn.has(e));return e}function Sn(e){let t=xn(),n=on.withResolvers();vn.set(t,{resolve:n.resolve,reject:n.reject});let r=gn(yn,Object.assign({"call-id":t},e)),i=!0;r.then(e=>{i=!1,vn.delete(t),n.resolve(e)},e=>{i=!1,vn.delete(t),n.reject(e)});let a=()=>(vn.delete(t),_n(bn,{"call-id":t}).catch(e=>{console.error(`Error while requesting binding call cancellation:`,e)}));return n.oncancelled=()=>i?a():r.then(a),n.promise}function A(e,...t){return Sn({methodID:e,args:t})}function Cn(e){return e}function wn(e){return e===Cn?e=>e===null?[]:e:t=>{if(t===null)return[];for(let n=0;nt===null?null:e(t)}var En={},j=new Map,Dn=class{constructor(e,t,n){this.eventName=e,this.callback=t,this.maxCallbacks=n||-1}dispatch(e){try{this.callback(e)}catch(e){console.error(e)}return this.maxCallbacks!==-1&&(--this.maxCallbacks,this.maxCallbacks===0)}};function On(e){let t=j.get(e.eventName);t&&(t=t.filter(t=>t!==e),t.length===0?j.delete(e.eventName):j.set(e.eventName,t))}_e&&(window._wails=window._wails||{},window._wails.dispatchWailsEvent=An),Ce.Events;var kn=class{constructor(e,t){this.name=e,this.data=t??null}};function An(e){let t=j.get(e.name);if(!t)return;let n=new kn(e.name,e.name in En?En[e.name](e.data):e.data);`sender`in e&&(n.sender=e.sender);let r=new Set;for(let e of t.slice())e.dispatch(n)&&r.add(e);if(r.size>0){let t=j.get(e.name);if(t){let n=t.filter(e=>!r.has(e));n.length===0?j.delete(e.name):j.set(e.name,n)}}}function jn(e,t,n){let r=j.get(e)||[],i=new Dn(e,t,n);return r.push(i),j.set(e,r),()=>On(i)}function Mn(e,t){return jn(e,t,-1)}var Nn=`data-file-drop-target`,Pn=`file-drop-target-active`,M=null,Fn=0,In=1,Ln=2,Rn=3,zn=4,Bn=5,Vn=6,Hn=7,Un=8,Wn=9,Gn=10,Kn=11,qn=12,Jn=13,Yn=14,Xn=15,Zn=16,Qn=17,$n=18,er=19,tr=20,nr=21,rr=22,ir=23,ar=24,or=25,sr=26,cr=27,lr=28,ur=29,dr=30,fr=31,pr=32,mr=33,hr=34,gr=35,_r=36,vr=37,yr=38,br=39,xr=40,Sr=41,Cr=42,wr=43,Tr=44,Er=45,Dr=46,Or=47,kr=48,Ar=49,jr=50,Mr=51,Nr=52;function Pr(e){return e?e.closest(`[${Nn}]`):null}function Fr(){return window.chrome?.webview?.postMessageWithAdditionalObjects!=null&&window._wails?.flags?.enableFileDrop===!0}function Ir(e,t,n){window.chrome?.webview?.postMessageWithAdditionalObjects&&window.chrome.webview.postMessageWithAdditionalObjects(`file:drop:${e}:${t}`,n)}var Lr=!1;function Rr(){Lr=!1,M&&=(M.classList.remove(Pn),null)}function zr(){window._wails?.flags?.enableFileDrop!==!1&&(Lr=!0)}function Br(){Rr()}function Vr(e,t){if(!Lr||window._wails?.flags?.enableFileDrop===!1)return;let n=Pr(document.elementFromPoint(e,t));M&&M!==n&&M.classList.remove(Pn),n?(n.classList.add(Pn),M=n):M=null}var N=Symbol(`caller`),Hr=new class e{constructor(t=``){this[N]=Ee(Ce.Window,t);for(let t of Object.getOwnPropertyNames(e.prototype))t!==`constructor`&&typeof this[t]==`function`&&(this[t]=this[t].bind(this))}Get(t){return new e(t)}Position(){return this[N](Fn)}Center(){return this[N](In)}Close(){return this[N](Ln)}DisableSizeConstraints(){return this[N](Rn)}EnableSizeConstraints(){return this[N](zn)}Focus(){return this[N](Bn)}ForceReload(){return this[N](Vn)}Fullscreen(){return this[N](Hn)}GetScreen(){return this[N](Un)}GetZoom(){return this[N](Wn)}Height(){return this[N](Gn)}Hide(){return this[N](Kn)}IsFocused(){return this[N](qn)}IsFullscreen(){return this[N](Jn)}IsMaximised(){return this[N](Yn)}IsMinimised(){return this[N](Xn)}Maximise(){return this[N](Zn)}Minimise(){return this[N](Qn)}Name(){return this[N]($n)}OpenDevTools(){return this[N](er)}RelativePosition(){return this[N](tr)}Reload(){return this[N](nr)}Resizable(){return this[N](rr)}Restore(){return this[N](ir)}SetPosition(e,t){return this[N](ar,{x:e,y:t})}SetAlwaysOnTop(e){return this[N](or,{alwaysOnTop:e})}SetBackgroundColour(e,t,n,r){return this[N](sr,{r:e,g:t,b:n,a:r})}SetFrameless(e){return this[N](cr,{frameless:e})}SetFullscreenButtonEnabled(e){return this[N](lr,{enabled:e})}SetMaxSize(e,t){return this[N](ur,{width:e,height:t})}SetMinSize(e,t){return this[N](dr,{width:e,height:t})}SetRelativePosition(e,t){return this[N](fr,{x:e,y:t})}SetResizable(e){return this[N](pr,{resizable:e})}SetSize(e,t){return this[N](mr,{width:e,height:t})}SetTitle(e){return this[N](hr,{title:e})}SetZoom(e){return this[N](gr,{zoom:e})}Show(){return this[N](_r)}Size(){return this[N](vr)}ToggleFullscreen(){return this[N](yr)}ToggleMaximise(){return this[N](br)}ToggleFrameless(){return this[N](xr)}UnFullscreen(){return this[N](Sr)}UnMaximise(){return this[N](Cr)}UnMinimise(){return this[N](wr)}Width(){return this[N](Tr)}Zoom(){return this[N](Er)}ZoomIn(){return this[N](Dr)}ZoomOut(){return this[N](Or)}ZoomReset(){return this[N](kr)}HandlePlatformFileDrop(e,t,n){if(window._wails?.flags?.enableFileDrop===!1)return;let r=Pr(document.elementFromPoint(t,n));if(!r)return;let i={id:r.id,classList:Array.from(r.classList),attributes:{}};for(let e=0;e{if(!e.dataTransfer?.types.includes(`Files`))return;if(e.preventDefault(),window._wails?.flags?.enableFileDrop===!1){e.dataTransfer.dropEffect=`none`;return}t++;let n=Pr(document.elementFromPoint(e.clientX,e.clientY));M&&M!==n&&M.classList.remove(Pn),n?(n.classList.add(Pn),e.dataTransfer.dropEffect=`copy`,M=n):(e.dataTransfer.dropEffect=`none`,M=null)},!1),e.addEventListener(`dragover`,e=>{if(!e.dataTransfer?.types.includes(`Files`))return;if(e.preventDefault(),window._wails?.flags?.enableFileDrop===!1){e.dataTransfer.dropEffect=`none`;return}let t=Pr(document.elementFromPoint(e.clientX,e.clientY));M&&M!==t&&M.classList.remove(Pn),t?(t.classList.contains(Pn)||t.classList.add(Pn),e.dataTransfer.dropEffect=`copy`,M=t):(e.dataTransfer.dropEffect=`none`,M=null)},!1),e.addEventListener(`dragleave`,e=>{e.dataTransfer?.types.includes(`Files`)&&(e.preventDefault(),window._wails?.flags?.enableFileDrop!==!1&&e.relatedTarget!==null&&(t--,(t===0||M&&!M.contains(e.relatedTarget))&&(M&&=(M.classList.remove(Pn),null),t=0)))},!1),e.addEventListener(`drop`,e=>{if(e.dataTransfer?.types.includes(`Files`)&&(e.preventDefault(),window._wails?.flags?.enableFileDrop!==!1&&(t=0,M&&=(M.classList.remove(Pn),null),Fr()))){let t=[];if(e.dataTransfer.items){for(let n of e.dataTransfer.items)if(n.kind===`file`){let e=n.getAsFile();e&&t.push(e)}}else if(e.dataTransfer.files)for(let n of e.dataTransfer.files)t.push(n);t.length>0&&Ir(e.clientX,e.clientY,t)}},!1)}typeof window<`u`&&typeof document<`u`&&Ur(),_e&&(window._wails=window._wails||{}),_e&&(window._wails.invoke=je,window._wails.clientId=we),_e&&(window._wails.handlePlatformFileDrop=Hr.HandlePlatformFileDrop.bind(Hr)),_e&&(window._wails.handleDragEnter=zr,window._wails.handleDragLeave=Br,window._wails.handleDragOver=Vr),_e&&je(`wails:runtime:ready`);function Wr(e){return fetch(e,{method:`HEAD`}).then(t=>{if(t.ok&&(t.headers.get(`content-type`)||``).toLowerCase().includes(`javascript`)){let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}}).catch(()=>{})}_e&&Wr(`/wails/custom.js`);var Gr=function(e){return e.$zero=``,e.Dongle=`dongle`,e.Wired=`wired`,e}({}),Kr=class e{ID;ProfileID;Path;InventoryRevision;SessionOnly;constructor(e={}){`ID`in e||(this.ID=new Jr),`ProfileID`in e||(this.ProfileID=``),`Path`in e||(this.Path=``),`InventoryRevision`in e||(this.InventoryRevision=0),`SessionOnly`in e||(this.SessionOnly=!1),Object.assign(this,e)}static createFrom(t={}){let n=Yr,r=typeof t==`string`?JSON.parse(t):t;return`ID`in r&&(r.ID=n(r.ID)),new e(r)}},qr=class e{ID;Profile;Path;Connection;Eligible;Warning;constructor(e={}){`ID`in e||(this.ID=new Jr),`Profile`in e||(this.Profile=``),`Path`in e||(this.Path=``),`Connection`in e||(this.Connection=Gr.$zero),`Eligible`in e||(this.Eligible=!1),`Warning`in e||(this.Warning=``),Object.assign(this,e)}static createFrom(t={}){let n=Yr,r=typeof t==`string`?JSON.parse(t):t;return`ID`in r&&(r.ID=n(r.ID)),new e(r)}},Jr=class e{VendorID;ProductID;Serial;constructor(e={}){`VendorID`in e||(this.VendorID=0),`ProductID`in e||(this.ProductID=0),`Serial`in e||(this.Serial=``),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},Yr=Jr.createFrom,Xr=function(e){return e[e.$zero=0]=`$zero`,e[e.LightingOff=0]=`LightingOff`,e[e.LightingFixed=16]=`LightingFixed`,e[e.LightingBreathing=32]=`LightingBreathing`,e[e.LightingNeon=48]=`LightingNeon`,e[e.LightingColorBreathing=64]=`LightingColorBreathing`,e[e.LightingStaticDPI=80]=`LightingStaticDPI`,e[e.LightingBreathingDPI=96]=`LightingBreathingDPI`,e}({}),Zr=class e{Mode;TemplateID;constructor(e={}){`Mode`in e||(this.Mode=Xr.$zero),`TemplateID`in e||(this.TemplateID=Qr.$zero),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},Qr=function(e){return e.$zero=``,e.LightingTemplateOff=`off`,e.LightingTemplateFixedGreen=`fixed-green`,e.LightingTemplateBreathingGreen=`breathing-green`,e.LightingTemplateBreathingFE5EF9=`breathing-fe5ef9`,e.LightingTemplateBreathingFF7F00=`breathing-ff7f00`,e.LightingTemplateBreathingFFFF00=`breathing-ffff00`,e.LightingTemplateStaticDPIDefault=`static-dpi-default`,e.LightingTemplateNeonOne=`neon-one`,e.LightingTemplateNeonTwo=`neon-two`,e.LightingTemplateColorBreathingOne=`color-breathing-one`,e.LightingTemplateColorBreathingTwo=`color-breathing-two`,e.LightingTemplateBreathingDPIOne=`breathing-dpi-one`,e.LightingTemplateBreathingDPITwo=`breathing-dpi-two`,e.LightingTemplateBreathingDPIThree=`breathing-dpi-three`,e}({}),$r=function(e){return e[e.$zero=0]=`$zero`,e[e.PollingRate125=125]=`PollingRate125`,e[e.PollingRate250=250]=`PollingRate250`,e[e.PollingRate500=500]=`PollingRate500`,e[e.PollingRate1000=1e3]=`PollingRate1000`,e}({}),ei=function(e){return e.$zero=``,e.RemapOff=`off`,e.RemapLeft=`left`,e.RemapRight=`right`,e.RemapMiddle=`middle`,e.RemapBackward=`backward`,e.RemapForward=`forward`,e.RemapDoubleClick=`double_click`,e.RemapFire=`fire`,e}({}),ti=class e{Button;Action;PreservedDefault;constructor(e={}){`Button`in e||(this.Button=0),`Action`in e||(this.Action=ei.$zero),`PreservedDefault`in e||(this.PreservedDefault=``),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},ni=class e{Buttons;constructor(e={}){`Buttons`in e||(this.Buttons=[]),Object.assign(this,e)}static createFrom(t={}){let n=ii,r=typeof t==`string`?JSON.parse(t):t;return`Buttons`in r&&(r.Buttons=n(r.Buttons)),new e(r)}},ri=ti.createFrom,ii=wn(ri),ai=class e{TemplateID;CSSColor;constructor(e={}){`TemplateID`in e||(this.TemplateID=Qr.$zero),`CSSColor`in e||(this.CSSColor=``),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},oi=class e{Mode;Label;DefaultTemplateID;SpeedVariants;ColorTemplates;constructor(e={}){`Mode`in e||(this.Mode=Xr.$zero),`Label`in e||(this.Label=``),`DefaultTemplateID`in e||(this.DefaultTemplateID=Qr.$zero),`SpeedVariants`in e||(this.SpeedVariants=[]),`ColorTemplates`in e||(this.ColorTemplates=[]),Object.assign(this,e)}static createFrom(t={}){let n=di,r=pi,i=typeof t==`string`?JSON.parse(t):t;return`SpeedVariants`in i&&(i.SpeedVariants=n(i.SpeedVariants)),`ColorTemplates`in i&&(i.ColorTemplates=r(i.ColorTemplates)),new e(i)}},si=Zr,ci=class e{TemplateID;constructor(e={}){`TemplateID`in e||(this.TemplateID=Qr.$zero),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},li=ni,ui=ci.createFrom,di=wn(ui),fi=ai.createFrom,pi=wn(fi),mi=class e{AngleControl;RippleControl;StageMask;LiftDistance;DPI;ActiveStage;Colors;constructor(e={}){`AngleControl`in e||(this.AngleControl=!1),`RippleControl`in e||(this.RippleControl=!1),`StageMask`in e||(this.StageMask=0),`LiftDistance`in e||(this.LiftDistance=0),`DPI`in e||(this.DPI=Array.from({length:8},()=>0)),`ActiveStage`in e||(this.ActiveStage=0),`Colors`in e||(this.Colors=Array.from({length:8},()=>Array.from({length:3},()=>0))),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},hi=class e{Desired;Applied;Persisted;Factory;Revision;Error;Firmware;Persistence;RetryAvailable;constructor(e={}){this.Desired=0,this.Applied=0,this.Persisted=null,this.Factory=0,this.Revision=0,this.Error=new gi,this.Firmware=``,this.Persistence=``,this.RetryAvailable=!1,Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return`Error`in n&&(n.Error=gi.createFrom(n.Error)),new e(n)}},gi=class e{Code;constructor(e={}){`Code`in e||(this.Code=_i.$zero),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},_i=function(e){return e.$zero=``,e.DeviceUnavailable=`device_unavailable`,e.PermissionDenied=`permission_denied`,e.StatusReadFailed=`status_read_failed`,e.InvalidConfiguration=`invalid_configuration`,e.ApplyFailed=`apply_failed`,e.PersistenceFailed=`persistence_failed`,e.SelectionRequired=`selection_required`,e.StaleBinding=`stale_binding`,e.AmbiguousIdentity=`ambiguous_identity`,e.MigrationFailed=`migration_failed`,e}({}),vi=class e{Devices;Selected;Error;constructor(e={}){`Devices`in e||(this.Devices=[]),`Selected`in e||(this.Selected=null),`Error`in e||(this.Error=new gi),Object.assign(this,e)}static createFrom(t={}){let n=Oi,r=Ai,i=ji,a=typeof t==`string`?JSON.parse(t):t;return`Devices`in a&&(a.Devices=n(a.Devices)),`Selected`in a&&(a.Selected=r(a.Selected)),`Error`in a&&(a.Error=i(a.Error)),new e(a)}},yi=class e{Pending;Applied;Effects;Revision;Firmware;Error;constructor(e={}){`Pending`in e||(this.Pending=new si),`Applied`in e||(this.Applied=null),`Effects`in e||(this.Effects=[]),`Revision`in e||(this.Revision=0),`Firmware`in e||(this.Firmware=``),`Error`in e||(this.Error=new gi),Object.assign(this,e)}static createFrom(t={}){let n=Mi,r=Ni,i=Fi,a=ji,o=typeof t==`string`?JSON.parse(t):t;return`Pending`in o&&(o.Pending=n(o.Pending)),`Applied`in o&&(o.Applied=r(o.Applied)),`Effects`in o&&(o.Effects=i(o.Effects)),`Error`in o&&(o.Error=a(o.Error)),new e(o)}},bi=class e{Pending;Applied;Persisted;Revision;Firmware;Persistence;RetryAvailable;Error;constructor(e={}){this.Pending=0,this.Applied=0,this.Persisted=null,this.Revision=0,this.Firmware=``,this.Persistence=``,this.RetryAvailable=!1,this.Error=new gi,Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return`Error`in n&&(n.Error=gi.createFrom(n.Error)),new e(n)}},xi=class e{Desired;Applied;Persisted;Factory;Revision;Error;Firmware;Persistence;RetryAvailable;constructor(e={}){`Desired`in e||(this.Desired=$r.$zero),`Applied`in e||(this.Applied=$r.$zero),`Persisted`in e||(this.Persisted=null),`Factory`in e||(this.Factory=$r.$zero),`Revision`in e||(this.Revision=0),`Error`in e||(this.Error=new gi),`Firmware`in e||(this.Firmware=``),`Persistence`in e||(this.Persistence=``),`RetryAvailable`in e||(this.RetryAvailable=!1),Object.assign(this,e)}static createFrom(t={}){let n=ji,r=typeof t==`string`?JSON.parse(t):t;return`Error`in r&&(r.Error=n(r.Error)),new e(r)}},Si=class e{Pending;Applied;Factory;Actions;Revision;Firmware;Persistence;RetryAvailable;Error;constructor(e={}){`Pending`in e||(this.Pending=new li),`Applied`in e||(this.Applied=new li),`Factory`in e||(this.Factory=new li),`Actions`in e||(this.Actions=[]),`Revision`in e||(this.Revision=0),`Firmware`in e||(this.Firmware=``),`Persistence`in e||(this.Persistence=``),`RetryAvailable`in e||(this.RetryAvailable=!1),`Error`in e||(this.Error=new gi),Object.assign(this,e)}static createFrom(t={}){let n=Ii,r=Ii,i=Ii,a=Li,o=ji,s=typeof t==`string`?JSON.parse(t):t;return`Pending`in s&&(s.Pending=n(s.Pending)),`Applied`in s&&(s.Applied=r(s.Applied)),`Factory`in s&&(s.Factory=i(s.Factory)),`Actions`in s&&(s.Actions=a(s.Actions)),`Error`in s&&(s.Error=o(s.Error)),new e(s)}},Ci=class e{Lane;State;Code;constructor(e={}){`Lane`in e||(this.Lane=``),`State`in e||(this.State=``),`Code`in e||(this.Code=_i.$zero),Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},wi=class e{Lanes;Cleanup;Error;RetryAvailable;constructor(e={}){`Lanes`in e||(this.Lanes=[]),`Cleanup`in e||(this.Cleanup=new Ci),`Error`in e||(this.Error=new gi),`RetryAvailable`in e||(this.RetryAvailable=!1),Object.assign(this,e)}static createFrom(t={}){let n=P,r=Ri,i=ji,a=typeof t==`string`?JSON.parse(t):t;return`Lanes`in a&&(a.Lanes=n(a.Lanes)),`Cleanup`in a&&(a.Cleanup=r(a.Cleanup)),`Error`in a&&(a.Error=i(a.Error)),new e(a)}},Ti=class e{constructor(e={}){Object.assign(this,e)}static createFrom(t={}){let n=typeof t==`string`?JSON.parse(t):t;return new e(n)}},Ei=class e{Connection;Battery;Applied;Pending;Factory;Revision;Error;Firmware;Persistence;RetryAvailable;ObservedStage;ObservedDPI;constructor(e={}){`Connection`in e||(this.Connection=``),`Battery`in e||(this.Battery=null),`Applied`in e||(this.Applied=new mi),`Pending`in e||(this.Pending=new mi),`Factory`in e||(this.Factory=new mi),`Revision`in e||(this.Revision=0),`Error`in e||(this.Error=new gi),`Firmware`in e||(this.Firmware=``),`Persistence`in e||(this.Persistence=``),`RetryAvailable`in e||(this.RetryAvailable=!1),`ObservedStage`in e||(this.ObservedStage=null),`ObservedDPI`in e||(this.ObservedDPI=null),Object.assign(this,e)}static createFrom(t={}){let n=F,r=F,i=F,a=ji,o=typeof t==`string`?JSON.parse(t):t;return`Applied`in o&&(o.Applied=n(o.Applied)),`Pending`in o&&(o.Pending=r(o.Pending)),`Factory`in o&&(o.Factory=i(o.Factory)),`Error`in o&&(o.Error=a(o.Error)),new e(o)}},Di=qr.createFrom,Oi=wn(Di),ki=Kr.createFrom,Ai=Tn(ki),ji=gi.createFrom,Mi=Zr.createFrom,Ni=Tn(Mi),Pi=oi.createFrom,Fi=wn(Pi),Ii=ni.createFrom,Li=wn(Cn),Ri=Ci.createFrom,P=wn(Ri),F=mi.createFrom,zi=n({ApplyDPI:()=>Bi,ApplyDebounce:()=>Vi,ApplyLighting:()=>Ui,ApplyNormalSleep:()=>Hi,ApplyPollingRate:()=>Wi,ApplyRemap:()=>Gi,AttachDevicePersistence:()=>Ki,AttachInventory:()=>qi,AttachListener:()=>Ji,AttachMigrator:()=>Yi,AttachPollingPersistence:()=>Xi,AttachResetRunner:()=>Zi,GetDebounceSnapshot:()=>Qi,GetLightingSnapshot:()=>$i,GetNormalSleepSnapshot:()=>ea,GetPollingSnapshot:()=>ta,GetRemapSnapshot:()=>na,GetSnapshot:()=>ra,Quiesce:()=>ia,RefreshInventory:()=>aa,RefreshStatus:()=>oa,ResetToFactory:()=>sa,RetryDebouncePersistence:()=>ca,RetryNormalSleepPersistence:()=>la,RetryPersistence:()=>ua,RetryPollingPersistence:()=>I,RetryRemapPersistence:()=>da,SelectDevice:()=>fa,StageDPI:()=>pa,StageDebounce:()=>ma,StageLighting:()=>ha,StageNormalSleep:()=>ga,StagePollingRate:()=>_a,StartListener:()=>va});function Bi(){return A(3461389201).then(e=>ya(e))}function Vi(){return A(2092901873).then(e=>hi.createFrom(e))}function Hi(){return A(4245697592).then(e=>bi.createFrom(e))}function Ui(){return A(2699165782).then(e=>ba(e))}function Wi(){return A(3669795219).then(e=>xa(e))}function Gi(e){return A(4250088139,e).then(e=>Sa(e))}function Ki(e,t){return A(3887596840,e,t).then(e=>wa(e))}function qi(e){return A(3655060073,e).then(e=>wa(e))}function Ji(e,t){return A(3795100807,e,t).then(e=>wa(e))}function Yi(e){return A(1213464496,e).then(e=>wa(e))}function Xi(e,t){return A(46337553,e,t).then(e=>wa(e))}function Zi(e){return A(2710634656,e).then(e=>wa(e))}function Qi(){return A(847781341).then(e=>hi.createFrom(e))}function $i(){return A(1849424142).then(e=>ba(e))}function ea(){return A(690718744).then(e=>bi.createFrom(e))}function ta(){return A(1825488429).then(e=>xa(e))}function na(){return A(3043747887).then(e=>Sa(e))}function ra(){return A(152452614).then(e=>ya(e))}function ia(e){return A(2160581423,e)}function aa(){return A(2420989727).then(e=>Ta(e))}function oa(){return A(3077675599).then(e=>ya(e))}function sa(){return A(2708725118).then(e=>Ea(e))}function ca(){return A(2757981562).then(e=>hi.createFrom(e))}function la(){return A(3832391481).then(e=>bi.createFrom(e))}function ua(){return A(808566931).then(e=>ya(e))}function I(){return A(3085626362).then(e=>xa(e))}function da(){return A(2964542300).then(e=>Sa(e))}function fa(e){return A(236647672,e).then(e=>Ta(e))}function pa(e){return A(2647292463,e).then(e=>ya(e))}function ma(e){return A(3641231323,e).then(e=>hi.createFrom(e))}function ha(e){return A(1205871004,e).then(e=>ba(e))}function ga(e){return A(1234567502,e).then(e=>bi.createFrom(e))}function _a(e){return A(1822189569,e).then(e=>xa(e))}function va(){return A(987205650)}var ya=Ei.createFrom,ba=yi.createFrom,xa=xi.createFrom,Sa=Si.createFrom,Ca=Ti.createFrom,wa=Tn(Ca),Ta=vi.createFrom,Ea=wi.createFrom,Da=zi,Oa={GetSnapshot:ra,GetPollingSnapshot:ta,GetDebounceSnapshot:Qi,GetLightingSnapshot:$i,GetNormalSleepSnapshot:ea,GetRemapSnapshot:na,RefreshStatus:oa,RefreshInventory:aa,SelectDevice:fa,StageDPI:pa,ApplyDPI:Da.ApplyDPI,StagePollingRate:_a,ApplyPollingRate:Da.ApplyPollingRate,StageDebounce:ma,ApplyDebounce:Vi,RetryDebouncePersistence:ca,StageLighting:ha,StageNormalSleep:ga,ApplyNormalSleep:Hi,RetryNormalSleepPersistence:la,ApplyRemap:Da.ApplyRemap,ApplyLighting:Ui,RetryRemapPersistence:da,RetryPollingPersistence:I,ResetToFactory:Da.ResetToFactory,RetryPersistence:ua,OnStatusEvent:e=>Mn(`mouse:status`,t=>e(t.data)),OnConfiguration:e=>Mn(`mouse:configuration`,t=>e(t.data)),OnPollingConfiguration:e=>Mn(`mouse:polling-configuration`,t=>e(t.data)),OnRemapConfiguration:e=>Mn(`mouse:remap-configuration`,t=>e(t.data))};(0,u.createRoot)(document.getElementById(`root`)).render((0,v.jsx)(ge,{service:Oa})); \ No newline at end of file diff --git a/cmd/x6configurator/frontend/dist/index.html b/cmd/x6configurator/frontend/dist/index.html deleted file mode 100644 index a6dd9b9..0000000 --- a/cmd/x6configurator/frontend/dist/index.html +++ /dev/null @@ -1,3 +0,0 @@ -Attack Shark X6 - -
diff --git a/docs/linux-usb-prerequisites.md b/docs/linux-usb-prerequisites.md index f7f7e42..4196f14 100644 --- a/docs/linux-usb-prerequisites.md +++ b/docs/linux-usb-prerequisites.md @@ -27,6 +27,8 @@ Wails remains pinned to `github.com/wailsapp/wails/v3 v3.0.0-beta.5`; this document does not upgrade it. Build and run the fake-only hidraw tests with: ```sh +# Generate the assets embedded by cmd/x6configurator before Go checks or builds. +(cd frontend && npm ci && npm run build) go test ./internal/hidlinux -run 'TestHidraw(SendAndAwait|ReadInterruptIN|Enumerate|ValidateDescriptor)' -count=1 go build ./cmd/x6configurator ``` diff --git a/odd/tasks/untrack-frontend-dist.md b/odd/tasks/untrack-frontend-dist.md new file mode 100644 index 0000000..47c9914 --- /dev/null +++ b/odd/tasks/untrack-frontend-dist.md @@ -0,0 +1,84 @@ +# Untrack Generated Frontend Dist + +## Objective + +Remove the generated `cmd/x6configurator/frontend/dist/**` output from version control while keeping it available whenever the application is built. Future frontend output must be ignored, and frontend generation must happen before Go build, test, vet, Wails build, and release operations that depend on the embedded assets. + +The maintainer-approved change must preserve `cmd/x6configurator/main.go`'s `//go:embed frontend/dist` contract and the existing Taskfile and CI behavior. The clean-checkout-like validation must prove that a checkout without tracked `dist` files can generate the assets before dependent Go operations. + +## Repository Evidence and Expected Surfaces + +The implementation is expected to touch only the following documentation/configuration/build-guidance surfaces, plus the three tracked generated files explicitly listed under the destructive boundary: + +| Surface | Evidence and expected change | +|---|---| +| `.gitignore` | Currently force-includes `cmd/x6configurator/frontend/dist/` and its contents; replace that exception with an ignore rule for generated output. | +| `Makefile` | Defines `frontend-build`, `go-test`, `test`, `build`, and `check`; make dependent Go/build/check paths generate frontend assets first without changing their intended commands. | +| `cmd/x6configurator/Taskfile.yml` | `build` already depends on `build:frontend`; preserve this dependency and its `go build -o ../../bin/attack-shark-linux .` command. | +| `.github/workflows/test.yml` | Already builds frontend assets before `go build ./...`, `go vet ./...`, and `go test ./...`; preserve and make the ordering explicit/robust after `dist` is untracked. | +| `.github/workflows/release.yml` | Installs frontend dependencies, then runs `make check`; preserve release verification ordering and ensure the frontend is generated before all dependent operations. | +| `README.md` | Building and Testing sections currently show separate/manual frontend and Go commands; document the required generation-first workflow. | +| `CONTRIBUTING.md` | Setup, tests, and PR checklist currently show direct Go commands; document that frontend generation precedes Go build/test/release checks. | +| `docs/linux-usb-prerequisites.md` | Its build prerequisite includes `go build ./cmd/x6configurator`; document the frontend-generation prerequisite for that command. | +| `cmd/x6configurator/wails.json` | Configures `frontend.dir` and `npm run build`; preserve the existing Wails frontend build configuration and do not introduce recursive Wails builds. | +| `openspec/config.yaml` | Defines repository test, vet, and build commands; update configuration so its build/test contract reflects frontend generation before Go operations. | +| `.opencode/skills/wails-backend/SKILL.md` | Agent guidance currently describes `//go:embed frontend/dist` and runs Go build before the frontend build; update the guidance to require generation first while preserving the embedding contract. | +| `.opencode/skills/wails-backend/references/wails-backend.md` | Agent reference currently documents the embedded output and Wails configuration; update the build-order guidance without changing the runtime embedding model. | +| `cmd/x6configurator/main.go` and `cmd/x6configurator/main_test.go` | Preserve unchanged as the embedding implementation and its runtime/configuration assertions; they are evidence and compatibility boundaries, not expected edit surfaces. | +| `cmd/x6configurator/frontend/dist/index.html` | Currently tracked generated output; remove only under the destructive boundary below. | +| `cmd/x6configurator/frontend/dist/assets/index-CU8R5TZP.css` | Currently tracked generated output; remove only under the destructive boundary below. | +| `cmd/x6configurator/frontend/dist/assets/index-DG8SNgAN.js` | Currently tracked generated output; remove only under the destructive boundary below. | + +No agent-guidance files were found at repository root; the Wails skill and its reference above are the evidence-backed agent-guidance surfaces. + +## Ordered Checklist + +- [x] 1. Confirm the baseline: exactly three tracked files exist below `cmd/x6configurator/frontend/dist/**`, `main.go` embeds `frontend/dist`, `frontend/package.json` writes Vite output there, and current Taskfile/CI frontend-before-Go behavior is understood. Baseline RED: `make -n go-test` and `make -n check` ran Go operations before frontend generation. +- [x] 2. Change ignore/configuration policy so generated `cmd/x6configurator/frontend/dist/**` is ignored and no longer force-included, without broadening the ignore rule to source, bindings, or unrelated build output. +- [x] 3. Make the Makefile's dependent workflows generation-first: frontend generation must precede Go build/test/vet/check and any release verification path that invokes them; retain named targets and existing tool commands where possible. +- [x] 4. Preserve `cmd/x6configurator/Taskfile.yml`'s `build:frontend` dependency and existing output command; reconcile only if required to make the documented clean-checkout ordering unambiguous. Preserved unchanged. +- [x] 5. Preserve CI and release behavior while making their frontend-generation-before-Go ordering explicit for `.github/workflows/test.yml` and `.github/workflows/release.yml`. Preserved unchanged: CI builds after `npm ci`, and release invokes the generation-first `make check`. +- [x] 6. Update `README.md`, `CONTRIBUTING.md`, and `docs/linux-usb-prerequisites.md` so build, test, and release-related instructions never imply that Go operations can run before frontend generation. +- [x] 7. Update `openspec/config.yaml`, `cmd/x6configurator/wails.json` only as needed for the generation-first contract; preserve the Wails `npm run build` configuration and non-recursive behavior. `wails.json` preserved unchanged. +- [x] 8. Update the Wails agent skill and reference to teach the same generation-first ordering, while retaining the `//go:embed frontend/dist` runtime contract and generated-binding guidance. +- [x] 9. Remove only the three currently tracked dist files listed above; do not remove generated directories or newly produced files beyond this exact set as part of the source change. +- [ ] 10. Validate a clean-checkout-like sequence: with tracked dist absent, install frontend dependencies, generate frontend output, then run the configured Go build/test/vet and frontend test checks; verify `go test ./cmd/x6configurator` still serves embedded assets and `main.go` remains unchanged. `npm ci && npm run build`, `go build ./...`, `go vet ./...`, `go test ./...`, `go test ./cmd/x6configurator`, and `npm test` passed; `make check` reached Wails build after those checks but cannot complete because `wails3` is not installed. +- [x] 11. Validate the final diff and status: the only deletion candidates are the three listed dist files, generated dist remains ignored after regeneration, Taskfile and CI ordering is preserved, and no unrelated files are changed. + +## Acceptance Criteria + +- `cmd/x6configurator/frontend/dist/**` is no longer versioned, and future generated output is ignored. +- Exactly these three currently tracked files are removed: `cmd/x6configurator/frontend/dist/index.html`, `cmd/x6configurator/frontend/dist/assets/index-CU8R5TZP.css`, and `cmd/x6configurator/frontend/dist/assets/index-DG8SNgAN.js`. +- Frontend generation is required before Go build/test/vet/check and release verification operations that depend on the embedded tree. +- Makefile, build/test documentation/configuration, CI/release configuration, and the evidence-backed Wails agent guidance describe the same ordering. +- `cmd/x6configurator/main.go` continues to embed `frontend/dist`; no workaround replaces or weakens the embed contract. +- `cmd/x6configurator/Taskfile.yml` retains its frontend build dependency and existing binary build behavior. +- A clean-checkout-like validation generates the ignored assets before dependent Go operations and passes the configured checks. +- No production behavior, frontend source, generated bindings, protocol/transport code, or unrelated generated artifacts are changed. + +## Non-goals + +- Do not change the Wails asset embedding mechanism or move the frontend output directory. +- Do not redesign frontend build tooling, package scripts, dependency versions, or hashed asset naming. +- Do not regenerate or hand-edit frontend bindings. +- Do not change application, protocol, HID, transport, desktop, or frontend source behavior. +- Do not alter release publishing semantics beyond required verification ordering. +- Do not add a cleanup mechanism that deletes arbitrary build output. + +## Destructive Boundary + +The only permitted destructive operation in implementation is removing these three currently tracked generated files: + +1. `cmd/x6configurator/frontend/dist/index.html` +2. `cmd/x6configurator/frontend/dist/assets/index-CU8R5TZP.css` +3. `cmd/x6configurator/frontend/dist/assets/index-DG8SNgAN.js` + +Do not delete any other file, directory, generated asset, source file, binding, configuration, or documentation artifact. Do not commit. + +## Verification Plan + +- `git ls-files 'cmd/x6configurator/frontend/dist/**'` reports no tracked files after the change. +- Ignore checks confirm generated files under `cmd/x6configurator/frontend/dist/**` are ignored. +- A fresh/clean-like run performs `cd frontend && npm ci && npm run build` before `go build ./...`, `go vet ./...`, and `go test ./...`. +- `cd frontend && npm test` passes, and `go test ./cmd/x6configurator` confirms the embedded runtime entry remains readable after generation. +- `git diff --name-status` and `git status --short` show only the approved documentation/configuration/build-guidance changes and the three approved generated-file deletions. diff --git a/openspec/config.yaml b/openspec/config.yaml index e6ad69c..ebf7801 100644 --- a/openspec/config.yaml +++ b/openspec/config.yaml @@ -10,15 +10,16 @@ context: | managed and must not be hand-edited. Safety: no hidraw write occurs without an explicit user apply action; never run as root, weaken udev permissions, claim USB interfaces, or inspect the official Windows executable. - Testing: Go package tests, Vitest/jsdom frontend tests, go vet, and frontend production build. + Testing: generate the embedded frontend with `cd frontend && npm ci && npm run build` + before Go package tests, go vet, or Go builds; then run Vitest/jsdom frontend tests. strict_tdd: true testing: - test_command: "go test ./..." - frontend_test_command: "cd frontend && npm test" - vet_command: "go vet ./..." - build_command: "go build ./... && cd frontend && npm run build" + test_command: "cd frontend && npm ci && npm run build && cd .. && go test ./..." + frontend_test_command: "cd frontend && npm ci && npm test" + vet_command: "cd frontend && npm ci && npm run build && cd .. && go vet ./..." + build_command: "cd frontend && npm ci && npm run build && cd .. && go build ./..." rules: proposal: