@supportwire/messenger-js-sdk 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -0
- package/dist/index-bfV4xNqW-CRQbrL80.js +1092 -0
- package/dist/index-bfV4xNqW-CRQbrL80.js.map +1 -0
- package/dist/index-bfV4xNqW-ChZOGalc.cjs +162 -0
- package/dist/index-bfV4xNqW-ChZOGalc.cjs.map +1 -0
- package/dist/index.cjs +921 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +149 -0
- package/dist/index.js +2646 -0
- package/dist/index.js.map +1 -0
- package/dist/snapdom-6yvsn_Iv-6uiY9rZc.js +3373 -0
- package/dist/snapdom-6yvsn_Iv-6uiY9rZc.js.map +1 -0
- package/dist/snapdom-6yvsn_Iv-OVmChxqF.cjs +9 -0
- package/dist/snapdom-6yvsn_Iv-OVmChxqF.cjs.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var In=Object.defineProperty,On=Object.defineProperties,Un=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,Se=(t,e,n)=>e in t?In(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,O=(t,e)=>{for(var n in e||(e={}))jn.call(e,n)&&Se(t,n,e[n]);if(ve)for(var n of ve(e))_n.call(e,n)&&Se(t,n,e[n]);return t},J=(t,e)=>On(t,Un(e)),Hn=Object.defineProperty,nt=(t,e)=>()=>(t&&(e=t(t=0)),e),Pt=(t,e)=>{for(var n in e)Hn(t,n,{get:e[n],enumerable:!0})};function Dn(t){if(t===!0)return"soft";if(t===!1)return"disabled";if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="auto")return"auto";if(e==="full")return"full";if(e==="soft"||e==="disabled")return e}return"soft"}function Bn(t="soft"){switch(k.session.__counterEpoch=(k.session.__counterEpoch||0)+1,t){case"auto":{k.session.styleMap=new Map,k.session.nodeMap=new Map;return}case"soft":{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap,k.computedStyle=new WeakMap,k.baseStyle=new rt(50),k.defaultStyle=new rt(30),k.image=new rt(100),k.background=new rt(100),k.resource=new rt(150),k.font=new Set;return}default:{k.session.styleMap=new Map,k.session.nodeMap=new Map,k.session.styleCache=new WeakMap;return}}}var rt,k,it=nt(()=>{rt=class extends Map{constructor(t=100,...e){super(...e),this._maxSize=t}set(t,e){if(this.size>=this._maxSize&&!this.has(t)){let n=this.keys().next().value;n!==void 0&&this.delete(n)}return super.set(t,e)}},k={image:new rt(100),background:new rt(100),resource:new rt(150),defaultStyle:new rt(30),baseStyle:new rt(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function de(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Vn(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let l=r.split(",").map(i=>i.trim());return l.length!==6?`matrix(${r})`:(l[4]="0",l[5]="0",`matrix(${l.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let l=r.split(",").map(i=>i.trim());return l.length!==16?`matrix3d(${r})`:(l[12]="0",l[13]="0",`matrix3d(${l.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function Bt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function qn(t,e){var n;if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let r=e||typeof document<"u"&&(document.baseURI||((n=document.location)==null?void 0:n.href))||"http://localhost/";return new URL(t,r).href}catch{return t}}var qt=nt(()=>{});function zn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,l=0;function i(o,a,s){if(l>=n)return;let c=Date.now();(r.get(a)||0)>c||(r.set(a,c+e),l++,o==="warn"&&console&&console.warn?console.warn(`${t} ${s}`):console&&console.error&&console.error(`${t} ${s}`))}return{warnOnce(o,a){i("warn",o,a)},errorOnce(o,a){i("error",o,a)},reset(){r.clear(),l=0}}}function Xn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Yn(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,l=new URL(r||".",n),i=new URL(t,n);if(i.origin===l.origin)return!0;let o=i.searchParams;if(o&&(o.has("url")||o.has("target")))return!0}catch{}return!1}function Gn(t,e){if(!e||Xn(t)||Yn(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Jn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",Bt(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${Bt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Ce(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Kn(t,e){var n,r;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(r=e.errorTTL)!=null?r:8e3,t].join("|")}async function lt(t,e={}){var n,r,l;let i=(n=e.as)!=null?n:"blob",o=(r=e.timeout)!=null?r:3e3,a=e.useProxy||"",s=(l=e.errorTTL)!=null?l:8e3,c=e.headers||{},h=!!e.silent;if(/^data:/i.test(t))try{if(i==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(i==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",w=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],S=/;base64/i.test(g)?atob(w):decodeURIComponent(w),b=new Uint8Array([...S].map(v=>v.charCodeAt(0))),C=new Blob([b],{type:(g||"").split(";")[0]||""});return{ok:!0,data:C,status:200,url:t,fromCache:!1,mime:C.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let w=await g.blob(),S=w.type||g.headers.get("content-type")||"";return i==="dataURL"?{ok:!0,data:await Ce(w),status:g.status,url:t,fromCache:!1,mime:S}:i==="text"?{ok:!0,data:await w.text(),status:g.status,url:t,fromCache:!1,mime:S}:{ok:!0,data:w,status:g.status,url:t,fromCache:!1,mime:S}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return i==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:i==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let u=Kn(t,{as:i,timeout:o,useProxy:a,errorTTL:s}),d=At.get(u);if(d&&d.until>Date.now())return J(O({},d.result),{fromCache:!0});d&&At.delete(u);let p=Ot.get(u);if(p)return p;let m=Gn(t,a)?Jn(t,a):t,f=e.credentials;if(!f)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",w=new URL(t,g);f=typeof location<"u"&&w.origin===location.origin?"include":"omit"}catch{f="omit"}let y=new AbortController,x=setTimeout(()=>y.abort("timeout"),o),$=(async()=>{var g,w;try{let S=await fetch(m,{signal:y.signal,credentials:f,headers:c});if(!S.ok){let v={ok:!1,data:null,status:S.status,url:m,fromCache:!1,reason:"http_error"};if(s>0&&At.set(u,{until:Date.now()+s,result:v}),!h){let F=`${S.status} ${S.statusText||""}`.trim();Zt.warnOnce(`http:${S.status}:${i}:${new URL(t,(g=location?.href)!=null?g:"http://localhost/").origin}`,`HTTP error ${F} while fetching ${i} ${t}`)}return e.onError&&e.onError(v),v}if(i==="text")return{ok:!0,data:await S.text(),status:S.status,url:m,fromCache:!1};let b=await S.blob(),C=b.type||S.headers.get("content-type")||"";return i==="dataURL"?{ok:!0,data:await Ce(b),status:S.status,url:m,fromCache:!1,mime:C}:{ok:!0,data:b,status:S.status,url:m,fromCache:!1,mime:C}}catch(S){let b=S&&typeof S=="object"&&"name"in S&&S.name==="AbortError"?String(S.message||"").includes("timeout")?"timeout":"abort":"network",C={ok:!1,data:null,status:0,url:m,fromCache:!1,reason:b};if(!/^blob:/i.test(t)&&s>0&&At.set(u,{until:Date.now()+s,result:C}),!h){let v=`${b}:${i}:${new URL(t,(w=location?.href)!=null?w:"http://localhost/").origin}`,F=b==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:b==="abort"?`Request aborted while fetching ${i} ${t}`:`Network/CORS issue while fetching ${i} ${t}. A proxy may be required`;Zt.errorOnce(v,F)}return e.onError&&e.onError(C),C}finally{clearTimeout(x),Ot.delete(u)}})();return Ot.set(u,$),$}var Zt,Ot,At,$t=nt(()=>{qt(),Zt=zn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Ot=new Map,At=new Map});async function Xe(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let n=de(t);if(!n)return t;let r=qn(n),l=Bt(r);if(k.background.has(l)){let i=k.background.get(l);return i?`url("${i}")`:"none"}try{let i=await lt(l,{as:"dataURL",useProxy:e.useProxy});return i.ok?(k.background.set(l,i.data),`url("${i.data}")`):(k.background.set(l,null),"none")}catch{return k.background.set(l,null),"none"}}var Qn=nt(()=>{it(),qt(),$t()});function Zn(t){if(t=String(t).toLowerCase(),me.has(t)){let i={};return k.defaultStyle.set(t,i),i}if(k.defaultStyle.has(t))return k.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),l={};for(let i of r){if(fe(i))continue;let o=r.getPropertyValue(i);l[i]=o}return e.removeChild(n),k.defaultStyle.set(t,l),l}function fe(t){let e=String(t).toLowerCase();return!!(Ke.has(e)||Je.test(e)||Ge.test(e))}function te(t,e){if(e=String(e||"").toLowerCase(),me.has(e))return"";let n=[],r=Zn(e),l=(t.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(e);for(let[i,o]of Object.entries(t)){if(fe(i)||l&&(i==="width"||i==="min-width"||i==="max-width"))continue;let a=r[i];o&&o!==a&&n.push(`${i}:${o}`)}return n.sort(),n.join(";")}function tr(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function er(t){let e=new Map;for(let r of t){let l=k.defaultStyle.get(r);if(!l)continue;let i=Object.entries(l).map(([o,a])=>`${o}:${a};`).sort().join("");i&&(e.has(i)||e.set(i,[]),e.get(i).push(r))}let n="";for(let[r,l]of e.entries())n+=`${l.join(",")} { ${r} }
|
|
2
|
+
`;return n}function nr(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let l of e)n.set(l,`c${r++}`);return n}function rr(t){var e;try{let n=t?.ownerDocument;if(!n)return typeof window<"u"?window:null;let r=n.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let l=0;l<window.frames.length;l++)try{if(((e=window.frames[l])==null?void 0:e.document)===n)return window.frames[l]}catch{}}catch{}return typeof window<"u"?window:null}function ft(t,e=null){let n=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(!(t instanceof Element)){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=k.computedStyle.get(t);r||(r=new Map,k.computedStyle.set(t,r));let l=r.get(e);if(!l){let i=rr(t),o=null;try{o=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(t,e):null}catch{}if(!o&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(o=window.getComputedStyle(t,e))}catch{}l=o||n(),r.set(e,l)}return l}function Me(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function ee(t){let e=[],n=0,r=0;for(let l=0;l<t.length;l++){let i=t[l];i==="("&&n++,i===")"&&n--,i===","&&n===0&&(e.push(t.slice(r,l).trim()),r=l+1)}return e.push(t.slice(r).trim()),e}var Ye,me,Ge,Je,Ke,Qe=nt(()=>{it(),Ye=new Set(["meta","script","noscript","title","link","template"]),me=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"]),Ge=/(?:^|-)(animation|transition)(?:-|$)/i,Je=/^(--.+|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,Ke=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"])});function Ct(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function lr(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function xt(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),r=/applewebkit/i.test(t),l=/mobile/i.test(t),i=!/safari/i.test(t),o=r&&l&&i,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),s=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),c=/ipad|iphone|ipod/.test(e)&&r;return n||o||a||s||c}function ir(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}var Rt=nt(()=>{});function V(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}var Ze=nt(()=>{}),st=nt(()=>{Qn(),Qe(),Rt(),qt(),Ze()}),tn={};Pt(tn,{toCanvas:()=>zt});function or(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function ar(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function sr(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function ur(t){let e=[],n="",r=0;for(let l=0;l<t.length;l++){let i=t[l];i==="("&&r++,i===")"&&(r=Math.max(0,r-1)),i===";"&&r===0?(e.push(n),n=""):n+=i}return n.trim()&&e.push(n),e.map(l=>l.trim()).filter(Boolean)}function cr(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===","&&r===0?(e.push(n.trim()),n=""):n+=o}n.trim()&&e.push(n.trim());let l=[];for(let i of e){if(/\binset\b/i.test(i))continue;let o=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",s="0px",c="0px"]=o,h=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!h&&h!==",";l.push(`drop-shadow(${a} ${s} ${c}${u?` ${h}`:""})`)}return l.join(" ")}function en(t){let e=ur(t),n=null,r=null,l=null,i=[];for(let a of e){let s=a.indexOf(":");if(s<0)continue;let c=a.slice(0,s).trim().toLowerCase(),h=a.slice(s+1).trim();c==="box-shadow"?l=h:c==="filter"?n=h:c==="-webkit-filter"?r=h:i.push([c,h])}if(l){let a=cr(l);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let o=[...i];return n&&o.push(["filter",n]),r&&o.push(["-webkit-filter",r]),o.map(([a,s])=>`${a}:${s}`).join(";")}function dr(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${en(r)}}`)}function fr(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,dr(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${en(r)}${n}`),t}function mr(t){if(!xt()||!or(t))return t;try{let e=ar(t),n=fr(e);return sr(n)}catch{return t}}async function zt(t,e){let{width:n,height:r,scale:l=1,dpr:i=1,meta:o={},backgroundColor:a}=e;t=mr(t);let s=new Image;s.loading="eager",s.decoding="sync",s.crossOrigin="anonymous",s.src=t,await s.decode();let c=s.naturalWidth,h=s.naturalHeight,u=Number.isFinite(o.w0)?o.w0:c,d=Number.isFinite(o.h0)?o.h0:h,p,m,f=Number.isFinite(n),y=Number.isFinite(r);if(f&&y)p=Math.max(1,n),m=Math.max(1,r);else if(f){let g=n/Math.max(1,u);p=n,m=d*g}else if(y){let g=r/Math.max(1,d);m=r,p=u*g}else p=c,m=h;p=p*l,m=m*l;let x=document.createElement("canvas");x.width=p*i,x.height=m*i,x.style.width=`${p}px`,x.style.height=`${m}px`;let $=x.getContext("2d");return i!==1&&$.scale(i,i),a&&($.save(),$.fillStyle=a,$.fillRect(0,0,p,m),$.restore()),$.drawImage(s,0,0,p,m),x}var Xt=nt(()=>{Rt()}),Ut={};Pt(Ut,{rasterize:()=>nn});async function nn(t,e){let n=await zt(t,e),r=new Image;return r.src=n.toDataURL(`image/${e.format}`,e.quality),await r.decode(),r.style.width=`${n.width/e.dpr}px`,r.style.height=`${n.height/e.dpr}px`,r}var jt=nt(()=>{Xt()}),ne={};Pt(ne,{toImg:()=>$e,toSvg:()=>$e});async function $e(t,e){let{scale:n=1,width:r,height:l,meta:i={}}=e,o=Number.isFinite(r),a=Number.isFinite(l),s=Number.isFinite(n)&&n!==1||o||a;if(xt()&&s)return await nn(t,J(O({},e),{format:"png",quality:1,meta:i}));let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,await c.decode(),o&&a)c.style.width=`${r}px`,c.style.height=`${l}px`;else if(o){let h=Number.isFinite(i.w0)?i.w0:c.naturalWidth,u=Number.isFinite(i.h0)?i.h0:c.naturalHeight,d=r/Math.max(1,h);c.style.width=`${r}px`,c.style.height=`${Math.round(u*d)}px`}else if(a){let h=Number.isFinite(i.w0)?i.w0:c.naturalWidth,u=Number.isFinite(i.h0)?i.h0:c.naturalHeight,d=l/Math.max(1,u);c.style.height=`${l}px`,c.style.width=`${Math.round(h*d)}px`}else{let h=Math.round(c.naturalWidth*n),u=Math.round(c.naturalHeight*n);if(c.style.width=`${h}px`,c.style.height=`${u}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${h}"`).replace(/height="[^"]*"/,`height="${u}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,c.src=t}catch(d){V(e,"SVG width/height patch in toImg failed",d)}}return c}var ke=nt(()=>{st(),jt()}),rn={};Pt(rn,{toBlob:()=>ln});async function ln(t,e){let n=e.type;if(n==="svg"){let l=decodeURIComponent(t.split(",")[1]);return new Blob([l],{type:"image/svg+xml"})}let r=await zt(t,e);return new Promise(l=>r.toBlob(i=>l(i),`image/${n}`,e.quality))}var on=nt(()=>{Xt()}),an={};Pt(an,{download:()=>hr});async function Ae(t,e){var n;let r=new File([t],e,{type:t.type});if(!((n=navigator.canShare)!=null&&n.call(navigator,{files:[r]})))return!1;try{await navigator.share({files:[r],title:e})}catch(l){if(l.name!=="AbortError")return!1}return!0}async function hr(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),l=n.has(r)?r:"",i=(e?.format||l||"").toLowerCase(),o=i==="jpg"?"jpeg":i||"png",a=e?.filename||`snapdom.${o}`,s=J(O({},e||{}),{format:o,type:o});s.dpr=1;let c=lr();if(o==="svg"){let d=await ln(t,J(O({},s),{type:"svg"}));if(c&&await Ae(d,a))return;let p=URL.createObjectURL(d),m=document.createElement("a");m.href=p,m.download=a,document.body.appendChild(m),m.click(),URL.revokeObjectURL(p),m.remove();return}let h=await zt(t,s);if(c){let d=`image/${o}`,p=await new Promise(m=>h.toBlob(m,d,e?.quality));if(p&&await Ae(p,a))return}let u=document.createElement("a");u.href=h.toDataURL(`image/${o}`,e?.quality),u.download=a,document.body.appendChild(u),u.click(),u.remove()}var pr=nt(()=>{on(),Xt(),Rt()});st();st();it();var Ee=new WeakMap,Lt=new Map,gr=2e3,re=0;function Et(){re++,Lt.size>gr&&Lt.clear()}var Fe=!1;function yr(t=document.documentElement){var e,n;if(!Fe){Fe=!0;try{new MutationObserver(()=>Et()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Et()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let r=document.fonts;r&&((e=r.addEventListener)==null||e.call(r,"loadingdone",Et),(n=r.ready)==null||n.then(()=>Et()).catch(()=>{}))}catch{}}}function wr(t,e={}){let n={},r=t.getPropertyValue("visibility"),l=e.excludeStyleProps;for(let u=0;u<t.length;u++){let d=t[u];if(fe(d)||l&&(l instanceof RegExp&&l.test(d)||typeof l=="function"&&l(d)))continue;let p=t.getPropertyValue(d);(d==="background-image"||d==="content")&&p.includes("url(")&&!p.includes("data:")&&(p="none"),n[d]=p}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let u of i)if(!n[u])try{let d=t.getPropertyValue(u);d&&(n[u]=d)}catch{}let o=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let u of o)if(!n[u])try{let d=t.getPropertyValue(u);d&&(n[u]=d)}catch{}if(e.embedFonts){let u=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let d of u)if(!n[d])try{let p=t.getPropertyValue(d);p&&(n[d]=p)}catch{}}r==="hidden"&&(n.opacity="0");try{(n["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(n.visibility="hidden")}catch{}let a=parseFloat(t.getPropertyValue("border-top-width")||0)||0,s=parseFloat(t.getPropertyValue("border-right-width")||0)||0,c=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,h=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(a===0&&s===0&&c===0&&h===0){let u=(t.getPropertyValue("border-image-source")||"").trim(),d=u&&u!=="none",p=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let m of p)delete n[m];d||(n.border="none")}return n}var Le=new WeakMap;function br(t){let e=Le.get(t);return e||(e=Object.entries(t).sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:0).map(([n,r])=>`${n}:${r}`).join(";"),Le.set(t,e),e)}function xr(t,e=null,n={}){let r=Ee.get(t);if(r&&r.epoch===re)return r.snapshot;let l=e||getComputedStyle(t),i=wr(l,n);return Ar(t,l,i),Ee.set(t,{epoch:re,snapshot:i}),i}function vr(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Lt,defaultStyle:k.defaultStyle,baseStyle:k.baseStyle,image:k.image,resource:k.resource,background:k.background,font:k.font},options:e||{}}:{session:k.session,persist:{snapshotKeyCache:Lt,defaultStyle:k.defaultStyle,baseStyle:k.baseStyle,image:k.image,resource:k.resource,background:k.background,font:k.font},options:t||e||{}}}function Sr(t,e,n){if(!(!t.style||t.style.length===0))for(let r=0;r<t.style.length;r++){let l=t.style[r],i=n.getPropertyValue(l);i&&e.style.setProperty(l,i)}}async function bt(t,e,n,r){var l,i;if(t.tagName==="STYLE")return;let o=vr(n,r),a=o.options&&o.options.cache||"auto";a!=="disabled"&&yr(document.documentElement),a==="disabled"&&!o.session.__bumpedForDisabled&&(Et(),Lt.clear(),o.session.__bumpedForDisabled=!0);let{session:s,persist:c}=o;if(!s.styleCache.has(t)){let m=null;try{m=getComputedStyle(t)}catch{}s.styleCache.set(t,m||getComputedStyle(document.documentElement))}let h=s.styleCache.get(t);(l=t.getAttribute)!=null&&l.call(t,"style")&&Sr(t,e,h);let u=xr(t,h,o.options),d=br(u),p=c.snapshotKeyCache.get(d);if(!p){let m=((i=t.tagName)==null?void 0:i.toLowerCase())||"div";p=te(u,m),c.snapshotKeyCache.set(d,p)}s.styleMap.set(e,p)}function Cr(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Mr(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function $r(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function kr(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let l=t.scrollHeight;if(l===0)return!1;let i=parseFloat(e.paddingTop)||0,o=parseFloat(e.paddingBottom)||0;return l>i+o}function Ar(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let l=parseFloat(e.height);if(Number.isFinite(l)&&t.scrollHeight>0&&Math.abs(l-t.scrollHeight)>2||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let i=e.display||"";if(i.includes("flex")||i.includes("grid")||Cr(t))return;let o=e.position;if(o==="absolute"||o==="fixed"||o==="sticky"||e.transform!=="none"||Mr(e)||$r(t))return;let a=e.overflowX||e.overflow||"visible",s=e.overflowY||e.overflow||"visible";if(a!=="visible"||s!=="visible")return;let c=e.clip;c&&c!=="auto"&&c!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||kr(t,e)&&(delete n.height,delete n["block-size"])}Qe();var sn=["fill","stroke","color","background-color","stop-color"],Ne=new Map;function Er(t,e){let n=e+"::"+t.toLowerCase(),r=Ne.get(n);if(r)return r;let l=document,i=e==="http://www.w3.org/2000/svg"?l.createElementNS(e,t):l.createElement(t),o=l.createElement("div");o.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",o.appendChild(i),l.documentElement.appendChild(o);let a=getComputedStyle(i),s={};for(let c of sn)s[c]=a.getPropertyValue(c)||"";return o.remove(),Ne.set(n,s),s}function Fr(t,e){var n,r,l;if(!(t instanceof Element)||!(e instanceof Element))return;let i=(n=t.getAttribute)==null?void 0:n.call(t,"style"),o=!!(i&&i.includes("var("));if(!o&&(r=t.attributes)!=null&&r.length){let s=t.attributes;for(let c=0;c<s.length;c++){let h=s[c];if(h&&typeof h.value=="string"&&h.value.includes("var(")){o=!0;break}}}let a=null;if(o)try{a=getComputedStyle(t)}catch{}if(o){let s=t.style;if(s&&s.length){let c=new Set;for(let h=0;h<s.length;h++){let u=s[h];if(c.has(u))continue;c.add(u);let d=s.getPropertyValue(u);if(!d||!d.includes("var("))continue;let p=a&&a.getPropertyValue(u);if(p)try{e.style.setProperty(u,p.trim(),s.getPropertyPriority(u))}catch{}}}}if(o&&(l=t.attributes)!=null&&l.length){let s=t.attributes;for(let c=0;c<s.length;c++){let h=s[c];if(!h||typeof h.value!="string"||!h.value.includes("var("))continue;let u=h.name,d=a&&a.getPropertyValue(u);if(d)try{e.style.setProperty(u,d.trim())}catch{}}}if(!o){if(!a)try{a=getComputedStyle(t)}catch{a=null}if(!a)return;let s=t.namespaceURI||"html",c=Er(t.tagName,s);for(let h of sn){let u=a.getPropertyValue(h)||"",d=c[h]||"";if(u&&u!==d)try{e.style.setProperty(h,u.trim())}catch{}}}}st();st();it();$t();function Kt(t,e,n){return Promise.all(t.map(r=>new Promise(l=>{function i(){Ct(o=>{!(o&&typeof o.timeRemaining=="function")||o.timeRemaining()>0?e(r,l):i()},{fast:n})}i()})))}function Lr(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Nr(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let l=n?Lr(r):r;return`:where(${e} ${l})`}).join(", ")}function Pr(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,l,i)=>{let o=Nr(i,e,!0);return`${r}${l}${o}{`}),t):""}function Rr(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Tr(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
|
|
3
|
+
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let l of r.cssRules)e+=l.cssText+`
|
|
4
|
+
`}catch{}}catch{}return e}function Wr(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function Ir(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Or(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function Ur(t,e){try{let n=getComputedStyle(t).getPropertyValue(e).trim();if(n)return n}catch{}try{let n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(n)return n}catch{}return""}function jr(t,e,n){let r=[];for(let l of e){let i=Ur(t,l);i&&r.push(`${l}: ${i};`)}return r.length?`${n}{${r.join("")}}
|
|
5
|
+
`:""}function _r(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function Hr(t,e=3){let n=()=>{var i;try{return t.contentDocument||((i=t.contentWindow)==null?void 0:i.document)||null}catch{return null}},r=n(),l=0;for(;l<e&&(!r||!r.body&&!r.documentElement);)await new Promise(i=>setTimeout(i,0)),r=n(),l++;return r&&(r.body||r.documentElement)?r:null}function Dr(t){let e=t.getBoundingClientRect(),n=0,r=0,l=0,i=0;try{let s=getComputedStyle(t);n=parseFloat(s.borderLeftWidth)||0,r=parseFloat(s.borderRightWidth)||0,l=parseFloat(s.borderTopWidth)||0,i=parseFloat(s.borderBottomWidth)||0}catch{}let o=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(l+i)));return{contentWidth:o,contentHeight:a,rect:e}}function at(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let l=parseFloat(r.width);!isNaN(l)&&l>0&&(e=l)}if(n===0){let l=parseFloat(r.height);!isNaN(l)&&l>0&&(n=l)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Br(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(r),()=>{try{r.remove()}catch{}}}async function Vr(t,e,n){let r=await Hr(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:l,contentHeight:i,rect:o}=Dr(t),a=n?.snap;if(!a&&typeof window<"u"&&window.snapdom&&(a=window.snapdom),!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let s=J(O({},n),{scale:1}),c=Br(r,l,i),h;try{h=await a.toPng(r.documentElement,s)}finally{c()}h.style.display="block",h.style.width=`${l}px`,h.style.height=`${i}px`;let u=document.createElement("div");return e.nodeMap.set(u,t),bt(t,u,e,n),u.style.overflow="hidden",u.style.display="block",u.style.width||(u.style.width=`${Math.round(o.width)}px`),u.style.height||(u.style.height=`${Math.round(o.height)}px`),u.appendChild(h),u}function qr(t){let{width:e,height:n}=at(t),r=t.getBoundingClientRect(),l;try{l=window.getComputedStyle(t)}catch{}let i=l?parseFloat(l.width):NaN,o=l?parseFloat(l.height):NaN,a=Math.round(e||r.width||0),s=Math.round(n||r.height||0),c=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,a||16),h=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,s||16),u=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,p=!!t.indeterminate,m=Math.max(Math.min(c,h),12),f="middle";try{l&&l.verticalAlign&&(f=l.verticalAlign)}catch{}let y=document.createElement("div");y.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),y.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${f};flex-shrink:0;line-height:0;`;let x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("width",String(m)),x.setAttribute("height",String(m)),x.setAttribute("viewBox",`0 0 ${m} ${m}`),y.appendChild(x);function $(){let g="#0a6ed1";try{l&&(g=l.accentColor||l.color||g)}catch{}let w=2,S=w/2,b=m-w;if(x.innerHTML="",u){let C=document.createElementNS("http://www.w3.org/2000/svg","rect");if(C.setAttribute("x",String(S)),C.setAttribute("y",String(S)),C.setAttribute("width",String(b)),C.setAttribute("height",String(b)),C.setAttribute("rx","2"),C.setAttribute("ry","2"),C.setAttribute("fill",d?g:"none"),C.setAttribute("stroke",g),C.setAttribute("stroke-width",String(w)),x.appendChild(C),d){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",`M ${S+2} ${m/2} L ${m/2-1} ${m-S-2} L ${m-S-2} ${S+2}`),v.setAttribute("stroke","white"),v.setAttribute("stroke-width",String(Math.max(1.5,w))),v.setAttribute("fill","none"),v.setAttribute("stroke-linecap","round"),v.setAttribute("stroke-linejoin","round"),x.appendChild(v)}else if(p){let v=document.createElementNS("http://www.w3.org/2000/svg","rect"),F=Math.max(6,b-4);v.setAttribute("x",String((m-F)/2)),v.setAttribute("y",String((m-w)/2)),v.setAttribute("width",String(F)),v.setAttribute("height",String(w)),v.setAttribute("fill",g),v.setAttribute("rx","1"),x.appendChild(v)}}else{let C=document.createElementNS("http://www.w3.org/2000/svg","circle");if(C.setAttribute("cx",String(m/2)),C.setAttribute("cy",String(m/2)),C.setAttribute("r",String((m-w)/2)),C.setAttribute("fill",d?g:"none"),C.setAttribute("stroke",g),C.setAttribute("stroke-width",String(w)),x.appendChild(C),d){let v=document.createElementNS("http://www.w3.org/2000/svg","circle"),F=Math.max(2,(m-w*2)*.35);v.setAttribute("cx",String(m/2)),v.setAttribute("cy",String(m/2)),v.setAttribute("r",String(F)),v.setAttribute("fill","white"),x.appendChild(v)}}y.style.setProperty("width",`${m}px`,"important"),y.style.setProperty("height",`${m}px`,"important"),y.style.setProperty("min-width",`${m}px`,"important"),y.style.setProperty("min-height",`${m}px`,"important")}return $(),{el:y,applyVisual:$}}var kt=new rt(80);async function Ft(t){var e;if((e=k.resource)!=null&&e.has(t))return k.resource.get(t);if(kt.has(t))return kt.get(t);let n=(async()=>{var r;let l=await lt(t,{as:"dataURL",silent:!0});if(!l.ok||typeof l.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(r=k.resource)==null||r.set(t,l.data),l.data})();kt.set(t,n);try{let r=await n;return kt.set(t,r),r}catch(r){throw kt.delete(t),r}}var zr=/\bblob:[^)"'\s]+/g;async function Pe(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(zr)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let l=await Ft(r);n=n.split(r).join(l)}catch{}return n}function It(t){return typeof t=="string"&&t.startsWith("blob:")}function Xr(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Yr(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function Gr(t,e=null){var n,r;if(!t)return;let l=e,i=t.querySelectorAll?t.querySelectorAll("img"):[];for(let h of i)try{let u=h.getAttribute("src")||h.currentSrc||"";if(It(u)){let p=await Ft(u);h.setAttribute("src",p)}let d=h.getAttribute("srcset");if(d&&d.includes("blob:")){let p=Xr(d),m=!1;for(let f of p)if(It(f.url))try{f.url=await Ft(f.url),m=!0}catch(y){V(l,"blobUrlToDataUrl for srcset item failed",y)}m&&h.setAttribute("srcset",Yr(p))}}catch(u){V(l,"resolveBlobUrls for img failed",u)}let o=t.querySelectorAll?t.querySelectorAll("image"):[];for(let h of o)try{let u="http://www.w3.org/1999/xlink",d=h.getAttribute("href")||((n=h.getAttributeNS)==null?void 0:n.call(h,u,"href"));if(It(d)){let p=await Ft(d);h.setAttribute("href",p),(r=h.removeAttributeNS)==null||r.call(h,u,"href")}}catch(u){V(l,"resolveBlobUrls for SVG image href failed",u)}let a=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let h of a)try{let u=h.getAttribute("style");if(u&&u.includes("blob:")){let d=await Pe(u);h.setAttribute("style",d)}}catch(u){V(l,"replaceBlobUrls in inline style failed",u)}let s=t.querySelectorAll?t.querySelectorAll("style"):[];for(let h of s)try{let u=h.textContent||"";u.includes("blob:")&&(h.textContent=await Pe(u))}catch(u){V(l,"replaceBlobUrls in style tag failed",u)}let c=["poster"];for(let h of c){let u=t.querySelectorAll?t.querySelectorAll(`[${h}^='blob:']`):[];for(let d of u)try{let p=d.getAttribute(h);It(p)&&d.setAttribute(h,await Ft(p))}catch(p){V(l,`resolveBlobUrls for ${h} failed`,p)}}}Rt();async function _t(t,e,n){var r,l,i,o,a,s,c,h,u;if(!t)throw new Error("Invalid node");let d=new Set,p=null,m=null;if(t.nodeType===Node.ELEMENT_NODE){let g=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ye.has(g))return null;if(g==="foreignobject"&&(l=(r=t.parentElement)==null?void 0:r.closest)!=null&&l.call(r,"foreignObject"))return V(e,"Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)"),null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let g=document.createElement("div"),{width:w,height:S}=at(t),b=w||t.getBoundingClientRect().width||0,C=S||t.getBoundingClientRect().height||0;return g.style.cssText=`display:inline-block;width:${b}px;height:${C}px;visibility:hidden;`,g}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let g of n.exclude)try{if((i=t.matches)!=null&&i.call(t,g)){if(n.excludeMode==="hide"){let w=document.createElement("div"),{width:S,height:b}=at(t),C=S||t.getBoundingClientRect().width||0,v=b||t.getBoundingClientRect().height||0;return w.style.cssText=`display:inline-block;width:${C}px;height:${v}px;visibility:hidden;`,w}else if(n.excludeMode==="remove")return null}}catch(w){console.warn(`Invalid selector in exclude option: ${g}`,w)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let g=document.createElement("div"),{width:w,height:S}=at(t),b=w||t.getBoundingClientRect().width||0,C=S||t.getBoundingClientRect().height||0;return g.style.cssText=`display:inline-block;width:${b}px;height:${C}px;visibility:hidden;`,g}else if(n.filterMode==="remove")return null}}catch(g){console.warn("Error in filter function:",g)}if(t.tagName==="IFRAME"){let g=!1;try{g=!!(t.contentDocument||(o=t.contentWindow)!=null&&o.document)}catch(w){V(e,"iframe same-origin probe failed",w)}if(g)try{return await Vr(t,e,n)}catch(w){console.warn("[SnapDOM] iframe rasterization failed, fallback:",w)}if(g||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",t),n.placeholders){let{width:w,height:S}=at(t),b=document.createElement("div");return b.style.cssText=`width:${w}px;height:${S}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;`,bt(t,b,e,n),b}else{let{width:w,height:S}=at(t),b=document.createElement("div");return b.style.cssText=`display:inline-block;width:${w}px;height:${S}px;visibility:hidden;`,bt(t,b,e,n),b}}if(t.getAttribute("data-capture")==="placeholder"){let g=t.cloneNode(!1);e.nodeMap.set(g,t),bt(t,g,e,n);let w=document.createElement("div");return w.textContent=t.getAttribute("data-placeholder-text")||"",w.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",g.appendChild(w),g}if(t.tagName==="CANVAS"){let g="";try{let C=t.getContext("2d",{willReadFrequently:!0});try{C&&C.getImageData(0,0,1,1)}catch{}if(await new Promise(v=>requestAnimationFrame(v)),g=t.toDataURL("image/png"),!g||g==="data:,"){try{C&&C.getImageData(0,0,1,1)}catch{}if(await new Promise(v=>requestAnimationFrame(v)),g=t.toDataURL("image/png"),!g||g==="data:,"){let v=document.createElement("canvas");v.width=t.width,v.height=t.height;let F=v.getContext("2d");F&&(F.drawImage(t,0,0),g=v.toDataURL("image/png"))}}}catch(C){V(e,"Canvas toDataURL failed, using empty/fallback",C)}let w=document.createElement("img");try{w.decoding="sync",w.loading="eager"}catch(C){V(e,"img decoding/loading hints failed",C)}g&&(w.src=g),w.width=t.width,w.height=t.height;let{width:S,height:b}=at(t);return S>0&&(w.style.width=`${S}px`),b>0&&(w.style.height=`${b}px`),e.nodeMap.set(w,t),bt(t,w,e,n),w}if(t.tagName==="VIDEO"){let g="";try{let C=document.createElement("canvas");C.width=t.videoWidth||t.offsetWidth||320,C.height=t.videoHeight||t.offsetHeight||240;let v=C.getContext("2d");v&&(v.drawImage(t,0,0,C.width,C.height),g=C.toDataURL("image/png"),(!g||g==="data:,")&&(g=""))}catch(C){V(e,"Video frame capture failed, using poster fallback",C)}let w=document.createElement("img");try{w.decoding="sync",w.loading="eager"}catch{}g?w.src=g:t.poster&&(w.src=t.poster),w.width=t.videoWidth||t.offsetWidth||0,w.height=t.videoHeight||t.offsetHeight||0;let{width:S,height:b}=at(t);return S>0&&(w.style.width=`${S}px`),b>0&&(w.style.height=`${b}px`),w.style.objectFit="contain",e.nodeMap.set(w,t),bt(t,w,e,n),w}let f;try{if(f=t.cloneNode(!1),(a=f.attributes)==null?void 0:a.length)try{for(let g of f.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(g.value)&&f.setAttribute(g.name,g.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Fr(t,f),e.nodeMap.set(f,t),t.tagName==="IMG"){Ir(t,f);try{let{width:g,height:w}=at(t),S=Math.round(g||0),b=Math.round(w||0);S&&(f.dataset.snapdomWidth=String(S)),b&&(f.dataset.snapdomHeight=String(b))}catch(g){V(e,"getUnscaledDimensions for IMG failed",g)}try{let g=t.getAttribute("style")||"",w=window.getComputedStyle(t),S=U=>{let B=g.match(new RegExp(`${U}\\s*:\\s*([^;]+)`,"i")),W=B?B[1].trim():w.getPropertyValue(U);return/%|auto/i.test(String(W||""))},b=parseInt(f.dataset.snapdomWidth||"0",10),C=parseInt(f.dataset.snapdomHeight||"0",10),v=S("width")||!b,F=S("height")||!C;v&&b&&(f.style.width=`${b}px`),F&&C&&(f.style.height=`${C}px`);let E=w.getPropertyValue("object-fit"),D=w.getPropertyValue("object-position");E&&E!=="fill"?(f.style.objectFit=E,D&&(f.style.objectPosition=D)):(b&&(f.style.minWidth=`${b}px`),C&&(f.style.minHeight=`${C}px`))}catch(g){V(e,"IMG dimension freeze failed",g)}}}catch(g){throw console.error("[Snapdom] Failed to clone node:",t,g),g}let y=null;if(t instanceof HTMLTextAreaElement){let{width:g,height:w}=at(t),S=g||t.getBoundingClientRect().width||0,b=w||t.getBoundingClientRect().height||0;S&&(f.style.width=`${S}px`),b&&(f.style.height=`${b}px`)}if(t instanceof HTMLInputElement){let g=(t.type||"text").toLowerCase();if((g==="checkbox"||g==="radio")&&ir()){let{el:w,applyVisual:S}=qr(t);e.nodeMap.set(w,t),y=S,f=w}else f.value=t.value,f.setAttribute("value",t.value),t.checked!==void 0&&(f.checked=t.checked,t.checked&&f.setAttribute("checked",""),t.indeterminate&&(f.indeterminate=t.indeterminate))}if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!t.value&&t.placeholder)try{let g=window.getComputedStyle(t,"::placeholder"),w=g&&g.color;if(w&&w!=="rgba(0, 0, 0, 0)"){let S="snapdom-ph-"+(Math.random()*1e6|0);f.classList.add(S);let b=document.createElement("style");b.textContent=`.${S}::placeholder{color:${w}!important;opacity:${g.opacity||"1"}!important;}`,f.prepend(b)}}catch{}if(t instanceof HTMLSelectElement&&(p=t.value),t instanceof HTMLTextAreaElement&&(m=t.value),t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement){t.disabled&&f.setAttribute("disabled",""),t.required&&f.setAttribute("required",""),t.readOnly&&f.setAttribute("readonly","");let g=t;g.min!==void 0&&g.min!==""&&f.setAttribute("min",g.min),g.max!==void 0&&g.max!==""&&f.setAttribute("max",g.max),g.pattern!==void 0&&g.pattern!==""&&f.setAttribute("pattern",g.pattern);let w=t.getAttribute("aria-invalid");w!==null&&f.setAttribute("aria-invalid",w)}if(bt(t,f,e,n),y&&y(),t instanceof SVGElement){let g=["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 w=window.getComputedStyle(t);for(let S of g){let b=w.getPropertyValue(S);b&&f.style.setProperty(S,b)}}catch{}}if(t.shadowRoot){let g=function(U,B){if(U.nodeType===Node.ELEMENT_NODE&&U.tagName==="STYLE")return B(null);_t(U,e,n).then(W=>{B(W||null)}).catch(()=>{B(null)})};try{let U=t.shadowRoot.querySelectorAll("slot");for(let B of U){let W=[];try{W=((s=B.assignedNodes)==null?void 0:s.call(B,{flatten:!0}))||((c=B.assignedNodes)==null?void 0:c.call(B))||[]}catch{W=((h=B.assignedNodes)==null?void 0:h.call(B))||[]}for(let I of W)d.add(I)}}catch{}let w=Rr(e),S=`[data-sd="${w}"]`;try{f.setAttribute("data-sd",w)}catch{}let b=Tr(t.shadowRoot),C=Pr(b,S),v=Or(b),F=jr(t,v,S);Wr(f,F+C,w);let E=document.createDocumentFragment(),D=await Kt(Array.from(t.shadowRoot.childNodes),g,n.fast);E.append(...D.filter(U=>!!U)),f.appendChild(E)}if(t.tagName==="SLOT"){let g=function(v,F){_t(v,e,n).then(E=>{E&&_r(E),F(E||null)}).catch(()=>{F(null)})},w=((u=t.assignedNodes)==null?void 0:u.call(t,{flatten:!0}))||[],S=w.length>0?w:Array.from(t.childNodes),b=document.createDocumentFragment(),C=await Kt(Array.from(S),g,n.fast);return b.append(...C.filter(v=>!!v)),b}function x(g,w){if(d.has(g))return w(null);_t(g,e,n).then(S=>{w(S||null)}).catch(()=>{w(null)})}let $=await Kt(Array.from(t.childNodes),x,n.fast);if(f.append(...$.filter(g=>!!g)),p!==null&&f instanceof HTMLSelectElement){f.value=p;for(let g of f.options)g.value===p?g.setAttribute("selected",""):g.removeAttribute("selected")}return m!==null&&f instanceof HTMLTextAreaElement&&(f.textContent=m),f}st();qt();it();var Jr=[/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],vt=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__||{}),le=[];function Kr(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?le.push(n):typeof n=="string"?le.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function dt(t){let e=typeof t=="string"?t:"",n=[...Jr,...le];for(let r of n)if(r instanceof RegExp&&r.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function Qr(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Re=new Map;function Zr(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,l;for(;l=r.exec(n);)e[l[1].toUpperCase()]=Number(l[2]);return e}async function tl(t,e,n){var r;let l=String(t||""),i=l.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:l,familyForCanvas:l};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:l,familyForCanvas:l};let a=n&&((r=n.FILL)!=null?r:n.fill),s="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?s="rounded":/\bsharp\b/.test(o)?s="sharp":/\boutlined\b/.test(o)&&(s="outlined");let c=a===1,h=null;if(c&&(s==="outlined"&&vt.materialIconsFilled?h={url:vt.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&vt.materialIconsRound?h={url:vt.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&vt.materialIconsSharp&&(h={url:vt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!h)return{familyForMeasure:l,familyForCanvas:l};if(!Re.has(h.alias))try{let d=new FontFace(h.alias,`url(${h.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),Re.set(h.alias,!0)}catch{return{familyForMeasure:l,familyForCanvas:l}}let u=`"${h.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function el(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function nl(t){var e,n;let r=((e=t.getPropertyValue("-webkit-text-fill-color"))==null?void 0:e.trim())||"",l=/^transparent$/i.test(r)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(r);if(r&&!l&&r.toLowerCase()!=="currentcolor")return r;let i=(n=t.color)==null?void 0:n.trim();return i&&i!=="inherit"?i:"#000"}async function rl(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:l="#000",variation:i="",className:o=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),s=window.devicePixelRatio||1,c=Zr(i),{familyForMeasure:h,familyForCanvas:u}=await tl(a,o,c);await el(u.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");d.textContent=t,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=h,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=l,document.body.appendChild(d);let p=d.getBoundingClientRect(),m=Math.max(1,Math.ceil(p.width)),f=Math.max(1,Math.ceil(p.height));document.body.removeChild(d);let y=document.createElement("canvas");y.width=m*s,y.height=f*s;let x=y.getContext("2d");x.scale(s,s),x.font=`${n?`${n} `:""}${r}px ${u}`,x.textAlign="left",x.textBaseline="top",x.fillStyle=l;try{x.fontKerning="normal"}catch{}return x.fillText(t,0,0),{dataUrl:y.toDataURL(),width:m,height:f}}async function ll(t,e){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(t.querySelectorAll(n)).filter(o=>o&&o.textContent&&o.textContent.trim());if(r.length===0)return 0;let l=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(o=>o&&o.textContent&&o.textContent.trim()):[],i=0;for(let o=0;o<r.length;o++){let a=r[o],s=l[o]||null;try{let c=getComputedStyle(s||a),h=c.fontFamily||"Material Icons";if(!Qr(h))continue;let u=(s||a).textContent.trim();if(!u)continue;let d=parseInt(c.fontSize,10)||24,p=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",m=nl(c),f=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",y=(s||a).className||"",{dataUrl:x,width:$,height:g}=await rl(u,{family:h,weight:p,fontSize:d,color:m,variation:f,className:y});a.textContent="";let w=a.ownerDocument.createElement("img");w.src=x,w.alt=u,w.style.height=`${d}px`,w.style.width=`${Math.max(1,Math.round($/g*d))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(a).verticalAlign||"baseline",a.appendChild(w),i++}catch{}}return i}$t();async function il(t,e,n,r=32,l="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let o=document.createElement("span");o.textContent=t,o.style.position="absolute",o.style.visibility="hidden",o.style.fontFamily=`"${e}"`,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 a=o.getBoundingClientRect(),s=Math.ceil(a.width),c=Math.ceil(a.height);document.body.removeChild(o);let h=document.createElement("canvas");h.width=Math.max(1,s*i),h.height=Math.max(1,c*i);let u=h.getContext("2d");return u.scale(i,i),u.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,u.textAlign="left",u.textBaseline="top",u.fillStyle=l,u.fillText(t,0,0),{dataUrl:h.toDataURL(),width:s,height:c}}var un=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),ol=["katex","mathjax","mathml"];function he(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!un.has(n.toLowerCase()))return n}return""}function al(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(un.has(r.toLowerCase())||e.push(r))}return e}function Ht(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Dt(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function sl(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function ul(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let l=Ht(n[1]),i=Ht(n[2]);return{min:Math.min(l,i),max:Math.max(l,i)}}let r=Ht(e);return{min:r,max:r}}function cl(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function dl(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let i=parseFloat(n[1]),o=parseFloat(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),l=r?parseFloat(r[1]):100;return{min:l,max:l}}function fl(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ml(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let l=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(o=>l.endsWith(o))||n.some(o=>l===o.toLowerCase()||l.endsWith("."+o.toLowerCase())))return!0;let i=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||ol.some(o=>i.includes(o)))return!0;for(let o of e){let a=o.toLowerCase().replace(/\s+/g,"+"),s=o.toLowerCase().replace(/\s+/g,"-"),c=fl(o);if(i.includes(a)||i.includes(s)||c&&i.includes(c))return!0}return!1}catch{return!1}}function hl(t){var e;let n=new Set;for(let r of t||[]){let l=(e=String(r).split("__")[0])==null?void 0:e.trim();l&&n.add(l)}return n}function Te(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,l)=>{let i=(l||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return n;let o=i;try{o=new URL(i,e||location.href).href}catch{}return`url("${o}")`})}var ie=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Vt=4;async function pl(t,e,n){if(!t)return t;let r=new Set;function l(a,s){try{return new URL(a,s||location.href).href}catch{return a}}async function i(a,s,c=0){if(c>Vt)return console.warn(`[snapDOM] @import depth exceeded (${Vt}) at ${s}`),a;let h="",u=0,d;for(;d=ie.exec(a);){h+=a.slice(u,d.index),u=ie.lastIndex;let p=(d[2]||d[4]||"").trim(),m=l(p,s);if(r.has(m)){console.warn(`[snapDOM] Skipping circular @import: ${m}`);continue}r.add(m);let f="";try{let y=await lt(m,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(f=y.data)}catch{}f?(f=Te(f,m),f=await i(f,m,c+1),h+=`
|
|
6
|
+
/* inlined: ${m} */
|
|
7
|
+
${f}
|
|
8
|
+
`):h+=d[0]}return h+=a.slice(u),h}let o=Te(t,e||location.href);return o=await i(o,e||location.href,0),o}var cn=/url\((["']?)([^"')]+)\1\)/g,gl=/@font-face[^{}]*\{[^}]*\}/g;function dn(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let l=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!l)continue;let i=l[1],o=l[2],a=s=>{if(!s.includes("?"))return parseInt(s,16);let c=parseInt(s.replace(/\?/g,"0"),16),h=parseInt(s.replace(/\?/g,"F"),16);return[c,h]};if(o){let s=a(i),c=a(o),h=Array.isArray(s)?s[0]:s,u=Array.isArray(c)?c[1]:c;e.push([Math.min(h,u),Math.max(h,u)])}else{let s=a(i);Array.isArray(s)?e.push([s[0],s[1]]):e.push([s,s])}}return e}function fn(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,l]of e)if(n>=r&&n<=l)return!0;return!1}function pe(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(cn)){let l=(r[2]||"").trim();if(!(!l||l.startsWith("data:"))){if(!/^https?:/i.test(l))try{l=new URL(l,e||location.href).href}catch{}n.push(l)}}return n}async function mn(t,e,n=""){var r,l,i,o,a;let s=t;for(let c of t.matchAll(cn)){let h=de(c[0]);if(!h)continue;let u=h;if(!u.startsWith("http")&&!u.startsWith("data:"))try{u=new URL(u,e||location.href).href}catch{}if(!dt(u)){if((r=k.resource)!=null&&r.has(u)){(l=k.font)==null||l.add(u),s=s.replace(c[0],`url(${k.resource.get(u)})`);continue}if(!((i=k.font)!=null&&i.has(u)))try{let d=await lt(u,{as:"dataURL",useProxy:n,silent:!0});if(d.ok&&typeof d.data=="string"){let p=d.data;(o=k.resource)==null||o.set(u,p),(a=k.font)==null||a.add(u),s=s.replace(c[0],`url(${p})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",u)}}}return s}function yl(t){if(!t.length)return null;let e=(o,a)=>t.some(([s,c])=>!(c<o||s>a)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),l=e(880,1023),i=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":i?"cyrillic":l?"greek":r?"latin-ext":n?"latin":null}function We(t={}){let e=new Set((t.families||[]).map(l=>String(l).toLowerCase())),n=new Set((t.domains||[]).map(l=>String(l).toLowerCase())),r=new Set((t.subsets||[]).map(l=>String(l).toLowerCase()));return(l,i)=>{if(e.size&&e.has(l.family.toLowerCase()))return!0;if(n.size)for(let o of l.srcUrls)try{if(n.has(new URL(o).host.toLowerCase()))return!0}catch{}if(r.size){let o=yl(i);if(o&&r.has(o))return!0}return!1}}function wl(t){var e,n,r,l,i,o;if(!t)return t;let a=/@font-face[^{}]*\{[^}]*\}/gi,s=new Set,c=[];for(let u of t.match(a)||[]){let d=((e=u.match(/font-family:\s*([^;]+);/i))==null?void 0:e[1])||"",p=he(d),m=(((n=u.match(/font-weight:\s*([^;]+);/i))==null?void 0:n[1])||"400").trim(),f=(((r=u.match(/font-style:\s*([^;]+);/i))==null?void 0:r[1])||"normal").trim(),y=(((l=u.match(/font-stretch:\s*([^;]+);/i))==null?void 0:l[1])||"100%").trim(),x=(((i=u.match(/unicode-range:\s*([^;]+);/i))==null?void 0:i[1])||"").trim(),$=(((o=u.match(/src\s*:\s*([^;}]+)[;}]/i))==null?void 0:o[1])||"").trim(),g=pe($,location.href),w=g.length?g.map(b=>String(b).toLowerCase()).sort().join("|"):$.toLowerCase(),S=[String(p||"").toLowerCase(),m,f,y,x.toLowerCase(),w].join("|");s.has(S)||(s.add(S),c.push(u))}if(c.length===0)return t;let h=0;return t.replace(a,()=>c[h++]||"")}function bl(t,e,n,r,l){let i=Array.from(t||[]).sort().join("|"),o=e?JSON.stringify({families:(e.families||[]).map(h=>String(h).toLowerCase()).sort(),domains:(e.domains||[]).map(h=>String(h).toLowerCase()).sort(),subsets:(e.subsets||[]).map(h=>String(h).toLowerCase()).sort()}):"",a=(n||[]).map(h=>`${(h.family||"").toLowerCase()}::${h.weight||"normal"}::${h.style||"normal"}::${h.src||""}`).sort().join("|"),s=r||"",c=(l||[]).map(h=>String(h).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${i}::ex=${o}::lf=${a}::px=${s}::fd=${c}`}async function hn(t,e,n,r){let l;try{l=t.cssRules||[]}catch{return}let i=(o,a)=>{try{return new URL(o,a||location.href).href}catch{return o}};for(let o of l){if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){let a=o.href?i(o.href,e):e;if(r.depth>=Vt){console.warn(`[snapDOM] CSSOM import depth exceeded (${Vt}) at ${a}`);continue}if(a&&r.visitedSheets.has(a)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${a}`);continue}a&&r.visitedSheets.add(a);let s=J(O({},r),{depth:(r.depth||0)+1});await hn(o.styleSheet,a,n,s);continue}if(o.type===CSSRule.FONT_FACE_RULE){let a=(o.style.getPropertyValue("font-family")||"").trim(),s=he(a);if(!s||dt(s))continue;let c=(o.style.getPropertyValue("font-weight")||"400").trim(),h=(o.style.getPropertyValue("font-style")||"normal").trim(),u=(o.style.getPropertyValue("font-stretch")||"100%").trim(),d=(o.style.getPropertyValue("src")||"").trim(),p=(o.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(s,h,c,u))continue;let m=dn(p);if(!fn(r.usedCodepoints,m))continue;let f={family:s,weightSpec:c,styleSpec:h,stretchSpec:u,unicodeRange:p,srcRaw:d,srcUrls:pe(d,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(f,m))continue;if(/url\(/i.test(d)){let y=await mn(d,e||location.href,r.useProxy);await n(`@font-face{font-family:${s};src:${y};font-style:${h};font-weight:${c};font-stretch:${u};${p?`unicode-range:${p};`:""}}`)}else await n(`@font-face{font-family:${s};src:${d};font-style:${h};font-weight:${c};font-stretch:${u};${p?`unicode-range:${p};`:""}}`)}}}async function xl({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:l="",fontStylesheetDomains:i=[]}={}){var o,a,s,c,h,u,d,p,m,f,y,x,$,g,w,S,b,C;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let v=new Map;for(let M of t){let[P,T,_,A]=String(M).split("__");if(!P)continue;let N=v.get(P)||[];N.push({w:parseInt(T,10),s:_,st:parseInt(A,10)}),v.set(P,N)}function F(M,P,T,_){if(!v.has(M))return!1;let A=v.get(M),N=ul(T),j=cl(P),R=dl(_),X=N.min!==N.max,Y=N.min,Z=H=>j.kind==="normal"&&H==="normal"||j.kind!=="normal"&&(H==="italic"||H==="oblique"),tt=!1;for(let H of A){let G=X?H.w>=N.min&&H.w<=N.max:H.w===Y,K=Z(Dt(H.s)),ht=H.st>=R.min&&H.st<=R.max;if(G&&K&&ht){tt=!0;break}}if(tt)return!0;if(!X)for(let H of A){let G=Z(Dt(H.s)),K=H.st>=R.min&&H.st<=R.max;if(Math.abs(Y-H.w)<=300&&G&&K)return!0}if(!X&&j.kind==="normal"&&A.some(H=>Dt(H.s)!=="normal"))for(let H of A){let G=Math.abs(Y-H.w)<=300,K=H.st>=R.min&&H.st<=R.max;if(G&&K)return!0}return!1}let E=We(n),D=bl(t,n,r,l,i);if((o=k.resource)!=null&&o.has(D))return k.resource.get(D);let U=hl(t),B=[],W=ie;for(let M of document.querySelectorAll("style")){let P=M.textContent||"";for(let T of P.matchAll(W)){let _=(T[2]||T[4]||"").trim();!_||dt(_)||document.querySelector(`link[rel="stylesheet"][href="${_}"]`)||B.push(_)}}B.length&&await Promise.all(B.map(M=>new Promise(P=>{if(document.querySelector(`link[rel="stylesheet"][href="${M}"]`))return P(null);let T=document.createElement("link");T.rel="stylesheet",T.href=M,T.setAttribute("data-snapdom","injected-import"),T.onload=()=>P(T),T.onerror=()=>P(null),document.head.appendChild(T)})));let I="",z=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(M=>!!M.href);for(let M of z)try{if(dt(M.href))continue;let P="",T=!1;try{T=new URL(M.href,location.href).origin===location.origin}catch{}if(!T){let A=Array.isArray(i)?i:[];if(!ml(M.href,U,A))continue}if(T){let A=Array.from(document.styleSheets).find(N=>N.href===M.href);if(A)try{let N=A.cssRules||[];P=Array.from(N).map(j=>j.cssText).join("")}catch{}}if(!P){let A=await lt(M.href,{as:"text",useProxy:l});if(A!=null&&A.ok&&typeof A.data=="string"&&(P=A.data),dt(M.href))continue}P=await pl(P,M.href,l);let _="";for(let A of P.match(gl)||[]){let N=(((a=A.match(/font-family:\s*([^;]+);/i))==null?void 0:a[1])||"").trim(),j=he(N);if(!j||dt(j))continue;let R=(((s=A.match(/font-weight:\s*([^;]+);/i))==null?void 0:s[1])||"400").trim(),X=(((c=A.match(/font-style:\s*([^;]+);/i))==null?void 0:c[1])||"normal").trim(),Y=(((h=A.match(/font-stretch:\s*([^;]+);/i))==null?void 0:h[1])||"100%").trim(),Z=(((u=A.match(/unicode-range:\s*([^;]+);/i))==null?void 0:u[1])||"").trim(),tt=(((d=A.match(/src\s*:\s*([^;}]+)[;}]/i))==null?void 0:d[1])||"").trim(),H=pe(tt,M.href);if(!F(j,X,R,Y))continue;let G=dn(Z);if(!fn(e,G))continue;let K={family:j,weightSpec:R,styleSpec:X,stretchSpec:Y,unicodeRange:Z,srcRaw:tt,srcUrls:H,href:M.href};if(n&&E(K,G))continue;let ht=/url\(/i.test(tt)?await mn(A,M.href,l):A;_+=ht}_.trim()&&(I+=_)}catch{console.warn("[snapDOM] Failed to process stylesheet:",M.href)}let mt={requiredIndex:v,usedCodepoints:e,faceMatchesRequired:F,simpleExcluder:n?We(n):null,useProxy:l,visitedSheets:new Set,depth:0};for(let M of document.styleSheets)if(!(M.href&&z.some(P=>P.href===M.href)))try{let P=M.href||location.origin+"/";P&&mt.visitedSheets.add(P),await hn(M,P,async T=>{I+=T},mt)}catch{}try{for(let M of document.fonts||[]){if(!M||!M.family||M.status!=="loaded"||!M._snapdomSrc)continue;let P=String(M.family).replace(/^['"]+|['"]+$/g,"");if(dt(P)||!v.has(P)||n!=null&&n.families&&n.families.some(_=>String(_).toLowerCase()===P.toLowerCase()))continue;let T=M._snapdomSrc;if(!String(T).startsWith("data:")){if((p=k.resource)!=null&&p.has(M._snapdomSrc))T=k.resource.get(M._snapdomSrc),(m=k.font)==null||m.add(M._snapdomSrc);else if(!((f=k.font)!=null&&f.has(M._snapdomSrc)))try{let _=await lt(M._snapdomSrc,{as:"dataURL",useProxy:l,silent:!0});if(_.ok&&typeof _.data=="string")T=_.data,(y=k.resource)==null||y.set(M._snapdomSrc,T),(x=k.font)==null||x.add(M._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",M._snapdomSrc);continue}}I+=`@font-face{font-family:'${P}';src:url(${T});font-style:${M.style||"normal"};font-weight:${M.weight||"normal"};}`}}catch{}for(let M of r){if(!M||typeof M!="object")continue;let P=String(M.family||"").replace(/^['"]+|['"]+$/g,"");if(!P||dt(P)||!v.has(P)||n!=null&&n.families&&n.families.some(R=>String(R).toLowerCase()===P.toLowerCase()))continue;let T=M.weight!=null?String(M.weight):"normal",_=M.style!=null?String(M.style):"normal",A=M.stretchPct!=null?`${M.stretchPct}%`:"100%",N=String(M.src||""),j=N;if(!j.startsWith("data:")){if(($=k.resource)!=null&&$.has(N))j=k.resource.get(N),(g=k.font)==null||g.add(N);else if(!((w=k.font)!=null&&w.has(N)))try{let R=await lt(N,{as:"dataURL",useProxy:l,silent:!0});if(R.ok&&typeof R.data=="string")j=R.data,(S=k.resource)==null||S.set(N,j),(b=k.font)==null||b.add(N);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",N);continue}}I+=`@font-face{font-family:'${P}';src:url(${j});font-style:${_};font-weight:${T};font-stretch:${A};}`}return I&&(I=wl(I),(C=k.resource)==null||C.set(D,I)),I}function pn(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=o=>{let a=al(o.fontFamily);if(a.length)for(let s of a){let c=(h,u,d)=>`${s}__${Ht(h)}__${Dt(u)}__${sl(d)}`;e.add(c(o.fontWeight,o.fontStyle,o.fontStretch))}};r(getComputedStyle(t));let l=getComputedStyle(t,"::before");l&&l.content&&l.content!=="none"&&r(l);let i=getComputedStyle(t,"::after");for(i&&i.content&&i.content!=="none"&&r(i);n.nextNode();){let o=n.currentNode,a=getComputedStyle(o);r(a);let s=getComputedStyle(o,"::before");s&&s.content&&s.content!=="none"&&r(s);let c=getComputedStyle(o,"::after");c&&c.content&&c.content!=="none"&&r(c)}return e}function vl(t){var e;let n=new Set,r=i=>{if(i)for(let o of i)n.add(o.codePointAt(0))},l=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;l.nextNode();){let i=l.currentNode;if(i.nodeType===Node.TEXT_NODE)r(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let o=i;for(let a of["::before","::after"]){let s=(e=getComputedStyle(o,a))==null?void 0:e.getPropertyValue("content");if(!(!s||s==="none"))if(/^"/.test(s)||/^'/.test(s))r(s.slice(1,-1));else{let c=s.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let h of c)try{n.add(parseInt(h.slice(1),16))}catch{}}}}}return n}async function gn(t,e=2){try{await document.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let l=document.createElement("div");l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of n){let o=document.createElement("span");o.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",o.style.fontFamily=`"${i}"`,o.style.fontWeight="700",o.style.fontStyle="italic",o.style.fontSize="32px",o.style.lineHeight="1",o.style.whiteSpace="nowrap",o.style.margin="0",o.style.padding="0",l.appendChild(o)}document.body.appendChild(l),l.offsetWidth,document.body.removeChild(l)};for(let l=0;l<Math.max(1,e);l++)r(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}it();function Sl(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Cl(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Ie(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function Oe(t,e=!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,t)),l="";for(let[i,o]of n)for(;r>=i;)l+=o,r-=i;return e?l:l.toLowerCase()}function Ue(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return Ie(t,!1);case"upper-alpha":return Ie(t,!0);case"lower-roman":return Oe(t,!1);case"upper-roman":return Oe(t,!0);default:return String(t)}}function Ml(t){let e=()=>{var d,p;return(p=(d=k?.session)==null?void 0:d.__counterEpoch)!=null?p:0},n=e(),r=new WeakMap,l=t instanceof Document?t.documentElement:t,i=d=>d&&d.tagName==="LI",o=d=>{let p=0,m=d?.parentElement;if(!m)return 0;for(let f of m.children){if(f===d)break;f.tagName==="LI"&&p++}return p},a=d=>{let p=new Map;for(let[m,f]of d)p.set(m,f.slice());return p},s=(d,p,m)=>{var f,y,x;let $=a(d),g;try{g=((f=m.style)==null?void 0:f.counterReset)||getComputedStyle(m).counterReset}catch{}if(g&&g!=="none")for(let b of g.split(",")){let C=b.trim().split(/\s+/),v=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):0;if(!v)continue;let E=p.get(v);if(E&&E.length){let D=E.slice();D.push(F),$.set(v,D)}else $.set(v,[F])}let w;try{w=((y=m.style)==null?void 0:y.counterSet)||getComputedStyle(m).counterSet}catch{}if(w&&w!=="none")for(let b of w.split(",")){let C=b.trim().split(/\s+/),v=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):0;if(!v)continue;let E=$.get(v)||[];E.length===0&&E.push(0),E[E.length-1]=F,$.set(v,E)}let S;try{S=((x=m.style)==null?void 0:x.counterIncrement)||getComputedStyle(m).counterIncrement}catch{}if(S&&S!=="none")for(let b of S.split(",")){let C=b.trim().split(/\s+/),v=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):1;if(!v)continue;let E=$.get(v)||[];E.length===0&&E.push(0),E[E.length-1]+=F,$.set(v,E)}try{if(getComputedStyle(m).display==="list-item"&&i(m)){let b=m.parentElement,C=1;if(b&&b.tagName==="OL"){let F=b.getAttribute("start"),E=Number.isFinite(Number(F))?Number(F):1,D=o(m),U=m.getAttribute("value");C=Number.isFinite(Number(U))?Number(U):E+D}else C=1+o(m);let v=$.get("list-item")||[];v.length===0&&v.push(0),v[v.length-1]=C,$.set("list-item",v)}}catch{}return $},c=(d,p,m)=>{let f=s(m,p,d);r.set(d,f);let y=f;for(let $ of d.children)y=c($,f,y);let x=new Map;for(let[$,g]of m){let w=g.length,S=y.get($);x.set($,S&&S.length?S.slice(0,w):g.slice())}for(let[$,g]of y)!x.has($)&&g.length&&!p.has($)&&x.set($,g.slice(0,1));return x},h=new Map;c(l,h,h);function u(){let d=e();if(d!==n){n=d;let p=new Map;c(l,p,p)}}return{get(d,p){var m;u();let f=(m=r.get(d))==null?void 0:m.get(p);return f&&f.length?f[f.length-1]:0},getStack(d,p){var m;u();let f=(m=r.get(d))==null?void 0:m.get(p);return f?f.slice():[]}}}function $l(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,l=t.replace(r,(i,o,a)=>{var s,c,h,u;let d=String(a).split(",").map(p=>p.trim());if(o==="counter"){let p=(s=d[0])==null?void 0:s.replace(/^["']|["']$/g,""),m=(d[1]||"decimal").toLowerCase(),f=n.get(e,p);return Ue(f,m)}else{let p=(c=d[0])==null?void 0:c.replace(/^["']|["']$/g,""),m=(u=(h=d[1])==null?void 0:h.replace(/^["']|["']$/g,""))!=null?u:"",f=(d[2]||"decimal").toLowerCase(),y=n.getStack(e,p);return y.length?y.map(x=>Ue(x,f)).join(m):""}});return Cl(l)}catch{return"- "}}$t();it();var St=new WeakMap,je=1e3;function kl(t,e){let n=yn(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=He(t),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):He(t)}function oe(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function yn(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let i=0;i<e.length;i++){let o=e[i];if(o.tagName==="STYLE"){let a=o.textContent?o.textContent.length:0;n+=`S${a}|`;let s=o.sheet,c=s?oe(s):null;c&&(r+=c.length)}else{let a=o.getAttribute("href")||"",s=o.getAttribute("media")||"all";n+=`L${a}|m:${s}|`;let c=o.sheet,h=c?oe(c):null;h&&(r+=h.length)}}let l=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(l)?l.length:0}|tr:${r}`,n}function _e(t,e,n){let r=oe(t);if(!r)return!1;for(let l=0;l<r.length;l++){if(n.budget<=0)return!1;let i=r[l],o=i&&i.cssText?i.cssText:"";n.budget--;for(let a of e)if(o.includes(a))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let a=0;a<i.cssRules.length&&n.budget>0;a++){let s=i.cssRules[a],c=s&&s.cssText?s.cssText:"";n.budget--;for(let h of e)if(c.includes(h))return!0}if(n.budget<=0)return!1}return!1}function He(t=document){let e=yn(t),n=St.get(t);if(n&&n.fingerprint===e)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],l=t.querySelectorAll("style");for(let o=0;o<l.length;o++){let a=l[o].textContent||"";for(let s of r)if(a.includes(s))return St.set(t,{fingerprint:e,result:!0}),!0}let i=t.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let o={budget:je};try{for(let a of i)if(_e(a,r,o))return St.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let o=t.querySelectorAll('style,link[rel~="stylesheet"]'),a={budget:je};for(let s=0;s<o.length&&a.budget>0;s++){let c=o[s],h=null;if(c.tagName,h=c.sheet||null,h&&_e(h,r,a))return St.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(St.set(t,{fingerprint:e,result:!0}),!0):(St.set(t,{fingerprint:e,result:!1}),!1)}var Mt=new WeakMap,De=-1;function Al(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function El(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r;for(;r=n.exec(t);)e.push(r[1]);return e.length?e.join(""):Al(t)}function ae(t,e){let n=t.parentElement,r=n?Mt.get(n):null;return r?{get(l,i){let o=e.get(l,i),a=r.get(i);return typeof a=="number"?Math.max(o,a):o},getStack(l,i){let o=e.getStack(l,i);if(!o.length)return o;let a=r.get(i);if(typeof a=="number"){let s=o.slice();return s[s.length-1]=Math.max(s[s.length-1],a),s}return o}}:e}function se(t,e,n){let r=new Map;function l(s){let c=[];if(!s||s==="none")return c;for(let h of String(s).split(",")){let u=h.trim().split(/\s+/),d=u[0],p=Number.isFinite(Number(u[1]))?Number(u[1]):void 0;d&&c.push({name:d,num:p})}return c}let i=l(e?.counterReset),o=l(e?.counterIncrement);function a(s){if(r.has(s))return r.get(s).slice();let c=n.getStack(t,s);c=c.length?c.slice():[];let h=i.find(d=>d.name===s);if(h){let d=Number.isFinite(h.num)?h.num:0;c=c.length?[...c,d]:[d]}let u=o.find(d=>d.name===s);if(u){let d=Number.isFinite(u.num)?u.num:1;c.length===0&&(c=[0]),c[c.length-1]+=d}return r.set(s,c.slice()),c}return{get(s,c){let h=a(c);return h.length?h[h.length-1]:0},getStack(s,c){return a(c)},__incs:o}}function Fl(t,e,n){let r;try{r=ft(t,e)}catch{}let l=r?.content;if(!l||l==="none"||l==="normal")return{text:"",incs:[]};let i=ae(t,n),o=se(t,r,i),a=Sl(l)?$l(l,t,o):l;return{text:El(a),incs:o.__incs||[]}}async function ue(t,e,n,r){var l,i,o,a,s;if(!(t instanceof Element)||!(e instanceof Element))return;let c=t.ownerDocument||document;if(!kl(c,n))return;let h=(i=(l=k?.session)==null?void 0:l.__counterEpoch)!=null?i:0;if(De!==h&&(Mt=new WeakMap,n&&(n.__counterCtx=null),De=h),!n.__counterCtx)try{n.__counterCtx=Ml(t.ownerDocument||document)}catch(p){V(n,"buildCounterContext failed",p)}let u=n.__counterCtx;for(let p of["::before","::after","::first-letter"])try{let m=ft(t,p);if(!m||m.content==="none"&&m.backgroundImage==="none"&&m.backgroundColor==="transparent"&&(m.borderStyle==="none"||parseFloat(m.borderWidth)===0)&&(!m.transform||m.transform==="none")&&m.display==="inline")continue;if(p==="::first-letter"){let A=ft(t);if(!(m.color!==A.color||m.fontSize!==A.fontSize||m.fontWeight!==A.fontWeight||m.fontFamily!==A.fontFamily||m.fontStyle!==A.fontStyle||m.textTransform!==A.textTransform||m.float!==A.float||m.paddingTop!==A.paddingTop||m.paddingRight!==A.paddingRight||m.paddingBottom!==A.paddingBottom||m.paddingLeft!==A.paddingLeft||m.marginTop!==A.marginTop||m.marginRight!==A.marginRight||m.marginBottom!==A.marginBottom||m.marginLeft!==A.marginLeft))continue;let N=Array.from(e.childNodes).find(G=>{var K;return G.nodeType===Node.TEXT_NODE&&((K=G.textContent)==null?void 0:K.trim().length)>0});if(!N)continue;let j=N.textContent,R=(o=j.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u))==null?void 0:o[0],X=j.slice(R?.length||0);if(!R||/[\uD800-\uDFFF]/.test(R))continue;let Y=document.createElement("span");Y.textContent=R,Y.dataset.snapdomPseudo="::first-letter";let Z=Me(m),tt=te(Z,"span");n.styleMap.set(Y,tt);let H=document.createTextNode(X);e.replaceChild(H,N),e.insertBefore(Y,H);continue}let f=(a=m.content)!=null?a:"",y=f===""||f==="none"||f==="normal",{text:x,incs:$}=Fl(t,p,u),g=m.backgroundImage,w=m.backgroundColor,S=m.fontFamily,b=parseInt(m.fontSize)||32,C=parseInt(m.fontWeight)||!1,v=m.color||"#000",F=m.borderStyle,E=parseFloat(m.borderWidth),D=m.transform,U=dt(S),B=!y&&x!=="",W=g&&g!=="none",I=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",z=F&&F!=="none"&&E>0,mt=D&&D!=="none";if(!(B||W||I||z||mt)){if($&&$.length&&t.parentElement){let A=Mt.get(t.parentElement)||new Map;for(let{name:N}of $){if(!N)continue;let j=ae(t,u),R=se(t,ft(t,p),j).get(t,N);A.set(N,R)}Mt.set(t.parentElement,A)}continue}let M=document.createElement("span");M.dataset.snapdomPseudo=p,M.style.pointerEvents="none";let P=Me(m),T=te(P,"span");if(n.styleMap.set(M,T),U&&x&&x.length===1){let{dataUrl:A,width:N,height:j}=await il(x,S,C,b,v),R=document.createElement("img");R.src=A,R.style=`height:${b}px;width:${N/j*b}px;object-fit:contain;`,M.appendChild(R),e.dataset.snapdomHasIcon="true"}else if(x&&x.startsWith("url(")){let A=de(x);if(A!=null&&A.trim())try{let N=await lt(Bt(A),{as:"dataURL",useProxy:r.useProxy});if(N!=null&&N.ok&&typeof N.data=="string"){let j=document.createElement("img");j.src=N.data,j.style=`width:${b}px;height:auto;object-fit:contain;`,M.appendChild(j)}}catch(N){console.error(`[snapdom] Error in pseudo ${p} for`,t,N)}}else!U&&B&&(M.textContent=x);M.style.backgroundImage="none","maskImage"in M.style&&(M.style.maskImage="none"),"webkitMaskImage"in M.style&&(M.style.webkitMaskImage="none");try{M.style.backgroundRepeat=m.backgroundRepeat,M.style.backgroundSize=m.backgroundSize,m.backgroundPositionX&&m.backgroundPositionY?(M.style.backgroundPositionX=m.backgroundPositionX,M.style.backgroundPositionY=m.backgroundPositionY):M.style.backgroundPosition=m.backgroundPosition,M.style.backgroundOrigin=m.backgroundOrigin,M.style.backgroundClip=m.backgroundClip,M.style.backgroundAttachment=m.backgroundAttachment,M.style.backgroundBlendMode=m.backgroundBlendMode}catch{}if(W)try{let A=ee(g),N=await Promise.all(A.map(Xe));M.style.backgroundImage=N.join(", ")}catch(A){console.warn(`[snapdom] Failed to inline background-image for ${p}`,A)}I&&(M.style.backgroundColor=w);let _=M.childNodes.length>0||((s=M.textContent)==null?void 0:s.trim())!==""||W||I||z||mt;if($&&$.length&&t.parentElement){let A=Mt.get(t.parentElement)||new Map,N=ae(t,u),j=se(t,ft(t,p),N);for(let{name:R}of $){if(!R)continue;let X=j.get(t,R);A.set(R,X)}Mt.set(t.parentElement,A)}if(!_)continue;p==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(M,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(M))}catch(m){console.warn(`[snapdom] Failed to capture ${p} for`,t,m)}let d=Array.from(e.children).filter(p=>!p.dataset.snapdomPseudo);if(n.nodeMap)for(let p of d){let m=n.nodeMap.get(p);m instanceof Element&&await ue(m,p,n,r)}else{let p=Array.from(t.children);for(let m=0;m<Math.min(p.length,d.length);m++)await ue(p[m],d[m],n,r)}}function Ll(t,e){var n,r;if(!t||!(t instanceof Element))return;let l=t.ownerDocument||document,i=l,o=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(o.length===0)return;let a=/url\(\s*#([^)]+)\)/g,s=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),h="http://www.w3.org/1999/xlink",u=b=>{if(!b||!b.getAttribute)return null;let C=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(h,"href"):null);if(C)return C;let v=b.attributes;if(!v)return null;for(let F=0;F<v.length;F++){let E=v[F];if(!E||!E.name)continue;if(E.name==="href")return E.value;let D=E.name.indexOf(":");if(D!==-1&&E.name.slice(D+1)==="href")return E.value}return null},d=new Set(Array.from(t.querySelectorAll("[id]")).map(b=>b.id)),p=new Set,m=!1,f=(b,C=null)=>{if(!b)return;a.lastIndex=0;let v;for(;v=a.exec(b);){m=!0;let F=(v[1]||"").trim();F&&(d.has(F)||(p.add(F),C&&!C.has(F)&&C.add(F)))}},y=b=>{let C=b.querySelectorAll("use");for(let F of C){let E=u(F);if(!E||!E.startsWith("#"))continue;m=!0;let D=E.slice(1).trim();D&&!d.has(D)&&p.add(D)}let v=b.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 F of v){f(F.getAttribute("style")||"");for(let E of s)f(F.getAttribute(E))}};for(let b of o)y(b);if(!m)return;let x=t.querySelector("svg.inline-defs-container");x||(x=l.createElementNS("http://www.w3.org/2000/svg","svg"),x.classList.add("inline-defs-container"),x.setAttribute("aria-hidden","true"),x.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(x,t.firstChild||null));let $=x.querySelector("defs")||null,g=b=>{if(!b||d.has(b))return null;let C=c(b),v=F=>{let E=i.querySelector(F);return E&&!t.contains(E)?E:null};return v(`svg defs > *#${C}`)||v(`svg > symbol#${C}`)||v(`*#${C}`)};if(!p.size)return;let w=new Set(p),S=new Set;for(;w.size;){let b=w.values().next().value;if(w.delete(b),!b||d.has(b)||S.has(b))continue;let C=g(b);if(!C){S.add(b);continue}$||($=l.createElementNS("http://www.w3.org/2000/svg","defs"),x.appendChild($));let v=C.cloneNode(!0);v.id||v.setAttribute("id",b),$.appendChild(v),S.add(b),d.add(b);let F=[v,...v.querySelectorAll("*")];for(let E of F){let D=u(E);if(D&&D.startsWith("#")){let B=D.slice(1).trim();B&&!d.has(B)&&!S.has(B)&&w.add(B)}let U=((n=E.getAttribute)==null?void 0:n.call(E,"style"))||"";U&&f(U,w);for(let B of s){let W=(r=E.getAttribute)==null?void 0:r.call(E,B);W&&f(W,w)}}}}it();function Nl(t,e){var n;if(!t||!e)return;let r=t.scrollTop||0;if(!r)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let l=t.getBoundingClientRect(),i=t.clientHeight,o="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let s=a.currentNode,c=getComputedStyle(s),h=c.position;if(h!=="sticky"&&h!=="-webkit-sticky")continue;let u=Be(c.top),d=Be(c.bottom);if(u==null&&d==null)continue;let p=Pl(s,t),m=Rl(e,p,o);if(!m)continue;let f=s.getBoundingClientRect(),y=f.width,x=f.height,$=f.left-l.left;if(!(y>0&&x>0)||!Number.isFinite($))continue;let g=u!=null?u+r:r+(i-x-d);if(!Number.isFinite(g))continue;let w=Number.parseInt(c.zIndex,10),S=Number.isFinite(w),b=S?Math.max(w,1)+1:2,C=S?w-1:0,v=m.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${$}px`,v.style.top=`${g}px`,v.style.width=`${y}px`,v.style.height=`${x}px`,v.style.visibility="hidden",v.style.zIndex=String(C),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",(n=m.parentElement)==null||n.insertBefore(v,m),m.style.position="absolute",m.style.left=`${$}px`,m.style.top=`${g}px`,m.style.bottom="auto",m.style.zIndex=String(b),m.style.pointerEvents="none"}}function Be(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Pl(t,e){let n=[];for(let r=t;r&&r!==e;){let l=r.parentElement;if(!l)break;n.push(Array.prototype.indexOf.call(l.children,r)),r=l}return n.reverse()}function Rl(t,e,n){let r=t;for(let l=0;l<e.length;l++)if(r=Tl(r,n)[e[l]],!r)return null;return r instanceof HTMLElement?r:null}function Tl(t,e){let n=[],r=t.children;for(let l=0;l<r.length;l++){let i=r[l];i.hasAttribute(e)||n.push(i)}return n}function Wl(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,l=e.borderStyle,i=e.borderWidth,o=n!=="none"&&parseFloat(r)>0,a=l==="none"||parseFloat(i)===0;o&&a&&(t.style.border=`${r} solid transparent`)}function Il(t){let e=[];try{let n=t.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let l=r.style.contentVisibility||"",i=getComputedStyle(r),o=i.contentVisibility||i.getPropertyValue("content-visibility")||"";(o==="auto"||o==="hidden")&&(e.push({el:r,original:l}),r.style.contentVisibility="visible")}if(t instanceof HTMLElement){let r=getComputedStyle(t),l=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(l==="auto"||l==="hidden")&&(e.push({el:t,original:t.style.contentVisibility||""}),t.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:r}of e)try{n.style.contentVisibility=r}catch{}}}async function Ol(t,e={}){var n,r;let l={styleMap:k.session.styleMap,styleCache:k.session.styleCache,nodeMap:k.session.nodeMap,options:e},i,o="",a="";Wl(t);let s=Il(t);try{Ll(t)}catch(u){console.warn("inlineExternal defs or symbol failed:",u)}try{i=await _t(t,l,e)}catch(u){throw console.warn("deepClone failed:",u),u}finally{s()}try{await ue(t,i,l,e)}catch(u){console.warn("inlinePseudoElements failed:",u)}await Gr(i,l);try{let u=i.querySelectorAll("style[data-sd]");for(let d of u)a+=d.textContent||"",d.remove()}catch(u){V(l,"Failed to extract shadow CSS from style[data-sd]",u)}let c=nr(l.styleMap);o=Array.from(c.entries()).map(([u,d])=>`.${d}{${u}}`).join(""),o=a+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+o;for(let[u,d]of l.styleMap.entries()){if(u.tagName==="STYLE")continue;if(u.getRootNode&&u.getRootNode()instanceof ShadowRoot){u.setAttribute("style",d.replace(/;/g,"; "));continue}let p=c.get(d);p&&u.classList.add(p);let m=(n=u.style)==null?void 0:n.backgroundImage,f=(r=u.dataset)==null?void 0:r.snapdomHasIcon;m&&m!=="none"&&(u.style.backgroundImage=m),f&&(u.style.verticalAlign="middle",u.style.display="inline")}for(let[u,d]of l.nodeMap.entries()){let p=d.scrollLeft,m=d.scrollTop;if((p||m)&&u instanceof HTMLElement){u.style.overflow="hidden",u.style.scrollbarWidth="none",u.style.msOverflowStyle="none";try{let y=u.querySelectorAll("*");for(let x of y){if(!(x instanceof HTMLElement))continue;let $=x.style.position;if($==="fixed"||$==="absolute"){let g=parseFloat(x.style.top)||0,w=parseFloat(x.style.left)||0;x.style.top=`${g+m}px`,x.style.left=`${w+p}px`,$==="fixed"&&(x.style.position="absolute")}}}catch{}let f=document.createElement("div");for(f.style.transform=`translate(${-p}px, ${-m}px)`,f.style.willChange="transform",f.style.display="inline-block",f.style.width="100%";u.firstChild;)f.appendChild(u.firstChild);u.appendChild(f)}}let h=i instanceof HTMLElement&&i.firstElementChild instanceof HTMLElement?i.firstElementChild:i;if(Nl(t,h),t===l.nodeMap.get(i)){let u=l.styleCache.get(t)||ft(t);l.styleCache.set(t,u);let d=Vn(u.transform);i.style.margin="0",i.style.top="auto",i.style.left="auto",i.style.right="auto",i.style.bottom="auto",i.style.animation="none",i.style.transition="none",i.style.willChange="auto",i.style.float="none",i.style.clear="none",i.style.transform=d||""}for(let[u,d]of l.nodeMap.entries())d.tagName==="PRE"&&(u.style.marginTop="0",u.style.marginBlockStart="0");return{clone:i,classCSS:o,styleCache:l.styleCache}}$t();var wn="http://www.w3.org/1999/xlink";function Ul(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(wn,"href"):null)}function jl(t){var e,n,r,l;let i=parseInt(((e=t.dataset)==null?void 0:e.snapdomWidth)||"",10)||0,o=parseInt(((n=t.dataset)==null?void 0:n.snapdomHeight)||"",10)||0,a=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,c=parseFloat(((r=t.style)==null?void 0:r.width)||"")||0,h=parseFloat(((l=t.style)==null?void 0:l.height)||"")||0,u=i||c||a||t.width||t.naturalWidth||100,d=o||h||s||t.height||t.naturalHeight||100;return{width:u,height:d}}async function _l(t,e={}){let n=Array.from(t.querySelectorAll("img")),r=async o=>{if(!o.getAttribute("src")){let d=o.currentSrc||o.src||"";d&&o.setAttribute("src",d)}o.removeAttribute("srcset"),o.removeAttribute("sizes");let a=o.src||"";if(!a)return;let s=await lt(a,{as:"dataURL",useProxy:e.useProxy});if(s.ok&&typeof s.data=="string"&&s.data.startsWith("data:")){o.src=s.data,o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}let{width:c,height:h}=jl(o),{fallbackURL:u}=e||{};if(u)try{let d=typeof u=="function"?await u({width:c,height:h,src:a,element:o}):u;if(d){let p=await lt(d,{as:"dataURL",useProxy:e.useProxy});if(p!=null&&p.ok&&typeof p.data=="string"){o.src=p.data,o.width||(o.width=c),o.height||(o.height=h);return}}}catch{}if(e.placeholders!==!1){let d=document.createElement("div");d.style.cssText=[`width:${c}px`,`height:${h}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${h}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),d.textContent="img",o.replaceWith(d)}else{let d=document.createElement("div");d.style.cssText=`display:inline-block;width:${c}px;height:${h}px;visibility:hidden;`,o.replaceWith(d)}};for(let o=0;o<n.length;o+=4){let a=n.slice(o,o+4).map(r);await Promise.allSettled(a)}let l=Array.from(t.querySelectorAll("image")),i=async o=>{let a=Ul(o);if(!a||a.startsWith("data:")||a.startsWith("blob:"))return;let s=await lt(a,{as:"dataURL",useProxy:e.useProxy});s.ok&&typeof s.data=="string"&&s.data.startsWith("data:")&&(o.setAttribute("href",s.data),o.removeAttribute("xlink:href"),typeof o.removeAttributeNS=="function"&&o.removeAttributeNS(wn,"href"))};for(let o=0;o<l.length;o+=4){let a=l.slice(o,o+4).map(i);await Promise.allSettled(a)}}st();async function Hl(t,e,n,r={}){let l=[[t,e]],i=["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"],o=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],a=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],s=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;l.length;){let[c,h]=l.shift();if(!h)continue;let u=n.get(c)||ft(c);n.has(c)||n.set(c,u);let d=(()=>{let f=u.getPropertyValue("border-image"),y=u.getPropertyValue("border-image-source");return f&&f!=="none"||y&&y!=="none"})();for(let f of a){let y=u.getPropertyValue(f);y&&h.style.setProperty(f,y)}for(let f of i){let y=u.getPropertyValue(f);if(f==="background-image"&&(!y||y==="none")){let g=u.getPropertyValue("background");g&&/url\s*\(/.test(g)&&(y=ee(g).filter(w=>/url\s*\(/.test(w)).join(", ")||y)}if(!y||y==="none")continue;let x=ee(y),$=await Promise.all(x.map(g=>Xe(g,r)));$.some(g=>g&&g!=="none"&&!/^url\(undefined/.test(g))&&h.style.setProperty(f,$.join(", "))}for(let f of o){let y=u.getPropertyValue(f);!y||y==="initial"||h.style.setProperty(f,y)}if(d)for(let f of s){let y=u.getPropertyValue(f);!y||y==="initial"||h.style.setProperty(f,y)}let p=c.shadowRoot?Array.from(c.shadowRoot.children).filter(f=>f.tagName!=="STYLE"):Array.from(c.children),m=Array.from(h.children).filter(f=>{var y,x;return!((y=f.dataset)!=null&&y.snapdomPseudo||f.tagName==="STYLE"&&(x=f.dataset)!=null&&x.sd)});for(let f=0;f<Math.min(p.length,m.length);f++)l.push([p[f],m[f]])}}st();it();function Dl(t){if(!t)return()=>{};let e=[];function n(r){let l=Bl(r);l&&e.push(l);for(let i of r.children||[])n(i)}return n(t),()=>e.forEach(r=>r())}function Bl(t){var e;if(!t)return()=>{};let n=Vl(t);if(n<=0)return()=>{};if(!Xl(t))return()=>{};let r=getComputedStyle(t),l=Math.round(ql(r)*n+zl(r)),i=(e=t.textContent)!=null?e:"",o=i;if(t.scrollHeight<=l+.5)return()=>{};let a=0,s=i.length,c=-1;for(;a<=s;){let h=a+s>>1;t.textContent=i.slice(0,h)+"…",t.scrollHeight<=l+.5?(c=h,a=h+1):s=h-1}return t.textContent=(c>=0?i.slice(0,c):"")+"…",()=>{t.textContent=o}}function Vl(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function ql(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function zl(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Xl(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Nt=[];function bn(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function Yl(...t){let e=t.flat();for(let n of e){let r=bn(n);r&&(Nt.some(l=>l&&l.name&&r.name&&l.name===r.name)||Nt.push(r))}}function xn(t){return(t&&Array.isArray(t.plugins)?t.plugins:Nt)||Nt}async function wt(t,e,n){let r=n,l=xn(e);for(let i of l){let o=i&&typeof i[t]=="function"?i[t]:null;if(!o)continue;let a=await o(e,r);typeof a<"u"&&(r=a)}return r}async function Gl(t,e,n){let r=[],l=xn(e);for(let i of l){let o=i&&typeof i[t]=="function"?i[t]:null;if(!o)continue;let a=await o(e,n);typeof a<"u"&&r.push(a)}return r}function Jl(t){let e=[];if(Array.isArray(t))for(let n of t){let r=bn(n);if(!r||!r.name)continue;let l=e.findIndex(i=>i&&i.name===r.name);l>=0&&e.splice(l,1),e.push(r)}for(let n of Nt)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function Kl(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Jl(e)),t}st();function Ql(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(i){V(n,"stripRootShadows boxShadow",i)}try{e.style.textShadow="none"}catch(i){V(n,"stripRootShadows textShadow",i)}try{e.style.outline="none"}catch(i){V(n,"stripRootShadows outline",i)}let l=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=l.length?l:"none"}catch(i){V(n,"stripRootShadows filter",i)}}function Zl(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let r of n)r.remove()}function ti(t,e={}){let{stripFrameworkDirectives:n=!0}=e,r=new Set(["xml","xlink"]),l=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;l.nextNode();){let i=l.currentNode;for(let o of Array.from(i.attributes)){let a=o.name;if(a.includes("@")){i.removeAttribute(a);continue}if(a.includes(":")){let s=a.split(":",1)[0];if(!r.has(s)){i.removeAttribute(a);continue}}if(n&&(a.startsWith("x-")||a.startsWith("v-")||a.startsWith(":")||a.startsWith("on:")||a.startsWith("bind:")||a.startsWith("let:")||a.startsWith("class:"))){i.removeAttribute(a);continue}}}}function ei(t,e={}){t&&(ti(t,e),Zl(t))}function ni(t){var e;try{let n=((e=t.getAttribute)==null?void 0:e.call(t,"style"))||"";return/\b(height|width|block-size|inline-size)\s*:/.test(n)}catch{return!1}}function ri(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function li(t,e){if(!(t instanceof Element)||ni(t)||ri(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function ii(t,e,n=new Map){function r(l,i){if(!(l instanceof Element)||!(i instanceof Element))return;let o=l.childElementCount>i.childElementCount,a=n.get(l)||getComputedStyle(l);if(n.has(l)||n.set(l,a),o&&li(l,a)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let h=a.overflowY||a.overflowBlock||"visible",u=a.overflowX||a.overflowInline||"visible";(h!=="visible"||u!=="visible")&&(i.style.overflow="visible")}let s=Array.from(l.children),c=Array.from(i.children);for(let h=0;h<Math.min(s.length,c.length);h++)r(s[h],c[h])}r(t,e)}function oi(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function ai(t,e){if(!(t instanceof Element))return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){V(e,"exclude selector match failed",r)}return!1}function si(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),l=1/0,i=-1/0,o=!1,a=Array.from(t.children);for(let p of a){if(ai(p,e)||!oi(p))continue;let m=p.getBoundingClientRect(),f=m.top-r.top,y=m.bottom-r.top;y<=f||(f<l&&(l=f),y>i&&(i=y),o=!0)}let s=o?Math.max(0,i-l):0,c=parseFloat(n.borderTopWidth)||0,h=parseFloat(n.borderBottomWidth)||0,u=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return c+h+u+d+s}var L=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,ui=/::-webkit-scrollbar(-[a-z]+)?\b/i;function ce(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let l=t[r];try{if(l.type===CSSRule.IMPORT_RULE&&l.styleSheet){n+=ce(l.styleSheet.cssRules,e);continue}if(l.type===CSSRule.MEDIA_RULE&&l.cssRules){let i=ce(l.cssRules,e);i&&(n+=`@media ${l.conditionText}{${i}}`);continue}if(l.type===CSSRule.STYLE_RULE){let i=l.selectorText||"";if(ui.test(i)){let o=l.cssText;o&&!e.has(o)&&(e.add(o),n+=o)}}}catch{}}return n}function ci(t){if(!t||!t.styleSheets)return"";let e=new Set,n="";for(let r of Array.from(t.styleSheets))try{let l=r.cssRules;l&&(n+=ce(l,e))}catch{}return n}function di(t){var e;let n=t.boxShadow||"";if(!n||n==="none")return{top:0,right:0,bottom:0,left:0};let r=n.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(s=>s.trim()),l=0,i=0,o=0,a=0;for(let s of r){let c=((e=s.match(/-?\d+(\.\d+)?px/g))==null?void 0:e.map(y=>parseFloat(y)))||[];if(c.length<2)continue;let[h,u,d=0,p=0]=c,m=Math.abs(h)+d+p,f=Math.abs(u)+d+p;i=Math.max(i,m+Math.max(h,0)),a=Math.max(a,m+Math.max(-h,0)),o=Math.max(o,f+Math.max(u,0)),l=Math.max(l,f+Math.max(-u,0))}return{top:Math.ceil(l),right:Math.ceil(i),bottom:Math.ceil(o),left:Math.ceil(a)}}function fi(t){let e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function mi(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function hi(t){var e;let n=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!n||n==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=n.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],l=0,i=0,o=0,a=0,s=!1;for(let c of r){s=!0;let h=((e=c.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:e.map(y=>parseFloat(y)))||[],[u=0,d=0,p=0]=h,m=Math.abs(u)+p,f=Math.abs(d)+p;i=Math.max(i,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),o=Math.max(o,f+Math.max(d,0)),l=Math.max(l,f+Math.max(-d,0))}return{bleed:{top:L(l),right:L(i),bottom:L(o),left:L(a)},has:s}}function pi(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(r==="none")try{let a=vn(t);if(a.a===1&&a.b===0&&a.c===0&&a.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}function l(a,s,c,h){let u=Math.sqrt(a*a+s*s)||0,d=0,p=0;if(u>0){let m=a/u,f=s/u;d=m*c+f*h;let y=c-m*d,x=h-f*d;p=Math.sqrt(y*y+x*x)||0,p>0?d=d/p:d=0}return{a:u,b:0,c:d*p,d:p}}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let a=i[1].split(",").map(s=>parseFloat(s.trim()));if(a.length===6&&a.every(Number.isFinite)){let[s,c,h,u]=a,d=l(s,c,h,u);try{e.style.transform=`matrix(${d.a}, ${d.b}, ${d.c}, ${d.d}, 0, 0)`}catch{}return d}}let o=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(o){let a=o[1].split(",").map(s=>parseFloat(s.trim()));if(a.length===16&&a.every(Number.isFinite)){let s=a[0],c=a[1],h=a[4],u=a[5],d=l(s,c,h,u);try{e.style.transform=`matrix(${d.a}, ${d.b}, ${d.c}, ${d.d}, 0, 0)`}catch{}return d}}try{let a=new DOMMatrix(r),s=l(a.a,a.b,a.c,a.d);try{e.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}catch{return null}}function Ve(t,e,n,r,l){let i=n.a,o=n.b,a=n.c,s=n.d,c=n.e||0,h=n.f||0;function u(x,$){let g=x-r,w=$-l,S=i*g+a*w,b=o*g+s*w;return S+=r+c,b+=l+h,[S,b]}let d=[u(0,0),u(t,0),u(0,e),u(t,e)],p=1/0,m=1/0,f=-1/0,y=-1/0;for(let[x,$]of d)x<p&&(p=x),$<m&&(m=$),x>f&&(f=x),$>y&&(y=$);return{minX:p,minY:m,maxX:f,maxY:y,width:f-p,height:y-m}}function gi(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[l,i]=[r[0]||"0",r[1]||"0"],o=(a,s)=>{let c=a.toLowerCase();return c==="left"||c==="top"?0:c==="center"?s/2:c==="right"||c==="bottom"?s:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*s/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:o(l,e),oy:o(i,n)}}function yi(t){var e,n,r,l,i,o,a,s;let c={rotate:"0deg",scale:null,translate:null},h=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(h){let d=y=>{try{return typeof h.has=="function"&&!h.has(y)||typeof h.get!="function"?null:h.get(y)}catch{return null}},p=d("rotate");if(p)if(p.angle){let y=p.angle;c.rotate=y.unit==="rad"?y.value*180/Math.PI+"deg":y.value+y.unit}else p.unit?c.rotate=p.unit==="rad"?p.value*180/Math.PI+"deg":p.value+p.unit:c.rotate=String(p);else{let y=getComputedStyle(t);c.rotate=y.rotate&&y.rotate!=="none"?y.rotate:"0deg"}let m=d("scale");if(m){let y="x"in m&&((e=m.x)==null?void 0:e.value)!=null?m.x.value:Array.isArray(m)?(n=m[0])==null?void 0:n.value:Number(m)||1,x="y"in m&&((r=m.y)==null?void 0:r.value)!=null?m.y.value:Array.isArray(m)?(l=m[1])==null?void 0:l.value:y;c.scale=`${y} ${x}`}else{let y=getComputedStyle(t);c.scale=y.scale&&y.scale!=="none"?y.scale:null}let f=d("translate");if(f){let y="x"in f&&"value"in f.x?f.x.value:Array.isArray(f)?(i=f[0])==null?void 0:i.value:0,x="y"in f&&"value"in f.y?f.y.value:Array.isArray(f)?(o=f[1])==null?void 0:o.value:0,$="x"in f&&(a=f.x)!=null&&a.unit?f.x.unit:"px",g="y"in f&&(s=f.y)!=null&&s.unit?f.y.unit:"px";c.translate=`${y}${$} ${x}${g}`}else{let y=getComputedStyle(t);c.translate=y.translate&&y.translate!=="none"?y.translate:null}return c}let u=getComputedStyle(t);return c.rotate=u.rotate&&u.rotate!=="none"?u.rotate:"0deg",c.scale=u.scale&&u.scale!=="none"?u.scale:null,c.translate=u.translate&&u.translate!=="none"?u.translate:null,c}var Qt=null;function wi(){if(Qt)return Qt;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),Qt=t,t}function bi(t){let e=wi(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let r=vn(n);return e.removeChild(n),r}function xi(t){let e=getComputedStyle(t),n=e.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=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",l=e.scale&&e.scale!=="none"&&e.scale!=="1",i=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||l||i)}function vn(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}async function Sn(t,e){var n,r;if(!t)throw new Error("Element cannot be null or undefined");Bn(e.cache);let l=e.fast,i=e.outerTransforms!==!1,o=!!e.outerShadows,a={element:t,options:e,plugins:e.plugins},s,c,h,u="",d="",p,m,f=null;await wt("beforeSnap",a),await wt("beforeClone",a);let y=Dl(a.element);try{({clone:s,classCSS:c,styleCache:h}=await Ol(a.element,a.options)),!i&&s&&(f=pi(a.element,s)),!o&&s&&Ql(a.element,s,a.options)}finally{y()}if(a=O({clone:s,classCSS:c,styleCache:h},a),await wt("afterClone",a),ei(a.clone),((n=a.options)==null?void 0:n.excludeMode)==="remove")try{ii(a.element,a.clone,a.styleCache)}catch(S){console.warn("[snapdom] shrink pass failed:",S)}try{await ll(a.clone,a.element)}catch{}await new Promise(S=>{Ct(async()=>{await _l(a.clone,a.options),S()},{fast:l})}),await new Promise(S=>{Ct(async()=>{await Hl(a.element,a.clone,a.styleCache,a.options),S()},{fast:l})}),e.embedFonts&&await new Promise(S=>{Ct(async()=>{let b=pn(a.element),C=vl(a.element);if(xt()){let v=new Set(Array.from(b).map(F=>String(F).split("__")[0]).filter(Boolean));await gn(v,1)}u=await xl({required:b,usedCodepoints:C,exclude:a.options.excludeFonts,useProxy:a.options.useProxy,fontStylesheetDomains:a.options.fontStylesheetDomains}),S()},{fast:l})});let x=tr(a.clone).sort(),$=x.join(",");k.baseStyle.has($)?d=k.baseStyle.get($):await new Promise(S=>{Ct(()=>{d=er(x),k.baseStyle.set($,d),S()},{fast:l})});let g=ci(((r=a.element)==null?void 0:r.ownerDocument)||document);a=O({fontsCSS:u,baseCSS:d,scrollbarCSS:g},a),await wt("beforeRender",a),await new Promise(S=>{Ct(()=>{var b,C,v,F,E,D;let U=ft(a.element),B=a.element.getBoundingClientRect(),W=Math.max(1,L(a.element.offsetWidth||parseFloat(U.width)||B.width||1)),I=Math.max(1,L(a.element.offsetHeight||parseFloat(U.height)||B.height||1)),z=a.element.ownerDocument||document;if(a.element===z.body||a.element===z.documentElement){let Q=Math.max(a.element.scrollHeight||0,((b=z.documentElement)==null?void 0:b.scrollHeight)||0,((C=z.body)==null?void 0:C.scrollHeight)||0),et=Math.max(a.element.scrollWidth||0,((v=z.documentElement)==null?void 0:v.scrollWidth)||0,((F=z.body)==null?void 0:F.scrollWidth)||0);Q>0&&(I=Math.max(I,L(Q))),et>0&&(W=Math.max(W,L(et)));try{let ot=(a.scrollbarCSS||"").length+(a.baseCSS||"").length+(a.fontsCSS||"").length+(a.classCSS||"").length,ut=k.measureHints.get(a.element);if(ut&&ut.cssLen===ot&&ut.w0===W)ut.csh>0&&(I=Math.max(I,L(ut.csh))),ut.csw>0&&(W=Math.max(W,L(ut.csw)));else{let ct=z.createElement("div");ct.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+W+"px!important;overflow:visible!important;visibility:hidden!important;";let Wt=z.createElement("style");Wt.textContent=(a.scrollbarCSS||"")+a.baseCSS+a.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a.classCSS,ct.appendChild(Wt),ct.appendChild(a.clone.cloneNode(!0)),z.body.appendChild(ct);let yt=ct.scrollHeight,Jt=ct.scrollWidth;z.body.removeChild(ct),k.measureHints.set(a.element,{cssLen:ot,w0:W,csh:yt,csw:Jt}),yt>0&&(I=Math.max(I,L(yt))),Jt>0&&(W=Math.max(W,L(Jt)))}}catch{}}if(((E=a.options)==null?void 0:E.excludeMode)==="remove"){let Q=si(a.element,a.options);Number.isFinite(Q)&&Q>0&&(I=Math.max(1,Math.min(I,L(Q+1))))}let mt=(Q,et=NaN)=>{let ot=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(ot)?ot:et},M=mt(a.options.width),P=mt(a.options.height),T=W,_=I,A=Number.isFinite(M),N=Number.isFinite(P),j=I>0?W/I:1;A&&N?(T=Math.max(1,L(M)),_=Math.max(1,L(P))):A?(T=Math.max(1,L(M)),_=Math.max(1,L(T/(j||1)))):N?(_=Math.max(1,L(P)),T=Math.max(1,L(_*(j||1)))):(T=W,_=I);let R=0,X=0,Y=W,Z=I;if(!i&&f&&Number.isFinite(f.a)){let Q={a:f.a,b:f.b||0,c:f.c||0,d:f.d||1,e:0,f:0},et=Ve(W,I,Q,0,0);R=L(et.minX),X=L(et.minY),Y=L(et.maxX),Z=L(et.maxY)}else if(i&&qe(a.element)){let Q=U.transform&&U.transform!=="none"?U.transform:"",et=yi(a.element),ot=bi({baseTransform:Q,rotate:et.rotate||"0deg",scale:et.scale,translate:et.translate}),{ox:ut,oy:ct}=gi(U,W,I),Wt=ot.is2D?ot:new DOMMatrix(ot.toString()),yt=Ve(W,I,Wt,ut,ct);R=L(yt.minX),X=L(yt.minY),Y=L(yt.maxX),Z=L(yt.maxY)}let tt=di(U),H=fi(U),G=mi(U),K=hi(U),ht=o?{top:L(tt.top+H.top+G.top+K.bleed.top),right:L(tt.right+H.right+G.right+K.bleed.right),bottom:L(tt.bottom+H.bottom+G.bottom+K.bleed.bottom),left:L(tt.left+H.left+G.left+K.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=L(R-ht.left),X=L(X-ht.top),Y=L(Y+ht.right),Z=L(Z+ht.bottom);let ge=Math.max(1,L(Y-R)),ye=Math.max(1,L(Z-X)),Mn=A||N?L(T/W):1,$n=N||A?L(_/I):1,kn=Math.max(1,L(ge*Mn)),An=Math.max(1,L(ye*$n)),we="http://www.w3.org/2000/svg",En=xt()&&qe(a.element)?1:0,pt=L(En+(i?0:1)),gt=document.createElementNS(we,"foreignObject"),Fn=L(R),Ln=L(X);gt.setAttribute("x",String(L(-(Fn-pt)))),gt.setAttribute("y",String(L(-(Ln-pt)))),gt.setAttribute("width",String(L(W+pt*2))),gt.setAttribute("height",String(L(I+pt*2))),gt.style.overflow="visible";let be=document.createElement("style"),Nn='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';be.textContent=(a.scrollbarCSS||"")+a.baseCSS+a.fontsCSS+Nn+a.classCSS,gt.appendChild(be);let Tt=document.createElement("div");Tt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Tt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${L(W)}px;height:${L(I)}px`,Tt.appendChild(a.clone),gt.appendChild(Tt);let Pn=new XMLSerializer().serializeToString(gt),Yt=L(ge+pt*2),Gt=L(ye+pt*2),xe=A||N;e.meta={w0:W,h0:I,vbW:Yt,vbH:Gt,targetW:T,targetH:_};let Rn=xt()&&xe?Yt:L(kn+pt*2),Tn=xt()&&xe?Gt:L(An+pt*2),Wn=parseFloat((D=ft(z.documentElement))==null?void 0:D.fontSize)||16;m=`<svg xmlns="${we}" width="${Rn}" height="${Tn}" viewBox="0 0 ${Yt} ${Gt}" font-size="${Wn}px">`+Pn+"</svg>",p=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,a=O({svgString:m,dataURL:p},a),S()},{fast:l})}),await wt("afterRender",a);let w=document.getElementById("snapdom-sandbox");return w&&w.style.position==="absolute"&&w.remove(),a.dataURL}function qe(t){return xi(t)}it();function vi(t={}){var e,n,r,l,i,o,a,s,c,h,u,d,p,m,f,y,x,$,g,w,S,b;let C=(e=t.format)!=null?e:"png";C==="jpg"&&(C="jpeg");let v=Dn(t.cache);return{debug:(n=t.debug)!=null?n:!1,fast:(r=t.fast)!=null?r:!0,scale:(l=t.scale)!=null?l:1,exclude:(i=t.exclude)!=null?i:[],excludeMode:(o=t.excludeMode)!=null?o:"hide",filter:(a=t.filter)!=null?a:null,filterMode:(s=t.filterMode)!=null?s:"hide",placeholders:t.placeholders!==!1,embedFonts:(c=t.embedFonts)!=null?c:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(h=t.excludeFonts)!=null?h:void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:(u=t.fallbackURL)!=null?u:void 0,cache:v,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(d=t.width)!=null?d:null,height:(p=t.height)!=null?p:null,format:C,type:(m=t.type)!=null?m:"svg",quality:(f=t.quality)!=null?f:.92,dpr:(y=t.dpr)!=null?y:window.devicePixelRatio||1,backgroundColor:(x=t.backgroundColor)!=null?x:["jpeg","webp"].includes(C)?"#ffffff":null,filename:($=t.filename)!=null?$:"snapDOM",outerTransforms:(g=t.outerTransforms)!=null?g:!0,outerShadows:(w=t.outerShadows)!=null?w:!1,safariWarmupAttempts:Math.min(3,Math.max(1,((S=t.safariWarmupAttempts)!=null?S:3)|0)),excludeStyleProps:(b=t.excludeStyleProps)!=null?b:null}}Rt();Ze();st();$t();it();function Si(...t){return Yl(...t),q}var q=Object.assign(Mi,{plugins:Si}),Cn=Symbol("snapdom.internal"),Ci=Symbol("snapdom.internal.silent"),ze=!1;async function Mi(t,e){var n;if(!t)throw new Error("Element cannot be null or undefined");let r=vi(e);if(Kl(r,e&&e.plugins),xt()&&(r.embedFonts===!0||ki(t))){if(r.embedFonts)try{let i=pn(t),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await gn(o,1)}catch{}let l=(n=r.safariWarmupAttempts)!=null?n:3;for(let i=0;i<l;i++)try{await $i(t,e)}catch{}}return r.iconFonts&&r.iconFonts.length>0&&Kr(r.iconFonts),r.snap||(r.snap={toPng:(l,i)=>q.toPng(l,i),toSvg:(l,i)=>q.toSvg(l,i)}),q.capture(t,r,Cn)}q.capture=async(t,e,n)=>{if(n!==Cn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Sn(t,e),l={img:async(f,y)=>{let{toImg:x}=await Promise.resolve().then(()=>(ke(),ne));return x(r,O(O({},f),y||{}))},svg:async(f,y)=>{let{toSvg:x}=await Promise.resolve().then(()=>(ke(),ne));return x(r,O(O({},f),y||{}))},canvas:async(f,y)=>{let{toCanvas:x}=await Promise.resolve().then(()=>(Xt(),tn));return x(r,O(O({},f),y||{}))},blob:async(f,y)=>{let{toBlob:x}=await Promise.resolve().then(()=>(on(),rn));return x(r,O(O({},f),y||{}))},png:async(f,y)=>{let{rasterize:x}=await Promise.resolve().then(()=>(jt(),Ut));return x(r,J(O(O({},f),y||{}),{format:"png"}))},jpeg:async(f,y)=>{let{rasterize:x}=await Promise.resolve().then(()=>(jt(),Ut));return x(r,J(O(O({},f),y||{}),{format:"jpeg"}))},webp:async(f,y)=>{let{rasterize:x}=await Promise.resolve().then(()=>(jt(),Ut));return x(r,J(O(O({},f),y||{}),{format:"webp"}))},download:async(f,y)=>{let{download:x}=await Promise.resolve().then(()=>(pr(),an));return x(r,O(O({},f),y||{}))}},i={};for(let f of["img","svg","canvas","blob","png","jpeg","webp"])i[f]=async y=>l[f](e,J(O({},y||{}),{[Ci]:!0}));i.jpg=i.jpeg;let o=J(O({},e),{export:{url:r},exports:i}),a=await Gl("defineExports",o),s=Object.assign({},...a.filter(f=>f&&typeof f=="object")),c=O(O({},l),s);c.jpeg&&!c.jpg&&(c.jpg=(f,y)=>c.jpeg(f,y));function h(f,y){let x=O(O({},e),y||{});return(f==="jpeg"||f==="jpg")&&(x.backgroundColor==null||x.backgroundColor==="transparent")&&(x.backgroundColor="#ffffff"),x}let u=!1,d=Promise.resolve();async function p(f,y){let x=async()=>{let $=c[f];if(!$)throw new Error(`[snapdom] Unknown export type: ${f}`);let g=h(f,y),w=J(O({},e),{export:{type:f,options:g,url:r}});await wt("beforeExport",w);let S=await $(w,g);return await wt("afterExport",w,S),u||(u=!0,await wt("afterSnap",e)),S};return d=d.then(x)}let m={url:r,toRaw:()=>r,to:(f,y)=>p(f,y),toImg:f=>p("img",f),toSvg:f=>p("svg",f),toCanvas:f=>p("canvas",f),toBlob:f=>p("blob",f),toPng:f=>p("png",f),toJpg:f=>p("jpg",f),toWebp:f=>p("webp",f),download:f=>p("download",f)};for(let f of Object.keys(c)){let y="to"+f.charAt(0).toUpperCase()+f.slice(1);m[y]||(m[y]=x=>p(f,x))}return m};q.toRaw=(t,e)=>q(t,e).then(n=>n.toRaw());q.toImg=(t,e)=>q(t,e).then(n=>n.toImg());q.toSvg=(t,e)=>q(t,e).then(n=>n.toSvg());q.toCanvas=(t,e)=>q(t,e).then(n=>n.toCanvas());q.toBlob=(t,e)=>q(t,e).then(n=>n.toBlob());q.toPng=(t,e)=>q(t,J(O({},e),{format:"png"})).then(n=>n.toPng());q.toJpg=(t,e)=>q(t,J(O({},e),{format:"jpeg"})).then(n=>n.toJpg());q.toWebp=(t,e)=>q(t,J(O({},e),{format:"webp"})).then(n=>n.toWebp());q.download=(t,e)=>q(t,e).then(n=>n.download());async function $i(t,e){if(ze)return;let n=J(O({},e),{fast:!0,embedFonts:!0,scale:.2}),r;try{r=await Sn(t,n)}catch(l){V(e,"safariWarmup pre-capture failed",l)}await new Promise(l=>requestAnimationFrame(()=>requestAnimationFrame(l))),r&&await new Promise(l=>{let i=new Image;try{i.decoding="sync",i.loading="eager"}catch(o){V(e,"safariWarmup img hints failed",o)}i.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",i.src=r,document.body.appendChild(i),(async()=>{try{typeof i.decode=="function"&&await i.decode()}catch(a){V(e,"safariWarmup img.decode failed",a)}let o=performance.now();for(;!(i.complete&&i.naturalWidth>0)&&performance.now()-o<900;)await new Promise(a=>setTimeout(a,200));await new Promise(a=>requestAnimationFrame(a));try{let a=document.createElement("canvas");a.width=Math.max(1,i.naturalWidth||10),a.height=Math.max(1,i.naturalHeight||10);let s=a.getContext("2d");s&&s.drawImage(i,0,0)}catch{}await new Promise(a=>requestAnimationFrame(a));try{i.remove()}catch(a){V(e,"safariWarmup img.remove failed",a)}l()})()}),t.querySelectorAll("canvas").forEach(l=>{try{let i=l.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){V(e,"safariWarmup canvas poke failed",i)}}),ze=!0}function ki(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,r=getComputedStyle(n),l=r.backgroundImage&&r.backgroundImage!=="none",i=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(l||i||n.tagName==="CANVAS")return!0}return!1}exports.snapdom=q;
|
|
9
|
+
//# sourceMappingURL=snapdom-6yvsn_Iv-OVmChxqF.cjs.map
|