8 lines
146 KiB
JavaScript
8 lines
146 KiB
JavaScript
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})};function r(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 i(e=`soft`){switch(e){case`auto`:o.session.styleMap=new Map,o.session.nodeMap=new Map;return;case`soft`:o.session.styleMap=new Map,o.session.nodeMap=new Map,o.session.styleCache=new WeakMap;return;case`full`:return;case`disabled`:o.session.styleMap=new Map,o.session.nodeMap=new Map,o.session.styleCache=new WeakMap,o.computedStyle=new WeakMap,o.measureHints=new WeakMap,o.baseStyle=new a(50),o.defaultStyle=new a(30),o.image=new a(100),o.background=new a(100),o.resource=new a(150),o.compress=new a(50),o.font=new Set;return;default:o.session.styleMap=new Map,o.session.nodeMap=new Map,o.session.styleCache=new WeakMap;return}}var a,o,s=t(()=>{a=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let e=this.keys().next().value;e!==void 0&&this.delete(e)}return super.set(e,t)}},o={image:new a(100),background:new a(100),resource:new a(150),defaultStyle:new a(30),baseStyle:new a(50),compress:new a(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 c(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith(`#`)?null:n}function l(e,t=1){let n=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let e of n[1].split(`,`)){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!p.test(n[1].trim()))continue;let i=e.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),a=1;if(i){let e=parseFloat(i[1]);a=/dpi/i.test(i[2])?e/96:e}r.push({url:t[2].trim(),dppx:a})}return r.length?(r.sort((e,t)=>e.dppx-t.dppx),(r.find(e=>e.dppx>=t)||r[r.length-1]).url):null}function u(e){if(!e||e===`none`)return``;let t=e.replace(/translate[XY]?\([^)]*\)/g,``);return t=t.replace(/matrix\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===6?(n[4]=`0`,n[5]=`0`,`matrix(${n.join(`, `)})`):`matrix(${t})`}),t=t.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===16?(n[12]=`0`,n[13]=`0`,`matrix3d(${n.join(`, `)})`):`matrix3d(${t})`}),t.trim().replace(/\s{2,}/g,` `)}function d(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function f(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<`u`&&(document.baseURI||document.location?.href)||`http://localhost/`;return new URL(e,n).href}catch{return e}}var p,m=t(()=>{p=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function h(e=`[snapDOM]`,{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function a(a,o,s){if(i>=n)return;let c=Date.now();(r.get(o)||0)>c||(r.set(o,c+t),i++,a===`warn`&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(e,t){a(`warn`,e,t)},errorOnce(e,t){a(`error`,e,t)},reset(){r.clear(),i=0}}}function g(e){return/^data:|^blob:|^about:blank$/i.test(e)}function _(e,t){try{let n=typeof location<`u`&&location.href?location.href:`http://localhost/`,r=t.includes(`{url}`)?t.split(`{url}`)[0]:t,i=new URL(r||`.`,n),a=new URL(e,n);if(a.origin===i.origin)return!0;let o=a.searchParams;if(o&&(o.has(`url`)||o.has(`target`)))return!0}catch{}return!1}function v(e,t){if(!t||g(e)||_(e,t))return!1;try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);return typeof location<`u`?n.origin!==location.origin:!0}catch{return!!t}}function y(e,t){return t?t.includes(`{url}`)?t.replace(`{urlRaw}`,d(e)).replace(`{url}`,encodeURIComponent(e)):/[?&]url=?$/.test(t)?`${t}${encodeURIComponent(e)}`:t.endsWith(`?`)?`${t}url=${encodeURIComponent(e)}`:t.endsWith(`/`)?`${t}${d(e)}`:`${t}${t.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`:e}function b(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(Error(`read_failed`)),r.readAsDataURL(e)})}function x(e,t){return[t.as||`blob`,t.timeout??3e3,t.useProxy||``,t.errorTTL??8e3,e].join(`|`)}async function S(e,t={}){let n=t.as??`blob`,r=t.timeout??3e3,i=t.useProxy||``,a=t.errorTTL??8e3,o=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(n===`text`)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n===`dataURL`)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(`;`)[0]||``};let[,t=``,r=``]=String(e).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(t)?atob(r):decodeURIComponent(r),a=new Uint8Array([...i].map(e=>e.charCodeAt(0))),o=new Blob([a],{type:(t||``).split(`;`)[0]||``});return{ok:!0,data:o,status:200,url:e,fromCache:!1,mime:o.type||``}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:`special_url_error`}}if(/^blob:/i.test(e))try{let t=await fetch(e);if(!t.ok)return{ok:!1,data:null,status:t.status,url:e,fromCache:!1,reason:`http_error`};let r=await t.blob(),i=r.type||t.headers.get(`content-type`)||``;return n===`dataURL`?{ok:!0,data:await b(r),status:t.status,url:e,fromCache:!1,mime:i}:n===`text`?{ok:!0,data:await r.text(),status:t.status,url:e,fromCache:!1,mime:i}:{ok:!0,data:r,status:t.status,url:e,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:`network`}}if(/^about:blank$/i.test(e))return n===`dataURL`?{ok:!0,data:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==`,status:200,url:e,fromCache:!1,mime:`image/png`}:{ok:!0,data:n===`text`?``:new Blob([]),status:200,url:e,fromCache:!1};let c=x(e,{as:n,timeout:r,useProxy:i,errorTTL:a}),l=T.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&T.delete(c);let u=w.get(c);if(u)return u;let d=v(e,i)?y(e,i):e,f=t.credentials;if(!f)try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);f=typeof location<`u`&&n.origin===location.origin?`include`:`omit`}catch{f=`omit`}let p=new AbortController,m=setTimeout(()=>p.abort(`timeout`),r),h=(async()=>{try{let r=await fetch(d,{signal:p.signal,credentials:f,headers:o});if(!r.ok){let i={ok:!1,data:null,status:r.status,url:d,fromCache:!1,reason:`http_error`};if(a>0&&T.set(c,{until:Date.now()+a,result:i}),!s){let t=`${r.status} ${r.statusText||``}`.trim();C.warnOnce(`http:${r.status}:${n}:${new URL(e,location?.href??`http://localhost/`).origin}`,`HTTP error ${t} while fetching ${n} ${e}`)}return t.onError&&t.onError(i),i}if(n===`text`)return{ok:!0,data:await r.text(),status:r.status,url:d,fromCache:!1};let i=await r.blob(),l=i.type||r.headers.get(`content-type`)||``;return n===`dataURL`?{ok:!0,data:await b(i),status:r.status,url:d,fromCache:!1,mime:l}:{ok:!0,data:i,status:r.status,url:d,fromCache:!1,mime:l}}catch(i){let o=i&&typeof i==`object`&&`name`in i&&i.name===`AbortError`?String(i.message||``).includes(`timeout`)?`timeout`:`abort`:`network`,l={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:o};if(!/^blob:/i.test(e)&&a>0&&T.set(c,{until:Date.now()+a,result:l}),!s){let t=`${o}:${n}:${new URL(e,location?.href??`http://localhost/`).origin}`,i=o===`timeout`?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:o===`abort`?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;C.errorOnce(t,i)}return t.onError&&t.onError(l),l}finally{clearTimeout(m),w.delete(c)}})();return w.set(c,h),h}var C,w,T,E=t(()=>{m(),C=h(`[snapDOM]`,{ttlMs:3*6e4,maxEntries:10}),w=new Map,T=new Map});async function D(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()===`none`)return e;let n=l(e,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??c(e);if(!n)return e;let r=d(f(n)),i=(t.useProxy||``)+`|`+r;if(o.background.has(i)){let e=o.background.get(i);return e?`url("${e}")`:`none`}try{let e=await S(r,{as:`dataURL`,useProxy:t.useProxy});return e.ok?(o.background.set(i,e.data),`url("${e.data}")`):(o.background.set(i,null),`none`)}catch{return o.background.set(i,null),`none`}}var O=t(()=>{s(),m(),E()});function k(e){if(e=String(e).toLowerCase(),ie.has(e)){let t={};return o.defaultStyle.set(e,t),t}if(o.defaultStyle.has(e))return o.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 n=document.createElement(e);n.style.all=`initial`,t.appendChild(n);let r=getComputedStyle(n),i={};for(let e of r)A(e)||(i[e]=r.getPropertyValue(e));return t.removeChild(n),o.defaultStyle.set(e,i),i}function A(e){let t=z.get(e);if(t===void 0){let n=String(e).toLowerCase();t=R.has(n)||L.test(n)||ae.test(n),z.set(e,t)}return t}function j(e,t){return!ce.has(e)&&(t===`inline`||oe.has(e)||se.has(e))}function M(e,t,n=!0,r=!1){if(t=String(t||``).toLowerCase(),ie.has(t))return``;let i=[],a=k(t),o=(e.display||``).toLowerCase(),s=o===`inline`,c=j(t,o),l=e[`text-wrap-mode`]||e[`white-space`]||``,u=c&&n&&!s&&(l===`nowrap`||l===`pre`),d=c&&n&&!u,f=!1;for(let t in e){if(A(t))continue;let n=e[t];if(d){if(le.has(t))continue;if(ue.has(t)){n&&n!==a[t]&&(i.push(`${t}:${n}`),n!==`auto`&&(f=!0));continue}}if(n&&n!==a[t]){if(!u&&(t===`width`||t===`inline-size`)&&n.endsWith(`px`)&&n.includes(`.`)){let e=parseFloat(n);if(Number.isFinite(e)){i.push(`${t}:${Math.ceil(e*16)/16}px`);continue}}i.push(`${t}:${n}`)}}if(d&&!s&&!r&&!f){let t=e.width;t&&t!==`auto`&&t!==a.width&&i.push(`min-width:${t}`)}return i.sort(),i.join(`;`)}function N(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(e=>t.add(e.tagName.toLowerCase())),Array.from(t))}function P(e){let t=new Map;for(let n of e){let e=k(n);if(!e)continue;let r=Object.entries(e).map(([e,t])=>`${e}:${t};`).sort().join(``);r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}let n=``;for(let[e,r]of t.entries())n+=`${r.join(`,`)} { ${e} }
|
||
`;return n}function ee(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let e of t)n.set(e,`c${r++}`);return n}function F(e){try{let t=e?.ownerDocument;if(!t)return typeof window<`u`?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle==`function`)return n;if(typeof window<`u`&&window.frames)for(let e=0;e<window.frames.length;e++)try{if(window.frames[e]?.document===t)return window.frames[e]}catch{}}catch{}return typeof window<`u`?window:null}function I(e,t=null){let n=()=>{let e={length:0,getPropertyValue:()=>``,item:()=>``};return e[Symbol.iterator]=function*(){},e};if(e?.nodeType!==1){let r=typeof window<`u`?window:null;if(r&&typeof r.getComputedStyle==`function`)try{return r.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=o.computedStyle.get(e);r||(r=new Map,o.computedStyle.set(e,r));let i=r.get(t);if(!i){let a=F(e),o=null;try{o=a&&typeof a.getComputedStyle==`function`?a.getComputedStyle(e,t):null}catch{}if(!o&&typeof window<`u`&&typeof window.getComputedStyle==`function`)try{e.ownerDocument===document&&(o=window.getComputedStyle(e,t))}catch{}i=o||n(),r.set(t,i)}return i}function te(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);for(let e of de){let n=t[`border-${e}-style`];(n===`none`||n===`hidden`||t[`border-${e}-width`]===`0px`)&&(delete t[`border-${e}-style`],delete t[`border-${e}-width`],delete t[`border-${e}-color`])}return t}function ne(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&n++,a===`)`&&n--,a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var re,ie,ae,L,R,z,oe,se,ce,le,ue,de,B=t(()=>{s(),re=new Set([`meta`,`script`,`noscript`,`title`,`link`,`template`]),ie=new Set([`meta`,`link`,`style`,`title`,`noscript`,`script`,`template`,`g`,`defs`,`use`,`marker`,`mask`,`clipPath`,`pattern`,`path`,`polygon`,`polyline`,`line`,`circle`,`ellipse`,`rect`,`filter`,`lineargradient`,`radialgradient`,`stop`]),ae=/(?:^|-)(animation|transition)(?:-|$)/i,L=/^(--.+|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,R=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`]),z=new Map,oe=new Set([`span`,`small`,`em`,`strong`,`b`,`i`,`u`,`s`,`code`,`cite`,`mark`,`sub`,`sup`]),se=new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`]),ce=new Set([`img`,`video`,`canvas`,`svg`,`iframe`,`embed`,`object`,`input`,`textarea`,`select`]),le=new Set([`width`,`max-width`,`inline-size`,`max-inline-size`]),ue=new Set([`min-width`,`min-inline-size`]),de=[`top`,`right`,`bottom`,`left`]});function fe(e,{fast:t=!1}={}){if(t)return e();`requestIdleCallback`in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function pe(){if(typeof navigator>`u`)return!1;if(navigator.userAgentData)return navigator.userAgentData.platform===`iOS`;let e=navigator.userAgent||``,t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function V(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent||``,t=e.toLowerCase(),n=t.includes(`safari`)&&!t.includes(`chrome`)&&!t.includes(`crios`)&&!t.includes(`fxios`)&&!t.includes(`android`),r=/applewebkit/i.test(e),i=/mobile/i.test(e),a=!/safari/i.test(e),o=r&&i&&a,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&r;return n||o||s||c||l}function me(){if(typeof navigator>`u`)return!1;let e=(navigator.userAgent||``).toLowerCase();return e.includes(`firefox`)||e.includes(`fxios`)}var H=t(()=>{});function U(e,t,n){let r=e&&typeof e==`object`&&(e.options||e);r&&r.debug&&(n===void 0?console.warn(`[snapdom]`,t):console.warn(`[snapdom]`,t,n))}var he=t(()=>{}),W=t(()=>{O(),B(),H(),m(),he()}),ge={};n(ge,{decodeSvgFromDataURL:()=>ye,encodeSvgToDataURL:()=>xe,fixSafariShadows:()=>Ae,toCanvas:()=>Me});function _e(e){try{let t=e.match(/<svg\b[^>]*>/i);if(!t)return e;let n=t[0],r=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)return e;let a=Math.min(1,G/r,G/i,Math.sqrt(Ne/(r*i)));if(a>=1)return e;let o=Math.max(1,Math.floor(r*a)),s=Math.max(1,Math.floor(i*a));return console.warn(`[snapDOM] Capture ${Math.round(r)}\xD7${Math.round(i)}px exceeds the browser image-decode limit (${G}px/side); downscaling to ${o}\xD7${s}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),e.replace(n,n.replace(/(\bwidth=")[\d.]+/i,`$1${o}`).replace(/(\bheight=")[\d.]+/i,`$1${s}`))}catch{return e}}function ve(e){return typeof e==`string`&&/^data:image\/svg\+xml/i.test(e)}function ye(e){let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``}function be(e){let t=e.indexOf(`,`);if(t<0)return``;let n=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,``);try{return decodeURIComponent(n)}catch{return``}}function xe(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Se(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`;`&&r===0?(t.push(n),n=``):n+=a}return n.trim()&&t.push(n),t.map(e=>e.trim()).filter(Boolean)}function Ce(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`,`&&r===0?(t.push(n.trim()),n=``):n+=a}n.trim()&&t.push(n.trim());let i=[];for(let e of t){if(/\binset\b/i.test(e))continue;let[t=`0px`,n=`0px`,r=`0px`]=e.match(/-?\d+(?:\.\d+)?px/gi)||[];r=`${parseFloat(r)/2}px`;let a=e.replace(/-?\d+(?:\.\d+)?px/gi,``).replace(/\binset\b/gi,``).trim().replace(/\s{2,}/g,` `),o=!!a&&a!==`,`;i.push(`drop-shadow(${t} ${n} ${r}${o?` ${a}`:``})`)}return i.join(` `)}function we(e){let t=Se(e),n=null,r=null,i=null,a=[];for(let e of t){let t=e.indexOf(`:`);if(t<0)continue;let o=e.slice(0,t).trim().toLowerCase(),s=e.slice(t+1).trim();o===`box-shadow`?i=s:o===`filter`?n=s:o===`-webkit-filter`?r=s:a.push([o,s])}if(i){let e=Ce(i);e&&(n=n?`${n} ${e}`:e,r=r?`${r} ${e}`:e)}let o=[...a];return n&&o.push([`filter`,n]),r&&o.push([`-webkit-filter`,r]),o.map(([e,t])=>`${e}:${t}`).join(`;`)}function Te(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${we(n)}}`)}function Ee(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,Te(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${we(n)}${t}`),e}function De(){return Pe||(Pe=(async()=>{try{let e=new Image;e.decoding=`sync`,e.src=`data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%2220%22%3E%3CforeignObject%20width%3D%228%22%20height%3D%2220%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22width%3A4px%3Bheight%3A4px%3Bmargin-top%3A8px%3Bbackground%3A%23000%3Bbox-shadow%3A0%208px%200%200%20%23000%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3C%2Fsvg%3E`,await e.decode();let t=document.createElement(`canvas`);t.width=8,t.height=20;let n=t.getContext(`2d`,{willReadFrequently:!0});n.drawImage(e,0,0);let r=n.getImageData(2,18,1,1).data[3]>128,i=n.getImageData(2,2,1,1).data[3]>128;return{native:r||i,flippedY:i&&!r}}catch{return{native:!1,flippedY:!1}}})(),Pe)}function Oe(e){let t=[],n=0,r=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(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t.map(e=>{let t=0,n=0,r=``,i=0;for(;i<e.length;){let a=e[i];if(a===`(`?t++:a===`)`&&(t=Math.max(0,t-1)),t===0&&(i===0||e[i-1]===` `)){let t=/^-?\d*\.?\d+px/.exec(e.slice(i));if(t){n++,r+=n===2?`${-parseFloat(t[0])}px`:t[0],i+=t[0].length;continue}}r+=a,i++}return r}).join(`,`)}function ke(e,t){let n=e=>Se(e).map(e=>{let n=e.indexOf(`:`);if(n<0)return e;let r=e.slice(0,n).trim().toLowerCase();return r===`text-shadow`||t&&r===`box-shadow`?`${r}:${Oe(e.slice(n+1))}`:e}).join(`;`);return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,t.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,r)=>`${t}{${n(r)}}`))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,r)=>`style=${t}${n(r)}${t}`),e}async function Ae(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:n}=await De();try{let r=e;return t||(r=Ee(r)),n&&(r=ke(r,t)),{svg:r,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}async function je(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 n=document.createElement(`canvas`);n.width=16,n.height=16;let r=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}),i=n.getContext(`2d`,{willReadFrequently:!0});if(!i){await r(),await r();return}let a=performance.now()+(t?600:150);for(;;){i.clearRect(0,0,16,16);try{i.drawImage(e,0,0,16,16)}catch{return}let t=i.getImageData(0,0,16,16).data,n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0){n=!0;break}if(n||performance.now()>a)return;await r()}}finally{try{e.remove()}catch{}}}async function Me(e,t){let{width:n,height:r,scale:i=1,dpr:a=1,meta:o={},backgroundColor:s}=t,c=e,l=!1,u=!1;if(ve(e)){let t=(be(e).match(/<svg\b[^>]*>/i)||[])[0]||``,n=parseFloat((t.match(/\bwidth="([\d.]+)/i)||[])[1]),r=parseFloat((t.match(/\bheight="([\d.]+)/i)||[])[1]),i=Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0&&Math.min(1,G/n,G/r,Math.sqrt(Ne/(n*r)))<1;if(i||V())try{let t=ye(e);if(V()){let e=await Ae(t);t=e.svg,l=e.naturalOnly,u=/@font-face|data:image\//i.test(t)}i&&(t=_e(t)),c=xe(t)}catch{c=e}}let d=new Image;d.loading=`eager`,d.decoding=`sync`,d.crossOrigin=`anonymous`,d.src=c,await d.decode(),V()&&await je(d,u);let f=d.naturalWidth,p=d.naturalHeight,m=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:p,g,_,v=Number.isFinite(n),y=Number.isFinite(r);if(v&&y)g=Math.max(1,n),_=Math.max(1,r);else if(v){let e=n/Math.max(1,m);g=n,_=h*e}else if(y){let e=r/Math.max(1,h);_=r,g=m*e}else g=f,_=p;g*=i,_*=i;let b=g*a,x=_*a,S=Math.max(b/G,x/G,Math.sqrt(b*x/Ne));S>1&&(console.warn(`[snapDOM] Output ${Math.round(b)}\xD7${Math.round(x)}px exceeds the browser canvas limit (${G}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),g/=S,_/=S);let C=document.createElement(`canvas`);C.width=g*a,C.height=_*a,C.style.width=`${g}px`,C.style.height=`${_}px`;let w=C.getContext(`2d`);if(a!==1&&w.scale(a,a),s&&(w.save(),w.fillStyle=s,w.fillRect(0,0,g,_),w.restore()),l&&(Math.round(g*a)!==f||Math.round(_*a)!==p)){let e=document.createElement(`canvas`);e.width=f,e.height=p,e.getContext(`2d`).drawImage(d,0,0),w.drawImage(e,0,0,g,_)}else w.drawImage(d,0,0,g,_);return C}var G,Ne,Pe,Fe=t(()=>{H(),G=16384,Ne=16384*16384,Pe=null}),Ie={};n(Ie,{rasterize:()=>Le});async function Le(e,t){let n=await Me(e,t),r=await new Promise(e=>{let r=()=>e(n.toDataURL(`image/${t.format}`,t.quality));try{n.toBlob(t=>{if(!t)return r();let n=new FileReader;n.onload=()=>e(String(n.result||``)),n.onerror=r,n.readAsDataURL(t)},`image/${t.format}`,t.quality)}catch{r()}}),i=new Image;return i.src=r,await i.decode(),i.style.width=`${n.width/t.dpr}px`,i.style.height=`${n.height/t.dpr}px`,i}var Re=t(()=>{Fe()}),ze={};n(ze,{toImg:()=>Be,toSvg:()=>Be});async function Be(e,t){let{scale:n=1,width:r,height:i,meta:a={}}=t,o=Number.isFinite(r),s=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||o||s;if(V()&&c)try{let{svg:t}=await Ae(ye(e)),c=(t.match(/<svg\b[^>]*>/i)||[])[0]||``,l=parseFloat((c.match(/\bwidth="([\d.]+)/i)||[])[1]),u=parseFloat((c.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(l)||!Number.isFinite(u))throw Error(`svg without dimensions`);let d=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:u,p,m;o&&s?(p=r,m=i):o?(p=r,m=Math.round(r/Math.max(1,d)*f)):s?(m=i,p=Math.round(i/Math.max(1,f)*d)):(p=Math.round(l*n),m=Math.round(u*n));let h=t.replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${m}"`),g=new Image;return g.decoding=`sync`,g.loading=`eager`,g.src=xe(h),await g.decode(),g.style.width=`${p}px`,g.style.height=`${m}px`,g}catch(n){return U(t,`safari vector toImg failed, falling back to PNG`,n),Le(e,{...t,format:`png`,quality:1,meta:a})}let l=new Image;if(l.decoding=`sync`,l.loading=`eager`,l.src=e,await l.decode(),o&&s)l.style.width=`${r}px`,l.style.height=`${i}px`;else if(o){let e=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:l.naturalWidth,t=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:l.naturalHeight,n=r/Math.max(1,e);l.style.width=`${r}px`,l.style.height=`${Math.round(t*n)}px`}else if(s){let e=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:l.naturalWidth,t=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:l.naturalHeight,n=i/Math.max(1,t);l.style.height=`${i}px`,l.style.width=`${Math.round(e*n)}px`}else{let r=Math.round(l.naturalWidth*n),i=Math.round(l.naturalHeight*n);if(l.style.width=`${r}px`,l.style.height=`${i}px`,typeof e==`string`&&e.startsWith(`data:image/svg+xml`))try{let t=decodeURIComponent(e.split(`,`)[1]).replace(/width="[^"]*"/,`width="${r}"`).replace(/height="[^"]*"/,`height="${i}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,l.src=e}catch(e){U(t,`SVG width/height patch in toImg failed`,e)}}return l}var Ve=t(()=>{W(),Re(),Fe()}),He={};n(He,{toBlob:()=>Ue});async function Ue(e,t){let n=t.type;if(n===`svg`){let t=decodeURIComponent(e.split(`,`)[1]);return new Blob([t],{type:`image/svg+xml`})}let r=await Me(e,t);return new Promise(e=>r.toBlob(t=>e(t),`image/${n}`,t.quality))}var We=t(()=>{Fe()}),Ge={};n(Ge,{download:()=>qe});async function Ke(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(e){if(e.name!==`AbortError`)return!1}return!0}async function qe(e,t){let n=new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]),r=(t?.type||``).toLowerCase(),i=n.has(r)?r:``,a=(t?.format||i||``).toLowerCase(),o=a===`jpg`?`jpeg`:a||`png`,s=t?.filename||`snapdom.${o}`,c={...t||{},format:o,type:o};c.dpr=1;let l=pe();if(o===`svg`){let t=await Ue(e,{...c,type:`svg`});if(l&&await Ke(t,s))return;let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=s,document.body.appendChild(r),r.click(),URL.revokeObjectURL(n),r.remove();return}let u=await Me(e,c);if(l){let e=`image/${o}`,n=await new Promise(n=>u.toBlob(n,e,t?.quality));if(n&&await Ke(n,s))return}let d=document.createElement(`a`);d.href=u.toDataURL(`image/${o}`,t?.quality),d.download=s,document.body.appendChild(d),d.click(),d.remove()}var Je=t(()=>{We(),Fe(),H()});W(),W(),s();var Ye=new WeakMap,Xe=new Map,Ze=2e3,Qe=0;function $e(){Qe++,Xe.size>Ze&&Xe.clear()}var et=`[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]`;function tt(e){let t=e&&(e.nodeType===1?e:e.parentElement);return!!(t&&t.closest&&t.closest(et))}function nt(e){for(let t of e)if(!tt(t.target)){if(t.type===`childList`){let e=!0;for(let n of t.addedNodes)if(!tt(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!tt(n)){e=!1;break}}if(e)continue}return!0}return!1}var rt=!1;function it(e=document.documentElement){if(rt)return;rt=!0;let t=e=>{nt(e)&&$e()};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 e=document.fonts;e&&(e.addEventListener?.(`loadingdone`,$e),e.ready?.then(()=>$e()).catch(()=>{}))}catch{}}var at=[`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 ot(e){let t=Ye.get(e);if(t&&t.epoch===Qe){let e=t.snapshot&&t.snapshot.__needsBgInline;if(e!==void 0)return e}return!0}function st(e,t={}){let n={},r=e.getPropertyValue(`visibility`),i=t.excludeStyleProps;for(let t=0;t<e.length;t++){let r=e[t];if(A(r)||i&&(i instanceof RegExp&&i.test(r)||typeof i==`function`&&i(r)))continue;let a=e.getPropertyValue(r);(r===`background-image`||r===`content`)&&a.includes(`url(`)&&!a.includes(`data:`)&&(a=`none`),n[r]=a}for(let t of[`text-decoration-line`,`text-decoration-color`,`text-decoration-style`,`text-decoration-thickness`,`text-underline-offset`,`text-decoration-skip-ink`])if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}for(let t of[`-webkit-text-stroke`,`-webkit-text-stroke-width`,`-webkit-text-stroke-color`,`paint-order`])if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}if(t.embedFonts){for(let t of[`font-feature-settings`,`font-variation-settings`,`font-kerning`,`font-variant`,`font-variant-ligatures`,`font-optical-sizing`])if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}}r===`hidden`&&(n.opacity=`0`);try{(n[`content-visibility`]||e.getPropertyValue(`content-visibility`))===`hidden`&&(n.visibility=`hidden`)}catch{}let a=!1;{let t=e.getPropertyValue(`background-image`);if(t&&t!==`none`&&(a=!0),!a){let t=e.getPropertyValue(`background-color`);t&&t!==`rgba(0, 0, 0, 0)`&&t!==`transparent`&&(a=!0)}if(!a)for(let t of at){let n=e.getPropertyValue(t);if(n&&n!==`none`){a=!0;break}}if(!a){let t=e.getPropertyValue(`background`);t&&/url\s*\(/i.test(t)&&(a=!0)}}Object.defineProperty(n,`__needsBgInline`,{value:a,enumerable:!1});let o=parseFloat(e.getPropertyValue(`border-top-width`)||0)||0,s=parseFloat(e.getPropertyValue(`border-right-width`)||0)||0,c=parseFloat(e.getPropertyValue(`border-bottom-width`)||0)||0,l=parseFloat(e.getPropertyValue(`border-left-width`)||0)||0;if(o===0&&s===0&&c===0&&l===0){let t=(e.getPropertyValue(`border-image-source`)||``).trim(),r=t&&t!==`none`;for(let e of`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`.split(`.`))delete n[e];r||(n.border=`none`)}return n}function ct(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 e=I(t).position;if(e!==`absolute`&&e!==`fixed`)return!0}}return!1}var lt=new WeakMap;function ut(e){let t=lt.get(e);return t||(t=Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])).map(([e,t])=>`${e}:${t}`).join(`;`),lt.set(e,t),t)}function dt(e,t=null,n={}){let r=Ye.get(e),i=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(r&&r.epoch===Qe&&r.embedFonts===i&&r.excludeStyleProps===a)return r.snapshot;let o=t||getComputedStyle(e),s=st(o,n);return vt(e,o,s),Ye.set(e,{epoch:Qe,snapshot:s,embedFonts:i,excludeStyleProps:a}),s}function ft(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Xe,defaultStyle:o.defaultStyle,baseStyle:o.baseStyle,image:o.image,resource:o.resource,background:o.background,font:o.font},options:t||{}}:{session:o.session,persist:{snapshotKeyCache:Xe,defaultStyle:o.defaultStyle,baseStyle:o.baseStyle,image:o.image,resource:o.resource,background:o.background,font:o.font},options:e||t||{}}}function pt(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let i=e.style[r],a=n.getPropertyValue(i);a&&t.style.setProperty(i,a)}}async function K(e,t,n,r){if(e.tagName===`STYLE`)return;let i=ft(n,r),a=i.options&&i.options.cache||`auto`;a!==`disabled`&&it(document.documentElement),a===`disabled`&&!i.session.__bumpedForDisabled&&($e(),Xe.clear(),i.session.__bumpedForDisabled=!0);let{session:o,persist:s}=i;if(!o.styleCache.has(e)){let t=null;try{t=getComputedStyle(e)}catch{}o.styleCache.set(e,t||getComputedStyle(document.documentElement))}let c=o.styleCache.get(e);e.getAttribute?.(`style`)&&pt(e,t,c);let l=c.getPropertyValue(`animation-name`);t&&t.style&&l&&l!==`none`&&t.style.setProperty(`animation`,`none`,`important`);let u=dt(e,c,i.options),d=gt(e);if(d){let e=c.getPropertyValue(`min-width`);(!e||e===`auto`||e===`0px`)&&(u[`min-width`]=`0px`)}let f=e.tagName?.toLowerCase()||`div`,p=ut(u),m=!0;if(j(f,(u.display||``).toLowerCase())){m=ct(e),p=`${p}|${f}${m?`|c`:``}${d?`|f`:``}`;let t=u[`text-wrap-mode`]||u[`white-space`]||``;m&&t!==`nowrap`&&t!==`pre`&&(o.reconcileRisk=(o.reconcileRisk||0)+1)}let h=s.snapshotKeyCache.get(p);h===void 0&&(h=M(u,f,m,d),s.snapshotKeyCache.set(p,h)),o.styleMap.set(t,h)}function mt(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function ht(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 gt(e){let t=e.parentElement;if(!t)return!1;let n=I(t).display||``;return n.includes(`flex`)||n.includes(`grid`)}function _t(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===3&&/\S/.test(t.nodeValue))return!0;let t=e.firstElementChild,n=e.lastElementChild;if(t&&t.tagName===`BR`||n&&n.tagName===`BR`)return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let e=I(t);if(e.display===`none`)continue;let n=e.position;if(n!==`absolute`&&n!==`fixed`)return!0}return!1}function vt(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||![`div`,`section`,`article`,`main`,`aside`,`header`,`footer`,`nav`].includes(r))return;let i=parseFloat(t.height);if(Number.isFinite(i)&&e.scrollHeight>0&&Math.abs(i-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!==`none`&&t.aspectRatio!==`auto`)return;let a=t.display||``;if(a.includes(`flex`)||a.includes(`grid`)||mt(e))return;let o=t.position;if(o===`absolute`||o===`fixed`||o===`sticky`||t.transform!==`none`||ht(t)||gt(e))return;let s=t.overflowX||t.overflow||`visible`,c=t.overflowY||t.overflow||`visible`;if(s!==`visible`||c!==`visible`)return;let l=t.clip;l&&l!==`auto`&&l!==`rect(auto, auto, auto, auto)`||t.visibility===`hidden`||t.opacity===`0`||_t(e)&&(delete n.height,delete n[`block-size`])}B();var yt=[`fill`,`stroke`,`color`,`background-color`,`stop-color`],bt=new Set([`symbol`,`defs`,`pattern`,`marker`,`linearGradient`,`radialGradient`,`filter`]);function xt(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(bt.has(t.localName))return!0}t=t.parentNode}return!1}var St=new Map;function Ct(e,t){let n=t+`::`+e.toLowerCase(),r=St.get(n);if(r)return r;let i=document,a=t===`http://www.w3.org/2000/svg`?i.createElementNS(t,e):i.createElement(e),o=i.createElement(`div`);o.setAttribute(`data-snapdom-internal`,``),o.style.cssText=`position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;`,o.appendChild(a),i.documentElement.appendChild(o);let s=getComputedStyle(a),c={};for(let e of yt)c[e]=s.getPropertyValue(e)||``;return o.remove(),St.set(n,c),c}function wt(e,t){if(e?.nodeType!==1||t?.nodeType!==1||xt(e))return;let n=e.getAttribute?.(`style`),r=!!(n&&n.includes(`var(`));if(!r&&e.attributes?.length){let t=e.attributes;for(let e=0;e<t.length;e++){let n=t[e];if(n&&typeof n.value==`string`&&n.value.includes(`var(`)){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let n=e.style;if(n&&n.length){let e=new Set;for(let r=0;r<n.length;r++){let a=n[r];if(e.has(a))continue;e.add(a);let o=n.getPropertyValue(a);if(!o||!o.includes(`var(`))continue;let s=i&&i.getPropertyValue(a);if(s)try{t.style.setProperty(a,s.trim(),n.getPropertyPriority(a))}catch{}}}}if(r&&e.attributes?.length){let n=e.attributes;for(let e=0;e<n.length;e++){let r=n[e];if(!r||typeof r.value!=`string`||!r.value.includes(`var(`))continue;let a=r.name,o=i&&i.getPropertyValue(a);if(o)try{t.style.setProperty(a,o.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let n=e.namespaceURI||`html`,r=Ct(e.tagName,n);for(let e of yt){let n=i.getPropertyValue(e)||``,a=r[e]||``;if(n&&n!==a)try{t.style.setProperty(e,n.trim())}catch{}}}}W(),W(),s(),E(),E();function q(e){return!!(!e||e.startsWith(`data:`)||e.startsWith(`blob:`)||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}var Tt=`img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]`;function Et(e,t){return!e||e?.nodeType!==1?!1:e.matches?.(`picture`)||e.querySelector(`picture`)?!0:t?!!(e.matches?.(Tt)||e.querySelector(Tt)):!1}var Dt=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Ot(e,t){if(!e)return null;let n=0;try{n=t?t.getBoundingClientRect().width||t.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let t of e.split(`,`)){let e=t.trim().split(/\s+/);if(!e[0])continue;let i=e[1]||``,a=1;/^\d*\.?\d+x$/i.test(i)?a=parseFloat(i):/^\d+w$/i.test(i)&&(a=parseInt(i,10)/n),r.push({url:e[0],d:a})}if(!r.length)return null;r.sort((e,t)=>e.d-t.d);let i=window.devicePixelRatio||1;return(r.find(e=>e.d>=i)||r[r.length-1]).url}function kt(e,t){let n=e.currentSrc||``;if(n&&!q(n))return n;let r=t.querySelectorAll(`source[srcset]`),i=null;for(let t of r){let n=t.getAttribute(`srcset`);if(!n||q(n))continue;let r=t.getAttribute(`type`);if(r&&!Dt.test(r.trim()))continue;let a=t.getAttribute(`media`);if(a)try{if(window.matchMedia(a).matches)return Ot(n,e)}catch{}i||(i=Ot(n,e))}return i}function At(e){let t=[e.getAttribute(`data-src`),e.getAttribute(`data-lazy-src`),e.getAttribute(`data-original`),e.getAttribute(`data-hi-res-src`)];for(let e of t)if(e&&!q(e))return e;let n=e.getAttribute(`data-srcset`)||e.getAttribute(`data-lazy-srcset`);if(n){let e=n.split(`,`)[0].trim().split(/\s+/)[0];if(e&&!q(e))return e}return null}function jt(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 Mt(e,t={}){if(!e||e?.nodeType!==1||t.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:r,resolveLazySrc:i,silent:a,useProxy:o}=jt(t);if(!Et(e,i))return null;let s=[],c=[];async function l(e){let t=await S(e,{as:`dataURL`,timeout:n,useProxy:o,silent:!0});return t.ok?t.data:null}async function u(e){for(let t=0;t<e.length;t+=r){let n=e.slice(t,t+r);await Promise.allSettled(n.map(e=>e()))}}let d=Array.from(e.querySelectorAll(`picture`));e.matches?.(`picture`)&&d.unshift(e);for(let e of d){let t=e.querySelector(`img`);if(!t||!q(t.getAttribute(`src`)||``))continue;let n=kt(t,e);n&&c.push(async()=>{let r=await l(n);if(!r){a||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${n.slice(0,60)}`);return}let i=t.getAttribute(`src`),o=t.getAttribute(`srcset`),c=t.getAttribute(`sizes`),u=[];t.src=r,t.setAttribute(`src`,r),t.removeAttribute(`srcset`),t.removeAttribute(`sizes`);let d=e.querySelectorAll(`source`);for(let e of d)u.push({el:e,parent:e.parentElement,next:e.nextSibling}),e.remove();s.push(()=>{i===null?t.removeAttribute(`src`):t.setAttribute(`src`,i),o!==null&&t.setAttribute(`srcset`,o),c!==null&&t.setAttribute(`sizes`,c);for(let{el:e,parent:t,next:n}of u)t&&t.insertBefore(e,n)})})}if(i){let t=Array.from(e.querySelectorAll(`img`));e.localName===`img`&&t.unshift(e);for(let e of t){if(e.closest(`picture`)&&q(e.getAttribute(`src`)||``))continue;let t=e.getAttribute(`src`)||``,n=At(e);n&&q(t)&&c.push(async()=>{let t=await l(n);if(!t)return;let r=e.getAttribute(`src`);e.src=t,e.setAttribute(`src`,t),e.removeAttribute(`srcset`),e.removeAttribute(`sizes`),s.push(()=>{r===null?e.removeAttribute(`src`):e.setAttribute(`src`,r)})})}}return c.length===0?null:(await u(c),async function(){for(let e of s)try{e()}catch{}})}function Nt(e,t,n){return n?Promise.all(e.map(e=>new Promise(n=>t(e,n)))):Promise.all(e.map(e=>new Promise(r=>{function i(){fe(n=>{!(n&&typeof n.timeRemaining==`function`)||n.timeRemaining()>0?t(e,r):i()},{fast:n})}i()})))}function Pt(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function Ft(e,t,n=!0){return e.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>e.startsWith(`:where(`)||e.startsWith(`@`)?e:`:where(${t} ${n?Pt(e):e})`).join(`, `)}function It(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(e,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(e,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(e,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(e,n,r,i)=>`${n}${r}${Ft(i,t,!0)}{`),e):``}function Lt(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Rt(e){let t=``;try{e.querySelectorAll(`style`).forEach(e=>{t+=(e.textContent||``)+`
|
||
`});let n=e.adoptedStyleSheets||[];for(let e of n)try{if(e&&e.cssRules)for(let n of e.cssRules)t+=n.cssText+`
|
||
`}catch{}}catch{}return t}function zt(e,t,n){if(!t)return;let r=document.createElement(`style`);r.setAttribute(`data-sd`,n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function Bt(e,t){try{let n=null,r=I(e).content;if(r&&r.includes(`url(`)){let e=r.match(/url\(["']?([^"')]+)["']?\)/);e&&(n=e[1])}let i=e.closest?.(`picture`),a=n||(i?kt(e,i):e.currentSrc)||e.src||Ot(e.getAttribute(`srcset`),e)||``;if(!a)return;t.setAttribute(`src`,a),t.removeAttribute(`srcset`),t.removeAttribute(`sizes`),t.loading=`eager`,t.decoding=`sync`}catch{}}function Vt(e){let t=new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function Ht(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let e=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(e)return e}catch{}return``}function Ut(e,t,n){let r=[];for(let n of t){let t=Ht(e,n);t&&r.push(`${n}: ${t};`)}return r.length?`${n}{${r.join(``)}}
|
||
`:``}function Wt(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute(`data-sd-slotted`,``),e.querySelectorAll&&e.querySelectorAll(`*`).forEach(e=>e.setAttribute(`data-sd-slotted`,``)))}async function Gt(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(e=>setTimeout(e,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Kt(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,a=0;try{let t=getComputedStyle(e);n=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,a=parseFloat(t.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(t.width-(n+r))),contentHeight:Math.max(0,Math.round(t.height-(i+a))),rect:t}}function J(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let e=parseFloat(r.width);!isNaN(e)&&e>0&&(t=e)}if(n===0){let e=parseFloat(r.height);!isNaN(e)&&e>0&&(n=e)}}catch{}if(t===0||n===0)try{if(t===0){let n=parseFloat(e.getAttribute(`width`));!isNaN(n)&&n>0&&(t=n)}if(n===0){let t=parseFloat(e.getAttribute(`height`));!isNaN(t)&&t>0&&(n=t)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}function qt(e,t,n){let r=e.defaultView,i=r?r.scrollX:0,a=r?r.scrollY:0,o=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,c=e.documentElement?e.documentElement.scrollLeft:0,l=e.documentElement?e.documentElement.scrollTop:0,u=0,d=0,f=0,p=0;try{let t=r&&e.body?r.getComputedStyle(e.body):null;t&&(u=(parseFloat(t.marginTop)||0)+(parseFloat(t.paddingTop)||0),d=(parseFloat(t.marginRight)||0)+(parseFloat(t.paddingRight)||0),f=(parseFloat(t.marginBottom)||0)+(parseFloat(t.paddingBottom)||0),p=(parseFloat(t.marginLeft)||0)+(parseFloat(t.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute(`data-sd-pinned`,``)}catch{}let m=e.createElement(`style`);return m.setAttribute(`data-sd-iframe-pin`,``),m.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${u}px ${d}px ${f}px ${p}px !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(m),()=>{try{m.remove()}catch{}try{e.documentElement.removeAttribute(`data-sd-pinned`)}catch{}try{r&&typeof r.scrollTo==`function`&&r.scrollTo(i,a),e.body&&(e.body.scrollLeft=o,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=c,e.documentElement.scrollTop=l)}catch{}}}async function Jt(e,t,n){let r=await Gt(e,3);if(!r)throw Error(`iframe document not accessible/ready`);let{contentWidth:i,contentHeight:a,rect:s}=Kt(e),c=n?.snap;if(!c&&typeof window<`u`&&window.snapdom&&(c=window.snapdom),!c||typeof c.toPng!=`function`)throw 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={...n,scale:1,clip:null},u=qt(r,i,a),d=o.session.nodeMap,f=o.session.styleMap,p=o.session.styleCache,m;try{m=await c.toPng(r.documentElement,l)}finally{u(),o.session.nodeMap=d,o.session.styleMap=f,o.session.styleCache=p}m.style.display=`block`,m.style.width=`${i}px`,m.style.height=`${a}px`;let h=document.createElement(`div`);return t.nodeMap.set(h,e),K(e,h,t,n),h.style.overflow=`hidden`,h.style.display=`block`,h.style.width||(h.style.width=`${Math.round(s.width)}px`),h.style.height||(h.style.height=`${Math.round(s.height)}px`),h.appendChild(m),h}function Yt(e){let{width:t,height:n}=J(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,s||16),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,c||16),d=(e.type||`text`).toLowerCase()===`checkbox`,f=!!e.checked,p=!!e.indeterminate,m=Math.max(Math.min(l,u),12),h=`middle`;try{i&&i.verticalAlign&&(h=i.verticalAlign)}catch{}let g=document.createElement(`div`);g.setAttribute(`data-snapdom-input-replacement`,e.type||`checkbox`),g.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${h};flex-shrink:0;line-height:0;`;let _=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);_.setAttribute(`width`,String(m)),_.setAttribute(`height`,String(m)),_.setAttribute(`viewBox`,`0 0 ${m} ${m}`),g.appendChild(_);function v(){let e=`#0a6ed1`;try{i&&(e=i.accentColor||i.color||e)}catch{}let t=m-2;if(_.innerHTML=``,d){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);if(n.setAttribute(`x`,`1`),n.setAttribute(`y`,`1`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`rx`,`2`),n.setAttribute(`ry`,`2`),n.setAttribute(`fill`,f?e:`none`),n.setAttribute(`stroke`,e),n.setAttribute(`stroke-width`,`2`),_.appendChild(n),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);e.setAttribute(`d`,`M 3 ${m/2} L ${m/2-1} ${m-1-2} L ${m-1-2} 3`),e.setAttribute(`stroke`,`white`),e.setAttribute(`stroke-width`,`2`),e.setAttribute(`fill`,`none`),e.setAttribute(`stroke-linecap`,`round`),e.setAttribute(`stroke-linejoin`,`round`),_.appendChild(e)}else if(p){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),r=Math.max(6,t-4);n.setAttribute(`x`,String((m-r)/2)),n.setAttribute(`y`,String((m-2)/2)),n.setAttribute(`width`,String(r)),n.setAttribute(`height`,`2`),n.setAttribute(`fill`,e),n.setAttribute(`rx`,`1`),_.appendChild(n)}}else{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);if(t.setAttribute(`cx`,String(m/2)),t.setAttribute(`cy`,String(m/2)),t.setAttribute(`r`,String((m-2)/2)),t.setAttribute(`fill`,f?e:`none`),t.setAttribute(`stroke`,e),t.setAttribute(`stroke-width`,`2`),_.appendChild(t),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),t=Math.max(2,(m-4)*.35);e.setAttribute(`cx`,String(m/2)),e.setAttribute(`cy`,String(m/2)),e.setAttribute(`r`,String(t)),e.setAttribute(`fill`,`white`),_.appendChild(e)}}g.style.setProperty(`width`,`${m}px`,`important`),g.style.setProperty(`height`,`${m}px`,`important`),g.style.setProperty(`min-width`,`${m}px`,`important`),g.style.setProperty(`min-height`,`${m}px`,`important`)}return v(),{el:g,applyVisual:v}}var Xt=new a(80);async function Zt(e){if(o.resource?.has(e))return o.resource.get(e);if(Xt.has(e))return Xt.get(e);let t=(async()=>{let t=await S(e,{as:`dataURL`,silent:!0});if(!t.ok||typeof t.data!=`string`)throw Error(`[snapDOM] Failed to read blob URL: ${e}`);return o.resource?.set(e,t.data),t.data})();Xt.set(e,t);try{let n=await t;return Xt.set(e,n),n}catch(t){throw Xt.delete(e),t}}var Qt=/\bblob:[^)"'\s]+/g;async function $t(e){if(!e||e.indexOf(`blob:`)===-1)return e;let t=Array.from(new Set(e.match(Qt)||[]));if(t.length===0)return e;let n=e;for(let e of t)try{let t=await Zt(e);n=n.split(e).join(t)}catch{}return n}function en(e){return typeof e==`string`&&e.startsWith(`blob:`)}function tn(e){return(e||``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.match(/^(\S+)(\s+.+)?$/);return t?{url:t[1],desc:t[2]||``}:null}).filter(Boolean)}function nn(e){return e.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(`, `)}function rn(e,t){let n=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&n.unshift(e),n}async function an(e,t=null){if(!e)return;let n=t,r=rn(e,`img`);for(let e of r)try{let t=e.getAttribute(`src`)||e.currentSrc||``;if(en(t)){let n=await Zt(t);e.setAttribute(`src`,n)}let r=e.getAttribute(`srcset`);if(r&&r.includes(`blob:`)){let t=tn(r),i=!1;for(let e of t)if(en(e.url))try{e.url=await Zt(e.url),i=!0}catch(e){U(n,`blobUrlToDataUrl for srcset item failed`,e)}i&&e.setAttribute(`srcset`,nn(t))}}catch(e){U(n,`resolveBlobUrls for img failed`,e)}let i=rn(e,`image`);for(let e of i)try{let t=`http://www.w3.org/1999/xlink`,n=e.getAttribute(`href`)||e.getAttributeNS?.(t,`href`);if(en(n)){let r=await Zt(n);e.setAttribute(`href`,r),e.removeAttributeNS?.(t,`href`)}}catch(e){U(n,`resolveBlobUrls for SVG image href failed`,e)}let a=rn(e,`[style*='blob:']`);for(let e of a)try{let t=e.getAttribute(`style`);if(t&&t.includes(`blob:`)){let n=await $t(t);e.setAttribute(`style`,n)}}catch(e){U(n,`replaceBlobUrls in inline style failed`,e)}let o=e.querySelectorAll?e.querySelectorAll(`style`):[];for(let e of o)try{let t=e.textContent||``;t.includes(`blob:`)&&(e.textContent=await $t(t))}catch(e){U(n,`replaceBlobUrls in style tag failed`,e)}for(let t of[`poster`]){let r=rn(e,`[${t}^='blob:']`);for(let e of r)try{let n=e.getAttribute(t);en(n)&&e.setAttribute(t,await Zt(n))}catch(e){U(n,`resolveBlobUrls for ${t} failed`,e)}}}H();var on=new Map,sn=new Set([`IFRAME`]);function cn(e,t){on.set(String(e).toUpperCase(),t)}function ln(e){let{width:t,height:n}=J(e),r=t,i=n;if(!r||!i){let t=e.getBoundingClientRect();r=r||t.width||0,i=i||t.height||0}let a=document.createElement(`div`);return a.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,a}var un=200,dn=new Set([`img`,`canvas`,`video`,`iframe`,`object`,`embed`]);function fn(e,t){return e.right>=t.left-un&&e.left<=t.right+un&&e.bottom>=t.top-un&&e.top<=t.bottom+un}function pn(e,t){if(e===t.root)return!1;let n;try{n=e.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=I(e);if(r.display===`inline`&&!dn.has((e.localName||``).toLowerCase()))return!1;let i=t.rect,a=e.scrollWidth||0,o=e.scrollHeight||0,s={left:r.direction===`rtl`?Math.min(n.left,n.right-a):n.left,top:n.top,right:Math.max(n.right,n.left+a),bottom:Math.max(n.bottom,n.top+o)},c=r.writingMode||``;if((c.startsWith(`vertical`)||c.startsWith(`sideways`))&&(s.top=Math.min(n.top,n.bottom-o),s.left=Math.min(s.left,n.right-a)),fn(s,i))return!1;let l=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;l.nextNode();){let e=l.currentNode.getBoundingClientRect();if((e.width>0||e.height>0)&&fn(e,i))return!1}return!0}function mn(e,t,n){let r=e.cloneNode(!1);e.tagName===`IMG`&&(r.removeAttribute(`src`),r.removeAttribute(`srcset`),r.removeAttribute(`sizes`)),K(e,r,t,n);let{width:i,height:a}=J(e);return i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),a>0&&(r.style.height=`${a}px`,r.style.minHeight=`${a}px`,r.style.maxHeight=`${a}px`),r.style.visibility=`hidden`,r.style.overflow=`hidden`,r.style.boxSizing=`border-box`,r}async function hn(e,t,n){if(!e)throw Error(`Invalid node`);let r=new Set,i=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let n=(e.localName||e.tagName||``).toLowerCase();if(e.id===`snapdom-sandbox`||e.hasAttribute(`data-snapdom-sandbox`)||re.has(n))return null;if(n===`foreignobject`&&e.parentElement?.closest?.(`foreignObject`))return U(t,`Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)`),null;if(n===`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(n.excludeMode===`hide`)return ln(e);if(n.excludeMode===`remove`)return null}if(n.exclude&&Array.isArray(n.exclude))for(let t of n.exclude)try{if(e.matches?.(t)){if(n.excludeMode===`hide`)return ln(e);if(n.excludeMode===`remove`)return null}}catch(e){console.warn(`Invalid selector in exclude option: ${t}`,e)}if(typeof n.filter==`function`)try{if(!n.filter(e)){if(n.filterMode===`hide`)return ln(e);if(n.filterMode===`remove`)return null}}catch(e){console.warn(`Error in filter function:`,e)}if(t.clip&&pn(e,t.clip))return mn(e,t,n);if(n.__resolveNodeHooks)for(let r of n.__resolveNodeHooks){let i;try{i=await r(e,n)}catch(e){U(t,`resolveNode plugin hook failed`,e)}if(i===null)return null;if(i instanceof Node)return i.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(i,e),K(e,i,t,n)),i}{let r=sn.has(e.tagName)&&on.get(e.tagName);if(r){let i=await r(e,t,n);if(i!==void 0)return i}}if(e.getAttribute(`data-capture`)===`placeholder`){let r=e.cloneNode(!1);t.nodeMap.set(r,e),K(e,r,t,n);let i=document.createElement(`div`);return i.textContent=e.getAttribute(`data-placeholder-text`)||``,i.style.cssText=`color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;`,r.appendChild(i),r}{let r=!sn.has(e.tagName)&&on.get(e.tagName);if(r){let i=await r(e,t,n);if(i!==void 0)return i}}let o;try{if(o=e.cloneNode(!1),o.attributes?.length)try{for(let e of o.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(e.value)&&o.setAttribute(e.name,e.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,``))}catch{}if(wt(e,o),t.nodeMap.set(o,e),e.tagName===`IMG`){Bt(e,o);try{let{width:t,height:n}=J(e),r=Math.round(t||0),i=Math.round(n||0);r&&(o.dataset.snapdomWidth=String(r)),i&&(o.dataset.snapdomHeight=String(i))}catch(e){U(t,`getUnscaledDimensions for IMG failed`,e)}try{let t=e.getAttribute(`style`)||``,n=window.getComputedStyle(e),r=e=>{let r=t.match(RegExp(`${e}\\s*:\\s*([^;]+)`,`i`)),i=r?r[1].trim():n.getPropertyValue(e);return/%|auto/i.test(String(i||``))},i=parseInt(o.dataset.snapdomWidth||`0`,10),a=parseInt(o.dataset.snapdomHeight||`0`,10),s=r(`width`)||!i,c=r(`height`)||!a;s&&i&&(o.style.width=`${i}px`),c&&a&&(o.style.height=`${a}px`);let l=n.getPropertyValue(`object-fit`),u=n.getPropertyValue(`object-position`);l&&l!==`fill`?(o.style.objectFit=l,u&&(o.style.objectPosition=u)):(i&&(o.style.minWidth=`${i}px`),a&&(o.style.minHeight=`${a}px`))}catch(e){U(t,`IMG dimension freeze failed`,e)}}}catch(t){throw console.error(`[Snapdom] Failed to clone node:`,e,t),t}let s=null;if(e instanceof HTMLTextAreaElement){let{width:t,height:n}=J(e),r=t||e.getBoundingClientRect().width||0,i=n||e.getBoundingClientRect().height||0;r&&(o.style.width=`${r}px`),i&&(o.style.height=`${i}px`)}if(e instanceof HTMLInputElement){let n=(e.type||`text`).toLowerCase();if((n===`checkbox`||n===`radio`)&&me()){let{el:n,applyVisual:r}=Yt(e);t.nodeMap.set(n,e),s=r,o=n}else o.value=e.value,o.setAttribute(`value`,e.value),e.checked!==void 0&&(o.checked=e.checked,e.checked&&o.setAttribute(`checked`,``),e.indeterminate&&(o.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let t=window.getComputedStyle(e,`::placeholder`),n=t&&t.color;if(n&&n!==`rgba(0, 0, 0, 0)`){let e=`snapdom-ph-`+(Math.random()*1e6|0);o.classList.add(e);let r=document.createElement(`style`);r.textContent=`.${e}::placeholder{color:${n}!important;opacity:${t.opacity||`1`}!important;-webkit-text-fill-color:${n}!important;}`,o.prepend(r)}}catch{}if(e instanceof HTMLSelectElement&&(i=e.value),e instanceof HTMLTextAreaElement&&(a=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&o.setAttribute(`disabled`,``),e.required&&o.setAttribute(`required`,``),e.readOnly&&o.setAttribute(`readonly`,``);let t=e;t.min!==void 0&&t.min!==``&&o.setAttribute(`min`,t.min),t.max!==void 0&&t.max!==``&&o.setAttribute(`max`,t.max),t.pattern!==void 0&&t.pattern!==``&&o.setAttribute(`pattern`,t.pattern);let n=e.getAttribute(`aria-invalid`);n!==null&&o.setAttribute(`aria-invalid`,n)}if(xt(e)||K(e,o,t,n),s&&s(),e instanceof SVGElement&&!xt(e)){let t=[`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 n=window.getComputedStyle(e);for(let e of t){let t=n.getPropertyValue(e);t&&o.style.setProperty(e,t)}}catch{}}if(e.shadowRoot){let i=function(e,r){if(e.nodeType===Node.ELEMENT_NODE&&e.tagName===`STYLE`)return r(null);hn(e,t,n).then(e=>{r(e||null)}).catch(()=>{r(null)})};var c=i;try{let t=e.shadowRoot.querySelectorAll(`slot`);for(let e of t){let t=[];try{t=e.assignedNodes?.({flatten:!0})||e.assignedNodes?.()||[]}catch{t=e.assignedNodes?.()||[]}for(let e of t)r.add(e)}}catch{}let a=Lt(t),s=`[data-sd="${a}"]`;try{o.setAttribute(`data-sd`,a)}catch{}let l=Rt(e.shadowRoot),u=It(l,s),d=Ut(e,Vt(l),s);zt(o,d+u,a);let f=document.createDocumentFragment(),p=await Nt(Array.from(e.shadowRoot.childNodes),i,n.fast);f.append(...p.filter(e=>!!e)),o.appendChild(f)}if(e.tagName===`SLOT`){let r=function(e,r){hn(e,t,n).then(e=>{e&&Wt(e),r(e||null)}).catch(()=>{r(null)})};var c=r;let i=e.assignedNodes?.({flatten:!0})||[],a=i.length>0?i:Array.from(e.childNodes),o=document.createDocumentFragment(),s=await Nt(Array.from(a),r,n.fast);return o.append(...s.filter(e=>!!e)),o}function c(e,i){if(r.has(e))return i(null);hn(e,t,n).then(e=>{i(e||null)}).catch(()=>{i(null)})}let l=await Nt(Array.from(e.childNodes),c,n.fast);if(o.append(...l.filter(e=>!!e)),i!==null&&o instanceof HTMLSelectElement){o.value=i;for(let e of o.options)e.value===i?e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}return a!==null&&o instanceof HTMLTextAreaElement&&(o.textContent=a),o}async function gn(e,t,n){let r=!1;try{r=!!(e.contentDocument||e.contentWindow?.document)}catch(e){U(t,`iframe same-origin probe failed`,e)}if(r)try{return await Jt(e,t,n)}catch(e){console.warn(`[SnapDOM] iframe rasterization failed, fallback:`,e)}if(r||console.warn(`[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.`,e),n.placeholders){let{width:r,height:i}=J(e),a=document.createElement(`div`);return a.style.cssText=`width:${r}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;`,K(e,a,t,n),a}else{let{width:r,height:i}=J(e),a=document.createElement(`div`);return a.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,K(e,a,t,n),a}}async function _n(e,t,n){let r=``;try{let t=e.getContext(`2d`,{willReadFrequently:!0});try{t&&t.getImageData(0,0,1,1)}catch{}if(V()&&await new Promise(e=>requestAnimationFrame(e)),r=e.toDataURL(`image/png`),!r||r===`data:,`){try{t&&t.getImageData(0,0,1,1)}catch{}if(await new Promise(e=>requestAnimationFrame(e)),r=e.toDataURL(`image/png`),!r||r===`data:,`){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0),r=t.toDataURL(`image/png`))}}}catch(e){U(t,`Canvas toDataURL failed, using empty/fallback`,e)}let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch(e){U(t,`img decoding/loading hints failed`,e)}r&&(i.src=r),i.width=e.width,i.height=e.height;let{width:a,height:o}=J(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),K(e,i,t,n),i}async function vn(e,t,n){let r=``;try{let t=document.createElement(`canvas`);t.width=e.videoWidth||e.offsetWidth||320,t.height=e.videoHeight||e.offsetHeight||240;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0,t.width,t.height),r=t.toDataURL(`image/png`),(!r||r===`data:,`)&&(r=``))}catch(e){U(t,`Video frame capture failed, using poster fallback`,e)}let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch{}r?i.src=r:e.poster&&(i.src=e.poster),i.width=e.videoWidth||e.offsetWidth||0,i.height=e.videoHeight||e.offsetHeight||0;let{width:a,height:o}=J(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),i.style.objectFit=`contain`,t.nodeMap.set(i,e),K(e,i,t,n),i}async function yn(e,t,n){if(!e.controls)return;let{width:r,height:i}=J(e),a=Math.round(r||e.offsetWidth||300),o=Math.round(i||e.offsetHeight||54),s=o/2,c=Math.max(4,o*.16),l=o*.34,u=a-o*.34,d=l+c+o*.55,f=Math.max(0,u-o*.7-d),p=Math.max(9,Math.round(o*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}" viewBox="0 0 ${a} ${o}"><rect width="${a}" height="${o}" rx="${Math.min(o/2,10)}" fill="#f1f3f4"/><path d="M ${l} ${s-c} L ${l+c} ${s} L ${l} ${s+c} Z" fill="#5f6368"/><rect x="${d}" y="${s-1.5}" width="${f}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${s}" r="${Math.max(3,o*.09)}" fill="#5f6368"/><text x="${u}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${p}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,h=document.createElement(`img`);try{h.decoding=`sync`,h.loading=`eager`}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,h.width=a,h.height=o,h.style.width=`${a}px`,h.style.height=`${o}px`,t.nodeMap.set(h,e),K(e,h,t,n),h}cn(`IFRAME`,gn),cn(`CANVAS`,_n),cn(`VIDEO`,vn),cn(`AUDIO`,yn),W(),m(),B(),s(),s();var bn=[/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],xn=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__||{}),Sn=[],Cn=new Set;function wn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Tn(e){let t=Array.isArray(e)?e:[e];for(let e of t){let t;if(e instanceof RegExp)t=e;else if(typeof e==`string`)t=new RegExp(wn(e),`i`);else{console.warn(`[snapdom] Ignored invalid iconFont value:`,e);continue}let n=`${t.source}/${t.flags}`;Cn.has(n)||(Cn.add(n),Sn.push(t))}}function Y(e){let t=typeof e==`string`?e:``,n=[...bn,...Sn];for(let e of n)if(e instanceof RegExp&&e.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 En(e=``){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var Dn=new Map;function On(e=``){let t=Object.create(null),n=String(e||``),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function kn(e,t,n){let r=String(e||``),i=r.toLowerCase(),a=String(t||``).toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i)||!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let o=n&&(n.FILL??n.fill),s=`outlined`;/\brounded\b/.test(a)||/\bround\b/.test(a)?s=`rounded`:/\bsharp\b/.test(a)?s=`sharp`:/\boutlined\b/.test(a)&&(s=`outlined`);let c=o===1,l=null;if(c&&(s===`outlined`&&xn.materialIconsFilled?l={url:xn.materialIconsFilled,alias:`snapdom-mi-filled`}:s===`rounded`&&xn.materialIconsRound?l={url:xn.materialIconsRound,alias:`snapdom-mi-round`}:s===`sharp`&&xn.materialIconsSharp&&(l={url:xn.materialIconsSharp,alias:`snapdom-mi-sharp`})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Dn.has(l.alias))try{let e=new FontFace(l.alias,`url(${l.url})`,{style:`normal`,weight:`400`});document.fonts.add(e),await e.load(),Dn.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function An(e=`Material Icons`,t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,``)}"`),document.fonts.ready])}catch{}}function jn(e){let t=e.getPropertyValue(`-webkit-text-fill-color`)?.trim()||``,n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!==`currentcolor`)return t;let r=e.color?.trim();return r&&r!==`inherit`?r:`#000`}async function Mn(e,{family:t=`Material Icons`,weight:n=`normal`,fontSize:r=32,color:i=`#000`,variation:a=``,className:o=``}={}){let s=String(t||``).replace(/^['"]+|['"]+$/g,``),c=window.devicePixelRatio||1,{familyForMeasure:l,familyForCanvas:u}=await kn(s,o,On(a));await An(u.replace(/^["']+|["']+$/g,``),r);let d=document.createElement(`span`);d.setAttribute(`data-snapdom-internal`,``),d.textContent=e,d.style.position=`absolute`,d.style.visibility=`hidden`,d.style.left=`-99999px`,d.style.whiteSpace=`nowrap`,d.style.fontFamily=l,d.style.fontWeight=String(n||`normal`),d.style.fontSize=`${r}px`,d.style.lineHeight=`1`,d.style.margin=`0`,d.style.padding=`0`,d.style.fontFeatureSettings=`'liga' 1`,d.style.fontVariantLigatures=`normal`,d.style.color=i,document.body.appendChild(d);let f=d.getBoundingClientRect(),p=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(d);let h=document.createElement(`canvas`);h.width=p*c,h.height=m*c;let g=h.getContext(`2d`);g.scale(c,c),g.font=`${n?`${n} `:``}${r}px ${u}`,g.textAlign=`left`,g.textBaseline=`top`,g.fillStyle=i;try{g.fontKerning=`normal`}catch{}return g.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:m}}async function Nn(e,t,n=o.session.nodeMap){if(e?.nodeType!==1)return 0;let r=`.material-icons, [class*="material-symbols"]`,i=Array.from(e.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim());if(e.matches?.(r)&&e.textContent&&e.textContent.trim()&&i.unshift(e),i.length===0)return 0;let a=t?.nodeType===1?Array.from(t.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim()):[];t?.nodeType===1&&t.matches?.(r)&&t.textContent&&t.textContent.trim()&&a.unshift(t);let s=0;for(let e=0;e<i.length;e++){let t=i[e],r=n&&n.get(t)||a[e]||null;try{let e=getComputedStyle(r||t),n=e.fontFamily||`Material Icons`;if(!En(n))continue;let i=(r||t).textContent.trim();if(!i)continue;let a=parseInt(e.fontSize,10)||24,{dataUrl:o,width:c,height:l}=await Mn(i,{family:n,weight:e.fontWeight&&e.fontWeight!==`normal`?e.fontWeight:`normal`,fontSize:a,color:jn(e),variation:e.fontVariationSettings&&e.fontVariationSettings!==`normal`?e.fontVariationSettings:``,className:(r||t).className||``});t.textContent=``;let u=t.ownerDocument.createElement(`img`);u.src=o,u.alt=i,u.style.height=`${a}px`,u.style.width=`${Math.max(1,Math.round(c/l*a))}px`,u.style.objectFit=`contain`,u.style.verticalAlign=getComputedStyle(t).verticalAlign||`baseline`,t.appendChild(u),s++}catch{}}return s}E();async function Pn(e,t,n,r=32,i=`#000`){t=t.replace(/^['"]+|['"]+$/g,``);let a=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let o=document.createElement(`span`);o.setAttribute(`data-snapdom-internal`,``),o.textContent=e,o.style.position=`absolute`,o.style.visibility=`hidden`,o.style.fontFamily=`"${t}"`,o.style.fontWeight=n||`normal`,o.style.fontSize=`${r}px`,o.style.lineHeight=`1`,o.style.whiteSpace=`nowrap`,o.style.padding=`0`,o.style.margin=`0`,document.body.appendChild(o);let s=o.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(o);let u=document.createElement(`canvas`);u.width=Math.max(1,c*a),u.height=Math.max(1,l*a);let d=u.getContext(`2d`);return d.scale(a,a),d.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,d.textAlign=`left`,d.textBaseline=`top`,d.fillStyle=i,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var Fn=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`emoji`,`math`,`fangsong`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`]),In=[`katex`,`mathjax`,`mathml`];function Ln(e){if(!e)return``;for(let t of e.split(`,`)){let e=t.trim().replace(/^['"]+|['"]+$/g,``);if(e&&!Fn.has(e.toLowerCase()))return e}return``}function Rn(e){if(!e)return[];let t=[];for(let n of e.split(`,`)){let e=n.trim().replace(/^['"]+|['"]+$/g,``);e&&(Fn.has(e.toLowerCase())||t.push(e))}return t}function zn(e){let t=String(e??`400`).trim().toLowerCase();if(t===`normal`)return 400;if(t===`bold`)return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Bn(e){let t=String(e??`normal`).trim().toLowerCase();return t.startsWith(`italic`)?`italic`:t.startsWith(`oblique`)?`oblique`:`normal`}function Vn(e){let t=String(e??`100%`).match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Hn(e){let t=String(e||`400`).trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let e=zn(n[1]),t=zn(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=zn(t);return{min:r,max:r}}function Un(e){let t=String(e||`normal`).trim().toLowerCase();return t===`italic`?{kind:`italic`}:t.startsWith(`oblique`)?{kind:`oblique`}:{kind:`normal`}}function Wn(e){let t=String(e||`100%`).trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Gn(e){return!e||typeof e!=`string`?``:e.replace(/\s+(variable|vf|v[0-9]+)$/i,``).trim().toLowerCase().replace(/\s+/g,`-`)}function Kn(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=r.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(e=>i.endsWith(e))||n.some(e=>i===e.toLowerCase()||i.endsWith(`.`+e.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||In.some(e=>a.includes(e)))return!0;for(let e of t){let t=e.toLowerCase().replace(/\s+/g,`+`),n=e.toLowerCase().replace(/\s+/g,`-`),r=Gn(e);if(a.includes(t)||a.includes(n)||r&&a.includes(r))return!0}return!1}catch{return!1}}function qn(e){let t=new Set;for(let n of e||[]){let e=String(n).split(`__`)[0]?.trim();e&&t.add(e)}return t}function Jn(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(e,n,r)=>{let i=(r||``).trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return e;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var Yn=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Xn=4;async function Zn(e,t,n){if(!e)return e;let r=new Set;function i(e,t){try{return new URL(e,t||location.href).href}catch{return e}}async function a(e,t,o=0){if(o>Xn)return console.warn(`[snapDOM] @import depth exceeded (${Xn}) at ${t}`),e;let s=``,c=0,l;for(;l=Yn.exec(e);){s+=e.slice(c,l.index),c=Yn.lastIndex;let u=i((l[2]||l[4]||``).trim(),t);if(r.has(u)){console.warn(`[snapDOM] Skipping circular @import: ${u}`);continue}r.add(u);let d=``;try{let e=await S(u,{as:`text`,useProxy:n,silent:!0});e.ok&&typeof e.data==`string`&&(d=e.data)}catch{}d?(d=Jn(d,u),d=await a(d,u,o+1),s+=`
|
||
/* inlined: ${u} */
|
||
${d}
|
||
`):s+=l[0]}return s+=e.slice(c),s}let o=Jn(e,t||location.href);return o=await a(o,t||location.href,0),o}var Qn=/url\((["']?)([^"')]+)\1\)/g,$n=/@font-face[^{}]*\{[^}]*\}/g;function X(e,t,n=``){return(e.match(RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,`i`))?.[1]||n).trim()}function er(e){if(!e)return[];let t=[],n=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of n){let n=e.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;let r=n[1],i=n[2],a=e=>e.includes(`?`)?[parseInt(e.replace(/\?/g,`0`),16),parseInt(e.replace(/\?/g,`F`),16)]:parseInt(e,16);if(i){let e=a(r),n=a(i),o=Array.isArray(e)?e[0]:e,s=Array.isArray(n)?n[1]:n;t.push([Math.min(o,s),Math.max(o,s)])}else{let e=a(r);Array.isArray(e)?t.push([e[0],e[1]]):t.push([e,e])}}return t}function tr(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[e,r]of t)if(n>=e&&n<=r)return!0;return!1}function nr(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Qn)){let e=(r[2]||``).trim();if(!(!e||e.startsWith(`data:`))){if(!/^https?:/i.test(e))try{e=new URL(e,t||location.href).href}catch{}n.push(e)}}return n}async function rr(e,t,n=``){let r=e;for(let i of e.matchAll(Qn)){let e=c(i[0]);if(!e)continue;let a=e;if(!a.startsWith(`http`)&&!a.startsWith(`data:`))try{a=new URL(a,t||location.href).href}catch{}if(!Y(a)){if(o.resource?.has(a)){o.font?.add(a),r=r.replace(i[0],`url(${o.resource.get(a)})`);continue}try{let e=await S(a,{as:`dataURL`,useProxy:n,silent:!0});if(e.ok&&typeof e.data==`string`){let t=e.data;o.resource?.set(a,t),o.font?.add(a),r=r.replace(i[0],`url(${t})`)}}catch{console.warn(`[snapDOM] Failed to fetch font resource:`,a)}}}return r}function ir(e){if(!e.length)return null;let t=(t,n)=>e.some(([e,r])=>!(r<t||e>n)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),a=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?`vietnamese`:a?`cyrillic`:i?`greek`:r?`latin-ext`:n?`latin`:null}function ar(e={}){let t=new Set((e.families||[]).map(e=>String(e).toLowerCase())),n=new Set((e.domains||[]).map(e=>String(e).toLowerCase())),r=new Set((e.subsets||[]).map(e=>String(e).toLowerCase()));return(e,i)=>{if(t.size&&t.has(e.family.toLowerCase()))return!0;if(n.size)for(let t of e.srcUrls)try{if(n.has(new URL(t).host.toLowerCase()))return!0}catch{}if(r.size){let e=ir(i);if(e&&r.has(e))return!0}return!1}}function or(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let e=Ln(X(i,`font-family`)),t=X(i,`font-weight`,`400`),a=X(i,`font-style`,`normal`),o=X(i,`font-stretch`,`100%`),s=X(i,`unicode-range`),c=X(i,`src`),l=nr(c,location.href),u=l.length?l.map(e=>String(e).toLowerCase()).sort().join(`|`):c.toLowerCase(),d=[String(e||``).toLowerCase(),t,a,o,s.toLowerCase(),u].join(`|`);n.has(d)||(n.add(d),r.push(i))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||``)}var sr=new WeakMap,cr=0;function lr(e){let t=sr.get(e);return t===void 0&&(t=cr++,sr.set(e,t)),t}function ur(e,t,n,r,i,a){return`fonts-embed-css::req=${Array.from(e||[]).sort().join(`|`)}::ex=${t?JSON.stringify({families:(t.families||[]).map(e=>String(e).toLowerCase()).sort(),domains:(t.domains||[]).map(e=>String(e).toLowerCase()).sort(),subsets:(t.subsets||[]).map(e=>String(e).toLowerCase()).sort()}):``}::lf=${(n||[]).map(e=>`${(e.family||``).toLowerCase()}::${e.weight||`normal`}::${e.style||`normal`}::${e.src||``}`).sort().join(`|`)}::px=${r||``}::fd=${(i||[]).map(e=>String(e).toLowerCase()).sort().join(`|`)}::doc=${lr(a||document)}`}async function dr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let a=(e,t)=>{try{return new URL(e,t||location.href).href}catch{return e}};for(let e of i){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let i=e.href?a(e.href,t):t;if(r.depth>=Xn){console.warn(`[snapDOM] CSSOM import depth exceeded (${Xn}) at ${i}`);continue}if(i&&r.visitedSheets.has(i)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${i}`);continue}i&&r.visitedSheets.add(i);let o={...r,depth:(r.depth||0)+1};await dr(e.styleSheet,i,n,o);continue}if(e.type===CSSRule.FONT_FACE_RULE){let i=Ln((e.style.getPropertyValue(`font-family`)||``).trim());if(!i||Y(i))continue;let a=(e.style.getPropertyValue(`font-weight`)||`400`).trim(),o=(e.style.getPropertyValue(`font-style`)||`normal`).trim(),s=(e.style.getPropertyValue(`font-stretch`)||`100%`).trim(),c=(e.style.getPropertyValue(`src`)||``).trim(),l=(e.style.getPropertyValue(`unicode-range`)||``).trim();if(!r.faceMatchesRequired(i,o,a,s))continue;let u=er(l);if(!tr(r.usedCodepoints,u))continue;let d={family:i,weightSpec:a,styleSpec:o,stretchSpec:s,unicodeRange:l,srcRaw:c,srcUrls:nr(c,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(d,u))continue;/url\(/i.test(c)?await n(`@font-face{font-family:${i};src:${await rr(c,t||location.href,r.useProxy)};font-style:${o};font-weight:${a};font-stretch:${s};${l?`unicode-range:${l};`:``}}`):await n(`@font-face{font-family:${i};src:${c};font-style:${o};font-weight:${a};font-stretch:${s};${l?`unicode-range:${l};`:``}}`)}}}async function fr({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i=``,fontStylesheetDomains:a=[],doc:s=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let c=new Map;for(let t of e){let[e,n,r,i]=String(t).split(`__`);if(!e)continue;let a=e.toLowerCase(),o=c.get(a)||[];o.push({w:parseInt(n,10),s:r,st:parseInt(i,10)}),c.set(a,o)}function l(e,t,n,r){let i=String(e).toLowerCase();if(!c.has(i))return!1;let a=c.get(i),o=Hn(n),s=Un(t),l=Wn(r),u=o.min!==o.max,d=o.min,f=e=>s.kind===`normal`&&e===`normal`||s.kind!==`normal`&&(e===`italic`||e===`oblique`),p=!1;for(let e of a){let t=u?e.w>=o.min&&e.w<=o.max:e.w===d,n=f(Bn(e.s)),r=e.st>=l.min&&e.st<=l.max;if(t&&n&&r){p=!0;break}}if(p)return!0;if(!u)for(let e of a){let t=f(Bn(e.s)),n=e.st>=l.min&&e.st<=l.max;if(Math.abs(d-e.w)<=300&&t&&n)return!0}if(!u&&s.kind===`normal`&&a.some(e=>Bn(e.s)!==`normal`))for(let e of a){let t=Math.abs(d-e.w)<=300,n=e.st>=l.min&&e.st<=l.max;if(t&&n)return!0}return!1}let u=ar(n),d=ur(e,n,r,i,a,s);if(o.resource?.has(d))return o.resource.get(d);let f=qn(e),p=[],m=Yn;for(let e of s.querySelectorAll(`style`)){let t=e.textContent||``;for(let e of t.matchAll(m)){let t=(e[2]||e[4]||``).trim();!t||Y(t)||s.querySelector(`link[rel="stylesheet"][href="${t}"]`)||p.push(t)}}let h=[];p.length&&await Promise.all(p.map(e=>new Promise(t=>{if(s.querySelector(`link[rel="stylesheet"][href="${e}"]`))return t(null);let n=s.createElement(`link`);n.rel=`stylesheet`,n.href=e,n.setAttribute(`data-snapdom`,`injected-import`),n.onload=()=>t(n),n.onerror=()=>t(null),s.head.appendChild(n),h.push(n)})));let g=``,_=Array.from(s.querySelectorAll(`link[rel="stylesheet"]`)).filter(e=>!!e.href);for(let e of h)try{e.remove()}catch{}for(let e of _)try{if(Y(e.href))continue;let r=``,o=!1;try{o=new URL(e.href,location.href).origin===location.origin}catch{}if(!o){let t=Array.isArray(a)?a:[];if(!Kn(e.href,f,t))continue}if(o){let t=Array.from(s.styleSheets).find(t=>t.href===e.href);if(t)try{let e=t.cssRules||[];r=Array.from(e).map(e=>e.cssText).join(``)}catch{}}if(!r){let t=await S(e.href,{as:`text`,useProxy:i});if(t?.ok&&typeof t.data==`string`&&(r=t.data),Y(e.href))continue}r=await Zn(r,e.href,i);let c=``;for(let a of r.match($n)||[]){let r=Ln(X(a,`font-family`));if(!r||Y(r))continue;let o=X(a,`font-weight`,`400`),s=X(a,`font-style`,`normal`),d=X(a,`font-stretch`,`100%`),f=X(a,`unicode-range`),p=X(a,`src`),m=nr(p,e.href);if(!l(r,s,o,d))continue;let h=er(f);if(!tr(t,h))continue;let g={family:r,weightSpec:o,styleSpec:s,stretchSpec:d,unicodeRange:f,srcRaw:p,srcUrls:m,href:e.href};if(n&&u(g,h))continue;let _=/url\(/i.test(p)?await rr(a,e.href,i):a;c+=_}c.trim()&&(g+=c)}catch{console.warn(`[snapDOM] Failed to process stylesheet:`,e.href)}let v={requiredIndex:c,usedCodepoints:t,faceMatchesRequired:l,simpleExcluder:n?ar(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let e of s.styleSheets)if(!(e.href&&_.some(t=>t.href===e.href)))try{let t=e.href||location.origin+`/`;t&&v.visitedSheets.add(t),await dr(e,t,async e=>{g+=e},v)}catch{}try{for(let e of s.fonts||[]){if(!e||!e.family||e.status!==`loaded`||!e._snapdomSrc)continue;let t=String(e.family).replace(/^['"]+|['"]+$/g,``);if(Y(t)||!c.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e._snapdomSrc;if(!String(r).startsWith(`data:`)){if(o.resource?.has(e._snapdomSrc))r=o.resource.get(e._snapdomSrc),o.font?.add(e._snapdomSrc);else if(!o.font?.has(e._snapdomSrc))try{let t=await S(e._snapdomSrc,{as:`dataURL`,useProxy:i,silent:!0});if(t.ok&&typeof t.data==`string`)r=t.data,o.resource?.set(e._snapdomSrc,r),o.font?.add(e._snapdomSrc);else continue}catch{console.warn(`[snapDOM] Failed to fetch dynamic font src:`,e._snapdomSrc);continue}}g+=`@font-face{font-family:'${t}';src:url(${r});font-style:${e.style||`normal`};font-weight:${e.weight||`normal`};}`}}catch{}for(let e of r){if(!e||typeof e!=`object`)continue;let t=String(e.family||``).replace(/^['"]+|['"]+$/g,``);if(!t||Y(t)||!c.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e.weight==null?`normal`:String(e.weight),a=e.style==null?`normal`:String(e.style),s=e.stretchPct==null?`100%`:`${e.stretchPct}%`,l=String(e.src||``),u=l;if(!u.startsWith(`data:`)){if(o.resource?.has(l))u=o.resource.get(l),o.font?.add(l);else if(!o.font?.has(l))try{let e=await S(l,{as:`dataURL`,useProxy:i,silent:!0});if(e.ok&&typeof e.data==`string`)u=e.data,o.resource?.set(l,u),o.font?.add(l);else continue}catch{console.warn(`[snapDOM] Failed to fetch localFonts src:`,l);continue}}g+=`@font-face{font-family:'${t}';src:url(${u});font-style:${a};font-weight:${r};font-stretch:${s};}`}return g&&(g=or(g),o.resource?.set(d,g)),g}function pr(e,t){let n=new Set,r=new Set;if(!e)return{required:n,usedCodepoints:r};let i=e=>{if(e)for(let t of e)r.add(t.codePointAt(0))},a=e=>{let t=Rn(e.fontFamily);if(t.length)for(let r of t)n.add(`${r}__${zn(e.fontWeight)}__${Bn(e.fontStyle)}__${Vn(e.fontStretch)}`)},o=e=>{a(I(e));for(let t of[`::before`,`::after`]){let n=I(e,t),o=n&&n.content;if(!(!o||o===`none`||o===`normal`))if(a(n),/^["']/.test(o))i(o.slice(1,-1));else{let e=o.match(/\\[0-9A-Fa-f]{1,6}/g);if(e)for(let t of e)try{r.add(parseInt(t.slice(1),16))}catch{}}}};o(e);let s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let e=s.currentNode;if(e.nodeType===Node.TEXT_NODE){if(t&&e.parentElement&&!t(e.parentElement))continue;i(e.nodeValue||``)}else{if(t&&!t(e))continue;o(e)}}return{required:n,usedCodepoints:r}}function mr(e,t){return pr(e,t).required}async function hr(e,t=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let e=n.createElement(`div`);e.setAttribute(`data-snapdom-internal`,``),e.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;`;for(let t of r){let r=n.createElement(`span`);r.textContent=`AaBbGg1234ÁÉÍÓÚçñ—∞`,r.style.fontFamily=`"${t}"`,r.style.fontWeight=`700`,r.style.fontStyle=`italic`,r.style.fontSize=`32px`,r.style.lineHeight=`1`,r.style.whiteSpace=`nowrap`,r.style.margin=`0`,r.style.padding=`0`,e.appendChild(r)}n.body.appendChild(e),e.offsetWidth,n.body.removeChild(e)};for(let e=0;e<Math.max(1,t);e++)i(),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))}function gr(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||``)}function _r(e,t=!1){let n=``,r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function vr(e,t=!0){let n=[[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`]],r=Math.max(1,Math.min(3999,e)),i=``;for(let[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function yr(e,t){switch((t||`decimal`).toLowerCase()){case`decimal`:return String(e);case`decimal-leading-zero`:{let t=Math.abs(e);return(e<0?`-`:``)+(t<10?`0`:``)+String(t)}case`lower-alpha`:return _r(e,!1);case`upper-alpha`:return _r(e,!0);case`lower-roman`:return vr(e,!1);case`upper-roman`:return vr(e,!0);default:return String(e)}}function br(e){let t=new WeakMap,n=e instanceof Document?e.documentElement:e,r=e=>e&&e.tagName===`LI`,i=e=>{let t=0,n=e?.parentElement;if(!n)return 0;for(let r of n.children){if(r===e)break;r.tagName===`LI`&&t++}return t},a=e=>{let t=new Map;for(let[n,r]of e)t.set(n,r.slice());return t},o=(e,t,n)=>{let o=a(e),s;try{s=n.style?.counterReset||getComputedStyle(n).counterReset}catch{}if(s&&s!==`none`)for(let e of s.split(`,`)){let n=e.trim().split(/\s+/),r=n[0],i=Number.isFinite(Number(n[1]))?Number(n[1]):0;if(!r)continue;let a=t.get(r);if(a&&a.length){let e=a.slice();e.push(i),o.set(r,e)}else o.set(r,[i])}let c;try{c=n.style?.counterSet||getComputedStyle(n).counterSet}catch{}if(c&&c!==`none`)for(let e of c.split(`,`)){let t=e.trim().split(/\s+/),n=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):0;if(!n)continue;let i=o.get(n)||[];i.length===0&&i.push(0),i[i.length-1]=r,o.set(n,i)}let l;try{l=n.style?.counterIncrement||getComputedStyle(n).counterIncrement}catch{}if(l&&l!==`none`)for(let e of l.split(`,`)){let t=e.trim().split(/\s+/),n=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):1;if(!n)continue;let i=o.get(n)||[];i.length===0&&i.push(0),i[i.length-1]+=r,o.set(n,i)}try{if(getComputedStyle(n).display===`list-item`&&r(n)){let e=n.parentElement,t=1;if(e&&e.tagName===`OL`){let r=e.getAttribute(`start`),a=Number.isFinite(Number(r))?Number(r):1,o=i(n),s=n.getAttribute(`value`);t=Number.isFinite(Number(s))?Number(s):a+o}else t=1+i(n);let r=o.get(`list-item`)||[];r.length===0&&r.push(0),r[r.length-1]=t,o.set(`list-item`,r)}}catch{}return o},s=(e,n,r)=>{let i=o(r,n,e);t.set(e,i);let a=i;for(let t of e.children)a=s(t,i,a);let c=new Map;for(let[e,t]of r){let n=t.length,r=a.get(e);c.set(e,r&&r.length?r.slice(0,n):t.slice())}for(let[e,t]of a)!c.has(e)&&t.length&&!n.has(e)&&c.set(e,t.slice(0,1));return c},c=new Map;return s(n,c,c),{get(e,n){let r=t.get(e)?.get(n);return r&&r.length?r[r.length-1]:0},getStack(e,n){let r=t.get(e)?.get(n);return r?r.slice():[]}}}function xr(e,t,n){if(!e||e===`none`)return e;try{return e.replace(/\b(counter|counters)\s*\(([^)]+)\)/g,(e,r,i)=>{let a=String(i).split(`,`).map(e=>e.trim());if(r===`counter`){let e=a[0]?.replace(/^["']|["']$/g,``),r=(a[1]||`decimal`).toLowerCase();return yr(n.get(t,e),r)}else{let e=a[0]?.replace(/^["']|["']$/g,``),r=a[1]?.replace(/^["']|["']$/g,``)??``,i=(a[2]||`decimal`).toLowerCase(),o=n.getStack(t,e);return o.length?o.map(e=>yr(e,i)).join(r):``}})}catch{return`- `}}E();var Sr=new WeakMap,Cr=1e3;function wr(e,t){let n=Er(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=Or(e,n),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):Or(e,n)}function Tr(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Er(e){let t=e.querySelectorAll(`style,link[rel~="stylesheet"]`),n=`n:${t.length}|`,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i.tagName===`STYLE`){let e=i.textContent?i.textContent.length:0;n+=`S${e}|`;let t=i.sheet,a=t?Tr(t):null;a&&(r+=a.length)}else{let e=i.getAttribute(`href`)||``,t=i.getAttribute(`media`)||`all`;n+=`L${e}|m:${t}|`;let a=i.sheet,o=a?Tr(a):null;o&&(r+=o.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function Dr(e,t,n){let r=Tr(e);if(!r)return!1;for(let e=0;e<r.length;e++){if(n.budget<=0)return!1;let i=r[e],a=i&&i.cssText?i.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let e=0;e<i.cssRules.length&&n.budget>0;e++){let r=i.cssRules[e],a=r&&r.cssText?r.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0}if(n.budget<=0)return!1}return!1}function Or(e=document,t=Er(e)){let n=Sr.get(e);if(n&&n.fingerprint===t)return n.result;let r=[`::before`,`::after`,`::first-letter`,`:before`,`:after`,`:first-letter`,`counter(`,`counters(`,`counter-increment`,`counter-reset`],i=e.querySelectorAll(`style`);for(let n=0;n<i.length;n++){let a=i[n].textContent||``;for(let n of r)if(a.includes(n))return Sr.set(e,{fingerprint:t,result:!0}),!0}let a=e.adoptedStyleSheets;if(Array.isArray(a)&&a.length){let n={budget:Cr};try{for(let i of a)if(Dr(i,r,n))return Sr.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let n=e.querySelectorAll(`style,link[rel~="stylesheet"]`),i={budget:Cr};for(let a=0;a<n.length&&i.budget>0;a++){let o=n[a],s=null;if(o.tagName,s=o.sheet||null,s&&Dr(s,r,i))return Sr.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector(`[style*="counter("], [style*="counters("]`)?(Sr.set(e,{fingerprint:t,result:!0}),!0):(Sr.set(e,{fingerprint:t,result:!1}),!1)}function kr(e){for(let t of[`Top`,`Right`,`Bottom`,`Left`]){let n=parseFloat(e[`border${t}Width`])||0,r=e[`border${t}Style`];if(n>0&&r&&r!==`none`&&r!==`hidden`)return!0}return!1}function Ar(e,t){let n=null,r=()=>{if(!n)try{n=br(e)}catch(e){U(t,`buildCounterContext failed`,e),n={get:()=>0,getStack:()=>[]}}return n};return{get(e,t){return r().get(e,t)},getStack(e,t){return r().getStack(e,t)}}}function jr(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`)t=!t;else if(r===`/`&&!t)return e.slice(0,n).trim()}return e}function Mr(e){if(!e)return``;let t=[],n=/"([^"]*)"/g,r=0,i;for(;i=n.exec(e);){let a=e.slice(r,i.index).trim();a&&t.push(a),t.push(i[1]),r=n.lastIndex}let a=e.slice(r).trim();return a&&t.push(a),t.join(``)}function Nr(e,t,n){let r=e.parentElement,i=r&&n?n.get(r):null;return i?{get(e,n){let r=t.get(e,n),a=i.get(n);return typeof a==`number`?Math.max(r,a):r},getStack(e,n){let r=t.getStack(e,n);if(!r.length)return r;let a=i.get(n);if(typeof a==`number`){let e=r.slice();return e[e.length-1]=Math.max(e[e.length-1],a),e}return r}}:t}function Pr(e,t,n){let r=new Map;function i(e){let t=[];if(!e||e===`none`)return t;for(let n of String(e).split(`,`)){let e=n.trim().split(/\s+/),r=e[0],i=Number.isFinite(Number(e[1]))?Number(e[1]):void 0;r&&t.push({name:r,num:i})}return t}let a=i(t?.counterReset),o=i(t?.counterSet),s=i(t?.counterIncrement);function c(t){if(r.has(t))return r.get(t).slice();let i=n.getStack(e,t);i=i.length?i.slice():[];let c=a.find(e=>e.name===t);if(c){let e=Number.isFinite(c.num)?c.num:0;i=i.length?[...i,e]:[e]}let l=o.find(e=>e.name===t);if(l){let e=Number.isFinite(l.num)?l.num:0;i.length===0&&(i=[0]),i[i.length-1]=e}let u=s.find(e=>e.name===t);if(u){let e=Number.isFinite(u.num)?u.num:1;i.length===0&&(i=[0]),i[i.length-1]+=e}return r.set(t,i.slice()),i}return{get(e,t){let n=c(t);return n.length?n[n.length-1]:0},getStack(e,t){return c(t)},__incs:s}}function Fr(e,t,n,r){let i;try{i=I(e,t)}catch{}let a=i?.content;if(!a||a===`none`||a===`normal`)return{text:``,incs:[]};a=jr(a);let o=Nr(e,n,r),s=Pr(e,i,o);return{text:Mr(gr(a)?xr(a,e,s):a),incs:s.__incs||[]}}async function Ir(e,t,n,r){if(e?.nodeType!==1||t?.nodeType!==1||e.tagName===`TEXTAREA`||!wr(e.ownerDocument||document,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Ar(e.ownerDocument||document,n));let i=n.__counterCtx;for(let a of[`::before`,`::after`,`::first-letter`])try{let o=I(e,a);if(!o||o.content===`none`&&o.backgroundImage===`none`&&o.backgroundColor===`transparent`&&!kr(o)&&(!o.transform||o.transform===`none`)&&o.display===`inline`)continue;if(a===`::first-letter`){let r=I(e),i=(r?.display||``).toLowerCase();if(i.includes(`flex`)||i.includes(`grid`))continue;let a=e=>o[e]!==r[e]&&(parseFloat(o[e])||0)!==0;if(!(o.color!==r.color||o.fontSize!==r.fontSize||o.fontWeight!==r.fontWeight||o.fontFamily!==r.fontFamily||o.fontStyle!==r.fontStyle||o.textTransform!==r.textTransform||o.float!==r.float&&o.float!==`none`||a(`paddingTop`)||a(`paddingRight`)||a(`paddingBottom`)||a(`paddingLeft`)||a(`marginTop`)||a(`marginRight`)||a(`marginBottom`)||a(`marginLeft`)))continue;let s=Array.from(t.childNodes).find(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim().length>0);if(!s)continue;let c=s.textContent,l=c.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],u=c.slice(l?.length||0);if(!l||/[\uD800-\uDFFF]/.test(l))continue;let d=document.createElement(`span`);d.textContent=l,d.dataset.snapdomPseudo=`::first-letter`;let f=M(te(o),`span`);n.styleMap.set(d,f);let p=document.createTextNode(u);t.replaceChild(p,s),t.insertBefore(d,p);continue}let s=o.content??``,u=s===``||s===`none`||s===`normal`,{text:f,incs:p}=Fr(e,a,i,n.__siblingCounters),m=o.backgroundImage,h=o.backgroundColor,g=o.fontFamily,_=parseInt(o.fontSize)||32,v=parseInt(o.fontWeight)||!1,y=o.color||`#000`,b=o.transform,x=Y(g),C=!u&&f!==``,w=m&&m!==`none`,T=h&&h!==`transparent`&&h!==`rgba(0, 0, 0, 0)`,E=kr(o),O=b&&b!==`none`,k=s!==`none`&&s!==`normal`,A=k&&((parseFloat(o.width)||0)>0||(parseFloat(o.height)||0)>0),j=k&&o.boxShadow&&o.boxShadow!==`none`,N=k&&o.outlineStyle&&o.outlineStyle!==`none`&&(parseFloat(o.outlineWidth)||0)>0;if(!(C||w||T||E||O||A||j||N)){if(p&&p.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map;for(let{name:r}of p){if(!r)continue;let o=Nr(e,i,n.__siblingCounters),s=Pr(e,I(e,a),o).get(e,r);t.set(r,s)}n.__siblingCounters.set(e.parentElement,t)}continue}let P=f.startsWith(`url(`)||/^-?(?:webkit-)?image-set\(/i.test(f),ee=!1;if(C&&!x&&f.length>1&&!P){let n=I(e),r=parseFloat(n.fontSize)||16,i=parseFloat(n.lineHeight);Number.isFinite(i)||(i=r*1.5),e.getBoundingClientRect().height<i*1.6&&(t.style.whiteSpace=`nowrap`,ee=!0)}let F=document.createElement(`span`);F.dataset.snapdomPseudo=a,F.style.pointerEvents=`none`,ee&&(F.style.whiteSpace=`nowrap`);let re=te(o),ie=(I(e).display||``).toLowerCase(),ae=ie.includes(`flex`)||ie.includes(`grid`);if(ae){let e=re[`min-width`];(!e||e===`auto`||e===`0px`)&&(re[`min-width`]=`0px`)}let L=M(re,`span`,C,ae);if(n.styleMap.set(F,L),x&&f&&f.length===1){let{dataUrl:e,width:n,height:r}=await Pn(f,g,v,_,y),i=document.createElement(`img`);i.src=e,i.style=`height:${_}px;width:${n/r*_}px;object-fit:contain;`,F.appendChild(i),t.dataset.snapdomHasIcon=`true`}else if(f&&P){let t=l(f,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??c(f);if(t?.trim())try{let e=await S(d(t),{as:`dataURL`,useProxy:r.useProxy});if(e?.ok&&typeof e.data==`string`){let t=document.createElement(`img`);t.src=e.data,t.style=`width:${_}px;height:auto;object-fit:contain;`,F.appendChild(t)}}catch(t){console.error(`[snapdom] Error in pseudo ${a} for`,e,t)}}else !x&&C&&(F.textContent=f);F.style.backgroundImage=`none`,`maskImage`in F.style&&(F.style.maskImage=`none`),`webkitMaskImage`in F.style&&(F.style.webkitMaskImage=`none`);try{F.style.backgroundRepeat=o.backgroundRepeat,F.style.backgroundSize=o.backgroundSize,o.backgroundPositionX&&o.backgroundPositionY?(F.style.backgroundPositionX=o.backgroundPositionX,F.style.backgroundPositionY=o.backgroundPositionY):F.style.backgroundPosition=o.backgroundPosition,F.style.backgroundOrigin=o.backgroundOrigin,F.style.backgroundClip=o.backgroundClip,F.style.backgroundAttachment=o.backgroundAttachment,F.style.backgroundBlendMode=o.backgroundBlendMode}catch{}if(w)try{let e=ne(m),t=await Promise.all(e.map(D));F.style.backgroundImage=t.join(`, `)}catch(e){console.warn(`[snapdom] Failed to inline background-image for ${a}`,e)}T&&(F.style.backgroundColor=h);let R=F.childNodes.length>0||F.textContent?.trim()!==``||w||T||E||O||A||j||N;if(p&&p.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map,r=Nr(e,i,n.__siblingCounters),o=Pr(e,I(e,a),r);for(let{name:n}of p){if(!n)continue;let r=o.get(e,n);t.set(n,r)}n.__siblingCounters.set(e.parentElement,t)}if(!R)continue;a===`::before`?(t.dataset.snapdomHasBefore=`1`,t.insertBefore(F,t.firstChild)):(t.dataset.snapdomHasAfter=`1`,t.appendChild(F))}catch(t){console.warn(`[snapdom] Failed to capture ${a} for`,e,t)}let a=Array.from(t.children).filter(e=>!e.dataset.snapdomPseudo);if(n.nodeMap)for(let e of a){let t=n.nodeMap.get(e);t?.nodeType===1&&await Ir(t,e,n,r)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,a.length);e++)await Ir(t[e],a[e],n,r)}}function Lr(e,t){if(!e||e?.nodeType!==1)return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll(`svg`));if(i.length===0)return;let a=/url\(\s*#([^)]+)\)/g,o=[`fill`,`stroke`,`filter`,`clip-path`,`mask`,`marker`,`marker-start`,`marker-mid`,`marker-end`],s=e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`),c=e=>{if(!e||!e.getAttribute)return null;let t=e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(t)return t;let n=e.attributes;if(!n)return null;for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name)continue;if(t.name===`href`)return t.value;let r=t.name.indexOf(`:`);if(r!==-1&&t.name.slice(r+1)===`href`)return t.value}return null},l=new Set(Array.from(e.querySelectorAll(`[id]`)).map(e=>e.id)),u=new Set,d=!1,f=(e,t=null)=>{if(!e)return;a.lastIndex=0;let n;for(;n=a.exec(e);){d=!0;let e=(n[1]||``).trim();e&&(l.has(e)||(u.add(e),t&&!t.has(e)&&t.add(e)))}},p=e=>{let t=e.querySelectorAll(`use`);for(let e of t){let t=c(e);if(!t||!t.startsWith(`#`))continue;d=!0;let n=t.slice(1).trim();n&&!l.has(n)&&u.add(n)}f(e.getAttribute(`style`)||``);for(let t of o)f(e.getAttribute(t));let n=e.querySelectorAll(`*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]`);for(let e of n){f(e.getAttribute(`style`)||``);for(let t of o)f(e.getAttribute(t))}};for(let e of i)p(e);if(!d)return;let m=e.querySelector(`svg.inline-defs-container`);m||(m=n.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 h=m.querySelector(`defs`)||null,g=t=>{if(!t||l.has(t))return null;let n=s(t),i=t=>{let n=r.querySelector(t);return n&&!e.contains(n)?n:null};return i(`svg defs > *#${n}`)||i(`svg > symbol#${n}`)||i(`*#${n}`)};if(!u.size)return;let _=new Set(u),v=new Set;for(;_.size;){let e=_.values().next().value;if(_.delete(e),!e||l.has(e)||v.has(e))continue;let t=g(e);if(!t){v.add(e);continue}h||(h=n.createElementNS(`http://www.w3.org/2000/svg`,`defs`),m.appendChild(h));let r=t.cloneNode(!0);r.id||r.setAttribute(`id`,e),h.appendChild(r),v.add(e),l.add(e);let i=[r,...r.querySelectorAll(`*`)];for(let e of i){let t=c(e);if(t&&t.startsWith(`#`)){let e=t.slice(1).trim();e&&!l.has(e)&&!v.has(e)&&_.add(e)}let n=e.getAttribute?.(`style`)||``;n&&f(n,_);for(let t of o){let n=e.getAttribute?.(t);n&&f(n,_)}}}}s();function Rr(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,a=t.borderWidth;if(n!==`none`&&parseFloat(r)>0&&(i===`none`||parseFloat(a)===0)){let t=e.style.border;return e.style.border=`${r} solid transparent`,()=>{e.style.border=t}}return()=>{}}function zr(e){let t=[];try{let n=e.querySelectorAll(`*`);for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.style.contentVisibility||``,r=getComputedStyle(e),i=r.contentVisibility||r.getPropertyValue(`content-visibility`)||``;(i===`auto`||i===`hidden`)&&(t.push({el:e,original:n}),e.style.contentVisibility=`visible`)}if(e instanceof HTMLElement){let n=getComputedStyle(e),r=n.contentVisibility||n.getPropertyValue(`content-visibility`)||``;(r===`auto`||r===`hidden`)&&(t.push({el:e,original:e.style.contentVisibility||``}),e.style.contentVisibility=`visible`)}}catch{}return()=>{for(let{el:e,original:n}of t)try{e.style.contentVisibility=n}catch{}}}W(),B();function Br(e){return Hr(e.boxShadow)}function Vr(e){return Hr(e.textShadow)}function Hr(e){if(!e||e===`none`)return{top:0,right:0,bottom:0,left:0};let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?r++:a===`)`&&(r=Math.max(0,r-1)),a===`,`&&r===0?(t.push(n),n=``):n+=a}n.trim()&&t.push(n);let i=0,a=0,o=0,s=0;for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(\.\d+)?px/g)?.map(e=>parseFloat(e))||[];if(t.length<2)continue;let[n,r,c=0,l=0]=t,u=Math.abs(n)+c+l,d=Math.abs(r)+c+l;a=Math.max(a,u+Math.max(n,0)),s=Math.max(s,u+Math.max(-n,0)),o=Math.max(o,d+Math.max(r,0)),i=Math.max(i,d+Math.max(-r,0))}return{top:Math.ceil(i),right:Math.ceil(a),bottom:Math.ceil(o),left:Math.ceil(s)}}function Ur(e){let t=e.filter&&e.filter!==`none`?e.filter:e.webkitFilter||``,n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(t);)r+=parseFloat(i[1])||0;let a=Math.ceil(r);return{top:a,right:a,bottom:a,left:a}}function Wr(e){if((e.outlineStyle||`none`)===`none`)return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||`0`)||0),n=parseFloat(e.outlineOffset||`0`)||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function Gr(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 n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,a=0,o=0,s=!1;for(let e of n){s=!0;let[t=0,n=0,c=0]=e.match(/-?\d+(?:\.\d+)?px/gi)?.map(e=>parseFloat(e))||[],l=Math.abs(t)+c,u=Math.abs(n)+c;i=Math.max(i,l+Math.max(t,0)),o=Math.max(o,l+Math.max(-t,0)),a=Math.max(a,u+Math.max(n,0)),r=Math.max(r,u+Math.max(-n,0))}return{bleed:{top:Z(r),right:Z(i),bottom:Z(a),left:Z(o)},has:s}}function Kr(e,t){if(!e||!t||!t.style)return null;let n=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 r=n.transform||`none`;if(!r||r===`none`){let n=null;try{n=Yr(e).scale}catch{}try{t.style.transform=`none`}catch{}if(!n)return{a:1,b:0,c:0,d:1};let r=n.trim().split(/\s+/).map(parseFloat),i=Number.isFinite(r[0])?r[0]:1;return{a:i,b:0,c:0,d:Number.isFinite(r[1])?r[1]:i}}function i(e,t,n,r){let i=Math.sqrt(e*e+t*t)||0,a=0,o=0;if(i>0){let s=e/i,c=t/i;a=s*n+c*r;let l=n-s*a,u=r-c*a;o=Math.sqrt(l*l+u*u)||0,o>0?a/=o:a=0}return{a:i,b:0,c:a*o,d:o}}let a=r.match(/^matrix\(\s*([^)]+)\)$/i);if(a){let e=a[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===6&&e.every(Number.isFinite)){let[n,r,a,o]=e,s=i(n,r,a,o);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}}let o=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(o){let e=o[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===16&&e.every(Number.isFinite)){let n=e[0],r=e[1],a=e[4],o=e[5],s=i(n,r,a,o);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}}try{let e=new DOMMatrix(r),n=i(e.a,e.b,e.c,e.d);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return n}catch{return null}}function qr(e,t,n,r,i){let a=n.a,o=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(e,t){let n=e-r,d=t-i,f=a*n+s*d,p=o*n+c*d;return f+=r+l,p+=i+u,[f,p]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],p=1/0,m=1/0,h=-1/0,g=-1/0;for(let[e,t]of f)e<p&&(p=e),t<m&&(m=t),e>h&&(h=e),t>g&&(g=t);return{minX:p,minY:m,maxX:h,maxY:g,width:h-p,height:g-m}}function Jr(e,t,n){let r=(e.transformOrigin||`0 0`).trim().split(/\s+/),[i,a]=[r[0]||`0`,r[1]||`0`],o=(e,t)=>{let n=e.toLowerCase();return n===`left`||n===`top`?0:n===`center`?t/2:n===`right`||n===`bottom`?t:n.endsWith(`px`)?parseFloat(n)||0:n.endsWith(`%`)?(parseFloat(n)||0)*t/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:o(i,t),oy:o(a,n)}}function Yr(e){let t={rotate:`0deg`,scale:null,translate:null},n=typeof e.computedStyleMap==`function`?e.computedStyleMap():null;if(n){let r=e=>{try{return typeof n.has==`function`&&!n.has(e)||typeof n.get!=`function`?null:n.get(e)}catch{return null}},i=r(`rotate`);if(i)if(i.angle){let e=i.angle;t.rotate=e.unit===`rad`?e.value*180/Math.PI+`deg`:e.value+e.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 n=getComputedStyle(e);t.rotate=n.rotate&&n.rotate!==`none`?n.rotate:`0deg`}let a=r(`scale`);if(a){let e=`x`in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1;t.scale=`${e} ${`y`in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:e}`}else{let n=getComputedStyle(e);t.scale=n.scale&&n.scale!==`none`?n.scale:null}let o=r(`translate`);if(o){let e=`x`in o&&`value`in o.x?o.x.value:Array.isArray(o)?o[0]?.value:0,n=`y`in o&&`value`in o.y?o.y.value:Array.isArray(o)?o[1]?.value:0;t.translate=`${e}${`x`in o&&o.x?.unit?o.x.unit:`px`} ${n}${`y`in o&&o.y?.unit?o.y.unit:`px`}`}else{let n=getComputedStyle(e);t.translate=n.translate&&n.translate!==`none`?n.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!==`none`?r.rotate:`0deg`,t.scale=r.scale&&r.scale!==`none`?r.scale:null,t.translate=r.translate&&r.translate!==`none`?r.translate:null,t}var Xr=null;function Zr(){if(Xr)return Xr;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),Xr=e,e}function Qr(e){let t=Zr(),n=document.createElement(`div`);n.style.transformOrigin=`0 0`,e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=ei(n);return t.removeChild(n),r}function $r(e){let t=I(e),n=t.transform||`none`;if(n!==`none`&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&t.rotate!==`none`&&t.rotate!==`0deg`,i=t.scale&&t.scale!==`none`&&t.scale!==`1`,a=t.translate&&t.translate!==`none`&&t.translate!==`0px 0px`;return!!(r||i||a)}function ei(e){let t=getComputedStyle(e).transform;if(!t||t===`none`)return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}function ti(e,t){if(!t)return null;let n=e.ownerDocument||document,r=n.defaultView||window,i,a,o,s;if(t===`viewport`)i=0,a=0,o=n.documentElement?.clientWidth||r.innerWidth,s=n.documentElement?.clientHeight||r.innerHeight;else if(typeof t==`object`)i=(Number(t.x)||0)-(r.scrollX||0),a=(Number(t.y)||0)-(r.scrollY||0),o=Number(t.width),s=Number(t.height);else return null;return o>0&&s>0?{left:i,top:a,width:o,height:s,right:i+o,bottom:a+s}:null}function ni(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return t instanceof ShadowRoot?t.host:null}function ri(e,t){for(let n=t;n;n=ni(n))if(n===e)return!0;return!1}function ii(e,t){for(let n=ni(e);n&&n!==t&&n?.nodeType===1;n=ni(n)){let e=I(n);if(e.position!==`static`||e.transform&&e.transform!==`none`||e.filter&&e.filter!==`none`||e.backdropFilter&&e.backdropFilter!==`none`||e.perspective&&e.perspective!==`none`||/transform|perspective|filter/.test(e.willChange||``)||/layout|paint|strict|content/.test(e.contain||``))return n}return null}function ai(e,t){try{let n=new DOMMatrix;if(t&&t.rotate&&t.rotate!==`0deg`&&(n=n.multiply(new DOMMatrix(`rotate(${t.rotate})`))),t&&t.scale){let e=String(t.scale).trim().split(/\s+/).filter(Boolean);e.length&&e.every(e=>Number.isFinite(Number(e)))&&(n=n.multiply(new DOMMatrix(`scale(${e.join(`,`)})`)))}return e&&(n=n.multiply(new DOMMatrix(e))),n}catch{return null}}function oi(e,t,n,r,i){let a=e.getBoundingClientRect();t instanceof HTMLElement&&I(e).position===`static`&&(t.style.position=`relative`);let o=[];for(let[t,s]of n){if(!(t instanceof HTMLElement)||s?.nodeType!==1||s===e||!ri(e,s))continue;let n=r.get(s)||I(s),c=n.position;if(c!==`fixed`&&c!==`sticky`&&c!==`-webkit-sticky`||t.style.position===`absolute`)continue;let l=s.getBoundingClientRect();if(!(l.width>0&&l.height>0))continue;let u=n.transform&&n.transform!==`none`?n.transform:``,d=Yr(s),f=!!(u||d.rotate!==`0deg`||d.scale||d.translate),p=f?ai(u,d):null,m=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,h=l.width,g=l.height;m||(h=s.offsetWidth||l.width,g=s.offsetHeight||l.height);let _=s.getRootNode&&s.getRootNode()instanceof ShadowRoot,v=a,y=e.clientLeft||0,b=e.clientTop||0;if(_){let t=ii(s,e);t&&(v=t.getBoundingClientRect(),y=t.clientLeft||0,b=t.clientTop||0)}let x=l.left-v.left-y,S=l.top-v.top-b;if(f)if(t.style.translate=`none`,t.style.rotate=`none`,t.style.scale=`none`,m)t.style.transform=`none`;else{t.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:e,oy:r}=Jr(n,h,g),i=qr(h,g,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},e,r);x-=i.minX,S-=i.minY}if(c!==`fixed`){let e=t.cloneNode(!1);e.setAttribute(`data-snap-ph`,`1`),e.style.position=`static`,e.style.visibility=`hidden`,e.style.width=`${h}px`,e.style.height=`${g}px`,e.style.boxSizing=`border-box`,t.parentElement?.insertBefore(e,t)}let C=h+2,w=g;i&&(Math.abs(S-i.y)<.5&&(--S,w+=1),Math.abs(x-i.x)<.5&&(--x,C+=1)),t.style.position=`absolute`,t.style.left=`${x}px`,t.style.top=`${S}px`,t.style.right=`auto`,t.style.bottom=`auto`,t.style.margin=`0`,t.style.width=`${C}px`,t.style.height=`${w}px`,t.style.boxSizing=`border-box`,_||o.push(t)}for(let e of o)t.appendChild(e)}function si(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow=`none`}catch(e){U(n,`stripRootShadows boxShadow`,e)}try{t.style.textShadow=`none`}catch(e){U(n,`stripRootShadows textShadow`,e)}try{t.style.outline=`none`}catch(e){U(n,`stripRootShadows outline`,e)}let i=(r.filter||``).replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,``).trim().replace(/\s+/g,` `);try{t.style.filter=i.length?i:`none`}catch(e){U(n,`stripRootShadows filter`,e)}}function ci(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 n=e.overflowX||e.overflow||`visible`,r=e.overflowY||e.overflow||`visible`;return!!(n!==`visible`||r!==`visible`||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function li(e,t){let n=Array.from(e.childNodes),r=t===`top`?n:n.reverse();for(let e of r){if(e.nodeType===Node.TEXT_NODE){if(/\S/.test(e.textContent||``))return null;continue}if(e.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(e),n=String(t.display||``);if(!(n===`none`||n===`contents`)&&!(t.position===`absolute`||t.position===`fixed`))return t.float&&t.float!==`none`||n.startsWith(`inline`)?null:e}return null}function ui(e,t,n){if(!e||!t||!t.style)return;let r=getComputedStyle(e);if(!ci(r))for(let i of[`top`,`bottom`]){let a=i===`top`?`Top`:`Bottom`;if((parseFloat(r[`border${a}Width`])||0)>0||(parseFloat(r[`padding${a}`])||0)>0)continue;let o=e,s=t;for(;o&&s;){let e=li(o,i);if(!e)break;let t=n?Array.from(s.children).find(t=>n.get(t)===e)||null:s.children[Array.from(o.children).indexOf(e)]||null,r=getComputedStyle(e),c=parseFloat(r[`margin${a}`])||0;if(t&&t.style&&c>0&&(t.style[`margin${a}`]=`0px`),ci(r)||(parseFloat(r[`border${a}Width`])||0)>0||(parseFloat(r[`padding${a}`])||0)>0)break;o=e,s=t}}}function di(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let e of n)e.remove()}function fi(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set([`xml`,`xlink`]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let e=i.currentNode;for(let t of Array.from(e.attributes)){let i=t.name;if(i.startsWith(`*`)){e.removeAttribute(i);continue}if(i.includes(`@`)){e.removeAttribute(i);continue}if(i.includes(`:`)){let t=i.split(`:`,1)[0];if(!r.has(t)){e.removeAttribute(i);continue}}if(n&&(i.startsWith(`x-`)||i.startsWith(`v-`)||i.startsWith(`:`)||i.startsWith(`on:`)||i.startsWith(`bind:`)||i.startsWith(`let:`)||i.startsWith(`class:`))){e.removeAttribute(i);continue}}}}var pi=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function mi(e){if(!e)return;let t=e=>{if(e.nodeType===Node.ELEMENT_NODE){if(e.attributes)for(let t of Array.from(e.attributes)){let n=t.value.replace(pi,``);if(n!==t.value)try{e.setAttribute(t.name,n)}catch{}}}else if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.CDATA_SECTION_NODE){let t=e.data.replace(pi,``);t!==e.data&&(e.data=t)}};t(e);let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),r;for(;r=n.nextNode();)t(r)}function hi(e,t={}){e&&(fi(e,t),di(e),mi(e))}function gi(e){try{let t=e.getAttribute?.(`style`)||``;return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function _i(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function vi(e,t){if(e?.nodeType!==1||gi(e)||_i(e))return!1;let n=t.position;if(n===`absolute`||n===`fixed`||n===`sticky`)return!1;let r=t.display||``;return!(r.includes(`flex`)||r.includes(`grid`)||r.startsWith(`table`)||t.transform&&t.transform!==`none`)}function yi(e,t,n=new Map){function r(e,t){if(e?.nodeType!==1||t?.nodeType!==1)return;let i=e.childElementCount>t.childElementCount,a=n.get(e)||getComputedStyle(e);if(n.has(e)||n.set(e,a),i&&vi(e,a)){t.style.height||(t.style.height=`auto`),t.style.width||(t.style.width=`auto`),t.style.removeProperty(`block-size`),t.style.removeProperty(`inline-size`),t.style.minHeight||(t.style.minHeight=`0`),t.style.minWidth||(t.style.minWidth=`0`),t.style.maxHeight||(t.style.maxHeight=`none`),t.style.maxWidth||(t.style.maxWidth=`none`);let e=a.overflowY||a.overflowBlock||`visible`,n=a.overflowX||a.overflowInline||`visible`;(e!==`visible`||n!==`visible`)&&(t.style.overflow=`visible`)}let o=Array.from(e.children),s=Array.from(t.children);for(let e=0;e<Math.min(o.length,s.length);e++)r(o[e],s[e])}r(e,t)}function bi(e){let t=getComputedStyle(e);return!(t.display===`none`||t.position===`absolute`||t.position===`fixed`)}function xi(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 n of t.exclude)try{if(e.matches(n))return t.excludeMode===`remove`}catch(e){U(t,`exclude selector match failed`,e)}if(typeof t?.filter==`function`&&t.filterMode===`remove`)try{if(!t.filter(e))return!0}catch(e){U(t,`filter function failed`,e)}return!1}function Si(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,a=-1/0,o=!1,s=Array.from(e.children);for(let e of s){if(xi(e,t)||!bi(e))continue;let n=e.getBoundingClientRect(),s=n.top-r.top,c=n.bottom-r.top;c<=s||(s<i&&(i=s),c>a&&(a=c),o=!0)}let c=o?Math.max(0,a-i):0,l=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return l+u+d+f+c}var Z=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Ci=.75;function wi(e,t,n,r,i,a){let o=e.ownerDocument||document,s=e.getBoundingClientRect(),c=i>0&&s.width>0?s.width/i:1,l=a>0&&s.height>0?s.height/a:1;if(Math.abs(c-l)>.02)return 0;let u=o.createElement(`div`);u.setAttribute(`data-snapdom-internal`,``),u.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+i+`px!important;overflow:visible!important;visibility:hidden!important;`;let d=u.attachShadow({mode:`open`}),f=o.createElement(`style`);f.textContent=n,d.appendChild(f);let p=t.cloneNode(!0);d.appendChild(p),o.body.appendChild(u);let m=0;try{let e=(t,n)=>{let i=t.children,a=n.children,o=Math.min(i.length,a.length);for(let t=0;t<o;t++){let n=i[t],o=a[t],s=r.get(n);if(s?.nodeType===1&&n instanceof HTMLElement&&s.isConnected){let e=s.getBoundingClientRect();if(e.width>0&&e.height>0){let t=o.getBoundingClientRect(),r=t.width-e.width/c,i=t.height-e.height/l;(Math.abs(r)>Ci||Math.abs(i)>Ci)&&(n.style.boxSizing=`border-box`,n.style.width=`${Z(e.width/c)}px`,n.style.height=`${Z(e.height/l)}px`,m++)}}e(n,o)}};e(t,p)}finally{u.remove()}return m}var Ti=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Ei(e,t=new Set){let n=``;if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=Ei(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let e=Ei(i.cssRules,t);e&&(n+=`@media ${i.conditionText}{${e}}`);continue}if(i.type===CSSRule.STYLE_RULE){let e=i.selectorText||``;if(Ti.test(e)){let e=i.cssText;e&&!t.has(e)&&(t.add(e),n+=e)}}}catch{}}return n}var Di=new WeakMap;function Oi(e){let t=``;for(let n of e.styleSheets){let e=-1;try{e=n.cssRules?n.cssRules.length:-1}catch{}t+=(n.href||`inline`)+`:`+e+`|`}return t}function ki(e){if(!e||!e.styleSheets)return``;let t=Oi(e),n=Di.get(e);if(n&&n.fp===t)return n.css;let r=new Set,i=``;for(let t of Array.from(e.styleSheets))try{let e=t.cssRules;e&&(i+=Ei(e,r))}catch{}return Di.set(e,{fp:t,css:i}),i}async function Ai(e,t={}){let n=t.__session||o.session,r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:t},i=null;if(t.clip){let n=ti(e,t.clip);if(n){r.clip={rect:n,root:e};let t=e.getBoundingClientRect();i={x:n.left-t.left,y:n.top-t.top,width:n.width,height:n.height}}}let a,s=``,c=``,l=Rr(e),d=r.clip?()=>{}:zr(e);try{a=await hn(e,r,t)}catch(e){throw console.warn(`deepClone failed:`,e),e}finally{d(),l()}try{Lr(a)}catch(e){console.warn(`inlineExternal defs or symbol failed:`,e)}try{await Ir(e,a,r,t)}catch(e){console.warn(`inlinePseudoElements failed:`,e)}await an(a,r);try{let e=a.querySelectorAll(`style[data-sd]`);for(let t of e)c+=t.textContent||``,t.remove()}catch(e){U(r,`Failed to extract shadow CSS from style[data-sd]`,e)}let f=ee(r.styleMap);s=Array.from(f.entries()).map(([e,t])=>`.${t}{${e}}`).join(``),s=c+`[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}`+s;for(let[e,t]of r.styleMap.entries()){if(e.tagName===`STYLE`)continue;if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){e.setAttribute(`style`,t.replace(/;/g,`; `));continue}let n=f.get(t);n&&e.classList.add(n);let r=e.style?.backgroundImage,i=e.dataset?.snapdomHasIcon;r&&r!==`none`&&(e.style.backgroundImage=r),i&&(e.style.verticalAlign=`middle`,e.style.display=`inline`)}if((r.clip||e.scrollTop||e.scrollLeft)&&a?.nodeType===1)try{let t=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};oi(e,a,r.nodeMap,r.styleCache,t)}catch(e){U(r,`freezeViewportPositioned failed`,e)}for(let[t,n]of r.nodeMap.entries()){if(r.clip&&n===e)continue;let i=n.scrollLeft,a=n.scrollTop;if((i||a)&&t?.nodeType===1&&t.namespaceURI===`http://www.w3.org/1999/xhtml`){t.style.overflow=`hidden`,t.style.scrollbarWidth=`none`,t.style.msOverflowStyle=`none`;try{let e=t.querySelectorAll(`*`);for(let t of e){if(t.nodeType!==1||t.namespaceURI!==`http://www.w3.org/1999/xhtml`)continue;let e=t.style.position;if(e===`fixed`||e===`absolute`){let n=parseFloat(t.style.top)||0,r=parseFloat(t.style.left)||0;t.style.top=`${n+a}px`,t.style.left=`${r+i}px`,e===`fixed`&&(t.style.position=`absolute`)}}}catch{}let e=document.createElement(`div`);for(e.style.all=`unset`,e.style.transform=`translate(${-i}px, ${-a}px)`,e.style.willChange=`transform`,e.style.display=`inline-block`,e.style.width=`100%`;t.firstChild;)e.appendChild(t.firstChild);t.appendChild(e)}}if(e===r.nodeMap.get(a)){let t=r.styleCache.get(e)||I(e);r.styleCache.set(e,t);let n=u(t.transform);a.style.margin=`0`,a.style.top=`auto`,a.style.left=`auto`,a.style.right=`auto`,a.style.bottom=`auto`,a.style.animation=`none`,a.style.transition=`none`,a.style.willChange=`auto`,a.style.float=`none`,a.style.clear=`none`,a.style.transform=n||``}for(let[e,t]of r.nodeMap.entries())t.tagName===`PRE`&&(e.style.marginTop=`0`,e.style.marginBlockStart=`0`);return{clone:a,classCSS:s,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}E(),s();var ji=`http://www.w3.org/1999/xlink`;function Mi(e){return e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(ji,`href`):null)}function Ni(e){let t=parseInt(e.dataset?.snapdomWidth||``,10)||0,n=parseInt(e.dataset?.snapdomHeight||``,10)||0,r=parseInt(e.getAttribute(`width`)||``,10)||0,i=parseInt(e.getAttribute(`height`)||``,10)||0,a=parseFloat(e.style?.width||``)||0,o=parseFloat(e.style?.height||``)||0;return{width:t||a||r||e.width||e.naturalWidth||100,height:n||o||i||e.height||e.naturalHeight||100}}async function Pi(e,t={}){let n=Array.from(e.querySelectorAll(`img`));e.tagName===`IMG`&&n.unshift(e);let r=async e=>{if(!e.getAttribute(`src`)){let t=e.currentSrc||e.src||Ot(e.getAttribute(`srcset`),e)||``;t&&e.setAttribute(`src`,t)}e.removeAttribute(`srcset`),e.removeAttribute(`sizes`);let n=e.src||``;if(!n)return;let r=o.image?.get(n);if(r){e.src=r,e.width||(e.width=e.naturalWidth||100),e.height||(e.height=e.naturalHeight||100);return}let i=await S(n,{as:`dataURL`,useProxy:t.useProxy});if(i.ok&&typeof i.data==`string`&&i.data.startsWith(`data:`)){o.image?.set(n,i.data),e.src=i.data,e.width||(e.width=e.naturalWidth||100),e.height||(e.height=e.naturalHeight||100);return}let{width:a,height:s}=Ni(e),{fallbackURL:c}=t||{};if(c)try{let r=typeof c==`function`?await c({width:a,height:s,src:n,element:e}):c;if(r){let n=await S(r,{as:`dataURL`,useProxy:t.useProxy});if(n?.ok&&typeof n.data==`string`){e.src=n.data,e.width||(e.width=a),e.height||(e.height=s);return}}}catch{}if(t.placeholders!==!1){let t=document.createElement(`div`);t.style.cssText=[`width:${a}px`,`height:${s}px`,`background:#ccc`,`display:inline-block`,`text-align:center`,`line-height:${s}px`,`color:#666`,`font-size:12px`,`overflow:hidden`].join(`;`),t.textContent=`img`,e.replaceWith(t)}else{let t=document.createElement(`div`);t.style.cssText=`display:inline-block;width:${a}px;height:${s}px;visibility:hidden;`,e.replaceWith(t)}};for(let e=0;e<n.length;e+=6){let t=n.slice(e,e+6).map(r);await Promise.allSettled(t)}let i=Array.from(e.querySelectorAll(`image`));e.localName===`image`&&i.unshift(e);let a=async e=>{let n=Mi(e);if(!n||n.startsWith(`data:`)||n.startsWith(`blob:`))return;let r=await S(n,{as:`dataURL`,useProxy:t.useProxy});r.ok&&typeof r.data==`string`&&r.data.startsWith(`data:`)&&(e.setAttribute(`href`,r.data),e.removeAttribute(`xlink:href`),typeof e.removeAttributeNS==`function`&&e.removeAttributeNS(ji,`href`))};for(let e=0;e<i.length;e+=6){let t=i.slice(e,e+6).map(a);await Promise.allSettled(t)}}W(),s();var Fi=[`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`],Ii=[`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`],Li=[`background-position`,`background-position-x`,`background-position-y`,`background-size`,`background-repeat`,`background-origin`,`background-clip`,`background-attachment`,`background-blend-mode`],Ri=[`border-image-slice`,`border-image-width`,`border-image-outset`,`border-image-repeat`];async function zi(e,t,n,r){let i=n.get(e)||I(e);n.has(e)||n.set(e,i);let a=i.getPropertyValue(`border-image`),o=i.getPropertyValue(`border-image-source`),s=a&&a!==`none`||o&&o!==`none`,c=i.getPropertyValue(`background-image`),l=i.getPropertyValue(`background-color`);if(c&&c!==`none`||l&&l!==`rgba(0, 0, 0, 0)`&&l!==`transparent`||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue(`background`)||``))for(let e of Li){let n=i.getPropertyValue(e);n&&t.style.setProperty(e,n)}for(let e of Fi){let n=i.getPropertyValue(e);if(e===`background-image`&&(!n||n===`none`)){let e=i.getPropertyValue(`background`);e&&/url\s*\(/.test(e)&&(n=ne(e).filter(e=>/url\s*\(/.test(e)).join(`, `)||n)}if(!n||n===`none`)continue;let a=ne(n),o=await Promise.all(a.map(e=>D(e,r)));o.some(e=>e&&e!==`none`&&!/^url\(undefined/.test(e))&&t.style.setProperty(e,o.join(`, `))}for(let e of Ii){let n=i.getPropertyValue(e);!n||n===`initial`||t.style.setProperty(e,n)}if(s)for(let e of Ri){let n=i.getPropertyValue(e);!n||n===`initial`||t.style.setProperty(e,n)}}async function Bi(e,t,n,r={},i=o.session.nodeMap){if(!t)return;let a=[];e&&ot(e)&&a.push([e,t]);let s=[t];for(;s.length;){let e=s.pop();if(e.children)for(let t of e.children){if(t.tagName===`STYLE`)continue;let e=i.get(t);e&&ot(e)&&a.push([e,t]),s.push(t)}}for(let e=0;e<a.length;e+=6)await Promise.allSettled(a.slice(e,e+6).map(([e,t])=>zi(e,t,n,r)))}s(),W();function Vi(e,t,n=o.session.nodeMap){let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let e=i.currentNode;e;e=i.nextNode()){let i=n.get(e);if(i?.nodeType!==1)continue;let a=I(i),o=a.getPropertyValue(`backdrop-filter`)||a.getPropertyValue(`-webkit-backdrop-filter`);o&&o!==`none`&&e!==t&&r.push({cloneEl:e,orig:i,bf:o,path:Gi(t,e)})}if(!r.length)return;let a=e.getBoundingClientRect(),s=r.map((e,i)=>{let a=t.cloneNode(!0);Wi(a,t,e.orig.getBoundingClientRect(),n),qi(Ki(a,e.path));for(let e=0;e<i;e++){let t=Ki(a,r[e].path);t&&(t.style.setProperty(`backdrop-filter`,`none`,`important`),t.style.setProperty(`-webkit-backdrop-filter`,`none`,`important`))}return{...e,copy:a}});for(let{cloneEl:e,orig:t,bf:n,copy:r}of s)Hi(e,t,n,r,a)}function Hi(e,t,n,r,i){let a=t.getBoundingClientRect();if(!a.width||!a.height)return;let o=I(t),s=t.offsetWidth?a.width/t.offsetWidth:1,c=Math.abs(s-1)>.001?1/s:1;r.style.position=`absolute`,r.style.left=`${(i.left-a.left)*c}px`,r.style.top=`${(i.top-a.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin=`0`,r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin=`top left`);let l=document.createElement(`div`);l.style.cssText=`position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2`,l.appendChild(r);let u=document.createElement(`div`);u.style.cssText=`position:absolute;inset:0;border-radius:inherit;z-index:-1`,u.style.backgroundColor=o.backgroundColor,u.style.backgroundImage=e.style.backgroundImage||o.backgroundImage;for(let e of[`background-size`,`background-position`,`background-repeat`,`background-origin`,`background-clip`])u.style.setProperty(e,o.getPropertyValue(e));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`),o.position===`static`&&(e.style.position=`relative`),e.style.isolation=`isolate`,e.prepend(u),e.prepend(l)}var Ui=128;function Wi(e,t,n,r){let i=[[e,t]];for(;i.length;){let[e,t]=i.pop(),a=r.get(t);if(a?.nodeType===1){let t=a.getBoundingClientRect();(t.left>n.right+Ui||t.right<n.left-Ui||t.top>n.bottom+Ui||t.bottom<n.top-Ui)&&(e.tagName===`IMG`&&e.setAttribute(`src`,`data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=`),e.style&&(e.style.backgroundImage=`none`))}let o=e.children,s=t.children;for(let e=0;e<o.length;e++)i.push([o[e],s[e]])}}function Gi(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Ki(e,t){if(!t)return null;let n=e;for(let e of t)if(n=n.children[e],!n)return null;return n}function qi(e){if(e)for(let t=e;t&&t.parentNode;){let n=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=n}}W(),s();function Ji(e,t){if(!e)return()=>{};let n=[];function r(e){if(t){let n=e.getBoundingClientRect();if(n.width>0||n.height>0){let r=Math.max(n.right,n.left+(e.scrollWidth||0)),i=Math.max(n.bottom,n.top+(e.scrollHeight||0));if(r<t.left-200||n.left>t.right+200||i<t.top-200||n.top>t.bottom+200)return}}let i=getComputedStyle(e),a=Yi(e,i);a&&n.push(a);let o=Xi(e,i);o&&n.push(o);for(let t of e.children||[])r(t)}return r(e),()=>n.forEach(e=>e())}function Yi(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let n=Zi(t);if(n<=0||!ea(e))return()=>{};let r=e.textContent??``,i=r,a=$i(t);e.textContent=`X`;let o=e.scrollHeight-a;e.textContent=r;let s=o>0?o:Qi(t),c=Math.round(s*n+a);if(e.scrollHeight<=c+.5)return()=>{};let l=0,u=r.length,d=-1;for(;l<=u;){let t=l+u>>1;e.textContent=r.slice(0,t)+`…`,e.scrollHeight<=c+.5?(d=t,l=t+1):u=t-1}return e.textContent=(d>=0?r.slice(0,d):``)+`…`,()=>{e.textContent=i}}function Xi(e,t){if(!e||(t=t||getComputedStyle(e),t.textOverflow!==`ellipsis`)||t.whiteSpace!==`nowrap`&&t.whiteSpace!==`pre`||t.overflowX!==`hidden`&&t.overflowX!==`clip`||!ea(e)||e.scrollWidth<=e.clientWidth+.5)return()=>{};let n=e.textContent??``,r=n,i=0,a=n.length,o=-1;for(;i<=a;){let t=i+a>>1;e.textContent=n.slice(0,t)+`…`,e.scrollWidth<=e.clientWidth+.5?(o=t,i=t+1):a=t-1}return e.textContent=(o>=0?n.slice(0,o):``)+`…`,()=>{e.textContent=r}}function Zi(e){let t=e.getPropertyValue(`-webkit-line-clamp`)||e.getPropertyValue(`line-clamp`);t=(t||``).trim();let n=parseInt(t,10);return Number.isFinite(n)&&n>0?n:0}function Qi(e){let t=(e.lineHeight||``).trim(),n=parseFloat(e.fontSize)||16;return!t||t===`normal`?Math.round(n*1.2):t.endsWith(`px`)?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith(`%`)?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function $i(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function ea(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var ta=[];function na(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t==`function`?t(n):t}if(typeof e==`object`&&`plugin`in e){let{plugin:t,options:n}=e;return typeof t==`function`?t(n):t}return typeof e==`function`?e():e}function ra(...e){let t=e.flat();for(let e of t){let t=na(e);t&&(ta.some(e=>e&&e.name&&t.name&&e.name===t.name)||ta.push(t))}}function ia(e){return e&&Array.isArray(e.plugins)?e.plugins:ta}async function Q(e,t,n){let r=n,i=ia(t);for(let n of i){let i=n&&typeof n[e]==`function`?n[e]:null;if(!i)continue;let a=await i(t,r);typeof a<`u`&&(r=a)}return r}async function aa(e,t,n){let r=[],i=ia(t);for(let a of i){let i=a&&typeof a[e]==`function`?a[e]:null;if(!i)continue;let o=await i(t,n);typeof o<`u`&&r.push(o)}return r}function oa(e){let t=[];if(Array.isArray(e))for(let n of e){let e=na(n);if(!e||!e.name)continue;let r=t.findIndex(t=>t&&t.name===e.name);r>=0&&t.splice(r,1),t.push(e)}for(let e of ta)e&&e.name&&!t.some(t=>t.name===e.name)&&t.push(e);return Object.freeze(t)}function sa(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=oa(t)),e}function ca(){return ta.slice()}s();var la=.92,ua=.95;async function da(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((e,n)=>{t.onload=()=>e(),t.onerror=n}),t}function fa(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:``}async function pa(e,t,n){if(typeof e!=`string`||!e.startsWith(`data:image`)||e.startsWith(`data:image/svg`))return null;let r=e.length+`:`+e.slice(0,64)+e.slice(-64)+`:`+Math.round(t)+`x`+Math.round(n);if(o.compress.has(r))return o.compress.get(r);let i=await(async()=>{let r;try{r=await da(e)}catch{return null}let i=r.naturalWidth||r.width,a=r.naturalHeight||r.height;if(!i||!a)return null;let o=Math.min(1,Math.max(t/i,n/a));if(!(o>0)||o>=.95)return null;let s=o*ua,c=Math.max(1,Math.round(i*s)),l=Math.max(1,Math.round(a*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)return null;d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(r,0,0,c,l);let f=fa(e),p=f===`image/jpeg`?`image/jpeg`:f===`image/webp`?`image/webp`:`image/png`;try{let t=u.toDataURL(p,la);if(typeof t==`string`&&t.startsWith(`data:image`)&&t.length<e.length)return t}catch{}return null})();return o.compress.set(r,i),i}async function ma(e,t){if(!t.compress)return{count:0,before:0,after:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll(`img`));e.tagName===`IMG`&&r.unshift(e);let i=0,a=0,o=0,s=async e=>{let t=e.getAttribute(`src`)||``;if(!t.startsWith(`data:image`)||t.startsWith(`data:image/svg`))return;let r=parseFloat(e.dataset.snapdomWidth)||parseFloat(e.style.width)||e.width||0,s=parseFloat(e.dataset.snapdomHeight)||parseFloat(e.style.height)||e.height||0;if(!r||!s)return;let c=await pa(t,r*n,s*n);c&&(i++,a+=t.length,o+=c.length,e.setAttribute(`src`,c))};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(s));return{count:i,before:a,after:o}}function ha(e){return{w:e.offsetWidth||e.getBoundingClientRect().width||0,h:e.offsetHeight||e.getBoundingClientRect().height||0}}async function ga(e,t,n=o.session.nodeMap){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),i=[],a=[e,...e.querySelectorAll(`*`)];for(let e of a){let t=e.style&&e.style.backgroundImage;t&&t.includes(`data:image`)&&i.push(e)}let s=0,c=async e=>{let t=n.get(e);if(!t||!t.isConnected)return;let i;try{i=getComputedStyle(t)}catch{return}if((i.backgroundRepeat||`repeat`).toLowerCase().split(`,`).some(e=>e.trim()!==`no-repeat`))return;let{w:a,h:o}=ha(t);if(!a||!o)return;let c=a*r,l=o*r,u=e.style.backgroundImage,d=[...u.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],f=u;for(let e of d){let t=e[2];if(t.startsWith(`data:image/svg`))continue;let n=await pa(t,c,l);n&&(f=f.split(t).join(n),s++)}f!==u&&(e.style.backgroundImage=f)};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(c));return{count:s}}async function _a(e,t){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll(`image`));e.localName===`image`&&r.unshift(e);let i=0,a=async e=>{let t=e.getAttribute(`href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(!t||!t.startsWith(`data:image`)||t.startsWith(`data:image/svg`))return;let r=parseFloat(e.getAttribute(`width`))||0,a=parseFloat(e.getAttribute(`height`))||0;if(!r||!a)return;let o=await pa(t,r*n,a*n);o&&(e.setAttribute(`href`,o),e.hasAttribute(`xlink:href`)&&e.setAttribute(`xlink:href`,o),i++)};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(a));return{count:i}}async function va(e,t,n){t.compress&&(await ma(e,t),await ga(e,t,n),await _a(e,t))}function ya(e){if(Array.isArray(e.plugins)){for(let t of e.plugins)if(na(t)?.name===`picture-resolver`)return!0}return ca().some(e=>e?.name===`picture-resolver`)}function ba(e){let t=Array.isArray(e.plugins)?e.plugins:ca(),n=[];for(let e of t){let t=na(e);t&&typeof t.resolveNode==`function`&&n.push(t.resolveNode.bind(t))}return n.length?n:null}var xa=2e3,Sa=3;function Ca(e){let t=Date.now(),n=o.burstAdvice.get(e);if(!n||t-n.firstTs>xa){o.burstAdvice.set(e,{count:1,firstTs:t,warned:!1});return}n.count++,n.count>=Sa&&!n.warned&&(n.warned=!0,console.warn(`[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed.`))}async function wa(e,t){if(!e)throw Error(`Element cannot be null or undefined`);i(t.cache),t.__session={styleMap:o.session.styleMap,styleCache:o.session.styleCache,nodeMap:o.session.nodeMap},t.burst||Ca(e),t.__resolveNodeHooks=ba(t);let n=t.fast,r=t.outerTransforms!==!1,a=!!t.outerShadows,s=t.clip?ti(e,t.clip):null,c={element:e,options:t,plugins:t.plugins},l,u,d,f,p,m,h=``,g=``,_,v,y=null;await Q(`beforeSnap`,c);let b=null;t.resolvePicturePlaceholders!==!1&&!ya(t)&&(b=await Mt(c.element,c.options)),await Q(`beforeClone`,c);let x=Ji(c.element,s);try{({clone:l,classCSS:u,styleCache:d,nodeMap:f,reconcileRisk:p,clipWindow:m}=await Ai(c.element,c.options)),p>0&&!t.reconcile&&!o.warnedReconcile&&(o.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).`)),!r&&l&&(y=Kr(c.element,l)),!a&&l&&si(c.element,l,c.options),l&&ui(c.element,l,f)}finally{x()}if(c={clone:l,classCSS:u,styleCache:d,nodeMap:f,...c},await Q(`afterClone`,c),b&&await b(),hi(c.clone),c.options?.excludeMode===`remove`||c.options?.filterMode===`remove`)try{yi(c.element,c.clone,c.styleCache)}catch(e){console.warn(`[snapdom] shrink pass failed:`,e)}try{await Nn(c.clone,c.element,c.nodeMap)}catch{}let S=e=>new Promise((t,r)=>{fe(()=>{Promise.resolve().then(e).then(t,r)},{fast:n})}),C=(async()=>{await Promise.all([S(()=>Pi(c.clone,c.options)),S(()=>Bi(c.element,c.clone,c.styleCache,c.options,c.nodeMap))]);try{Vi(c.element,c.clone,c.nodeMap)}catch(e){console.warn(`[snapdom] backdrop-filter emulation failed:`,e)}t.compress&&await S(()=>va(c.clone,c.options,c.nodeMap))})(),w=Promise.resolve();t.embedFonts&&(w=S(async()=>{let e=c.element.ownerDocument||document,t=s?e=>{try{let t=e.getBoundingClientRect();return t.right>=s.left-200&&t.left<=s.right+200&&t.bottom>=s.top-200&&t.top<=s.bottom+200}catch{return!0}}:null,{required:n,usedCodepoints:r}=pr(c.element,t);V()&&await hr(new Set(Array.from(n).map(e=>String(e).split(`__`)[0]).filter(Boolean)),1,e),h=await fr({required:n,usedCodepoints:r,preCached:!1,exclude:c.options.excludeFonts,localFonts:c.options.localFonts,useProxy:c.options.useProxy,fontStylesheetDomains:c.options.fontStylesheetDomains,doc:e})})),await Promise.all([C,w]);let T=N(c.clone).sort(),E=T.join(`,`);o.baseStyle.has(E)?g=o.baseStyle.get(E):await new Promise(e=>{fe(()=>{g=P(T),o.baseStyle.set(E,g),e()},{fast:n})});let D=ki(c.element?.ownerDocument||document);c={fontsCSS:h,baseCSS:g,scrollbarCSS:D,...c},await Q(`beforeRender`,c),await new Promise(e=>{fe(()=>{let n=I(c.element),i=c.element.getBoundingClientRect(),s=Math.max(1,Z(c.element.offsetWidth||parseFloat(n.width)||i.width||1)),l=Math.max(1,Z(c.element.offsetHeight||parseFloat(n.height)||i.height||1)),u=c.element.ownerDocument||document;if(!m&&(c.element===u.body||c.element===u.documentElement)&&!u.documentElement.hasAttribute(`data-sd-pinned`)){let e=Math.max(c.element.scrollHeight||0,u.documentElement?.scrollHeight||0,u.body?.scrollHeight||0),t=Math.max(c.element.scrollWidth||0,u.documentElement?.scrollWidth||0,u.body?.scrollWidth||0);e>0&&(l=Math.max(l,Z(e))),t>0&&(s=Math.max(s,Z(t)));try{let e=(c.scrollbarCSS||``).length+(c.baseCSS||``).length+(c.fontsCSS||``).length+(c.classCSS||``).length,t=o.measureHints.get(c.element);if(t&&t.cssLen===e&&t.w0===s)t.csh>0&&(l=Math.max(l,Z(t.csh))),t.csw>0&&(s=Math.max(s,Z(t.csw)));else{let t=u.createElement(`div`);t.setAttribute(`data-snapdom-internal`,``),t.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+s+`px!important;overflow:visible!important;visibility:hidden!important;`;let n=t.attachShadow({mode:`open`}),r=u.createElement(`style`);r.textContent=(c.scrollbarCSS||``)+c.baseCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+c.classCSS,n.appendChild(r),n.appendChild(c.clone.cloneNode(!0)),u.body.appendChild(t);let i=t.scrollHeight,a=t.scrollWidth;u.body.removeChild(t),o.measureHints.set(c.element,{cssLen:e,w0:s,csh:i,csw:a}),i>0&&(l=Math.max(l,Z(i))),a>0&&(s=Math.max(s,Z(a)))}}catch{}}if(c.options?.excludeMode===`remove`||c.options?.filterMode===`remove`){let e=Si(c.element,c.options);Number.isFinite(e)&&e>0&&(l=Math.max(1,Math.min(l,Z(e+1))))}if(c.options?.reconcile)try{let e=(c.scrollbarCSS||``)+c.baseCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+c.classCSS;wi(c.element,c.clone,e,c.nodeMap,s,l)}catch(e){console.warn(`[snapdom] reconcile pass failed:`,e)}let d=(e,t=NaN)=>{let n=typeof e==`string`?parseFloat(e):e;return Number.isFinite(n)?n:t},f=d(c.options.width),p=d(c.options.height),h=m?Z(m.width):s,g=m?Z(m.height):l,b=h,x=g,S=Number.isFinite(f),C=Number.isFinite(p),w=g>0?h/g:1;S&&C?(b=Math.max(1,Z(f)),x=Math.max(1,Z(p))):S?(b=Math.max(1,Z(f)),x=Math.max(1,Z(b/(w||1)))):C&&(x=Math.max(1,Z(p)),b=Math.max(1,Z(x*(w||1))));let T=0,E=0,D=s,O=l;if(m){let e=0,t=0;if(Ta(c.element)){let i=null;if(!r&&y&&Number.isFinite(y.a))i={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0};else{let e=Yr(c.element),t=ai(n.transform&&n.transform!==`none`?n.transform:``,e);t&&t.is2D&&(i={a:t.a,b:t.b,c:t.c,d:t.d,e:0,f:0})}if(i&&!(i.a===1&&i.b===0&&i.c===0&&i.d===1)){let{ox:r,oy:a}=Jr(n,s,l),o=qr(s,l,i,r,a);e=o.minX,t=o.minY}}T=Z(m.x+e),E=Z(m.y+t),D=Z(T+m.width),O=Z(E+m.height)}else if(!r&&y&&Number.isFinite(y.a)){let e={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0},t=qr(s,l,e,0,0);T=Z(t.minX),E=Z(t.minY),D=Z(t.maxX),O=Z(t.maxY)}else if(r&&Ta(c.element)){let e=n.transform&&n.transform!==`none`?n.transform:``,t=Yr(c.element),r=Qr({baseTransform:e,rotate:t.rotate||`0deg`,scale:t.scale,translate:t.translate}),{ox:i,oy:a}=Jr(n,s,l),o=r.is2D?r:new DOMMatrix(r.toString()),u={a:o.a,b:o.b,c:o.c,d:o.d,e:0,f:0},d=qr(s,l,u,i,a);T=Z(d.minX),E=Z(d.minY),D=Z(d.maxX),O=Z(d.maxY)}let k=Br(n),A=Vr(n),j=Ur(n),M=Wr(n),N=Gr(n),P=m?{top:0,right:0,bottom:0,left:0}:a?{top:Z(Math.max(k.top,A.top)+j.top+M.top+N.bleed.top),right:Z(Math.max(k.right,A.right)+j.right+M.right+N.bleed.right),bottom:Z(Math.max(k.bottom,A.bottom)+j.bottom+M.bottom+N.bleed.bottom),left:Z(Math.max(k.left,A.left)+j.left+M.left+N.bleed.left)}:{top:j.top,right:j.right,bottom:j.bottom,left:j.left};T=Z(T-P.left),E=Z(E-P.top),D=Z(D+P.right),O=Z(O+P.bottom);let ee=Math.max(1,Z(D-T)),F=Math.max(1,Z(O-E)),te=S||C?Z(b/h):1,ne=C||S?Z(x/g):1,re=Math.max(1,Z(ee*te)),ie=Math.max(1,Z(F*ne)),ae=`http://www.w3.org/2000/svg`,L=Z((Ta(c.element)?2:0)+ +!r),R=Math.ceil(ee+L*2),z=Math.ceil(F+L*2),oe=Z(-(Z(T)-L)),se=Z(-(Z(E)-L)),ce=Math.max(0,oe),le=Math.max(0,se),ue=Z(R-Math.min(0,oe)),de=Z(z-Math.min(0,se)),B=document.createElementNS(ae,`foreignObject`);B.setAttribute(`x`,String(Math.min(0,oe))),B.setAttribute(`y`,String(Math.min(0,se))),B.setAttribute(`width`,String(ue)),B.setAttribute(`height`,String(de)),B.style.overflow=`visible`;let fe=document.createElement(`style`);fe.textContent=(c.scrollbarCSS||``)+c.baseCSS+c.fontsCSS+`svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}`+c.classCSS,B.appendChild(fe);let pe=document.createElement(`div`);pe.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),pe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ue}px;height:${de}px`+(ce!==0||le!==0?`;padding:${le}px 0 0 ${ce}px !important`:``),pe.appendChild(c.clone),B.appendChild(pe);let me=new XMLSerializer().serializeToString(B),H=S||C;t.meta={w0:h,h0:g,vbW:R,vbH:z,targetW:b,targetH:x},v=`<svg xmlns="${ae}" width="${!H||V()?R:Z(re+L*2)}" height="${!H||V()?z:Z(ie+L*2)}" viewBox="0 0 ${R} ${z}" font-size="${parseFloat(I(u.documentElement)?.fontSize)||16}px">`+me+`</svg>`,_=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(v)}`,c={svgString:v,dataURL:_,...c},e()},{fast:n})}),await Q(`afterRender`,c);let O=document.getElementById(`snapdom-sandbox`);return O&&O.style.position===`absolute`&&O.remove(),c.dataURL}function Ta(e){return $r(e)}s();function Ea(e={}){let t=e.format??`png`;t===`jpg`&&(t=`jpeg`);let n=r(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:n,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:{}}}H(),he();var Da=new WeakMap;function Oa(e,t,n){let r=new Set;if(e instanceof HTMLVideoElement&&r.add(e),e.querySelectorAll)for(let t of e.querySelectorAll(`video`))r.add(t);for(let e of t.trackedVideos)r.has(e)||(e.removeEventListener(`timeupdate`,n),e.removeEventListener(`seeked`,n),t.trackedVideos.delete(e));for(let e of r)t.trackedVideos.has(e)||(e.addEventListener(`timeupdate`,n),e.addEventListener(`seeked`,n),t.trackedVideos.add(e))}function ka(e){let t={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},n=e=>{t.capturing||nt(e)&&(t.dirty=!0)},r=()=>{t.capturing||(t.dirty=!0)},i=e.ownerDocument||document;try{let r=new MutationObserver(n);r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),t.observers.push(r)}catch{}try{if(i.head){let e=new MutationObserver(n);e.observe(i.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),t.observers.push(e)}}catch{}return t.markDirty=n,t.onMediaDirty=r,Oa(e,t,r),t}function Aa(e){let{burst:t,invalidate:n,...r}=e||{};try{return JSON.stringify(r,Object.keys(r).sort())}catch{return null}}function ja(e,t,n,r){let i=Da.get(e);i||(i=ka(e),i.baselineSignature=Aa(t),Da.set(e,i));let a=Aa(t),o=a===null||a!==i.baselineSignature,s=async()=>{for(let e of i.observers)i.markDirty(e.takeRecords());if(n.invalidate&&(i.dirty=!0),!o&&!i.dirty&&i.last)return i.last;i.capturing=!0,o||(i.dirty=!1);try{let e=await r();return o||(i.last=e),e}finally{for(let e of i.observers)e.takeRecords();i.capturing=!1,Oa(e,i,i.onMediaDirty)}},c=i.inflight.then(s,s);return i.inflight=c.catch(()=>{}),c}W(),E(),s();function Ma(...e){return ra(...e),$}var $=Object.assign(Fa,{plugins:Ma}),Na=Symbol(`snapdom.internal`),Pa=Symbol(`snapdom.internal.silent`);async function Fa(e,t){if(!e)throw Error(`Element cannot be null or undefined`);let n=Ea(t);if(sa(n,t&&t.plugins),V()){if(n.embedFonts===!0)try{let t=mr(e);await hr(new Set([...t].map(e=>String(e).split(`__`)[0]).filter(Boolean)),1)}catch{}let r=Array.from(e.querySelectorAll(`canvas`));e.tagName===`CANVAS`&&r.unshift(e);for(let e of r)try{let t=e.getContext(`2d`,{willReadFrequently:!0});t&&t.getImageData(0,0,1,1)}catch(e){U(t,`safari canvas poke failed`,e)}}return n.iconFonts&&n.iconFonts.length>0&&Tn(n.iconFonts),n.snap||(n.snap={toPng:(e,t)=>$.toPng(e,t),toSvg:(e,t)=>$.toSvg(e,t)}),n.burst?ja(e,t,n,()=>$.capture(e,n,Na)):$.capture(e,n,Na)}$.capture=async(e,t,n)=>{if(n!==Na)throw Error(`[snapdom.capture] is internal. Use snapdom(...) instead.`);let r=await wa(e,t),i={img:async(e,t)=>{let{toImg:n}=await Promise.resolve().then(()=>(Ve(),ze));return n(r,{...e,...t||{}})},svg:async(e,t)=>{let{toSvg:n}=await Promise.resolve().then(()=>(Ve(),ze));return n(r,{...e,...t||{}})},canvas:async(e,t)=>{let{toCanvas:n}=await Promise.resolve().then(()=>(Fe(),ge));return n(r,{...e,...t||{}})},blob:async(e,t)=>{let{toBlob:n}=await Promise.resolve().then(()=>(We(),He));return n(r,{...e,...t||{}})},png:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Re(),Ie));return n(r,{...e,...t||{},format:`png`})},jpeg:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Re(),Ie));return n(r,{...e,...t||{},format:`jpeg`})},webp:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Re(),Ie));return n(r,{...e,...t||{},format:`webp`})},download:async(e,t)=>{let{download:n}=await Promise.resolve().then(()=>(Je(),Ge));return n(r,{...e,...t||{}})}},a={};for(let e of[`img`,`svg`,`canvas`,`blob`,`png`,`jpeg`,`webp`])a[e]=async n=>i[e](t,{...n||{},[Pa]:!0});a.jpg=a.jpeg;let o=await aa(`defineExports`,{...t,export:{url:r},exports:a}),s=Object.assign({},...o.filter(e=>e&&typeof e==`object`).reverse()),c={...i,...s};c.jpeg&&!c.jpg&&(c.jpg=(e,t)=>c.jpeg(e,t));function l(e,n){let r={...t,...n||{}};return[e,r.format,r.type].map(e=>typeof e==`string`?e.toLowerCase():``).find(e=>e===`jpeg`||e===`jpg`||e===`webp`)&&(r.backgroundColor==null||r.backgroundColor===`transparent`)&&(r.backgroundColor=`#ffffff`),r}let u=!1,d=Promise.resolve();async function f(e,n){let i=d.then(async()=>{let i=c[e];if(!i)throw Error(`[snapdom] Unknown export type: ${e}`);let a=l(e,n),o={...t,export:{type:e,options:a,url:r}};await Q(`beforeExport`,o,{format:e,options:a});let s=await i(o,a);return await Q(`afterExport`,o,{format:e,options:a,result:s}),u||(u=!0,await Q(`afterSnap`,t)),s});return d=i.catch(()=>{}),i}let p={url:r,toRaw:()=>r,to:(e,t)=>f(e,t),toImg:e=>f(`img`,e),toSvg:e=>f(`svg`,e),toCanvas:e=>f(`canvas`,e),toBlob:e=>f(`blob`,e),toPng:e=>f(`png`,e),toJpg:e=>f(`jpg`,e),toWebp:e=>f(`webp`,e),download:e=>f(`download`,e)};for(let e of Object.keys(c)){let t=`to`+e.charAt(0).toUpperCase()+e.slice(1);p[t]||(p[t]=t=>f(e,t))}return p},$.toRaw=(e,t)=>$(e,t).then(e=>e.toRaw()),$.toImg=(e,t)=>$(e,t).then(e=>e.toImg()),$.toSvg=(e,t)=>$(e,t).then(e=>e.toSvg()),$.toCanvas=(e,t)=>$(e,t).then(e=>e.toCanvas()),$.toBlob=(e,t)=>$(e,t).then(e=>e.toBlob()),$.toPng=(e,t)=>$(e,{...t,format:`png`}).then(e=>e.toPng()),$.toJpg=(e,t)=>$(e,{...t,format:`jpeg`}).then(e=>e.toJpg()),$.toWebp=(e,t)=>$(e,{...t,format:`webp`}).then(e=>e.toWebp()),$.download=(e,t)=>$(e,t).then(e=>e.download());export{$ as t}; |