browsertrack 0.2.2 → 0.2.3
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/dist/{chunk-TWEYRBDU.js → chunk-5NR5K3ER.js} +24 -5
- package/dist/chunk-5NR5K3ER.js.map +1 -0
- package/dist/{chunk-AYSVE6NG.js → chunk-G5CIZSQM.js} +2 -2
- package/dist/{chunk-QRZ57ME3.js → chunk-ONPW7AYL.js} +75 -11
- package/dist/chunk-ONPW7AYL.js.map +1 -0
- package/dist/{chunk-4HRLW6YF.js → chunk-PG4JJDCV.js} +196 -17
- package/dist/chunk-PG4JJDCV.js.map +1 -0
- package/dist/cli/index.js +22 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/client/index.cjs +267 -26
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -2
- package/dist/client.iife.js +121 -15
- package/dist/core/index.d.ts +9 -2
- package/dist/core/index.js +3 -1
- package/dist/daemon/index.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -4
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +3 -3
- package/dist/{server-DjV7RWQM.d.ts → server-BRG-RQQP.d.ts} +1 -0
- package/package.json +1 -1
- package/packages/client/src/notes/inspector.ts +210 -19
- package/packages/core/src/selector.ts +110 -15
- package/packages/mcp/src/handlers.ts +7 -0
- package/packages/mcp/src/server.ts +21 -3
- package/test/core/selector.test.ts +133 -0
- package/dist/chunk-4HRLW6YF.js.map +0 -1
- package/dist/chunk-QRZ57ME3.js.map +0 -1
- package/dist/chunk-TWEYRBDU.js.map +0 -1
- /package/dist/{chunk-AYSVE6NG.js.map → chunk-G5CIZSQM.js.map} +0 -0
package/dist/client.iife.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var BrowserTrack=(()=>{var nt=Object.defineProperty;var ko=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var Eo=Object.prototype.hasOwnProperty;var $o=(e,t,r)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ao=(e,t)=>{for(var r in t)nt(e,r,{get:t[r],enumerable:!0})},No=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Mo(t))!Eo.call(e,o)&&o!==r&&nt(e,o,{get:()=>t[o],enumerable:!(n=ko(t,o))||n.enumerable});return e};var Ro=e=>No(nt({},"__esModule",{value:!0}),e);var R=(e,t,r)=>$o(e,typeof t!="symbol"?t+"":t,r);var Ml={};Ao(Ml,{BreadcrumbBuffer:()=>Ie,BrowserScriptScreenshotDriver:()=>ze,BrowserTrackClient:()=>Xe,DEFAULT_OPTIONS:()=>st,NoteInspector:()=>Ve,getClient:()=>po,init:()=>wr,resolveComponentSource:()=>Re,shouldHideUIFromUrl:()=>Dt});var Ie=class{constructor(t=50){R(this,"capacity");R(this,"buffer",[]);this.capacity=t}add(t){let r={...t,timestamp:t.timestamp||Date.now()};this.buffer.push(r),this.buffer.length>this.capacity&&this.buffer.shift()}getRecent(){return[...this.buffer]}clear(){this.buffer=[]}};var ot="[REDACTED]",To=[/^authorization$/i,/^cookie$/i,/^set-cookie$/i,/password/i,/token/i,/secret/i,/api[-_]?key/i,/access[-_]?token/i,/refresh[-_]?token/i,/credentials/i,/private[-_]?key/i,/ssn/i,/credit[-_]?card/i,/cvv/i],Nr=["token","auth","key","apikey","api_key","secret","password","access_token","refresh_token","code","signature"];function Lo(e){if(!e)return!1;let t=e.replace(/[-_]/g,"");return To.some(r=>r.test(e)||r.test(t))}function me(e){if(!e)return e;try{let t=!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("ws://")&&!e.startsWith("wss://"),r="http://localhost",n=new URL(e,r),o=!1;for(let a of Nr)n.searchParams.has(a)&&(n.searchParams.set(a,ot),o=!0);for(let a of Array.from(n.searchParams.keys()))Lo(a)&&(n.searchParams.set(a,ot),o=!0);if(!o)return e;let i=t?n.pathname+n.search+n.hash:n.toString();return i=i.replace(/%5BREDACTED%5D/g,ot),i}catch{let t=e;for(let r of Nr){let n=new RegExp(`([?&]${r}=)[^&#]+`,"gi");t=t.replace(n,`$1${ot}`)}return t}}function ge(e,t={}){if(!e||!e.tagName)return"unknown";let r=t.maxClasses??2,n=e.getAttribute("data-testid")||e.getAttribute("data-test")||e.getAttribute("data-cy")||e.getAttribute("data-qa");if(n)return`[data-testid="${n}"]`;let o=e.id;if(o&&!/^[0-9]+$/.test(o)&&!/[0-9a-f]{8}-[0-9a-f]{4}/i.test(o))return`#${o}`;let i=e.getAttribute("aria-label");if(i&&i.length<30)return`${e.tagName.toLowerCase()}[aria-label="${i}"]`;let a=e.getAttribute("name");if(a)return`${e.tagName.toLowerCase()}[name="${a}"]`;let s=e.tagName.toLowerCase(),l=Array.from(e.classList||[]).filter(d=>!d.startsWith("css-")&&!d.startsWith("_")&&!/^[a-z0-9]{5,}$/i.test(d)).slice(0,r);if(l.length>0){let d=l.map(c=>`.${c}`).join("");return`${s}${d}`}if(e.parentElement&&e.parentElement!==document.body&&e.parentElement!==document.documentElement){let d=ge(e.parentElement,{maxClasses:1});if(d&&d!=="unknown"&&!d.includes(">"))return`${d} > ${s}`}return s}function ke(e,t=200){return e?e.length<=t?e:e.slice(0,t)+"...":""}function Ot(e,t="{}"){if(e===void 0)return t;try{let r=new WeakSet;return JSON.stringify(e,(n,o)=>{if(typeof o=="object"&&o!==null){if(r.has(o))return"[Circular]";r.add(o)}return typeof o=="bigint"?o.toString():o})}catch{try{return JSON.stringify(String(e))}catch{return t}}}function Re(e){if(!e||typeof e!="object")return;let t=Fo(e);if(t)return t;let r=Po(e);if(r)return r;let n=Io(e);if(n)return n;if(e.tagName&&e.tagName.includes("-"))return{framework:"web-component",componentName:e.tagName.toLowerCase(),hierarchy:[e.tagName.toLowerCase()]};let o=Oo(e);if(o)return o}function Fo(e){try{let t=Object.keys(e).find(u=>u.startsWith("__reactFiber$")||u.startsWith("__reactInternalInstance$"));if(!t)return;let r=e[t];if(!r)return;let n,o,i,a,s=[],l;if(r._debugSource&&(n=r._debugSource.fileName,o=r._debugSource.lineNumber,i=r._debugSource.columnNumber),r._debugOwner){let u=r._debugOwner.type;a=Rr(u),!n&&r._debugOwner._debugSource&&(n=r._debugOwner._debugSource.fileName,o=r._debugOwner._debugSource.lineNumber,i=r._debugOwner._debugSource.columnNumber)}let d=r,c=0;for(;d&&c<50;){c++;let u=d.type,p=Rr(u);p&&!p.startsWith("html:")&&p!=="Fragment"&&(a||(a=p),s.includes(p)||s.unshift(p),!n&&d._debugSource&&(n=d._debugSource.fileName,o=d._debugSource.lineNumber,i=d._debugSource.columnNumber),!l&&d.memoizedProps&&typeof d.memoizedProps=="object"&&(l=_t(d.memoizedProps))),d=d.return}return!a&&!n?void 0:{framework:"react",componentName:a,sourceFile:Oe(n),sourceLine:o,sourceColumn:i,hierarchy:s.length>0?s:a?[a]:void 0,props:l}}catch{return}}function Rr(e){if(e&&typeof e!="string"){if(e.displayName)return e.displayName;if(e.name)return e.name;if(e.render?.displayName)return e.render.displayName;if(e.render?.name)return e.render.name}}function Po(e){try{let t=e.__vueParentComponent||e.__vnode?.ctx;if(t){let n=t.type||{},o=n.name||n.__name||n.displayName||"AnonymousComponent",i=n.__file,a=[],s=t,l=0;for(;s&&l<50;){l++;let d=s.type||{},c=d.name||d.__name||d.displayName;c&&!a.includes(c)&&a.unshift(c),s=s.parent}return{framework:"vue",componentName:o,sourceFile:Oe(i),hierarchy:a.length>0?a:[o],props:t.props?_t(t.props):void 0}}let r=e.__vue__;if(r){let n=r.$options||{},o=n.name||n._componentTag||"VueComponent",i=n.__file;return{framework:"vue",componentName:o,sourceFile:Oe(i),hierarchy:[o],props:r.$props?_t(r.$props):void 0}}return}catch{return}}function Io(e){try{let t=e,r=0;for(;t&&r<50;){r++;let n=t.__svelte_meta;if(n&&n.loc)return{framework:"svelte",sourceFile:Oe(n.loc.file),sourceLine:n.loc.line,sourceColumn:n.loc.column,componentName:n.loc.file?Tr(n.loc.file):void 0,hierarchy:n.loc.file?[Tr(n.loc.file)]:void 0};t=t.parentElement}return}catch{return}}function Oo(e){try{let t=e.closest("[data-component], [data-component-name], [data-source-file]");if(!t)return;let r=t.getAttribute("data-component")||t.getAttribute("data-component-name")||void 0,n=t.getAttribute("data-source-file")||void 0,o=t.getAttribute("data-source-line"),i=o?parseInt(o,10):void 0;return!r&&!n?void 0:{framework:"vanilla",componentName:r,sourceFile:Oe(n),sourceLine:isNaN(i)?void 0:i,hierarchy:r?[r]:void 0}}catch{return}}function Oe(e){return e?e.split("?")[0]:void 0}function Tr(e){let t=e.split("/"),r=t[t.length-1]||e;return r.split(".")[0]||r}function _t(e){let t={};for(let[r,n]of Object.entries(e))r.startsWith("__")||typeof n=="function"||(n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"?t[r]=n:Array.isArray(n)?t[r]=`Array(${n.length})`:typeof n=="object"&&(t[r]="[Object]"));return t}function _e(e){let t=ge(e),r=e.tagName.toLowerCase(),n=e.id||void 0,o=Array.from(e.classList||[]),i=Re(e),a,s=!0;try{let c=e.getBoundingClientRect();a={x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),top:Math.round(c.top),left:Math.round(c.left),bottom:Math.round(c.bottom),right:Math.round(c.right)};let u=window.getComputedStyle(e);s=u.display!=="none"&&u.visibility!=="hidden"&&u.opacity!=="0"&&c.width>0&&c.height>0}catch{}let l;r!=="input"&&r!=="textarea"&&r!=="select"&&(l=ke(e.textContent?.trim(),80));let d=ke(e.outerHTML?.trim(),200);return{selector:t,tag:r,id:n,classes:o,boundingRect:a,visible:s,innerText:l,outerHTML:d,componentSource:i}}function Lr(e){if(typeof document>"u")return()=>{};let t=n=>{try{let o=n.target;if(!o||!(o instanceof Element))return;let i=_e(o),a=`click ${i.selector}${i.innerText?` ("${i.innerText}")`:""}`;e({type:"click",category:"ui",message:a,timestamp:Date.now(),element:i},i)}catch{}},r=n=>{try{let o=n.target;if(!o||!(o instanceof Element))return;let i=_e(o),a=o.getAttribute("action")||"",s=`submit form ${i.selector}${a?` (action: ${a})`:""}`;e({type:"submit",category:"ui",message:s,timestamp:Date.now(),element:i},i)}catch{}};return document.addEventListener("click",t,{capture:!0,passive:!0}),document.addEventListener("submit",r,{capture:!0,passive:!0}),()=>{document.removeEventListener("click",t,{capture:!0}),document.removeEventListener("submit",r,{capture:!0})}}var it=class{constructor(t){R(this,"screenshotDriver");this.screenshotDriver=t}async executeCommand(t){try{switch(t.type){case"reload":return this.handleReload(t);case"navigate":return this.handleNavigate(t);case"get_page_state":return this.handleGetPageState(t);case"query_element":return this.handleQueryElement(t);case"capture_element":return await this.handleCaptureElement(t);case"check_overflow":return this.handleCheckOverflow(t);case"get_element_rect":return this.handleGetElementRect(t);case"get_element_style":return this.handleGetElementStyle(t);default:return{id:t.id,ok:!1,error:`Unsupported command type: ${t.type}`}}}catch(r){return{id:t.id,ok:!1,error:r?.message||"Command execution failed"}}}handleReload(t){return typeof window<"u"&&window.location?(setTimeout(()=>{window.location.reload()},50),{id:t.id,ok:!0,result:{message:"Reload initiated"}}):{id:t.id,ok:!1,error:"No browser window available"}}handleNavigate(t){let r=t.params?.url;return r?typeof window<"u"&&window.location?(setTimeout(()=>{window.location.href=r},50),{id:t.id,ok:!0,result:{message:`Navigating to ${r}`}}):{id:t.id,ok:!1,error:"No browser window available"}:{id:t.id,ok:!1,error:"Missing target url parameter"}}handleGetPageState(t){if(typeof window>"u"||typeof document>"u")return{id:t.id,ok:!1,error:"No browser document available"};let r=document.activeElement&&document.activeElement!==document.body?_e(document.activeElement):void 0;return{id:t.id,ok:!0,result:{url:window.location.href,route:window.location.pathname+window.location.search+window.location.hash,title:document.title,readyState:document.readyState,activeElement:r}}}handleQueryElement(t){if(typeof document>"u")return{id:t.id,ok:!1,error:"No browser document available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!0,result:{exists:!1}};let o=_e(n);return{id:t.id,ok:!0,result:{exists:!0,visible:o.visible,tag:o.tag,id:o.id,classes:o.classes,boundingRect:o.boundingRect,innerText:o.innerText,outerHTML:o.outerHTML}}}async handleCaptureElement(t){let r=t.params?.selector,n=null;if(r){if(n=document.querySelector(r),!n)return{id:t.id,ok:!1,reason:`ELEMENT_NOT_FOUND: ${r}`,error:`Element not found for selector: ${r}`}}else n=document.body||document.documentElement;let o=await this.screenshotDriver.captureElement(n);return o.ok?{id:t.id,ok:!0,result:{dataUrl:o.dataUrl,format:o.format,width:o.width,height:o.height}}:{id:t.id,ok:!1,reason:o.reason||"CAPTURE_FAILED",error:o.reason||"Failed to capture element screenshot"}}handleCheckOverflow(t){if(typeof window>"u"||typeof document>"u")return{id:t.id,ok:!1,error:"No browser window available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!1,error:`Element not found: ${r}`};let o=n.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,s=Math.max(0,Math.round(o.right-i)),l=Math.max(0,Math.round(o.bottom-a)),d=s>0||o.left<0,c=!1;return n.parentElement&&(c=n.parentElement.scrollWidth>n.parentElement.clientWidth),{id:t.id,ok:!0,result:{selector:r,overflow:d||c,viewportWidth:i,viewportHeight:a,rect:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(o.width),height:Math.round(o.height),top:Math.round(o.top),left:Math.round(o.left),bottom:Math.round(o.bottom),right:Math.round(o.right)},overflowRightPx:s,overflowBottomPx:l,parentOverflow:c}}}handleGetElementRect(t){if(typeof document>"u")return{id:t.id,ok:!1,error:"No browser document available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!1,error:`Element not found: ${r}`};let o=n.getBoundingClientRect();return{id:t.id,ok:!0,result:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(o.width),height:Math.round(o.height),top:Math.round(o.top),left:Math.round(o.left),bottom:Math.round(o.bottom),right:Math.round(o.right)}}}handleGetElementStyle(t){if(typeof window>"u"||typeof document>"u")return{id:t.id,ok:!1,error:"No browser window available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!1,error:`Element not found: ${r}`};let o=window.getComputedStyle(n),i=t.params?.properties||["overflow","overflowX","overflowY","width","maxWidth","display","position"],a={};for(let s of i)a[s]=o.getPropertyValue(s)||o[s]||"";return{id:t.id,ok:!0,result:{selector:r,styles:a}}}};var st={daemonUrl:"ws://127.0.0.1:7331",projectId:"",maxBreadcrumbs:50,captureErrors:!0,captureConsole:!0,captureNetwork:!0,captureNavigation:!0,captureInteractions:!0,onErrorScreenshot:!0,notes:{enabled:!0,shortcut:"Alt+Click",showBadges:!0,showToolbar:!0,maskSelectors:['input[type="password"]',"[data-sensitive]"]},hidden:!1,hideQueryParam:void 0,debug:!1},at=new Set(["0","false","hidden","hide","off","none","disabled","ui_off","silent"]);function Dt(e,t){let r=t;if(r===void 0){if(typeof window>"u"||!window.location)return!1;r=window.location.search}if(!r)return!1;try{let n=new URLSearchParams(r);if(e){let o=Array.isArray(e)?e:[e];for(let i of o)if(n.has(i)){let a=(n.get(i)||"").toLowerCase().trim();if(a===""||a==="1"||a==="true"||at.has(a))return!0}}for(let o of["no_bt","no_browsertrack","hide_bt","hide_browsertrack"])if(n.has(o)){let i=(n.get(o)||"").toLowerCase().trim();if(i===""||i==="1"||i==="true"||i==="yes")return!0}if(n.has("bt")){let o=(n.get("bt")||"").toLowerCase().trim();if(at.has(o))return!0}if(n.has("browsertrack")){let o=(n.get("browsertrack")||"").toLowerCase().trim();if(at.has(o))return!0}if(n.has("bt_ui")){let o=(n.get("bt_ui")||"").toLowerCase().trim();if(at.has(o)||o==="0"||o==="false")return!0}if(n.has("bt_hide")){let o=(n.get("bt_hide")||"").toLowerCase().trim();if(o===""||o==="1"||o==="true")return!0}}catch{}return!1}function Fr(e){if(typeof console>"u")return()=>{};let t=console.error,r=console.warn;function n(o){return o.map(i=>{if(i instanceof Error)return i.stack||`${i.name}: ${i.message}`;if(typeof i=="object"&&i!==null)try{return JSON.stringify(i)}catch{return String(i)}return String(i)}).join(" ")}return console.error=function(...o){try{let i=n(o),a=new Error().stack;e({level:"error",message:i,stack:a,timestamp:Date.now()})}catch{}return t.apply(console,o)},console.warn=function(...o){try{let i=n(o),a=new Error().stack;e({level:"warn",message:i,stack:a,timestamp:Date.now()})}catch{}return r.apply(console,o)},()=>{console.error=t,console.warn=r}}function Pr(e){if(typeof window>"u"||typeof history>"u")return()=>{};let t="";try{t=me(window.location.href),e({to:t,type:"initial",timestamp:Date.now()})}catch{}let r=history.pushState,n=history.replaceState;history.pushState=function(a,s,l){let d=t,c=r.apply(history,[a,s,l]);try{let u=me(window.location.href);t=u,e({from:d,to:u,type:"pushState",timestamp:Date.now()})}catch{}return c},history.replaceState=function(a,s,l){let d=t,c=n.apply(history,[a,s,l]);try{let u=me(window.location.href);t=u,e({from:d,to:u,type:"replaceState",timestamp:Date.now()})}catch{}return c};let o=()=>{try{let a=t,s=me(window.location.href);t=s,e({from:a,to:s,type:"popstate",timestamp:Date.now()})}catch{}},i=()=>{try{let a=t,s=me(window.location.href);t=s,e({from:a,to:s,type:"hashchange",timestamp:Date.now()})}catch{}};return window.addEventListener("popstate",o),window.addEventListener("hashchange",i),()=>{history.pushState=r,history.replaceState=n,window.removeEventListener("popstate",o),window.removeEventListener("hashchange",i)}}function Ir(e){let t=[];if(typeof window<"u"&&typeof window.fetch=="function"){let r=window.fetch;window.fetch=async function(n,o){let i=Date.now(),a="",s="GET";try{typeof n=="string"?a=n:n instanceof URL?a=n.toString():n&&typeof n=="object"&&"url"in n&&(a=n.url,s=n.method||"GET"),o&&o.method&&(s=o.method.toUpperCase())}catch{a="unknown_url"}let l=me(a),d;try{d=await r.apply(window,[n,o])}catch(u){let p=Date.now()-i,f=u?.name==="AbortError";try{e({url:l,method:s,durationMs:p,error:u?.message||"Network request failed",aborted:f,timestamp:i})}catch{}throw u}let c=Date.now()-i;try{e({url:l,method:s,status:d.status,statusText:d.statusText,durationMs:c,timestamp:i})}catch{}return d},t.push(()=>{window.fetch=r})}if(typeof window<"u"&&typeof window.XMLHttpRequest=="function"){let r=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send,o=XMLHttpRequest.prototype.abort,i=new WeakMap;XMLHttpRequest.prototype.open=function(...a){try{let s=String(a[0]||"GET").toUpperCase(),l=String(a[1]||"");i.set(this,{url:me(l),method:s,startTime:Date.now()})}catch{}return r.apply(this,a)},XMLHttpRequest.prototype.abort=function(){let a=i.get(this);return a&&(a.aborted=!0),o.apply(this)},XMLHttpRequest.prototype.send=function(a){let s=i.get(this)||{url:"unknown_url",method:"GET",startTime:Date.now()},l=()=>{try{let c=Date.now()-s.startTime;e({url:s.url,method:s.method,status:this.status,statusText:this.statusText,durationMs:c,aborted:s.aborted,timestamp:s.startTime})}catch{}},d=()=>{try{let c=Date.now()-s.startTime;e({url:s.url,method:s.method,status:this.status||0,durationMs:c,error:"XHR Network Error",aborted:s.aborted,timestamp:s.startTime})}catch{}};return this.addEventListener("load",l,{once:!0}),this.addEventListener("error",d,{once:!0}),this.addEventListener("timeout",d,{once:!0}),n.apply(this,[a])},t.push(()=>{XMLHttpRequest.prototype.open=r,XMLHttpRequest.prototype.send=n,XMLHttpRequest.prototype.abort=o})}return()=>{for(let r of t)try{r()}catch{}}}function Or(e){if(typeof window>"u")return()=>{};let t=n=>{try{let o={message:n.message||n.error&&n.error.message||"Script error",stack:n.error&&n.error.stack||void 0,filename:n.filename||void 0,lineno:n.lineno||void 0,colno:n.colno||void 0,errorType:n.error&&n.error.name||"Error",timestamp:Date.now()};e(o,n.error)}catch{}},r=n=>{try{let o=n.reason,i="Unhandled Promise Rejection",a,s="UnhandledRejection";if(o instanceof Error)i=o.message,a=o.stack,s=o.name||"UnhandledRejection";else if(typeof o=="string")i=o;else if(o&&typeof o=="object")try{i=JSON.stringify(o)}catch{i=String(o)}let l={message:i,stack:a,errorType:s,timestamp:Date.now()};e(l,o)}catch{}};return window.addEventListener("error",t),window.addEventListener("unhandledrejection",r),()=>{window.removeEventListener("error",t),window.removeEventListener("unhandledrejection",r)}}var _o=Object.defineProperty,ae=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}},Ue=(e,t)=>{for(var r in t)_o(e,r,{get:t[r],enumerable:!0})};function Do(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function Ho(e="soft"){switch(e){case"auto":{k.session.styleMap=new Map,k.session.nodeMap=new Map;return}case"soft":{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap,k.computedStyle=new WeakMap,k.measureHints=new WeakMap,k.baseStyle=new re(50),k.defaultStyle=new re(30),k.image=new re(100),k.background=new re(100),k.resource=new re(150),k.compress=new re(50),k.font=new Set;return}default:{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap;return}}}var re,k,ne=ae(()=>{"use strict";re=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,t)}},k={image:new re(100),background:new re(100),resource:new re(150),defaultStyle:new re(30),baseStyle:new re(50),compress:new re(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function cr(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function bn(e,t=1){let r=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!r)return null;let n=[];for(let o of r[1].split(",")){let i=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!i)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!yn.test(a[1].trim()))continue;let s=o.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),l=1;if(s){let d=parseFloat(s[1]);l=/dpi/i.test(s[2])?d/96:d}n.push({url:i[2].trim(),dppx:l})}return n.length?(n.sort((o,i)=>o.dppx-i.dppx),(n.find(o=>o.dppx>=t)||n[n.length-1]).url):null}function Wo(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==6?`matrix(${n})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${n})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Ct(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Bo(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let r=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,r).href}catch{return e}}var yn,Nt=ae(()=>{"use strict";yn=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function jo(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:r=12}={}){let n=new Map,o=0;function i(a,s,l){if(o>=r)return;let d=Date.now();(n.get(s)||0)>d||(n.set(s,d+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${l}`):console&&console.error&&console.error(`${e} ${l}`))}return{warnOnce(a,s){i("warn",a,s)},errorOnce(a,s){i("error",a,s)},reset(){n.clear(),o=0}}}function Uo(e){return/^data:|^blob:|^about:blank$/i.test(e)}function qo(e,t){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(n||".",r),i=new URL(e,r);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function zo(e,t){if(!t||Uo(e)||qo(e,t))return!1;try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,r);return typeof location<"u"?n.origin!==location.origin:!0}catch{return!!t}}function Vo(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Ct(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Ct(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function _r(e){return new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(e)})}function Xo(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function le(e,t={}){let r=t.as??"blob",n=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(r==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,g="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(g)?atob(y):decodeURIComponent(y),v=new Uint8Array([...x].map(w=>w.charCodeAt(0))),b=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:b,status:200,url:e,fromCache:!1,mime:b.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let g=await fetch(e);if(!g.ok)return{ok:!1,data:null,status:g.status,url:e,fromCache:!1,reason:"http_error"};let y=await g.blob(),x=y.type||g.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await _r(y),status:g.status,url:e,fromCache:!1,mime:x}:r==="text"?{ok:!0,data:await y.text(),status:g.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:y,status:g.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let l=Xo(e,{as:r,timeout:n,useProxy:o,errorTTL:i}),d=He.get(l);if(d&&d.until>Date.now())return{...d.result,fromCache:!0};d&&He.delete(l);let c=ft.get(l);if(c)return c;let u=zo(e,o)?Vo(e,o):e,p=t.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let f=new AbortController,h=setTimeout(()=>f.abort("timeout"),n),m=(async()=>{try{let g=await fetch(u,{signal:f.signal,credentials:p,headers:a});if(!g.ok){let v={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(i>0&&He.set(l,{until:Date.now()+i,result:v}),!s){let b=`${g.status} ${g.statusText||""}`.trim();qt.warnOnce(`http:${g.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${b} while fetching ${r} ${e}`)}return t.onError&&t.onError(v),v}if(r==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),x=y.type||g.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await _r(y),status:g.status,url:u,fromCache:!1,mime:x}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:x}}catch(g){let y=g&&typeof g=="object"&&"name"in g&&g.name==="AbortError"?String(g.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&He.set(l,{until:Date.now()+i,result:x}),!s){let v=`${y}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,b=y==="timeout"?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${r} ${e}`:`Network/CORS issue while fetching ${r} ${e}. A proxy may be required`;qt.errorOnce(v,b)}return t.onError&&t.onError(x),x}finally{clearTimeout(h),ft.delete(l)}})();return ft.set(l,m),m}var qt,ft,He,$e=ae(()=>{"use strict";Nt(),qt=jo("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),ft=new Map,He=new Map});async function wn(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=bn(e,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??cr(e);if(!r)return e;let n=Bo(r),o=Ct(n),i=(t.useProxy||"")+"|"+o;if(k.background.has(i)){let a=k.background.get(i);return a?`url("${a}")`:"none"}try{let a=await le(o,{as:"dataURL",useProxy:t.useProxy});return a.ok?(k.background.set(i,a.data),`url("${a.data}")`):(k.background.set(i,null),"none")}catch{return k.background.set(i,null),"none"}}var Yo=ae(()=>{"use strict";ne(),Nt(),$e()});function xn(e){if(e=String(e).toLowerCase(),ur.has(e)){let i={};return k.defaultStyle.set(e,i),i}if(k.defaultStyle.has(e))return k.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let r=document.createElement(e);r.style.all="initial",t.appendChild(r);let n=getComputedStyle(r),o={};for(let i of n){if(dr(i))continue;let a=n.getPropertyValue(i);o[i]=a}return t.removeChild(r),k.defaultStyle.set(e,o),o}function dr(e){let t=Xt.get(e);if(t===void 0){let r=String(e).toLowerCase();t=Mn.has(r)||kn.test(r)||Cn.test(r),Xt.set(e,t)}return t}function vn(e,t){return!$n.has(e)&&(t==="inline"||En.has(e)||pr.has(e))}function Go(e,t,r){let n=(t.display||"").toLowerCase();if(n==="inline"||pr.has(e))return!1;if(r)return!0;if((t.float||"none").toLowerCase()!=="none")return!1;let o=(t.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!Tn.has(n)}function zt(e,t,r=!0,n=!1){if(t=String(t||"").toLowerCase(),ur.has(t))return"";let o=[],i=xn(t),a=(e.display||"").toLowerCase(),s=a==="inline",l=vn(t,a),d=e["text-wrap-mode"]||e["white-space"]||"",c=d==="nowrap"||d==="pre",u=l&&r&&!(l&&r&&!s&&c),p=!1;for(let f in e){if(dr(f))continue;let h=e[f];if(u){if(An.has(f))continue;if(Nn.has(f)){h&&h!==i[f]&&(o.push(`${f}:${h}`),h!=="auto"&&(p=!0));continue}}if(h&&h!==i[f]){if(!c&&(f==="width"||f==="inline-size")&&h.endsWith("px")&&h.includes(".")){let m=parseFloat(h);if(Number.isFinite(m)){o.push(`${f}:${(m+Rn).toFixed(3)}px`);continue}}o.push(`${f}:${h}`)}}if(u&&!s&&!n&&!p){let f=e.width;f&&f!=="auto"&&f!==i.width&&o.push(`min-width:${f}`)}return o.sort(),o.join(";")}function Qo(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(r=>t.add(r.tagName.toLowerCase())),Array.from(t))}function Ko(e){let t=new Map;for(let n of e){let o=xn(n);if(!o)continue;let i=Object.entries(o).map(([a,s])=>`${a}:${s};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(n))}let r="";for(let[n,o]of t.entries())r+=`${o.join(",")} { ${n} }
|
|
2
|
-
`;return r}function Jo(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),r=new Map,n=1;for(let o of t)r.set(o,`c${n++}`);return r}function Zo(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let r=t.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let n=0;n<window.frames.length;n++)try{if(window.frames[n]?.document===t)return window.frames[n]}catch{}}catch{}return typeof window<"u"?window:null}function B(e,t=null){let r=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(e?.nodeType!==1){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(e,t)||r()}catch{return r()}return r()}let n=k.computedStyle.get(e);n||(n=new Map,k.computedStyle.set(e,n));let o=n.get(t);if(!o){let i=Zo(e),a=null;try{a=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}o=a||r(),n.set(t,o)}return o}function Dr(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);for(let r of Ln){let n=t[`border-${r}-style`],o=t[`border-${r}-width`];(n==="none"||n==="hidden"||o==="0px")&&(delete t[`border-${r}-style`],delete t[`border-${r}-width`],delete t[`border-${r}-color`])}return t}function Vt(e){let t=[],r=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&r++,i===")"&&r--,i===","&&r===0&&(t.push(e.slice(n,o).trim()),n=o+1)}return t.push(e.slice(n).trim()),t}var Sn,ur,ei,Cn,kn,Mn,Xt,En,pr,$n,An,Nn,Rn,Tn,Ln,Rt=ae(()=>{"use strict";ne(),Sn=new Set(["meta","script","noscript","title","link","template"]),ur=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),ei=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],Cn=/(?:^|-)(animation|transition)(?:-|$)/i,kn=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Mn=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),Xt=new Map,En=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),pr=new Set(["table","thead","tbody","tfoot","tr","td","th"]),$n=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),An=new Set(["width","max-width","inline-size","max-inline-size"]),Nn=new Set(["min-width","min-inline-size"]),Rn=.001,Tn=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]),Ln=["top","right","bottom","left"]});function ht(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Me(e=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(t=>{let r=!1,n=()=>{r||(r=!0,t())};try{requestAnimationFrame(n)}catch{n();return}setTimeout(n,e)})}function ti(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),r=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||r}function we(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),r=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),n=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=n&&o&&i,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),d=/ipad|iphone|ipod/.test(t)&&n;return r||a||s||l||d}function ri(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Ae=ae(()=>{"use strict"});function j(e,t,r){let n=e&&typeof e=="object"&&(e.options||e);n&&n.debug&&(r!==void 0?console.warn("[snapdom]",t,r):console.warn("[snapdom]",t))}var Fn=ae(()=>{"use strict"}),de=ae(()=>{"use strict";Yo(),Rt(),Ae(),Nt(),Fn()}),Pn={};Ue(Pn,{decodeSvgFromDataURL:()=>fr,encodeSvgToDataURL:()=>hr,fixSafariShadows:()=>mr,toCanvas:()=>Tt});function ni(e){try{let t=e.match(/<svg\b[^>]*>/i);if(!t)return e;let r=t[0],n=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(n)||!Number.isFinite(o)||n<=0||o<=0)return e;let i=Math.min(1,ye/n,ye/o,Math.sqrt(kt/(n*o)));if(i>=1)return e;let a=Math.max(1,Math.floor(n*i)),s=Math.max(1,Math.floor(o*i));return console.warn(`[snapDOM] Capture ${Math.round(n)}\xD7${Math.round(o)}px exceeds the browser image-decode limit (${ye}px/side); downscaling to ${a}\xD7${s}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${s}`))}catch{return e}}function oi(e,t){let r=["x","y","width","height"].map(S=>Number(t?.[S]));if(!r.every(Number.isFinite)||r[2]<=0||r[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let n=e.match(/<svg\b[^>]*>/i);if(!n)throw new Error("[snapdom] cannot crop a non-SVG capture");let o=n[0],i=(o.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(i||"").trim().split(/[\s,]+/).map(Number);if(a.length!==4||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[s,l,d,c]=a,u=Math.max(s,r[0]),p=Math.max(l,r[1]),f=Math.min(s+d,r[0]+r[2]),h=Math.min(l+c,r[1]+r[3]);if(!(f>u)||!(h>p))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let m=parseFloat((o.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((o.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(m)&&m>0?m/d:1,x=Number.isFinite(g)&&g>0?g/c:1,v=Math.max(1,(f-u)*y),b=Math.max(1,(h-p)*x),w=o.replace(/(\bwidth=")[^"]*/i,`$1${v}`).replace(/(\bheight=")[^"]*/i,`$1${b}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${p} ${f-u} ${h-p}`);return e.replace(o,w)}function Hr(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function fr(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function ii(e){let t=e.indexOf(",");if(t<0)return"";let r=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(r)}catch{return""}}function hr(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function In(e){let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&n++,i===")"&&(n=Math.max(0,n-1)),i===";"&&n===0?(t.push(r),r=""):r+=i}return r.trim()&&t.push(r),t.map(o=>o.trim()).filter(Boolean)}function ai(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&n++,a===")"&&(n=Math.max(0,n-1)),a===","&&n===0?(t.push(r.trim()),r=""):r+=a}r.trim()&&t.push(r.trim());let o=[];for(let i of t){if(/\binset\b/i.test(i))continue;let a=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",l="0px",d="0px"]=a;d=`${parseFloat(d)/2}px`;let c=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!c&&c!==",";o.push(`drop-shadow(${s} ${l} ${d}${u?` ${c}`:""})`)}return o.join(" ")}function On(e){let t=In(e),r=null,n=null,o=null,i=[];for(let s of t){let l=s.indexOf(":");if(l<0)continue;let d=s.slice(0,l).trim().toLowerCase(),c=s.slice(l+1).trim();d==="box-shadow"?o=c:d==="filter"?r=c:d==="-webkit-filter"?n=c:i.push([d,c])}if(o){let s=ai(o);s&&(r=r?`${r} ${s}`:s,n=n?`${n} ${s}`:s)}let a=[...i];return r&&a.push(["filter",r]),n&&a.push(["-webkit-filter",n]),a.map(([s,l])=>`${s}:${l}`).join(";")}function si(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${On(n)}}`)}function li(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,si(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${On(n)}${r}`),e}function ci(){return mt||(mt=(async()=>{try{let e='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',t=new Image;t.decoding="sync",t.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await t.decode();let r=document.createElement("canvas");r.width=8,r.height=20;let n=r.getContext("2d",{willReadFrequently:!0});n.drawImage(t,0,0);let o=n.getImageData(2,18,1,1).data[3]>128,i=n.getImageData(2,2,1,1).data[3]>128;return{native:o||i,flippedY:i&&!o}}catch{return{native:!1,flippedY:!1}}})(),mt)}function di(e){let t=[],r=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("?r++:i===")"?r=Math.max(0,r-1):i===","&&r===0&&(t.push(e.slice(n,o)),n=o+1)}return t.push(e.slice(n)),t.map(o=>{let i=0,a=0,s="",l=0;for(;l<o.length;){let d=o[l];if(d==="("?i++:d===")"&&(i=Math.max(0,i-1)),i===0&&(l===0||o[l-1]===" ")){let c=/^-?\d*\.?\d+px/.exec(o.slice(l));if(c){a++,s+=a===2?`${-parseFloat(c[0])}px`:c[0],l+=c[0].length;continue}}s+=d,l++}return s}).join(",")}function ui(e,t){let r=n=>In(n).map(o=>{let i=o.indexOf(":");if(i<0)return o;let a=o.slice(0,i).trim().toLowerCase();return a==="text-shadow"||t&&a==="box-shadow"?`${a}:${di(o.slice(i+1))}`:o}).join(";");return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(n,o)=>n.replace(o,o.replace(/([^{}]+)\{([^}]*)\}/g,(i,a,s)=>`${a}{${r(s)}}`))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(n,o,i)=>`style=${o}${r(i)}${o}`),e}async function mr(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:r}=await ci();try{let n=e;return t||(n=li(n)),r&&(n=ui(n,t)),{svg:n,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}async function pi(e,t){e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(e);try{let r=document.createElement("canvas");r.width=16,r.height=16;let n=()=>new Promise(a=>{requestAnimationFrame(a),setTimeout(a,50)}),o=r.getContext("2d",{willReadFrequently:!0});if(!o){await n(),await n();return}let i=performance.now()+(t?600:150);for(;;){o.clearRect(0,0,16,16);try{o.drawImage(e,0,0,16,16)}catch{return}let a=o.getImageData(0,0,16,16).data,s=!1;for(let l=3;l<a.length;l+=4)if(a[l]>0){s=!0;break}if(s||performance.now()>i)return;await n()}}finally{try{e.remove()}catch{}}}async function Tt(e,t){let{width:r,height:n,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s,crop:l=null}=t,d=e,c=!1,u=!1;if(l&&!Hr(e))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(Hr(e)){let $=(ii(e).match(/<svg\b[^>]*>/i)||[])[0]||"",N=parseFloat(($.match(/\bwidth="([\d.]+)/i)||[])[1]),L=parseFloat(($.match(/\bheight="([\d.]+)/i)||[])[1]),_=Number.isFinite(N)&&Number.isFinite(L)&&N>0&&L>0&&Math.min(1,ye/N,ye/L,Math.sqrt(kt/(N*L)))<1;if(l||_||we())try{let F=fr(e);if(l&&(F=oi(F,l)),we()){let I=await mr(F);F=I.svg,c=I.naturalOnly,u=/@font-face|data:image\//i.test(F)}(_||l)&&(F=ni(F)),d=hr(F)}catch(F){if(l)throw F;d=e}}let p=new Image;p.loading="eager",p.decoding="sync",p.crossOrigin="anonymous",p.src=d,await p.decode(),we()&&await pi(p,u);let f=p.naturalWidth,h=p.naturalHeight,m=l?f:Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:f,g=l?h:Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:h,y,x,v=Number.isFinite(r),b=Number.isFinite(n);if(v&&b)y=Math.max(1,r),x=Math.max(1,n);else if(v){let $=r/Math.max(1,m);y=r,x=g*$}else if(b){let $=n/Math.max(1,g);x=n,y=m*$}else y=f,x=h;y=y*o,x=x*o;let w=y*i,S=x*i,M=Math.max(w/ye,S/ye,Math.sqrt(w*S/kt));M>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}\xD7${Math.round(S)}px exceeds the browser canvas limit (${ye}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),y/=M,x/=M);let C=document.createElement("canvas");C.width=y*i,C.height=x*i,C.style.width=`${y}px`,C.style.height=`${x}px`;let E=C.getContext("2d");if(i!==1&&E.scale(i,i),s&&(E.save(),E.fillStyle=s,E.fillRect(0,0,y,x),E.restore()),c&&(Math.round(y*i)!==f||Math.round(x*i)!==h)){let $=document.createElement("canvas");$.width=f,$.height=h,$.getContext("2d").drawImage(p,0,0),E.drawImage($,0,0,y,x)}else E.drawImage(p,0,0,y,x);return C}var ye,kt,mt,qe=ae(()=>{"use strict";Ae(),ye=16384,kt=16384*16384,mt=null}),gt={};Ue(gt,{rasterize:()=>_n});async function _n(e,t){let r=await Tt(e,t),n=await new Promise(i=>{let a=()=>i(r.toDataURL(`image/${t.format}`,t.quality));try{r.toBlob(s=>{if(!s)return a();let l=new FileReader;l.onload=()=>i(String(l.result||"")),l.onerror=a,l.readAsDataURL(s)},`image/${t.format}`,t.quality)}catch{a()}}),o=new Image;return o.src=n,await o.decode(),o.style.width=`${r.width/t.dpr}px`,o.style.height=`${r.height/t.dpr}px`,o}var bt=ae(()=>{"use strict";qe()}),Yt={};Ue(Yt,{toImg:()=>Wr,toSvg:()=>Wr});async function Wr(e,t){let{scale:r=1,width:n,height:o,meta:i={}}=t,a=Number.isFinite(n),s=Number.isFinite(o),l=Number.isFinite(r)&&r!==1||a||s;if(we()&&l)try{let{svg:c}=await mr(fr(e)),u=(c.match(/<svg\b[^>]*>/i)||[])[0]||"",p=parseFloat((u.match(/\bwidth="([\d.]+)/i)||[])[1]),f=parseFloat((u.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(p)||!Number.isFinite(f))throw new Error("svg without dimensions");let h=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:p,m=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f,g,y;a&&s?(g=n,y=o):a?(g=n,y=Math.round(m*(n/Math.max(1,h)))):s?(y=o,g=Math.round(h*(o/Math.max(1,m)))):(g=Math.round(p*r),y=Math.round(f*r));let x=c.replace(/width="[^"]*"/,`width="${g}"`).replace(/height="[^"]*"/,`height="${y}"`),v=new Image;return v.decoding="sync",v.loading="eager",v.src=hr(x),await v.decode(),v.style.width=`${g}px`,v.style.height=`${y}px`,v}catch(c){return j(t,"safari vector toImg failed, falling back to PNG",c),_n(e,{...t,format:"png",quality:1,meta:i})}let d=new Image;if(d.decoding="sync",d.loading="eager",d.src=e,await d.decode(),a&&s)d.style.width=`${n}px`,d.style.height=`${o}px`;else if(a){let c=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:d.naturalWidth,u=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:d.naturalHeight,p=n/Math.max(1,c);d.style.width=`${n}px`,d.style.height=`${Math.round(u*p)}px`}else if(s){let c=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:d.naturalWidth,u=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:d.naturalHeight,p=o/Math.max(1,u);d.style.height=`${o}px`,d.style.width=`${Math.round(c*p)}px`}else{let c=Math.round(d.naturalWidth*r),u=Math.round(d.naturalHeight*r);if(d.style.width=`${c}px`,d.style.height=`${u}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${c}"`).replace(/height="[^"]*"/,`height="${u}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,d.src=e}catch(p){j(t,"SVG width/height patch in toImg failed",p)}}return d}var Br=ae(()=>{"use strict";de(),bt(),qe()}),Dn={};Ue(Dn,{toBlob:()=>Hn});async function Hn(e,t){let r=t.type;if(r==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let n=await Tt(e,t);return new Promise(o=>n.toBlob(i=>o(i),`image/${r}`,t.quality))}var Wn=ae(()=>{"use strict";qe()}),Bn={};Ue(Bn,{download:()=>fi});async function jr(e,t){let r=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:t})}catch(n){if(n.name!=="AbortError")return!1}return!0}async function fi(e,t){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(t?.type||"").toLowerCase(),o=r.has(n)?n:"",i=(t?.format||o||"").toLowerCase(),a=i==="jpg"?"jpeg":i||"png",s=t?.filename||`snapdom.${a}`,l={...t||{},format:a,type:a};l.dpr=1;let d=ti();if(a==="svg"){let p=await Hn(e,{...l,type:"svg"});if(d&&await jr(p,s))return;let f=URL.createObjectURL(p),h=document.createElement("a");h.href=f,h.download=s,document.body.appendChild(h),h.click(),URL.revokeObjectURL(f),h.remove();return}let c=await Tt(e,l);if(d){let p=`image/${a}`,f=await new Promise(h=>c.toBlob(h,p,t?.quality));if(f&&await jr(f,s))return}let u=document.createElement("a");u.href=c.toDataURL(`image/${a}`,t?.quality),u.download=s,document.body.appendChild(u),u.click(),u.remove()}var hi=ae(()=>{"use strict";Wn(),qe(),Ae()});de();de();ne();var Gt=new WeakMap,Be=new Map,mi=2e3,Mt=0;function yt(){Mt++,Be.size>mi&&Be.clear()}var gi="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]";function Ht(e){let t=e&&(e.nodeType===1?e:e.parentElement);return!!(t&&t.closest&&t.closest(gi))}function jn(e){for(let t of e)if(!Ht(t.target)){if(t.type==="childList"){let r=!0;for(let n of t.addedNodes)if(!Ht(n)){r=!1;break}if(r){for(let n of t.removedNodes)if(!Ht(n)){r=!1;break}}if(r)continue}return!0}return!1}var Ur=!1;function bi(e=document.documentElement){if(Ur)return;Ur=!0;let t=r=>{jn(r)&&yt()};try{new MutationObserver(t).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(t).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let r=document.fonts;r&&(r.addEventListener?.("loadingdone",yt),r.ready?.then(()=>yt()).catch(()=>{}))}catch{}}var yi=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function qr(e){let t=Gt.get(e);if(t&&t.epoch===Mt){let r=t.snapshot&&t.snapshot.__needsBgInline;if(r!==void 0)return r}return!0}function wi(e,t={}){let r={},n=t.excludeStyleProps;for(let u=0;u<e.length;u++){let p=e[u];if(dr(p)||n&&(n instanceof RegExp&&n.test(p)||typeof n=="function"&&n(p)))continue;let f=e.getPropertyValue(p);(p==="background-image"||p==="content")&&f.includes("url(")&&!f.includes("data:")&&(f="none"),r[p]=f}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let u of o)if(!r[u])try{let p=e.getPropertyValue(u);p&&(r[u]=p)}catch{}let i=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let u of i)if(!r[u])try{let p=e.getPropertyValue(u);p&&(r[u]=p)}catch{}if(t.embedFonts){let u=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let p of u)if(!r[p])try{let f=e.getPropertyValue(p);f&&(r[p]=f)}catch{}}try{(r["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(r["content-visibility"]="hidden")}catch{}let a=!1;{let u=e.getPropertyValue("background-image");if(u&&u!=="none"&&(a=!0),!a){let p=e.getPropertyValue("background-color");p&&p!=="rgba(0, 0, 0, 0)"&&p!=="transparent"&&(a=!0)}if(!a)for(let p of yi){let f=e.getPropertyValue(p);if(f&&f!=="none"){a=!0;break}}if(!a){let p=e.getPropertyValue("background");p&&/url\s*\(/i.test(p)&&(a=!0)}}Object.defineProperty(r,"__needsBgInline",{value:a,enumerable:!1});let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,l=parseFloat(e.getPropertyValue("border-right-width")||0)||0,d=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,c=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(s===0&&l===0&&d===0&&c===0){let u=(e.getPropertyValue("border-image-source")||"").trim(),p=u&&u!=="none",f=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let h of f)delete r[h];p||(r.border="none")}return r}function xi(e){for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3&&/\S/.test(t.nodeValue||""))return!0;if(t.nodeType===1){let r=B(t).position;if(r!=="absolute"&&r!=="fixed")return!0}}return!1}function vi(e,t,r){try{if(typeof e.computedStyleMap=="function"){let o=e.computedStyleMap().get("width");if(o!=null)return!zr(String(o).trim().toLowerCase())}}catch{}let n=e.style&&(e.style.width||e.style.inlineSize);return n&&!zr(String(n).trim().toLowerCase())?!0:Ci(e,t)?r||ki(e,t):!1}var Si=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function zr(e){return Si.has(e)||e.startsWith("fit-content")}function Ci(e,t){let r=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(r>0))return!1;let n=1/0,o=-1/0,i=null;for(let a=e.firstChild;a;a=a.nextSibling){let s;if(a.nodeType===3){if(!/\S/.test(a.nodeValue||"")||(i=i||document.createRange(),i.selectNode(a),s=i.getBoundingClientRect(),!s.width&&!s.height))continue}else if(a.nodeType===1){let l=B(a);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;s=a.getBoundingClientRect()}else continue;s.left<n&&(n=s.left),s.right>o&&(o=s.right)}return o===-1/0?!1:o-n<r-.5}function ki(e,t){let r=e.parentElement;if(!r)return!1;let n=B(r),o=r.getBoundingClientRect().width-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0)-(parseFloat(n.borderLeftWidth)||0)-(parseFloat(n.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return o>0?Math.abs(e.getBoundingClientRect().width-o)>.5:!1}var Vr=new WeakMap;function Mi(e){let t=Vr.get(e);return t||(t=Object.entries(e).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0).map(([r,n])=>`${r}:${n}`).join(";"),Vr.set(e,t),t)}function Ei(e,t=null,r={}){let n=Gt.get(e),o=!!(r&&r.embedFonts),i=r&&r.excludeStyleProps||null;if(n&&n.epoch===Mt&&n.embedFonts===o&&n.excludeStyleProps===i)return n.snapshot;let a=t||getComputedStyle(e),s=wi(a,r);return Li(e,a,s),Gt.set(e,{epoch:Mt,snapshot:s,embedFonts:o,excludeStyleProps:i}),s}function $i(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Be,defaultStyle:k.defaultStyle,baseStyle:k.baseStyle,image:k.image,resource:k.resource,background:k.background,font:k.font},options:t||{}}:{session:k.session,persist:{snapshotKeyCache:Be,defaultStyle:k.defaultStyle,baseStyle:k.baseStyle,image:k.image,resource:k.resource,background:k.background,font:k.font},options:e||t||{}}}function Ai(e,t,r){if(!(!e.style||e.style.length===0))for(let n=0;n<e.style.length;n++){let o=e.style[n],i=r.getPropertyValue(o);i&&t.style.setProperty(o,i)}}async function pe(e,t,r,n){if(e.tagName==="STYLE")return;let o=$i(r,n),i=o.options&&o.options.cache||"auto";i!=="disabled"&&bi(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(yt(),Be.clear(),o.session.__bumpedForDisabled=!0);let{session:a,persist:s}=o;if(!a.styleCache.has(e)){let g=null;try{g=getComputedStyle(e)}catch{}a.styleCache.set(e,g||getComputedStyle(document.documentElement))}let l=a.styleCache.get(e);e.getAttribute?.("style")&&Ai(e,t,l);let d=l.getPropertyValue("animation-name");t&&t.style&&d&&d!=="none"&&t.style.setProperty("animation","none","important");let c=Ei(e,l,o.options),u=Un(e);if(u){let g=l.getPropertyValue("min-width");(!g||g==="auto"||g==="0px")&&(c["min-width"]="0px")}let p=e.tagName?.toLowerCase()||"div",f=Mi(c),h=!0;if(vn(p,(c.display||"").toLowerCase())){h=xi(e),h&&Go(p,c,u)&&vi(e,l,u)&&(h=!1),f=`${f}|${p}${h?"|c":""}${u?"|f":""}`;let g=c["text-wrap-mode"]||c["white-space"]||"";h&&g!=="nowrap"&&g!=="pre"&&(a.reconcileRisk=(a.reconcileRisk||0)+1)}let m=s.snapshotKeyCache.get(f);m===void 0&&(m=zt(c,p,h,u),s.snapshotKeyCache.set(f,m)),a.styleMap.set(t,m)}function Ni(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function Un(e){let t=e.parentElement;if(!t)return!1;let r=B(t).display||"";return r.includes("flex")||r.includes("grid")}function Ri(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3&&/\S/.test(n.nodeValue))return!0;let t=e.firstElementChild,r=e.lastElementChild;if(t&&t.tagName==="BR"||r&&r.tagName==="BR")return!0;for(let n=e.firstElementChild;n;n=n.nextElementSibling){let o=B(n);if(o.display==="none")continue;let i=o.position;if(i!=="absolute"&&i!=="fixed")return!0}return!1}function Ti(e){let t=e.getBoundingClientRect().top,r=-1/0,n=null;for(let o=e.firstChild;o;o=o.nextSibling){if(o.nodeType===3){if(!/\S/.test(o.nodeValue||""))continue;n=n||document.createRange(),n.selectNode(o);let s=n.getBoundingClientRect();(s.width||s.height)&&(r=Math.max(r,s.bottom));continue}if(o.nodeType!==1)continue;let i=B(o);if(i.display==="none")continue;let a=i.position;a==="absolute"||a==="fixed"||i.float&&i.float!=="none"||(r=Math.max(r,o.getBoundingClientRect().bottom))}return r===-1/0?NaN:r-t}function Li(e,t,r){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let n=e.tagName&&e.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n)||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid"))return;let i=t.position;if(i==="absolute"||i==="fixed"||i==="sticky"||t.transform!=="none"||Ni(t)||Un(e))return;let a=t.overflowX||t.overflow||"visible",s=t.overflowY||t.overflow||"visible";if(a!=="visible"||s!=="visible")return;let l=t.clip;if(l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||!Ri(e))return;let d=parseFloat(t.height),c=Ti(e);Number.isFinite(d)&&Number.isFinite(c)&&Math.abs(d-c)>2||(delete r.height,delete r["block-size"])}Rt();var qn=["fill","stroke","color","background-color","stop-color"],Fi=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function Qt(e){let t=e;for(;t&&t.nodeType===1;){if(t.namespaceURI==="http://www.w3.org/2000/svg"){if(t.localName==="mask"||t.localName==="clipPath")return!1;if(Fi.has(t.localName))return!0}t=t.parentNode}return!1}var Xr=new Map;function Pi(e,t){let r=t+"::"+e.toLowerCase(),n=Xr.get(r);if(n)return n;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.setAttribute("data-snapdom-internal",""),a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let s=getComputedStyle(i),l={};for(let d of qn)l[d]=s.getPropertyValue(d)||"";return a.remove(),Xr.set(r,l),l}function Ii(e,t){if(e?.nodeType!==1||t?.nodeType!==1||Qt(e))return;let r=e.getAttribute?.("style"),n=!!(r&&r.includes("var("));if(!n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){n=!0;break}}}let o=null;if(n)try{o=getComputedStyle(e)}catch{}if(n){let i=e.style;if(i&&i.length){let a=new Set;for(let s=0;s<i.length;s++){let l=i[s];if(a.has(l))continue;a.add(l);let d=i.getPropertyValue(l);if(!d||!d.includes("var("))continue;let c=o&&o.getPropertyValue(l);if(c)try{t.style.setProperty(l,c.trim(),i.getPropertyPriority(l))}catch{}}}}if(n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let l=s.name,d=o&&o.getPropertyValue(l);if(d)try{t.style.setProperty(l,d.trim())}catch{}}}if(!n){if(!o)try{o=getComputedStyle(e)}catch{o=null}if(!o)return;let i=e.namespaceURI||"html",a=Pi(e.tagName,i);for(let s of qn){let l=o.getPropertyValue(s)||"",d=a[s]||"";if(l&&l!==d)try{t.style.setProperty(s,l.trim())}catch{}}}}de();de();ne();$e();$e();function Ee(e){return!!(!e||e.startsWith("data:")||e.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}var Yr="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";function Oi(e,t){return!e||e?.nodeType!==1?!1:e.matches?.("picture")||e.querySelector("picture")?!0:t?!!(e.matches?.(Yr)||e.querySelector(Yr)):!1}var _i=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Et(e,t){if(!e)return null;let r=0;try{r=t?t.getBoundingClientRect().width||t.width:0}catch{}r||(r=window.innerWidth||1e3);let n=[];for(let i of e.split(",")){let a=i.trim().split(/\s+/);if(!a[0])continue;let s=a[1]||"",l=1;/^\d*\.?\d+x$/i.test(s)?l=parseFloat(s):/^\d+w$/i.test(s)&&(l=parseInt(s,10)/r),n.push({url:a[0],d:l})}if(!n.length)return null;n.sort((i,a)=>i.d-a.d);let o=window.devicePixelRatio||1;return(n.find(i=>i.d>=o)||n[n.length-1]).url}function zn(e,t){let r=e.currentSrc||"";if(r&&!Ee(r))return r;let n=t.querySelectorAll("source[srcset]"),o=null;for(let i of n){let a=i.getAttribute("srcset");if(!a||Ee(a))continue;let s=i.getAttribute("type");if(s&&!_i.test(s.trim()))continue;let l=i.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return Et(a,e)}catch{}o||(o=Et(a,e))}return o}function Di(e){let t=[e.getAttribute("data-src"),e.getAttribute("data-lazy-src"),e.getAttribute("data-original"),e.getAttribute("data-hi-res-src")];for(let n of t)if(n&&!Ee(n))return n;let r=e.getAttribute("data-srcset")||e.getAttribute("data-lazy-srcset");if(r){let n=r.split(",")[0].trim().split(/\s+/)[0];if(n&&!Ee(n))return n}return null}function Hi(e={}){let t=e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:t.resolveLazySrc!==!1,silent:t.silent??!1,useProxy:typeof e.useProxy=="string"?e.useProxy:""}}async function Wi(e,t={}){if(!e||e?.nodeType!==1||t.resolvePicturePlaceholders===!1)return null;let{timeout:r,concurrency:n,resolveLazySrc:o,silent:i,useProxy:a}=Hi(t);if(!Oi(e,o))return null;let s=[],l=[];async function d(p){let f=await le(p,{as:"dataURL",timeout:r,useProxy:a,silent:!0});return f.ok?f.data:null}async function c(p){for(let f=0;f<p.length;f+=n){let h=p.slice(f,f+n);await Promise.allSettled(h.map(m=>m()))}}let u=Array.from(e.querySelectorAll("picture"));e.matches?.("picture")&&u.unshift(e);for(let p of u){let f=p.querySelector("img");if(!f)continue;let h=f.getAttribute("src")||"";if(!Ee(h))continue;let m=zn(f,p);m&&l.push(async()=>{let g=await d(m);if(!g){i||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${m.slice(0,60)}`);return}let y=f.getAttribute("src"),x=f.getAttribute("srcset"),v=f.getAttribute("sizes"),b=[];f.src=g,f.setAttribute("src",g),f.removeAttribute("srcset"),f.removeAttribute("sizes");let w=p.querySelectorAll("source");for(let S of w)b.push({el:S,parent:S.parentElement,next:S.nextSibling}),S.remove();s.push(()=>{y!==null?f.setAttribute("src",y):f.removeAttribute("src"),x!==null&&f.setAttribute("srcset",x),v!==null&&f.setAttribute("sizes",v);for(let{el:S,parent:M,next:C}of b)M&&M.insertBefore(S,C)})})}if(o){let p=Array.from(e.querySelectorAll("img"));e.localName==="img"&&p.unshift(e);for(let f of p){if(f.closest("picture")&&Ee(f.getAttribute("src")||""))continue;let h=f.getAttribute("src")||"",m=Di(f);m&&Ee(h)&&l.push(async()=>{let g=await d(m);if(!g)return;let y=f.getAttribute("src");f.src=g,f.setAttribute("src",g),f.removeAttribute("srcset"),f.removeAttribute("sizes"),s.push(()=>{y!==null?f.setAttribute("src",y):f.removeAttribute("src")})})}}return l.length===0?null:(await c(l),async function(){for(let p of s)try{p()}catch{}})}function Wt(e,t,r){return r?Promise.all(e.map(n=>new Promise(o=>t(n,o)))):Promise.all(e.map(n=>new Promise(o=>{function i(){ht(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(n,o):i()},{fast:r})}i()})))}function Bi(e,t){if(e=e.trim(),!e)return e;let r=t?`[data-sd-slotted~="${t}"]`:"[data-sd-slotted]";return e.endsWith(":not([data-sd-slotted])")||e.endsWith(`:not(${r})`)?e:`${e}:not(${r})`}function ji(e,t,r=!0,n){return e.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let i=r?Bi(o,n):o;return`:where(${t} ${i})`}).join(", ")}function Ui(e,t,r){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${t}:is(${o.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${t} ${o.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,i,a)=>{let s=ji(a,t,!0,r);return`${o}${i}${s}{`}),e):""}function qi(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function zi(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
|
|
1
|
+
"use strict";var BrowserTrack=(()=>{var nt=Object.defineProperty;var Mo=Object.getOwnPropertyDescriptor;var Eo=Object.getOwnPropertyNames;var $o=Object.prototype.hasOwnProperty;var Ao=(e,t,r)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var No=(e,t)=>{for(var r in t)nt(e,r,{get:t[r],enumerable:!0})},Ro=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Eo(t))!$o.call(e,o)&&o!==r&&nt(e,o,{get:()=>t[o],enumerable:!(n=Mo(t,o))||n.enumerable});return e};var To=e=>Ro(nt({},"__esModule",{value:!0}),e);var N=(e,t,r)=>Ao(e,typeof t!="symbol"?t+"":t,r);var El={};No(El,{BreadcrumbBuffer:()=>Ie,BrowserScriptScreenshotDriver:()=>ze,BrowserTrackClient:()=>Xe,DEFAULT_OPTIONS:()=>st,NoteInspector:()=>Ve,getClient:()=>fo,init:()=>xr,resolveComponentSource:()=>Re,shouldHideUIFromUrl:()=>Dt});var Ie=class{constructor(t=50){N(this,"capacity");N(this,"buffer",[]);this.capacity=t}add(t){let r={...t,timestamp:t.timestamp||Date.now()};this.buffer.push(r),this.buffer.length>this.capacity&&this.buffer.shift()}getRecent(){return[...this.buffer]}clear(){this.buffer=[]}};var ot="[REDACTED]",Lo=[/^authorization$/i,/^cookie$/i,/^set-cookie$/i,/password/i,/token/i,/secret/i,/api[-_]?key/i,/access[-_]?token/i,/refresh[-_]?token/i,/credentials/i,/private[-_]?key/i,/ssn/i,/credit[-_]?card/i,/cvv/i],Rr=["token","auth","key","apikey","api_key","secret","password","access_token","refresh_token","code","signature"];function Po(e){if(!e)return!1;let t=e.replace(/[-_]/g,"");return Lo.some(r=>r.test(e)||r.test(t))}function me(e){if(!e)return e;try{let t=!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("ws://")&&!e.startsWith("wss://"),r="http://localhost",n=new URL(e,r),o=!1;for(let a of Rr)n.searchParams.has(a)&&(n.searchParams.set(a,ot),o=!0);for(let a of Array.from(n.searchParams.keys()))Po(a)&&(n.searchParams.set(a,ot),o=!0);if(!o)return e;let i=t?n.pathname+n.search+n.hash:n.toString();return i=i.replace(/%5BREDACTED%5D/g,ot),i}catch{let t=e;for(let r of Rr){let n=new RegExp(`([?&]${r}=)[^&#]+`,"gi");t=t.replace(n,`$1${ot}`)}return t}}function ge(e,t={}){if(!e||!e.tagName)return"unknown";let r=t.maxClasses??2,n=t.maxParentDepth??3,o=e.getAttribute("data-testid")||e.getAttribute("data-test")||e.getAttribute("data-cy")||e.getAttribute("data-qa")||e.getAttribute("data-component");if(o)return`[data-testid="${o}"]`;let i=e.id;if(i&&!/^[0-9]+$/.test(i)&&!/[0-9a-f]{8}-[0-9a-f]{4}/i.test(i))return`#${i}`;let a=e.tagName.toLowerCase(),s=e.getAttribute("aria-label");if(s&&s.length<40)return`${a}[aria-label="${s}"]`;let l=e.getAttribute("role");if(l&&!["presentation","none"].includes(l)){let h=`${a}[role="${l}"]`;if(a==="button"||a==="a"||a==="nav"||a==="dialog")return h}let d=e.getAttribute("name");if(d)return`${a}[name="${d}"]`;let c=e.getAttribute("title");if(c&&c.length<30)return`${a}[title="${c}"]`;let p=Array.from(e.classList||[]).filter(h=>!h.startsWith("css-")&&!h.startsWith("_")&&!/^[a-z0-9]{5,}$/i.test(h)&&!h.includes(":")&&!h.includes("[")).slice(0,r);if(p.length>0){let h=p.map(m=>`.${m}`).join("");return`${a}${h}`}if(e.parentElement&&(typeof document>"u"||e.parentElement!==document.body&&e.parentElement!==document.documentElement)){let h="";if(e.parentElement.children&&e.parentElement.children.length>1){let m=Array.from(e.parentElement.children).filter(g=>g.tagName&&g.tagName.toLowerCase()===a);if(m.length>1){let g=m.indexOf(e)+1;g>0&&(h=`:nth-of-type(${g})`)}}if(n>0){let m=ge(e.parentElement,{maxClasses:1,maxParentDepth:n-1});if(m&&m!=="unknown"&&m!=="body"&&m!=="html")return`${m} > ${a}${h}`}if(h)return`${a}${h}`}return a}function Ot(e){if(!e||typeof e!="object")return e;let t=e,r=t.tagName.toLowerCase()==="svg"||t.namespaceURI?.includes("svg");if(r||t.closest?.("svg")){let i=t.closest?.('button, a, [role="button"], [role="link"], [role="tab"], summary, label, [data-testid], [data-component]');if(i)return i;let a=r?t:t.closest?.("svg");if(a)return a}let n=["span","i","em","b","strong","small","mark","code"],o=t.tagName.toLowerCase();if(n.includes(o)&&!t.id&&!t.getAttribute("data-testid")&&!t.getAttribute("data-component")&&!t.getAttribute("aria-label")){let i=t.closest?.('button, a, [role="button"], [role="link"], [role="tab"], [role="menuitem"], summary, label, [data-testid], [data-component]');if(i)return i}return t}function ke(e,t=200){return e?e.length<=t?e:e.slice(0,t)+"...":""}function Ht(e,t="{}"){if(e===void 0)return t;try{let r=new WeakSet;return JSON.stringify(e,(n,o)=>{if(typeof o=="object"&&o!==null){if(r.has(o))return"[Circular]";r.add(o)}return typeof o=="bigint"?o.toString():o})}catch{try{return JSON.stringify(String(e))}catch{return t}}}function Re(e){if(!e||typeof e!="object")return;let t=Fo(e);if(t)return t;let r=Io(e);if(r)return r;let n=Oo(e);if(n)return n;if(e.tagName&&e.tagName.includes("-"))return{framework:"web-component",componentName:e.tagName.toLowerCase(),hierarchy:[e.tagName.toLowerCase()]};let o=Ho(e);if(o)return o}function Fo(e){try{let t=Object.keys(e).find(u=>u.startsWith("__reactFiber$")||u.startsWith("__reactInternalInstance$"));if(!t)return;let r=e[t];if(!r)return;let n,o,i,a,s=[],l;if(r._debugSource&&(n=r._debugSource.fileName,o=r._debugSource.lineNumber,i=r._debugSource.columnNumber),r._debugOwner){let u=r._debugOwner.type;a=Tr(u),!n&&r._debugOwner._debugSource&&(n=r._debugOwner._debugSource.fileName,o=r._debugOwner._debugSource.lineNumber,i=r._debugOwner._debugSource.columnNumber)}let d=r,c=0;for(;d&&c<50;){c++;let u=d.type,p=Tr(u);p&&!p.startsWith("html:")&&p!=="Fragment"&&(a||(a=p),s.includes(p)||s.unshift(p),!n&&d._debugSource&&(n=d._debugSource.fileName,o=d._debugSource.lineNumber,i=d._debugSource.columnNumber),!l&&d.memoizedProps&&typeof d.memoizedProps=="object"&&(l=_t(d.memoizedProps))),d=d.return}return!a&&!n?void 0:{framework:"react",componentName:a,sourceFile:Oe(n),sourceLine:o,sourceColumn:i,hierarchy:s.length>0?s:a?[a]:void 0,props:l}}catch{return}}function Tr(e){if(e&&typeof e!="string"){if(e.displayName)return e.displayName;if(e.name)return e.name;if(e.render?.displayName)return e.render.displayName;if(e.render?.name)return e.render.name}}function Io(e){try{let t=e.__vueParentComponent||e.__vnode?.ctx;if(t){let n=t.type||{},o=n.name||n.__name||n.displayName||"AnonymousComponent",i=n.__file,a=[],s=t,l=0;for(;s&&l<50;){l++;let d=s.type||{},c=d.name||d.__name||d.displayName;c&&!a.includes(c)&&a.unshift(c),s=s.parent}return{framework:"vue",componentName:o,sourceFile:Oe(i),hierarchy:a.length>0?a:[o],props:t.props?_t(t.props):void 0}}let r=e.__vue__;if(r){let n=r.$options||{},o=n.name||n._componentTag||"VueComponent",i=n.__file;return{framework:"vue",componentName:o,sourceFile:Oe(i),hierarchy:[o],props:r.$props?_t(r.$props):void 0}}return}catch{return}}function Oo(e){try{let t=e,r=0;for(;t&&r<50;){r++;let n=t.__svelte_meta;if(n&&n.loc)return{framework:"svelte",sourceFile:Oe(n.loc.file),sourceLine:n.loc.line,sourceColumn:n.loc.column,componentName:n.loc.file?Lr(n.loc.file):void 0,hierarchy:n.loc.file?[Lr(n.loc.file)]:void 0};t=t.parentElement}return}catch{return}}function Ho(e){try{let t=e.closest("[data-component], [data-component-name], [data-source-file]");if(!t)return;let r=t.getAttribute("data-component")||t.getAttribute("data-component-name")||void 0,n=t.getAttribute("data-source-file")||void 0,o=t.getAttribute("data-source-line"),i=o?parseInt(o,10):void 0;return!r&&!n?void 0:{framework:"vanilla",componentName:r,sourceFile:Oe(n),sourceLine:isNaN(i)?void 0:i,hierarchy:r?[r]:void 0}}catch{return}}function Oe(e){return e?e.split("?")[0]:void 0}function Lr(e){let t=e.split("/"),r=t[t.length-1]||e;return r.split(".")[0]||r}function _t(e){let t={};for(let[r,n]of Object.entries(e))r.startsWith("__")||typeof n=="function"||(n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"?t[r]=n:Array.isArray(n)?t[r]=`Array(${n.length})`:typeof n=="object"&&(t[r]="[Object]"));return t}function He(e){let t=ge(e),r=e.tagName.toLowerCase(),n=e.id||void 0,o=Array.from(e.classList||[]),i=Re(e),a,s=!0;try{let c=e.getBoundingClientRect();a={x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),top:Math.round(c.top),left:Math.round(c.left),bottom:Math.round(c.bottom),right:Math.round(c.right)};let u=window.getComputedStyle(e);s=u.display!=="none"&&u.visibility!=="hidden"&&u.opacity!=="0"&&c.width>0&&c.height>0}catch{}let l;r!=="input"&&r!=="textarea"&&r!=="select"&&(l=ke(e.textContent?.trim(),80));let d=ke(e.outerHTML?.trim(),200);return{selector:t,tag:r,id:n,classes:o,boundingRect:a,visible:s,innerText:l,outerHTML:d,componentSource:i}}function Pr(e){if(typeof document>"u")return()=>{};let t=n=>{try{let o=n.target;if(!o||!(o instanceof Element))return;let i=He(o),a=`click ${i.selector}${i.innerText?` ("${i.innerText}")`:""}`;e({type:"click",category:"ui",message:a,timestamp:Date.now(),element:i},i)}catch{}},r=n=>{try{let o=n.target;if(!o||!(o instanceof Element))return;let i=He(o),a=o.getAttribute("action")||"",s=`submit form ${i.selector}${a?` (action: ${a})`:""}`;e({type:"submit",category:"ui",message:s,timestamp:Date.now(),element:i},i)}catch{}};return document.addEventListener("click",t,{capture:!0,passive:!0}),document.addEventListener("submit",r,{capture:!0,passive:!0}),()=>{document.removeEventListener("click",t,{capture:!0}),document.removeEventListener("submit",r,{capture:!0})}}var it=class{constructor(t){N(this,"screenshotDriver");this.screenshotDriver=t}async executeCommand(t){try{switch(t.type){case"reload":return this.handleReload(t);case"navigate":return this.handleNavigate(t);case"get_page_state":return this.handleGetPageState(t);case"query_element":return this.handleQueryElement(t);case"capture_element":return await this.handleCaptureElement(t);case"check_overflow":return this.handleCheckOverflow(t);case"get_element_rect":return this.handleGetElementRect(t);case"get_element_style":return this.handleGetElementStyle(t);default:return{id:t.id,ok:!1,error:`Unsupported command type: ${t.type}`}}}catch(r){return{id:t.id,ok:!1,error:r?.message||"Command execution failed"}}}handleReload(t){return typeof window<"u"&&window.location?(setTimeout(()=>{window.location.reload()},50),{id:t.id,ok:!0,result:{message:"Reload initiated"}}):{id:t.id,ok:!1,error:"No browser window available"}}handleNavigate(t){let r=t.params?.url;return r?typeof window<"u"&&window.location?(setTimeout(()=>{window.location.href=r},50),{id:t.id,ok:!0,result:{message:`Navigating to ${r}`}}):{id:t.id,ok:!1,error:"No browser window available"}:{id:t.id,ok:!1,error:"Missing target url parameter"}}handleGetPageState(t){if(typeof window>"u"||typeof document>"u")return{id:t.id,ok:!1,error:"No browser document available"};let r=document.activeElement&&document.activeElement!==document.body?He(document.activeElement):void 0;return{id:t.id,ok:!0,result:{url:window.location.href,route:window.location.pathname+window.location.search+window.location.hash,title:document.title,readyState:document.readyState,activeElement:r}}}handleQueryElement(t){if(typeof document>"u")return{id:t.id,ok:!1,error:"No browser document available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!0,result:{exists:!1}};let o=He(n);return{id:t.id,ok:!0,result:{exists:!0,visible:o.visible,tag:o.tag,id:o.id,classes:o.classes,boundingRect:o.boundingRect,innerText:o.innerText,outerHTML:o.outerHTML}}}async handleCaptureElement(t){let r=t.params?.selector,n=null;if(r){if(n=document.querySelector(r),!n)return{id:t.id,ok:!1,reason:`ELEMENT_NOT_FOUND: ${r}`,error:`Element not found for selector: ${r}`}}else n=document.body||document.documentElement;let o=await this.screenshotDriver.captureElement(n);return o.ok?{id:t.id,ok:!0,result:{dataUrl:o.dataUrl,format:o.format,width:o.width,height:o.height}}:{id:t.id,ok:!1,reason:o.reason||"CAPTURE_FAILED",error:o.reason||"Failed to capture element screenshot"}}handleCheckOverflow(t){if(typeof window>"u"||typeof document>"u")return{id:t.id,ok:!1,error:"No browser window available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!1,error:`Element not found: ${r}`};let o=n.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,s=Math.max(0,Math.round(o.right-i)),l=Math.max(0,Math.round(o.bottom-a)),d=s>0||o.left<0,c=!1;return n.parentElement&&(c=n.parentElement.scrollWidth>n.parentElement.clientWidth),{id:t.id,ok:!0,result:{selector:r,overflow:d||c,viewportWidth:i,viewportHeight:a,rect:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(o.width),height:Math.round(o.height),top:Math.round(o.top),left:Math.round(o.left),bottom:Math.round(o.bottom),right:Math.round(o.right)},overflowRightPx:s,overflowBottomPx:l,parentOverflow:c}}}handleGetElementRect(t){if(typeof document>"u")return{id:t.id,ok:!1,error:"No browser document available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!1,error:`Element not found: ${r}`};let o=n.getBoundingClientRect();return{id:t.id,ok:!0,result:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(o.width),height:Math.round(o.height),top:Math.round(o.top),left:Math.round(o.left),bottom:Math.round(o.bottom),right:Math.round(o.right)}}}handleGetElementStyle(t){if(typeof window>"u"||typeof document>"u")return{id:t.id,ok:!1,error:"No browser window available"};let r=t.params?.selector;if(!r)return{id:t.id,ok:!1,error:"Missing selector parameter"};let n=document.querySelector(r);if(!n)return{id:t.id,ok:!1,error:`Element not found: ${r}`};let o=window.getComputedStyle(n),i=t.params?.properties||["overflow","overflowX","overflowY","width","maxWidth","display","position"],a={};for(let s of i)a[s]=o.getPropertyValue(s)||o[s]||"";return{id:t.id,ok:!0,result:{selector:r,styles:a}}}};var st={daemonUrl:"ws://127.0.0.1:7331",projectId:"",maxBreadcrumbs:50,captureErrors:!0,captureConsole:!0,captureNetwork:!0,captureNavigation:!0,captureInteractions:!0,onErrorScreenshot:!0,notes:{enabled:!0,shortcut:"Alt+Click",showBadges:!0,showToolbar:!0,maskSelectors:['input[type="password"]',"[data-sensitive]"]},hidden:!1,hideQueryParam:void 0,debug:!1},at=new Set(["0","false","hidden","hide","off","none","disabled","ui_off","silent"]);function Dt(e,t){let r=t;if(r===void 0){if(typeof window>"u"||!window.location)return!1;r=window.location.search}if(!r)return!1;try{let n=new URLSearchParams(r);if(e){let o=Array.isArray(e)?e:[e];for(let i of o)if(n.has(i)){let a=(n.get(i)||"").toLowerCase().trim();if(a===""||a==="1"||a==="true"||at.has(a))return!0}}for(let o of["no_bt","no_browsertrack","hide_bt","hide_browsertrack"])if(n.has(o)){let i=(n.get(o)||"").toLowerCase().trim();if(i===""||i==="1"||i==="true"||i==="yes")return!0}if(n.has("bt")){let o=(n.get("bt")||"").toLowerCase().trim();if(at.has(o))return!0}if(n.has("browsertrack")){let o=(n.get("browsertrack")||"").toLowerCase().trim();if(at.has(o))return!0}if(n.has("bt_ui")){let o=(n.get("bt_ui")||"").toLowerCase().trim();if(at.has(o)||o==="0"||o==="false")return!0}if(n.has("bt_hide")){let o=(n.get("bt_hide")||"").toLowerCase().trim();if(o===""||o==="1"||o==="true")return!0}}catch{}return!1}function Fr(e){if(typeof console>"u")return()=>{};let t=console.error,r=console.warn;function n(o){return o.map(i=>{if(i instanceof Error)return i.stack||`${i.name}: ${i.message}`;if(typeof i=="object"&&i!==null)try{return JSON.stringify(i)}catch{return String(i)}return String(i)}).join(" ")}return console.error=function(...o){try{let i=n(o),a=new Error().stack;e({level:"error",message:i,stack:a,timestamp:Date.now()})}catch{}return t.apply(console,o)},console.warn=function(...o){try{let i=n(o),a=new Error().stack;e({level:"warn",message:i,stack:a,timestamp:Date.now()})}catch{}return r.apply(console,o)},()=>{console.error=t,console.warn=r}}function Ir(e){if(typeof window>"u"||typeof history>"u")return()=>{};let t="";try{t=me(window.location.href),e({to:t,type:"initial",timestamp:Date.now()})}catch{}let r=history.pushState,n=history.replaceState;history.pushState=function(a,s,l){let d=t,c=r.apply(history,[a,s,l]);try{let u=me(window.location.href);t=u,e({from:d,to:u,type:"pushState",timestamp:Date.now()})}catch{}return c},history.replaceState=function(a,s,l){let d=t,c=n.apply(history,[a,s,l]);try{let u=me(window.location.href);t=u,e({from:d,to:u,type:"replaceState",timestamp:Date.now()})}catch{}return c};let o=()=>{try{let a=t,s=me(window.location.href);t=s,e({from:a,to:s,type:"popstate",timestamp:Date.now()})}catch{}},i=()=>{try{let a=t,s=me(window.location.href);t=s,e({from:a,to:s,type:"hashchange",timestamp:Date.now()})}catch{}};return window.addEventListener("popstate",o),window.addEventListener("hashchange",i),()=>{history.pushState=r,history.replaceState=n,window.removeEventListener("popstate",o),window.removeEventListener("hashchange",i)}}function Or(e){let t=[];if(typeof window<"u"&&typeof window.fetch=="function"){let r=window.fetch;window.fetch=async function(n,o){let i=Date.now(),a="",s="GET";try{typeof n=="string"?a=n:n instanceof URL?a=n.toString():n&&typeof n=="object"&&"url"in n&&(a=n.url,s=n.method||"GET"),o&&o.method&&(s=o.method.toUpperCase())}catch{a="unknown_url"}let l=me(a),d;try{d=await r.apply(window,[n,o])}catch(u){let p=Date.now()-i,f=u?.name==="AbortError";try{e({url:l,method:s,durationMs:p,error:u?.message||"Network request failed",aborted:f,timestamp:i})}catch{}throw u}let c=Date.now()-i;try{e({url:l,method:s,status:d.status,statusText:d.statusText,durationMs:c,timestamp:i})}catch{}return d},t.push(()=>{window.fetch=r})}if(typeof window<"u"&&typeof window.XMLHttpRequest=="function"){let r=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send,o=XMLHttpRequest.prototype.abort,i=new WeakMap;XMLHttpRequest.prototype.open=function(...a){try{let s=String(a[0]||"GET").toUpperCase(),l=String(a[1]||"");i.set(this,{url:me(l),method:s,startTime:Date.now()})}catch{}return r.apply(this,a)},XMLHttpRequest.prototype.abort=function(){let a=i.get(this);return a&&(a.aborted=!0),o.apply(this)},XMLHttpRequest.prototype.send=function(a){let s=i.get(this)||{url:"unknown_url",method:"GET",startTime:Date.now()},l=()=>{try{let c=Date.now()-s.startTime;e({url:s.url,method:s.method,status:this.status,statusText:this.statusText,durationMs:c,aborted:s.aborted,timestamp:s.startTime})}catch{}},d=()=>{try{let c=Date.now()-s.startTime;e({url:s.url,method:s.method,status:this.status||0,durationMs:c,error:"XHR Network Error",aborted:s.aborted,timestamp:s.startTime})}catch{}};return this.addEventListener("load",l,{once:!0}),this.addEventListener("error",d,{once:!0}),this.addEventListener("timeout",d,{once:!0}),n.apply(this,[a])},t.push(()=>{XMLHttpRequest.prototype.open=r,XMLHttpRequest.prototype.send=n,XMLHttpRequest.prototype.abort=o})}return()=>{for(let r of t)try{r()}catch{}}}function Hr(e){if(typeof window>"u")return()=>{};let t=n=>{try{let o={message:n.message||n.error&&n.error.message||"Script error",stack:n.error&&n.error.stack||void 0,filename:n.filename||void 0,lineno:n.lineno||void 0,colno:n.colno||void 0,errorType:n.error&&n.error.name||"Error",timestamp:Date.now()};e(o,n.error)}catch{}},r=n=>{try{let o=n.reason,i="Unhandled Promise Rejection",a,s="UnhandledRejection";if(o instanceof Error)i=o.message,a=o.stack,s=o.name||"UnhandledRejection";else if(typeof o=="string")i=o;else if(o&&typeof o=="object")try{i=JSON.stringify(o)}catch{i=String(o)}let l={message:i,stack:a,errorType:s,timestamp:Date.now()};e(l,o)}catch{}};return window.addEventListener("error",t),window.addEventListener("unhandledrejection",r),()=>{window.removeEventListener("error",t),window.removeEventListener("unhandledrejection",r)}}var _o=Object.defineProperty,ae=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}},Ue=(e,t)=>{for(var r in t)_o(e,r,{get:t[r],enumerable:!0})};function Do(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function Wo(e="soft"){switch(e){case"auto":{k.session.styleMap=new Map,k.session.nodeMap=new Map;return}case"soft":{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap,k.computedStyle=new WeakMap,k.measureHints=new WeakMap,k.baseStyle=new re(50),k.defaultStyle=new re(30),k.image=new re(100),k.background=new re(100),k.resource=new re(150),k.compress=new re(50),k.font=new Set;return}default:{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap;return}}}var re,k,ne=ae(()=>{"use strict";re=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,t)}},k={image:new re(100),background:new re(100),resource:new re(150),defaultStyle:new re(30),baseStyle:new re(50),compress:new re(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function dr(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function yn(e,t=1){let r=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!r)return null;let n=[];for(let o of r[1].split(",")){let i=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!i)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!wn.test(a[1].trim()))continue;let s=o.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),l=1;if(s){let d=parseFloat(s[1]);l=/dpi/i.test(s[2])?d/96:d}n.push({url:i[2].trim(),dppx:l})}return n.length?(n.sort((o,i)=>o.dppx-i.dppx),(n.find(o=>o.dppx>=t)||n[n.length-1]).url):null}function Bo(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==6?`matrix(${n})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${n})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Ct(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function jo(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let r=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,r).href}catch{return e}}var wn,Nt=ae(()=>{"use strict";wn=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function Uo(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:r=12}={}){let n=new Map,o=0;function i(a,s,l){if(o>=r)return;let d=Date.now();(n.get(s)||0)>d||(n.set(s,d+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${l}`):console&&console.error&&console.error(`${e} ${l}`))}return{warnOnce(a,s){i("warn",a,s)},errorOnce(a,s){i("error",a,s)},reset(){n.clear(),o=0}}}function qo(e){return/^data:|^blob:|^about:blank$/i.test(e)}function zo(e,t){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(n||".",r),i=new URL(e,r);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Vo(e,t){if(!t||qo(e)||zo(e,t))return!1;try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,r);return typeof location<"u"?n.origin!==location.origin:!0}catch{return!!t}}function Xo(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Ct(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Ct(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function _r(e){return new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(e)})}function Yo(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function le(e,t={}){let r=t.as??"blob",n=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(r==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,g="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(g)?atob(y):decodeURIComponent(y),v=new Uint8Array([...x].map(w=>w.charCodeAt(0))),b=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:b,status:200,url:e,fromCache:!1,mime:b.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let g=await fetch(e);if(!g.ok)return{ok:!1,data:null,status:g.status,url:e,fromCache:!1,reason:"http_error"};let y=await g.blob(),x=y.type||g.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await _r(y),status:g.status,url:e,fromCache:!1,mime:x}:r==="text"?{ok:!0,data:await y.text(),status:g.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:y,status:g.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let l=Yo(e,{as:r,timeout:n,useProxy:o,errorTTL:i}),d=De.get(l);if(d&&d.until>Date.now())return{...d.result,fromCache:!0};d&&De.delete(l);let c=ft.get(l);if(c)return c;let u=Vo(e,o)?Xo(e,o):e,p=t.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let f=new AbortController,h=setTimeout(()=>f.abort("timeout"),n),m=(async()=>{try{let g=await fetch(u,{signal:f.signal,credentials:p,headers:a});if(!g.ok){let v={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(i>0&&De.set(l,{until:Date.now()+i,result:v}),!s){let b=`${g.status} ${g.statusText||""}`.trim();zt.warnOnce(`http:${g.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${b} while fetching ${r} ${e}`)}return t.onError&&t.onError(v),v}if(r==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),x=y.type||g.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await _r(y),status:g.status,url:u,fromCache:!1,mime:x}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:x}}catch(g){let y=g&&typeof g=="object"&&"name"in g&&g.name==="AbortError"?String(g.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&De.set(l,{until:Date.now()+i,result:x}),!s){let v=`${y}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,b=y==="timeout"?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${r} ${e}`:`Network/CORS issue while fetching ${r} ${e}. A proxy may be required`;zt.errorOnce(v,b)}return t.onError&&t.onError(x),x}finally{clearTimeout(h),ft.delete(l)}})();return ft.set(l,m),m}var zt,ft,De,$e=ae(()=>{"use strict";Nt(),zt=Uo("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),ft=new Map,De=new Map});async function xn(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=yn(e,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??dr(e);if(!r)return e;let n=jo(r),o=Ct(n),i=(t.useProxy||"")+"|"+o;if(k.background.has(i)){let a=k.background.get(i);return a?`url("${a}")`:"none"}try{let a=await le(o,{as:"dataURL",useProxy:t.useProxy});return a.ok?(k.background.set(i,a.data),`url("${a.data}")`):(k.background.set(i,null),"none")}catch{return k.background.set(i,null),"none"}}var Go=ae(()=>{"use strict";ne(),Nt(),$e()});function vn(e){if(e=String(e).toLowerCase(),pr.has(e)){let i={};return k.defaultStyle.set(e,i),i}if(k.defaultStyle.has(e))return k.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let r=document.createElement(e);r.style.all="initial",t.appendChild(r);let n=getComputedStyle(r),o={};for(let i of n){if(ur(i))continue;let a=n.getPropertyValue(i);o[i]=a}return t.removeChild(r),k.defaultStyle.set(e,o),o}function ur(e){let t=Yt.get(e);if(t===void 0){let r=String(e).toLowerCase();t=En.has(r)||Mn.test(r)||kn.test(r),Yt.set(e,t)}return t}function Sn(e,t){return!An.has(e)&&(t==="inline"||$n.has(e)||fr.has(e))}function Qo(e,t,r){let n=(t.display||"").toLowerCase();if(n==="inline"||fr.has(e))return!1;if(r)return!0;if((t.float||"none").toLowerCase()!=="none")return!1;let o=(t.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!Ln.has(n)}function Vt(e,t,r=!0,n=!1){if(t=String(t||"").toLowerCase(),pr.has(t))return"";let o=[],i=vn(t),a=(e.display||"").toLowerCase(),s=a==="inline",l=Sn(t,a),d=e["text-wrap-mode"]||e["white-space"]||"",c=d==="nowrap"||d==="pre",u=l&&r&&!(l&&r&&!s&&c),p=!1;for(let f in e){if(ur(f))continue;let h=e[f];if(u){if(Nn.has(f))continue;if(Rn.has(f)){h&&h!==i[f]&&(o.push(`${f}:${h}`),h!=="auto"&&(p=!0));continue}}if(h&&h!==i[f]){if(!c&&(f==="width"||f==="inline-size")&&h.endsWith("px")&&h.includes(".")){let m=parseFloat(h);if(Number.isFinite(m)){o.push(`${f}:${(m+Tn).toFixed(3)}px`);continue}}o.push(`${f}:${h}`)}}if(u&&!s&&!n&&!p){let f=e.width;f&&f!=="auto"&&f!==i.width&&o.push(`min-width:${f}`)}return o.sort(),o.join(";")}function Ko(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(r=>t.add(r.tagName.toLowerCase())),Array.from(t))}function Jo(e){let t=new Map;for(let n of e){let o=vn(n);if(!o)continue;let i=Object.entries(o).map(([a,s])=>`${a}:${s};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(n))}let r="";for(let[n,o]of t.entries())r+=`${o.join(",")} { ${n} }
|
|
2
|
+
`;return r}function Zo(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),r=new Map,n=1;for(let o of t)r.set(o,`c${n++}`);return r}function ei(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let r=t.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let n=0;n<window.frames.length;n++)try{if(window.frames[n]?.document===t)return window.frames[n]}catch{}}catch{}return typeof window<"u"?window:null}function B(e,t=null){let r=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(e?.nodeType!==1){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(e,t)||r()}catch{return r()}return r()}let n=k.computedStyle.get(e);n||(n=new Map,k.computedStyle.set(e,n));let o=n.get(t);if(!o){let i=ei(e),a=null;try{a=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}o=a||r(),n.set(t,o)}return o}function Dr(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);for(let r of Pn){let n=t[`border-${r}-style`],o=t[`border-${r}-width`];(n==="none"||n==="hidden"||o==="0px")&&(delete t[`border-${r}-style`],delete t[`border-${r}-width`],delete t[`border-${r}-color`])}return t}function Xt(e){let t=[],r=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&r++,i===")"&&r--,i===","&&r===0&&(t.push(e.slice(n,o).trim()),n=o+1)}return t.push(e.slice(n).trim()),t}var Cn,pr,ti,kn,Mn,En,Yt,$n,fr,An,Nn,Rn,Tn,Ln,Pn,Rt=ae(()=>{"use strict";ne(),Cn=new Set(["meta","script","noscript","title","link","template"]),pr=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),ti=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],kn=/(?:^|-)(animation|transition)(?:-|$)/i,Mn=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,En=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),Yt=new Map,$n=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),fr=new Set(["table","thead","tbody","tfoot","tr","td","th"]),An=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Nn=new Set(["width","max-width","inline-size","max-inline-size"]),Rn=new Set(["min-width","min-inline-size"]),Tn=.001,Ln=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]),Pn=["top","right","bottom","left"]});function ht(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Me(e=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(t=>{let r=!1,n=()=>{r||(r=!0,t())};try{requestAnimationFrame(n)}catch{n();return}setTimeout(n,e)})}function ri(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),r=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||r}function we(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),r=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),n=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=n&&o&&i,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),d=/ipad|iphone|ipod/.test(t)&&n;return r||a||s||l||d}function ni(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Ae=ae(()=>{"use strict"});function j(e,t,r){let n=e&&typeof e=="object"&&(e.options||e);n&&n.debug&&(r!==void 0?console.warn("[snapdom]",t,r):console.warn("[snapdom]",t))}var Fn=ae(()=>{"use strict"}),de=ae(()=>{"use strict";Go(),Rt(),Ae(),Nt(),Fn()}),In={};Ue(In,{decodeSvgFromDataURL:()=>hr,encodeSvgToDataURL:()=>mr,fixSafariShadows:()=>gr,toCanvas:()=>Tt});function oi(e){try{let t=e.match(/<svg\b[^>]*>/i);if(!t)return e;let r=t[0],n=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(n)||!Number.isFinite(o)||n<=0||o<=0)return e;let i=Math.min(1,ye/n,ye/o,Math.sqrt(kt/(n*o)));if(i>=1)return e;let a=Math.max(1,Math.floor(n*i)),s=Math.max(1,Math.floor(o*i));return console.warn(`[snapDOM] Capture ${Math.round(n)}\xD7${Math.round(o)}px exceeds the browser image-decode limit (${ye}px/side); downscaling to ${a}\xD7${s}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${s}`))}catch{return e}}function ii(e,t){let r=["x","y","width","height"].map(S=>Number(t?.[S]));if(!r.every(Number.isFinite)||r[2]<=0||r[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let n=e.match(/<svg\b[^>]*>/i);if(!n)throw new Error("[snapdom] cannot crop a non-SVG capture");let o=n[0],i=(o.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(i||"").trim().split(/[\s,]+/).map(Number);if(a.length!==4||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[s,l,d,c]=a,u=Math.max(s,r[0]),p=Math.max(l,r[1]),f=Math.min(s+d,r[0]+r[2]),h=Math.min(l+c,r[1]+r[3]);if(!(f>u)||!(h>p))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let m=parseFloat((o.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((o.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(m)&&m>0?m/d:1,x=Number.isFinite(g)&&g>0?g/c:1,v=Math.max(1,(f-u)*y),b=Math.max(1,(h-p)*x),w=o.replace(/(\bwidth=")[^"]*/i,`$1${v}`).replace(/(\bheight=")[^"]*/i,`$1${b}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${p} ${f-u} ${h-p}`);return e.replace(o,w)}function Wr(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function hr(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function ai(e){let t=e.indexOf(",");if(t<0)return"";let r=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(r)}catch{return""}}function mr(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function On(e){let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&n++,i===")"&&(n=Math.max(0,n-1)),i===";"&&n===0?(t.push(r),r=""):r+=i}return r.trim()&&t.push(r),t.map(o=>o.trim()).filter(Boolean)}function si(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&n++,a===")"&&(n=Math.max(0,n-1)),a===","&&n===0?(t.push(r.trim()),r=""):r+=a}r.trim()&&t.push(r.trim());let o=[];for(let i of t){if(/\binset\b/i.test(i))continue;let a=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",l="0px",d="0px"]=a;d=`${parseFloat(d)/2}px`;let c=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!c&&c!==",";o.push(`drop-shadow(${s} ${l} ${d}${u?` ${c}`:""})`)}return o.join(" ")}function Hn(e){let t=On(e),r=null,n=null,o=null,i=[];for(let s of t){let l=s.indexOf(":");if(l<0)continue;let d=s.slice(0,l).trim().toLowerCase(),c=s.slice(l+1).trim();d==="box-shadow"?o=c:d==="filter"?r=c:d==="-webkit-filter"?n=c:i.push([d,c])}if(o){let s=si(o);s&&(r=r?`${r} ${s}`:s,n=n?`${n} ${s}`:s)}let a=[...i];return r&&a.push(["filter",r]),n&&a.push(["-webkit-filter",n]),a.map(([s,l])=>`${s}:${l}`).join(";")}function li(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${Hn(n)}}`)}function ci(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,li(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${Hn(n)}${r}`),e}function di(){return mt||(mt=(async()=>{try{let e='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',t=new Image;t.decoding="sync",t.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await t.decode();let r=document.createElement("canvas");r.width=8,r.height=20;let n=r.getContext("2d",{willReadFrequently:!0});n.drawImage(t,0,0);let o=n.getImageData(2,18,1,1).data[3]>128,i=n.getImageData(2,2,1,1).data[3]>128;return{native:o||i,flippedY:i&&!o}}catch{return{native:!1,flippedY:!1}}})(),mt)}function ui(e){let t=[],r=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("?r++:i===")"?r=Math.max(0,r-1):i===","&&r===0&&(t.push(e.slice(n,o)),n=o+1)}return t.push(e.slice(n)),t.map(o=>{let i=0,a=0,s="",l=0;for(;l<o.length;){let d=o[l];if(d==="("?i++:d===")"&&(i=Math.max(0,i-1)),i===0&&(l===0||o[l-1]===" ")){let c=/^-?\d*\.?\d+px/.exec(o.slice(l));if(c){a++,s+=a===2?`${-parseFloat(c[0])}px`:c[0],l+=c[0].length;continue}}s+=d,l++}return s}).join(",")}function pi(e,t){let r=n=>On(n).map(o=>{let i=o.indexOf(":");if(i<0)return o;let a=o.slice(0,i).trim().toLowerCase();return a==="text-shadow"||t&&a==="box-shadow"?`${a}:${ui(o.slice(i+1))}`:o}).join(";");return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(n,o)=>n.replace(o,o.replace(/([^{}]+)\{([^}]*)\}/g,(i,a,s)=>`${a}{${r(s)}}`))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(n,o,i)=>`style=${o}${r(i)}${o}`),e}async function gr(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:r}=await di();try{let n=e;return t||(n=ci(n)),r&&(n=pi(n,t)),{svg:n,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}async function fi(e,t){e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(e);try{let r=document.createElement("canvas");r.width=16,r.height=16;let n=()=>new Promise(a=>{requestAnimationFrame(a),setTimeout(a,50)}),o=r.getContext("2d",{willReadFrequently:!0});if(!o){await n(),await n();return}let i=performance.now()+(t?600:150);for(;;){o.clearRect(0,0,16,16);try{o.drawImage(e,0,0,16,16)}catch{return}let a=o.getImageData(0,0,16,16).data,s=!1;for(let l=3;l<a.length;l+=4)if(a[l]>0){s=!0;break}if(s||performance.now()>i)return;await n()}}finally{try{e.remove()}catch{}}}async function Tt(e,t){let{width:r,height:n,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s,crop:l=null}=t,d=e,c=!1,u=!1;if(l&&!Wr(e))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(Wr(e)){let $=(ai(e).match(/<svg\b[^>]*>/i)||[])[0]||"",R=parseFloat(($.match(/\bwidth="([\d.]+)/i)||[])[1]),L=parseFloat(($.match(/\bheight="([\d.]+)/i)||[])[1]),H=Number.isFinite(R)&&Number.isFinite(L)&&R>0&&L>0&&Math.min(1,ye/R,ye/L,Math.sqrt(kt/(R*L)))<1;if(l||H||we())try{let P=hr(e);if(l&&(P=ii(P,l)),we()){let I=await gr(P);P=I.svg,c=I.naturalOnly,u=/@font-face|data:image\//i.test(P)}(H||l)&&(P=oi(P)),d=mr(P)}catch(P){if(l)throw P;d=e}}let p=new Image;p.loading="eager",p.decoding="sync",p.crossOrigin="anonymous",p.src=d,await p.decode(),we()&&await fi(p,u);let f=p.naturalWidth,h=p.naturalHeight,m=l?f:Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:f,g=l?h:Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:h,y,x,v=Number.isFinite(r),b=Number.isFinite(n);if(v&&b)y=Math.max(1,r),x=Math.max(1,n);else if(v){let $=r/Math.max(1,m);y=r,x=g*$}else if(b){let $=n/Math.max(1,g);x=n,y=m*$}else y=f,x=h;y=y*o,x=x*o;let w=y*i,S=x*i,M=Math.max(w/ye,S/ye,Math.sqrt(w*S/kt));M>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}\xD7${Math.round(S)}px exceeds the browser canvas limit (${ye}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),y/=M,x/=M);let C=document.createElement("canvas");C.width=y*i,C.height=x*i,C.style.width=`${y}px`,C.style.height=`${x}px`;let E=C.getContext("2d");if(i!==1&&E.scale(i,i),s&&(E.save(),E.fillStyle=s,E.fillRect(0,0,y,x),E.restore()),c&&(Math.round(y*i)!==f||Math.round(x*i)!==h)){let $=document.createElement("canvas");$.width=f,$.height=h,$.getContext("2d").drawImage(p,0,0),E.drawImage($,0,0,y,x)}else E.drawImage(p,0,0,y,x);return C}var ye,kt,mt,qe=ae(()=>{"use strict";Ae(),ye=16384,kt=16384*16384,mt=null}),gt={};Ue(gt,{rasterize:()=>_n});async function _n(e,t){let r=await Tt(e,t),n=await new Promise(i=>{let a=()=>i(r.toDataURL(`image/${t.format}`,t.quality));try{r.toBlob(s=>{if(!s)return a();let l=new FileReader;l.onload=()=>i(String(l.result||"")),l.onerror=a,l.readAsDataURL(s)},`image/${t.format}`,t.quality)}catch{a()}}),o=new Image;return o.src=n,await o.decode(),o.style.width=`${r.width/t.dpr}px`,o.style.height=`${r.height/t.dpr}px`,o}var bt=ae(()=>{"use strict";qe()}),Gt={};Ue(Gt,{toImg:()=>Br,toSvg:()=>Br});async function Br(e,t){let{scale:r=1,width:n,height:o,meta:i={}}=t,a=Number.isFinite(n),s=Number.isFinite(o),l=Number.isFinite(r)&&r!==1||a||s;if(we()&&l)try{let{svg:c}=await gr(hr(e)),u=(c.match(/<svg\b[^>]*>/i)||[])[0]||"",p=parseFloat((u.match(/\bwidth="([\d.]+)/i)||[])[1]),f=parseFloat((u.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(p)||!Number.isFinite(f))throw new Error("svg without dimensions");let h=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:p,m=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f,g,y;a&&s?(g=n,y=o):a?(g=n,y=Math.round(m*(n/Math.max(1,h)))):s?(y=o,g=Math.round(h*(o/Math.max(1,m)))):(g=Math.round(p*r),y=Math.round(f*r));let x=c.replace(/width="[^"]*"/,`width="${g}"`).replace(/height="[^"]*"/,`height="${y}"`),v=new Image;return v.decoding="sync",v.loading="eager",v.src=mr(x),await v.decode(),v.style.width=`${g}px`,v.style.height=`${y}px`,v}catch(c){return j(t,"safari vector toImg failed, falling back to PNG",c),_n(e,{...t,format:"png",quality:1,meta:i})}let d=new Image;if(d.decoding="sync",d.loading="eager",d.src=e,await d.decode(),a&&s)d.style.width=`${n}px`,d.style.height=`${o}px`;else if(a){let c=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:d.naturalWidth,u=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:d.naturalHeight,p=n/Math.max(1,c);d.style.width=`${n}px`,d.style.height=`${Math.round(u*p)}px`}else if(s){let c=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:d.naturalWidth,u=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:d.naturalHeight,p=o/Math.max(1,u);d.style.height=`${o}px`,d.style.width=`${Math.round(c*p)}px`}else{let c=Math.round(d.naturalWidth*r),u=Math.round(d.naturalHeight*r);if(d.style.width=`${c}px`,d.style.height=`${u}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${c}"`).replace(/height="[^"]*"/,`height="${u}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,d.src=e}catch(p){j(t,"SVG width/height patch in toImg failed",p)}}return d}var jr=ae(()=>{"use strict";de(),bt(),qe()}),Dn={};Ue(Dn,{toBlob:()=>Wn});async function Wn(e,t){let r=t.type;if(r==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let n=await Tt(e,t);return new Promise(o=>n.toBlob(i=>o(i),`image/${r}`,t.quality))}var Bn=ae(()=>{"use strict";qe()}),jn={};Ue(jn,{download:()=>hi});async function Ur(e,t){let r=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:t})}catch(n){if(n.name!=="AbortError")return!1}return!0}async function hi(e,t){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(t?.type||"").toLowerCase(),o=r.has(n)?n:"",i=(t?.format||o||"").toLowerCase(),a=i==="jpg"?"jpeg":i||"png",s=t?.filename||`snapdom.${a}`,l={...t||{},format:a,type:a};l.dpr=1;let d=ri();if(a==="svg"){let p=await Wn(e,{...l,type:"svg"});if(d&&await Ur(p,s))return;let f=URL.createObjectURL(p),h=document.createElement("a");h.href=f,h.download=s,document.body.appendChild(h),h.click(),URL.revokeObjectURL(f),h.remove();return}let c=await Tt(e,l);if(d){let p=`image/${a}`,f=await new Promise(h=>c.toBlob(h,p,t?.quality));if(f&&await Ur(f,s))return}let u=document.createElement("a");u.href=c.toDataURL(`image/${a}`,t?.quality),u.download=s,document.body.appendChild(u),u.click(),u.remove()}var mi=ae(()=>{"use strict";Bn(),qe(),Ae()});de();de();ne();var Qt=new WeakMap,Be=new Map,gi=2e3,Mt=0;function yt(){Mt++,Be.size>gi&&Be.clear()}var bi="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]";function Wt(e){let t=e&&(e.nodeType===1?e:e.parentElement);return!!(t&&t.closest&&t.closest(bi))}function Un(e){for(let t of e)if(!Wt(t.target)){if(t.type==="childList"){let r=!0;for(let n of t.addedNodes)if(!Wt(n)){r=!1;break}if(r){for(let n of t.removedNodes)if(!Wt(n)){r=!1;break}}if(r)continue}return!0}return!1}var qr=!1;function yi(e=document.documentElement){if(qr)return;qr=!0;let t=r=>{Un(r)&&yt()};try{new MutationObserver(t).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(t).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let r=document.fonts;r&&(r.addEventListener?.("loadingdone",yt),r.ready?.then(()=>yt()).catch(()=>{}))}catch{}}var wi=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function zr(e){let t=Qt.get(e);if(t&&t.epoch===Mt){let r=t.snapshot&&t.snapshot.__needsBgInline;if(r!==void 0)return r}return!0}function xi(e,t={}){let r={},n=t.excludeStyleProps;for(let u=0;u<e.length;u++){let p=e[u];if(ur(p)||n&&(n instanceof RegExp&&n.test(p)||typeof n=="function"&&n(p)))continue;let f=e.getPropertyValue(p);(p==="background-image"||p==="content")&&f.includes("url(")&&!f.includes("data:")&&(f="none"),r[p]=f}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let u of o)if(!r[u])try{let p=e.getPropertyValue(u);p&&(r[u]=p)}catch{}let i=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let u of i)if(!r[u])try{let p=e.getPropertyValue(u);p&&(r[u]=p)}catch{}if(t.embedFonts){let u=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let p of u)if(!r[p])try{let f=e.getPropertyValue(p);f&&(r[p]=f)}catch{}}try{(r["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(r["content-visibility"]="hidden")}catch{}let a=!1;{let u=e.getPropertyValue("background-image");if(u&&u!=="none"&&(a=!0),!a){let p=e.getPropertyValue("background-color");p&&p!=="rgba(0, 0, 0, 0)"&&p!=="transparent"&&(a=!0)}if(!a)for(let p of wi){let f=e.getPropertyValue(p);if(f&&f!=="none"){a=!0;break}}if(!a){let p=e.getPropertyValue("background");p&&/url\s*\(/i.test(p)&&(a=!0)}}Object.defineProperty(r,"__needsBgInline",{value:a,enumerable:!1});let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,l=parseFloat(e.getPropertyValue("border-right-width")||0)||0,d=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,c=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(s===0&&l===0&&d===0&&c===0){let u=(e.getPropertyValue("border-image-source")||"").trim(),p=u&&u!=="none",f=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let h of f)delete r[h];p||(r.border="none")}return r}function vi(e){for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3&&/\S/.test(t.nodeValue||""))return!0;if(t.nodeType===1){let r=B(t).position;if(r!=="absolute"&&r!=="fixed")return!0}}return!1}function Si(e,t,r){try{if(typeof e.computedStyleMap=="function"){let o=e.computedStyleMap().get("width");if(o!=null)return!Vr(String(o).trim().toLowerCase())}}catch{}let n=e.style&&(e.style.width||e.style.inlineSize);return n&&!Vr(String(n).trim().toLowerCase())?!0:ki(e,t)?r||Mi(e,t):!1}var Ci=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Vr(e){return Ci.has(e)||e.startsWith("fit-content")}function ki(e,t){let r=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(r>0))return!1;let n=1/0,o=-1/0,i=null;for(let a=e.firstChild;a;a=a.nextSibling){let s;if(a.nodeType===3){if(!/\S/.test(a.nodeValue||"")||(i=i||document.createRange(),i.selectNode(a),s=i.getBoundingClientRect(),!s.width&&!s.height))continue}else if(a.nodeType===1){let l=B(a);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;s=a.getBoundingClientRect()}else continue;s.left<n&&(n=s.left),s.right>o&&(o=s.right)}return o===-1/0?!1:o-n<r-.5}function Mi(e,t){let r=e.parentElement;if(!r)return!1;let n=B(r),o=r.getBoundingClientRect().width-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0)-(parseFloat(n.borderLeftWidth)||0)-(parseFloat(n.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return o>0?Math.abs(e.getBoundingClientRect().width-o)>.5:!1}var Xr=new WeakMap;function Ei(e){let t=Xr.get(e);return t||(t=Object.entries(e).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0).map(([r,n])=>`${r}:${n}`).join(";"),Xr.set(e,t),t)}function $i(e,t=null,r={}){let n=Qt.get(e),o=!!(r&&r.embedFonts),i=r&&r.excludeStyleProps||null;if(n&&n.epoch===Mt&&n.embedFonts===o&&n.excludeStyleProps===i)return n.snapshot;let a=t||getComputedStyle(e),s=xi(a,r);return Pi(e,a,s),Qt.set(e,{epoch:Mt,snapshot:s,embedFonts:o,excludeStyleProps:i}),s}function Ai(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Be,defaultStyle:k.defaultStyle,baseStyle:k.baseStyle,image:k.image,resource:k.resource,background:k.background,font:k.font},options:t||{}}:{session:k.session,persist:{snapshotKeyCache:Be,defaultStyle:k.defaultStyle,baseStyle:k.baseStyle,image:k.image,resource:k.resource,background:k.background,font:k.font},options:e||t||{}}}function Ni(e,t,r){if(!(!e.style||e.style.length===0))for(let n=0;n<e.style.length;n++){let o=e.style[n],i=r.getPropertyValue(o);i&&t.style.setProperty(o,i)}}async function pe(e,t,r,n){if(e.tagName==="STYLE")return;let o=Ai(r,n),i=o.options&&o.options.cache||"auto";i!=="disabled"&&yi(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(yt(),Be.clear(),o.session.__bumpedForDisabled=!0);let{session:a,persist:s}=o;if(!a.styleCache.has(e)){let g=null;try{g=getComputedStyle(e)}catch{}a.styleCache.set(e,g||getComputedStyle(document.documentElement))}let l=a.styleCache.get(e);e.getAttribute?.("style")&&Ni(e,t,l);let d=l.getPropertyValue("animation-name");t&&t.style&&d&&d!=="none"&&t.style.setProperty("animation","none","important");let c=$i(e,l,o.options),u=qn(e);if(u){let g=l.getPropertyValue("min-width");(!g||g==="auto"||g==="0px")&&(c["min-width"]="0px")}let p=e.tagName?.toLowerCase()||"div",f=Ei(c),h=!0;if(Sn(p,(c.display||"").toLowerCase())){h=vi(e),h&&Qo(p,c,u)&&Si(e,l,u)&&(h=!1),f=`${f}|${p}${h?"|c":""}${u?"|f":""}`;let g=c["text-wrap-mode"]||c["white-space"]||"";h&&g!=="nowrap"&&g!=="pre"&&(a.reconcileRisk=(a.reconcileRisk||0)+1)}let m=s.snapshotKeyCache.get(f);m===void 0&&(m=Vt(c,p,h,u),s.snapshotKeyCache.set(f,m)),a.styleMap.set(t,m)}function Ri(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function qn(e){let t=e.parentElement;if(!t)return!1;let r=B(t).display||"";return r.includes("flex")||r.includes("grid")}function Ti(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3&&/\S/.test(n.nodeValue))return!0;let t=e.firstElementChild,r=e.lastElementChild;if(t&&t.tagName==="BR"||r&&r.tagName==="BR")return!0;for(let n=e.firstElementChild;n;n=n.nextElementSibling){let o=B(n);if(o.display==="none")continue;let i=o.position;if(i!=="absolute"&&i!=="fixed")return!0}return!1}function Li(e){let t=e.getBoundingClientRect().top,r=-1/0,n=null;for(let o=e.firstChild;o;o=o.nextSibling){if(o.nodeType===3){if(!/\S/.test(o.nodeValue||""))continue;n=n||document.createRange(),n.selectNode(o);let s=n.getBoundingClientRect();(s.width||s.height)&&(r=Math.max(r,s.bottom));continue}if(o.nodeType!==1)continue;let i=B(o);if(i.display==="none")continue;let a=i.position;a==="absolute"||a==="fixed"||i.float&&i.float!=="none"||(r=Math.max(r,o.getBoundingClientRect().bottom))}return r===-1/0?NaN:r-t}function Pi(e,t,r){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let n=e.tagName&&e.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n)||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid"))return;let i=t.position;if(i==="absolute"||i==="fixed"||i==="sticky"||t.transform!=="none"||Ri(t)||qn(e))return;let a=t.overflowX||t.overflow||"visible",s=t.overflowY||t.overflow||"visible";if(a!=="visible"||s!=="visible")return;let l=t.clip;if(l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||!Ti(e))return;let d=parseFloat(t.height),c=Li(e);Number.isFinite(d)&&Number.isFinite(c)&&Math.abs(d-c)>2||(delete r.height,delete r["block-size"])}Rt();var zn=["fill","stroke","color","background-color","stop-color"],Fi=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function Kt(e){let t=e;for(;t&&t.nodeType===1;){if(t.namespaceURI==="http://www.w3.org/2000/svg"){if(t.localName==="mask"||t.localName==="clipPath")return!1;if(Fi.has(t.localName))return!0}t=t.parentNode}return!1}var Yr=new Map;function Ii(e,t){let r=t+"::"+e.toLowerCase(),n=Yr.get(r);if(n)return n;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.setAttribute("data-snapdom-internal",""),a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let s=getComputedStyle(i),l={};for(let d of zn)l[d]=s.getPropertyValue(d)||"";return a.remove(),Yr.set(r,l),l}function Oi(e,t){if(e?.nodeType!==1||t?.nodeType!==1||Kt(e))return;let r=e.getAttribute?.("style"),n=!!(r&&r.includes("var("));if(!n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){n=!0;break}}}let o=null;if(n)try{o=getComputedStyle(e)}catch{}if(n){let i=e.style;if(i&&i.length){let a=new Set;for(let s=0;s<i.length;s++){let l=i[s];if(a.has(l))continue;a.add(l);let d=i.getPropertyValue(l);if(!d||!d.includes("var("))continue;let c=o&&o.getPropertyValue(l);if(c)try{t.style.setProperty(l,c.trim(),i.getPropertyPriority(l))}catch{}}}}if(n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let l=s.name,d=o&&o.getPropertyValue(l);if(d)try{t.style.setProperty(l,d.trim())}catch{}}}if(!n){if(!o)try{o=getComputedStyle(e)}catch{o=null}if(!o)return;let i=e.namespaceURI||"html",a=Ii(e.tagName,i);for(let s of zn){let l=o.getPropertyValue(s)||"",d=a[s]||"";if(l&&l!==d)try{t.style.setProperty(s,l.trim())}catch{}}}}de();de();ne();$e();$e();function Ee(e){return!!(!e||e.startsWith("data:")||e.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}var Gr="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";function Hi(e,t){return!e||e?.nodeType!==1?!1:e.matches?.("picture")||e.querySelector("picture")?!0:t?!!(e.matches?.(Gr)||e.querySelector(Gr)):!1}var _i=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Et(e,t){if(!e)return null;let r=0;try{r=t?t.getBoundingClientRect().width||t.width:0}catch{}r||(r=window.innerWidth||1e3);let n=[];for(let i of e.split(",")){let a=i.trim().split(/\s+/);if(!a[0])continue;let s=a[1]||"",l=1;/^\d*\.?\d+x$/i.test(s)?l=parseFloat(s):/^\d+w$/i.test(s)&&(l=parseInt(s,10)/r),n.push({url:a[0],d:l})}if(!n.length)return null;n.sort((i,a)=>i.d-a.d);let o=window.devicePixelRatio||1;return(n.find(i=>i.d>=o)||n[n.length-1]).url}function Vn(e,t){let r=e.currentSrc||"";if(r&&!Ee(r))return r;let n=t.querySelectorAll("source[srcset]"),o=null;for(let i of n){let a=i.getAttribute("srcset");if(!a||Ee(a))continue;let s=i.getAttribute("type");if(s&&!_i.test(s.trim()))continue;let l=i.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return Et(a,e)}catch{}o||(o=Et(a,e))}return o}function Di(e){let t=[e.getAttribute("data-src"),e.getAttribute("data-lazy-src"),e.getAttribute("data-original"),e.getAttribute("data-hi-res-src")];for(let n of t)if(n&&!Ee(n))return n;let r=e.getAttribute("data-srcset")||e.getAttribute("data-lazy-srcset");if(r){let n=r.split(",")[0].trim().split(/\s+/)[0];if(n&&!Ee(n))return n}return null}function Wi(e={}){let t=e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:t.resolveLazySrc!==!1,silent:t.silent??!1,useProxy:typeof e.useProxy=="string"?e.useProxy:""}}async function Bi(e,t={}){if(!e||e?.nodeType!==1||t.resolvePicturePlaceholders===!1)return null;let{timeout:r,concurrency:n,resolveLazySrc:o,silent:i,useProxy:a}=Wi(t);if(!Hi(e,o))return null;let s=[],l=[];async function d(p){let f=await le(p,{as:"dataURL",timeout:r,useProxy:a,silent:!0});return f.ok?f.data:null}async function c(p){for(let f=0;f<p.length;f+=n){let h=p.slice(f,f+n);await Promise.allSettled(h.map(m=>m()))}}let u=Array.from(e.querySelectorAll("picture"));e.matches?.("picture")&&u.unshift(e);for(let p of u){let f=p.querySelector("img");if(!f)continue;let h=f.getAttribute("src")||"";if(!Ee(h))continue;let m=Vn(f,p);m&&l.push(async()=>{let g=await d(m);if(!g){i||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${m.slice(0,60)}`);return}let y=f.getAttribute("src"),x=f.getAttribute("srcset"),v=f.getAttribute("sizes"),b=[];f.src=g,f.setAttribute("src",g),f.removeAttribute("srcset"),f.removeAttribute("sizes");let w=p.querySelectorAll("source");for(let S of w)b.push({el:S,parent:S.parentElement,next:S.nextSibling}),S.remove();s.push(()=>{y!==null?f.setAttribute("src",y):f.removeAttribute("src"),x!==null&&f.setAttribute("srcset",x),v!==null&&f.setAttribute("sizes",v);for(let{el:S,parent:M,next:C}of b)M&&M.insertBefore(S,C)})})}if(o){let p=Array.from(e.querySelectorAll("img"));e.localName==="img"&&p.unshift(e);for(let f of p){if(f.closest("picture")&&Ee(f.getAttribute("src")||""))continue;let h=f.getAttribute("src")||"",m=Di(f);m&&Ee(h)&&l.push(async()=>{let g=await d(m);if(!g)return;let y=f.getAttribute("src");f.src=g,f.setAttribute("src",g),f.removeAttribute("srcset"),f.removeAttribute("sizes"),s.push(()=>{y!==null?f.setAttribute("src",y):f.removeAttribute("src")})})}}return l.length===0?null:(await c(l),async function(){for(let p of s)try{p()}catch{}})}function Bt(e,t,r){return r?Promise.all(e.map(n=>new Promise(o=>t(n,o)))):Promise.all(e.map(n=>new Promise(o=>{function i(){ht(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(n,o):i()},{fast:r})}i()})))}function ji(e,t){if(e=e.trim(),!e)return e;let r=t?`[data-sd-slotted~="${t}"]`:"[data-sd-slotted]";return e.endsWith(":not([data-sd-slotted])")||e.endsWith(`:not(${r})`)?e:`${e}:not(${r})`}function Ui(e,t,r=!0,n){return e.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let i=r?ji(o,n):o;return`:where(${t} ${i})`}).join(", ")}function qi(e,t,r){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${t}:is(${o.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${t} ${o.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,i,a)=>{let s=Ui(a,t,!0,r);return`${o}${i}${s}{`}),e):""}function zi(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Vi(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
|
|
3
3
|
`});let r=e.adoptedStyleSheets||[];for(let n of r)try{if(n&&n.cssRules)for(let o of n.cssRules)t+=o.cssText+`
|
|
4
|
-
`}catch{}}catch{}return t}function
|
|
5
|
-
`:""}function Ki(e,t){if(!e)return;let r=n=>{let o=n.getAttribute("data-sd-slotted")||"";t?` ${o} `.includes(` ${t} `)||n.setAttribute("data-sd-slotted",o?`${o} ${t}`:t):n.setAttribute("data-sd-slotted",o)};e.nodeType===Node.ELEMENT_NODE&&r(e),e.querySelectorAll?.("*").forEach(r)}async function Ji(e,t=3){let r=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},n=r(),o=0;for(;o<t&&(!n||!n.body&&!n.documentElement);)await new Promise(i=>setTimeout(i,0)),n=r(),o++;return n&&(n.body||n.documentElement)?n:null}function Zi(e){let t=e.getBoundingClientRect(),r=0,n=0,o=0,i=0;try{let l=getComputedStyle(e);r=parseFloat(l.borderLeftWidth)||0,n=parseFloat(l.borderRightWidth)||0,o=parseFloat(l.borderTopWidth)||0,i=parseFloat(l.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(r+n))),s=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:s,rect:t}}function fe(e){let t=0,r=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(r=e.offsetHeight),t===0||r===0)try{let n=getComputedStyle(e);if(t===0){let o=parseFloat(n.width);!isNaN(o)&&o>0&&(t=o)}if(r===0){let o=parseFloat(n.height);!isNaN(o)&&o>0&&(r=o)}}catch{}if(t===0||r===0)try{if(t===0){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(r===0){let n=parseFloat(e.getAttribute("height"));!isNaN(n)&&n>0&&(r=n)}}catch{}if((t===0||r===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),r===0&&e.naturalHeight>0&&(r=e.naturalHeight)}catch{}return{width:t,height:r}}function ea(e,t,r){let n=e.defaultView,o=n?n.scrollX:0,i=n?n.scrollY:0,a=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,l=e.documentElement?e.documentElement.scrollLeft:0,d=e.documentElement?e.documentElement.scrollTop:0,c=0,u=0,p=0,f=0;try{let m=n&&e.body?n.getComputedStyle(e.body):null;m&&(c=(parseFloat(m.marginTop)||0)+(parseFloat(m.paddingTop)||0),u=(parseFloat(m.marginRight)||0)+(parseFloat(m.paddingRight)||0),p=(parseFloat(m.marginBottom)||0)+(parseFloat(m.paddingBottom)||0),f=(parseFloat(m.marginLeft)||0)+(parseFloat(m.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute("data-sd-pinned","")}catch{}let h=e.createElement("style");return h.setAttribute("data-sd-iframe-pin",""),h.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${u}px ${p}px ${f}px !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(h),()=>{try{h.remove()}catch{}try{e.documentElement.removeAttribute("data-sd-pinned")}catch{}try{n&&typeof n.scrollTo=="function"&&n.scrollTo(o,i),e.body&&(e.body.scrollLeft=a,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=l,e.documentElement.scrollTop=d)}catch{}}}async function ta(e,t,r){let n=await Ji(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=Zi(e),s=r?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l={...r,scale:1,clip:null},d=ea(n,o,i),c=k.session.nodeMap,u=k.session.styleMap,p=k.session.styleCache,f;try{f=await s.toPng(n.documentElement,l)}finally{d(),k.session.nodeMap=c,k.session.styleMap=u,k.session.styleCache=p}f.style.display="block",f.style.width=`${o}px`,f.style.height=`${i}px`;let h=document.createElement("div");return t.nodeMap.set(h,e),pe(e,h,t,r),h.style.overflow="hidden",h.style.display="block",h.style.width||(h.style.width=`${Math.round(a.width)}px`),h.style.height||(h.style.height=`${Math.round(a.height)}px`),h.appendChild(f),h}function ra(e){let{width:t,height:r}=fe(e),n=e.getBoundingClientRect(),o;try{o=window.getComputedStyle(e)}catch{}let i=o?parseFloat(o.width):NaN,a=o?parseFloat(o.height):NaN,s=Math.round(t||n.width||0),l=Math.round(r||n.height||0),d=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,s||16),c=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),u=(e.type||"text").toLowerCase()==="checkbox",p=!!e.checked,f=!!e.indeterminate,h=Math.max(Math.min(d,c),12),m="middle";try{o&&o.verticalAlign&&(m=o.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),g.style.cssText=`display:inline-block;width:${h}px;height:${h}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(h)),y.setAttribute("height",String(h)),y.setAttribute("viewBox",`0 0 ${h} ${h}`),g.appendChild(y);function x(){let v="#0a6ed1";try{o&&(v=o.accentColor||o.color||v)}catch{}let b=2,w=b/2,S=h-b;if(y.innerHTML="",u){let M=document.createElementNS("http://www.w3.org/2000/svg","rect");if(M.setAttribute("x",String(w)),M.setAttribute("y",String(w)),M.setAttribute("width",String(S)),M.setAttribute("height",String(S)),M.setAttribute("rx","2"),M.setAttribute("ry","2"),M.setAttribute("fill",p?v:"none"),M.setAttribute("stroke",v),M.setAttribute("stroke-width",String(b)),y.appendChild(M),p){let C=document.createElementNS("http://www.w3.org/2000/svg","path");C.setAttribute("d",`M ${w+2} ${h/2} L ${h/2-1} ${h-w-2} L ${h-w-2} ${w+2}`),C.setAttribute("stroke","white"),C.setAttribute("stroke-width",String(Math.max(1.5,b))),C.setAttribute("fill","none"),C.setAttribute("stroke-linecap","round"),C.setAttribute("stroke-linejoin","round"),y.appendChild(C)}else if(f){let C=document.createElementNS("http://www.w3.org/2000/svg","rect"),E=Math.max(6,S-4);C.setAttribute("x",String((h-E)/2)),C.setAttribute("y",String((h-b)/2)),C.setAttribute("width",String(E)),C.setAttribute("height",String(b)),C.setAttribute("fill",v),C.setAttribute("rx","1"),y.appendChild(C)}}else{let M=document.createElementNS("http://www.w3.org/2000/svg","circle");if(M.setAttribute("cx",String(h/2)),M.setAttribute("cy",String(h/2)),M.setAttribute("r",String((h-b)/2)),M.setAttribute("fill",p?v:"none"),M.setAttribute("stroke",v),M.setAttribute("stroke-width",String(b)),y.appendChild(M),p){let C=document.createElementNS("http://www.w3.org/2000/svg","circle"),E=Math.max(2,(h-b*2)*.35);C.setAttribute("cx",String(h/2)),C.setAttribute("cy",String(h/2)),C.setAttribute("r",String(E)),C.setAttribute("fill","white"),y.appendChild(C)}}g.style.setProperty("width",`${h}px`,"important"),g.style.setProperty("height",`${h}px`,"important"),g.style.setProperty("min-width",`${h}px`,"important"),g.style.setProperty("min-height",`${h}px`,"important")}return x(),{el:g,applyVisual:x}}var De=new re(80);async function We(e){if(k.resource?.has(e))return k.resource.get(e);if(De.has(e))return De.get(e);let t=(async()=>{let r=await le(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return k.resource?.set(e,r.data),r.data})();De.set(e,t);try{let r=await t;return De.set(e,r),r}catch(r){throw De.delete(e),r}}var na=/\bblob:[^)"'\s]+/g;async function Gr(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(na)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let o=await We(n);r=r.split(n).join(o)}catch{}return r}function lt(e){return typeof e=="string"&&e.startsWith("blob:")}function oa(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let r=t.match(/^(\S+)(\s+.+)?$/);return r?{url:r[1],desc:r[2]||""}:null}).filter(Boolean)}function ia(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}function ct(e,t){let r=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&r.unshift(e),r}async function aa(e,t=null){if(!e)return;let r=t,n=ct(e,"img");for(let l of n)try{let d=l.getAttribute("src")||l.currentSrc||"";if(lt(d)){let u=await We(d);l.setAttribute("src",u)}let c=l.getAttribute("srcset");if(c&&c.includes("blob:")){let u=oa(c),p=!1;for(let f of u)if(lt(f.url))try{f.url=await We(f.url),p=!0}catch(h){j(r,"blobUrlToDataUrl for srcset item failed",h)}p&&l.setAttribute("srcset",ia(u))}}catch(d){j(r,"resolveBlobUrls for img failed",d)}let o=ct(e,"image");for(let l of o)try{let d="http://www.w3.org/1999/xlink",c=l.getAttribute("href")||l.getAttributeNS?.(d,"href");if(lt(c)){let u=await We(c);l.setAttribute("href",u),l.removeAttributeNS?.(d,"href")}}catch(d){j(r,"resolveBlobUrls for SVG image href failed",d)}let i=ct(e,"[style*='blob:']");for(let l of i)try{let d=l.getAttribute("style");if(d&&d.includes("blob:")){let c=await Gr(d);l.setAttribute("style",c)}}catch(d){j(r,"replaceBlobUrls in inline style failed",d)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let l of a)try{let d=l.textContent||"";d.includes("blob:")&&(l.textContent=await Gr(d))}catch(d){j(r,"replaceBlobUrls in style tag failed",d)}let s=["poster"];for(let l of s){let d=ct(e,`[${l}^='blob:']`);for(let c of d)try{let u=c.getAttribute(l);lt(u)&&c.setAttribute(l,await We(u))}catch(u){j(r,`resolveBlobUrls for ${l} failed`,u)}}}Ae();var Kt=new Map,Qr=new Set(["IFRAME"]);function Lt(e,t){Kt.set(String(e).toUpperCase(),t)}function Bt(e){let{width:t,height:r}=fe(e),n=t,o=r;if(!n||!o){let a=e.getBoundingClientRect();n=n||a.width||0,o=o||a.height||0}let i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${n}px;height:${o}px;visibility:hidden;`,i}var dt=200,sa=new Set(["img","canvas","video","iframe","object","embed"]);function Kr(e,t){return e.right>=t.left-dt&&e.left<=t.right+dt&&e.bottom>=t.top-dt&&e.top<=t.bottom+dt}function la(e,t){if(e===t.root)return!1;let r;try{r=e.getBoundingClientRect()}catch{return!1}if(r.width===0&&r.height===0)return!1;let n=B(e);if(n.display==="inline"&&!sa.has((e.localName||"").toLowerCase()))return!1;let o=t.rect,i=e.scrollWidth||0,a=e.scrollHeight||0,s={left:n.direction==="rtl"?Math.min(r.left,r.right-i):r.left,top:r.top,right:Math.max(r.right,r.left+i),bottom:Math.max(r.bottom,r.top+a)},l=n.writingMode||"";if((l.startsWith("vertical")||l.startsWith("sideways"))&&(s.top=Math.min(r.top,r.bottom-a),s.left=Math.min(s.left,r.right-i)),Kr(s,o))return!1;let d=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;d.nextNode();){let c=d.currentNode.getBoundingClientRect();if((c.width>0||c.height>0)&&Kr(c,o))return!1}return!0}function ca(e,t,r){let n=e.cloneNode(!1);e.tagName==="IMG"&&(n.removeAttribute("src"),n.removeAttribute("srcset"),n.removeAttribute("sizes")),pe(e,n,t,r);let{width:o,height:i}=fe(e);return o>0&&(n.style.width=`${o}px`,n.style.minWidth=`${o}px`,n.style.maxWidth=`${o}px`),i>0&&(n.style.height=`${i}px`,n.style.minHeight=`${i}px`,n.style.maxHeight=`${i}px`),n.style.visibility="hidden",n.style.overflow="hidden",n.style.boxSizing="border-box",n}async function wt(e,t,r){if(!e)throw new Error("Invalid node");let n=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let c=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Sn.has(c))return null;if(c==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return j(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null;if(c==="source"&&e.parentElement?.localName==="picture")return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(r.excludeMode==="hide")return Bt(e);if(r.excludeMode==="remove")return null}if(r.exclude&&Array.isArray(r.exclude))for(let c of r.exclude)try{if(e.matches?.(c)){if(r.excludeMode==="hide")return Bt(e);if(r.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${c}`,u)}if(typeof r.filter=="function")try{if(!r.filter(e)){if(r.filterMode==="hide")return Bt(e);if(r.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.clip&&la(e,t.clip))return ca(e,t,r);if(r.__resolveNodeHooks)for(let c of r.__resolveNodeHooks){let u;try{u=await c(e,r)}catch(p){j(t,"resolveNode plugin hook failed",p)}if(u===null)return null;if(u instanceof Node)return u.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(u,e),pe(e,u,t,r)),u}{let c=Qr.has(e.tagName)&&Kt.get(e.tagName);if(c){let u=await c(e,t,r);if(u!==void 0)return u}}if(e.getAttribute("data-capture")==="placeholder"){let c=e.cloneNode(!1);t.nodeMap.set(c,e),pe(e,c,t,r);let u=document.createElement("div");return u.textContent=e.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(u),c}{let c=!Qr.has(e.tagName)&&Kt.get(e.tagName);if(c){let u=await c(e,t,r);if(u!==void 0)return u}}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let c of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(c.value)&&a.setAttribute(c.name,c.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Ii(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Xi(e,a);try{let{width:c,height:u}=fe(e),p=Math.round(c||0),f=Math.round(u||0);p&&(a.dataset.snapdomWidth=String(p)),f&&(a.dataset.snapdomHeight=String(f))}catch(c){j(t,"getUnscaledDimensions for IMG failed",c)}try{let c=e.getAttribute("style")||"",u=window.getComputedStyle(e),p=v=>{let b=c.match(new RegExp(`${v}\\s*:\\s*([^;]+)`,"i")),w=b?b[1].trim():u.getPropertyValue(v);return/%|auto/i.test(String(w||""))},f=parseInt(a.dataset.snapdomWidth||"0",10),h=parseInt(a.dataset.snapdomHeight||"0",10),m=p("width")||!f,g=p("height")||!h;m&&f&&(a.style.width=`${f}px`),g&&h&&(a.style.height=`${h}px`);let y=u.getPropertyValue("object-fit"),x=u.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,x&&(a.style.objectPosition=x)):(f&&(a.style.minWidth=`${f}px`),h&&(a.style.minHeight=`${h}px`))}catch(c){j(t,"IMG dimension freeze failed",c)}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",e,c),c}let s=null;if(e instanceof HTMLTextAreaElement){let{width:c,height:u}=fe(e),p=c||e.getBoundingClientRect().width||0,f=u||e.getBoundingClientRect().height||0;p&&(a.style.width=`${p}px`),f&&(a.style.height=`${f}px`)}if(e instanceof HTMLInputElement){let c=(e.type||"text").toLowerCase();if((c==="checkbox"||c==="radio")&&ri()){let{el:u,applyVisual:p}=ra(e);t.nodeMap.set(u,e),s=p,a=u}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let c=window.getComputedStyle(e,"::placeholder"),u=c&&c.color;if(u&&u!=="rgba(0, 0, 0, 0)"){let p="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(p);let f=document.createElement("style");f.textContent=`.${p}::placeholder{color:${u}!important;opacity:${c.opacity||"1"}!important;-webkit-text-fill-color:${u}!important;}`,a.prepend(f)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let c=e;c.min!==void 0&&c.min!==""&&a.setAttribute("min",c.min),c.max!==void 0&&c.max!==""&&a.setAttribute("max",c.max),c.pattern!==void 0&&c.pattern!==""&&a.setAttribute("pattern",c.pattern);let u=e.getAttribute("aria-invalid");u!==null&&a.setAttribute("aria-invalid",u)}if(Qt(e)||pe(e,a,t,r),s&&s(),e instanceof SVGElement&&!Qt(e)){let c=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let u=window.getComputedStyle(e);for(let p of c){let f=u.getPropertyValue(p);f&&a.style.setProperty(p,f)}}catch{}}if(e.shadowRoot){try{let v=e.shadowRoot.querySelectorAll("slot");for(let b of v){let w=b.assignedNodes?.()||[];for(let S of w)n.add(S)}}catch{}let c=qi(t),u=`[data-sd="${c}"]`;t.shadowScopes||(t.shadowScopes=new WeakMap),t.shadowScopes.set(e.shadowRoot,c);try{a.setAttribute("data-sd",c)}catch{}let p=zi(e.shadowRoot),f=Ui(p,u,c),h=Yi(p),m=Qi(e,h,u);Vi(a,m+f,c);let g=document.createDocumentFragment(),y=(v,b)=>{if(v.nodeType===Node.ELEMENT_NODE&&v.tagName==="STYLE")return b(null);wt(v,t,r).then(w=>{b(w||null)}).catch(()=>{b(null)})},x=await Wt(Array.from(e.shadowRoot.childNodes),y,r.fast);g.append(...x.filter(v=>!!v)),a.appendChild(g)}if(e.tagName==="SLOT"){let c=t.shadowScopes?.get(e.getRootNode()),u=e.assignedNodes?.()||[],p=u.length?e.assignedNodes?.({flatten:!0})||u:[],f=p.length?p:Array.from(e.childNodes),h=document.createDocumentFragment(),m=(y,x)=>{wt(y,t,r).then(v=>{v&&u.length&&Ki(v,c),x(v||null)}).catch(()=>{x(null)})},g=await Wt(Array.from(f),m,r.fast);return h.append(...g.filter(y=>!!y)),h}function l(c,u){if(n.has(c)||e.shadowRoot&&!c.assignedSlot)return u(null);wt(c,t,r).then(p=>{u(p||null)}).catch(()=>{u(null)})}let d=await Wt(Array.from(e.childNodes),l,r.fast);if(a.append(...d.filter(c=>!!c)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let c of a.options)c.value===o?c.setAttribute("selected",""):c.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}async function da(e,t,r){let n=!1;try{n=!!(e.contentDocument||e.contentWindow?.document)}catch(o){j(t,"iframe same-origin probe failed",o)}if(n)try{return await ta(e,t,r)}catch(o){console.warn("[SnapDOM] iframe rasterization failed, fallback:",o)}if(n||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",e),r.placeholders){let{width:o,height:i}=fe(e),a=document.createElement("div");return a.style.cssText=`width:${o}px;height:${i}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,pe(e,a,t,r),a}else{let{width:o,height:i}=fe(e),a=document.createElement("div");return a.style.cssText=`display:inline-block;width:${o}px;height:${i}px;visibility:hidden;`,pe(e,a,t,r),a}}function ua(e){try{let t=Math.max(1,Math.min(32,e.width)),r=Math.max(1,Math.min(32,e.height)),n=document.createElement("canvas");n.width=t,n.height=r;let o=n.getContext("2d",{willReadFrequently:!0});if(!o)return!1;o.drawImage(e,0,0,t,r);let i=o.getImageData(0,0,t,r).data;for(let a=3;a<i.length;a+=4)if(i[a]!==0)return!1;return!0}catch{return!1}}async function pa(e,t,r){let n="";try{let s=e.getContext("2d",{willReadFrequently:!0});try{s&&s.getImageData(0,0,1,1)}catch{}if((we()||!s)&&await Me(),n=e.toDataURL("image/png"),!n||n==="data:,"){try{s&&s.getImageData(0,0,1,1)}catch{}if(await Me(),n=e.toDataURL("image/png"),!n||n==="data:,"){let l=document.createElement("canvas");l.width=e.width,l.height=e.height;let d=l.getContext("2d");d&&(d.drawImage(e,0,0),n=l.toDataURL("image/png"))}}}catch(s){j(t,"Canvas toDataURL failed, using empty/fallback",s)}r&&r.debug&&n&&ua(e)&&j(t,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",e);let o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch(s){j(t,"img decoding/loading hints failed",s)}n&&(o.src=n),o.width=e.width,o.height=e.height;let{width:i,height:a}=fe(e);return i>0&&(o.style.width=`${i}px`),a>0&&(o.style.height=`${a}px`),t.nodeMap.set(o,e),pe(e,o,t,r),o}async function fa(e,t,r){let n="";try{let s=document.createElement("canvas");s.width=e.videoWidth||e.offsetWidth||320,s.height=e.videoHeight||e.offsetHeight||240;let l=s.getContext("2d");l&&(l.drawImage(e,0,0,s.width,s.height),n=s.toDataURL("image/png"),(!n||n==="data:,")&&(n=""))}catch(s){j(t,"Video frame capture failed, using poster fallback",s)}let o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}n?o.src=n:e.poster&&(o.src=e.poster),o.width=e.videoWidth||e.offsetWidth||0,o.height=e.videoHeight||e.offsetHeight||0;let{width:i,height:a}=fe(e);return i>0&&(o.style.width=`${i}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",t.nodeMap.set(o,e),pe(e,o,t,r),o}async function ha(e,t,r){if(!e.controls)return;let{width:n,height:o}=fe(e),i=Math.round(n||e.offsetWidth||300),a=Math.round(o||e.offsetHeight||54),s=a/2,l=Math.max(4,a*.16),d=a*.34,c=i-a*.34,u=d+l+a*.55,p=Math.max(0,c-a*.7-u),f=Math.max(9,Math.round(a*.24)),h=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${a}" viewBox="0 0 ${i} ${a}"><rect width="${i}" height="${a}" rx="${Math.min(a/2,10)}" fill="#f1f3f4"/><path d="M ${d} ${s-l} L ${d+l} ${s} L ${d} ${s+l} Z" fill="#5f6368"/><rect x="${u}" y="${s-1.5}" width="${p}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${s}" r="${Math.max(3,a*.09)}" fill="#5f6368"/><text x="${c}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${f}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch{}return m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,m.width=i,m.height=a,m.style.width=`${i}px`,m.style.height=`${a}px`,t.nodeMap.set(m,e),pe(e,m,t,r),m}Lt("IFRAME",da);Lt("CANVAS",pa);Lt("VIDEO",fa);Lt("AUDIO",ha);de();Nt();Rt();ne();ne();var ma=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Te=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),Vn=[],Jr=new Set;function ga(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ba(e){let t=Array.isArray(e)?e:[e];for(let r of t){let n;if(r instanceof RegExp)n=r;else if(typeof r=="string")n=new RegExp(ga(r),"i");else{console.warn("[snapdom] Ignored invalid iconFont value:",r);continue}let o=`${n.source}/${n.flags}`;Jr.has(o)||(Jr.add(o),Vn.push(n))}}function be(e){let t=typeof e=="string"?e:"",r=[...ma,...Vn];for(let n of r)if(n instanceof RegExp&&n.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function ya(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var Zr=new Map;function wa(e=""){let t=Object.create(null),r=String(e||""),n=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=n.exec(r);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function xa(e,t,r){let n=String(e||""),o=n.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};let a=r&&(r.FILL??r.fill),s="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?s="rounded":/\bsharp\b/.test(i)?s="sharp":/\boutlined\b/.test(i)&&(s="outlined");let l=a===1,d=null;if(l&&(s==="outlined"&&Te.materialIconsFilled?d={url:Te.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&Te.materialIconsRound?d={url:Te.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&Te.materialIconsSharp&&(d={url:Te.materialIconsSharp,alias:"snapdom-mi-sharp"})),!d)return{familyForMeasure:n,familyForCanvas:n};if(!Zr.has(d.alias))try{let u=new FontFace(d.alias,`url(${d.url})`,{style:"normal",weight:"400"});document.fonts.add(u),await u.load(),Zr.set(d.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let c=`"${d.alias}"`;return{familyForMeasure:c,familyForCanvas:c}}async function va(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Sa(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!r&&t.toLowerCase()!=="currentcolor")return t;let n=e.color?.trim();return n&&n!=="inherit"?n:"#000"}async function Ca(e,{family:t="Material Icons",weight:r="normal",fontSize:n=32,color:o="#000",variation:i="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,d=wa(i),{familyForMeasure:c,familyForCanvas:u}=await xa(s,a,d);await va(u.replace(/^["']+|["']+$/g,""),n);let p=document.createElement("span");p.setAttribute("data-snapdom-internal",""),p.textContent=e,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=c,p.style.fontWeight=String(r||"normal"),p.style.fontSize=`${n}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=o,document.body.appendChild(p);let f=p.getBoundingClientRect(),h=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(p);let g=document.createElement("canvas");g.width=h*l,g.height=m*l;let y=g.getContext("2d");y.scale(l,l),y.font=`${r?`${r} `:""}${n}px ${u}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:g.toDataURL(),width:h,height:m}}async function ka(e,t,r=k.session.nodeMap){if(e?.nodeType!==1)return 0;let n='.material-icons, [class*="material-symbols"]',o=Array.from(e.querySelectorAll(n)).filter(s=>s&&s.textContent&&s.textContent.trim());if(e.matches?.(n)&&e.textContent&&e.textContent.trim()&&o.unshift(e),o.length===0)return 0;let i=t?.nodeType===1?Array.from(t.querySelectorAll(n)).filter(s=>s&&s.textContent&&s.textContent.trim()):[];t?.nodeType===1&&t.matches?.(n)&&t.textContent&&t.textContent.trim()&&i.unshift(t);let a=0;for(let s=0;s<o.length;s++){let l=o[s],d=r&&r.get(l)||i[s]||null;try{let c=getComputedStyle(d||l),u=c.fontFamily||"Material Icons";if(!ya(u))continue;let p=(d||l).textContent.trim();if(!p)continue;let f=parseInt(c.fontSize,10)||24,h=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",m=Sa(c),g=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",y=(d||l).className||"",{dataUrl:x,width:v,height:b}=await Ca(p,{family:u,weight:h,fontSize:f,color:m,variation:g,className:y});l.textContent="";let w=l.ownerDocument.createElement("img");w.src=x,w.alt=p,w.style.height=`${f}px`,w.style.width=`${Math.max(1,Math.round(v/b*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(w),a++}catch{}}return a}$e();Ae();async function Ma(e,t,r,n=32,o="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.setAttribute("data-snapdom-internal",""),a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=r||"normal",a.style.fontSize=`${n}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),l=Math.ceil(s.width),d=Math.ceil(s.height);document.body.removeChild(a);let c=document.createElement("canvas");c.width=Math.max(1,l*i),c.height=Math.max(1,d*i);let u=c.getContext("2d");return u.scale(i,i),u.font=r?`${r} ${n}px "${t}"`:`${n}px "${t}"`,u.textAlign="left",u.textBaseline="top",u.fillStyle=o,u.fillText(e,0,0),{dataUrl:c.toDataURL(),width:l,height:d}}var Xn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Ea=["katex","mathjax","mathml"];function gr(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!Xn.has(r.toLowerCase()))return r}return""}function $a(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(Xn.has(n.toLowerCase())||t.push(n))}return t}function xt(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let r=parseInt(t,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function vt(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Aa(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Na(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let o=xt(r[1]),i=xt(r[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let n=xt(t);return{min:n,max:n}}function Ra(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Ta(e){let t=String(e||"100%").trim(),r=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let i=parseFloat(r[1]),a=parseFloat(r[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let n=t.match(/(\d+(?:\.\d+)?)\s*%/),o=n?parseFloat(n[1]):100;return{min:o,max:o}}function La(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Fa(e,t,r=[]){if(!e)return!1;try{let n=new URL(e,location.href);if(n.origin===location.origin)return!0;let o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(a=>o.endsWith(a))||r.some(a=>o===a.toLowerCase()||o.endsWith("."+a.toLowerCase())))return!0;let i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||Ea.some(a=>i.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),l=a.toLowerCase().replace(/\s+/g,"-"),d=La(a);if(i.includes(s)||i.includes(l)||d&&i.includes(d))return!0}return!1}catch{return!1}}function Pa(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function en(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(r,n,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return r;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var Jt=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,$t=4;async function Ia(e,t,r){if(!e)return e;let n=new Set;function o(s,l){try{return new URL(s,l||location.href).href}catch{return s}}async function i(s,l,d=0){if(d>$t)return console.warn(`[snapDOM] @import depth exceeded (${$t}) at ${l}`),s;let c="",u=0,p;for(;p=Jt.exec(s);){c+=s.slice(u,p.index),u=Jt.lastIndex;let f=(p[2]||p[4]||"").trim(),h=o(f,l);if(n.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}n.add(h);let m="";try{let g=await le(h,{as:"text",useProxy:r,silent:!0});g.ok&&typeof g.data=="string"&&(m=g.data)}catch{}m?(m=en(m,h),m=await i(m,h,d+1),c+=`
|
|
4
|
+
`}catch{}}catch{}return t}function Xi(e,t,r){if(!t)return;let n=document.createElement("style");n.setAttribute("data-sd",r),n.textContent=t,e.insertBefore(n,e.firstChild||null)}function Yi(e,t){try{let r=null,n=B(e).content;if(n&&n.includes("url(")){let a=n.match(/url\(["']?([^"')]+)["']?\)/);a&&(r=a[1])}let o=e.closest?.("picture"),i=r||(o?Vn(e,o):e.currentSrc)||e.src||Et(e.getAttribute("srcset"),e)||"";if(!i)return;t.setAttribute("src",i),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function Gi(e){let t=new Set;if(!e)return t;let r=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,n;for(;n=r.exec(e);)t.add(n[1]);return t}function Qi(e,t){try{let r=getComputedStyle(e).getPropertyValue(t).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(r)return r}catch{}return""}function Ki(e,t,r){let n=[];for(let o of t){let i=Qi(e,o);i&&n.push(`${o}: ${i};`)}return n.length?`${r}{${n.join("")}}
|
|
5
|
+
`:""}function Ji(e,t){if(!e)return;let r=n=>{let o=n.getAttribute("data-sd-slotted")||"";t?` ${o} `.includes(` ${t} `)||n.setAttribute("data-sd-slotted",o?`${o} ${t}`:t):n.setAttribute("data-sd-slotted",o)};e.nodeType===Node.ELEMENT_NODE&&r(e),e.querySelectorAll?.("*").forEach(r)}async function Zi(e,t=3){let r=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},n=r(),o=0;for(;o<t&&(!n||!n.body&&!n.documentElement);)await new Promise(i=>setTimeout(i,0)),n=r(),o++;return n&&(n.body||n.documentElement)?n:null}function ea(e){let t=e.getBoundingClientRect(),r=0,n=0,o=0,i=0;try{let l=getComputedStyle(e);r=parseFloat(l.borderLeftWidth)||0,n=parseFloat(l.borderRightWidth)||0,o=parseFloat(l.borderTopWidth)||0,i=parseFloat(l.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(r+n))),s=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:s,rect:t}}function fe(e){let t=0,r=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(r=e.offsetHeight),t===0||r===0)try{let n=getComputedStyle(e);if(t===0){let o=parseFloat(n.width);!isNaN(o)&&o>0&&(t=o)}if(r===0){let o=parseFloat(n.height);!isNaN(o)&&o>0&&(r=o)}}catch{}if(t===0||r===0)try{if(t===0){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(r===0){let n=parseFloat(e.getAttribute("height"));!isNaN(n)&&n>0&&(r=n)}}catch{}if((t===0||r===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),r===0&&e.naturalHeight>0&&(r=e.naturalHeight)}catch{}return{width:t,height:r}}function ta(e,t,r){let n=e.defaultView,o=n?n.scrollX:0,i=n?n.scrollY:0,a=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,l=e.documentElement?e.documentElement.scrollLeft:0,d=e.documentElement?e.documentElement.scrollTop:0,c=0,u=0,p=0,f=0;try{let m=n&&e.body?n.getComputedStyle(e.body):null;m&&(c=(parseFloat(m.marginTop)||0)+(parseFloat(m.paddingTop)||0),u=(parseFloat(m.marginRight)||0)+(parseFloat(m.paddingRight)||0),p=(parseFloat(m.marginBottom)||0)+(parseFloat(m.paddingBottom)||0),f=(parseFloat(m.marginLeft)||0)+(parseFloat(m.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute("data-sd-pinned","")}catch{}let h=e.createElement("style");return h.setAttribute("data-sd-iframe-pin",""),h.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${u}px ${p}px ${f}px !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(h),()=>{try{h.remove()}catch{}try{e.documentElement.removeAttribute("data-sd-pinned")}catch{}try{n&&typeof n.scrollTo=="function"&&n.scrollTo(o,i),e.body&&(e.body.scrollLeft=a,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=l,e.documentElement.scrollTop=d)}catch{}}}async function ra(e,t,r){let n=await Zi(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=ea(e),s=r?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l={...r,scale:1,clip:null},d=ta(n,o,i),c=k.session.nodeMap,u=k.session.styleMap,p=k.session.styleCache,f;try{f=await s.toPng(n.documentElement,l)}finally{d(),k.session.nodeMap=c,k.session.styleMap=u,k.session.styleCache=p}f.style.display="block",f.style.width=`${o}px`,f.style.height=`${i}px`;let h=document.createElement("div");return t.nodeMap.set(h,e),pe(e,h,t,r),h.style.overflow="hidden",h.style.display="block",h.style.width||(h.style.width=`${Math.round(a.width)}px`),h.style.height||(h.style.height=`${Math.round(a.height)}px`),h.appendChild(f),h}function na(e){let{width:t,height:r}=fe(e),n=e.getBoundingClientRect(),o;try{o=window.getComputedStyle(e)}catch{}let i=o?parseFloat(o.width):NaN,a=o?parseFloat(o.height):NaN,s=Math.round(t||n.width||0),l=Math.round(r||n.height||0),d=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,s||16),c=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),u=(e.type||"text").toLowerCase()==="checkbox",p=!!e.checked,f=!!e.indeterminate,h=Math.max(Math.min(d,c),12),m="middle";try{o&&o.verticalAlign&&(m=o.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),g.style.cssText=`display:inline-block;width:${h}px;height:${h}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(h)),y.setAttribute("height",String(h)),y.setAttribute("viewBox",`0 0 ${h} ${h}`),g.appendChild(y);function x(){let v="#0a6ed1";try{o&&(v=o.accentColor||o.color||v)}catch{}let b=2,w=b/2,S=h-b;if(y.innerHTML="",u){let M=document.createElementNS("http://www.w3.org/2000/svg","rect");if(M.setAttribute("x",String(w)),M.setAttribute("y",String(w)),M.setAttribute("width",String(S)),M.setAttribute("height",String(S)),M.setAttribute("rx","2"),M.setAttribute("ry","2"),M.setAttribute("fill",p?v:"none"),M.setAttribute("stroke",v),M.setAttribute("stroke-width",String(b)),y.appendChild(M),p){let C=document.createElementNS("http://www.w3.org/2000/svg","path");C.setAttribute("d",`M ${w+2} ${h/2} L ${h/2-1} ${h-w-2} L ${h-w-2} ${w+2}`),C.setAttribute("stroke","white"),C.setAttribute("stroke-width",String(Math.max(1.5,b))),C.setAttribute("fill","none"),C.setAttribute("stroke-linecap","round"),C.setAttribute("stroke-linejoin","round"),y.appendChild(C)}else if(f){let C=document.createElementNS("http://www.w3.org/2000/svg","rect"),E=Math.max(6,S-4);C.setAttribute("x",String((h-E)/2)),C.setAttribute("y",String((h-b)/2)),C.setAttribute("width",String(E)),C.setAttribute("height",String(b)),C.setAttribute("fill",v),C.setAttribute("rx","1"),y.appendChild(C)}}else{let M=document.createElementNS("http://www.w3.org/2000/svg","circle");if(M.setAttribute("cx",String(h/2)),M.setAttribute("cy",String(h/2)),M.setAttribute("r",String((h-b)/2)),M.setAttribute("fill",p?v:"none"),M.setAttribute("stroke",v),M.setAttribute("stroke-width",String(b)),y.appendChild(M),p){let C=document.createElementNS("http://www.w3.org/2000/svg","circle"),E=Math.max(2,(h-b*2)*.35);C.setAttribute("cx",String(h/2)),C.setAttribute("cy",String(h/2)),C.setAttribute("r",String(E)),C.setAttribute("fill","white"),y.appendChild(C)}}g.style.setProperty("width",`${h}px`,"important"),g.style.setProperty("height",`${h}px`,"important"),g.style.setProperty("min-width",`${h}px`,"important"),g.style.setProperty("min-height",`${h}px`,"important")}return x(),{el:g,applyVisual:x}}var _e=new re(80);async function We(e){if(k.resource?.has(e))return k.resource.get(e);if(_e.has(e))return _e.get(e);let t=(async()=>{let r=await le(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return k.resource?.set(e,r.data),r.data})();_e.set(e,t);try{let r=await t;return _e.set(e,r),r}catch(r){throw _e.delete(e),r}}var oa=/\bblob:[^)"'\s]+/g;async function Qr(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(oa)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let o=await We(n);r=r.split(n).join(o)}catch{}return r}function lt(e){return typeof e=="string"&&e.startsWith("blob:")}function ia(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let r=t.match(/^(\S+)(\s+.+)?$/);return r?{url:r[1],desc:r[2]||""}:null}).filter(Boolean)}function aa(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}function ct(e,t){let r=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&r.unshift(e),r}async function sa(e,t=null){if(!e)return;let r=t,n=ct(e,"img");for(let l of n)try{let d=l.getAttribute("src")||l.currentSrc||"";if(lt(d)){let u=await We(d);l.setAttribute("src",u)}let c=l.getAttribute("srcset");if(c&&c.includes("blob:")){let u=ia(c),p=!1;for(let f of u)if(lt(f.url))try{f.url=await We(f.url),p=!0}catch(h){j(r,"blobUrlToDataUrl for srcset item failed",h)}p&&l.setAttribute("srcset",aa(u))}}catch(d){j(r,"resolveBlobUrls for img failed",d)}let o=ct(e,"image");for(let l of o)try{let d="http://www.w3.org/1999/xlink",c=l.getAttribute("href")||l.getAttributeNS?.(d,"href");if(lt(c)){let u=await We(c);l.setAttribute("href",u),l.removeAttributeNS?.(d,"href")}}catch(d){j(r,"resolveBlobUrls for SVG image href failed",d)}let i=ct(e,"[style*='blob:']");for(let l of i)try{let d=l.getAttribute("style");if(d&&d.includes("blob:")){let c=await Qr(d);l.setAttribute("style",c)}}catch(d){j(r,"replaceBlobUrls in inline style failed",d)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let l of a)try{let d=l.textContent||"";d.includes("blob:")&&(l.textContent=await Qr(d))}catch(d){j(r,"replaceBlobUrls in style tag failed",d)}let s=["poster"];for(let l of s){let d=ct(e,`[${l}^='blob:']`);for(let c of d)try{let u=c.getAttribute(l);lt(u)&&c.setAttribute(l,await We(u))}catch(u){j(r,`resolveBlobUrls for ${l} failed`,u)}}}Ae();var Jt=new Map,Kr=new Set(["IFRAME"]);function Lt(e,t){Jt.set(String(e).toUpperCase(),t)}function jt(e){let{width:t,height:r}=fe(e),n=t,o=r;if(!n||!o){let a=e.getBoundingClientRect();n=n||a.width||0,o=o||a.height||0}let i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${n}px;height:${o}px;visibility:hidden;`,i}var dt=200,la=new Set(["img","canvas","video","iframe","object","embed"]);function Jr(e,t){return e.right>=t.left-dt&&e.left<=t.right+dt&&e.bottom>=t.top-dt&&e.top<=t.bottom+dt}function ca(e,t){if(e===t.root)return!1;let r;try{r=e.getBoundingClientRect()}catch{return!1}if(r.width===0&&r.height===0)return!1;let n=B(e);if(n.display==="inline"&&!la.has((e.localName||"").toLowerCase()))return!1;let o=t.rect,i=e.scrollWidth||0,a=e.scrollHeight||0,s={left:n.direction==="rtl"?Math.min(r.left,r.right-i):r.left,top:r.top,right:Math.max(r.right,r.left+i),bottom:Math.max(r.bottom,r.top+a)},l=n.writingMode||"";if((l.startsWith("vertical")||l.startsWith("sideways"))&&(s.top=Math.min(r.top,r.bottom-a),s.left=Math.min(s.left,r.right-i)),Jr(s,o))return!1;let d=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;d.nextNode();){let c=d.currentNode.getBoundingClientRect();if((c.width>0||c.height>0)&&Jr(c,o))return!1}return!0}function da(e,t,r){let n=e.cloneNode(!1);e.tagName==="IMG"&&(n.removeAttribute("src"),n.removeAttribute("srcset"),n.removeAttribute("sizes")),pe(e,n,t,r);let{width:o,height:i}=fe(e);return o>0&&(n.style.width=`${o}px`,n.style.minWidth=`${o}px`,n.style.maxWidth=`${o}px`),i>0&&(n.style.height=`${i}px`,n.style.minHeight=`${i}px`,n.style.maxHeight=`${i}px`),n.style.visibility="hidden",n.style.overflow="hidden",n.style.boxSizing="border-box",n}async function wt(e,t,r){if(!e)throw new Error("Invalid node");let n=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let c=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Cn.has(c))return null;if(c==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return j(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null;if(c==="source"&&e.parentElement?.localName==="picture")return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(r.excludeMode==="hide")return jt(e);if(r.excludeMode==="remove")return null}if(r.exclude&&Array.isArray(r.exclude))for(let c of r.exclude)try{if(e.matches?.(c)){if(r.excludeMode==="hide")return jt(e);if(r.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${c}`,u)}if(typeof r.filter=="function")try{if(!r.filter(e)){if(r.filterMode==="hide")return jt(e);if(r.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.clip&&ca(e,t.clip))return da(e,t,r);if(r.__resolveNodeHooks)for(let c of r.__resolveNodeHooks){let u;try{u=await c(e,r)}catch(p){j(t,"resolveNode plugin hook failed",p)}if(u===null)return null;if(u instanceof Node)return u.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(u,e),pe(e,u,t,r)),u}{let c=Kr.has(e.tagName)&&Jt.get(e.tagName);if(c){let u=await c(e,t,r);if(u!==void 0)return u}}if(e.getAttribute("data-capture")==="placeholder"){let c=e.cloneNode(!1);t.nodeMap.set(c,e),pe(e,c,t,r);let u=document.createElement("div");return u.textContent=e.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(u),c}{let c=!Kr.has(e.tagName)&&Jt.get(e.tagName);if(c){let u=await c(e,t,r);if(u!==void 0)return u}}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let c of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(c.value)&&a.setAttribute(c.name,c.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Oi(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Yi(e,a);try{let{width:c,height:u}=fe(e),p=Math.round(c||0),f=Math.round(u||0);p&&(a.dataset.snapdomWidth=String(p)),f&&(a.dataset.snapdomHeight=String(f))}catch(c){j(t,"getUnscaledDimensions for IMG failed",c)}try{let c=e.getAttribute("style")||"",u=window.getComputedStyle(e),p=v=>{let b=c.match(new RegExp(`${v}\\s*:\\s*([^;]+)`,"i")),w=b?b[1].trim():u.getPropertyValue(v);return/%|auto/i.test(String(w||""))},f=parseInt(a.dataset.snapdomWidth||"0",10),h=parseInt(a.dataset.snapdomHeight||"0",10),m=p("width")||!f,g=p("height")||!h;m&&f&&(a.style.width=`${f}px`),g&&h&&(a.style.height=`${h}px`);let y=u.getPropertyValue("object-fit"),x=u.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,x&&(a.style.objectPosition=x)):(f&&(a.style.minWidth=`${f}px`),h&&(a.style.minHeight=`${h}px`))}catch(c){j(t,"IMG dimension freeze failed",c)}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",e,c),c}let s=null;if(e instanceof HTMLTextAreaElement){let{width:c,height:u}=fe(e),p=c||e.getBoundingClientRect().width||0,f=u||e.getBoundingClientRect().height||0;p&&(a.style.width=`${p}px`),f&&(a.style.height=`${f}px`)}if(e instanceof HTMLInputElement){let c=(e.type||"text").toLowerCase();if((c==="checkbox"||c==="radio")&&ni()){let{el:u,applyVisual:p}=na(e);t.nodeMap.set(u,e),s=p,a=u}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let c=window.getComputedStyle(e,"::placeholder"),u=c&&c.color;if(u&&u!=="rgba(0, 0, 0, 0)"){let p="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(p);let f=document.createElement("style");f.textContent=`.${p}::placeholder{color:${u}!important;opacity:${c.opacity||"1"}!important;-webkit-text-fill-color:${u}!important;}`,a.prepend(f)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let c=e;c.min!==void 0&&c.min!==""&&a.setAttribute("min",c.min),c.max!==void 0&&c.max!==""&&a.setAttribute("max",c.max),c.pattern!==void 0&&c.pattern!==""&&a.setAttribute("pattern",c.pattern);let u=e.getAttribute("aria-invalid");u!==null&&a.setAttribute("aria-invalid",u)}if(Kt(e)||pe(e,a,t,r),s&&s(),e instanceof SVGElement&&!Kt(e)){let c=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let u=window.getComputedStyle(e);for(let p of c){let f=u.getPropertyValue(p);f&&a.style.setProperty(p,f)}}catch{}}if(e.shadowRoot){try{let v=e.shadowRoot.querySelectorAll("slot");for(let b of v){let w=b.assignedNodes?.()||[];for(let S of w)n.add(S)}}catch{}let c=zi(t),u=`[data-sd="${c}"]`;t.shadowScopes||(t.shadowScopes=new WeakMap),t.shadowScopes.set(e.shadowRoot,c);try{a.setAttribute("data-sd",c)}catch{}let p=Vi(e.shadowRoot),f=qi(p,u,c),h=Gi(p),m=Ki(e,h,u);Xi(a,m+f,c);let g=document.createDocumentFragment(),y=(v,b)=>{if(v.nodeType===Node.ELEMENT_NODE&&v.tagName==="STYLE")return b(null);wt(v,t,r).then(w=>{b(w||null)}).catch(()=>{b(null)})},x=await Bt(Array.from(e.shadowRoot.childNodes),y,r.fast);g.append(...x.filter(v=>!!v)),a.appendChild(g)}if(e.tagName==="SLOT"){let c=t.shadowScopes?.get(e.getRootNode()),u=e.assignedNodes?.()||[],p=u.length?e.assignedNodes?.({flatten:!0})||u:[],f=p.length?p:Array.from(e.childNodes),h=document.createDocumentFragment(),m=(y,x)=>{wt(y,t,r).then(v=>{v&&u.length&&Ji(v,c),x(v||null)}).catch(()=>{x(null)})},g=await Bt(Array.from(f),m,r.fast);return h.append(...g.filter(y=>!!y)),h}function l(c,u){if(n.has(c)||e.shadowRoot&&!c.assignedSlot)return u(null);wt(c,t,r).then(p=>{u(p||null)}).catch(()=>{u(null)})}let d=await Bt(Array.from(e.childNodes),l,r.fast);if(a.append(...d.filter(c=>!!c)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let c of a.options)c.value===o?c.setAttribute("selected",""):c.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}async function ua(e,t,r){let n=!1;try{n=!!(e.contentDocument||e.contentWindow?.document)}catch(o){j(t,"iframe same-origin probe failed",o)}if(n)try{return await ra(e,t,r)}catch(o){console.warn("[SnapDOM] iframe rasterization failed, fallback:",o)}if(n||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",e),r.placeholders){let{width:o,height:i}=fe(e),a=document.createElement("div");return a.style.cssText=`width:${o}px;height:${i}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,pe(e,a,t,r),a}else{let{width:o,height:i}=fe(e),a=document.createElement("div");return a.style.cssText=`display:inline-block;width:${o}px;height:${i}px;visibility:hidden;`,pe(e,a,t,r),a}}function pa(e){try{let t=Math.max(1,Math.min(32,e.width)),r=Math.max(1,Math.min(32,e.height)),n=document.createElement("canvas");n.width=t,n.height=r;let o=n.getContext("2d",{willReadFrequently:!0});if(!o)return!1;o.drawImage(e,0,0,t,r);let i=o.getImageData(0,0,t,r).data;for(let a=3;a<i.length;a+=4)if(i[a]!==0)return!1;return!0}catch{return!1}}async function fa(e,t,r){let n="";try{let s=e.getContext("2d",{willReadFrequently:!0});try{s&&s.getImageData(0,0,1,1)}catch{}if((we()||!s)&&await Me(),n=e.toDataURL("image/png"),!n||n==="data:,"){try{s&&s.getImageData(0,0,1,1)}catch{}if(await Me(),n=e.toDataURL("image/png"),!n||n==="data:,"){let l=document.createElement("canvas");l.width=e.width,l.height=e.height;let d=l.getContext("2d");d&&(d.drawImage(e,0,0),n=l.toDataURL("image/png"))}}}catch(s){j(t,"Canvas toDataURL failed, using empty/fallback",s)}r&&r.debug&&n&&pa(e)&&j(t,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",e);let o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch(s){j(t,"img decoding/loading hints failed",s)}n&&(o.src=n),o.width=e.width,o.height=e.height;let{width:i,height:a}=fe(e);return i>0&&(o.style.width=`${i}px`),a>0&&(o.style.height=`${a}px`),t.nodeMap.set(o,e),pe(e,o,t,r),o}async function ha(e,t,r){let n="";try{let s=document.createElement("canvas");s.width=e.videoWidth||e.offsetWidth||320,s.height=e.videoHeight||e.offsetHeight||240;let l=s.getContext("2d");l&&(l.drawImage(e,0,0,s.width,s.height),n=s.toDataURL("image/png"),(!n||n==="data:,")&&(n=""))}catch(s){j(t,"Video frame capture failed, using poster fallback",s)}let o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}n?o.src=n:e.poster&&(o.src=e.poster),o.width=e.videoWidth||e.offsetWidth||0,o.height=e.videoHeight||e.offsetHeight||0;let{width:i,height:a}=fe(e);return i>0&&(o.style.width=`${i}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",t.nodeMap.set(o,e),pe(e,o,t,r),o}async function ma(e,t,r){if(!e.controls)return;let{width:n,height:o}=fe(e),i=Math.round(n||e.offsetWidth||300),a=Math.round(o||e.offsetHeight||54),s=a/2,l=Math.max(4,a*.16),d=a*.34,c=i-a*.34,u=d+l+a*.55,p=Math.max(0,c-a*.7-u),f=Math.max(9,Math.round(a*.24)),h=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${a}" viewBox="0 0 ${i} ${a}"><rect width="${i}" height="${a}" rx="${Math.min(a/2,10)}" fill="#f1f3f4"/><path d="M ${d} ${s-l} L ${d+l} ${s} L ${d} ${s+l} Z" fill="#5f6368"/><rect x="${u}" y="${s-1.5}" width="${p}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${s}" r="${Math.max(3,a*.09)}" fill="#5f6368"/><text x="${c}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${f}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch{}return m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,m.width=i,m.height=a,m.style.width=`${i}px`,m.style.height=`${a}px`,t.nodeMap.set(m,e),pe(e,m,t,r),m}Lt("IFRAME",ua);Lt("CANVAS",fa);Lt("VIDEO",ha);Lt("AUDIO",ma);de();Nt();Rt();ne();ne();var ga=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Te=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),Xn=[],Zr=new Set;function ba(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ya(e){let t=Array.isArray(e)?e:[e];for(let r of t){let n;if(r instanceof RegExp)n=r;else if(typeof r=="string")n=new RegExp(ba(r),"i");else{console.warn("[snapdom] Ignored invalid iconFont value:",r);continue}let o=`${n.source}/${n.flags}`;Zr.has(o)||(Zr.add(o),Xn.push(n))}}function be(e){let t=typeof e=="string"?e:"",r=[...ga,...Xn];for(let n of r)if(n instanceof RegExp&&n.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function wa(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var en=new Map;function xa(e=""){let t=Object.create(null),r=String(e||""),n=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=n.exec(r);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function va(e,t,r){let n=String(e||""),o=n.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};let a=r&&(r.FILL??r.fill),s="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?s="rounded":/\bsharp\b/.test(i)?s="sharp":/\boutlined\b/.test(i)&&(s="outlined");let l=a===1,d=null;if(l&&(s==="outlined"&&Te.materialIconsFilled?d={url:Te.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&Te.materialIconsRound?d={url:Te.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&Te.materialIconsSharp&&(d={url:Te.materialIconsSharp,alias:"snapdom-mi-sharp"})),!d)return{familyForMeasure:n,familyForCanvas:n};if(!en.has(d.alias))try{let u=new FontFace(d.alias,`url(${d.url})`,{style:"normal",weight:"400"});document.fonts.add(u),await u.load(),en.set(d.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let c=`"${d.alias}"`;return{familyForMeasure:c,familyForCanvas:c}}async function Sa(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Ca(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!r&&t.toLowerCase()!=="currentcolor")return t;let n=e.color?.trim();return n&&n!=="inherit"?n:"#000"}async function ka(e,{family:t="Material Icons",weight:r="normal",fontSize:n=32,color:o="#000",variation:i="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,d=xa(i),{familyForMeasure:c,familyForCanvas:u}=await va(s,a,d);await Sa(u.replace(/^["']+|["']+$/g,""),n);let p=document.createElement("span");p.setAttribute("data-snapdom-internal",""),p.textContent=e,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=c,p.style.fontWeight=String(r||"normal"),p.style.fontSize=`${n}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=o,document.body.appendChild(p);let f=p.getBoundingClientRect(),h=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(p);let g=document.createElement("canvas");g.width=h*l,g.height=m*l;let y=g.getContext("2d");y.scale(l,l),y.font=`${r?`${r} `:""}${n}px ${u}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:g.toDataURL(),width:h,height:m}}async function Ma(e,t,r=k.session.nodeMap){if(e?.nodeType!==1)return 0;let n='.material-icons, [class*="material-symbols"]',o=Array.from(e.querySelectorAll(n)).filter(s=>s&&s.textContent&&s.textContent.trim());if(e.matches?.(n)&&e.textContent&&e.textContent.trim()&&o.unshift(e),o.length===0)return 0;let i=t?.nodeType===1?Array.from(t.querySelectorAll(n)).filter(s=>s&&s.textContent&&s.textContent.trim()):[];t?.nodeType===1&&t.matches?.(n)&&t.textContent&&t.textContent.trim()&&i.unshift(t);let a=0;for(let s=0;s<o.length;s++){let l=o[s],d=r&&r.get(l)||i[s]||null;try{let c=getComputedStyle(d||l),u=c.fontFamily||"Material Icons";if(!wa(u))continue;let p=(d||l).textContent.trim();if(!p)continue;let f=parseInt(c.fontSize,10)||24,h=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",m=Ca(c),g=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",y=(d||l).className||"",{dataUrl:x,width:v,height:b}=await ka(p,{family:u,weight:h,fontSize:f,color:m,variation:g,className:y});l.textContent="";let w=l.ownerDocument.createElement("img");w.src=x,w.alt=p,w.style.height=`${f}px`,w.style.width=`${Math.max(1,Math.round(v/b*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(w),a++}catch{}}return a}$e();Ae();async function Ea(e,t,r,n=32,o="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.setAttribute("data-snapdom-internal",""),a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=r||"normal",a.style.fontSize=`${n}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),l=Math.ceil(s.width),d=Math.ceil(s.height);document.body.removeChild(a);let c=document.createElement("canvas");c.width=Math.max(1,l*i),c.height=Math.max(1,d*i);let u=c.getContext("2d");return u.scale(i,i),u.font=r?`${r} ${n}px "${t}"`:`${n}px "${t}"`,u.textAlign="left",u.textBaseline="top",u.fillStyle=o,u.fillText(e,0,0),{dataUrl:c.toDataURL(),width:l,height:d}}var Yn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),$a=["katex","mathjax","mathml"];function br(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!Yn.has(r.toLowerCase()))return r}return""}function Aa(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(Yn.has(n.toLowerCase())||t.push(n))}return t}function xt(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let r=parseInt(t,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function vt(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Na(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Ra(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let o=xt(r[1]),i=xt(r[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let n=xt(t);return{min:n,max:n}}function Ta(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function La(e){let t=String(e||"100%").trim(),r=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let i=parseFloat(r[1]),a=parseFloat(r[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let n=t.match(/(\d+(?:\.\d+)?)\s*%/),o=n?parseFloat(n[1]):100;return{min:o,max:o}}function Pa(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Fa(e,t,r=[]){if(!e)return!1;try{let n=new URL(e,location.href);if(n.origin===location.origin)return!0;let o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(a=>o.endsWith(a))||r.some(a=>o===a.toLowerCase()||o.endsWith("."+a.toLowerCase())))return!0;let i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||$a.some(a=>i.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),l=a.toLowerCase().replace(/\s+/g,"-"),d=Pa(a);if(i.includes(s)||i.includes(l)||d&&i.includes(d))return!0}return!1}catch{return!1}}function Ia(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function tn(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(r,n,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return r;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var Zt=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,$t=4;async function Oa(e,t,r){if(!e)return e;let n=new Set;function o(s,l){try{return new URL(s,l||location.href).href}catch{return s}}async function i(s,l,d=0){if(d>$t)return console.warn(`[snapDOM] @import depth exceeded (${$t}) at ${l}`),s;let c="",u=0,p;for(;p=Zt.exec(s);){c+=s.slice(u,p.index),u=Zt.lastIndex;let f=(p[2]||p[4]||"").trim(),h=o(f,l);if(n.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}n.add(h);let m="";try{let g=await le(h,{as:"text",useProxy:r,silent:!0});g.ok&&typeof g.data=="string"&&(m=g.data)}catch{}m?(m=tn(m,h),m=await i(m,h,d+1),c+=`
|
|
6
6
|
/* inlined: ${h} */
|
|
7
7
|
${m}
|
|
8
|
-
`):c+=p[0]}return c+=s.slice(u),c}let a=en(e,t||location.href);return a=await i(a,t||location.href,0),a}var Yn=/url\((["']?)([^"')]+)\1\)/g,Oa=/@font-face[^{}]*\{[^}]*\}/g;function se(e,t,r=""){return(e.match(new RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||r).trim()}function Gn(e){if(!e)return[];let t=[],r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r){let o=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],s=l=>{if(!l.includes("?"))return parseInt(l,16);let d=parseInt(l.replace(/\?/g,"0"),16),c=parseInt(l.replace(/\?/g,"F"),16);return[d,c]};if(a){let l=s(i),d=s(a),c=Array.isArray(l)?l[0]:l,u=Array.isArray(d)?d[1]:d;t.push([Math.min(c,u),Math.max(c,u)])}else{let l=s(i);Array.isArray(l)?t.push([l[0],l[1]]):t.push([l,l])}}return t}function Qn(e,t){if(!t.length||!e||e.size===0)return!0;for(let r of e)for(let[n,o]of t)if(r>=n&&r<=o)return!0;return!1}function br(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(Yn)){let o=(n[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}r.push(o)}}return r}async function Zt(e,t,r=""){let n=e;for(let o of e.matchAll(Yn)){let i=cr(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!be(a)){if(k.resource?.has(a)){k.font?.add(a),n=n.replace(o[0],`url(${k.resource.get(a)})`);continue}try{let s=await le(a,{as:"dataURL",useProxy:r,silent:!0});if(s.ok&&typeof s.data=="string"){let l=s.data;k.resource?.set(a,l),k.font?.add(a),n=n.replace(o[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return n}function _a(e){if(!e.length)return null;let t=(a,s)=>e.some(([l,d])=>!(d<a||l>s)),r=t(0,255)||t(305,305),n=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":n?"latin-ext":r?"latin":null}function tn(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),r=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),n=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(r.size)for(let a of o.srcUrls)try{if(r.has(new URL(a).host.toLowerCase()))return!0}catch{}if(n.size){let a=_a(i);if(a&&n.has(a))return!0}return!1}}function Da(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let i of e.match(t)||[]){let a=se(i,"font-family"),s=gr(a),l=se(i,"font-weight","400"),d=se(i,"font-style","normal"),c=se(i,"font-stretch","100%"),u=se(i,"unicode-range"),p=se(i,"src"),f=br(p,location.href),h=f.length?f.map(g=>String(g).toLowerCase()).sort().join("|"):p.toLowerCase(),m=[String(s||"").toLowerCase(),l,d,c,u.toLowerCase(),h].join("|");r.has(m)||(r.add(m),n.push(i))}if(n.length===0)return e;let o=0;return e.replace(t,()=>n[o++]||"")}var rn=new WeakMap,Ha=0;function Wa(e){let t=rn.get(e);return t===void 0&&(t=Ha++,rn.set(e,t)),t}function Ba(e,t,r,n,o,i){let a=Array.from(e||[]).sort().join("|"),s=t?JSON.stringify({families:(t.families||[]).map(p=>String(p).toLowerCase()).sort(),domains:(t.domains||[]).map(p=>String(p).toLowerCase()).sort(),subsets:(t.subsets||[]).map(p=>String(p).toLowerCase()).sort()}):"",l=(r||[]).map(p=>`${(p.family||"").toLowerCase()}::${p.weight||"normal"}::${p.style||"normal"}::${p.src||""}`).sort().join("|"),d=n||"",c=(o||[]).map(p=>String(p).toLowerCase()).sort().join("|"),u=Wa(i||document);return`fonts-embed-css::req=${a}::ex=${s}::lf=${l}::px=${d}::fd=${c}::doc=${u}`}async function Kn(e,t,r,n){let o;try{o=e.cssRules||[]}catch{return}let i=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?i(a.href,t):t;if(n.depth>=$t){console.warn(`[snapDOM] CSSOM import depth exceeded (${$t}) at ${s}`);continue}if(s&&n.visitedSheets.has(s)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${s}`);continue}s&&n.visitedSheets.add(s);let l={...n,depth:(n.depth||0)+1};await Kn(a.styleSheet,s,r,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),l=gr(s);if(!l||be(l))continue;let d=(a.style.getPropertyValue("font-weight")||"").trim(),c=(a.style.getPropertyValue("font-style")||"").trim(),u=(a.style.getPropertyValue("font-stretch")||"").trim(),p=(a.style.getPropertyValue("font-variation-settings")||"").trim(),f=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim(),m=d||"400",g=c||"normal",y=u||"100%",x=(c?`font-style:${c};`:"")+(d?`font-weight:${d};`:"")+(u?`font-stretch:${u};`:"")+(p?`font-variation-settings:${p};`:"")+(h?`unicode-range:${h};`:""),v=n.faceMatchesRequired(l,g,m,y);if(!v&&!n.requiredIndex.has(l.toLowerCase()))continue;let b=Gn(h);if(!Qn(n.usedCodepoints,b))continue;let w={family:l,weightSpec:m,styleSpec:g,stretchSpec:y,unicodeRange:h,srcRaw:f,srcUrls:br(f,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(w,b))continue;if(!v){n.provisionalFaces.push({family:l.toLowerCase(),block:`@font-face{font-family:${l};src:${f};${x}}`,srcRaw:f,baseHref:t||location.href});continue}if(n.coveredFamilies.add(l.toLowerCase()),/url\(/i.test(f)){let S=await Zt(f,t||location.href,n.useProxy);await r(`@font-face{font-family:${l};src:${S};${x}}`)}else await r(`@font-face{font-family:${l};src:${f};${x}}`)}}}async function ja({required:e,usedCodepoints:t,exclude:r=void 0,localFonts:n=[],useProxy:o="",fontStylesheetDomains:i=[],doc:a=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let s=new Map;for(let b of e){let[w,S,M,C]=String(b).split("__");if(!w)continue;let E=w.toLowerCase(),$=s.get(E)||[];$.push({w:parseInt(S,10),s:M,st:parseInt(C,10)}),s.set(E,$)}function l(b,w,S,M){let C=String(b).toLowerCase();if(!s.has(C))return!1;let E=s.get(C),$=Na(S),N=Ra(w),L=Ta(M),_=$.min!==$.max,F=$.min,I=O=>N.kind==="normal"&&O==="normal"||N.kind!=="normal"&&(O==="italic"||O==="oblique"),T=!1;for(let O of E){let X=_?O.w>=$.min&&O.w<=$.max:O.w===F,U=I(vt(O.s)),V=O.st>=L.min&&O.st<=L.max;if(X&&U&&V){T=!0;break}}if(T)return!0;if(!_)for(let O of E){let X=I(vt(O.s)),U=O.st>=L.min&&O.st<=L.max;if(Math.abs(F-O.w)<=300&&X&&U)return!0}if(!_&&N.kind==="normal"&&E.some(O=>vt(O.s)!=="normal"))for(let O of E){let X=Math.abs(F-O.w)<=300,U=O.st>=L.min&&O.st<=L.max;if(X&&U)return!0}return!1}let d=tn(r),c=Ba(e,r,n,o,i,a);if(k.resource?.has(c))return k.resource.get(c);let u=Pa(e),p=[],f=Jt;for(let b of a.querySelectorAll("style")){let w=b.textContent||"";for(let S of w.matchAll(f)){let M=(S[2]||S[4]||"").trim();!M||be(M)||a.querySelector(`link[rel="stylesheet"][href="${M}"]`)||p.push(M)}}let h=[];p.length&&await Promise.all(p.map(b=>new Promise(w=>{if(a.querySelector(`link[rel="stylesheet"][href="${b}"]`))return w(null);let S=a.createElement("link");S.rel="stylesheet",S.href=b,S.setAttribute("data-snapdom","injected-import"),S.onload=()=>w(S),S.onerror=()=>w(null),a.head.appendChild(S),h.push(S)})));let m="",g=new Set,y=[],x=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(b=>!!b.href);for(let b of h)try{b.remove()}catch{}for(let b of x)try{if(be(b.href))continue;let w="",S=!1;try{S=new URL(b.href,location.href).origin===location.origin}catch{}if(!S){let C=Array.isArray(i)?i:[];if(!Fa(b.href,u,C))continue}if(S){let C=Array.from(a.styleSheets).find(E=>E.href===b.href);if(C)try{let E=C.cssRules||[];w=Array.from(E).map($=>$.cssText).join("")}catch{}}if(!w){let C=await le(b.href,{as:"text",useProxy:o});if(C?.ok&&typeof C.data=="string"&&(w=C.data),be(b.href))continue}w=await Ia(w,b.href,o);let M="";for(let C of w.match(Oa)||[]){let E=se(C,"font-family"),$=gr(E);if(!$||be($))continue;let N=se(C,"font-weight","400"),L=se(C,"font-style","normal"),_=se(C,"font-stretch","100%"),F=se(C,"unicode-range"),I=se(C,"src"),T=br(I,b.href),O=l($,L,N,_);if(!O&&!s.has($.toLowerCase()))continue;let X=Gn(F);if(!Qn(t,X))continue;let U={family:$,weightSpec:N,styleSpec:L,stretchSpec:_,unicodeRange:F,srcRaw:I,srcUrls:T,href:b.href};if(r&&d(U,X))continue;if(!O){y.push({family:$.toLowerCase(),block:C,srcRaw:I,baseHref:b.href});continue}g.add($.toLowerCase());let V=/url\(/i.test(I)?await Zt(C,b.href,o):C;M+=V}M.trim()&&(m+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",b.href)}let v={requiredIndex:s,usedCodepoints:t,faceMatchesRequired:l,coveredFamilies:g,provisionalFaces:y,simpleExcluder:r?tn(r):null,useProxy:o,visitedSheets:new Set,depth:0};for(let b of a.styleSheets)if(!(b.href&&x.some(w=>w.href===b.href)))try{let w=b.href||location.origin+"/";w&&v.visitedSheets.add(w),await Kn(b,w,async S=>{m+=S},v)}catch{}for(let b of y)g.has(b.family)||(m+=/url\(/i.test(b.srcRaw)?await Zt(b.block,b.baseHref,o):b.block);try{for(let b of a.fonts||[]){if(!b||!b.family||b.status!=="loaded"||!b._snapdomSrc)continue;let w=String(b.family).replace(/^['"]+|['"]+$/g,"");if(be(w)||!s.has(w.toLowerCase())||r?.families&&r.families.some(M=>String(M).toLowerCase()===w.toLowerCase()))continue;let S=b._snapdomSrc;if(!String(S).startsWith("data:")){if(k.resource?.has(b._snapdomSrc))S=k.resource.get(b._snapdomSrc),k.font?.add(b._snapdomSrc);else if(!k.font?.has(b._snapdomSrc))try{let M=await le(b._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(M.ok&&typeof M.data=="string")S=M.data,k.resource?.set(b._snapdomSrc,S),k.font?.add(b._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",b._snapdomSrc);continue}}m+=`@font-face{font-family:'${w}';src:url(${S});font-style:${b.style||"normal"};font-weight:${b.weight||"normal"};}`}}catch{}for(let b of n){if(!b||typeof b!="object")continue;let w=String(b.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||be(w)||!s.has(w.toLowerCase())||r?.families&&r.families.some(N=>String(N).toLowerCase()===w.toLowerCase()))continue;let S=b.weight!=null?String(b.weight):"normal",M=b.style!=null?String(b.style):"normal",C=b.stretchPct!=null?`${b.stretchPct}%`:"100%",E=String(b.src||""),$=E;if(!$.startsWith("data:")){if(k.resource?.has(E))$=k.resource.get(E),k.font?.add(E);else if(!k.font?.has(E))try{let N=await le(E,{as:"dataURL",useProxy:o,silent:!0});if(N.ok&&typeof N.data=="string")$=N.data,k.resource?.set(E,$),k.font?.add(E);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",E);continue}}m+=`@font-face{font-family:'${w}';src:url(${$});font-style:${M};font-weight:${S};font-stretch:${C};}`}return m&&(m=Da(m),k.resource?.set(c,m)),m}function Jn(e,t){let r=new Set,n=new Set;if(!e)return{required:r,usedCodepoints:n};let o=l=>{if(l)for(let d of l)n.add(d.codePointAt(0))},i=l=>{let d=$a(l.fontFamily);if(d.length)for(let c of d)r.add(`${c}__${xt(l.fontWeight)}__${vt(l.fontStyle)}__${Aa(l.fontStretch)}`)},a=l=>{i(B(l));for(let d of["::before","::after"]){let c=B(l,d),u=c&&c.content;if(!(!u||u==="none"||u==="normal"))if(i(c),/^["']/.test(u))o(u.slice(1,-1));else{let p=u.match(/\\[0-9A-Fa-f]{1,6}/g);if(p)for(let f of p)try{n.add(parseInt(f.slice(1),16))}catch{}}}};a(e);let s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let l=s.currentNode;if(l.nodeType===Node.TEXT_NODE){if(t&&l.parentElement&&!t(l.parentElement))continue;o(l.nodeValue||"")}else{if(t&&!t(l))continue;a(l)}}return{required:r,usedCodepoints:n}}function Ua(e,t){return Jn(e,t).required}async function Zn(e,t=2,r=document){try{await r.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let i=r.createElement("div");i.setAttribute("data-snapdom-internal",""),i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let a of n){let s=r.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${a}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",i.appendChild(s)}r.body.appendChild(i),i.offsetWidth,r.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)o(),await Me(),await Me()}function qa(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function nn(e,t=!1){let r="",n=Math.max(1,e);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return t?r.toUpperCase():r}function on(e,t=!0){let r=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of r)for(;n>=i;)o+=a,n-=i;return t?o:o.toLowerCase()}function an(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let r=Math.abs(e);return(e<0?"-":"")+(r<10?"0":"")+String(r)}case"lower-alpha":return nn(e,!1);case"upper-alpha":return nn(e,!0);case"lower-roman":return on(e,!1);case"upper-roman":return on(e,!0);default:return String(e)}}function za(e){let t=new WeakMap,r=e instanceof Document?e.documentElement:e,n=d=>d&&d.tagName==="LI",o=d=>{let c=0,u=d?.parentElement;if(!u)return 0;for(let p of u.children){if(p===d)break;p.tagName==="LI"&&c++}return c},i=d=>{let c=new Map;for(let[u,p]of d)c.set(u,p.slice());return c},a=(d,c,u)=>{let p=i(d),f;try{f=u.style?.counterReset||getComputedStyle(u).counterReset}catch{}if(f&&f!=="none")for(let g of f.split(",")){let y=g.trim().split(/\s+/),x=y[0],v=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!x)continue;let b=c.get(x);if(b&&b.length){let w=b.slice();w.push(v),p.set(x,w)}else p.set(x,[v])}let h;try{h=u.style?.counterSet||getComputedStyle(u).counterSet}catch{}if(h&&h!=="none")for(let g of h.split(",")){let y=g.trim().split(/\s+/),x=y[0],v=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!x)continue;let b=p.get(x)||[];b.length===0&&b.push(0),b[b.length-1]=v,p.set(x,b)}let m;try{m=u.style?.counterIncrement||getComputedStyle(u).counterIncrement}catch{}if(m&&m!=="none")for(let g of m.split(",")){let y=g.trim().split(/\s+/),x=y[0],v=Number.isFinite(Number(y[1]))?Number(y[1]):1;if(!x)continue;let b=p.get(x)||[];b.length===0&&b.push(0),b[b.length-1]+=v,p.set(x,b)}try{if(getComputedStyle(u).display==="list-item"&&n(u)){let g=u.parentElement,y=1;if(g&&g.tagName==="OL"){let v=g.getAttribute("start"),b=Number.isFinite(Number(v))?Number(v):1,w=o(u),S=u.getAttribute("value");y=Number.isFinite(Number(S))?Number(S):b+w}else y=1+o(u);let x=p.get("list-item")||[];x.length===0&&x.push(0),x[x.length-1]=y,p.set("list-item",x)}}catch{}return p},s=(d,c,u)=>{let p=a(u,c,d);t.set(d,p);let f=p;for(let m of d.children)f=s(m,p,f);let h=new Map;for(let[m,g]of u){let y=g.length,x=f.get(m);h.set(m,x&&x.length?x.slice(0,y):g.slice())}for(let[m,g]of f)!h.has(m)&&g.length&&!c.has(m)&&h.set(m,g.slice(0,1));return h},l=new Map;return s(r,l,l),{get(d,c){let u=t.get(d)?.get(c);return u&&u.length?u[u.length-1]:0},getStack(d,c){let u=t.get(d)?.get(c);return u?u.slice():[]}}}function Va(e,t,r){if(!e||e==="none")return e;try{let n=/\b(counter|counters)\s*\(([^)]+)\)/g;return e.replace(n,(o,i,a)=>{let s=String(a).split(",").map(l=>l.trim());if(i==="counter"){let l=s[0]?.replace(/^["']|["']$/g,""),d=(s[1]||"decimal").toLowerCase(),c=r.get(t,l);return an(c,d)}else{let l=s[0]?.replace(/^["']|["']$/g,""),d=s[1]?.replace(/^["']|["']$/g,"")??"",c=(s[2]||"decimal").toLowerCase(),u=r.getStack(t,l);return u.length?u.map(p=>an(p,c)).join(d):""}})}catch{return"- "}}$e();var Le=new WeakMap,sn=1e3;function Xa(e,t){let r=eo(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=cn(e,r),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):cn(e,r)}function er(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function eo(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${t.length}|`,n=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;r+=`S${s}|`;let l=a.sheet,d=l?er(l):null;d&&(n+=d.length)}else{let s=a.getAttribute("href")||"",l=a.getAttribute("media")||"all";r+=`L${s}|m:${l}|`;let d=a.sheet,c=d?er(d):null;c&&(n+=c.length)}}let o=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(o)?o.length:0}|tr:${n}`,r}function ln(e,t,r){let n=er(e);if(!n)return!1;for(let o=0;o<n.length;o++){if(r.budget<=0)return!1;let i=n[o],a=i&&i.cssText?i.cssText:"";r.budget--;for(let s of t)if(a.includes(s))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let s=0;s<i.cssRules.length&&r.budget>0;s++){let l=i.cssRules[s],d=l&&l.cssText?l.cssText:"";r.budget--;for(let c of t)if(d.includes(c))return!0}if(r.budget<=0)return!1}return!1}function cn(e=document,t=eo(e)){let r=Le.get(e);if(r&&r.fingerprint===t)return r.result;let n=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a<o.length;a++){let s=o[a].textContent||"";for(let l of n)if(s.includes(l))return Le.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:sn};try{for(let s of i)if(ln(s,n,a))return Le.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:sn};for(let l=0;l<a.length&&s.budget>0;l++){let d=a[l],c=null;if(d.tagName,c=d.sheet||null,c&&ln(c,n,s))return Le.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(e,{fingerprint:t,result:!0}),!0):(Le.set(e,{fingerprint:t,result:!1}),!1)}function dn(e){for(let t of["Top","Right","Bottom","Left"]){let r=parseFloat(e[`border${t}Width`])||0,n=e[`border${t}Style`];if(r>0&&n&&n!=="none"&&n!=="hidden")return!0}return!1}function Ya(e,t){let r=null,n=()=>{if(!r)try{r=za(e)}catch(o){j(t,"buildCounterContext failed",o),r={get:()=>0,getStack:()=>[]}}return r};return{get(o,i){return n().get(o,i)},getStack(o,i){return n().getStack(o,i)}}}function Ga(e){let t=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==='"')t=!t;else if(n==="/"&&!t)return e.slice(0,r).trim()}return e}function Qa(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n=0,o;for(;o=r.exec(e);){let a=e.slice(n,o.index).trim();a&&t.push(a),t.push(o[1]),n=r.lastIndex}let i=e.slice(n).trim();return i&&t.push(i),t.join("")}function tr(e,t,r){let n=e.parentElement,o=n&&r?r.get(n):null;return o?{get(i,a){let s=t.get(i,a),l=o.get(a);return typeof l=="number"?Math.max(s,l):s},getStack(i,a){let s=t.getStack(i,a);if(!s.length)return s;let l=o.get(a);if(typeof l=="number"){let d=s.slice();return d[d.length-1]=Math.max(d[d.length-1],l),d}return s}}:t}function rr(e,t,r){let n=new Map;function o(d){let c=[];if(!d||d==="none")return c;for(let u of String(d).split(",")){let p=u.trim().split(/\s+/),f=p[0],h=Number.isFinite(Number(p[1]))?Number(p[1]):void 0;f&&c.push({name:f,num:h})}return c}let i=o(t?.counterReset),a=o(t?.counterSet),s=o(t?.counterIncrement);function l(d){if(n.has(d))return n.get(d).slice();let c=r.getStack(e,d);c=c.length?c.slice():[];let u=i.find(h=>h.name===d);if(u){let h=Number.isFinite(u.num)?u.num:0;c=c.length?[...c,h]:[h]}let p=a.find(h=>h.name===d);if(p){let h=Number.isFinite(p.num)?p.num:0;c.length===0&&(c=[0]),c[c.length-1]=h}let f=s.find(h=>h.name===d);if(f){let h=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=h}return n.set(d,c.slice()),c}return{get(d,c){let u=l(c);return u.length?u[u.length-1]:0},getStack(d,c){return l(c)},__incs:s}}function Ka(e,t,r,n){let o;try{o=B(e,t)}catch{}let i=o?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};i=Ga(i);let a=tr(e,r,n),s=rr(e,o,a),l=qa(i)?Va(i,e,s):i;return{text:Qa(l),incs:s.__incs||[]}}async function nr(e,t,r,n){if(e?.nodeType!==1||t?.nodeType!==1||e.tagName==="TEXTAREA")return;let o=e.ownerDocument||document;if(!Xa(o,r))return;r.__siblingCounters||(r.__siblingCounters=new WeakMap),r.__counterCtx||(r.__counterCtx=Ya(e.ownerDocument||document,r));let i=r.__counterCtx;for(let s of["::before","::after","::first-letter"])try{let l=B(e,s);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&!dn(l)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(s==="::first-letter"){let P=B(e),W=(P?.display||"").toLowerCase();if(W.includes("flex")||W.includes("grid"))continue;let D=ee=>l[ee]!==P[ee]&&(parseFloat(l[ee])||0)!==0;if(!(l.color!==P.color||l.fontSize!==P.fontSize||l.fontWeight!==P.fontWeight||l.fontFamily!==P.fontFamily||l.fontStyle!==P.fontStyle||l.textTransform!==P.textTransform||l.float!==P.float&&l.float!=="none"||D("paddingTop")||D("paddingRight")||D("paddingBottom")||D("paddingLeft")||D("marginTop")||D("marginRight")||D("marginBottom")||D("marginLeft")))continue;let q=Array.from(t.childNodes).find(ee=>ee.nodeType===Node.TEXT_NODE&&ee.textContent?.trim().length>0);if(!q)continue;let ce=q.textContent,Q=ce.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],te=ce.slice(Q?.length||0);if(!Q||/[\uD800-\uDFFF]/.test(Q))continue;let oe=document.createElement("span");oe.textContent=Q,oe.dataset.snapdomPseudo="::first-letter";let J=Dr(l),he=zt(J,"span");r.styleMap.set(oe,he);let Ce=document.createTextNode(te);t.replaceChild(Ce,q),t.insertBefore(oe,Ce);continue}let d=l.content??"",c=d===""||d==="none"||d==="normal",{text:u,incs:p}=Ka(e,s,i,r.__siblingCounters),f=l.backgroundImage,h=l.backgroundColor,m=l.fontFamily,g=parseInt(l.fontSize)||32,y=parseInt(l.fontWeight)||!1,x=l.color||"#000",v=l.transform,b=be(m),w=!c&&u!=="",S=f&&f!=="none",M=h&&h!=="transparent"&&h!=="rgba(0, 0, 0, 0)",C=dn(l),E=v&&v!=="none",$=d!=="none"&&d!=="normal",N=$&&((parseFloat(l.width)||0)>0||(parseFloat(l.height)||0)>0),L=$&&l.boxShadow&&l.boxShadow!=="none",_=$&&l.outlineStyle&&l.outlineStyle!=="none"&&(parseFloat(l.outlineWidth)||0)>0;if(!(w||S||M||C||E||N||L||_)){if(p&&p.length&&e.parentElement){let P=r.__siblingCounters.get(e.parentElement)||new Map;for(let{name:W}of p){if(!W)continue;let D=tr(e,i,r.__siblingCounters),q=rr(e,B(e,s),D).get(e,W);P.set(W,q)}r.__siblingCounters.set(e.parentElement,P)}continue}let F=u.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(u),I=!1;if(w&&!b&&u.length>1&&!F){let P=B(e),W=parseFloat(P.fontSize)||16,D=parseFloat(P.lineHeight);Number.isFinite(D)||(D=W*1.5),e.getBoundingClientRect().height<D*1.6&&(t.style.whiteSpace="nowrap",I=!0)}let T=document.createElement("span");T.dataset.snapdomPseudo=s,T.style.pointerEvents="none",I&&(T.style.whiteSpace="nowrap");let O=Dr(l),X=(B(e).display||"").toLowerCase(),U=X.includes("flex")||X.includes("grid");if(U){let P=O["min-width"];(!P||P==="auto"||P==="0px")&&(O["min-width"]="0px")}let V=zt(O,"span",w,U);if(r.styleMap.set(T,V),b&&u&&u.length===1){let{dataUrl:P,width:W,height:D}=await Ma(u,m,y,g,x),q=document.createElement("img");q.src=P,q.style=`height:${g}px;width:${W/D*g}px;object-fit:contain;`,T.appendChild(q),t.dataset.snapdomHasIcon="true"}else if(u&&F){let P=bn(u,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??cr(u);if(P?.trim())try{let W=await le(Ct(P),{as:"dataURL",useProxy:n.useProxy});if(W?.ok&&typeof W.data=="string"){let D=document.createElement("img");D.src=W.data,D.style=`width:${g}px;height:auto;object-fit:contain;`,T.appendChild(D)}}catch(W){console.error(`[snapdom] Error in pseudo ${s} for`,e,W)}}else!b&&w&&(T.textContent=u);T.style.backgroundImage="none","maskImage"in T.style&&(T.style.maskImage="none"),"webkitMaskImage"in T.style&&(T.style.webkitMaskImage="none");try{T.style.backgroundRepeat=l.backgroundRepeat,T.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(T.style.backgroundPositionX=l.backgroundPositionX,T.style.backgroundPositionY=l.backgroundPositionY):T.style.backgroundPosition=l.backgroundPosition,T.style.backgroundOrigin=l.backgroundOrigin,T.style.backgroundClip=l.backgroundClip,T.style.backgroundAttachment=l.backgroundAttachment,T.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(S)try{let P=Vt(f),W=await Promise.all(P.map(wn));T.style.backgroundImage=W.join(", ")}catch(P){console.warn(`[snapdom] Failed to inline background-image for ${s}`,P)}M&&(T.style.backgroundColor=h);let K=T.childNodes.length>0||T.textContent?.trim()!==""||S||M||C||E||N||L||_;if(p&&p.length&&e.parentElement){let P=r.__siblingCounters.get(e.parentElement)||new Map,W=tr(e,i,r.__siblingCounters),D=rr(e,B(e,s),W);for(let{name:q}of p){if(!q)continue;let ce=D.get(e,q);P.set(q,ce)}r.__siblingCounters.set(e.parentElement,P)}if(!K)continue;s==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(T,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(T))}catch(l){console.warn(`[snapdom] Failed to capture ${s} for`,e,l)}let a=Array.from(t.children).filter(s=>!s.dataset.snapdomPseudo);if(r.nodeMap)for(let s of a){let l=r.nodeMap.get(s);l?.nodeType===1&&await nr(l,s,r,n)}else{let s=Array.from(e.children);for(let l=0;l<Math.min(s.length,a.length);l++)await nr(s[l],a[l],r,n)}}function Ja(e,t){if(!e||e?.nodeType!==1)return;let r=e.ownerDocument||document,n=t||r,o=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(o.length===0)return;let i=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",d=b=>{if(!b||!b.getAttribute)return null;let w=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(l,"href"):null);if(w)return w;let S=b.attributes;if(!S)return null;for(let M=0;M<S.length;M++){let C=S[M];if(!C||!C.name)continue;if(C.name==="href")return C.value;let E=C.name.indexOf(":");if(E!==-1&&C.name.slice(E+1)==="href")return C.value}return null},c=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),u=new Set,p=!1,f=(b,w=null)=>{if(!b)return;i.lastIndex=0;let S;for(;S=i.exec(b);){p=!0;let M=(S[1]||"").trim();M&&(c.has(M)||(u.add(M),w&&!w.has(M)&&w.add(M)))}},h=b=>{let w=b.querySelectorAll("use");for(let C of w){let E=d(C);if(!E||!E.startsWith("#"))continue;p=!0;let $=E.slice(1).trim();$&&!c.has($)&&u.add($)}let S='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';f(b.getAttribute("style")||"");for(let C of a)f(b.getAttribute(C));let M=b.querySelectorAll(S);for(let C of M){f(C.getAttribute("style")||"");for(let E of a)f(C.getAttribute(E))}};for(let b of o)h(b);if(!p)return;let m=e.querySelector("svg.inline-defs-container");m||(m=r.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(m,e.firstChild||null));let g=m.querySelector("defs")||null,y=b=>{if(!b||c.has(b))return null;let w=s(b),S=M=>{let C=n.querySelector(M);return C&&!e.contains(C)?C:null};return S(`svg defs > *#${w}`)||S(`svg > symbol#${w}`)||S(`*#${w}`)};if(!u.size)return;let x=new Set(u),v=new Set;for(;x.size;){let b=x.values().next().value;if(x.delete(b),!b||c.has(b)||v.has(b))continue;let w=y(b);if(!w){v.add(b);continue}g||(g=r.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(g));let S=w.cloneNode(!0);S.id||S.setAttribute("id",b),g.appendChild(S),v.add(b),c.add(b);let M=[S,...S.querySelectorAll("*")];for(let C of M){let E=d(C);if(E&&E.startsWith("#")){let N=E.slice(1).trim();N&&!c.has(N)&&!v.has(N)&&x.add(N)}let $=C.getAttribute?.("style")||"";$&&f($,x);for(let N of a){let L=C.getAttribute?.(N);L&&f(L,x)}}}}ne();function Za(e){let t=getComputedStyle(e),r=t.outlineStyle,n=t.outlineWidth,o=t.borderStyle,i=t.borderWidth,a=r!=="none"&&parseFloat(n)>0,s=o==="none"||parseFloat(i)===0;if(a&&s){let l=e.style.border;return e.style.border=`${n} solid transparent`,()=>{e.style.border=l}}return()=>{}}function es(e){let t=[];try{let r=e.querySelectorAll("*");for(let n of r){if(!(n instanceof HTMLElement))continue;let o=n.style.contentVisibility||"",i=getComputedStyle(n);(i.contentVisibility||i.getPropertyValue("content-visibility")||"")==="auto"&&(t.push({el:n,original:o}),n.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e);(n.contentVisibility||n.getPropertyValue("content-visibility")||"")==="auto"&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:r,original:n}of t)try{r.style.contentVisibility=n}catch{}}}de();Rt();function ts(e){return to(e.boxShadow)}function rs(e){return to(e.textShadow)}function to(e){if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let t=[],r="",n=0;for(let l=0;l<e.length;l++){let d=e[l];d==="("?n++:d===")"&&(n=Math.max(0,n-1)),d===","&&n===0?(t.push(r),r=""):r+=d}r.trim()&&t.push(r);let o=0,i=0,a=0,s=0;for(let l of t){if(/\binset\b/i.test(l))continue;let d=l.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(d.length<2)continue;let[c,u,p=0,f=0]=d,h=Math.abs(c)+p+f,m=Math.abs(u)+p+f;i=Math.max(i,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),a=Math.max(a,m+Math.max(u,0)),o=Math.max(o,m+Math.max(-u,0))}return{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(a),left:Math.ceil(s)}}function ns(e){let t=e.filter&&e.filter!=="none"?e.filter:e.webkitFilter||"",r=/blur\(\s*([0-9.]+)px\s*\)/gi,n=0,o;for(;o=r.exec(t);)n+=parseFloat(o[1])||0;let i=Math.ceil(n);return{top:i,right:i,bottom:i,left:i}}function os(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),r=parseFloat(e.outlineOffset||"0")||0,n=t+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}function is(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,o=0,i=0,a=0,s=!1;for(let l of r){s=!0;let d=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(m=>parseFloat(m))||[],[c=0,u=0,p=0]=d,f=Math.abs(c)+p,h=Math.abs(u)+p;o=Math.max(o,f+Math.max(c,0)),a=Math.max(a,f+Math.max(-c,0)),i=Math.max(i,h+Math.max(u,0)),n=Math.max(n,h+Math.max(-u,0))}return{bleed:{top:A(n),right:A(o),bottom:A(i),left:A(a)},has:s}}function as(e,t){if(!e||!t||!t.style)return null;let r=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let n=r.transform||"none";if(!n||n==="none"){let s=null;try{s=At(e).scale}catch{}try{t.style.transform="none"}catch{}if(!s)return{a:1,b:0,c:0,d:1};let l=s.trim().split(/\s+/).map(parseFloat),d=Number.isFinite(l[0])?l[0]:1,c=Number.isFinite(l[1])?l[1]:d;return{a:d,b:0,c:0,d:c}}function o(s,l,d,c){let u=Math.sqrt(s*s+l*l)||0,p=0,f=0;if(u>0){let h=s/u,m=l/u;p=h*d+m*c;let g=d-h*p,y=c-m*p;f=Math.sqrt(g*g+y*y)||0,f>0?p=p/f:p=0}return{a:u,b:0,c:p*f,d:f}}let i=n.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let s=i[1].split(",").map(l=>parseFloat(l.trim()));if(s.length===6&&s.every(Number.isFinite)){let[l,d,c,u]=s,p=o(l,d,c,u);try{t.style.transform=`matrix(${p.a}, ${p.b}, ${p.c}, ${p.d}, 0, 0)`}catch{}return p}}let a=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let s=a[1].split(",").map(l=>parseFloat(l.trim()));if(s.length===16&&s.every(Number.isFinite)){let l=s[0],d=s[1],c=s[4],u=s[5],p=o(l,d,c,u);try{t.style.transform=`matrix(${p.a}, ${p.b}, ${p.c}, ${p.d}, 0, 0)`}catch{}return p}}try{let s=new DOMMatrix(n),l=o(s.a,s.b,s.c,s.d);try{t.style.transform=`matrix(${l.a}, ${l.b}, ${l.c}, ${l.d}, 0, 0)`}catch{}return l}catch{return null}}function St(e,t,r,n,o){let i=r.a,a=r.b,s=r.c,l=r.d,d=r.e||0,c=r.f||0;function u(y,x){let v=y-n,b=x-o,w=i*v+s*b,S=a*v+l*b;return w+=n+d,S+=o+c,[w,S]}let p=[u(0,0),u(e,0),u(0,t),u(e,t)],f=1/0,h=1/0,m=-1/0,g=-1/0;for(let[y,x]of p)y<f&&(f=y),x<h&&(h=x),y>m&&(m=y),x>g&&(g=x);return{minX:f,minY:h,maxX:m,maxY:g,width:m-f,height:g-h}}function or(e,t,r){let n=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[n[0]||"0",n[1]||"0"],a=(s,l)=>{let d=s.toLowerCase();return d==="left"||d==="top"?0:d==="center"?l/2:d==="right"||d==="bottom"?l:d.endsWith("px")?parseFloat(d)||0:d.endsWith("%")?(parseFloat(d)||0)*l/100:/^-?\d+(\.\d+)?$/.test(d)&&parseFloat(d)||0};return{ox:a(o,t),oy:a(i,r)}}function At(e){let t={rotate:"0deg",scale:null,translate:null},r=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(r){let o=l=>{try{return typeof r.has=="function"&&!r.has(l)||typeof r.get!="function"?null:r.get(l)}catch{return null}},i=o("rotate");if(i)if(i.angle){let l=i.angle;t.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let l=getComputedStyle(e);t.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=o("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,d="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;t.scale=`${l} ${d}`}else{let l=getComputedStyle(e);t.scale=l.scale&&l.scale!=="none"?l.scale:null}let s=o("translate");if(s){let l="x"in s&&"value"in s.x?s.x.value:Array.isArray(s)?s[0]?.value:0,d="y"in s&&"value"in s.y?s.y.value:Array.isArray(s)?s[1]?.value:0,c="x"in s&&s.x?.unit?s.x.unit:"px",u="y"in s&&s.y?.unit?s.y.unit:"px";t.translate=`${l}${c} ${d}${u}`}else{let l=getComputedStyle(e);t.translate=l.translate&&l.translate!=="none"?l.translate:null}return t}let n=getComputedStyle(e);return t.rotate=n.rotate&&n.rotate!=="none"?n.rotate:"0deg",t.scale=n.scale&&n.scale!=="none"?n.scale:null,t.translate=n.translate&&n.translate!=="none"?n.translate:null,t}var jt=null;function ss(){if(jt)return jt;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),jt=e,e}function ls(e){let t=ss(),r=document.createElement("div");r.style.transformOrigin="0 0",e.baseTransform&&(r.style.transform=e.baseTransform),e.rotate&&(r.style.rotate=e.rotate),e.scale&&(r.style.scale=e.scale),e.translate&&(r.style.translate=e.translate),t.appendChild(r);let n=ds(r);return t.removeChild(r),n}function cs(e){let t=B(e),r=t.transform||"none";if(r!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(n||o||i)}function ds(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}var ir="http://www.w3.org/1999/xhtml",ro=new WeakSet;function no(e,t){if(!t)return null;let r=e.ownerDocument||document,n=r.defaultView||window,o,i,a,s;if(t==="viewport")o=0,i=0,a=r.documentElement?.clientWidth||n.innerWidth,s=r.documentElement?.clientHeight||n.innerHeight;else if(typeof t=="object")o=(Number(t.x)||0)-(n.scrollX||0),i=(Number(t.y)||0)-(n.scrollY||0),a=Number(t.width),s=Number(t.height);else return null;return a>0&&s>0?{left:o,top:i,width:a,height:s,right:o+a,bottom:i+s}:null}function ar(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return t instanceof ShadowRoot?t.host:null}function us(e,t){for(let r=t;r;r=ar(r))if(r===e)return!0;return!1}function ps(e,t){for(let r=ar(e);r&&r!==t&&r?.nodeType===1;r=ar(r)){let n=B(r);if(n.position!=="static"||n.transform&&n.transform!=="none"||n.filter&&n.filter!=="none"||n.backdropFilter&&n.backdropFilter!=="none"||n.perspective&&n.perspective!=="none"||/transform|perspective|filter/.test(n.willChange||"")||/layout|paint|strict|content/.test(n.contain||""))return r}return null}function oo(e,t){try{let r=new DOMMatrix;if(t&&t.rotate&&t.rotate!=="0deg"&&(r=r.multiply(new DOMMatrix(`rotate(${t.rotate})`))),t&&t.scale){let n=String(t.scale).trim().split(/\s+/).filter(Boolean);n.length&&n.every(o=>Number.isFinite(Number(o)))&&(r=r.multiply(new DOMMatrix(`scale(${n.join(",")})`)))}return e&&(r=r.multiply(new DOMMatrix(e))),r}catch{return null}}function fs(e,t,r,n,o){let i=e.getBoundingClientRect();t?.nodeType===1&&t.namespaceURI===ir&&B(e).position==="static"&&(t.style.position="relative");let a=[];for(let[s,l]of r){if(s?.nodeType!==1||s.namespaceURI!==ir||l?.nodeType!==1||l===e||!us(e,l))continue;let d=n.get(l)||B(l),c=d.position;if(c!=="fixed"&&c!=="sticky"&&c!=="-webkit-sticky"||s.style.position==="absolute")continue;let u=l.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;ro.add(s);let p=d.transform&&d.transform!=="none"?d.transform:"",f=At(l),h=!!(p||f.rotate!=="0deg"||f.scale||f.translate),m=h?oo(p,f):null,g=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,y=u.width,x=u.height;g||(y=l.offsetWidth||u.width,x=l.offsetHeight||u.height);let v=l.getRootNode&&l.getRootNode()instanceof ShadowRoot,b=i,w=e.clientLeft||0,S=e.clientTop||0;if(v){let N=ps(l,e);N&&(b=N.getBoundingClientRect(),w=N.clientLeft||0,S=N.clientTop||0)}let M=u.left-b.left-w,C=u.top-b.top-S;if(h)if(s.style.translate="none",s.style.rotate="none",s.style.scale="none",g)s.style.transform="none";else{s.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:N,oy:L}=or(d,y,x),_=St(y,x,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},N,L);M-=_.minX,C-=_.minY}if(c!=="fixed"){let N=s.cloneNode(!1);N.setAttribute("data-snap-ph","1"),N.style.position="static",N.style.visibility="hidden",N.style.width=`${y}px`,N.style.height=`${x}px`,N.style.boxSizing="border-box",s.parentElement?.insertBefore(N,s)}let E=y+2,$=x;o&&(Math.abs(C-o.y)<.5&&(C-=1,$+=1),Math.abs(M-o.x)<.5&&(M-=1,E+=1)),s.style.position="absolute",s.style.left=`${M}px`,s.style.top=`${C}px`,s.style.right="auto",s.style.bottom="auto",s.style.margin="0",s.style.width=`${E}px`,s.style.height=`${$}px`,s.style.boxSizing="border-box",v||a.push(s)}for(let s of a)t.appendChild(s)}function hs(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){j(r,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){j(r,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){j(r,"stripRootShadows outline",i)}let o=(n.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=o.length?o:"none"}catch(i){j(r,"stripRootShadows filter",i)}}function ms(e,t){if(!e||!t||!t.style)return;let r=1;try{r=parseFloat(getComputedStyle(e).zoom)}catch{return}if(!(!t.style.getPropertyValue("zoom")&&(!Number.isFinite(r)||r===1)))try{t.style.setProperty("zoom","1","important")}catch{}}function un(e){let t=e.display||"";if(t.includes("flex")||t.includes("grid")||t.startsWith("table")||t==="inline-block"||t==="flow-root"||e.position==="absolute"||e.position==="fixed"||e.float&&e.float!=="none")return!0;let r=e.overflowX||e.overflow||"visible",n=e.overflowY||e.overflow||"visible";return!!(r!=="visible"||n!=="visible"||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function gs(e,t){let r=Array.from(e.childNodes),n=t==="top"?r:r.reverse();for(let o of n){if(o.nodeType===Node.TEXT_NODE){if(/\S/.test(o.textContent||""))return null;continue}if(o.nodeType!==Node.ELEMENT_NODE)continue;let i=getComputedStyle(o),a=String(i.display||"");if(!(a==="none"||a==="contents")&&!(i.position==="absolute"||i.position==="fixed"))return i.float&&i.float!=="none"||a.startsWith("inline")?null:o}return null}function bs(e,t,r){if(!e||!t||!t.style)return;let n=getComputedStyle(e);if(!un(n))for(let o of["top","bottom"]){let i=o==="top"?"Top":"Bottom";if((parseFloat(n[`border${i}Width`])||0)>0||(parseFloat(n[`padding${i}`])||0)>0)continue;let a=e,s=t;for(;a&&s;){let l=gs(a,o);if(!l)break;let d=r?Array.from(s.children).find(p=>r.get(p)===l)||null:s.children[Array.from(a.children).indexOf(l)]||null,c=getComputedStyle(l),u=parseFloat(c[`margin${i}`])||0;if(d&&d.style&&u>0&&(d.style[`margin${i}`]="0px"),un(c)||(parseFloat(c[`border${i}Width`])||0)>0||(parseFloat(c[`padding${i}`])||0)>0)break;a=l,s=d}}}function ys(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),r=[];for(;t.nextNode();)r.push(t.currentNode);for(let n of r)n.remove()}function ws(e,t={}){let{stripFrameworkDirectives:r=!0}=t,n=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let s=a.name;if(s.startsWith("*")){i.removeAttribute(s);continue}if(s.includes("@")){i.removeAttribute(s);continue}if(s.includes(":")){let l=s.split(":",1)[0];if(!n.has(l)){i.removeAttribute(s);continue}}if(r&&(s.startsWith("x-")||s.startsWith("v-")||s.startsWith(":")||s.startsWith("on:")||s.startsWith("bind:")||s.startsWith("let:")||s.startsWith("class:"))){i.removeAttribute(s);continue}}}}var pn=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function xs(e){if(!e)return;let t=o=>{if(o.nodeType===Node.ELEMENT_NODE){if(o.attributes)for(let i of Array.from(o.attributes)){let a=i.value.replace(pn,"");if(a!==i.value)try{o.setAttribute(i.name,a)}catch{}}}else if(o.nodeType===Node.TEXT_NODE||o.nodeType===Node.CDATA_SECTION_NODE){let i=o.data.replace(pn,"");i!==o.data&&(o.data=i)}};t(e);let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),n;for(;n=r.nextNode();)t(n)}function vs(e,t={}){e&&(ws(e,t),ys(e),xs(e))}function Ss(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Cs(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function ks(e,t){if(e?.nodeType!==1||Ss(e)||Cs(e))return!1;let r=t.position;if(r==="absolute"||r==="fixed"||r==="sticky")return!1;let n=t.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||t.transform&&t.transform!=="none")}function Ms(e,t,r=new Map){function n(o,i){if(o?.nodeType!==1||i?.nodeType!==1)return;let a=o.childElementCount>i.childElementCount,s=r.get(o)||getComputedStyle(o);if(r.has(o)||r.set(o,s),a&&ks(o,s)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let c=s.overflowY||s.overflowBlock||"visible",u=s.overflowX||s.overflowInline||"visible";(c!=="visible"||u!=="visible")&&(i.style.overflow="visible")}let l=Array.from(o.children),d=Array.from(i.children);for(let c=0;c<Math.min(l.length,d.length);c++)n(l[c],d[c])}n(e,t)}function Es(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function $s(e,t){if(e?.nodeType!==1)return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let r of t.exclude)try{if(e.matches(r))return t.excludeMode==="remove"}catch(n){j(t,"exclude selector match failed",n)}if(typeof t?.filter=="function"&&t.filterMode==="remove")try{if(!t.filter(e))return!0}catch(r){j(t,"filter function failed",r)}return!1}function As(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let f of s){if($s(f,t)||!Es(f))continue;let h=f.getBoundingClientRect(),m=h.top-n.top,g=h.bottom-n.top;g<=m||(m<o&&(o=m),g>i&&(i=g),a=!0)}let l=a?Math.max(0,i-o):0,d=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderBottomWidth)||0,u=parseFloat(r.paddingTop)||0,p=parseFloat(r.paddingBottom)||0;return d+c+u+p+l}var A=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Fe=.75;function Ns(e,t,r,n,o,i){let a=e.ownerDocument||document,s=e.getBoundingClientRect(),l=o>0&&s.width>0?s.width/o:1,d=i>0&&s.height>0?s.height/i:1;if(Math.abs(l-d)>.02)return 0;let c=a.createElement("div");c.setAttribute("data-snapdom-internal",""),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+o+"px!important;overflow:visible!important;visibility:hidden!important;";let u=c.attachShadow({mode:"open"}),p=a.createElement("style");p.textContent=r,u.appendChild(p);let f=t.cloneNode(!0);u.appendChild(f),a.body.appendChild(c);let h=0,m=(g,y,x)=>{let v=B(g),b=v.boxSizing==="border-box",w=(S,M,...C)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let $=E+(b?0:C.reduce((N,L)=>N+(parseFloat(L)||0),0));return Math.abs($-M)<=.51?$:M};return{width:w(v.width,y,v.paddingLeft,v.paddingRight,v.borderLeftWidth,v.borderRightWidth),height:w(v.height,x,v.paddingTop,v.paddingBottom,v.borderTopWidth,v.borderBottomWidth)}};try{let g=f.getBoundingClientRect(),y=f.offsetWidth||o,x=f.offsetHeight||i,v=y>0&&g.width>0?g.width/y:1,b=x>0&&g.height>0?g.height/x:1,w=(S,M,C=!1)=>{let E=S.children,$=M.children,N=Math.min(E.length,$.length);for(let L=0;L<N;L++){let _=E[L],F=$[L],I=n.get(_),T=C||ro.has(_);if(I?.nodeType===1&&_?.namespaceURI===ir&&_.style&&I.isConnected){let O=I.getBoundingClientRect();if(O.width>0&&O.height>0){let X=F.getBoundingClientRect(),U=O.width/l,V=O.height/d,K=X.width,P=X.height,W=I.offsetWidth||U,D=I.offsetHeight||V,q=F.offsetWidth||K,ce=F.offsetHeight||P,Q=Math.abs(U-W)>Fe||Math.abs(V-D)>Fe||Math.abs(K-q)>Fe||Math.abs(P-ce)>Fe;if(T){let J=m(F,q,ce);U=K>0?U*v*J.width/K:U,V=P>0?V*b*J.height/P:V,K=J.width,P=J.height}else if(Q){let J=m(I,W,D),he=m(F,q,ce);U=J.width,V=J.height,K=he.width,P=he.height}let te=K-U,oe=P-V;(Math.abs(te)>Fe||Math.abs(oe)>Fe)&&(_.style.boxSizing="border-box",_.style.width=`${A(U)}px`,_.style.height=`${A(V)}px`,h++)}}w(_,F,T)}};w(t,f)}finally{c.remove()}return h}var Rs=/::-webkit-scrollbar(-[a-z]+)?\b/i;function sr(e,t=new Set){let r="";if(!e)return r;for(let n=0;n<e.length;n++){let o=e[n];try{if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){r+=sr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=sr(o.cssRules,t);i&&(r+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(Rs.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),r+=a)}}}catch{}}return r}var fn=new WeakMap;function Ts(e){let t="";for(let r of e.styleSheets){let n=-1;try{n=r.cssRules?r.cssRules.length:-1}catch{}t+=(r.href||"inline")+":"+n+"|"}return t}function Ls(e){if(!e||!e.styleSheets)return"";let t=Ts(e),r=fn.get(e);if(r&&r.fp===t)return r.css;let n=new Set,o="";for(let i of Array.from(e.styleSheets))try{let a=i.cssRules;a&&(o+=sr(a,n))}catch{}return fn.set(e,{fp:t,css:o}),o}Ae();var ut=new Set;async function Fs(e,t={}){let r=t.__session||k.session,n={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:t},o=null;if(t.clip){let u=no(e,t.clip);if(u){n.clip={rect:u,root:e};let p=e.getBoundingClientRect();o={x:u.left-p.left,y:u.top-p.top,width:u.width,height:u.height}}}let i,a="",s="";if(ut.size){let u=(p,f)=>{for(let h=f;h;h=h.assignedSlot||h.parentElement||h.getRootNode()?.host)if(h===p)return!0;return!1};for(;;){let p=[...ut].filter(({root:f})=>u(f,e)||u(e,f)).map(({promise:f})=>f.catch(()=>{}));if(!p.length)break;await Promise.all(p)}}if(!n.clip&&e.isConnected&&e.ownerDocument?.visibilityState!=="hidden")try{let u=e.getBoundingClientRect(),p=e.ownerDocument?.defaultView||window,f=u.right<=0||u.bottom<=0||u.left>=p.innerWidth||u.top>=p.innerHeight,h=[];if(f&&(()=>{let m=[];e.shadowRoot&&m.push(e.shadowRoot);for(let g of e.querySelectorAll("*"))g.shadowRoot&&m.push(g.shadowRoot);for(;m.length;){let g=m.pop(),y=g.host?.localName==="calcite-icon";for(let x of g.querySelectorAll("*")){if(x.shadowRoot&&m.push(x.shadowRoot),!y||x.localName!=="svg")continue;let v=x.querySelectorAll("path");if(!v.length||[...v].some(w=>w.getAttribute("d")?.trim()))continue;let b=x.getBoundingClientRect();b.width&&b.height&&h.push(x)}}})(),h.length){let m=(async()=>{let y=e.style,x=e.hasAttribute("style"),v=new Map,b=(w,S)=>{v.has(w)||v.set(w,{value:y.getPropertyValue(w),priority:y.getPropertyPriority(w)}),y.setProperty(w,S,"important");let M=v.get(w);M.forcedValue=y.getPropertyValue(w),M.forcedPriority=y.getPropertyPriority(w)};try{b("left","0"),b("top","0"),b("right","auto"),b("bottom","auto"),b("margin-top","0"),b("margin-right","0"),b("margin-bottom","0"),b("margin-left","0"),b("transform","none"),b("translate","none"),b("opacity","0"),b("pointer-events","none");let w=e.getBoundingClientRect();if(w.right<=0||w.bottom<=0||w.left>=p.innerWidth||w.top>=p.innerHeight){let C=e.parentElement?.getBoundingClientRect(),E=C&&C.right>0&&C.left<p.innerWidth?Math.max(0,C.left):0,$=C&&C.bottom>0&&C.top<p.innerHeight?Math.max(0,C.top):0;b("position","fixed"),b("left",`${E}px`),b("top",`${$}px`)}await Me(100);let S=Date.now()+1500,M=()=>h.some(C=>{if([...C.querySelectorAll("path")].some($=>$.getAttribute("d")?.trim()))return!1;let E=C.getBoundingClientRect();return E.width&&E.height&&E.right>0&&E.bottom>0&&E.left<p.innerWidth&&E.top<p.innerHeight});for(;Date.now()<S&&M();)await new Promise(C=>setTimeout(C,25));await Me(100)}finally{for(let[w,S]of v)y.getPropertyValue(w)!==S.forcedValue||y.getPropertyPriority(w)!==S.forcedPriority||(S.value?y.setProperty(w,S.value,S.priority):y.removeProperty(w));!x&&!y.length&&e.removeAttribute("style"),await Me(100)}})(),g={root:e,promise:m};ut.add(g);try{await m}finally{ut.delete(g)}}}catch{}let l=Za(e),d=n.clip?()=>{}:es(e);try{i=await wt(e,n,t)}catch(u){throw console.warn("deepClone failed:",u),u}finally{d(),l()}try{Ja(i)}catch(u){console.warn("inlineExternal defs or symbol failed:",u)}try{await nr(e,i,n,t)}catch(u){console.warn("inlinePseudoElements failed:",u)}await aa(i,n);try{let u=i.querySelectorAll("style[data-sd]");for(let p of u)s+=p.textContent||"",p.remove()}catch(u){j(n,"Failed to extract shadow CSS from style[data-sd]",u)}let c=Jo(n.styleMap);a=Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join(""),a=s+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+a;for(let[u,p]of n.styleMap.entries()){if(u.tagName==="STYLE")continue;if(u.getRootNode&&u.getRootNode()instanceof ShadowRoot){u.setAttribute("style",p.replace(/;/g,"; "));continue}let f=c.get(p);f&&u.classList.add(f);let h=u.style?.backgroundImage,m=u.dataset?.snapdomHasIcon;h&&h!=="none"&&(u.style.backgroundImage=h),m&&(u.style.verticalAlign="middle",u.style.display="inline")}if((n.clip||e.scrollTop||e.scrollLeft)&&i?.nodeType===1)try{let u=n.clip&&o?{x:o.x,y:o.y}:{x:0,y:0};fs(e,i,n.nodeMap,n.styleCache,u)}catch(u){j(n,"freezeViewportPositioned failed",u)}for(let[u,p]of n.nodeMap.entries()){if(n.clip&&p===e)continue;let f=p.scrollLeft,h=p.scrollTop;if((f||h)&&u?.nodeType===1&&u.namespaceURI==="http://www.w3.org/1999/xhtml"){u.style.overflow="hidden",u.style.scrollbarWidth="none",u.style.msOverflowStyle="none";try{let g=u.querySelectorAll("*");for(let y of g){if(y.nodeType!==1||y.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let x=y.style.position;if(x==="fixed"||x==="absolute"){let v=parseFloat(y.style.top)||0,b=parseFloat(y.style.left)||0;y.style.top=`${v+h}px`,y.style.left=`${b+f}px`,x==="fixed"&&(y.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.all="unset",m.style.transform=`translate(${-f}px, ${-h}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";u.firstChild;)m.appendChild(u.firstChild);u.appendChild(m)}}if(e===n.nodeMap.get(i)){let u=n.styleCache.get(e)||B(e);n.styleCache.set(e,u);let p=Wo(u.transform);i.style.margin="0",i.style.top="auto",i.style.left="auto",i.style.right="auto",i.style.bottom="auto",i.style.animation="none",i.style.transition="none",i.style.willChange="auto",i.style.float="none",i.style.clear="none",i.style.transform=p||""}for(let[u,p]of n.nodeMap.entries())p.tagName==="PRE"&&(u.style.marginTop="0",u.style.marginBlockStart="0");return{clone:i,classCSS:a,styleCache:n.styleCache,nodeMap:n.nodeMap,reconcileRisk:n.reconcileRisk||0,clipWindow:o}}$e();ne();var io="http://www.w3.org/1999/xlink";function Ps(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(io,"href"):null)}function Is(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,r=parseInt(e.dataset?.snapdomHeight||"",10)||0,n=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||i||n||e.width||e.naturalWidth||100,l=r||a||o||e.height||e.naturalHeight||100;return{width:s,height:l}}async function Os(e,t={}){let r=Array.from(e.querySelectorAll("img"));e.tagName==="IMG"&&r.unshift(e);let n=async s=>{if(!s.getAttribute("src")){let h=s.currentSrc||s.src||Et(s.getAttribute("srcset"),s)||"";h&&s.setAttribute("src",h)}s.removeAttribute("srcset"),s.removeAttribute("sizes");let l=s.src||"";if(!l)return;let d=k.image?.get(l);if(d){s.src=d,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let c=await le(l,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){k.image?.set(l,c.data),s.src=c.data,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let{width:u,height:p}=Is(s),{fallbackURL:f}=t||{};if(f)try{let h=typeof f=="function"?await f({width:u,height:p,src:l,element:s}):f;if(h){let m=await le(h,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){s.src=m.data,s.width||(s.width=u),s.height||(s.height=p);return}}}catch{}if(t.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${u}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",s.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${u}px;height:${p}px;visibility:hidden;`,s.replaceWith(h)}},o=6;for(let s=0;s<r.length;s+=o){let l=r.slice(s,s+o).map(n);await Promise.allSettled(l)}let i=Array.from(e.querySelectorAll("image"));e.localName==="image"&&i.unshift(e);let a=async s=>{let l=Ps(s);if(!l||l.startsWith("data:")||l.startsWith("blob:"))return;let d=await le(l,{as:"dataURL",useProxy:t.useProxy});d.ok&&typeof d.data=="string"&&d.data.startsWith("data:")&&(s.setAttribute("href",d.data),s.removeAttribute("xlink:href"),typeof s.removeAttributeNS=="function"&&s.removeAttributeNS(io,"href"))};for(let s=0;s<i.length;s+=o){let l=i.slice(s,s+o).map(a);await Promise.allSettled(l)}}de();ne();var _s=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],Ds=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],Hs=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Ws=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function Bs(e,t,r,n){let o=r.get(e)||B(e);r.has(e)||r.set(e,o);let i=o.getPropertyValue("border-image"),a=o.getPropertyValue("border-image-source"),s=i&&i!=="none"||a&&a!=="none",l=o.getPropertyValue("background-image"),d=o.getPropertyValue("background-color");if(l&&l!=="none"||d&&d!=="rgba(0, 0, 0, 0)"&&d!=="transparent"||/url\s*\(|gradient\s*\(/i.test(o.getPropertyValue("background")||""))for(let c of Hs){let u=o.getPropertyValue(c);u&&t.style.setProperty(c,u)}for(let c of _s){let u=o.getPropertyValue(c);if(c==="background-image"&&(!u||u==="none")){let h=o.getPropertyValue("background");h&&/url\s*\(/.test(h)&&(u=Vt(h).filter(m=>/url\s*\(/.test(m)).join(", ")||u)}if(!u||u==="none")continue;let p=Vt(u),f=await Promise.all(p.map(h=>wn(h,n)));f.some(h=>h&&h!=="none"&&!/^url\(undefined/.test(h))&&t.style.setProperty(c,f.join(", "))}for(let c of Ds){let u=o.getPropertyValue(c);!u||u==="initial"||t.style.setProperty(c,u)}if(s)for(let c of Ws){let u=o.getPropertyValue(c);!u||u==="initial"||t.style.setProperty(c,u)}}async function js(e,t,r,n={},o=k.session.nodeMap){if(!t)return;let i=[];e&&qr(e)&&i.push([e,t]);let a=[t];for(;a.length;){let l=a.pop();if(l.children)for(let d of l.children){if(d.tagName==="STYLE")continue;let c=o.get(d);c&&qr(c)&&i.push([c,d]),a.push(d)}}let s=6;for(let l=0;l<i.length;l+=s)await Promise.allSettled(i.slice(l,l+s).map(([d,c])=>Bs(d,c,r,n)))}ne();de();function Us(e,t,r=k.session.nodeMap){let n=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let s=o.currentNode;s;s=o.nextNode()){let l=r.get(s);if(l?.nodeType!==1)continue;let d=B(l),c=d.getPropertyValue("backdrop-filter")||d.getPropertyValue("-webkit-backdrop-filter");c&&c!=="none"&&s!==t&&n.push({cloneEl:s,orig:l,bf:c,path:Vs(t,s)})}if(!n.length)return;let i=e.getBoundingClientRect(),a=n.map((s,l)=>{let d=t.cloneNode(!0);zs(d,t,s.orig.getBoundingClientRect(),r),Xs(hn(d,s.path));for(let c=0;c<l;c++){let u=hn(d,n[c].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...s,copy:d}});for(let{cloneEl:s,orig:l,bf:d,copy:c}of a)qs(s,l,d,c,i)}function qs(e,t,r,n,o){let i=t.getBoundingClientRect();if(!i.width||!i.height)return;let a=B(t),s=t.offsetWidth?i.width/t.offsetWidth:1,l=Math.abs(s-1)>.001?1/s:1;n.style.position="absolute",n.style.left=`${(o.left-i.left)*l}px`,n.style.top=`${(o.top-i.top)*l}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`,n.style.margin="0",n.style.filter=r,l!==1&&(n.style.transform=`scale(${l})`,n.style.transformOrigin="top left");let d=document.createElement("div");d.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",d.appendChild(n);let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",c.style.backgroundColor=a.backgroundColor,c.style.backgroundImage=e.style.backgroundImage||a.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])c.style.setProperty(u,a.getPropertyValue(u));e.style.setProperty("background-color","transparent","important"),e.style.setProperty("background-image","none","important"),e.style.setProperty("backdrop-filter","none","important"),e.style.setProperty("-webkit-backdrop-filter","none","important"),a.position==="static"&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(c),e.prepend(d)}var pt=128;function zs(e,t,r,n){let o=[[e,t]];for(;o.length;){let[i,a]=o.pop(),s=n.get(a);if(s?.nodeType===1){let c=s.getBoundingClientRect();(c.left>r.right+pt||c.right<r.left-pt||c.top>r.bottom+pt||c.bottom<r.top-pt)&&(i.tagName==="IMG"&&i.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),i.style&&(i.style.backgroundImage="none"))}let l=i.children,d=a.children;for(let c=0;c<l.length;c++)o.push([l[c],d[c]])}}function Vs(e,t){let r=[];for(let n=t;n!==e;n=n.parentElement){if(!n?.parentElement)return null;r.push([...n.parentElement.children].indexOf(n))}return r.reverse()}function hn(e,t){if(!t)return null;let r=e;for(let n of t)if(r=r.children[n],!r)return null;return r}function Xs(e){if(e)for(let t=e;t&&t.parentNode;){let r=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=r}}de();ne();function Ys(e,t){if(!e)return()=>{};let r=[],n=200;function o(i){if(t){let d=i.getBoundingClientRect();if(d.width>0||d.height>0){let c=Math.max(d.right,d.left+(i.scrollWidth||0)),u=Math.max(d.bottom,d.top+(i.scrollHeight||0));if(c<t.left-n||d.left>t.right+n||u<t.top-n||d.top>t.bottom+n)return}}let a=getComputedStyle(i),s=Gs(i,a);s&&r.push(s);let l=Qs(i,a);l&&r.push(l);for(let d of i.children||[])o(d)}return o(e),()=>r.forEach(i=>i())}function Gs(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let r=Ks(t);if(r<=0)return()=>{};if(!so(e))return()=>{};let n=ao(e),o=n.text,i=Zs(t);n.write("X");let a=e.scrollHeight-i;n.restore();let s=a>0?a:Js(t),l=Math.round(s*r+i);if(e.scrollHeight<=l+.5)return()=>{};let d=0,c=o.length,u=-1;for(;d<=c;){let p=d+c>>1;n.write(o.slice(0,p)+"\u2026"),e.scrollHeight<=l+.5?(u=p,d=p+1):c=p-1}return n.write((u>=0?o.slice(0,u):"")+"\u2026"),()=>{n.restore()}}function Qs(e,t){if(!e)return()=>{};if(t=t||getComputedStyle(e),t.textOverflow!=="ellipsis")return()=>{};if(t.whiteSpace!=="nowrap"&&t.whiteSpace!=="pre")return()=>{};if(t.overflowX!=="hidden"&&t.overflowX!=="clip")return()=>{};if(!so(e))return()=>{};if(e.scrollWidth<=e.clientWidth+.5)return()=>{};let r=ao(e),n=r.text,o=0,i=n.length,a=-1;for(;o<=i;){let s=o+i>>1;r.write(n.slice(0,s)+"\u2026"),e.scrollWidth<=e.clientWidth+.5?(a=s,o=s+1):i=s-1}return r.write((a>=0?n.slice(0,a):"")+"\u2026"),()=>{r.restore()}}function ao(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let r=t.map(n=>n.data);return{text:r.join(""),write(n){t[0].data=n;for(let o=1;o<t.length;o++)t[o].data=""},restore(){for(let n=0;n<t.length;n++)t[n].data=r[n]}}}function Ks(e){let t=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");t=(t||"").trim();let r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:0}function Js(e){let t=(e.lineHeight||"").trim(),r=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(r*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*r):t.endsWith("%")?Math.round(parseFloat(t)/100*r):Math.round(r*1.2)}function Zs(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function so(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var je=[];function Ft(e){if(!e)return null;if(Array.isArray(e)){let[t,r]=e;return typeof t=="function"?t(r):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:r}=e;return typeof t=="function"?t(r):t}return typeof e=="function"?e():e}function el(...e){let t=e.flat();for(let r of t){let n=Ft(r);n&&(je.some(o=>o&&o.name&&n.name&&o.name===n.name)||je.push(n))}}function lo(e){return e&&Array.isArray(e.plugins)?e.plugins:je}async function Se(e,t,r){let n=r,o=lo(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&(n=s)}return n}async function tl(e,t,r){let n=[],o=lo(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&n.push(s)}return n}function rl(e){let t=[];if(Array.isArray(e))for(let r of e){let n=Ft(r);if(!n||!n.name)continue;let o=t.findIndex(i=>i&&i.name===n.name);o>=0&&t.splice(o,1),t.push(n)}for(let r of je)r&&r.name&&!t.some(n=>n.name===r.name)&&t.push(r);return Object.freeze(t)}function nl(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=rl(t)),e}function co(){return je.slice()}ne();var ol=.92,il=.95;async function al(e){let t=new Image;if(t.decoding="sync",t.src=e,typeof t.decode=="function")try{return await t.decode(),t}catch{}return await new Promise((r,n)=>{t.onload=()=>r(),t.onerror=n}),t}function sl(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:""}async function yr(e,t,r){if(typeof e!="string"||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return null;let n=e.length+":"+e.slice(0,64)+e.slice(-64)+":"+Math.round(t)+"x"+Math.round(r);if(k.compress.has(n))return k.compress.get(n);let o=await(async()=>{let i;try{i=await al(e)}catch{return null}let a=i.naturalWidth||i.width,s=i.naturalHeight||i.height;if(!a||!s)return null;let l=Math.min(1,Math.max(t/a,r/s));if(!(l>0)||l>=.95)return null;let d=l*il,c=Math.max(1,Math.round(a*d)),u=Math.max(1,Math.round(s*d)),p=document.createElement("canvas");p.width=c,p.height=u;let f=p.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(i,0,0,c,u);let h=sl(e),m=h==="image/jpeg"?"image/jpeg":h==="image/webp"?"image/webp":"image/png";try{let g=p.toDataURL(m,ol);if(typeof g=="string"&&g.startsWith("data:image")&&g.length<e.length)return g}catch{}return null})();return k.compress.set(n,o),o}async function ll(e,t){if(!t.compress)return{count:0,before:0,after:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("img"));e.tagName==="IMG"&&n.unshift(e);let o=0,i=0,a=0,s=async d=>{let c=d.getAttribute("src")||"";if(!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let u=parseFloat(d.dataset.snapdomWidth)||parseFloat(d.style.width)||d.width||0,p=parseFloat(d.dataset.snapdomHeight)||parseFloat(d.style.height)||d.height||0;if(!u||!p)return;let f=await yr(c,u*r,p*r);f&&(o++,i+=c.length,a+=f.length,d.setAttribute("src",f))},l=6;for(let d=0;d<n.length;d+=l)await Promise.allSettled(n.slice(d,d+l).map(s));return{count:o,before:i,after:a}}function cl(e){let t=e.offsetWidth||e.getBoundingClientRect().width||0,r=e.offsetHeight||e.getBoundingClientRect().height||0;return{w:t,h:r}}async function dl(e,t,r=k.session.nodeMap){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),o=[],i=[e,...e.querySelectorAll("*")];for(let d of i){let c=d.style&&d.style.backgroundImage;c&&c.includes("data:image")&&o.push(d)}let a=0,s=async d=>{let c=r.get(d);if(!c||!c.isConnected)return;let u;try{u=getComputedStyle(c)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(v=>v.trim()!=="no-repeat"))return;let{w:p,h:f}=cl(c);if(!p||!f)return;let h=p*n,m=f*n,g=d.style.backgroundImage,y=[...g.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],x=g;for(let v of y){let b=v[2];if(b.startsWith("data:image/svg"))continue;let w=await yr(b,h,m);w&&(x=x.split(b).join(w),a++)}x!==g&&(d.style.backgroundImage=x)},l=6;for(let d=0;d<o.length;d+=l)await Promise.allSettled(o.slice(d,d+l).map(s));return{count:a}}async function ul(e,t){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("image"));e.localName==="image"&&n.unshift(e);let o=0,i=async s=>{let l=s.getAttribute("href")||(typeof s.getAttributeNS=="function"?s.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!l||!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let d=parseFloat(s.getAttribute("width"))||0,c=parseFloat(s.getAttribute("height"))||0;if(!d||!c)return;let u=await yr(l,d*r,c*r);u&&(s.setAttribute("href",u),s.hasAttribute("xlink:href")&&s.setAttribute("xlink:href",u),o++)},a=6;for(let s=0;s<n.length;s+=a)await Promise.allSettled(n.slice(s,s+a).map(i));return{count:o}}async function pl(e,t,r){t.compress&&(await ll(e,t),await dl(e,t,r),await ul(e,t))}function fl(e){if(Array.isArray(e.plugins)){for(let t of e.plugins)if(Ft(t)?.name==="picture-resolver")return!0}return co().some(t=>t?.name==="picture-resolver")}function hl(e){let t=Array.isArray(e.plugins)?e.plugins:co(),r=[];for(let n of t){let o=Ft(n);o&&typeof o.resolveNode=="function"&&r.push(o.resolveNode.bind(o))}return r.length?r:null}var ml=2e3,gl=3;function bl(e){let t=Date.now(),r=k.burstAdvice.get(e);if(!r||t-r.firstTs>ml){k.burstAdvice.set(e,{count:1,firstTs:t,warned:!1});return}r.count++,r.count>=gl&&!r.warned&&(r.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed."))}async function yl(e,t){if(!e)throw new Error("Element cannot be null or undefined");Ho(t.cache),t.__session={styleMap:k.session.styleMap,styleCache:k.session.styleCache,nodeMap:k.session.nodeMap},t.burst||bl(e),t.__resolveNodeHooks=hl(t);let r=t.fast,n=t.outerTransforms!==!1,o=!!t.outerShadows,i=t.clip?no(e,t.clip):null,a={element:e,options:t,plugins:t.plugins},s,l,d,c,u,p,f="",h="",m,g,y=null;await Se("beforeSnap",a);let x=null;t.resolvePicturePlaceholders!==!1&&!fl(t)&&(x=await Wi(a.element,a.options)),await Se("beforeClone",a);let v=Ys(a.element,i);try{({clone:s,classCSS:l,styleCache:d,nodeMap:c,reconcileRisk:u,clipWindow:p}=await Fs(a.element,a.options)),u>0&&!t.reconcile&&!k.warnedReconcile&&(k.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!n&&s&&(y=as(a.element,s)),!o&&s&&hs(a.element,s,a.options),s&&(bs(a.element,s,c),ms(a.element,s))}finally{v()}if(a={clone:s,classCSS:l,styleCache:d,nodeMap:c,...a},await Se("afterClone",a),x&&await x(),vs(a.clone),a.options?.excludeMode==="remove"||a.options?.filterMode==="remove")try{Ms(a.element,a.clone,a.styleCache)}catch(N){console.warn("[snapdom] shrink pass failed:",N)}try{await ka(a.clone,a.element,a.nodeMap)}catch{}let b=N=>new Promise((L,_)=>{ht(()=>{Promise.resolve().then(N).then(L,_)},{fast:r})}),w=(async()=>{await Promise.all([b(()=>Os(a.clone,a.options)),b(()=>js(a.element,a.clone,a.styleCache,a.options,a.nodeMap))]);try{Us(a.element,a.clone,a.nodeMap)}catch(N){console.warn("[snapdom] backdrop-filter emulation failed:",N)}t.compress&&await b(()=>pl(a.clone,a.options,a.nodeMap))})(),S=Promise.resolve();t.embedFonts&&(S=b(async()=>{let N=a.element.ownerDocument||document,L=i?I=>{try{let T=I.getBoundingClientRect();return T.right>=i.left-200&&T.left<=i.right+200&&T.bottom>=i.top-200&&T.top<=i.bottom+200}catch{return!0}}:null,{required:_,usedCodepoints:F}=Jn(a.element,L);if(we()){let I=new Set(Array.from(_).map(T=>String(T).split("__")[0]).filter(Boolean));await Zn(I,1,N)}f=await ja({required:_,usedCodepoints:F,preCached:!1,exclude:a.options.excludeFonts,localFonts:a.options.localFonts,useProxy:a.options.useProxy,fontStylesheetDomains:a.options.fontStylesheetDomains,doc:N})})),await Promise.all([w,S]);let M=Qo(a.clone).sort(),C=M.join(",");k.baseStyle.has(C)?h=k.baseStyle.get(C):await new Promise(N=>{ht(()=>{h=Ko(M),k.baseStyle.set(C,h),N()},{fast:r})});let E=Ls(a.element?.ownerDocument||document);a={fontsCSS:f,baseCSS:h,scrollbarCSS:E,...a},await Se("beforeRender",a),await new Promise(N=>{ht(()=>{let L=B(a.element),_=a.element.getBoundingClientRect(),F=Math.max(1,A(a.element.offsetWidth||parseFloat(L.width)||_.width||1)),I=Math.max(1,A(a.element.offsetHeight||parseFloat(L.height)||_.height||1)),T=a.element.ownerDocument||document;if(!p&&(a.element===T.body||a.element===T.documentElement)&&!T.documentElement.hasAttribute("data-sd-pinned")){let z=Math.max(a.element.scrollHeight||0,T.documentElement?.scrollHeight||0,T.body?.scrollHeight||0),Z=Math.max(a.element.scrollWidth||0,T.documentElement?.scrollWidth||0,T.body?.scrollWidth||0);z>0&&(I=Math.max(I,A(z))),Z>0&&(F=Math.max(F,A(Z)));try{let Y=(a.scrollbarCSS||"").length+(a.baseCSS||"").length+(a.fontsCSS||"").length+(a.classCSS||"").length,ie=k.measureHints.get(a.element);if(ie&&ie.cssLen===Y&&ie.w0===F)ie.csh>0&&(I=Math.max(I,A(ie.csh))),ie.csw>0&&(F=Math.max(F,A(ie.csw)));else{let G=T.createElement("div");G.setAttribute("data-snapdom-internal",""),G.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+F+"px!important;overflow:visible!important;visibility:hidden!important;";let ue=G.attachShadow({mode:"open"}),rt=T.createElement("style");rt.textContent=(a.scrollbarCSS||"")+a.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a.classCSS,ue.appendChild(rt),ue.appendChild(a.clone.cloneNode(!0)),T.body.appendChild(G);let ve=G.scrollHeight,It=G.scrollWidth;T.body.removeChild(G),k.measureHints.set(a.element,{cssLen:Y,w0:F,csh:ve,csw:It}),ve>0&&(I=Math.max(I,A(ve))),It>0&&(F=Math.max(F,A(It)))}}catch{}}if(a.options?.excludeMode==="remove"||a.options?.filterMode==="remove"){let z=As(a.element,a.options);Number.isFinite(z)&&z>0&&(I=Math.max(1,Math.min(I,A(z+1))))}if(a.options?.reconcile)try{let z=(a.scrollbarCSS||"")+a.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a.classCSS;Ns(a.element,a.clone,z,a.nodeMap,F,I)}catch(z){console.warn("[snapdom] reconcile pass failed:",z)}let O=(z,Z=NaN)=>{let Y=typeof z=="string"?parseFloat(z):z;return Number.isFinite(Y)?Y:Z},X=O(a.options.width),U=O(a.options.height),V=p?A(p.width):F,K=p?A(p.height):I,P=V,W=K,D=Number.isFinite(X),q=Number.isFinite(U),ce=K>0?V/K:1;D&&q?(P=Math.max(1,A(X)),W=Math.max(1,A(U))):D?(P=Math.max(1,A(X)),W=Math.max(1,A(P/(ce||1)))):q&&(W=Math.max(1,A(U)),P=Math.max(1,A(W*(ce||1))));let Q=0,te=0,oe=F,J=I;if(p){let z=0,Z=0;if(Ut(a.element)){let Y=null;if(!n&&y&&Number.isFinite(y.a))Y={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0};else{let ie=At(a.element),G=oo(L.transform&&L.transform!=="none"?L.transform:"",ie);G&&G.is2D&&(Y={a:G.a,b:G.b,c:G.c,d:G.d,e:0,f:0})}if(Y&&!(Y.a===1&&Y.b===0&&Y.c===0&&Y.d===1)){let{ox:ie,oy:G}=or(L,F,I),ue=St(F,I,Y,ie,G);z=ue.minX,Z=ue.minY}}Q=A(p.x+z),te=A(p.y+Z),oe=A(Q+p.width),J=A(te+p.height)}else if(!n&&y&&Number.isFinite(y.a)){let z={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0},Z=St(F,I,z,0,0);Q=A(Z.minX),te=A(Z.minY),oe=A(Z.maxX),J=A(Z.maxY)}else if(n&&Ut(a.element)){let z=L.transform&&L.transform!=="none"?L.transform:"",Z=At(a.element),Y=ls({baseTransform:z,rotate:Z.rotate||"0deg",scale:Z.scale,translate:Z.translate}),{ox:ie,oy:G}=or(L,F,I),ue=Y.is2D?Y:new DOMMatrix(Y.toString()),rt={a:ue.a,b:ue.b,c:ue.c,d:ue.d,e:0,f:0},ve=St(F,I,rt,ie,G);Q=A(ve.minX),te=A(ve.minY),oe=A(ve.maxX),J=A(ve.maxY)}let he=ts(L),Ce=rs(L),ee=ns(L),Ye=os(L),Ge=is(L),Qe=p?{top:0,right:0,bottom:0,left:0}:o?{top:A(Math.max(he.top,Ce.top)+ee.top+Ye.top+Ge.bleed.top),right:A(Math.max(he.right,Ce.right)+ee.right+Ye.right+Ge.bleed.right),bottom:A(Math.max(he.bottom,Ce.bottom)+ee.bottom+Ye.bottom+Ge.bleed.bottom),left:A(Math.max(he.left,Ce.left)+ee.left+Ye.left+Ge.bleed.left)}:{top:ee.top,right:ee.right,bottom:ee.bottom,left:ee.left};Q=A(Q-Qe.left),te=A(te-Qe.top),oe=A(oe+Qe.right),J=A(J+Qe.bottom);let xr=Math.max(1,A(oe-Q)),vr=Math.max(1,A(J-te)),fo=D||q?A(P/V):1,ho=q||D?A(W/K):1,mo=Math.max(1,A(xr*fo)),go=Math.max(1,A(vr*ho)),Sr="http://www.w3.org/2000/svg",bo=Ut(a.element)?2:0,Ne=A(bo+(n?0:1)),Ke=Math.ceil(xr+Ne*2),Je=Math.ceil(vr+Ne*2),Ze=A(-(A(Q)-Ne)),et=A(-(A(te)-Ne)),Cr=Math.max(0,Ze),kr=Math.max(0,et),Mr=A(Ke-Math.min(0,Ze)),Er=A(Je-Math.min(0,et)),xe=document.createElementNS(Sr,"foreignObject");xe.setAttribute("x",String(Math.min(0,Ze))),xe.setAttribute("y",String(Math.min(0,et))),xe.setAttribute("width",String(Mr)),xe.setAttribute("height",String(Er)),xe.style.overflow="visible";let $r=document.createElement("style"),yo="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";$r.textContent=(a.scrollbarCSS||"")+a.baseCSS+a.fontsCSS+yo+a.classCSS,xe.appendChild($r);let tt=document.createElement("div");tt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),tt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${Mr}px;height:${Er}px`+(Cr!==0||kr!==0?`;padding:${kr}px 0 0 ${Cr}px !important`:""),tt.appendChild(a.clone),xe.appendChild(tt);let wo=new XMLSerializer().serializeToString(xe),Ar=D||q,xo=Object.freeze({w0:V,h0:K,vbW:Ke,vbH:Je,targetW:P,targetH:W,contentX:A(Ze+(p?Q:0)),contentY:A(et+(p?te:0)),clip:p?Object.freeze({x:A(Q),y:A(te),width:V,height:K}):null});Object.defineProperty(t,"meta",{value:xo,enumerable:!0,writable:!1,configurable:!0});let vo=!Ar||we()?Ke:A(mo+Ne*2),So=!Ar||we()?Je:A(go+Ne*2),Co=parseFloat(B(T.documentElement)?.fontSize)||16;g=`<svg xmlns="${Sr}" width="${vo}" height="${So}" viewBox="0 0 ${Ke} ${Je}" font-size="${Co}px">`+wo+"</svg>",m=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,a={svgString:g,dataURL:m,...a},N()},{fast:r})}),await Se("afterRender",a);let $=document.getElementById("snapdom-sandbox");return $&&$.style.position==="absolute"&&$.remove(),a.dataURL}function Ut(e){return cs(e)}ne();function wl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=Do(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:r,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst??!1,invalidate:e.invalidate??!1,clip:e.clip??null,compress:e.compress!==!1,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1,pictureResolver:e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{}}}Ae();Fn();var mn=new WeakMap;function uo(e,t,r){let n=new Set;if(e instanceof HTMLVideoElement&&n.add(e),e.querySelectorAll)for(let o of e.querySelectorAll("video"))n.add(o);for(let o of t.trackedVideos)n.has(o)||(o.removeEventListener("timeupdate",r),o.removeEventListener("seeked",r),t.trackedVideos.delete(o));for(let o of n)t.trackedVideos.has(o)||(o.addEventListener("timeupdate",r),o.addEventListener("seeked",r),t.trackedVideos.add(o))}function xl(e){let t={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},r=i=>{t.capturing||jn(i)&&(t.dirty=!0)},n=()=>{t.capturing||(t.dirty=!0)},o=e.ownerDocument||document;try{let i=new MutationObserver(r);i.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),t.observers.push(i)}catch{}try{if(o.head){let i=new MutationObserver(r);i.observe(o.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),t.observers.push(i)}}catch{}return t.markDirty=r,t.onMediaDirty=n,uo(e,t,n),t}function gn(e){let{burst:t,invalidate:r,...n}=e||{};try{return JSON.stringify(n,Object.keys(n).sort())}catch{return null}}function vl(e,t,r,n){let o=mn.get(e);o||(o=xl(e),o.baselineSignature=gn(t),mn.set(e,o));let i=gn(t),a=i===null||i!==o.baselineSignature,s=async()=>{for(let d of o.observers)o.markDirty(d.takeRecords());if(r.invalidate&&(o.dirty=!0),!a&&!o.dirty&&o.last)return o.last;o.capturing=!0,a||(o.dirty=!1);try{let d=await n();return a||(o.last=d),d}finally{for(let d of o.observers)d.takeRecords();o.capturing=!1,uo(e,o,o.onMediaDirty)}},l=o.inflight.then(s,s);return o.inflight=l.catch(()=>{}),l}de();$e();ne();function Sl(...e){return el(...e),H}var H=Object.assign(kl,{plugins:Sl}),lr=Symbol("snapdom.internal"),Cl=Symbol("snapdom.internal.silent");async function kl(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=wl(t);if(nl(r,t&&t.plugins),we()){if(r.embedFonts===!0)try{let o=Ua(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await Zn(i,1)}catch{}let n=Array.from(e.querySelectorAll("canvas"));e.tagName==="CANVAS"&&n.unshift(e);for(let o of n)try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){j(t,"safari canvas poke failed",i)}}return r.iconFonts&&r.iconFonts.length>0&&ba(r.iconFonts),r.snap||(r.snap={toPng:(n,o)=>H.toPng(n,o),toSvg:(n,o)=>H.toSvg(n,o)}),r.burst?vl(e,t,r,()=>H.capture(e,r,lr)):H.capture(e,r,lr)}H.capture=async(e,t,r)=>{if(r!==lr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");t.element=e;let n=await yl(e,t),o={img:async(m,g)=>{let{toImg:y}=await Promise.resolve().then(()=>(Br(),Yt));return y(n,{...m,...g||{}})},svg:async(m,g)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Br(),Yt));return y(n,{...m,...g||{}})},canvas:async(m,g)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(qe(),Pn));return y(n,{...m,...g||{}})},blob:async(m,g)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Wn(),Dn));return y(n,{...m,...g||{}})},png:async(m,g)=>{let{rasterize:y}=await Promise.resolve().then(()=>(bt(),gt));return y(n,{...m,...g||{},format:"png"})},jpeg:async(m,g)=>{let{rasterize:y}=await Promise.resolve().then(()=>(bt(),gt));return y(n,{...m,...g||{},format:"jpeg"})},webp:async(m,g)=>{let{rasterize:y}=await Promise.resolve().then(()=>(bt(),gt));return y(n,{...m,...g||{},format:"webp"})},download:async(m,g)=>{let{download:y}=await Promise.resolve().then(()=>(hi(),Bn));return y(n,{...m,...g||{}})}},i={};for(let m of["img","svg","canvas","blob","png","jpeg","webp"])i[m]=async g=>o[m](t,{...g||{},[Cl]:!0});i.jpg=i.jpeg;let a={...t,export:{url:n},exports:i},s=await tl("defineExports",a),l=Object.assign({},...s.filter(m=>m&&typeof m=="object").reverse()),d={...o,...l};d.jpeg&&!d.jpg&&(d.jpg=(m,g)=>d.jpeg(m,g));function c(m,g){let y={...t,...g||{}},x=v=>v==="jpeg"||v==="jpg"||v==="webp";return[m,y.format,y.type].map(v=>typeof v=="string"?v.toLowerCase():"").find(x)&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let u=!1,p=Promise.resolve();async function f(m,g){let y=Object.freeze(g&&typeof g=="object"?{...g}:{}),x=async()=>{let b=d[m];if(!b)throw new Error(`[snapdom] Unknown export type: ${m}`);let w=c(m,y),S={...t,export:{type:m,options:w,requestedOptions:y,url:n}};await Se("beforeExport",S,{format:m,options:w});let M=await b(S,w);return await Se("afterExport",S,{format:m,options:w,result:M}),u||(u=!0,await Se("afterSnap",t)),M},v=p.then(x);return p=v.catch(()=>{}),v}let h={url:n,toRaw:()=>n,to:(m,g)=>f(m,g),toImg:m=>f("img",m),toSvg:m=>f("svg",m),toCanvas:m=>f("canvas",m),toBlob:m=>f("blob",m),toPng:m=>f("png",m),toJpg:m=>f("jpg",m),toWebp:m=>f("webp",m),download:m=>f("download",m)};Object.defineProperty(h,"meta",{value:t.meta,enumerable:!0,writable:!1,configurable:!1});for(let m of Object.keys(d)){let g="to"+m.charAt(0).toUpperCase()+m.slice(1);h[g]||(h[g]=y=>f(m,y))}return h};H.toRaw=(e,t)=>H(e,t).then(r=>r.toRaw());H.toImg=(e,t)=>H(e,t).then(r=>r.toImg());H.toSvg=(e,t)=>H(e,t).then(r=>r.toSvg());H.toCanvas=(e,t)=>H(e,t).then(r=>r.toCanvas());H.toBlob=(e,t)=>H(e,t).then(r=>r.toBlob());H.toPng=(e,t)=>H(e,{...t,format:"png"}).then(r=>r.toPng());H.toJpg=(e,t)=>H(e,{...t,format:"jpeg"}).then(r=>r.toJpg());H.toWebp=(e,t)=>H(e,{...t,format:"webp"}).then(r=>r.toWebp());H.download=(e,t)=>H(e,t).then(r=>r.download());var ze=class{constructor(){R(this,"name","BrowserScriptScreenshotDriver")}async captureSelector(t){try{if(typeof document>"u")return{ok:!1,reason:"NO_DOCUMENT_ENVIRONMENT"};let r=document.querySelector(t);return r?await this.captureElement(r):{ok:!1,reason:`ELEMENT_NOT_FOUND: ${t}`}}catch(r){return{ok:!1,reason:r?.message||"UNKNOWN_CAPTURE_ERROR"}}}async captureElement(t){try{if(typeof window>"u"||typeof document>"u")return{ok:!1,reason:"NO_BROWSER_ENVIRONMENT"};let r=t.getBoundingClientRect(),n=Math.max(Math.round(r.width),10),o=Math.max(Math.round(r.height),10),i=(async()=>{try{let s,l="webp";try{if(typeof H=="function"){let d=await H(t,{scale:1,embedFonts:!1});if(d&&typeof d.toWebp=="function")s=await d.toWebp();else if(d&&typeof d.toPng=="function")s=await d.toPng(),l="png";else if(d?.url)return{ok:!0,dataUrl:d.url,format:"webp",width:n,height:o}}else H?.toWebp?s=await H.toWebp(t,{scale:1,embedFonts:!1}):H?.toPng&&(s=await H.toPng(t,{scale:1,embedFonts:!1}),l="png")}catch{}if(s&&s.src)return{ok:!0,dataUrl:s.src,format:s.src.startsWith("data:image/webp")?"webp":l,width:s.naturalWidth||n,height:s.naturalHeight||o}}catch(s){let l=String(s?.message||s);if(l.includes("CORS")||l.includes("SecurityError")||l.includes("tainted"))return{ok:!1,reason:"CROSS_ORIGIN_RESOURCE"}}return await this.captureWithSvgFallback(t,n,o)})(),a=new Promise(s=>{setTimeout(()=>s({ok:!1,reason:"CAPTURE_TIMEOUT"}),3e3)});return await Promise.race([i,a])}catch(r){return{ok:!1,reason:r?.message||"CAPTURE_EXCEPTION"}}}async captureWithSvgFallback(t,r,n){try{let o=t.cloneNode(!0),i=window.getComputedStyle(t),a="";for(let c=0;c<i.length;c++){let u=i[c];a+=`${u}:${i.getPropertyValue(u)};`}o.style.cssText=a,o.style.margin="0",o.style.position="static";let s=`
|
|
8
|
+
`):c+=p[0]}return c+=s.slice(u),c}let a=tn(e,t||location.href);return a=await i(a,t||location.href,0),a}var Gn=/url\((["']?)([^"')]+)\1\)/g,Ha=/@font-face[^{}]*\{[^}]*\}/g;function se(e,t,r=""){return(e.match(new RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||r).trim()}function Qn(e){if(!e)return[];let t=[],r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r){let o=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],s=l=>{if(!l.includes("?"))return parseInt(l,16);let d=parseInt(l.replace(/\?/g,"0"),16),c=parseInt(l.replace(/\?/g,"F"),16);return[d,c]};if(a){let l=s(i),d=s(a),c=Array.isArray(l)?l[0]:l,u=Array.isArray(d)?d[1]:d;t.push([Math.min(c,u),Math.max(c,u)])}else{let l=s(i);Array.isArray(l)?t.push([l[0],l[1]]):t.push([l,l])}}return t}function Kn(e,t){if(!t.length||!e||e.size===0)return!0;for(let r of e)for(let[n,o]of t)if(r>=n&&r<=o)return!0;return!1}function yr(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(Gn)){let o=(n[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}r.push(o)}}return r}async function er(e,t,r=""){let n=e;for(let o of e.matchAll(Gn)){let i=dr(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!be(a)){if(k.resource?.has(a)){k.font?.add(a),n=n.replace(o[0],`url(${k.resource.get(a)})`);continue}try{let s=await le(a,{as:"dataURL",useProxy:r,silent:!0});if(s.ok&&typeof s.data=="string"){let l=s.data;k.resource?.set(a,l),k.font?.add(a),n=n.replace(o[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return n}function _a(e){if(!e.length)return null;let t=(a,s)=>e.some(([l,d])=>!(d<a||l>s)),r=t(0,255)||t(305,305),n=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":n?"latin-ext":r?"latin":null}function rn(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),r=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),n=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(r.size)for(let a of o.srcUrls)try{if(r.has(new URL(a).host.toLowerCase()))return!0}catch{}if(n.size){let a=_a(i);if(a&&n.has(a))return!0}return!1}}function Da(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let i of e.match(t)||[]){let a=se(i,"font-family"),s=br(a),l=se(i,"font-weight","400"),d=se(i,"font-style","normal"),c=se(i,"font-stretch","100%"),u=se(i,"unicode-range"),p=se(i,"src"),f=yr(p,location.href),h=f.length?f.map(g=>String(g).toLowerCase()).sort().join("|"):p.toLowerCase(),m=[String(s||"").toLowerCase(),l,d,c,u.toLowerCase(),h].join("|");r.has(m)||(r.add(m),n.push(i))}if(n.length===0)return e;let o=0;return e.replace(t,()=>n[o++]||"")}var nn=new WeakMap,Wa=0;function Ba(e){let t=nn.get(e);return t===void 0&&(t=Wa++,nn.set(e,t)),t}function ja(e,t,r,n,o,i){let a=Array.from(e||[]).sort().join("|"),s=t?JSON.stringify({families:(t.families||[]).map(p=>String(p).toLowerCase()).sort(),domains:(t.domains||[]).map(p=>String(p).toLowerCase()).sort(),subsets:(t.subsets||[]).map(p=>String(p).toLowerCase()).sort()}):"",l=(r||[]).map(p=>`${(p.family||"").toLowerCase()}::${p.weight||"normal"}::${p.style||"normal"}::${p.src||""}`).sort().join("|"),d=n||"",c=(o||[]).map(p=>String(p).toLowerCase()).sort().join("|"),u=Ba(i||document);return`fonts-embed-css::req=${a}::ex=${s}::lf=${l}::px=${d}::fd=${c}::doc=${u}`}async function Jn(e,t,r,n){let o;try{o=e.cssRules||[]}catch{return}let i=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?i(a.href,t):t;if(n.depth>=$t){console.warn(`[snapDOM] CSSOM import depth exceeded (${$t}) at ${s}`);continue}if(s&&n.visitedSheets.has(s)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${s}`);continue}s&&n.visitedSheets.add(s);let l={...n,depth:(n.depth||0)+1};await Jn(a.styleSheet,s,r,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),l=br(s);if(!l||be(l))continue;let d=(a.style.getPropertyValue("font-weight")||"").trim(),c=(a.style.getPropertyValue("font-style")||"").trim(),u=(a.style.getPropertyValue("font-stretch")||"").trim(),p=(a.style.getPropertyValue("font-variation-settings")||"").trim(),f=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim(),m=d||"400",g=c||"normal",y=u||"100%",x=(c?`font-style:${c};`:"")+(d?`font-weight:${d};`:"")+(u?`font-stretch:${u};`:"")+(p?`font-variation-settings:${p};`:"")+(h?`unicode-range:${h};`:""),v=n.faceMatchesRequired(l,g,m,y);if(!v&&!n.requiredIndex.has(l.toLowerCase()))continue;let b=Qn(h);if(!Kn(n.usedCodepoints,b))continue;let w={family:l,weightSpec:m,styleSpec:g,stretchSpec:y,unicodeRange:h,srcRaw:f,srcUrls:yr(f,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(w,b))continue;if(!v){n.provisionalFaces.push({family:l.toLowerCase(),block:`@font-face{font-family:${l};src:${f};${x}}`,srcRaw:f,baseHref:t||location.href});continue}if(n.coveredFamilies.add(l.toLowerCase()),/url\(/i.test(f)){let S=await er(f,t||location.href,n.useProxy);await r(`@font-face{font-family:${l};src:${S};${x}}`)}else await r(`@font-face{font-family:${l};src:${f};${x}}`)}}}async function Ua({required:e,usedCodepoints:t,exclude:r=void 0,localFonts:n=[],useProxy:o="",fontStylesheetDomains:i=[],doc:a=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let s=new Map;for(let b of e){let[w,S,M,C]=String(b).split("__");if(!w)continue;let E=w.toLowerCase(),$=s.get(E)||[];$.push({w:parseInt(S,10),s:M,st:parseInt(C,10)}),s.set(E,$)}function l(b,w,S,M){let C=String(b).toLowerCase();if(!s.has(C))return!1;let E=s.get(C),$=Ra(S),R=Ta(w),L=La(M),H=$.min!==$.max,P=$.min,I=O=>R.kind==="normal"&&O==="normal"||R.kind!=="normal"&&(O==="italic"||O==="oblique"),T=!1;for(let O of E){let X=H?O.w>=$.min&&O.w<=$.max:O.w===P,U=I(vt(O.s)),V=O.st>=L.min&&O.st<=L.max;if(X&&U&&V){T=!0;break}}if(T)return!0;if(!H)for(let O of E){let X=I(vt(O.s)),U=O.st>=L.min&&O.st<=L.max;if(Math.abs(P-O.w)<=300&&X&&U)return!0}if(!H&&R.kind==="normal"&&E.some(O=>vt(O.s)!=="normal"))for(let O of E){let X=Math.abs(P-O.w)<=300,U=O.st>=L.min&&O.st<=L.max;if(X&&U)return!0}return!1}let d=rn(r),c=ja(e,r,n,o,i,a);if(k.resource?.has(c))return k.resource.get(c);let u=Ia(e),p=[],f=Zt;for(let b of a.querySelectorAll("style")){let w=b.textContent||"";for(let S of w.matchAll(f)){let M=(S[2]||S[4]||"").trim();!M||be(M)||a.querySelector(`link[rel="stylesheet"][href="${M}"]`)||p.push(M)}}let h=[];p.length&&await Promise.all(p.map(b=>new Promise(w=>{if(a.querySelector(`link[rel="stylesheet"][href="${b}"]`))return w(null);let S=a.createElement("link");S.rel="stylesheet",S.href=b,S.setAttribute("data-snapdom","injected-import"),S.onload=()=>w(S),S.onerror=()=>w(null),a.head.appendChild(S),h.push(S)})));let m="",g=new Set,y=[],x=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(b=>!!b.href);for(let b of h)try{b.remove()}catch{}for(let b of x)try{if(be(b.href))continue;let w="",S=!1;try{S=new URL(b.href,location.href).origin===location.origin}catch{}if(!S){let C=Array.isArray(i)?i:[];if(!Fa(b.href,u,C))continue}if(S){let C=Array.from(a.styleSheets).find(E=>E.href===b.href);if(C)try{let E=C.cssRules||[];w=Array.from(E).map($=>$.cssText).join("")}catch{}}if(!w){let C=await le(b.href,{as:"text",useProxy:o});if(C?.ok&&typeof C.data=="string"&&(w=C.data),be(b.href))continue}w=await Oa(w,b.href,o);let M="";for(let C of w.match(Ha)||[]){let E=se(C,"font-family"),$=br(E);if(!$||be($))continue;let R=se(C,"font-weight","400"),L=se(C,"font-style","normal"),H=se(C,"font-stretch","100%"),P=se(C,"unicode-range"),I=se(C,"src"),T=yr(I,b.href),O=l($,L,R,H);if(!O&&!s.has($.toLowerCase()))continue;let X=Qn(P);if(!Kn(t,X))continue;let U={family:$,weightSpec:R,styleSpec:L,stretchSpec:H,unicodeRange:P,srcRaw:I,srcUrls:T,href:b.href};if(r&&d(U,X))continue;if(!O){y.push({family:$.toLowerCase(),block:C,srcRaw:I,baseHref:b.href});continue}g.add($.toLowerCase());let V=/url\(/i.test(I)?await er(C,b.href,o):C;M+=V}M.trim()&&(m+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",b.href)}let v={requiredIndex:s,usedCodepoints:t,faceMatchesRequired:l,coveredFamilies:g,provisionalFaces:y,simpleExcluder:r?rn(r):null,useProxy:o,visitedSheets:new Set,depth:0};for(let b of a.styleSheets)if(!(b.href&&x.some(w=>w.href===b.href)))try{let w=b.href||location.origin+"/";w&&v.visitedSheets.add(w),await Jn(b,w,async S=>{m+=S},v)}catch{}for(let b of y)g.has(b.family)||(m+=/url\(/i.test(b.srcRaw)?await er(b.block,b.baseHref,o):b.block);try{for(let b of a.fonts||[]){if(!b||!b.family||b.status!=="loaded"||!b._snapdomSrc)continue;let w=String(b.family).replace(/^['"]+|['"]+$/g,"");if(be(w)||!s.has(w.toLowerCase())||r?.families&&r.families.some(M=>String(M).toLowerCase()===w.toLowerCase()))continue;let S=b._snapdomSrc;if(!String(S).startsWith("data:")){if(k.resource?.has(b._snapdomSrc))S=k.resource.get(b._snapdomSrc),k.font?.add(b._snapdomSrc);else if(!k.font?.has(b._snapdomSrc))try{let M=await le(b._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(M.ok&&typeof M.data=="string")S=M.data,k.resource?.set(b._snapdomSrc,S),k.font?.add(b._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",b._snapdomSrc);continue}}m+=`@font-face{font-family:'${w}';src:url(${S});font-style:${b.style||"normal"};font-weight:${b.weight||"normal"};}`}}catch{}for(let b of n){if(!b||typeof b!="object")continue;let w=String(b.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||be(w)||!s.has(w.toLowerCase())||r?.families&&r.families.some(R=>String(R).toLowerCase()===w.toLowerCase()))continue;let S=b.weight!=null?String(b.weight):"normal",M=b.style!=null?String(b.style):"normal",C=b.stretchPct!=null?`${b.stretchPct}%`:"100%",E=String(b.src||""),$=E;if(!$.startsWith("data:")){if(k.resource?.has(E))$=k.resource.get(E),k.font?.add(E);else if(!k.font?.has(E))try{let R=await le(E,{as:"dataURL",useProxy:o,silent:!0});if(R.ok&&typeof R.data=="string")$=R.data,k.resource?.set(E,$),k.font?.add(E);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",E);continue}}m+=`@font-face{font-family:'${w}';src:url(${$});font-style:${M};font-weight:${S};font-stretch:${C};}`}return m&&(m=Da(m),k.resource?.set(c,m)),m}function Zn(e,t){let r=new Set,n=new Set;if(!e)return{required:r,usedCodepoints:n};let o=l=>{if(l)for(let d of l)n.add(d.codePointAt(0))},i=l=>{let d=Aa(l.fontFamily);if(d.length)for(let c of d)r.add(`${c}__${xt(l.fontWeight)}__${vt(l.fontStyle)}__${Na(l.fontStretch)}`)},a=l=>{i(B(l));for(let d of["::before","::after"]){let c=B(l,d),u=c&&c.content;if(!(!u||u==="none"||u==="normal"))if(i(c),/^["']/.test(u))o(u.slice(1,-1));else{let p=u.match(/\\[0-9A-Fa-f]{1,6}/g);if(p)for(let f of p)try{n.add(parseInt(f.slice(1),16))}catch{}}}};a(e);let s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let l=s.currentNode;if(l.nodeType===Node.TEXT_NODE){if(t&&l.parentElement&&!t(l.parentElement))continue;o(l.nodeValue||"")}else{if(t&&!t(l))continue;a(l)}}return{required:r,usedCodepoints:n}}function qa(e,t){return Zn(e,t).required}async function eo(e,t=2,r=document){try{await r.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let i=r.createElement("div");i.setAttribute("data-snapdom-internal",""),i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let a of n){let s=r.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${a}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",i.appendChild(s)}r.body.appendChild(i),i.offsetWidth,r.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)o(),await Me(),await Me()}function za(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function on(e,t=!1){let r="",n=Math.max(1,e);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return t?r.toUpperCase():r}function an(e,t=!0){let r=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of r)for(;n>=i;)o+=a,n-=i;return t?o:o.toLowerCase()}function sn(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let r=Math.abs(e);return(e<0?"-":"")+(r<10?"0":"")+String(r)}case"lower-alpha":return on(e,!1);case"upper-alpha":return on(e,!0);case"lower-roman":return an(e,!1);case"upper-roman":return an(e,!0);default:return String(e)}}function Va(e){let t=new WeakMap,r=e instanceof Document?e.documentElement:e,n=d=>d&&d.tagName==="LI",o=d=>{let c=0,u=d?.parentElement;if(!u)return 0;for(let p of u.children){if(p===d)break;p.tagName==="LI"&&c++}return c},i=d=>{let c=new Map;for(let[u,p]of d)c.set(u,p.slice());return c},a=(d,c,u)=>{let p=i(d),f;try{f=u.style?.counterReset||getComputedStyle(u).counterReset}catch{}if(f&&f!=="none")for(let g of f.split(",")){let y=g.trim().split(/\s+/),x=y[0],v=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!x)continue;let b=c.get(x);if(b&&b.length){let w=b.slice();w.push(v),p.set(x,w)}else p.set(x,[v])}let h;try{h=u.style?.counterSet||getComputedStyle(u).counterSet}catch{}if(h&&h!=="none")for(let g of h.split(",")){let y=g.trim().split(/\s+/),x=y[0],v=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!x)continue;let b=p.get(x)||[];b.length===0&&b.push(0),b[b.length-1]=v,p.set(x,b)}let m;try{m=u.style?.counterIncrement||getComputedStyle(u).counterIncrement}catch{}if(m&&m!=="none")for(let g of m.split(",")){let y=g.trim().split(/\s+/),x=y[0],v=Number.isFinite(Number(y[1]))?Number(y[1]):1;if(!x)continue;let b=p.get(x)||[];b.length===0&&b.push(0),b[b.length-1]+=v,p.set(x,b)}try{if(getComputedStyle(u).display==="list-item"&&n(u)){let g=u.parentElement,y=1;if(g&&g.tagName==="OL"){let v=g.getAttribute("start"),b=Number.isFinite(Number(v))?Number(v):1,w=o(u),S=u.getAttribute("value");y=Number.isFinite(Number(S))?Number(S):b+w}else y=1+o(u);let x=p.get("list-item")||[];x.length===0&&x.push(0),x[x.length-1]=y,p.set("list-item",x)}}catch{}return p},s=(d,c,u)=>{let p=a(u,c,d);t.set(d,p);let f=p;for(let m of d.children)f=s(m,p,f);let h=new Map;for(let[m,g]of u){let y=g.length,x=f.get(m);h.set(m,x&&x.length?x.slice(0,y):g.slice())}for(let[m,g]of f)!h.has(m)&&g.length&&!c.has(m)&&h.set(m,g.slice(0,1));return h},l=new Map;return s(r,l,l),{get(d,c){let u=t.get(d)?.get(c);return u&&u.length?u[u.length-1]:0},getStack(d,c){let u=t.get(d)?.get(c);return u?u.slice():[]}}}function Xa(e,t,r){if(!e||e==="none")return e;try{let n=/\b(counter|counters)\s*\(([^)]+)\)/g;return e.replace(n,(o,i,a)=>{let s=String(a).split(",").map(l=>l.trim());if(i==="counter"){let l=s[0]?.replace(/^["']|["']$/g,""),d=(s[1]||"decimal").toLowerCase(),c=r.get(t,l);return sn(c,d)}else{let l=s[0]?.replace(/^["']|["']$/g,""),d=s[1]?.replace(/^["']|["']$/g,"")??"",c=(s[2]||"decimal").toLowerCase(),u=r.getStack(t,l);return u.length?u.map(p=>sn(p,c)).join(d):""}})}catch{return"- "}}$e();var Le=new WeakMap,ln=1e3;function Ya(e,t){let r=to(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=dn(e,r),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):dn(e,r)}function tr(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function to(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${t.length}|`,n=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;r+=`S${s}|`;let l=a.sheet,d=l?tr(l):null;d&&(n+=d.length)}else{let s=a.getAttribute("href")||"",l=a.getAttribute("media")||"all";r+=`L${s}|m:${l}|`;let d=a.sheet,c=d?tr(d):null;c&&(n+=c.length)}}let o=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(o)?o.length:0}|tr:${n}`,r}function cn(e,t,r){let n=tr(e);if(!n)return!1;for(let o=0;o<n.length;o++){if(r.budget<=0)return!1;let i=n[o],a=i&&i.cssText?i.cssText:"";r.budget--;for(let s of t)if(a.includes(s))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let s=0;s<i.cssRules.length&&r.budget>0;s++){let l=i.cssRules[s],d=l&&l.cssText?l.cssText:"";r.budget--;for(let c of t)if(d.includes(c))return!0}if(r.budget<=0)return!1}return!1}function dn(e=document,t=to(e)){let r=Le.get(e);if(r&&r.fingerprint===t)return r.result;let n=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a<o.length;a++){let s=o[a].textContent||"";for(let l of n)if(s.includes(l))return Le.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:ln};try{for(let s of i)if(cn(s,n,a))return Le.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:ln};for(let l=0;l<a.length&&s.budget>0;l++){let d=a[l],c=null;if(d.tagName,c=d.sheet||null,c&&cn(c,n,s))return Le.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(e,{fingerprint:t,result:!0}),!0):(Le.set(e,{fingerprint:t,result:!1}),!1)}function un(e){for(let t of["Top","Right","Bottom","Left"]){let r=parseFloat(e[`border${t}Width`])||0,n=e[`border${t}Style`];if(r>0&&n&&n!=="none"&&n!=="hidden")return!0}return!1}function Ga(e,t){let r=null,n=()=>{if(!r)try{r=Va(e)}catch(o){j(t,"buildCounterContext failed",o),r={get:()=>0,getStack:()=>[]}}return r};return{get(o,i){return n().get(o,i)},getStack(o,i){return n().getStack(o,i)}}}function Qa(e){let t=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==='"')t=!t;else if(n==="/"&&!t)return e.slice(0,r).trim()}return e}function Ka(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n=0,o;for(;o=r.exec(e);){let a=e.slice(n,o.index).trim();a&&t.push(a),t.push(o[1]),n=r.lastIndex}let i=e.slice(n).trim();return i&&t.push(i),t.join("")}function rr(e,t,r){let n=e.parentElement,o=n&&r?r.get(n):null;return o?{get(i,a){let s=t.get(i,a),l=o.get(a);return typeof l=="number"?Math.max(s,l):s},getStack(i,a){let s=t.getStack(i,a);if(!s.length)return s;let l=o.get(a);if(typeof l=="number"){let d=s.slice();return d[d.length-1]=Math.max(d[d.length-1],l),d}return s}}:t}function nr(e,t,r){let n=new Map;function o(d){let c=[];if(!d||d==="none")return c;for(let u of String(d).split(",")){let p=u.trim().split(/\s+/),f=p[0],h=Number.isFinite(Number(p[1]))?Number(p[1]):void 0;f&&c.push({name:f,num:h})}return c}let i=o(t?.counterReset),a=o(t?.counterSet),s=o(t?.counterIncrement);function l(d){if(n.has(d))return n.get(d).slice();let c=r.getStack(e,d);c=c.length?c.slice():[];let u=i.find(h=>h.name===d);if(u){let h=Number.isFinite(u.num)?u.num:0;c=c.length?[...c,h]:[h]}let p=a.find(h=>h.name===d);if(p){let h=Number.isFinite(p.num)?p.num:0;c.length===0&&(c=[0]),c[c.length-1]=h}let f=s.find(h=>h.name===d);if(f){let h=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=h}return n.set(d,c.slice()),c}return{get(d,c){let u=l(c);return u.length?u[u.length-1]:0},getStack(d,c){return l(c)},__incs:s}}function Ja(e,t,r,n){let o;try{o=B(e,t)}catch{}let i=o?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};i=Qa(i);let a=rr(e,r,n),s=nr(e,o,a),l=za(i)?Xa(i,e,s):i;return{text:Ka(l),incs:s.__incs||[]}}async function or(e,t,r,n){if(e?.nodeType!==1||t?.nodeType!==1||e.tagName==="TEXTAREA")return;let o=e.ownerDocument||document;if(!Ya(o,r))return;r.__siblingCounters||(r.__siblingCounters=new WeakMap),r.__counterCtx||(r.__counterCtx=Ga(e.ownerDocument||document,r));let i=r.__counterCtx;for(let s of["::before","::after","::first-letter"])try{let l=B(e,s);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&!un(l)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(s==="::first-letter"){let F=B(e),W=(F?.display||"").toLowerCase();if(W.includes("flex")||W.includes("grid"))continue;let _=ee=>l[ee]!==F[ee]&&(parseFloat(l[ee])||0)!==0;if(!(l.color!==F.color||l.fontSize!==F.fontSize||l.fontWeight!==F.fontWeight||l.fontFamily!==F.fontFamily||l.fontStyle!==F.fontStyle||l.textTransform!==F.textTransform||l.float!==F.float&&l.float!=="none"||_("paddingTop")||_("paddingRight")||_("paddingBottom")||_("paddingLeft")||_("marginTop")||_("marginRight")||_("marginBottom")||_("marginLeft")))continue;let q=Array.from(t.childNodes).find(ee=>ee.nodeType===Node.TEXT_NODE&&ee.textContent?.trim().length>0);if(!q)continue;let ce=q.textContent,Q=ce.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],te=ce.slice(Q?.length||0);if(!Q||/[\uD800-\uDFFF]/.test(Q))continue;let oe=document.createElement("span");oe.textContent=Q,oe.dataset.snapdomPseudo="::first-letter";let J=Dr(l),he=Vt(J,"span");r.styleMap.set(oe,he);let Ce=document.createTextNode(te);t.replaceChild(Ce,q),t.insertBefore(oe,Ce);continue}let d=l.content??"",c=d===""||d==="none"||d==="normal",{text:u,incs:p}=Ja(e,s,i,r.__siblingCounters),f=l.backgroundImage,h=l.backgroundColor,m=l.fontFamily,g=parseInt(l.fontSize)||32,y=parseInt(l.fontWeight)||!1,x=l.color||"#000",v=l.transform,b=be(m),w=!c&&u!=="",S=f&&f!=="none",M=h&&h!=="transparent"&&h!=="rgba(0, 0, 0, 0)",C=un(l),E=v&&v!=="none",$=d!=="none"&&d!=="normal",R=$&&((parseFloat(l.width)||0)>0||(parseFloat(l.height)||0)>0),L=$&&l.boxShadow&&l.boxShadow!=="none",H=$&&l.outlineStyle&&l.outlineStyle!=="none"&&(parseFloat(l.outlineWidth)||0)>0;if(!(w||S||M||C||E||R||L||H)){if(p&&p.length&&e.parentElement){let F=r.__siblingCounters.get(e.parentElement)||new Map;for(let{name:W}of p){if(!W)continue;let _=rr(e,i,r.__siblingCounters),q=nr(e,B(e,s),_).get(e,W);F.set(W,q)}r.__siblingCounters.set(e.parentElement,F)}continue}let P=u.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(u),I=!1;if(w&&!b&&u.length>1&&!P){let F=B(e),W=parseFloat(F.fontSize)||16,_=parseFloat(F.lineHeight);Number.isFinite(_)||(_=W*1.5),e.getBoundingClientRect().height<_*1.6&&(t.style.whiteSpace="nowrap",I=!0)}let T=document.createElement("span");T.dataset.snapdomPseudo=s,T.style.pointerEvents="none",I&&(T.style.whiteSpace="nowrap");let O=Dr(l),X=(B(e).display||"").toLowerCase(),U=X.includes("flex")||X.includes("grid");if(U){let F=O["min-width"];(!F||F==="auto"||F==="0px")&&(O["min-width"]="0px")}let V=Vt(O,"span",w,U);if(r.styleMap.set(T,V),b&&u&&u.length===1){let{dataUrl:F,width:W,height:_}=await Ea(u,m,y,g,x),q=document.createElement("img");q.src=F,q.style=`height:${g}px;width:${W/_*g}px;object-fit:contain;`,T.appendChild(q),t.dataset.snapdomHasIcon="true"}else if(u&&P){let F=yn(u,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??dr(u);if(F?.trim())try{let W=await le(Ct(F),{as:"dataURL",useProxy:n.useProxy});if(W?.ok&&typeof W.data=="string"){let _=document.createElement("img");_.src=W.data,_.style=`width:${g}px;height:auto;object-fit:contain;`,T.appendChild(_)}}catch(W){console.error(`[snapdom] Error in pseudo ${s} for`,e,W)}}else!b&&w&&(T.textContent=u);T.style.backgroundImage="none","maskImage"in T.style&&(T.style.maskImage="none"),"webkitMaskImage"in T.style&&(T.style.webkitMaskImage="none");try{T.style.backgroundRepeat=l.backgroundRepeat,T.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(T.style.backgroundPositionX=l.backgroundPositionX,T.style.backgroundPositionY=l.backgroundPositionY):T.style.backgroundPosition=l.backgroundPosition,T.style.backgroundOrigin=l.backgroundOrigin,T.style.backgroundClip=l.backgroundClip,T.style.backgroundAttachment=l.backgroundAttachment,T.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(S)try{let F=Xt(f),W=await Promise.all(F.map(xn));T.style.backgroundImage=W.join(", ")}catch(F){console.warn(`[snapdom] Failed to inline background-image for ${s}`,F)}M&&(T.style.backgroundColor=h);let K=T.childNodes.length>0||T.textContent?.trim()!==""||S||M||C||E||R||L||H;if(p&&p.length&&e.parentElement){let F=r.__siblingCounters.get(e.parentElement)||new Map,W=rr(e,i,r.__siblingCounters),_=nr(e,B(e,s),W);for(let{name:q}of p){if(!q)continue;let ce=_.get(e,q);F.set(q,ce)}r.__siblingCounters.set(e.parentElement,F)}if(!K)continue;s==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(T,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(T))}catch(l){console.warn(`[snapdom] Failed to capture ${s} for`,e,l)}let a=Array.from(t.children).filter(s=>!s.dataset.snapdomPseudo);if(r.nodeMap)for(let s of a){let l=r.nodeMap.get(s);l?.nodeType===1&&await or(l,s,r,n)}else{let s=Array.from(e.children);for(let l=0;l<Math.min(s.length,a.length);l++)await or(s[l],a[l],r,n)}}function Za(e,t){if(!e||e?.nodeType!==1)return;let r=e.ownerDocument||document,n=t||r,o=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(o.length===0)return;let i=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",d=b=>{if(!b||!b.getAttribute)return null;let w=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(l,"href"):null);if(w)return w;let S=b.attributes;if(!S)return null;for(let M=0;M<S.length;M++){let C=S[M];if(!C||!C.name)continue;if(C.name==="href")return C.value;let E=C.name.indexOf(":");if(E!==-1&&C.name.slice(E+1)==="href")return C.value}return null},c=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),u=new Set,p=!1,f=(b,w=null)=>{if(!b)return;i.lastIndex=0;let S;for(;S=i.exec(b);){p=!0;let M=(S[1]||"").trim();M&&(c.has(M)||(u.add(M),w&&!w.has(M)&&w.add(M)))}},h=b=>{let w=b.querySelectorAll("use");for(let C of w){let E=d(C);if(!E||!E.startsWith("#"))continue;p=!0;let $=E.slice(1).trim();$&&!c.has($)&&u.add($)}let S='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';f(b.getAttribute("style")||"");for(let C of a)f(b.getAttribute(C));let M=b.querySelectorAll(S);for(let C of M){f(C.getAttribute("style")||"");for(let E of a)f(C.getAttribute(E))}};for(let b of o)h(b);if(!p)return;let m=e.querySelector("svg.inline-defs-container");m||(m=r.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(m,e.firstChild||null));let g=m.querySelector("defs")||null,y=b=>{if(!b||c.has(b))return null;let w=s(b),S=M=>{let C=n.querySelector(M);return C&&!e.contains(C)?C:null};return S(`svg defs > *#${w}`)||S(`svg > symbol#${w}`)||S(`*#${w}`)};if(!u.size)return;let x=new Set(u),v=new Set;for(;x.size;){let b=x.values().next().value;if(x.delete(b),!b||c.has(b)||v.has(b))continue;let w=y(b);if(!w){v.add(b);continue}g||(g=r.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(g));let S=w.cloneNode(!0);S.id||S.setAttribute("id",b),g.appendChild(S),v.add(b),c.add(b);let M=[S,...S.querySelectorAll("*")];for(let C of M){let E=d(C);if(E&&E.startsWith("#")){let R=E.slice(1).trim();R&&!c.has(R)&&!v.has(R)&&x.add(R)}let $=C.getAttribute?.("style")||"";$&&f($,x);for(let R of a){let L=C.getAttribute?.(R);L&&f(L,x)}}}}ne();function es(e){let t=getComputedStyle(e),r=t.outlineStyle,n=t.outlineWidth,o=t.borderStyle,i=t.borderWidth,a=r!=="none"&&parseFloat(n)>0,s=o==="none"||parseFloat(i)===0;if(a&&s){let l=e.style.border;return e.style.border=`${n} solid transparent`,()=>{e.style.border=l}}return()=>{}}function ts(e){let t=[];try{let r=e.querySelectorAll("*");for(let n of r){if(!(n instanceof HTMLElement))continue;let o=n.style.contentVisibility||"",i=getComputedStyle(n);(i.contentVisibility||i.getPropertyValue("content-visibility")||"")==="auto"&&(t.push({el:n,original:o}),n.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e);(n.contentVisibility||n.getPropertyValue("content-visibility")||"")==="auto"&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:r,original:n}of t)try{r.style.contentVisibility=n}catch{}}}de();Rt();function rs(e){return ro(e.boxShadow)}function ns(e){return ro(e.textShadow)}function ro(e){if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let t=[],r="",n=0;for(let l=0;l<e.length;l++){let d=e[l];d==="("?n++:d===")"&&(n=Math.max(0,n-1)),d===","&&n===0?(t.push(r),r=""):r+=d}r.trim()&&t.push(r);let o=0,i=0,a=0,s=0;for(let l of t){if(/\binset\b/i.test(l))continue;let d=l.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(d.length<2)continue;let[c,u,p=0,f=0]=d,h=Math.abs(c)+p+f,m=Math.abs(u)+p+f;i=Math.max(i,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),a=Math.max(a,m+Math.max(u,0)),o=Math.max(o,m+Math.max(-u,0))}return{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(a),left:Math.ceil(s)}}function os(e){let t=e.filter&&e.filter!=="none"?e.filter:e.webkitFilter||"",r=/blur\(\s*([0-9.]+)px\s*\)/gi,n=0,o;for(;o=r.exec(t);)n+=parseFloat(o[1])||0;let i=Math.ceil(n);return{top:i,right:i,bottom:i,left:i}}function is(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),r=parseFloat(e.outlineOffset||"0")||0,n=t+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}function as(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,o=0,i=0,a=0,s=!1;for(let l of r){s=!0;let d=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(m=>parseFloat(m))||[],[c=0,u=0,p=0]=d,f=Math.abs(c)+p,h=Math.abs(u)+p;o=Math.max(o,f+Math.max(c,0)),a=Math.max(a,f+Math.max(-c,0)),i=Math.max(i,h+Math.max(u,0)),n=Math.max(n,h+Math.max(-u,0))}return{bleed:{top:A(n),right:A(o),bottom:A(i),left:A(a)},has:s}}function ss(e,t){if(!e||!t||!t.style)return null;let r=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let n=r.transform||"none";if(!n||n==="none"){let s=null;try{s=At(e).scale}catch{}try{t.style.transform="none"}catch{}if(!s)return{a:1,b:0,c:0,d:1};let l=s.trim().split(/\s+/).map(parseFloat),d=Number.isFinite(l[0])?l[0]:1,c=Number.isFinite(l[1])?l[1]:d;return{a:d,b:0,c:0,d:c}}function o(s,l,d,c){let u=Math.sqrt(s*s+l*l)||0,p=0,f=0;if(u>0){let h=s/u,m=l/u;p=h*d+m*c;let g=d-h*p,y=c-m*p;f=Math.sqrt(g*g+y*y)||0,f>0?p=p/f:p=0}return{a:u,b:0,c:p*f,d:f}}let i=n.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let s=i[1].split(",").map(l=>parseFloat(l.trim()));if(s.length===6&&s.every(Number.isFinite)){let[l,d,c,u]=s,p=o(l,d,c,u);try{t.style.transform=`matrix(${p.a}, ${p.b}, ${p.c}, ${p.d}, 0, 0)`}catch{}return p}}let a=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let s=a[1].split(",").map(l=>parseFloat(l.trim()));if(s.length===16&&s.every(Number.isFinite)){let l=s[0],d=s[1],c=s[4],u=s[5],p=o(l,d,c,u);try{t.style.transform=`matrix(${p.a}, ${p.b}, ${p.c}, ${p.d}, 0, 0)`}catch{}return p}}try{let s=new DOMMatrix(n),l=o(s.a,s.b,s.c,s.d);try{t.style.transform=`matrix(${l.a}, ${l.b}, ${l.c}, ${l.d}, 0, 0)`}catch{}return l}catch{return null}}function St(e,t,r,n,o){let i=r.a,a=r.b,s=r.c,l=r.d,d=r.e||0,c=r.f||0;function u(y,x){let v=y-n,b=x-o,w=i*v+s*b,S=a*v+l*b;return w+=n+d,S+=o+c,[w,S]}let p=[u(0,0),u(e,0),u(0,t),u(e,t)],f=1/0,h=1/0,m=-1/0,g=-1/0;for(let[y,x]of p)y<f&&(f=y),x<h&&(h=x),y>m&&(m=y),x>g&&(g=x);return{minX:f,minY:h,maxX:m,maxY:g,width:m-f,height:g-h}}function ir(e,t,r){let n=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[n[0]||"0",n[1]||"0"],a=(s,l)=>{let d=s.toLowerCase();return d==="left"||d==="top"?0:d==="center"?l/2:d==="right"||d==="bottom"?l:d.endsWith("px")?parseFloat(d)||0:d.endsWith("%")?(parseFloat(d)||0)*l/100:/^-?\d+(\.\d+)?$/.test(d)&&parseFloat(d)||0};return{ox:a(o,t),oy:a(i,r)}}function At(e){let t={rotate:"0deg",scale:null,translate:null},r=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(r){let o=l=>{try{return typeof r.has=="function"&&!r.has(l)||typeof r.get!="function"?null:r.get(l)}catch{return null}},i=o("rotate");if(i)if(i.angle){let l=i.angle;t.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let l=getComputedStyle(e);t.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=o("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,d="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;t.scale=`${l} ${d}`}else{let l=getComputedStyle(e);t.scale=l.scale&&l.scale!=="none"?l.scale:null}let s=o("translate");if(s){let l="x"in s&&"value"in s.x?s.x.value:Array.isArray(s)?s[0]?.value:0,d="y"in s&&"value"in s.y?s.y.value:Array.isArray(s)?s[1]?.value:0,c="x"in s&&s.x?.unit?s.x.unit:"px",u="y"in s&&s.y?.unit?s.y.unit:"px";t.translate=`${l}${c} ${d}${u}`}else{let l=getComputedStyle(e);t.translate=l.translate&&l.translate!=="none"?l.translate:null}return t}let n=getComputedStyle(e);return t.rotate=n.rotate&&n.rotate!=="none"?n.rotate:"0deg",t.scale=n.scale&&n.scale!=="none"?n.scale:null,t.translate=n.translate&&n.translate!=="none"?n.translate:null,t}var Ut=null;function ls(){if(Ut)return Ut;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Ut=e,e}function cs(e){let t=ls(),r=document.createElement("div");r.style.transformOrigin="0 0",e.baseTransform&&(r.style.transform=e.baseTransform),e.rotate&&(r.style.rotate=e.rotate),e.scale&&(r.style.scale=e.scale),e.translate&&(r.style.translate=e.translate),t.appendChild(r);let n=us(r);return t.removeChild(r),n}function ds(e){let t=B(e),r=t.transform||"none";if(r!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(n||o||i)}function us(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}var ar="http://www.w3.org/1999/xhtml",no=new WeakSet;function oo(e,t){if(!t)return null;let r=e.ownerDocument||document,n=r.defaultView||window,o,i,a,s;if(t==="viewport")o=0,i=0,a=r.documentElement?.clientWidth||n.innerWidth,s=r.documentElement?.clientHeight||n.innerHeight;else if(typeof t=="object")o=(Number(t.x)||0)-(n.scrollX||0),i=(Number(t.y)||0)-(n.scrollY||0),a=Number(t.width),s=Number(t.height);else return null;return a>0&&s>0?{left:o,top:i,width:a,height:s,right:o+a,bottom:i+s}:null}function sr(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return t instanceof ShadowRoot?t.host:null}function ps(e,t){for(let r=t;r;r=sr(r))if(r===e)return!0;return!1}function fs(e,t){for(let r=sr(e);r&&r!==t&&r?.nodeType===1;r=sr(r)){let n=B(r);if(n.position!=="static"||n.transform&&n.transform!=="none"||n.filter&&n.filter!=="none"||n.backdropFilter&&n.backdropFilter!=="none"||n.perspective&&n.perspective!=="none"||/transform|perspective|filter/.test(n.willChange||"")||/layout|paint|strict|content/.test(n.contain||""))return r}return null}function io(e,t){try{let r=new DOMMatrix;if(t&&t.rotate&&t.rotate!=="0deg"&&(r=r.multiply(new DOMMatrix(`rotate(${t.rotate})`))),t&&t.scale){let n=String(t.scale).trim().split(/\s+/).filter(Boolean);n.length&&n.every(o=>Number.isFinite(Number(o)))&&(r=r.multiply(new DOMMatrix(`scale(${n.join(",")})`)))}return e&&(r=r.multiply(new DOMMatrix(e))),r}catch{return null}}function hs(e,t,r,n,o){let i=e.getBoundingClientRect();t?.nodeType===1&&t.namespaceURI===ar&&B(e).position==="static"&&(t.style.position="relative");let a=[];for(let[s,l]of r){if(s?.nodeType!==1||s.namespaceURI!==ar||l?.nodeType!==1||l===e||!ps(e,l))continue;let d=n.get(l)||B(l),c=d.position;if(c!=="fixed"&&c!=="sticky"&&c!=="-webkit-sticky"||s.style.position==="absolute")continue;let u=l.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;no.add(s);let p=d.transform&&d.transform!=="none"?d.transform:"",f=At(l),h=!!(p||f.rotate!=="0deg"||f.scale||f.translate),m=h?io(p,f):null,g=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,y=u.width,x=u.height;g||(y=l.offsetWidth||u.width,x=l.offsetHeight||u.height);let v=l.getRootNode&&l.getRootNode()instanceof ShadowRoot,b=i,w=e.clientLeft||0,S=e.clientTop||0;if(v){let R=fs(l,e);R&&(b=R.getBoundingClientRect(),w=R.clientLeft||0,S=R.clientTop||0)}let M=u.left-b.left-w,C=u.top-b.top-S;if(h)if(s.style.translate="none",s.style.rotate="none",s.style.scale="none",g)s.style.transform="none";else{s.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:R,oy:L}=ir(d,y,x),H=St(y,x,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},R,L);M-=H.minX,C-=H.minY}if(c!=="fixed"){let R=s.cloneNode(!1);R.setAttribute("data-snap-ph","1"),R.style.position="static",R.style.visibility="hidden",R.style.width=`${y}px`,R.style.height=`${x}px`,R.style.boxSizing="border-box",s.parentElement?.insertBefore(R,s)}let E=y+2,$=x;o&&(Math.abs(C-o.y)<.5&&(C-=1,$+=1),Math.abs(M-o.x)<.5&&(M-=1,E+=1)),s.style.position="absolute",s.style.left=`${M}px`,s.style.top=`${C}px`,s.style.right="auto",s.style.bottom="auto",s.style.margin="0",s.style.width=`${E}px`,s.style.height=`${$}px`,s.style.boxSizing="border-box",v||a.push(s)}for(let s of a)t.appendChild(s)}function ms(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){j(r,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){j(r,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){j(r,"stripRootShadows outline",i)}let o=(n.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=o.length?o:"none"}catch(i){j(r,"stripRootShadows filter",i)}}function gs(e,t){if(!e||!t||!t.style)return;let r=1;try{r=parseFloat(getComputedStyle(e).zoom)}catch{return}if(!(!t.style.getPropertyValue("zoom")&&(!Number.isFinite(r)||r===1)))try{t.style.setProperty("zoom","1","important")}catch{}}function pn(e){let t=e.display||"";if(t.includes("flex")||t.includes("grid")||t.startsWith("table")||t==="inline-block"||t==="flow-root"||e.position==="absolute"||e.position==="fixed"||e.float&&e.float!=="none")return!0;let r=e.overflowX||e.overflow||"visible",n=e.overflowY||e.overflow||"visible";return!!(r!=="visible"||n!=="visible"||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function bs(e,t){let r=Array.from(e.childNodes),n=t==="top"?r:r.reverse();for(let o of n){if(o.nodeType===Node.TEXT_NODE){if(/\S/.test(o.textContent||""))return null;continue}if(o.nodeType!==Node.ELEMENT_NODE)continue;let i=getComputedStyle(o),a=String(i.display||"");if(!(a==="none"||a==="contents")&&!(i.position==="absolute"||i.position==="fixed"))return i.float&&i.float!=="none"||a.startsWith("inline")?null:o}return null}function ys(e,t,r){if(!e||!t||!t.style)return;let n=getComputedStyle(e);if(!pn(n))for(let o of["top","bottom"]){let i=o==="top"?"Top":"Bottom";if((parseFloat(n[`border${i}Width`])||0)>0||(parseFloat(n[`padding${i}`])||0)>0)continue;let a=e,s=t;for(;a&&s;){let l=bs(a,o);if(!l)break;let d=r?Array.from(s.children).find(p=>r.get(p)===l)||null:s.children[Array.from(a.children).indexOf(l)]||null,c=getComputedStyle(l),u=parseFloat(c[`margin${i}`])||0;if(d&&d.style&&u>0&&(d.style[`margin${i}`]="0px"),pn(c)||(parseFloat(c[`border${i}Width`])||0)>0||(parseFloat(c[`padding${i}`])||0)>0)break;a=l,s=d}}}function ws(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),r=[];for(;t.nextNode();)r.push(t.currentNode);for(let n of r)n.remove()}function xs(e,t={}){let{stripFrameworkDirectives:r=!0}=t,n=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let s=a.name;if(s.startsWith("*")){i.removeAttribute(s);continue}if(s.includes("@")){i.removeAttribute(s);continue}if(s.includes(":")){let l=s.split(":",1)[0];if(!n.has(l)){i.removeAttribute(s);continue}}if(r&&(s.startsWith("x-")||s.startsWith("v-")||s.startsWith(":")||s.startsWith("on:")||s.startsWith("bind:")||s.startsWith("let:")||s.startsWith("class:"))){i.removeAttribute(s);continue}}}}var fn=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function vs(e){if(!e)return;let t=o=>{if(o.nodeType===Node.ELEMENT_NODE){if(o.attributes)for(let i of Array.from(o.attributes)){let a=i.value.replace(fn,"");if(a!==i.value)try{o.setAttribute(i.name,a)}catch{}}}else if(o.nodeType===Node.TEXT_NODE||o.nodeType===Node.CDATA_SECTION_NODE){let i=o.data.replace(fn,"");i!==o.data&&(o.data=i)}};t(e);let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),n;for(;n=r.nextNode();)t(n)}function Ss(e,t={}){e&&(xs(e,t),ws(e),vs(e))}function Cs(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function ks(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Ms(e,t){if(e?.nodeType!==1||Cs(e)||ks(e))return!1;let r=t.position;if(r==="absolute"||r==="fixed"||r==="sticky")return!1;let n=t.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||t.transform&&t.transform!=="none")}function Es(e,t,r=new Map){function n(o,i){if(o?.nodeType!==1||i?.nodeType!==1)return;let a=o.childElementCount>i.childElementCount,s=r.get(o)||getComputedStyle(o);if(r.has(o)||r.set(o,s),a&&Ms(o,s)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let c=s.overflowY||s.overflowBlock||"visible",u=s.overflowX||s.overflowInline||"visible";(c!=="visible"||u!=="visible")&&(i.style.overflow="visible")}let l=Array.from(o.children),d=Array.from(i.children);for(let c=0;c<Math.min(l.length,d.length);c++)n(l[c],d[c])}n(e,t)}function $s(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function As(e,t){if(e?.nodeType!==1)return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let r of t.exclude)try{if(e.matches(r))return t.excludeMode==="remove"}catch(n){j(t,"exclude selector match failed",n)}if(typeof t?.filter=="function"&&t.filterMode==="remove")try{if(!t.filter(e))return!0}catch(r){j(t,"filter function failed",r)}return!1}function Ns(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let f of s){if(As(f,t)||!$s(f))continue;let h=f.getBoundingClientRect(),m=h.top-n.top,g=h.bottom-n.top;g<=m||(m<o&&(o=m),g>i&&(i=g),a=!0)}let l=a?Math.max(0,i-o):0,d=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderBottomWidth)||0,u=parseFloat(r.paddingTop)||0,p=parseFloat(r.paddingBottom)||0;return d+c+u+p+l}var A=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Pe=.75;function Rs(e,t,r,n,o,i){let a=e.ownerDocument||document,s=e.getBoundingClientRect(),l=o>0&&s.width>0?s.width/o:1,d=i>0&&s.height>0?s.height/i:1;if(Math.abs(l-d)>.02)return 0;let c=a.createElement("div");c.setAttribute("data-snapdom-internal",""),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+o+"px!important;overflow:visible!important;visibility:hidden!important;";let u=c.attachShadow({mode:"open"}),p=a.createElement("style");p.textContent=r,u.appendChild(p);let f=t.cloneNode(!0);u.appendChild(f),a.body.appendChild(c);let h=0,m=(g,y,x)=>{let v=B(g),b=v.boxSizing==="border-box",w=(S,M,...C)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let $=E+(b?0:C.reduce((R,L)=>R+(parseFloat(L)||0),0));return Math.abs($-M)<=.51?$:M};return{width:w(v.width,y,v.paddingLeft,v.paddingRight,v.borderLeftWidth,v.borderRightWidth),height:w(v.height,x,v.paddingTop,v.paddingBottom,v.borderTopWidth,v.borderBottomWidth)}};try{let g=f.getBoundingClientRect(),y=f.offsetWidth||o,x=f.offsetHeight||i,v=y>0&&g.width>0?g.width/y:1,b=x>0&&g.height>0?g.height/x:1,w=(S,M,C=!1)=>{let E=S.children,$=M.children,R=Math.min(E.length,$.length);for(let L=0;L<R;L++){let H=E[L],P=$[L],I=n.get(H),T=C||no.has(H);if(I?.nodeType===1&&H?.namespaceURI===ar&&H.style&&I.isConnected){let O=I.getBoundingClientRect();if(O.width>0&&O.height>0){let X=P.getBoundingClientRect(),U=O.width/l,V=O.height/d,K=X.width,F=X.height,W=I.offsetWidth||U,_=I.offsetHeight||V,q=P.offsetWidth||K,ce=P.offsetHeight||F,Q=Math.abs(U-W)>Pe||Math.abs(V-_)>Pe||Math.abs(K-q)>Pe||Math.abs(F-ce)>Pe;if(T){let J=m(P,q,ce);U=K>0?U*v*J.width/K:U,V=F>0?V*b*J.height/F:V,K=J.width,F=J.height}else if(Q){let J=m(I,W,_),he=m(P,q,ce);U=J.width,V=J.height,K=he.width,F=he.height}let te=K-U,oe=F-V;(Math.abs(te)>Pe||Math.abs(oe)>Pe)&&(H.style.boxSizing="border-box",H.style.width=`${A(U)}px`,H.style.height=`${A(V)}px`,h++)}}w(H,P,T)}};w(t,f)}finally{c.remove()}return h}var Ts=/::-webkit-scrollbar(-[a-z]+)?\b/i;function lr(e,t=new Set){let r="";if(!e)return r;for(let n=0;n<e.length;n++){let o=e[n];try{if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){r+=lr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=lr(o.cssRules,t);i&&(r+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(Ts.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),r+=a)}}}catch{}}return r}var hn=new WeakMap;function Ls(e){let t="";for(let r of e.styleSheets){let n=-1;try{n=r.cssRules?r.cssRules.length:-1}catch{}t+=(r.href||"inline")+":"+n+"|"}return t}function Ps(e){if(!e||!e.styleSheets)return"";let t=Ls(e),r=hn.get(e);if(r&&r.fp===t)return r.css;let n=new Set,o="";for(let i of Array.from(e.styleSheets))try{let a=i.cssRules;a&&(o+=lr(a,n))}catch{}return hn.set(e,{fp:t,css:o}),o}Ae();var ut=new Set;async function Fs(e,t={}){let r=t.__session||k.session,n={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:t},o=null;if(t.clip){let u=oo(e,t.clip);if(u){n.clip={rect:u,root:e};let p=e.getBoundingClientRect();o={x:u.left-p.left,y:u.top-p.top,width:u.width,height:u.height}}}let i,a="",s="";if(ut.size){let u=(p,f)=>{for(let h=f;h;h=h.assignedSlot||h.parentElement||h.getRootNode()?.host)if(h===p)return!0;return!1};for(;;){let p=[...ut].filter(({root:f})=>u(f,e)||u(e,f)).map(({promise:f})=>f.catch(()=>{}));if(!p.length)break;await Promise.all(p)}}if(!n.clip&&e.isConnected&&e.ownerDocument?.visibilityState!=="hidden")try{let u=e.getBoundingClientRect(),p=e.ownerDocument?.defaultView||window,f=u.right<=0||u.bottom<=0||u.left>=p.innerWidth||u.top>=p.innerHeight,h=[];if(f&&(()=>{let m=[];e.shadowRoot&&m.push(e.shadowRoot);for(let g of e.querySelectorAll("*"))g.shadowRoot&&m.push(g.shadowRoot);for(;m.length;){let g=m.pop(),y=g.host?.localName==="calcite-icon";for(let x of g.querySelectorAll("*")){if(x.shadowRoot&&m.push(x.shadowRoot),!y||x.localName!=="svg")continue;let v=x.querySelectorAll("path");if(!v.length||[...v].some(w=>w.getAttribute("d")?.trim()))continue;let b=x.getBoundingClientRect();b.width&&b.height&&h.push(x)}}})(),h.length){let m=(async()=>{let y=e.style,x=e.hasAttribute("style"),v=new Map,b=(w,S)=>{v.has(w)||v.set(w,{value:y.getPropertyValue(w),priority:y.getPropertyPriority(w)}),y.setProperty(w,S,"important");let M=v.get(w);M.forcedValue=y.getPropertyValue(w),M.forcedPriority=y.getPropertyPriority(w)};try{b("left","0"),b("top","0"),b("right","auto"),b("bottom","auto"),b("margin-top","0"),b("margin-right","0"),b("margin-bottom","0"),b("margin-left","0"),b("transform","none"),b("translate","none"),b("opacity","0"),b("pointer-events","none");let w=e.getBoundingClientRect();if(w.right<=0||w.bottom<=0||w.left>=p.innerWidth||w.top>=p.innerHeight){let C=e.parentElement?.getBoundingClientRect(),E=C&&C.right>0&&C.left<p.innerWidth?Math.max(0,C.left):0,$=C&&C.bottom>0&&C.top<p.innerHeight?Math.max(0,C.top):0;b("position","fixed"),b("left",`${E}px`),b("top",`${$}px`)}await Me(100);let S=Date.now()+1500,M=()=>h.some(C=>{if([...C.querySelectorAll("path")].some($=>$.getAttribute("d")?.trim()))return!1;let E=C.getBoundingClientRect();return E.width&&E.height&&E.right>0&&E.bottom>0&&E.left<p.innerWidth&&E.top<p.innerHeight});for(;Date.now()<S&&M();)await new Promise(C=>setTimeout(C,25));await Me(100)}finally{for(let[w,S]of v)y.getPropertyValue(w)!==S.forcedValue||y.getPropertyPriority(w)!==S.forcedPriority||(S.value?y.setProperty(w,S.value,S.priority):y.removeProperty(w));!x&&!y.length&&e.removeAttribute("style"),await Me(100)}})(),g={root:e,promise:m};ut.add(g);try{await m}finally{ut.delete(g)}}}catch{}let l=es(e),d=n.clip?()=>{}:ts(e);try{i=await wt(e,n,t)}catch(u){throw console.warn("deepClone failed:",u),u}finally{d(),l()}try{Za(i)}catch(u){console.warn("inlineExternal defs or symbol failed:",u)}try{await or(e,i,n,t)}catch(u){console.warn("inlinePseudoElements failed:",u)}await sa(i,n);try{let u=i.querySelectorAll("style[data-sd]");for(let p of u)s+=p.textContent||"",p.remove()}catch(u){j(n,"Failed to extract shadow CSS from style[data-sd]",u)}let c=Zo(n.styleMap);a=Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join(""),a=s+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+a;for(let[u,p]of n.styleMap.entries()){if(u.tagName==="STYLE")continue;if(u.getRootNode&&u.getRootNode()instanceof ShadowRoot){u.setAttribute("style",p.replace(/;/g,"; "));continue}let f=c.get(p);f&&u.classList.add(f);let h=u.style?.backgroundImage,m=u.dataset?.snapdomHasIcon;h&&h!=="none"&&(u.style.backgroundImage=h),m&&(u.style.verticalAlign="middle",u.style.display="inline")}if((n.clip||e.scrollTop||e.scrollLeft)&&i?.nodeType===1)try{let u=n.clip&&o?{x:o.x,y:o.y}:{x:0,y:0};hs(e,i,n.nodeMap,n.styleCache,u)}catch(u){j(n,"freezeViewportPositioned failed",u)}for(let[u,p]of n.nodeMap.entries()){if(n.clip&&p===e)continue;let f=p.scrollLeft,h=p.scrollTop;if((f||h)&&u?.nodeType===1&&u.namespaceURI==="http://www.w3.org/1999/xhtml"){u.style.overflow="hidden",u.style.scrollbarWidth="none",u.style.msOverflowStyle="none";try{let g=u.querySelectorAll("*");for(let y of g){if(y.nodeType!==1||y.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let x=y.style.position;if(x==="fixed"||x==="absolute"){let v=parseFloat(y.style.top)||0,b=parseFloat(y.style.left)||0;y.style.top=`${v+h}px`,y.style.left=`${b+f}px`,x==="fixed"&&(y.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.all="unset",m.style.transform=`translate(${-f}px, ${-h}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";u.firstChild;)m.appendChild(u.firstChild);u.appendChild(m)}}if(e===n.nodeMap.get(i)){let u=n.styleCache.get(e)||B(e);n.styleCache.set(e,u);let p=Bo(u.transform);i.style.margin="0",i.style.top="auto",i.style.left="auto",i.style.right="auto",i.style.bottom="auto",i.style.animation="none",i.style.transition="none",i.style.willChange="auto",i.style.float="none",i.style.clear="none",i.style.transform=p||""}for(let[u,p]of n.nodeMap.entries())p.tagName==="PRE"&&(u.style.marginTop="0",u.style.marginBlockStart="0");return{clone:i,classCSS:a,styleCache:n.styleCache,nodeMap:n.nodeMap,reconcileRisk:n.reconcileRisk||0,clipWindow:o}}$e();ne();var ao="http://www.w3.org/1999/xlink";function Is(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(ao,"href"):null)}function Os(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,r=parseInt(e.dataset?.snapdomHeight||"",10)||0,n=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||i||n||e.width||e.naturalWidth||100,l=r||a||o||e.height||e.naturalHeight||100;return{width:s,height:l}}async function Hs(e,t={}){let r=Array.from(e.querySelectorAll("img"));e.tagName==="IMG"&&r.unshift(e);let n=async s=>{if(!s.getAttribute("src")){let h=s.currentSrc||s.src||Et(s.getAttribute("srcset"),s)||"";h&&s.setAttribute("src",h)}s.removeAttribute("srcset"),s.removeAttribute("sizes");let l=s.src||"";if(!l)return;let d=k.image?.get(l);if(d){s.src=d,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let c=await le(l,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){k.image?.set(l,c.data),s.src=c.data,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let{width:u,height:p}=Os(s),{fallbackURL:f}=t||{};if(f)try{let h=typeof f=="function"?await f({width:u,height:p,src:l,element:s}):f;if(h){let m=await le(h,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){s.src=m.data,s.width||(s.width=u),s.height||(s.height=p);return}}}catch{}if(t.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${u}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",s.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${u}px;height:${p}px;visibility:hidden;`,s.replaceWith(h)}},o=6;for(let s=0;s<r.length;s+=o){let l=r.slice(s,s+o).map(n);await Promise.allSettled(l)}let i=Array.from(e.querySelectorAll("image"));e.localName==="image"&&i.unshift(e);let a=async s=>{let l=Is(s);if(!l||l.startsWith("data:")||l.startsWith("blob:"))return;let d=await le(l,{as:"dataURL",useProxy:t.useProxy});d.ok&&typeof d.data=="string"&&d.data.startsWith("data:")&&(s.setAttribute("href",d.data),s.removeAttribute("xlink:href"),typeof s.removeAttributeNS=="function"&&s.removeAttributeNS(ao,"href"))};for(let s=0;s<i.length;s+=o){let l=i.slice(s,s+o).map(a);await Promise.allSettled(l)}}de();ne();var _s=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],Ds=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],Ws=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Bs=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function js(e,t,r,n){let o=r.get(e)||B(e);r.has(e)||r.set(e,o);let i=o.getPropertyValue("border-image"),a=o.getPropertyValue("border-image-source"),s=i&&i!=="none"||a&&a!=="none",l=o.getPropertyValue("background-image"),d=o.getPropertyValue("background-color");if(l&&l!=="none"||d&&d!=="rgba(0, 0, 0, 0)"&&d!=="transparent"||/url\s*\(|gradient\s*\(/i.test(o.getPropertyValue("background")||""))for(let c of Ws){let u=o.getPropertyValue(c);u&&t.style.setProperty(c,u)}for(let c of _s){let u=o.getPropertyValue(c);if(c==="background-image"&&(!u||u==="none")){let h=o.getPropertyValue("background");h&&/url\s*\(/.test(h)&&(u=Xt(h).filter(m=>/url\s*\(/.test(m)).join(", ")||u)}if(!u||u==="none")continue;let p=Xt(u),f=await Promise.all(p.map(h=>xn(h,n)));f.some(h=>h&&h!=="none"&&!/^url\(undefined/.test(h))&&t.style.setProperty(c,f.join(", "))}for(let c of Ds){let u=o.getPropertyValue(c);!u||u==="initial"||t.style.setProperty(c,u)}if(s)for(let c of Bs){let u=o.getPropertyValue(c);!u||u==="initial"||t.style.setProperty(c,u)}}async function Us(e,t,r,n={},o=k.session.nodeMap){if(!t)return;let i=[];e&&zr(e)&&i.push([e,t]);let a=[t];for(;a.length;){let l=a.pop();if(l.children)for(let d of l.children){if(d.tagName==="STYLE")continue;let c=o.get(d);c&&zr(c)&&i.push([c,d]),a.push(d)}}let s=6;for(let l=0;l<i.length;l+=s)await Promise.allSettled(i.slice(l,l+s).map(([d,c])=>js(d,c,r,n)))}ne();de();function qs(e,t,r=k.session.nodeMap){let n=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let s=o.currentNode;s;s=o.nextNode()){let l=r.get(s);if(l?.nodeType!==1)continue;let d=B(l),c=d.getPropertyValue("backdrop-filter")||d.getPropertyValue("-webkit-backdrop-filter");c&&c!=="none"&&s!==t&&n.push({cloneEl:s,orig:l,bf:c,path:Xs(t,s)})}if(!n.length)return;let i=e.getBoundingClientRect(),a=n.map((s,l)=>{let d=t.cloneNode(!0);Vs(d,t,s.orig.getBoundingClientRect(),r),Ys(mn(d,s.path));for(let c=0;c<l;c++){let u=mn(d,n[c].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...s,copy:d}});for(let{cloneEl:s,orig:l,bf:d,copy:c}of a)zs(s,l,d,c,i)}function zs(e,t,r,n,o){let i=t.getBoundingClientRect();if(!i.width||!i.height)return;let a=B(t),s=t.offsetWidth?i.width/t.offsetWidth:1,l=Math.abs(s-1)>.001?1/s:1;n.style.position="absolute",n.style.left=`${(o.left-i.left)*l}px`,n.style.top=`${(o.top-i.top)*l}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`,n.style.margin="0",n.style.filter=r,l!==1&&(n.style.transform=`scale(${l})`,n.style.transformOrigin="top left");let d=document.createElement("div");d.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",d.appendChild(n);let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",c.style.backgroundColor=a.backgroundColor,c.style.backgroundImage=e.style.backgroundImage||a.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])c.style.setProperty(u,a.getPropertyValue(u));e.style.setProperty("background-color","transparent","important"),e.style.setProperty("background-image","none","important"),e.style.setProperty("backdrop-filter","none","important"),e.style.setProperty("-webkit-backdrop-filter","none","important"),a.position==="static"&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(c),e.prepend(d)}var pt=128;function Vs(e,t,r,n){let o=[[e,t]];for(;o.length;){let[i,a]=o.pop(),s=n.get(a);if(s?.nodeType===1){let c=s.getBoundingClientRect();(c.left>r.right+pt||c.right<r.left-pt||c.top>r.bottom+pt||c.bottom<r.top-pt)&&(i.tagName==="IMG"&&i.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),i.style&&(i.style.backgroundImage="none"))}let l=i.children,d=a.children;for(let c=0;c<l.length;c++)o.push([l[c],d[c]])}}function Xs(e,t){let r=[];for(let n=t;n!==e;n=n.parentElement){if(!n?.parentElement)return null;r.push([...n.parentElement.children].indexOf(n))}return r.reverse()}function mn(e,t){if(!t)return null;let r=e;for(let n of t)if(r=r.children[n],!r)return null;return r}function Ys(e){if(e)for(let t=e;t&&t.parentNode;){let r=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=r}}de();ne();function Gs(e,t){if(!e)return()=>{};let r=[],n=200;function o(i){if(t){let d=i.getBoundingClientRect();if(d.width>0||d.height>0){let c=Math.max(d.right,d.left+(i.scrollWidth||0)),u=Math.max(d.bottom,d.top+(i.scrollHeight||0));if(c<t.left-n||d.left>t.right+n||u<t.top-n||d.top>t.bottom+n)return}}let a=getComputedStyle(i),s=Qs(i,a);s&&r.push(s);let l=Ks(i,a);l&&r.push(l);for(let d of i.children||[])o(d)}return o(e),()=>r.forEach(i=>i())}function Qs(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let r=Js(t);if(r<=0)return()=>{};if(!lo(e))return()=>{};let n=so(e),o=n.text,i=el(t);n.write("X");let a=e.scrollHeight-i;n.restore();let s=a>0?a:Zs(t),l=Math.round(s*r+i);if(e.scrollHeight<=l+.5)return()=>{};let d=0,c=o.length,u=-1;for(;d<=c;){let p=d+c>>1;n.write(o.slice(0,p)+"\u2026"),e.scrollHeight<=l+.5?(u=p,d=p+1):c=p-1}return n.write((u>=0?o.slice(0,u):"")+"\u2026"),()=>{n.restore()}}function Ks(e,t){if(!e)return()=>{};if(t=t||getComputedStyle(e),t.textOverflow!=="ellipsis")return()=>{};if(t.whiteSpace!=="nowrap"&&t.whiteSpace!=="pre")return()=>{};if(t.overflowX!=="hidden"&&t.overflowX!=="clip")return()=>{};if(!lo(e))return()=>{};if(e.scrollWidth<=e.clientWidth+.5)return()=>{};let r=so(e),n=r.text,o=0,i=n.length,a=-1;for(;o<=i;){let s=o+i>>1;r.write(n.slice(0,s)+"\u2026"),e.scrollWidth<=e.clientWidth+.5?(a=s,o=s+1):i=s-1}return r.write((a>=0?n.slice(0,a):"")+"\u2026"),()=>{r.restore()}}function so(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let r=t.map(n=>n.data);return{text:r.join(""),write(n){t[0].data=n;for(let o=1;o<t.length;o++)t[o].data=""},restore(){for(let n=0;n<t.length;n++)t[n].data=r[n]}}}function Js(e){let t=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");t=(t||"").trim();let r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:0}function Zs(e){let t=(e.lineHeight||"").trim(),r=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(r*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*r):t.endsWith("%")?Math.round(parseFloat(t)/100*r):Math.round(r*1.2)}function el(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function lo(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var je=[];function Pt(e){if(!e)return null;if(Array.isArray(e)){let[t,r]=e;return typeof t=="function"?t(r):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:r}=e;return typeof t=="function"?t(r):t}return typeof e=="function"?e():e}function tl(...e){let t=e.flat();for(let r of t){let n=Pt(r);n&&(je.some(o=>o&&o.name&&n.name&&o.name===n.name)||je.push(n))}}function co(e){return e&&Array.isArray(e.plugins)?e.plugins:je}async function Se(e,t,r){let n=r,o=co(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&(n=s)}return n}async function rl(e,t,r){let n=[],o=co(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&n.push(s)}return n}function nl(e){let t=[];if(Array.isArray(e))for(let r of e){let n=Pt(r);if(!n||!n.name)continue;let o=t.findIndex(i=>i&&i.name===n.name);o>=0&&t.splice(o,1),t.push(n)}for(let r of je)r&&r.name&&!t.some(n=>n.name===r.name)&&t.push(r);return Object.freeze(t)}function ol(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=nl(t)),e}function uo(){return je.slice()}ne();var il=.92,al=.95;async function sl(e){let t=new Image;if(t.decoding="sync",t.src=e,typeof t.decode=="function")try{return await t.decode(),t}catch{}return await new Promise((r,n)=>{t.onload=()=>r(),t.onerror=n}),t}function ll(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:""}async function wr(e,t,r){if(typeof e!="string"||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return null;let n=e.length+":"+e.slice(0,64)+e.slice(-64)+":"+Math.round(t)+"x"+Math.round(r);if(k.compress.has(n))return k.compress.get(n);let o=await(async()=>{let i;try{i=await sl(e)}catch{return null}let a=i.naturalWidth||i.width,s=i.naturalHeight||i.height;if(!a||!s)return null;let l=Math.min(1,Math.max(t/a,r/s));if(!(l>0)||l>=.95)return null;let d=l*al,c=Math.max(1,Math.round(a*d)),u=Math.max(1,Math.round(s*d)),p=document.createElement("canvas");p.width=c,p.height=u;let f=p.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(i,0,0,c,u);let h=ll(e),m=h==="image/jpeg"?"image/jpeg":h==="image/webp"?"image/webp":"image/png";try{let g=p.toDataURL(m,il);if(typeof g=="string"&&g.startsWith("data:image")&&g.length<e.length)return g}catch{}return null})();return k.compress.set(n,o),o}async function cl(e,t){if(!t.compress)return{count:0,before:0,after:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("img"));e.tagName==="IMG"&&n.unshift(e);let o=0,i=0,a=0,s=async d=>{let c=d.getAttribute("src")||"";if(!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let u=parseFloat(d.dataset.snapdomWidth)||parseFloat(d.style.width)||d.width||0,p=parseFloat(d.dataset.snapdomHeight)||parseFloat(d.style.height)||d.height||0;if(!u||!p)return;let f=await wr(c,u*r,p*r);f&&(o++,i+=c.length,a+=f.length,d.setAttribute("src",f))},l=6;for(let d=0;d<n.length;d+=l)await Promise.allSettled(n.slice(d,d+l).map(s));return{count:o,before:i,after:a}}function dl(e){let t=e.offsetWidth||e.getBoundingClientRect().width||0,r=e.offsetHeight||e.getBoundingClientRect().height||0;return{w:t,h:r}}async function ul(e,t,r=k.session.nodeMap){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),o=[],i=[e,...e.querySelectorAll("*")];for(let d of i){let c=d.style&&d.style.backgroundImage;c&&c.includes("data:image")&&o.push(d)}let a=0,s=async d=>{let c=r.get(d);if(!c||!c.isConnected)return;let u;try{u=getComputedStyle(c)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(v=>v.trim()!=="no-repeat"))return;let{w:p,h:f}=dl(c);if(!p||!f)return;let h=p*n,m=f*n,g=d.style.backgroundImage,y=[...g.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],x=g;for(let v of y){let b=v[2];if(b.startsWith("data:image/svg"))continue;let w=await wr(b,h,m);w&&(x=x.split(b).join(w),a++)}x!==g&&(d.style.backgroundImage=x)},l=6;for(let d=0;d<o.length;d+=l)await Promise.allSettled(o.slice(d,d+l).map(s));return{count:a}}async function pl(e,t){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("image"));e.localName==="image"&&n.unshift(e);let o=0,i=async s=>{let l=s.getAttribute("href")||(typeof s.getAttributeNS=="function"?s.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!l||!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let d=parseFloat(s.getAttribute("width"))||0,c=parseFloat(s.getAttribute("height"))||0;if(!d||!c)return;let u=await wr(l,d*r,c*r);u&&(s.setAttribute("href",u),s.hasAttribute("xlink:href")&&s.setAttribute("xlink:href",u),o++)},a=6;for(let s=0;s<n.length;s+=a)await Promise.allSettled(n.slice(s,s+a).map(i));return{count:o}}async function fl(e,t,r){t.compress&&(await cl(e,t),await ul(e,t,r),await pl(e,t))}function hl(e){if(Array.isArray(e.plugins)){for(let t of e.plugins)if(Pt(t)?.name==="picture-resolver")return!0}return uo().some(t=>t?.name==="picture-resolver")}function ml(e){let t=Array.isArray(e.plugins)?e.plugins:uo(),r=[];for(let n of t){let o=Pt(n);o&&typeof o.resolveNode=="function"&&r.push(o.resolveNode.bind(o))}return r.length?r:null}var gl=2e3,bl=3;function yl(e){let t=Date.now(),r=k.burstAdvice.get(e);if(!r||t-r.firstTs>gl){k.burstAdvice.set(e,{count:1,firstTs:t,warned:!1});return}r.count++,r.count>=bl&&!r.warned&&(r.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed."))}async function wl(e,t){if(!e)throw new Error("Element cannot be null or undefined");Wo(t.cache),t.__session={styleMap:k.session.styleMap,styleCache:k.session.styleCache,nodeMap:k.session.nodeMap},t.burst||yl(e),t.__resolveNodeHooks=ml(t);let r=t.fast,n=t.outerTransforms!==!1,o=!!t.outerShadows,i=t.clip?oo(e,t.clip):null,a={element:e,options:t,plugins:t.plugins},s,l,d,c,u,p,f="",h="",m,g,y=null;await Se("beforeSnap",a);let x=null;t.resolvePicturePlaceholders!==!1&&!hl(t)&&(x=await Bi(a.element,a.options)),await Se("beforeClone",a);let v=Gs(a.element,i);try{({clone:s,classCSS:l,styleCache:d,nodeMap:c,reconcileRisk:u,clipWindow:p}=await Fs(a.element,a.options)),u>0&&!t.reconcile&&!k.warnedReconcile&&(k.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!n&&s&&(y=ss(a.element,s)),!o&&s&&ms(a.element,s,a.options),s&&(ys(a.element,s,c),gs(a.element,s))}finally{v()}if(a={clone:s,classCSS:l,styleCache:d,nodeMap:c,...a},await Se("afterClone",a),x&&await x(),Ss(a.clone),a.options?.excludeMode==="remove"||a.options?.filterMode==="remove")try{Es(a.element,a.clone,a.styleCache)}catch(R){console.warn("[snapdom] shrink pass failed:",R)}try{await Ma(a.clone,a.element,a.nodeMap)}catch{}let b=R=>new Promise((L,H)=>{ht(()=>{Promise.resolve().then(R).then(L,H)},{fast:r})}),w=(async()=>{await Promise.all([b(()=>Hs(a.clone,a.options)),b(()=>Us(a.element,a.clone,a.styleCache,a.options,a.nodeMap))]);try{qs(a.element,a.clone,a.nodeMap)}catch(R){console.warn("[snapdom] backdrop-filter emulation failed:",R)}t.compress&&await b(()=>fl(a.clone,a.options,a.nodeMap))})(),S=Promise.resolve();t.embedFonts&&(S=b(async()=>{let R=a.element.ownerDocument||document,L=i?I=>{try{let T=I.getBoundingClientRect();return T.right>=i.left-200&&T.left<=i.right+200&&T.bottom>=i.top-200&&T.top<=i.bottom+200}catch{return!0}}:null,{required:H,usedCodepoints:P}=Zn(a.element,L);if(we()){let I=new Set(Array.from(H).map(T=>String(T).split("__")[0]).filter(Boolean));await eo(I,1,R)}f=await Ua({required:H,usedCodepoints:P,preCached:!1,exclude:a.options.excludeFonts,localFonts:a.options.localFonts,useProxy:a.options.useProxy,fontStylesheetDomains:a.options.fontStylesheetDomains,doc:R})})),await Promise.all([w,S]);let M=Ko(a.clone).sort(),C=M.join(",");k.baseStyle.has(C)?h=k.baseStyle.get(C):await new Promise(R=>{ht(()=>{h=Jo(M),k.baseStyle.set(C,h),R()},{fast:r})});let E=Ps(a.element?.ownerDocument||document);a={fontsCSS:f,baseCSS:h,scrollbarCSS:E,...a},await Se("beforeRender",a),await new Promise(R=>{ht(()=>{let L=B(a.element),H=a.element.getBoundingClientRect(),P=Math.max(1,A(a.element.offsetWidth||parseFloat(L.width)||H.width||1)),I=Math.max(1,A(a.element.offsetHeight||parseFloat(L.height)||H.height||1)),T=a.element.ownerDocument||document;if(!p&&(a.element===T.body||a.element===T.documentElement)&&!T.documentElement.hasAttribute("data-sd-pinned")){let z=Math.max(a.element.scrollHeight||0,T.documentElement?.scrollHeight||0,T.body?.scrollHeight||0),Z=Math.max(a.element.scrollWidth||0,T.documentElement?.scrollWidth||0,T.body?.scrollWidth||0);z>0&&(I=Math.max(I,A(z))),Z>0&&(P=Math.max(P,A(Z)));try{let Y=(a.scrollbarCSS||"").length+(a.baseCSS||"").length+(a.fontsCSS||"").length+(a.classCSS||"").length,ie=k.measureHints.get(a.element);if(ie&&ie.cssLen===Y&&ie.w0===P)ie.csh>0&&(I=Math.max(I,A(ie.csh))),ie.csw>0&&(P=Math.max(P,A(ie.csw)));else{let G=T.createElement("div");G.setAttribute("data-snapdom-internal",""),G.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+P+"px!important;overflow:visible!important;visibility:hidden!important;";let ue=G.attachShadow({mode:"open"}),rt=T.createElement("style");rt.textContent=(a.scrollbarCSS||"")+a.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a.classCSS,ue.appendChild(rt),ue.appendChild(a.clone.cloneNode(!0)),T.body.appendChild(G);let ve=G.scrollHeight,It=G.scrollWidth;T.body.removeChild(G),k.measureHints.set(a.element,{cssLen:Y,w0:P,csh:ve,csw:It}),ve>0&&(I=Math.max(I,A(ve))),It>0&&(P=Math.max(P,A(It)))}}catch{}}if(a.options?.excludeMode==="remove"||a.options?.filterMode==="remove"){let z=Ns(a.element,a.options);Number.isFinite(z)&&z>0&&(I=Math.max(1,Math.min(I,A(z+1))))}if(a.options?.reconcile)try{let z=(a.scrollbarCSS||"")+a.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a.classCSS;Rs(a.element,a.clone,z,a.nodeMap,P,I)}catch(z){console.warn("[snapdom] reconcile pass failed:",z)}let O=(z,Z=NaN)=>{let Y=typeof z=="string"?parseFloat(z):z;return Number.isFinite(Y)?Y:Z},X=O(a.options.width),U=O(a.options.height),V=p?A(p.width):P,K=p?A(p.height):I,F=V,W=K,_=Number.isFinite(X),q=Number.isFinite(U),ce=K>0?V/K:1;_&&q?(F=Math.max(1,A(X)),W=Math.max(1,A(U))):_?(F=Math.max(1,A(X)),W=Math.max(1,A(F/(ce||1)))):q&&(W=Math.max(1,A(U)),F=Math.max(1,A(W*(ce||1))));let Q=0,te=0,oe=P,J=I;if(p){let z=0,Z=0;if(qt(a.element)){let Y=null;if(!n&&y&&Number.isFinite(y.a))Y={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0};else{let ie=At(a.element),G=io(L.transform&&L.transform!=="none"?L.transform:"",ie);G&&G.is2D&&(Y={a:G.a,b:G.b,c:G.c,d:G.d,e:0,f:0})}if(Y&&!(Y.a===1&&Y.b===0&&Y.c===0&&Y.d===1)){let{ox:ie,oy:G}=ir(L,P,I),ue=St(P,I,Y,ie,G);z=ue.minX,Z=ue.minY}}Q=A(p.x+z),te=A(p.y+Z),oe=A(Q+p.width),J=A(te+p.height)}else if(!n&&y&&Number.isFinite(y.a)){let z={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0},Z=St(P,I,z,0,0);Q=A(Z.minX),te=A(Z.minY),oe=A(Z.maxX),J=A(Z.maxY)}else if(n&&qt(a.element)){let z=L.transform&&L.transform!=="none"?L.transform:"",Z=At(a.element),Y=cs({baseTransform:z,rotate:Z.rotate||"0deg",scale:Z.scale,translate:Z.translate}),{ox:ie,oy:G}=ir(L,P,I),ue=Y.is2D?Y:new DOMMatrix(Y.toString()),rt={a:ue.a,b:ue.b,c:ue.c,d:ue.d,e:0,f:0},ve=St(P,I,rt,ie,G);Q=A(ve.minX),te=A(ve.minY),oe=A(ve.maxX),J=A(ve.maxY)}let he=rs(L),Ce=ns(L),ee=os(L),Ye=is(L),Ge=as(L),Qe=p?{top:0,right:0,bottom:0,left:0}:o?{top:A(Math.max(he.top,Ce.top)+ee.top+Ye.top+Ge.bleed.top),right:A(Math.max(he.right,Ce.right)+ee.right+Ye.right+Ge.bleed.right),bottom:A(Math.max(he.bottom,Ce.bottom)+ee.bottom+Ye.bottom+Ge.bleed.bottom),left:A(Math.max(he.left,Ce.left)+ee.left+Ye.left+Ge.bleed.left)}:{top:ee.top,right:ee.right,bottom:ee.bottom,left:ee.left};Q=A(Q-Qe.left),te=A(te-Qe.top),oe=A(oe+Qe.right),J=A(J+Qe.bottom);let vr=Math.max(1,A(oe-Q)),Sr=Math.max(1,A(J-te)),ho=_||q?A(F/V):1,mo=q||_?A(W/K):1,go=Math.max(1,A(vr*ho)),bo=Math.max(1,A(Sr*mo)),Cr="http://www.w3.org/2000/svg",yo=qt(a.element)?2:0,Ne=A(yo+(n?0:1)),Ke=Math.ceil(vr+Ne*2),Je=Math.ceil(Sr+Ne*2),Ze=A(-(A(Q)-Ne)),et=A(-(A(te)-Ne)),kr=Math.max(0,Ze),Mr=Math.max(0,et),Er=A(Ke-Math.min(0,Ze)),$r=A(Je-Math.min(0,et)),xe=document.createElementNS(Cr,"foreignObject");xe.setAttribute("x",String(Math.min(0,Ze))),xe.setAttribute("y",String(Math.min(0,et))),xe.setAttribute("width",String(Er)),xe.setAttribute("height",String($r)),xe.style.overflow="visible";let Ar=document.createElement("style"),wo="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Ar.textContent=(a.scrollbarCSS||"")+a.baseCSS+a.fontsCSS+wo+a.classCSS,xe.appendChild(Ar);let tt=document.createElement("div");tt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),tt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${Er}px;height:${$r}px`+(kr!==0||Mr!==0?`;padding:${Mr}px 0 0 ${kr}px !important`:""),tt.appendChild(a.clone),xe.appendChild(tt);let xo=new XMLSerializer().serializeToString(xe),Nr=_||q,vo=Object.freeze({w0:V,h0:K,vbW:Ke,vbH:Je,targetW:F,targetH:W,contentX:A(Ze+(p?Q:0)),contentY:A(et+(p?te:0)),clip:p?Object.freeze({x:A(Q),y:A(te),width:V,height:K}):null});Object.defineProperty(t,"meta",{value:vo,enumerable:!0,writable:!1,configurable:!0});let So=!Nr||we()?Ke:A(go+Ne*2),Co=!Nr||we()?Je:A(bo+Ne*2),ko=parseFloat(B(T.documentElement)?.fontSize)||16;g=`<svg xmlns="${Cr}" width="${So}" height="${Co}" viewBox="0 0 ${Ke} ${Je}" font-size="${ko}px">`+xo+"</svg>",m=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,a={svgString:g,dataURL:m,...a},R()},{fast:r})}),await Se("afterRender",a);let $=document.getElementById("snapdom-sandbox");return $&&$.style.position==="absolute"&&$.remove(),a.dataURL}function qt(e){return ds(e)}ne();function xl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=Do(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:r,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst??!1,invalidate:e.invalidate??!1,clip:e.clip??null,compress:e.compress!==!1,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1,pictureResolver:e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{}}}Ae();Fn();var gn=new WeakMap;function po(e,t,r){let n=new Set;if(e instanceof HTMLVideoElement&&n.add(e),e.querySelectorAll)for(let o of e.querySelectorAll("video"))n.add(o);for(let o of t.trackedVideos)n.has(o)||(o.removeEventListener("timeupdate",r),o.removeEventListener("seeked",r),t.trackedVideos.delete(o));for(let o of n)t.trackedVideos.has(o)||(o.addEventListener("timeupdate",r),o.addEventListener("seeked",r),t.trackedVideos.add(o))}function vl(e){let t={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},r=i=>{t.capturing||Un(i)&&(t.dirty=!0)},n=()=>{t.capturing||(t.dirty=!0)},o=e.ownerDocument||document;try{let i=new MutationObserver(r);i.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),t.observers.push(i)}catch{}try{if(o.head){let i=new MutationObserver(r);i.observe(o.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),t.observers.push(i)}}catch{}return t.markDirty=r,t.onMediaDirty=n,po(e,t,n),t}function bn(e){let{burst:t,invalidate:r,...n}=e||{};try{return JSON.stringify(n,Object.keys(n).sort())}catch{return null}}function Sl(e,t,r,n){let o=gn.get(e);o||(o=vl(e),o.baselineSignature=bn(t),gn.set(e,o));let i=bn(t),a=i===null||i!==o.baselineSignature,s=async()=>{for(let d of o.observers)o.markDirty(d.takeRecords());if(r.invalidate&&(o.dirty=!0),!a&&!o.dirty&&o.last)return o.last;o.capturing=!0,a||(o.dirty=!1);try{let d=await n();return a||(o.last=d),d}finally{for(let d of o.observers)d.takeRecords();o.capturing=!1,po(e,o,o.onMediaDirty)}},l=o.inflight.then(s,s);return o.inflight=l.catch(()=>{}),l}de();$e();ne();function Cl(...e){return tl(...e),D}var D=Object.assign(Ml,{plugins:Cl}),cr=Symbol("snapdom.internal"),kl=Symbol("snapdom.internal.silent");async function Ml(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=xl(t);if(ol(r,t&&t.plugins),we()){if(r.embedFonts===!0)try{let o=qa(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await eo(i,1)}catch{}let n=Array.from(e.querySelectorAll("canvas"));e.tagName==="CANVAS"&&n.unshift(e);for(let o of n)try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){j(t,"safari canvas poke failed",i)}}return r.iconFonts&&r.iconFonts.length>0&&ya(r.iconFonts),r.snap||(r.snap={toPng:(n,o)=>D.toPng(n,o),toSvg:(n,o)=>D.toSvg(n,o)}),r.burst?Sl(e,t,r,()=>D.capture(e,r,cr)):D.capture(e,r,cr)}D.capture=async(e,t,r)=>{if(r!==cr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");t.element=e;let n=await wl(e,t),o={img:async(m,g)=>{let{toImg:y}=await Promise.resolve().then(()=>(jr(),Gt));return y(n,{...m,...g||{}})},svg:async(m,g)=>{let{toSvg:y}=await Promise.resolve().then(()=>(jr(),Gt));return y(n,{...m,...g||{}})},canvas:async(m,g)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(qe(),In));return y(n,{...m,...g||{}})},blob:async(m,g)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Bn(),Dn));return y(n,{...m,...g||{}})},png:async(m,g)=>{let{rasterize:y}=await Promise.resolve().then(()=>(bt(),gt));return y(n,{...m,...g||{},format:"png"})},jpeg:async(m,g)=>{let{rasterize:y}=await Promise.resolve().then(()=>(bt(),gt));return y(n,{...m,...g||{},format:"jpeg"})},webp:async(m,g)=>{let{rasterize:y}=await Promise.resolve().then(()=>(bt(),gt));return y(n,{...m,...g||{},format:"webp"})},download:async(m,g)=>{let{download:y}=await Promise.resolve().then(()=>(mi(),jn));return y(n,{...m,...g||{}})}},i={};for(let m of["img","svg","canvas","blob","png","jpeg","webp"])i[m]=async g=>o[m](t,{...g||{},[kl]:!0});i.jpg=i.jpeg;let a={...t,export:{url:n},exports:i},s=await rl("defineExports",a),l=Object.assign({},...s.filter(m=>m&&typeof m=="object").reverse()),d={...o,...l};d.jpeg&&!d.jpg&&(d.jpg=(m,g)=>d.jpeg(m,g));function c(m,g){let y={...t,...g||{}},x=v=>v==="jpeg"||v==="jpg"||v==="webp";return[m,y.format,y.type].map(v=>typeof v=="string"?v.toLowerCase():"").find(x)&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let u=!1,p=Promise.resolve();async function f(m,g){let y=Object.freeze(g&&typeof g=="object"?{...g}:{}),x=async()=>{let b=d[m];if(!b)throw new Error(`[snapdom] Unknown export type: ${m}`);let w=c(m,y),S={...t,export:{type:m,options:w,requestedOptions:y,url:n}};await Se("beforeExport",S,{format:m,options:w});let M=await b(S,w);return await Se("afterExport",S,{format:m,options:w,result:M}),u||(u=!0,await Se("afterSnap",t)),M},v=p.then(x);return p=v.catch(()=>{}),v}let h={url:n,toRaw:()=>n,to:(m,g)=>f(m,g),toImg:m=>f("img",m),toSvg:m=>f("svg",m),toCanvas:m=>f("canvas",m),toBlob:m=>f("blob",m),toPng:m=>f("png",m),toJpg:m=>f("jpg",m),toWebp:m=>f("webp",m),download:m=>f("download",m)};Object.defineProperty(h,"meta",{value:t.meta,enumerable:!0,writable:!1,configurable:!1});for(let m of Object.keys(d)){let g="to"+m.charAt(0).toUpperCase()+m.slice(1);h[g]||(h[g]=y=>f(m,y))}return h};D.toRaw=(e,t)=>D(e,t).then(r=>r.toRaw());D.toImg=(e,t)=>D(e,t).then(r=>r.toImg());D.toSvg=(e,t)=>D(e,t).then(r=>r.toSvg());D.toCanvas=(e,t)=>D(e,t).then(r=>r.toCanvas());D.toBlob=(e,t)=>D(e,t).then(r=>r.toBlob());D.toPng=(e,t)=>D(e,{...t,format:"png"}).then(r=>r.toPng());D.toJpg=(e,t)=>D(e,{...t,format:"jpeg"}).then(r=>r.toJpg());D.toWebp=(e,t)=>D(e,{...t,format:"webp"}).then(r=>r.toWebp());D.download=(e,t)=>D(e,t).then(r=>r.download());var ze=class{constructor(){N(this,"name","BrowserScriptScreenshotDriver")}async captureSelector(t){try{if(typeof document>"u")return{ok:!1,reason:"NO_DOCUMENT_ENVIRONMENT"};let r=document.querySelector(t);return r?await this.captureElement(r):{ok:!1,reason:`ELEMENT_NOT_FOUND: ${t}`}}catch(r){return{ok:!1,reason:r?.message||"UNKNOWN_CAPTURE_ERROR"}}}async captureElement(t){try{if(typeof window>"u"||typeof document>"u")return{ok:!1,reason:"NO_BROWSER_ENVIRONMENT"};let r=t.getBoundingClientRect(),n=Math.max(Math.round(r.width),10),o=Math.max(Math.round(r.height),10),i=(async()=>{try{let s,l="webp";try{if(typeof D=="function"){let d=await D(t,{scale:1,embedFonts:!1});if(d&&typeof d.toWebp=="function")s=await d.toWebp();else if(d&&typeof d.toPng=="function")s=await d.toPng(),l="png";else if(d?.url)return{ok:!0,dataUrl:d.url,format:"webp",width:n,height:o}}else D?.toWebp?s=await D.toWebp(t,{scale:1,embedFonts:!1}):D?.toPng&&(s=await D.toPng(t,{scale:1,embedFonts:!1}),l="png")}catch{}if(s&&s.src)return{ok:!0,dataUrl:s.src,format:s.src.startsWith("data:image/webp")?"webp":l,width:s.naturalWidth||n,height:s.naturalHeight||o}}catch(s){let l=String(s?.message||s);if(l.includes("CORS")||l.includes("SecurityError")||l.includes("tainted"))return{ok:!1,reason:"CROSS_ORIGIN_RESOURCE"}}return await this.captureWithSvgFallback(t,n,o)})(),a=new Promise(s=>{setTimeout(()=>s({ok:!1,reason:"CAPTURE_TIMEOUT"}),3e3)});return await Promise.race([i,a])}catch(r){return{ok:!1,reason:r?.message||"CAPTURE_EXCEPTION"}}}async captureWithSvgFallback(t,r,n){try{let o=t.cloneNode(!0),i=window.getComputedStyle(t),a="";for(let c=0;c<i.length;c++){let u=i[c];a+=`${u}:${i.getPropertyValue(u)};`}o.style.cssText=a,o.style.margin="0",o.style.position="static";let s=`
|
|
9
9
|
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${n}">
|
|
10
10
|
<foreignObject width="100%" height="100%">
|
|
11
11
|
<div xmlns="http://www.w3.org/1999/xhtml" style="width:${r}px;height:${n}px;">
|
|
@@ -13,12 +13,29 @@ ${m}
|
|
|
13
13
|
</div>
|
|
14
14
|
</foreignObject>
|
|
15
15
|
</svg>
|
|
16
|
-
`.trim(),l=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),d=URL.createObjectURL(l);return await new Promise(c=>{let u=new Image;u.onload=()=>{try{let p=document.createElement("canvas");p.width=r,p.height=n;let f=p.getContext("2d");if(!f){URL.revokeObjectURL(d),c({ok:!1,reason:"CANVAS_CONTEXT_UNAVAILABLE"});return}f.drawImage(u,0,0),URL.revokeObjectURL(d);let h;try{h=p.toDataURL("image/webp",.85)}catch{h=p.toDataURL("image/png")}c({ok:!0,dataUrl:h,format:h.startsWith("data:image/webp")?"webp":"png",width:r,height:n})}catch(p){URL.revokeObjectURL(d),p?.name==="SecurityError"||String(p).includes("tainted")?c({ok:!1,reason:"CROSS_ORIGIN_RESOURCE"}):c({ok:!1,reason:p?.message||"CANVAS_EXPORT_FAILED"})}},u.onerror=()=>{URL.revokeObjectURL(d),c({ok:!1,reason:"IMAGE_LOAD_FAILED"})},u.src=d})}catch(o){return{ok:!1,reason:o?.message||"FALLBACK_CAPTURE_FAILED"}}}};var
|
|
17
|
-
:
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
`.trim(),l=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),d=URL.createObjectURL(l);return await new Promise(c=>{let u=new Image;u.onload=()=>{try{let p=document.createElement("canvas");p.width=r,p.height=n;let f=p.getContext("2d");if(!f){URL.revokeObjectURL(d),c({ok:!1,reason:"CANVAS_CONTEXT_UNAVAILABLE"});return}f.drawImage(u,0,0),URL.revokeObjectURL(d);let h;try{h=p.toDataURL("image/webp",.85)}catch{h=p.toDataURL("image/png")}c({ok:!0,dataUrl:h,format:h.startsWith("data:image/webp")?"webp":"png",width:r,height:n})}catch(p){URL.revokeObjectURL(d),p?.name==="SecurityError"||String(p).includes("tainted")?c({ok:!1,reason:"CROSS_ORIGIN_RESOURCE"}):c({ok:!1,reason:p?.message||"CANVAS_EXPORT_FAILED"})}},u.onerror=()=>{URL.revokeObjectURL(d),c({ok:!1,reason:"IMAGE_LOAD_FAILED"})},u.src=d})}catch(o){return{ok:!1,reason:o?.message||"FALLBACK_CAPTURE_FAILED"}}}};var Ft=class{constructor(t){N(this,"wsUrl");N(this,"projectId");N(this,"debug");N(this,"ws",null);N(this,"sessionId",null);N(this,"queue",[]);N(this,"maxQueueSize",50);N(this,"reconnectAttempts",0);N(this,"maxReconnectDelay",1e4);N(this,"reconnectTimer",null);N(this,"commandHandler");N(this,"messageListeners",[]);N(this,"isDestroyed",!1);this.wsUrl=t.url||"ws://127.0.0.1:7331",this.projectId=t.projectId,this.debug=!!t.debug}setCommandHandler(t){this.commandHandler=t}onMessage(t){return this.messageListeners.push(t),()=>{this.messageListeners=this.messageListeners.filter(r=>r!==t)}}getSessionId(){return this.sessionId}isConnected(){return this.ws!==null&&this.ws.readyState===(typeof WebSocket<"u"?WebSocket.OPEN:1)}connect(){if(!(this.isDestroyed||typeof WebSocket>"u")&&!(this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN)))try{this.ws=new WebSocket(this.wsUrl),this.ws.onopen=()=>{this.reconnectAttempts=0,this.sendHello(),this.flushQueue()},this.ws.onmessage=async t=>{try{let r=typeof t.data=="string"?t.data:"";if(!r)return;let n=JSON.parse(r);for(let o of this.messageListeners)try{o(n)}catch{}if(n.type==="hello_ack"){this.sessionId=n.sessionId,this.debug&&console.log("[BrowserTrack] Connected, session ID:",this.sessionId);return}if(n.type==="command"&&this.commandHandler){let o=n.command,i=await this.commandHandler.executeCommand(o);this.send({type:"command_response",sessionId:this.sessionId,response:i})}}catch{}},this.ws.onerror=()=>{},this.ws.onclose=()=>{this.ws=null,this.scheduleReconnect()}}catch{this.scheduleReconnect()}}send(t){try{let r=Ht(t);if(this.isConnected())try{this.ws.send(r)}catch{this.enqueue(r)}else this.enqueue(r)}catch{}}enqueue(t){this.queue.length>=this.maxQueueSize&&this.queue.shift(),this.queue.push(t)}flushQueue(){if(this.isConnected())for(;this.queue.length>0;){let t=this.queue.shift();if(t)try{this.ws.send(t)}catch{this.queue.unshift(t);break}}}sendHello(){if(!(typeof window>"u"))try{let t={type:"hello",origin:window.location.origin,url:window.location.href,title:document.title,userAgent:navigator.userAgent,timestamp:Date.now(),projectId:this.projectId};this.ws.send(Ht(t))}catch{}}scheduleReconnect(){if(this.isDestroyed||this.reconnectTimer)return;this.reconnectAttempts++;let t=Math.min(1e3*Math.pow(1.5,this.reconnectAttempts),this.maxReconnectDelay);this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}destroy(){if(this.isDestroyed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}this.queue=[]}};var Ve=class{constructor(t,r,n={}){N(this,"transport");N(this,"screenshotDriver");N(this,"options");N(this,"container",null);N(this,"shadowRoot",null);N(this,"highlightOverlay",null);N(this,"regionOverlay",null);N(this,"regionBox",null);N(this,"regionBanner",null);N(this,"markersContainer",null);N(this,"toolbarElement",null);N(this,"modalOverlay",null);N(this,"cardOverlay",null);N(this,"toastContainer",null);N(this,"activeMode","idle");N(this,"activeScenario",null);N(this,"hoveredElement",null);N(this,"selectedElement",null);N(this,"selectedRegion",null);N(this,"isDraggingRegion",!1);N(this,"dragStartX",0);N(this,"dragStartY",0);N(this,"savedNotes",[]);N(this,"showMarkers",!0);N(this,"isHidden",!1);N(this,"isToolbarCollapsed",!1);N(this,"cleanups",[]);this.transport=t,this.screenshotDriver=r;let o=Dt(n.hideQueryParam);this.isHidden=n.hidden===!0||o,this.showMarkers=n.showBadges!==!1&&!this.isHidden;try{typeof window<"u"&&window.sessionStorage&&(this.isToolbarCollapsed=window.sessionStorage.getItem("bt_toolbar_collapsed")==="true")}catch{}this.options={shortcut:"Alt+Click",maskSelectors:['input[type="password"]',"[data-sensitive]"],showToolbar:!0,showBadges:!0,...n}}init(){if(typeof window>"u"||typeof document>"u")return;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.ensureContainer()}):this.ensureContainer();let t=this.transport.onMessage(r=>{r&&r.type==="notes_sync"&&Array.isArray(r.notes)&&this.syncNotes(r.notes)});this.cleanups.push(t),this.setupListeners()}syncNotes(t){this.savedNotes=t,this.updateToolbarCount(),this.renderMarkers()}showToast(t,r="\u2728",n=2500){if(typeof document>"u"||!this.ensureContainer()||!this.toastContainer)return;let i=document.createElement("div");i.className="bt-toast",i.innerHTML=`<span>${r}</span> <span>${t}</span>`,this.toastContainer.appendChild(i),setTimeout(()=>{i.classList.add("bt-toast-fadeout"),setTimeout(()=>{i.parentElement&&i.parentElement.removeChild(i)},250)},n)}startScenario(t){let r=t||`Scenario ${new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`;this.activeScenario={id:`scen_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,title:r,stepNumber:1},this.updateToolbarState(),this.setMode("element"),this.showToast(`Started flow: "${r}"`,"\u{1F3AC}")}finishScenario(){let t=this.activeScenario?.title;this.activeScenario=null,this.updateToolbarState(),this.setMode("idle"),this.showToast(t?`Finished flow: "${t}"`:"Flow recording finished","\u2713")}setMode(t){this.activeMode=t,this.updateToolbarState(),t==="element"?this.hideRegionOverlay():t==="region"?(this.hideHighlight(),this.showRegionOverlay()):t==="page"?(this.hideRegionOverlay(),this.hideHighlight(),this.openNoteEditor(document.body,"page")):(this.hideRegionOverlay(),this.hideHighlight())}isVisible(){return!this.isHidden}setVisible(t){this.isHidden=!t,this.showMarkers=this.options.showBadges!==!1&&!this.isHidden,this.container&&(this.container.style.display=this.isHidden?"none":"block"),this.toolbarElement?this.toolbarElement.style.display=this.isHidden?"none":"flex":!this.isHidden&&this.options.showToolbar!==!1&&this.createToolbar(),this.isHidden?(this.hideHighlight(),this.hideRegionOverlay(),this.modalOverlay&&this.shadowRoot&&(this.shadowRoot.removeChild(this.modalOverlay),this.modalOverlay=null),this.cardOverlay&&this.shadowRoot&&(this.shadowRoot.removeChild(this.cardOverlay),this.cardOverlay=null),this.markersContainer&&(this.markersContainer.innerHTML="")):(this.renderMarkers(),this.updateToolbarCount())}ensureContainer(){if(typeof document>"u")return null;if(!this.container){this.container=document.createElement("div"),this.container.id="browsertrack-inspector-host",this.container.style.cssText="all: initial; position: fixed; top: 0; left: 0; width: 0; height: 0; z-index: 2147483647; pointer-events: none;",this.isHidden&&(this.container.style.display="none"),this.shadowRoot=this.container.attachShadow({mode:"open"});let t=document.createElement("style");t.textContent=`
|
|
17
|
+
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
|
18
|
+
|
|
19
|
+
:host, :host *, :host *::before, :host *::after {
|
|
20
|
+
box-sizing: border-box;
|
|
20
21
|
-webkit-font-smoothing: antialiased;
|
|
21
22
|
-moz-osx-font-smoothing: grayscale;
|
|
23
|
+
text-rendering: optimizeLegibility;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host {
|
|
27
|
+
font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
28
|
+
color-scheme: dark;
|
|
29
|
+
letter-spacing: -0.012em;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
button, input, textarea, select {
|
|
33
|
+
font-family: inherit;
|
|
34
|
+
letter-spacing: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
code, pre, kbd, .bt-mono, .bt-badge, .bt-region-badge, .bt-target-pill, .bt-component-pill {
|
|
38
|
+
font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
22
39
|
}
|
|
23
40
|
|
|
24
41
|
/* 1. Element Highlight Overlay */
|
|
@@ -252,7 +269,7 @@ ${m}
|
|
|
252
269
|
pointer-events: auto;
|
|
253
270
|
z-index: 2147483646;
|
|
254
271
|
user-select: none;
|
|
255
|
-
transition: all 0.
|
|
272
|
+
transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
|
|
256
273
|
}
|
|
257
274
|
|
|
258
275
|
.bt-toolbar-btn {
|
|
@@ -313,6 +330,86 @@ ${m}
|
|
|
313
330
|
margin: 0 2px;
|
|
314
331
|
}
|
|
315
332
|
|
|
333
|
+
.bt-toolbar-collapse-btn {
|
|
334
|
+
background: transparent;
|
|
335
|
+
border: none;
|
|
336
|
+
color: #64748b;
|
|
337
|
+
font-size: 11px;
|
|
338
|
+
font-weight: 700;
|
|
339
|
+
padding: 6px 8px;
|
|
340
|
+
border-radius: 20px;
|
|
341
|
+
cursor: pointer;
|
|
342
|
+
display: flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: center;
|
|
345
|
+
transition: all 0.15s ease;
|
|
346
|
+
font-family: inherit;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.bt-toolbar-collapse-btn:hover {
|
|
350
|
+
background: #1e293b;
|
|
351
|
+
color: #f8fafc;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* Collapsed Toolbar State */
|
|
355
|
+
.bt-toolbar.bt-toolbar-collapsed {
|
|
356
|
+
padding: 0;
|
|
357
|
+
background: transparent;
|
|
358
|
+
border: none;
|
|
359
|
+
box-shadow: none;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.bt-toolbar.bt-toolbar-collapsed .bt-toolbar-btn,
|
|
363
|
+
.bt-toolbar.bt-toolbar-collapsed .bt-toolbar-divider,
|
|
364
|
+
.bt-toolbar.bt-toolbar-collapsed .bt-toolbar-collapse-btn {
|
|
365
|
+
display: none !important;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.bt-toolbar-trigger {
|
|
369
|
+
display: none;
|
|
370
|
+
background: #0f172a;
|
|
371
|
+
border: 1px solid #334155;
|
|
372
|
+
border-radius: 30px;
|
|
373
|
+
padding: 6px 14px;
|
|
374
|
+
color: #38bdf8;
|
|
375
|
+
font-size: 12px;
|
|
376
|
+
font-weight: 600;
|
|
377
|
+
cursor: pointer;
|
|
378
|
+
align-items: center;
|
|
379
|
+
gap: 8px;
|
|
380
|
+
box-shadow: 0 10px 25px -3px rgba(0,0,0,0.6), 0 4px 6px -4px rgba(0,0,0,0.4);
|
|
381
|
+
transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
382
|
+
font-family: inherit;
|
|
383
|
+
user-select: none;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.bt-toolbar.bt-toolbar-collapsed .bt-toolbar-trigger {
|
|
387
|
+
display: inline-flex;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.bt-toolbar-trigger:hover {
|
|
391
|
+
background: #1e293b;
|
|
392
|
+
color: #ffffff;
|
|
393
|
+
transform: translateY(-2px);
|
|
394
|
+
box-shadow: 0 12px 28px -3px rgba(0,0,0,0.7);
|
|
395
|
+
border-color: #38bdf8;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.bt-pulse-dot {
|
|
399
|
+
width: 7px;
|
|
400
|
+
height: 7px;
|
|
401
|
+
border-radius: 50%;
|
|
402
|
+
background: #38bdf8;
|
|
403
|
+
box-shadow: 0 0 8px #38bdf8;
|
|
404
|
+
display: inline-block;
|
|
405
|
+
animation: bt-dot-pulse 2s infinite;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
@keyframes bt-dot-pulse {
|
|
409
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
410
|
+
50% { opacity: 0.4; transform: scale(0.85); }
|
|
411
|
+
}
|
|
412
|
+
|
|
316
413
|
/* 5. Modals & Popover Card */
|
|
317
414
|
.bt-modal-backdrop {
|
|
318
415
|
position: fixed;
|
|
@@ -696,7 +793,12 @@ ${m}
|
|
|
696
793
|
from { opacity: 0; transform: translateY(8px) scale(0.95); }
|
|
697
794
|
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
698
795
|
}
|
|
699
|
-
`,this.shadowRoot.appendChild(t),this.highlightOverlay=document.createElement("div"),this.highlightOverlay.className="bt-highlight",this.highlightOverlay.style.display="none",this.shadowRoot.appendChild(this.highlightOverlay),this.markersContainer=document.createElement("div"),this.markersContainer.className="bt-markers-layer",this.shadowRoot.appendChild(this.markersContainer),this.toastContainer=document.createElement("div"),this.toastContainer.className="bt-toast-container",this.shadowRoot.appendChild(this.toastContainer),this.options.showToolbar&&!this.isHidden&&this.createToolbar()}if(this.container&&!this.container.isConnected){let t=document.body||document.documentElement;t&&t.appendChild(this.container)}return this.shadowRoot}createToolbar(){if(!this.shadowRoot||this.toolbarElement)return;this.toolbarElement=document.createElement("div"),this.toolbarElement.className
|
|
796
|
+
`,this.shadowRoot.appendChild(t),this.highlightOverlay=document.createElement("div"),this.highlightOverlay.className="bt-highlight",this.highlightOverlay.style.display="none",this.shadowRoot.appendChild(this.highlightOverlay),this.markersContainer=document.createElement("div"),this.markersContainer.className="bt-markers-layer",this.shadowRoot.appendChild(this.markersContainer),this.toastContainer=document.createElement("div"),this.toastContainer.className="bt-toast-container",this.shadowRoot.appendChild(this.toastContainer),this.options.showToolbar&&!this.isHidden&&this.createToolbar()}if(this.container&&!this.container.isConnected){let t=document.body||document.documentElement;t&&t.appendChild(this.container)}return this.shadowRoot}createToolbar(){if(!this.shadowRoot||this.toolbarElement)return;this.toolbarElement=document.createElement("div"),this.toolbarElement.className=`bt-toolbar ${this.isToolbarCollapsed?"bt-toolbar-collapsed":""}`,this.toolbarElement.innerHTML=`
|
|
797
|
+
<button class="bt-toolbar-trigger" id="bt-toolbar-expand" title="Expand BrowserTrack toolbar (Alt+T)">
|
|
798
|
+
<span class="bt-pulse-dot"></span>
|
|
799
|
+
<span>\u26A1 BrowserTrack</span>
|
|
800
|
+
<span class="bt-count-pill" id="bt-notes-count-collapsed">0</span>
|
|
801
|
+
</button>
|
|
700
802
|
<button class="bt-toolbar-btn" id="bt-mode-element" title="Inspect element (or hold Alt+Click)">
|
|
701
803
|
<span>\u{1F3AF}</span> Element
|
|
702
804
|
</button>
|
|
@@ -714,7 +816,11 @@ ${m}
|
|
|
714
816
|
<button class="bt-toolbar-btn active" id="bt-toggle-notes" title="Toggle visible note markers on screen">
|
|
715
817
|
<span>\u{1F4CC}</span> Notes <span class="bt-count-pill" id="bt-notes-count">0</span>
|
|
716
818
|
</button>
|
|
717
|
-
|
|
819
|
+
<div class="bt-toolbar-divider"></div>
|
|
820
|
+
<button class="bt-toolbar-collapse-btn" id="bt-toolbar-collapse" title="Collapse toolbar (Alt+T)">
|
|
821
|
+
<span>\u276F</span>
|
|
822
|
+
</button>
|
|
823
|
+
`;let t=this.toolbarElement.querySelector("#bt-toolbar-expand"),r=this.toolbarElement.querySelector("#bt-toolbar-collapse"),n=this.toolbarElement.querySelector("#bt-mode-element"),o=this.toolbarElement.querySelector("#bt-mode-region"),i=this.toolbarElement.querySelector("#bt-mode-page"),a=this.toolbarElement.querySelector("#bt-mode-flow"),s=this.toolbarElement.querySelector("#bt-toggle-notes");t.onclick=l=>{l.stopPropagation(),this.toggleToolbarCollapse(!1)},r.onclick=l=>{l.stopPropagation(),this.toggleToolbarCollapse(!0)},n.onclick=l=>{l.stopPropagation(),this.setMode(this.activeMode==="element"?"idle":"element")},o.onclick=l=>{l.stopPropagation(),this.setMode(this.activeMode==="region"?"idle":"region")},i.onclick=l=>{l.stopPropagation(),this.setMode("page")},a.onclick=l=>{l.stopPropagation(),this.activeScenario?this.finishScenario():this.startScenario()},s.onclick=l=>{l.stopPropagation(),this.showMarkers=!this.showMarkers,s.classList.toggle("active",this.showMarkers),this.renderMarkers()},this.shadowRoot.appendChild(this.toolbarElement)}toggleToolbarCollapse(t){if(this.toolbarElement){this.isToolbarCollapsed=typeof t=="boolean"?t:!this.isToolbarCollapsed,this.toolbarElement.classList.toggle("bt-toolbar-collapsed",this.isToolbarCollapsed);try{typeof window<"u"&&window.sessionStorage&&window.sessionStorage.setItem("bt_toolbar_collapsed",String(this.isToolbarCollapsed))}catch{}}}updateToolbarState(){if(!this.toolbarElement)return;let t=this.toolbarElement.querySelector("#bt-mode-element"),r=this.toolbarElement.querySelector("#bt-mode-region"),n=this.toolbarElement.querySelector("#bt-mode-page"),o=this.toolbarElement.querySelector("#bt-mode-flow");t?.classList.toggle("active",this.activeMode==="element"),r?.classList.toggle("active",this.activeMode==="region"),n?.classList.toggle("active",this.activeMode==="page"),o&&(this.activeScenario?(o.className="bt-toolbar-btn active-scenario",o.innerHTML=`<span>\u{1F3AC}</span> Step ${this.activeScenario.stepNumber} (Finish)`,o.setAttribute("title",`Click to finish recording "${this.activeScenario.title}"`)):(o.className="bt-toolbar-btn",o.innerHTML="<span>\u{1F3AC}</span> Flow",o.setAttribute("title","Record multi-step reproduction flow")))}updateToolbarCount(){if(!this.toolbarElement)return;let t=this.savedNotes.filter(o=>o.status==="OPEN").length,r=this.toolbarElement.querySelector("#bt-notes-count");r&&(r.textContent=String(t));let n=this.toolbarElement.querySelector("#bt-notes-count-collapsed");n&&(n.textContent=String(t))}renderMarkers(){if(!this.ensureContainer()||!this.markersContainer||(this.markersContainer.innerHTML="",!this.showMarkers||this.isHidden))return;let r=window.location.pathname,n=this.savedNotes.filter(i=>i.status!=="OPEN"?!1:!i.route||i.route===r?!0:i.route.includes("#")||i.route.includes("?")?window.location.href.includes(i.route):!1),o=[];if(n.forEach((i,a)=>{if(i.type==="page"){o.push(i);return}let s=!!i.scenarioId&&i.stepNumber!=null,l=s?`\u{1F3AC} Step ${i.stepNumber}`:`#${a+1}`,d=`bt-note-marker ${s?"bt-note-marker-step":""}`;if(i.type==="region"&&i.region){let p=document.createElement("div");p.className="bt-region-marker-box",p.style.left=`${i.region.x}px`,p.style.top=`${i.region.y}px`,p.style.width=`${i.region.width}px`,p.style.height=`${i.region.height}px`,this.markersContainer.appendChild(p);let f=document.createElement("div");f.className=d,f.style.left=`${Math.max(4,i.region.x-12)}px`,f.style.top=`${Math.max(4,i.region.y-12)}px`,f.title=s?`[${i.scenarioTitle||"Scenario"}] Step ${i.stepNumber}: ${i.message}`:i.message,f.innerHTML=`<span>${s?"\u{1F3AC}":"\u{1F4D0}"}</span> <span>${l}</span>`,f.onclick=h=>{h.stopPropagation(),this.openNoteCard(i)},this.markersContainer.appendChild(f);return}let c=null;if(i.target?.selector)try{c=document.querySelector(i.target.selector)}catch{}let u=c?c.getBoundingClientRect():i.target?.boundingRect;if(u){if(c&&(u.bottom<0||u.top>window.innerHeight||u.right<0||u.left>window.innerWidth))return;let f=document.createElement("div");f.className=d,f.setAttribute("data-note-id",i.id),f.title=s?`[${i.scenarioTitle||"Scenario"}] Step ${i.stepNumber}: ${i.message}`:i.message,f.style.left=`${Math.max(4,u.left-10)}px`,f.style.top=`${Math.max(4,u.top-12)}px`,f.innerHTML=`<span>${s?"\u{1F3AC}":"\u{1F4DD}"}</span> <span>${l}</span>`,f.onclick=h=>{h.stopPropagation(),this.openNoteCard(i)},c&&(f.onmouseenter=()=>this.updateHighlight(c),f.onmouseleave=()=>this.hideHighlight()),this.markersContainer.appendChild(f)}}),o.length>0){let i=document.createElement("div");i.className="bt-page-notes-dock",o.forEach(a=>{let s=document.createElement("div");s.className="bt-page-note-pill";let l=a.scenarioId&&a.stepNumber?`Step ${a.stepNumber}: `:"";s.innerHTML=`<span>\u{1F4C4}</span> <span>${l}${ke(a.message,25)}</span>`,s.onclick=d=>{d.stopPropagation(),this.openNoteCard(a)},i.appendChild(s)}),this.markersContainer.appendChild(i)}}updateMarkerPositions(){!this.showMarkers||!this.markersContainer||this.renderMarkers()}openNoteCard(t){let r=this.ensureContainer();if(!r)return;this.cardOverlay&&this.cardOverlay.parentElement&&(this.cardOverlay.parentElement.removeChild(this.cardOverlay),this.cardOverlay=null);let n=document.createElement("div");n.className="bt-modal-backdrop",this.cardOverlay=n;let o=`bt-badge-${t.type.toLowerCase()}`,i=t.status==="OPEN"?"bt-badge-status-open":"bt-badge-status-resolved",a=t.type==="region"?"\u{1F4D0}":t.type==="page"?"\u{1F4C4}":"\u{1F3AF}",s=t.type==="region"&&t.region?`Region: ${t.region.width} \xD7 ${t.region.height} px \xB7 Route: ${t.route}`:t.type==="page"?`Page Note \xB7 Route: ${t.route}`:`${t.target?.selector||"Element"} (${t.target?.boundingRect?.width||0}\xD7${t.target?.boundingRect?.height||0}px) \xB7 ${t.route}`,l=new Date(t.createdAt).toLocaleString(),d="",c=[];if(t.scenarioId){c=this.savedNotes.filter(S=>S.scenarioId===t.scenarioId).sort((S,M)=>(S.stepNumber||0)-(M.stepNumber||0));let v=c.findIndex(S=>S.id===t.id),b=v>0?c[v-1]:null,w=v>=0&&v<c.length-1?c[v+1]:null;d=`
|
|
718
824
|
<div class="bt-scenario-stepper">
|
|
719
825
|
<button class="bt-step-nav-btn" id="btn-prev-step" ${b?"":"disabled"}>
|
|
720
826
|
\u25C0 Step ${b?b.stepNumber:""}
|
|
@@ -774,10 +880,10 @@ ${m}
|
|
|
774
880
|
</div>
|
|
775
881
|
</div>
|
|
776
882
|
</div>
|
|
777
|
-
`;let u=n.querySelector("#btn-card-close"),p=n.querySelector("#btn-card-dismiss"),f=n.querySelector("#btn-card-resolve"),h=n.querySelector("#btn-card-delete"),m=n.querySelector("#btn-card-delete-flow"),g=n.querySelector("#btn-prev-step"),y=n.querySelector("#btn-next-step-card"),x=()=>{this.cardOverlay&&(r.removeChild(this.cardOverlay),this.cardOverlay=null,this.hideHighlight())};if(u.onclick=x,p.onclick=x,n.onclick=v=>{v.target===n&&x()},g&&c.length>0){let v=c.findIndex(b=>b.id===t.id);v>0&&(g.onclick=()=>{this.openNoteCard(c[v-1])})}if(y&&c.length>0){let v=c.findIndex(b=>b.id===t.id);v>=0&&v<c.length-1&&(y.onclick=()=>{this.openNoteCard(c[v+1])})}f.onclick=()=>{t.status==="OPEN"?(this.transport.send({type:"resolve_note",noteId:t.id}),this.showToast("Note marked as resolved","\u2705")):(this.transport.send({type:"reopen_note",noteId:t.id}),this.showToast("Note reopened","\u21BA")),x()},h.onclick=()=>{this.transport.send({type:"delete_note",noteId:t.id}),this.showToast("Note deleted","\u{1F5D1}\uFE0F"),x()},m&&t.scenarioId&&(m.onclick=()=>{this.transport.send({type:"delete_scenario",scenarioId:t.scenarioId}),this.showToast("Scenario flow deleted","\u{1F5D1}\uFE0F"),x()}),r.appendChild(n)}setupListeners(){let t=a=>{try{if(this.isHidden||this.modalOverlay||this.cardOverlay||this.isDraggingRegion||this.activeMode==="region")return;let s=a.composedPath?a.composedPath():[];if(this.container&&s.includes(this.container)){this.hideHighlight();return}if(a.altKey||this.activeMode==="element"){let l=document.elementFromPoint(a.clientX,a.clientY);if(
|
|
883
|
+
`;let u=n.querySelector("#btn-card-close"),p=n.querySelector("#btn-card-dismiss"),f=n.querySelector("#btn-card-resolve"),h=n.querySelector("#btn-card-delete"),m=n.querySelector("#btn-card-delete-flow"),g=n.querySelector("#btn-prev-step"),y=n.querySelector("#btn-next-step-card"),x=()=>{this.cardOverlay&&(r.removeChild(this.cardOverlay),this.cardOverlay=null,this.hideHighlight())};if(u.onclick=x,p.onclick=x,n.onclick=v=>{v.target===n&&x()},g&&c.length>0){let v=c.findIndex(b=>b.id===t.id);v>0&&(g.onclick=()=>{this.openNoteCard(c[v-1])})}if(y&&c.length>0){let v=c.findIndex(b=>b.id===t.id);v>=0&&v<c.length-1&&(y.onclick=()=>{this.openNoteCard(c[v+1])})}f.onclick=()=>{t.status==="OPEN"?(this.transport.send({type:"resolve_note",noteId:t.id}),this.showToast("Note marked as resolved","\u2705")):(this.transport.send({type:"reopen_note",noteId:t.id}),this.showToast("Note reopened","\u21BA")),x()},h.onclick=()=>{this.transport.send({type:"delete_note",noteId:t.id}),this.showToast("Note deleted","\u{1F5D1}\uFE0F"),x()},m&&t.scenarioId&&(m.onclick=()=>{this.transport.send({type:"delete_scenario",scenarioId:t.scenarioId}),this.showToast("Scenario flow deleted","\u{1F5D1}\uFE0F"),x()}),r.appendChild(n)}setupListeners(){let t=a=>{try{if(this.isHidden||this.modalOverlay||this.cardOverlay||this.isDraggingRegion||this.activeMode==="region")return;let s=a.composedPath?a.composedPath():[];if(this.container&&s.includes(this.container)){this.hideHighlight();return}if(a.altKey||this.activeMode==="element"){let l=document.elementFromPoint(a.clientX,a.clientY),d=l?Ot(l):null;if(d&&d!==this.container&&!this.container?.contains(d)){this.hoveredElement=d,this.updateHighlight(d);return}}!a.altKey&&this.activeMode!=="element"&&this.hideHighlight()}catch{}},r=a=>{try{if(this.isHidden||this.modalOverlay||this.cardOverlay)return;let s=a.composedPath?a.composedPath():[];if(this.container&&s.includes(this.container)||this.activeMode==="region")return;if(a.altKey||this.activeMode==="element"){a.preventDefault(),a.stopPropagation();let l=this.hoveredElement||document.elementFromPoint(a.clientX,a.clientY),d=l?Ot(l):null;d&&d!==this.container&&!this.container?.contains(d)&&(this.selectedElement=d,this.openNoteEditor(d,"element"),this.activeMode==="element"&&!this.activeScenario&&this.setMode("idle"))}}catch{}},n=a=>{try{if(a.altKey&&(a.key==="t"||a.key==="T")){a.preventDefault(),this.toggleToolbarCollapse();return}a.key==="Escape"&&(this.cardOverlay&&this.cardOverlay.parentElement&&this.shadowRoot?(this.shadowRoot.removeChild(this.cardOverlay),this.cardOverlay=null):(this.activeMode==="region"||this.activeMode==="element")&&(this.activeScenario||this.setMode("idle")))}catch{}},o=a=>{try{a.key==="Alt"&&!this.modalOverlay&&!this.cardOverlay&&this.activeMode!=="element"&&this.hideHighlight()}catch{}},i=()=>{try{requestAnimationFrame(()=>{try{this.updateMarkerPositions()}catch{}})}catch{}};window.addEventListener("mousemove",t,{capture:!0,passive:!0}),window.addEventListener("click",r,{capture:!0}),window.addEventListener("keydown",n,{capture:!0}),window.addEventListener("keyup",o,{capture:!0}),window.addEventListener("scroll",i,{capture:!0,passive:!0}),window.addEventListener("resize",i,{passive:!0}),this.cleanups.push(()=>{window.removeEventListener("mousemove",t,{capture:!0}),window.removeEventListener("click",r,{capture:!0}),window.removeEventListener("keydown",n,{capture:!0}),window.removeEventListener("keyup",o,{capture:!0}),window.removeEventListener("scroll",i,{capture:!0}),window.removeEventListener("resize",i)})}showRegionOverlay(){let t=this.ensureContainer();if(t)if(this.regionOverlay)this.regionOverlay.style.display="block";else{this.regionOverlay=document.createElement("div"),this.regionOverlay.className="bt-region-overlay",this.regionBox=document.createElement("div"),this.regionBox.className="bt-region-box",this.regionBox.style.display="none",this.regionOverlay.appendChild(this.regionBox),this.regionBanner=document.createElement("div"),this.regionBanner.className="bt-region-banner",this.regionBanner.innerHTML=`
|
|
778
884
|
<span>\u{1F4D0} Drag rectangle on screen to select region</span>
|
|
779
885
|
<button class="bt-region-cancel-btn" id="bt-region-cancel">\u2715 Cancel (Esc)</button>
|
|
780
|
-
`;let r=this.regionBanner.querySelector("#bt-region-cancel");r.onclick=n=>{n.stopPropagation(),this.setMode("idle")},this.regionOverlay.appendChild(this.regionBanner),this.regionOverlay.oncontextmenu=n=>{n.preventDefault(),this.setMode("idle")},this.regionOverlay.onmousedown=n=>{let o=n.composedPath?n.composedPath():[];this.regionBanner&&o.includes(this.regionBanner)||this.toolbarElement&&o.includes(this.toolbarElement)||(this.isDraggingRegion=!0,this.dragStartX=n.clientX,this.dragStartY=n.clientY,this.regionBox&&(this.regionBox.style.display="block",this.regionBox.style.left=`${n.clientX}px`,this.regionBox.style.top=`${n.clientY}px`,this.regionBox.style.width="0px",this.regionBox.style.height="0px"))},this.regionOverlay.onmousemove=n=>{if(!this.isDraggingRegion||!this.regionBox)return;let o=n.clientX,i=n.clientY,a=Math.min(this.dragStartX,o),s=Math.min(this.dragStartY,i),l=Math.abs(o-this.dragStartX),d=Math.abs(i-this.dragStartY);this.regionBox.style.left=`${a}px`,this.regionBox.style.top=`${s}px`,this.regionBox.style.width=`${l}px`,this.regionBox.style.height=`${d}px`;let c=this.regionBox.querySelector(".bt-region-badge");c||(c=document.createElement("div"),c.className="bt-region-badge",this.regionBox.appendChild(c)),c.textContent=`Region: ${Math.round(l)} \xD7 ${Math.round(d)} px
|
|
886
|
+
`;let r=this.regionBanner.querySelector("#bt-region-cancel");r.onclick=n=>{n.stopPropagation(),this.setMode("idle")},this.regionOverlay.appendChild(this.regionBanner),this.regionOverlay.oncontextmenu=n=>{n.preventDefault(),this.setMode("idle")},this.regionOverlay.onmousedown=n=>{let o=n.composedPath?n.composedPath():[];this.regionBanner&&o.includes(this.regionBanner)||this.toolbarElement&&o.includes(this.toolbarElement)||(this.isDraggingRegion=!0,this.dragStartX=n.clientX,this.dragStartY=n.clientY,this.regionBox&&(this.regionBox.style.display="block",this.regionBox.style.left=`${n.clientX}px`,this.regionBox.style.top=`${n.clientY}px`,this.regionBox.style.width="0px",this.regionBox.style.height="0px"))},this.regionOverlay.onmousemove=n=>{if(!this.isDraggingRegion||!this.regionBox)return;let o=n.clientX,i=n.clientY,a=Math.min(this.dragStartX,o),s=Math.min(this.dragStartY,i),l=Math.abs(o-this.dragStartX),d=Math.abs(i-this.dragStartY);this.regionBox.style.left=`${a}px`,this.regionBox.style.top=`${s}px`,this.regionBox.style.width=`${l}px`,this.regionBox.style.height=`${d}px`;let c=this.regionBox.querySelector(".bt-region-badge");c||(c=document.createElement("div"),c.className="bt-region-badge",this.regionBox.appendChild(c)),c.textContent=`Region: ${Math.round(l)} \xD7 ${Math.round(d)} px`,s<32?c.style.top="4px":c.style.top="-26px"},this.regionOverlay.onmouseup=n=>{if(!this.isDraggingRegion)return;this.isDraggingRegion=!1;let o=n.clientX,i=n.clientY,a=Math.min(this.dragStartX,o),s=Math.min(this.dragStartY,i),l=Math.abs(o-this.dragStartX),d=Math.abs(i-this.dragStartY);l>15&&d>15&&(this.selectedRegion={x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(d)},this.openRegionNoteEditor(this.selectedRegion)),this.regionBox&&(this.regionBox.style.display="none"),this.activeScenario||this.setMode("idle")},t.appendChild(this.regionOverlay)}}hideRegionOverlay(){this.regionOverlay&&(this.regionOverlay.style.display="none",this.isDraggingRegion=!1,this.regionBox&&(this.regionBox.style.display="none"))}updateHighlight(t){if(!this.ensureContainer()||!this.highlightOverlay)return;let n=t.getBoundingClientRect();this.highlightOverlay.style.display="block",this.highlightOverlay.style.left=`${n.left}px`,this.highlightOverlay.style.top=`${n.top}px`,this.highlightOverlay.style.width=`${n.width}px`,this.highlightOverlay.style.height=`${n.height}px`;let o=this.highlightOverlay.querySelector(".bt-badge");o||(o=document.createElement("div"),o.className="bt-badge",this.highlightOverlay.appendChild(o));let i=ge(t),a=this.activeScenario?`\u{1F3AC} Step ${this.activeScenario.stepNumber} \xB7 ${i}`:i;o.textContent=`${a} (${Math.round(n.width)} \xD7 ${Math.round(n.height)} px)`,n.top<32?o.style.top=`${n.height+4}px`:o.style.top="-26px",n.left+260>window.innerWidth?(o.style.left="auto",o.style.right="0"):(o.style.left="0",o.style.right="auto")}hideHighlight(){this.highlightOverlay&&(this.highlightOverlay.style.display="none")}openNoteEditor(t,r="element"){if(!this.ensureContainer())return;let o=t||document.body;this.selectedElement=o,r==="element"&&this.updateHighlight(o);let i=r==="element"?Re(o):void 0,a=i?.componentName?`\u{1F9EC} <${i.componentName}>${i.sourceFile?" ("+i.sourceFile+(i.sourceLine?":"+i.sourceLine:"")+")":""} \xB7 `:"";this.renderNoteModal({title:this.activeScenario?`Step ${this.activeScenario.stepNumber}: ${this.activeScenario.title}`:"Add Visual Note",modeBadge:this.activeScenario?`STEP ${this.activeScenario.stepNumber}`:r.toUpperCase(),pillText:r==="page"?`Page Viewport: ${window.innerWidth} \xD7 ${window.innerHeight} px`:`${a}${ge(o)} (${Math.round(o.getBoundingClientRect().width)}\xD7${Math.round(o.getBoundingClientRect().height)}) \xB7 Viewport: ${window.innerWidth}\xD7${window.innerHeight}`,onSave:async(s,l)=>{let d;l==="next_step"&&!this.activeScenario&&this.startScenario(),this.activeScenario&&(d={scenarioId:this.activeScenario.id,stepNumber:this.activeScenario.stepNumber,scenarioTitle:this.activeScenario.title}),await this.saveVisualNote(o,s,r,d),l==="next_step"&&this.activeScenario?(this.activeScenario.stepNumber++,this.updateToolbarState(),this.setMode("element")):l==="finish_flow"&&this.activeScenario&&this.finishScenario()}})}openRegionNoteEditor(t){this.renderNoteModal({title:this.activeScenario?`Step ${this.activeScenario.stepNumber}: ${this.activeScenario.title}`:"Add Region Note",modeBadge:this.activeScenario?`STEP ${this.activeScenario.stepNumber}`:"REGION",pillText:`Selected Area: x:${t.x}, y:${t.y} (${t.width} \xD7 ${t.height} px)`,onSave:async(r,n)=>{let o;n==="next_step"&&!this.activeScenario&&this.startScenario(),this.activeScenario&&(o={scenarioId:this.activeScenario.id,stepNumber:this.activeScenario.stepNumber,scenarioTitle:this.activeScenario.title}),await this.saveRegionVisualNote(t,r,o),n==="next_step"&&this.activeScenario?(this.activeScenario.stepNumber++,this.updateToolbarState(),this.setMode("element")):n==="finish_flow"&&this.activeScenario&&this.finishScenario()}})}renderNoteModal(t){let r=this.ensureContainer();if(!r)return;this.modalOverlay&&this.modalOverlay.parentElement&&(this.modalOverlay.parentElement.removeChild(this.modalOverlay),this.modalOverlay=null);let n=document.createElement("div");n.className="bt-modal-backdrop",this.modalOverlay=n;let o=t.modeBadge.startsWith("STEP"),i=o?"bt-badge-step":`bt-badge-${t.modeBadge.toLowerCase()}`,a=o?"\u{1F3AC}":t.modeBadge==="REGION"?"\u{1F4D0}":t.modeBadge==="PAGE"?"\u{1F4C4}":"\u{1F3AF}",s=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);n.innerHTML=`
|
|
781
887
|
<div class="bt-modal">
|
|
782
888
|
<div class="bt-modal-header">
|
|
783
889
|
<div class="bt-modal-title">
|
|
@@ -806,4 +912,4 @@ ${m}
|
|
|
806
912
|
</div>
|
|
807
913
|
</div>
|
|
808
914
|
</div>
|
|
809
|
-
`;let l=n.querySelector("textarea"),d=n.querySelector("#btn-close"),c=n.querySelector("#btn-cancel"),u=n.querySelector("#btn-save"),p=n.querySelector("#btn-next-step"),f=n.querySelector("#btn-finish-flow"),h=()=>{this.modalOverlay&&(r.removeChild(this.modalOverlay),this.modalOverlay=null,this.hideHighlight(),this.hideRegionOverlay())};d.onclick=h,c.onclick=h,n.onclick=g=>{g.target===n&&h()};let m=async g=>{let y=l.value.trim();if(y){p.disabled=!0,u&&(u.disabled=!0),f&&(f.disabled=!0);try{await t.onSave(y,g)}
|
|
915
|
+
`;let l=n.querySelector("textarea"),d=n.querySelector("#btn-close"),c=n.querySelector("#btn-cancel"),u=n.querySelector("#btn-save"),p=n.querySelector("#btn-next-step"),f=n.querySelector("#btn-finish-flow"),h=()=>{this.modalOverlay&&(r.removeChild(this.modalOverlay),this.modalOverlay=null,this.hideHighlight(),this.hideRegionOverlay())};d.onclick=h,c.onclick=h,n.onclick=g=>{g.target===n&&h()};let m=async g=>{let y=l.value.trim();if(y){p.disabled=!0,u&&(u.disabled=!0),f&&(f.disabled=!0),h();try{await t.onSave(y,g)}catch{this.showToast("Failed to save note","\u26A0\uFE0F")}}};u&&(u.onclick=()=>m("save")),p.onclick=()=>m("next_step"),f&&(f.onclick=()=>m("finish_flow")),l.onkeydown=g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),m(this.activeScenario?"next_step":"save")),g.key==="Escape"&&h()},r.appendChild(n),setTimeout(()=>l?.focus(),50)}async saveVisualNote(t,r,n="element",o){let i=t.getBoundingClientRect(),a=n==="page"?"body":ge(t),s;try{let m=this.screenshotDriver.captureElement(t),g=new Promise(x=>setTimeout(()=>x({ok:!1}),800)),y=await Promise.race([m,g]);y&&y.ok&&y.dataUrl&&(s=y.dataUrl)}catch{}let l=this.extractElementContext(t),d={selector:a,boundingRect:{x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height),top:Math.round(i.top),left:Math.round(i.left),bottom:Math.round(i.bottom),right:Math.round(i.right)},visible:i.width>0&&i.height>0,confidence:a.startsWith("[data-test")?"high":a.startsWith("#")?"medium":"low"},c=typeof window<"u"?window.location.pathname+window.location.search:"/",u=typeof window<"u"?window.location.href:"http://localhost/",p=typeof window<"u"?{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio||1}:{width:1280,height:800,devicePixelRatio:1},f=typeof window<"u"?{scrollX:window.scrollX,scrollY:window.scrollY}:{scrollX:0,scrollY:0},h={type:"create_note",sessionId:this.transport.getSessionId()||"",noteType:n,message:r,route:c,url:u,viewport:p,scroll:f,target:d,elementContext:l,screenshot:s,scenarioId:o?.scenarioId,stepNumber:o?.stepNumber,scenarioTitle:o?.scenarioTitle,timestamp:Date.now()};this.transport.send(h),this.options.onNoteCreated&&this.options.onNoteCreated(h),o?.scenarioId?this.showToast(`Step ${o.stepNumber||1} recorded`,"\u{1F3AC}"):this.showToast("Visual note saved","\u2728")}async saveRegionVisualNote(t,r,n){let o;try{let c=t.x+t.width/2,u=t.y+t.height/2,p=document.elementFromPoint(c,u)||document.body,f=this.screenshotDriver.captureElement(p),h=new Promise(g=>setTimeout(()=>g({ok:!1}),800)),m=await Promise.race([f,h]);m&&m.ok&&m.dataUrl&&(o=m.dataUrl)}catch{}let i=typeof window<"u"?window.location.pathname+window.location.search:"/",a=typeof window<"u"?window.location.href:"http://localhost/",s=typeof window<"u"?{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio||1}:{width:1280,height:800,devicePixelRatio:1},l=typeof window<"u"?{scrollX:window.scrollX,scrollY:window.scrollY}:{scrollX:0,scrollY:0},d={type:"create_note",sessionId:this.transport.getSessionId()||"",noteType:"region",message:r,route:i,url:a,viewport:s,scroll:l,region:t,screenshot:o,scenarioId:n?.scenarioId,stepNumber:n?.stepNumber,scenarioTitle:n?.scenarioTitle,timestamp:Date.now()};this.transport.send(d),this.options.onNoteCreated&&this.options.onNoteCreated(d),n?.scenarioId?this.showToast(`Step ${n.stepNumber||1} region recorded`,"\u{1F3AC}"):this.showToast("Region note saved","\u{1F4D0}")}extractElementContext(t){let r=ge(t),n={};for(let s=0;s<t.attributes.length;s++){let l=t.attributes[s];this.options.maskSelectors?.some(d=>{try{return t.matches(d)}catch{return!1}})&&(l.name==="value"||l.name==="data-secret")?n[l.name]="[REDACTED]":n[l.name]=l.value}let o=t.outerHTML;o&&o.length>1e3&&(o=ke(o,1e3));let i=t.innerText||t.textContent||"";i&&i.length>200&&(i=ke(i,200));let a=Re(t);return{selector:r,tag:t.tagName.toLowerCase(),attributes:n,outerHTML:o,innerText:i,componentSource:a,parent:t.parentElement?{selector:ge(t.parentElement),tag:t.parentElement.tagName.toLowerCase()}:void 0}}async cropDataUrl(t,r){return new Promise(n=>{let o=new Image;o.onload=()=>{let i=document.createElement("canvas");i.width=r.width,i.height=r.height;let a=i.getContext("2d");if(!a){n(t);return}let s=window.devicePixelRatio||1;a.drawImage(o,r.x*s,r.y*s,r.width*s,r.height*s,0,0,r.width,r.height);try{n(i.toDataURL("image/png"))}catch{n(t)}},o.onerror=()=>n(t),o.src=t})}destroy(){for(let t of this.cleanups)t();this.cleanups=[],this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null,this.shadowRoot=null)}};var Xe=class{constructor(t={}){N(this,"options");N(this,"breadcrumbs");N(this,"transport");N(this,"screenshotDriver");N(this,"commandHandler");N(this,"inspector");N(this,"lastElement");N(this,"currentRoute","/");N(this,"cleanups",[]);N(this,"isInitialized",!1);this.options={...st,...t,notes:{...st.notes,...t.notes||{}}},this.breadcrumbs=new Ie(this.options.maxBreadcrumbs),this.transport=new Ft({url:this.options.daemonUrl,projectId:this.options.projectId,debug:this.options.debug}),this.screenshotDriver=new ze,this.commandHandler=new it(this.screenshotDriver),this.transport.setCommandHandler(this.commandHandler),this.options.notes.enabled&&(this.inspector=new Ve(this.transport,this.screenshotDriver,{shortcut:this.options.notes.shortcut,maskSelectors:this.options.notes.maskSelectors,showToolbar:this.options.notes.showToolbar,showBadges:this.options.notes.showBadges,hidden:this.options.hidden,hideQueryParam:this.options.hideQueryParam}))}init(){if(this.isInitialized||typeof window>"u")return this;this.isInitialized=!0;try{this.currentRoute=window.location.pathname+window.location.search}catch{this.currentRoute="/"}if(this.transport.connect(),this.options.captureErrors){let t=Hr(async r=>{await this.handleRuntimeError(r)});this.cleanups.push(t)}if(this.options.captureConsole){let t=Fr(async r=>{await this.handleConsole(r)});this.cleanups.push(t)}if(this.options.captureNetwork){let t=Or(r=>{this.handleNetwork(r)});this.cleanups.push(t)}if(this.options.captureNavigation){let t=Ir(r=>{this.handleNavigation(r)});this.cleanups.push(t)}if(this.options.captureInteractions){let t=Pr((r,n)=>{n&&(this.lastElement=n),this.breadcrumbs.add(r)});this.cleanups.push(t)}return this.inspector&&this.inspector.init(),this}openNoteEditor(t,r="element"){this.inspector&&this.inspector.openNoteEditor(t,r)}startRegionSelection(){this.inspector&&this.inspector.setMode("region")}startElementSelection(){this.inspector&&this.inspector.setMode("element")}isUIVisible(){return this.inspector?this.inspector.isVisible():!1}setUIVisible(t){this.inspector&&this.inspector.setVisible(t)}setInspectMode(t){this.inspector&&this.inspector.setMode(t)}async createNote(t,r,n="element"){this.inspector&&await this.inspector.saveVisualNote(t,r,n)}async handleRuntimeError(t){this.breadcrumbs.add({type:"error",category:"runtime",message:`${t.errorType}: ${t.message}`,timestamp:t.timestamp,level:"error",data:{filename:t.filename,lineno:t.lineno,colno:t.colno}});let r;if(this.options.onErrorScreenshot&&this.lastElement?.selector)try{let n=await this.screenshotDriver.captureSelector(this.lastElement.selector);n.ok&&(r=n.dataUrl)}catch{}this.sendEvent("runtime_error",t,r)}async handleConsole(t){this.breadcrumbs.add({type:"console",category:"console",message:`console.${t.level}: ${t.message}`,timestamp:t.timestamp,level:t.level==="error"?"error":t.level==="warn"?"warn":"info"}),(t.level==="error"||t.level==="warn")&&this.sendEvent("console",t)}handleNetwork(t){let r=t.status&&t.status>=400||!!t.error,n=`${t.method} ${t.url} -> ${t.status||"ERR"} (${t.durationMs}ms)`;this.breadcrumbs.add({type:t.id?.startsWith("xhr")?"xhr":"fetch",category:"network",message:n,timestamp:t.timestamp,level:r?"error":"info",data:{status:t.status,durationMs:t.durationMs,error:t.error,aborted:t.aborted}}),this.sendEvent("fetch",t)}handleNavigation(t){this.currentRoute=t.to,this.breadcrumbs.add({type:"navigation",category:"navigation",message:`navigate ${t.to} (${t.type})`,timestamp:t.timestamp,level:"info",data:{from:t.from,to:t.to,type:t.type}}),this.sendEvent("navigation",t)}sendEvent(t,r,n){if(typeof window>"u")return;let o={type:"event",sessionId:this.transport.getSessionId()||"",eventType:t,payload:r,breadcrumbs:this.breadcrumbs.getRecent(),lastElement:this.lastElement,route:this.currentRoute,url:window.location.href,title:document.title,timestamp:Date.now(),screenshot:n};this.transport.send(o)}getBreadcrumbs(){return this.breadcrumbs.getRecent()}getLastElement(){return this.lastElement}destroy(){for(let t of this.cleanups)try{t()}catch{}this.cleanups=[],this.transport.destroy(),this.inspector&&this.inspector.destroy(),this.breadcrumbs.clear(),this.isInitialized=!1}};var Fe=null;function xr(e={}){return Fe||(Fe=new Xe(e),Fe.init(),Fe)}function fo(){return Fe}if(typeof window<"u"){window.__BROWSERTRACK__={init:xr,getClient:fo};try{let e=document.currentScript,t=e?.getAttribute("data-auto-init")!=="false",r=e?.getAttribute("data-daemon-url")||void 0,n=e?.getAttribute("data-project-id")||void 0,o=e?.getAttribute("data-hidden")==="true",i=e?.getAttribute("data-hide-query-param")||void 0;t&&xr({daemonUrl:r,projectId:n,hidden:o,hideQueryParam:i})}catch{}}return To(El);})();
|