@dominevo/addon-admin-ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2009 -0
- package/README.md +28 -2
- package/assets/icon.svg +1 -0
- package/dist/assets/Addons-DXj_703d.js +5 -0
- package/dist/assets/AdminPage-CA4Sxydy.js +1 -0
- package/dist/assets/AdminSectionedPage-3XsaKUPh.js +1 -0
- package/dist/assets/AiProfiles-BPuugVHP.js +3 -0
- package/dist/assets/Archive-Cs7NaNc_.js +1 -0
- package/dist/assets/BootstrapSettingsForm-B7n4Tn8W.js +1 -0
- package/dist/assets/Build-D7v3yZ31.js +51 -0
- package/dist/assets/Calendars-5ikY87Kt.js +1 -0
- package/dist/assets/Cluster-CMcu7Iqn.js +1 -0
- package/dist/assets/CompositionBlockEditor-BP9BOpRr.js +2 -0
- package/dist/assets/CompositionEditorPage-D_4Dx_8C.js +1 -0
- package/dist/assets/Data-Dlx9uZ0Q.js +2 -0
- package/dist/assets/DeviceDetail-DJXx7Dh3.js +1 -0
- package/dist/assets/Devices-DJd001mb.js +1 -0
- package/dist/assets/EmbedDevicePage-Cxe3_S-n.js +1 -0
- package/dist/assets/EmbedPlayerPage-BKq1BRg_.js +1 -0
- package/dist/assets/FormBuilder-BjcOGVVa.js +1 -0
- package/dist/assets/History-CqTLHyoj.js +1 -0
- package/dist/assets/Identity-CELdhZ4o.js +1 -0
- package/dist/assets/InstancesTable-DVnHkIbJ.js +1 -0
- package/dist/assets/IntegrationDetail-BlopkLuy.js +1 -0
- package/dist/assets/Integrations-BOr-rN3Z.js +2 -0
- package/dist/assets/Integrations-C8TECl9Z.js +1 -0
- package/dist/assets/Jobs-DnObAnQR.js +1 -0
- package/dist/assets/Library-sG9Ie6Ay.js +1 -0
- package/dist/assets/Locations-Dh63x-8T.js +3 -0
- package/dist/assets/Logs-B3LPrdqh.js +1 -0
- package/dist/assets/MaskShapeCanvas-T6ZNfW4J.js +1 -0
- package/dist/assets/MotionZonesSettings-B5KDfHoK.js +1 -0
- package/dist/assets/MyAccess-WIUGe7rE.js +2 -0
- package/dist/assets/Network--neqNeoA.js +7 -0
- package/dist/assets/Network-DtxX27Jz.css +1 -0
- package/dist/assets/NewExportModal-D64AhGe8.js +1 -0
- package/dist/assets/NodeAddonsSettingsPanel-Bc_UiSsk.js +1 -0
- package/dist/assets/Notifications-I66jIXko.js +1 -0
- package/dist/assets/Pipeline-DX80qRVf.js +1 -0
- package/dist/assets/PrivacyMaskSettings-CERwQtiu.js +1 -0
- package/dist/assets/SceneMonitorEditor-DxTYd8U2.js +1 -0
- package/dist/assets/SessionsList-BoOCsi8N.js +2 -0
- package/dist/assets/Showroom-Dkom3it5.js +1 -0
- package/dist/assets/StorageLocationsTable-CujqHG2j.js +1 -0
- package/dist/assets/System-PnjU9olQ.js +2 -0
- package/dist/assets/TemplateEditorDialog-B_8g2CrL.js +1 -0
- package/dist/assets/Terminal-BVqOTvEA.js +9 -0
- package/dist/assets/Terminal-kHJ-D0s7.css +1 -0
- package/dist/assets/TrainingProviders-5e1QS5zN.js +1 -0
- package/dist/assets/Viewer-CyLueECm.js +1 -0
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Cc7iYWcG.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js +6 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DzoL8nR8.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__konva__loadShare__.js-B7XYY0cV.js +15 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BPba2g2p.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-ZBKFTPET.js +9 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-BjdR__nc.js +19 -0
- package/dist/assets/addon-kind-filter-CEGKkC1O.js +1 -0
- package/dist/assets/ai-page.helpers-CiDsxXp3.js +1 -0
- package/dist/assets/assignment-candidates-BfhoJg-T.js +1 -0
- package/dist/assets/auth-context-CkfOTCG-.js +1 -0
- package/dist/assets/authed-media-C-zK1a1B.js +1 -0
- package/dist/assets/board-model-BvqJSvTB.js +1 -0
- package/dist/assets/broker-oauth-popup-B_GRcwxo.js +1 -0
- package/dist/assets/browser-BHo8W_uH.js +8 -0
- package/dist/assets/camera-block-model-QrJ_0XZY.js +1 -0
- package/dist/assets/chevron-down-CBb-F8DT.js +1 -0
- package/dist/assets/chunk-4ZMWKKQ3-BCeNTgXs.js +3 -0
- package/dist/assets/circle-slash-Duh934sZ.js +1 -0
- package/dist/assets/command-vocab-CiIfJEGh.js +1 -0
- package/dist/assets/compat-muhdrMna.js +64 -0
- package/dist/assets/crop-B-t0rzRY.js +1 -0
- package/dist/assets/database-zap-DHuELz_w.js +1 -0
- package/dist/assets/device-integration-icon-D9fVWv4K.js +1 -0
- package/dist/assets/device-picker-model-CYNi1aEm.js +1 -0
- package/dist/assets/dist-2ETbjdqB.js +1 -0
- package/dist/assets/dist-B0ixn42U.js +1326 -0
- package/dist/assets/divide-Bmm9r7CP.js +1 -0
- package/dist/assets/eraser-B3lnG9yK.js +1 -0
- package/dist/assets/file-up-2YD_M6f_.js +1 -0
- package/dist/assets/flask-conical-D7tbJQpj.js +1 -0
- package/dist/assets/format-D43HvBR0.js +1 -0
- package/dist/assets/format-size-DIxKXxtj.js +1 -0
- package/dist/assets/hard-drive-download-C6N6tovA.js +1 -0
- package/dist/assets/hls-IujbK-0_.js +40 -0
- package/dist/assets/hostInit-BjOFEl3v.js +1 -0
- package/dist/assets/i18n-BHLBFC1-.js +1 -0
- package/dist/assets/icons-CNI0rnl8.js +1 -0
- package/dist/assets/index-C1r-vzdu.js +5 -0
- package/dist/assets/index-CyIIY_ZD.css +2 -0
- package/dist/assets/key-CH4aXNMz.js +1 -0
- package/dist/assets/languages-Du_pOBpX.js +1 -0
- package/dist/assets/layers-BH9u1mrE.js +1 -0
- package/dist/assets/link-2-off-DmsjRAt7.js +1 -0
- package/dist/assets/linked-devices-model-Dl4vHeXt.js +1 -0
- package/dist/assets/memory-stick-BQrJMbEW.js +1 -0
- package/dist/assets/message-square-plus-_aGccjyj.js +1 -0
- package/dist/assets/mf-entry-bootstrap-0-64d22ef4.js +19 -0
- package/dist/assets/mic-off-BIQ5bbUV.js +1 -0
- package/dist/assets/monitor-off-DnOkDa2s.js +1 -0
- package/dist/assets/monitor-smartphone-DPI9EQus.js +1 -0
- package/dist/assets/mount-CYNi1aEm.js +1 -0
- package/dist/assets/notification-rule-status-T3SwZb2I.js +1 -0
- package/dist/assets/player-overlays-qzCoRsrQ.js +1 -0
- package/dist/assets/remoteEntry-Dc97BJQ9.js +1 -0
- package/dist/assets/rolldown-runtime-Cyuzqnbw.js +1 -0
- package/dist/assets/ruler-Buxogset.js +1 -0
- package/dist/assets/scan-eye-C862nWtV.js +1 -0
- package/dist/assets/scissors-DpiKUioV.js +1 -0
- package/dist/assets/search-x-C5ra3Aft.js +1 -0
- package/dist/assets/settings-section-shape-DbQZZpNL.js +1 -0
- package/dist/assets/shapes-D4IRNSXI.js +1 -0
- package/dist/assets/square-check-big-DAcFGNUN.js +1 -0
- package/dist/assets/src-CJoX3s-1.js +1326 -0
- package/dist/assets/src-Cf1Uvi4o.js +289 -0
- package/dist/assets/sso-popup-CPavla3I.js +1 -0
- package/dist/assets/step-inspector-model-CMrG9Xaa.js +1 -0
- package/dist/assets/table-2-DMxm3oyu.js +1 -0
- package/dist/assets/terminal-BncJ-1sF.js +1 -0
- package/dist/assets/timer-reset-5221y6Jb.js +1 -0
- package/dist/assets/uPlot.esm-B6hGABOr.js +10 -0
- package/dist/assets/unlink-D3-IGpS8.js +1 -0
- package/dist/assets/usb-P4R9CjYI.js +1 -0
- package/dist/assets/use-scenes-feed-CosaOMpn.js +1 -0
- package/dist/assets/useAdminDeviceRemoval-bOibMOT6.js +1 -0
- package/dist/assets/useDevice-JbC1lVOL.js +1 -0
- package/dist/assets/useEventInvalidation-CYNi1aEm.js +1 -0
- package/dist/assets/useFaultTypeOptions-BCjpEaI1.js +1 -0
- package/dist/assets/useInvalidateAddonSettings-CyofQfBo.js +1 -0
- package/dist/assets/useNodeUrlSelection-DBU1LRHP.js +1 -0
- package/dist/assets/useTranslation-uIxPZ_3N.js +1 -0
- package/dist/assets/user-x-DkWcmF99.js +1 -0
- package/dist/assets/variable-DTEpBbRf.js +1 -0
- package/dist/assets/virtualExposes-SIMIW5lI.js +1 -0
- package/dist/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BZ1YRJXZ.js +5 -0
- package/dist/assets/virtual_mf-exposes___mfe_internal__admin_ui_host__remoteEntry-_hash_-DnnXQRkG.js +1 -0
- package/dist/assets/vite-preload-helper-kNaey6uv.js +1 -0
- package/dist/assets/waypoints-CuxO4XzY.js +1 -0
- package/dist/brand/logo-dark.svg +1 -0
- package/dist/brand/logo-horizontal-dark.svg +1 -0
- package/dist/brand/logo-horizontal-light.svg +1 -0
- package/dist/brand/logo-light.svg +1 -0
- package/dist/brand/logo-wide-dark.svg +1 -0
- package/dist/brand/logo-wide-light.svg +1 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons/apple-touch-icon.png +0 -0
- package/dist/icons/icon-192.png +0 -0
- package/dist/icons/icon-512-maskable.png +0 -0
- package/dist/icons/icon-512.png +0 -0
- package/dist/index.html +190 -0
- package/dist/manifest.webmanifest +27 -0
- package/dist/server/addon.js +9135 -0
- package/dist/sw.js +17 -0
- package/package.json +124 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,J as t,K as n,R as r,S as i,V as a,Y as o,et as s,x as ee}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Di as te,Oo as c,To as l,U as u,n as d,q as ne,rt as f,z as p,zt as m}from"./player-overlays-qzCoRsrQ.js";import{MaskShapeCanvas as h}from"./MaskShapeCanvas-T6ZNfW4J.js";s();var re=110,g=`motion-zones`,_=0,v=[1,2,3],y=1,b=`rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,x=`rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors`;function S(e,t,n){let r=t*n,i=Array.from({length:r});for(let t=0;t<r;t+=1)i[t]=e[t]===!0;return i}function C(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function w(e,t){return Math.ceil(e/t)}function T(e,t,n){return Math.min(n-1,Math.floor((e+.5)/t*n))}function E(e,t,n,r){let i=w(t,r),a=w(n,r),o=Array.from({length:i*a},()=>!1);for(let r=0;r<n;r+=1){let s=T(r,n,a);for(let n=0;n<t;n+=1)e[r*t+n]===!0&&(o[s*i+T(n,t,i)]=!0)}return o}function D(e,t,n,r){let i=w(t,r),a=w(n,r),o=Array.from({length:t*n},()=>!1);for(let r=0;r<n;r+=1){let s=T(r,n,a);for(let n=0;n<t;n+=1)o[r*t+n]=e[s*i+T(n,t,i)]===!0}return o}function O({deviceId:s}){let T=c(),O=ne(m().trpcClient,s),[k,A]=o(null),[j,M]=o(!1),[N,P]=o(null),[F,I]=o(null),[L,R]=o(y),[z,B]=o(!1),[V,H]=o(!1),U=t(!1);a(()=>{if(!O)return;let e=!1;return U.current=!1,A(null),M(!1),P(null),I(null),R(y),H(!1),(async()=>{try{let t=await O.motionZones?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(A(t),U.current)return;let n=await O.motionZones?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);U.current=!0;let r=n.regions.find(e=>e.shape.kind===`grid`),i=S(r?r.shape.cells:[],t.grid.width,t.grid.height);I(i),P(E(i,t.grid.width,t.grid.height,y))}catch(t){if(e)return;u(t)?M(!0):console.error(`Motion Zones load failed`,t)}})(),()=>{e=!0}},[O]);let W=k?k.grid.width:0,G=k?k.grid.height:0,K=w(W,L),q=w(G,L),J=n(()=>N&&k?D(N,W,G,L):null,[N,k,W,G,L]),Y=n(()=>J!==null&&F!==null&&!C(J,F),[J,F]),ie=n(()=>J?J.reduce((e,t)=>t?e+1:e,0):0,[J]),ae=W*G,X=K*q,Z=r(e=>{X>0&&P(Array.from({length:X},()=>e))},[X]),oe=r(()=>{P(e=>e&&e.map(e=>!e))},[]),se=r(()=>{F&&k&&P(E(F,W,G,L))},[F,k,W,G,L]),ce=r(e=>{e===L||!k||P(t=>{if(!t)return R(e),t;let n=E(D(t,W,G,L),W,G,e);return R(e),n})},[L,k,W,G]),Q=n(()=>k&&N?[{id:_,shape:{kind:`grid`,gridWidth:K,gridHeight:q,cells:[...N]}}]:[],[k,N,K,q]),$=r((e,t)=>{t.kind===`grid`&&P(t.cells)},[]),le=r(async()=>{if(!(!O||!N||!k)){B(!0);try{let e=D(N,k.grid.width,k.grid.height,L),t={kind:`grid`,gridWidth:k.grid.width,gridHeight:k.grid.height,cells:e};await O.motionZones?.setZone({patch:{regions:[{id:_,enabled:!0,shape:t}]}});let n=await O.motionZones?.getStatus({});if(n){let e=n.regions.find(e=>e.shape.kind===`grid`),t=S(e?e.shape.cells:[],k.grid.width,k.grid.height);I(t),P(E(t,k.grid.width,k.grid.height,L))}}catch(e){console.error(`Motion Zones save failed`,e)}finally{B(!1)}}},[O,N,k,L]);d(n(()=>V&&!j&&k&&N?{id:g,order:re,node:i(h,{transparent:!0,items:Q,supportedShapes:[`grid`],grid:{width:K,height:q},selectedId:_,onSelect:()=>{},onShapeChange:$,onDrawComplete:()=>{},drawingKind:null})}:null,[V,j,k,N,Q,$,K,q]));let ue=!j&&k!==null&&N!==null;return O?i(f,{title:T(`uiLibrary.motionZones.title`,`Motion Zones`),icon:i(te,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:i(`div`,{className:`flex flex-col gap-3`,children:j?i(`p`,{className:`${p} leading-relaxed`,children:T(`uiLibrary.motionZones.unsupported`,`This camera doesn't expose an on-board motion zones grid.`)}):ue?e(ee,{children:[i(`p`,{className:`${p} leading-relaxed`,children:i(l,{uiKey:`uiLibrary.motionZones.intro`,fallback:`Toggle <0>Edit grid</0> to paint the region directly on the live frame, then <1>Save</1> to push the mask to the camera. Pick a bigger <2>Cell size</2> for quicker, broad-stroke painting — it's resampled to the camera's native {{width}}×{{height}} grid on save (×1 is the finest).`,components:[i(`strong`,{className:`text-foreground`},`e`),i(`strong`,{className:`text-foreground`},`s`),i(`strong`,{className:`text-foreground`},`c`)],values:{width:k.grid.width,height:k.grid.height}})}),e(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[i(`button`,{type:`button`,onClick:()=>H(e=>!e),disabled:z,"aria-pressed":V,className:V?x:b,children:V?T(`uiLibrary.motionZones.doneEditing`,`Done editing`):T(`uiLibrary.motionZones.editGrid`,`Edit grid`)}),i(`button`,{type:`button`,onClick:()=>Z(!0),disabled:z,className:b,children:T(`uiLibrary.motionZones.allOn`,`All on`)}),i(`button`,{type:`button`,onClick:()=>Z(!1),disabled:z,className:b,children:T(`uiLibrary.motionZones.allOff`,`All off`)}),i(`button`,{type:`button`,onClick:oe,disabled:z,className:b,children:T(`uiLibrary.motionZones.invert`,`Invert`)}),e(`div`,{className:`flex items-center gap-1 ml-1`,role:`group`,"aria-label":T(`uiLibrary.motionZones.cellSize`,`Cell size`),children:[i(`span`,{className:`${p} mr-0.5`,children:T(`uiLibrary.motionZones.cellSize`,`Cell size`)}),v.map(t=>e(`button`,{type:`button`,onClick:()=>ce(t),disabled:z,"aria-pressed":L===t,title:t===1?T(`uiLibrary.motionZones.cameraGrid`,`Camera grid {{width}}×{{height}} (finest)`,{width:W,height:G}):T(`uiLibrary.motionZones.paintingGrid`,`{{width}}×{{height}} painting grid · cells ×{{factor}} bigger`,{width:w(W,t),height:w(G,t),factor:t}),className:L===t?x:b,children:[`×`,t]},t))]}),e(`span`,{className:`${p} ml-1 tabular-nums`,children:[T(`uiLibrary.motionZones.cells`,`{{active}} / {{total}} cells · {{width}}×{{height}}`,{active:ie,total:ae,width:k.grid.width,height:k.grid.height}),L===1?``:T(`uiLibrary.motionZones.paintSuffix`,` · paint {{width}}×{{height}}`,{width:K,height:q})]}),i(`span`,{className:`flex-1`}),i(`button`,{type:`button`,onClick:se,disabled:z||!Y,className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,children:T(`uiLibrary.motionZones.revert`,`Revert`)}),i(`button`,{type:`button`,onClick:()=>void le(),disabled:z||!Y,className:x,children:z?T(`uiLibrary.motionZones.saving`,`Saving…`):T(`uiLibrary.motionZones.save`,`Save`)})]})]}):i(`p`,{className:`${p} leading-relaxed`,children:T(`uiLibrary.motionZones.loading`,`Loading the camera's grid…`)})})}):null}export{O as MotionZonesSettings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./browser-BHo8W_uH.js","./rolldown-runtime-Cyuzqnbw.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{t}from"./vite-preload-helper-kNaey6uv.js";import{C as n,J as r,K as i,S as a,V as o,Y as s,a as c,et as l,t as u,x as d}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{$i as f,$n as p,Ar as m,Oo as h,Ri as g,Un as _,_n as v,at as y,ba as b,bt as x,ht as S,io as C,li as w,mi as T,oi as E,ri as D,va as O,xn as k,xt as A,yt as j,zt as M}from"./player-overlays-qzCoRsrQ.js";import{Ui as N,Wi as ee}from"./src-CJoX3s-1.js";import{c as te,i as P}from"./terminal-BncJ-1sF.js";import{t as ne}from"./monitor-smartphone-DPI9EQus.js";import{t as F}from"./unlink-D3-IGpS8.js";import{Im as I,Nr as re,Xi as ie,Zi as ae,gu as oe,ht as se,vu as ce,za as le}from"./src-Cf1Uvi4o.js";import{i as L,p as ue}from"./chunk-4ZMWKKQ3-BCeNTgXs.js";import{t as de}from"./i18n-BHLBFC1-.js";import{t as R}from"./useTranslation-uIxPZ_3N.js";import"./mount-CYNi1aEm.js";import{c as z,i as B,l as V,s as H}from"./sso-popup-CPavla3I.js";import{n as U}from"./auth-context-CkfOTCG-.js";import{$t as W,g as fe,h as pe,n as G}from"./index-C1r-vzdu.js";import{t as me}from"./AdminSectionedPage-3XsaKUPh.js";import{t as he}from"./AdminPage-CA4Sxydy.js";import{_ as ge,a as _e,h as ve,r as ye,t as be,w as xe}from"./SessionsList-BoOCsi8N.js";l();var Se=`${N}/connect`,K={public:0,mesh:1,lan:2,"lan-ipv6":3};function Ce(e){switch(e.kind){case`public`:return e.interfaceKind===`vpn`?`mesh`:`public`;case`lan-ipv4`:return`lan`;case`lan-ipv6`:return`lan-ipv6`;case`custom`:return`public`;case`loopback`:case`app-link`:return null}}function q(e){return ee(e)}function we(e){return e.startsWith(`https://`)}function Te(e){let t=e.flatMap(e=>{let t=Ce(e),n=q(e.baseUrl);return t===null||n===null?[]:[{endpoint:e,tier:t,origin:n}]}).toSorted((e,t)=>K[e.tier]-K[t.tier]||Number(t.endpoint.plausible)-Number(e.endpoint.plausible)||e.endpoint.priority-t.endpoint.priority),n=new Set;return t.flatMap(({endpoint:e,tier:t,origin:r})=>n.has(r)?[]:(n.add(r),[{origin:r,label:e.label,tier:t,secure:we(r),plausible:e.plausible}]))}function Ee(e,t,n=null){for(let r of[t,n]){if(r===null)continue;let t=q(r),n=e.find(e=>e.origin===t);if(n!==void 0)return n}return e[0]??null}function De(e){let t=new URL(Se);return t.searchParams.set(`hub`,e),t.toString()}var Oe=176,J={scheme:`https`};function ke(){let{t:e}=R(),t=ce(J),r=oe(J).data?.roles.publicEndpoint.resolved??null;return n(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[n(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[a(_,{className:`h-3.5 w-3.5 text-foreground-subtle`}),a(`div`,{className:`text-xs font-semibold text-foreground`,children:e(`connectPhone.title`)})]}),n(`div`,{className:`p-4 space-y-3`,children:[a(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`connectPhone.description`)}),t.isPending?n(`div`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[a(E,{className:`h-3.5 w-3.5 animate-spin`}),e(`connectPhone.loading`)]}):t.isError?n(`div`,{className:`flex items-start gap-2 text-[11px] text-danger`,children:[a(v,{className:`h-3.5 w-3.5 mt-0.5 shrink-0`}),n(`div`,{className:`flex-1 min-w-0 space-y-1.5`,children:[a(`div`,{className:`break-words`,children:e(`connectPhone.error`,{message:t.error.message})}),a(j,{size:`sm`,variant:`ghost`,onClick:()=>void t.refetch(),children:e(`connectPhone.retry`)})]})]}):a(Ae,{candidates:Te(t.data.endpoints),preferredOrigin:r})]})]})}function Ae({candidates:e,preferredOrigin:t}){let{t:r}=R(),[o,c]=s(null),l=Ee(e,o,t),u=i(()=>l?De(l.origin):null,[l]);if(l===null||u===null)return a(`p`,{className:`text-[11px] text-foreground-subtle`,children:r(`connectPhone.empty`)});let d=e=>r(`connectPhone.tier.${e}`),f=e.map(e=>({value:e.origin,label:`${d(e.tier)} — ${e.origin}`}));return n(`div`,{className:`flex flex-col sm:flex-row gap-4`,children:[a(ie,{value:u,size:Oe,alt:r(`connectPhone.qrAlt`),className:`self-start`}),n(`div`,{className:`flex-1 min-w-0 space-y-3`,children:[n(`label`,{className:`block space-y-1`,children:[a(`span`,{className:`text-[11px] font-medium text-foreground`,children:r(`connectPhone.addressLabel`)}),a(x,{value:l.origin,options:f,onChange:e=>c(e.target.value)}),n(`span`,{className:`block text-[10px] text-foreground-subtle`,children:[d(l.tier),` · `,l.label]})]}),!l.secure&&a(Y,{text:r(`connectPhone.insecure`)}),!l.plausible&&a(Y,{text:r(`connectPhone.implausible`)}),n(`div`,{className:`space-y-1`,children:[a(`span`,{className:`text-[11px] font-medium text-foreground`,children:r(`connectPhone.linkLabel`)}),n(`div`,{className:`flex items-center gap-1 rounded-md border border-border bg-background px-2 py-1`,children:[a(`code`,{className:`flex-1 min-w-0 font-mono text-[11px] text-foreground break-all select-all`,children:u}),a(re,{value:u,srLabel:r(`connectPhone.linkLabel`)})]})]}),a(`p`,{className:`text-[11px] text-foreground-subtle`,children:r(`connectPhone.signInHint`)})]})]})}function Y({text:e}){return n(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-1.5 text-[11px] text-foreground`,children:[a(v,{className:`h-3.5 w-3.5 text-warning mt-0.5 shrink-0`}),a(`span`,{children:e})]})}l();function je(e){return new Date(e).toLocaleDateString()}function Me(){let{t:e}=R(),t=S(),i=I.useUtils(),c=I.auth.listLinkableProviders.useQuery(),l=I.auth.listOwnExternalIdentities.useQuery(),[u,d]=s(null),[f,p]=s(()=>V(window.location.search)),m=r(null),h=G(`Linking a sign-in account`),g=r(null);o(()=>()=>g.current?.(),[]);let[_,v]=s(null);o(()=>{if(f===null)return;let e=new URL(window.location.href);e.searchParams.delete(`linked`),e.searchParams.delete(`linkError`),window.history.replaceState({},``,e.pathname+e.search+e.hash)},[f]);let x=I.auth.beginExternalLink.useMutation({onSuccess:({url:e})=>{let t=m.current;if(m.current=null,t===null||t.closed){window.location.assign(e);return}let n=e=>{v(null),p(V(`?${e}`)),i.auth.listOwnExternalIdentities.invalidate()};g.current?.(),g.current=H(t,{onReturn:e=>{e.target===`profile`&&n(e.query)},onDone:e=>{e.target===`profile`&&n(e.query)},onClosed:()=>{g.current?.(),g.current=null,i.auth.listOwnExternalIdentities.invalidate()}}),t.location.href=y(z(e))},onError:e=>{m.current?.close(),m.current=null,v(null),d(e.message)}}),C=I.auth.unlinkOwnExternalIdentity.useMutation({onSuccess:()=>void i.auth.listOwnExternalIdentities.invalidate(),onError:e=>d(e.message)}),T=c.data??[],D=l.data??[],k=_!==null&&D.some(e=>e.provider===_);if(o(()=>{!k||_===null||(v(null),p({kind:`linked`,provider:_}))},[k,_]),T.length===0&&D.length===0)return null;let A=new Set(D.map(e=>e.provider)),M=e=>T.find(t=>t.provider===e)?.label??e,N=async(n,r)=>{await t({title:e(`users.linkedSignInsSection.unlinkSignInAccount`,`Unlink sign-in account`),message:e(`users.linkedSignInsSection.stopSigningInWithThis`,`Stop signing in with this {{label}} account?`,{label:r}),confirmLabel:e(`users.linkedSignInsSection.unlink`,`Unlink`),variant:`danger`})&&(d(null),C.mutate({provider:n.provider,subject:n.subject}))};return n(`div`,{"data-testid":`linked-sign-ins`,className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[h.dialog,n(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[a(w,{className:`h-3.5 w-3.5 text-foreground-subtle`}),a(`div`,{className:`text-xs font-semibold text-foreground`,children:e(`users.linkedSignInsSection.linkedSignInAccounts`,`Linked sign-in accounts`)})]}),n(`div`,{className:`p-4 space-y-3`,children:[a(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`users.linkedSignInsSection.signInWithAnExternal`,`Sign in with an external account instead of your password. Only accounts you link here can sign you in; your two-factor authentication still applies.`)}),f?.kind===`linked`&&n(`div`,{className:`flex items-center gap-2 rounded-md border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 text-xs text-foreground`,children:[a(O,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}),e(`users.linkedSignIns.linkedNotice`,{provider:M(f.provider)})]}),(f?.kind===`error`||u)&&n(`div`,{className:`flex items-center gap-2 rounded-md border border-danger/20 bg-danger/10 px-3 py-2 text-xs text-danger`,children:[a(b,{className:`h-3.5 w-3.5 shrink-0`}),u??(f?.kind===`error`?f.message:``)]}),D.length>0&&a(`ul`,{className:`divide-y divide-border rounded-md border border-border`,children:D.map(t=>{let r=t.providerLabel??t.provider;return n(`li`,{className:`flex items-center gap-3 px-3 py-2 text-xs`,children:[n(`div`,{className:`flex-1 min-w-0`,children:[n(`div`,{className:`font-medium text-foreground truncate`,children:[r,!t.available&&a(`span`,{className:`ml-2 rounded bg-foreground-subtle/15 px-1.5 py-0.5 text-[10px] font-normal text-foreground-subtle`,children:e(`users.linkedSignInsSection.providerUnavailable`,`provider unavailable`)})]}),a(`div`,{className:`text-[11px] text-foreground-subtle truncate`,children:e(`users.linkedSignIns.linkedOn`,{label:t.label??t.subject,date:je(t.linkedAt)})})]}),n(j,{variant:`unstyled`,onClick:()=>void N(t,r),disabled:C.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] text-danger hover:bg-danger/10 disabled:opacity-50`,children:[a(F,{className:`h-3 w-3`}),e(`users.linkedSignInsSection.unlink`,`Unlink`)]})]},`${t.provider}|${t.subject}`)})}),a(`div`,{className:`flex flex-wrap gap-2`,children:T.filter(e=>!A.has(e.provider)).map(t=>n(j,{variant:`unstyled`,onClick:()=>{d(null),p(null),h.requestProof().then(e=>{e!==null&&(m.current=B(null),v(m.current===null?null:t.provider),x.mutate({provider:t.provider,reauthToken:e}))})},disabled:x.isPending,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1 text-[11px] font-medium text-foreground hover:bg-surface-hover disabled:opacity-50`,children:[x.isPending&&x.variables?.provider===t.provider?a(E,{className:`h-3 w-3 animate-spin`}):a(w,{className:`h-3 w-3`}),e(`users.linkedSignIns.link`,{provider:t.label})]},t.provider))})]})]})}l();function Ne({value:r,size:i=192}){let{t:c}=R(),[l,u]=s(null),[d,f]=s(null);if(o(()=>{let n=!1;return t(()=>import(`./browser-BHo8W_uH.js`).then(t=>e(t.default,1)).then(async e=>{if(n)return;let t=e.create;if(typeof t!=`function`){f(`qrcode.create() unavailable in installed version`);return}try{let e=t(r,{errorCorrectionLevel:`M`});n||u(e)}catch(e){n||f(e instanceof Error?e.message:`QR generation failed`)}}),__vite__mapDeps([0,1]),import.meta.url).catch(()=>{n||f(`qrcode library not installed`)}),()=>{n=!0}},[r]),d)return a(`div`,{className:`flex items-center justify-center text-[10px] text-foreground-subtle text-center p-4`,style:{width:i,height:i},children:c(`users.totpQrCode.qrRenderingUnavailableUseThe`,`QR rendering unavailable — use the secret below.`)});if(!l)return a(`div`,{className:`flex items-center justify-center text-[10px] text-foreground-subtle animate-pulse`,style:{width:i,height:i},children:c(`users.totpQrCode.generating`,`Generating…`)});let p=l.modules.size,m=i/p,h=[];for(let e=0;e<p;e++)for(let t=0;t<p;t++)l.modules.data[e*p+t]&&h.push(a(`rect`,{x:t*m,y:e*m,width:m,height:m,fill:`currentColor`},`${t}-${e}`));return n(`svg`,{width:i,height:i,viewBox:`0 0 ${i} ${i}`,className:`text-black`,children:[a(`rect`,{x:0,y:0,width:i,height:i,fill:`white`}),h]})}l();function Pe(){let{t:e}=R(),t=M(),[r,i]=s(``),[o,c]=s(``),[l,d]=s(``),[f,p]=s(null),m=u({mutationFn:e=>t.changeOwnPassword(e),onSuccess:()=>{p({kind:`success`,msg:`Password updated.`}),i(``),c(``),d(``)},onError:e=>{p({kind:`error`,msg:e instanceof Error?e.message:`Update failed`})}}),h=o.length>0&&l.length>0&&o!==l,g=o.length>0&&o.length<8,_=r.length>=1&&o.length>=8&&o===l;return n(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[n(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[a(te,{className:`h-3.5 w-3.5 text-foreground-subtle`}),a(`div`,{className:`text-xs font-semibold text-foreground`,children:e(`systemPage.myAccess.changePassword`,`Change password`)})]}),n(`div`,{className:`p-4 space-y-3`,children:[a(X,{label:e(`systemPage.myAccess.currentPassword`,`Current password`),value:r,onChange:i,autoComplete:`current-password`}),a(X,{label:e(`systemPage.myAccess.newPassword`,`New password`),value:o,onChange:c,autoComplete:`new-password`,hint:e(`systemPage.myAccess.atLeast8Characters`,`At least 8 characters.`)}),a(X,{label:e(`systemPage.myAccess.confirmNewPassword`,`Confirm new password`),value:l,onChange:d,autoComplete:`new-password`}),(h||g)&&a(`div`,{className:`text-[11px] text-danger`,children:h?e(`systemPage.myAccess.passwordsDoNotMatch`,`Passwords do not match.`):e(`systemPage.myAccess.newPasswordMustBeAt`,`New password must be at least 8 characters.`)}),f&&n(`div`,{className:`text-[11px] flex items-center gap-1 ${f.kind===`success`?`text-success`:`text-danger`}`,children:[f.kind===`success`?a(O,{className:`h-3 w-3`}):a(b,{className:`h-3 w-3`}),f.msg]}),a(`div`,{className:`flex justify-end`,children:n(j,{onClick:()=>{p(null),m.mutate({currentPassword:r,newPassword:o})},disabled:!_||m.isPending,children:[m.isPending?a(E,{className:`h-3 w-3 animate-spin`}):a(D,{className:`h-3 w-3`}),e(`systemPage.myAccess.updatePassword`,`Update password`)]})})]})]})}function X({label:e,value:t,onChange:r,autoComplete:i,hint:o}){return n(`div`,{className:`space-y-1`,children:[a(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e}),a(A,{type:`password`,value:t,onChange:e=>r(e.target.value),autoComplete:i,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),o&&a(`div`,{className:`text-[10px] text-foreground-subtle`,children:o})]})}function Fe({username:e}){let{t}=R(),r=M(),l=c({queryKey:[`auth`,`getOwnTotpStatus`],queryFn:()=>r.getOwnTotpStatus()}),p=l.data,[m,h]=s(null),[g,v]=s(``),[y,x]=s(null),[S,C]=s(!1),w=u({mutationFn:()=>r.setupOwnTotp(),onSuccess:e=>{h({secret:e.secret,otpauthUrl:e.otpauthUrl}),v(``),x(null)},onError:e=>x(e instanceof Error?e.message:`Setup failed`)}),T=u({mutationFn:e=>r.confirmOwnTotp(e),onSuccess:()=>{h(null),v(``),x(null),l.refetch()},onError:e=>x(e instanceof Error?e.message:`Confirmation failed — code did not match`)}),D=G(`Turning off two-factor authentication`),k=u({mutationFn:async()=>{let e=await D.requestProof();return e===null?null:r.disableOwnTotp({reauthToken:e})},onSuccess:()=>{x(null),l.refetch()},onError:e=>x(e instanceof Error?e.message:`Disable failed`)});o(()=>{if(!S)return;let e=setTimeout(()=>C(!1),1500);return()=>clearTimeout(e)},[S]);let N=i(()=>l.isLoading?`loading`:m?`setup_in_progress`:p?.enabled?`enrolled`:`not_enrolled`,[l.isLoading,p?.enabled,m]);return n(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[D.dialog,n(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[a(_,{className:`h-3.5 w-3.5 text-foreground-subtle`}),a(`div`,{className:`text-xs font-semibold text-foreground`,children:t(`systemPage.myAccess.twoFactorAuthentication`,`Two-factor authentication`)})]}),n(`div`,{className:`p-4 space-y-3`,children:[N===`loading`&&n(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[a(E,{className:`h-3.5 w-3.5 animate-spin`}),t(`systemPage.myAccess.checkingStatus`,`Checking status…`)]}),N===`not_enrolled`&&n(d,{children:[a(`div`,{className:`text-xs text-foreground-subtle`,children:t(`systemPage.myAccess.2faIsnTActiveOn`,`2FA isn't active on your account. Enable it to require a 6-digit code from your authenticator app at every login.`)}),a(`div`,{className:`flex justify-end`,children:n(j,{onClick:()=>{x(null),w.mutate()},disabled:w.isPending,children:[w.isPending?a(E,{className:`h-3 w-3 animate-spin`}):a(_,{className:`h-3 w-3`}),t(`systemPage.myAccess.enable2fa`,`Enable 2FA`)]})})]}),N===`setup_in_progress`&&m&&n(d,{children:[a(`div`,{className:`text-[11px] text-foreground-subtle`,children:a(W,{i18nKey:`systemPage.myAccess.scanQr`,values:{username:e},components:{mono:a(`span`,{className:`font-mono`})}})}),n(`div`,{className:`flex flex-col items-center gap-3`,children:[a(`div`,{className:`rounded-lg border border-border bg-white p-3`,children:a(Ne,{value:m.otpauthUrl,size:180})}),n(`div`,{className:`w-full`,children:[a(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle mb-1`,children:t(`systemPage.myAccess.secretManualEntry`,`Secret (manual entry)`)}),n(`div`,{className:`flex items-center gap-2 rounded border border-border bg-surface-hover/30 px-2 py-1.5`,children:[a(`code`,{className:`text-[11px] font-mono text-foreground break-all flex-1`,children:m.secret}),n(j,{variant:`ghost`,onClick:()=>{m&&navigator.clipboard.writeText(m.secret).then(()=>C(!0))},children:[S?a(O,{className:`h-3 w-3 text-success`}):a(f,{className:`h-3 w-3`}),S?t(`systemPage.myAccess.copied`,`Copied`):t(`common.copy`,`Copy`)]})]})]})]}),n(`div`,{className:`space-y-1`,children:[a(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`6-digit code`}),a(A,{type:`text`,inputMode:`numeric`,autoComplete:`one-time-code`,placeholder:`123456`,value:g,onChange:e=>v(e.target.value.replace(/\D/g,``).slice(0,6)),className:`w-full rounded-md border border-border bg-surface px-3 py-2 text-center text-lg font-mono tracking-widest text-foreground focus:outline-none focus:ring-2 focus:ring-primary`})]}),y&&n(`div`,{className:`text-[11px] text-danger flex items-center gap-1`,children:[a(b,{className:`h-3 w-3`}),y]}),n(`div`,{className:`flex justify-end gap-2`,children:[a(j,{variant:`outline`,onClick:()=>{h(null),x(null),v(``)},children:t(`common.cancel`,`Cancel`)}),n(j,{onClick:()=>{x(null),T.mutate({code:g})},disabled:T.isPending||g.length!==6,children:[T.isPending?a(E,{className:`h-3 w-3 animate-spin`}):a(O,{className:`h-3 w-3`}),t(`common.confirm`,`Confirm`)]})]})]}),N===`enrolled`&&p&&n(d,{children:[n(`div`,{className:`rounded-md border border-success/30 bg-success/5 px-3 py-2.5 flex items-start gap-2.5`,children:[a(O,{className:`h-4 w-4 mt-0.5 text-success shrink-0`}),n(`div`,{className:`text-xs text-foreground space-y-0.5`,children:[a(`div`,{className:`font-medium`,children:t(`systemPage.myAccess.2faIsActive`,`2FA is active`)}),a(`div`,{className:`text-foreground-subtle`,children:t(`common.enrolledOn`,{when:p.confirmedAt?new Date(p.confirmedAt).toLocaleString():`—`})})]})]}),y&&n(`div`,{className:`text-[11px] text-danger flex items-center gap-1`,children:[a(b,{className:`h-3 w-3`}),y]}),a(`div`,{className:`flex justify-end`,children:n(j,{variant:`danger`,onClick:()=>{x(null),k.mutate()},disabled:k.isPending,children:[k.isPending?a(E,{className:`h-3 w-3 animate-spin`}):a(_,{className:`h-3 w-3`}),t(`systemPage.myAccess.disable2fa`,`Disable 2FA`)]})})]})]})]})}function Ie(){return le(`auth-webauthn/passkey-enrollment`)?a(ae,{widgetId:`auth-webauthn/passkey-enrollment`,host:`dashboard`}):null}l();function Z(e){return e.message.length>0?e.message:de.t(`auth.authAuditSection.requestFailed`)}function Le(){let{t:e}=R(),{logout:t}=U(),r=S(),i=I.useUtils(),o=I.auth.listOwnSessions.useQuery(),[c,l]=s(null),u=I.auth.revokeOwnSession.useMutation({onSuccess:()=>void i.auth.listOwnSessions.invalidate(),onError:e=>l(`Sign out failed: ${Z(e)}`)}),d=I.auth.logout.useMutation({onSuccess:()=>t(),onError:e=>l(`Sign out failed: ${Z(e)}`)}),f=async t=>{await r({title:e(`auth.mySessionsSection.signOutThisSession`,`Sign out this session`),message:e(`auth.mySessionsSection.willHaveToSignIn`,`{{label}} will have to sign in again.`,{label:ge(t.client).label}),confirmLabel:e(`auth.mySessionsSection.signOut`,`Sign out`),variant:`danger`})&&(l(null),u.mutate({id:t.id}))},p=async()=>{await r({title:e(`auth.mySessionsSection.signOutEverywhere`,`Sign out everywhere`),message:e(`auth.mySessionsSection.everySessionOfYourAccount`,`Every session of your account ends, this browser included: you will be signed out here too and every device has to sign in again.`),confirmLabel:e(`auth.mySessionsSection.signOutEverywhere`,`Sign out everywhere`),variant:`danger`})&&(l(null),d.mutate({everywhere:!0}))};return n(`div`,{"data-testid":`my-sessions`,className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[n(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[a(ne,{className:`h-3.5 w-3.5 text-foreground-subtle`}),a(`div`,{className:`text-xs font-semibold text-foreground`,children:e(`auth.mySessionsSection.activeSessions`,`Active sessions`)})]}),n(`div`,{className:`p-4 space-y-3`,children:[a(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`auth.mySessionsSection.theBrowsersAndAppsSigned`,`The browsers and apps signed in to your account. Signing one out ends it at once.`)}),c!==null&&a(`div`,{className:`text-[11px] text-danger`,children:c}),a(be,{sessions:o.data??[],isLoading:o.isLoading,loadError:o.isError?o.error?.message??e(`auth.authAuditSection.requestFailed`):null,emptyText:`No active sessions.`,onRevoke:e=>void f(e),revokingId:u.isPending?u.variables?.id??null:null}),a(`div`,{className:`flex justify-end`,children:n(j,{variant:`unstyled`,onClick:()=>void p(),disabled:d.isPending,className:`inline-flex items-center gap-1.5 rounded border border-danger/40 px-2.5 py-1 text-[11px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,children:[d.isPending?a(E,{className:`h-3 w-3 animate-spin`}):a(P,{className:`h-3 w-3`}),e(`auth.mySessionsSection.signOutEverywhere`,`Sign out everywhere`)]})})]})]})}l();var Re=`You`;function Q(){let{t:e}=R(),t=S(),n=I.useUtils(),r=I.auth.listOwnDeviceCredentials.useQuery(),[o,c]=s(null),l=I.auth.revokeOwnDeviceCredential.useMutation({onSuccess:e=>{e.revoked||c(`That device could not be revoked - it may already be gone.`),n.auth.listOwnDeviceCredentials.invalidate()},onError:e=>c(`Revoke failed: ${e.message}`)}),u=i(()=>(r.data??[]).map(e=>ye(e,Re)),[r.data]),d=async n=>{await t({title:e(`certificates.myDevicesSection.revoke`,`Revoke "{{name}}"?`,{name:n.name}),message:e(`certificates.myDevicesSection.theDeviceStopsSigningIn`,`The device stops signing in at once and its open sessions end. To use it again you have to pair it anew. This cannot be undone.`),confirmLabel:e(`certificates.myDevicesSection.revoke2`,`Revoke`),variant:`danger`})&&(c(null),l.mutate({id:n.id}))},f={label:e(`certificates.myDevicesSection.revoke2`,`Revoke`),icon:C,isAvailable:_e,onRun:e=>void d(e),busyId:l.isPending?l.variables?.id??null:null,disabled:l.isPending};return a(pe,{id:`my-devices`,title:e(`certificates.myDevicesSection.myDevices`,`My devices`),icon:_,description:e(`certificates.myDevicesSection.phonesThatStaySignedIn`,`Phones that stay signed in to your account with a certificate. If one is lost, revoke it here and it is signed out at once.`),notice:fe(o),onDismissNotice:()=>c(null),children:a(xe,{rows:u,label:e(`certificates.devicesCard.label`),isLoading:r.isPending,loadError:r.error===null?null:r.error.message||`Request failed`,emptyText:`No devices are signed in with a certificate.`,hideOwner:!0,expiresNone:`—`,action:f})})}var $={profile:`profile`,signIn:`sign-in`,sessions:`sessions`,tokens:`tokens`},ze=[`linked`,`linkError`],Be={view:{icon:g,cls:`bg-foreground-subtle/15 text-foreground-subtle`},create:{icon:m,cls:`bg-primary/15 text-primary`},delete:{icon:k,cls:`bg-danger/15 text-danger`}};function Ve(){let{t:e}=R(),{user:t,logout:r}=U(),[i]=ue(),o=e(`system.myAccess`,`My access`);if(!t)return a(he,{icon:p,title:o,children:a(`div`,{className:`text-xs text-foreground-subtle`,children:e(`systemPage.myAccess.notSignedIn`,`Not signed in.`)})});if(i.get(`tab`)===`preferences`)return a(L,{to:`/system/settings`,replace:!0});if(ze.some(e=>i.has(e))&&!i.has(`tab`)){let e=new URLSearchParams(i);return e.set(`tab`,$.signIn),a(L,{to:`?${e.toString()}`,replace:!0})}return a(me,{icon:p,title:o,subtitle:e(`systemPage.myAccess.subtitle`,`Your account, how you sign in, where you are signed in, and your tokens.`),sectionsLabel:e(`systemPage.myAccess.sectionsLabel`,`My access sections`),defaultSection:$.profile,actions:n(j,{variant:`outline`,onClick:r,children:[a(P,{className:`h-3 w-3`}),e(`systemPage.myAccess.signOut`,`Sign out`)]}),sections:[{id:$.profile,label:e(`systemPage.myAccess.sections.profile`,`Profile`),content:a(He,{user:t})},{id:$.signIn,label:e(`systemPage.myAccess.sections.signIn`,`Sign-in & security`),content:n(`div`,{className:`space-y-4`,children:[a(Pe,{}),a(Fe,{username:t.username}),a(Ie,{}),a(Me,{})]})},{id:$.sessions,label:e(`systemPage.myAccess.sections.sessions`,`Sessions & devices`),content:n(`div`,{className:`space-y-4`,children:[a(Le,{}),a(Q,{}),a(ke,{})]})},{id:$.tokens,label:e(`systemPage.myAccess.sections.tokens`,`Tokens`),content:a(ve,{ownOnly:!0})}]})}function He({user:e}){let{t}=R(),r=e.isAdmin,i=e.scopes??[];return n(`div`,{className:`space-y-4`,children:[n(`div`,{className:`rounded-lg border border-border bg-surface px-4 py-3 flex items-center gap-3`,children:[a(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-primary font-semibold text-base`,children:e.username.slice(0,1).toUpperCase()}),n(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`text-sm font-semibold text-foreground truncate`,children:e.username}),n(`div`,{className:`text-[11px] text-foreground-subtle`,children:[r?t(`systemPage.myAccess.administrator`,`Administrator`):t(`systemPage.myAccess.user`,`User`),` `,a(W,{i18nKey:`systemPage.myAccess.sessionId`,values:{id:e.id.slice(0,8)},components:{mono:a(`span`,{className:`font-mono`})}})]})]})]}),r&&n(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 px-4 py-3 text-xs text-foreground flex items-start gap-2.5`,children:[a(T,{className:`h-4 w-4 text-primary mt-0.5 shrink-0`}),n(`div`,{children:[a(`div`,{className:`font-semibold text-foreground`,children:t(`systemPage.myAccess.unrestrictedAccess`,`Unrestricted access`)}),a(`p`,{className:`text-foreground-subtle mt-0.5`,children:t(`systemPage.myAccess.adminSessionsBypassThePer`,`Admin sessions bypass the per-call scope check. Every protected endpoint is reachable regardless of the list below.`)})]})]}),i.length>0&&a(Ue,{scopes:i})]})}function Ue({scopes:e}){let{t}=R(),r=h();return n(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[n(`div`,{className:`px-4 py-2 border-b border-border`,children:[a(`div`,{className:`text-xs font-semibold text-foreground`,children:t(`systemPage.myAccess.grantedScopes`,`Granted scopes`)}),a(`div`,{className:`text-[10px] text-foreground-subtle`,children:t(`systemPage.myAccess.bakedIntoYourSessionToken`,`Baked into your session token at login; sign out + back in to refresh after changes.`)})]}),n(`div`,{className:`grid grid-cols-[100px_1fr_240px] gap-3 px-4 py-2 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:[a(`div`,{children:t(`systemPage.myAccess.type`,`Type`)}),a(`div`,{children:t(`systemPage.myAccess.target`,`Target`)}),a(`div`,{children:t(`systemPage.myAccess.access`,`Access`)})]}),a(`ul`,{className:`divide-y divide-border`,children:e.map((e,i)=>n(`li`,{className:`grid grid-cols-[100px_1fr_240px] gap-3 px-4 py-2.5 items-center text-xs`,children:[a(`span`,{className:`font-mono text-foreground-subtle`,children:e.type}),a(`span`,{className:`font-mono text-foreground`,children:e.type===`device`?se(e.selector,r):e.target}),a(`div`,{className:`flex items-center gap-1`,children:[`view`,`create`,`delete`].map(r=>{let i=e.access.includes(r),{icon:o,cls:s}=Be[r];return n(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${i?s:`bg-transparent text-foreground-subtle/40 line-through`}`,title:i?t(`systemPage.myAccess.can`,`Can {{a}}`,{a:r}):t(`systemPage.myAccess.cannot`,`Cannot {{a}}`,{a:r}),children:[a(o,{className:`h-3 w-3`}),r]},r)})})]},i))})]})}export{Ve as MyAccessPage};
|