UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1,625 lines • 416 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./command-palette-Ckx_A_St.js","./control-ui-boot-shared-Rs4iS2kF.js","./control-ui-boot-shared-3SP_aL-Y.js","./control-ui-boot-shared-JlZTSJEC.js","./control-ui-boot-shared-90V688bk.js","./control-ui-boot-shared-DBJri5ri.js","./config-runtime-CgOgfOrG.js","./control-ui-boot-shared-BykNRHBP.js","./plugin-contracts-runtime-CsJ0WpAd.js","./markdown-runtime-Hc-lvqnn.js","./control-ui-boot-shared-DoKu-5Ju.js","./control-ui-boot-shared-CG9HtEG-.js","./control-ui-boot-shared-73R4ErOy.js","./control-ui-boot-shared-CcmBeh0v.js","./control-ui-boot-shared-BR12heUA.js","./control-ui-boot-shared-CApmg5ot.js","./css-chat-Ckz95ikh.js","./chat-transcript-layout-w3EszKw8.js","./css-chat-custodian-new-session-B_euK-Vu.js","./sidebar-update-runtime-B0vYzX3D.js","./control-ui-boot-new-BTHisEC4.js","./css-cron-custodian-new-session-DdqVeFqw.js","./chat-transcript-styles-BVZgOT1t.js","./css-new-session-BGJnpiJ5.js","./css-config-njfbfHBk.js","./transcript-search-Bw6jSdBN.js","./en-apps-8oPCuuXd.js","./settings-targets-BVKntTff.js","./control-ui-core-D-VUH4Gq.css","./control-ui-boot-shared-BJ_QKfFn.css","./css-chat-DCHf01mf.css","./css-chat-custodian-new-session-CEndYuO5.css","./sidebar-update-runtime-ah7rgQE7.css","./css-cron-custodian-new-session-Ci5c-FgJ.css","./chat-transcript-styles-DHHd4Hhc.css","./css-new-session-C71huhgC.css","./css-config-vi6FusyS.css","./control-ui-boot-new-D-SpiTTi.css","./command-palette-NBC8ATMP.css","./debug-overlay-DeLfhBb8.js","./keyboard-shortcuts-dialog-oLNWxwqe.js","./app-sidebar-DA-MiL2F.js","./macos-titlebar-controls.runtime-BXoXcvFt.js","./sidebar-attention-nNRsUgIp.js","./terminal-panel-registration-D5VvSsFk.js","./terminal-panel-registration-DCAn7CIA.js","./scrollbar-styles-BielkyQ9.js","./dock-panel-styles-lbOjSYYD.js","./panel-tab-strip-BM8uM2tc.js","./dock-destination-controls-BlZlW68m.js","./panel-empty-state-BO6bnLg_.js","./theme-color-DAo4KRoc.js","./catalog-terminal-start-CKAPUE5U.js","./browser-panel-BZcARBB-.js","./browser-panel-DNPuq5oF.js","./gateway-websocket-url-cYJwVUmD.js","./browser-document-I7E6o6kg.js","./desktop-panel-YZcYHBlM.js","./desktop-panel-B-wMMJaC.js","./desktop-focus-window-BlH9P8oZ.js","./link-reader-panel-DdSQDdBY.js","./link-reader-response-Cct0r21o.js","./board-document-CFFelSJn.js","./board-view-BD5Z3h_5.js","./control-ui-disabled-DNN1S8_t.js","./near-viewport-observer-WgGck829.js","./widget-sandbox-host-BQH21b5-.js","./board-view-DSwvd-aj.css","./board-document-B0Y4zGJq.css","./approval-page-registration-Z63Xdd1j.js","./approval-BhCMRUNv.js","./approval-D_3q8zgZ.css","./question-page-registration-CE8mGnbu.js","./css-question-Ct0OXZAc.js","./css-question-DeaP1V6y.css","./exec-approval-CkJQ1zvS.js","./login-gate-BAEnjKPe.js","./login-runtime-B9V4EbPP.js","./tooltip-COuYAF8g.js","./assistant-panel-content-Tev0SwDP.js","./custodian-surface-DgaL0Vy1.js","./plugin-help-C-HH8MfQ.js","./custodian-alert-store-D3-kKDhQ.js","./wizard-step-controls-BmW-9g-y.js","./channel-picker-DAnVfyDn.js","./control-ui-boot-chat-DCYcb1Hy.js","./css-agents-plugins-skill-workshop-skills-DvcafeYi.js","./css-skill-workshop-D2ZfJfdl.js","./session-snapshot-database-CobUvfK7.js","./channel-picker-DMboyz7y.css","./wizard-step-controls-D2NAzKG1.css","./css-agents-plugins-skill-workshop-skills-DP4CzO_X.css","./css-skill-workshop-CWhVVscF.css","./control-ui-boot-chat-CPmZGJw4.css","./custodian-surface-BS8BC9z-.css","./assistant-panel-content-DzJupYdl.css","./link-reader-hovercard-BCyqj9WV.js","./link-reader-hovercard-Bv0AteIE.css","./route-loader-Cu3upMOr.js","./route-loader-session-reference-J09ar3gm.js","./session-placement-recovery-migration.runtime-C6MeUzhK.js","./gateway-scope-upgrade.runtime-k9Z1HIJx.js","./control-ui-environment-presentation.runtime-DUs57N_7.js","./theme-catalog-DVDT9sEx.js","./theme-palette-CTWKNgGC.js","./session-roster-cache.runtime-CPajVK7c.js","./session-roster-cache.reader-EFFQX3Sf.js","./native-gateways.runtime--PSgoJUb.js","./session-placement-startup.runtime-DSqPZz_S.js","./sw-refresh.runtime-BOQMREZN.js","./canvas-surface-lease.runtime-CzzmSkNQ.js","./plugin-capabilities.runtime-D0SV9g_o.js","./native-link-menu.runtime-DeGj9_Ij.js","./update-failure-report-c97igbFt.js","./en-update-actions-B4FZH2_u.js","./update-triage.runtime-rqfa0tcg.js","./en-settings-CTjRjKt9.js","./web-push.runtime-DnfB-fK7.js","./browser-bootstrap.runtime-azYaAbIw.js","./response-body-krIvH2yK.js","./native-startup.runtime-D2efId9J.js","./native-embed-CiDYfKFT.css","./session-progress-hovercard-registration-BxST9uwo.js","./nav-drawer-swipe.runtime-BlSGP3CY.js","./server-prefs-profile-runtime-Bj5WHU6a.js","./user-prefs-request-Y0ykMyQk.js","./update-confirmation.runtime-BcC65xAB.js","./update-run-view-BRPFPBfJ.js","./stream-auto-follow-controller-BZ0UzGsg.js","./update-run-view-DpZEihgg.css","./settings-sidebar-DGY6fHqk.js","./config-form.tiers-B6RLhwBP.js","./config-form.search-Cgp2izNk.js","./setup-schema-Dq2HBf5f.js","./slots-Dm2tR7jh.js","./settings-DdI5hVp3.js","./settings-DyrJbLnT.css","./view-pairing.runtime-CvBsN78a.js","./en-devices-CYyAb5JP.js","./onboarding-memory-import-q7lLmUal.js","./onboarding-memory-import-DuWLEvoz.css","./outbox-store-projection-CNeLFLzI.js","./sidebar-update-card-B3kfrCKK.js","./control-ui-favicon-status.runtime-DowawiKJ.js","./composer-draft-retirement.runtime-BggnHQQu.js"])))=>i.map(i=>d[i]);
import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{$i as t,$t as n,B as r,Ba as i,Bi as a,Br as o,Bt as s,Ct as c,D as l,Da as u,E as d,Et as f,F as p,Ft as m,Gi as h,Gt as g,Ha as _,Hr as v,Ht as y,I as b,Ii as x,It as S,Ja as C,Ji as w,Jt as T,Kr as E,L as D,Lt as O,M as k,Ma as A,N as ee,P as j,Pa as M,Qi as N,R as P,Rt as te,Sa as ne,Si as re,St as F,Tt as ie,Ui as I,Ut as ae,Vr as oe,Vt as se,Xa as ce,Xi as le,Yt as ue,Zi as de,_t as fe,aa as pe,an as me,b as he,ba as ge,bn as _e,br as ve,bt as ye,ca as be,cn as xe,ct as Se,d as Ce,dn as we,ea as Te,en as Ee,eo as De,f as Oe,fa as ke,g as Ae,gn as je,gt as Me,ha as Ne,ht as Pe,ia as Fe,ii as Ie,in as Le,io as Re,j as ze,ja as Be,kn as Ve,la as He,ln as Ue,lo as We,m as Ge,ma as Ke,mn as qe,mt as Je,n as Ye,na as Xe,nn as Ze,nt as Qe,on as $e,oo as et,p as tt,pn as nt,qr as L,qt as rt,r as it,ra as at,ro as R,rt as ot,sa as st,sn as ct,so as lt,st as ut,ta as dt,tn as ft,tt as pt,u as mt,va as ht,vt as gt,wn as _t,wt as vt,xn as yt,xt as bt,ya as xt,yn as St,yr as Ct,z as wt,zi as z,zr as Tt}from"./control-ui-foundation-ZY_Flbbd.js";import{$ as Et,$l as Dt,$n as Ot,$o as kt,$s as At,$t as jt,Aa as Mt,Ao as Nt,Ar as Pt,At as Ft,Ba as It,Bl as Lt,Bo as Rt,Bs as zt,Ca as Bt,Co as Vt,Ct as Ht,Cu as Ut,Da as Wt,Dc as Gt,Di as Kt,Dn as qt,Ds as Jt,Dt as Yt,Ea as Xt,En as Zt,Eo as Qt,Eu as $t,Fa as en,Fc as tn,Ft as nn,G as rn,Ga as an,Gl as on,Gt as sn,H as cn,Ha as ln,Hl as un,Ho as dn,Hs as fn,Ia as pn,Ic as mn,Il as hn,Is as gn,It as _n,J as vn,Jn as yn,Js as bn,Jt as xn,K as Sn,Ka as Cn,Kl as wn,Kt as Tn,La as En,Ll as Dn,Lo as On,Lt as kn,Mt as An,Ni as jn,Ns as Mn,O as Nn,Oa as Pn,Ot as Fn,Ou as In,Pa as Ln,Pc as Rn,Q as zn,Ql as Bn,Qn as Vn,Qo as Hn,R as Un,Ra as Wn,Ri as Gn,Ro as Kn,Rt as qn,S as Jn,Sa as Yn,Sn as Xn,So as Zn,Ss as Qn,Su as $n,Ta as er,Tn as tr,To as nr,Tu as rr,U as ir,Ua as ar,Ul as or,Un as sr,Uo as cr,V as lr,Va as ur,Vl as dr,Vo as fr,Vs as pr,W as mr,Wa as hr,Wl as gr,Wn as _r,Wo as vr,X as yr,Xn as br,Xo as xr,Xt as Sr,Y as Cr,Yn as wr,Yr as Tr,Ys as Er,Yt as Dr,Zc as Or,Zl as kr,Zn as Ar,Zo as jr,Zt as Mr,_ as Nr,_a as Pr,_l as Fr,_o as Ir,_s as Lr,aa as Rr,ac as zr,an as Br,ao as Vr,ar as Hr,as as Ur,at as Wr,ba as Gr,bc as Kr,bo as qr,bs as Jr,c as Yr,ca as Xr,cc as Zr,co as Qr,cr as $r,cs as ei,cu as ti,d as ni,dl as ri,dn as ii,do as ai,ds as oi,dt as si,eo as ci,er as li,es as ui,et as di,eu as fi,f as pi,fa as mi,fn as hi,fo as gi,fs as _i,ft as vi,g as yi,gl as bi,gn as xi,go as Si,gs as Ci,ha as wi,hc as Ti,hl as Ei,ho as Di,hs as Oi,ht as ki,hu as B,i as Ai,ia as ji,io as Mi,ir as Ni,is as Pi,it as Fi,ja as Ii,ji as Li,jr as Ri,ka as zi,kc as Bi,ko as Vi,ks as Hi,ku as Ui,l as Wi,ll as Gi,lo as Ki,ls as qi,lu as Ji,mc as Yi,mn as Xi,mo as Zi,ms as Qi,mt as $i,n as ea,na as ta,nl as na,nn as ra,no as ia,ns as aa,nu as oa,o as sa,oa as ca,oc as la,oi as ua,on as da,oo as fa,os as pa,ot as ma,ou as ha,p as ga,pl as _a,pn as va,po as ya,ps as ba,pu as xa,q as Sa,qa as Ca,ql as wa,qn as Ta,qs as Ea,qt as Da,ra as Oa,rc as ka,ro as Aa,rr as ja,rs as Ma,rt as Na,sa as Pa,sc as Fa,si as Ia,sl as La,so as Ra,sr as za,ss as Ba,st as Va,su as Ha,ta as Ua,to as Wa,tr as Ga,ts as Ka,tt as qa,tu as Ja,u as Ya,uo as Xa,us as Za,ut as Qa,uu as V,va as $a,vc as eo,vo as to,vs as no,vt as ro,wa as io,wo as ao,ws as oo,xa as so,xc as co,xl as lo,xn as uo,xo as fo,xs as po,ya as mo,yl as ho,yo as go,yu as _o,za as vo,zi as yo,zo as bo,zs as xo}from"./control-ui-core-3P365fbR.js";import{$ as H,B as So,F as Co,I as wo,M as To,N as Eo,R as Do,X as U,Y as W,Z as Oo,at as ko,ct as G,g as Ao,m as jo,mt as Mo,nt as No,p as Po,tt as K,ut as q}from"./lit-runtime-P5vbNq6b.js";import{c as Fo,d as Io,l as Lo}from"./gateway-runtime-5YzSCmfV.js";function Ro(e){let t=e.slug;if(t){if(Ps.has(t)){Ls.has(t)||(Ls.add(t),console.warn(`[openclaw] /${t} is a native route; using /plugin.`));return}return t}}function zo(e=[]){Is.clear();for(let t of e){let e=Ro(t);e&&!Is.has(e)&&Is.set(e,t)}}function Bo(e,t=``){let n=He(e),r=be(t);if(!n.startsWith(`${r}/`))return null;let i=n.slice(r.length+1);return i.length<=64&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(i)&&!Ps.has(i)?i:null}function Vo(e,t=``){return Is.get(Bo(e,t)??``)??null}function Ho(e,t=``){let n=Ro(e);return{pathname:n?`${be(t)}/${n}`:J(`plugin`,t),search:n?``:`?${new URLSearchParams({plugin:e.pluginId,id:e.id})}`,hash:``}}function Uo(e,t=``){if(He(e.pathname)!==J(`plugin`,t))return e;let n=new URLSearchParams(e.search),r=[...Is.values()].find(e=>e.pluginId===n.get(`plugin`)&&e.id===n.get(`id`));if(!r)return e;let i=new URLSearchParams([...n].filter(([e])=>e.startsWith(`p.`)));return{...Ho(r,t),search:i.size?`?${i}`:``,hash:e.hash}}function Wo(e){return Object.hasOwn(As,e)}function Go(e){return{id:e,...As[e]}}function J(e,t=``){return`${be(t)}${As[e].path}`}function Ko(e,t,n){let r=He(e),i=J(t,n);if(r===i)return``;let a=`${i}/`;return r.startsWith(a)&&r.slice(a.length)||null}function qo(e){return e.length===36&&ke.test(e)}function Jo(e,t=``,n,r=12){let i=qo(e),a=$t(_(n),48).replace(/-+$/u,``),o=i?`${a?`${a}-`:``}${e.replaceAll(`-`,``).slice(0,r).toLowerCase()}`:e,s=encodeURIComponent(qo(o)?`person-${o}`:o).replaceAll(`.`,`%2E`);i||(s=s.replace(/-(?=[0-9a-f]{8,32}$)/u,`%2D`));let c=`${J(`activity`,t)}/${s}`;return{pathname:c,search:``,href:c}}function Yo(e,t=``){let n=Ko(e,`activity`,t);if(!n||n.includes(`/`))return null;try{let e=decodeURIComponent(n);return!e.trim()||e===`.`||e===`..`?null:qo(e)?e:n.match(zs)?.[1]??e}catch{return null}}function Xo(e,t=``){if(!Fe(e))throw Error(`Invalid Workboard board id.`);let n=encodeURIComponent(e).replaceAll(`.`,`%2E`);return`${J(`workboard`,t)}/${n}`}function Zo(e,t=null,n=``){if(!e||e.includes(`/`)||e===`.`||e===`..`)throw Error(`Invalid agent id for a route path.`);let r=encodeURIComponent(e).replaceAll(`.`,`%2E`),i=`${J(`agents`,n)}/${r}`;return t?`${i}/${t}`:i}function Qo(e,t=``){let n=Ko(e,`agents`,t);if(!n)return null;let r=n.split(`/`);if(r.length>2||!r[0])return null;let i;try{i=decodeURIComponent(r[0])}catch{return null}if(!i||i.includes(`/`)||i===`.`||i===`..`)return null;let a=r[1]??null,o=a&&Ui(a)?a:null;return{agentId:i,panel:o??`overview`,panelSegment:o,invalidPanel:a!==null&&o===null}}function $o(e,t=``){let n=J(`memory`,t);return e===`overview`?n:`${n}/${e}`}function es(e,t=``){let n=Ko(e,`memory`,t);return n===``?`overview`:n===`memories`||n===`dreams`||n===`settings`?n:null}function ts(e,t=``){return He(e)===`${J(`plugin-settings`,t)}/discover`}function ns(e){return/^[A-Za-z0-9_-]+$/u.test(e)}function rs(e,t=``){if(!ns(e))throw Error(`Invalid plugin catalog id for a route path.`);return`${J(`plugins`,t)}/${e}`}function is(e,t=``){let n=He(e),r=`${J(`plugins`,t)}/`;if(!n.startsWith(r))return null;let i=n.slice(r.length);return ns(i)?i:null}function as(e,t=``){if(!e||e===`.`||e===`..`)throw Error(`Invalid plugin id for a route path.`);let n=e===`discover`?`%64iscover`:encodeURIComponent(e).replaceAll(`.`,`%2E`);return`${J(`plugin-settings`,t)}/${n}`}function os(e,t=``){let n=He(e),r=`${J(`plugin-settings`,t)}/`;if(!n.startsWith(r))return null;let i=n.slice(r.length);if(!i||i.includes(`/`)||i===`discover`)return null;try{let e=decodeURIComponent(i);return e&&e!==`.`&&e!==`..`?e:null}catch{return null}}function ss(e){return e===`chat`||e===`dashboard`}function cs(e,t=``){let n=He(e),r=be(t);if(r&&n!==r&&!n.startsWith(`${r}/`))return null;let i=n.slice(r.length);return i.startsWith(`/chat/`)?`chat`:i.startsWith(`/dashboard/`)?`dashboard`:ht({pathname:n,basePath:r})?`chat`:null}function ls(e,t=``){return`${J(`terminal`,t)}/${encodeURIComponent(e)}`}function us(e,t,n){let r=Ko(e,t,n);if(!r||r.includes(`/`))return null;try{return decodeURIComponent(r)}catch{return null}}function ds(e,t=``){return us(e,`terminal`,t)?.trim()||null}function fs(e,t=``){let n=us(e,`workboard`,t);return Fe(n)?n:null}function ps(e,t=``){return ds(e,t)?`terminal`:Vo(e,t)?`plugin`:Qo(e,t)?`agents`:Yo(e,t)?`activity`:fs(e,t)?`workboard`:es(e,t)?`memory`:ts(e,t)?`plugins`:os(e,t)?`plugin-settings`:cs(e,t)}function ms(e,t){let n=is(e,t)?`plugins`:ps(e,t);return n&&(n!==`memory`||es(e,t)!==`overview`)?[n,Bs[n],e]:null}function hs(e,t=``){let n=He(e),r=be(t);if(r&&n!==r&&!n.startsWith(`${r}/`))return null;let i=r?n.slice(r.length)||`/`:n;return is(n,r)?`plugins`:Ns.get(i.toLowerCase())??ps(n,r)}function gs(e){if(Ms.includes(e))return!0;let t=e.split(`/`).filter(Boolean);for(let e=1;e<=t.length;e+=1){let n=`/${t.slice(0,e).join(`/`)}`;if(Ms.some(e=>e.startsWith(`${n}/`)))return!0}return!1}function _s(e){let t=ge(e);if(t!==null)return t;let n=e.trim().endsWith(`/`),r=He(e);if(r.toLowerCase().endsWith(`/index.html`))return be(r.slice(0,-11));if(r===`/`)return``;let i=r.split(`/`).filter(Boolean);for(let e=0;e<i.length;e+=1){let t=`/${i.slice(e).join(`/`)}`,n=Ns.has(t)?t:void 0,r=Object.values(ks).find(e=>t===e||t.startsWith(`${e}/`)),a=ps(t);if(!n&&!r&&!a)continue;let o=i[e-1],s=r??(a?As[a].path:null),c=(n??s??``).split(`/`)[1];if(e===0||o===c)return``;let l=`/${i.slice(0,e).join(`/`)}`;return gs(l)?``:l}if(!n||i.length===0)return``;let a=`/${i.join(`/`)}`;return gs(a)?``:a}function vs(e,t){return{pathname:J(e,t),search:``,hash:``}}function ys(e,t){let n=new URLSearchParams(e.search),r=n.get(t)??e.pathname;n.delete(t);let i=n.toString();return{pathname:r,search:i?`?${i}`:``,hash:e.hash}}function bs(e,t){return e?.pathname===t?.pathname&&e?.search===t?.search&&e?.hash===t?.hash}var xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs;function Y(){return(Y=e((()=>{i(),Ne(),st(),at(),In(),rr(),xs=`__openclawAgentPath`,Ss=`__openclawActivityPath`,Cs=`__openclawTerminalPath`,ws=`__openclawSessionPath`,Ts=`__openclawMemoryPath`,Es=`__openclawPluginsPath`,Ds=`__openclawPluginSettingsPath`,Os=`__openclawWorkboardPath`,ks={approval:`/approve`,question:`/ask`},As={settings:{path:`/settings`},chat:{path:`/chat`},terminal:{path:`/terminal`},dashboard:{path:`/dashboard`},dashboards:{path:`/dashboards`},custodian:{path:`/custodian`},"new-session":{path:`/new`},activity:{path:`/activity`},meetings:{path:`/meetings`},apps:{path:`/apps`},portals:{path:`/portals`},"agents-home":{path:`/agents`},agents:{path:`/settings/agents`},channels:{path:`/settings/channels`,aliases:[`/channels`]},connection:{path:`/settings/connection`},config:{path:`/settings/general`,aliases:[`/config`]},profile:{path:`/settings/profile`,aliases:[`/profile`]},communications:{path:`/settings/communications`,aliases:[`/communications`]},appearance:{path:`/settings/appearance`,aliases:[`/appearance`]},lobsterdex:{path:`/settings/lobsterdex`,aliases:[`/lobsterdex`]},device:{path:`/settings/device`},"device-permissions":{path:`/settings/device/permissions`},notifications:{path:`/settings/notifications`},security:{path:`/settings/security`},secrets:{path:`/settings/secrets`},advanced:{path:`/settings/advanced`},approvals:{path:`/settings/approvals`},automation:{path:`/settings/automation`,aliases:[`/automation`]},mcp:{path:`/settings/mcp`,aliases:[`/mcp`]},memory:{path:`/settings/memory`},search:{path:`/settings/search`},talk:{path:`/settings/talk`},infrastructure:{path:`/settings/infrastructure`,aliases:[`/infrastructure`]},labs:{path:`/settings/labs`},updates:{path:`/settings/updates`},about:{path:`/settings/about`},"ai-agents":{path:`/settings/ai-agents`,aliases:[`/ai-agents`]},"model-setup":{path:`/settings/model-setup`,aliases:[`/model-setup`]},"model-providers":{path:`/settings/model-providers`,aliases:[`/model-providers`]},"memory-import":{path:`/memory-import`,aliases:[`/settings/memory-import`]},workboard:{path:`/workboard`},worktrees:{path:`/worktrees`,aliases:[`/settings/worktrees`]},sessions:{path:`/sessions`,aliases:[`/settings/sessions`]},systems:{path:`/systems`},usage:{path:`/usage`},debug:{path:`/debug`},logs:{path:`/logs`},"skill-workshop":{path:`/skills/workshop`},skills:{path:`/skills`},"skill-settings":{path:`/settings/skills`},plugins:{path:`/plugins`},"plugin-settings":{path:`/settings/plugins`},cron:{path:`/automations`,aliases:[`/cron`]},devices:{path:`/settings/devices`,aliases:[`/nodes`]},"cloud-workers":{path:`/settings/cloud-workers`},plugin:{path:`/plugin`}},js=Object.keys(As),Ms=[],Ns=new Map;for(let e of js){let t=As[e],n=`aliases`in t?[t.path,...t.aliases]:[t.path];for(let t of n){let n=He(t);Ms.push(n),Ns.has(n)||Ns.set(n,e)}}Ps=new Set(Ms.map(e=>e.split(`/`)[1])),Fs=`__openclawPluginPath`,Is=new Map,Ls=new Set,Rs=`person`,zs=/(?:^|-)([0-9a-f]{8,32})$/u,Bs={terminal:Cs,plugin:Fs,agents:xs,activity:Ss,workboard:Os,memory:Ts,plugins:Es,"plugin-settings":Ds,chat:ws,dashboard:ws}})))()}function Vs(){}function Hs(e){return!1}function Us(e){return e}function Ws(e){try{let t=new URL(Us(e),location.href);return t.protocol=t.protocol.replace(/^ws/u,`http`),t.origin===location.origin}catch{return!1}}function Gs(e){return e}function Ks(){return(Ks=e((()=>{})))()}function qs(){return window.__OPENCLAW_NATIVE_WEB_CHROME__===!0}function Js(){let e=window.__OPENCLAW_NATIVE_EMBED__;if(!w(e))return null;let{platform:t,formFactor:n,surface:r}=e;return(t===`ios`||t===`macos`||t===`android`)&&(n===`phone`||n===`pad`||n===`desktop`)&&(r===void 0||r===`conversation`)?{platform:t,formFactor:n,...r?{surface:r}:{}}:null}function Ys(){return Js()!==null}function Xs(){let e=window.__OPENCLAW_NATIVE_HISTORY__;return e&&typeof e.canGoBack==`boolean`&&typeof e.canGoForward==`boolean`?e:{canGoBack:!1,canGoForward:!1}}var Zs;function Qs(){return(Qs=e((()=>{Zs=`openclaw:native-history-state`,typeof window<`u`&&window.dispatchEvent(new Event(`openclaw:native-window-chrome-available`))})))()}function $s(){let e=typeof window>`u`?void 0:window.__OPENCLAW_CONTROL_UI_BASE_PATH__,t=typeof e==`string`?e:typeof document>`u`?null:document.documentElement.getAttribute(le);return t===null?null:be(t)}function ec(e){let t=$s(),n=t===``&&Bo(e)?``:t||_s(e);return[n,t??n]}function tc(){return{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash}}function nc(e){return`${e.pathname}${e.search}${e.hash}`}function rc(){let e=window.history.state;if(e&&typeof e==`object`&&`openclawNativeEmbedDepth`in e){let t=e.openclawNativeEmbedDepth;if(typeof t==`number`&&Number.isSafeInteger(t)&&t>=0)return t}return 0}function ic(){return rc()>0}function ac(){let e=Ys(),t=new Set,n,r=()=>{if(n)return;let e=()=>{let e=tc();for(let n of t)n(e)};window.addEventListener(`popstate`,e),n=()=>window.removeEventListener(`popstate`,e)},i=()=>{t.size===0&&(n?.(),n=void 0)};return{location:tc,push:t=>window.history.pushState(e?{openclawNativeEmbedDepth:rc()+1}:{},``,nc(t)),replace:t=>window.history.replaceState(e?{openclawNativeEmbedDepth:rc()}:{},``,nc(t)),listen:e=>(t.add(e),r(),()=>{t.delete(e),i()})}}function oc(){return(oc=e((()=>{Xe(),Y(),Qs()})))()}function sc(e,t){let n=e!==`sw.js`&&typeof document<`u`?document.documentElement.getAttribute(lt):null,r=n?`?v=${encodeURIComponent(n)}`:``;return`${be(t??``)}/${e}${r}`}function cc(e,t){return sc(e,t?.resourceBasePath??(t?.pathname===void 0?ec(typeof window>`u`?`/`:window.location.pathname)[1]:_s(t.pathname)))}function lc(){return(lc=e((()=>{We(),Y(),oc()})))()}function uc(e){return Nc.has(e)}function dc(e){return Pc.has(e)}function fc(e){return Mc.includes(e)}function pc(e){if(typeof e!=`string`)return null;if(e.startsWith(`route:`)){let t=e.slice(6);return t===`workboard`?{type:`plugin`,key:`workboard/workboard`}:fc(t)?{type:`route`,route:t}:null}if(e.startsWith(`session:`)){let t=e.slice(8).trim();return t?{type:`session`,key:t}:null}if(e.startsWith(`workboard:`)){let t=e.slice(10).trim();return Fe(t)?{type:`plugin`,key:`workboard/board-${t}`}:null}if(e.startsWith(`plugin:`)){let t=e.slice(7),n=t.indexOf(`/`);return n>0&&n<t.length-1?{type:`plugin`,key:t}:null}return null}function mc(e){return e.type===`route`?`route:${e.route}`:e.type===`plugin`?`plugin:${e.key}`:`session:${e.key}`}function hc(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=pc(n);if(!e)continue;let r=mc(e);t.includes(r)||t.push(r)}return t}function gc(e){let t=new Set(e.flatMap(e=>{let t=pc(e);return t?.type===`route`?[t.route]:[]}));return Mc.filter(e=>!t.has(e))}function _c(e,t){let n=xa.getLocale();if(Ic!==n&&(Ic=n,Lc=typeof Intl<`u`&&`Segmenter`in Intl?new Intl.Segmenter(n,{granularity:`word`}):null),!Lc)return e.split(/[^\p{L}\p{N}]+/u).some(e=>e.startsWith(t));for(let n of Lc.segment(e))if(n.isWordLike!==!1&&n.segment.startsWith(t))return!0;return!1}function vc(e,t){let n=De(e).normalize(`NFC`),r=De(t).normalize(`NFC`);return r?r.length>2?n.includes(r):_c(n,r):!1}function yc(e,t,n=null){if(e===`device`)return n!==null;if(e===`device-permissions`){let e=n?.snapshot;return!!(e&&(e.permissions.entries.length>0||e.permissions.location||e.capabilities?.activeComputerPresenceEnabled!==void 0))}return e===`updates`?t||n!==null:t||zc.has(e)}function bc(e){let t=e?.device;if(t?.platform===`macos`)return`nav.settingsGroupDevice`;if(t?.platform===`linux`||t?.platform===`windows`)return`nav.settingsGroupThisComputer`;if(t?.platform===`ios`){if(t.formFactor===`phone`)return`nav.settingsGroupThisIPhone`;if(t.formFactor===`pad`)return`nav.settingsGroupThisIPad`}return`nav.settingsGroupThisDevice`}function xc(e,t=null){return Rc.map(n=>({labelKey:n.labelKey===`nav.settingsGroupDevice`?bc(t?.snapshot):n.labelKey,routes:n.routes.filter(n=>yc(n,e,t))})).filter(e=>e.routes.length>0)}function X(e,t){return[e,`tabs.${t}`,`subtitles.${t}`]}function Sc(e){return Uc.has(e)}function Cc(e){return e!==void 0&&Sc(e)}function wc(e){return Hc[e]??e}function Tc(e){return Wc[e]?.[0]??`folder`}function Ec(e,t,n,r,i=!1,a=!1){if(i||!r)return;let o=n.currentTarget;if(!o)return;let s=()=>{e.delete(o);try{Promise.resolve(r(t)).catch(()=>void 0)}catch{}};if(a){Dc(e,n),s();return}e.has(o)||e.set(o,globalThis.setTimeout(s,50))}function Dc(e,t){let n=t.currentTarget;if(!n)return;let r=e.get(n);r!==void 0&&(globalThis.clearTimeout(r),e.delete(n))}function Oc(e){let[,t]=Wc[e];return B(t)}function kc(e){let t=e.context.endsWith(`OpenClaw`)?e.context:`${e.context} — OpenClaw`;return e.gatewayDisconnected?`(${B(`connection.disconnectedTitle`)}) ${t}`:e.attentionCount&&e.attentionCount>0?`(${e.attentionCount}) ${t}`:t}function Ac(e,t){return e===`device`&&t?B(bc(t)):e===`custodian`?B(`nav.askOpenClaw`):Oc(e)}function jc(e){let t=Wc[e][2];return B(t)}var Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc;function Gc(){return(Gc=e((()=>{at(),V(),Mc=[`agents-home`,`dashboards`,`usage`,`cron`,`sessions`,`systems`,`activity`,`meetings`,`plugins`,`apps`,`portals`],Nc=new Set([`plugins`,`skills`,`skill-workshop`]),Pc=new Set([`sessions`,`worktrees`]),Fc=[`agents-home`,`dashboards`,`systems`,`cron`,`plugins`].map(e=>mc({type:`route`,route:e})),Ic=``,Lc=null,Rc=[{labelKey:null,routes:[`custodian`,`profile`,`appearance`,`notifications`]},{labelKey:`nav.settingsGroupDevice`,routes:[`device`,`device-permissions`]},{labelKey:`nav.settingsGroupConnections`,routes:[`connection`,`channels`,`communications`,`talk`,`devices`,`cloud-workers`]},{labelKey:`nav.settingsGroupAgents`,routes:[`agents`,`model-providers`,`search`,`plugin-settings`,`skill-settings`,`mcp`,`memory`,`automation`]},{labelKey:`nav.settingsGroupSecurity`,routes:[`security`,`secrets`,`approvals`]},{labelKey:`nav.settingsGroupSystem`,routes:[`infrastructure`,`labs`,`advanced`,`debug`,`logs`,`updates`,`about`]}],zc=new Set([`profile`,`appearance`,`notifications`,`connection`,`channels`,`talk`,`devices`,`agents`,`model-providers`,`search`,`plugin-settings`,`skill-settings`,`memory`,`approvals`,`advanced`,`debug`,`logs`,`about`]),Bc=[`config`,`ai-agents`,`model-setup`,`lobsterdex`],Vc=[`ai-agents`],Hc={"ai-agents":`agents`,"model-setup":`model-providers`},Uc=new Set([...Rc.flatMap(e=>e.routes),...Bc]),Wc={settings:[`settings`,`nav.settings`,`common.settingsSections`],"agents-home":X(`bot`,`agentsHome`),agents:X(`bot`,`agents`),activity:X(`activity`,`activity`),meetings:X(`book`,`meetings`),apps:X(`layoutGrid`,`apps`),portals:X(`monitor`,`portals`),approvals:X(`badgeCheck`,`approvals`),workboard:X(`kanban`,`workboard`),worktrees:X(`folder`,`worktrees`),channels:X(`link`,`channels`),connection:X(`radio`,`connection`),sessions:X(`fileText`,`sessions`),systems:X(`monitor`,`systems`),usage:X(`coins`,`usage`),cron:X(`calendarClock`,`cron`),skills:X(`bookOpenText`,`skills`),"skill-settings":X(`bookOpenText`,`skills`),plugins:X(`plug`,`plugins`),"plugin-settings":X(`plug`,`plugins`),"skill-workshop":X(`wrench`,`skillWorkshop`),device:X(`monitor`,`device`),"device-permissions":X(`shieldCheck`,`devicePermissions`),devices:X(`monitorSmartphone`,`devices`),"cloud-workers":X(`server`,`cloudWorkers`),chat:X(`messageSquare`,`chat`),terminal:[`terminal`,`terminal.title`,`terminal.open`],dashboard:X(`layoutDashboard`,`chat`),dashboards:X(`layoutDashboard`,`dashboards`),custodian:X(`lobster`,`custodian`),config:[`settings`,`nav.settings`,`subtitles.config`],profile:X(`circleUser`,`profile`),communications:X(`send`,`communications`),appearance:X(`palette`,`appearance`),lobsterdex:X(`bug`,`lobsterdex`),automation:X(`terminal`,`automation`),mcp:X(`wrench`,`mcp`),memory:X(`book`,`memory`),search:X(`search`,`search`),talk:X(`mic`,`talk`),infrastructure:X(`globe`,`infrastructure`),labs:X(`flaskConical`,`labs`),updates:X(`download`,`updates`),about:X(`fileText`,`about`),"ai-agents":X(`brain`,`aiAgents`),"model-setup":X(`spark`,`modelSetup`),"model-providers":[`box`,`routeTitles.modelProviders`,`subtitles.modelProviders`],"memory-import":X(`download`,`memoryImport`),notifications:[`bell`,`routeTitles.notifications`,`subtitles.notifications`],security:X(`shieldCheck`,`security`),secrets:[`key`,`tabs.secrets`,`secretsStore.hint`],advanced:[`fileCode`,`routeTitles.advanced`,`subtitles.advanced`],debug:X(`bug`,`debug`),logs:X(`scrollText`,`logs`),plugin:X(`plug`,`plugin`),"new-session":[`plus`,`newSession.title`,`newSession.hint`]}})))()}function Kc(){return typeof window>`u`?void 0:window}function qc(){return(qc=e((()=>{})))()}function Jc(){let e=Kc()?.webkit?.messageHandlers?.openclawWindowDrag;return e?.postMessage.bind(e)}function Yc(e){if(e.button!==0||e.defaultPrevented)return;for(let t of e.composedPath())if(t instanceof Element&&t.matches(Zc))return;let t=Jc();if(t){try{t({type:`window-drag`})}catch{return}e.preventDefault()}}function Xc(e){if(e.target!==e.currentTarget||!(e.currentTarget instanceof HTMLElement))return;let t=Number.parseFloat(getComputedStyle(e.currentTarget).paddingTop);!Number.isFinite(t)||e.offsetY>t||Yc(e)}var Zc;function Qc(){return(Qc=e((()=>{Zc=`a, button, input, select, textarea, [role='button'], [role='tab'], [role='menu'], [role^='menuitem'], [contenteditable]`})))()}var $c;function el(){return(el=e((()=>{W(),$c=K`
    <svg viewBox="0 0 24 24" class="icon--filled" width="16" height="16" fill="currentColor" stroke="none" aria-hidden="true">
      <path
        d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.27-.01-1.17-.02-2.12-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.19 1.76 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.72-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.78 0c2.21-1.49 3.18-1.18 3.18-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.83 1.19 3.09 0 4.42-2.7 5.39-5.26 5.68.41.35.78 1.05.78 2.12 0 1.53-.01 2.76-.01 3.14 0 .3.21.67.8.55A11.5 11.5 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"
      />
    </svg>
  `})))()}function tl(e){rl=e}function nl(){return rl}var rl;function il(){return(il=e((()=>{rl={mascot:`claw`,critters:[]}})))()}function al({fill:e,glyph:t}){let n=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`"`,`&quot;`).replaceAll(`<`,`&lt;`);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${ol.viewBox}" fill="none"><rect x="${ol.inset}" y="${ol.inset}" width="${ol.size}" height="${ol.size}" rx="${ol.radius}" fill="${n(e)}"/><path d="${ol.glyph}" fill="none" stroke="${n(t)}" stroke-width="${ol.strokeWidth}" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var ol,sl;function cl(){return(cl=e((()=>{W(),il(),ol={viewBox:`0 0 120 120`,inset:8,size:104,radius:28,glyph:`M40 42L62 60L40 78M68 80H88`,strokeWidth:11},sl=K`<svg viewBox=${ol.viewBox} width="100%" height="100%" fill="none" aria-hidden="true">
  <rect
    x=${ol.inset}
    y=${ol.inset}
    width=${ol.size}
    height=${ol.size}
    rx=${ol.radius}
    style="fill: var(--primary); stroke: none"
  />
  <path
    d=${ol.glyph}
    style="fill: none; stroke: var(--primary-foreground)"
    stroke-width=${ol.strokeWidth}
    stroke-linecap="round"
    stroke-linejoin="round"
  />
</svg>`})))()}function Z(e,t){return H`
    <svg
      viewBox="0 0 24 24"
      style=${t??U}
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
    >
      ${e}
    </svg>
  `}var ll,ul;function dl(){return(dl=e((()=>{W(),cl(),ll={"⌘":K`<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />`,"⌥":K`<path d="M3 3h6l6 18h6M14 3h7" />`,"⇧":K`<path d="M9 19a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-6a1 1 0 0 1 1-1h3.293a.707.707 0 0 0 .5-1.207l-7.086-7.086a1 1 0 0 0-1.414 0l-7.086 7.086a.707.707 0 0 0 .5 1.207H8a1 1 0 0 1 1 1z" />`,"⌃":K`<path d="m18 15-6-6-6 6" />`,"⏎":K`<polyline points="9 10 4 15 9 20" /><path d="M20 4v7a4 4 0 0 1-4 4H4" />`,"↑":K`<path d="M12 19V5m-7 7 7-7 7 7" />`,"↓":K`<path d="M12 5v14m7-7-7 7-7-7" />`,"←":K`<path d="m12 19-7-7 7-7M19 12H5" />`,"→":K`<path d="M5 12h14m-7-7 7 7-7 7" />`},ul={bookOpenText:Z(K`<path d="M12 5v16M16 13h2M16 9h2" />
    <path d="M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z" />
    <path d="M6 13h2M6 9h2" />`),mark:sl,shieldCheck:Z(K`<path d="M20 13c0 5-3.5 7.5-8 9-4.5-1.5-8-4-8-9V5l8-3 8 3zM9 12l2 2 4-4" />`),shieldX:Z(K`<path d="M20 13c0 5-3.5 7.5-8 9-4.5-1.5-8-4-8-9V5l8-3 8 3zM9.5 9.5l5 5m0-5-5 5" />`),cpu:Z(K` <rect width="16" height="16" x="4" y="4" rx="2" />
    <rect width="6" height="6" x="9" y="9" rx="1" />
    <path d="M15 2v2M15 20v2M2 15h2M2 9h2M20 15h2M20 9h2M9 2v2M9 20v2" />`),foldVertical:Z(K`<path d="M12 22v-6M12 8V2M4 12H2M10 12H8M16 12h-2M22 12h-2M19 9l-3 3 3 3M5 15l3-3-3-3" />`),wrench:Z(K` <path
    d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"
  />`),fileCode:Z(K` <path
      d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"
    />
    <polyline points="14 2 14 8 20 8" />
    <path d="M10 13l-2 2 2 2M14 17l2-2-2-2" />`),edit:Z(K`<path
      d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"
    />`),home:Z(K` <path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
    <polyline points="9 22 9 12 15 12 15 22" />`),cloud:Z(K`<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" />`),penLine:Z(K`<path d="M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" />`),paperclip:Z(K` <path
    d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"
  />`),globe:Z(K` <circle cx="12" cy="12" r="10" />
    <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" />
    <path d="M2 12h20" />`),image:Z(K` <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />
    <circle cx="9" cy="9" r="2" />
    <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />`),copyImage:Z(K` <rect width="14" height="14" x="8" y="8" rx="2" />
    <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
    <circle cx="13" cy="13" r="1" />
    <path d="m21 18-3-3-5 5" />`),camera:Z(K` <path
      d="M14.5 4 16 7h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3l1.5-3z"
    />
    <circle cx="12" cy="13" r="3" />`),cameraOff:Z(K`<path
      d="M14.564 14.558a3 3 0 1 1-4.122-4.121M2 2l20 20M20 20H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 .819-.175M9.695 4.024A2 2 0 0 1 10.004 4h3.993a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v7.344"
    />`),smartphone:Z(K` <rect width="14" height="20" x="5" y="2" rx="2" ry="2" />
    <path d="M12 18h.01" />`),circleQuestionMark:Z(K` <circle cx="12" cy="12" r="10" />
    <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01" />`),plug:Z(K`<path d="M12 22v-5M9 8V2M15 8V2M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z" />`),circle:Z(K`<circle cx="12" cy="12" r="10" />`),puzzle:Z(K` <path
    d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.076.874.54 1.02 1.02a2.5 2.5 0 1 0 3.237-3.237c-.48-.146-.944-.505-1.02-1.02a.98.98 0 0 1 .303-.917l1.526-1.526A2.402 2.402 0 0 1 11.998 2c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.236 3.236c-.464.18-.894.527-.967 1.02Z"
  />`),panelLeft:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M9 3v18" />`),panelLeftClose:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M9 3v18M16 10l-3 2 3 2" />`),panelLeftOpen:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M9 3v18M14 10l3 2-3 2" />`),chevronDown:Z(K`<path d="M6 9l6 6 6-6" />`),chevronRight:Z(K`<path d="M9 18l6-6-6-6" />`),chevronLeft:Z(K`<path d="M15 18l-6-6 6-6" />`),externalLink:Z(K`<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3" />`),send:Z(K`<path d="m22 2-7 20-4-9-9-4ZM22 2 11 13" />`),forward:Z(K`<path d="m15 17 5-5-5-5M4 18v-2a4 4 0 0 1 4-4h12" />`),stop:Z(K`<rect width="14" height="14" x="5" y="5" rx="1" />`),pin:Z(K` <line x1="12" x2="12" y1="17" y2="22" />
    <path
      d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"
    />`),pinOff:Z(K` <line x1="2" x2="22" y1="2" y2="22" />
    <line x1="12" x2="12" y1="17" y2="22" />
    <path
      d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0-.39.04"
    />`),download:Z(K` <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
    <polyline points="7 10 12 15 17 10" />
    <line x1="12" x2="12" y1="15" y2="3" />`),mic:Z(K`<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3ZM19 10v2a7 7 0 0 1-14 0v-2M12 19v3" />`),volume2:Z(K` <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" />
    <path d="M15.54 8.46a5 5 0 0 1 0 7.07M19.07 4.93a10 10 0 0 1 0 14.14" />`),volumeX:Z(K` <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" />
    <path d="m22 9-6 6" />
    <path d="m16 9 6 6" />`),bookmark:Z(K`<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z" />`),plus:Z(K`<path d="M5 12h14M12 5v14" />`),gitBranch:Z(K` <circle cx="6" cy="5" r="2" />
    <circle cx="18" cy="6" r="2" />
    <circle cx="6" cy="19" r="2" />
    <path d="M6 7v10M8 9h5a5 5 0 0 0 5-5" />`),gitFork:Z(K` <circle cx="6" cy="6" r="3" />
    <circle cx="18" cy="6" r="3" />
    <circle cx="12" cy="18" r="3" />
    <path d="M6 9a6 6 0 0 0 6 6M18 9a6 6 0 0 1-6 6" />`),gitPullRequest:Z(K` <circle cx="6" cy="6" r="3" />
    <circle cx="18" cy="18" r="3" />
    <path d="M13 6h3a2 2 0 0 1 2 2v7M6 9v12" />`),gitPullRequestDraft:Z(K` <circle cx="6" cy="6" r="3" />
    <circle cx="18" cy="18" r="3" />
    <path d="M6 9v12" />
    <path d="M18 6v.01" />
    <path d="M18 11v.01" />`),gitPullRequestClosed:Z(K` <circle cx="6" cy="6" r="3" />
    <path d="M6 9v12" />
    <path d="m15 9 6 6" />
    <path d="m21 9-6 6" />`),gitMerge:Z(K` <circle cx="6" cy="6" r="3" />
    <circle cx="18" cy="18" r="3" />
    <path d="M6 21V9a9 9 0 0 0 9 9" />`),terminal:Z(K` <polyline points="4 17 10 11 4 5" />
    <line x1="12" x2="20" y1="19" y2="19" />`),squareTerminal:Z(K` <path d="m7 11 2-2-2-2M11 13h4" />
    <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />`),listTree:Z(K`<path d="M21 12h-8M21 6H8M21 18h-8M3 6v4c0 1.1.9 2 2 2h3M3 10v6c0 1.1.9 2 2 2h3" />`),claw:Z(K` <path
      d="M8.2 10 A5.2 5.2 0 1 0 8.2 20.4 A5.2 5.2 0 0 0 8.2 10 Z M10.2 20 C14.5 20.8 19 18.6 22.3 13.2 C21 12.9 19.7 12.7 18.4 12.8 L17.5 14.6 L16 12.9 L14.3 14.5 L13.5 13 L11.5 14.2 Z"
    />
    <path
      class="claw-icon__jaw"
      d="M5.6 12.2 C5.2 5.6 10.4 1.4 15.6 2 C19.4 2.6 21.8 5.2 22.6 8.2 C20.9 7.7 19.2 7.6 17.6 7.9 L16.9 6.3 L15.2 8.5 C13.6 9.4 12.2 10.9 11.6 12.4 L6.8 13 Z"
    />`),spark:Z(K` <path
    d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"
  />`),lobster:H`
    <svg viewBox="0 0 120 120" fill="none">
      <defs>
        <linearGradient id="lob-g" x1="0%" y1="0%" x2="100%" y2="100%">
          <stop offset="0%" style="stop-color: var(--lobster-icon-body, #ff4d4d)" />
          <stop offset="100%" style="stop-color: var(--lobster-icon-shade, #991b1b)" />
        </linearGradient>
      </defs>
      <path
        d="M60 10C30 10 15 35 15 55C15 75 30 95 45 100L45 110L55 110L55 100C55 100 60 102 65 100L65 110L75 110L75 100C90 95 105 75 105 55C105 35 90 10 60 10Z"
        fill="url(#lob-g)"
      />
      <path d="M20 45C5 40 0 50 5 60C10 70 20 65 25 55C28 48 25 45 20 45Z" fill="url(#lob-g)" />
      <path
        d="M100 45C115 40 120 50 115 60C110 70 100 65 95 55C92 48 95 45 100 45Z"
        fill="url(#lob-g)"
      />
      <path
        d="M45 15Q35 5 30 8"
        style="stroke: var(--lobster-icon-body, #ff4d4d)"
        stroke-width="3"
        stroke-linecap="round"
      />
      <path
        d="M75 15Q85 5 90 8"
        style="stroke: var(--lobster-icon-body, #ff4d4d)"
        stroke-width="3"
        stroke-linecap="round"
      />
      <circle cx="45" cy="35" r="6" style="fill: var(--lobster-icon-eye, #050810)" />
      <circle cx="75" cy="35" r="6" style="fill: var(--lobster-icon-eye, #050810)" />
      <circle cx="46" cy="34" r="2.5" fill="#00e5cc" />
      <circle cx="76" cy="34" r="2.5" fill="#00e5cc" />
    </svg>
  `,circleUser:Z(K` <path d="M18 20a6 6 0 0 0-12 0" />
    <circle cx="12" cy="10" r="4" />
    <circle cx="12" cy="12" r="10" />`),bell:Z(K`<path
      d="M10.268 21a2 2 0 0 0 3.464 0M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"
    />`),palette:Z(K` <path
      d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"
    />
    <circle cx="13.5" cy="6.5" r=".5" fill="currentColor" />
    <circle cx="17.5" cy="10.5" r=".5" fill="currentColor" />
    <circle cx="6.5" cy="12.5" r=".5" fill="currentColor" />
    <circle cx="8.5" cy="7.5" r=".5" fill="currentColor" />`),flaskConical:Z(K`<path
      d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2M6.453 15h11.094M8.5 2h7"
    />`),badgeCheck:Z(K` <path
      d="M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"
    />
    <path d="m9 12 2 2 4-4" />`),refresh:Z(K`<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8M21 3v5h-5" />`),rotateCcw:Z(K`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8M3 3v5h5" />`),trash:Z(K`<path
      d="M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2M10 11v6M14 11v6"
    />`),eye:Z(K` <path
      d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
    />
    <circle cx="12" cy="12" r="3" />`),eyeOff:Z(K`<path
      d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49M14.084 14.158a3 3 0 0 1-4.242-4.242M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143M2 2l20 20"
    />`),arrowUpDown:Z(K`<path d="M21 16l-4 4-4-4M17 20V4M3 8l4-4 4 4M7 4v16" />`),panelRightOpen:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M15 3v18M10 10l-3 2 3 2" />`),panelRightClose:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M15 3v18M8 10l3 2-3 2" />`),columns2:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M12 3v18" />`),panelBottomOpen:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M3 15h18M10 8l2 3 2-3" />`),panelBottomClose:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" />
    <path d="M3 15h18M10 11l2-3 2 3" />`),maximize:Z(K` <polyline points="15 3 21 3 21 9" />
    <polyline points="9 21 3 21 3 15" />
    <line x1="21" x2="14" y1="3" y2="10" />
    <line x1="3" x2="10" y1="21" y2="14" />`),minimize:Z(K` <polyline points="4 14 10 14 10 20" />
    <polyline points="20 10 14 10 14 4" />
    <line x1="14" x2="21" y1="10" y2="3" />
    <line x1="3" x2="10" y1="21" y2="14" />`)}})))()}function fl(e){return pl[e]}var pl;function ml(){return(ml=e((()=>{W(),el(),dl(),pl={github:$c,repeat:Z(K`<path d="m17 2 4 4-4 4"/><path d="M3 11V9a3 3 0 0 1 3-3h15M7 22l-4-4 4-4"/><path d="M21 13v2a3 3 0 0 1-3 3H3"/>`),layers:Z(K`<path d="m12 3 10 5-10 5L2 8Z"/><path d="m2 12 10 5 10-5M2 16l10 5 10-5"/>`),messageCircle:Z(K`<path
    d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"
  />`),messageSquare:Z(K` <path
    d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"
  />`),messageSquarePlus:Z(K` <path
      d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"
    />
    <path d="M12 7v6" />
    <path d="M9 10h6" />`),messageCircleOff:Z(K` <path d="m2 2 20 20" />
    <path
      d="M4.93 4.929a10 10 0 0 0-1.938 11.412 2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 0 0 11.302-1.989"
    />
    <path d="M8.35 2.69A10 10 0 0 1 21.3 15.65" />`),layoutGrid:Z(K` <rect width="7" height="7" x="3" y="3" rx="1" />
    <rect width="7" height="7" x="14" y="3" rx="1" />
    <rect width="7" height="7" x="14" y="14" rx="1" />
    <rect width="7" height="7" x="3" y="14" rx="1" />`),barChart:Z(K` <line x1="12" x2="12" y1="20" y2="10" />
    <line x1="18" x2="18" y1="20" y2="4" />
    <line x1="6" x2="6" y1="20" y2="16" />`),layoutDashboard:Z(K` <rect width="7" height="9" x="3" y="3" rx="1" />
    <rect width="7" height="5" x="14" y="3" rx="1" />
    <rect width="7" height="9" x="14" y="12" rx="1" />
    <rect width="7" height="5" x="3" y="16" rx="1" />`),coins:Z(K` <circle cx="8" cy="8" r="6" />
    <path d="M18.09 10.37A6 6 0 1 1 10.34 18" />
    <path d="M7 6h1v4" />
    <path d="m16.71 13.88.7.71-2.82 2.82" />`),activity:Z(K` <path d="M22 12h-4l-3 9L9 3l-3 9H2" />`),clock:Z(K` <circle cx="12" cy="12" r="10" />
    <polyline points="12 6 12 12 16 14" />`),circleX:Z(K` <circle cx="12" cy="12" r="10" />
    <path d="m15 9-6 6" />
    <path d="m9 9 6 6" />`),arrowLeftRight:Z(K`<path d="m8 3-4 4 4 4" />
    <path d="M4 7h16" />
    <path d="m16 21 4-4-4-4" />
    <path d="M20 17H4" />`),arrowUpRight:Z(K` <path d="M7 17 17 7" />
    <path d="M7 7h10v10" />`),link:Z(K` <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
    <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />`),radio:Z(K` <circle cx="12" cy="12" r="2" />
    <path
      d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"
    />`),fileText:Z(K` <path
      d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"
    />
    <polyline points="14 2 14 8 20 8" />
    <line x1="16" x2="8" y1="13" y2="13" />
    <line x1="16" x2="8" y1="17" y2="17" />
    <line x1="10" x2="8" y1="9" y2="9" />`),file:Z(K` <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
    <polyline points="14 2 14 8 20 8" />`),fileDiff:Z(K` <path
      d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.7.71l3.59 3.58A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"
    />
    <path d="M9 10h6" />
    <path d="M12 13V7" />
    <path d="M9 17h6" />`),diff:Z(K` <path d="M12 3v14" />
    <path d="M5 10h14" />
    <path d="M5 21h14" />`),braces:Z(K` <path
      d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"
    />
    <path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1" />`),mail:Z(K` <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" />
    <polyline points="22,6 12,13 2,6" />`),outbox:Z(K` <polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
    <path d="M2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6" />
    <path d="M12 10V3" />
    <path d="m8 6 4-4 4 4" />`),inbox:Z(K` <polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
    <path d="m5.45 5.11-3.45 6.89v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89a2 2 0 0 0-1.79-1.11h-9.52a2 2 0 0 0-1.79 1.11z" />`),star:Z(K`<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />`),wandSparkles:Z(K` <path d="M15 4V2" />
    <path d="M15 16v-2" />
    <path d="M8 9h2" />
    <path d="M20 9h2" />
    <path d="M17.8 11.8 19 13" />
    <path d="M15 9h0" />
    <path d="M17.8 6.2 19 5" />
    <path d="m3 21 9-9" />
    <path d="M12.2 6.2 11 5" />`),chrome:Z(K` <circle cx="12" cy="12" r="10" />
    <circle cx="12" cy="12" r="4" />
    <line x1="21.17" y1="8" x2="12" y2="8" />
    <line x1="3.95" y1="6.06" x2="8.54" y2="14" />
    <line x1="10.88" y1="21.94" x2="15.46" y2="14" />`),panelsTopLeft:Z(K` <rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
    <line x1="3" y1="9" x2="21" y2="9" />
    <line x1="9" y1="21" x2="9" y2="9" />`),box:Z(K` <path
      d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"
    />
    <polyline points="3.27 6.96 12 12.01 20.73 6.96" />
    <line x1="12" y1="22.08" x2="12" y2="12" />`),music:Z(K` <path d="M9 18V5l12-2v13" />
    <circle cx="6" cy="18" r="3" />
    <circle cx="18" cy="16" r="3" />`),asterisk:Z(K` <path d="M12 2v6" />
    <path d="m4.93 10.93 4.24 4.24" />
    <path d="M2 12h6" />
    <path d="m4.93 13.07 4.24-4.24" />
    <path d="M12 22v-6" />
    <path d="m19.07 13.07-4.24-4.24" />
    <path d="M22 12h-6" />
    <path d="m19.07 10.93-4.24 4.24" />`),zap:Z(K`<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />`),monitor:Z(K` <rect width="20" height="14" x="2" y="3" rx="2" />
    <line x1="8" x2="16" y1="21" y2="21" />
    <line x1="12" x2="12" y1="17" y2="21" />`),monitorSmartphone:Z(K` <path
      d="M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"
    />
    <path d="M10 19v-3.96 3.15" />
    <path d="M7 19h5" />
    <rect width="6" height="10" x="16" y="12" rx="2" />`),server:Z(K` <rect width="20" height="8" x="2" y="2" rx="2" ry="2" />
    <rect width="20" height="8" x="2" y="14" rx="2" ry="2" />
    <line x1="6" x2="6.01" y1="6" y2="6" />
    <line x1="6" x2="6.01" y1="18" y2="18" />`),sun:Z(K` <circle cx="12" cy="12" r="4" />
    <path d="M12 2v2" />
    <path d="M12 20v2" />
    <path d="m4.93 4.93 1.41 1.41" />
    <path d="m17.66 17.66 1.41 1.41" />
    <path d="M2 12h2" />
    <path d="M20 12h2" />
    <path d="m6.34 17.66-1.41 1.41" />
    <path d="m19.07 4.93-1.41 1.41" />`),moon:Z(K` <path d="M12 3a6.5 6.5 0 0 0 9 9 9 9 0 1 1-9-9Z" />`),settings:Z(K` <path
      d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
    />
    <circle cx="12" cy="12" r="3" />`),bug:Z(K` <path d="m8 2 1.88 1.88" />
    <path d="M14.12 3.88 16 2" />
    <path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" />
    <path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6" />
    <path d="M12 20v-9" />
    <path d="M6.53 9C4.6 8.8 3 7.1 3 5" />
    <path d="M6 13H2" />
    <path d="M3 21c0-2.1 1.7-3.9 3.8-4" />
    <path d="M20.97 5c0 2.1-1.6 3.8-3.5 4" />
    <path d="M22 13h-4" />
    <path d="M17.2 17c2.1.1 3.8 1.9 3.8 4" />`),scrollText:Z(K` <path
      d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4"
    />
    <path d="M19 17V5a2 2 0 0 0-2-2H4" />
    <path d="M15 8h-5" />
    <path d="M15 12h-5" />`),folder:Z(K` <path
    d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
  />`),kanban:Z(K` <rect width="18" height="18" x="3" y="3" rx="2" />
    <path d="M8 7v7" />
    <path d="M12 7v4" />
    <path d="M16 7v9" />`),bot:Z(K` <path d="M12 8V4H8" />
    <rect width="16" height="12" x="4" y="8" rx="2" />
    <path d="M2 14h2" />
    <path d="M20 14h2" />
    <path d="M15 13v2" />
    <path d="M9 13v2" />`),users:Z(K` <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
    <circle cx="9" cy="7" r="4" />
    <path d="M22 21v-2a4 4 0 0 0-3-3.87" />
    <path d="M16 3.13a4 4 0 0 1 0 7.75" />`),shieldQuestion:Z(K` <path
      d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
    />
    <path d="M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3" />
    <path d="M12 17h.01" />`),shield:Z(K` <path
      d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
    />`),shieldEllipsis:Z(K` <path
      d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
    />
    <path d="M8 12h.01" /><path d="M12 12h.01" /><path d="M16 12h.01" />`),shieldLock:Z(K` <path
      d="M20 9.807V6a1 1 0 0 0-1-1c-2 0-4.49-1.19-6.24-2.72a1.17 1.17 0 0 0-1.52 0C9.5 3.8 7 5 5 5a1 1 0 0 0-1 1v7c0 3.88 2.107 6.254 5 7.796"
    />
    <path d="M19 17v-2a2 2 0 0 0-4 0v2" />
    <rect x="13" y="17" width="8" height="5" rx="1" />`),shieldCog:Z(K` <path d="m10.929 14.467-.383.924" />
    <path d="M10.929 8.923 10.546 8" />
    <path d="M13.225 8.923 13.608 8" />
    <path d="m13.607 15.391-.382-.924" />
    <path d="m14.849 10.547.923-.383" />
    <path d="m14.849 12.843.923.383" />
    <path
      d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
    />
    <path d="m9.305 10.547-.923-.383" />
    <path d="m9.305 12.843-.923.383" />
    <circle cx="12.077" cy="11.695" r="3" />`),shieldAlert:Z(K` <path
      d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
    />
    <path d="M12 8v4" />
    <path d="M12 16h.01" />`),menu:Z(K` <line x1="4" x2="20" y1="12" y2="12" />
    <line x1="4" x2="20" y1="6" y2="6" />
    <line x1="4" x2="20" y1="18" y2="18" />`),x:Z(K` <path d="M18 6 6 18" />
    <path d="m6 6 12 12" />`),check:Z(K`<path d="M20 6 9 17l-5-5" />`),info:Z(K`<circle cx="12" cy="12" r="10" /><path d="M12 16v-4" /><path d="M12 8h.01" />`),square:Z(K`<rect width="18" height="18" x="3" y="3" rx="2" />`),play:Z(K`<polygon points="6 3 20 12 6 21 6 3" />`),pause:Z(K` <rect x="14" y="4" width="4" height="16" rx="1" />
    <rect x="6" y="4" width="4" height="16" rx="1" />`),target:Z(K` <circle cx="12" cy="12" r="10" />
    <circle cx="12" cy="12" r="6" />
    <circle cx="12" cy="12" r="2" />`),switchCamera:Z(K` <path d="M11 19H6.5a4.5 4.5 0 0 1 0-9H8" />
    <path d="m8 16 3 3-3 3" />
    <path d="M13 5h4.5a4.5 4.5 0 0 1 0 9H16" />
    <path d="m16 8-3-3 3-3" />`),archive:Z(K` <rect width="20" height="5" x="2" y="3" rx="1" />
    <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" />
    <path d="M10 12h4" />`),archiveRestore:Z(K` <rect width="20" height="5" x="2" y="3" rx="1" />
    <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" />
    <path d="m9 15 3-3 3 3" />
    <path d="M12 12v6" />`),alertTriangle:Z(K` <path
      d="m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
    />
    <path d="M12 9v4" />
    <path d="M12 17h.01" />`),globeOff:Z(K` <path
      d="M10.114 4.462A14.5 14.5 0 0 1 12 2a10 10 0 0 1 9.313 13.643"
    />
    <path d="M15.557 15.556A14.5 14.5 0 0 1 12 22 10 10 0 0 1 4.929 4.929" />
    <path d="M15.892 10.234A14.5 14.5 0 0 0 12 2a10 10 0 0 0-3.643.687" />
    <path d="M17.656 12H22" />
    <path d="M19.071 19.071A10 10 0 0 1 12 22 14.5 14.5 0 0 1 8.44 8.45" />
    <path d="M2 12h10" />
    <path d="m2 2 20 20" />`),hand:Z(K` <path d="M18 11V6a2 2 0 0 0-4 0v5" />
    <path d="M14 10V4a2 2 0 0 0-4 0v6" />
    <path d="M10 10.5V6a2 2 0 0 0-4 0v8" />
    <path d="M6 14v-2a2 2 0 0 0-4 0v4c0 4.4 3.6 8 8 8h2c4.4 0 8-3.6 8-8v-5a2 2 0 0 0-4 0v2" />`),key:Z(K` <circle cx="7.5" cy="15.5" r="5.5" />
    <path d="m21 2-9.6 9.6" />
    <path d="m15.5 7.5 3 3L22 7l-3-3" />`),flag:Z(K` <path d="M5 22V4" />
    <path d="M5 4c5-4 9 4 14 0v11c-5 4-9-4-14 0" />`),lock:Z(K` <rect width="18" height="11" x="3" y="11" rx="2" />
    <path d="M7 11V7a5 5 0 0 1 10 0v4" />`),pencil:Z(K` <path
      d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"
    />
    <path d="m15 5 4 4" />`),pipette:Z(K` <path
      d="m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12"
    />
    <path
      d="m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z"
    />
    <path d="m2 22 .414-.414" />`),pencilSparkles:Z(K` <path d="M10 3H8" />
    <path d="m15.007 5.008 3.987 3.986" />
    <path d="M20 15v4" />
    <path
      d="M21.174 6.813a2.82 2.82 0 0 0-3.986-3.987L3.842 16.175a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"
    />
    <path d="M22 17h-4" />
    <path d="M4 5v4" />
    <path d="M6 7H2" />
    <path d="M9 2v2" />`),layoutComfortable:Z(K` <rect width="16" height="5" x="4" y="4" rx="1.5" />
    <rect width="16" height="5" x="4" y="15" rx="1.5" />
    <line x1="7" x2="16" y1="7" y2="7" />
    <line x1="7" x2="16" y1="18" y2="18" />`),layoutCompact:Z(K` <rect width="16" height="3" x="4" y="4" rx="1" />
    <rect width="16" height="3" x="4" y="9" rx="1" />
    <rect width="16" height="3" x="4" y="14" rx="1" />
    <rect width="16" height="3" x="4" y="19" rx="1" />`),listFilter:Z(K` <path d="M3 6h18" />
    <path d="M7 12h10" />
    <path d="M10 18h4" />`),gripVertical:Z(K` <circle cx="9" cy="6" r="1.1" fill="currentColor" stroke="none" />
    <circle cx="9" cy="12" r="1.1" fill="currentColor" stroke="none" />
    <circle cx="9" cy="18" r="1.1" fill="currentColor" stroke="none" />
    <circle cx="15" cy="6" r="1.1" fill="currentColor" stroke="none" />
    <circle cx="15" cy="12" r="1.1" fill="currentColor" stroke="none" />
    <circle cx="15" cy="18" r="1.1" fill="currentColor" stroke="none" />`),arrowDown:Z(ll[`↓`]),arrowUp:Z(ll[`↑`]),audioLines:Z(K`<path d="M2 10v3" />
    <path d="M6 6v11" />
    <path d="M10 3v18" />
    <path d="M14 8v7" />
    <path d="M18 5v13" />
    <path d="M22 10v3" />`),chevronUp:Z(ll[`⌃`]),chevronsUpDown:Z(K`<path d="m7 15 5 5 5-5" />
    <path d="m7 9 5-5 5 5" />`),arrowRight:Z(ll[`→`]),arrowLeft:Z(ll[`←`]),cornerDownLeft:Z(ll[`⏎`]),cornerDownRight:Z(K` <polyline points="15 10 20 15 15 20" />
    <path d="M4 4v7a4 4 0 0 0 4 4h12" />`),copy:Z(K` <rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
    <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`),search:Z(K` <circle cx="11" cy="11" r="8" />
    <path d="m21 21-4.3-4.3" />`),wrapText:Z(K` <path d="M3 6h18" />
    <path d="M3 12h15a3 3 0 1 1 0 6h-4" />
    <path d="m16 16-2 2 2 2" />
    <path d="M3 18h7" />`),brain:Z(K` <path
      d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"
    />
    <path
      d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"
    />
    <path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4" />
    <path d="M17.599 6.5a3 3 0 0 0 .399-1.375" />
    <path d="M6.003 5.125A3 3 0 0 0 6.401 6.5" />
    <path d="M3.477 10.896a4 4 0 0 1 .585-.396" />
    <path d="M19.938 10.5a4 4 0 0 1 .585.396" />
    <path d="M6 18a4 4 0 0 1-1.967-.516" />
    <path d="M19.967 17.484A4 4 0 0 1 18 18" />`),book:Z(K` <path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20" />`),loader:Z(K` <path d="M12 2v4" />
    <path d="m16.2 7.8 2.9-2.9" />
    <path d="M18 12h4" />
    <path d="m16.2 16.2 2.9 2.9" />
    <path d="M12 18v4" />
    <path d="m4.9 19.1 2.9-2.9" />
    <path d="M2 12h4" />
    <path d="m4.9 4.9 2.9 2.9" />`),calendarClock:Z(K` <path
      d="M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"
    />
    <path d="M16 2v4" />
    <path d="M8 2v4" />
    <path d="M3 10h5" />
    <path d="M17.5 17.5 16 16.3V14" />
    <circle cx="16" cy="16" r="6" />`),listChecks:Z(K` <path d="m3 17 2 2 4-4" />
    <path d="m3 7 2 2 4-4" />
    <path d="M13 6h8" />
    <path d="M13 12h8" />
    <path d="M13 18h8" />`),moreHorizontal:Z(K` <circle cx="5" cy="12" r="1" />
    <circle cx="12" cy="12" r="1" />
    <circle cx="19" cy="12" r="1" />`),...ul}})))()}function hl(e){return Object.hasOwn(ll,e)}function gl(e){let t=e===`↵`?`⏎`:e;return hl(t)?H`<span
        class="kbd__symbol"
        style="position:relative;display:inline-block;width:1em;height:1em"
        ><span
          style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap"
          >${e}</span
        ><span aria-hidden="true" style="position:absolute;inset:0;display:flex;align-items:center"
          >${Z(ll[t],`width:1em;height:1em;stroke-width:2.3`)}</span
        ></span
      >`:H`<span class="kbd__text">${e}</span>`}function _l(e,t={}){let n=typeof e==`string`||typeof e==`number`?[String(e)]:e;return H`<kbd
    class=${`shortcut-kbd${t.className?` ${t.className}`:``}`}
    style=${t.inline?`font:inherit`:U}
    slot=${t.slot??U}
    aria-hidden=${t.ariaHidden?`true`:U}
    ?hidden=${t.hidden}
    ${t.ref?Co(t.ref):U}
    >${n.map(gl)}</kbd
  >`}function vl(e,t={}){let n=t.applePlatform??Ja(),r=Dt(e,n);return t.separateKeys?H`${r.map(e=>_l(e,t))}`:_l(n?r:r.flatMap((e,t)=>t===0?[e]:[`+`,e]),t)}function yl(e,t){return H`${e}${` (`}${vl(t,{inline:!0})})`}function bl(e,t){return H`${e.split(`{shortcut}`).map((e,n)=>n===0?e:H`${t}${e}`)}`}function xl(){return(xl=e((()=>{W(),To(),fi(),dl()})))()}function Sl(e){return w(e)&&e.type===`sw-updated`&&typeof e.version==`string`&&e.version!==wl.buildId}function Cl(e){if(e.controlUiBuildSource===`configured`)return!1;let t=wl.buildId?.trim(),n=e.buildId?.trim();if(t&&t!==`dev`&&n)return t!==n;let r=wl.version?.trim(),i=e.version?.trim();return!!(r&&i&&r!==i)}var wl;function Tl(){return(Tl=e((()=>{wl={version:`2026.9.33`,commit:`5873f8174e0b2866a2b8bc0dbf4c4c8164d8dc82`,builtAt:`2026-10-15T06:48:07.653Z`,release:!0,commitAt:`2026-10-15T02:30:22.000Z`,branch:`release-ci/5873f8174e0b-1792046388156`,dirty:!0,buildId:`2026.9.33-release-5873f8174e0b-2026-10-15T06-48-07.653Z`}})))()}function El(e,t){let n={canReload:e,onBlocked:t};return Ol.add(n),()=>void Ol.delete(n)}function Dl(e=!1){let t=[...Ol].find(e=>!e.canReload());return t&&e&&t.onBlocked(),!t}var Ol;function kl(){return(kl=e((()=>{Ol=new Set})))()}function Al(e){return e instanceof Error&&Ul.test(e.message)}function jl(e=new URL(window.location.href)){e.searchParams.set(`openclaw_mount_recovery`,String(Date.now())),window.location.replace(e.href)}function Ml(){if(Kl)return Kl;let e=(async()=>{let e=new AbortController,t=setTimeout(()=>e.abort(),Hl);try{let t=new URL(window.location.href),[n,r]=ec(t.pathname);return t.pathname=`${r}/index.html`,t.search=``,t.hash=``,(await fetch(t.href,{method:`HEAD`,cache:`no-store`,signal:e.signal})).ok}catch{return!1}finally{clearTimeout(t)}})().finally(()=>{Kl===e&&(Kl=null)});return Kl=e,e}function Nl(e,t){if(!e)return!1;try{return e.setItem(Bl,t),!0}catch{return!1}}async function Pl(e={}){if(e.canReload?.()===!1||!Dl())return!1;let t=e.storage===void 0?Ut():e.storage,n=e.buildId??wl.buildId;try{if(t?.getItem(Bl)===n)return!1}catch{}let r=e.now?.()??Date.now(),i=t??Gl,a=Wl.get(i)??[new Map,n],o=a[0],s=a[1];if(e.buildId===void 0&&s!==null&&s!==n&&(o.get(s)?.active??0)>0)return!1;for(let[e,t]of o)t.active===0&&r-t.attemptedAt>=Vl&&o.delete(e);let c=o.get(n);if(c&&(c.active===0||a[1]!==n))return!1;let l=c??{attemptedAt:r,active:0};l.active+=1,o.set(n,l),a[1]=n,Wl.set(i,a);try{if(!await Il({timeoutMs:e.buildId===void 0?0:void 0},()=>e.canReload?.()!==!1&&Dl()&&a[1]===n))return!1}finally{--l.active,l.attemptedAt=e.now?.()??Date.now()}let u=e.reload??jl;return!Dl()||e.canReload?.()===!1||a[1]!==n||!Nl(t,n)?!1:(a[1]=null,u(),!0)}async function Fl(e,t){let n,r=new Promise(e=>{n=setTimeout(()=>e(!1),t)});try{return await Promise.race([e(),r])}finally{clearTimeout(n)}}async function Il(e,t){let n=e.now??Date.now,r=e.probe??Ml,i=e.wait??(e=>new Promise(t=>{setTimeout(t,e)})),a=e.intervalMs??Jl,o=n()+(e.timeoutMs??ql);for(let e=0;;e+=1){if(!t())return!1;let s=o-n();if(e>0&&s<=0)return!1;let c=await Fl(r,s>0?s:Hl);if(!t())return!1;if(c)return!0;let l=o-n();if(l<=0)return!1;await i(Math.min(a,l))}}async function Ll(e={}){if(!await Il(e,()=>e.canReload?.()!==!1&&Dl(!0))||e.canReload?.()===!1||!Dl(!0))return!1;let t=e.storage===void 0?Ut():e.storage,n=t??Gl,r=e.reload??jl,i=Wl.get(n)??[new Map,wl.buildId];Wl.set(n,i);let a=i[1];return a!==null&&(i[1]=null,Nl(t,a),r(),!0)}function Rl(e=Pl){let t=t=>{let n=t.payload;Al(n)&&e()};return window.addEventListener(`vite:preloadError`,t),()=>window.removeEventListener(`vite:preloadError`,t)}function zl(e={}){let t=e.isCssApplied??(()=>getComputedStyle(document.documentElement).getPropertyValue(`--openclaw-css-ok`).trim()===`1`),n=e.schedule??Pl,r=e.retry??(()=>Ll({timeoutMs:0})),i=!1,a=!1,o=null,s=()=>{window.removeEventListener(`load`,u),window.removeEventListener(`error`,d,!0)},c=()=>{if(a||o)return;o=document.createElement(`div`),o.role=`alert`,o.style.cssText=`position:fixed;inset:0 0 auto;z-index:2147483647;padding:12px;text-align:center;background:#1f2937;color:#fff;font:14px system-ui`;let e=document.createElement(`button`);e.textContent=B(`common.reload`),e.addEventListener(`click`,()=>void r()),o.append(B(`lazyView.stylesFailed`),` `,e),document.body.append(o)},l=async()=>{i||a||(i=!0,s(),await n()||c())};function u(){if(t()){s();return}l()}function d(e){let t=e.target;t instanceof HTMLLinkElement&&t.relList.contains(`stylesheet`)&&l()}return window.addEventListener(`error`,d,!0),document.readyState===`complete`?u():window.addEventListener(`load`,u,{once:!0}),()=>{a=!0,s(),o?.remove(),o=null}}var Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl;function Yl(){return(Yl=e((()=>{Tl(),V(),oc(),kl(),Bl=`openclaw.controlUi.staleChunkReloadBuildId`,Vl=5e3,Hl=3e3,Ul=/importing a module script failed|failed to fetch dynamically imported module|error loading dynamically imported module|unable to preload css/i,Wl=new WeakMap,Gl={},Kl=null,ql=3e4,Jl=1e3})))()}function Xl(e,t){if(customElements.get(e))return Promise.resolve();let n=Ql.get(e);if(n)return n;let r=Promise.resolve().then(t).then(()=>{if(!customElements.get(e))throw Error(`Custom element module did not define ${e}`)}).finally(()=>{Ql.delete(e)});return Ql.set(e,r),r}function Zl(e){return customElements.get(e.tagName)!==void 0}var Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu;function xu(){return(xu=e((()=>{V(),Yl(),a(),Ql=new Map,$l=class{constructor(e,t,n=e=>Ll({canReload:e})){this.host=e,this.onClose=t,this.retryStale=n,this.preloads=new Set,this.activeDismissed=!1}get visibleState(){return this.current}preload(e,t){Zl(e)||this.preloads.has(e.tagName)||(this.preloads.add(e.tagName),Xl(e.tagName,e.loadModule).then(()=>this.host.requestUpdate(),n=>{t?.reportError&&!this.current&&(this.current={element:e,error:n,stale:Al(n),status:`error`},this.host.requestUpdate())}).finally(()=>this.preloads.delete(e.tagName)))}request(e,t){let n={action:t,element:e,status:`loading`};this.current=n,this.host.requestUpdate(),this.load(n)}requestWhileActive(e,t){t?this.active!==e&&(this.active=e,this.activeDismissed=!1):this.active===e&&(this.active=void 0,this.activeDismissed=!1),!t&&this.current?.element===e?this.abandon():this.pumpActive()}retry(){let e=this.current;if(e?.status!==`error`)return;let t={action:e.action,element:e.element,status:`loading`};this.current=t,this.host.requestUpdate(),(e.stale?this.retryStale(()=>this.current===t):Promise.resolve(!1)).then(e=>{!e&&this.current===t&&this.load(t)})}close(){this.current&&(this.current.element===this.active&&(this.activeDismissed=!0),this.onClose?.(),this.abandon())}abandon(){this.current&&(this.current=void 0,this.host.requestUpdate(),this.pumpActive())}pumpActive(){this.active&&!this.activeDismissed&&!this.current&&!Zl(this.active)&&this.request(this.active)}load(e){Xl(e.element.tagName,e.element.loadModule).then(async()=>{this.host.requestUpdate(),this.current===e&&(await this.host.updateComplete,this.current===e&&((!this.host.queryRenderedElement||this.host.queryRenderedElement(e.element.tagName)!==null)&&e.action?.(),this.current===e&&this.abandon()))},t=>{this.current===e&&(this.current={action:e.action,element:e.element,error:t,stale:Al(t),status:`error`},this.host.requestUpdate())})}},eu={tagName:`openclaw-command-palette`,label:`command palette`,loadModule:()=>z(()=>import(`./command-palette-Ckx_A_St.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]),import.meta.url)},tu={tagName:`openclaw-debug-overlay`,get label(){return B(`debug.overlay.title`)},loadModule:()=>z(()=>import(`./debug-overlay-DeLfhBb8.js`),__vite__mapDeps([39,28]),import.meta.url)},nu=`openclaw-keyboard-shortcuts-dialog`,ru={tagName:nu,get label(){return B(`shortcutsOverlay.title`)},loadModule:()=>z(()=>import(`./keyboard-shortcuts-dialog-oLNWxwqe.js`),__vite__mapDeps([40,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)},iu=`openclaw-app-sidebar`,au={tagName:iu,label:iu,loadModule:()=>z(()=>import(`./app-sidebar-DA-MiL2F.js`),__vite__mapDeps([41,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)},ou=`openclaw-macos-titlebar-controls`,su={tagName:ou,label:ou,loadModule:()=>z(()=>import(`./macos-titlebar-controls.runtime-BXoXcvFt.js`),__vite__mapDeps([42,28]),import.meta.url)},cu={tagName:`openclaw-sidebar-attention`,label:B(`attention.issues`),loadModule:()=>z(()=>import(`./sidebar-attention-nNRsUgIp.js`),__vite__mapDeps([43,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)},lu={tagName:`openclaw-terminal-panel`,label:`terminal panel`,loadModule:()=>z(()=>import(`./terminal-panel-registration-D5VvSsFk.js`),__vite__mapDeps([44,45,5,4,11,3,2,7,1,8,9,6,10,12,13,14,15,16,17,18,19,46,47,48,49,50,51,52,28,29,30,31,32]),import.meta.url)},uu={tagName:`openclaw-browser-panel`,label:`browser panel`,loadModule:()=>z(()=>import(`./browser-panel-BZcARBB-.js`),__vite__mapDeps([53,54,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,46,47,48,55,49,50,28,29,30,31,32]),import.meta.url)},du={tagName:`openclaw-browser-document`,label:uu.label,loadModule:()=>z(()=>import(`./browser-document-I7E6o6kg.js`),__vite__mapDeps([56,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,54,46,47,48,55,49,50,28,29,30,31,32]),import.meta.url)},fu={tagName:`openclaw-desktop-panel`,label:`desktop panel`,loadModule:()=>z(()=>import(`./desktop-panel-YZcYHBlM.js`),__vite__mapDeps([57,58,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,46,47,55,59,28,29,30,31,32]),import.meta.url)},pu={tagName:`openclaw-link-reader-panel`,get label(){return B(`linkReader.title`)},loadModule:()=>z(()=>import(`./link-reader-panel-DdSQDdBY.js`),__vite__mapDeps([60,2,3,1,4,5,8,9,6,7,11,10,12,13,14,15,16,17,18,19,47,48,61,28,29,30,31,32]),import.meta.url)},mu={tagName:`openclaw-board-document`,label:`dashboard document`,loadModule:()=>z(()=>import(`./board-document-CFFelSJn.js`),__vite__mapDeps([62,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,63,64,65,66,28,29,30,31,32,67,68]),import.meta.url)},hu={tagName:`openclaw-approval-page`,label:`approval page`,loadModule:()=>z(()=>import(`./approval-page-registration-Z63Xdd1j.js`),__vite__mapDeps([69,1,2,3,4,5,6,7,8,9,70,28,71]),import.meta.url)},gu=`openclaw-question-page`,_u={tagName:gu,label:gu,loadModule:()=>z(()=>import(`./question-page-registration-CE8mGnbu.js`),__vite__mapDeps([72,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,73,70,28,29,30,31,32,74,71]),import.meta.url)},vu=`openclaw-exec-approval`,yu={tagName:vu,get label(){return B(`tabs.approvals`)},loadModule:()=>z(()=>import(`./exec-approval-CkJQ1zvS.js`),__vite__mapDeps([75,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)},bu={tagName:`openclaw-login-gate`,label:`login screen`,loadModule:()=>z(()=>import(`./login-gate-BAEnjKPe.js`),__vite__mapDeps([76,77,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)}})))()}var Su;function Cu(){return(Cu=e((()=>{W(),Su=Mo`
  .shortcut-kbd:where(:not([hidden])) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
  }

  .shortcut-kbd > span + span {
    margin-inline-start: 0.15em;
  }
  .kbd__text {
    text-box: trim-both cap alphabetic;
  }
  .shortcut-kbd::before {
    content: "";
    height: 1lh;
  }
`})))()}function wu(e){return e.replace(/\s+/g,` `).trim()}function Tu(e){return typeof e==`object`&&!!e&&`namespaceURI`in e&&(e.namespaceURI===`http://www.w3.org/1999/xhtml`||e.namespaceURI===`http://www.w3.org/2000/svg`)}function Eu(e){return e.nodeType===Node.ELEMENT_NODE}function Du(e,t){let n=e.ownerDocument.defaultView?.getComputedStyle(e);if(e.hasAttribute(`hidden`)||!t&&e.getAttribute(`aria-hidden`)===`true`||n?.display===`none`||n?.contentVisibility===`hidden`)return``;let r=n?.visibility!==`hidden`&&n?.visibility!==`collapse`&&(n?.display===`contents`||typeof e.checkVisibility!=`function`||e.checkVisibility({checkOpacity:t,checkVisibilityCSS:!0}));return[...e.childNodes].map(e=>Eu(e)?Du(e,t):e.nodeType===Node.TEXT_NODE&&r?e.textContent??``:``).join(` `)}function Ou(e){return Du(e,!1)}function ku(e){return e.matches(`[data-tooltip-overflow]`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}function Au(e,t){let n=wu(e),r=wu(Du(t,!0));if(!n||!r.includes(n)||ku(t))return!1;for(let e of t.querySelectorAll(`*`))if(Tu(e)&&ku(e))return!1;return!0}function ju(){return`openclaw-tooltip-${++Lu}`}function Mu(e){let t=e?.closest(`openclaw-tooltip`);t&&e?t.focusTriggerWithoutOpening(e):e?.focus()}var Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu;function Vu(){return(Vu=e((()=>{W(),No(),xu(),wa(),or(),Ji(),Cu(),a(),Nu=`a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])`,Pu=150,Fu=300,Iu=100,Lu=0,Ru=class extends ti{constructor(...e){super(...e),this.delay=Pu,this.skipDelay=Fu,this.delayed=!0,this.#e=`keyboard`,this.#t=null,this.#r=e=>{[`Alt`,`Control`,`Meta`,`Shift`].includes(e.key)||(this.#e=`keyboard`)},this.#i=()=>{this.#e=`pointer`}}#e;#t;connectedCallback(){super.connectedCallback(),this.style.display=`contents`,this.#e=`keyboard`,this.ownerDocument.addEventListener(`keydown`,this.#r,!0),this.ownerDocument.addEventListener(`pointerdown`,this.#i,!0)}disconnectedCallback(){this.ownerDocument.removeEventListener(`keydown`,this.#r,!0),this.ownerDocument.removeEventListener(`pointerdown`,this.#i,!0),zu.closeForProvider(this),this.#n(),this.delayed=!0,super.disconnectedCallback()}focusOpensTooltip(){return this.#e===`keyboard`}openTooltip(){this.delayed=!1,this.#n()}closeTooltip(){if(this.#n(),this.skipDelay<=0){this.delayed=!0;return}this.#t=window.setTimeout(()=>{this.#t=null,this.delayed=!0},this.skipDelay)}#n(){this.#t!==null&&(window.clearTimeout(this.#t),this.#t=null)}#r;#i;render(){return H`<slot></slot>`}},L([q({type:Number})],Ru.prototype,`delay`,void 0),L([q({type:Number})],Ru.prototype,`skipDelay`,void 0),zu=class e extends ti{constructor(...t){super(...t),this.content=``,this.placement=`top`,this.closeDelay=Iu,this.describe=!0,this.autoSize=!1,this.disabled=!1,this.openOnClick=!1,this.anchor=null,this.#t=null,this.#n=!1,this.#r=null,this.#i=null,this.#a=null,this.#o=!1,this.#s=!1,this.#c=!1,this.#l=null,this.#u=!1,this.#d=!1,this.#f=null,this.#p=null,this.#m=null,this.#h=ju(),this.#g=`${this.#h}-description`,this.#b=e=>{(!(`pointerType`in e)||e.pointerType!==`touch`)&&(this.#o=!0,this.#c=!1,this.#B(),this.#k())},this.#x=e=>{(!(`pointerType`in e)||e.pointerType!==`touch`)&&(this.#o=!1,this.#c=!0,this.#U(!1),this.#H())},this.#S=e=>{e.pointerType!==`touch`&&(this.#s=!0,this.#c=!1,this.#B(),this.#A())},this.#C=e=>{e.pointerType!==`touch`&&(this.#s=!1,this.#c=!0,this.#H())},this.#w=()=>{this.openOnClick||this.#F()},this.#T=()=>{this.#F()},this.#E=()=>{if(this.#d){this.#d=!1,this.#F();return}this.#m?.focusOpensTooltip()!==!1&&this.#A()},this.#D=e=>{e instanceof FocusEvent&&e.relatedTarget instanceof Node&&this.#P(e.relatedTarget)||this.#n||this.#o||this.#s||this.#F()},this.#O=()=>{if(this.openOnClick&&!this.#n){this.#A(),this.#n=this.webAwesomeTooltip?.open===!0;return}this.#F()},this.#j=t=>{e.consumeEscape(t,this.ownerDocument)},this.#M=e=>{e.composedPath().some(e=>e===this||e===this.#t)||this.#F()},this.#N=e=>{e.pointerType!==`touch`&&this.#c&&this.#a===null&&!e.composedPath().includes(this)&&this.#H(!0)},this.#q=()=>{this.#K(),this.#R(),this.#G||this.#F()}}static#e=new WeakMap;static{this.consumeEscape=(t,n)=>{if(t.key!==`Escape`||t.defaultPrevented||t.isComposing||t.keyCode===229)return!1;let r=e.#e.get(n);if(!r)return!1;t.preventDefault(),t.stopImmediatePropagation();let i=n.activeElement,a=i&&r.contains(i)&&!r.#t?.contains(i)?r.#L():null;return r.#F(),a instanceof HTMLElement&&r.focusTriggerWithoutOpening(a),!0}}static closeForProvider(t){let n=e.#e.get(t.ownerDocument);n&&n.#m===t&&n.#F()}#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;static{this.styles=[Su,Mo`
      :host {
        display: contents;
      }

      wa-tooltip:not(:defined) {
        display: none;
      }

      wa-tooltip {
        --max-width: var(--openclaw-tooltip-max-width, min(260px, calc(100vw - 16px)));
        --wa-tooltip-arrow-size: var(--openclaw-tooltip-arrow-size, 0px);
        --wa-tooltip-background-color: var(
          --openclaw-tooltip-background-color,
          color-mix(in srgb, var(--bg-elevated) 97%, var(--text) 3%)
        );
        --wa-tooltip-border-color: var(
          --openclaw-tooltip-border-color,
          var(--overlay-border, var(--border-strong))
        );
        --wa-tooltip-border-width: 1px;
        --wa-tooltip-border-style: solid;
        --wa-tooltip-content-color: var(--text);
        --wa-tooltip-border-radius: var(--openclaw-tooltip-border-radius, var(--radius-md));
        --show-duration: var(--openclaw-tooltip-popup-show-duration, var(--wa-transition-fast));
        --hide-duration: var(--openclaw-tooltip-popup-hide-duration, var(--wa-transition-fast));
        font-family: var(--font-body);
      }

      wa-tooltip::part(body) {
        padding: var(--openclaw-tooltip-padding, 5px 7px);
        box-shadow: var(--openclaw-tooltip-shadow, var(--overlay-shadow, var(--shadow-md)));
        font-size: 11px;
        font-weight: 500;
        line-height: 1.25;
        overflow-wrap: anywhere;
      }

      :host(.sidebar-hover-tooltip) wa-tooltip[open]::part(base__popup) {
        animation: var(--openclaw-tooltip-open-animation);
      }

      @media (prefers-reduced-motion: reduce) {
        wa-tooltip {
          --show-duration: 0ms;
          --hide-duration: 0ms;
        }

        :host(.sidebar-hover-tooltip) wa-tooltip[open]::part(base__popup) {
          animation: none;
        }
      }

      @keyframes openclaw-tooltip-hover-card-in {
        from {
          opacity: 0;
          transform: scale(0.95);
        }
        to {
          opacity: 1;
          transform: scale(1);
        }
      }

      .tooltip-content {
        display: block;
        text-align: center;
        white-space: pre-line;
      }

      .tooltip-rich-content {
        display: block;
        pointer-events: auto;
        text-align: left;
      }
    `]}connectedCallback(){super.connectedCallback(),this.style.display=`contents`}updated(){this.#_(),this.#R(),this.#y(),(this.disabled||!this.#G||this.webAwesomeTooltip?.open&&this.#I())&&this.#F()}disconnectedCallback(){this.#F(),this.#p?.disconnect(),this.#p=null,this.#m=null,this.#v(),super.disconnectedCallback()}#_(){let e=this.renderRoot.querySelector(`slot:not([name])`),t=this.anchor??e?.assignedElements({flatten:!0}).find(Tu);if(t===this.#t||(this.#F(),this.#v(),!t))return;this.#t=t,this.#m=null;let n=t;for(;n;){let e=n.closest(`openclaw-tooltip-provider`);if(e){this.#m=e;break}let t=n.getRootNode();n=t instanceof ShadowRoot?t.host:null}t.addEventListener(`pointerenter`,this.#b),t.addEventListener(`pointerleave`,this.#x),t.addEventListener(`pointerdown`,this.#w),t.addEventListener(`pointercancel`,this.#T),t.addEventListener(`focusin`,this.#E),t.addEventListener(`focusout`,this.#D),t.addEventListener(`click`,this.#O,!0),this.#K(),this.#R(),this.#y()}#v(){let e=this.#t;e&&(e.removeEventListener(`pointerenter`,this.#b),e.removeEventListener(`pointerleave`,this.#x),e.removeEventListener(`pointerdown`,this.#w),e.removeEventListener(`pointercancel`,this.#T),e.removeEventListener(`focusin`,this.#E),e.removeEventListener(`focusout`,this.#D),e.removeEventListener(`click`,this.#O,!0),this.#z(),this.#t=null)}previewForAnchor(e,t,n){this.anchor=e,this.content=t,this.updateComplete.then(()=>{this.anchor===e&&e.isConnected&&this.isConnected&&(n===`focus`?this.#E():(this.#o=!0,this.#k()))})}#y(){let e=this.webAwesomeTooltip;if(!e)return;e.showDelay=0,e.hideDelay=0;let t=this.#t;if(!customElements.get(`wa-tooltip`)){e.anchor=t;return}e.updateComplete.then(()=>{this.webAwesomeTooltip===e&&this.#t===t&&(e.anchor=t,this.autoSize?e.popup.setAttribute(`auto-size`,`vertical`):e.popup.removeAttribute(`auto-size`),e.popup.autoSizePadding=this.autoSize?8:0,e.popup.shiftPadding=this.autoSize?8:0)})}#b;#x;#S;#C;#w;#T;#E;#D;#O;#k(){if(this.disabled||this.webAwesomeTooltip?.open||this.#i!==null)return;let e=this.#m,t=this.delay===void 0&&e?.delayed===!1?0:Math.max(0,this.delay??e?.delay??Pu);this.#i=window.setTimeout(()=>{this.#i=null,this.#A()},t)}#A(){let t=this.webAwesomeTooltip;if(this.disabled||!t||!this.#t||!this.#G||this.#I())return;Xl(`wa-tooltip`,()=>z(()=>import(`./tooltip-COuYAF8g.js`),__vite__mapDeps([78,5,4,28]),import.meta.url)).then(()=>{this.isConnected&&this.#y()},t=>{e.#e.get(this.ownerDocument)===this&&(this.#F(),gr({message:on(t)}))}),this.#U(!1);let n=e.#e.get(this.ownerDocument);n&&n!==this&&n.#F(),e.#e.set(this.ownerDocument,this),this.#m?.openTooltip(),this.#R(),t.placement=this.#J(),t.open=!0,this.setAttribute(`open`,``),this.ownerDocument.addEventListener(`pointerdown`,this.#M,!0),this.ownerDocument.addEventListener(`focusin`,this.#M,!0),this.hoverDismissDelay!==void 0&&this.ownerDocument.addEventListener(`pointermove`,this.#N,!0),this.ownerDocument.defaultView?.addEventListener(`keydown`,this.#j,!0)}#j;#M;#N;#P(e){return this.contains(e)||this.#t?.contains(e)===!0}#F(){this.#n=!1,this.removeAttribute(`open`),this.ownerDocument.removeEventListener(`pointerdown`,this.#M,!0),this.ownerDocument.removeEventListener(`focusin`,this.#M,!0),this.ownerDocument.removeEventListener(`pointermove`,this.#N,!0),this.ownerDocument.defaultView?.removeEventListener(`keydown`,this.#j,!0),this.#U(),this.webAwesomeTooltip?.open&&(this.webAwesomeTooltip.open=!1),e.#e.get(this.ownerDocument)===this&&(e.#e.delete(this.ownerDocument),this.#m?.closeTooltip())}#I(){return!this.#W&&this.#t!==null&&Au(this.content,this.#t)}#L(){let e=this.#t;return e?e.matches(Nu)?e:e.querySelector(Nu)??e:null}#R(){let e=this.#W;if(this.webAwesomeTooltip?.style.setProperty(`pointer-events`,e?`auto`:`none`),!this.describe){this.#z();return}let t=this.#L();if(!t)return;this.#r=t;let n=t.getAttribute(`aria-describedby`);if(this.#u||=(this.#l=n,!0),!this.#f){let e=this.ownerDocument.createElement(`span`);e.id=this.#g,e.hidden=!0;let n=t.getRootNode();(n instanceof ShadowRoot?n:this).append(e),this.#f=e}let r=e||this.content;this.#f.textContent!==r&&(this.#f.textContent=r);let i=new Set((n??``).split(/\s+/u).filter(Boolean));i.add(this.#g);let a=[...i].join(` `);n!==a&&t.setAttribute(`aria-describedby`,a)}#z(){let e=this.#r??this.#t;e&&(this.#l?e.setAttribute(`aria-describedby`,this.#l):e.removeAttribute(`aria-describedby`),this.#r=null,this.#f?.remove(),this.#f=null,this.#l=null,this.#u=!1)}#B(){this.#a!==null&&(window.clearTimeout(this.#a),this.#a=null)}#V(e=!1){if(e)return this.#o||this.#s;let t=this.#t?.getRootNode(),n=t instanceof ShadowRoot?t.activeElement:this.ownerDocument.activeElement;return this.#n||this.#o||this.#s||n instanceof Node&&this.#P(n)}#H(e=!1){if(this.#B(),!this.#V(e)){if(!this.#W){this.#F();return}this.#a=window.setTimeout(()=>{this.#a=null,this.#V(e)||this.#F()},this.hoverDismissDelay??this.closeDelay)}}#U(e=!0){this.#i!==null&&(window.clearTimeout(this.#i),this.#i=null),this.#B(),e&&(this.#o=!1,this.#s=!1,this.#c=!1)}get#W(){return wu(this.renderRoot.querySelector(`slot[name="content"]`)?.assignedNodes({flatten:!0}).map(e=>e.textContent??``).join(` `)??``)}get#G(){return this.#W||this.content}#K(){this.#p?.disconnect(),this.#p??=new MutationObserver(()=>this.#R());let e=this.renderRoot.querySelector(`slot[name="content"]`);for(let t of e?.assignedNodes({flatten:!0})??[])this.#p.observe(t,{characterData:!0,childList:!0,subtree:!0})}#q;#J(){return(this.placement===`right-start`||this.placement===`right`)&&this.ownerDocument.defaultView?.matchMedia?.(`(max-width: 640px)`).matches?`bottom-start`:this.placement}render(){return H`
      <slot @slotchange=${()=>this.#_()}></slot>
      <wa-tooltip
        id=${this.#h}
        placement=${this.#J()}
        trigger="manual"
        @wa-hide=${()=>this.#F()}
      >
        <span class="tooltip-content">${this.contentTemplate??this.content}</span>
        <span
          class="tooltip-rich-content"
          @pointerenter=${this.#S}
          @pointerleave=${this.#C}
          @focusin=${this.#E}
          @focusout=${this.#D}
        >
          <slot name="content" @slotchange=${this.#q}></slot>
        </span>
      </wa-tooltip>
    `}focusTriggerWithoutOpening(e){this.#t?.contains(e)&&!e.matches(`:focus`)&&(this.#d=!0),e.focus()}},L([q()],zu.prototype,`content`,void 0),L([q({attribute:!1})],zu.prototype,`contentTemplate`,void 0),L([q()],zu.prototype,`placement`,void 0),L([q({type:Number})],zu.prototype,`closeDelay`,void 0),L([q({type:Number})],zu.prototype,`hoverDismissDelay`,void 0),L([q({type:Number})],zu.prototype,`delay`,void 0),L([q({type:Boolean})],zu.prototype,`describe`,void 0),L([q({type:Boolean,attribute:`auto-size`})],zu.prototype,`autoSize`,void 0),L([q({type:Boolean})],zu.prototype,`disabled`,void 0),L([q({type:Boolean,attribute:`open-on-click`})],zu.prototype,`openOnClick`,void 0),L([q({attribute:!1})],zu.prototype,`anchor`,void 0),L([ko(`wa-tooltip`)],zu.prototype,`webAwesomeTooltip`,void 0),Bu=zu.consumeEscape,customElements.get(`openclaw-tooltip-provider`)||customElements.define(`openclaw-tooltip-provider`,Ru),customElements.get(`openclaw-tooltip`)||customElements.define(`openclaw-tooltip`,zu)})))()}var Hu;function Uu(){return(Uu=e((()=>{W(),No(),Qc(),lc(),V(),Ji(),ml(),xl(),Vu(),Hu=class extends ha{constructor(...e){super(...e),this.navDrawerOpen=!1,this.resourceBasePath=``,this.environment=null}render(){let e=this.navDrawerOpen?B(`nav.collapse`):B(`nav.expand`);return H`
      <header class="topbar">
        <div class="topnav-shell">
          <openclaw-tooltip .content=${e}>
            <button
              type="button"
              class="topbar-icon-btn topbar-nav-toggle"
              @click=${e=>this.onToggleDrawer(e.currentTarget)}
              aria-label=${e}
              aria-expanded=${String(this.navDrawerOpen)}
            >
              <span class="nav-collapse-toggle__icon" aria-hidden="true">${pl.menu}</span>
            </button>
          </openclaw-tooltip>
          <div class="topnav-shell__content" @mousedown=${Yc}>
            <div class="topbar-brand" aria-label="OpenClaw">
              <img
                class="topbar-brand__logo"
                src=${sc(`apple-touch-icon.png`,this.resourceBasePath)}
                alt=""
                aria-hidden="true"
              />
              <span class="topbar-brand__title">OpenClaw</span>
              ${this.environment&&H`<span class="control-ui-environment-pill">${this.environment.label}</span>`}
            </div>
          </div>
          <div class="topnav-shell__actions">
            <openclaw-tooltip
              .content=${B(`chat.commandPaletteTitle`)}
              .contentTemplate=${bl(B(`chat.commandPaletteTitle`).replace(`⌘K`,`{shortcut}`),_l([`⌘`,`K`],{inline:!0}))}
            >
              <button
                class="topbar-search"
                @click=${this.onOpenPalette}
                aria-label=${B(`chat.openCommandPalette`)}
              >
                ${pl.search}
              </button>
            </openclaw-tooltip>
          </div>
        </div>
      </header>
    `}},L([q({attribute:!1})],Hu.prototype,`navDrawerOpen`,void 0),L([q({attribute:!1})],Hu.prototype,`resourceBasePath`,void 0),L([q({attribute:!1})],Hu.prototype,`environment`,void 0),L([q({attribute:!1})],Hu.prototype,`onToggleDrawer`,void 0),L([q({attribute:!1})],Hu.prototype,`onOpenPalette`,void 0),customElements.get(`openclaw-app-topbar`)||customElements.define(`openclaw-app-topbar`,Hu)})))()}function Wu(e){let t=Ku.get(e);return t||(t=new Gu,Ku.set(e,t)),t}var Gu,Ku;function qu(){return(qu=e((()=>{Gu=class{constructor(){this.region=`page`,this.listeners=new Set}get current(){return this.region}claim(e){if(this.region!==e){this.region=e;for(let e of this.listeners)e()}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}},Ku=new WeakMap})))()}var Ju;function Yu(){return(Yu=e((()=>{Ju=E(`openclaw.application`)})))()}function Xu(e,t,n,r=``,i={}){return Ke({namespace:e,sessionKey:n,fallbackAgentId:t,basePath:r,displayName:i.displayName??void 0,exactKey:i.exactKey,mainKey:i.mainKey??void 0,shortIdLength:i.shortIdLength??32})}function Zu(){return(Zu=e((()=>{Ne()})))()}function Qu(e){let t=e.agentId?.trim()||ri(e.sessionKey)?.agentId;t&&(e.background?e.selection.set(M(t),{background:!0}):e.selection.set(M(t))),e.gateway.setSessionKey(e.sessionKey)}function $u(e,t,n,r,i={}){let a=e=>{let n=e?.trim()?M(e):null,r=t.state.agentsList;if(i.requireConfiguredAgent){let e=r?.agents.filter(e=>e.kind!==`system`)??[],t=t=>e.some(e=>M(e.id)===t),i=r?M(r.defaultId):null;return t(n)?n:t(i)?i:e[0]?M(e[0].id):null}if(!r||r.agents.length===0)return n;let a=M(r.defaultId);return!n||!r.agents.some(e=>M(e.id)===n)?a:n},o=e=>{let n=e?.trim()?M(e):null;return t.state.agentsList?.agents.some(e=>e.kind===`system`&&M(e.id)===n)?null:n},s=e.connection.gatewayUrl,c=n?.load(s)?.trim(),l=a(c?M(c):e.snapshot.assistantAgentId?M(e.snapshot.assistantAgentId):null),u=i.requireConfiguredAgent&&!t.state.agentsList&&c?M(c):null,d=r?.settings.sidebarAgentsMode===`roster`,f=e=>o(r?.settings.sidebarPreTeamScope===void 0?e:r.settings.sidebarPreTeamScope),p=f(l),m=r?.settings.sidebarPreTeamScope===void 0&&!t.state.agentsList,h=!d&&m,g=new Set(t.state.agentsList?.agents.map(e=>M(e.id))),_={selectedId:l,scopeId:i.requireConfiguredAgent?l:d?null:p},v=e.snapshot.assistantAgentId?M(e.snapshot.assistantAgentId):null,y=!c||!u&&l!==M(c);c&&y&&n?.save(s,null);let b=new Set,x=0,S=e=>{let t=a(e.selectedId),n=i.requireConfiguredAgent?t:d||t===e.selectedId?e.scopeId:t,r={selectedId:t,scopeId:o(n)};if(_.selectedId!==r.selectedId||_.scopeId!==r.scopeId){_=r;for(let e of b)e(_)}},C=r?.subscribe(()=>{if(e.connection.gatewayUrl!==s)return;let t=r.settings.sidebarAgentsMode===`roster`;t!==d&&(d=t,d?(p=_.scopeId,m=h):p=f(p),h=!d&&m,r.patch({sidebarPreTeamScope:d?p:void 0}),S({..._,scopeId:d?null:p}))}),w=e.subscribe(i=>{let a=i.assistantAgentId?M(i.assistantAgentId):null,o=a!==v;v=a;let c=e.connection.gatewayUrl;if(c!==s){s=c,x+=1,u=null;let e=n?.load(s)?.trim();y=!e;let i=e?M(e):a;d=r?.settings.sidebarAgentsMode===`roster`,p=f(i),m=r?.settings.sidebarPreTeamScope===void 0&&!t.state.agentsList,h=!d&&m,g.clear(),S({selectedId:i,scopeId:d?null:p});return}o&&y&&a&&(d||(h=!t.state.agentsList),S({selectedId:a,scopeId:d?_.scopeId:a}))}),T=t.subscribe(()=>{if(i.requireConfiguredAgent){let e=u??(y?v:_.selectedId),r=a(e);t.state.agentsList?(u=null,!y&&r!==e&&(y=!0,n?.save(s,null))):y||(u=e),S({selectedId:r,scopeId:r});return}let e=new Set(t.state.agentsList?.agents.map(e=>M(e.id))),c=_.scopeId;e.size>0&&(p&&(m||g.has(p))&&!e.has(p)&&(p=o(a(p)),d&&r?.patch({sidebarPreTeamScope:p})),m=!1,h=!1,d&&_.scopeId&&g.has(_.scopeId)&&!e.has(_.scopeId)&&(c=null),g=e),!y&&a(_.selectedId)!==_.selectedId&&(y=!0,n?.save(s,null)),S(y&&v?{selectedId:v,scopeId:d||_.selectedId===v?c:v}:{..._,scopeId:c})}),E=(e,r)=>{r?.background||(x+=1);let o=e?.trim()?M(e):null;u=i.requireConfiguredAgent&&!t.state.agentsList?o:null,y=!o||!u&&a(o)!==o,d||(h=!t.state.agentsList),n?.save(s,y?null:o),S({selectedId:o,scopeId:d?_.scopeId:o})};return{get state(){return _},get intentRevision(){return x},set:E,setScope(e){if(i.requireConfiguredAgent){E(e);return}h=!1;let t=e?.trim()?M(e):null;S({..._,scopeId:t})},subscribe(e){return b.add(e),()=>b.delete(e)},dispose(){C?.(),w(),T(),b.clear()}}}function ed(){return(ed=e((()=>{na()})))()}function td(){return H`<div
    class="assistant-panel-loading"
    role="status"
    aria-live="polite"
    aria-label=${B(`common.loading`)}
    aria-busy="true"
  >
    <div class="assistant-panel-loading__content" aria-hidden="true">
      <div class="assistant-panel-loading__messages">
        <div>
          <div class="assistant-panel-loading__lines"><span></span><span></span><span></span></div>
        </div>
        <div class="assistant-panel-loading__message--reply">
          <div class="assistant-panel-loading__lines"><span></span><span></span></div>
        </div>
        <div>
          <div class="assistant-panel-loading__lines"><span></span><span></span></div>
        </div>
      </div>
      <div class="assistant-panel-loading__composer"></div>
    </div>
  </div>`}function nd(){return(nd=e((()=>{W(),V()})))()}var rd,id;function ad(){return(ad=e((()=>{W(),No(),V(),Ji(),rd=[`pointerup`,`pointercancel`,`blur`],id=class extends ti{constructor(...e){super(...e),this.splitRatio=.6,this.minRatio=.4,this.maxRatio=.7,this.label=``,this.orientation=`vertical`,this.startPosition=0,this.startRatio=0,this.dragRatio=0,this.dragSize=0,this.dragFrame=0,this.pendingPosition=null,this.activePointerId=null,this.handlePointerDown=e=>{if(e.button===0&&this.activePointerId===null&&(this.startPosition=this.orientation===`horizontal`?e.clientY:e.clientX,this.startRatio=this.currentRatio(),this.dragRatio=this.startRatio,this.dragSize=this.measureDragSize(),!(this.dragSize<=0))){this.classList.add(`dragging`),this.capturePointer(e.pointerId),window.addEventListener(`pointermove`,this.handlePointerMove);for(let e of rd)window.addEventListener(e,this.finishDragging);this.addEventListener(`lostpointercapture`,this.finishDragging),e.preventDefault(),this.dispatchEvent(new CustomEvent(`resize-start`,{bubbles:!0,composed:!0}))}},this.handlePointerMove=e=>{e.pointerId===this.activePointerId&&(this.pendingPosition=this.orientation===`horizontal`?e.clientY:e.clientX,this.dragFrame||=requestAnimationFrame(this.flushPointerMove))},this.flushPointerMove=()=>{this.dragFrame=0;let e=this.pendingPosition;this.pendingPosition=null,e!==null&&(this.dragRatio=this.emitResize(this.startRatio+(e-this.startPosition)/this.dragSize))},this.handleKeyDown=e=>{let t=e.shiftKey?.05:.02,n=this.currentRatio(),r=null,i=this.orientation===`horizontal`?`ArrowUp`:`ArrowLeft`,a=this.orientation===`horizontal`?`ArrowDown`:`ArrowRight`;e.key===i?r=n-t:e.key===a?r=n+t:e.key===`Home`?r=this.minRatio:e.key===`End`&&(r=this.maxRatio),r!=null&&(e.preventDefault(),this.emitResize(r),this.emitResize(r,`resize-end`))},this.finishDragging=e=>{`pointerId`in e&&e.pointerId!==this.activePointerId||(this.activePointerId!==null&&(this.dragFrame&&=(cancelAnimationFrame(this.dragFrame),0),this.flushPointerMove(),this.emitResize(this.dragRatio,`resize-end`)),this.stopDragging())}}static{this.styles=Mo`
    :host {
      width: var(--resize-handle-size, 6px);
      cursor: col-resize;
      flex-shrink: 0;
      position: relative;
      touch-action: none;
      user-select: none;
    }
    :host::before {
      content: "";
      position: absolute;
      top: 0;
      left: -4px;
      right: -4px;
      bottom: 0;
    }
    /* The visible divider is a centered hairline, not the whole gutter:
       filling the host paints a fat bar that stacks with neighboring pane
       borders into a multi-line smear while dragging. */
    :host::after {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      inset-inline-start: var(--resize-handle-line-inline, 50%);
      width: var(--resize-handle-line-size, 1px);
      transform: translateX(-50%);
      background: var(--resize-handle-rest-color, var(--border, #1e2028));
      transition:
        background 150ms ease-out,
        width 150ms ease-out;
    }
    :host(:hover)::after,
    :host(.dragging)::after,
    :host(:focus-visible)::after {
      width: var(--resize-handle-active-line-size, 2px);
      background: var(--resize-handle-active-color, currentColor);
    }
    :host(:focus-visible) {
      outline: 2px solid var(--accent, #ff5c5c);
      outline-offset: 2px;
    }
    :host([orientation="horizontal"]) {
      width: auto;
      height: var(--resize-handle-size, 6px);
      cursor: row-resize;
    }
    :host([orientation="horizontal"])::before {
      top: -4px;
      left: 0;
      right: 0;
      bottom: -4px;
    }
    :host([orientation="horizontal"])::after {
      top: var(--resize-handle-line-block, 50%);
      bottom: auto;
      inset-inline-start: 0;
      left: 0;
      right: 0;
      width: auto;
      height: var(--resize-handle-line-size, 1px);
      transform: translateY(-50%);
      transition:
        background 150ms ease-out,
        height 150ms ease-out;
    }
    :host([orientation="horizontal"]:hover)::after,
    :host([orientation="horizontal"].dragging)::after,
    :host([orientation="horizontal"]:focus-visible)::after {
      width: auto;
      height: var(--resize-handle-active-line-size, 2px);
    }
  `}render(){return U}connectedCallback(){super.connectedCallback(),this.setStaticAccessibilityAttributes(),this.addEventListener(`pointerdown`,this.handlePointerDown),this.addEventListener(`keydown`,this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this.handlePointerDown),this.removeEventListener(`keydown`,this.handleKeyDown),this.finishDragging(new Event(`disconnect`))}updated(){this.setAttribute(`aria-valuemin`,String(this.toAriaValue(this.minRatio))),this.setAttribute(`aria-valuemax`,String(this.toAriaValue(this.maxRatio))),this.setCurrentAriaValue(this.currentRatio()),this.setAttribute(`aria-label`,this.label||B(`common.resizeSplitView`)),this.setAttribute(`aria-orientation`,this.orientation)}stopDragging(){let e=this.activePointerId;if(e!==null){this.classList.remove(`dragging`),this.removeEventListener(`lostpointercapture`,this.finishDragging),this.releaseActivePointer(e),this.dragFrame&&=(cancelAnimationFrame(this.dragFrame),0),this.pendingPosition=null,window.removeEventListener(`pointermove`,this.handlePointerMove);for(let e of rd)window.removeEventListener(e,this.finishDragging)}}emitResize(e,t=`resize`){let n=this.clampRatio(e);return t===`resize`&&this.setCurrentAriaValue(n),this.dispatchEvent(new CustomEvent(t,{detail:{splitRatio:n},bubbles:!0,composed:!0})),n}clampRatio(e){return Math.max(this.minRatio,Math.min(this.maxRatio,e))}measureDragSize(){let e=this.measureSize?.()??0;if(e>0)return e;let t=this.previousElementSibling?.getBoundingClientRect(),n=this.nextElementSibling?.getBoundingClientRect(),r=this.orientation===`horizontal`?(t?.height??0)+(n?.height??0):(t?.width??0)+(n?.width??0);if(r>0)return r;let i=this.parentElement?.getBoundingClientRect();return this.orientation===`horizontal`?i?.height??0:i?.width??0}currentRatio(){let e=this.measureRatio?.();return e!==void 0&&Number.isFinite(e)?this.clampRatio(e):this.splitRatio}toAriaValue(e){return Math.round(e*100)}setCurrentAriaValue(e){this.setAttribute(`aria-valuenow`,String(this.toAriaValue(e)))}setStaticAccessibilityAttributes(){this.setAttribute(`role`,`separator`),this.setAttribute(`tabindex`,`0`),this.setAttribute(`aria-orientation`,this.orientation)}capturePointer(e){this.activePointerId=e,typeof this.setPointerCapture==`function`&&this.setPointerCapture(e)}releaseActivePointer(e){this.activePointerId=null,typeof this.releasePointerCapture==`function`&&(typeof this.hasPointerCapture!=`function`||this.hasPointerCapture(e))&&this.releasePointerCapture(e)}},L([q({type:Number})],id.prototype,`splitRatio`,void 0),L([q({type:Number})],id.prototype,`minRatio`,void 0),L([q({type:Number})],id.prototype,`maxRatio`,void 0),L([q({type:String})],id.prototype,`label`,void 0),L([q({type:String,reflect:!0})],id.prototype,`orientation`,void 0),L([q({attribute:!1})],id.prototype,`measureRatio`,void 0),L([q({attribute:!1})],id.prototype,`measureSize`,void 0),customElements.get(`resizable-divider`)||customElements.define(`resizable-divider`,id)})))()}var od;function sd(){return(sd=e((()=>{W(),ad(),od=class{constructor(e,t){this.host=e,this.options=t,this.open=!1,this.suppressed=!1,this.persistedOpen=!1,this.onViewportResize=()=>{let e=Math.min(this.height,this.options.layout.maxHeight()),t=Math.min(this.width,this.maxWidth());(e!==this.height||t!==this.width)&&(this.height=e,this.width=t,this.syncReservation(),this.options.onResize?.(),this.host.requestUpdate())},this.dock=t.layout.defaults.dock,this.height=t.layout.defaults.height,this.width=t.layout.defaults.width,e.addController(this)}hostConnected(){if(this.isFullscreen()){this.open=this.options.isAvailable();return}let e=this.options.layout.load();this.persistedOpen=e.open,this.open=e.open&&this.options.isAvailable(),this.dock=e.dock,this.height=e.height,this.width=Math.min(e.width,this.maxWidth()),window.addEventListener(`resize`,this.onViewportResize)}hostDisconnected(){window.removeEventListener(`resize`,this.onViewportResize),this.clearReservation()}setOpen(e,t=!0){this.open=e,this.syncReservation(),t&&this.persist(),this.host.requestUpdate()}hideWithoutPersisting(){this.setOpen(!1,!1)}setSuppressed(e){return this.suppressed!==e&&(this.suppressed=e,e?(this.hideWithoutPersisting(),!1):this.restoreOpenState())}restoreOpenState(){return this.suppressed||!this.options.isAvailable()||this.open||!this.isFullscreen()&&!this.persistedOpen?!1:(this.open=!0,this.syncReservation(),this.host.requestUpdate(),!0)}setDock(e,t=!0){this.dock=e,this.syncReservation(),t&&this.persist(),this.host.requestUpdate()}persist(){this.persistedOpen=this.open,this.options.layout.save({open:this.open,dock:this.dock,height:this.height,width:this.width})}syncReservation(){if(this.options.reserveViewport===!1||this.isFullscreen())return;let e=!(this.host instanceof HTMLElement&&this.host.hasAttribute(`embedded`))&&!this.isFullscreen()&&this.options.isAvailable()&&this.open,t=document.documentElement.style;t.setProperty(`--oc-${this.options.reservationPrefix}-reserve-bottom`,e&&this.dock===`bottom`?`${this.height}px`:`0px`),t.setProperty(`--oc-${this.options.reservationPrefix}-reserve-right`,e&&this.dock===`right`?`${this.width}px`:`0px`)}resize(e){let t=this.dock===`bottom`,n=t?this.options.layout.minHeight:this.options.layout.minWidth,r=t?this.options.layout.maxHeight():this.maxWidth(),i=Math.min(r,Math.max(n,(1-e.detail.splitRatio)*this.size()));t?this.height=i:this.width=i,this.syncReservation(),this.options.onResize?.(),this.host.requestUpdate()}size(){return this.dock===`bottom`?window.innerHeight:window.innerWidth}renderResizer(e,t){if(this.isFullscreen()||this.dock===`main`)return U;let n=this.dock===`bottom`,r=this.size(),i=n?this.options.layout.minHeight:this.options.layout.minWidth,a=n?this.options.layout.maxHeight():this.maxWidth(),o=n?this.height:this.width;return H`<resizable-divider
      class="${e}-resizer ${e}-resizer--${this.dock}"
      .orientation=${n?`horizontal`:`vertical`}
      .label=${t}
      .splitRatio=${1-o/r}
      .minRatio=${1-a/r}
      .maxRatio=${1-i/r}
      .measureRatio=${()=>1-(n?this.height:this.width)/this.size()}
      .measureSize=${()=>this.size()}
      @resize=${e=>this.resize(e)}
      @resize-end=${()=>this.persist()}
    ></resizable-divider>`}clearReservation(){if(this.options.reserveViewport===!1||this.isFullscreen())return;let e=document.documentElement.style;e.setProperty(`--oc-${this.options.reservationPrefix}-reserve-bottom`,`0px`),e.setProperty(`--oc-${this.options.reservationPrefix}-reserve-right`,`0px`)}isFullscreen(){return this.options.isFullscreen?.()===!0}maxWidth(){return Math.max(this.options.layout.minWidth,Math.min(this.options.layout.maxWidth(),this.options.maxWidth?.()??1/0))}}})))()}function cd(e){let t={open:!1,dock:e.defaultDock,height:e.defaultHeight,width:e.defaultWidth},n=()=>Math.max(e.minHeight,Math.floor((globalThis.innerHeight||800)*.8)),r=()=>Math.max(e.minWidth,Math.floor((globalThis.innerWidth||1280)*.8)),i=(e,t,n,r)=>Math.min(typeof e==`number`&&Number.isFinite(e)&&e>=t?e:r,n);return{defaults:t,minHeight:e.minHeight,minWidth:e.minWidth,maxHeight:n,maxWidth:r,load(){try{let a=globalThis.localStorage?.getItem(e.storageKey);if(!a)return{...t};let o=JSON.parse(a);return{open:!!o.open,dock:e.supportedDocks.includes(o.dock)?o.dock:t.dock,height:i(o.height,e.minHeight,n(),t.height),width:i(o.width,e.minWidth,r(),t.width)}}catch{return{...t}}},save(t){try{globalThis.localStorage?.setItem(e.storageKey,JSON.stringify(t))}catch{}}}}var ld,ud,dd;function fd(){return(fd=e((()=>{ld=cd({storageKey:`openclaw.terminal.panel.v1`,minHeight:140,minWidth:320,defaultDock:`bottom`,supportedDocks:[`bottom`,`right`,`main`],defaultHeight:320,defaultWidth:520}),ud=cd({storageKey:`openclaw.browser.panel.v1`,minHeight:240,minWidth:380,defaultDock:`right`,supportedDocks:[`bottom`,`right`],defaultHeight:420,defaultWidth:560}),dd=cd({storageKey:`openclaw.custodian.panel.v1`,minHeight:240,minWidth:320,defaultDock:`right`,supportedDocks:[`bottom`,`right`],defaultHeight:420,defaultWidth:440})})))()}function pd(){return H`<div class="loading-skeleton" aria-hidden="true">
    <div class="loading-skeleton__header">
      <div class="skeleton loading-skeleton__avatar"></div>
      <div class="skeleton skeleton-line loading-skeleton__title"></div>
    </div>
    <div class="loading-skeleton__messages">
      <div class="loading-skeleton__message loading-skeleton__message--user">
        <div class="skeleton skeleton-line"></div>
        <div class="skeleton skeleton-line skeleton-line--medium"></div>
      </div>
      <div class="loading-skeleton__message">
        <div class="skeleton loading-skeleton__avatar"></div>
        <div class="skeleton skeleton-line"></div>
        <div class="skeleton skeleton-line skeleton-line--long"></div>
        <div class="skeleton skeleton-line skeleton-line--medium"></div>
      </div>
    </div>
    <div class="skeleton loading-skeleton__composer"></div>
  </div>`}function md(e){return H`<main
    class="connect-splash connect-splash--skeleton"
    role="status"
    aria-live="polite"
    aria-label=${e??B(`common.loading`)}
  >
    <div class="connect-splash__layout" aria-hidden="true" @mousedown=${Yc}>
      <aside class="connect-splash__sidebar">
        <div class="skeleton loading-skeleton__avatar"></div>
        <div class="skeleton connect-splash__new-session"></div>
        ${[85,65,75,55,80,60].map(e=>H`<div class="skeleton skeleton-line" style=${`width: ${e}%`}></div>`)}
      </aside>
      ${pd()}
    </div>
    ${e?H`<span class="connect-splash__status">${e}</span>`:U}
  </main>`}function hd(){return(hd=e((()=>{W(),Qc(),V()})))()}function gd(){return H`
    <section
      class="lazy-view-state lazy-view-state--loading"
      role="status"
      aria-live="polite"
      aria-label=${B(`common.loading`)}
    >
      ${pd()}
    </section>
  `}function _d(){return(_d=e((()=>{W(),V(),hd()})))()}function vd(e,t,n){return e.status===`loading`?gd():bd({actionLabel:B(`common.retry`),error:e.error,stale:e.stale,subtitle:e.element.label,onRetry:t,onClose:n})}function yd(e){let t=e.visibleState;if(!t)return U;let n=()=>e.close(),r=t.status===`loading`;return H`<openclaw-modal-dialog
    class=${r?`lazy-element-loading-modal`:U}
    label=${t.element.label}
    @modal-cancel=${n}
  >
    ${r?H`<section class="lazy-element-loading">
            <header class="lazy-element-loading__header">
              <h2>${t.element.label}</h2>
              <button
                class="btn btn--ghost btn--icon"
                type="button"
                aria-label=${B(`common.close`)}
                @click=${n}
              >
                ${fl(`x`)}
              </button>
            </header>
            <div
              class="lazy-element-loading__status"
              role="status"
              aria-live="polite"
              aria-label=${B(`common.loading`)}
            >
              <span class="btn__spinner" aria-hidden="true"></span>
              <span>${B(`common.loading`)}</span>
            </div>
          </section>`:vd(t,()=>e.retry(),n)}
  </openclaw-modal-dialog>`}function bd({actionLabel:e,error:t,onClose:n,onRetry:r,render:i,stale:a=!1,subtitle:o}){let s=on(t);return H`
    ${i?.()??U}
    ${xd({title:B(a?`lazyView.staleTitle`:`lazyView.errorTitle`),subtitle:o??B(a?`lazyView.staleSubtitle`:`lazyView.genericSubtitle`),actions:H`
        <button class="btn lazy-view-error__action" @click=${r}>
          ${e??B(a?`common.reload`:`lazyView.retry`)}
        </button>
        ${n?H`<button class="btn" type="button" @click=${n}>
                ${B(`common.close`)}
              </button>`:U}
      `,detail:s,inline:!!i,stale:a})}
  `}function xd({actions:e,className:t,detail:n,inline:r=!1,role:i=`alert`,stale:a=!1,subtitle:o,title:s}){let c=`lazy-view-error${r?` lazy-view-error--inline`:``}${a?` lazy-view-error--stale`:``}${t?` ${t}`:``}`;return H`
    <div class=${c} role=${i}>
      <div class="lazy-view-error__icon" aria-hidden="true">
        ${fl(a?`refresh`:`alertTriangle`)}
      </div>
      <div class="lazy-view-error__title">${s}</div>
      <div class="lazy-view-error__subtitle">${o}</div>
      ${e?H`<div class="lazy-view-error__actions">${e}</div>`:U}
      ${n?H`<code class="lazy-view-error__detail">${n}</code>`:U}
    </div>
  `}function Sd(){return(Sd=e((()=>{W(),V(),wa(),ml(),_d()})))()}function Cd(e){return oa(kr.terminalPanel,e)}function wd(e){return oa(kr.homePanel,e)}var Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd;function Id(){return(Id=e((()=>{fi(),Td=`openclaw:terminal-toggle`,Ed=`openclaw:terminal-dock-bottom`,Dd=`openclaw:browser-toggle`,Od=`openclaw:desktop-toggle`,kd=`openclaw:portal-toggle`,Ad=`openclaw:home-toggle`,jd=`openclaw:custodian-toggle`,Md=`openclaw:debug-overlay-request`,Nd=`openclaw:keyboard-shortcuts-request`,Pd=`openclaw:link-reader-panel-toggle`,Fd=`openclaw:ui-command`})))()}var Ld,Rd;function zd(){return(zd=e((()=>{o(),W(),No(),Gc(),qu(),Yu(),xu(),Qc(),V(),Rn(),Ti(),na(),Ji(),Zr(),la(),Er(),nd(),sd(),fd(),ml(),Sd(),Id(),a(),Ld={tagName:`openclaw-assistant-panel-content`,get label(){return B(`assistantPanel.title`)},loadModule:()=>z(()=>import(`./assistant-panel-content-Tev0SwDP.js`),__vite__mapDeps([79,3,2,4,5,7,1,8,9,6,80,10,11,12,13,14,15,16,17,18,19,81,82,83,84,21,22,85,86,23,87,73,88,28,29,30,31,32,89,90,33,34,91,35,92,74,93,94,95]),import.meta.url)},Rd=class extends Ha{constructor(){super(),this.custodianAvailable=!1,this.homeAvailable=!1,this.custodianSuppressed=!1,this.pageSessionKey=``,this.pageAgentId=``,this.pageRouteId=`chat`,this.pageRouteFailed=!1,this.homeStarted=!1,this.pendingPrimaryPane=null,this.destination=`custodian`,this.contentLoader=new $l(this),this.minimizeRequestId=0,this.dockLayout=new od(this,{layout:dd,reservationPrefix:`assistant`,isAvailable:()=>this.available}),this.onToggleRequest=e=>this.handleToggleRequest(e),this.handledMinimizeRequestId=0,this.targetScope=``,this.homeDefaults={},this.startHomeAfterPrimaryChat=()=>{if(this.homeStarted||!this.dockLayout.open||this.destination!==`home`)return;if(this.pageRouteId!==`chat`||this.pageRouteFailed){this.homeStarted=!0;return}let e=this.primaryChatPane();if(!e?.transcriptReady||this.pendingPrimaryPane===e)return;this.pendingPrimaryPane=e;let t=this.context;Promise.resolve().then(()=>e.updateComplete).then(()=>{this.pendingPrimaryPane===e&&(this.pendingPrimaryPane=null,this.isConnected&&this.context===t&&this.primaryChatPane()===e&&e.transcriptReady&&(this.homeStarted=!0))})},new Fa(this).watch(()=>this.context,(e,t)=>At(e,t)).watch(()=>this.store,(e,t)=>e.subscribe(t)).watch(()=>this.context?.agentSelection,(e,t)=>e.subscribe(t)).watch(()=>this.context?.agents,(e,t)=>e.subscribe(t)).watch(()=>this.context?.gateway,(e,t)=>e.subscribe(t))}connectedCallback(){super.connectedCallback(),document.addEventListener(ka,this.startHomeAfterPrimaryChat),document.addEventListener(zr,this.startHomeAfterPrimaryChat),window.addEventListener(jd,this.onToggleRequest),window.addEventListener(Ad,this.onToggleRequest),this.dockLayout.setSuppressed(this.restoreSuppressed)}disconnectedCallback(){document.removeEventListener(ka,this.startHomeAfterPrimaryChat),document.removeEventListener(zr,this.startHomeAfterPrimaryChat),this.pendingPrimaryPane=null,window.removeEventListener(jd,this.onToggleRequest),window.removeEventListener(Ad,this.onToggleRequest),this.claimInput(`page`),super.disconnectedCallback()}willUpdate(){let e=this.dockLayout.open,t=this.context?.gateway.connection.gatewayUrl??``;if(t!==this.targetScope){this.targetScope=t,this.homeStarted=!1,this.pendingPrimaryPane=null,this.homeDefaults={};let e=null;try{e=I(JSON.parse($n()?.getItem(this.targetStorageKey)??`null`))}catch{}this.destination=e?.destination===`home`?`home`:`custodian`}this.context?.gateway.snapshot.phase===`connected`&&(this.homeDefaults={agentsList:this.context.agents.state.agentsList??this.homeDefaults.agentsList,hello:this.context.gateway.snapshot.hello}),this.dockLayout.setSuppressed(this.restoreSuppressed),this.minimizeRequestId>0&&this.minimizeRequestId!==this.handledMinimizeRequestId&&this.custodianAvailable&&this.store&&(this.handledMinimizeRequestId=this.minimizeRequestId,this.store.hasRealUserTurn()&&this.openDestination(`custodian`)),this.available?this.dockLayout.restoreOpenState():this.dockLayout.hideWithoutPersisting(),e&&!this.dockLayout.open&&this.claimInput(`page`),this.context&&this.custodianAvailable&&!this.custodianSuppressed&&window.innerWidth>1100&&Ea(this.context)&&this.openDestination(`custodian`),this.startHomeAfterPrimaryChat(),this.contentLoader.requestWhileActive(Ld,this.dockLayout.open&&(this.destination!==`home`||this.homeStarted)||this.custodianAvailable&&this.minimizeRequestId>this.handledMinimizeRequestId),this.dockLayout.syncReservation()}primaryChatPane(){return[...(this.closest(`openclaw-app-shell`)??this.parentElement)?.querySelectorAll(`openclaw-chat-pane.chat-pane-cache__pane--active`)??[]].find(e=>e.presented!==!1&&e.sessionKey&&Or(e.sessionKey,this.pageSessionKey))}get targetStorageKey(){return`openclaw.assistant.panel.target.v1:${this.targetScope}`}persistTarget(){try{$n()?.setItem(this.targetStorageKey,JSON.stringify({destination:this.destination}))}catch{}}get homeTarget(){let e=this.homeDefaults,t=tn(e.agentsList?.agents??[]),n=Fr(e),r=this.context?.agentSelection.state.selectedId,i=r?M(r):``,a=t.find(e=>e.id===i)?.id??t.find(e=>e.id===n)?.id??t[0]?.id??n;return{...bi(e,u({agentId:a,mainKey:Ei(e)}),a),agentId:a}}availableFor(e){return e===`home`?this.homeAvailable:this.custodianAvailable}get available(){return this.availableFor(this.destination)}get suppressed(){if(this.destination===`custodian`)return this.custodianSuppressed;if(!this.context||this.pageRouteId!==`chat`)return!1;let e=bi(this.homeDefaults,this.pageSessionKey,this.pageAgentId),t=this.homeTarget;return e.sessionKey===t.sessionKey&&M(e.agentId)===t.agentId}claimInput(e){this.context&&Wu(this.context).claim(e)}get restoreSuppressed(){return this.suppressed||this.destination===`custodian`&&Cc(this.pageRouteId)}openDestination(e){this.destination=e,this.dockLayout.setSuppressed(this.restoreSuppressed),this.available&&(this.setOpen(!0),this.suppressed&&(this.dockLayout.hideWithoutPersisting(),this.claimInput(`page`),e===`home`&&this.openHomePage()))}openHomePage(){if(this.context){let{sessionKey:e,agentId:t}=this.homeTarget,n=co({context:this.context,face:`chat`,sessionKey:e,agentId:t,focusComposer:!0});this.context.navigate(`chat`,n.options)}}setOpen(e){!e&&this.destination===`custodian`&&this.context&&bn(this.context),e&&this.destination===`home`&&(this.homeStarted=!0),this.persistTarget(),this.dockLayout.setOpen(e),this.claimInput(e?`dock`:`page`)}toggle(){if(this.available){if(this.suppressed){this.destination===`home`&&this.openHomePage();return}this.setOpen(!this.dockLayout.open)}}handleToggleRequest(e){let t=e.type===`openclaw:home-toggle`?`home`:`custodian`;if(!this.availableFor(t))return;let n=I(e instanceof CustomEvent?e.detail:null),r=n?.dock;(r===`right`||r===`bottom`)&&this.dockLayout.setDock(r,!1),n?.open===!1?this.destination===t&&this.setOpen(!1):this.destination!==t||n?.open===!0?this.openDestination(t):this.toggle()}get assistantPanelOpen(){return this.dockLayout.open}render(){let e=this.available&&this.dockLayout.open,t=this.dockLayout.dock,n=this.homeTarget,r=this.contentLoader.visibleState,i=t===`bottom`?`height:${this.dockLayout.height}px`:`width:${this.dockLayout.width}px`;return H`
      <section
        class="assistant-panel assistant-panel--${t}"
        style=${i}
        ?hidden=${!e}
        aria-label=${B(`assistantPanel.title`)}
        @pointerdown=${()=>this.claimInput(`dock`)}
        @focusin=${()=>this.claimInput(`dock`)}
      >
        ${this.dockLayout.renderResizer(`assistant-panel`,B(`assistantPanel.resize`))}
        <header class="rail-header assistant-panel-header" @mousedown=${Yc}>
          <div class="assistant-panel-title">
            <openclaw-mascot
              .mood=${this.destination===`custodian`&&this.store?.sending?`thinking`:`idle`}
              .size=${16}
            ></openclaw-mascot>
            ${[`home`,`custodian`].map(e=>this.availableFor(e)?H`<button
                    type="button"
                    class="assistant-panel-tab"
                    aria-pressed=${this.destination===e}
                    @click=${()=>this.openDestination(e)}
                  >
                    ${B(e===`home`?`assistantPanel.home`:`nav.askOpenClaw`)}
                  </button>`:U)}
          </div>
          <div class="rail-header__actions assistant-panel-actions">
            ${this.destination===`home`?H`<button
                    class="rail-header__action assistant-panel-icon"
                    type="button"
                    aria-label=${B(`assistantPanel.openHome`)}
                    @click=${()=>this.openHomePage()}
                  >
                    ${pl.maximize}
                  </button>`:U}
            <button
              class="rail-header__action assistant-panel-icon"
              type="button"
              aria-label=${B(t===`bottom`?`assistantPanel.dockRight`:`assistantPanel.dockBottom`)}
              @click=${()=>this.dockLayout.setDock(t===`bottom`?`right`:`bottom`)}
            >
              ${t===`bottom`?pl.panelRightOpen:pl.panelBottomOpen}
            </button>
            <button
              class="rail-header__action assistant-panel-icon"
              type="button"
              aria-label=${B(`assistantPanel.close`)}
              @click=${()=>this.setOpen(!1)}
            >
              ${pl.x}
            </button>
          </div>
        </header>
        ${Zl(Ld)?H`<openclaw-assistant-panel-content
                ?hidden=${!e||this.destination===`home`&&!this.homeStarted}
                .active=${e&&(this.destination!==`home`||this.homeStarted)}
                .destination=${this.destination}
                .sessionKey=${n.sessionKey}
                .agentId=${n.agentId}
                .context=${this.context}
                .pageRouteId=${this.pageRouteId}
                .pageSessionKey=${this.pageSessionKey}
                .pageAgentId=${this.pageAgentId}
                .store=${this.store}
                @assistant-custodian-store=${e=>{this.store=e.detail}}
              ></openclaw-assistant-panel-content>`:U}
        ${e&&(!Zl(Ld)||this.destination===`home`&&!this.homeStarted)?r?.status===`error`?vd(r,()=>this.contentLoader.retry(),()=>this.setOpen(!1)):td():U}
      </section>
    `}},L([Tt({context:Ju,subscribe:!0}),q({attribute:!1})],Rd.prototype,`context`,void 0),L([q({type:Boolean})],Rd.prototype,`custodianAvailable`,void 0),L([q({type:Boolean})],Rd.prototype,`homeAvailable`,void 0),L([q({type:Boolean})],Rd.prototype,`custodianSuppressed`,void 0),L([q()],Rd.prototype,`pageSessionKey`,void 0),L([q()],Rd.prototype,`pageAgentId`,void 0),L([q()],Rd.prototype,`pageRouteId`,void 0),L([q({type:Boolean})],Rd.prototype,`pageRouteFailed`,void 0),L([G()],Rd.prototype,`homeStarted`,void 0),L([G()],Rd.prototype,`destination`,void 0),L([q({type:Number})],Rd.prototype,`minimizeRequestId`,void 0),L([q({attribute:!1})],Rd.prototype,`store`,void 0),customElements.get(`openclaw-assistant-panel`)||customElements.define(`openclaw-assistant-panel`,Rd)})))()}function Bd(){return typeof(typeof window>`u`?void 0:window)?.webkit?.messageHandlers?.openclawBrowser?.postMessage==`function`}function Vd(){return(Vd=e((()=>{})))()}function Hd(e,t){let n=Ud.size>0;Ud.delete(e),t&&Ud.add(e);let r=Ud.size>0;n!==r&&window.dispatchEvent(new CustomEvent(`openclaw:native-modal-state`,{detail:{open:r}}))}var Ud,Wd;function Gd(){return(Gd=e((()=>{Ve(),W(),No(),fn(),Ji(),Ud=document.openClawModalLayers??=new Set,Wd=class extends ti{constructor(...e){super(...e),this.open=!0,this.manual=!1,this.label=``,this.description=``,this.#t=null,this.#r=0,this.#i=!1,this.#a=!1,this.#o=!1,this.#u=()=>{this.#a&&(this.#o=!0)},this.#d=e=>{e.target===e.currentTarget&&this.#f(e instanceof FocusEvent?e.relatedTarget:null)},this.#p=e=>{if(e.target!==e.currentTarget)return;this.#l();let t=this.#n,n=this.#t;this.#n=void 0,this.open=!1,this.#t=null,t!==void 0&&setTimeout(()=>{t===null?n&&document.activeElement===n&&n.blur():t.isConnected&&t.focus({preventScroll:!0})},0)},this.#m=e=>{if(e.target!==e.currentTarget)return;if(this.#i){this.#i=!1;return}let t=new CustomEvent(`modal-cancel`,{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(t),t.defaultPrevented&&e.preventDefault()}}get#e(){return this.renderRoot?.querySelector(`wa-dialog`)}#t;#n;#r;#i;#a;#o;#s;static{this.styles=Mo`
    :host {
      /* Slotted document panels share the standard/fullscreen shell height limit. */
      --openclaw-modal-height-limit: var(--openclaw-modal-max-height, calc(100dvh - 48px));
      display: contents;
    }

    wa-dialog {
      --width: min(var(--openclaw-modal-width, 540px), calc(100vw - 48px));
      --spacing: 0;
      --backdrop-filter: var(--openclaw-modal-backdrop-filter, blur(4px));
    }

    wa-dialog::part(dialog) {
      max-width: var(--openclaw-modal-max-width, calc(100vw - 48px));
      max-height: var(--openclaw-modal-height-limit);
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--text);
      overflow: visible;
    }

    wa-dialog::part(body) {
      padding: 0;
      overflow: visible;
    }

    :host(.fullscreen) {
      --openclaw-modal-height-limit: calc(100dvh - 20px);
    }

    :host(.fullscreen) wa-dialog {
      --width: calc(100vw - 20px);
    }

    :host(.fullscreen) wa-dialog::part(dialog) {
      max-width: calc(100vw - 20px);
    }

    :host(.viewport-edge-to-edge) wa-dialog {
      --width: 100vw;
    }

    :host(.viewport-edge-to-edge) wa-dialog::part(dialog) {
      width: 100vw;
      height: 100dvh;
      max-width: none;
      max-height: none;
      margin: 0;
      border-radius: 0;
    }

    /* Slotted scroll containers need the body's definite viewport height. */
    :host(.viewport-edge-to-edge) wa-dialog::part(body),
    :host(.drawer) wa-dialog::part(body) {
      height: 100%;
    }

    :host(.palette) wa-dialog::part(dialog) {
      margin-block-start: min(20dvh, 160px);
      margin-block-end: auto;
    }

    :host(.palette) wa-dialog {
      --openclaw-modal-backdrop-filter: none;
      --wa-color-overlay-modal: color-mix(in oklab, black 12%, transparent);
      --show-duration: 0ms;
      --hide-duration: 0ms;
    }

    :host(.drawer) wa-dialog {
      --width: min(var(--openclaw-modal-width, 100vw), 100vw);
      --show-duration: 200ms;
      --hide-duration: 0ms;
    }

    :host(.drawer) wa-dialog::part(dialog) {
      height: 100dvh;
      max-width: 100vw;
      max-height: 100dvh;
      margin: 0 0 0 auto;
      border-radius: 0;
    }

    :host(.drawer) wa-dialog[open]::part(dialog) {
      animation: openclaw-drawer-in 200ms cubic-bezier(0.32, 0.72, 0, 1);
    }

    :host(.drawer--floating) {
      --openclaw-drawer-inset: 20px;
      --openclaw-modal-height-limit: calc(100dvh - var(--openclaw-drawer-inset) * 2);
    }

    :host(.drawer--floating) wa-dialog {
      --width: min(
        var(--openclaw-modal-width, 620px),
        calc(100vw - var(--openclaw-drawer-inset) * 2)
      );
    }

    :host(.drawer--floating) wa-dialog::part(body) {
      height: 100%;
    }

    :host(.drawer--floating) wa-dialog::part(dialog) {
      height: calc(100dvh - var(--openclaw-drawer-inset) * 2);
      max-width: calc(100vw - var(--openclaw-drawer-inset) * 2);
      max-height: calc(100dvh - var(--openclaw-drawer-inset) * 2);
      margin: var(--openclaw-drawer-inset) var(--openclaw-drawer-inset) auto auto;
      border-radius: var(--radius-xl);
    }

    @keyframes openclaw-drawer-in {
      from {
        transform: translateX(calc(100% + var(--openclaw-drawer-inset, 0px)));
      }
      to {
        transform: translateX(0);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      :host(.drawer) wa-dialog {
        --show-duration: 0ms;
      }

      :host(.drawer) wa-dialog[open]::part(dialog) {
        animation: none;
      }
    }
    @media (max-width: 640px) {
      :host(.drawer--floating) {
        --openclaw-drawer-inset: 12px;
      }

      :host {
        --openclaw-modal-height-limit: 90dvh;
      }

      wa-dialog {
        --width: min(var(--openclaw-modal-width, 540px), calc(100vw - 24px));
      }

      wa-dialog::part(dialog) {
        max-width: var(--openclaw-modal-max-width, calc(100vw - 24px));
      }
    }

    @media (max-width: 768px),
      (max-width: 932px) and (max-height: 500px) and (orientation: landscape) {
      :host(.mobile-edge-to-edge) wa-dialog {
        --width: 100vw;
      }

      :host(.mobile-edge-to-edge) wa-dialog::part(dialog) {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        margin: 0;
        border-radius: 0;
      }

      :host(.mobile-edge-to-edge) wa-dialog::part(body) {
        height: 100%;
      }
    }
  `}connectedCallback(){this.manual&&(this.open=!1),super.connectedCallback(),this.open&&(Hd(this,!0),this.#s??=pr()),this.updateComplete.then(()=>this.#c())}disconnectedCallback(){Hd(this,!1),this.#l(),this.#r+=1,this.#a=!1;let e=this.#e,t=e?.shadowRoot?.querySelector(`dialog`);t?.open&&t.close(),e&&(e.open=!1);let n=this.#n===void 0?this.#t:this.#n;this.#t=null,this.#n=void 0,n?.isConnected&&n.focus({preventScroll:!0}),super.disconnectedCallback()}render(){return H`
      <wa-dialog
        without-header
        light-dismiss
        .label=${this.label}
        @pointerdown=${{handleEvent:this.#u,capture:!0}}
        @keydown=${{handleEvent:this.#u,capture:!0}}
        @focusin=${this.#d}
        @wa-after-show=${this.#d}
        @wa-after-hide=${this.#p}
        @wa-hide=${this.#m}
      >
        <slot></slot>
      </wa-dialog>
    `}updated(e){e.has(`open`)&&(Hd(this,this.open&&this.isConnected),this.open&&this.isConnected&&(this.#s??=pr())),this.#c()}async#c(){let e=++this.#r,t=this.#e;if(!t||(await t.updateComplete,e!==this.#r||!this.isConnected))return;let n=t.shadowRoot?.querySelector(`dialog`);if(n){if(n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-modal`,`true`),this.label?n.setAttribute(`aria-label`,this.label):n.removeAttribute(`aria-label`),this.description?n.setAttribute(`aria-description`,this.description):n.removeAttribute(`aria-description`),this.open){n?.open||(this.#t=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#a=!0,this.#o=!1,t.open=!0,await t.updateComplete),e===this.#r&&this.isConnected&&this.open&&n?.open&&this.#a&&(this.#a=!1,this.#f(null,n,!this.#o));return}this.#a=!1,t.open||n?.open?(this.#i=!0,t.open=!1):this.#l()}}#l(){this.#s?.(),this.#s=void 0}#u;#d;#f(e=null,t,n=!1){if(!this.isConnected)return;let r=this.getRootNode(),i=r instanceof ShadowRoot?r.activeElement:this.ownerDocument.activeElement,a=this.querySelector(`[autofocus]`);i instanceof HTMLElement&&i!==this&&this.contains(i)&&(!n||!a||i===a)||(e instanceof HTMLElement&&this.contains(e)?e:a??t)?.focus({preventScroll:!0})}#p;#m;show(){this.open=!0}setReturnFocusTarget(e){this.#n=e}hide(){this.open=!1}},L([q({type:Boolean})],Wd.prototype,`open`,void 0),L([q({type:Boolean,reflect:!0})],Wd.prototype,`manual`,void 0),L([q()],Wd.prototype,`label`,void 0),L([q()],Wd.prototype,`description`,void 0),customElements.get(`openclaw-modal-dialog`)||customElements.define(`openclaw-modal-dialog`,Wd)})))()}function Kd(e,t){return t?.status===`pending`&&t.module===void 0&&t.error===void 0&&e?e:t??e}function qd(e){return{status:e.status,active:e.matches[0],pending:e.pendingMatches[0]}}function Jd(){return{status:`idle`,active:void 0,pending:void 0,settled:void 0,showPending:!1}}var Yd,Xd;function Zd(){return(Zd=e((()=>{Yd=1e3,Xd=class{constructor(e,t={}){this.invalidate=e,this.connected=!1,this.selection=Jd(),this.snapshotValue=Jd(),this.showPending=!1,this.notFoundActive=!1,this.notFoundDeclined=!1,this.notFoundQueued=!1,this.notFoundGeneration=0,this.notFoundRecoveryReady=!0,this.pendingDelayMs=t.pendingDelayMs??Yd}get snapshot(){return this.snapshotValue}setInputs(e){this.onNotFound=e.onNotFound;let t=e.notFoundRecoveryReady??!0,n=!this.notFoundRecoveryReady&&t&&this.notFoundDeclined;if(this.notFoundRecoveryReady=t,this.router===e.router){n&&this.selection.status===`notFound`&&(this.cancelNotFoundEffect(),this.updateNotFoundEffect(this.selection.status));return}if(this.detachSource(),this.router=e.router,this.settled=void 0,this.connected){this.attachSource();return}let r=e.router?qd(e.router.getState()):Jd();this.applySelection(r)}connect(){this.connected||(this.connected=!0,this.attachSource(!1),this.invalidate())}disconnect(){this.connected&&(this.connected=!1,this.detachSource())}attachSource(e=!0){let t=this.router;if(!this.unsubscribe){if(!t){this.applySelection(Jd(),e);return}this.applySelection(qd(t.getState()),e),this.unsubscribe=t.subscribe(()=>this.applySelection(qd(t.getState())))}}detachSource(){this.unsubscribe?.(),this.unsubscribe=void 0,this.clearPendingTimer(),this.pendingMatchId=void 0,this.showPending=!1,this.cancelNotFoundEffect()}applySelection(e,t=!0){if(this.selection=e,e.status===`idle`||e.status===`notFound`)this.settled=void 0;else{let t=Kd(e.active,e.pending);t?.status===`success`?this.settled=t:(t?.status===`error`||t?.status===`notFound`||t?.status===`redirected`)&&(this.settled=void 0)}let n=e.pending;n?.status!==`pending`||n.module!==void 0||n.error!==void 0||e.active?(this.clearPendingTimer(),this.pendingMatchId=void 0,this.showPending=!1):this.pendingMatchId===n.id?this.connected&&!this.showPending&&this.pendingTimer===void 0&&this.schedulePendingFallback(n.id):(this.clearPendingTimer(),this.pendingMatchId=n.id,this.showPending=!1,this.schedulePendingFallback(n.id)),this.publish({...e,settled:this.settled,showPending:this.showPending},t),this.updateNotFoundEffect(e.status)}schedulePendingFallback(e){this.connected&&(this.pendingTimer=globalThis.setTimeout(()=>{this.pendingTimer=void 0;let t=this.selection.pending,n=t?.id===e&&t.status===`pending`&&t.module===void 0&&t.error===void 0&&!this.selection.active;this.connected&&this.pendingMatchId===e&&n&&(this.showPending=!0,this.publish({...this.selection,settled:this.settled,showPending:!0}))},this.pendingDelayMs))}updateNotFoundEffect(e){if(e!==`notFound`){(this.notFoundActive||this.notFoundQueued)&&this.cancelNotFoundEffect();return}if(!this.connected||this.notFoundActive)return;this.notFoundActive=!0,this.notFoundQueued=!0;let t=++this.notFoundGeneration;queueMicrotask(()=>{this.connected&&t===this.notFoundGeneration&&this.selection.status===`notFound`&&(this.notFoundQueued=!1,this.onNotFound?.()===!1&&(this.notFoundDeclined=!0))})}cancelNotFoundEffect(){this.notFoundGeneration+=1,this.notFoundActive=!1,this.notFoundDeclined=!1,this.notFoundQueued=!1}publish(e,t=!0){let n=this.snapshotValue;(n.status!==e.status||n.active!==e.active||n.pending!==e.pending||n.settled!==e.settled||n.showPending!==e.showPending)&&(this.snapshotValue=e,t&&this.connected&&this.invalidate())}clearPendingTimer(){this.pendingTimer!==void 0&&(globalThis.clearTimeout(this.pendingTimer),this.pendingTimer=void 0)}}})))()}function Qd(e,t){if(!ss(e)||!t||typeof t!=`object`)return;let n=t;return n.kind===`session`&&typeof n.sessionKey==`string`&&n.sessionKey.trim()||void 0}function $d(e){let t=Kd(e.matches[0],e.pendingMatches[0]),n=e.matches[0],r=n?Qd(n.routeId,n.data):void 0;return{routeId:t?.routeId,location:t?.location,routeFailed:t?t.status===`error`||t.status===`notFound`:e.status===`notFound`||void 0,committedRouteId:n?.routeId,committedLocation:n?.location,committedSessionKey:r}}function ef(e,t){return e.routeId===t.routeId&&e.routeFailed===t.routeFailed&&bs(e.location,t.location)&&e.committedRouteId===t.committedRouteId&&bs(e.committedLocation,t.committedLocation)&&e.committedSessionKey===t.committedSessionKey}function tf(){return(tf=e((()=>{Y(),Zd()})))()}function nf(e){if(!e.pendingGatewayUrl)return U;let t=B(`connection.switchGateway.title`),n=B(`connection.switchGateway.summary`),r=po(e.currentGatewayUrl),i=po(e.pendingGatewayUrl),a=!!e.currentGatewayUrl.trim()&&Ze(e.currentGatewayUrl)!==Ze(e.pendingGatewayUrl),o=[B(`connection.switchGateway.note`),e.linkCarriesToken?B(`connection.switchGateway.noteToken`):null,a?B(`connection.switchGateway.noteScoped`,{host:r}):null].filter(Boolean);return H`
    <openclaw-modal-dialog label=${t} description=${n} @modal-cancel=${e.onCancel}>
      <div class="gateway-switch">
        <div class="gateway-switch__head">
          <span class="gateway-switch__icon" aria-hidden="true">${pl.shieldAlert}</span>
          <div class="gateway-switch__text">
            <h2 class="gateway-switch__title">${t}</h2>
            <p class="gateway-switch__summary">${n}</p>
          </div>
        </div>
        <div class="gateway-switch__hosts">
          <div class="gateway-switch__host">
            <span class="gateway-switch__label">${B(`connection.switchGateway.current`)}</span>
            <code translate="no">${e.currentGatewayUrl.trim()||B(`common.na`)}</code>
          </div>
          <span class="gateway-switch__arrow" aria-hidden="true">${pl.arrowRight}</span>
          <div class="gateway-switch__host gateway-switch__host--next">
            <span class="gateway-switch__label">${B(`connection.switchGateway.next`)}</span>
            <code translate="no">${e.pendingGatewayUrl}</code>
          </div>
        </div>
        <p class="gateway-switch__note">${o.join(` `)}</p>
        <div class="gateway-switch__actions">
          <button type="button" class="btn primary" @click=${e.onConfirm}>
            ${B(`connection.switchGateway.confirm`,{host:i})}
          </button>
          <button type="button" class="btn" @click=${e.onCancel}>
            ${B(`connection.switchGateway.cancel`)}
          </button>
        </div>
      </div>
    </openclaw-modal-dialog>
  `}var rf;function af(){return(af=e((()=>{W(),No(),V(),Qn(),Ji(),ml(),Gd(),rf=class extends ha{render(){return this.props?nf(this.props):U}},L([q({attribute:!1})],rf.prototype,`props`,void 0),customElements.get(`openclaw-gateway-url-confirmation`)||customElements.define(`openclaw-gateway-url-confirmation`,rf)})))()}function of(e){let t={focus:t=>void e(t,`focus`),pointer:t=>void e(t,`pointer`)};return document.addEventListener(`pointerover`,t.pointer,!0),document.addEventListener(`focusin`,t.focus,!0),()=>{document.removeEventListener(`pointerover`,t.pointer,!0),document.removeEventListener(`focusin`,t.focus,!0)}}function sf(e,t,n=!1){return t===`pointer`?e.matches(`:hover`):n?document.activeElement instanceof Node&&e.contains(document.activeElement):e.matches(`:focus`)}function cf(e,t){return Math.max(0,t-(performance.now()-e))}var lf;function uf(){return(uf=e((()=>{xu(),lf=class{constructor(e){this.params=e,this.stopListeners=null}install(e){customElements.get(this.params.tag)||(this.stopListeners=of(e))}providerFor(e){let t=e;for(;t;){let e=t.closest(this.params.tag);if(e)return e;t=Lr(t)}return null}async define(){await Xl(this.params.tag,async()=>{let e=await this.params.load();customElements.get(this.params.tag)||customElements.define(this.params.tag,e)}),this.stopListeners?.(),this.stopListeners=null,this.params.onDefined?.()}}})))()}function df(e){return/^(?:www\.)?github\.com\.?$/i.test(e)}function ff(e,t){try{let n=decodeURIComponent(e),r=decodeURIComponent(t);return/^[a-z\d](?:[a-z\d-]{0,37}[a-z\d])?$/i.test(n)&&/^[a-z\d._-]{1,100}$/i.test(r)&&!/^\.{1,2}$|\.(?:git|atom)$/i.test(r)?[n,r]:null}catch{return null}}function pf(e){if(!e.href.startsWith(`https://github.com/`))return!1;let t=/^\/([^/]+)\/([^/]+)\/?$/u.exec(e.pathname),n=t?ff(t[1],t[2]):null;return!(!n||/^(?:account|accounts|apps|auth|codespaces|copilot|dashboard|discussions|email|emails|enterprises|github-copilot|issues|join|login|logout|marketplace|new|notifications|oauth|orgs|organizations|projects|pulls|repositories|session|sessions|settings|signup|sponsors|stars|two-factor|user|users|verify|watching)$/i.test(n[0]))}function mf(e){let t=/^\/([^/]+)\/([^/]+)\/(?:issues\/([1-9]\d{0,9})|pull\/([1-9]\d{0,9})(?:\/(?:files|checks|commits(?:\/[a-fA-F\d]{7,40})?))?)\/?$/u.exec(e.pathname);if(!t)return null;let n=ff(t[1],t[2]);return n?[...n,t[3],t[4]]:null}function hf(e){return e.href.startsWith(`https://github.com/`)?mf(e):null}function gf(){return(gf=e((()=>{})))()}function _f(e,t){if(!e||e.length>8192)return null;let n=URL.parse(e);if(!n||n.protocol!==`https:`||n.username||n.password||n.port)return null;for(let e of t){if(!e.linkReader.hosts.includes(n.hostname))continue;let t=wf.get(e);if(t===void 0){try{t=new RegExp(e.linkReader.pathPattern,`u`)}catch{t=null}wf.set(e,t)}if(t?.test(n.pathname))return{href:n.href,reader:e}}return null}function vf(e){return e.reader.pluginId+`:`+e.reader.id+`:`+e.href.split(`#`,1)[0]}function yf(e){let t=URL.parse(e.href);if(t&&df(t.hostname)&&!hf(t)&&!pf(t)||e.matches(`[download], [data-file-path], [data-session-href], .markdown-session-link, [data-link-reader-external]`))return!1;for(let t=e;t;t=Lr(t))if(t.matches(`openclaw-tooltip, openclaw-browser-tab-card, wa-popover, .link-reader-hovercard, .link-hovercard, .session-progress-hovercard, .chat-source-card`))return!1;return!0}function bf(e){let t=e.pagePreviewContext;return!!(t?.config.current.automaticallyFetchFavicons&&t.gateway.snapshot.client===e.client&&Fo(t.gateway.snapshot,`controlUi.linkPreview`,`operator.read`,{requireAdvertisement:!1}))}function xf(e,t){if(!t.client||!yf(e))return null;let n=_f(e.href,t.claimedReaders?.length?t.claimedReaders:t.readers);if(n)return n.reader.linkReader.previewMethod&&t.readers.includes(n.reader)?n:null;if(!bf(t))return null;let r=URL.parse(e.href);return r&&[`http:`,`https:`].includes(r.protocol)&&r.origin!==location.origin&&!r.username&&!r.password&&r.href.length<=2048?{kind:`page`,href:r.href}:null}var Sf,Cf,wf;function Tf(){return(Tf=e((()=>{Lo(),Sf=`openclaw-link-reader-hovercard-provider`,Cf=[],wf=new WeakMap})))()}function Ef(e){let t=kf.providerFor(e);return t?xf(e,t):null}function Df(e){let t=Ef(e);return!!(t&&(t.reader||customElements.get(`openclaw-link-reader-hovercard-provider`)))}async function Of(e,t){if(t===`pointer`&&e instanceof PointerEvent&&e.pointerType===`touch`)return;let n=Ci(e),r=n?Ef(n):null;if(r&&!r.reader&&t===`focus`&&!n?.matches(`:focus-visible`)||!n||!r)return;let i=performance.now();try{await kf.define()}catch{return}let a=kf.providerFor(n);await a?.updateComplete;let o=Ef(n);a&&o&&n.isConnected&&o?.reader===r.reader&&o.href===r.href&&sf(n,t)&&a.activateFromBootstrap(n,r,t,t===`pointer`?cf(i,250):0)}var kf;function Af(){return(Af=e((()=>{uf(),Tf(),a(),kf=new lf({tag:Sf,load:async()=>(await z(async()=>{let{LinkReaderHovercardProvider:e}=await import(`./link-reader-hovercard-BCyqj9WV.js`);return{LinkReaderHovercardProvider:e}},__vite__mapDeps([96,2,3,1,4,5,8,9,6,7,10,11,12,13,14,15,16,17,18,19,61,28,29,30,31,32,97]),import.meta.url)).LinkReaderHovercardProvider}),kf.install(Of)})))()}function jf(e){return e.hasAttribute(`aria-label`)||e.hasAttribute(`aria-labelledby`)||e.matches(`img[alt], input[alt]`)||Ou(e).trim()?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?!e.labels?.length&&!e.matches(`input[type="button"], input[type="submit"], input[type="reset"]`):!0}function Mf(e){let t=null,n=null,r=()=>{if(!n)return;let{anchor:e,title:r,label:i}=n;n=null,o.disconnect(),e.removeEventListener(`pointerleave`,s),e.removeEventListener(`focusout`,c),r!==null&&e.getAttribute(`title`)===``&&e.setAttribute(`title`,r),i!==null&&e.getAttribute(`aria-label`)===i&&e.removeAttribute(`aria-label`),t&&(t.anchor=null,t.remove())},i=e=>!!(e&&Df(e)),a=()=>i(n?.link)||n?.anchor.matches(`[aria-haspopup="dialog"][aria-expanded="true"]`)?``:n?.anchor.getAttribute(`data-tooltip`)??n?.title??``,o=new MutationObserver(e=>{if(n){if(!n.anchor.isConnected){r();return}i(n.link)&&(n.previewOwned=!0,t&&(t.content=``)),e.some(e=>n?.anchor.contains(e.target)||e.target===n?.link)&&(e.some(e=>e.target===n?.anchor&&e.attributeName===`title`)&&(n.title=n.anchor.getAttribute(`title`),n.title!==null&&(n.anchor.setAttribute(`title`,``),o.takeRecords())),n.label!==null&&n.anchor.getAttribute(`aria-label`)===n.label&&(n.anchor.removeAttribute(`aria-label`),n.label=null),n.title&&jf(n.anchor)&&(n.label=n.title,n.anchor.setAttribute(`aria-label`,n.label)),t&&(t.content=a()))}}),s=e=>{n&&e.target===n.anchor&&(n.pointer=!1,n.focus||r())},c=e=>{!n||e instanceof FocusEvent&&e.relatedTarget instanceof Node&&n.anchor.contains(e.relatedTarget)||(n.focus=!1,n.pointer||r())},l=l=>{if(`pointerType`in l&&l.pointerType===`touch`)return;let u=l.composedPath().filter(Tu),d=Ci(l),f=u.some(e=>e.localName===`openclaw-tooltip`),p;for(let e of u){if(e.localName===`iframe`)break;let t=e===n?.anchor?n.title:e.getAttribute(`title`),r=e.getAttribute(`data-tooltip`)??t;if(r!==null){p=r?e:void 0;break}}let m=l.type===`focusin`?`focus`:`pointer`,h=i(d);if(p===n?.anchor&&h===n?.previewOwned){n&&(n.link=d,n[m]=!0,d&&!n.anchor.contains(d)&&o.observe(d,{attributes:!0,attributeFilter:[`href`]}));return}if(!p&&n?.focus&&m===`pointer`||(r(),!p))return;let g=p.getAttribute(`title`),_=g&&jf(p)?g:null;n={anchor:p,link:d,previewOwned:h,title:g,label:_,pointer:m===`pointer`,focus:m===`focus`},g!==null&&p.setAttribute(`title`,``),_!==null&&p.setAttribute(`aria-label`,_),p.addEventListener(`pointerleave`,s),p.addEventListener(`focusout`,c),o.observe(p,{attributes:!0,attributeFilter:[`title`,`data-tooltip`,`aria-hidden`,`aria-haspopup`,`aria-expanded`,`href`],characterData:!0,subtree:!0}),d&&!p.contains(d)&&o.observe(d,{attributes:!0,attributeFilter:[`href`]}),o.observe(e,{childList:!0,subtree:!0});let v=p.getRootNode();v instanceof ShadowRoot&&o.observe(v,{childList:!0,subtree:!0});let y=a();!f&&y&&(t??=e.createElement(`openclaw-tooltip`),(u.find(e=>e.localName===`openclaw-modal-dialog`)??e.body).append(t),t.previewForAnchor(p,y,m))};return e.addEventListener(`pointerover`,l,!0),e.addEventListener(`focusin`,l,!0),()=>{e.removeEventListener(`pointerover`,l,!0),e.removeEventListener(`focusin`,l,!0),r()}}function Nf(){return(Nf=e((()=>{Vu(),Af()})))()}function Pf(e,t,n){return e?!e.scopes||Pe({role:e.role??`operator`,requestedScopes:[t],allowedScopes:e.scopes}):n}function Ff(e){let t=e?.hello?.auth??null;return{canWrite:If(t),canAdmin:Rf(t),canPair:zf(t),canReviewApprovals:!t||Bf(t),canGrantApprovals:Bf(t)}}function If(e){return Pf(e,`operator.write`,!0)}function Lf(e){return Pf(e,`operator.read`,!0)}function Rf(e){return Pf(e,`operator.admin`,!0)}function zf(e){return Pf(e,`operator.pairing`,!1)}function Bf(e){return Pf(e,`operator.approvals`,!1)}function Vf(e){return Lf(e)||Pf(e,`operator.sessions.read`,!0)}function Hf(){return(Hf=e((()=>{Je()})))()}function Uf(e){let t=e.connectionRevision,n=e.snapshot,r=n.phase===`connected`&&n.client?.recoveryScopeReady!==!1,i=n.phase===`connected`?n.selfUser??null:void 0,a=i?.id,o=Wf.get(e);if(!o||o.revision!==t||a!==void 0&&o.userId!==void 0&&o.userId!==a){let n={scope:{key:++Gf,displayUser:i??null,readyOnce:r},revision:t,userId:a};return Wf.set(e,n),n.scope}return o.userId??=a,o.scope.readyOnce||=r,i===void 0?n.phase!==`reconnecting`&&n.phase!==`reload-required`&&(o.scope.displayUser=null):o.scope.displayUser=i,o.scope}var Wf,Gf;function Kf(){return(Kf=e((()=>{Wf=new WeakMap,Gf=0})))()}function qf(e){let t=new URLSearchParams(e).get(`onboarding`);return t!==null&&/^(?:1|true|yes|on)$/iu.test(t.trim())}function Jf(){return(Jf=e((()=>{})))()}var Yf,Xf,Zf,Qf,$f;function ep(){return(ep=e((()=>{W(),Ao(),So(),Yf=[[`pluginEmbed`,`content--plugin-embed`],[`hubHeader`,`content--hub-header`],[`toolbarHeader`,`content--toolbar-header`],[`workbench`,`content--workbench`],[`settingsPage`,`content--settings-page`],[`settingsWide`,`content--settings-wide`],[`settingsWorkspace`,`content--settings-workspace`],[`memoryPage`,`content--memory-page`],[`logsPage`,`content--logs-page`],[`activityPage`,`content--activity-page`],[`terminalPage`,`content--terminal-page`]],Xf=new WeakMap,Zf=class extends wo{constructor(...e){super(...e),this.traits={}}render(e){return U}update(e,[t]){return this.host=e.options?.host instanceof Element?e.options.host:void 0,this.traits=t,this.publish(),U}publish(){let e=this.isConnected&&this.host?.isConnected?this.host.closest(`main.content`):null,t=e?Xf.get(e):void 0;t!==this.controller&&(this.controller?.clear(this),this.controller=t),this.host&&this.controller?.record(this,this.host,this.traits)}disconnected(){this.controller?.clear(this),this.controller=void 0}reconnected(){this.publish()}},Qf=Do(Zf),$f=class{constructor(e){this.host=e,this.reporters=new Map,this.contentRef=e=>{e!==this.content&&(this.content&&Xf.delete(this.content),this.content=e,e&&(Xf.set(e,this),this.apply()))},e.addController(this)}record(e,t,n){if(!t.isConnected||!this.content?.contains(t)||!Yf.some(([e])=>n[e])){this.clear(e);return}let r=this.reporters.get(e);r?.host===t&&Yf.every(([e])=>!!r.traits[e]==!!n[e])||(this.reporters.set(e,{host:t,traits:{...n}}),this.apply(),this.host.requestUpdate())}clear(e){this.reporters.delete(e)&&(this.apply(),this.host.requestUpdate())}get current(){let e={};for(let[t,n]of this.reporters){if(!n.host.isConnected||!this.content?.contains(n.host)){this.reporters.delete(t);continue}for(let[t]of Yf)n.traits[t]&&(e[t]=!0)}return e}get className(){let e=this.current;return Yf.filter(([t])=>e[t]).map(([,e])=>e).join(` `)}apply(){let e=this.current;for(let[t,n]of Yf)this.content?.classList.toggle(n,!!e[t])}hostDisconnected(){this.reporters.clear(),this.apply()}}})))()}function tp(e,t,n){let r=hs(t.pathname,n),i=r?e.getRoute(r):null;i&&Promise.resolve(i.component()).catch(()=>void 0)}function np(e,t,n){return e===`workboard`?Bt(t,n).canonicalLocation??t:e===`plugin`?Uo(t,n):t}function rp(){let e=pe({routes:cp});return{...e,navigate:(t,n,r,i)=>n.nativeConversation?.interceptNavigation(i??vs(t,n.basePath))?Promise.resolve():e.navigate(t,n,r,i?np(t,i,n.basePath):void 0),routeIdFromPath:hs}}function ip(e,t){let n=ms(e.pathname,t);if(!n)return e;let[r,i,a]=n,o=new URLSearchParams(e.search);return o.set(i,a),{...e,pathname:J(r,t),search:`?${o.toString()}`}}function ap(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`notFound`}async function op(e){try{await e}catch(e){if(!ap(e))throw e}}async function sp(e,t,n,r){zo(r.gateway.snapshot.hello?.controlUiTabs);let i=t.location(),a=np(hs(i.pathname,n),i,n);bs(i,a)||(t.replace(a),i=t.location());let o=Qo(i.pathname,n);o?.invalidPanel&&(t.replace({...i,pathname:Zo(o.agentId,null,n)}),i=t.location()),hs(i.pathname,n)===null&&!Bo(i.pathname,n)&&(t.replace({...i,pathname:e.pathForRoute(`chat`,n)}),i=t.location());let s=ms(i.pathname,n);await op(e.start({location:()=>ip(t.location(),n),push:e=>t.push(e),replace:e=>t.replace(e),listen:i=>{let a=!0,o=!1,s=r.gateway.snapshot.hello,c,l=()=>{let t=e.getState();return t.pendingMatches[0]??t.matches[0]},u=async(t,n)=>{let i=t.data;if(i?.kind!==`session`||!n&&!i.sessionResolutionFromCache)return;let{client:o,hello:s}=r.gateway.snapshot,c=Uf(r.gateway),u=()=>a&&r.gateway.snapshot.phase===`connected`&&r.gateway.snapshot.client===o&&r.gateway.snapshot.hello===s&&Uf(r.gateway)===c&&l()?.abortController===t.abortController&&e.getState().pendingMatches.length===0;try{let{sessionRouteTargetFromLocation:n}=await z(async()=>{let{sessionRouteTargetFromLocation:e}=await import(`./route-loader-Cu3upMOr.js`);return{sessionRouteTargetFromLocation:e}},__vite__mapDeps([98,85,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,21,22,86,23,87,73,88,28,29,30,31,32,33,34,91,35,92,74,93]),import.meta.url);if(!u())return;let a=n(r,t.location)?.target;if(!a||!(a.kind===`short`||a.kind===`literal`&&a.slugCandidate))return;let{querySessionReference:o}=await z(async()=>{let{querySessionReference:e}=await import(`./route-loader-session-reference-J09ar3gm.js`);return{querySessionReference:e}},__vite__mapDeps([99,85,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,21,22,86,23,87,73,88,28,29,30,31,32,33,34,91,35,92,74,93]),import.meta.url);if(!u())return;(await o(r,{key:i.sessionKey,agentId:a.agentId},t.abortController.signal))?.kind===`not-found`&&u()&&await e.revalidate(r,t.routeId)}catch{}},d=()=>{let t=l();if(!t||!ss(t.routeId)){c=void 0;return}let n=Uf(r.gateway);if(c?.controller!==t.abortController&&(c=void 0),!(c&&c.scope!==n)){if(r.gateway.snapshot.phase!==`connected`){(t.status===`pending`||t.status===`success`||t.isFetching===`loader`)&&(c={controller:t.abortController,scope:n,verifySession:c?.verifySession===!0||s!==null||t.data!==void 0});return}if(t.status===`success`&&!t.isFetching){let e=c;c=void 0,e&&u(t,e.verifySession)}c&&!o&&t.status===`error`&&(o=!0,queueMicrotask(()=>{o=!1;let t=l();a&&c&&t?.abortController===c.controller&&Uf(r.gateway)===c.scope&&r.gateway.snapshot.phase===`connected`&&t.status===`error`&&(c=void 0,t.abortController.abort(),l()?.abortController===t.abortController&&e.navigate(t.routeId,r,{history:`none`,revalidate:!0},t.location).catch(()=>void 0))}))}},f=e.subscribe(d),p=r.gateway.subscribe(o=>{d(),s!==o.hello&&(s=o.hello,zo(o.hello?.controlUiTabs),queueMicrotask(()=>{if(!a||r.gateway.snapshot.phase!==`connected`)return;let o=t.location(),s=Uo(o,n),c=e.getState();if(c.pendingMatches.some(e=>!bs(e.location,o)))return;let l=o.pathname!==J(`plugin`,n)&&[...c.matches,...c.pendingMatches].some(e=>e.routeId===`plugin`);!bs(o,s)||l&&Vo(o.pathname,n)?e.navigate(`plugin`,r,{history:`replace`},s).catch(e=>{console.error(`[openclaw] Plugin tab navigation failed`,e)}):l&&i(o)}))}),m=t.listen(a=>{if(r.nativeConversation?.interceptNavigation(a)){let n=e.getState().location;n&&t.replace(n);return}let o=np(hs(a.pathname,n),a,n);bs(a,o)||t.replace(o);let s=ms(o.pathname,n);if(s){e.navigate(s[0],r,{history:`none`},o).catch(e=>{console.error(`[openclaw] Dynamic route navigation failed`,e)});return}i(o)});return()=>{a=!1,c=void 0,f(),p(),m()}}},n,r)),s&&bs(t.location(),i)&&await op(e.navigate(s[0],r,{history:`none`},i))}var cp;function lp(){return(lp=e((()=>{st(),Y(),Kf(),_i(),Za(),ei(),pa(),Pi(),aa(),ui(),Hn(),xr(),cr(),fr(),bo(),On(),Vi(),nr(),Zn(),qr(),to(),Si(),Zi(),gi(),Xa(),Qr(),fa(),Mi(),ci(),Cn(),hr(),ln(),It(),Wn(),pn(),Ln(),Mt(),Pn(),Xt(),io(),Yn(),Gr(),$a(),a(),cp=[...kt,Kn,Vr,Wt,oi,ya,Nt,Ma,an,qi,Ba,Ur,Ka,jr,dn,go,ba,Ir,...vr,Ra,Ki,ai,ar,so,mo,En,zi,vo,ur,er,Qt,Di,en,...Ii,...Ca,Rt,Vt,ao,fo,Wa]})))()}function up(){return(up=e((()=>{ut()})))()}function dp(e){if(Object.keys(e).length===1){if(typeof e.deviceToken==`string`&&e.deviceToken)return{deviceToken:e.deviceToken};if(typeof e.token==`string`&&e.token)return{token:e.token};if(typeof e.password==`string`&&e.password)return{password:e.password}}throw Error(`The app returned an invalid Gateway credential. Reconnect in the app.`)}function fp(e,t){let n=w(e)?e:{},r=w(n.client)?n.client:{},i=w(n.device)?n.device:{},a=w(n.auth)?n.auth:{},o=c(typeof r.id==`string`?r.id:void 0),s=vt(typeof r.mode==`string`?r.mode:void 0);if(!o||!s||typeof r.version!=`string`||typeof r.platform!=`string`||!Array.isArray(n.scopes)||!n.scopes.every(e=>typeof e==`string`)||typeof i.id!=`string`||typeof i.publicKey!=`string`||typeof i.signature!=`string`||i.nonce!==t.nonce||i.signedAt!==t.signedAt)throw Error(`The app returned an invalid Gateway authorization. Reconnect in the app.`);return{client:{id:o,mode:s,version:r.version,platform:r.platform,...typeof r.deviceFamily==`string`?{deviceFamily:r.deviceFamily}:{},...typeof r.instanceId==`string`?{instanceId:r.instanceId}:{}},scopes:n.scopes,auth:dp(a),device:{id:i.id,publicKey:i.publicKey,signature:i.signature,nonce:t.nonce,signedAt:t.signedAt}}}function pp(e,t={}){let n=window,r=n.OpenClawNativeGatewayAuth,i=n.webkit?.messageHandlers?.OpenClawNativeGatewayAuth,a=new Map,o=new Map,c,l=!1,u=e=>{let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return}w(t)&&typeof t.id==`string`&&a.get(t.id)?.(t)};if(r&&(r.onmessage=e=>u(e.data)),t.messagePort&&n.top===n){let t=r=>{let i=r.ports[0];if(l||c||r.source!==null||r.origin!==``||r.ports.length!==1||!i)return;let a;try{a=typeof r.data==`string`?JSON.parse(r.data):void 0}catch{return}if(w(a)&&a.type===`openclaw.native-control-auth`&&typeof a.gatewayUrl==`string`&&ft(a.gatewayUrl)===ft(e)){c=i,c.addEventListener(`message`,e=>u(e.data)),c.start(),n.removeEventListener(`message`,t);for(let[e,t]of o)try{c.postMessage(t)}catch(t){u({id:e,error:on(t)})}o.clear()}};n.addEventListener(`message`,t),n.addEventListener(`pagehide`,()=>{l=!0,n.removeEventListener(`message`,t),c?.close();for(let e of a.keys())u({id:e,error:`Native dashboard document closed`});o.clear()},{once:!0})}return async({gatewayUrl:d,nonce:f,signedAt:p,signal:m})=>{if(ft(d)!==ft(e))throw Error(`This dashboard belongs to a different Gateway. Select the Gateway in the app.`);if(l||n.top!==n||!r&&!i&&!t.messagePort)throw Error(`Native Gateway authorization is unavailable. Reopen this dashboard in the app.`);if(!/[^\p{White_Space}\p{Control}\ufeff]/u.test(f)||new TextEncoder().encode(f).length>512||f.includes(`|`)||!Number.isSafeInteger(p)||p<=0)throw Error(`The Gateway did not provide a valid native authentication challenge.`);m.throwIfAborted();let h={id:ie(),nonce:f,signedAt:p};return await new Promise((e,t)=>{let n=(n,r)=>{a.delete(h.id)&&(o.delete(h.id),clearTimeout(d),m.removeEventListener(`abort`,l),n===void 0?r&&e(r):t(n))},l=()=>n(Error(on(m.reason??`Native Gateway authorization cancelled.`))),d=setTimeout(()=>n(new mp(`The app did not authorize this dashboard in time. Reconnect in the app.`)),s/2);a.set(h.id,e=>{try{if(typeof e.error==`string`)throw new mp(e.error);n(void 0,fp(e.result,h))}catch(e){n(e instanceof Error?e:Error(on(e)))}}),m.addEventListener(`abort`,l,{once:!0});try{let e;r?e=r.postMessage(JSON.stringify(h)):i?e=i.postMessage(h):c?c.postMessage(JSON.stringify(h)):o.set(h.id,JSON.stringify(h)),e&&e.then(u,e=>n(new mp(on(e))))}catch(e){n(new mp(on(e)))}})}}var mp;function hp(){return(hp=e((()=>{se(),F(),wa(),f(),mp=class extends Error{}})))()}function gp(e){let t=e&&typeof e==`object`&&`name`in e?e.name:void 0;return typeof t==`string`&&t.trim()?t:void 0}function _p(e){let t=gp(e)?.toLowerCase(),n=on(e).toLowerCase();return t===`securityerror`||n.includes(`security error`)||n.includes(`mixed content`)||n.includes(`insecure websocket`)}function vp(e,t){let n=_p(e),r=on(e),i=t.trim().toLowerCase().startsWith(`ws://`),a={code:n?Sp:xp,browserErrorName:gp(e),browserMessage:r};return n?{code:Sp,message:`Browser refused the Gateway WebSocket for security reasons.`+(i?` Use wss:// when the Control UI is served over HTTPS/Tailscale Serve, or open the loopback dashboard at http://127.0.0.1:18789.`:` Check the Gateway WebSocket URL and browser security policy.`),details:a}:{code:xp,message:`Could not create the Gateway WebSocket: ${r}`,details:a}}async function yp(e,t){try{let n=new URL(e,window.location.href);n.protocol=n.protocol.replace(/^ws/u,`http`);let r=new URL(Gs(new URL(`/healthz`,n).href),window.location.href);if(r.origin!==new URL(window.location.href).origin)return!1;let i=await fetch(r,{cache:`no-store`,credentials:`same-origin`,redirect:`error`,signal:t});if(!i.ok)return!1;let a=await i.json();return typeof a==`object`&&!!a&&`ok`in a&&a.ok===!0&&`status`in a&&a.status===`live`}catch{return!1}}function bp(e,t,n){let r=new WebSocket(Us(e)),i=!0,a,o,c=()=>{i=!1,o!==void 0&&(clearTimeout(o),o=void 0)};return r.addEventListener(`open`,()=>{c(),t.open()}),r.addEventListener(`message`,e=>t.message(String(e.data??``))),r.addEventListener(`close`,e=>{c(),t.close(e.code,e.reason||a||``)}),r.addEventListener(`error`,()=>{c(),a||t.error(Error(`websocket error`))}),o=setTimeout(()=>{if(o=void 0,i){i=!1,a=`gateway websocket opening timed out after ${s}ms`;try{t.error(Error(a))}finally{r.close()}}},s),{isOpen:()=>r.readyState===WebSocket.OPEN,send:e=>{let t=n?.();if(t!==void 0&&new TextEncoder().encode(e).byteLength>t)throw new Cp;r.send(e)},close:(e,t)=>{c(),r.close(e===1008?4008:e,t)}}}var xp,Sp,Cp;function wp(){return(wp=e((()=>{se(),wa(),xp=`BROWSER_WEBSOCKET_CONSTRUCTOR_ERROR`,Sp=`BROWSER_WEBSOCKET_SECURITY_ERROR`,Cp=class extends Error{constructor(){super(`Request exceeds the Gateway payload limit. Shorten the message or remove one or more attachments and retry.`),this.name=`GatewayPayloadLimitError`}}})))()}var Tp;function Ep(){return(Ep=e((()=>{yt(),Ne(),Tp=class{constructor(e){this.reconnect=e,this.stream=new _e,this.projectedEvents=new WeakMap,this.generation=0}clear(){this.generation+=1,this.stream.clear()}async request(e,t,n,r){let i=this.generation,a=await e.request(t,n,r);if(t===`sessions.messages.unsubscribe`&&i===this.generation){let e=I(a)?.key,t=I(n),r=(typeof e==`string`?Be(e)?.agentId:void 0)??t?.agentId??(e===`global`&&typeof t?.key==`string`?Be(t.key)?.agentId:void 0);this.stream.retire(t=>{let n=t.agentId??Be(t.sessionKey)?.agentId;return t.sessionKey===e&&n===r})}return a}dispatch(e,t){let n=this.project(e);n&&t?.(n)}project(e){if(e.event!==`chat`)return e;if(this.projectedEvents.has(e))return this.projectedEvents.get(e)??null;let t=this.stream.project(e),n=t.missingBaseline?null:t.event;return t.missingBaseline&&this.reconnect(`chat stream baseline missing`),this.projectedEvents.set(e,n),n}}})))()}function Dp(e,t){return qe(t)===Ue.PROTOCOL_MISMATCH||!e?.toLowerCase().includes(`protocol mismatch`)?t:{code:Ue.PROTOCOL_MISMATCH,clientMinProtocol:4,clientMaxProtocol:4,...t&&typeof t==`object`&&!Array.isArray(t)?t:{}}}function Op(e){return qe(e?.details)}function kp(){return(kp=e((()=>{nt()})))()}async function Ap(e){let{deviceIdentity:t}=e;if(!t)return;if(e.connectChallengeTs===null)throw Error(`gateway connect challenge timestamp invalid`);let n=e.connectChallengeTs??Date.now(),r=e.connectNonce??``,i=_t({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await Pa(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function jp(){return(jp=e((()=>{ta()})))()}function Mp(){if(navigator.platform===`MacIntel`)return navigator.maxTouchPoints>1||/iPad/u.test(navigator.userAgent)?`iPad`:`Mac`}async function Np({opts:e,connectNonce:t,connectChallengeTs:n,generation:r,serverCapabilities:i,nativeSignal:a,selectAuth:o,onDeviceIdentityReady:s}){let c=Pp,l=Intl.DateTimeFormat().resolvedOptions().timeZone||void 0,u={id:e.clientName??bt.CONTROL_UI,version:e.clientVersion??`control-ui`,buildId:e.clientBuildId,platform:e.platform??navigator.platform??`web`,deviceFamily:e.deviceFamily??(e.platform===void 0?Mp():void 0),mode:e.mode??ye.WEBCHAT,instanceId:e.instanceId,...l?{timeZone:l}:{}},d=e.token?.trim()||void 0,f={authToken:d,authPassword:e.password?.trim()||void 0},p;if(e.nativeConnectAuth){if(!t||typeof n!=`number`||!Number.isSafeInteger(n))throw Error(`The Gateway did not provide a valid native authentication challenge.`);p=await e.nativeConnectAuth({gatewayUrl:e.url,nonce:t,signedAt:n,signal:a}),a.throwIfAborted(),u={...p.client,buildId:e.clientBuildId,...l?{timeZone:l}:{}},f={authToken:p.auth.token,authPassword:p.auth.password,resolvedDeviceToken:p.auth.deviceToken}}let m=p?null:await Rr().catch(()=>null);s(m!==null),m&&(f=o({role:c,deviceId:m.deviceId})),p||(f.authPassword??=f.authToken);let h=p?.scopes??$e({requestedScopes:f.authBootstrapToken?e.bootstrapProfile===`owner`?[...Qe]:[...pt]:e.scopes,usingStoredDeviceToken:f.usingStoredDeviceToken,storedScopes:f.storedScopes,defaultScopes:Fp}),g=p?.device??await Ap({deviceIdentity:m,client:u,role:c,scopes:h,authToken:f.signatureToken,connectNonce:t,connectChallengeTs:n});return{generation:r,params:{minProtocol:4,maxProtocol:4,client:u,role:c,scopes:h,device:g,...Ee({modelCatalog:e.modelCatalog,serverCapabilities:i,caps:[`agent-kind`,`approvals`,`task-suggestions`,`terminal-offset-seq`,`terminal-session-metadata`,`terminal-upload-path-style`,`tool-events`,`chat-only-assistant-text`,`session-scoped-events`,`inline-widgets`,`model-selection-policy`,`ui-commands`,`usage-refreshing`]}),auth:p?.auth??Le(f),userAgent:navigator.userAgent,locale:navigator.language},explicitGatewayToken:p?void 0:d,selectedAuth:f,deviceIdentity:m}}var Pp,Fp;function Ip(){return(Ip=e((()=>{me(),F(),n(),Xe(),ot(),ta(),jp(),Pp=`operator`,Fp=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.questions`,`operator.pairing`]})))()}function Lp(){return(typeof window<`u`?window:void 0)?.isSecureContext===!0}function Rp(e){try{let t=new URL(e,window.location.href);return mi(t.hostname)||t.host===new URL(window.location.href).host}catch{return!1}}function zp(e){let{gatewayCode:t,message:n,details:r,retryable:i,retryAfterMs:a}=e;return{code:t,message:n,details:r,retryable:i,retryAfterMs:a}}async function Bp(e){if(!e||typeof crypto>`u`||!crypto.subtle)return``;try{let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,`0`)).join(``)}catch{return``}}var Vp,Hp,Up,Wp,Gp,Kp,qp;function Jp(){return(Jp=e((()=>{nt(),te(),g(),me(),Me(),se(),m(),Je(),hp(),wa(),ta(),f(),wp(),Ep(),kp(),Ip(),a(),Vp=class extends ae{constructor(e){let t=Dp(e.message,e.details);super({...e,details:t,message:we({message:e.message,details:t})}),this.name=`GatewayRequestError`}},Hp=4008,Up=4013,Wp=1006,Gp=3e4,Kp=1e3,qp=class{constructor(e){this.opts=e,this.chatEvents=new Tp(e=>this.forceReconnect(e)),this.scopeUpgradeRuntime=null,this.inboundActivitySeq=0,this.lastInboundActivityAtMs=null,this.maxInboundSilenceMs=null,this.tickWatchTimer=null,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.nativeAuthAbort=null,this.nativeAuthError=null,this.recovery={value:``,resolved:!1,generation:0},this.scopeUpgradeBinding=null,this.reachabilityProbe=null,this.client=new O({createSocket:e=>(this.reachabilityProbe?.abort(),this.reachabilityProbe=null,this.chatEvents.clear(),this.maxPayloadBytes=void 0,bp(this.opts.url,e,()=>this.maxPayloadBytes)),createRequestId:ie,createRequestError:e=>new Vp({code:e.code??`UNAVAILABLE`,message:e.message??`request failed`,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}),buildConnectPlan:({nonce:e,challengeTs:t,generation:n,serverCapabilities:r})=>this.buildConnectPlan(e,t,n,r),buildConnectParams:e=>e.params,onConnectPlanError:e=>this.opts.nativeConnectAuth?(this.nativeAuthError=e instanceof Vp?e:new Vp({code:`UNAVAILABLE`,message:on(e),retryable:e instanceof mp}),{closeCode:Hp,closeReason:`native authorization unavailable`,stop:!this.nativeAuthError.retryable}):{closeCode:Hp,closeReason:`connect failed`},onConnectHello:(e,t)=>this.handleConnectHello(e,t.plan),onHello:e=>this.opts.onHello?.(e),onConnectFailure:(e,t)=>(this.client.recordTiming(`failed`,t.generation,t.plan,{errorCode:e.code}),this.handleConnectFailure(e,t.plan)),resolveClose:e=>this.resolveClose(e),onClose:(e,t)=>{this.nativeAuthAbort?.abort(),this.chatEvents.clear(),this.recovery={...this.recovery,generation:e.generation+1,resolved:!1},this.stopTickWatch(),this.scopeUpgradeBinding=null;let n=e.connectFailure?.error??this.nativeAuthError;if(this.client.recordTiming(`failed`,e.generation,void 0,{errorCode:n instanceof Vp?n.code:`SOCKET_CLOSED`}),t.notify){let r={code:e.code,reason:e.reason,error:n instanceof Vp?zp(n):void 0,willRetry:t.retry};if(t.retry&&!e.socketOpened&&e.code===Wp&&!r.error){let e=new AbortController;this.reachabilityProbe=e;let t=setTimeout(()=>e.abort(),1e3);yp(this.opts.url,e.signal).then(n=>{clearTimeout(t),this.reachabilityProbe===e&&(this.reachabilityProbe=null,this.opts.onClose?.({...r,...n&&!e.signal.aborted?{busy:!0}:{}}))}).catch(e=>console.error(`[gateway] close handler error:`,e))}else this.opts.onClose?.(r)}},onReconnectScheduled:e=>this.opts.onReconnectScheduled?.(e),onSocketFactoryError:e=>this.handleSocketFactoryError(e),onEvent:e=>this.chatEvents.dispatch(e,this.opts.onEvent),onGap:e=>this.opts.onGap?.(e),onActivity:()=>{this.inboundActivitySeq+=1,this.lastInboundActivityAtMs=Date.now()},onTiming:({plan:e,detail:t,...n})=>{this.opts.onConnectTiming?.({...n,...e?this.connectPlanTimingPayload(e):{},...t&&typeof t==`object`?t:{}})},onRequestTiming:e=>this.opts.onRequestTiming?.(e),onCallbackError:(e,t)=>console.error(`[gateway] ${e} handler error:`,t),handshake:{mode:`fallback`,timeoutMs:750},reconnect:{initialMs:800,multiplier:1.7,maxMs:15e3},nowMs:()=>typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()})}get instanceId(){return this.opts.instanceId}get gatewayUrl(){return this.opts.url}start(){this.client.start()}stop(){this.nativeAuthAbort?.abort(),this.reachabilityProbe?.abort(),this.reachabilityProbe=null,this.chatEvents.clear(),this.stopTickWatch(),this.recovery={...this.recovery,generation:this.recovery.generation+1,resolved:!1},this.client.stop(),this.cancelScopeUpgrade(),this.scopeUpgradeBinding=null,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1}get connected(){return this.client.connected}get needsWakeReconnect(){return!this.client.connected||this.lastInboundActivityAtMs!==null&&this.maxInboundSilenceMs!==null&&Date.now()-this.lastInboundActivityAtMs>this.maxInboundSilenceMs}get connectionGeneration(){return this.recovery.generation}get recoveryScope(){return this.recovery.value}get recoveryScopeReady(){return this.recovery.resolved}get scopeUpgradeReady(){return this.connected&&this.scopeUpgradeBinding!==null}connectPlanTimingPayload(e){return{secureContext:Lp(),hasDeviceIdentity:!!e.deviceIdentity,hasDevice:!!e.params.device,hasAuthToken:!!e.selectedAuth.authToken,hasBootstrapToken:!!e.selectedAuth.authBootstrapToken,hasDeviceToken:!!(e.selectedAuth.authDeviceToken??e.selectedAuth.resolvedDeviceToken),hasPassword:!!e.selectedAuth.authPassword}}async buildConnectPlan(e,t,n,r){this.nativeAuthError=null,this.recovery={...this.recovery,generation:n,resolved:!1},this.nativeAuthAbort?.abort(),this.nativeAuthAbort=new AbortController;let i=await Np({opts:this.opts,connectNonce:e,connectChallengeTs:t,generation:n,serverCapabilities:r,nativeSignal:this.nativeAuthAbort.signal,selectAuth:e=>this.selectConnectAuth(e),onDeviceIdentityReady:e=>{this.client.recordTiming(`device-identity-ready`,n,void 0,{secureContext:Lp(),hasDeviceIdentity:e})}});return this.pendingDeviceTokenRetry&&i.selectedAuth.authDeviceToken&&(this.pendingDeviceTokenRetry=!1),i}handleConnectHello(e,t){if(this.recovery.value=e.auth?.recoveryScope??``,this.maxPayloadBytes=e.policy?.maxPayload,this.startTickWatch(e),this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.opts.bootstrapToken=void 0,this.opts.bootstrapProfile=void 0,this.scopeUpgradeBinding=t.deviceIdentity&&{clientId:t.params.client.id,deviceId:t.deviceIdentity.deviceId,role:t.params.role??`operator`},e?.auth?.deviceToken&&t.deviceIdentity){let n=e.auth.role??t.params.role??`operator`,r=n===t.params.role&&e.auth.deviceToken===t.selectedAuth.storedToken?t.selectedAuth.storedScopes??e.auth.scopes??[]:e.auth.scopes??[];Xr({deviceId:t.deviceIdentity.deviceId,gatewayUrl:this.opts.url,role:n,token:e.auth.deviceToken,scopes:r})}this.resolveRecoveryScope(e,t)}async resolveRecoveryScope(e,t){let n=e.auth?.recoveryScope,r=await Bp(e.auth?.deviceToken??t.selectedAuth.authDeviceToken??t.selectedAuth.resolvedDeviceToken??t.selectedAuth.authToken),i=n&&e.auth?.recoveryMigrationAllowed===!0&&r?(await z(async()=>{let{default:e}=await import(`./session-placement-recovery-migration.runtime-C6MeUzhK.js`);return{default:e}},__vite__mapDeps([100,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)).default:void 0;t.generation===this.recovery.generation&&this.client.connected&&(i?.(this.opts.url,r,n),this.recovery.value=n??r,this.recovery.resolved=!0,this.opts.onRecoveryScopeChange?.())}startTickWatch(e){this.stopTickWatch();let t=e.policy?.tickIntervalMs,n=y(typeof t==`number`&&Number.isFinite(t)&&t>0?t:Gp,{minMs:Kp});this.maxInboundSilenceMs=n*2,this.lastInboundActivityAtMs=Date.now(),this.tickWatchTimer=setInterval(()=>{this.needsWakeReconnect&&this.forceReconnect(`tick timeout`)},n)}stopTickWatch(){this.tickWatchTimer!==null&&(clearInterval(this.tickWatchTimer),this.tickWatchTimer=null),this.lastInboundActivityAtMs=null,this.maxInboundSilenceMs=null}handleConnectFailure(e,t){let n=e instanceof Vp?Op(e):null;xe({retryBudgetUsed:this.deviceTokenRetryBudgetUsed,currentDeviceToken:t.selectedAuth.authDeviceToken,explicitToken:t.explicitGatewayToken,storedToken:t.selectedAuth.storedToken,trustedEndpoint:!!t.deviceIdentity&&Rp(this.opts.url),errorDetails:e instanceof Vp?e.details:void 0})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),t.selectedAuth.storedToken&&(t.selectedAuth.resolvedDeviceToken===t.selectedAuth.storedToken||t.selectedAuth.authDeviceToken===t.selectedAuth.storedToken)&&t.deviceIdentity&&n===Ue.AUTH_DEVICE_TOKEN_MISMATCH&&Ua({deviceId:t.deviceIdentity.deviceId,gatewayUrl:this.opts.url,role:t.params.role??`operator`});let r=gt(e);return fe(e)?{closeCode:Up,closeReason:`gateway starting`,reconnectDelayMs:r??void 0}:{closeCode:Hp,closeReason:`connect failed`}}selectConnectAuth(e){let t=ji({deviceId:e.deviceId,gatewayUrl:this.opts.url,role:e.role}),n=t?.scopes??[],r=e.role!==`operator`||Pe({role:e.role,requestedScopes:[`operator.sessions.read`],allowedScopes:n});return ct({token:this.opts.token,bootstrapToken:this.opts.bootstrapToken,password:this.opts.password,storedToken:r?t?.token:void 0,storedScopes:t?.scopes,pendingDeviceTokenRetry:this.pendingDeviceTokenRetry,trustedDeviceTokenRetry:Rp(this.opts.url),preferBootstrapToken:!0})}request(e,t,n){return this.chatEvents.request(this.client,e,t,n)}async requestScopeUpgrade(e={}){let t=this.scopeUpgradeBinding;if(!this.connected||!t)throw Error(`scope upgrade requires a connected browser device`);return(await this.loadScopeUpgradeRuntime()).requestScopeUpgrade({binding:t,scopes:Fp,onPending:e.onPending})}cancelScopeUpgrade(){this.scopeUpgradeRuntime?.then(e=>e.cancelScopeUpgrade()).catch(()=>void 0)}loadScopeUpgradeRuntime(){return this.scopeUpgradeRuntime??=z(async()=>{let{createGatewayScopeUpgradeRuntime:e}=await import(`./gateway-scope-upgrade.runtime-k9Z1HIJx.js`);return{createGatewayScopeUpgradeRuntime:e}},__vite__mapDeps([101,28]),import.meta.url).then(({createGatewayScopeUpgradeRuntime:e})=>e({gatewayUrl:this.opts.url,request:(e,t,n)=>this.request(e,t,n),reconnect:()=>this.forceReconnect(`scope upgrade approved`)})).catch(e=>{throw this.scopeUpgradeRuntime=null,e})}addEventListener(e){return this.client.addEventListener(t=>this.chatEvents.dispatch(t,e))}forceReconnect(e){this.client.closeSocket(4e3,e)}resolveClose(e){if(this.nativeAuthError)return{retry:this.nativeAuthError.retryable,notify:!0,pendingError:this.nativeAuthError};let t=e.connectFailure?.error,n=e.connectFailure?.reconnectDelayMs;if(n!==void 0)return{retry:!0,notify:!0,reconnectDelayMs:n,pendingError:t};let r=t instanceof Vp?zp(t):void 0;return{retry:Op(r)===Ue.AUTH_TOKEN_MISMATCH?this.pendingDeviceTokenRetry:!S({details:r?.details,protocolMismatchIsTerminal:!0}),notify:!0,pendingError:t}}handleSocketFactoryError(e){let t=vp(e,this.opts.url);this.pendingDeviceTokenRetry=!1;try{this.opts.onClose?.({code:Wp,reason:t.code===`BROWSER_WEBSOCKET_SECURITY_ERROR`?`security error`:`websocket error`,error:t,willRetry:!1})}catch(e){console.error(`[gateway] close handler error:`,e)}}}})))()}function Yp(e){if(!nm.test(e))return;let[t=``,n]=e.toLowerCase().split(`e`),r=t.startsWith(`-`),[i=``,a=``]=(r?t.slice(1):t).split(`.`),o=`${i||`0`}${a}`;if(/^0+$/u.test(o))return{numerator:0n,denominator:1n};let s=Number(n??0);if(!Number.isSafeInteger(s))return;let c=a.length-s;if(o.length>rm||Math.abs(c)>rm)return;let l=BigInt(o),u=c<0?l*10n**BigInt(-c):l;return{numerator:r?-u:u,denominator:c>0?10n**BigInt(c):1n}}function Xp(e,t){return e.numerator*t.denominator===t.numerator*e.denominator}function Zp(e){return nm.test(e.trim())}function Qp(e){let t=e.trim();return/^-?\d+$/u.test(t)&&!Number.isSafeInteger(Number(t))}function $p(e,t){let n=e.trim();if(n===``)return;let r=Yp(n),i=Number(n);if(!r||!Number.isFinite(i)||t&&!Number.isInteger(i))return e;let a=Number.isInteger(i)?void 0:tm(i);return(Number.isInteger(i)?r.numerator===BigInt(i)*r.denominator:a&&Xp(r,a))?i:e}function em(e){return Number.isInteger(e)?BigInt(e).toString():String(e)}function tm(e){if(Number.isFinite(e))return Yp(String(e))}var nm,rm;function im(){return(im=e((()=>{nm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,rm=1024})))()}function am(e){let t=e?.trim();return t?Kt(t).toString(16):null}function om(e,t){let n=e?.method;if(n!==`token`&&n!==`device-token`)return null;let r=am(n===`token`?t:e?.deviceToken);return r?{authMethod:n,credential:r}:null}function sm(e){if(!w(e)||!w(e.agents))return!1;let t=e.agents;return e.version===2&&(e.authMethod===`token`||e.authMethod===`device-token`)&&typeof e.credential==`string`&&typeof e.savedAt==`number`&&Number.isFinite(e.savedAt)&&e.savedAt>=0&&typeof e.scope==`string`&&(e.profileId===null||typeof e.profileId==`string`)&&typeof t.defaultId==`string`&&t.defaultId.trim().length>0&&typeof t.mainKey==`string`&&t.mainKey.trim().length>0&&(t.scope===`per-sender`||t.scope===`global`)&&Array.isArray(t.agents)&&t.agents.every(e=>w(e)&&typeof e.id==`string`)&&Array.isArray(e.groups)&&e.groups.every(e=>w(e)&&typeof e.name==`string`&&typeof e.position==`number`)&&Array.isArray(e.sectionOrder)&&e.sectionOrder.every(e=>typeof e==`string`)}function cm(e,t){let n=$n(),r=fm+e;try{let i=n?.getItem(r);if(i==null)return null;if(new TextEncoder().encode(i).length<=pm){let n=JSON.parse(i);if(sm(n)&&n.scope===e&&n.credential===am(t(n.authMethod))&&Date.now()-n.savedAt<=mm)return n}}catch{}try{n?.removeItem(r)}catch{}return null}function lm(e){hm+=1;try{let t=$n();if(!t)return;if(e!==void 0){t.removeItem(fm+e);return}for(let e=t.length-1;e>=0;--e){let n=t.key(e);n?.startsWith(fm)&&t.removeItem(n)}}catch{}}function um(){clearTimeout(gm),gm=void 0;let e=_m;if(_m=void 0,!e||e.generation!==hm)return;let{record:t}=e,n=$n(),r=fm+t.scope;try{let e={...t.agents,agents:t.agents.agents.map(e=>{let t=e.identity?{...e.identity}:void 0;return t&&(delete t.avatar,delete t.avatarUrl),{...e,identity:t}})},i=JSON.stringify({...t,agents:e});new TextEncoder().encode(i).length>pm?n?.removeItem(r):n?.setItem(r,i)}catch{try{n?.removeItem(r)}catch{}}}function dm(e){clearTimeout(gm),_m={record:e,generation:hm},gm=setTimeout(um,500)}var fm,pm,mm,hm,gm,_m;function vm(){return(vm=e((()=>{fm=`openclaw.control.bootRecord.v1:`,pm=65536,mm=2592e6,hm=0,typeof window<`u`&&typeof window.addEventListener==`function`&&typeof document<`u`&&typeof document.addEventListener==`function`&&(window.addEventListener(`pagehide`,um),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&um()}))})))()}function ym(e,t,n){let r=`${be(t)}${n}`;if(e===r||e===`${r}/`)return null;let i=`${r}/`;if(!e.startsWith(i))return;let a=e.slice(i.length);if(!a||a.includes(`/`))return null;try{let e=decodeURIComponent(a);return e&&e!==`.`&&e!==`..`?e:null}catch{return null}}function bm(e,t){let n=ym(e,t,ks.approval);if(n!==void 0)return{kind:`approval`,approvalId:n};let r=ym(e,t,ks.question);return r===void 0?null:{kind:`question`,questionId:r}}function xm(){return(xm=e((()=>{Y()})))()}function Sm(e){let t=h(e)?.phase;return t===`accepting`||t===`preparing`||t===`draining`||t===`prepared`?t:void 0}function Cm(e){return e.reason instanceof Error?e.reason:new DOMException(`Gateway wait aborted`,`AbortError`)}function wm(e,t){let n=e.snapshot.client;return t.aborted?Promise.reject(Cm(t)):n&&e.snapshot.phase===`connected`?Promise.resolve(n):new Promise((n,r)=>{let i=()=>void 0,a=!1,o=()=>{i(),t.removeEventListener(`abort`,s)},s=()=>{o(),r(Cm(t))};t.addEventListener(`abort`,s,{once:!0}),i=e.subscribe(e=>{e.phase===`connected`&&e.client&&(a=!0,o(),n(e.client))}),(a||t.aborted)&&i()})}function Tm(){return(Tm=e((()=>{})))()}function Em(e,t){let n=e?.trim();if(!n||!t)return null;let r=M(n);return t.agents.some(e=>M(e.id)===r)?r:null}function Dm(e,t){let n=new URLSearchParams(e.search);if(!n.has(`session`))return null;let r=J(`chat`,t),i=J(`dashboard`,t),a=e.pathname===r||e.pathname===`${r}/`?`chat`:e.pathname===i||e.pathname===`${i}/`?`dashboard`:null;return a?{face:n.get(`face`)===`dashboard`?`dashboard`:a,sessionKey:n.get(`session`)?.trim()??``}:null}function Om(){return(Om=e((()=>{Y(),na()})))()}function km(e){if(!Rm.test(e))throw Error(`Unsupported tweakcn link. Expected a theme share URL.`)}function Am(e,t){let n=R(e);if(!n||n.length>Bm)throw Error(`Unsupported tweakcn token: ${t}`);let r=n.toLowerCase();if(Vm.some(e=>r.includes(e))||n.includes(`/*`)||n.includes(`*/`)||n.includes(`\\`))throw Error(`Unsupported tweakcn token: ${t}`);for(let e of n){let n=e.charCodeAt(0);if(n<32||n===127||e===`{`||e===`}`||e===`;`||e===`<`||e===`>`||e==="`")throw Error(`Unsupported tweakcn token: ${t}`)}return n}function jm(e,t){let n=Am(e,t);if(/[^A-Za-z0-9 ,'"._-]/.test(n))throw Error(`Unsupported tweakcn token: ${t}`);return n}function Mm(e){return Object.fromEntries(e)}function Nm(e){if(!e)return null;let t=[];for(let n of Hm){let r=n===`font-body`||n===`font-display`||n===`mono`?jm(e[n],n):Am(e[n],n);t.push([n,r])}return Mm(t)}function Pm(e){let t=R(e);return t?x(t,80):`Custom`}function Fm(e){let t=I(e);if(!t)return null;let{sourceUrl:n,themeId:r,label:i,importedAt:a}=t;if(typeof n!=`string`||typeof r!=`string`||typeof i!=`string`||typeof a!=`string`)return null;try{km(r);let e=Nm(I(t.light)??void 0),o=Nm(I(t.dark)??void 0);return!e||!o?null:{sourceUrl:n,themeId:r,label:Pm(i),importedAt:a,light:e,dark:o}}catch{return null}}function Im(e){let t=Nm(e.light),n=Nm(e.dark);if(!t||!n)throw Error(`Stored custom theme is missing required tokens.`);let r=e=>Hm.map(t=>`  --${t}: ${e[t]};`).join(`
`);return[`:root[data-theme="custom"] {`,r(n),`}`,`:root[data-theme="custom-light"] {`,r(t),`}`].join(`
`)}function Lm(e){if(typeof document>`u`)return;let t=document.getElementById(zm);if(!e){t?.remove();return}let n;try{n=Im(e)}catch{t?.remove();return}t||(t=document.createElement(`style`),t.id=zm,document.head.appendChild(t)),t.textContent=n}var Rm,zm,Bm,Vm,Hm;function Um(){return(Um=e((()=>{Rm=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,zm=`openclaw-custom-theme`,Bm=240,Vm=[`url(`,`image(`,`image-set(`,`-webkit-image-set(`,`cross-fade(`,`element(`,`-moz-element(`,`paint(`,`@import`,`expression(`],Hm=`bg.bg-accent.bg-elevated.bg-hover.bg-muted.bg-content.card.card-foreground.card-highlight.popover.popover-foreground.panel.panel-strong.panel-hover.chrome.chrome-strong.text.text-strong.chat-text.muted.muted-strong.muted-foreground.border.border-strong.border-hover.input.ring.accent.accent-hover.accent-muted.accent-subtle.accent-foreground.accent-glow.primary.primary-foreground.secondary.secondary-foreground.accent-2.accent-2-muted.accent-2-subtle.destructive.destructive-foreground.danger.danger-muted.danger-subtle.focus.focus-ring.focus-glow.font-body.font-display.mono.grid-line`.split(`.`)})))()}function Wm(){return typeof globalThis.matchMedia==`function`&&globalThis.matchMedia(`(prefers-color-scheme: light)`).matches}function Gm(e,t){return{theme:e===`custom`||wt(e)?e:`claw`,mode:r(t)??`system`}}function Km(e){return e===`system`?Wm()?`light`:`dark`:e}function qm(e,t){let n=Km(t);if(e===`claw`)return n;let r=P(e)?e===`knot`?`openknot`:e:`custom`;return n===`light`?`${r}-light`:r}function Jm(e,t){if(typeof document>`u`||e===`claw`||!P(e)){t();return}let n=`openclaw-theme-palette-${e}`,r=document.getElementById(n);if(r instanceof HTMLLinkElement&&r.sheet){t();return}let i=r instanceof HTMLLinkElement?r:document.createElement(`link`),a=e=>{i.removeEventListener(`load`,a),i.removeEventListener(`error`,a),e.type===`error`&&(console.error(`Theme palette failed to load; reload to retry: ${i.href}`),i.remove()),t()};i.addEventListener(`load`,a),i.addEventListener(`error`,a),r||(i.id=n,i.rel=`stylesheet`,i.href=cc(`themes/${e}.css`),document.head.append(i))}function Ym(){return(Ym=e((()=>{D(),lc()})))()}function Xm(e){return p.find(t=>t===e)}function Zm(e,t,n){let r=oh[P(e)?e:`custom`];return{ui:t??r.ui,chat:n??r.chat}}function Qm(e){let t=`openclaw-typeface-${e}`,n=ah[e].asset;if(!n||document.getElementById(t))return;let r=document.createElement(`link`);r.id=t,r.rel=`stylesheet`,r.href=cc(n),document.head.append(r)}function $m(e){typeof document<`u`&&(Qm(e.ui),Qm(e.chat),Qm(`jetbrains-mono`))}function eh(){p.forEach(Qm)}function th(e,t){for(let[n,r]of[[`--font-body`,e],[`--font-chat`,t]])r?document.documentElement.style.setProperty(n,ah[r].stack):document.documentElement.style.removeProperty(n)}function nh(e){ih[e].kind===`serif`?document.documentElement.style.setProperty(`--chat-font-smoothing`,`auto`):document.documentElement.style.removeProperty(`--chat-font-smoothing`)}var rh,ih,ah,oh;function sh(){return(sh=e((()=>{b(),D(),lc(),rh={sans:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,serif:`Georgia, "Times New Roman", serif`,mono:`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace`},ih={"instrument-sans":{label:`Instrument Sans`,kind:`sans`},geist:{label:`Geist`,kind:`sans`},"dm-sans":{label:`DM Sans`,kind:`sans`},"ibm-plex-sans":{label:`IBM Plex Sans`,kind:`sans`},"space-grotesk":{label:`Space Grotesk`,kind:`sans`},"atkinson-hyperlegible":{label:`Atkinson Hyperlegible`,family:`Atkinson Hyperlegible Next`,kind:`sans`},fraunces:{label:`Fraunces`,kind:`serif`},lora:{label:`Lora`,kind:`serif`},"jetbrains-mono":{label:`JetBrains Mono`,kind:`mono`},system:{label:`System`,kind:`sans`}},ah=Object.fromEntries(p.map(e=>{let{label:t,family:n=t,kind:r}=ih[e];return[e,{label:t,stack:e===`system`?rh.sans:`"${n}", ${rh[r]}`,asset:e===`system`?void 0:`fonts/${e}.css`}]})),oh={claw:{ui:`instrument-sans`,chat:`instrument-sans`},knot:{ui:`geist`,chat:`geist`},dash:{ui:`dm-sans`,chat:`fraunces`},absolutely:{ui:`space-grotesk`,chat:`lora`},tide:{ui:`ibm-plex-sans`,chat:`ibm-plex-sans`},beacon:{ui:`atkinson-hyperlegible`,chat:`atkinson-hyperlegible`},phosphor:{ui:`jetbrains-mono`,chat:`jetbrains-mono`},crt:{ui:`jetbrains-mono`,chat:`jetbrains-mono`},manuscript:{ui:`lora`,chat:`lora`},rose:{ui:`dm-sans`,chat:`dm-sans`},miami:{ui:`space-grotesk`,chat:`space-grotesk`},custom:{ui:`system`,chat:`system`}}})))()}function ch(e){let t=R(e);return t?Dn(t)?t.length<=hh?t:null:/[\r\n]/.test(t)?null:t.length<=mh?t:null:null}function lh(e){let t=R(e?.name);return{name:t?x(t,ph):null,avatar:ch(e?.avatar)}}function uh(e,t=`You`){return lh(e).name??t}function dh(e){let t=lh(e);return Lt(t.avatar,{identity:{avatar:t.avatar??void 0}})}function fh(e){let t=lh(e),n=t.avatar;return n?dh(t)?null:n:null}var ph,mh,hh;function gh(){return(gh=e((()=>{hn(),ph=50,mh=16,hh=2e6})))()}function _h(e){return`${qh}${Ze(e)}`}function vh(e){return`${Xh}${Ze(e)}`}function yh(e){for(let t of e.matchAll(ag)){let e=t[0].toLowerCase();if(!ng.has(e)&&!tg.has(e)&&!rg.has(e))return!1}return!0}function bh(e){if(typeof e!=`string`)return;let t=e.trim().replace(/\s+/g,` `);if(t.length!==0&&!(t.length>sg)){if(tg.has(t.toLowerCase())||og.test(t))return t;if(ig.test(t)&&CSS.supports(`max-width`,t)&&yh(t))return/^(?:calc|clamp|fit-content|max|min)\(.+\)$/i.test(t)?t:void 0}}function xh(e,t){return n=>e.find(e=>e===n)??t}function Sh(e){return ug.find(t=>t===e)}function Ch(e){return j(`ui.accent`,e)}function wh(e,t=100){if(typeof e!=`number`||!Number.isFinite(e))return t;let n=eg[0],r=Math.abs(e-n);for(let t of eg){let i=Math.abs(e-t);i<r&&(n=t,r=i)}return n}function Th(e){let t=R(e);return e===null?null:t?M(t):void 0}function Eh(e,t){return typeof e==`boolean`?e:t}function Dh(){return typeof document>`u`?!1:!!document.querySelector(`script[src*="/@vite/client"]`)}function Oh(e,t){return`${e.includes(`:`)&&!e.startsWith(`[`)?`[${e}]`:e}:${t}`}function kh(){let e=location.protocol===`https:`?`wss`:`ws`,t=ec(location.pathname)[0],n=`${e}://${location.host}${t}`;return Dh()?{pageUrl:n,effectiveUrl:`${e}://${Oh(location.hostname,`18789`)}`}:{pageUrl:n,effectiveUrl:n}}function Ah(e){let{effectiveUrl:t}=kh();if(Ze(e.gatewayUrl)===Ze(t))return e;let n=Fh(t);return{...e,gatewayUrl:t,token:Lh(e.gatewayUrl,t,{token:e.token,password:``}).token,sessionKey:n.sessionKey,lastActiveSessionKey:n.lastActiveSessionKey}}function jh(e){return e?re(e)??null:null}function Mh(e,t){let n=jh(e?.getItem(_h(t))??null),r=R(n?.gatewayUrl);return n&&(!r||Ze(r)===Ze(t))?{gatewayUrl:r??t,parsed:n}:null}function Nh(e){return`${$h}${Ze(e)}`}function Ph(e,t,n){let r=t.sessionsByGateway?.[Ze(e)],i=R(r?.sessionKey),a=R(r?.lastActiveSessionKey),o=R(r?.selectedAgentId);if(i&&a)return{sessionKey:i,lastActiveSessionKey:a,...o?{selectedAgentId:M(o)}:{}};let s=R(t.sessionKey)??n.sessionKey;return{sessionKey:s,lastActiveSessionKey:R(t.lastActiveSessionKey)??s}}function Fh(e){let t={sessionKey:`main`,lastActiveSessionKey:`main`};try{let n=Mh($n(),e);return n?Ph(e,n.parsed,t):t}catch{return t}}function Ih(e){try{let t=Ut();if(!t)return``;t.removeItem(Qh);let n=t.getItem(Nh(e));return R(n)??``}catch{return``}}function Lh(e,t,n){let r=Ze(e)===Ze(t),i=ft(e)===ft(t);return{token:r?n.token:Ih(t),password:i?n.password:``}}function Rh(e,t){try{let n=Ut();if(!n)return;n.removeItem(Qh);let r=Nh(e),i=R(t)??``;if(i){n.setItem(r,i);return}n.removeItem(r)}catch{}}function zh(e){return vg=e,()=>{vg===e&&(vg=null)}}function Bh(e=vg?.gatewayUrl()){let t=Vh(e);return{...t,token:Ih(t.gatewayUrl)}}function Vh(e=void 0){let t=_g;if(t&&(!e||Ze(t.gatewayUrl)===Ze(e)))return e?{...t,gatewayUrl:e}:t;let{pageUrl:n,effectiveUrl:r}=kh(),i=$n(),a={gatewayUrl:e??r,sessionKey:`main`,lastActiveSessionKey:`main`,theme:gg.theme,themeMode:gg.themeMode,chatShowThinking:!0,chatShowToolCalls:!0,chatPersistCommentary:!0,chatShowTaskProgress:gg.chatShowTaskProgress,chatCollapseTaskProgress:gg.chatCollapseTaskProgress,chatSendShortcut:gg.chatSendShortcut,catalogOpenTarget:gg.catalogOpenTarget,navCollapsed:!1,navWidth:Yh,sidebarAgentsMode:`chip`,sidebarEntries:[...Fc],sidebarLiveActivity:gg.sidebarLiveActivity,showAdvancedSettings:!1,pinnedAgentIds:[],composerHoldToRecord:gg.composerHoldToRecord};try{let t=e??R(i?.getItem(vh(n))),o=(t?Mh(i,t):null)??(e?null:Mh(i,r));if(!o)return a;let s=o.parsed,c=o.gatewayUrl,l=e??(c===n?r:c),u=Ph(l,s,a),d=Fm(s.customTheme),{theme:f,mode:p}=Gm(s.theme,s.themeMode),m=h(s)??{},g=Object.hasOwn(m,`sidebarEntries`)?null:Array.isArray(m.sidebarPinnedRoutes)?hc(m.sidebarPinnedRoutes.map(e=>typeof e==`string`?`route:${e}`:e)):null,_={gatewayUrl:l,sessionKey:u.sessionKey,lastActiveSessionKey:u.lastActiveSessionKey,selectedAgentId:u.selectedAgentId,theme:f===`custom`&&!d?`claw`:f,themeMode:p,accent:Ch(s.accent),fontUi:Xm(s.fontUi),fontChat:Xm(s.fontChat),chatShowThinking:Eh(s.chatShowThinking,a.chatShowThinking),chatShowToolCalls:Eh(s.chatShowToolCalls,a.chatShowToolCalls),chatPersistCommentary:Eh(s.chatPersistCommentary,a.chatPersistCommentary),chatShowTaskProgress:Eh(s.chatShowTaskProgress,a.chatShowTaskProgress),chatCollapseTaskProgress:Eh(s.chatCollapseTaskProgress,a.chatCollapseTaskProgress),chatSendShortcut:lg(s.chatSendShortcut),chatFollowUpMode:Sh(s.chatFollowUpMode),catalogOpenTarget:pg(s.catalogOpenTarget),realtimeTalkInputDeviceId:R(s.realtimeTalkInputDeviceId),realtimeTalkVideoDeviceId:R(s.realtimeTalkVideoDeviceId),composerHoldToRecord:Eh(s.composerHoldToRecord,a.composerHoldToRecord),talkCameraAutoEnable:typeof s.talkCameraAutoEnable==`boolean`?s.talkCameraAutoEnable:void 0,chatSplitLayout:Xn(s.chatSplitLayout),chatWorkspaceDock:hg(s.chatWorkspaceDock),boardSessionViews:_r(s.boardSessionViews),sidebarSessionLayouts:qt(s.sidebarSessionLayouts),sidebarSessionActivePanels:Zt(s.sidebarSessionActivePanels),navCollapsed:a.navCollapsed,navWidth:typeof s.navWidth==`number`&&s.navWidth>=240&&s.navWidth<=400?s.navWidth:a.navWidth,sidebarAgentsMode:s.sidebarAgentsMode===`roster`?`roster`:`chip`,sidebarPreTeamScope:Th(s.sidebarPreTeamScope),sidebarCollapsedAgentIds:C(s.sidebarCollapsedAgentIds),sidebarEntries:hc(m.sidebarEntries)??g??a.sidebarEntries,sidebarLiveActivity:Eh(s.sidebarLiveActivity,a.sidebarLiveActivity),chatMessageMaxWidth:bh(s.chatMessageMaxWidth),showAdvancedSettings:Eh(s.showAdvancedSettings,a.showAdvancedSettings),pinnedAgentIds:C(s.pinnedAgentIds),textScale:typeof s.textScale==`number`&&wh(s.textScale)!==gg.textScale?wh(s.textScale):void 0,customTheme:d??void 0,locale:_o(s.locale)?s.locale:void 0,...s.lobsterPetVisits===!1?{lobsterPetVisits:!1}:{},...s.lobsterPetSounds===!0?{lobsterPetSounds:!0}:{},...s.sessionDeleteConfirm===!1?{sessionDeleteConfirm:!1}:{},...s.openLinksInControlUiBrowser===!0?{openLinksInControlUiBrowser:!0}:{},...s.openLinksExternally===!0?{openLinksExternally:!0}:{}};return(`token`in s||g!==null)&&Kh({..._,token:Ih(l)},{selectGateway:!e}),_}catch{return a}}function Hh(e){Kh(e)}function Uh(e){yg=e}function Wh(e,t={}){let n=Bh(e.gatewayUrl),r={...n,...e};return Kh(r,{selectGateway:t.selectGateway??e.gatewayUrl!==void 0}),yg?.(n,r),r}function Gh(){let e=$n();try{let t=e?.getItem(Zh);return t?lh(JSON.parse(t)):lh()}catch{return lh()}}function Kh(e,t={}){let n=$n(),r=Ze(e.gatewayUrl),i=_h(e.gatewayUrl),a={};try{let t=Mh(n,e.gatewayUrl);if(t){let e=t.parsed;e.sessionsByGateway&&typeof e.sessionsByGateway==`object`&&(a=e.sessionsByGateway)}}catch{}let o=Object.fromEntries([...Object.entries(a).filter(([e])=>e!==r),[r,{sessionKey:e.sessionKey,lastActiveSessionKey:e.lastActiveSessionKey,...R(e.selectedAgentId)?{selectedAgentId:M(e.selectedAgentId)}:{}}]].slice(-10)),s={gatewayUrl:e.gatewayUrl,theme:e.theme,themeMode:e.themeMode,accent:Ch(e.accent),fontUi:Xm(e.fontUi),fontChat:Xm(e.fontChat),chatShowThinking:e.chatShowThinking,chatShowToolCalls:e.chatShowToolCalls,chatPersistCommentary:e.chatPersistCommentary??!0,chatShowTaskProgress:e.chatShowTaskProgress!==!1&&void 0,chatCollapseTaskProgress:e.chatCollapseTaskProgress===!0||void 0,chatSendShortcut:e.chatSendShortcut===`modifier-enter`?`modifier-enter`:void 0,chatFollowUpMode:Sh(e.chatFollowUpMode),catalogOpenTarget:e.catalogOpenTarget===`terminal`?`terminal`:void 0,realtimeTalkInputDeviceId:R(e.realtimeTalkInputDeviceId),realtimeTalkVideoDeviceId:R(e.realtimeTalkVideoDeviceId),composerHoldToRecord:e.composerHoldToRecord!==!1&&void 0,talkCameraAutoEnable:typeof e.talkCameraAutoEnable==`boolean`?e.talkCameraAutoEnable:void 0,chatSplitLayout:e.chatSplitLayout||void 0,chatWorkspaceDock:e.chatWorkspaceDock===`bottom`?`bottom`:void 0,boardSessionViews:e.boardSessionViews&&Object.keys(e.boardSessionViews).length>0?_r(e.boardSessionViews):void 0,sidebarSessionLayouts:e.sidebarSessionLayouts&&Object.keys(e.sidebarSessionLayouts).length>0?qt(e.sidebarSessionLayouts):void 0,sidebarSessionActivePanels:e.sidebarSessionActivePanels&&Object.keys(e.sidebarSessionActivePanels).length>0?Zt(e.sidebarSessionActivePanels):void 0,navWidth:e.navWidth,sidebarAgentsMode:e.sidebarAgentsMode===`roster`?`roster`:`chip`,sidebarPreTeamScope:Th(e.sidebarPreTeamScope),sidebarCollapsedAgentIds:e.sidebarCollapsedAgentIds?.length?C(e.sidebarCollapsedAgentIds):void 0,sidebarEntries:e.sidebarEntries,sidebarLiveActivity:e.sidebarLiveActivity!==!1&&void 0,chatMessageMaxWidth:bh(e.chatMessageMaxWidth),showAdvancedSettings:e.showAdvancedSettings===!0||void 0,pinnedAgentIds:e.pinnedAgentIds?.length?e.pinnedAgentIds:void 0,textScale:e.textScale===void 0?void 0:wh(e.textScale),customTheme:e.customTheme||void 0,sessionsByGateway:o,locale:e.locale||void 0,lobsterPetVisits:e.lobsterPetVisits!==!1&&void 0,lobsterPetSounds:e.lobsterPetSounds===!0||void 0,sessionDeleteConfirm:e.sessionDeleteConfirm!==!1&&void 0,openLinksInControlUiBrowser:e.openLinksInControlUiBrowser===!0||void 0,openLinksExternally:e.openLinksExternally===!0||void 0},c=JSON.stringify(s),{token:l,...u}=e;_g=u;try{let{pageUrl:r}=kh(),a=vh(r);n?.setItem(i,c),(t.selectGateway||n?.getItem(a)==null)&&n?.setItem(a,e.gatewayUrl),n?.removeItem(Jh),n&&(_g=null)}catch{}let d=vg;d&&Ze(d.gatewayUrl())===r&&d.refresh()}var qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg;function bg(){return(bg=e((()=>{Ie(),A(),i(),ee(),Gc(),V(),sr(),tr(),uo(),oc(),Um(),Ym(),sh(),gh(),qh=`openclaw.control.settings.v1:`,Jh=`openclaw.control.settings.v1`,Yh=258,Xh=`openclaw.control.currentGateway.v1:`,Zh=`openclaw.control.user.v1`,Qh=`openclaw.control.token.v1`,$h=`openclaw.control.token.v1:`,eg=[90,100,110,125,140],tg=new Set([`none`,`min-content`,`max-content`]),ng=new Set([`calc`,`clamp`,`fit-content`,`max`,`min`]),rg=new Set([`ch`,`em`,`rem`,`vh`,`vmax`,`vmin`,`vw`,`px`]),ig=/^[0-9A-Za-z.%+\-*/(),\s]+$/,ag=/[A-Za-z][A-Za-z0-9-]*/g,og=/^(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem|em|ch|vw|vh|vmin|vmax|%)$/i,sg=96,cg=[`enter`,`modifier-enter`],lg=xh(cg,`enter`),ug=[`queue`,`steer`],dg=xh(ug,`steer`),fg=[`viewer`,`terminal`],pg=xh(fg,`viewer`),mg=[`right`,`bottom`],hg=xh(mg,`right`),gg={theme:`claw`,themeMode:`system`,textScale:100,sidebarLiveActivity:!0,chatMessageMaxWidth:`48rem`,chatShowTaskProgress:!0,chatCollapseTaskProgress:!1,chatSendShortcut:`enter`,catalogOpenTarget:`viewer`,composerHoldToRecord:!0,lobsterPetVisits:!0,lobsterPetSounds:!1,sessionDeleteConfirm:!0},_g=null,vg=null,yg=null})))()}function xg(e,t){return!new URLSearchParams(e.search+`&`+e.hash.slice(1)).has(`session`)&&!Bo(e.pathname,t)&&(hs(e.pathname,t)===null||/^\/chat\/?$/u.test(e.pathname.slice(t.length)))}async function Sg(e){let t=Dm(e.location,e.basePath);if(!t)return null;let n=!!(e.agentsList()?.mainKey?.trim()||e.gateway.snapshot.phase===`connected`&&e.gateway.snapshot.hello),r=ri(t.sessionKey);t.sessionKey&&!n&&await wm(e.gateway,e.signal);let i={agentsList:e.agentsList(),hello:e.gateway.snapshot.hello},a=r?.agentId??(Em(e.selectedAgentId,i.agentsList)||Fr(i)),o=Ei(i),s=t.sessionKey?Xu(t.face,a,t.sessionKey,e.basePath,{mainKey:o}):null,c=new URLSearchParams(e.location.search);c.delete(`session`),c.delete(`face`);let l=c.toString();return{...e.location,pathname:s??J(t.face,e.basePath),search:l?`?${l}`:``}}function Cg(e,t,n,r,i){if(!xg(e,t)||!n.trim())return e;let a=ri(n)?.agentId??r.trim();if(!a)return e;let{options:o}=co({face:`chat`,sessionKey:n,fallbackAgentId:a,basePath:t,mainKey:i,exactKey:!0});if(o.pathname===J(`chat`,t))return e;let s=new URLSearchParams(e.search);return new URLSearchParams(o.search).forEach((e,t)=>s.set(t,e)),{...e,pathname:o.pathname,search:s.size?`?${s}`:``}}function wg(e,t,n){if(hs(e.pathname,t)===`new-session`){let t=Ta(e.search).agentId;return t?{agentId:t}:{}}let r=Fh(n);if(hs(e.pathname,t)===`model-providers`)return r.selectedAgentId?{agentId:r.selectedAgentId}:{};let i=Cg(e,t,r.sessionKey,r.selectedAgentId??``),a=Se(i.pathname,t);if(a?.kind===`literal`)return{agentId:a.agentId,sessionKey:a.sessionKey};if(a?.kind===`main`)return{agentId:a.agentId,sessionKey:u({agentId:a.agentId})};if(a?.kind===`short`)return{agentId:a.agentId,shortId:a.shortId,...a.slugHint?{slugHint:a.slugHint}:{}};if(li(e,t,hs)){let e=ri(r.sessionKey)?.agentId??r.selectedAgentId;return{sessionKey:r.sessionKey,...e?{agentId:e}:{}}}}function Tg(e){let t=null;return()=>t??=e.resolve().catch(t=>{if(e.signal.aborted)return e.fallback;throw t})}async function Eg(e){let t=await Sg(e);if(t)return t;if(!xg(e.location,e.basePath))return e.location;let n=await wm(e.gateway,e.signal),r=e.gateway.snapshot.hello,i=e.agentsList(),a={agentsList:i,hello:e.gateway.snapshot.hello},o=e.sessionKey.trim()||e.gateway.snapshot.sessionKey,s=Fr(a),c=ri(o)?.agentId??Em(e.selectedAgentId,i)??s;if(i=await e.ensureAgentsList?.()??i,e.signal.throwIfAborted(),e.gateway.snapshot.client!==n||e.gateway.snapshot.hello!==r)return Eg(e);s=Fr({agentsList:i,hello:r}),i&&!Em(c,i)&&(c=Em(e.selectedAgentId,i)??s,o=u({agentId:c,mainKey:Ei({agentsList:i,hello:e.gateway.snapshot.hello})}));let l={agentsList:i,hello:e.gateway.snapshot.hello},d=Ei(l),f=bi(l,o,c);o=f.sessionKey,c=f.agentId??c;let p=ri(o),m=La(o)||(p?.rest??o).toLowerCase()===d.toLowerCase(),h=null;if(!m&&!Bi(o)){try{h=await n.request(`sessions.resolve`,{key:o,agentId:c,allowMissing:!0},{signal:e.signal})}catch{e.signal.throwIfAborted()}if(e.signal.throwIfAborted(),e.gateway.snapshot.client!==n||e.gateway.snapshot.hello!==r)return Eg(e);h&&!h.ok&&(o=u({agentId:c,mainKey:d}))}let g=h?.ok?h:void 0;return Cg(e.location,e.basePath,g?.key??o,g?.agentId??c,d)}function Dg({router:e,gateway:t,agents:n,agentSelection:r,connectionBootstrap:i,initialChatRoute:a,chatSubmissions:o}){i.setForegroundRoute(a?void 0:null);let s=t.subscribe(e=>{i.synchronize({client:e.client,connected:e.phase===`connected`})}),c=e=>{let a=e.pendingMatches[0]??e.matches[0];if(!a&&e.status===`idle`)return;let s=h(a?.data),c=s?.kind===`session`&&typeof s.sessionKey==`string`?s.sessionKey:null;i.setForegroundRoute(a?.routeId!==`chat`||o.creation?null:a.status===`pending`?void 0:a.status===`success`&&c&&!Bi(c)?br({agentsList:n.state.agentsList,hello:t.snapshot.hello,assistantAgentId:r.state.selectedId},{sessionKey:c,agentId:typeof s?.agentId==`string`?s.agentId:void 0}):null)},l=()=>c(e.getState()),u=[s,e.subscribe(c),r.subscribe(l),o.subscribeCreate(l)];return()=>u.forEach(e=>e())}function Og(){return(Og=e((()=>{Y(),lp(),Zu(),up(),Gt(),Ti(),na(),wr(),Ot(),Tm(),Om(),bg()})))()}function kg(e){let t=!1,n=()=>({navCollapsed:t,navWidth:e.settings.navWidth,sidebarEntries:e.settings.sidebarEntries,pinnedAgentIds:e.settings.pinnedAgentIds??[]}),r=new Set;return{get snapshot(){return n()},update(e){let i=e.navCollapsed!==void 0&&e.navCollapsed!==t;e.navCollapsed!==void 0&&(t=e.navCollapsed);let a={};if(e.navWidth!==void 0&&(a.navWidth=e.navWidth),e.sidebarEntries!==void 0&&(a.sidebarEntries=[...e.sidebarEntries]),e.pinnedAgentIds!==void 0&&(a.pinnedAgentIds=[...e.pinnedAgentIds]),Object.keys(a).length>0&&Wh(a),i)for(let e of r)e(n())},subscribe(t){r.add(t);let i=e.subscribe(()=>t(n()));return()=>{r.delete(t),i()}}}}function Ag(){return(Ag=e((()=>{bg()})))()}function jg(e){let t=e.trim().replace(/^#/,``);if(!/^[0-9a-fA-F]{6}$/.test(t))return`#ffffff`;let n=e=>{let n=Number.parseInt(t.slice(e,e+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(2)+.0722*n(4)>.179?`#000000`:`#ffffff`}function Mg(){return(Mg=e((()=>{})))()}function Ng(){if(typeof document>`u`)return;let e=document.documentElement,t=document.querySelector(`.shell--chat`)!==null;e.classList.toggle(`control-ui-chat-shell`,t);let n=getComputedStyle(e),r=n.getPropertyValue(`--bg`).trim(),i=globalThis.matchMedia?.(`(max-width: 768px), (max-width: 932px) and (max-height: 500px) and (orientation: landscape)`).matches&&t&&n.getPropertyValue(`--bg-content`).trim()||r;if(i){e.style.setProperty(`--control-ui-system-chrome-background`,i);for(let e of document.querySelectorAll(`meta[name="theme-color"]`))e.content=i,e.removeAttribute(`media`)}}function Pg(e){Rg=e;let t=document.documentElement,n=(Rg===`theme`?void 0:Rg??Lg)?.trim().replace(/^#/,``),r=n&&/^[0-9a-fA-F]{6}$/.test(n)?`#${n}`:null;if(!r){for(let e of Ig)t.style.removeProperty(e);return}let i=jg(r),a=(e,t)=>`color-mix(in srgb, var(${e}) ${t}%, transparent)`;for(let e of[`--ring`,`--accent`,`--accent-muted`,`--primary`])t.style.setProperty(e,r);for(let e of[`--accent-foreground`,`--primary-foreground`])t.style.setProperty(e,i);t.style.setProperty(`--accent-hover`,`color-mix(in srgb, var(--accent) 82%, white 18%)`),t.style.setProperty(`--primary-hover`,`color-mix(in srgb, var(--primary) 82%, white 18%)`),t.style.setProperty(`--accent-subtle`,a(`--accent`,16)),t.style.setProperty(`--accent-glow`,a(`--accent`,30)),t.style.setProperty(`--focus`,a(`--ring`,22)),t.style.setProperty(`--focus-ring`,`0 0 0 2px var(--bg), 0 0 0 3px ${a(`--ring`,80)}`),t.style.setProperty(`--focus-glow`,`0 0 0 2px var(--bg), 0 0 0 3px var(--ring), 0 0 16px var(--accent-glow)`)}function Fg(e){Lg=e,Pg(Rg)}var Ig,Lg,Rg;function zg(){return(zg=e((()=>{Ig=[`--ring`,`--accent`,`--accent-foreground`,`--accent-hover`,`--accent-muted`,`--accent-subtle`,`--accent-glow`,`--primary`,`--primary-hover`,`--primary-foreground`,`--focus`,`--focus-ring`,`--focus-glow`]})))()}var Bg;function Vg(){return(Vg=e((()=>{Bg=({nextTheme:e,applyTheme:t,currentTheme:n})=>{let r=n===e?void 0:globalThis.document?.documentElement;t(),r&&(r.classList.remove(`theme-transition`),r.style.removeProperty(`--theme-switch-x`),r.style.removeProperty(`--theme-switch-y`))}})))()}function Hg(e,t){return t?.branding??ze(d.find(t=>t.id===e.theme))}function Ug(e,t){if(typeof globalThis.matchMedia!=`function`)return;let n=globalThis.matchMedia(e);if(typeof n.addEventListener==`function`)return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t);if(typeof n.addListener==`function`)return n.addListener(t),()=>n.removeListener(t)}function Wg(e,t){if(typeof document>`u`)return;let n=document.documentElement,r=e.theme.includes(`/`)&&!t?`claw`:e.theme,i=qm(r,t?.mode??e.themeMode);n.dataset.themeId=r,n.dataset.theme=i,n.dataset.themeMode=i.endsWith(`light`)?`light`:`dark`;let a=Hg(e,t);n.dataset.themeMascot=a.mascot,a.avatarHat?n.dataset.themeAvatarHat=a.avatarHat:delete n.dataset.themeAvatarHat,n.dataset.themeResolved=n.dataset.themeMode,n.classList.toggle(`wa-light`,n.dataset.themeMode===`light`),n.classList.toggle(`wa-dark`,n.dataset.themeMode===`dark`),n.style.colorScheme=n.dataset.themeMode,n.style.setProperty(`--control-ui-text-scale`,`${(e.textScale??100)/100}`);let o=Zm(r,e.fontUi,e.fontChat);$m(o),th(e.fontUi,e.fontChat),nh(o.chat),Lm(t?.palette??e.customTheme),Pg(e.accent),Ng()}function Gg(e){let{sessionKey:t,lastActiveSessionKey:n,selectedAgentId:r,...i}=e;return JSON.stringify(i)}function Kg(e,t){let{token:n,...r}=e,i=r,a=null,o,s=new Set,c=0,l,u=!1,d=!1,f,p=!1,m=()=>{let e=++c,t=!1;tl(Hg(i,l?.theme(i.theme))),Jm(i.theme,()=>{if(e!==c)return;let n=typeof document>`u`?void 0:document.documentElement.dataset.themeMascot;if(Wg(i,l?.theme(i.theme)),t)for(let e of s)e();typeof document<`u`&&(n===`none`||document.documentElement.dataset.themeMascot===`none`)&&z(async()=>{let{invalidateControlUiFaviconPalette:e,syncControlUiFavicon:t}=await import(`./control-ui-environment-presentation.runtime-DUs57N_7.js`);return{invalidateControlUiFaviconPalette:e,syncControlUiFavicon:t}},__vite__mapDeps([102,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url).then(({invalidateControlUiFaviconPalette:e,syncControlUiFavicon:t})=>{p||(e(),t())})}),t=!0;for(let e of s)e()},h=async()=>{if(!(p||l||u||t.snapshot.phase!==`connected`||!d&&!i.theme.includes(`/`))){u=!0;try{let{createThemeCatalog:e}=await z(async()=>{let{createThemeCatalog:e}=await import(`./theme-catalog-DVDT9sEx.js`);return{createThemeCatalog:e}},__vite__mapDeps([103,104,28]),import.meta.url);p||(l=e(t,m),f=void 0)}catch(e){p||(f={themes:[],error:e instanceof Error?e.message:String(e)},m())}finally{u=!1}}},g=()=>{o?.(),o=void 0},_=()=>{g(),i.themeMode===`system`&&(o=Ug(`(prefers-color-scheme: light)`,()=>{i.themeMode===`system`&&m()}))},v=Ug(`(max-width: 768px), (max-width: 932px) and (max-height: 500px) and (orientation: landscape)`,()=>Ng()),y=()=>{let e=Vh(t.connection.gatewayUrl),n=Gg(e)!==Gg(i);i=e,n&&(h(),m(),_())},b=zh({gatewayUrl:()=>t.connection.gatewayUrl,refresh:y}),x=e=>{(e.key===null||e.key===_h(t.connection.gatewayUrl))&&y()};globalThis.addEventListener?.(`storage`,x);let S=t.subscribe(()=>{h(),i.gatewayUrl!==t.connection.gatewayUrl&&y()});return _(),m(),h(),{get branding(){return Hg(i,l?.theme(i.theme))},get catalog(){return d||(d=!0,h()),l?.snapshot(i.theme)??f},get settings(){return i},get mode(){return i.themeMode},get resolvedMode(){let e=l?.theme(i.theme)?.mode??i.themeMode;return qm(i.theme,e).endsWith(`light`)?`light`:`dark`},get serverSelection(){return a},recordServerSelection(e,t){a={revision:(a?.revision??0)+1,scope:t,theme:e},m()},setMode(e){let t=qm(i.theme,i.themeMode),n=qm(i.theme,e);Bg({nextTheme:n,currentTheme:t,applyTheme:()=>{Wh({themeMode:e})}})},refresh:y,retryCatalog(){l?.refresh()??h()},subscribe(e){return s.add(e),()=>s.delete(e)},dispose(){p=!0,l?.dispose(),b(),globalThis.removeEventListener?.(`storage`,x),S(),c+=1,g(),v?.(),s.clear()}}}function qg(){return(qg=e((()=>{l(),zg(),Um(),bg(),il(),Vg(),Ym(),sh(),a()})))()}function Jg(e,t){ri(t)&&va(br({agentsList:e.agents,hello:null,assistantAgentId:null},{sessionKey:t}))}function Yg(){lm(),Xi(),z(async()=>{let{clearCachedBootState:e}=await import(`./session-roster-cache.runtime-CPajVK7c.js`);return{clearCachedBootState:e}},__vite__mapDeps([105,106,28]),import.meta.url).then(({clearCachedBootState:e})=>e())}function Xg(e,t){let n=e.connectionRevision,r=t;return e.subscribe(t=>{if(t.phase===`connected`&&hi(),e.connectionRevision!==n&&(r=void 0),t.phase!==`connected`||r===void 0)return;let i=r!==(t.selfUser?.id??null);r=void 0,i&&Yg()})}function Zg({gateway:e,agents:t,sessions:n}){let r=()=>{if(e.snapshot.phase!==`connected`)return;let r=ft(e.connection.gatewayUrl),i=om(e.snapshot.hello?.auth,e.connection.token);if(!i){lm(r);return}let a=t.state.agentsList;a&&!t.state.agentsListCached&&n.groupsStatus()===`ready`&&dm({version:2,...i,savedAt:Date.now(),scope:r,profileId:e.snapshot.selfUser?.id??null,agents:a,groups:[...n.state.groupSettings],sectionOrder:[...n.state.sectionOrder]})},i=[e,t,n].map(e=>e.subscribe(r));return()=>i.forEach(e=>e())}function Qg(){return(Qg=e((()=>{na(),xi(),wr(),ii(),vm(),a()})))()}function $g(e,t){if(e?.signal?.aborted)return Promise.resolve(e.value);let n=document.createElement(`div`);return document.body.append(n),new Promise(r=>{let i={host:n,settled:!1,render(e){i.settled||Oo(e(),n)},finish(t){i.settled||(i.settled=!0,e?.signal?.removeEventListener(`abort`,a),Oo(U,n),n.remove(),r(t))}},a=()=>e&&i.finish(e.value);e?.signal?.addEventListener(`abort`,a,{once:!0}),t(i)})}function e_(){return(e_=e((()=>{W(),Gd()})))()}function t_(e){return a_.add(e),()=>void a_.delete(e)}function n_(e){return o_.add(e),()=>void o_.delete(e)}function r_(){let e=[...o_];for(let t of e)t()}async function i_(e,t){let n=()=>{if(!t?.signal?.aborted)for(let t of a_)t(e)};try{let r=await fetch(e,t);return r.status===401&&n(),r}catch(e){throw n(),e}}var a_,o_;function s_(){return(s_=e((()=>{a_=new Set,o_=new Set})))()}async function c_(e,t){let n=null;try{n=I(await e.json())}catch{t.throwIfAborted()}let r=n?.error,i=typeof r==`string`?r:r&&typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:``,a=wn(i);return{data:n,response:e,errorMessage:a?`HTTP ${e.status}: ${a}`:`HTTP ${e.status}`}}function l_(e){return C([e.hello?.auth?.deviceToken,e.settings?.token,e.password]).filter(e=>!/[\r\n]/.test(e))}function u_(e){return l_(e)[0]??null}async function d_(e,t,n,r){let i=n.length?n:[``],a=!t.method||t.method===`GET`||t.method===`HEAD`;for(let n=0;;n++){if(t.signal.throwIfAborted(),!r())throw new DOMException(`Gateway request is no longer current`,`AbortError`);let o=i[n],s=await i_(e,{...t,...o?{headers:{...t.headers,Authorization:`Bearer ${o}`}}:{}});if(t.signal.throwIfAborted(),n===i.length-1||s.status!==401&&!(a&&s.status===403))return s;s.body?.cancel().catch(()=>void 0)}}function f_(){return(f_=e((()=>{i(),wa(),s_()})))()}function p_(e,t){return t.aborted?Promise.resolve():new Promise(n=>{let r=document.createElement(`iframe`);r.hidden=!0,r.setAttribute(`sandbox`,`allow-same-origin`),r.referrerPolicy=`no-referrer`,r.src=e.href;let i=()=>{window.clearTimeout(a),t.removeEventListener(`abort`,i),r.remove(),n()},a=window.setTimeout(i,1e4);r.addEventListener(`load`,i,{once:!0}),r.addEventListener(`error`,i,{once:!0}),t.addEventListener(`abort`,i,{once:!0}),document.body.append(r)})}function m_(e,t=()=>({})){let n=new URL(`${be(e)}/`,window.location.origin),r=new URL(de.slice(1),n),i=new AbortController,a,o=-1/0,s=!1,c=!1,l=!1,u,d,f=()=>{u||c||i.signal.aborted||$g({signal:i.signal,value:void 0},e=>{let t=()=>{c=!0,e.finish(void 0)},r=()=>H`
        <openclaw-modal-dialog
          label=${B(`connection.browserSignIn.title`)}
          description=${B(`connection.browserSignIn.description`)}
          @modal-cancel=${t}
        >
          <div class="exec-approval-card">
            <div class="exec-approval-header">
              <div style="min-width: 0">
                <div class="exec-approval-title">${B(`connection.browserSignIn.title`)}</div>
                <div class="exec-approval-sub" style="white-space: normal">
                  ${B(`connection.browserSignIn.description`)}
                </div>
              </div>
            </div>
            ${l?H`<p>${B(`connection.browserSignIn.returnHint`)}</p>`:U}
            <p role="status" aria-live="polite">
              ${a?B(`connection.browserSignIn.checking`):d===`unavailable`?B(`connection.browserSignIn.unavailable`):d===`sign-in`?B(`connection.browserSignIn.stillRequired`):U}
            </p>
            <div class="exec-approval-actions">
              <button
                class="btn primary"
                @click=${async()=>{if(Kc()?.webkit?.messageHandlers?.openclawGateways){let{nativeGatewaysCapability:e}=await z(async()=>{let{nativeGatewaysCapability:e}=await import(`./native-gateways.runtime--PSgoJUb.js`);return{nativeGatewaysCapability:e}},__vite__mapDeps([107,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url);if(i.signal.aborted||c)return;let t=e(),n=t?.snapshot?.currentId;if(t&&n){t.reconnect(n);return}}l=!0,d=void 0,da(n.href),e.render(r)}}
              >
                ${B(`connection.browserSignIn.action`)}
              </button>
              ${l?H`<button class="btn" ?disabled=${!!a} @click=${()=>void p(!0)}>${B(`connection.browserSignIn.checkAgain`)}</button>`:U}
              <button class="btn" @click=${t}>
                ${B(`connection.browserSignIn.dismiss`)}
              </button>
            </div>
          </div>
        </openclaw-modal-dialog>
      `;u={close:()=>e.finish(void 0),update:()=>e.render(r)},e.render(r)}).finally(()=>{u=void 0})};function p(e=!1){if(i.signal.aborted||a||!e&&Date.now()-o<3e4)return a;o=Date.now();let n=l_(t()),p=()=>{let e=l_(t());return!i.signal.aborted&&e.length===n.length&&e.every((e,t)=>e===n[t])};return a=(async()=>{try{let e=()=>d_(r.href,{method:`HEAD`,credentials:`same-origin`,cache:`no-store`,redirect:`manual`,signal:AbortSignal.any([i.signal,AbortSignal.timeout(5e3)])},n,p),t=await e();if(!p())return;if(t.type===`opaqueredirect`&&!s){if(s=!0,await p_(r,i.signal),!p())return;t=await e()}if(!p())return;if(t.type===`opaqueredirect`)s=!0,d=l?`sign-in`:void 0,f();else if(t.ok&&t.headers.get(`content-type`)?.split(`;`)[0]?.trim()===`application/json`){let e=s;s=!1,c=!1,l=!1,u?.close(),e&&r_()}else d=`unavailable`}catch{p()&&(d=`unavailable`)}})().finally(()=>{a=void 0,u?.update()}),u?.update(),a}let m=t_(e=>{let t;try{t=new URL(e,window.location.href)}catch{return}t.origin===n.origin&&t.pathname.startsWith(n.pathname)&&p()}),h=navigator.serviceWorker,g=e=>{h?.controller&&e.source===h.controller&&e.data?.type===`openclaw-http-request-failed`&&p()},_=()=>{s&&p(!0)};return h?.addEventListener(`message`,g,{signal:i.signal}),window.addEventListener(`focus`,_,{signal:i.signal}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&_()},{signal:i.signal}),()=>{i.abort(),m()}}function h_(){return(h_=e((()=>{W(),Xe(),Y(),e_(),V(),Br(),s_(),f_(),a()})))()}function g_(e,t){let{connection:n,snapshot:{client:r}}=e;return{canReload:()=>t?.()!==!1&&r!==null&&e.snapshot.client===r&&e.connection===n&&(!n.bootstrapToken||__(n.gatewayUrl)),reload:()=>{let e=new URL(window.location.href);if(n.bootstrapToken){e.searchParams.delete(`gatewayUrl`);let t=new URLSearchParams(e.hash.slice(1));t.set(`gatewayUrl`,n.gatewayUrl),t.set(`bootstrapToken`,n.bootstrapToken),n.bootstrapProfile&&t.set(N,n.bootstrapProfile),e.hash=t.toString()}jl(e)}}}function __(e){try{return new URL(e.replace(/^ws/u,`http`)).origin===globalThis.location?.origin}catch{return!1}}function v_(){return(v_=e((()=>{Xe(),Yl()})))()}function y_(e){let{recovery:t,attachments:n,createdAt:r,checking:i,reconnecting:a,error:o}=e,s={id:t.messageId,text:t.message,...t.mentions?.length?{mentions:t.mentions}:{},attachments:n,createdAt:r,sessionKey:t.sessionKey,agentId:t.agentId,sendRunId:t.messageId,sendAttempts:1,sendState:a?`waiting-reconnect`:i?`unconfirmed`:o?`failed`:t.phase===`paused`?t.reason===`unconfirmed`?`unconfirmed`:`failed`:`sending`,...o||t.phase===`paused`?{sendError:o??(t.phase===`paused`?t.error:void 0)}:{}},c=b_.get(t),l=Reflect.ownKeys(s);return c&&Reflect.ownKeys(c).length===l.length&&l.every(e=>Object.hasOwn(c,e)&&Object.is(Reflect.get(c,e),Reflect.get(s,e)))?c:(b_.set(t,s),s)}var b_;function x_(){return(x_=e((()=>{b_=new WeakMap})))()}function S_(e,{gatewayUrl:t,recoveryScope:n}){let r=e.connectionRevision,i=Uf(e);return()=>{let a=e.snapshot.client,o=e.snapshot.hello?.auth?.recoveryScope??(a?.recoveryScopeReady?a.recoveryScope:void 0);return e.connectionRevision===r&&Uf(e)===i&&e.connection.gatewayUrl===t&&(n===void 0||!o||o===n)}}function C_(e,t=()=>z(()=>import(`./session-placement-startup.runtime-DSqPZz_S.js`),__vite__mapDeps([108,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url)){let n=new Map,{gateway:r}=e,i=!1,a,o,s=new Set,c,l,u=()=>s.forEach(e=>e()),d=()=>{let{client:e,phase:t}=r.snapshot;return t===`connected`&&e?.recoveryScopeReady?e:null},f=()=>[...n.values()].map(e=>e()).filter(e=>e!==void 0),p=()=>f().every(e=>e.persisted),m=()=>{let e=f(),t=e[0];if(!t)return;let a=o,s=S_(r,t.input.recovery),c=()=>!i&&o===a&&s();return()=>{let t=f();if(c()&&e.length===t.length&&!e.some((e,n)=>e!==t[n])){for(let{input:t,persisted:r}of e)r||n.delete(t.recovery.sessionKey);u(),c()&&Dl(!0)&&jl()}}},h=El(p,()=>gr({message:B(`newSession.placementReloadBlocked`),actionLabel:B(`newSession.discardUnsavedAndReload`),onAction:m()})),g=(s,f=!1)=>{if(i)return;if(c??=r.subscribe(()=>g()),(s||f)&&o?.error&&(o=void 0,s||u()),s){let{input:e}=s;if(a){a.start(e);return}let t=e.recovery.sessionKey;n.delete(t);let i=S_(r,e.recovery),o={...s,input:{...e,displayAttachments:e.displayAttachments??xn(e.recovery.attachments)}};n.set(t,()=>i()?o:void 0),n.size>32&&n.delete(n.keys().next().value),u()}let p=d();if(a){if(p)for(let[e,t]of n){let r=t()?.input;n.delete(e),r&&a.start(r)}a?.resumeRecovery(),p&&l&&(l=void 0,u());return}if(p&&!s){if(!l?.current()){let e={gatewayUrl:r.connection.gatewayUrl,recoveryScope:p.recoveryScope},t=S_(r,e),n=[],i={startedAt:Date.now()};l={current:t,refresh:()=>{n=Sr(e.gatewayUrl,e.recoveryScope)},read:r=>t()&&n.includes(Mr(e.gatewayUrl,e.recoveryScope,r))?i:void 0}}l.refresh()}if(o)return;let m={};o=m,t().then(({default:t})=>{i||(a=t(e),a.subscribe(u),g())},e=>{m.error=Error(on(e)),u()})};return{get(e){let t=n.get(e)?.()?.input,r=t?{targetKind:t.recovery.target.kind,startedAt:t.createdAt}:l?.read(e);if(!r)return a?.get(e)??null;let i=o?.error,s=Al(i)&&!p(),c=s?B(`newSession.placementReloadBlocked`):i?.message,u=!d();return!u||t?{sessionKey:e,...r,phase:u?`reconnecting`:i?`failed`:`pending`,error:c,retryable:!u&&!!i&&!s,...t?{initialTurn:y_({recovery:t.recovery,attachments:t.displayAttachments,createdAt:t.createdAt,error:c,reconnecting:u})}:{},...s&&!u?{discardAndReload:m()}:{}}:null},hasPendingTurn(e){return!!(n.get(e)?.()||a?.hasPendingTurn(e)||l?.read(e))},start:e=>g({input:e,persisted:e.persistRecovery}),pause(e,t,o){let s=d();if(i||!s)return;if(a){a.pause(e,t,o);return}let c=n.get(e)?.()?.input,l=c?.recovery??o.readSessionPlacementRecovery(r.connection.gatewayUrl,s.recoveryScope,e);if(!l)return;let{recovery:u,persisted:f}=o.pauseSessionPlacementRecovery(l,t,c?.persistRecovery??!0);g({input:{recovery:u,persistRecovery:c?.persistRecovery??!0,mode:`recover`,createdAt:c?.createdAt??Date.now(),displayAttachments:c?.displayAttachments},persisted:f})},retry(e){if(!d())return;let t=n.get(e)?.();if(t||l?.read(e)){let n=o,r=n?.error;if(Al(r)){g();let t=l;if(!t?.read(e))return;Ll({canReload:()=>(t.refresh(),!i&&o===n&&l===t&&!!t.read(e)&&p())});return}return g(t,!0)}a?.retry(e)},resumeRecovery:g,subscribe(e){return s.add(e),()=>s.delete(e)},dispose(){c?.(),h(),i=!0,a?.dispose(),a=void 0,n.clear(),l=void 0,s.clear()}}}function w_(){return(w_=e((()=>{V(),wa(),Dr(),or(),Da(),kl(),Kf(),x_(),Yl(),a()})))()}function T_(e){let t=new Map,n=!1,r,i=e=>{let t=new Map(e.attachments.map(e=>[e.id,e]));for(let n of Object.values(e.fallbacks))for(let e of n.attachments)t.set(e.id,e);return[...t.values()]},a=(e,t=new Set)=>{e&&ra(i(e).filter(e=>!t.has(e.id)))},o=(e,t)=>JSON.stringify([e,t]),s=e=>{let n=t.get(e);return n&&(t.delete(e),r?.key===e&&r.controller.abort()),n},c=e=>{if((e.incognito||e.newSessionDraft?.incognito)&&D_(e))return{draft:e,fallbackKey:void 0};for(let[t,n]of Object.entries(e.fallbacks))if(n.incognito&&D_(n))return{draft:n,fallbackKey:t}},l=()=>new Set([...t.values()].flatMap(i).map(e=>e.id)),u=()=>{for(let[e,n]of t)c(n)&&!n.isConnectionCurrent()&&a(s(e),l())},d=e.subscribe(u),f=()=>{u();for(let[e,n]of t){let t=c(n);if(t)return{key:e,entry:n,...t}}},p=async()=>{let i=f();if(!i||r)return;let{key:a,entry:o,draft:c,fallbackKey:u}=i,d=new AbortController;r={key:a,controller:d};let p=e.connection,m=e.snapshot.client,h=()=>!n&&!d.signal.aborted&&t.get(a)===o&&o.isConnectionCurrent()&&e.snapshot.client===m&&e.connection===p,g=g_(e);try{if(!h()||!await o.reviewPrivateDraft({text:c.message,attachments:c.attachments,hasGoal:!!c.goalMode,pendingReads:0,isCurrent:h,signal:d.signal})||!h())return;let e=[...c.attachments];u===void 0?(o.message=``,o.attachments=[],o.goalMode=null,o.replyTarget=null,o.mentions=[]):delete o.fallbacks[u],!o.message&&!o.attachments.length&&!o.goalMode&&!o.replyTarget&&!Object.keys(o.fallbacks).length&&s(a);let t=l();ra(e.filter(e=>!t.has(e.id))),await Ll({timeoutMs:0,...g})}catch{h()&&gr({message:B(`chat.privateDraftReload.unavailable`)})}finally{r?.controller===d&&(r=void 0)}},m=El(()=>!f(),()=>gr({message:B(`chat.privateDraftReload.blocked`),actionLabel:B(`chat.privateDraftReload.review`),onAction:()=>void p()}));return{prepare:({owner:r,paneId:i,scopeKey:c,attachments:l,fallbacks:u,message:d=``,draftRevision:f,goalMode:p,replyTarget:m,mentions:h,newSessionDraft:g,incognito:_,reviewPrivateDraft:v})=>{let y=o(i,c),b=s(y),x=Object.entries(u);if(!d&&!p&&!m&&l.length===0&&x.length===0){a(b);return}let S=new Set(l.map(e=>e.id));for(let e of Object.values(u))for(let t of e.attachments)S.add(t.id);if(a(b,S),!r||n){ra(l);for(let e of Object.values(u))ra(e.attachments);return}t.set(y,{owner:r,reviewPrivateDraft:v,isConnectionCurrent:S_(e,{gatewayUrl:e.connection.gatewayUrl,recoveryScope:r.recoveryScope||void 0}),preparedAt:Date.now(),paneId:i,scopeKey:c,attachments:[...l],...g?{newSessionDraft:g}:{},..._?{incognito:_}:{},message:d,...f===void 0?{}:{draftRevision:f},...p?{goalMode:p}:{},...m?{replyTarget:{...m}}:{},...h?.length?{mentions:h.map(e=>({...e}))}:{},fallbacks:Object.fromEntries(x.map(([e,t])=>[e,{...t,attachments:[...t.attachments]}]))});for(let e of t.keys()){if(t.size<=E_)break;a(s(e))}},consume:({owner:e,paneId:t,scopeKey:n})=>{let r=s(o(t,n));return r?.owner===e&&r.isConnectionCurrent()?{attachments:r.attachments,fallbacks:r.fallbacks,...r.newSessionDraft?{newSessionDraft:r.newSessionDraft}:{},...r.message?{message:r.message}:{},...r.draftRevision===void 0?{}:{draftRevision:r.draftRevision},...r.goalMode?{goalMode:r.goalMode}:{},...r.replyTarget?{replyTarget:r.replyTarget}:{},...r.mentions?{mentions:r.mentions}:{}}:(a(r),null)},retainedAttachmentIds:e=>{let n=new Set(e.map(e=>e.id)),r=new Set;for(let e of t.values())for(let t of i(e))n.has(t.id)&&r.add(t.id);return r},retireScope:(n,r)=>{for(let[i,o]of t)o.owner===e.snapshot.client&&o.isConnectionCurrent()&&o.scopeKey===n&&o.preparedAt<r&&a(s(i),l())},clearPane:e=>{for(let[n,r]of t)r.paneId===e&&a(s(n))},dispose:()=>{n=!0,m(),d(),r?.controller.abort();for(let e of t.values())a(e);t.clear()}}}var E_,D_;function O_(){return(O_=e((()=>{V(),or(),jt(),kl(),v_(),w_(),Yl(),E_=32,D_=e=>!!(e.message||e.attachments.length||e.goalMode||e.replyTarget||e.mentions?.length)})))()}function k_(e){Object.assign(e,{pending:!1,message:null})}function A_(){let e=new Map,t,n=new Set,r=e=>{t=e;for(let e of n)e()},i=new WeakMap,a=t=>[...e.keys()].find(e=>Or(e,t)),o=(t,n,r)=>{let i=e.get(a(t)??``);return i?.kind===`initial`&&i.owner===n&&(!i.sessionId||!r||i.sessionId===r)?i:null};return{retain:t=>{if(!t)return;let n=t.kind===`initial`,r=n?e:i.get(t.owner)??new Map,o=n?a(t.sessionKey)??t.sessionKey:t.deliveryKey,s=r.get(o);if(n&&s?.kind===`initial`&&s.owner===t.owner&&s.pendingRunId===t.pendingRunId)return s.consumedByEventId??=t.consumedByEventId,s;n||i.set(t.owner,r);let c={...t,pending:!0};r.delete(o),r.set(o,c);let l=n?32:64;return r.size>l&&r.delete(r.keys().next().value),c},beginCreate:e=>(r(e),()=>{t===e&&r(void 0)}),get creation(){return t?.creation},readCreateMessage:e=>t?.creation.sessionKey===e&&t.canDisplay()?t.message:null,subscribeCreate:e=>(n.add(e),()=>n.delete(e)),readInitial:o,observeInitialSession:(e,t,n)=>{let r=o(e,t);r?.pending&&n&&(r.sessionId&&r.sessionId!==n?k_(r):r.sessionId=n)},readDelivered:(e,t)=>i.get(t)?.get(e),clear:()=>{e.clear(),i=new WeakMap,r(void 0)}}}function j_(){return(j_=e((()=>{na()})))()}function M_(){if(typeof document>`u`)return null;let e=document.documentElement.getAttribute(dt);return e===`true`||e!==`false`&&null}function N_(e,t,n){let r=document.documentElement;(e||t||r.hasAttribute(`data-openclaw-environment`)||r.style.getPropertyValue(`--ring`))&&z(async()=>{let{applyControlUiPresentation:e}=await import(`./control-ui-environment-presentation.runtime-DUs57N_7.js`);return{applyControlUiPresentation:e}},__vite__mapDeps([102,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url).then(({applyControlUiPresentation:r})=>{n()&&r({environment:e,seamColor:t})})}function P_(e){return{assistantIdentity:un({agentId:e.assistantAgentId,name:e.assistantName,avatar:e.assistantAvatar,avatarSource:e.assistantAvatarSource,avatarStatus:e.assistantAvatarStatus,avatarReason:e.assistantAvatarReason}),serverVersion:e.serverVersion??null,serverBuildId:e.serverBuildId??null,devGitBranch:e.devGitBranch?.trim()||null,environment:e.environment??null,embedSandboxMode:e.embedSandbox??`scripts`,allowExternalEmbedUrls:!!e.allowExternalEmbedUrls,automaticallyFetchFavicons:!!e.automaticallyFetchFavicons,communityInvite:e.communityInvite===!0,newSessionModelDefaults:e.newSessionModelDefaults??`last-used`,terminalEnabled:!!e.terminalEnabled,uploadsEnabled:e.uploadsEnabled!==!1,cliAgentsEnabled:!!e.cliAgentsEnabled,pluginAssetsRequireAuth:e.pluginAssetsRequireAuth!==!1,pluginFrameGrants:(e.pluginFrameGrants??[]).filter(e=>typeof e?.pluginId==`string`&&typeof e.path==`string`&&(e.match===`exact`||e.match===`prefix`)).map(e=>({pluginId:e.pluginId,path:Gs(e.path),match:e.match}))}}async function F_(e){if(typeof window>`u`||typeof fetch!=`function`)return null;try{let t=null;for(let n of e.authCandidates.length?e.authCandidates:[``]){let r={Accept:`application/json`};if(n&&(r.Authorization=`Bearer ${n}`),t=await fetch(e.url,{method:`GET`,headers:r,credentials:`same-origin`,signal:e.signal}),t.ok)break;if(t.status!==401&&t.status!==403)return null}if(!t?.ok)return null;let n=await t.json();return{config:P_(n),seamColor:n.seamColor}}catch{return null}}function I_(e){let n=L_,r=0,i=0,a=0,o=document.documentElement.getAttribute(t);o&&(n={...n,environment:JSON.parse(o)},N_(n.environment,void 0,()=>a===0));let s=`${be(e.resourceBasePath)}${de}`,c=new URL(s,window.location.origin).origin===window.location.origin,l=()=>c?l_(e.getAuth?.()??{}):[],u=[],d,f=new Set;return{get current(){return n},async refresh(e){let t=l();if((t.length!==u.length||t.some((e,t)=>e!==u[t]))&&(u=t,r++,d=void 0),e?.skipWithoutAuthCandidate&&c&&!t.length)return null;if(d&&d.signal===e?.signal)return d.promise;let o=++i,p=r,m=e?.signal,h=()=>{let e=l();return p===r&&!m?.aborted&&t.length===e.length&&t.every((t,n)=>t===e[n])},g=F_({url:s,authCandidates:t,signal:m}).then(e=>{if(!e||!h())return null;let t=e.config;if(o<a)return t;a=o,N_(t.environment,e.seamColor,()=>h()&&o===a);let r=M_();if(r!==null&&t.terminalEnabled!==r)return Dl()&&window.location.reload(),t;n=t;for(let e of f)e(n);return t});d={promise:g,signal:m};try{return await g}finally{d?.promise===g&&(d=void 0)}},subscribe(e){return f.add(e),()=>f.delete(e)}}}var L_;function R_(){return(R_=e((()=>{st(),Xe(),dr(),f_(),kl(),a(),L_={assistantIdentity:un(),serverVersion:null,serverBuildId:null,devGitBranch:null,environment:null,embedSandboxMode:`strict`,allowExternalEmbedUrls:!1,automaticallyFetchFavicons:!1,communityInvite:!1,newSessionModelDefaults:null,terminalEnabled:M_()??!1,uploadsEnabled:!0,cliAgentsEnabled:!1,pluginAssetsRequireAuth:!0,pluginFrameGrants:[]}})))()}function z_(){let e=null,t=0,n=0,r=null,i,a=new Map,o=()=>{for(let[s,c]of a){if(!e||n>=B_)return;let l=r!==null&&(!i?.ready||i.client!==e||i.sessionKey!==r);if(c.started||l&&c.background)continue;c.started=!0,n++;let u=t,d=()=>{u===t&&(a.delete(s),n--),c.resolve(),u===t&&o()};try{c.run().then(d,d)}catch{d()}}},s=()=>{t+=1,e=null,n=0,i=void 0;for(let e of a.values())e.started||e.resolve();a.clear()};return{reset:s,synchronize(t){let n=t.connected?t.client:null;(!n||e&&e!==n)&&s(),e=n,o()},setForegroundRoute(e){r=e,o()},setForegroundPane(e,t){t&&(r===void 0||t.sessionKey===r)?i={owner:e,...t}:!t&&i?.owner===e&&(i=void 0),o()},run(e,t,n){let r=a.get(e);if(r)return r.promise;let i=Ct();return a.set(e,{...i,run:t,started:!1,background:n?.background===!0}),o(),i.promise}}}var B_;function V_(){return(V_=e((()=>{ve(),B_=2})))()}function H_(e){let t=e.hello?.auth;return e.phase!==`connected`||t?.scopes===void 0||Rf(t)?{phase:`hidden`}:Io(e,`device.scopes.requestUpgrade`)===!0&&Io(e,`device.scopes.waitUpgrade`)===!0&&e.client?.scopeUpgradeReady===!0?{phase:`available`}:{phase:`guidance`}}function U_(){return(U_=e((()=>{Lo(),Hf()})))()}function W_(e){let t=new Set,n=e.snapshot,r=null,i=H_(n),a=e=>{if(JSON.stringify(i)!==JSON.stringify(e)){i=e;for(let e of t)e()}},o=()=>{r&&a(r.state)},s=e.subscribe(e=>{n=e,r?.sync(n),a(r?.state??H_(n))});return{get state(){return i},activate(e){r??=new e(n,o),r.sync(n),a(r.state)},request:()=>r?.request(),retry:()=>r?.retry(),cancel:()=>r?.cancel(),subscribe(e){return t.add(e),()=>t.delete(e)},dispose(){s(),r?.dispose(),r=null,t.clear()}}}function G_(){return(G_=e((()=>{U_()})))()}function K_(e,t,n){let r=!1,i=!1,a=!1,o=t.visibilityState===`hidden`,s=n=>{t.visibilityState!==`hidden`&&(a||=n,!i&&(i=!0,queueMicrotask(()=>{i=!1;let n=a;if(a=!1,r||t.visibilityState===`hidden`)return;let o=e.snapshot.client;o&&(n||o.needsWakeReconnect)&&e.connect(),z(async()=>{let{refreshControlUiServiceWorker:e}=await import(`./sw-refresh.runtime-BOQMREZN.js`);return{refreshControlUiServiceWorker:e}},__vite__mapDeps([109,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url).then(({refreshControlUiServiceWorker:e})=>e()).catch(e=>{console.warn(`OpenClaw service worker refresh failed after page activation.`,e)})})))},c=()=>{if(t.visibilityState===`hidden`){o=!0;return}o&&(o=!1,s(!1))},l=e=>{e.persisted&&s(!0)},u=()=>s(!1);return t.addEventListener(`visibilitychange`,c),n.addEventListener(`pageshow`,l),n.addEventListener(`online`,u),()=>{r=!0,t.removeEventListener(`visibilitychange`,c),n.removeEventListener(`pageshow`,l),n.removeEventListener(`online`,u)}}function q_(){return(q_=e((()=>{a()})))()}function J_(e,t){let n=!1,r=-1/0,i=!1,a=()=>{let{client:a,phase:o}=e.snapshot;if(n||i||!a||o!==`connected`||t.visibilityState!==`visible`)return;let s=Date.now();if(s>=r&&s-r<Y_)return;r=s,i=!0;let c=()=>{i=!1};a.request(`presence.activity`,{}).then(c,c)},o=()=>{e.snapshot.phase!==`connected`||Z_.has(t)||(Z_.add(t),a())},s=e=>{e.isTrusted&&a()};for(let e of X_)t.addEventListener(e,s,{capture:!0,passive:!0});let c=e.subscribe(o);return o(),()=>{n=!0,c();for(let e of X_)t.removeEventListener(e,s,!0)}}var Y_,X_,Z_;function Q_(){return(Q_=e((()=>{Y_=3e4,X_=[`keydown`,`pointerdown`,`pointermove`,`wheel`,`touchstart`],Z_=new WeakSet})))()}function $_(e,t){let n=null,r=null,i=null,a=0,o=!1,s=()=>{if(n)return Promise.resolve(n);if(r)return r;let a=z(async()=>{let{createCanvasSurfaceLease:e}=await import(`./canvas-surface-lease.runtime-CzzmSkNQ.js`);return{createCanvasSurfaceLease:e}},__vite__mapDeps([110,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url).then(({createCanvasSurfaceLease:r})=>{let a=r({request:(t,n)=>{let r=i;return!r||e()!==r?Promise.reject(Error(`canvas surface lease has no current gateway client`)):r.request(t,n)},onChange:n=>{i&&e()===i&&t(n)}});return n=a,a});return r=a,a.catch(()=>{r===a&&(r=null)}),a};return{begin:(e,t)=>(i=null,n?.stop(),a+=1,i=e,o=Lf(t),Fn(),a),start:(t,n,r)=>{o&&s().then(o=>{a===n&&i===t&&e()===t&&o.start(r)}).catch(()=>{})},stop:()=>{i&&(a+=1,i=null,n?.stop(),Fn())},get generation(){return a}}}function ev(){return(ev=e((()=>{Ft(),Hf(),a()})))()}function tv(e){rv.delete(e)}async function nv(e,t){tv(e);try{return await e.request(`users.prefs.set`,t)}finally{tv(e)}}var rv;function iv(){return(iv=e((()=>{rv=new WeakMap})))()}function av(e){return t=>{if(!e.isAttached())return;let n=e.project(t);if(n){try{e.record(n)}catch(e){console.error(`[gateway] event handler error:`,e)}ov(e.listeners,n,`event listener`,e.isCurrent)}}}function ov(e,t,n,r){for(let i of Array.from(e)){if(r&&!r(t))return;try{i(t)}catch(e){console.error(`[gateway] ${n} handler error:`,e)}}}function sv(){let e=[],t=0,n=null,r=()=>(t+=1,e=[],e);return{get entries(){return e},get revision(){return t},clear(){e=[]},resetConnection(){return n=null,r()},bindRecoveryScope(e){let t=e??``,i=n!==null&&n!==t;return n=t,i?r():null},record(t){return e=[{ts:Date.now(),event:t.event,payload:t.payload},...e].slice(0,250),e}}}function cv(e){let t,n,r=e=>JSON.stringify(`shortId`in e?[`short`,e.agentId,e.shortId,e.slugHint]:[`scope`,e.agentId,e.sessionKey]);return{captureTarget(e){return t=e,e},synchronize(r,i){let a=r.client!==i.client||r.hello!==i.hello;if(r.client&&(a||r.selfUser?.id!==i.selfUser?.id||r.phase===`connected`&&i.phase!==`connected`)&&(tv(r.client),Va(r.client),Fi(r.client),ki(r.client),vi(r.client),!e(i)))return!1;if(!i.client||!i.hello||i.phase!==`connected`||!a&&r.phase===`connected`)return!0;let{client:o,hello:s}=i,c=t&&!(`shortId`in t)?t.sessionKey?bi({hello:s},t.sessionKey,t.agentId):{}:void 0;return n=t?$i(o,c,void 0,c?.agentId===void 0):void 0,!0},receive(e,i){if(i.client&&(e.event===`cron`||e.event===`config.changed`)&&Va(i.client),e.event!==`models.snapshot`)return e;let a=n;if(!a)return;let o=e.payload;if(!t||r(t)!==r(o.target))return;n=void 0;let s=o.scope.sessionKey?bi(i,o.scope.sessionKey,o.scope.agentId):o.scope,c=Yt(a,s,o.catalog);return a.cache.reads.delete(a),c?{...e,payload:{...o,scope:s}}:void 0}}}function lv(){return(lv=e((()=>{Qa(),ma(),Na(),ro(),na(),iv()})))()}function uv(e){let t=null,n={};return{clearOfflineIndicatorTimer:()=>{globalThis.clearTimeout(t??void 0),t=null},setUnavailableDeadline:(t,r)=>{globalThis.clearTimeout(n[t]),delete n[t],r!==void 0&&(n[t]=globalThis.setTimeout(()=>{delete n[t],e.applySnapshot({[t]:t!==`restartPending`&&void 0})},y(r*3,{minMs:15e3})))},scheduleOfflineIndicator:()=>{let n=e.getSnapshot();e.isStopped()||n.phase===`connected`||n.offlineStable||t!==null||(t=globalThis.setTimeout(()=>{t=null,!e.isStopped()&&e.getSnapshot().phase!==`connected`&&e.applySnapshot({offlineStable:!0})},dv))},hasSuspensionDeadline:()=>n.suspensionPhase!==void 0}}var dv;function fv(){return(fv=e((()=>{se(),dv=2e3})))()}function pv(e){let t=()=>{let t=ca();return t&&ji({deviceId:t,gatewayUrl:e.gatewayUrl(),role:`operator`})?{deviceId:t}:null};return{hasStoredDeviceToken:()=>t()!==null,forgetDeviceToken:()=>{let n=t();if(!n)return!1;let r=e.gatewayUrl();return Ua({deviceId:n.deviceId,gatewayUrl:r,role:Pp}),Rh(r,``),Tn(r),e.isStopped()||e.connect({token:``,bootstrapToken:``,password:``}),!0}}}function mv(){return(mv=e((()=>{Jp(),sn(),ta(),bg()})))()}function hv(e,t){return e?.id===t?.id&&e?.identity?.id===t?.identity?.id&&e?.email===t?.email&&e?.name===t?.name&&e?.avatarUrl===t?.avatarUrl}function gv(e){if(!e||typeof e!=`object`)return;let t=e.presence;return Array.isArray(t)?t:void 0}function _v(e,t){if(!t)return null;let n=e.find(e=>e.instanceId===t&&e.reason!==`disconnect`);return n?.user?.id?n.user:null}function vv({snapshotUser:e,presenceEntries:t,presenceInstanceId:n}){return e===void 0?_v(t??[],n):e}function yv(){return(yv=e((()=>{})))()}function bv(e){let t=null,n;return{load:()=>{let r=e.getSnapshot().client,i=e.getSnapshot().hello;if(!r||!i||e.getSnapshot().phase!==`connected`||!Vf(i.auth??null))return Promise.resolve(null);if(t)return t;let a=e.getSnapshot().selfUser,o=()=>e.getSnapshot().client===r&&e.getSnapshot().hello===i&&e.getSnapshot().phase===`connected`&&t===s,s=r.request(`users.self`,{}).then(({profile:t})=>{if(!o())return null;let s=e.getSnapshot().selfUser,c=s?.id===t.id?s:null,l=c&&s!==a?c:null,u=_v(gv(i.snapshot)??[],r.instanceId),d=c?.avatarUrl??(u?.id===t.id?u.avatarUrl:void 0),f=qa(e.getConnection().gatewayUrl,t.id,t.updatedAt,e.resourceBasePath)??void 0,p=d&&d!==n?d:f;n=f;let m={id:t.id,identity:{type:`profile`,id:t.id},name:l?l.name:t.displayName??void 0,email:t.emails[0],avatarUrl:p};return hv(e.getSnapshot().selfUser,m)||e.publish(m),o()?t:null}).catch(t=>{if(!o())return null;if(t instanceof Vp&&t.code===`FORBIDDEN`)return e.publish(null),null;throw t}).finally(()=>{t===s&&(t=null)});return t=s,s},applyPresence:r=>{let i=e.getSnapshot(),a=i.selfUser;if(i.phase!==`connected`)return;let o=_v(gv(r)??[],i.client?.instanceId);if(o){if(Lf(i.hello?.auth??null)&&(o.id!==a?.id||o.identity&&o.identity.id!==a.identity?.id))t=null,n=void 0,e.publish(o);else if(o.id===a?.id){let t={...a,name:o.name,avatarUrl:o.avatarUrl??a.avatarUrl};hv(a,t)||e.publish(t)}}},invalidate:()=>{t=null,e.getSnapshot().phase!==`connected`&&(n=void 0)}}}function xv(){return(xv=e((()=>{Jp(),di(),Hf()})))()}function Sv(e){return e.features?.methods===void 0&&!e.controlUiTabs?.length&&!e.controlUiWidgetKinds?.length&&!e.controlUiLinkReaders?.length&&!Object.keys(e.pluginSurfaceUrls??{}).length?null:{ok:!0,descriptors:[],methods:e.features?.methods??[],controlUiTabs:e.controlUiTabs??[],controlUiWidgetKinds:e.controlUiWidgetKinds??[],controlUiLinkReaders:e.controlUiLinkReaders??[],pluginSurfaceUrls:e.pluginSurfaceUrls??{}}}function Cv(e,t=``,n=``,r=wv,i={}){let a=e,o=i.persistDefaultConnectionSettings!==!1,s={gatewayUrl:a.gatewayUrl,token:a.token,bootstrapToken:n,...i.bootstrapProfile?{bootstrapProfile:i.bootstrapProfile}:{},password:t},c=0,l={client:null,phase:`stopped`,offlineStable:!1,hello:null,pluginCapabilities:null,canvasPluginSurfaceUrl:null,assistantAgentId:null,sessionKey:a.sessionKey,lastError:null,lastErrorCode:null,lastErrorAuthReason:null,selfUser:null},u=null,d=bv({getSnapshot:()=>l,getConnection:()=>s,publish:e=>O({selfUser:e}),resourceBasePath:i.resourceBasePath}),f=$_(()=>u,e=>O({canvasPluginSurfaceUrl:e})),p=!1,m=!0,g=e=>!m&&u===e,_=uv({isStopped:()=>m,getSnapshot:()=>l,applySnapshot:e=>O(e)}),{clearOfflineIndicatorTimer:v,setUnavailableDeadline:y,scheduleOfflineIndicator:b}=_,x=new Set,S=new Set,C=new Set,w=sv(),E=cv(e=>e===l),D=e=>{ov(C,e,`event`,e=>e===w.entries)},O=e=>{let t=l;l={...t,...e},l.phase!==`connecting`&&l.phase!==`reconnecting`&&(l.reconnectAt=void 0),(t.client!==l.client||t.hello!==l.hello||l.phase!==`connected`)&&d.invalidate(),l.phase===`connected`?(v(),l.offlineStable=!1):(l.suspensionPhase=_.hasSuspensionDeadline()?l.suspensionPhase:void 0,l.pluginCapabilities=null,l.usagePublications=void 0,b()),E.synchronize(t,l)&&ov(x,l,`snapshot`,e=>e===l)},k=()=>{let e=u,t=l.hello;d.load().catch(n=>{g(e)&&l.hello===t&&l.phase===`connected`&&O({lastError:on(n)})})},A=(e,t=!1)=>{if(!o&&!t){a={...a,...e};return}o=!0,a=Wh(e,{selectGateway:t})},ee=e=>{let t=u;if((e.event===`plugins.changed`||e.event===`plugins.controlUi.changed`)&&t){let n=l.hello,r=()=>g(t)&&l.hello===n&&l.phase===`connected`?l:null;z(async()=>{let{refreshPluginCapabilities:e}=await import(`./plugin-capabilities.runtime-D0SV9g_o.js`);return{refreshPluginCapabilities:e}},__vite__mapDeps([111,28]),import.meta.url).then(({refreshPluginCapabilities:n})=>n(e,t,r,O,e=>f.start(t,f.generation,e))).catch(e=>{r()&&O({lastError:on(e)})})}else if(e.event===`chat.metadata.changed`){let t=h(e.payload),n=t?.agentId,r=t?.usageUpdatedAt;typeof n==`string`&&typeof r==`number`&&r>(l.usagePublications?.[n]?.usageUpdatedAt??0)&&O({usagePublications:{...l.usagePublications,[n]:{usageUpdatedAt:r,committedAt:t?.usageRefreshFailed===!0?l.usagePublications?.[n]?.committedAt??0:r,usageRefreshFailed:t?.usageRefreshFailed===!0||void 0}}})}else if(e.event===`gateway.suspension`){let t=Sm(e.payload);t&&O({suspensionPhase:t})}else if(e.event===`shutdown`){let t=h(e.payload)?.restartExpectedMs;typeof t==`number`&&(y(`restartPending`,t),O({restartPending:!0}))}else e.event===`presence`?d.applyPresence(e.payload):e.event===`sessions.changed`&&h(e.payload)?.reason===`profile-identity`&&(d.invalidate(),k());if(!g(t)||C.size===0)return;let n=w.record(e);ov(C,n,`event`,e=>e===w.entries&&g(t))},j=(e={})=>{e.gatewayUrl??s.gatewayUrl,y(`suspensionPhase`),m=!1;let{sessionKey:t,...n}=e,d=n.gatewayUrl??s.gatewayUrl,_=ft(d)!==ft(s.gatewayUrl),v=Lh(s.gatewayUrl,d,s),b={...s,...n,..._&&n.token===void 0?{token:v.token}:{},..._&&n.password===void 0?{password:v.password}:{},..._&&n.bootstrapToken===void 0?{bootstrapToken:``,bootstrapProfile:void 0}:{},...n.bootstrapToken!==void 0&&n.bootstrapProfile===void 0?{bootstrapProfile:void 0}:{}},x=b.gatewayUrl!==s.gatewayUrl||b.token!==s.token||b.password!==s.password||b.bootstrapToken!==s.bootstrapToken||b.bootstrapProfile!==s.bootstrapProfile,C=x?w.resetConnection():null;x&&(c+=1,Yg());let N=n.gatewayUrl!==void 0&&n.gatewayUrl!==s.gatewayUrl,P=N?Fh(b.gatewayUrl):null,te=t!==void 0,ne=te?t.trim():P?.sessionKey??l.sessionKey;N&&(p=!1),s=b;let re=e=>{nn(b.gatewayUrl,l_({hello:e,settings:b,password:b.password}),i.resourceBasePath)};re(),A({gatewayUrl:b.gatewayUrl,token:b.token,...te?{sessionKey:ne,lastActiveSessionKey:ne}:P??{},...P?{selectedAgentId:P.selectedAgentId}:{}},o||N),f.stop(),u?.stop();let F=r({url:b.gatewayUrl,token:b.token.trim()?b.token:void 0,bootstrapToken:b.bootstrapToken.trim()?b.bootstrapToken:void 0,bootstrapProfile:b.bootstrapProfile,password:b.password.trim()?b.password:void 0,clientName:i.clientOptions?.clientName??`openclaw-control-ui`,clientVersion:wl.version??`dev`,clientBuildId:wl.buildId,platform:i.clientOptions?.platform,deviceFamily:i.clientOptions?.deviceFamily,mode:i.clientOptions?.mode??`webchat`,instanceId:i.clientOptions?.instanceId??ie(),scopes:i.clientOptions?.scopes,nativeConnectAuth:i.clientOptions?.nativeConnectAuth,get modelCatalog(){return u===F?E.captureTarget(i.getModelCatalogTarget?.(b.gatewayUrl)):void 0},onHello:e=>{if(u!==F)return;Rh(b.gatewayUrl,h(e.snapshot)?.authMode===`token`?b.token:``),y(`suspensionPhase`),s={...s,bootstrapToken:``,bootstrapProfile:void 0};let t=w.bindRecoveryScope(e.auth?.recoveryScope);if(t&&(D(t),!g(F)))return;let n=!!e.server?.buildId?.trim();if(__(b.gatewayUrl)&&(n||p)&&Cl({version:e.server?.version,buildId:e.server?.buildId,controlUiBuildSource:e.server?.controlUiBuildSource})){O({client:F,phase:`reconnecting`,hello:e,canvasPluginSurfaceUrl:null,selfUser:null,lastError:null,lastErrorCode:null,lastErrorAuthReason:null});let t=e.server?.buildId?.trim()||e.server?.version?.trim();t&&Pl({buildId:t,...g_(M,()=>g(F)&&__(b.gatewayUrl))});return}re(e),o&&(a=Bh());let r=_a({hello:e}),i=Tr(l.sessionKey,e),c=Tr(a.lastActiveSessionKey,e);(i!==a.sessionKey||c!==a.lastActiveSessionKey)&&A({sessionKey:i,lastActiveSessionKey:c}),p=!0;let d=e.pluginSurfaceUrls?.canvas?.trim()||null,m=f.begin(F,e.auth);y(`restartPending`),O({client:F,phase:`connected`,restartPending:!1,suspensionPhase:Sm(h(e.snapshot)?.suspension),hello:e,pluginCapabilities:Sv(e),canvasPluginSurfaceUrl:d,assistantAgentId:r?.defaultAgentId?.trim()||null,sessionKey:i,lastError:null,lastErrorCode:null,lastErrorAuthReason:null,selfUser:_v(gv(e.snapshot)??[],F.instanceId)}),g(F)&&!l.selfUser&&k(),f.start(F,m,d??void 0)},onRecoveryScopeChange:()=>{u===F&&l.phase===`connected`&&(Tn(b.gatewayUrl,F.recoveryScope),O({}))},onReconnectScheduled:e=>{u===F&&O({reconnectAt:Date.now()+e})},onClose:({code:e,reason:t,error:n,willRetry:r,busy:i})=>{if(u!==F)return;f.stop();let a=je(n?.details);a&&Pl({buildId:a,...g_(M,()=>g(F)&&__(b.gatewayUrl))});let o=a===null&&!p&&r&&fe(n);if(o&&l.phase===`starting`)return;let c=Op(n)??n?.code??null;c===Ue.AUTH_BOOTSTRAP_TOKEN_INVALID&&(s={...s,bootstrapToken:``,bootstrapProfile:void 0});let d=T(n);d&&y(`restartPending`,0);let m=ue(n)?Sm(n?.details)??`prepared`:void 0;y(`suspensionPhase`,m?0:void 0);let h=wn(t);O({client:F,phase:a===null?o?`starting`:p?r?`reconnecting`:`offline`:r?`connecting`:`stopped`:`reload-required`,hello:null,canvasPluginSurfaceUrl:null,selfUser:null,restartPending:d||l.restartPending===!0,suspensionPhase:m,lastError:o?null:n?.message?on(n.message):h?`disconnected (${e}): ${h}`:B(r?`connection.interruptedRetrying`:`connection.interrupted`,{code:String(e)}),lastErrorCode:o?null:i?`GATEWAY_BUSY`:c,lastErrorAuthReason:o?null:kn(n?.details)})},onGap:({expected:e,received:t})=>{g(F)&&(O({lastError:`event gap detected (expected seq ${e}, got ${t}); reconnecting`,lastErrorCode:null,lastErrorAuthReason:null}),g(F)&&j())},onEvent:av({isAttached:()=>u===F,isCurrent:()=>g(F),project:e=>E.receive(e,l),record:ee,listeners:S})});u=F,O({client:F,phase:p?`reconnecting`:`connecting`,reconnectAt:void 0,hello:null,canvasPluginSurfaceUrl:null,assistantAgentId:null,selfUser:null,sessionKey:ne,lastError:null,lastErrorCode:null,lastErrorAuthReason:null}),C&&D(C),g(F)&&F.start()},M={get snapshot(){return l},get connection(){return s},get connectionRevision(){return c},get eventLog(){return w.entries},get eventLogRevision(){return w.revision},connect:j,setSessionKey:e=>{let t=e.trim();t&&t!==l.sessionKey&&(A({sessionKey:t,lastActiveSessionKey:t}),O({sessionKey:t}))},start:()=>j(),stop:()=>{m=!0,v(),y(`restartPending`),y(`suspensionPhase`),f.stop(),u?.stop(),u=null,p=!1,O({client:null,phase:`stopped`,offlineStable:!1,restartPending:!1,hello:null,canvasPluginSurfaceUrl:null,assistantAgentId:null,selfUser:null,lastError:null,lastErrorCode:null,lastErrorAuthReason:null})},subscribe:e=>(x.add(e),()=>x.delete(e)),subscribeEventLog:e=>(C.add(e),()=>{C.delete(e),C.size===0&&w.clear()}),subscribeEvents:e=>(S.add(e),()=>S.delete(e)),loadSelfProfile:d.load,updateSelfUser:e=>{l.selfUser&&(d.invalidate(),O({selfUser:{...l.selfUser,...e}}))},...pv({gatewayUrl:()=>s.gatewayUrl,connect:j,isStopped:()=>m})};return M}var wv;function Tv(){return(Tv=e((()=>{nt(),Me(),rt(),Jp(),Tl(),V(),sn(),_n(),wa(),An(),$r(),na(),f(),Qg(),f_(),ev(),v_(),lv(),Tm(),fv(),mv(),xv(),bg(),Yl(),a(),wv=e=>new qp(e)})))()}function Ev(e){return e.phase===`connected`?(e.pluginCapabilities?.controlUiLinkReaders??Cf).filter(t=>e.pluginCapabilities?.methods?.includes(t.linkReader.detailMethod)===!0&&Fo(e,t.linkReader.detailMethod,`operator.read`,{requireAdvertisement:!1})):Cf}function Dv(e){return Ev(e).filter(t=>!!(t.linkReader.previewMethod&&e.pluginCapabilities?.methods?.includes(t.linkReader.previewMethod)))}function Ov(e,t={}){let n=n=>{if(t.shouldOpenExternally?.()||!Jr(n)||e().phase!==`connected`)return;let r=n.composedPath(),i=r.find(e=>e instanceof HTMLAnchorElement);if(!i||!r.some(e=>e instanceof Element&&e.localName===`openclaw-app-shell`)||i.hasAttribute(`download`)||i.hasAttribute(`data-file-path`)||i.hasAttribute(`data-link-reader-external`))return;let a=_f(i.href,Ev(e()));if(!a)return;let o=new CustomEvent(Pd,{cancelable:!0,detail:{url:a.href,open:!0,trigger:i,newTab:!r.some(e=>e instanceof Element&&e.localName===`openclaw-link-reader-panel`)}});window.dispatchEvent(o)||n.preventDefault()};return document.addEventListener(`click`,n),{dispose:()=>document.removeEventListener(`click`,n)}}function kv(){return(kv=e((()=>{Tf(),Id(),Lo()})))()}function Av(){return window.chrome?.webview}function jv(e){Av()?.postMessage(e)}function Mv(e){if(!e||typeof e!=`object`||!(`type`in e)||e.type!==`draft-text`)return null;let t=`payload`in e?e.payload:null,n=t&&typeof t==`object`&&`text`in t?t.text:null;return typeof n==`string`?n:null}function Nv(){let e=Av();if(!e)return{subscribe:()=>()=>{},dispose:()=>{}};let t=null,n=new Set,r=e=>{let r=Mv(e.data);if(r!==null){if(n.size===0){t=r;return}for(let e of n)e(r)}};return e.addEventListener(`message`,r),jv({type:`ready`}),{subscribe(e){if(n.add(e),t!==null){let n=t;t=null,e(n)}return()=>n.delete(e)},dispose(){n.clear(),t=null,e.removeEventListener(`message`,r)}}}function Pv(){let e=Kc()?.webkit?.messageHandlers?.openclawLink;return e?.postMessage.bind(e)}function Fv(){return Kc()?.webkit?.messageHandlers?.openclawUpdate}function Iv(){return Fv()!==void 0}function Lv(){let e=Fv();return e?(e.postMessage.bind(e)({type:`start-update`}),window.dispatchEvent(new CustomEvent(Kv)),!0):!1}function Rv(e){if(!e.isTrusted)return null;let t=Ci(e);if(!t||t.hasAttribute(`download`)||t.hasAttribute(`data-file-path`))return null;try{let e=new URL(t.href,window.location.href);return e.protocol===`mailto:`||e.protocol===`tel:`?{anchor:t,url:e}:null}catch{return null}}function zv(e,t){try{return e({type:`open-link`,url:t.href,target:`external`}),!0}catch{return!1}}function Bv(e){let t=Pv();if(!t)return!1;try{return zv(t,new URL(e))}catch{return!1}}function Vv(e){window.dispatchEvent(new CustomEvent(Dd,{detail:{open:!0,url:e.href,...Bd()?{native:!0}:{}}}))}function Hv(e){return!e.defaultPrevented&&!e.shiftKey&&!e.altKey&&(e.type===`click`&&e.button===0||e.type===`auxclick`&&e.button===1)}function Uv(e={}){if(e.signal?.aborted||typeof window>`u`||typeof document>`u`)return{dispose(){}};let t=Pv();if(!t&&!Bd()&&!e.shouldOpenInControlUiBrowser&&!e.onNativeUpdateDeclined)return{dispose(){}};let n=null,r,i=0,a=!1,o=!1,s=()=>{o=!0},c=()=>{o&&(o=!1,e.onNativeUpdateDeclined?.())},l=e=>{e&&n!==e||(i+=1,n?.remove(),n=null)},u=n=>{Bd()&&e.canPresentBrowserPanel?.()===!1?t&&zv(t,n):Vv(n)},d=async(o,s,c)=>{l();let d=i,f=o.composedPath(),{mountNativeLinkMenu:p}=await(r??=z(()=>import(`./native-link-menu.runtime-DeGj9_Ij.js`),__vite__mapDeps([112,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url));a||e.signal?.aborted||d!==i||!s.isConnected||(n=p({path:f,anchor:s,url:c,x:o.clientX,y:o.clientY,close:l,openExternal:()=>t&&zv(t,c),openInline:()=>u(c)}))},f=n=>{let r=no(n);if(r&&(r.anchor.hasAttribute(`data-link-reader-external`)||e.shouldOpenExternally?.())){t&&Jr(n)&&zv(t,r.url)&&(l(),n.preventDefault());return}if(r&&(Bd()?Jr(n):Hv(n))&&(Bd()||e.shouldOpenInControlUiBrowser?.())){u(r.url),l(),n.preventDefault();return}if(!t||!Jr(n))return;let i=Rv(n);i&&zv(t,i.url)&&(l(),n.preventDefault())},p=e=>{if(!t||e.defaultPrevented)return;let n=no(e);n&&(e.preventDefault(),e.stopPropagation(),d(e,n.anchor,n.url).catch(e=>{r=void 0,a||console.error(`[openclaw] native link menu failed to load; right-click to retry`,e)}))};window.addEventListener(`click`,f),window.addEventListener(`auxclick`,f),window.addEventListener(Kv,s),window.addEventListener(Wv,c),t&&document.addEventListener(`contextmenu`,p,!0);let m=()=>{a=!0,e.signal?.removeEventListener(`abort`,m),window.removeEventListener(`click`,f),window.removeEventListener(`auxclick`,f),window.removeEventListener(Kv,s),window.removeEventListener(Wv,c),document.removeEventListener(`contextmenu`,p,!0),l()};return e.signal?.addEventListener(`abort`,m,{once:!0}),{dispose:m}}var Wv,Gv,Kv;function qv(){return(qv=e((()=>{Id(),a(),Wv=`openclaw:native-update-declined`,Gv=`openclaw:native-update-availability-changed`,Kv=`openclaw:native-update-posted`})))()}function Jv(e,t){if(!Array.isArray(e))return;let n=e.filter(e=>{if(!w(e))return!1;let{startIndex:n,endIndex:r}=e;return Number.isSafeInteger(n)&&Number.isSafeInteger(r)&&typeof n==`number`&&typeof r==`number`&&n>=0&&r>n&&r<=t});return n.length>0?n:void 0}function Yv(e){if(!Array.isArray(e))return;let t=e.filter(e=>e===`allow-once`||e===`allow-always`||e===`deny`);return t.length>0?t:void 0}function Xv(e){if(!w(e))return null;switch(e.kind){case`standing-grant`:return typeof e.automation==`string`&&typeof e.command==`string`?{kind:`standing-grant`,automation:e.automation,command:e.command,...typeof e.expiresInDays==`number`?{expiresInDays:e.expiresInDays}:{}}:null;case`message-send`:return typeof e.target==`string`&&typeof e.recipientCount==`number`?{kind:`message-send`,target:e.target,recipientCount:e.recipientCount,...Array.isArray(e.recipients)&&e.recipients.every(e=>typeof e==`string`)?{recipients:e.recipients}:{},...e.audience===`internal`||e.audience===`external`?{audience:e.audience}:{}}:null;case`payment`:return typeof e.amount==`string`&&typeof e.currency==`string`&&typeof e.target==`string`?{kind:`payment`,amount:e.amount,currency:e.currency,target:e.target}:null;case`external-post`:return typeof e.target==`string`&&(e.visibility===`public`||e.visibility===`restricted`)?{kind:`external-post`,target:e.target,visibility:e.visibility}:null;default:return null}}function Zv(e,t){if(!w(t)||!w(t.request))return null;let n=R(t.id),r=t.request,i=typeof t.createdAtMs==`number`?t.createdAtMs:0,a=typeof t.expiresAtMs==`number`?t.expiresAtMs:0;if(!n||!i||!a)return null;let o={id:n,kind:e,createdAtMs:i,expiresAtMs:a},s={agentId:et(r.agentId)??null,sessionKey:et(r.sessionKey)??null};if(e===`exec`){let e=Re(r.command);return e?{...o,request:{...s,command:e,cwd:et(r.cwd)??null,host:et(r.host)??null,security:et(r.security)??null,ask:et(r.ask)??null,resolvedPath:et(r.resolvedPath)??null,runId:et(r.runId)??null,commandSpans:Jv(r.commandSpans,e.length),allowedDecisions:Yv(r.allowedDecisions),scope:Xv(r.scope)}}:null}let c=R(r.title);if(!c)return null;if(e===`plugin`)return{...o,request:{...s,command:c,allowedDecisions:Yv(r.allowedDecisions)},pluginTitle:c,pluginDescription:et(r.description)??null,pluginDetail:et(r.detail)??null,pluginSeverity:et(r.severity)??null,pluginId:et(r.pluginId)??null};let l=R(r.description),u=R(r.command),d=R(r.proposalHash);return!l||!u||!d?null:{...o,request:{...s,command:u,allowedDecisions:[`allow-once`,`deny`]},pluginTitle:c,pluginDescription:l,proposalHash:d}}function Qv(e,t){if(e!==`exec.approval.resolved`&&e!==`plugin.approval.resolved`&&e!==`openclaw.approval.resolved`||!w(t))return null;let n=R(t.id)??``;return n?{id:n,decision:typeof t.decision==`string`?t.decision:null,resolvedBy:typeof t.resolvedBy==`string`?t.resolvedBy:null,ts:typeof t.ts==`number`?t.ts:null}:null}function $v(e,t){return e===`exec.approval.requested`?Zv(`exec`,t):e===`plugin.approval.requested`?Zv(`plugin`,t):e===`openclaw.approval.requested`?Zv(`system-agent`,t):null}async function ey(e,t,n){if(t.kind===`system-agent`){await e.request(`approval.resolve`,{id:t.id,kind:`system-agent`,decision:n});return}let r=t.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await e.request(r,{id:t.id,decision:n})}function ty(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function ny(e,t){let n=ty(e).filter(e=>e.id!==t.id);return n.push(t),oy(n)}function ry(e,t){return ty(e).filter(e=>e.id!==t)}function iy(e){if(!(e instanceof Error))return!1;let t=w(e)?e:null,n=w(t?.details)?R(t.details.reason):void 0;return n===gy||n===_y||R(t?.gatewayCode)===_y||/unknown or expired approval id/i.test(e.message)}function ay(e,t,n){return e.status===`rejected`?ty(n).filter(e=>e.kind===t):Array.isArray(e.value)?e.value.flatMap(e=>{let n=Zv(t,e);return n?[n]:[]}):[]}function oy(e){return e.toSorted((e,t)=>e.createdAtMs-t.createdAtMs||e.id.localeCompare(t.id))}function sy(e,t,n,r){let i=new Set(t.map(e=>e.id)),a=ty(n),o=new Set(a.map(e=>e.id)),s=ty(e).filter(e=>!r.has(e.id)&&(!i.has(e.id)||o.has(e.id))),c=new Set(s.map(e=>e.id)),l=a.filter(e=>!i.has(e.id)&&!c.has(e.id));return oy([...s,...l])}function cy(e,t){let n=e.execApprovalExpiryTimers?.get(t);n!==void 0&&(globalThis.clearTimeout(n),e.execApprovalExpiryTimers?.delete(t))}function ly(e,t){cy(e,t.id);let n=globalThis.setTimeout(()=>{let r=e.execApprovalExpiryTimers?.get(t.id);if(r!==void 0&&r!==n)return;e.execApprovalExpiryTimers?.delete(t.id);let i=e.execApprovalQueue.some(e=>e.id===t.id);uy(e,t.id),i&&e.execApprovalChanged?.()},Math.max(0,t.expiresAtMs-Date.now()+500));e.execApprovalExpiryTimers?.set(t.id,n)}function uy(e,t){cy(e,t),e.execApprovalQueue=ry(e.execApprovalQueue,t),e.execApprovalErrors.delete(t)}function dy(e){let t=new Set(e.execApprovalQueue.map(e=>e.id));for(let n of e.execApprovalErrors.keys())t.has(n)||e.execApprovalErrors.delete(n)}function fy(e){for(let t of e.execApprovalExpiryTimers?.values()??[])globalThis.clearTimeout(t);e.execApprovalExpiryTimers?.clear()}function py(e,t){e.execApprovalQueue=ny(e.execApprovalQueue,t),ly(e,t)}async function my(e,t){let n=e.client;if(!n||t?.isCurrentClient&&!t.isCurrentClient(n))return!1;let r={removedIds:new Set},i=e.execApprovalRefreshes??=new Set;i.add(r);let a=ty(e.execApprovalQueue);try{let[i,o,s]=await Promise.allSettled([n.request(`exec.approval.list`,{}),n.request(`plugin.approval.list`,{}),n.request(`openclaw.approval.list`,{})]),c=sy([...ay(i,`exec`,e.execApprovalQueue),...ay(o,`plugin`,e.execApprovalQueue),...ay(s,`system-agent`,e.execApprovalQueue)],a,e.execApprovalQueue,r.removedIds);if(t?.isCurrentClient&&!t.isCurrentClient(n))return!1;e.execApprovalQueue=c,dy(e);let l=new Set(c.map(e=>e.id));for(let t of e.execApprovalExpiryTimers?.keys()??[])l.has(t)||cy(e,t);for(let t of c)ly(e,t);return!0}finally{i.delete(r),i.size===0&&(e.execApprovalRefreshes=void 0)}}function hy(e,t){uy(e,t);for(let n of e.execApprovalRefreshes??[])n.removedIds.add(t)}var gy,_y;function vy(){return(vy=e((()=>{gy=`APPROVAL_ALREADY_RESOLVED`,_y=`APPROVAL_NOT_FOUND`})))()}function yy(e){let t=Ff(e);return t.canAdmin||t.canPair}function by(e,t){let n=Ff(t);return{access:n,reviewChanged:e.canReviewApprovals!==n.canReviewApprovals,grantChanged:e.canGrantApprovals!==n.canGrantApprovals,grantRevoked:e.canGrantApprovals&&!n.canGrantApprovals,adminRevoked:e.canAdmin&&!n.canAdmin,pairingChanged:e.canPair!==n.canPair,pairingSetupRevoked:(e.canAdmin||e.canPair)&&!(n.canAdmin||n.canPair)}}function xy(e){let t=0;return{invalidate(n={}){t+=1,n.clear&&(e.state.pendingCount=0)},async refresh(){let n=e.gateway.snapshot.client;if(!n||e.gateway.snapshot.phase!==`connected`||e.isDisposed()||!e.state.devicePairSetupOpen||!yy(e.gateway.snapshot))return;let r=++t,i;try{i=await n.request(`device.pair.list`,{})}catch{return}!e.isDisposed()&&r===t&&e.gateway.snapshot.client===n&&e.gateway.snapshot.phase===`connected`&&e.state.devicePairSetupOpen&&yy(e.gateway.snapshot)&&(e.state.pendingCount=Array.isArray(i.pending)?i.pending.length:0,e.publish())}}}function Sy(e){return async(t,n=e.getConnectedEpoch(),r=e.getReviewGeneration())=>{e.canReview()&&r===e.getReviewGeneration()&&Ff(e.gateway.snapshot).canReviewApprovals&&await my(e.state,{isCurrentClient:i=>i===t&&n===e.getConnectedEpoch()&&r===e.getReviewGeneration()&&e.canReview()&&Ff(e.gateway.snapshot).canReviewApprovals&&e.isCurrentClient(t)})&&!e.isDisposed()&&e.publish()}}function Cy(){return(Cy=e((()=>{vy(),Hf()})))()}function wy(e){let t=null,n=0,r=()=>{n+=1,t!==null&&(globalThis.clearTimeout(t),t=null)},i=async()=>{t=null;let r=n;e.canPoll()&&await e.refresh(),r===n&&a()},a=()=>{if(!e.canPoll()){r();return}t===null&&(t=globalThis.setTimeout(()=>void i(),5e3))};return{stop:r,sync:a}}function Ty(e){return!!e.selfUser?.id?.trim()&&Fo(e,`update.report`,`operator.admin`,{requireAdvertisement:!1})}function Ey(e){let t=0,n=null;return{invalidate:()=>{t+=1,n=null},async report(r){let i=e.getClient();if(!i||n!==null||!e.isCurrent(r,i))return;let a=++t;n=a;let o=()=>n===a&&t===a&&e.isCurrent(r,i);e.setBusy(!0);try{let{reportUpdateFailure:t}=await z(async()=>{let{reportUpdateFailure:e}=await import(`./update-failure-report-c97igbFt.js`);return{reportUpdateFailure:e}},__vite__mapDeps([113,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,114,28,29,30,31,32]),import.meta.url),n=await t({attemptId:r,client:i,isCurrent:o});n&&o()&&e.setResult(r,n)}catch(t){o()&&e.setResult(r,{status:`error`,message:on(t)})}finally{n===a&&(n=null,e.setBusy(!1))}}}}function Dy(){return(Dy=e((()=>{wa(),Lo(),a()})))()}function Oy(e,t){return typeof e==`number`&&Number.isInteger(e)&&e>=t}function ky(e){let t=e?.snapshot;return w(t)?Ay(t.updateAvailable):null}function Ay(e){if(!w(e)||!St(e.currentVersion)||!St(e.latestVersion)||!St(e.channel))return null;let t=e.commits,n=Array.isArray(t)?t.filter(e=>w(e)&&St(e.sha)&&typeof e.subject==`string`).map(e=>({sha:e.sha,subject:e.subject})).slice(0,Ly):void 0;return{currentVersion:e.currentVersion,latestVersion:e.latestVersion,channel:e.channel,...St(e.currentSha)?{currentSha:e.currentSha}:{},...St(e.upstreamRef)?{upstreamRef:e.upstreamRef}:{},...St(e.upstreamSha)?{upstreamSha:e.upstreamSha}:{},...St(e.repositoryUrl)?{repositoryUrl:e.repositoryUrl}:{},...Oy(e.commitsBehind,0)?{commitsBehind:e.commitsBehind}:{},...n?.length?{commits:n}:{}}}function jy(e){return w(e)?e.kind===`package`?St(e.version)?{kind:`package`,version:e.version}:null:e.kind===`git`&&St(e.upstreamRef)&&St(e.upstreamSha)&&Oy(e.commitsBehind,0)?{kind:`git`,upstreamRef:e.upstreamRef,upstreamSha:e.upstreamSha,commitsBehind:e.commitsBehind}:null:null}function My(e){return{...St(e.currentSha)?{currentSha:e.currentSha}:{},...St(e.upstreamSha)?{upstreamSha:e.upstreamSha}:{},...St(e.repositoryUrl)?{repositoryUrl:e.repositoryUrl}:{},...Oy(e.commitAtMs,0)?{commitAtMs:e.commitAtMs}:{},...Oy(e.installedAtMs,0)?{installedAtMs:e.installedAtMs}:{}}}function Ny(e){if(!w(e))return null;let t=My(e);return e.status===`current`?{...t,status:`current`}:e.status===`behind`&&Oy(e.commitsBehind,1)?{...t,status:`behind`,commitsBehind:e.commitsBehind}:e.status===`ahead`&&Oy(e.commitsAhead,1)?{...t,status:`ahead`,commitsAhead:e.commitsAhead}:e.status===`diverged`&&Oy(e.commitsAhead,1)&&Oy(e.commitsBehind,1)?{...t,status:`diverged`,commitsAhead:e.commitsAhead,commitsBehind:e.commitsBehind}:e.status===`unavailable`&&(e.reason===`fetch-failed`||e.reason===`no-upstream`||e.reason===`no-upstream-sha`||e.reason===`comparison-failed`||e.reason===`git-unavailable`)?{...t,status:`unavailable`,reason:e.reason}:null}function Py(e){return!w(e)||!St(e.id)||e.state!==`waiting-for-idle`&&e.state!==`countdown`&&e.state!==`applying`||!Oy(e.announcedAtMs,0)||!Oy(e.forceAtMs,0)||!Oy(e.updatedAtMs,0)?null:{id:e.id,state:e.state,announcedAtMs:e.announcedAtMs,...Oy(e.applyAtMs,0)?{applyAtMs:e.applyAtMs}:{},...Oy(e.holdUntilMs,0)?{holdUntilMs:e.holdUntilMs}:{},forceAtMs:e.forceAtMs,updatedAtMs:e.updatedAtMs}}function Fy(e){if(!w(e)||!St(e.channel)||typeof e.autoEnabled!=`boolean`)return null;let t=w(e.install)?e.install:null,n=t?.kind,r=n===`package`||n===`git`||n===`unknown`?n:void 0;if(e.install!==void 0&&r===void 0)return null;let i=t?.git===void 0?void 0:Ny(t.git);if(t?.git!==void 0&&!i)return null;let a=e.target===void 0?void 0:jy(e.target),o=e.campaign===void 0?void 0:Py(e.campaign);return e.target!==void 0&&!a||e.campaign!==void 0&&!o?null:{channel:e.channel,autoEnabled:e.autoEnabled,...r?{install:{kind:r,...i?{git:i}:{}}}:{},...a?{target:a}:{},...o?{campaign:o}:{}}}function Iy(e){let t=e?.snapshot;return w(t)?Fy(t.updateSchedule):null}var Ly;function Ry(){return(Ry=e((()=>{Ly=5})))()}function zy(e){let t=e?.stats?.runId?.trim()||e?.stats?.handoffId?.trim();return t&&t.length<=256?t:null}function By(e){if(e?.kind!==`update`||!e.status)return null;let t=e.stats,n=mt({status:e.status,reason:t?.reason??void 0}),r=n!==`succeeded`&&n!==`pending`,i=r?Hy(e):null,a=r&&typeof e.ts==`number`?{timestampMs:e.ts,status:e.status,reason:t?.reason?.trim()||`unexpected-error`,installKind:t?.mode?.trim()||null,beforeVersion:t?.before?.version?.trim()||null,beforeSha:t?.before?.sha?.trim()||null,afterVersion:t?.after?.version?.trim()||null,afterSha:t?.after?.sha?.trim()||null,failure:i}:null,o=r?Jy({status:e.status,reason:t?.reason??void 0,cause:i}):null;o&&n===`failed`&&(o.text+=` ${B(`updates.triage.hostHint`)}`);let s={id:zy(e)??(typeof e.ts==`number`?`recorded:${e.ts}`:null),timestampMs:e.ts??null};return{attempt:a,banner:o,failure:n===`failed`&&s.id&&o?{id:s.id,outcome:n,attempt:a,banner:o,reconciledRecord:s}:null}}function Vy(e){let t=wn(e).split(`
`).map(e=>e.trim()).filter(Boolean).at(-1);return t?t.slice(0,Zy):null}function Hy(e){let t=e?.stats?.steps,n=Array.isArray(t)?t.findLast(e=>typeof e?.log?.exitCode==`number`&&e.log.exitCode!==0):void 0,r=Vy(n?.log?.stderrTail)??Vy(n?.log?.stdoutTail),i=n?.name?.trim();return i&&r?{step:i,detail:r}:null}function Uy(e){let t=0,n=0,r=0,i=0,a=async(o=`manual`)=>{let s=e.getClient(),c=e.getEpoch();if(!s||!e.canRefresh()||!e.isCurrent(s,c))return!1;let l=o===`manual`,u=l?++n:++t,d=e.getRevision(),f=r,p=i,m=()=>u===(l?n:t)&&e.isCurrent(s,c),h=()=>m()&&e.canRefresh()&&d===e.getRevision();l&&e.onRefreshing(!0);try{let t=s.request(`update.status`,l?{refreshCheckout:!0}:{},l?void 0:{timeoutMs:5e3}).catch(t=>(o!==`background`&&h()&&e.onError(t,o),null)),n=l?a(`background`):null,c=await t;if(c&&h()){if(l){r++;let t=p!==i,{activeRun:o,lastRun:s,sentinel:l}=c;(!t||o||s)&&e.onStatus({activeRun:o,lastRun:s,...t?{}:{sentinel:l}}),e.onCheckout(c,t),n?.then(()=>{h()&&a(`background`)})}else i++,e.onError(null,`completion`),e.onStatus(c,f!==r);return!0}return!1}finally{l&&m()&&e.onRefreshing(!1)}};return a}function Wy(e,t,n=!1){let r=By(e.sentinel);return{failure:r?.failure??null,updateStatusBanner:r?r.banner:t.updateStatusBanner,recordedUpdateAttempt:r?r.attempt:t.recordedUpdateAttempt,...Gy(e,t,n?`install`:void 0)}}function Gy(e,t,n){let r=Object.hasOwn(e,`schedule`)?Fy(e.schedule):void 0,i=n===`schedule`?t.updateSchedule:r,a=n===`schedule`?r:t.updateSchedule;return n&&i&&a?.channel===i.channel&&a.install&&(i={...i,install:a.install}),{...n!==`schedule`&&Object.hasOwn(e,`updateAvailable`)?{updateAvailable:Ay(e.updateAvailable)}:{},...i===void 0?{}:{updateSchedule:i,heldUpdateCampaignId:i?.campaign?.holdUntilMs===void 0?t.heldUpdateCampaignId:i.campaign.id}}}function Ky(e){if(Ge(e)||e.status!==`failed`&&e.status!==`rolled-back`)return null;let t=e.steps.findLast(e=>e.status===`failed`);return{id:e.runId,reconciledRecord:{id:e.runId,timestampMs:e.finishedAtMs??e.updatedAtMs},outcome:`failed`,banner:{tone:e.reason===`legacy-driver-expired`?`warn`:`danger`,text:it(e).markdown},attempt:{timestampMs:e.finishedAtMs??e.updatedAtMs,status:e.status,reason:e.reason??`unexpected-error`,installKind:e.target.kind??null,beforeVersion:e.before.version??null,beforeSha:e.before.sha??null,afterVersion:e.after.version??null,afterSha:e.after.sha??null,failure:t?{step:t.step,detail:t.detail??``}:null}}}function qy(e){return{tone:`warn`,text:B(`updates.checkError`,{error:on(e)})}}function Jy(e){let t=(e.status??`error`).trim()||`error`,n=(e.reason??`unexpected-error`).trim()||`unexpected-error`,r=B(Xy[n]??`updates.failureReasons.default`),i=e.cause;return{tone:t===`skipped`?`warn`:`danger`,text:i?`${B(`updates.failedAtStep`,{step:i.step,cause:i.detail})} ${r}`:B(`updates.status`,{status:t,reason:n,guidance:r})}}function Yy(){return{tone:`danger`,text:B(`updates.outcomeUnknown`)}}var Xy,Zy;function Qy(){return(Qy=e((()=>{Ae(),tt(),Ye(),Ce(),V(),wa(),Ry(),Xy={dirty:`updates.failureReasons.dirty`,"no-upstream":`updates.failureReasons.noUpstream`,"not-git-install":`updates.failureReasons.notGitInstall`,"not-openclaw-root":`updates.failureReasons.notOpenclawRoot`,"deps-install-failed":`updates.failureReasons.depsInstallFailed`,"build-failed":`updates.failureReasons.buildFailed`,"build-dirty":`updates.failureReasons.buildDirty`,"ui-build-failed":`updates.failureReasons.uiBuildFailed`,"global-install-failed":`updates.failureReasons.globalInstallFailed`,"restart-disabled":`updates.failureReasons.restartDisabled`,"restart-unavailable":`updates.failureReasons.restartUnavailable`,"external-supervisor-update-required":`updates.failureReasons.externalSupervisorUpdateRequired`,"restart-unhealthy":`updates.failureReasons.restartUnhealthy`,"restart-revision-mismatch":`updates.failureReasons.restartRevisionMismatch`,"restart-revision-unavailable":`updates.failureReasons.restartRevisionUnavailable`,"already-current":`updates.failureReasons.alreadyCurrent`,"managed-service-handoff-already-running":`updates.failureReasons.managedServiceHandoffAlreadyRunning`,"managed-service-handoff-unavailable":`updates.failureReasons.managedServiceHandoffUnavailable`,"doctor-failed":`updates.failureReasons.doctorFailed`,"managed-service-handoff-failed":`updates.failureReasons.managedServiceHandoffFailed`,"managed-service-handoff-spawn-failed":`updates.failureReasons.managedServiceHandoffSpawnFailed`,"managed-service-handoff-helper-failed":`updates.failureReasons.managedServiceHandoffFailed`,"managed-service-handoff-parent-timeout":`updates.failureReasons.managedServiceHandoffParentTimeout`},Zy=180})))()}function $y(){let e=$n(),t=()=>{try{let t=e?.getItem(eb);if(t==null)return[];let n=t.length<32768?JSON.parse(t):null;return Array.isArray(n)&&n.every(e=>typeof e==`string`)?n.slice(-32):null}catch{return null}},n=(e,t,n)=>JSON.stringify([e,t,n]);return{acknowledged:(e,r,i)=>(t()??[]).includes(n(e,r,i)),acknowledge:(r,i,a)=>{try{let o=t();if(!e||!o)return!1;let s=[...new Set([...o,n(r,i,a)])].slice(-32);return e.setItem(eb,JSON.stringify(s)),!0}catch{return!1}}}}var eb;function tb(){return(tb=e((()=>{eb=`openclaw:control-ui:update-acknowledged:v1`})))()}function nb(e,t,n){let r=e?.campaign,i=t?.campaign;return!i||n&&r?.id===i.id&&r.updatedAtMs===i.updatedAtMs}function rb(e,t){return e?.campaign?.holdUntilMs===void 0?t:e.campaign.id}function ib(e,t){let n=Iy(t);return{updateAvailable:ky(t),updateSchedule:n,heldUpdateCampaignId:rb(n,e.heldUpdateCampaignId),updateCampaignStatusHydrated:nb(e.updateSchedule,n,e.updateCampaignStatusHydrated)}}function ab(e,t){let n=t&&Object.hasOwn(t,`schedule`)?Fy(t.schedule):void 0;return{updateAvailable:Ay(t?.updateAvailable),...n===void 0?{}:{updateSchedule:n,heldUpdateCampaignId:rb(n,e.heldUpdateCampaignId),updateCampaignStatusHydrated:nb(e.updateSchedule,n,e.updateCampaignStatusHydrated)}}}function ob(e,t=Date.now()){let n=e?.campaign;return n?n.state===`applying`?B(`updates.campaign.applying`):n.holdUntilMs!==void 0&&n.holdUntilMs>t?B(`updates.campaign.held`,{time:Nn(n.holdUntilMs,t)}):n.state===`waiting-for-idle`?B(`updates.campaign.waitingForIdle`,{time:Nn(n.forceAtMs,t)}):B(`updates.campaign.countdown`,{time:Nn(n.applyAtMs??n.forceAtMs,t)}):null}function sb(e,t){let n=e?.target;if(n?.kind===`package`||e?.install?.kind===`package`)return null;let r=e?.install?.git;if(e?.campaign&&n?.kind===`git`){let e=t?.upstreamSha===n.upstreamSha&&(!r?.currentSha||r.currentSha===t.currentSha)?t.currentSha:void 0;return{upstreamSha:n.upstreamSha,...e?{currentSha:e,repositoryUrl:t?.repositoryUrl,commitsBehind:t?.commitsBehind}:{}}}return r&&r.status!==`unavailable`?{currentSha:r.currentSha,upstreamSha:r.upstreamSha,repositoryUrl:r.repositoryUrl,commitsBehind:`commitsBehind`in r&&r.commitsBehind}:t?.upstreamSha||t?.commitsBehind!==void 0?t:n?.kind===`git`?{upstreamSha:n.upstreamSha,commitsBehind:n.commitsBehind}:null}function cb(e,t){let n=e?.target,r=sb(e,t);if(r){let e=r.commitsBehind;return typeof e==`number`?B(e===1?`updates.target.commitBehind`:`updates.target.commitsBehind`,{count:String(e)}):null}let i=n?.kind===`package`?n.version:t?.latestVersion;return i?B(`updates.target.version`,{version:i}):null}function lb(e,t){let n=sb(e,t);if(!n?.upstreamSha||n.commitsBehind===!1)return null;let{currentSha:r,upstreamSha:i,repositoryUrl:a}=n;return{currentSha:r,targetSha:i,compareUrl:a&&/^https:\/\/github\.com\/[\w.-]+\/[\w.-]+$/u.test(a)&&r&&/^[a-f\d]{7,40}$/iu.test(r)&&/^[a-f\d]{7,40}$/iu.test(i)?`${a}/compare/${r}...${i}`:void 0}}function ub(e,t,n){let r=sb(t,e)?.commitsBehind;return!!(n||t?.campaign||r!==!1&&(e?.latestVersion!==e?.currentVersion||r))}function db(){return(db=e((()=>{V(),Un(),Ry()})))()}function fb(e,t,n={}){let r={updateAvailable:null,updateSchedule:null,heldUpdateCampaignId:null,updateRunning:!1,updateStatusRefreshing:!1,updateCampaignStatusHydrated:!0,updateReconciliationPending:!1,updateStatusBanner:null,updateStatusCheckBanner:null,recordedUpdateAttempt:null,diagnosableUpdateFailureId:null,reportableUpdateFailureId:null,updateFailureReportBusy:!1,updateFailureReportNotice:null,updateRun:null,updateRunAcknowledged:!1,controlUiRefreshRequired:!1},i=!1,a=e.snapshot.client,o=e.snapshot.hello,s=null,c=0,l=Ff(e.snapshot),u=ft(e.connection.gatewayUrl),d=e.snapshot.selfUser?.id??null,f=$y(),p=!1,m=0,h=0,g=0,_=!1,v=null,y={kind:`unknown`},b=null,x=null,S=0,C=Ey({getClient:()=>e.snapshot.client,isCurrent:(t,n)=>D(n)&&!r.updateRunning&&!r.updateReconciliationPending&&r.reportableUpdateFailureId===t&&Ty(e.snapshot),setBusy:e=>{r={...r,updateFailureReportBusy:e},k()},setResult:(e,t)=>{r={...r,updateFailureReportNotice:{attemptId:e,result:t}}}});function T(){C.invalidate(),r={...r,updateFailureReportBusy:!1,updateFailureReportNotice:null}}function E(e){JSON.stringify(x)!==JSON.stringify(e)&&(x=e,T())}let D=t=>!i&&a===t&&e.snapshot.client===t&&e.snapshot.phase===`connected`&&Ff(e.snapshot).canAdmin;function O(t){let i=x,o=u,s=d,l=a,f=c;if(!i||i.id!==t||!l||!D(l)||r.updateRunning||r.updateFailureReportBusy||r.updateReconciliationPending)return;let p=++S,m=()=>p===S&&f===c&&D(l)&&x===i&&ft(e.connection.gatewayUrl)===o&&(e.snapshot.selfUser?.id??null)===s&&!r.updateRunning&&!r.updateReconciliationPending,h=!1;n.onUpdateFailure?.(i,{isCurrent:m,admit:()=>h||!m()?!1:(h=!0,!0)})}function k(){let e=r.updateSchedule?.campaign,n=e?.state===`applying`&&r.updateRun?.origin.campaignId!==e.id;r={...r,updateRunning:p||r.updateRun?.status===`running`||n,updateReconciliationPending:v!==null&&(!r.updateRun||r.updateRun.status===`running`)},n&&E(null),r={...r,diagnosableUpdateFailureId:x&&r.updateRun?.target.installationMethod!==`ocm`&&a&&D(a)&&!r.updateRunning&&!r.updateReconciliationPending?x.id:null,reportableUpdateFailureId:r.updateRunning||r.updateReconciliationPending||r.updateRun?.target.installationMethod===`ocm`?null:r.updateRun?!Ge(r.updateRun)&&Oe(r.updateRun)?r.updateRun.runId:null:x?.outcome===`failed`&&x.attempt?x.id:null},t()}let A=(e,t)=>{r={...r,updateStatusBanner:{...t?{source:t}:{},tone:`danger`,text:B(`updates.error`,{error:on(e)})}},k()},ee=e=>{let t=r.updateRun;if(t?.runId===e.runId&&t.updatedAtMs>e.updatedAtMs){k();return}(t?.runId!==e.runId||t.updatedAtMs!==e.updatedAtMs)&&T(),v=e.runId,b=null;let n=Ky(e);E(n),r={...r,updateRun:e,updateRunAcknowledged:Ge(e)||f.acknowledged(u,d,e.runId),recordedUpdateAttempt:n?.attempt??null,updateStatusBanner:n?.banner??null},k(),P.sync()},j=async()=>{let e=a,t=v;if(!e||!t||!D(e))return;let n=++g,i=c,o=()=>n===g&&i===c&&t===v&&D(e);try{let n=await e.request(`update.runs.get`,{runId:t});if(!o())return;n.run?(ee(n.run),n.run.status!==`running`&&M(`completion`)):(v=null,E(null),r={...r,updateRun:null,updateStatusBanner:Yy()},k())}catch(e){o()&&A(e,`read`)}},M=Uy({getClient:()=>a,getEpoch:()=>c,getRevision:()=>m,canRefresh:()=>!i&&l.canAdmin,isCurrent:(e,t)=>t===c&&D(e),onRefreshing:e=>{r={...r,updateStatusRefreshing:e},k()},onStatus:(e,t=!1)=>{let{failure:n,updateStatusBanner:i,recordedUpdateAttempt:a,...o}=Wy(e,r,t),s=e.activeRun??e.lastRun,c=b?.history,l=c!==void 0&&(!s||c.kind===`known`&&s.runId===c.runId||c.kind===`unknown`&&s.status!==`running`&&s.runId!==v);y={kind:`known`,runId:s?.runId??null},r={...r,...o,updateCampaignStatusHydrated:!0},s&&!l&&(!r.updateRun||s.runId===r.updateRun.runId||s.createdAtMs>=r.updateRun.createdAtMs)?ee(s):(!r.updateRun&&!l&&(E(n),r={...r,updateStatusBanner:i,recordedUpdateAttempt:a}),k()),P.sync()},onCheckout:(e,t)=>{r={...r,...Gy(e,r,t?`schedule`:void 0),updateStatusCheckBanner:null},k(),P.sync()},onError:(e,t)=>{(t!==`completion`||r.updateStatusCheckBanner?.mode!==`manual`)&&(e!==null||r.updateStatusCheckBanner!==null)&&(r={...r,updateStatusCheckBanner:e===null?null:{...qy(e),mode:t}},k())}}),N=()=>v?.startsWith(`ocm:`)&&r.updateReconciliationPending,P=wy({canPoll:()=>!!(a&&D(a)&&(r.updateSchedule?.campaign||N())),refresh:async()=>{N()?await j():await M(`background`)}}),te=(e,t)=>n.connectionBootstrap?.run(e,t)??t();return{get snapshot(){return r},synchronizeGateway:t=>{let n=ft(e.connection.gatewayUrl),i=t.selfUser?.id??null,f=Ff(t),_=!l.canAdmin&&f.canAdmin,x=t.phase===`connected`,S=n!==u||x&&i!==d||!!t.hello?.auth&&!f.canAdmin;S&&(C.invalidate(),h++,g++,m++,v=null,y={kind:`unknown`},b=null,p=!1,E(null),r={...r,updateRun:null,updateRunAcknowledged:!1,updateStatusRefreshing:!1,updateStatusBanner:null,updateStatusCheckBanner:null,recordedUpdateAttempt:null,heldUpdateCampaignId:null}),u=n,x&&(d=i);let w=x?t.client:null,T=s!==w,D=o!==t.hello;if(l=f,a=t.client,o=t.hello,s=w,T&&(C.invalidate(),r={...r,updateFailureReportBusy:!1},b?.requestSent&&!v&&!r.updateRun&&!r.updateStatusBanner&&(r={...r,updateStatusBanner:Yy()}),c++,g++,m++,h++,p=!1),!x||!t.client){r={...r,updateAvailable:null,updateSchedule:null,updateStatusRefreshing:!1,updateCampaignStatusHydrated:!0},P.stop(),t.phase===`reload-required`?r={...r,controlUiRefreshRequired:!0}:t.client?t.hello&&(r={...r,controlUiRefreshRequired:!0}):(c=0,r={...r,controlUiRefreshRequired:!1}),k();return}let O={version:t.hello?.server?.version,buildId:t.hello?.server?.buildId,controlUiBuildSource:t.hello?.server?.controlUiBuildSource};r={...r,...T||D?ib(r,t.hello):{},controlUiRefreshRequired:T?!Hs(e.connection.gatewayUrl)&&(!!O.buildId?.trim()||c>1)&&Cl(O):r.controlUiRefreshRequired},k(),P.sync(),(T||S||_)&&l.canAdmin&&te(`update-run`,()=>v?j():M(`background`))},handleUpdateRunChanged(e){let t=b?.history;if(!w(e)||typeof e.runId!=`string`||t?.kind===`known`&&e.runId===t.runId||!v&&t?.kind===`unknown`&&e.status!==`running`||typeof e.updatedAtMs!=`number`||!a||!D(a))return;let n=r.updateRun;n?.runId===e.runId&&e.updatedAtMs<=n.updatedAtMs||(E(null),C.invalidate(),r={...r,updateFailureReportBusy:!1},k(),m++,v&&v!==e.runId?M(`completion`):(v=e.runId,j()))},handleUpdateAvailable(e){if(i)return;let t=r.updateSchedule?.campaign;m++,r={...r,...ab(r,e)},k(),P.sync(),t?.state===`applying`&&r.updateSchedule?.campaign?.state!==`applying`&&M(`completion`)},refreshUpdateStatus:M,diagnoseUpdateFailure:O,acknowledgeUpdateRun(){let e=r.updateRun;e&&e.status!==`running`&&(f.acknowledge(u,d,e.runId),r={...r,updateRunAcknowledged:!0},k())},async runUpdate(e){let t=a;if(!t||!D(t)||r.updateRunning||r.updateReconciliationPending)return;let i=++h,o=e?.sessionKey??n.getActiveSessionKey?.();m++,g++;let s={history:r.updateRun?{kind:`known`,runId:r.updateRun.runId}:y,requestSent:!1};b=s,v=null,p=!0,E(null),r={...r,updateRun:null,updateRunAcknowledged:!1,updateStatusBanner:null,updateStatusCheckBanner:null,recordedUpdateAttempt:null},k();let c=()=>i===h&&D(t);try{if(await n.drainConfigWrites?.(),!c()||r.updateSchedule?.campaign?.state===`applying`)return;let e=await t.request(`update.run`,o?{sessionKey:o}:{},{onSent:()=>{s.requestSent=!0}});if(!c())return;if(e.runId)v=e.runId,await j();else{let t=By(e.sentinel?.payload);E(t?.failure??null),r={...r,recordedUpdateAttempt:t?.attempt??null,updateStatusBanner:t?.banner??Jy({status:e.result?.status??`error`,reason:e.result?.reason})}}}catch(e){c()&&(A(e),s.requestSent&&!(e instanceof Vp)&&await M(`completion`))}finally{c()&&(p=!1,k(),P.sync())}},async holdUpdate(){let t=e.snapshot.client,n=r.updateSchedule?.campaign,a=_||r.updateRunning||r.updateReconciliationPending;if(!t||e.snapshot.phase!==`connected`||i||a||!n||n.state===`applying`||r.heldUpdateCampaignId===n.id||!Ff(e.snapshot).canAdmin)return!1;let o=h,s=m,c=()=>o===h&&D(t);_=!0;try{let e=await t.request(`update.hold`,{});if(!c())return!1;let i=e.schedule&&Fy(e.schedule);return s===m&&(i!==void 0||e.ok)&&(m+=1,r={...r,...i===void 0?{}:{updateSchedule:i},heldUpdateCampaignId:e.ok?n.id:rb(i??r.updateSchedule,r.heldUpdateCampaignId)},k()),e.ok}catch(e){return c()&&s===m&&A(e),!1}finally{_=!1}},async reportUpdateFailure(e){await C.report(e)},dispose(){i=!0,C.invalidate(),h++,g++,P.stop()}}}function pb(){return(pb=e((()=>{tt(),Ce(),Jp(),Tl(),V(),wa(),Hf(),Dy(),Qy(),tb(),Ry(),db()})))()}function mb(e,t={}){let n=fb(e,g,t),r=(e,n)=>t.connectionBootstrap?.run(e,n)??n(),i={...n.snapshot,approvalQueue:[],approvalBusy:!1,approvalCanGrant:!1,approvalErrors:new Map,devicePairSetupOpen:!1,devicePairSetupLifecycle:{phase:`selection`,access:`full`},devicePairPendingCount:0},a=new Set,o=!1,s=e.snapshot.client,c=null,l=0,u=Ff(e.snapshot),d=0,f=0,p=null,m=ir({client:e.snapshot.client,connected:e.snapshot.phase===`connected`,onChange:()=>g()}),h={client:s,execApprovalQueue:[],execApprovalBusy:!1,execApprovalErrors:new Map,execApprovalExpiryTimers:new Map};function g(){i={...i,...n.snapshot,approvalQueue:h.execApprovalQueue,approvalBusy:h.execApprovalBusy,approvalCanGrant:Ff(e.snapshot).canGrantApprovals,approvalErrors:new Map(h.execApprovalErrors),...Cr(m)};for(let e of a)e(i)}h.execApprovalChanged=g;let _=xy({gateway:e,state:m,isDisposed:()=>o,publish:g}),v=async e=>{g(),await e,o||(Et(m,g),g())},y=t=>!o&&s===t&&e.snapshot.client===t&&e.snapshot.phase===`connected`,b=Sy({gateway:e,state:h,getConnectedEpoch:()=>l,getReviewGeneration:()=>d,canReview:()=>u.canReviewApprovals,isCurrentClient:y,isDisposed:()=>o,publish:g}),x=e=>{let t=s,i=e.phase===`connected`,a=i?e.client:null,o=c!==a,g=by(u,e);if(u=g.access,g.reviewChanged&&(d+=1),g.grantChanged&&(f+=1),g.grantRevoked){let e=p;e&&h.execApprovalQueue.some(t=>t.id===e.id)&&h.execApprovalErrors.set(e.id,B(`execApproval.reviewOnly`)),p=null,h.execApprovalBusy=!1}if((g.adminRevoked||g.pairingSetupRevoked)&&(lr(m),_.invalidate({clear:!0})),g.pairingChanged&&_.invalidate({clear:!(u.canAdmin||u.canPair)}),s=e.client,c=a,h.client=e.client,m.client=e.client,m.connected=i,(t!==e.client||!i)&&(p=null,_.invalidate({clear:!0}),lr(m)),i&&!u.canReviewApprovals&&(p=null),(!i||!e.client||!u.canReviewApprovals)&&(h.execApprovalQueue=[],h.execApprovalBusy=!1,h.execApprovalErrors.clear(),fy(h)),!i||!e.client){e.phase!==`reload-required`&&!e.client&&(l=0),n.synchronizeGateway(e);return}let v=e.client;n.synchronizeGateway(e),g.pairingChanged&&m.devicePairSetupOpen&&(u.canAdmin||u.canPair)&&r(`pairing-pending-count`,()=>_.refresh()).catch(()=>void 0),o&&(l+=1),(o||g.reviewChanged)&&u.canReviewApprovals&&r(`approvals`,()=>b(v,l,d)).catch(()=>void 0)},S=e.subscribe(x),C=e.subscribeEvents(t=>{if(o)return;if(t.event===`device.pair.setup.completed`){let e=Sa(t.payload);e&&cn(m,e);return}if(t.event===`device.pair.setup.deliveryUncertain`){let e=vn(t.payload);e&&rn(m,e);return}if(t.event===`device.pair.requested`||t.event===`device.pair.resolved`){_.refresh();return}if(t.event===`update.available`){n.handleUpdateAvailable(t.payload);return}if(t.event===`update.run.changed`){n.handleUpdateRunChanged(t.payload);return}if(!u.canReviewApprovals||!Ff(e.snapshot).canReviewApprovals)return;let r=$v(t.event,t.payload);if(r){py(h,r),g();return}let i=Qv(t.event,t.payload);i&&(hy(h,i.id),g())});return x(e.snapshot),{get snapshot(){return i},subscribe(e){return a.add(e),()=>a.delete(e)},refreshUpdateStatus:n.refreshUpdateStatus,acknowledgeUpdateRun:n.acknowledgeUpdateRun,runUpdate:n.runUpdate,holdUpdate:n.holdUpdate,diagnoseUpdateFailure:n.diagnoseUpdateFailure,reportUpdateFailure:n.reportUpdateFailure,async decideApproval(t,n,r){let i=n?h.execApprovalQueue.find(e=>e.id===n)??(r?.id===n?r:void 0):h.execApprovalQueue[0],a=e.snapshot.client;if(!i||h.execApprovalBusy||o)return;let c=i===r;if(!a||e.snapshot.phase!==`connected`){h.execApprovalErrors.set(i.id,B(`sessionsView.actionRequiresConnection`)),g();return}if(!Ff(e.snapshot).canGrantApprovals){h.execApprovalErrors.set(i.id,B(`execApproval.reviewOnly`)),g();return}h.execApprovalBusy=!0,h.execApprovalErrors.delete(i.id);let u={client:a,epoch:l,accessGeneration:d,grantGeneration:f,id:i.id};p=u;let m=()=>p===u&&u.epoch===l&&u.accessGeneration===d&&u.grantGeneration===f&&Ff(e.snapshot).canGrantApprovals&&y(u.client);g();try{if(await ey(a,i,t),!m())return;hy(h,i.id)}catch(e){if(iy(e)){if(!m())return;hy(h,i.id);let e=s,t=l;e&&m()&&await b(e,t);return}m()&&(c||h.execApprovalQueue.some(e=>e.id===i.id))&&h.execApprovalErrors.set(i.id,`Approval failed: ${on(e)}`)}finally{p===u&&(p=null,h.execApprovalBusy=!1,g())}},async openDevicePairSetup(){let t=Ff(e.snapshot);if(o||!t.canAdmin&&!t.canPair)return!1;m.pendingCount=0;let n=Sn(m);return _.refresh(),await v(n),m.devicePairSetupOpen},async refreshDevicePairSetup(){!o&&Ff(e.snapshot).canAdmin&&await v(yr(m))},async setDevicePairSetupAccess(t){!o&&Ff(e.snapshot).canAdmin&&await v(zn(m,t))},closeDevicePairSetup(){_.invalidate({clear:!0}),lr(m),g()},dispose(){o=!0,p=null,n.dispose(),_.invalidate(),lr(m),S(),C(),fy(h),h.execApprovalErrors.clear(),a.clear()}}}function hb(){return(hb=e((()=>{he(),V(),mr(),wa(),vy(),Hf(),Cy(),pb()})))()}function gb(e,t){return e.phase===`connected`&&Rf(e.hello?.auth??null)&&Io(e,t)===!0}function _b(e){return gb(e,`browser.request`)}function vb(e){return _b(e)||Fo(e,`browser.dashboard.request`,`operator.sessions.write`)}function yb(e){return Bd()||_b(e)}function bb(e){return gb(e,`desktop.observe`)}function xb(e){if(!e)return!1;let t=e.snapshot,n=e.connection.gatewayUrl;if(t.phase===`connected`){let r=Fo(t,`chat.history`,`operator.read`)&&Fo(t,`chat.send`,`operator.write`);return Sb.set(e,{gatewayUrl:n,allowed:r}),r}let r=Sb.get(e);return r?.gatewayUrl!==n||t.phase===`reload-required`?(Sb.delete(e),!1):r.allowed}var Sb;function Cb(){return(Cb=e((()=>{Lo(),Hf(),Sb=new WeakMap})))()}function wb(e){let t=e.snapshot,n=t.selfUser?.id;return t.phase===`connected`&&n&&e.connection.gatewayUrl?`${Ib}${JSON.stringify([ft(e.connection.gatewayUrl),n])}`:null}function Tb(e){if(!e)return{};let t=$n();if(!t)return{};try{let n=JSON.parse(t.getItem(e)??`null`),r=I(n);if(!r)return{};let i={};for(let e of Fb){let t=r[e],n=Array.isArray(t)?t.filter(e=>typeof e==`string`):[];n.length>0&&(i[e]=[...new Set(n)])}return i}catch{return{}}}function Eb(e,t){if(!e)return;let n=$n();if(n)try{Object.keys(t).length===0?n.removeItem(e):n.setItem(e,JSON.stringify(t))}catch{}}function Db(e,t){if(!e)return{};let n=Tb(e),r={...n,[t.kind]:[...new Set([...n[t.kind]??[],t.signature])]};return Eb(e,r),r}function Ob(e){return(e.state.phase===`guidance`||e.state.phase===`available`)&&e.scopes?{kind:`scopeUpgrade`,signature:JSON.stringify([e.state.phase,...e.scopes.toSorted()])}:null}function kb(e){let t=e.updateSchedule?.target,n=(t?.kind===`package`?t.version:t?.upstreamSha)??e.updateAvailable?.upstreamSha??e.updateAvailable?.latestVersion,r=e.gatewayBootId?.trim(),i=n?.trim();return r&&i?{kind:`updateAvailable`,signature:JSON.stringify([i,r])}:null}function Ab(e){return e===`warn`||e===`danger`}function jb(e,t){return e[t.kind]?.includes(t.signature)===!0}function Mb(e,t,n){let r={},i=!1;for(let a of Fb){let o=e[a];if(!o)continue;let s=o.filter(e=>!(!n||(a===`modelAuthExpired`?n.modelAuthAgentId&&(!e.startsWith(`agent:`)||e.startsWith(`agent:${n.modelAuthAgentId}\n`)):a!==`cronFailed`&&a!==`cronOverdue`||n.cronInventoryComplete))||t.some(t=>t.kind===a&&t.signature===e));s.length>0&&(r[a]=s),s.length!==o.length&&(i=!0)}return i?r:e}function Nb(e){let t=Tb(e.key),n=Mb(t,e.active,e.scope);return n!==t&&Eb(e.key,n),n}function Pb(e,t){let n=Tb(e);if(!n[t])return n;let r={...n};return delete r[t],Eb(e,r),r}var Fb,Ib;function Lb(){return(Lb=e((()=>{Fb=[`outbox`,`cronFailed`,`cronOverdue`,`modelAuthExpired`,`scopeUpgrade`,`updateAvailable`],Ib=`openclaw.control.sidebarAttention.v2:`})))()}function Rb(e){let t=new Set,n=null,r=()=>{for(let e of t)e()},i=()=>{let t=e.gateway.snapshot,r=t.hello?.auth?.scopes;t.phase===`connected`&&r&&!Ob({scopes:r,state:e.scopeUpgrade.state})&&Pb(wb(e.gateway),`scopeUpgrade`),n?.syncDismissals()},a=e.gateway.subscribe(i),o=e.scopeUpgrade.subscribe(i);return i(),{get entries(){return n?.entries??[]},activate(t){return n??=new t(e,r),n.mentions},dismiss(e){n?.dismiss(e)},subscribe(e){return t.add(e),()=>t.delete(e)},dispose(){a(),o(),n?.dispose(),n=null,t.clear()}}}function zb(){return(zb=e((()=>{Lb()})))()}function Bb(){let e=new AbortController,t=new Set,n=n=>{if(e.signal.aborted){n();return}t.add(n)};return{signal:e.signal,addDisposer:n,async run(t){for(let r of t){if(e.signal.aborted)return;let t=await r();t&&n(t)}},trackDisposer(t,r){t.then(n).catch(t=>{e.signal.aborted||r(t)})},stop(){e.abort();for(let e of[...t].toReversed())e();t.clear()}}}function Vb(e,t){let n=t?`${t}/`:`/`;if(e.pathname!==n)return e;let r=new URLSearchParams(e.search);if(r.get(`view`)!==`terminal`)return e;r.delete(`view`);let i=r.toString();return{pathname:xt({kind:`terminal`},t),search:i?`?${i}`:``,hash:e.hash}}function Hb(e,t){let n=e,r=!1,i=null,a=null,o=null,s=null,l=null,u=!1,d=null,f=e=>{Object.entries(e).every(([e,t])=>n[e]===t)||(n={...n,...e},r=!0)},p=typeof window>`u`?void 0:window.__OPENCLAW_NATIVE_CONTROL_AUTH__,m=new URLSearchParams(t.hash.replace(/^#/,``)).get(`nativeControlAuth`),h=p??(m?{gatewayUrl:m,nativeConnectAuth:!0}:void 0);if(h){try{delete window.__OPENCLAW_NATIVE_CONTROL_AUTH__}catch{window.__OPENCLAW_NATIVE_CONTROL_AUTH__=void 0}let e=R(h.gatewayUrl),t=R(h.token),r=R(h.password),a=e?Lh(n.gatewayUrl,e,{token:n.token,password:``}):null,o=h.client,s=c(R(o?.id)),l=vt(R(o?.mode)),u=R(o?.platform),g=R(o?.deviceFamily),_=R(o?.instanceId),v=Array.isArray(o?.scopes)?ce(o.scopes.flatMap(e=>R(e)??[])):[];s&&l&&u&&g&&v.length>0&&(d={clientName:s,mode:l,platform:u,deviceFamily:g,..._?{instanceId:_}:{},scopes:v}),h.nativeConnectAuth===!0&&e&&(d={nativeConnectAuth:pp(e,{messagePort:!p&&!!m})}),f({...e?{gatewayUrl:e}:{},...h.nativeConnectAuth===!0?{token:``}:h.token===null||t?{token:t??``}:a?{token:a.token}:{}}),r&&h.nativeConnectAuth!==!0&&(i=r)}if(!t.search&&!t.hash)return{settings:n,password:i,pendingGatewayUrl:a,pendingGatewayToken:o,pendingBootstrapToken:s,pendingBootstrapProfile:l,queryTokenUsed:u,nativeClient:d,location:t,changed:r};let g=new URL(`${t.pathname}${t.search}${t.hash}`,`http://openclaw.local`),_=new URLSearchParams(g.search),v=new URLSearchParams(g.hash.startsWith(`#`)?g.hash.slice(1):g.hash),y=_.get(`gatewayUrl`)??v.get(`gatewayUrl`),b=R(y)??``,x=!!(b&&b!==n.gatewayUrl),S=_.get(`token`),C=v.get(`token`),w=C!=null||S!=null,T=R(C??S),E=v.has(`bootstrapToken`),D=R(v.get(`bootstrapToken`)),O=v.has(N),k=R(v.get(N)),A=cs(t.pathname,_s(t.pathname)),ee=!(!T||A||x),j=!1;if(_.has(`token`)&&(_.delete(`token`),j=!0),w&&(S!=null&&(u=!0,console.warn(`[openclaw] Auth token passed as query parameter (?token=). Use URL fragment instead: #token=<token>. Query parameters may appear in server logs.`)),T&&x?o=T:T&&f({token:T}),v.delete(`token`),j=!0),E&&(s=D??null,l=D&&k===`owner`?Te:null,v.delete(`bootstrapToken`),j=!0),O&&(v.delete(N),j=!0),ee&&f({sessionKey:`main`,lastActiveSessionKey:`main`}),(_.has(`password`)||v.has(`password`))&&(_.delete(`password`),v.delete(`password`),j=!0),y!=null&&(a=x?b:null,(!x||s)&&(o=null),_.delete(`gatewayUrl`),v.delete(`gatewayUrl`),j=!0),j){g.search=_.toString();let e=v.toString();g.hash=e?`#${e}`:``}return{settings:n,password:i,pendingGatewayUrl:a,pendingGatewayToken:o,pendingBootstrapToken:s,pendingBootstrapProfile:l,queryTokenUsed:u,nativeClient:d,location:j?{pathname:g.pathname,search:g.search,hash:g.hash}:t,changed:r}}function Ub(){return(Ub=e((()=>{F(),i(),Ne(),Xe(),Y(),hp(),bg()})))()}function Wb(e,t){let n=async()=>{await e.refreshUpdateStatus(`completion`)},r=()=>{let r=e.snapshot;t.setWritesSuspended(r.updateRunning||r.updateReconciliationPending,n)},i=e.subscribe(r);return r(),i}async function Gb(e,t,n){try{let{presentUpdateFailureTriage:r}=await z(async()=>{let{presentUpdateFailureTriage:e}=await import(`./update-triage.runtime-rqfa0tcg.js`);return{presentUpdateFailureTriage:e}},__vite__mapDeps([115,114,116,82,28]),import.meta.url);r(e,t,n)}catch{n.isCurrent()&&e.navigate(`updates`)}}function Kb(){return(Kb=e((()=>{a()})))()}function qb(e,t={}){let n=globalThis.navigator,r=!Jn()||n.standalone===!0,i=r&&`serviceWorker`in n&&`PushManager`in globalThis&&`Notification`in globalThis,a={supported:i,permission:r?i?Notification.permission:`unsupported`:`install-required`,subscription:`unknown`,loading:!1},o=new Set,s=e=>{Object.assign(a,e);for(let e of o)e()},c=a.supported?z(async()=>{let{createWebPushCapabilityRuntime:e}=await import(`./web-push.runtime-DnfB-fK7.js`);return{createWebPushCapabilityRuntime:e}},__vite__mapDeps([117,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url).then(({createWebPushCapabilityRuntime:n})=>n({gateway:e,publish:s,connectionBootstrap:t.connectionBootstrap})).catch(e=>(s({supported:!1,permission:`unsupported`,subscription:`unknown`,preferences:null,error:on(e)}),null)):null;return{snapshot:a,subscribe(e){return o.add(e),()=>o.delete(e)},run:e=>c?c.then(t=>t?.run(e)):Promise.resolve(),dispose(){c?.then(e=>e?.dispose()),o.clear()}}}function Jb(){return(Jb=e((()=>{wa(),a()})))()}function Yb(){let e=ac(),t=e.location(),[n,r]=ec(t.pathname||globalThis.location?.pathname||`/`),i=bm(t.pathname,n),a=Bh(),o=i?Ah(a):a,s=Hb(o,t),c=Ze(s.settings.gatewayUrl)===Ze(o.gatewayUrl)?null:Fh(s.settings.gatewayUrl),l=c?{...s.settings,...c,selectedAgentId:c.selectedAgentId}:s.settings;bs(s.location,t)||e.replace(s.location),s.changed&&!i&&Hh(l);let u=Vb(s.location,n);u!==s.location&&e.replace(u);let d=ne(u,n),f=i===null&&d===null,p=f&&li(u,n,hs),m=s.pendingGatewayUrl!==null,h=Cv(l,s.password??``,m?``:s.pendingBootstrapToken??``,void 0,{persistDefaultConnectionSettings:i===null,resourceBasePath:r,getModelCatalogTarget:t=>wg(e.location(),n,t),...!m&&s.pendingBootstrapProfile?{bootstrapProfile:s.pendingBootstrapProfile}:{},...s.nativeClient?{clientOptions:s.nativeClient}:{}}),g=()=>({hello:h.snapshot.hello,settings:{token:h.connection.token},password:h.connection.password}),_=ft(`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${r}`),v=m_(r,()=>ft(h.connection.gatewayUrl)===_?g():{}),y=z_(),b=A_(),x=rp(),S=cm(ft(l.gatewayUrl),e=>s.pendingBootstrapToken||s.password?null:e===`token`?l.token:l.token.trim()?null:Oa(l.gatewayUrl)),C=S!==null&&f&&!m;C&&Jg(S,l.sessionKey);let w=Xg(h,f&&!m?S?.profileId:void 0),T=Gn(h,{cachedList:S?.agents??null,cachedProfileId:S?.profileId??null}),E=Bb(),D=ri(l.sessionKey),O=p&&!D,k=null,A=O?new Promise(e=>{k=e}):null,ee=Tg({fallback:u,signal:E.signal,resolve:()=>i||d?Promise.resolve(u):Eg({location:u,basePath:n,sessionKey:l.sessionKey,gateway:h,agentsList:()=>T.state.agentsList,ensureAgentsList:()=>T.ensureList(),selectedAgentId:l.selectedAgentId,signal:E.signal})}),j=p&&D?Cg(u,n,l.sessionKey,D.agentId):u,M=p?Promise.resolve(j):ee(),N=wi(h),P=Kg(l,h),te=$u(h,T,f?{load:e=>Fh(e).selectedAgentId??null,save:(e,t)=>{h.connection.gatewayUrl===e&&Wh({selectedAgentId:t??void 0})}}:void 0,{get settings(){return P.settings},subscribe:P.subscribe,patch:Wh}),re=$u(h,T,void 0,void 0,{requireConfiguredAgent:!0}),F=Li(h),ie=Dg({router:x,chatSubmissions:b,gateway:h,agents:T,agentSelection:te,connectionBootstrap:y,initialChatRoute:f&&Se(u.pathname,n)?.namespace===`chat`}),I=W_(h),ae=I_({resourceBasePath:r,getAuth:g}),oe=za(h,te,{bootRecord:S,connectionBootstrap:y}),se=Zg({gateway:h,agents:T,sessions:oe}),ce=ua(h),le=mb(h,{connectionBootstrap:y,getActiveSessionKey:()=>h.snapshot.sessionKey||void 0,drainConfigWrites:()=>ce.waitForPendingWrites(),onUpdateFailure:(e,t)=>void Gb(Re,e,t)}),ue=Rb({gateway:h,agentSelection:te,agents:T,overlays:le,scopeUpgrade:I,connectionBootstrap:y}),de=Wb(le,ce),fe=kg(P),pe=Nv(),me=()=>P.settings.openLinksExternally===!0,he=Ov(()=>h.snapshot,{shouldOpenExternally:me}),ge=Uv({shouldOpenExternally:me,signal:E.signal,canPresentBrowserPanel:()=>{let e=document.querySelector(`openclaw-app-shell`);return e?.isConnected===!0&&!Cc(e.routeState.routeId)},onNativeUpdateDeclined:()=>{let e=le.snapshot,t=e.updateSchedule?.campaign,n=e.updateRunning||e.updateReconciliationPending||t?.state===`applying`;(e.updateAvailable||t)&&!n&&!e.controlUiRefreshRequired&&le.runUpdate()},shouldOpenInControlUiBrowser:()=>Bh().openLinksInControlUiBrowser===!0&&_b(h.snapshot)&&document.querySelector(`openclaw-app-shell`)?.isConnected===!0}),_e=null,ve=null,ye=qb(h,{connectionBootstrap:y}),be=C_({gateway:h,sessions:oe,chatSubmissions:b}),xe=T_(h),Ce=!1,we=null,Te=s.pendingGatewayUrl===null?null:{gatewayUrl:s.pendingGatewayUrl,token:s.pendingGatewayToken,bootstrapToken:s.pendingBootstrapToken??``,...s.pendingBootstrapProfile?{bootstrapProfile:s.pendingBootstrapProfile}:{}},Ee=null,De=null,Oe=!!(m||s.nativeClient||s.pendingBootstrapToken),ke=h.connectionRevision,Ae=h.subscribe(e=>{if(e.phase===`connected`&&(Oe=!0),!Oe&&e.phase===`stopped`&&(e.lastErrorCode===Ue.AUTH_TOKEN_MISSING||e.lastErrorCode===Ue.AUTH_PASSWORD_MISSING)&&(Oe=!0,E.trackDisposer(z(async()=>{let{startBrowserBootstrapRecovery:e}=await import(`./browser-bootstrap.runtime-azYaAbIw.js`);return{startBrowserBootstrapRecovery:e}},__vite__mapDeps([118,119,2,3,1,4,5,8,9,6,7,28]),import.meta.url).then(({startBrowserBootstrapRecovery:t})=>h.snapshot.client===e.client&&h.connectionRevision===ke&&!E.signal.aborted?t(h,n):()=>{}),()=>{})),e.phase!==`connected`||!e.client){Ee=null,De=null;return}let t=e.client;Ee!==t&&(Ee=t,y.run(`config`,()=>ae.refresh()),y.run(`session-observer`,()=>ja(t,Hr()!==`off`))),t.recoveryScopeReady&&De!==t&&(De=t,be.resumeRecovery())}),je=(e,t)=>{let r=vs(e,n),i=x.getState().matches[0],a=i?.routeId===e&&e===`workboard`?i.location.pathname:null;return t?.pathname!==void 0||t?.search!==void 0||t?.hash!==void 0?{...r,pathname:t?.pathname??a??r.pathname,search:t?.search??``,hash:t?.hash??``}:r},Me=()=>{let e=Te;if(!e)return;Te=null;let t=Lh(h.connection.gatewayUrl,e.gatewayUrl,h.connection);h.connect({gatewayUrl:e.gatewayUrl,token:e.bootstrapToken?``:e.token??t.token,password:t.password,bootstrapToken:e.bootstrapToken,bootstrapProfile:e.bootstrapProfile})},Ne=()=>{Te=null},Pe=(t,n,r)=>{let i=je(t,n);Ce||(we={routeId:t,location:i,mode:r});let a=Ce&&bs(e.location(),i)?`replace`:r,o=x.navigate(t,Re,{history:a},i);return o.catch(e=>{console.error(`[openclaw] route navigation failed`,e)}),o},Fe=(e,t)=>Pe(e,t,`push`),Ie=new Ar(()=>Re),Le=null,Re={basePath:n,resourceBasePath:r,lifecycleAbortSignal:E.signal,router:x,gateway:h,connectionBootstrap:y,agents:T,agentIdentity:N,agentSelection:te,settingsAgentSelection:re,channels:F,config:ae,scopeUpgrade:I,sidebarAttention:ue,runtimeConfig:ce,sessions:oe,placementStartup:be,plugins:Ie,overlays:le,navigation:fe,theme:P,nativeChatDrafts:pe,get nativeConversation(){return Le},get nativeDeviceSettings(){return _e},get nativeNotifications(){return ve},webPush:ye,chatSubmissions:b,chatAttachmentHandoff:xe,navigate:(e,t)=>{Fe(e,t)},navigateAndWait:Fe,replace:(e,t)=>{Pe(e,t,`replace`)},revalidate:e=>x.revalidate(Re,e),preload:e=>x.preloadLocation(vs(e,n),Re)};return{context:Re,router:x,documentMode:i,warmBoot:C,focusLocation:d,get pendingGatewayConnection(){return Te},confirmPendingGatewayConnection:Me,cancelPendingGatewayConnection:Ne,start:()=>{let t=()=>x.stop();f&&E.addDisposer(t);let r=[()=>(h.start(),()=>h.stop()),()=>K_(h,document,window),()=>J_(h,document),()=>(Ie.start(),()=>Ie.dispose())];return f&&!p&&r.unshift(()=>tp(x,u,n)),window.webkit?.messageHandlers&&r.unshift(async()=>{let{startNativeCapabilities:e}=await z(async()=>{let{startNativeCapabilities:e}=await import(`./native-startup.runtime-D2efId9J.js`);return{startNativeCapabilities:e}},__vite__mapDeps([120,28]),import.meta.url);return e(Re,E,e=>{Le=e.conversation,_e=e.deviceSettings,ve=e.notifications})}),r.push(()=>Ga({context:Re,enabled:p,history:e,initialLocationReady:M,...O?{redirect:()=>e.replace({...vs(`model-setup`,n),search:`?firstRun=1`}),onInitialDecision:()=>k?.()}:{}})),r.push(()=>{ae.refresh({skipWithoutAuthCandidate:!0})}),f&&(A&&r.push(()=>A),r.push(async()=>{let r=we;return we=null,Ce=!0,r&&e[r.mode](r.location),await sp(x,e,n,Re),t})),p&&r.push(()=>{E.trackDisposer(Ga({context:Re,enabled:!1,history:e,initialLocationReady:ee(),installLocation:async t=>{let r=hs(t.pathname,n);r?await x.navigate(r,Re,{history:`replace`},t):e.replace(t)},shouldInstallLocation:()=>D?bs(e.location(),j):li(e.location(),n,hs)}),e=>{console.error(`[openclaw] initial session location failed`,e)})}),E.run(r)},stop:()=>{v(),E.stop(),w(),se(),Ae(),ie(),y.reset(),T.dispose(),te.dispose(),re.dispose(),F.dispose(),I.dispose(),ue.dispose(),be.dispose(),oe.dispose(),de(),ce.dispose(),le.dispose(),P.dispose(),pe.dispose(),he.dispose(),ge.dispose(),ye.dispose(),b.clear(),xe.dispose()}}}function Xb(){return(Xb=e((()=>{Ne(),nt(),Gc(),Y(),lp(),up(),Pr(),yo(),jn(),Ia(),ta(),$r(),na(),Ni(),Ot(),Vn(),ed(),xm(),vm(),Og(),Ag(),qg(),Qg(),h_(),oc(),O_(),j_(),R_(),V_(),G_(),q_(),Q_(),Tv(),kv(),qv(),hb(),Cb(),w_(),bg(),zb(),Ub(),Kb(),Jb(),a()})))()}function Zb(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLTextAreaElement?!e.readOnly&&!e.disabled:e instanceof HTMLInputElement?!e.readOnly&&!e.disabled&&![`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`].includes(e.type):e instanceof HTMLElement&&e.isContentEditable}function Qb(){let e=window.visualViewport;if(!e)return()=>{};let t=document.documentElement,n=new AbortController,r=null,i=null,a=t.clientWidth||window.innerWidth,o=()=>{r=null;let n=t.clientHeight||window.innerHeight,o=t.clientWidth||window.innerWidth,s=Zb();(a!==o||!s)&&(i=null),a=o,s&&(i??=Math.max(n,e.height));let c=e.scale===1;c&&s&&Math.max(n,i??0)-e.height>=$b?t.style.setProperty(`--shell-safe-area-bottom`,`0px`):t.style.removeProperty(`--shell-safe-area-bottom`),c&&n-e.height>=$b?t.style.setProperty(`--shell-viewport-height`,String(Math.max(0,e.height+e.offsetTop))+`px`):t.style.removeProperty(`--shell-viewport-height`)},s=()=>{r??=requestAnimationFrame(o)},c={signal:n.signal};return e.addEventListener(`resize`,s,c),e.addEventListener(`scroll`,s,c),window.addEventListener(`resize`,s,c),window.addEventListener(`orientationchange`,s,c),document.addEventListener(`focusin`,()=>{Zb()&&(i??=e.height),s()},c),document.addEventListener(`focusout`,s,c),o(),()=>{n.abort(),r!==null&&cancelAnimationFrame(r),t.style.removeProperty(`--shell-viewport-height`),t.style.removeProperty(`--shell-safe-area-bottom`)}}var $b;function ex(){return(ex=e((()=>{$b=80})))()}function tx(e){return`${e.pathname}${e.search}${e.hash}`}function nx(e){return`type`in e&&e.type===`notFound`}var rx;function ix(){return(ix=e((()=>{v(),Ne(),W(),No(),af(),Af(),Sd(),hd(),Nf(),V(),wa(),na(),Qi(),Ji(),Zr(),Xb(),Yu(),xu(),kv(),Qs(),Cb(),bg(),ex(),a(),rx=class extends Ha{get context(){return this.runtime?.context}get focusTarget(){let e=this.runtime?.focusLocation;return e?.status===`valid`?e.target:null}get terminalOnly(){return this.focusTarget?.kind===`terminal`}constructor(){super(),this.loginGatePinned=!1,this.loginGatewayUrl=``,this.loginToken=``,this.loginPassword=``,this.loginShowGatewaySecret=!1,this.pendingGatewayUrl=null,this.onboarding=qf(globalThis.location?.search??``),this.focusDashboardRoute={kind:`loading`},this.contextProvider=new oe(this,{context:Ju}),this.subscriptions=new Fa(this),this.loginGatewaySource=null,this.loginConnectionClient=null,this.focusDashboardAbort=null,this.loginGateLoader=new $l(this),this.lazyCustomElements=new $l(this,()=>this.closeDocument(this.context?.basePath??``)),this.subscriptions.watch(()=>this.context?.gateway,(e,t)=>e.subscribe(t),e=>this.synchronizeGateway(e)).watch(()=>this.terminalOnly?this.context?.config:void 0,(e,t)=>e.subscribe(t)).watch(()=>this.context?.agentSelection,(e,t)=>e.subscribe(t)).watch(()=>this.terminalOnly?this.context?.theme:void 0,(e,t)=>e.subscribe(t)).watch(()=>this.context?.router,(e,t)=>e.subscribe(t)).effect(()=>this.ownerDocument,Mf)}connectedCallback(){super.connectedCallback(),this.disconnectViewport?.(),this.disconnectViewport=Qb();let e=Js();this.ownerDocument.documentElement.classList.toggle(`openclaw-native-embed`,e!==null),this.toggleAttribute(`data-native-titlebar`,e?.platform===`macos`&&e.formFactor===`desktop`&&e.surface===`conversation`),e&&z(()=>Promise.resolve({}),__vite__mapDeps([121]),import.meta.url),z(()=>import(`./session-progress-hovercard-registration-BxST9uwo.js`),__vite__mapDeps([122,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url),this.resetLoginSensitivePresentation(),this.runtime=Yb();let t=this.focusTarget;t?.kind===`terminal`&&this.requestLazyDocument(lu),t?.kind===`desktop`&&this.requestLazyDocument(fu),t?.kind===`browser`&&this.requestLazyDocument(du),t?.kind===`dashboard`&&this.requestLazyDocument(mu),this.runtime.documentMode?.kind===`approval`&&this.requestLazyDocument(hu),this.runtime.documentMode?.kind===`question`&&this.requestLazyDocument(_u);let n=this.runtime.context;this.pendingGatewayUrl=this.runtime.pendingGatewayConnection?.gatewayUrl??null,this.contextProvider.setValue(n),this.syncLoginConnection(),this.requestUpdate(),this.runtime.start().then(()=>this.resolveFocusDashboard()).catch(e=>{console.error(`[openclaw] application start failed`,e)})}disconnectedCallback(){this.subscriptions.clear(),this.disconnectViewport?.(),this.disconnectViewport=void 0,this.focusDashboardAbort?.abort(),this.focusDashboardAbort=null,this.lazyCustomElements.abandon(),this.loginGateLoader.abandon(),this.runtime?.stop(),this.runtime=void 0,this.loginGatewaySource=null,this.loginConnectionClient=null,this.pendingGatewayUrl=null,this.resetLoginSensitivePresentation(),super.disconnectedCallback()}firstUpdated(){this.runtime&&globalThis.dispatchEvent(new Event(`openclaw-control-ui-rendered`))}synchronizeGateway(e){let t=e!==this.loginGatewaySource;t&&(this.loginGatewaySource=e,this.loginConnectionClient=null,this.resetLoginSensitivePresentation());let n=e.snapshot,r=n.client!==this.loginConnectionClient;r&&(this.loginConnectionClient=n.client,this.resetLoginSensitivePresentation()),(t||r)&&this.syncLoginConnection(e),n.phase===`connected`&&(this.loginGatePinned=!1)}syncLoginConnection(e=this.context?.gateway){let t=e?.connection;t&&(this.loginGatewayUrl=t.gatewayUrl,this.loginToken=t.token,this.loginPassword=t.password)}resetLoginSensitivePresentation(){this.loginShowGatewaySecret=!1}updateLoginGatewayUrl(e){let t=Lh(this.loginGatewayUrl,e,{token:this.loginToken,password:this.loginPassword});this.loginGatewayUrl=e,this.loginToken=t.token,this.loginPassword=t.password}closeDocument(e){globalThis.history.length>1?globalThis.history.back():globalThis.location.assign(e||`/`)}renderFocusEscape(e){return qs()?U:H`<button
      class="btn btn--ghost"
      type="button"
      @click=${()=>this.closeDocument(this.context?.basePath??``)}
    >
      ${e}
    </button>`}requestLazyDocument(e){Zl(e)||this.lazyCustomElements.request(e)}renderLazyDocumentState(e){let t=this.lazyCustomElements.visibleState;return!t||t.element!==e?U:H`<main class="connect-splash">
      ${vd(t,()=>this.lazyCustomElements.retry(),()=>this.lazyCustomElements.close())}
    </main>`}renderApprovalDocument(e){if(this.lazyCustomElements.visibleState?.element===hu)return this.renderLazyDocumentState(hu);let t=e.documentMode?.kind===`approval`?e.documentMode.approvalId:``;return H`<openclaw-approval-page .approvalId=${t??``}></openclaw-approval-page>`}renderQuestionDocument(e){if(this.lazyCustomElements.visibleState?.element===_u)return this.renderLazyDocumentState(_u);let t=e.documentMode?.kind===`question`?e.documentMode.questionId:``;return H`<openclaw-question-page .questionId=${t??``}></openclaw-question-page>`}replaceFocusDashboardLocation(e,t){let n=this.context?.basePath??``,r=xt({kind:`dashboard`,path:tx(t)},n),i=xt({kind:`dashboard`,path:tx(e)},n),a=`${globalThis.location.pathname}${globalThis.location.search}${globalThis.location.hash}`;r&&i&&a===r&&i!==a&&globalThis.history.replaceState(globalThis.history.state,``,i)}async resolveFocusDashboard(){let e=this.focusTarget,t=this.context;if(e?.kind!==`dashboard`||!t)return;this.focusDashboardAbort?.abort();let n=new AbortController;this.focusDashboardAbort=n,this.focusDashboardRoute={kind:`loading`};let r=e.route;try{let{loadChatRoute:e}=await z(async()=>{let{loadChatRoute:e}=await import(`./route-loader-Cu3upMOr.js`);return{loadChatRoute:e}},__vite__mapDeps([98,85,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,21,22,86,23,87,73,88,28,29,30,31,32,33,34,91,35,92,74,93]),import.meta.url),i=await e(t,r,`dashboard`,n.signal);if(n.signal.aborted||this.focusDashboardAbort!==n)return;if(nx(i)||i.kind===`missing-session`){this.focusDashboardRoute={kind:`not-found`};return}if(i.kind===`route-error`){this.focusDashboardRoute={kind:`error`,message:i.message};return}if(i.kind===`ambiguous`){this.focusDashboardRoute={kind:`ambiguous`,data:{...i,candidates:i.candidates.map(e=>({...e,href:xt({kind:`dashboard`,path:e.href},t.basePath)??e.href}))}};return}this.focusDashboardRoute={kind:`session`,data:i},i.canonicalLocation&&i.canonicalLocationSource&&this.replaceFocusDashboardLocation(i.canonicalLocation,i.canonicalLocationSource);let a=i.canonicalLocationSource;i.canonicalLocationReady&&a&&i.canonicalLocationReady.then(e=>{e&&!n.signal.aborted&&this.focusDashboardAbort===n&&this.replaceFocusDashboardLocation(e,a)})}catch(e){!n.signal.aborted&&this.focusDashboardAbort===n&&(this.focusDashboardRoute={kind:`error`,message:on(e)})}}renderFocusDashboard(e,t,n){let r=this.focusDashboardRoute;return r.kind===`loading`?md(n):r.kind===`not-found`?H`<main class="board-document">
        <section class="board-document__state stack" role="status">
          <span>${B(`dashboardDocument.notFound`)}</span>
          ${this.renderFocusEscape(B(`dashboardDocument.close`))}
        </section>
      </main>`:r.kind===`error`?H`<main class="board-document">
        <section class="board-document__state board-document__state--error stack" role="alert">
          <span>${B(`dashboardDocument.loadFailed`,{error:r.message})}</span>
          ${this.renderFocusEscape(B(`dashboardDocument.close`))}
        </section>
      </main>`:r.kind===`ambiguous`?H`<main class="board-document">
        <section class="card board-document__state">
          <h2>${B(`chat.sessionRoute.chooseTitle`)}</h2>
          <p>
            ${r.data.candidates.length>1?B(`chat.sessionRoute.multipleMatches`,{shortId:r.data.shortId}):B(`chat.sessionRoute.additionalMatches`)}
          </p>
          ${r.data.candidates.map(e=>H`<p>
              <a href=${e.href}>${e.displayName}</a><br />
              <small>${e.agentId} · ${e.idPrefix}</small>
            </p>`)}
          ${r.data.truncated?H`<p><small>${B(`chat.sessionRoute.additionalMatches`)}</small></p>`:U}
          ${this.renderFocusEscape(B(`dashboardDocument.close`))}
        </section>
      </main>`:H`
      <openclaw-board-document
        .gatewaySnapshot=${e}
        .sessions=${this.context?.sessions}
        .sessionKey=${r.data.sessionKey}
        .preparedSession=${r.data.agentId?{sessionKey:r.data.sessionKey,agentId:r.data.agentId}:null}
        .onDocumentClose=${qs()?null:()=>this.closeDocument(this.context?.basePath??``)}
      ></openclaw-board-document>
      ${!t&&e.lastError===null?md(n):U}
      ${t?this.renderLazyDocumentState(mu):U}
    `}render(){let e=this.context,t=this.runtime;if(!e||!t)return H`<main class="app-shell app-shell--booting" aria-busy="true"></main>`;let n=this.pendingGatewayUrl?H`
          <openclaw-gateway-url-confirmation
            .props=${{pendingGatewayUrl:this.pendingGatewayUrl,currentGatewayUrl:t.context.gateway.connection.gatewayUrl,linkCarriesToken:!!t.pendingGatewayConnection?.token,onConfirm:()=>{t.confirmPendingGatewayConnection(),this.pendingGatewayUrl=null},onCancel:()=>{t.cancelPendingGatewayConnection(),this.pendingGatewayUrl=null}}}
          ></openclaw-gateway-url-confirmation>
        `:U;return H`<openclaw-tooltip-provider>
      ${this.renderDocument(e,t)} ${n}
    </openclaw-tooltip-provider>`}renderDocument(e,t){let n=e.gateway.snapshot,r=n.phase===`connected`,i=n.phase===`starting`?B(`common.gatewayStarting`):void 0;if(t.focusLocation?.status===`unsupported`)return H`<main class="connect-splash" role="alert">
        <div class="stack">
          <span class="connect-splash__status">${B(`focus.unsupported`)}</span>
          ${this.renderFocusEscape(B(`common.back`))}
        </div>
      </main>`;let a=this.focusTarget;if(a?.kind===`browser`)return H`
        <openclaw-browser-document
          .props=${{context:e,target:a,renderEscape:e=>this.renderFocusEscape(e)}}
        ></openclaw-browser-document>
        ${this.renderLazyDocumentState(du)}
      `;if(a?.kind===`terminal`){let t=Oi(n,e.config.current.terminalEnabled??!1),a=e.agentSelection.state.selectedId??n.assistantAgentId,o=a?M(a):null;return H`
        <openclaw-terminal-panel
          .client=${r?n.client:null}
          .available=${t}
          .agentId=${o}
          .themeMode=${e.theme.resolvedMode}
          fullscreen
        ></openclaw-terminal-panel>
        ${!r&&n.lastError===null?md(i):U}
        ${t?this.renderLazyDocumentState(lu):U}
        ${!t&&(r||n.lastError)?H`<div class="terminal-view-unavailable">
                <div class="stack">
                  <span>${B(`terminal.unavailable`)}</span>
                  ${this.renderFocusEscape(B(`common.back`))}
                </div>
              </div>`:U}
      `}if(a?.kind===`desktop`){let t=bb(n),o=a.selector?.kind===`source`?a.selector.value:null,s=a.selector?.kind===`session`?a.selector.value:null;return H`
        <openclaw-desktop-panel
          .client=${r?n.client:null}
          .sessions=${e.sessions}
          .available=${t}
          .documentMode=${!0}
          .requestedSource=${o}
          .sessionKey=${s}
          .documentControl=${a.control}
          .onDocumentClose=${()=>this.closeDocument(e.basePath)}
        ></openclaw-desktop-panel>
        ${!r&&n.lastError===null?md(i):U}
        ${t?this.renderLazyDocumentState(fu):U}
        ${!t&&(r||n.lastError)?H`<div class="desktop-view-unavailable">
                <div class="stack">
                  <span>${B(`desktop.unavailable`)}</span>
                  ${this.renderFocusEscape(B(`common.back`))}
                </div>
              </div>`:U}
      `}if(a?.kind===`dashboard`)return this.renderFocusDashboard(n,r,i);let o=t.documentMode===null&&n.lastError===null&&(n.phase===`starting`||n.phase===`connecting`&&!this.loginGatePinned),s=o&&t.warmBoot&&!this.loginGatePinned;if(o&&!s)return md(i);let c=e.router.getState(),l=(c.pendingMatches[0]??c.matches[0])?.routeId===`connection`&&(e.gateway.hasStoredDeviceToken?.()??!1)||n.phase===`reconnecting`||n.phase===`reload-required`||s,u=!r&&!l;if(u&&!Zl(bu)){let e=this.loginGateLoader.visibleState;return e||this.loginGateLoader.preload(bu,{reportError:!0}),e?.status===`error`?bd({error:e.error,stale:e.stale,onRetry:()=>this.loginGateLoader.retry()}):md()}return u?H`
        <openclaw-login-gate
          .props=${{resourceBasePath:e.resourceBasePath,mascot:e.theme.branding.mascot,connected:r,lastError:n.lastError,reconnectAt:n.reconnectAt,reconnectPending:n.lastError!==null&&(n.phase===`connecting`||n.phase===`reconnecting`),lastErrorCode:n.lastErrorCode,lastErrorAuthReason:n.lastErrorAuthReason,hasToken:!!this.loginToken.trim(),hasPassword:!!this.loginPassword.trim(),gatewayUrl:this.loginGatewayUrl,secret:this.loginToken||this.loginPassword,showGatewaySecret:this.loginShowGatewaySecret,onGatewayUrlChange:e=>{this.updateLoginGatewayUrl(e)},onSecretChange:e=>{this.loginToken=e,this.loginPassword=``},onToggleGatewaySecret:()=>{this.loginShowGatewaySecret=!this.loginShowGatewaySecret},onOpenGatewaySettings:e.gateway.hasStoredDeviceToken?.()?()=>e.navigate(`connection`):void 0,onConnect:()=>{this.loginGatePinned=!0,e.gateway.connect({gatewayUrl:this.loginGatewayUrl,token:this.loginToken,password:this.loginPassword})}}}
        ></openclaw-login-gate>
      `:t.documentMode?.kind===`approval`?this.pendingGatewayUrl?U:this.renderApprovalDocument(t):t.documentMode?.kind===`question`?this.renderQuestionDocument(t):H`
      <openclaw-link-reader-hovercard-provider
        .client=${r?n.client:null}
        .readers=${Dv(n)}
        .claimedReaders=${Ev(n)}
        .pagePreviewContext=${e}
        .agentId=${e.agentSelection.state.selectedId??n.assistantAgentId??void 0}
      >
        <openclaw-session-progress-hovercard-provider
          .client=${n.client}
          .context=${e}
          .gateway=${e.gateway}
        >
          <openclaw-app-shell
            .runtime=${t}
            .onboarding=${this.onboarding}
          ></openclaw-app-shell>
        </openclaw-session-progress-hovercard-provider>
      </openclaw-link-reader-hovercard-provider>
    `}},L([G()],rx.prototype,`loginGatePinned`,void 0),L([G()],rx.prototype,`loginGatewayUrl`,void 0),L([G()],rx.prototype,`loginToken`,void 0),L([G()],rx.prototype,`loginPassword`,void 0),L([G()],rx.prototype,`loginShowGatewaySecret`,void 0),L([G()],rx.prototype,`pendingGatewayUrl`,void 0),L([G()],rx.prototype,`onboarding`,void 0),L([G()],rx.prototype,`focusDashboardRoute`,void 0)})))()}function ax(e){let t=e instanceof CustomEvent?e.detail:void 0,n=t&&typeof t==`object`&&`trigger`in t?t.trigger:null;return n instanceof HTMLElement?n:void 0}function ox(e){return oa(kr.commandPalette,e)}function sx(e){return typeof e==`object`&&!!e&&`owner`in e&&e.owner instanceof Element&&`onSlashCommand`in e&&(e.onSlashCommand===null||typeof e.onSlashCommand==`function`)}function cx(e,t){let n=t instanceof CustomEvent?t.detail:void 0;sx(n)&&(e.commandPaletteTarget=n.onSlashCommand?n:e.commandPaletteTarget?.owner===n.owner?void 0:e.commandPaletteTarget,e.requestUpdate())}var lx,ux,dx,fx;function px(){return(px=e((()=>{fi(),lx=`--openclaw-modal-width: min(740px, calc(100vw - 32px));`,ux=`openclaw-command-palette-target`,dx=`openclaw:command-palette-open`,fx=`openclaw:shell-nav-drawer-toggle`})))()}function mx(e){let t=e.closest(`.cmd-palette__entry`),n=e.scrollHeight-e.clientHeight;t?.toggleAttribute(`data-scroll-fade-top`,n>1&&e.scrollTop>1),t?.toggleAttribute(`data-scroll-fade-bottom`,n>1&&e.scrollTop<n-1)}function hx(e,t=!1){let n=e.closest(`.cmd-palette__entry`),r=n?.querySelector(`.cmd-palette__input-actions`);n&&r&&n.style.setProperty(`--cmd-palette-actions-width`,`${r.getBoundingClientRect().width}px`);let i=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(i)||i<=0)return;let a=e.scrollTop,o=t&&document.activeElement===e&&e.selectionStart===e.selectionEnd&&e.selectionEnd===e.value.length;e.style.overflowY=`hidden`,e.style.height=`0px`,e.style.height=`${Math.max(i,Math.min(i*3,e.scrollHeight))}px`;let s=e.scrollHeight>e.clientHeight+1;e.style.overflowY=s?`auto`:`hidden`,e.scrollTop=s?o?e.scrollHeight:a:0,mx(e),yx.set(e,e.value)}function gx(e){let t=e.currentTarget;t instanceof HTMLTextAreaElement&&t.isConnected&&mx(t)}function _x(e){return H`
    <div class="cmd-palette__entry">
      <div class="cmd-palette__input-scroll">
        <textarea
          ${xx(e.value,e.placeholder)}
          autofocus
          rows="1"
          id=${vx}
          class="cmd-palette__input"
          aria-label=${e.placeholder}
          aria-autocomplete=${e.controls?`list`:U}
          aria-haspopup=${e.controls?`listbox`:U}
          aria-controls=${e.controls??U}
          aria-activedescendant=${e.activeDescendant??U}
          aria-describedby=${e.describedBy??U}
          placeholder=${e.placeholder}
          .value=${e.value}
          ?disabled=${e.disabled}
          ?readonly=${e.readOnly}
          @scroll=${gx}
          @paste=${e.onPaste??U}
          @beforeinput=${e.onBeforeInput??U}
          @select=${e.onSelectionChange??U}
          @pointerup=${e.onSelectionChange??U}
          @keyup=${t=>{(t.key.startsWith(`Arrow`)||t.key===`Home`||t.key===`End`)&&e.onSelectionChange?.(t)}}
          @compositionstart=${e.onCompositionStart??U}
          @compositionend=${e.onCompositionEnd??U}
          ${Co(e.onInputRef)}
          @input=${t=>{t.currentTarget instanceof HTMLTextAreaElement&&(e.onValueChange(t.currentTarget.value,t),hx(t.currentTarget,!0))}}
        ></textarea>
      </div>
      <div class="cmd-palette__input-actions">${e.actions??U}</div>
    </div>
  `}var vx,yx,bx,xx;function Sx(){return(Sx=e((()=>{W(),Ao(),So(),To(),vx=`cmd-palette-input`,yx=new WeakMap,bx=class extends wo{#e;#t;#n;#r;render(e,t){return U}update(e,[t,n]){let r=e.element instanceof HTMLTextAreaElement?e.element:void 0,i=r&&(this.#e!==r||this.#t!==n||yx.get(r)!==t);return this.#e=r,this.#t=n,i&&this.#i(),U}#i=()=>{this.#r===void 0&&(this.#r=requestAnimationFrame(()=>{this.#r=void 0;let e=this.#e;if(this.isConnected&&e?.isConnected){if(!this.#n&&typeof ResizeObserver==`function`){this.#n=new ResizeObserver(this.#i);let t=e.closest(`.cmd-palette__entry`);if(t){this.#n.observe(t);let e=t.querySelector(`.cmd-palette__input-actions`);e&&this.#n.observe(e)}}hx(e)}}))};disconnected(){this.#n?.disconnect(),this.#n=void 0,this.#r!==void 0&&(cancelAnimationFrame(this.#r),this.#r=void 0)}reconnected(){this.#i()}},xx=Do(bx)})))()}function Cx(e,t){let n=t instanceof CustomEvent?t.detail:null;return w(n)?{eventType:e,detail:n}:{eventType:e}}function wx(){try{let e=Ut()?.getItem(Dx),t=e?JSON.parse(e):null;if(!w(t)||!Object.hasOwn(t,`eventType`))return Ex(),null;let n=Object.keys(t).length,r=kx.find(e=>e===t.eventType);if(r&&n===1)return{eventType:r};let i=t.detail;if(r&&n===2&&Object.hasOwn(t,`detail`)&&w(i))return{eventType:r,detail:i}}catch{}return Ex(),null}function Tx(e){try{let t=Ut();return t?(t.setItem(Dx,JSON.stringify(e)),!0):!1}catch{}return Ex(),!1}function Ex(){try{Ut()?.removeItem(Dx)}catch{}}var Dx,Ox,kx;function Ax(){return(Ax=e((()=>{px(),Id(),Dx=`openclaw:lazy-event`,Ox=`openclaw:approvals-open`,kx=[dx,Md,Nd,Td,Dd,Pd,Od,jd,Ad,Ox]})))()}function jx(e,t){let n=B(`palette.placeholder`);return H`<openclaw-modal-dialog
    class="cmd-palette-overlay palette"
    label=${n}
    style=${lx}
    @modal-cancel=${t}
  >
    <div
      class="cmd-palette"
      aria-busy="true"
      @compositionstart=${e.handleCompositionStart}
      @compositionend=${e.handleCompositionEnd}
      @keydown=${e.handleKeydown}
    >
      ${_x({value:e.value,placeholder:n,onInputRef:e.inputRef,onValueChange:e.captureInput,onPaste:e.handlePaste,readOnly:e.submitRequested})}
      <div class="cmd-palette__empty" role="status">${B(`common.loading`)}</div>
    </div>
  </openclaw-modal-dialog>`}var Mx,Nx;function Px(){return(Px=e((()=>{W(),px(),Sx(),V(),fi(),or(),Yr(),Kf(),Ax(),Mx=class{#e;#t;#n;constructor(e,t){this.open=()=>{let e=this.#t.commandPalette,t=Cx(dx);if(e){this.loading.handoff(()=>{if(this.loading.active){let t=this.loading.captureHandoff();e.openPalette(()=>(this.synchronizeScope(),t()))}else e.openPalette();this.#n.clear(t)});return}this.synchronizeScope(),this.loading.begin(),this.#n.request(this.#t.commandPaletteElement,t,this.open)},this.#t=e,this.#n=t,this.loading=new Nx(e)}closePending(){this.#n.cancel(),this.#t.lazyCustomElements.abandon(),this.#t.requestUpdate()}synchronizeScope(){let e=this.#t.context?.gateway,t=e?Uf(e):void 0;this.#e&&this.#e!==t&&(this.loading.active||this.#n.pending())&&this.closePending(),this.#e=t}toggle(){this.loading.active||this.#t.lazyCustomElements.visibleState?.element===this.#t.commandPaletteElement?this.closePending():this.#t.commandPalette?this.#t.commandPalette.togglePalette():this.open()}handleSlashCommand(e){let t=this.#t,n=t.commandPaletteTarget?.owner.isConnected?t.commandPaletteTarget.onSlashCommand:null;if(n){n(e);return}let r=t.chatNavigationOptions(`chat`),i=new URLSearchParams(r?.search??``);i.set(`draft`,e.endsWith(` `)?e:`${e} `),t.navigate(`chat`,{...r,search:`?${i.toString()}`})}handlePendingShortcut(e){return e.defaultPrevented||e.isComposing||e.keyCode===229||!this.loading.active||!ox(e)?!1:(e.preventDefault(),this.toggle(),!0)}},Nx=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;constructor(e){this.submitRequested=!1,this.#t=[],this.#a=!1,this.#c=!1,this.#l=0,this.captureInput=(e,t)=>{if(!this.active||!this.#r)return;let n=this.#r;if(!this.#a&&!t?.isComposing&&t?.inputType===`insertText`&&t.data?.includes(`@`))this.#n=n.selectionStart-t.data.length+t.data.lastIndexOf(`@`);else if(this.#n!==void 0){let e=this.#n+1;(t?.inputType===`insertFromPaste`||t?.inputType===`insertFromDrop`||this.#e?.value.slice(0,e)!==n.value.slice(0,e))&&(this.#n=void 0)}this.#e=this.#d(),this.#u.requestUpdate()},this.inputRef=e=>{if(!(e instanceof HTMLTextAreaElement)){this.active&&this.#r&&(this.#e=this.#d()),this.#r=void 0;return}if(!this.active)return;this.#r=e;let t=this.#e;e.closest(`openclaw-modal-dialog`)?.setReturnFocusTarget(this.#i??null),t&&!this.#a&&e.setSelectionRange(t.selectionStart,t.selectionEnd,t.selectionDirection)},this.handleCompositionStart=()=>{this.active&&(this.#a=!0,this.#n=void 0,this.#s!==void 0&&(cancelAnimationFrame(this.#s),this.#s=void 0))},this.handleCompositionEnd=()=>{this.active&&(this.#a=!1,this.#s!==void 0&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=void 0;let e=this.#o;this.#o=void 0,e?.()}))},this.handlePaste=e=>{if(!this.active||this.submitRequested)return;let t=Array.from(e.clipboardData?.items??[],e=>e.getAsFile()).filter(e=>e?.type.startsWith(`image/`)===!0);if(t.length){if(e.preventDefault(),!Ya(this.#u.context?.config)){gr({message:Wi()});return}this.#t.push(...t)}},this.handleKeydown=e=>{if(this.#a||e.isComposing||e.keyCode===229){e.stopPropagation();return}e.key===`Enter`&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),e.stopPropagation(),!e.repeat&&(this.value.trim()||this.#t.length>0)&&oa(kr.modifiedEnter,e)&&(this.submitRequested=!0,this.#u.requestUpdate()))},this.#u=e}get active(){return this.#i!==void 0}get waitingForComposition(){return this.#c}begin(){this.active||(this.#i=document.activeElement instanceof HTMLElement?document.activeElement:null)}get value(){return this.#e?.value??``}#d(){let e=this.#r;return e?{value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd,selectionDirection:e.selectionDirection}:this.#e}handoff(e){this.#a||this.#s!==void 0?(this.#c=!0,this.#o=e):e()}captureHandoff(){let e=this.#l;return()=>e===this.#l?this.#f():void 0}#f(){if(!this.active)return;let e=this.#d()??{value:``,selectionStart:0,selectionEnd:0,selectionDirection:`none`},t=this.#i,n=this.submitRequested,r=this.#t,i=this.#n;return this.#r?.closest(`openclaw-modal-dialog`)?.setReturnFocusTarget(null),this.clear(),this.#u.requestUpdate(),{...e,returnFocus:t,...n?{submitRequested:!0}:{},...r.length?{imageFiles:r}:{},...i===void 0?{}:{mentionTrigger:i}}}clear(){this.submitRequested=!1,this.#l+=1,this.#c=!1,this.#s!==void 0&&(cancelAnimationFrame(this.#s),this.#s=void 0),this.#o=void 0,this.#a=!1,this.#r=void 0,this.#e=void 0,this.#t=[],this.#n=void 0,this.#i=void 0}}})))()}function Fx(e,t){let n=e.context;return e.onboardingMode||t===`shortcut`&&(document.openClawModalLayers?.size||document.querySelector(`.shell-nav[aria-modal='true']`))?!1:n?Ri(n.gateway.snapshot,{method:`sessions.create`,params:{},sessionScope:!0}).allowed?(e.openNewSession(n.agentSelection.state.selectedId??``),t===`shortcut`&&e.querySelector(`openclaw-new-session-page`)?.focusComposer(),!0):!1:t===`native`&&(e.pendingNativeNewSession=!0,!0)}function Ix(){return(Ix=e((()=>{Pt()})))()}var Lx;function Rx(){return(Rx=e((()=>{fd(),Lx=cd({storageKey:`openclaw.desktopPanel`,minHeight:240,minWidth:380,defaultDock:`right`,supportedDocks:[`bottom`,`right`],defaultHeight:420,defaultWidth:560})})))()}function zx(e,t){return`${e}:${t?Gi(t):``}`}function Bx(e){return e instanceof CustomEvent&&typeof e.detail?.sessionKey==`string`?e.detail.sessionKey:void 0}function Vx(e,t){let n=Date.now();for(let[e,t]of Gx){let r=t.filter(e=>n-e.createdAt<=Wx);r.length?Gx.set(e,r):Gx.delete(e)}let r=zx(e,Bx(t)),i=t instanceof CustomEvent&&t.detail?.open===!1,a=e===`link-reader`&&!i?Gx.get(r)??[]:[];a.push({event:t,createdAt:n}),Gx.set(r,a)}function Hx(e,t){let n=zx(e,Bx(t)),r=Gx.get(n)?.filter(e=>e.event!==t);r?.length?Gx.set(n,r):Gx.delete(n)}function Ux(e,t){let n=zx(e,t),r=Gx.has(n)?n:zx(e),i=Gx.get(r)?.filter(e=>Date.now()-e.createdAt<=Wx)??[],a=i.shift();return i.length?Gx.set(r,i):Gx.delete(r),a?.event??null}var Wx,Gx;function Kx(){return(Kx=e((()=>{na(),Wx=1e4,Gx=new Map})))()}var qx;function Jx(){return(Jx=e((()=>{Gc(),Y(),Rx(),fd(),Tf(),Id(),Kx(),Qi(),xu(),Ax(),kv(),Qs(),Cb(),qx=class{constructor(e,t){this.host=e,this.requestLazyElement=t,this.restoredPanels=new Set,this.handleDeferredTerminalToggle=e=>this.handleDeferredToggle(`terminal`,e),this.handleDeferredBrowserToggle=e=>this.handleDeferredToggle(`browser`,e),this.handleDeferredLinkReaderToggle=e=>{let t=this.host,n=t.context?.gateway.snapshot,r=e instanceof CustomEvent?e.detail:null;if(!n||Cc(t.routeState.routeId)||Ys())return;let i=Ev(n);if(r?.open===!1||i.length&&(r?.url===void 0||_f(r.url,i))){if(this.isSessionRoute()){Vx(`link-reader`,e),e.preventDefault();return}Zl(t.linkReaderPanelElement)||(e.preventDefault(),this.requestLazyElement(t.linkReaderPanelElement,Cx(Pd,e)))}},this.handleDeferredDesktopToggle=e=>{let t=this.host;if(t.routeState.routeId===`systems`)return;if(this.isSessionRoute()){Vx(`desktop`,e);return}let n=t.context;if(!n||!bb(n.gateway.snapshot)){e.preventDefault(),e.stopImmediatePropagation();return}Zl(t.desktopPanelElement)||this.requestLazyElement(t.desktopPanelElement,Cx(Od,e))}}reset(){this.restoredPanels.clear()}restore(){let e=this.host,t=e.context,n=t?.gateway?.snapshot;if(!n)return;let r=bb(n),i=ss(e.routeState.routeId),a=Oi(n,t.config.current.terminalEnabled??!1),o=!i&&yb(n);for(let[t,n,s]of[[e.terminalPanelElement,ld,a],[e.browserPanelElement,ud,o],[e.desktopPanelElement,Lx,!i&&e.routeState.routeId!==`systems`&&r]]){if(!s)continue;let r=!this.restoredPanels.has(t)&&n.load().open;this.restoredPanels.add(t),r&&e.lazyCustomElements.preload(t,{reportError:!0})}}isSessionRoute(){return ss(hs(globalThis.location?.pathname??``,this.host.context?.basePath??``)??this.host.routeState.routeId)}handleDeferredToggle(e,t){let n=this.host;if(this.isSessionRoute()){Vx(e,t);return}let r=e===`terminal`?n.terminalPanelElement:n.browserPanelElement;if(Zl(r))return;let i=n.context,a=i?.gateway?.snapshot;if(!a||!(e===`terminal`?Oi(a,i.config.current.terminalEnabled??!1):yb(a))){t.preventDefault();return}this.requestLazyElement(r,Cx(e===`terminal`?Td:Dd,t))}}})))()}function Yx(){return qs()?`(max-width: ${tS}px)`:`(max-width: ${eS}px), (max-width: 932px) and (max-height: 500px) and (orientation: landscape)`}function Xx(){return globalThis.matchMedia?.(Yx()).matches??!1}function Zx(){return nS.some(e=>document.documentElement.classList.contains(e))}function Qx(e){return e.mobileNavLayout&&ss(e.routeId)&&!e.onboarding&&!Zx()}function $x(e,t){return Qx({mobileNavLayout:e,routeId:`chat`,onboarding:t})}var eS,tS,nS;function rS(){return(rS=e((()=>{Y(),Qs(),eS=900,tS=600,nS=[`openclaw-native-macos`,`openclaw-native-nav`,`openclaw-native-web-chrome`]})))()}var iS;function aS(){return(aS=e((()=>{a(),iS=class{constructor(e,t){this.host=e,this.requestOpen=t,this.pending=!1}load(){this.owner||this.pending||(this.pending=!0,z(async()=>{let{NavDrawerSwipeOwner:e}=await import(`./nav-drawer-swipe.runtime-BlSGP3CY.js`);return{NavDrawerSwipeOwner:e}},__vite__mapDeps([123]),import.meta.url).then(({NavDrawerSwipeOwner:e})=>{this.owner=new e(this.host,this.requestOpen),this.pending=!1,this.host.isConnected&&this.owner.connect()},()=>this.pending=!1))}connect(){this.owner?.connect()}disconnect(){this.owner?.disconnect()}opened(){return this.owner?.opened(),!!this.owner}closed(){this.owner?.closed()}}})))()}function oS(e){return[...e.querySelectorAll(gS)].filter(e=>e.checkVisibility())}function sS(e){let t=[...e.querySelectorAll(`openclaw-sidebar-attention:defined`)].map(e=>e.dismissPanel()).some(e=>e);return e.querySelector(`openclaw-app-sidebar:defined`)?.dismissTransientMenus()===!0||t}function cS(e,t){let n=e.querySelector(`.shell-nav`);if(!n||t.composedPath().some(e=>e instanceof Element&&e!==n&&e.matches(`dialog, [role='dialog']`)))return;let r=oS(n),i=t.shiftKey?r.at(-1):r[0],a=t.shiftKey?r[0]:r.at(-1);(!n.contains(document.activeElement)||document.activeElement===a||t.shiftKey&&document.activeElement===n)&&(t.preventDefault(),(i??n).focus({preventScroll:!0}))}function lS(e,t){t.defaultPrevented||oa(kr.escape,t)||(oa(kr.toggleSidebar,t)?(t.preventDefault(),e.closeNavDrawer({restoreFocus:!0})):t.key===`Tab`?cS(e,t):(ox(t)||Cd(t)||oa(kr.workspaceFiles,t)||oa(kr.sideChat,t))&&(t.preventDefault(),t.stopImmediatePropagation()))}function uS(e){let t=e.querySelector(`.shell-nav`),n=e.querySelector(`openclaw-toast-host`);t&&n&&n.parentElement!==t&&t.append(n)}function dS(e){let t=e.querySelector(`.shell`),n=e.querySelector(`openclaw-toast-host`);t&&n?.parentElement?.classList.contains(`shell-nav`)&&t.append(n)}function fS(e){return[...e.querySelectorAll(`.topbar-nav-toggle, .chat-pane__nav-toggle`)].find(e=>e.checkVisibility())}function pS(e){return e.onboarding||(e.mobileNavLayout?!e.navDrawerOpen:e.navCollapsed)}function mS(e){return e.navigationSurfaceHidden&&!e.mobileNavLayout&&!e.onboarding&&!e.compact}function hS(e){let t=mS(e),n=!e.compact&&e.refreshRequired;return!t&&!n?U:H`${t?H`<openclaw-sidebar-attention
          class="sidebar-attention--floating"
          .onNavigate=${e.onNavigate}
        ></openclaw-sidebar-attention>`:U}${n?H`<openclaw-sidebar-update-card
          class="sidebar-update-card--floating"
          .updateRun=${e.updateRun??null}
          .statusBanner=${e.statusBanner??null}
          .refreshRequired=${e.refreshRequired}
          .onRefresh=${e.onRefresh}
        ></openclaw-sidebar-update-card>`:U}`}var gS;function _S(){return(_S=e((()=>{W(),px(),Id(),fi(),gS=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])`})))()}var vS,yS;function bS(){return(bS=e((()=>{Gc(),Y(),px(),Id(),Vu(),Lo(),fi(),Qi(),pi(),Px(),Ix(),Jx(),xu(),Ax(),rS(),Qs(),aS(),_S(),Cb(),bg(),Yl(),yS=class{constructor(e){this.host=e,this.pendingLazyAction=wx(),this.toggleNavigationSurface=e=>{let t=this.host,n=t.context;if(!n||t.onboardingMode||Cc(t.routeState.routeId)&&!Xx())return;if(Xx()){if(this.navDrawerSwipe.load(),t.navDrawerOpen){t.closeNavDrawer({restoreFocus:!0});return}t.navDrawerTrigger=e??fS(t)??null,t.navDrawerOpen=!0,uS(t),this.navDrawerSwipe.opened()||t.updateComplete.then(()=>{t.isConnected&&t.navDrawerOpen&&t.querySelector(`.shell-nav`)?.focus({preventScroll:!0})});return}let r=t.navDrawerOpen||!(n.navigation.snapshot.navCollapsed&&!t.desktopNavigationExpanded);t.desktopNavigationExpanded=!1,r&&this.dismissSidebarTransientMenus(),t.closeNavDrawer(),n.navigation.update({navCollapsed:r}),r&&t.updateComplete.then(()=>{this.restoreFocusTo(t.querySelector(`.shell-chrome-controls__nav-toggle`))})},this.restoreFocusTo=e=>Mu(e?.isConnected&&e.checkVisibility()?e:this.host.querySelector(`.content`)),this.closeNavDrawer=(e={})=>{let t=this.host,n=t.navDrawerOpen&&e.restoreFocus;t.navDrawerOpen&&(this.dismissSidebarTransientMenus(),this.navDrawerSwipe.closed()),dS(t);let r=n?t.navDrawerTrigger:null;t.navDrawerOpen=!1,t.navDrawerTrigger=null,n&&requestAnimationFrame(()=>this.restoreFocusTo(r))},this.resizeNavigation=e=>{let t=this.host,n=t.querySelector(`.shell`),r=t.context;if(!n||!r)return;let i=Math.round(Math.min(400,Math.max(240,e*n.clientWidth)));r.navigation.update({navWidth:i})},this.handleNativeToggleSidebar=()=>this.toggleNavigationSurface(),this.handleNativeOpenSearch=()=>this.openPalette(),this.handleNativeToggleSearch=e=>{e.preventDefault(),this.togglePalette()},this.handleNativeNewSession=()=>{Fx(this.host,`native`)},this.handleNativeNavigate=e=>{let t=e.detail,n=t?.path,r=typeof n==`string`?n.slice(1):``;if(typeof n!=`string`||!n.startsWith(`/`)||n.startsWith(`//`)||/^[a-z][a-z\d+.-]*:/i.test(r))return;let i=hs(n),a=this.host.context;if(!i||!a)return;e.preventDefault();let o={pathname:`${a.basePath}${n}`},s=t?.search;typeof s==`string`&&s.startsWith(`?`)&&!s.includes(`#`)&&(o.search=s),this.host.navigate(i,o)},this.handleNativeHistoryState=e=>{let t=e.detail;typeof t?.canGoBack==`boolean`&&typeof t.canGoForward==`boolean`&&(this.host.nativeHistoryState=t)},this.handleWindowResize=()=>{let e=this.host,t=Xx(),n=t&&!e.navDrawerOpen&&this.dismissSidebarTransientMenus();t?(this.navDrawerSwipe.load(),e.desktopNavigationExpanded=!1):e.navDrawerOpen&&(e.closeNavDrawer({restoreFocus:!1}),e.desktopNavigationExpanded=e.context?.navigation.snapshot.navCollapsed??!1),e.requestUpdate(),e.updateComplete.then(()=>{Xx()&&!e.navDrawerOpen&&n&&requestAnimationFrame(()=>{this.restoreFocusTo(fS(e))})})},this.handleUnhandledFileDrag=e=>{let t=e.composedPath().some(e=>e instanceof HTMLInputElement&&e.type===`file`&&!e.disabled);e.defaultPrevented||t||!Array.from(e.dataTransfer?.types??[]).includes(`Files`)||(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))},this.dismissSidebarTransientMenus=()=>sS(this.host),this.handleDocumentKeydownBubble=e=>{let t=this.host;!e.defaultPrevented&&oa(kr.escape,e)&&(t.navDrawerOpen&&Xx()&&!document.openClawModalLayers?.size?(e.preventDefault(),t.closeNavDrawer({restoreFocus:!0})):Cc(t.routeState.routeId)&&!this.shouldIgnoreSettingsEscape(e)&&(e.preventDefault(),t.exitSettings()))},this.handleDocumentKeydown=e=>{let t=this.host;if(t.lazyCustomElements.visibleState?.element===tu&&Nr(e,this.pendingDebugOverlayMode,t.querySelector(`.debug-overlay`))){e.preventDefault(),t.lazyCustomElements.close();return}if(!this.palette.handlePendingShortcut(e)&&!document.openClawModalLayers?.size){if(t.navDrawerOpen&&Xx()){lS(t,e);return}if(!t.commandPalette&&ox(e)){e.preventDefault(),this.togglePalette();return}if(Cd(e)&&!ss(t.routeState.routeId)&&!e.defaultPrevented&&!t.onboardingMode&&!Cc(t.routeState.routeId)&&t.context&&Oi(t.context.gateway.snapshot,t.context.config.current.terminalEnabled??!1)){e.preventDefault(),window.dispatchEvent(new CustomEvent(Td));return}if(wd(e)&&xb(t.context?.gateway)){e.preventDefault(),window.dispatchEvent(new CustomEvent(Ad));return}if(!e.defaultPrevented){if(oa(kr.newSession,e)){!e.repeat&&Fx(this.host,`shortcut`)&&e.preventDefault();return}if(oa(kr.keyboardShortcuts,e)){e.preventDefault(),window.dispatchEvent(new CustomEvent(Nd));return}if(oa(kr.debugOverlay,e)){let t=e.target;if(t instanceof Element&&t.closest(`input, textarea, [contenteditable]:not([contenteditable='false'])`))return;e.preventDefault(),window.dispatchEvent(new CustomEvent(Md));return}if(oa(kr.escape,e)&&Cc(t.routeState.routeId)){if(t.navDrawerOpen){e.preventDefault(),t.closeNavDrawer({restoreFocus:!0});return}if(e.eventPhase===Event.CAPTURING_PHASE||this.shouldIgnoreSettingsEscape(e))return;e.preventDefault(),t.exitSettings();return}if(oa(kr.appearanceSettings,e)){e.preventDefault(),t.navigate(`appearance`);return}oa(kr.toggleSidebar,e)&&(e.preventDefault(),this.toggleNavigationSurface())}}},this.handleDebugOverlayRequest=e=>{let t=this.host;if(t.navDrawerOpen&&Xx()&&t.closeNavDrawer({restoreFocus:!1}),t.lazyCustomElements.visibleState?.element===tu){this.pendingDebugOverlayMode===`minimized`?this.togglePendingDebugOverlayMode():t.lazyCustomElements.close();return}let n=Cx(Md,e),r=Zl(tu)?t.querySelector(tu.tagName):null;if(r){this.clearPendingLazyAction(n),n.detail&&`mode`in n.detail?r.open(ga(n)):r.toggle();return}this.requestLazyElement(tu,n,()=>{if(this.pendingLazyAction!==n)return;let e=t.querySelector(tu.tagName);if(!e)return;let r=this.pendingDebugOverlayMode;this.clearPendingLazyAction(n),e.open(r)})},this.handleAssistantToggleBeforeMount=e=>{let t=this.host;if(t.querySelector(`openclaw-assistant-panel`))return;let n=e.type===Ad;if(n?!xb(t.context?.gateway):!Fo(t.context?.gateway.snapshot,`openclaw.chat`,`operator.admin`)){e.preventDefault();return}let r=Cx(n?Ad:jd,e);this.pendingLazyAction=r,Tx(r),t.requestUpdate()},this.handleKeyboardShortcutsRequest=e=>{let t=Cx(Nd,e);if(Zl(ru)){this.host.querySelector(ru.tagName)?.toggle(),this.clearPendingLazyAction(t);return}this.requestLazyElement(ru,t)},this.openPalette=()=>this.palette.open(),this.closePendingPalette=()=>this.palette.closePending(),this.togglePalette=()=>this.palette.toggle(),this.handleShellNavDrawerToggle=e=>{this.toggleNavigationSurface(ax(e))},this.handleApprovalsOpen=e=>{let t=this.host,n=Cx(Ox,e);if(Zl(t.execApprovalElement)){t.approvalOverlay?.show(),this.clearPendingLazyAction(n);return}this.requestLazyElement(t.execApprovalElement,n)},this.restorePendingLazyAction=()=>{let e=this.pendingLazyAction;if(!e||this.host.lazyCustomElements.visibleState||this.commandPaletteLoading.waitingForComposition)return;let t=this.shellEventElementTag(e.eventType);(!customElements.get(t)||this.host.querySelector(t))&&this.dispatchLazyShellEvent(e)&&!this.host.lazyCustomElements.visibleState&&this.clearPendingLazyAction(e)},this.handleCommandPaletteSlashCommand=e=>this.palette.handleSlashCommand(e),this.handleCommandPaletteTarget=e=>cx(this.host,e),this.nativeNavCollapsed=()=>{let e=this.host,t=Xx();return e.onboardingMode||t||Cc(e.routeState.routeId)&&!t||!e.navDrawerOpen&&!e.desktopNavigationExpanded&&(e.context?.navigation.snapshot.navCollapsed??!1)},this.palette=new Mx(e,{request:(e,t,n)=>this.requestLazyElement(e,t,n),clear:e=>this.clearPendingLazyAction(e),cancel:()=>this.cancelPendingLazyAction(),pending:()=>this.pendingLazyAction?.eventType===dx}),this.panels=new qx(e,(e,t)=>this.requestLazyElement(e,t)),this.navDrawerSwipe=new iS(e,()=>this.toggleNavigationSurface())}connect(){this.disconnect(),this.listeners=new AbortController;let e={signal:this.listeners.signal},t=this.host;t.nativeHistoryState=Xs(),t.addEventListener(ux,this.handleCommandPaletteTarget,e),document.addEventListener(`keydown`,this.handleDocumentKeydown,{capture:!0,signal:this.listeners.signal}),document.addEventListener(`keydown`,this.handleDocumentKeydownBubble,e),window.addEventListener(`dragover`,this.handleUnhandledFileDrag,e),window.addEventListener(`drop`,this.handleUnhandledFileDrag,e);for(let[t,n]of[[dx,this.palette.open],[fx,this.handleShellNavDrawerToggle],[Md,this.handleDebugOverlayRequest],[Nd,this.handleKeyboardShortcutsRequest],[`resize`,this.handleWindowResize],[Zs,this.handleNativeHistoryState],[`openclaw:native-toggle-sidebar`,this.handleNativeToggleSidebar],[`openclaw:native-open-search`,this.handleNativeOpenSearch],[`openclaw:native-toggle-search`,this.handleNativeToggleSearch],[`openclaw:native-new-session`,this.handleNativeNewSession],[`openclaw:native-navigate`,this.handleNativeNavigate],[Td,this.panels.handleDeferredTerminalToggle],[Dd,this.panels.handleDeferredBrowserToggle],[Pd,this.panels.handleDeferredLinkReaderToggle],[Od,this.panels.handleDeferredDesktopToggle],[jd,this.handleAssistantToggleBeforeMount],[Ad,this.handleAssistantToggleBeforeMount],[Ox,this.handleApprovalsOpen]])window.addEventListener(t,n,e);this.navDrawerSwipe.connect(),Xx()&&this.navDrawerSwipe.load(),vS=this.listeners,Object.assign(window,{__OPENCLAW_NATIVE_COMMANDS_READY__:!0}),window.dispatchEvent(new Event(`openclaw:native-commands-state`))}disconnect(){this.commandPaletteLoading.clear();let e=this.listeners;this.listeners?.abort(),this.listeners=void 0,this.navDrawerSwipe.disconnect(),e&&vS===e&&(vS=void 0,Object.assign(window,{__OPENCLAW_NATIVE_COMMANDS_READY__:!1}),window.dispatchEvent(new Event(`openclaw:native-commands-state`)))}get pendingDebugOverlayMode(){return ga(this.pendingLazyAction)}togglePendingDebugOverlayMode(){let e=this.pendingLazyAction;e?.eventType===`openclaw:debug-overlay-request`&&this.host.lazyCustomElements.visibleState?.element===tu&&(e.detail={mode:this.pendingDebugOverlayMode===`minimized`?`expanded`:`minimized`},Tx(e),this.host.requestUpdate())}shouldIgnoreSettingsEscape(e){let t=this.host,n=t.context?.overlays.snapshot;if(t.commandPalette?.isOpen||t.querySelector(ru.tagName)?.isOpen||n?.devicePairSetupOpen||t.approvalOverlay?.dialogOpen===!0||document.openClawModalLayers?.size)return!0;let r=e.target;return r instanceof Element&&r.closest(`input, textarea, select, wa-select[open], wa-dropdown[open], [contenteditable], dialog, [role='dialog'], [role='menu'], [role='listbox']`)!==null}get commandPaletteLoading(){return this.palette.loading}synchronizeCommandPaletteScope(){this.palette.synchronizeScope()}shellEventElementTag(e){let t=this.host;return{[dx]:t.commandPaletteElement.tagName,[Md]:tu.tagName,[Nd]:ru.tagName,[Td]:t.terminalPanelElement.tagName,[Dd]:t.browserPanelElement.tagName,[Pd]:t.linkReaderPanelElement.tagName,[Od]:t.desktopPanelElement.tagName,[jd]:`openclaw-assistant-panel`,[Ad]:`openclaw-assistant-panel`,[Ox]:t.execApprovalElement.tagName}[e]}requestLazyElement(e,t,n=()=>this.dispatchLazyShellEvent(t)){e!==this.host.commandPaletteElement&&this.commandPaletteLoading.clear(),this.pendingLazyAction=t,Tx(t),this.host.lazyCustomElements.request(e,()=>{n(),this.clearPendingLazyAction(t)})}retryPendingLazyAction(e){let t=this.pendingLazyAction;return Ll({canReload:()=>e()&&this.pendingLazyAction===t&&(!t||Tx(t))})}dispatchLazyShellEvent({eventType:e,detail:t}){return window.dispatchEvent(new CustomEvent(e,{cancelable:!0,detail:t}))}clearPendingLazyAction(e){JSON.stringify(this.pendingLazyAction)===JSON.stringify(e)&&(Ex(),this.pendingLazyAction=null)}cancelPendingLazyAction(){this.commandPaletteLoading.clear();let e=this.pendingLazyAction;e&&this.clearPendingLazyAction(e)}abandonPendingLazyActionForContext(){this.commandPaletteLoading.clear(),this.panels.reset(),this.pendingLazyAction=null,Ex(),this.host.lazyCustomElements.abandon()}preservePendingLazyActionForReload(){this.panels.reset(),this.host.lazyCustomElements.abandon()}}})))()}function xS(e){return Object.hasOwn(k,e)}function SS(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function CS(e,t,n){let r=(n,r)=>{SS(t[n],r)||(e[n]=r)};for(let e of Object.keys(n))r(e,n[e])}function wS(e){let t=I(I(I(e)?.ui)?.prefs);if(!t)return{};let n={};for(let e of jS){if(AS[e].configSync===!1)continue;let r=AS[e].extract(t[e]);r!==void 0&&(n[e]=r)}return n}function TS(e,t,n,r,i,a){let o=AS[t],s=o.local(r),c=o.reset?.(r),l=c?o.local({...r,...c}):void 0,u=e=>{let t=!SS(s,e);return{overridden:t,provenance:t||o.configSync===!1&&i===!1?`device-local`:`default`,resetValue:e,value:s}},d=I(I(I(e)?.ui)?.prefs),f=o.configSync!==!1&&d&&Object.hasOwn(d,t)?o.extract(d[t]):void 0,p=a?.[t]??void 0,m=p??f,h=p!==void 0,g=a!=null&&xS(t)?f??l:l,_=m!==void 0&&(!o.canApply||o.canApply(m,r)),v=_?m:l;if(i===null&&a!=null&&xS(t))return{...u(v),provenance:`device-local`};if(n&&t in n){if(i===!1)return{...u(v),provenance:`device-local`};let e=n[t];return e===null?{...u(g),provenance:`pending`}:{overridden:!0,provenance:`pending`,resetValue:g,value:e}}return m===void 0?u(l):_?SS(s,m)?{overridden:!0,provenance:h?`profile`:`synced`,resetValue:g,value:m}:u(m):i===!1?u(l):{overridden:!0,provenance:h?`profile`:`synced`,resetValue:g,value:s}}function ES(e,t,{appearanceReady:n,scopeChanged:r,firstSnapshot:i,shadowPrefs:a,retainedLocalKeys:o}){let s={};for(let c of jS){if(a&&c in a||o.has(c))continue;let l=xS(c),u=n||!l;Object.hasOwn(e,c)?u&&(r||i||!SS(e[c],t[c]))&&Object.assign(s,{[c]:e[c]}):!(c in e)&&AS[c].clearable&&(u&&Object.hasOwn(t,c)||r&&l)&&(s[c]=null)}return s}function DS(e,t){let n={};for(let r of jS){let i=AS[r],a=e[r];if(a!==void 0){if(a===null){let e=i.clearable?i.reset?.(t):void 0;e&&CS(n,t,e);continue}SS(a,i.local(t))||(!i.canApply||i.canApply(a,t))&&(n[r]=a)}}return Object.keys(n).length>0?n:null}var OS,kS,AS,jS;function MS(){return(MS=e((()=>{ee(),D(),Gc(),V(),bg(),sh(),OS=e=>e,kS=e=>OS({configSync:!1,extract:Xm,local:t=>Xm(t[e]),write:t=>({[e]:t}),clearable:!0,reset:()=>({[e]:void 0})}),AS={theme:OS({extract:e=>e===`custom`||wt(e)?e:void 0,local:e=>e.theme,write:e=>({theme:e??gg.theme}),clearable:!0,reset:()=>({theme:gg.theme}),canApply:(e,t)=>e!==`custom`||!!t.customTheme}),themeMode:OS({extract:r,local:e=>e.themeMode,write:e=>({themeMode:e??gg.themeMode}),clearable:!0,reset:()=>({themeMode:gg.themeMode})}),accent:OS({extract:Ch,local:e=>Ch(e.accent),write:e=>({accent:e}),clearable:!0,reset:()=>({accent:void 0})}),fontUi:kS(`fontUi`),fontChat:kS(`fontChat`),locale:OS({extract:e=>typeof e==`string`&&_o(e)?e:void 0,local:e=>e.locale,write:e=>({locale:e}),clearable:!0,reset:()=>({locale:void 0})}),chatShowThinking:OS({extract:e=>typeof e==`boolean`?e:void 0,local:e=>e.chatShowThinking}),chatShowToolCalls:OS({extract:e=>typeof e==`boolean`?e:void 0,local:e=>e.chatShowToolCalls}),chatPersistCommentary:OS({extract:e=>typeof e==`boolean`?e:void 0,local:e=>e.chatPersistCommentary!==!1}),chatSendShortcut:OS({extract:e=>e===`enter`||e===`modifier-enter`?e:void 0,local:e=>lg(e.chatSendShortcut),write:e=>({chatSendShortcut:e}),clearable:!0,reset:()=>({chatSendShortcut:void 0})}),chatFollowUpMode:OS({extract:Sh,local:e=>Sh(e.chatFollowUpMode),write:e=>({chatFollowUpMode:e}),clearable:!0,reset:()=>({chatFollowUpMode:void 0})}),sidebarEntries:OS({extract:e=>hc(e)??void 0,local:e=>e.sidebarEntries})},jS=Object.keys(AS)})))()}function NS(e,t){(t===`device-local`?RS:LS).add(e)}function PS(){LS.clear(),RS.clear(),zS.clear()}function FS(e,t){let n={};for(let r of jS){let i=zS.delete(r),a=LS.delete(r);if(RS.delete(r))continue;if(a){n[r]=null;continue}let o=AS[r],s=o.local(e),c=o.local(t);if(i||!SS(s,c)){if(c===void 0){o.clearable&&(n[r]=null);continue}n[r]=c}}return Object.keys(n).length>0?n:null}function IS(e,t={}){return e===Bh().theme?Wh({...t,theme:e}):(zS.add(`accent`),LS.add(`fontUi`),LS.add(`fontChat`),Wh({...t,theme:e,fontUi:void 0,fontChat:void 0,accent:`theme`}))}var LS,RS,zS;function BS(){return(BS=e((()=>{MS(),bg(),LS=new Set,RS=new Set,zS=new Set})))()}function VS(e,t){return t?`${e}:profile:${t}`:e}function HS(e,t){return t&&qS?.profileId===t&&qS.scope===e?qS.prefs:null}function US(e){return JS?.scope===e?JS.profileId:null}function WS(e,t){JS={scope:e,profileId:t}}function GS(){qS=null,JS=null,YS+=1}async function KS(e,t,n){WS(n,t);let r=++YS,{readProfileAppearancePrefs:i}=await z(async()=>{let{readProfileAppearancePrefs:e}=await import(`./server-prefs-profile-runtime-Bj5WHU6a.js`);return{readProfileAppearancePrefs:e}},__vite__mapDeps([124,125,28]),import.meta.url);if(r!==YS)return!1;let a=await i(e,t);return r!==YS||!a?!1:(qS={profileId:t,scope:n,prefs:a},!0)}var qS,JS,YS;function XS(){return(XS=e((()=>{a(),qS=null,JS=null,YS=0})))()}function ZS(e,t){try{let n=globalThis.localStorage;return n?{available:!0,value:n.getItem(`${e}:${t}`)}:{available:!1,value:null}}catch{return{available:!1,value:null}}}function QS(e,t){return ZS(e,t).value}function $S(e,t,n){try{let r=globalThis.localStorage;if(!r)return!1;let i=`${e}:${t}`;return n===null?r.removeItem(i):r.setItem(i,n),!0}catch{return!1}}function eC(e){let t=I(re(e??`null`));return t&&Object.keys(t).length?t:null}function tC(e,t){let n=ZS(e,t);return{available:n.available,prefs:eC(n.value)}}function nC(e){let t=eC(QS(oC,e));if(!t)return new Set;let n=Object.keys(t).filter(e=>Object.hasOwn(AS,e));return new Set(n)}function rC(e,t){$S(oC,e,t.size?JSON.stringify(Object.fromEntries([...t].map(e=>[e,!0]))):null)}var iC,aC,oC;function sC(){return(sC=e((()=>{Ie(),MS(),iC=`openclaw.control.serverPrefs.v1`,aC=`openclaw.control.serverPrefs.pending.v1`,oC=`openclaw.control.serverPrefs.retained-local.v1`})))()}function cC(e,t,n=``,r=Bh(n||void 0),i={}){let a=!i.profileId&&xS(t)&&i.canSync===null,o=i.profileId??(a?US(n):null),s=VS(n,o),c=s===Q?$:eC(QS(aC,s)),l=HS(n,o),u=o&&xS(t)&&l===null,d=u?eC(QS(`openclaw.control.serverPrefs.v1`,s))??{}:l,f=TS(e,t,c,r,i.canSync,d);return u&&f.provenance===`profile`?{...f,provenance:`synced`}:f}function lC(){HC!==null&&(clearTimeout(HC),HC=null),UC=0}function uC(e,t,n){let r=nC(e);for(let e of t)n?r.add(e):r.delete(e);rC(e,r),n&&e===WC&&(GC=null)}function dC(e,t=!1){if(!t&&e===Q)return;Q=e;let n=tC(aC,e);$=n.prefs,NC=new Set(n.available&&n.prefs?Object.keys(n.prefs):[])}function fC(e){$S(`openclaw.control.serverPrefs.pending.v1`,Q,e?JSON.stringify(e):null)?NC=new Set($?Object.keys($):[]):NC.clear()}function pC(e,t){e===Q&&gC();let n=e===Q?$:null,r={...eC(QS(aC,e)),...n};for(let e of t)delete r[e];let i=Object.keys(r).length?r:null;if(e===Q){$=i,fC(i);return}$S(aC,e,i?JSON.stringify(i):null)}function mC(){let e={...eC(QS(`openclaw.control.serverPrefs.pending.v1`,Q))??{},...$};fC(Object.keys(e).length?e:null)}function hC(e){let t={...eC(QS(aC,Q))};for(let n of Object.keys(e))SS(t[n],e[n])&&delete t[n];let n={...t,...$};fC(Object.keys(n).length?n:null)}function gC(){if(!$||NC.size===0)return;let e=tC(aC,Q);if(!e.available)return;let t=e.prefs??{};for(let e of NC){if(!Object.hasOwn(t,e)){delete $[e],NC.delete(e);continue}let n=t[e];SS($[e],n)||($[e]=n)}Object.keys($).length||($=null)}function _C(e){let t=$;return!!(t&&Object.keys(e).every(n=>Object.hasOwn(t,n)&&SS(t[n],e[n])))}function vC(){lC(),MC=zC=BC=!1,Q=``,$=PC=null,NC.clear(),FC=``,IC=null,LC=!1,WC=``,GC=null,GS(),PS()}function yC(e,t,n=Q,r){let i=AS[e],a=t=>e===`theme`&&t.theme!==void 0?IS(t.theme):Wh(t),o=VS(n,xS(e)?r??US(n):null),s=i.reset;if(!s)throw Error(`Server UI preference is not resettable: ${e}`);let c=i.write;if(t?.provenance===`device-local`){if(!c)throw Error(`Server UI preference cannot restore a retained local value: ${e}`);let r=c(t.resetValue),i=e===`theme`&&r.theme!==Bh().theme?[e,`accent`,`fontUi`,`fontChat`]:[e];pC(o,i),o!==n&&pC(n,i),uC(o,i,!1);for(let e of i)NS(e,`device-local`);return a(r)}return NS(e,`server`),a(t&&c?c(t.resetValue):s(Bh()))}function bC(e,t){let n=t.scope??``,r=VS(n,t.profileId);if(r===WC&&e===GC)return!1;let i=WC!==``&&r!==WC,a=HS(n,t.profileId),o=!t.profileId||a!==null||i,s=()=>{WC=r,GC=e},c=r===Q?$:eC(QS(aC,r)),l=nC(r),u=[...l].filter(e=>o||!xS(e)),d={...wS(e),...a},f=QS(iC,r),p=eC(f)??{};if(!o)for(let e of jS)xS(e)&&(delete d[e],Object.hasOwn(p,e)&&Object.assign(d,{[e]:p[e]}));let m=JSON.stringify(d);if(!i&&m===f)return u.length&&uC(r,u,!1),s(),!1;let h=ES(d,p,{appearanceReady:o,scopeChanged:i,firstSnapshot:f===null,shadowPrefs:c,retainedLocalKeys:l});$S(iC,r,m),u.length&&uC(r,u,!1),s(),Object.hasOwn(h,`theme`)&&t.onThemeChanged?.(h.theme??null);let g=DS(h,Bh(n||void 0));if(!g)return!1;MC=!0;try{Wh(g)}finally{MC=!1}return t.onApplied(g),!0}async function xC(e){let t=e.scope??e.client.gatewayUrl;return await KS(e.client,e.profileId,t)?(GC=null,bC(e.configObject,{...e,scope:t})):!1}function SC(){return MC}function CC(e,t){let n=t.profileId??t.profile?.selfUser?.id??null,r=e.state.client?.gatewayUrl??``;n&&WS(r,n);let i=VS(r,n);if(LC=t.canWrite??If(t.profile?.hello?.auth??null),PC===e&&FC===i&&IC===n)return;gC();let a=Q===``?{...eC(QS(aC,``)),...$}:null;lC(),VC+=1,PC=e,FC=i,IC=n,zC=!1,dC(i,!0),i&&a&&Object.keys(a).length&&($={...$,...a},mC(),$S(aC,``,null))}function wC(e){if($){for(let t of Object.keys(e))SS($[t],e[t])&&(delete $[t],NC.delete(t));Object.keys($).length||($=null)}}function TC(e,t){HC!==null||UC>=jC||(UC+=1,HC=setTimeout(()=>{HC=null,PC===e&&VC===t&&$&&DC(e)},AC))}async function EC(e,t){for(;$;){if(PC!==e||VC!==t||(gC(),!$))return;let n=jS.filter(e=>$?.[e]!==void 0&&(AS[e].configSync===!1||e===`theme`&&typeof $.theme==`string`&&$.theme.includes(`/`))&&!(IC&&LC));if(n.length){if(!e.state.connected)return;pC(Q,n),uC(Q,n,!0),RC?.({needsRefresh:!1,retainedLocal:!0});continue}if(IC&&$.theme===`custom`){pC(Q,[`theme`]),uC(Q,[`theme`],!0);continue}let r={};if(IC&&LC)for(let e of jS)xS(e)&&Object.hasOwn($,e)&&Object.assign(r,{[e]:$[e]});let i=Object.keys(r).length>0,a=i?r:{...$},o=RC;for(let n=0;n<2;n+=1){if(PC!==e||VC!==t)return;i&&e.state.client&&tv(e.state.client);let r=i?await z(async()=>{let{writeProfileAppearancePrefs:e}=await import(`./server-prefs-profile-runtime-Bj5WHU6a.js`);return{writeProfileAppearancePrefs:e}},__vite__mapDeps([124,125,28]),import.meta.url).then(({writeProfileAppearancePrefs:n})=>n(e.state.client,a,PC===e&&VC===t&&e.state.connected&&LC&&_C(a))):await e.runExternalMutation(e=>e.request(`config.patch`,{raw:JSON.stringify({ui:{prefs:a}}),...a.sidebarEntries===void 0?{}:{replacePaths:[`ui.prefs.sidebarEntries`]},note:`control-ui prefs sync`}),{waitForWritesResumed:!0,configWriteAck:e=>e,canDispatch:()=>e.canPatch!==!1&&(gC(),_C(a)?!0:(BC=!!$,!1)),dispatchError:`Access changed before preferences could sync.`});if(PC!==e||VC!==t)return;if(r.ok){wC(a);let n={...eC(QS(`openclaw.control.serverPrefs.v1`,Q))??{},...a},s=HS(e.state.client?.gatewayUrl??``,IC);if(i&&s){let t=wS(e.state.configSnapshot?.config);for(let e of jS)Object.hasOwn(a,e)&&(a[e]===null?(delete s[e],t[e]===void 0?delete n[e]:Object.assign(n,{[e]:t[e]})):Object.assign(s,{[e]:a[e]}));GC=null}if($S(iC,Q,JSON.stringify(n)),hC(a),lC(),PC!==e||VC!==t||(r.refresh.ok&&o&&WC===Q&&(GC=null),o?.({needsRefresh:!r.refresh.ok}),PC!==e||VC!==t))return;break}if(r.reason===`conflict`&&n===0){await new Promise(e=>{setTimeout(e,250)});continue}if(r.reason===`conflict`){TC(e,t);return}if(r.reason===`error`||r.reason===`unavailable`||r.reason===`suspended`)return;wC(a),hC(a),o?.({needsRefresh:!1,retainedLocal:!0});return}}}function DC(e){if(zC){BC=!0;return}if(!$||e.state.connected&&e.canPatch===!1&&!(IC&&LC&&Object.keys($).some(xS)))return;zC=!0;let t=VC;EC(e,t).catch(()=>void 0).finally(()=>{PC===e&&VC===t&&(zC=!1,BC&&(BC=!1,DC(e)))})}function OC(e,t,n={}){CC(e,n),lC(),RC=n.afterCommit;let r=jS.filter(e=>Object.hasOwn(t,e)),i=e.state.connected?r.filter(n=>AS[n].configSync===!1&&!IC?!0:IC&&xS(n)?!LC||n===`theme`&&t.theme===`custom`:e.canPatch===!1):[];if(i.length&&(pC(Q,i),uC(Q,i,!0),n.afterCommit?.({needsRefresh:!1,retainedLocal:!0}),i.length===r.length))return;let a=i.length?Object.fromEntries(Object.entries(t).filter(([e])=>!i.some(t=>t===e))):t;gC(),$={...$,...a},mC(),DC(e)}function kC(e,t={}){CC(e,t),lC(),VC+=1,zC=BC=!1,RC=t.afterCommit,DC(e)}var AC,jC,MC,Q,$,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC;function KC(){return(KC=e((()=>{Hf(),BS(),XS(),MS(),sC(),bg(),iv(),a(),AC=1e3,jC=5,MC=!1,Q=``,$=null,NC=new Set,PC=null,FC=``,IC=null,LC=!1,zC=!1,BC=!1,VC=0,HC=null,UC=0,WC=``,GC=null})))()}function qC(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=[];for(let t of e){let e=n.get(t.id);e?JSON.stringify(e)!==JSON.stringify(t)&&(r.push(t.id),i.push(t.id)):r.push(t.id)}return{invalidatedIds:r,changedIds:i}}var JC,YC;function XC(){return(XC=e((()=>{Y(),Id(),Kx(),V(),Qa(),Na(),ro(),na(),Hf(),KC(),iv(),JC=100,YC=class{constructor(e){this.host=e,this.runtimeConfigProfileId=null,this.profileAppearanceSource=null}observeSessions(e,t){let n=!0,r=()=>{n&&this.host.context?.sessions===e&&(this.host.observeDeletedSessions(e.state),this.host.recoverDeletedActiveSession(e.state),t())};r();let i=e.subscribe(r);return()=>{n=!1,i()}}reconcileServerUiPrefs(e){let t=e.state.configSnapshot,n=this.host.context;if(!t?.config||!n||n.runtimeConfig!==e||n.gateway.snapshot.phase!==`connected`)return;let r=n.gateway.connection.gatewayUrl;bC(t.config,{scope:r,profileId:n.gateway.snapshot?.selfUser?.id,onThemeChanged:e=>n.theme.recordServerSelection(e,r),onApplied:()=>n.theme.refresh()}),this.refreshProfileAppearancePrefs(n).catch(()=>void 0);let i=cC(t.config,`locale`,r),a=JSON.stringify([r,i.overridden,i.value]);if(a!==this.host.lastLocalePrefSignature){if(this.host.lastLocalePrefSignature=a,i.overridden&&_o(i.value)){xa.setLocale(i.value);return}xa.useSystemLocale()}}reconcileCommittedServerUiPrefs(e,t,n=!1){if(this.host.context?.runtimeConfig===e){if(t){e.refresh();return}this.reconcileServerUiPrefs(e),n&&this.host.context?.theme.refresh()}}handleGatewayEvent(e){let t=this.host.context,n=t?.gateway?.snapshot.client;n&&e.event===`sessions.changed`&&si(n,e.payload,{hello:t?.gateway.snapshot.hello,agentsList:t?.agents.state.agentsList});let r=Ht(e);if(n&&Wr(e)&&Fi(n),n&&(r||e.event===`chat.metadata.changed`)&&vi(n,void 0,void 0,r??`preserve`),e.event===`sessions.changed`){let e=this.host.context;e&&this.host.recoverDeletedActiveSession(e.sessions.state);return}if(e.event===`config.changed`){this.host.context?.config.refresh();let e=this.host.context?.runtimeConfig;e&&!e.state.configFormDirty&&e.refresh({background:!0}),this.scheduleAgentRosterRefresh();return}if(e.event===`users.prefs.changed`){let e=this.host.context,t=e?.gateway.snapshot.selfUser?.id;e&&t&&(e.gateway.snapshot.client&&tv(e.gateway.snapshot.client),this.refreshProfileAppearancePrefs(e,!0).catch(()=>void 0));return}if(e.event!==`ui.command`||!e.payload)return;let i=this.host.context;if(!i)return;let a=e.payload,{command:o}=a;if(o){if(o.kind===`sidebar`){this.host.desktopNavigationExpanded=!1,i.navigation.update({navCollapsed:!o.visible});return}if(o.kind===`panel`){let e=a.sessionKey??(o.panel===`portal`?this.host.activeSessionKey:void 0);e&&(!Or(e,this.host.activeSessionKey)||!ss(this.host.routeState.routeId))&&this.host.selectChatSession(e,a.agentId);let t=new CustomEvent({terminal:Td,browser:Dd,desktop:Od,portal:kd}[o.panel],{detail:{open:o.open,...e?{sessionKey:e}:{},...o.dock?{dock:o.dock}:{},...o.panel===`terminal`&&o.terminalSessionId?{terminalSessionId:o.terminalSessionId}:{},...`environmentId`in o&&o.environmentId?{environmentId:o.environmentId}:{},...`portalId`in o&&o.portalId?{portalId:o.portalId}:{}}});e&&Vx(o.panel,t),window.dispatchEvent(t);return}window.dispatchEvent(new CustomEvent(`openclaw:ui-command`,{detail:a,cancelable:!0}))&&(o.kind===`navigate`||o.kind===`split`)&&this.host.selectChatSession(o.sessionKey,a.agentId)}}scheduleAgentRosterRefresh(){this.host.agentRosterRefreshTimer!==null&&globalThis.clearTimeout(this.host.agentRosterRefreshTimer),this.host.agentRosterRefreshTimer=globalThis.setTimeout(()=>{this.host.agentRosterRefreshTimer=null,this.refreshAgentRoster()},JC)}async refreshAgentRoster(){let e=this.host.context;if(!e)return;let t=e.agents.state.agentsList,n=e.agentSelection.state.selectedId,r=await e.agents.refreshList();if(!r||this.host.context!==e)return;let i=qC(t?.agents??[],r.agents);i.invalidatedIds.length>0&&(e.agents.invalidateFiles(i.invalidatedIds),e.agentIdentity.invalidate(i.invalidatedIds)),i.changedIds.length>0&&e.agentIdentity.ensure(i.changedIds);let a=new Set(r.agents.map(e=>e.id));n&&e.agentSelection.state.selectedId===n&&r.agents.length>0&&!a.has(n)&&e.agentSelection.set(r.defaultId,{background:!0})}synchronizeGateway(e){let t=this.host.previousGatewayPhase;this.host.previousGatewayPhase=e.phase,this.updateGatewaySessionKey(e);let n=this.host.context;if(n&&this.host.recoverDeletedActiveSession(n.sessions.state),e.phase===`connected`&&n){let t=n.connectionBootstrap;t.run(`runtime-config`,async()=>(await this.ensureRuntimeConfig(e,n.runtimeConfig),this.refreshProfileAppearancePrefs(n))),this.host.routeState.routeId&&(!n.agents.state.agentsList||n.agents.state.agentsListCached)&&t.run(`agents`,()=>this.ensureAgentsList(e,n.agents)),t.run(`outbox`,()=>this.host.outboxStoreImport.load())}t!==`connected`&&e.phase===`connected`&&xa.retryPendingLocale()}ensureRuntimeConfig(e,t=this.host.context?.runtimeConfig){if(e.phase!==`connected`||!e.client||!t)return this.host.runtimeConfigClient=null,this.runtimeConfigProfileId=null,this.profileAppearanceSource=null,Promise.resolve();let n=e.selfUser?.id??null;return this.host.runtimeConfigClient===e.client&&this.host.runtimeConfigSource===t&&this.runtimeConfigProfileId===n?Promise.resolve():(this.host.runtimeConfigClient=e.client,this.host.runtimeConfigSource=t,this.runtimeConfigProfileId=n,kC(t,{profileId:n,canWrite:If(e.hello?.auth??null),afterCommit:({needsRefresh:e,retainedLocal:n})=>this.reconcileCommittedServerUiPrefs(t,e,n)}),t.ensureLoaded())}ensureAgentsList(e,t=this.host.context?.agents){if(e.phase!==`connected`||!e.client)return this.host.agentsListClient=null,Promise.resolve();let n=this.host.routeState.routeId;return!t||!n||t.state.agentsList&&!t.state.agentsListCached||this.host.agentsListClient===e.client&&this.host.agentsListSource===t?Promise.resolve():(this.host.agentsListClient=e.client,this.host.agentsListSource=t,t.ensureList().then(()=>void 0))}updateGatewaySessionKey(e){let t=e.sessionKey.trim();(e.client!==this.host.sessionKeyClient||t!==this.host.activeSessionKey)&&(this.host.sessionKeyClient=e.client,t&&(this.host.activeSessionKey=t))}refreshProfileAppearancePrefs(e,t=!1){let n=e.gateway.snapshot,r=n?.selfUser?.id;if(!r)return Promise.resolve();let i=n.client,a=e.runtimeConfig.state.configSnapshot?.config;if(n.phase!==`connected`||!i||!a)return Promise.resolve();let o=this.profileAppearanceSource;if(!t&&o?.client===i&&o.profileId===r)return Promise.resolve();let s={client:i,profileId:r};this.profileAppearanceSource=s;let c=e.gateway.connection.gatewayUrl,l=()=>this.host.context===e&&e.gateway.snapshot.client===i&&e.gateway.snapshot.selfUser?.id===r&&this.profileAppearanceSource===s;return xC({client:i,profileId:r,configObject:a,scope:c,onApplied:()=>{l()&&e.theme.refresh()},onThemeChanged:t=>{l()&&e.theme.recordServerSelection(t,c)}}).then(t=>{!t&&l()&&e.theme.refresh()}).catch(e=>{l()&&console.error(`[gateway] profile appearance preference refresh failed:`,e)})}reset(){this.host.agentsListClient=null,this.host.agentsListSource=null,this.host.sessionKeyClient=null,this.host.runtimeConfigClient=null,this.host.runtimeConfigSource=null,this.runtimeConfigProfileId=null,this.profileAppearanceSource=null,this.host.previousGatewayPhase=null,this.host.agentRosterRefreshTimer!==null&&(globalThis.clearTimeout(this.host.agentRosterRefreshTimer),this.host.agentRosterRefreshTimer=null),vC()}dispose(){this.host.lastLocalePrefSignature=null,this.reset()}}})))()}function ZC(e,t){let n=e.placementStartup.get(t);return n?.initialTurn&&(n.phase===`cancelled`||e.sessions.deletionState(t)===`confirmed`)?n:null}function QC(){return(QC=e((()=>{})))()}function $C(e,t=qs()){let n=t?e??$n():null;if(!n)return null;try{let e=n.getItem(rw);if(e===null)return null;let t=JSON.parse(e);if(typeof t.routeId==`string`&&Wo(t.routeId)&&typeof t.pathname==`string`&&typeof t.search==`string`)return{routeId:t.routeId,pathname:t.pathname,search:t.search};n.removeItem(rw)}catch{try{n.removeItem(rw)}catch{}}return null}function ew(e){let t=new URLSearchParams(e);t.delete(`draft`);let n=t.toString();return n?`?${n}`:``}function tw(e,t,n,r,i=qs()){let a=i?r??$n():null;if(a)try{a.setItem(rw,JSON.stringify({routeId:e,pathname:t,search:ew(n)}))}catch{}}function nw(e,t,n,r,i=qs()){if(!i||e!==`chat`||!t.endsWith(`/chat`)||n!==``)return null;let a=$C(r,i);return!a||a.routeId===e&&a.pathname===t&&a.search===n?null:a}var rw;function iw(){return(iw=e((()=>{lp(),Qs(),rw=`openclaw.native.lastRoute`})))()}var aw;function ow(){return(ow=e((()=>{Gc(),Y(),lp(),Ti(),na(),ed(),iw(),aw=class{constructor(e){this.host=e,this.navigate=(e,t)=>{let n=this.host.context;n&&Wo(e)&&(this.host.closeNavDrawer({restoreFocus:!0}),n.navigate(e,ss(e)?this.chatNavigationOptions(e,t):t))}}selectChatSession(e,t){let n=this.host.context;if(!n)return;Qu({selection:n.agentSelection,gateway:n.gateway,sessionKey:e,agentId:t});let r=Kr(n,e,t);this.navigate(r,co({context:n,face:r,sessionKey:e,...t?{agentId:t}:{},preferenceDerivedFace:!0}).options)}chatNavigationOptions(e,t){let n=this.host.activeSessionKey.trim(),r=this.host.context;return t??(n&&r?co({context:r,face:e,sessionKey:n}).options:void 0)}recoverNotFoundRoute(){let e=this.host.context,t=this.host.routeState.location??window.location;if(e&&Bo(t.pathname,e.basePath)){if(e.gateway.snapshot.phase!==`connected`)return!1;if(Vo(t.pathname,e.basePath))return e.replace(`plugin`,{pathname:t.pathname,search:t.search,hash:t.hash}),!0}return this.replaceChatWithCurrentSession()}replaceChatWithCurrentSession(){let e=this.host.context,t=this.host.activeSessionKey.trim();if(!e)return!0;if(!ri(t)&&e.gateway.snapshot.phase!==`connected`)return!1;let n=this.host.routeState.routeId===`dashboard`?`dashboard`:`chat`;if(n===`chat`&&ZC(e,t))return!0;let r=e.sessions.deletionState(t),i=Yi(e,t),a=this.host.routeState.location?.pathname,o=!a||a===co({context:e,face:n,sessionKey:t}).options.pathname,s=ri(t)?.agentId,c=e.agents.state.agentsList?.agents,l=s&&(!c||c.some(e=>M(e.id)===s))?s:eo(e),d=!r&&(i?.key||!o)?t:u({agentId:l,mainKey:Ei({agentsList:e.agents.state.agentsList,hello:e.gateway.snapshot.hello})});return r&&d===t?!0:(d!==t&&(this.host.activeSessionKey=d,Qu({selection:e.agentSelection,gateway:e.gateway,sessionKey:d})),e.replace(n,co({context:e,face:n,sessionKey:d}).options),!0)}recoverDeletedActiveSession(e){let t=this.host.context,n=this.host.routeState.routeId,r=this.host.activeSessionKey.trim();t&&n&&ss(n)&&r&&t.sessions.deletionState(r)&&this.replaceChatWithCurrentSession()}updateRouteState(e){this.host.routeState=e,e.routeId!==void 0&&(this.host.lastConcreteRouteId===`custodian`&&e.routeId!==`custodian`&&(this.host.custodianMinimizeRequestId+=1),this.host.lastConcreteRouteId=e.routeId);let t=e.committedRouteId,n=e.committedLocation?.pathname??``,r=e.committedLocation?.search??``,i=this.host.context;if(t&&i){let a=i.chatSubmissions.creation||e.routeId!==t||(e.location?.pathname??``)!==n||(e.location?.search??``)!==r;if(!this.host.didConsiderNativeRouteRestore){this.host.didConsiderNativeRouteRestore=!0;let e=a?null:nw(t,n,r);if(e){i.replace(e.routeId,{pathname:e.pathname,search:e.search});return}}if(!a){let a=e.committedSessionKey;if(a!==void 0&&i.sessions.deletionState(a)){if(t===`chat`&&ZC(i,a))return;this.replaceChatWithCurrentSession();return}tw(t,n,r),a&&(this.host.activeSessionKey=a,Qu({selection:i.agentSelection,gateway:i.gateway,sessionKey:a,background:!0}))}}let a=this.host.context;a&&this.host.ensureAgentsList(a.gateway.snapshot),e.routeId&&!Sc(e.routeId)&&(this.host.settingsSearchQuery=``,this.host.lastWorkspaceLocation={routeId:e.routeId,pathname:e.location?.pathname??``,search:e.location?.search??``,hash:e.location?.hash??``})}newSessionRouteAgentId(){return this.host.routeState.routeId===`new-session`?new URLSearchParams(this.host.routeState.location?.search??``).get(`agent`)?.trim()??``:``}openNewSession(e,t){this.navigate(`new-session`,{search:yn(e,t)})}exitSettings(){let e=this.host.lastWorkspaceLocation;if(e){let{routeId:t,...n}=e;this.navigate(t,n);return}this.navigate(`chat`)}}})))()}function sw(e){return t=>{let n=()=>{let n=e.overlays.snapshot,r=n.updateStatusBanner;t({run:n.updateRun,busy:n.updateRunning||n.updateReconciliationPending,connected:e.gateway.snapshot.phase===`connected`,failure:r&&r.tone!==`info`&&r.source!==`read`?r.text:null,readError:n.updateStatusCheckBanner?.text??(r?.source===`read`?r.text:null)})},r=e.overlays.subscribe(n),i=e.gateway.subscribe(n);return n(),()=>{r(),i()}}}async function cw(e){let{confirmAndStartUpdateRuntime:t}=await z(async()=>{let{confirmAndStartUpdateRuntime:e}=await import(`./update-confirmation.runtime-BcC65xAB.js`);return{confirmAndStartUpdateRuntime:e}},__vite__mapDeps([126,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,114,127,128,28,29,30,31,32,129]),import.meta.url);await t(e)}function lw(){return(lw=e((()=>{a()})))()}function uw(e){return{outboxAttentionCountForSession:t=>e.storedOutboxes?.attentionCountForSession(t)??0,hasSessionDraft:t=>e.storedOutboxes?.hasSessionDraft(t)??!1,retryGateway:()=>e.context?.gateway.connect(),toggleSidebar:()=>e.toggleNavigationSurface(),updateSidebarEntries:t=>e.context?.navigation.update({sidebarEntries:t}),openDevicePairSetup:()=>void e.context?.overlays.openDevicePairSetup(),preloadRoute:t=>Wo(t)?e.context?.preload(t)??Promise.resolve():Promise.resolve(),requestOpenNewSession:(t,n)=>{let r=e.context;r&&Ri(r.gateway.snapshot,{method:`sessions.create`,params:{},sessionScope:!0}).allowed&&e.openNewSession(t,n)},watchUpdateProgress:t=>{let n=e.context;return n?sw(n)(t):()=>void 0}}}function dw(){return(dw=e((()=>{lp(),Pt(),lw()})))()}function fw(e){return e===`reconnecting`||e===`offline`}function pw(e){let{kind:t}=e;if(!t)return U;let n=t?B(`connection.${t}`):null,r=H`
    ${t?H`<span class="gateway-status__state"><span class="gateway-status__icon" aria-hidden="true">${t===`suspending`||t===`suspended`?pl.pause:t===`offline`?pl.alertTriangle:pl.refresh}</span><span class="gateway-status__label">${n}</span></span>`:U}
  `,i=`gateway-status${t?` gateway-status--${t}`:``}`,a=e.onRetry&&fw(t)?H`<button
        type="button"
        class=${i}
        aria-label=${[n,B(`connection.retryNow`)].filter(Boolean).join(` — `)}
        @click=${e.onRetry}
      >
        ${r}
      </button>`:H`<span class=${i}>${r}</span>`;return H`<openclaw-tooltip
    class="gateway-status-tooltip"
    .content=${e.lastError&&fw(t)?qn(e.lastError):``}
    ><span
      role=${e.announce===!1?U:`status`}
      aria-live=${e.announce===!1?U:`polite`}
      >${a}</span
    ></openclaw-tooltip
  >`}function mw(){return(mw=e((()=>{W(),V(),_n(),ml()})))()}function hw(e){let t=!!e.disabledReason,n=`${J(`new-session`,e.basePath)}${yn(e.agentId,e.target)}`,r=e.showShortcut?`${e.label} (${Bn(kr.newSession)})`:e.label;return H`<openclaw-tooltip
    .content=${e.disabledReason??r}
    .contentTemplate=${e.disabledReason==null&&e.showShortcut?yl(e.label,kr.newSession):void 0}
  >
    <a
      class=${e.className}
      role="link"
      href=${t?U:n}
      aria-label=${e.label}
      aria-disabled=${t?`true`:U}
      tabindex=${t?`-1`:U}
      @contextmenu=${e=>{e.stopPropagation()}}
      @click=${n=>{if(t){n.preventDefault();return}Jr(n)&&(n.preventDefault(),e.onOpen?.(e.agentId,e.target))}}
    >
      ${pl.plus}
    </a>
  </openclaw-tooltip>`}function gw(){return(gw=e((()=>{W(),Y(),fi(),ml(),xl(),Vu()})))()}function _w(e,t){let n=e.settingsSidebarRenderer;if(n)return n(t);let r=e.settingsSidebarLoadFailed;return r||e.loadSettingsSidebarRenderer(),t.presentation===`embed-list`||t.presentation===`embed-page`?H`<section
      class=${t.presentation===`embed-list`?`settings-embed-list`:`native-embed-header`}
      aria-busy=${r?`false`:`true`}
    >
      ${t.presentation===`embed-page`?H`<button class="native-embed-header__back btn btn--ghost" type="button" @click=${t.onExit}>${B(`common.back`)}</button>`:U}
      <h1 class="page-title">
        ${t.presentation===`embed-list`?B(`nav.settings`):Oc(t.activeRouteId)}
      </h1>
      <p role=${r?`alert`:`status`}>
        ${B(r?`nav.settingsLoadFailed`:`common.loading`)}
      </p>
      ${r?H`<button class="btn" @click=${()=>e.retrySettingsSidebarRenderer()}>${B(`common.retry`)}</button>`:U}
    </section>`:H`<aside class="settings-sidebar" aria-busy=${r?U:`true`}>
    <header class="settings-sidebar__header" @mousedown=${Xc}>
      <button type="button" class="settings-sidebar__back" @click=${t.onExit}>
        <span class="settings-sidebar__back-icon" aria-hidden="true">${pl.arrowLeft}</span>
        ${B(`nav.exitSettings`)}
      </button>
      <h1 class="settings-sidebar__title">${B(`nav.settings`)}</h1>
    </header>
    ${r?H`<div class="settings-sidebar__empty" role="alert">
            ${B(`nav.settingsLoadFailed`)}
            <button
              class="btn btn--sm"
              type="button"
              @click=${()=>e.retrySettingsSidebarRenderer()}
            >
              ${B(`common.retry`)}
            </button>
          </div>`:vw(t)}
  </aside>`}function vw(e){let t=xc(!!e.canAdmin,e.nativeDeviceSettings??null);return H`<div class="settings-sidebar__agent" aria-hidden="true">
      <span class="skeleton settings-sidebar__loading-agent"></span>
    </div>
    <div class="settings-sidebar__search" aria-hidden="true">
      <span class="skeleton settings-sidebar__loading-search"></span>
    </div>
    <div
      class="settings-sidebar__nav settings-loading-skeleton settings-sidebar__loading"
      role="status"
      aria-busy="true"
      aria-label=${B(`common.loading`)}
    >
      ${t.map(e=>H`<div class="settings-sidebar__group" aria-hidden="true">
          ${e.labelKey?H`<span class="skeleton settings-sidebar__loading-group-label"></span>`:U}
          ${e.routes.map(()=>H`<span class="settings-sidebar__item settings-sidebar__loading-item">
              <span class="skeleton settings-sidebar__loading-icon"></span>
              <span class="skeleton settings-sidebar__loading-label"></span>
            </span>`)}
        </div>`)}
    </div>`}function yw(){return(yw=e((()=>{W(),Gc(),Qc(),V(),ml()})))()}function bw(e,t){if(!t.open)return U;let n=e.devicePairSetupRenderer;if(n)return n(t);let r=e.devicePairSetupLoadFailed;r||e.loadDevicePairSetupRenderer();let i=B(`devices.pairing.title`),a=B(r?`devices.pairing.loadFailed`:`common.loading`);return H`<openclaw-modal-dialog
    label=${i}
    description=${a}
    @modal-cancel=${t.onClose}
  >
    <section class="device-pair-setup" aria-busy=${r?U:`true`}>
      <header class="device-pair-setup__header">
        <div>
          <h2>${i}</h2>
          <p role=${r?U:`status`}>${a}</p>
        </div>
      </header>
      <footer class="device-pair-setup__footer">
        ${r?H`<button
                class="btn btn--primary"
                type="button"
                @click=${()=>e.retryDevicePairSetupRenderer()}
              >
                ${B(`common.retry`)}
              </button>`:U}
        <button class="btn btn--ghost" type="button" @click=${t.onClose}>
          ${B(`common.close`)}
        </button>
      </footer>
    </section>
  </openclaw-modal-dialog>`}function xw(){return(xw=e((()=>{W(),V()})))()}function Sw(e,t,n,r,i){let a=e.gateway.snapshot,o=a.phase===`connected`;return H` <openclaw-browser-panel
      ?inert=${t}
      data-chat-autotype-exempt
      .client=${o?a.client:null}
      .available=${yb(a)}
      .remoteAvailable=${_b(a)}
      .suppressed=${n}
      .resourceBasePath=${e.resourceBasePath}
      .authToken=${u_({hello:a.hello,settings:{token:e.gateway.connection.token},password:e.gateway.connection.password})}
    ></openclaw-browser-panel>
    <openclaw-desktop-panel
      ?inert=${t}
      data-chat-autotype-exempt
      .client=${o?a.client:null}
      .available=${bb(a)}
      .suppressed=${n||i===`systems`}
      .basePath=${e.basePath}
    ></openclaw-desktop-panel>
    <openclaw-link-reader-panel
      ?inert=${t}
      data-chat-autotype-exempt
      .client=${o?a.client:null}
      .available=${o}
      .readers=${Ev(a)}
      .agentId=${r}
      .suppressed=${n}
    ></openclaw-link-reader-panel>`}function Cw(){return(Cw=e((()=>{W(),f_(),kv(),Cb()})))()}function ww(e,t,n,r){let i=e.lazyCustomElements.visibleState,a=e.context?.theme.settings;return H`
    ${e.commandPaletteLoading.active&&(!i||i.status===`loading`&&i.element===e.commandPaletteElement)?jx(e.commandPaletteLoading,()=>e.closePendingPalette()):i?.element===tu?yi(e,i):yd(e.lazyCustomElements)}
    ${Zl(e.commandPaletteElement)?H`<openclaw-command-palette
            .desktopAvailable=${t}
            .custodianAvailable=${n}
            .onNavigate=${(t,n)=>e.navigate(t,n)}
            .onSelectSession=${t=>e.selectChatSession(t)}
            .onSlashCommand=${t=>e.handleCommandPaletteSlashCommand(t)}
          ></openclaw-command-palette>`:U}
    ${Zl(tu)?ni:U}
    ${!r&&Zl(ru)?H`<openclaw-keyboard-shortcuts-dialog
            .sendShortcut=${lg(a?.chatSendShortcut)}
            .newSessionHost=${e}
          ></openclaw-keyboard-shortcuts-dialog>`:U}
  `}function Tw(){return(Tw=e((()=>{W(),Sd(),pi(),Px(),xu(),bg()})))()}function Ew(){return H`<openclaw-tooltip
    .content=${`${B(`assistantPanel.toggle`)} (${Bn(kr.homePanel)})`}
  >
    <button
      type="button"
      class="shell-chrome-controls__button shell-chrome-controls__home"
      aria-label=${B(`assistantPanel.toggle`)}
      @click=${()=>window.dispatchEvent(new CustomEvent(Ad))}
    >
      ${pl.home}
    </button>
  </openclaw-tooltip>`}function Dw(){return(Dw=e((()=>{W(),ml(),Id(),V(),fi()})))()}function Ow(e){let t=e.context,n=e.runtime,r=e.viewCallbacks;if(!t||!n)return U;if(e.routeState.routeId===void 0&&!e.routeState.routeFailed)return md();let i=t.gateway.snapshot,a=t.config.current,o=i.phase===`connected`,s=Ff(i),c=t.navigation.snapshot,l=t.overlays.snapshot,u=l.controlUiRefreshRequired,d=sa(i,u),f=Uf(t.gateway),p=!f.readyOnce&&!i.offlineStable&&(d===`connecting`||d===`starting`||d===`restoring`),m=l.updateRunning||l.updateReconciliationPending,h=r.watchUpdateProgress,g=Oi(i,a.terminalEnabled??!1),_=bb(i),v=xb(t.gateway),y=Fo(i,`openclaw.chat`,`operator.admin`),b=e.routeState.routeId??`chat`,x=ss(b),S=i.phase===`reload-required`,C=!S&&!o&&!x&&b!==`new-session`&&b!==`appearance`&&b!==`connection`,w=b===`plugin`?Aa(e.routeState.location?.search??``,e.routeState.location?.pathname,t.basePath):null,T=Ys(),E=T&&b===`settings`,D=T&&(b===`settings`||Sc(b)||b===`skills`||b===`cron`),O=Cc(b)&&!e.onboardingMode&&!T,k=t.runtimeConfig.state,A=e.onboardingMode,ee=A&&b!==`custodian`;e.lazyCustomElements.requestWhileActive(e.onboardingMemoryImportElement,ee);let j=e.navDrawerOpen&&!A&&!T,N=Xx(),P=qs()&&!T;P&&!A&&e.lazyCustomElements.preload(su,{reportError:!0});let te=Qx({mobileNavLayout:N,routeId:b,onboarding:A}),ne=!T&&c.navCollapsed&&!e.desktopNavigationExpanded&&!j&&!O,re=pS({onboarding:A,navCollapsed:ne,navDrawerOpen:j,mobileNavLayout:N}),F=!T&&mS({navigationSurfaceHidden:re,mobileNavLayout:N,onboarding:A,compact:te});!T&&(A||F)&&e.lazyCustomElements.preload(cu,{reportError:!0});let ie=Math.max(globalThis.innerWidth||0,400),I=e.newSessionRouteAgentId(),ae=I?M(I):null,oe=ae!==null&&t.agents.state.agentsList?.agents.some(e=>M(e.id)===ae)===!0?ae:M(t.agentSelection.state.selectedId??i.assistantAgentId),se=Ri(i,{method:`sessions.create`,params:{},sessionScope:!0}),ce=r.requestOpenNewSession,le=t.theme.settings,ue=x||b===`new-session`||b===`systems`;!O&&!T&&Object.assign(e.navigationSidebar,{basePath:t.basePath,activeRouteId:b,router:e.runtime.router,activePluginTabId:w?ia(w):``,enabledRouteIds:js,sessionKey:e.activeSessionKey,connected:o,connectionStatus:d,lastError:i.lastError,outboxAttentionCountForSession:r.outboxAttentionCountForSession,hasSessionDraft:r.hasSessionDraft,terminalAvailable:g,catalogOpenTarget:pg(le.catalogOpenTarget),canPairDevice:o&&(s.canAdmin||s.canPair),preferencesBrowserOnly:o&&t.runtimeConfig.canPatch===!1,sidebarEntries:c.sidebarEntries,navigationVisible:!re,sidebarAgentsMode:le.sidebarAgentsMode??`chip`,sidebarLiveActivity:le.sidebarLiveActivity!==!1,pinnedAgentIds:c.pinnedAgentIds,themeMode:t.theme.mode,gatewayVersion:a.serverVersion??i.hello?.server?.version??null,devGitBranch:a.devGitBranch,watchUpdateProgress:h,onOpenPalette:e.openPalette,onRetryConnect:r.retryGateway,onToggleSidebar:r.toggleSidebar,onOpenNewSession:ce,onUpdateSidebarEntries:r.updateSidebarEntries,onPairMobile:r.openDevicePairSetup,onNavigate:e.navigate,onPreloadRoute:r.preloadRoute});let de=T&&(Js()?.surface!==`conversation`||b!==`chat`),fe=!T&&ne&&!A&&!O&&!N,pe=(re||(O?e.settingsSidebarRenderer===null:!Zl(au)))&&!T&&!A&&!p?d:null,me={navigationSurfaceHidden:re,mobileNavLayout:N,onboarding:A,compact:te&&!u,statusBanner:l.updateStatusBanner,updateRun:l.updateRun,refreshRequired:u,onRefresh:e.refreshControlUi,onNavigate:e.navigate},he=O||de?_w(e,{presentation:T?E?`embed-list`:`embed-page`:`sidebar`,basePath:t.basePath,activeRouteId:b,agents:t.agents.state.agentsList?.agents??[],agentIdentity:t.agentIdentity,settingsAgentSelection:t.settingsAgentSelection,activePathname:e.routeState.location?.pathname??``,activeSearch:e.routeState.location?.search??``,activeHash:e.routeState.location?.hash??``,connectionStatus:d,lastError:i.lastError,gatewayVersion:a.serverVersion??i.hello?.server?.version??``,searchQuery:E?``:e.settingsSearchQuery,searchParams:{query:e.settingsSearchQuery,schema:k.configSchema,value:k.configForm??k.configSnapshot?.config??null,uiHints:k.configUiHints,identityAvailable:!!i.selfUser,multipleProfiles:i.hello?.policy?.hasMultipleSessionSharingIdentities===!0,basePath:t.basePath,canAdmin:s.canAdmin,nativeDeviceSettings:t.nativeDeviceSettings},onExit:()=>{T?ic()?window.history.back():b===`memory-import`?t.replace(`memory`):e.navigate(`settings`):e.exitSettings()},onRetryConnect:r.retryGateway,onNavigate:e.navigate,onPreload:r.preloadRoute,onSearchQueryChange:t=>void e.handleSettingsSearchQueryChange(t),preloadTimers:e.settingsPreloadTimers,saveIndicator:{status:k.configRecoveryError?`recovery`:k.configAutoSaveStatus,lastError:k.configRecoveryError??k.lastError,needsApply:k.configNeedsApply,applying:k.configApplying,applyDisabled:t.runtimeConfig.canApply===!1||k.configLoading||k.configSaving||k.configFormDirty&&k.configFormMode===`raw`||m,onRetry:()=>void t.runtimeConfig.retry(),onSave:()=>void t.runtimeConfig.save(),onReload:()=>void t.runtimeConfig.discardDraft(),onApply:()=>void t.runtimeConfig.apply()},canAdmin:s.canAdmin,nativeDeviceSettings:t.nativeDeviceSettings}):e.navigationSidebar,ge=H`
    ${ww(e,_,y,T)}
    <div
      class="shell ${ue?`shell--chat`:``} ${ne?`shell--nav-collapsed`:``} ${N?`shell--mobile-nav`:``} ${te?`shell--merged-chat-chrome`:``} ${j?`shell--nav-drawer-open`:``} ${A?`shell--onboarding`:``} ${T?`shell--embed`:``} ${D?`shell--embed-settings`:``} ${O?`shell--settings`:``} ${fe&&v?`shell--home-control`:``} ${pe?`shell--connection-status`:``} ${mS(me)?`shell--floating-attention`:``} ${e.navResizing?`shell--nav-resizing`:``}"
      style=${`--shell-nav-expanded-width: ${c.navWidth}px`}
      @theme-change=${t=>e.handleThemeChange(t)}
    >
      <a class="shell-skip-link" href="#control-ui-main" ?inert=${j}>
        ${B(`common.skipToMainContent`)}
      </a>
      ${P&&!A?H`
              <openclaw-macos-titlebar-controls
                ?inert=${j}
                .navCollapsed=${e.nativeNavCollapsed()}
                .historyOnly=${O}
                .canGoBack=${e.nativeHistoryState.canGoBack}
                .canGoForward=${e.nativeHistoryState.canGoForward}
                .newSessionDisabledReason=${se.allowed?void 0:se.reason}
                .onToggleSidebar=${r.toggleSidebar}
                .onOpenPalette=${e.openPalette}
                .onOpenNewSession=${e.handleNativeNewSession}
              ></openclaw-macos-titlebar-controls>
            `:U}
      ${T?U:H`<openclaw-app-topbar
              ?inert=${j}
              .resourceBasePath=${t.resourceBasePath}
              .environment=${a.environment}
              .navDrawerOpen=${j}
              .onOpenPalette=${e.openPalette}
              .onToggleDrawer=${e.toggleNavigationSurface}
            ></openclaw-app-topbar>`}
      ${fe?H`
              <div class="shell-chrome-controls">
                <openclaw-tooltip
                  .content=${`${B(`nav.expand`)} (${Bn(kr.toggleSidebar)})`}
                >
                  <button
                    type="button"
                    class="shell-chrome-controls__button shell-chrome-controls__nav-toggle"
                    aria-label=${B(`nav.expand`)}
                    aria-expanded="false"
                    data-env-avatar=${a.environment?a.assistantIdentity.name.charAt(0):U}
                    @click=${r.toggleSidebar}
                  >
                    ${pl.panelLeftOpen}
                  </button>
                </openclaw-tooltip>
                ${hw({basePath:t.basePath,agentId:oe,className:`shell-chrome-controls__button shell-chrome-controls__new-thread`,label:B(`chat.runControls.newSession`),showShortcut:!0,disabledReason:se.allowed?void 0:se.reason,onOpen:ce})}
                <openclaw-tooltip
                  .content=${`${B(`chat.openCommandPalette`)} (${Bn(kr.commandPalette)})`}
                >
                  <button
                    type="button"
                    class="shell-chrome-controls__button shell-chrome-controls__search"
                    aria-label=${B(`chat.openCommandPalette`)}
                    @click=${e.openPalette}
                  >
                    ${pl.search}
                  </button>
                </openclaw-tooltip>
                ${v?Ew():U}
              </div>
            `:U}
      ${T?U:H`<button
                type="button"
                class="shell-nav-backdrop"
                tabindex="-1"
                aria-hidden="true"
                ?inert=${!j}
                @click=${()=>e.closeNavDrawer({restoreFocus:!0})}
              ></button>
              <div
                class="shell-nav ${N?`nav-drawer`:``}"
                role=${N?`dialog`:U}
                aria-modal=${N&&j?`true`:U}
                aria-label=${N?B(`palette.categories.navigation`):U}
                aria-hidden=${N&&re?`true`:U}
                tabindex=${N?-1:U}
                ?inert=${re}
              >
                ${he}
              </div>`}
      ${!T&&!ne&&!A&&!O?H`
              <resizable-divider
                class="sidebar-resizer"
                .label=${B(`nav.resize`)}
                .splitRatio=${c.navWidth/ie}
                .minRatio=${240/ie}
                .maxRatio=${400/ie}
                aria-valuetext=${`${c.navWidth} pixels`}
                title=${B(`nav.resize`)}
                @resize-start=${()=>{e.navResizing=!0}}
                @resize-end=${()=>{e.navResizing=!1}}
                @resize=${t=>e.resizeNavigation(t.detail.splitRatio)}
              ></resizable-divider>
            `:U}
      <main
        id="control-ui-main"
        class="content ${ue?`content--chat`:``} ${b===`custodian`?`content--custodian`:``} ${b===`workboard`?`content--workboard`:``} ${C?`content--actions-blocked`:``} ${e.shellLayout.className}"
        ${Co(e.shellLayout.contentRef)}
        .tabIndex=${-1}
        @mousedown=${Xc}
        ?inert=${!T&&C||N&&j}
      >
        ${C?H`<div class="connection-action-block" role="status" aria-live="polite">
                <span class="connection-action-block__icon" aria-hidden="true"
                  >${pl.globeOff}</span
                >
                <span class="connection-action-block__text">
                  ${B(O?`connection.settingsChangesUnavailable`:`connection.actionsUnavailable`)}
                </span>
              </div>`:U}
        ${hS(me)}
        ${de?he:U}
        <openclaw-router-outlet
          ?inert=${C||S}
          aria-disabled=${C||S?`true`:U}
          .router=${n.router}
          .retryContext=${t}
          .retentionScope=${f}
          .onNotFound=${e.recoverNotFoundRoute}
          .notFoundRecoveryReady=${o}
        ></openclaw-router-outlet>
      </main>
      ${pe?H`<div class="shell-connection-status">
              ${pw({kind:pe,lastError:i.lastError,onRetry:r.retryGateway})}
            </div>`:U}
      <openclaw-terminal-panel
        ?inert=${j}
        .client=${o?i.client:null}
        .available=${g}
        .agentId=${oe}
        .sessionKey=${x?e.activeSessionKey:null}
        .suppressed=${O||T}
        .themeMode=${t.theme.resolvedMode}
        .basePath=${t.basePath}
      ></openclaw-terminal-panel>
      ${x?U:Sw(t,j,O||T,oe,b)}
      <openclaw-assistant-panel
        ?inert=${j}
        .custodianAvailable=${y&&!T}
        .homeAvailable=${v&&!T}
        .custodianSuppressed=${b===`custodian`}
        .pageSessionKey=${e.activeSessionKey}
        .pageAgentId=${oe}
        .pageRouteId=${b}
        .pageRouteFailed=${e.routeState.routeFailed===!0}
        .minimizeRequestId=${e.custodianMinimizeRequestId}
      ></openclaw-assistant-panel>
      ${Zl(e.execApprovalElement)?H`<openclaw-exec-approval
              .props=${{queue:l.approvalQueue,busy:l.approvalBusy,canGrant:l.approvalCanGrant,errors:l.approvalErrors,onDecision:(e,n)=>t.overlays.decideApproval(n,e)}}
            ></openclaw-exec-approval>`:U}
      ${bw(e,{open:l.devicePairSetupOpen,lifecycle:l.devicePairSetupLifecycle,nowMs:Date.now(),pendingCount:l.devicePairPendingCount,onRefresh:()=>void t.overlays.refreshDevicePairSetup(),onAccessChange:e=>void t.overlays.setDevicePairSetupAccess(e),onClose:()=>t.overlays.closeDevicePairSetup(),onManageDevices:()=>{t.overlays.closeDevicePairSetup(),e.navigate(`devices`)},onGetApps:()=>{t.overlays.closeDevicePairSetup(),e.navigate(`apps`)}})}
      ${ee&&Zl(e.onboardingMemoryImportElement)?H`<openclaw-onboarding-memory-import
              .active=${!0}
              .context=${t}
            ></openclaw-onboarding-memory-import>`:U}
      <openclaw-toast-host></openclaw-toast-host>
    </div>
  `;return b===`plugins`||b===`plugin-settings`?ge:Ai(`workspace`,{sessionKey:e.activeSessionKey,agentId:lo({assistantAgentId:t.agentSelection.state.selectedId??i.assistantAgentId,agentsList:t.agents.state.agentsList,hello:i.hello},e.activeSessionKey),routeId:b},ge)}function kw(){return(kw=e((()=>{W(),To(),Gc(),Y(),lp(),mw(),ml(),hd(),gw(),yw(),V(),Lo(),fi(),Pt(),na(),Qi(),ci(),ea(),xw(),Cw(),Tw(),oc(),Kf(),xu(),rS(),Qs(),Qc(),_S(),Hf(),Cb(),bg(),Dw()})))()}function Aw(e){try{Kc()?.webkit?.messageHandlers?.openclawNav?.postMessage({type:`nav-state`,...e})}catch{}}function jw(){return(jw=e((()=>{})))()}function Mw(e){return typeof Reflect.get(e,`restartAfterTeardown`)==`function`&&typeof Reflect.get(e,`teardown`)==`function`}function Nw(e,t=`mcp-app-view`){let n=new Set;for(let r of e){r instanceof Element&&r.matches(t)&&Mw(r)&&n.add(r);for(let e of r.querySelectorAll(t))Mw(e)&&n.add(e)}return[...n]}var Pw;function Fw(){return(Fw=e((()=>{Pw=class{constructor(e,t=`mcp-app-view`){this.host=e,this.selector=t,this.renderedKey=null,this.pending=!1,this.restartTargets=null}get retiring(){return this.pending||this.restartTargets!==null}apply(e,t){return this.renderedValue=t(),this.renderedKey=e,this.renderedValue}render(e,t,n,r={}){if(this.pending)return this.renderedValue;if(this.restartTargets){let n=this.restartTargets;return this.restartTargets=null,queueMicrotask(()=>{for(let e of n)e.isConnected&&e.restartAfterTeardown()}),this.renderedKey===e&&r.retainRenderedValue?this.renderedValue:this.apply(e,t)}if(this.renderedKey===e&&r.retainRenderedValue)return this.renderedValue;if(this.renderedKey===null||this.renderedKey===e)return this.apply(e,t);let i=Nw(n(),this.selector);return i.length===0?this.apply(e,t):(this.pending=!0,Promise.allSettled(i.map(e=>e.teardown())).then(()=>{this.pending=!1,this.restartTargets=i,this.host.requestUpdate()}),this.renderedValue)}}})))()}function Iw(e){return typeof e==`object`&&!!e&&`render`in e&&typeof e.render==`function`}function Lw(e,t){let n=globalThis.performance?.now()??0,r=t(),i=Math.round((globalThis.performance?.now()??n)-n);return i>=16&&console.debug(`[openclaw] routed render`,{routeId:e,durationMs:i}),r}function Rw(e){if(!e)return()=>{};let t=e.textContent;return e.disabled=!0,e.textContent=B(`lazyView.reloading`),()=>{e.disabled=!1,e.textContent=t}}function zw(e,t,n,r,i){let a=Al(n);a&&Pl();let o=()=>{t!==void 0&&e.revalidate(t,r).catch(()=>void 0)};return bd({error:n,onRetry:e=>{if(!a){o();return}let t=Rw(e.currentTarget instanceof HTMLButtonElement?e.currentTarget:null);Ll().then(e=>{e||t()})},render:i,stale:a})}function Bw(e,t,n,r={}){if(!n||n.status===`notFound`||n.status===`redirected`)return U;let i=n.routeId;if(!n.module)return n.error?zw(e,r.retryContext,n.error,i):t.showPending?gd():U;let a=n.module;if(!Iw(a))return n.error?zw(e,r.retryContext,n.error,i):null;let o=()=>Lw(i,()=>r.presented===!1?a.render(n.data,n.isFetching===`loader`,!1):a.render(n.data,n.isFetching===`loader`));return n.error?zw(e,r.retryContext,n.error,i,a.retainOnNavigate?void 0:o):o()}var Vw,Hw,Uw;function Ww(){return(Ww=e((()=>{W(),No(),Po(),To(),Y(),Sd(),_d(),Fw(),V(),Ji(),Zd(),Yl(),Vw=class{constructor(e,t){this.inputs=t,this.controller=new Xd(()=>e.requestUpdate()),e.addController(this)}get snapshot(){return this.controller.snapshot}hostConnected(){this.controller.setInputs(this.inputs()),this.controller.connect()}hostUpdate(){this.controller.setInputs(this.inputs())}hostDisconnected(){this.controller.disconnect()}},Hw=class extends Ha{constructor(...e){super(...e),this.ownerKey=``,this.renderPage=()=>U,this.presentedValue=!1}get presented(){return this.presentedValue}set presented(e){let t=this.presentedValue;this.presentedValue=e,this.style.display=e?`contents`:`none`,this.toggleAttribute(`inert`,!e),this.setAttribute(`aria-hidden`,e?`false`:`true`),this.requestUpdate(`presented`,t)}render(){return this.renderPage(this.presented)}},L([q({attribute:!1})],Hw.prototype,`ownerKey`,void 0),L([q({attribute:!1})],Hw.prototype,`renderPage`,void 0),L([q({attribute:!1})],Hw.prototype,`presented`,null),Uw=class extends Ha{constructor(...e){super(...e),this.outlet=new Vw(this,()=>({router:this.router,onNotFound:this.onNotFound,notFoundRecoveryReady:this.notFoundRecoveryReady})),this.retainedUnmountGate=new Pw(this),this.transientUnmountGate=new Pw(this),this.retainedPresentation=Eo(),this.retainedPresented=!1,this.scopeInitialized=!1,this.scopeGeneration=0,this.scopeRefreshing=!1,this.retiredSessionMatches=new Set}synchronizeRetentionScope(e){let t=this.scopeRouter!==e,n=this.scopeInitialized&&(t||this.scopeOwner!==this.retentionScope);if(this.scopeInitialized=!0,this.scopeRouter=e,this.scopeOwner=this.retentionScope,!n)return;let r=++this.scopeGeneration;if(this.retainedMatch=void 0,this.retainedOwnerKey=void 0,this.retainedPresented=!1,this.scopeRefreshing=!1,this.retiredSessionMatches=new Set(t?[]:[...e.getState().matches,...e.getState().pendingMatches].filter(e=>ss(e.routeId)).map(e=>e.id)),t)return;let i=this.retryContext,a=this.retentionScope,o=e.getState(),s=o.pendingMatches[0]??o.matches[0];i!==void 0&&s&&ss(s.routeId)&&(this.scopeRefreshing=!0,e.navigate(s.routeId,i,{history:`none`,revalidate:!0},s.location).finally(()=>{this.router===e&&this.retentionScope===a&&this.scopeGeneration===r&&(this.scopeRefreshing=!1,this.requestUpdate())}).catch(()=>void 0))}render(){let e=this.router;if(!e)return U;let t=this.outlet.snapshot,n=Kd(t.active,t.pending);this.synchronizeRetentionScope(e);let r=n?.status===`success`&&n.error===void 0,i=n!==void 0&&this.retiredSessionMatches.has(n.id),a=!this.scopeRefreshing&&!i,o=n?`${n.routeId}:${n.status}`:`empty`,s=n?.module,c=Iw(s)?s:void 0,l=n?c?.renderOwnerKey?.(n,t.settled):void 0,u=n?.error===void 0?l:void 0,d=n?.status===`pending`||n?.isFetching===`loader`,f=d&&this.retainedPresented&&this.retainedOwnerKey===u,p=a&&c?.retainOnNavigate===!0&&u!==void 0&&(r||f);p&&r?(this.retainedMatch=n,this.retainedOwnerKey=u):(t.status===`idle`||a&&c?.retainOnNavigate&&!d)&&(this.retainedMatch=void 0,this.retainedOwnerKey=void 0),this.retainedPresented=p;let m=this.retainedMatch,h=`${this.scopeGeneration}:${this.retainedOwnerKey??`empty`}`,g=p?`empty`:u??o,_=()=>ss(n?.routeId)&&!a?!i&&n?.error!==void 0?zw(e,this.retryContext,n.error,n.routeId):gd():c?.retainOnNavigate&&d?n?.routeId===`chat`&&t.settled?.routeId===`new-session`?Bw(e,t,t.settled,{retryContext:this.retryContext}):gd():Bw(e,t,n,{retryContext:this.retryContext}),v=H`
      ${this.retainedUnmountGate.render(h,()=>m?jo(h,H`<openclaw-route-presentation
                  ${Co(this.retainedPresentation)}
                  .ownerKey=${h}
                  .presented=${p}
                  .renderPage=${n=>Bw(e,t,m,{retryContext:this.retryContext,presented:n})}
                ></openclaw-route-presentation>`):U,()=>this.retainedPresentation.value?[this.retainedPresentation.value]:[])}
      ${this.transientUnmountGate.render(g,()=>p?U:_(),()=>[...this.children].filter(e=>e!==this.retainedPresentation.value),{retainRenderedValue:!c?.retainOnNavigate&&u!==void 0&&n?.status===`pending`&&n.data===void 0})}
      ${p&&this.retainedUnmountGate.retiring?gd():U}
    `;return this.retainedPresentation.value&&(this.retainedPresentation.value.presented=p&&!this.retainedUnmountGate.retiring&&this.retainedPresentation.value.ownerKey===h),v}},L([q({attribute:!1})],Uw.prototype,`router`,void 0),L([q({attribute:!1})],Uw.prototype,`retryContext`,void 0),L([q({attribute:!1})],Uw.prototype,`onNotFound`,void 0),L([q({attribute:!1})],Uw.prototype,`notFoundRecoveryReady`,void 0),L([q({attribute:!1})],Uw.prototype,`retentionScope`,void 0),customElements.get(`openclaw-route-presentation`)||customElements.define(`openclaw-route-presentation`,Hw),customElements.get(`openclaw-router-outlet`)||customElements.define(`openclaw-router-outlet`,Uw)})))()}var Gw;function Kw(){return(Kw=e((()=>{No(),Gc(),Uu(),zd(),Gd(),Y(),ad(),V(),Rn(),xo(),Hi(),na(),or(),Ji(),Zr(),oo(),tf(),ix(),bS(),XC(),ow(),dw(),kw(),zg(),v_(),xu(),jw(),Qs(),Ww(),BS(),KC(),w_(),bg(),ep(),Yl(),a(),xa.setLocaleLoadRecovery({isUnrecoverableError:Al,onUnrecoverableLocaleLoad:()=>{Pl()}}),Gw=class extends Ha{loadSettingsSidebarRenderer(){this.settingsSidebarRuntime??=z(()=>import(`./settings-sidebar-DGY6fHqk.js`).then(e=>{this.settingsSidebarRenderer=e.renderSettingsSidebar,this.settingsSidebarLoadFailed=!1}),__vite__mapDeps([130,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,116,20,21,22,23,24,27,131,132,133,134,135,28,29,30,31,32,33,34,35,36,37,136]),import.meta.url).catch(()=>{this.settingsSidebarLoadFailed=!0,this.settingsSidebarRuntime=null})}retrySettingsSidebarRenderer(){this.settingsSidebarLoadFailed=!1,this.loadSettingsSidebarRenderer()}loadSidebarUpdateCard(){this.sidebarUpdateCardImport.load().catch(e=>{Al(e)&&Pl()})}loadDevicePairSetupRenderer(){this.devicePairSetupRuntime??=z(()=>import(`./view-pairing.runtime-CvBsN78a.js`).then(e=>{this.devicePairSetupRenderer=e.renderDevicePairSetup,this.devicePairSetupLoadFailed=!1}),__vite__mapDeps([137,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,138,28,29,30,31,32]),import.meta.url).catch(()=>{this.devicePairSetupLoadFailed=!0,this.devicePairSetupRuntime=null})}retryDevicePairSetupRenderer(){this.devicePairSetupLoadFailed=!1,this.loadDevicePairSetupRenderer()}get context(){return this.runtime?.context}get onboardingMode(){let e=this.routeState.location?.search;return e===void 0?this.onboarding:qf(e)}get workspaceChromeVisible(){let e=this.routeState.routeId;return e!==void 0&&!Sc(e)&&!this.onboardingMode}storedOutboxScopeHost(e){let t=e.gateway.snapshot;return{settings:{gatewayUrl:e.gateway.connection.gatewayUrl},assistantAgentId:t.assistantAgentId,agentsList:e.agents.state.agentsList,hello:t.hello}}chatTitleContext(e,t){let n=this.activeSessionKey,r=ri(n),i=La(n)?ho(t):r?.rest===Ei(t)?M(r.agentId):void 0,a=i?e.agents.state.agentsList?.agents.find(e=>M(e.id)===i):void 0;return a?mn(a):Mn(n,e.sessions.presentation.result?.sessions.find(e=>e.key===n))}constructor(){super(),this.onboarding=!1,this.navDrawerOpen=!1,this.navResizing=!1,this.shellLayout=new $f(this),this.desktopNavigationExpanded=!1,this.activeSessionKey=``,this.settingsSearchQuery=``,this.routeState={},this.nativeHistoryState=Xs(),this.commandPaletteElement=eu,this.terminalPanelElement=lu,this.browserPanelElement=uu,this.linkReaderPanelElement=pu,this.desktopPanelElement=fu,this.execApprovalElement=yu,this.onboardingMemoryImportElement={tagName:`openclaw-onboarding-memory-import`,label:B(`onboarding.memoryImport.title`),loadModule:()=>z(()=>import(`./onboarding-memory-import-q7lLmUal.js`),__vite__mapDeps([139,5,4,28,140]),import.meta.url)},this.lazyCustomElements=new $l(this,()=>this.shellChrome.cancelPendingLazyAction(),e=>this.shellChrome.retryPendingLazyAction(e)),this.queryRenderedElement=e=>this.renderRoot?.querySelector(e)??null,this.navDrawerTrigger=null,this.navigationSidebar=document.createElement(au.tagName),this.lastWorkspaceLocation=null,this.custodianMinimizeRequestId=0,this.agentsListClient=null,this.agentsListSource=null,this.sessionKeyClient=null,this.runtimeConfigClient=null,this.runtimeConfigSource=null,this.lastLocalePrefSignature=null,this.previousGatewayPhase=null,this.agentRosterRefreshTimer=null,this.outboxStoreRuntime=null,this.outboxStoreUnsubscribe=null,this.lastDeletedSessions=null,this.outboxStoreImport=gn(()=>z(()=>import(`./outbox-store-projection-CNeLFLzI.js`).then(e=>e.createStoredChatOutboxReader()),__vite__mapDeps([141,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url),e=>this.installOutboxStoreRuntime(e)),this.didConsiderNativeRouteRestore=!1,this.pendingNativeNewSession=!1,this.settingsPreloadTimers=new Map,this.settingsSidebarRenderer=null,this.settingsSidebarLoadFailed=!1,this.settingsSidebarRuntime=null,this.sidebarUpdateCardImport=gn(()=>z(()=>import(`./sidebar-update-card-B3kfrCKK.js`),__vite__mapDeps([142,19,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,28,29,30,31,32]),import.meta.url)),this.devicePairSetupRenderer=null,this.devicePairSetupLoadFailed=!1,this.devicePairSetupRuntime=null,this.subscriptions=new Fa(this),this.shellNavigation=new aw(this),this.shellChrome=new yS(this),this.shellGateway=new YC(this),this.viewCallbacks=uw(this),this.reconcileServerUiPrefs=this.shellGateway.reconcileServerUiPrefs.bind(this.shellGateway),this.reconcileCommittedServerUiPrefs=this.shellGateway.reconcileCommittedServerUiPrefs.bind(this.shellGateway),this.refreshStoredOutboxPresentation=()=>{this.refreshStoredOutboxSummary(),this.requestUpdate(),this.navigationSidebar.requestUpdate?.()},this.selectChatSession=this.shellNavigation.selectChatSession.bind(this.shellNavigation),this.handleGatewayEvent=this.shellGateway.handleGatewayEvent.bind(this.shellGateway),this.handleThemeChange=e=>{let t=this.context;t&&t.theme.setMode(e.detail.mode,e.detail.element)},this.chatNavigationOptions=this.shellNavigation.chatNavigationOptions.bind(this.shellNavigation),this.navigate=this.shellNavigation.navigate,this.recoverNotFoundRoute=this.shellNavigation.recoverNotFoundRoute.bind(this.shellNavigation),this.recoverDeletedActiveSession=this.shellNavigation.recoverDeletedActiveSession.bind(this.shellNavigation),this.exitSettings=this.shellNavigation.exitSettings.bind(this.shellNavigation),this.toggleNavigationSurface=this.shellChrome.toggleNavigationSurface,this.closeNavDrawer=this.shellChrome.closeNavDrawer,this.resizeNavigation=this.shellChrome.resizeNavigation,this.openNewSession=this.shellNavigation.openNewSession.bind(this.shellNavigation),this.handleNativeToggleSidebar=this.shellChrome.handleNativeToggleSidebar,this.handleNativeOpenSearch=this.shellChrome.handleNativeOpenSearch,this.handleNativeToggleSearch=this.shellChrome.handleNativeToggleSearch,this.handleNativeNewSession=this.shellChrome.handleNativeNewSession,this.handleNativeNavigate=this.shellChrome.handleNativeNavigate,this.handleNativeHistoryState=this.shellChrome.handleNativeHistoryState,this.handleWindowResize=this.shellChrome.handleWindowResize,this.handleDocumentKeydown=this.shellChrome.handleDocumentKeydown,this.togglePendingDebugOverlayMode=this.shellChrome.togglePendingDebugOverlayMode.bind(this.shellChrome),this.openPalette=this.shellChrome.openPalette,this.closePendingPalette=this.shellChrome.closePendingPalette,this.refreshControlUi=()=>{let e=this.context;return e?Ll({timeoutMs:0,...g_(e.gateway,()=>this.context===e&&e.overlays.snapshot.controlUiRefreshRequired)}):Promise.resolve(!1)},this.handleShellNavDrawerToggle=this.shellChrome.handleShellNavDrawerToggle,this.handleCommandPaletteSlashCommand=this.shellChrome.handleCommandPaletteSlashCommand,this.restorePendingLazyAction=this.shellChrome.restorePendingLazyAction,this.nativeNavCollapsed=this.shellChrome.nativeNavCollapsed,this.newSessionRouteAgentId=this.shellNavigation.newSessionRouteAgentId.bind(this.shellNavigation),this.updateRouteState=this.shellNavigation.updateRouteState.bind(this.shellNavigation),this.subscriptions.effect(()=>this.context,e=>(this.pendingNativeNewSession&&(this.pendingNativeNewSession=!1,this.handleNativeNewSession()),()=>{this.context!==e&&this.resetForContextEpoch()})).effect(()=>this.context,e=>{let t=Date.now(),n=!0,r,i=gn(()=>z(()=>import(`./control-ui-favicon-status.runtime-DowawiKJ.js`),__vite__mapDeps([143,11,3,2,4,5,7,1,8,9,6,10,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url),({connectControlUiFavicon:i})=>{n&&(r=i(this,e,t))});return i.schedule(),()=>{n=!1,i.dispose(),r?.()}}).watch(()=>this.context?.nativeDeviceSettings,(e,t)=>e.subscribe(t)).watch(()=>this.context?.navigation,(e,t)=>e.subscribe(t)).watch(()=>this.context?.plugins,(e,t)=>e.subscribe(t)).watch(()=>this.context?.agentSelection,(e,t)=>e.subscribe(t)).watch(()=>this.context?.settingsAgentSelection,(e,t)=>e.subscribe(t)).watch(()=>this.context?.agentIdentity,(e,t)=>e.subscribe(t)).watch(()=>this.context?.gateway,(e,t)=>e.subscribe(t),e=>{this.shellChrome.synchronizeCommandPaletteScope(),this.shellGateway.synchronizeGateway(e.snapshot),this.refreshStoredOutboxSummary()}).effect(()=>this.context?.gateway,e=>e.subscribeEvents(this.handleGatewayEvent)).watch(()=>this.context?.config,(e,t)=>e.subscribe(t)).watch(()=>this.context?.theme,(e,t)=>e.subscribe(t)).watch(()=>this.context?.agents,(e,t)=>e.subscribe(t),e=>{this.refreshStoredOutboxSummary();let t=this.context?.gateway.snapshot;t&&this.ensureAgentsList(t,e)}).effect(()=>this.runtime?.router,e=>(this.updateRouteState($d(e.getState())),e.subscribeSelector($d,e=>this.updateRouteState(e),ef))).watch(()=>this.context?.overlays,(e,t)=>e.subscribe(t)).effect(()=>this.context?.sessions,e=>this.shellGateway.observeSessions(e,()=>this.syncDocumentTitle())).watch(()=>this.context?.placementStartup,(e,t)=>e.subscribe(t),()=>{this.context&&this.recoverDeletedActiveSession(this.context.sessions.state)}).watch(()=>this.context?.runtimeConfig,(e,t)=>e.subscribe(()=>{this.reconcileServerUiPrefs(e),t()}),e=>{let t=this.context?.gateway.snapshot;t&&this.ensureRuntimeConfig(t,e),this.reconcileServerUiPrefs(e)})}connectedCallback(){super.connectedCallback(),this.outboxStoreRuntime&&this.installOutboxStoreRuntime(this.outboxStoreRuntime),this.outboxStoreImport.schedule(),this.shellChrome.connect(),Uh((e,t)=>{if(SC())return;let n=FS(e,t),r=this.context?.runtimeConfig;n&&r&&OC(r,n,{profile:this.context?.gateway.snapshot,afterCommit:({needsRefresh:e,retainedLocal:t})=>this.reconcileCommittedServerUiPrefs(r,e,t)})})}disconnectedCallback(){this.shellChrome.disconnect(),Ng(),this.outboxStoreImport.dispose(),this.sidebarUpdateCardImport.dispose(),this.outboxStoreUnsubscribe?.(),this.outboxStoreUnsubscribe=null,this.lastLocalePrefSignature=null,Uh(null),this.resetForDocumentDisconnect(),super.disconnectedCallback()}installOutboxStoreRuntime(e){this.outboxStoreRuntime=e,e.invalidate(),this.isConnected&&(this.outboxStoreUnsubscribe?.(),this.outboxStoreUnsubscribe=e.subscribe(this.refreshStoredOutboxPresentation),this.refreshStoredOutboxPresentation())}refreshStoredOutboxSummary(){let e=this.context;this.storedOutboxes=e?this.outboxStoreRuntime?.read(this.storedOutboxScopeHost(e)):void 0}resetForContextEpoch(){this.shellChrome.abandonPendingLazyActionForContext(),this.resetShellState()}resetForDocumentDisconnect(){this.shellChrome.preservePendingLazyActionForReload(),this.resetShellState()}resetShellState(){this.outboxStoreRuntime?.invalidate(),this.navDrawerOpen=!1,this.desktopNavigationExpanded=!1,this.navDrawerTrigger=null,this.lastWorkspaceLocation=null,this.activeSessionKey=``,this.settingsSearchQuery=``,this.commandPaletteTarget=void 0,this.lastDeletedSessions=null,this.storedOutboxes=void 0,this.shellGateway.reset();for(let e of this.settingsPreloadTimers.values())globalThis.clearTimeout(e);this.settingsPreloadTimers.clear()}async handleSettingsSearchQueryChange(e){this.settingsSearchQuery=e;let t=this.context?.runtimeConfig;if(t&&e.trim())try{await t.ensureLoaded(),this.context?.runtimeConfig===t&&await t.ensureSchemaLoaded()}catch{}}observeDeletedSessions(e){let t=this.context,n=e.deletedSessions;if(!t||Object.is(n,this.lastDeletedSessions)||(this.lastDeletedSessions=n,n.length===0))return;let{client:r,assistantAgentId:i,hello:a}=t.gateway.snapshot;Jt(t,n);for(let{key:e,agentId:r,retireBeforeRevision:i}of n)t.chatAttachmentHandoff.retireScope(zt({sessionKey:e,agentId:r}),i);let o=t.gateway.connection.gatewayUrl,s=S_(t.gateway,{gatewayUrl:o,recoveryScope:r?.recoveryScope||void 0}),c={client:r,gatewayUrl:o,isCurrent:()=>t.gateway.snapshot.client===r&&s(),assistantAgentId:i,hello:a,agentsList:t.agents.state.agentsList};z(async()=>{let{retireDeletedComposerDrafts:e}=await import(`./composer-draft-retirement.runtime-BggnHQQu.js`);return{retireDeletedComposerDrafts:e}},__vite__mapDeps([144,10,3,2,4,5,7,1,8,9,6,11,12,13,14,15,16,17,18,19,28,29,30,31,32]),import.meta.url).then(({retireDeletedComposerDrafts:e})=>e(t,c,n),()=>gr({message:B(`sessionsView.draftCleanupFailed`)}))}get pendingDebugOverlayMode(){return this.shellChrome.pendingDebugOverlayMode}get commandPaletteLoading(){return this.shellChrome.commandPaletteLoading}syncDocumentTitle(){let e=this.routeState.routeId,t=this.context;if(!e||!t)return;let n=this.storedOutboxScopeHost(t),r=e===`custodian`?B(`nav.askOpenClaw`):Oc(e);ss(e)&&this.activeSessionKey&&(r=this.chatTitleContext(t,n)||r);let i=t.gateway.snapshot.phase!==`connected`,a=kc({context:r,attentionCount:t.overlays.snapshot.approvalQueue.length,gatewayDisconnected:i}),o=t.config?.current.environment;o&&(a+=` · ${o.label}`),document.title!==a&&(document.title=a)}updated(e){this.syncDocumentTitle(),(e.has(`routeState`)||e.has(`runtime`))&&Ng(),this.restorePendingLazyAction(),!customElements.get(`openclaw-sidebar-update-card`)&&this.querySelector(`openclaw-sidebar-update-card`)&&this.loadSidebarUpdateCard();let t=this.querySelector(`openclaw-chat-page`);t&&(t.navDrawerOpen=this.navDrawerOpen&&!this.onboardingMode);let n=this.context;if(!n)return;this.querySelector(`.settings-sidebar__agent`)&&n.agentIdentity.ensure([n.settingsAgentSelection.state.selectedId]),this.workspaceChromeVisible&&this.shellChrome.panels.restore(),(n.overlays?.snapshot.approvalQueue.length??0)>0&&this.lazyCustomElements.preload(this.execApprovalElement),this.restorePendingLazyAction();let r={collapsed:this.nativeNavCollapsed(),width:n.navigation.snapshot.navWidth};(r.collapsed!==this.lastNativeNavState?.collapsed||r.width!==this.lastNativeNavState.width)&&(this.lastNativeNavState=r,Aw(r))}ensureRuntimeConfig(e,t=this.context?.runtimeConfig){this.shellGateway.ensureRuntimeConfig(e,t).catch(()=>void 0)}ensureAgentsList(e,t=this.context?.agents){this.shellGateway.ensureAgentsList(e,t).catch(()=>void 0)}render(){return this.refreshStoredOutboxSummary(),this.workspaceChromeVisible&&this.lazyCustomElements.preload(au),Ow(this)}},L([q({attribute:!1})],Gw.prototype,`runtime`,void 0),L([q({attribute:!1})],Gw.prototype,`onboarding`,void 0),L([G()],Gw.prototype,`navDrawerOpen`,void 0),L([G()],Gw.prototype,`navResizing`,void 0),L([G()],Gw.prototype,`desktopNavigationExpanded`,void 0),L([G()],Gw.prototype,`activeSessionKey`,void 0),L([G()],Gw.prototype,`settingsSearchQuery`,void 0),L([G()],Gw.prototype,`routeState`,void 0),L([G()],Gw.prototype,`nativeHistoryState`,void 0),L([ko(`openclaw-command-palette`)],Gw.prototype,`commandPalette`,void 0),L([ko(`openclaw-exec-approval`)],Gw.prototype,`approvalOverlay`,void 0),L([G()],Gw.prototype,`settingsSidebarRenderer`,void 0),L([G()],Gw.prototype,`settingsSidebarLoadFailed`,void 0),L([G()],Gw.prototype,`devicePairSetupRenderer`,void 0),L([G()],Gw.prototype,`devicePairSetupLoadFailed`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,rx),customElements.get(`openclaw-app-shell`)||customElements.define(`openclaw-app-shell`,Gw)})))()}export{Nb as $,Fs as $a,Z as $i,Vp as $n,Id as $r,i_ as $t,Ux as A,gc as Aa,xu as Ai,eh as An,df as Ar,_v as At,Sx as B,Ys as Ba,El as Bi,jm as Bn,Gd as Br,k_ as Bt,rS as C,Tc as Ca,Mu as Ci,Lh as Cn,Vo as Co,bf as Cr,Lv as Ct,Hx as D,Ac as Da,mu as Di,uh as Dn,bs as Do,xf as Dr,yv as Dt,Yx as E,mc as Ea,Su as Ei,dh as En,Go as Eo,vf as Er,kv as Et,Ex as F,cc as Fa,Al as Fi,Rm as Fn,uf as Fr,nv as Ft,fx as G,Ks as Ga,_l as Gi,vm as Gn,Md as Gr,g_ as Gt,lx as H,Js as Ha,Sl as Hi,Tm as Hn,Vd as Hr,w_ as Ht,Ax as I,lc as Ia,Ll as Ii,Pm as In,cf as Ir,rv as It,Db as J,Rs as Ja,bl as Ji,tm as Jn,Pd as Jr,d_ as Jt,px as K,Hs as Ka,vl as Ki,om as Kn,Od as Kr,v_ as Kt,Tx as L,oc as La,Pl as Li,Um as Ln,Zd as Lr,U_ as Lt,Rx as M,Oc as Ma,Yl as Mi,Zm as Mn,hf as Mr,ov as Mt,Ix as N,xc as Na,zl as Ni,Ym as Nn,lf as Nr,iv as Nt,Kx as O,wc as Oa,$l as Oi,ah as On,ds as Oo,_f as Or,gv as Ot,Fx as P,sc as Pa,Rl as Pi,qm as Pn,sf as Pr,tv as Pt,Tb as Q,Es as Qa,dl as Qi,Qp as Qn,Fd as Qr,u_ as Qt,wx as R,ec as Ra,Dl as Ri,Mm as Rn,Kd as Rr,H_ as Rt,oS as S,yc as Sa,Bu as Si,Wh as Sn,Ho as So,Sf as Sr,Bv as St,$x as T,Ec as Ta,Cu as Ti,fh as Tn,hs as To,yf as Tr,Ev as Tt,dx as U,Vs as Ua,Tl as Ui,wm as Un,Dd as Ur,y_ as Ut,_x as V,qs as Va,wl as Vi,km as Vn,Bd as Vr,S_ as Vt,ux as W,Ws as Wa,xl as Wi,lm as Wn,jd as Wr,x_ as Wt,jb as X,xs as Xa,pl as Xi,im as Xn,Ed as Xr,c_ as Xt,Lb as Y,Ss as Ya,fl as Yi,em as Yn,kd as Yr,f_ as Yt,Ab as Z,Ts as Za,ml as Zi,Zp as Zn,Td as Zr,l_ as Zt,BS as _,bc as _a,Xu as _i,Sh as _n,ls as _o,Hf as _r,vy as _t,hw as a,il as aa,hd as ai,Bg as an,Jo as ao,up as ar,_b as at,xS as b,dc as ba,Wu as bi,hg as bn,os as bo,kf as br,Iv as bt,pw as c,Yc as ca,cd as ci,jg as cn,Y as co,Jf as cr,xb as ct,lw as d,qc as da,od as di,gg as dn,es as do,Kf as dr,sb as dt,ul as ea,Sd as ei,s_ as en,Ds as eo,Jp as er,Ob as et,QC as f,Kc as fa,sd as fi,bg as fn,Zo as fo,Rf as fr,lb as ft,cC as g,Dc as ga,Zu as gi,dg as gn,J as go,If as gr,Dy as gt,yC as h,Mc as ha,Qu as hi,pg as hn,as as ho,Lf as hr,Ty as ht,gw as i,nl as ia,gd as ii,Vg as in,Yo as io,wp as ir,vb as it,Lx as j,jc as ja,Zl as ji,Xm as jn,mf as jr,lv as jt,Bx as k,vc as ka,Xl as ki,sh as kn,fs as ko,gf as kr,vv as kt,cw as l,Xc as la,fd as li,Mg as ln,Wo as lo,qf as lr,ob as lt,KC as m,Vc as ma,ed as mi,Bh as mn,rs as mo,zf as mr,ub as mt,Pw as n,sl as na,xd as ni,e_ as nn,Cs as no,Op as nr,kb as nt,fw as o,$c as oa,md as oi,Fg as on,Qo as oo,ep as or,yb as ot,ZC as p,Fc as pa,ad as pi,Gh as pn,$o as po,Bf as pr,db as pt,ox as q,Gs as qa,yl as qi,$p as qn,Ad as qr,__ as qt,Fw as r,al as ra,_d as ri,$g as rn,Os as ro,Cp as rr,Cb as rt,mw as s,el as sa,ud as si,zg as sn,_s as so,Qf as sr,bb as st,Kw as t,cl as ta,bd as ti,n_ as tn,ws as to,kp as tr,wb as tt,sw as u,Qc as ua,ld as ui,eg as un,ss as uo,Uf as ur,cb as ut,IS as v,Gc as va,Ju as vi,bh as vn,Xo as vo,Ff as vr,Qv as vt,Xx as w,pc as wa,Vu as wi,gh as wn,ys as wo,Tf as wr,Dv as wt,_S as x,Sc as xa,qu as xi,wh as xn,Bo as xo,Cf as xr,qv as xt,MS as y,uc as ya,Yu as yi,lg as yn,is as yo,Af as yr,Gv as yt,vx as z,Qs as za,kl as zi,Am as zn,Wd as zr,j_ as zt};