@linkshell/gateway 0.6.25 → 0.6.26

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/Dockerfile CHANGED
@@ -4,6 +4,8 @@ RUN corepack enable && corepack prepare pnpm@10.18.3 --activate
4
4
 
5
5
  WORKDIR /app
6
6
  COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
7
+ # Install and package builds share the workspace's cross-platform scripts.
8
+ COPY scripts/ scripts/
7
9
  # pnpm checks every patched dependency in the lockfile against its patch file.
8
10
  COPY patches/ patches/
9
11
  COPY packages/wire/package.json packages/wire/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkshell/gateway",
3
- "version": "0.6.25",
3
+ "version": "0.6.26",
4
4
  "description": "LinkShell gateway: relays end-to-end encrypted frames between computers and devices, and brokers pairing.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/render-CeOTtM6k.js","assets/markdown-SZOrMO_3.js","assets/account-R7yD1rZE.js","assets/terminal-DWFexEE4.js","assets/terminal-DOrYoP_4.css","assets/render-DpoQSszq.css"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const A="modulepreload",R=function(e){return"/"+e},_={},U=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let a=function(i){return Promise.all(i.map(f=>Promise.resolve(f).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),L=c?.nonce||c?.getAttribute("nonce");o=a(n.map(i=>{if(i=R(i),i in _)return;_[i]=!0;const f=i.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${m}`))return;const l=document.createElement("link");if(l.rel=f?"stylesheet":A,f||(l.as="script"),l.crossOrigin="",l.href=i,L&&l.setAttribute("nonce",L),document.head.appendChild(l),f)return new Promise((N,I)=>{l.addEventListener("load",N),l.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${i}`)))})}))}function r(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return o.then(a=>{for(const c of a||[])c.status==="rejected"&&r(c.reason);return t().catch(r)})},S=typeof window<"u"&&window.__LINKSHELL_CONFIG__?.desktop===!0,H="desktop:local",j="linkshell-desktop-visibility",q="linkshell-desktop-account",x="linkshell-desktop-error";let w,u,h,k=Promise.resolve(),b;const p=new Map;let g={},d,E=0;function O(e){window.dispatchEvent(new CustomEvent(x,{detail:e instanceof Error?e.message:String(e)}))}async function y(e,t={}){if(!S||!w)throw new Error("桌面工作台尚未连接,请重新打开窗口");if(!/^\/desktop\/[a-z]+$/.test(e))throw new Error("无效的桌面请求");const n=new Headers(t.headers);n.set("Authorization",`Bearer ${w}`),t.body&&n.set("Content-Type","application/json");const s=await fetch(e,{...t,headers:n,credentials:"omit",cache:"no-store",redirect:"error",signal:t.signal??AbortSignal.timeout(15e3)}),o=await s.json();if(!s.ok)throw new Error(o.error||"桌面服务暂时不可用,请重试");return o}async function K(){if(!(!S||u))return h||(h=(async()=>{const e=new URLSearchParams(location.hash.slice(1)),t=e.get("desktop");w=t||sessionStorage.getItem("linkshell.desktop.capability")||void 0,t&&(sessionStorage.setItem("linkshell.desktop.capability",t),e.delete("desktop"),history.replaceState(null,"",location.pathname+location.search+(e.size?`#${e}`:""))),u=await y("/desktop/bootstrap"),document.documentElement.dataset.desktop="true",window.__LINKSHELL_DESKTOP_FLUSH__=z})().finally(()=>{h=void 0}),h)}function M(){if(!u)throw new Error("桌面设备身份尚未载入");return u.identity}function V(){return u?.localComputer}function B(e,t){return u?.storage[e]??t}function T(e,t){k=k.then(async()=>{try{await y("/desktop/storage",{method:"PUT",body:JSON.stringify({key:e,value:t.value})}),p.get(e)===t&&p.delete(e)}catch(n){O(new Error(`工作台设置尚未保存:${n instanceof Error?n.message:String(n)}。请重试连接。`))}})}function W(e,t){if(!u)throw new Error("桌面工作台尚未初始化");const n=t===void 0?null:JSON.parse(JSON.stringify(t));u.storage[e]=n;const s={value:n};p.set(e,s),T(e,s)}function $(){for(const[e,t]of p)T(e,t);return k}async function P(){let e;do e=k,await e;while(e!==k)}function z(){return b??=(async()=>(await P(),p.size&&await $(),await P(),{saved:p.size===0,pending:p.size}))().finally(()=>{b=void 0})}function D(e){const t=e.userId!==g.userId||e.email!==g.email||e.accessToken!==g.accessToken;return g=e,t&&window.dispatchEvent(new CustomEvent(q,{detail:e})),e}function F(){if(d)return d;const e=E,t=y("/desktop/account").then(n=>e===E?D(n):g).finally(()=>{d===t&&(d=void 0)});return d=t,t}async function J(){await y("/desktop/login",{method:"POST",signal:AbortSignal.timeout(36e4)}),E++,d=void 0,await F()}async function G(){await y("/desktop/logout",{method:"POST"}),E++,d=void 0,D({})}function Y(){if(!w)throw new Error("桌面连接已失效,请重新打开窗口");const e=new URL("/desktop/host",location.origin);return e.protocol=location.protocol==="https:"?"wss:":"ws:",e.searchParams.set("token",w),new WebSocket(e)}function v(e){const t=window.webkit?.messageHandlers?.linkshellDesktop;return!S||!t?!1:(t.postMessage(e),!0)}function Q(){v({action:"manage"})||O("请通过 LinkShell 菜单打开本机服务")}function X(e){v({action:"appearance",value:e})}function Z(e){v({action:"contentFocus",focused:e})}async function C(){try{await K(),await U(()=>import("./render-CeOTtM6k.js"),__vite__mapDeps([0,1,2,3,4,5]))}catch(e){const t=document.getElementById("root");t.replaceChildren();const n=document.createElement("main");n.style.cssText="max-width:440px;margin:18vh auto;padding:32px;font:15px system-ui;line-height:1.65";const s=document.createElement("h1");s.textContent="工作台暂时无法打开";const o=document.createElement("p");o.textContent=e instanceof Error?e.message:String(e);const r=document.createElement("button");r.textContent="重试",r.style.cssText="padding:8px 18px;border-radius:9px;cursor:pointer",r.onclick=()=>{r.disabled=!0,C()},n.append(s,o,r),t.append(n)}}C();export{x as D,U as _,M as a,q as b,j as c,F as d,V as e,H as f,y as g,Y as h,S as i,$ as j,G as k,J as l,Z as m,X as n,Q as o,B as r,W as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/render-aEH5kWvo.js","assets/markdown-SZOrMO_3.js","assets/account-R7yD1rZE.js","assets/terminal-DWFexEE4.js","assets/terminal-DOrYoP_4.css","assets/render-Bjh9injB.css"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const A="modulepreload",R=function(e){return"/"+e},_={},U=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let a=function(i){return Promise.all(i.map(f=>Promise.resolve(f).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),L=c?.nonce||c?.getAttribute("nonce");o=a(n.map(i=>{if(i=R(i),i in _)return;_[i]=!0;const f=i.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${m}`))return;const l=document.createElement("link");if(l.rel=f?"stylesheet":A,f||(l.as="script"),l.crossOrigin="",l.href=i,L&&l.setAttribute("nonce",L),document.head.appendChild(l),f)return new Promise((N,I)=>{l.addEventListener("load",N),l.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${i}`)))})}))}function r(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return o.then(a=>{for(const c of a||[])c.status==="rejected"&&r(c.reason);return t().catch(r)})},S=typeof window<"u"&&window.__LINKSHELL_CONFIG__?.desktop===!0,H="desktop:local",j="linkshell-desktop-visibility",q="linkshell-desktop-account",x="linkshell-desktop-error";let w,u,h,k=Promise.resolve(),b;const p=new Map;let g={},d,E=0;function O(e){window.dispatchEvent(new CustomEvent(x,{detail:e instanceof Error?e.message:String(e)}))}async function y(e,t={}){if(!S||!w)throw new Error("桌面工作台尚未连接,请重新打开窗口");if(!/^\/desktop\/[a-z]+$/.test(e))throw new Error("无效的桌面请求");const n=new Headers(t.headers);n.set("Authorization",`Bearer ${w}`),t.body&&n.set("Content-Type","application/json");const s=await fetch(e,{...t,headers:n,credentials:"omit",cache:"no-store",redirect:"error",signal:t.signal??AbortSignal.timeout(15e3)}),o=await s.json();if(!s.ok)throw new Error(o.error||"桌面服务暂时不可用,请重试");return o}async function K(){if(!(!S||u))return h||(h=(async()=>{const e=new URLSearchParams(location.hash.slice(1)),t=e.get("desktop");w=t||sessionStorage.getItem("linkshell.desktop.capability")||void 0,t&&(sessionStorage.setItem("linkshell.desktop.capability",t),e.delete("desktop"),history.replaceState(null,"",location.pathname+location.search+(e.size?`#${e}`:""))),u=await y("/desktop/bootstrap"),document.documentElement.dataset.desktop="true",window.__LINKSHELL_DESKTOP_FLUSH__=z})().finally(()=>{h=void 0}),h)}function M(){if(!u)throw new Error("桌面设备身份尚未载入");return u.identity}function V(){return u?.localComputer}function B(e,t){return u?.storage[e]??t}function T(e,t){k=k.then(async()=>{try{await y("/desktop/storage",{method:"PUT",body:JSON.stringify({key:e,value:t.value})}),p.get(e)===t&&p.delete(e)}catch(n){O(new Error(`工作台设置尚未保存:${n instanceof Error?n.message:String(n)}。请重试连接。`))}})}function W(e,t){if(!u)throw new Error("桌面工作台尚未初始化");const n=t===void 0?null:JSON.parse(JSON.stringify(t));u.storage[e]=n;const s={value:n};p.set(e,s),T(e,s)}function $(){for(const[e,t]of p)T(e,t);return k}async function P(){let e;do e=k,await e;while(e!==k)}function z(){return b??=(async()=>(await P(),p.size&&await $(),await P(),{saved:p.size===0,pending:p.size}))().finally(()=>{b=void 0})}function D(e){const t=e.userId!==g.userId||e.email!==g.email||e.accessToken!==g.accessToken;return g=e,t&&window.dispatchEvent(new CustomEvent(q,{detail:e})),e}function F(){if(d)return d;const e=E,t=y("/desktop/account").then(n=>e===E?D(n):g).finally(()=>{d===t&&(d=void 0)});return d=t,t}async function J(){await y("/desktop/login",{method:"POST",signal:AbortSignal.timeout(36e4)}),E++,d=void 0,await F()}async function G(){await y("/desktop/logout",{method:"POST"}),E++,d=void 0,D({})}function Y(){if(!w)throw new Error("桌面连接已失效,请重新打开窗口");const e=new URL("/desktop/host",location.origin);return e.protocol=location.protocol==="https:"?"wss:":"ws:",e.searchParams.set("token",w),new WebSocket(e)}function v(e){const t=window.webkit?.messageHandlers?.linkshellDesktop;return!S||!t?!1:(t.postMessage(e),!0)}function Q(){v({action:"manage"})||O("请通过 LinkShell 菜单打开本机服务")}function X(e){v({action:"appearance",value:e})}function Z(e){v({action:"contentFocus",focused:e})}async function C(){try{await K(),await U(()=>import("./render-aEH5kWvo.js"),__vite__mapDeps([0,1,2,3,4,5]))}catch(e){const t=document.getElementById("root");t.replaceChildren();const n=document.createElement("main");n.style.cssText="max-width:440px;margin:18vh auto;padding:32px;font:15px system-ui;line-height:1.65";const s=document.createElement("h1");s.textContent="工作台暂时无法打开";const o=document.createElement("p");o.textContent=e instanceof Error?e.message:String(e);const r=document.createElement("button");r.textContent="重试",r.style.cssText="padding:8px 18px;border-radius:9px;cursor:pointer",r.onclick=()=>{r.disabled=!0,C()},n.append(s,o,r),t.append(n)}}C();export{x as D,U as _,M as a,q as b,j as c,F as d,V as e,H as f,y as g,Y as h,S as i,$ as j,G as k,J as l,Z as m,X as n,Q as o,B as r,W as s};
@@ -1 +1 @@
1
- import{_ as S}from"./index-C40ezOLN.js";class s{constructor(e,t,i,a,n){this._legacyCanvasSize=s.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=e,this.$canvas=document.createElement("canvas"),i&&typeof i=="object"?this._onDecode=t:(console.warn(i||a||n?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=t),t=typeof i=="object"?i:{},this._onDecodeError=t.onDecodeError||(typeof i=="function"?i:this._onDecodeError),this._calculateScanRegion=t.calculateScanRegion||(typeof a=="function"?a:this._calculateScanRegion),this._preferredCamera=t.preferredCamera||n||this._preferredCamera,this._legacyCanvasSize=typeof i=="number"?i:typeof a=="number"?a:this._legacyCanvasSize,this._maxScansPerSecond=t.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let o=!1;if(e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),i=e.parentElement,t.highlightScanRegion||t.highlightCodeOutline){if(a=!!t.overlay,this.$overlay=t.overlay||document.createElement("div"),n=this.$overlay.style,n.position="absolute",n.display="none",n.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!a&&t.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}i.insertBefore(this.$overlay,this.$video.nextSibling)}t.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(e),requestAnimationFrame(()=>{let d=window.getComputedStyle(e);d.display==="none"&&(e.style.setProperty("display","block","important"),o=!0),d.visibility!=="visible"&&(e.style.setProperty("visibility","visible","important"),o=!0),o&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity="0",e.style.width="0",e.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=s.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await s.listCameras(!1)).length}catch{return!1}}static async listCameras(e=!1){if(!navigator.mediaDevices)return[];let t=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(a=>a.kind==="videoinput"),i;try{e&&(await t()).every(a=>!a.label)&&(i=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await t()).map((a,n)=>({id:a.deviceId,label:a.label||(n===0?"Default Camera":`Camera ${n+1}`)}))}finally{i&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),s._stopVideoStream(i))}}async hasFlash(){let e;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;e=this.$video.srcObject}else e=(await this._getCameraStream()).stream;return"torch"in e.getVideoTracks()[0].getSettings()}catch{return!1}finally{e&&e!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),s._stopVideoStream(e))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),s._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:e,facingMode:t}=await this._getCameraStream();!this._active||this._paused?s._stopVideoStream(e):(this._setVideoMirror(t),this.$video.srcObject=e,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(e=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let t=()=>{this.$video.srcObject instanceof MediaStream&&(s._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return e?(t(),!0):(await new Promise(i=>setTimeout(i,300)),this._paused?(t(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(e,t,i,a,n=!1,o=!1){let d,c=!1;t&&("scanRegion"in t||"qrEngine"in t||"canvas"in t||"disallowCanvasResizing"in t||"alsoTryWithoutScanRegion"in t||"returnDetailedScanResult"in t)?(d=t.scanRegion,i=t.qrEngine,a=t.canvas,n=t.disallowCanvasResizing||!1,o=t.alsoTryWithoutScanRegion||!1,c=!0):console.warn(t||i||a||n||o?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),t=!!i;try{let m,h;[i,m]=await Promise.all([i||s.createQrEngine(),s._loadImage(e)]),[a,h]=s._drawToCanvas(m,d,a,n);let u;if(i instanceof Worker){let r=i;t||s._postWorkerMessageSync(r,"inversionMode","both"),u=await new Promise((l,f)=>{let p,y,g,w=-1;y=v=>{v.data.id===w&&(r.removeEventListener("message",y),r.removeEventListener("error",g),clearTimeout(p),v.data.data!==null?l({data:v.data.data,cornerPoints:s._convertPoints(v.data.cornerPoints,d)}):f(s.NO_QR_CODE_FOUND))},g=v=>{r.removeEventListener("message",y),r.removeEventListener("error",g),clearTimeout(p),f("Scanner error: "+(v?v.message||v:"Unknown Error"))},r.addEventListener("message",y),r.addEventListener("error",g),p=setTimeout(()=>g("timeout"),1e4);let _=h.getImageData(0,0,a.width,a.height);w=s._postWorkerMessageSync(r,"decode",_,[_.data.buffer])})}else u=await Promise.race([new Promise((r,l)=>window.setTimeout(()=>l("Scanner error: timeout"),1e4)),(async()=>{try{var[r]=await i.detect(a);if(!r)throw s.NO_QR_CODE_FOUND;return{data:r.rawValue,cornerPoints:s._convertPoints(r.cornerPoints,d)}}catch(l){if(r=l.message||l,/not implemented|service unavailable/.test(r))return s._disableBarcodeDetector=!0,s.scanImage(e,{scanRegion:d,canvas:a,disallowCanvasResizing:n,alsoTryWithoutScanRegion:o});throw`Scanner error: ${r}`}})()]);return c?u:u.data}catch(m){if(!d||!o)throw m;let h=await s.scanImage(e,{qrEngine:i,canvas:a,disallowCanvasResizing:n});return c?h:h.data}finally{t||s._postWorkerMessage(i,"close")}}setGrayscaleWeights(e,t,i,a=!0){s._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:i,useIntegerApproximation:a})}setInversionMode(e){s._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static async createQrEngine(e){if(e&&console.warn("Specifying a worker path is not required and not supported anymore."),e=()=>S(()=>import("./qr-scanner-worker.min-D85Z9gVD.js"),[]).then(i=>i.createWorker()),!(!s._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return e();let t=navigator.userAgentData;return t&&t.brands.some(({brand:i})=>/Chromium/i.test(i))&&/mac ?OS/i.test(t.platform)&&await t.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:i,platformVersion:a})=>/arm/i.test(i||"arm")&&13<=parseInt(a||"13")).catch(()=>!0)?e():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(.6666666666666666*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,i=e.videoHeight,a=e.offsetWidth,n=e.offsetHeight,o=e.offsetLeft,d=e.offsetTop,c=window.getComputedStyle(e),m=c.objectFit,h=t/i,u=a/n;switch(m){case"none":var r=t,l=i;break;case"fill":r=a,l=n;break;default:(m==="cover"?h>u:h<u)?(l=n,r=l*h):(r=a,l=r/h),m==="scale-down"&&(r=Math.min(r,t),l=Math.min(l,i))}var[f,p]=c.objectPosition.split(" ").map((g,w)=>{const _=parseFloat(g);return g.endsWith("%")?(w?n-l:a-r)*_/100:_});c=this._scanRegion.width||t,u=this._scanRegion.height||i,m=this._scanRegion.x||0;var y=this._scanRegion.y||0;h=this.$overlay.style,h.width=`${c/t*r}px`,h.height=`${u/i*l}px`,h.top=`${d+p+y/i*l}px`,i=/scaleX\(-1\)/.test(e.style.transform),h.left=`${o+(i?a-f-r:f)+(i?t-m-c:m)/t*r}px`,h.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let i=t.x||0,a=t.y||0,n=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let o of e)o.x=o.x*n+i,o.y=o.y*t+a;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var e=Date.now()-this._lastScanTimestamp,t=1e3/this._maxScansPerSecond;e<t&&await new Promise(a=>setTimeout(a,t-e)),this._lastScanTimestamp=Date.now();try{var i=await s.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(a){if(!this._active)return;this._onDecodeError(a)}!s._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=s.createQrEngine()),i?(this._onDecode?this._onDecode(i):this._legacyOnDecode&&this._legacyOnDecode(i.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",i.cornerPoints.map(({x:a,y:n})=>`${a},${n}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(e){e!==s.NO_QR_CODE_FOUND&&console.log(e)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}],i=t.map(a=>Object.assign({},a,{[e]:{exact:this._preferredCamera}}));for(let a of[...i,...t])try{let n=await navigator.mediaDevices.getUserMedia({video:a,audio:!1}),o=this._getFacingMode(n)||(a.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:n,facingMode:o}}catch{}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform="scaleX("+(e==="user"?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,t,i,a=!1){i=i||document.createElement("canvas");let n=t&&t.x?t.x:0,o=t&&t.y?t.y:0,d=t&&t.width?t.width:e.videoWidth||e.width,c=t&&t.height?t.height:e.videoHeight||e.height;return a||(a=t&&t.downScaledWidth?t.downScaledWidth:d,t=t&&t.downScaledHeight?t.downScaledHeight:c,i.width!==a&&(i.width=a),i.height!==t&&(i.height=t)),t=i.getContext("2d",{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,n,o,d,c,0,0,i.width,i.height),[i,t]}static async _loadImage(e){if(e instanceof Image)return await s._awaitImageLoad(e),e;if(e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGImageElement||"OffscreenCanvas"in window&&e instanceof OffscreenCanvas||"ImageBitmap"in window&&e instanceof ImageBitmap)return e;if(e instanceof File||e instanceof Blob||e instanceof URL||typeof e=="string"){let t=new Image;t.src=e instanceof File||e instanceof Blob?URL.createObjectURL(e):e.toString();try{return await s._awaitImageLoad(t),t}finally{(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(t.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,i)=>{let a=n=>{e.removeEventListener("load",a),e.removeEventListener("error",a),n instanceof ErrorEvent?i("Image load error"):t()};e.addEventListener("load",a),e.addEventListener("error",a)})}static async _postWorkerMessage(e,t,i,a){return s._postWorkerMessageSync(await e,t,i,a)}static _postWorkerMessageSync(e,t,i,a){if(!(e instanceof Worker))return-1;let n=s._workerMessageId++;return e.postMessage({id:n,type:t,data:i},a),n}}s.DEFAULT_CANVAS_SIZE=400;s.NO_QR_CODE_FOUND="No QR code found";s._disableBarcodeDetector=!1;s._workerMessageId=0;export{s as default};
1
+ import{_ as S}from"./index-D7YHCr18.js";class s{constructor(e,t,i,a,n){this._legacyCanvasSize=s.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=e,this.$canvas=document.createElement("canvas"),i&&typeof i=="object"?this._onDecode=t:(console.warn(i||a||n?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=t),t=typeof i=="object"?i:{},this._onDecodeError=t.onDecodeError||(typeof i=="function"?i:this._onDecodeError),this._calculateScanRegion=t.calculateScanRegion||(typeof a=="function"?a:this._calculateScanRegion),this._preferredCamera=t.preferredCamera||n||this._preferredCamera,this._legacyCanvasSize=typeof i=="number"?i:typeof a=="number"?a:this._legacyCanvasSize,this._maxScansPerSecond=t.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let o=!1;if(e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),i=e.parentElement,t.highlightScanRegion||t.highlightCodeOutline){if(a=!!t.overlay,this.$overlay=t.overlay||document.createElement("div"),n=this.$overlay.style,n.position="absolute",n.display="none",n.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!a&&t.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}i.insertBefore(this.$overlay,this.$video.nextSibling)}t.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(e),requestAnimationFrame(()=>{let d=window.getComputedStyle(e);d.display==="none"&&(e.style.setProperty("display","block","important"),o=!0),d.visibility!=="visible"&&(e.style.setProperty("visibility","visible","important"),o=!0),o&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity="0",e.style.width="0",e.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=s.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await s.listCameras(!1)).length}catch{return!1}}static async listCameras(e=!1){if(!navigator.mediaDevices)return[];let t=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(a=>a.kind==="videoinput"),i;try{e&&(await t()).every(a=>!a.label)&&(i=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await t()).map((a,n)=>({id:a.deviceId,label:a.label||(n===0?"Default Camera":`Camera ${n+1}`)}))}finally{i&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),s._stopVideoStream(i))}}async hasFlash(){let e;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;e=this.$video.srcObject}else e=(await this._getCameraStream()).stream;return"torch"in e.getVideoTracks()[0].getSettings()}catch{return!1}finally{e&&e!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),s._stopVideoStream(e))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),s._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:e,facingMode:t}=await this._getCameraStream();!this._active||this._paused?s._stopVideoStream(e):(this._setVideoMirror(t),this.$video.srcObject=e,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(e=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let t=()=>{this.$video.srcObject instanceof MediaStream&&(s._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return e?(t(),!0):(await new Promise(i=>setTimeout(i,300)),this._paused?(t(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(e,t,i,a,n=!1,o=!1){let d,c=!1;t&&("scanRegion"in t||"qrEngine"in t||"canvas"in t||"disallowCanvasResizing"in t||"alsoTryWithoutScanRegion"in t||"returnDetailedScanResult"in t)?(d=t.scanRegion,i=t.qrEngine,a=t.canvas,n=t.disallowCanvasResizing||!1,o=t.alsoTryWithoutScanRegion||!1,c=!0):console.warn(t||i||a||n||o?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),t=!!i;try{let m,h;[i,m]=await Promise.all([i||s.createQrEngine(),s._loadImage(e)]),[a,h]=s._drawToCanvas(m,d,a,n);let u;if(i instanceof Worker){let r=i;t||s._postWorkerMessageSync(r,"inversionMode","both"),u=await new Promise((l,f)=>{let p,y,g,w=-1;y=v=>{v.data.id===w&&(r.removeEventListener("message",y),r.removeEventListener("error",g),clearTimeout(p),v.data.data!==null?l({data:v.data.data,cornerPoints:s._convertPoints(v.data.cornerPoints,d)}):f(s.NO_QR_CODE_FOUND))},g=v=>{r.removeEventListener("message",y),r.removeEventListener("error",g),clearTimeout(p),f("Scanner error: "+(v?v.message||v:"Unknown Error"))},r.addEventListener("message",y),r.addEventListener("error",g),p=setTimeout(()=>g("timeout"),1e4);let _=h.getImageData(0,0,a.width,a.height);w=s._postWorkerMessageSync(r,"decode",_,[_.data.buffer])})}else u=await Promise.race([new Promise((r,l)=>window.setTimeout(()=>l("Scanner error: timeout"),1e4)),(async()=>{try{var[r]=await i.detect(a);if(!r)throw s.NO_QR_CODE_FOUND;return{data:r.rawValue,cornerPoints:s._convertPoints(r.cornerPoints,d)}}catch(l){if(r=l.message||l,/not implemented|service unavailable/.test(r))return s._disableBarcodeDetector=!0,s.scanImage(e,{scanRegion:d,canvas:a,disallowCanvasResizing:n,alsoTryWithoutScanRegion:o});throw`Scanner error: ${r}`}})()]);return c?u:u.data}catch(m){if(!d||!o)throw m;let h=await s.scanImage(e,{qrEngine:i,canvas:a,disallowCanvasResizing:n});return c?h:h.data}finally{t||s._postWorkerMessage(i,"close")}}setGrayscaleWeights(e,t,i,a=!0){s._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:i,useIntegerApproximation:a})}setInversionMode(e){s._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static async createQrEngine(e){if(e&&console.warn("Specifying a worker path is not required and not supported anymore."),e=()=>S(()=>import("./qr-scanner-worker.min-D85Z9gVD.js"),[]).then(i=>i.createWorker()),!(!s._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return e();let t=navigator.userAgentData;return t&&t.brands.some(({brand:i})=>/Chromium/i.test(i))&&/mac ?OS/i.test(t.platform)&&await t.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:i,platformVersion:a})=>/arm/i.test(i||"arm")&&13<=parseInt(a||"13")).catch(()=>!0)?e():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(.6666666666666666*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,i=e.videoHeight,a=e.offsetWidth,n=e.offsetHeight,o=e.offsetLeft,d=e.offsetTop,c=window.getComputedStyle(e),m=c.objectFit,h=t/i,u=a/n;switch(m){case"none":var r=t,l=i;break;case"fill":r=a,l=n;break;default:(m==="cover"?h>u:h<u)?(l=n,r=l*h):(r=a,l=r/h),m==="scale-down"&&(r=Math.min(r,t),l=Math.min(l,i))}var[f,p]=c.objectPosition.split(" ").map((g,w)=>{const _=parseFloat(g);return g.endsWith("%")?(w?n-l:a-r)*_/100:_});c=this._scanRegion.width||t,u=this._scanRegion.height||i,m=this._scanRegion.x||0;var y=this._scanRegion.y||0;h=this.$overlay.style,h.width=`${c/t*r}px`,h.height=`${u/i*l}px`,h.top=`${d+p+y/i*l}px`,i=/scaleX\(-1\)/.test(e.style.transform),h.left=`${o+(i?a-f-r:f)+(i?t-m-c:m)/t*r}px`,h.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let i=t.x||0,a=t.y||0,n=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let o of e)o.x=o.x*n+i,o.y=o.y*t+a;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var e=Date.now()-this._lastScanTimestamp,t=1e3/this._maxScansPerSecond;e<t&&await new Promise(a=>setTimeout(a,t-e)),this._lastScanTimestamp=Date.now();try{var i=await s.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(a){if(!this._active)return;this._onDecodeError(a)}!s._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=s.createQrEngine()),i?(this._onDecode?this._onDecode(i):this._legacyOnDecode&&this._legacyOnDecode(i.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",i.cornerPoints.map(({x:a,y:n})=>`${a},${n}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(e){e!==s.NO_QR_CODE_FOUND&&console.log(e)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}],i=t.map(a=>Object.assign({},a,{[e]:{exact:this._preferredCamera}}));for(let a of[...i,...t])try{let n=await navigator.mediaDevices.getUserMedia({video:a,audio:!1}),o=this._getFacingMode(n)||(a.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:n,facingMode:o}}catch{}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform="scaleX("+(e==="user"?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,t,i,a=!1){i=i||document.createElement("canvas");let n=t&&t.x?t.x:0,o=t&&t.y?t.y:0,d=t&&t.width?t.width:e.videoWidth||e.width,c=t&&t.height?t.height:e.videoHeight||e.height;return a||(a=t&&t.downScaledWidth?t.downScaledWidth:d,t=t&&t.downScaledHeight?t.downScaledHeight:c,i.width!==a&&(i.width=a),i.height!==t&&(i.height=t)),t=i.getContext("2d",{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,n,o,d,c,0,0,i.width,i.height),[i,t]}static async _loadImage(e){if(e instanceof Image)return await s._awaitImageLoad(e),e;if(e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGImageElement||"OffscreenCanvas"in window&&e instanceof OffscreenCanvas||"ImageBitmap"in window&&e instanceof ImageBitmap)return e;if(e instanceof File||e instanceof Blob||e instanceof URL||typeof e=="string"){let t=new Image;t.src=e instanceof File||e instanceof Blob?URL.createObjectURL(e):e.toString();try{return await s._awaitImageLoad(t),t}finally{(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(t.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,i)=>{let a=n=>{e.removeEventListener("load",a),e.removeEventListener("error",a),n instanceof ErrorEvent?i("Image load error"):t()};e.addEventListener("load",a),e.addEventListener("error",a)})}static async _postWorkerMessage(e,t,i,a){return s._postWorkerMessageSync(await e,t,i,a)}static _postWorkerMessageSync(e,t,i,a){if(!(e instanceof Worker))return-1;let n=s._workerMessageId++;return e.postMessage({id:n,type:t,data:i},a),n}}s.DEFAULT_CANVAS_SIZE=400;s.NO_QR_CODE_FOUND="No QR code found";s._disableBarcodeDetector=!1;s._workerMessageId=0;export{s as default};
@@ -0,0 +1 @@
1
+ html[data-desktop]{--radius-card: 18px;--radius-row: 12px;--radius-control: 9px;--transition: .16s cubic-bezier(.2, 0, .2, 1);font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,PingFang SC,system-ui,sans-serif}html[data-desktop] body{overscroll-behavior:none}html[data-desktop],html[data-desktop] *{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--secondaryLabel) 20%,transparent) transparent}html[data-desktop]:hover,html[data-desktop] *:hover,html[data-desktop] *:focus-within{scrollbar-color:color-mix(in srgb,var(--secondaryLabel) 36%,transparent) transparent}@supports selector(::-webkit-scrollbar){html[data-desktop],html[data-desktop] *{scrollbar-width:auto;scrollbar-color:auto;scrollbar-gutter:auto}html[data-desktop]::-webkit-scrollbar,html[data-desktop] *::-webkit-scrollbar{width:6px;height:6px}html[data-desktop]::-webkit-scrollbar-track,html[data-desktop] *::-webkit-scrollbar-track,html[data-desktop]::-webkit-scrollbar-corner,html[data-desktop] *::-webkit-scrollbar-corner{background:transparent}html[data-desktop]::-webkit-scrollbar-thumb,html[data-desktop] *::-webkit-scrollbar-thumb{border:1px solid transparent;border-radius:999px;background:color-mix(in srgb,var(--secondaryLabel) 20%,transparent);background-clip:padding-box}html[data-desktop]:hover::-webkit-scrollbar-thumb,html[data-desktop] *:hover::-webkit-scrollbar-thumb,html[data-desktop] *:focus-within::-webkit-scrollbar-thumb{background-color:color-mix(in srgb,var(--secondaryLabel) 36%,transparent)}html[data-desktop]::-webkit-scrollbar-thumb:hover,html[data-desktop] *::-webkit-scrollbar-thumb:hover{background-color:color-mix(in srgb,var(--secondaryLabel) 52%,transparent)}}html[data-desktop] .desktop-root,html[data-desktop] .desktop-body{display:flex;min-width:0;min-height:0;height:100dvh;overflow:hidden}html[data-desktop] .desktop-root{background:var(--background);font-size:13px;letter-spacing:-.012em}html[data-desktop] .desktop-body{flex:1}html[data-desktop] .desktop-sidebar{box-sizing:border-box;flex:none;width:232px;height:100%;padding-top:104px;padding-bottom:0;background:var(--sidebarBackground);border-right:1px solid var(--separatorStrong)}html[data-desktop] .desktop-sidebar [data-sidebar=sidebar]{background:var(--sidebarBackground)}html[data-desktop] .desktop-sidebar-header{flex:none;padding:8px 14px 14px}html[data-desktop] .desktop-computer-picker{display:flex;justify-content:flex-start;gap:10px;width:100%;height:58px;min-height:58px;padding:9px 11px;border:1px solid var(--separatorStrong);border-radius:10px;background:var(--card);color:var(--label);text-align:left;box-shadow:none;transition:background var(--transition),border-color var(--transition)}html[data-desktop] .desktop-computer-picker:hover,html[data-desktop] .desktop-computer-picker[aria-expanded=true]{background:color-mix(in srgb,var(--cardRaised) 50%,var(--card));border-color:color-mix(in srgb,var(--secondaryLabel) 28%,transparent)}html[data-desktop] .desktop-computer-copy{display:grid;gap:3px;flex:1;min-width:0}html[data-desktop] .desktop-computer-copy strong{overflow:hidden;font-size:13px;font-weight:600;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}html[data-desktop] .desktop-computer-copy>span{display:flex;align-items:center;gap:4px;color:var(--secondaryLabel);font-size:11px;font-weight:400}html[data-desktop] .desktop-connection-state{display:inline-flex;align-items:center;gap:5px;color:var(--secondaryLabel);font-size:11px}html[data-desktop] .desktop-computer-picker>svg{color:var(--tertiaryLabel)}html[data-desktop] .desktop-presence{display:inline-block;flex:none;width:6px;height:6px;border-radius:50%;background:var(--tertiaryLabel)}html[data-desktop] .desktop-presence[data-online]{background:var(--success)}html[data-desktop] .desktop-computer-menu{min-width:238px;max-width:min(340px,calc(100vw - 32px))}html[data-desktop] .desktop-menu-computer-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-desktop] .desktop-computer-menu small{color:var(--secondaryLabel);font-size:10px}html[data-desktop] .desktop-menu-empty{max-width:230px;padding:10px;color:var(--secondaryLabel);font-size:12px}html[data-desktop] .desktop-navigation{gap:18px;padding:0 14px 16px;overflow-y:auto}html[data-desktop] .desktop-navigation-group{gap:5px;padding:0}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-group-label]{height:20px;padding-inline:10px;color:var(--tertiaryLabel);font-size:11px;font-weight:600;letter-spacing:.015em}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu]{gap:2px}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button]{height:34px;padding:0 10px;gap:10px;border-radius:8px;color:var(--secondaryLabel);font-size:13px;font-weight:450;text-align:left;transition:background var(--transition),color var(--transition)}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button]>svg{width:16px;height:16px;flex:none}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button]>span:not(.agent-mark):not(.desktop-nav-badge):not(.desktop-nav-session-dot){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button]:hover{background:var(--fillStrong);color:var(--label)}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button][data-active=true]{background:var(--sidebarAccent);color:var(--label);font-weight:600;box-shadow:none}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button][data-active=true]>svg{color:var(--label)}html[data-desktop] .desktop-nav-badge{flex:none;margin-left:auto;padding:1px 6px;border-radius:999px;font-size:10px;font-weight:600;line-height:15px;font-variant-numeric:tabular-nums}html[data-desktop] .desktop-nav-badge[data-tone=waiting]{background:var(--waitingSoft);color:var(--warning)}html[data-desktop] .desktop-nav-badge[data-tone=running]{background:var(--accentSoft);color:var(--info)}html[data-desktop] .desktop-active-sessions [data-slot=sidebar-menu-button]{height:32px;gap:8px;font-size:12.5px}html[data-desktop] .desktop-active-sessions .agent-mark{width:16px;height:16px;border-radius:4px;flex:none}html[data-desktop] .desktop-nav-session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-desktop] .desktop-nav-session-dot{flex:none;width:6px;height:6px;border-radius:50%;margin-left:auto}html[data-desktop] .desktop-nav-session-dot[data-state=waiting]{background:var(--warning)}html[data-desktop] .desktop-nav-session-dot[data-state=running]{background:var(--info)}html[data-desktop] .desktop-sidebar-footer{flex:none;gap:0;padding:12px 14px;border-top:1px solid var(--separatorStrong)}html[data-desktop] .desktop-account-row{display:flex;align-items:center;gap:4px}html[data-desktop] .desktop-account{flex:1;justify-content:flex-start;min-width:0;height:34px;padding:0 8px;gap:9px;color:var(--secondaryLabel);font-size:12px}html[data-desktop] .desktop-account span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-desktop] .desktop-account-row>[data-slot=button]{height:30px;width:30px;border-radius:8px;color:var(--secondaryLabel)}html[data-desktop] .desktop-appearance-menu{min-width:172px}html[data-desktop] .desktop-main{flex:1;margin:0;height:100dvh;border:0;border-radius:0;overflow:hidden;background:var(--plain);outline:none;container-type:inline-size;container-name:desktop-workspace}html[data-desktop] .desktop-main:has(.screen-focused,.port-preview-focused){container-type:normal}html[data-desktop] .desktop-main>.live-overview,html[data-desktop] .desktop-main>.screens-page{flex:1;min-height:0;overflow:auto}html[data-desktop] .desktop-main .live-overview,html[data-desktop] .desktop-main .screens-page{padding:24px max(28px,calc((100% - 1060px)/2)) 32px}html[data-desktop] .desktop-main .page-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:36px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid var(--separator)}html[data-desktop] .desktop-main .page-heading h1,html[data-desktop] .desktop-main .live-overview>section>div:first-child h1,html[data-desktop] .desktop-main .screens-page>div:first-child h1{font-size:19px;line-height:1.3;font-weight:600;letter-spacing:-.025em}html[data-desktop] .desktop-main .page-heading p,html[data-desktop] .desktop-main .live-overview>section>div:first-child p,html[data-desktop] .desktop-main .screens-page>div:first-child p{margin-top:4px;font-size:12px;color:var(--secondaryLabel)}html[data-desktop] .desktop-main [data-slot=button][data-size=default]{height:34px;padding-inline:14px;border-radius:9px;font-size:13px}html[data-desktop] .desktop-main [data-slot=button][data-size=icon]{width:31px;height:31px;border-radius:9px}html[data-desktop] .desktop-main [data-slot=button][data-size=plain]{text-align:left;justify-content:flex-start}html[data-desktop] .desktop-main [data-slot=input-group]:not(.composer),html[data-desktop] .desktop-main [data-slot=select-trigger]{height:34px;border-radius:8px;box-shadow:none;font-size:13px}html[data-desktop] .desktop-main [data-slot=input-group]:not(.composer){background:var(--card);border-color:var(--separatorStrong)}html[data-desktop] .desktop-main [data-slot=input-group]:focus-within{border-color:var(--accent)}html[data-desktop] .desktop-main [data-slot=tabs-list][data-variant=line]{min-height:34px;gap:3px}html[data-desktop] .desktop-main [data-slot=tabs-trigger]{padding-inline:9px;font-size:13px}html[data-desktop] [data-slot=dropdown-menu-content],html[data-desktop] [data-slot=select-content]{padding:5px;border-radius:11px}html[data-desktop] [data-slot=dropdown-menu-item],html[data-desktop] [data-slot=dropdown-menu-radio-item],html[data-desktop] [data-slot=select-item]{min-height:31px;padding-inline:9px;gap:8px;border-radius:6px;font-size:12px}html[data-desktop] [data-slot=dialog-content]{border-radius:20px;padding:25px}html[data-desktop] .desktop-main .session-overview{gap:18px}html[data-desktop] .desktop-main .session-overview>*,html[data-desktop] .desktop-main .session-overview-filters,html[data-desktop] .desktop-main [data-slot=tabs],html[data-desktop] .desktop-main [data-slot=tabs-list]{flex-shrink:0}html[data-desktop] .desktop-main .session-overview-heading{position:static;flex:none;min-height:36px;margin:0;padding:0;background:transparent;border:0}html[data-desktop] .desktop-main .session-search{flex:1;width:100%;max-width:380px}html[data-desktop] .desktop-main .session-overview-tools{flex:none;margin-left:auto}html[data-desktop] .desktop-main .session-overview-heading h1{text-align:left;font-size:20px;font-weight:650;letter-spacing:-.025em}html[data-desktop] .desktop-main .session-overview-heading>[data-slot=button]{flex:none}html[data-desktop] .desktop-main .session-group{overflow:visible;border:0;border-radius:0;background:transparent}html[data-desktop] .desktop-main .session-group>.list-section-title{display:flex;align-items:center;gap:7px;min-height:28px;margin:0;padding:0 10px 6px;color:var(--secondaryLabel);font-size:12px;font-weight:600;line-height:18px}html[data-desktop] .desktop-main .session-group>.list-section-title>span{color:var(--tertiaryLabel);font-size:11px;font-weight:400}html[data-desktop] .desktop-main .session-group[data-session-group=waiting]{border:0}html[data-desktop] .desktop-main .session-group[data-session-group=waiting]>.list-section-title{color:var(--warning);background:transparent}html[data-desktop] .desktop-main .session-group[data-session-group=waiting]>.list-section-title>span{color:var(--warning);background:transparent}html[data-desktop] .desktop-main .session-group .list-row:last-child{border-bottom:0}html[data-desktop] .desktop-main .list-row{min-height:64px;padding:11px 12px;border-top:0;border-bottom:1px solid var(--separator);border-radius:0}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail){display:grid;grid-template-columns:24px minmax(160px,1fr) auto minmax(68px,auto);grid-template-rows:22px 20px;column-gap:14px;row-gap:4px;align-content:center}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>*{margin-left:0}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>:first-child{grid-row:1 / 3;grid-column:1;align-self:center}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>.list-row-title{grid-row:1;grid-column:2;display:block;width:100%;max-width:100%;min-height:0;padding:0;border:0;border-radius:0;text-align:left;justify-content:flex-start;font-size:14px;font-weight:600;line-height:22px;white-space:nowrap}html[data-desktop] .desktop-main .list-row-detail{grid-row:2;grid-column:2;max-width:100%;color:var(--secondaryLabel);font-size:12px;line-height:20px}html[data-desktop] .desktop-main .list-row-meta{font-size:11.5px}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>.list-row-project{grid-row:2;grid-column:3 / -1;max-width:180px;justify-self:end;text-align:right}html[data-desktop] .desktop-main .list-row:has(>button:not(.list-row-title))>.list-row-project{grid-column:3;max-width:140px}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>time{grid-row:1;grid-column:4;width:auto;min-width:56px;text-align:right;white-space:nowrap}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>.list-row-status{grid-row:1;grid-column:3;justify-self:end;white-space:nowrap}html[data-desktop] .desktop-main .list-row-status>span{font-size:11.5px;line-height:22px}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>:first-child .agent-mark{width:23px;height:23px;border-radius:7px}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail):hover{background:var(--fill)}html[data-desktop] .desktop-main .list-row-title:hover{background:transparent;color:var(--link)}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>button:not(.list-row-title){grid-row:2;grid-column:4;height:24px;justify-self:end;padding-inline:10px;font-size:11.5px;background:var(--waitingSoft);border-color:transparent;color:var(--warning);white-space:nowrap}html[data-desktop] .desktop-main .list-row-more{border:0;border-radius:9px}html[data-desktop] .desktop-main .computer-agent-row{display:grid;grid-template-columns:24px minmax(140px,190px) minmax(90px,130px) minmax(180px,1fr);gap:14px;min-height:54px;align-items:center}html[data-desktop] .desktop-main .computer-agent-row>*{margin-left:0}html[data-desktop] .desktop-main .computer-agent-label,html[data-desktop] .desktop-main .computer-agent-version,html[data-desktop] .desktop-main .computer-agent-auth{width:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-desktop] .desktop-main .computer-agent-label{font-size:13px;line-height:20px}html[data-desktop] .desktop-main .list-section-title{padding:6px 15px 8px;font-size:12px;font-weight:600}html[data-desktop] .desktop-main [data-slot=badge]{font-size:11px}html[data-desktop] .desktop-main .screen-row{min-height:84px;padding:16px 10px;margin:0;border:0;border-bottom:1px solid var(--separator);border-radius:0;background:transparent}html[data-desktop] .desktop-main .screen-row[data-current]{background:var(--fill)}html[data-desktop] .desktop-main .screens-page>.border-t{border-top:0}html[data-desktop] .desktop-main .screen-row>div:first-child>span:first-child{display:grid;place-items:center;width:39px;height:39px;border-radius:11px;background:var(--inset)}html[data-desktop] .desktop-main .session-heading{min-height:72px;padding:12px 24px;gap:16px;align-items:center;flex-wrap:nowrap;background:var(--plain)}html[data-desktop] .desktop-main .session-heading-context{display:flex;align-items:center;gap:12px;flex:1;min-width:0}html[data-desktop] .desktop-main .session-heading-copy{flex:1;min-width:0}html[data-desktop] .desktop-main .session-back{flex:none;width:28px;height:28px;color:var(--secondaryLabel)}html[data-desktop] .desktop-main .session-title h1{font-size:18px;font-weight:650;letter-spacing:-.02em;line-height:1.4;text-align:left}html[data-desktop] .desktop-main .session-subtitle{margin-top:5px;font-size:12px}html[data-desktop] .desktop-main .session-subtitle>span:nth-child(2),html[data-desktop] .desktop-main .session-subtitle>.separator{flex:none;overflow:visible;max-width:none}html[data-desktop] .desktop-main .session-subtitle>span[title]{flex:1;min-width:0}html[data-desktop] .desktop-main .session-actions{padding-top:3px}html[data-desktop] .desktop-main [data-testid=virtuoso-item-list]{padding:31px max(27px,calc((100% - 770px)/2))}html[data-desktop] .desktop-main .conversation-history-top,html[data-desktop] .desktop-main .conversation-footer{padding-inline:max(27px,calc((100% - 770px)/2))}html[data-desktop] .desktop-main .markdown{font-size:15px;line-height:1.8;letter-spacing:-.005em}html[data-desktop] .desktop-main .user-message{padding:13px 18px;border-radius:20px 20px 7px}html[data-desktop] .desktop-main .user-message .markdown{font-size:14px;line-height:1.75}html[data-desktop] .desktop-main .markdown h1{font-size:20px}html[data-desktop] .desktop-main .markdown h2{font-size:17px}html[data-desktop] .desktop-main .markdown h3{font-size:15px}html[data-desktop] .desktop-main .tool-record>summary{min-height:30px;padding:5px 8px;font-size:12px}html[data-desktop] .desktop-main .tool-record,html[data-desktop] .desktop-main .plan-card,html[data-desktop] .desktop-main .notice-card,html[data-desktop] .desktop-main .diff-block{border-radius:12px}html[data-desktop] .desktop-main .tool-record[open]>summary{border-radius:12px 12px 0 0}html[data-desktop] .desktop-main .approval-card{padding:19px;border:1px solid color-mix(in srgb,var(--warning) 21%,var(--separator));border-radius:17px;box-shadow:0 3px 12px var(--desktop-shadow)}html[data-desktop] .desktop-main .approval-icon{width:35px;height:35px;border-radius:10px}html[data-desktop] .desktop-main .composer-wrap{padding:10px max(24px,calc((100% - 790px)/2)) 18px;border-top:0;background:var(--plain)}html[data-desktop] .desktop-main .composer{height:auto;min-height:104px;border:1px solid var(--separatorStrong);border-radius:15px;background:var(--card);opacity:1;box-shadow:0 2px 10px var(--desktop-shadow)}html[data-desktop] .desktop-main .composer:focus-within{border-color:color-mix(in srgb,var(--accent) 62%,var(--separatorStrong));box-shadow:0 0 0 2px var(--accentSoft)}html[data-desktop] .desktop-main .composer textarea{min-height:54px;padding:12px 15px 6px;font-size:14px;line-height:1.7}html[data-desktop] .desktop-main .composer-toolbar{padding:3px 11px 10px}html[data-desktop] .desktop-main .composer-caption{padding-top:7px;color:var(--secondaryLabel);font-size:11px}html[data-desktop] .desktop-main .composer [data-slot=button].send-button{border-radius:50%}html[data-desktop] .desktop-main .conversation-jump button{border-color:var(--separator);box-shadow:0 4px 14px var(--desktop-shadow)}html[data-desktop] .desktop-main .welcome-live{max-width:540px;gap:18px;margin:auto;padding:36px}html[data-desktop] .desktop-main .welcome-live img{width:70px;height:70px;border-radius:19px}html[data-desktop] .desktop-main .welcome-live h1{font-size:27px;font-weight:650;letter-spacing:-.045em}html[data-desktop] .desktop-main .screen-detail-page{gap:14px;padding:19px;overflow:auto}html[data-desktop] .desktop-main .screen-detail-page>.screen-page{min-height:0;border-color:var(--separatorStrong);border-radius:14px}html[data-desktop] .desktop-main .screen-detail-page>.screen-page.screen-focused,html[data-desktop] .desktop-main .screen-detail-page>.screen-page:fullscreen{border:0;border-radius:0}html[data-desktop] .desktop-main .screen-toolbar{padding:10px 12px}html[data-desktop] .desktop-main .screen-display-mark{border-radius:17px}html[data-desktop] .desktop-main .screen-caption{min-height:32px;font-size:11px}html[data-desktop] .desktop-main .screen-stage{min-height:0}html[data-desktop] .desktop-screen-settings{display:flex;flex-wrap:wrap;gap:8px 16px;padding:10px 12px;border-bottom:1px solid var(--separator)}html[data-desktop] .desktop-screen-settings>div{display:flex;align-items:center;flex-wrap:wrap;gap:3px}html[data-desktop] .desktop-screen-settings>div>span{margin-right:6px;color:var(--secondaryLabel);font-size:11px}html[data-desktop] .desktop-native-screen .screen-stage{position:relative}html[data-desktop] .desktop-main [data-slot=button]:focus-visible,html[data-desktop] [data-slot=sidebar-menu-button]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@container desktop-workspace (max-width: 880px){html[data-desktop] .desktop-main .session-actions{padding-top:0}html[data-desktop] .desktop-main .session-actions [data-slot=button][data-size=sm]{font-size:12px;padding-inline:8px;gap:5px}}@container desktop-workspace (max-width: 600px){html[data-desktop] .desktop-main .session-overview-filters{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}html[data-desktop] .desktop-main .session-overview-tools{margin-left:0;justify-content:flex-start}html[data-desktop] .desktop-main .computer-agent-row{grid-template-columns:24px minmax(0,1fr) auto;gap:4px 12px}html[data-desktop] .desktop-main .computer-agent-row>.agent-mark{grid-column:1;grid-row:1 / 3}html[data-desktop] .desktop-main .computer-agent-label{grid-column:2;grid-row:1}html[data-desktop] .desktop-main .computer-agent-version{grid-column:3;grid-row:1;max-width:110px}html[data-desktop] .desktop-main .computer-agent-auth{grid-column:2 / -1;grid-row:2}}@container desktop-workspace (max-width: 760px){html[data-desktop] .desktop-main .list-row:has(>.list-row-detail)>.list-row-project{display:none}html[data-desktop] .desktop-main .list-row-detail{grid-column:2 / -1}}@media(max-height:760px){html[data-desktop] .desktop-navigation{gap:17px;padding-bottom:8px}html[data-desktop] .desktop-sidebar-footer{gap:7px;padding-top:8px}}@media(max-height:600px){html[data-desktop] .desktop-navigation{gap:12px}html[data-desktop] .desktop-navigation-group [data-slot=sidebar-menu-button]{height:35px}html[data-desktop] .desktop-sidebar-footer{padding-block:8px}html[data-desktop] .desktop-main .session-heading{min-height:67px;padding:10px 20px;gap:6px}html[data-desktop] .desktop-main .session-subtitle{margin-top:4px}html[data-desktop] .desktop-main .composer-wrap{gap:6px;padding-top:7px;padding-bottom:8px}html[data-desktop] .desktop-main .composer{min-height:91px}html[data-desktop] .desktop-main .composer textarea{min-height:48px;padding-top:12px;padding-bottom:6px}html[data-desktop] .desktop-main .composer-toolbar{padding-top:0;padding-bottom:7px}html[data-desktop] .desktop-main .composer-caption{padding-top:4px}html[data-desktop] .desktop-main [data-testid=virtuoso-item-list]{padding-block:20px}}@media(max-width:1080px){html[data-desktop] .desktop-main .live-overview,html[data-desktop] .desktop-main .screens-page{padding-inline:22px}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail){column-gap:8px}}@media(max-width:767px){html[data-desktop] .desktop-main{height:100dvh;margin:0;border:0;border-radius:0}html[data-desktop] .desktop-main .session-heading,html[data-desktop] .desktop-main .live-overview,html[data-desktop] .desktop-main .screens-page{padding-inline:16px}html[data-desktop] .desktop-main .list-row-detail{display:block}html[data-desktop] .desktop-main .list-row:has(>.list-row-detail){grid-template-columns:24px minmax(80px,1fr) 70px 52px;column-gap:7px}html[data-desktop] .desktop-main .composer-wrap{padding-inline:15px;padding-bottom:12px}}