Restructure: move Vite project into app/, deploy build output to repo root

The webserver serves the repo checkout directly as static files, so
index.html at the repo root must be the production build (pointing at
hashed /assets/*.js) rather than the dev template (/src/main.tsx),
which was being served with an unrecognized application/octet-stream
MIME type and blocked by the browser.

- Move src/, public/, scripts/, server/, package.json, vite.config.ts,
  tsconfig.json, .env(.example), and the dev index.html into app/.
- Add app/scripts/deploy.mjs: copies app/dist/* into the repo root
  after every `vite build`, cleaning up stale hashed filenames.
- Wire it into `npm run build` (app/package.json).
- Update run.sh to operate from app/, and .gitignore for the new layout.
- Commit the current build output (index.html, assets/, manifest,
  sw.js, workbox-*.js, favicon.svg, icons/, LICENSE) to the repo root.
- Update README with the new project layout and deployment model.
This commit is contained in:
oliver committed 2026-11-04 14:05:46 -03:00
1 parent 5245c0a856
commit c7b653ff6a
54 files changed
+224 -34

No files matched your search

+7 -7
View File
@@ -1,11 +1,11 @@
node_modules app/node_modules
dist app/dist
dist-ssr app/dist-ssr
*.local *.local
.env app/.env
.env.* app/.env.*
!.env.example !app/.env.example
.DS_Store .DS_Store
*.log *.log
.vite app/.vite
*.tsbuildinfo *.tsbuildinfo
+59 -20
View File
@@ -107,13 +107,46 @@ Then on the config screen enter your **API server URL** and **API key**.
```bash ```bash
./run.sh # dev server (http://localhost:5173) ./run.sh # dev server (http://localhost:5173)
./run.sh build # production build into dist/ ./run.sh build # production build, deployed straight into the repo root
./run.sh serve # build if needed, then host + proxy /api/*, /v1/* (needs HERMES_TARGET) ./run.sh serve # build if needed, then host + proxy /api/*, /v1/* (needs HERMES_TARGET)
./run.sh preview # build, then serve the build with vite preview ./run.sh preview # build, then serve the build with vite preview
./run.sh icons # regenerate the PWA icon set ./run.sh icons # regenerate the PWA icon set
./run.sh typecheck # type-check without emitting ./run.sh typecheck # type-check without emitting
``` ```
### Deployment model: the repo root *is* the web root
The Vite project lives in `app/`. Running a build (`./run.sh build` or
`cd app && npm run build`) compiles it and then copies the output
(`index.html`, `assets/`, `manifest.webmanifest`, `sw.js`, `workbox-*.js`,
`favicon.svg`, `icons/`, `LICENSE`) directly into the **repository root** —
see `app/scripts/deploy.mjs`. Those deployed files are committed to git.
This means a webserver that simply serves the raw repository checkout as
static files (no build step, no custom MIME types, no reverse-proxy config)
works out of the box: `index.html` in the repo root already references
hashed, plain `.js`/`.css` assets — nothing points at `/src/*.tsx` in
production, so there's no "unauthorized MIME type" issue.
To publish a new version:
```bash
cd app
npm run build # builds app/dist, then syncs it into the repo root
cd ..
git add -A
git commit -m "Deploy: <description>"
git push # or however the server pulls the repo
```
> Note: `app/` (source, dev config, `node_modules`) is still present in the
> checkout, so if the webserver serves the whole repo folder, the raw
> TypeScript source under `app/src` is technically reachable as plain text.
> It is never *executed* as a module by the deployed app (the deployed
> `index.html` only references the built `assets/*.js`), so this is not a
> functional issue — just something to be aware of if source privacy
> matters to you.
| Variable | Used by | Meaning | | Variable | Used by | Meaning |
| --- | --- | --- | | --- | --- | --- |
| `HERMES_TARGET` | `serve` | API server base URL to proxy to | | `HERMES_TARGET` | `serve` | API server base URL to proxy to |
@@ -154,29 +187,35 @@ Then on the config screen enter your **API server URL** and **API key**.
- **Response shapes.** The Sessions REST API's exact JSON envelope isn't fully - **Response shapes.** The Sessions REST API's exact JSON envelope isn't fully
documented, so the client normalises several shapes (`sessions`/`data`/`items`, documented, so the client normalises several shapes (`sessions`/`data`/`items`,
`id`/`session_id`, string/array content). If a field looks off on your version, `id`/`session_id`, string/array content). If a field looks off on your version,
it's a one-line tweak in `src/api/client.ts`. it's a one-line tweak in `app/src/api/client.ts`.
## Project layout ## Project layout
``` ```
src/ index.html, assets/, manifest.webmanifest, # repo root = deployed build
api/ sw.js, workbox-*.js, favicon.svg, icons/, # output (see Deployment model above)
client.ts # HermesClient: bearer auth, sessions REST, SSE chat LICENSE
types.ts # API server types + normalised UI types app/ # Vite project (source, dev config)
hooks/ index.html # dev entry (-> /src/main.tsx); NOT served in production
useSpeechRecognition.ts # browser dictation src/
useTts.ts # browser speech synthesis api/
lib/ client.ts # HermesClient: bearer auth, sessions REST, SSE chat
config.ts # saved connections (localStorage) types.ts # API server types + normalised UI types
format.ts # time / token formatting hooks/
markdown.tsx # tiny safe markdown renderer useSpeechRecognition.ts # browser dictation
state/ useTts.ts # browser speech synthesis
store.ts # zustand store: connections, sessions, streaming lib/
components/ # ConfigScreen, ConnectionForm, Sidebar, ChatView, Composer, … config.ts # saved connections (localStorage)
server/ format.ts # time / token formatting
proxy.mjs # optional static host + /api,/v1 reverse proxy (no deps) markdown.tsx # tiny safe markdown renderer
scripts/ state/
gen-icons.mjs # dependency-free PNG icon generator store.ts # zustand store: connections, sessions, streaming
components/ # ConfigScreen, ConnectionForm, Sidebar, ChatView, Composer, …
scripts/
gen-icons.mjs # dependency-free PNG icon generator
deploy.mjs # copies app/dist/* into the repo root after `vite build`
server/
proxy.mjs # optional static host + /api,/v1 reverse proxy (no deps)
``` ```
## License ## License
View File
File renamed without changes.
+21
View File
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, maximum-scale=1.0, user-scalable=no"
/>
<meta name="theme-color" content="#000810" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Hermes" />
<title>Hermes</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
View File
File renamed without changes.
+1 -1
View File
@@ -6,7 +6,7 @@
"description": "A mobile-first PWA client for a self-hosted Hermes Agent (Hermes Web UI bridge API).", "description": "A mobile-first PWA client for a self-hosted Hermes Agent (Hermes Web UI bridge API).",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build && node scripts/deploy.mjs",
"preview": "vite preview", "preview": "vite preview",
"icons": "node scripts/gen-icons.mjs", "icons": "node scripts/gen-icons.mjs",
"serve": "node server/proxy.mjs", "serve": "node server/proxy.mjs",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+48
View File
@@ -0,0 +1,48 @@
// Copies the production build (app/dist) into the repository root, so the
// webserver can serve the repo checkout directly as static files — no
// server-side build step, no special MIME-type config, no reverse proxy
// required. Run automatically as part of `npm run build`.
//
// node scripts/deploy.mjs
//
import { readdir, rm, cp, unlink, copyFile } from "node:fs/promises";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const DIST = resolve(__dirname, "../dist");
const REPO_ROOT = resolve(__dirname, "../../");
const entries = await readdir(DIST, { withFileTypes: true });
for (const entry of entries) {
const src = join(DIST, entry.name);
const dest = join(REPO_ROOT, entry.name);
if (entry.isDirectory()) {
// Directories (assets/, icons/) are pure build output — wipe and replace
// so stale, superseded hashed filenames don't pile up.
await rm(dest, { recursive: true, force: true });
await cp(src, dest, { recursive: true });
console.log(` dir ${entry.name}/`);
continue;
}
// Hashed, content-addressed files (e.g. workbox-<hash>.js) change name
// between builds — remove any previous versions before copying the new one.
const hashedPrefixMatch = entry.name.match(/^(workbox-)[0-9a-f]+(\.js)$/);
if (hashedPrefixMatch) {
const [, prefix, ext] = hashedPrefixMatch;
const siblings = await readdir(REPO_ROOT);
for (const sibling of siblings) {
if (sibling.startsWith(prefix) && sibling.endsWith(ext) && sibling !== entry.name) {
await unlink(join(REPO_ROOT, sibling));
}
}
}
await copyFile(src, dest);
console.log(` file ${entry.name}`);
}
console.log(`\nDeployed build output from ${DIST} -> ${REPO_ROOT}`);
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
+1 -1
View File
@@ -13,7 +13,7 @@ function licensePlugin(): Plugin {
this.emitFile({ this.emitFile({
type: "asset", type: "asset",
fileName: "LICENSE", fileName: "LICENSE",
source: readFileSync(fileURLToPath(new URL("LICENSE", import.meta.url)), "utf-8"), source: readFileSync(fileURLToPath(new URL("../LICENSE", import.meta.url)), "utf-8"),
}); });
}, },
}; };
+1
View File
@@ -0,0 +1 @@
:root{--bg: #000810;--bg-elev: #010f20;--bg-elev2: #001a30;--bg-hover: #001a30;--border: #0a3060;--border-soft: #072348;--text: #c8f0ff;--text-dim: #6aa8bf;--text-faint: #2e6a80;--accent: #00f5ff;--accent-soft: rgba(0, 245, 255, .12);--accent-strong: #00c8d4;--accent-contrast: #001018;--danger: #ff3b3b;--danger-soft: rgba(255, 59, 59, .14);--ok: #00ff88;--warn: #ffaa00;--radius: 10px;--radius-sm: 8px;--sidebar-w: 304px;--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;color-scheme:dark}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{font-family:var(--font);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;overscroll-behavior-y:none}button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}input,textarea,select{font-family:inherit;font-size:15px;color:var(--text);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;outline:none;width:100%}input:focus,textarea:focus,select:focus{border-color:var(--accent)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:#0a3060;border-radius:8px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-thumb:hover{background:#0f4a6e;background-clip:padding-box}.app{display:flex;height:100dvh;overflow:hidden}.sidebar{width:var(--sidebar-w);flex-shrink:0;background:var(--bg-elev);border-right:1px solid var(--border);display:flex;flex-direction:column;min-height:0}.main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg)}.scrim{display:none}@media (max-width: 820px){.sidebar{position:fixed;inset:0 auto 0 0;z-index:40;transform:translate(-100%);transition:transform .22s ease;box-shadow:0 0 40px #00000080;padding-top:env(safe-area-inset-top)}.sidebar.open{transform:translate(0)}.scrim.show{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;z-index:30}}.sidebar-head{padding:14px 14px 10px;display:flex;flex-direction:column;gap:10px;border-bottom:1px solid var(--border-soft)}.brand{display:flex;align-items:center;gap:9px;font-weight:650;letter-spacing:.2px}.brand-mark{width:26px;height:26px;border-radius:7px;background:linear-gradient(180deg,#003545,#00202e);border:1px solid #005570;display:grid;place-items:center;color:var(--accent);font-weight:800;font-size:14px}.brand-link{display:inline-flex;align-items:center;text-decoration:none;border-radius:8px;padding:2px 4px;margin-left:-4px}.brand-link:hover{background:var(--bg-hover)}.brand-actions{margin-left:auto;display:flex;gap:4px}.icon-btn{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;color:var(--text-dim);transition:background .15s,color .15s}.icon-btn:hover{background:var(--bg-hover);color:var(--text)}.icon-btn.active{color:var(--accent);background:var(--accent-soft)}.profile-switch{position:relative}.profile-btn{width:100%;display:flex;align-items:center;gap:9px;padding:9px 11px;border-radius:var(--radius-sm);background:var(--bg-elev2);border:1px solid var(--border);text-align:left}.profile-btn:hover{border-color:#2f3b4d}.profile-btn .dot{width:8px;height:8px;border-radius:50%;background:var(--ok);flex-shrink:0}.profile-btn .name{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-btn .sub{font-size:11px;color:var(--text-faint);margin-left:auto;flex-shrink:0}.menu{position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--bg-elev2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:5px;z-index:20;box-shadow:0 12px 30px #00000073;max-height:320px;overflow:auto}.menu-item{width:100%;display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:7px;font-size:14px;text-align:left}.menu-item:hover{background:var(--bg-hover)}.menu-item .check{margin-left:auto;color:var(--accent)}.new-chat{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;border-radius:var(--radius-sm);background:var(--accent);color:var(--accent-contrast);font-weight:700;font-size:14px}.new-chat:hover{background:var(--accent-strong)}.search-wrap{position:relative}.search-wrap svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--text-faint);pointer-events:none}.search-wrap input{padding-left:34px;background:var(--bg)}.sidebar-tools{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:12px;color:var(--text-dim);border-bottom:1px solid var(--border-soft)}.toggle{display:inline-flex;align-items:center;gap:6px;cursor:pointer;-webkit-user-select:none;user-select:none}.toggle input{width:auto;accent-color:var(--accent)}.session-list{flex:1;overflow-y:auto;padding:8px;min-height:0}.group-label{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-faint);padding:12px 8px 6px;font-weight:600}.session-item{dispLine truncated
+60
View File
@@ -0,0 +1,60 @@
var tf=Object.defineProperty;var nf=(e,t,n)=>t in e?tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _t=(e,t,n)=>nf(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function Pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tu={exports:{}},yl={},Ru={exports:{}},O={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ar=Symbol.for("react.element"),rf=Symbol.for("react.portal"),lf=Symbol.for("react.fragment"),of=Symbol.for("react.strict_mode"),sf=Symbol.for("react.profiler"),uf=Symbol.for("react.provider"),af=Symbol.for("react.context"),cf=Symbol.for("react.forward_ref"),ff=Symbol.for("react.suspense"),df=Symbol.for("react.memo"),pf=Symbol.for("react.lazy"),os=Symbol.iterator;function hf(e){return e===null||typeof e!="object"?null:(e=os&&e[os]||e["@@iterator"],typeof e=="function"?e:null)}var Lu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zu=Object.assign,Iu={};function gn(e,t,n){this.props=e,this.context=t,this.refs=Iu,this.updater=n||Lu}gn.prototype.isReactComponent={};gn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): 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")};gn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mu(){}Mu.prototype=gn.prototype;function oo(e,t,n){this.props=e,this.context=t,this.refs=Iu,this.updater=n||Lu}var so=oo.prototype=new Mu;so.constructor=oo;zu(so,gn.prototype);so.isPureReactComponent=!0;var ss=Array.isArray,Ou=Object.prototype.hasOwnProperty,uo={current:null},Du={key:!0,ref:!0,__self:!0,__source:!0};function $u(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Ou.call(t,r)&&!Du.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1<s){for(var a=Array(s),c=0;c<s;c++)a[c]=arguments[c+2];l.children=a}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)l[r]===void 0&&(l[r]=s[r]);return{$$typeof:ar,type:e,key:i,ref:o,props:l,_owner:uo.current}}function mf(e,t){return{$$typeof:ar,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ao(e){return typeof e=="object"&&e!==null&&e.$$typeof===ar}function vf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var us=/\/+/g;function $l(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vf(""+e.key):t.toString(36)}function Or(e,t,n,r,l){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ar:case rf:o=!0}}if(o)return o=e,l=l(o),e=r===""?"."+$l(o,0):r,ss(l)?(n="",e!=null&&(n=e.replace(us,"$&/")+"/"),Or(l,t,n,"",function(c){return c})):l!=null&&(ao(l)&&(l=mf(l,n+(!l.key||o&&o.key===l.key?"":(""+l.key).replace(us,"$&/")+"/")+e)),t.push(l)),1;if(o=0,r=r===""?".":r+":",ss(e))for(var s=0;s<e.length;s++){i=e[s];var a=r+$l(i,s);o+=Or(i,t,n,a,l)}else if(a=hf(e),typeof a=="function")for(e=a.call(e),s=0;!(i=e.next()).done;)i=i.value,a=r+$l(i,s++),o+=Or(i,t,n,a,l);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function vr(e,t,n){if(e==null)return e;var r=[],l=0;return Or(e,r,"","",function(i){return t.call(n,i,l++)}),r}function gf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var de={current:null},Dr={transition:null},yf={ReactCurrentDispatcher:de,ReactCurrentBatchConfig:Dr,ReactCurrentOwner:uo};function Uu(){throw Error("act(...) is not supported in production builds of React.")}O.Children={map:vr,forEach:function(e,t,n){vr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return vr(e,function(){t++}),t},toArray:function(e){return vr(e,function(t){return t})||[]},only:function(e){if(!ao(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};O.Component=gn;O.Fragment=lf;O.Profiler=sf;O.PureComponent=oo;O.StrictMode=of;O.Suspense=ff;O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yf;O.act=Uu;O.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=zu({},e.props),l=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=uo.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(a in t)Ou.call(t,a)&&!Du.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&s!==void 0?s[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){s=Array(a);for(var c=0;c<a;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:ar,type:e.type,key:l,ref:i,props:r,_owner:o}};O.createContext=function(e){return e={$$typeof:af,_currentValue:e,_currentValue2:e,_threadCount:0,ProviderLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xf=R,Sf=Symbol.for("react.element"),kf=Symbol.for("react.fragment"),jf=Object.prototype.hasOwnProperty,Cf=xf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ef={key:!0,ref:!0,__self:!0,__source:!0};function Au(e,t,n){var r,l={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)jf.call(t,r)&&!Ef.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Sf,type:e,key:i,ref:o,props:l,_owner:Cf.current}}yl.Fragment=kf;yl.jsx=Au;yl.jsxs=Au;Tu.exports=yl;var u=Tu.exports,Fu={exports:{}},Ce={},Vu={exports:{}},Hu={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(E,L){var I=E.length;E.push(L);e:for(;0<I;){var G=I-1>>>1,ee=E[G];if(0<l(ee,L))E[G]=L,E[I]=ee,I=G;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var L=E[0],I=E.pop();if(I!==L){E[0]=I;e:for(var G=0,ee=E.length,hr=ee>>>1;G<hr;){var Et=2*(G+1)-1,Dl=E[Et],Nt=Et+1,mr=E[Nt];if(0>l(Dl,I))Nt<ee&&0>l(mr,Dl)?(E[G]=mr,E[Nt]=I,G=Nt):(E[G]=Dl,E[Et]=I,G=Et);else if(Nt<ee&&0>l(mr,I))E[G]=mr,E[Nt]=I,G=Nt;else break e}}return L}function l(E,L){var I=E.sortIndex-L.sortIndex;return I!==0?I:E.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var a=[],c=[],p=1,h=null,d=3,y=!1,g=!1,x=!1,z=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(E){for(var L=n(c);L!==null;){if(L.callback===null)r(c);else if(L.startTime<=E)r(c),L.sortIndex=L.expirationTime,t(a,L);else break;L=n(c)}}function w(E){if(x=!1,v(E),!g)if(n(a)!==null)g=!0,U(C);else{var L=n(c);L!==null&&Ae(w,L.startTime-E)}}function C(E,L){g=!1,x&&(x=!1,m(T),T=-1),y=!0;var I=d;try{for(v(L),h=n(a);h!==null&&(!(h.expirationTime>L)||E&&!we());){var G=h.callback;if(typeof G=="function"){h.callback=null,d=h.priorityLevel;var ee=G(h.expirationTime<=L);L=e.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(a)&&r(a),v(L)}else r(a);h=n(a)}if(h!==null)var hr=!0;else{var Et=n(c);Et!==null&&Ae(w,Et.startTime-L),hr=!1}return hr}finally{h=null,d=I,y=!1}}var _=!1,P=null,T=-1,H=5,M=-1;function we(){return!(e.unstable_now()-M<H)}function jt(){if(P!==null){var E=e.unstable_now();M=E;var L=!0;try{L=P(!0,E)}finally{L?Ct():(_=!1,P=null)}}else _=!1}var Ct;if(typeof f=="function")Ct=function(){f(jt)};else if(typeof MessageChannel<"u"){var Sn=new MessageChannel,k=Sn.port2;Sn.port1.onmessage=jt,Ct=function(){k.postMessage(null)}}else Ct=function(){z(jt,0)};function U(E){P=E,_||(_=!0,Ct())}function Ae(E,L){T=z(function(){E(e.unstable_now())},L)}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_continueExecution=function(){g||y||(g=!0,U(C))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(E){switch(d){case 1:case 2:case 3:var L=3;break;default:L=d}var I=d;d=L;try{return E()}finally{d=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,L){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var I=d;d=E;try{return L()}finally{d=I}},e.unstable_scheduleCallback=function(E,L,I){var G=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?G+I:G):I=G,E){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=I+ee,E={id:p++,callback:L,priorityLevel:E,startTime:I,expirationTime:ee,sortIndex:-1},I>G?(E.sortIndex=I,t(c,E),n(a)===null&&E===n(c)&&(x?(m(T),T=-1):x=!0,Ae(w,I-G))):(E.sortIndex=ee,t(a,E),g||y||(g=!0,U(C))),E},e.unstable_shouldYield=we,e.unstable_wrapCallback=function(E){var L=d;return function(){var I=d;d=L;try{return E.apply(this,arguments)}finally{d=I}}}})(Hu);Vu.exports=Hu;var Nf=Vu.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var _f=R,je=Nf;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Bu=new Set,Kn={};function Vt(e,t){an(e,t),an(e+"Capture",t)}function an(e,t){for(Kn[e]=t,e=0;e<t.length;e++)Bu.add(t[e])}var Je=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pi=Object.prototype.hasOwnProperty,Pf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,as={},cs={};function Tf(e){return pi.call(cs,e)?!0:pi.call(as,e)?!1:Pf.test(e)?cs[e]=!0:(as[e]=!0,!1)}function Rf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Lf(e,t,n,r){if(t===null||typeof t>"u"||Rf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function pe(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ie[e]=new pe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ie[t]=new pe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ie[e]=new pe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ie[e]=new pe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ie[e]=new pe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ie[e]=new pe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ie[e]=new pe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ie[e]=new pe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ie[e]=new pe(e,5,!1,e.toLowerCase(),null,!1,!1)});var co=/[\-:]([a-z])/g;function fo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(co,fo);ie[t]=new pe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(co,fo);ie[t]=new pe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(co,fo);ie[t]=new pe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ie[e]=new pe(e,1,!1,e.toLowerCase(),null,!1,!1)});ie.xlinkHref=new pe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ie[e]=new pe(e,1,!1,e.toLowerCase(),null,!0,!0)});function po(e,t,n,r){var l=ie.hasOwnProperty(t)?ie[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==" Line truncated
`+Ul+e}var Al=!1;function Fl(e,t){if(!e||Al)return"";Al=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
`),i=r.stack.split(`
`),o=l.length-1,s=i.length-1;1<=o&&0<=s&&l[o]!==i[s];)s--;for(;1<=o&&0<=s;o--,s--)if(l[o]!==i[s]){if(o!==1||s!==1)do if(o--,s--,0>s||l[o]!==i[s]){var a=`
`+l[o].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=o&&0<=s);break}}}finally{Al=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ln(e):""}function zf(e){switch(e.tag){case 5:return Ln(e.type);case 16:return Ln("Lazy");case 13:return Ln("Suspense");case 19:return Ln("SuspenseList");case 0:case 2:case 15:return e=Fl(e.type,!1),e;case 11:return e=Fl(e.type.render,!1),e;case 1:return e=Fl(e.type,!0),e;default:return""}}function gi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qt:return"Fragment";case Wt:return"Portal";case hi:return"Profiler";case ho:return"StrictMode";case mi:return"Suspense";case vi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qu:return(e.displayName||"Context")+".Consumer";case Wu:return(e._context.displayName||"Context")+".Provider";case mo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vo:return t=e.displayName||null,t!==null?t:gi(e.type)||"Memo";case lt:t=e._payload,e=e._init;try{return gi(e(t))}catch{}}return null}function If(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gi(t);case 8:return t===ho?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function yt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Mf(e){var t=Yu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){e._valueTracker||(e._valueTracker=Mf(e))}function Gu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yi(e,t){var n=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ds(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=yt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xu(e,t){t=t.checked,t!=null&&po(e,"checked",t,!1)}function wi(e,t){Xu(e,t);var n=yt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xi(e,t.type,n):t.hasOwnProperty("defaultValue")&&xi(e,t.type,yt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ps(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function xi(e,t,n){(t!=="number"||Yr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zn=Array.isArray;function nn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+yt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Si(e,t){if(t.dang Line truncated
`).replace(Wd,"")}function Nr(e,t,n){if(t=Ds(t),Ds(e)!==t&&n)throw Error(S(425))}function tl(){}var Mi=null,Oi=null;function Di(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $i=typeof setTimeout=="function"?setTimeout:void 0,Qd=typeof clearTimeout=="function"?clearTimeout:void 0,$s=typeof Promise=="function"?Promise:void 0,Kd=typeof queueMicrotask=="function"?queueMicrotask:typeof $s<"u"?function(e){return $s.resolve(null).then(e).catch(Yd)}:$i;function Yd(e){setTimeout(function(){throw e})}function bl(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Jn(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Jn(t)}function pt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Us(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var wn=Math.random().toString(36).slice(2),Be="__reactFiber$"+wn,nr="__reactProps$"+wn,qe="__reactContainer$"+wn,Ui="__reactEvents$"+wn,Gd="__reactListeners$"+wn,Xd="__reactHandles$"+wn;function Lt(e){var t=e[Be];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qe]||n[Be]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Us(e);e!==null;){if(n=e[Be])return n;e=Us(e)}return t}e=n,n=e.parentNode}return null}function dr(e){return e=e[Be]||e[qe],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xt(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(S(33))}function jl(e){return e[nr]||null}var Ai=[],Zt=-1;function St(e){return{current:e}}function V(e){0>Zt||(e.current=Ai[Zt],Ai[Zt]=null,Zt--)}function A(e,t){Zt++,Ai[Zt]=e.current,e.current=t}var wt={},ae=St(wt),ve=St(!1),Dt=wt;function cn(e,t){var n=e.type.contextTypes;if(!n)return wt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ge(e){return e=e.childContextTypes,e!=null}function nl(){V(ve),V(ae)}function As(e,t,n){if(ae.current!==wt)throw Error(S(168));A(ae,t),A(ve,n)}function $a(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(S(108,If(e)||"Unknown",l));return K({},n,r)}function rl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wt,Dt=ae.current,A(ae,e),A(ve,ve.current),!0}function Fs(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=$a(e,t,Dt),r.__reactInternalMemoizedMergedChildContext=e,V(ve),V(ae),A(ae,e)):V(ve),A(ve,n)}var Ye=null,Cl=!1,ei=!1;function Ua(e){Ye===null?Ye=[e]:Ye.push(e)}function Zd(e){Cl=!0,Ua(e)}function kt(){if(!ei&&Ye!==null){ei=!0;var e=0,t=$;try{var n=Ye;for($=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ye=null,Cl=!1}catch(l){throw Ye!==null&&(Ye=Ye.slice(e+1)),aa(yo,kt),l}finally{$=t,ei=!1}}return null}var Jt=[],qt=0,ll=null,il=0,Ne=[],_e=0,$t=null,Ge=1,Xe="";function Pt(e,t){Jt[qt++]=il,Jt[qt++]=ll,ll=e,il=t}function Aa(e,t,n){Ne[_e++]=Ge,Ne[_e++]=Xe,Ne[_e++]=$t,$t=e;var r=Ge;e=Xe;var l=32-De(r)-1;r&=~(1<<l),n+=1;var i=32-De(t)+l;if(30<i){var o=l-l%5;i=(r&(1<<o)-1).toString(32),r>>=o,l-=o,Ge=1<<32-De(t)+l|n<<l|r,Xe=i+e}else Ge=1<<i|n<<l|r,Xe=e}function _o(e){e.return!==null&&(Pt(e,1),Aa(e,1,0))}function Po(e){for(;e===ll;)ll=Jt[--qt],Jt[qt]=null,il=Jt[--qt],Jt[qt]=null;for(;e===$t;)$t=Ne[--_e],Ne[_e]=null,Xe=Ne[--_e],Ne[_e]=null,Ge=Ne[--_e],Ne[_e]=null}var ke=null,Se=null,B=!1,Oe=null;function Fa(e,t){var n=Pe(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Vs(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ke=e,Se=pt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ke=e,Se=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$t!==null?{id:Ge,overflow:Xe}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Pe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ke=e,Se=null,!0):!1;default:return!1}}function Fi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vi(e){if(B){var t=Se;if(t){var n=t;if(!Vs(e,t)){if(Fi(e))throw Error(S(418));t=pt(n.nextSibling);var r=ke;t&&Vs(e,t)?Fa(r,n):(e.flags=e.flags&-4097|2,B=!1,ke=e)}}else{if(Fi(e))throw Error(S(418));e.flags=e.flags&-4097|2,B=!1,ke=e}}}function Hs(e){for(e=e.return;e!==null&&e.t Line truncated
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:l,digest:null}}function ii(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Qi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ip=typeof WeakMap=="function"?WeakMap:Map;function pc(e,t,n){n=Ze(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pl||(pl=!0,to=r),Qi(e,t)},n}function hc(e,t,n){n=Ze(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Qi(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Qi(e,t),typeof r!="function"&&(mt===null?mt=new Set([this]):mt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Zs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ip;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=wp.bind(null,e,t,n),t.then(e,e))}function Js(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function qs(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ze(-1,1),t.tag=2,ht(n,t,1))),n.lanes|=1),e)}var op=tt.ReactCurrentOwner,me=!1;function ce(e,t,n,r){t.child=e===null?Ba(t,null,n,r):dn(t,e.child,n,r)}function bs(e,t,n,r,l){n=n.render;var i=t.ref;return sn(t,l),r=Ao(e,t,n,r,i,l),n=Fo(),e!==null&&!me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,et(e,t,l)):(B&&n&&_o(t),t.flags|=1,ce(e,t,r,l),t.child)}function eu(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!Zo(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,mc(e,t,i,r,l)):(e=Kr(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:bn,n(o,r)&&e.ref===t.ref)return et(e,t,l)}return t.flags|=1,e=gt(i,r),e.ref=t.ref,e.return=t,t.child=e}function mc(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(bn(i,r)&&e.ref===t.ref)if(me=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(me=!0);else return t.lanes=e.lanes,et(e,t,l)}return Ki(e,t,n,r,l)}function vc(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},A(tn,xe),xe|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,A(tn,xe),xe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,A(tn,xe),xe|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,A(tn,xe),xe|=r;return ce(e,t,l,n),t.child}function gc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ki(e,t,n,r,l){var i=ge(n)?Dt:ae.current;return i=cn(t,i),sn(t,l),n=Ao(e,t,n,r,i,l),r=Fo(),e!==null&&!me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,et(e,t,l)):(B&&r&&_o(t),t.flags|=1,ce(e,t,n,l),t.child)}function tu(e,t,n,r,l){if(ge(n)){var i=!0;rl(t)}else i=!1;if(sn(t,l),t.stateNode===null)Br(e,t),dc(t,n,r),Wi(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var a=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Re(c):(c=ge(n)?Dt:ae.current,c=cn(t,c));var p=n.getDerivedStateFromProps,h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||a!==c)&&Xs(t,o,r,c),it=!1;var d=t.memoizedState;o.state=d,ul(t,r,o,l),a=t.memoizedState,s!==r||d!==a||ve.current||it?(typeof p=="function"&&(Bi(t,n,p,r),a=t.memoizedState),(s=it||Gs(t,n,s,r,d,a,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=c,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Qa(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Ie(t.type,s),o.props=c,h=t.pendingProps,d=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=Re(a):(a=ge(n)?Dt:ae.current,a=cn(t,a));var y=n.getDerivedStateFromProps;(p=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==h||d!==a)&&Xs(t,o,r,a),it=!1,d=t.memoizedState,o.state=d,ul(t,r,o,l);var g=t.memoizedState;s Line truncated
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var vn=R;function $p(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Up=typeof Object.is=="function"?Object.is:$p,Ap=vn.useState,Fp=vn.useEffect,Vp=vn.useLayoutEffect,Hp=vn.useDebugValue;function Bp(e,t){var n=t(),r=Ap({inst:{value:n,getSnapshot:t}}),l=r[0].inst,i=r[1];return Vp(function(){l.value=n,l.getSnapshot=t,ai(l)&&i({inst:l})},[e,n,t]),Fp(function(){return ai(l)&&i({inst:l}),e(function(){ai(l)&&i({inst:l})})},[e]),Hp(n),n}function ai(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Up(e,n)}catch{return!0}}function Wp(e,t){return t()}var Qp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Wp:Bp;Qc.useSyncExternalStore=vn.useSyncExternalStore!==void 0?vn.useSyncExternalStore:Qp;Wc.exports=Qc;var Kp=Wc.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ml=R,Yp=Kp;function Gp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xp=typeof Object.is=="function"?Object.is:Gp,Zp=Yp.useSyncExternalStore,Jp=Ml.useRef,qp=Ml.useEffect,bp=Ml.useMemo,eh=Ml.useDebugValue;Bc.useSyncExternalStoreWithSelector=function(e,t,n,r,l){var i=Jp(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=bp(function(){function a(y){if(!c){if(c=!0,p=y,y=r(y),l!==void 0&&o.hasValue){var g=o.value;if(l(g,y))return h=g}return h=y}if(g=h,Xp(p,y))return g;var x=r(y);return l!==void 0&&l(g,x)?(p=y,g):(p=y,h=x)}var c=!1,p,h,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,l]);var s=Zp(e,i[0],i[1]);return qp(function(){o.hasValue=!0,o.value=s},[s]),eh(s),s};Hc.exports=Bc;var th=Hc.exports;const nh=Pu(th),Kc={},{useDebugValue:rh}=wf,{useSyncExternalStoreWithSelector:lh}=nh;let gu=!1;const ih=e=>e;function oh(e,t=ih,n){(Kc?"production":void 0)!=="production"&&n&&!gu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),gu=!0);const r=lh(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return rh(r),r}const sh=e=>{(Kc?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Dp(e):e,n=(r,l)=>oh(t,r,l);return Object.assign(n,t),n},uh=e=>sh;class Wn extends Error{constructor(n,r,l){super(n);_t(this,"status");_t(this,"body");this.name="HermesError",this.status=r,this.body=l}}function ah(e){let t=e.trim();return t?(/^https?:\/\//i.test(t)||(t=`https://${t}`),t.replace(/\/+$/,"")):""}function yu(e,t){if(e&&typeof e=="object"){const n=e,r=n.error;if(r&&typeof r=="object"){const i=r.message;if(typeof i=="string"&&i)return i}const l=n.error??n.message??n.detail;if(typeof l=="string"&&l)return l}return typeof e=="string"&&e?e:`Request failed (HTTP ${t})`}function wu(e,t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const n=e;for(const r of t)if(Array.isArray(n[r]))return n[r]}return[]}function Yc(e){if(typeof e=="number")return e>1e12?e:e*1e3;if(typeof e=="string"){const t=Number(e);if(!Number.isNaN(t)&&e.trim()!=="")return t>1e12?t:t*1e3;const n=Date.parse(e);if(!Number.isNaN(n))return n}}function Ir(e){const t=String(e.id??e.session_id??""),n=String(e.title??"").trim(),r=typeof e.input_tokens=="number"?e.input_tokens:void 0,l=typeof e.output_tokens=="number"?e.output_tokens:void 0;return{id:t,title:n||"Untitled",preview:typeof e.preview=="string"?e.preview:void 0,source:typeof e.source=="string"?e.source:void 0,model:typeof e.model=="string"?e.model:void 0,provider:typeof e.provider=="string"?e.provider:void 0,messageCount:typeof e.message_count=="number"?e.message_count:void 0,toolCallCount:typeof e.tool_call_count=="number"?e.tool_call_count:void 0,updatedAt:Yc(e.last_active??e.ended_at??e.started_at),endReason:e.end_reason??null,pinned:!!e.pinned,archived:!!e.archived,costUsd:typeof e.estimated_cost_usd=="number"?e.estimated_cost_usd:void 0,tokens:r!==void 0||l!==void 0?(r??0)+(l??0):void 0}}function ch(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"){const n=t;if(typeof n.text=="string")return n.text;if(typeof n.content=="string")return n.content}return""}).join(""):""}function fh(e,t){const n=String(e.role??"assistant"),r=Array.isArray(e.tool_calls)?e.tool_calls.map((i,o)=>{var s,a;return{id:String(i.id??i.call_id??`tc-${t}-${o}`),name:String(((s=i.function)==null?void 0:s.name)??"tool"),preview:typeof((a=i.function)==null?void 0:a.arguments)=="string"?i.function.arguments:void 0,status:"done"}}):[],l=typeof e.reasoning_content=="string"&&e.reasoning_content||typeof e.reasoning=="string"&&e.reasoning||void 0;return{id:String(e.id??`msg-${t}`),role:n,content:ch(e.content)||(typeof e.text=="string"?e.text:""),reasoning:l||void 0,toolCalls:r.length?r:void 0,toolName:typeof e.tool_name=="string"?e.tool_name:void 0,timestamp:Yc(e.timestamp??e.created_at)}}class Gc{constructor(t){_t(this,"baseUrl");_t(this,"apiKey");_t(this,"profile");_t(this,"customHeaders");var n;this.baseUrl=t.sameOrigin?"":ah(t.baseUrl),this.apiKey=t.apiKey,this.profile=((n=t.profile)==null?void 0:n.trim())||void 0,this.customHeaders=t.customHeaders??[]}headers(t){const n={...t};this.apiKey&&(n.Authorization=`Bearer ${this.apiKey}`);for(const{name:r,value:l}of this.customHeaders)r.trim()&&(n[r.trim()]=l);return n}url(t){const n=this.profile?`/p/${encodeURIComponent(this.profile)}`:"";return`${this.baseUrl}${n}${t}`}async request(t,n={}){const{json:r,...l}=n,i=this.headers({Accept:"application/json",...r!==void 0?{"Content-Type":"application/json"}:{},...l.headers??{}});let o;try{o=await fetch(this.uLine truncated
`)){if(!z||z.startsWith(":"))continue;const m=z.indexOf(":"),f=m===-1?z:z.slice(0,m);let v=m===-1?"":z.slice(m+1);v.startsWith(" ")&&(v=v.slice(1)),f==="event"?d=v:f==="data"&&y.push(v)}if(!y.length)return;const g=y.join(`
`);if(g==="[DONE]"){n("done",{});return}let x=g;try{x=JSON.parse(g)}catch{}n(d,x)};try{for(;;){const{done:h,value:d}=await o.read();if(h)break;a+=s.decode(d,{stream:!0});let y;for(;(y=a.indexOf(`
`))!==-1;){const g=a.slice(0,y);a=a.slice(y+2),c(g)}}a.trim()&&c(a)}finally{(p=o.releaseLock)==null||p.call(o)}}}const io=2,Rt={connections:[],activeConnectionId:null,speakReplies:!1,ttsVoice:"",showToolCalls:!1,showReasoning:!1,showSystem:!0,transcribeUrl:"",transcribeKey:"",transcribeModel:"whisper-1",mediaBaseUrl:"",mediaPathPrefix:"",prefsVersion:io},Xc="hermes.config.v2";function dh(){try{const e=localStorage.getItem(Xc);if(!e)return{...Rt};const t=JSON.parse(e),n={...Rt,...t,connections:Array.isArray(t.connections)?t.connections:[]};return(t.prefsVersion??1)<io&&(n.showToolCalls=Rt.showToolCalls,n.showReasoning=Rt.showReasoning,n.showSystem=Rt.showSystem,n.prefsVersion=io),n}catch{return{...Rt}}}function Mr(e){localStorage.setItem(Xc,JSON.stringify(e))}function Qn(e){return e.connections.length?e.connections.find(t=>t.id===e.activeConnectionId)??e.connections[0]??null:null}function ph(e){const t=Qn(e);return!!t&&(t.sameOrigin===!0||t.baseUrl.trim().length>0)}function hh(){return`conn-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}let Rn=null;function mh(e){return new Gc({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile,sameOrigin:e.sameOrigin,customHeaders:e.customHeaders})}function Ve(e){return e instanceof Wn||e instanceof Error?e.message:String(e)}function rt(e,t,n){return e.map(r=>r.id===t?n(r):r)}const j=uh()((e,t)=>({config:{...Rt},client:null,ready:!1,connectionError:null,capabilities:null,models:[],sessions:[],sessionsLoading:!1,searchQuery:"",activeSessionId:null,session:null,messages:[],sessionLoading:!1,streaming:!1,runId:null,streamError:null,steerLeftover:null,sidebarOpen:!1,showSettings:!1,toast:null,async bootstrap(){const n=dh();e({config:n,ready:!0}),Qn(n)&&await t().connect()},async saveConnection(n){const r=t().config,i=r.connections.some(s=>s.id===n.id)?r.connections.map(s=>s.id===n.id?n:s):[...r.connections,n],o={...r,connections:i,activeConnectionId:n.id};Mr(o),e({config:o}),await t().connect()},async removeConnection(n){var s;const r=t().config,l=r.connections.filter(a=>a.id!==n),i=r.activeConnectionId===n?((s=l[0])==null?void 0:s.id)??null:r.activeConnectionId,o={...r,connections:l,activeConnectionId:i};Mr(o),e({config:o,sessions:[],session:null,messages:[],activeSessionId:null}),Qn(o)&&await t().connect()},async setActiveConnection(n){const r={...t().config,activeConnectionId:n};Mr(r),e({config:r,sessions:[],session:null,messages:[],activeSessionId:null}),await t().connect()},updatePrefs(n){const r={...t().config,...n};Mr(r),e({config:r})},async connect(){const n=Qn(t().config);if(!n||!n.sameOrigin&&!n.baseUrl.trim())return;const r=mh(n);e({client:r,connectionError:null,capabilities:null});try{const l=await r.capabilities();e({capabilities:l}),r.models().then(i=>e({models:i})).catch(()=>{}),await t().loadSessions()}catch(l){e({connectionError:Ve(l),capabilities:null})}},async loadSessions(){const{client:n,searchQuery:r}=t();if(n){e({sessionsLoading:!0});try{const l=await n.listSessions({limit:200}),i=r.trim().toLowerCase(),o=i?l.filter(s=>s.title.toLowerCase().includes(i)):l;e({sessions:o,sessionsLoading:!1})}catch(l){e({sessionsLoading:!1,toast:Ve(l)})}}},setSearch(n){e({searchQuery:n}),t().loadSessions()},async openSession(n){const{client:r}=t();if(r){e({activeSessionId:n,sessionLoading:!0,session:null,messages:[],sidebarOpen:!1,streamError:null});try{const[l,i]=await Promise.all([r.getSession(n).catch(()=>null),r.getMessages(n,{limit:500,order:"oldest"})]);e({session:l??{id:n,title:"Untitled"},messages:i,sessionLoading:!1})}catch(l){e({sessionLoading:!1,toast:Ve(l)})}}},async newSession(){const{client:n}=t();if(n)try{const r=await n.createSession();e({session:r,messages:[],activeSessionId:r.id,sidebarOpen:!1,streamError:null}),await t().loadSessions()}catch(r){e({toast:Ve(r)})}},async renameSession(n,r){var i;const{client:l}=t();if(l)try{await l.updateSession(n,{title:r}),e({sessions:t().sessions.map(o=>o.id===n?{...o,title:r}:o),session:((i=t().session)==null?void 0:i.id)===n?{...t().session,title:r}:t().session})}catch(o){e({toast:Ve(o)})}},async deleteSession(n){const{client:r}=t();if(r)try{await r.deleteSession(n);const l=t().activeSessionId===n;e({sessions:t().sessions.filter(i=>i.id!==n),...l?{activeSessionId:null,session:null,messages:[]}:{}})}catch(l){e({toast:Ve(l)})}},async forkSession(n){const{client:r}=t();if(r)try{const l=await r.forkSession(n);await t().loadSessions(),await t().openSession(l.id)}catch(l){e({toast:Ve(l)})}},async send(n,r){const{client:l,activeSessionId:i,messages:o}=t();if(!l||!i)return;const s=n.trim();if(!s&&!(r!=null&&r.length)||t().streaming)return;const a={id:`local-user-${Date.now()}`,role:"user",content:s,attachments:r,timestamp:Date.now()},c=`local-assistant-${Date.now()}`,p={id:c,role:"assistant",content:"",timestamp:Date.now(),streaming:!0,toolCalls:[]};e({messages:[...o,a,p],streaming:!0,streamError:null,runId:null});let h=s;if(r!=null&&r.length){const d=[];s&&d.push({type:"text",text:s});for(const y of r)d.pu Line truncated
@@ -0,0 +1,2 @@
try{self["workbox:window:7.4.0"]&&_()}catch{}function b(t,r){return new Promise(function(n){var u=new MessageChannel;u.port1.onmessage=function(s){n(s.data)},t.postMessage(r,[u.port2])})}function P(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,u=Array(r);n<r;n++)u[n]=t[n];return u}function j(t,r,n){return r&&function(u,s){for(var c=0;c<s.length;c++){var o=s[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,W(o.key),o)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function S(t,r){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(s,c){if(s){if(typeof s=="string")return P(s,c);var o={}.toString.call(s).slice(8,-1);return o==="Object"&&s.constructor&&(o=s.constructor.name),o==="Map"||o==="Set"?Array.from(s):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?P(s,c):void 0}}(t))||r){n&&(t=n);var u=0;return function(){return u>=t.length?{done:!0}:{done:!1,value:t[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(t,r){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,u){return n.__proto__=u,n},w(t,r)}function W(t){var r=function(n,u){if(typeof n!="object"||!n)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var c=s.call(n,u);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(t,"string");return typeof r=="symbol"?r:r+""}try{self["workbox:core:7.4.0"]&&_()}catch{}var m=function(){var t=this;this.promise=new Promise(function(r,n){t.resolve=r,t.reject=n})};function y(t,r){var n=location.href;return new URL(t,n).href===new URL(r,n).href}var d=function(t,r){this.type=t,Object.assign(this,r)};function l(t,r,n){return t&&t.then||(t=Promise.resolve(t)),r?t.then(r):t}function k(){}var L={type:"SKIP_WAITING"};function E(t,r){return t&&t.then?t.then(k):Promise.resolve()}var O=function(t){function r(c,o){var e,i;return o===void 0&&(o={}),(e=t.call(this)||this).nn={},e.tn=0,e.rn=new m,e.en=new m,e.on=new m,e.un=0,e.an=new Set,e.cn=function(){var f=e.fn,a=f.installing;e.tn>0||!y(a.scriptURL,e.sn.toString())||performance.now()>e.un+6e4?(e.vn=a,f.removeEventListener("updatefound",e.cn)):(e.hn=a,e.an.add(a),e.rn.resolve(a)),++e.tn,a.addEventListener("statechange",e.ln)},e.ln=function(f){var a=e.fn,v=f.target,h=v.state,p=v===e.vn,g={sw:v,isExternal:p,originalEvent:f};!p&&e.mn&&(g.isUpdate=!0),e.dispatchEvent(new d(h,g)),h==="installed"?e.wn=self.setTimeout(function(){h==="installed"&&a.waiting===v&&e.dispatchEvent(new d("waiting",g))},200):h==="activating"&&(clearTimeout(e.wn),p||e.en.resolve(v))},e.yn=function(f){var a=e.hn,v=a!==navigator.serviceWorker.controller;e.dispatchEvent(new d("controlling",{isExternal:v,originalEvent:f,sw:a,isUpdate:e.mn})),v||e.on.resolve(a)},e.gn=(i=function(f){var a=f.data,v=f.ports,h=f.source;return l(e.getSW(),function(){e.an.has(h)&&e.dispatchEvent(new d("message",{data:a,originalEvent:f,ports:v,sw:h}))})},function(){for(var f=[],a=0;a<arguments.length;a++)f[a]=arguments[a];try{return Promise.resolve(i.apply(this,f))}catch(v){return Promise.reject(v)}}),e.sn=c,e.nn=o,navigator.serviceWorker.addEventListener("message",e.gn),e}var n,u;u=t,(n=r).prototype=Object.create(u.prototype),n.prototype.constructor=n,w(n,u);var s=r.prototype;return s.register=function(c){var o=(c===void 0?{}:c).immediate,e=o!==void 0&&o;try{var i=this;return l(function(f,a){var v=f();return v&&v.then?v.then(a):a(v)}(function(){if(!e&&document.readyState!=="complete")return E(new Promise(function(f){return window.addEventListener("load",f)}))},function(){return i.mn=!!navigator.serviceWorker.controller,i.dn=i.pn(),l(i.bn(),function(f){i.fn=f,i.dn&&(i.hn=i.dn,i.en.resolve(i.dn),i.on.resolve(i.dn),i.dn.addEventListener("statechange",i.ln,{once:!0}));var a=i.fn.waiting;return a&&y(a.scriptURL,i.sn.toString())&&(i.hn=a,Promise.resolve().then(function(){i.dispatchEvent(new d("waiting",{sw:a,wasWaitingBeforeRegister:!0}))}).then(function(){})),i.hn&&(i.rn.resolve(i.hn),i.an.add(i.hn)),i.fn.addEventListener("updatefound",i.cn),navigator.serviceWorker.addEventListener("controllerchange",i.yn),i.fn})}))}catch(f){return Promise.reject(f)}},s.update=function(){try{return this.fn?l(E(this.fn.update())):l()}catch(c){return Promise.reject(c)}},s.getSW=function(){return this.hn!==void 0?Promise.resolve(this.hn):this.rn.promise},s.messageSW=function(c){try{return l(this.getSW(),function(o){return b(o,c)})}catch(o){return Promise.reject(o)}},s.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&b(this.fn.waiting,L)},s.pn=function(){var c=navigator.serviceWorker.controller;return c&&y(c.scriptURL,this.sn.toString())?c:void 0},s.bn=function(){try{var c=this;return l(function(o,e){try{var i=o()}catch(f){return e(f)}return i&&i.then?i.then(void 0,e):i}(function(){return l(navigator.serviceWorker.register(c.sn,c.nn),function(o){return c.un=performance.now(),o})},function(o){throw o}))}catch(o){return Promise.reject(o)}},j(r,[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])}(function(){function t(){this.Pn=new Map}var r=t.prototype;return r.addEventListener=function(n,u){this.jn(n).add(u)},r.removeEventListener=function(n,u){this.jn(n).delete(u)},r.dispatchEvent=function(n){n.target=this;for(var u,s=S(this.jn(n.type));!(u=s()).done;)(0,u.value)(n)},r.jn=function(n){return this.Pn.has(n)||this.Pn.set(n,new Set),this.Pn.get(n)},t}());export{O as Workbox,d as WorkboxEvent,b as messageSW};
+15
View File
@@ -0,0 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34">
<defs>
<linearGradient id="b" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#003545"/>
<stop offset="100%" stop-color="#00202e"/>
</linearGradient>
</defs>
<rect x="0" y="0" width="34" height="34" rx="10" fill="url(#b)" stroke="#005570" stroke-width="1.2"/>
<rect x="6" y="11" width="22" height="15" rx="2.5" fill="none" stroke="#00f5ff" stroke-width="1.8"/>
<path d="M17 11V7" stroke="#00f5ff" stroke-width="1.8" stroke-linecap="round"/>
<circle cx="17" cy="5.5" r="1.5" fill="#00f5ff"/>
<circle cx="10" cy="15.5" r="1" fill="#00f5ff"/>
<circle cx="14" cy="15.5" r="1" fill="#00f5ff"/>
<path d="M10 20h14" stroke="#00f5ff" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+3 -2
View File
@@ -13,9 +13,10 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Hermes" /> <meta name="apple-mobile-web-app-title" content="Hermes" />
<title>Hermes</title> <title>Hermes</title>
</head> <script type="module" crossorigin src="/assets/index-Cbj_LrNG.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CWSassUi.css">
<link rel="manifest" href="/manifest.webmanifest"></head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body> </body>
</html> </html>
+1
View File
@@ -0,0 +1 @@
{"name":"Hermes","short_name":"Hermes","start_url":"/","display":"standalone","background_color":"#000810","lang":"en","scope":"/","description":"Chat with your Hermes Agent profiles, sessions, voice and images.","theme_color":"#000810","orientation":"portrait-primary","icons":[{"src":"icons/icon-192.png","sizes":"192x192","type":"image/png"},{"src":"icons/icon-512.png","sizes":"512x512","type":"image/png"},{"src":"icons/maskable-512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
+3 -3
View File
@@ -4,7 +4,7 @@
# #
# ./run.sh # dev server -> http://localhost:5173 # ./run.sh # dev server -> http://localhost:5173
# ./run.sh dev # same as above # ./run.sh dev # same as above
# ./run.sh build # production build into dist/ # ./run.sh build # production build, deployed into the repo root
# ./run.sh serve # build if needed, then host + proxy /api/* (needs HERMES_TARGET) # ./run.sh serve # build if needed, then host + proxy /api/* (needs HERMES_TARGET)
# ./run.sh preview # build, then serve the build with vite preview # ./run.sh preview # build, then serve the build with vite preview
# ./run.sh icons # regenerate the PWA icon set # ./run.sh icons # regenerate the PWA icon set
@@ -17,7 +17,7 @@
# #
set -eu set -eu
cd "$(dirname "$0")" cd "$(dirname "$0")/app"
MODE="${1:-dev}" MODE="${1:-dev}"
@@ -54,7 +54,7 @@ case "$MODE" in
build) build)
ensure_deps ensure_deps
ensure_icons ensure_icons
log "Building..." log "Building and deploying to repo root..."
exec npm run build exec npm run build
;; ;;
serve) serve)
+1
View File
@@ -0,0 +1 @@
if(!self.define){let e,i={};const n=(n,s)=>(n=new URL(n+".js",s).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(s,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(i[r])return;let c={};const l=e=>n(e,r),t={module:{uri:r},exports:c,require:l};i[r]=Promise.all(s.map(e=>t[e]||l(e))).then(e=>(o(...e),c))}}define(["./workbox-abeb32eb"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"17d0b1d684770cbbfe6ee21d3f1198ac"},{url:"assets/workbox-window.prod.es5-BqEJf4Xk.js",revision:null},{url:"assets/index-Cbj_LrNG.js",revision:null},{url:"assets/index-CWSassUi.css",revision:null},{url:"favicon.svg",revision:"a3baf2b041a9ed1fcc08d8a3634b535b"},{url:"icons/apple-touch-icon.png",revision:"ed81749f391ac07000b948263124e943"},{url:"icons/icon-192.png",revision:"8b2374bbaec1e3d1db8a07af64a6ef77"},{url:"icons/icon-512.png",revision:"c44a8f2da9095157b9b9aff7ec8e1aeb"},{url:"icons/maskable-512.png",revision:"beb4196443dc6daafcaab4497038613d"},{url:"manifest.webmanifest",revision:"d1afe01b7c52b0c511fd7e5f11079c23"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{denylist:[/^\/api\//]})),e.registerRoute(({url:e})=>e.pathname.startsWith("/api/"),new e.NetworkOnly,"GET")});
+1
View File
@@ -0,0 +1 @@
define(["exports"],function(t){"use strict";try{self["workbox:core:7.4.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.4.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class i extends r{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=i&&i.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:r})}catch(t){a=Promise.reject(t)}const h=i&&i.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:r})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const r=this.t.get(s.method)||[];for(const i of r){let r;const o=i.match({url:t,sameOrigin:e,request:s,event:n});if(o)return r=o,(Array.isArray(r)&&0===r.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new r(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)o=new i(t,e,n);else if("function"==typeof t)o=new r(t,e,n);else{if(!(t instanceof r))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return a().registerRoute(o),o}function u(t){return new Promise(e=>setTimeout(e,t))}const l={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},f=t=>[l.prefix,t,l.suffix].filter(t=>t&&t.length>0).join("-"),w=t=>t||f(l.precache),d=t=>t||f(l.runtime);function p(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class y{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const g=new Set;try{self["workbox:strategies:7.4.0"]&&_()}catch(t){}function R(t){return"string"==typeof t?new Request(t):t}class m{constructor(t,e){this.h={},Object.assign(this,e),this.event=e.event,this.u=t,this.l=new y,this.p=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.l.promise)}async fetch(t){const{event:e}=this;let n=R(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.u.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:i,response:t});return t}catch(t){throw r&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:r.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=R(t);let s;const{cacheName:n,matchOptions:r}=this.u,i=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(i,o);for(const t of this.iterateCallbacks("cachedResponseLine truncated