@zumer/snapdom 1.9.12-dev.0 → 1.9.12-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- (()=>{var Le=Object.defineProperty,Te=Object.defineProperties;var Ie=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var Ne=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var ie=(t,e,n)=>e in t?Le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e)=>{for(var n in e||(e={}))Ne.call(e,n)&&ie(t,n,e[n]);if(se)for(var n of se(e))_e.call(e,n)&&ie(t,n,e[n]);return t},K=(t,e)=>Te(t,Ie(e));var $=(t,e,n)=>new Promise((o,r)=>{var a=i=>{try{c(n.next(i))}catch(u){r(u)}},s=i=>{try{c(n.throw(i))}catch(u){r(u)}},c=i=>i.done?o(i.value):Promise.resolve(i.value).then(a,s);c((n=n.apply(t,e)).next())});var h={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Mt(t="soft"){switch(t){case"auto":{h.session.styleMap=new Map,h.session.nodeMap=new Map;return}case"soft":{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap,h.computedStyle=new WeakMap,h.baseStyle=new Map,h.defaultStyle=new Map,h.image=new Map,h.background=new Map,h.resource=new Map,h.font=new Set;return}default:{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap;return}}}function dt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Ot(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(a=>a.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(a=>a.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function lt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function Ue(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function a(s,c,i){if(r>=n)return;let u=Date.now();(o.get(c)||0)>u||(o.set(c,u+e),r++,s==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(s,c){a("warn",s,c)},errorOnce(s,c){a("error",s,c)},reset(){o.clear(),r=0}}}var ce=Ue("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Dt=new Map,vt=new Map;function Pe(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Be(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,r=new URL(o||".",n),a=new URL(t,n);if(a.origin===r.origin)return!0;let s=a.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch(n){}return!1}function We(t,e){if(!e||Pe(t)||Be(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location!="undefined"?o.origin!==location.origin:!0}catch(n){return!!e}}function Oe(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",lt(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}${lt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function le(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function De(t,e){var n,o;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(o=e.errorTTL)!=null?o:8e3,t].join("|")}function V(n){return $(this,arguments,function*(t,e={}){var x,F,P;let o=(x=e.as)!=null?x:"blob",r=(F=e.timeout)!=null?F:3e3,a=e.useProxy||"",s=(P=e.errorTTL)!=null?P:8e3,c=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(o==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(o==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,M="",k=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],_=/;base64/i.test(M)?atob(k):decodeURIComponent(k),L=new Uint8Array([..._].map(D=>D.charCodeAt(0))),T=new Blob([L],{type:(M||"").split(";")[0]||""});return{ok:!0,data:T,status:200,url:t,fromCache:!1,mime:T.type||""}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let M=yield fetch(t);if(!M.ok)return{ok:!1,data:null,status:M.status,url:t,fromCache:!1,reason:"http_error"};let k=yield M.blob(),C=k.type||M.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield le(k),status:M.status,url:t,fromCache:!1,mime:C}:o==="text"?{ok:!0,data:yield k.text(),status:M.status,url:t,fromCache:!1,mime:C}:{ok:!0,data:k,status:M.status,url:t,fromCache:!1,mime:C}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return o==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:o==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let u=De(t,{as:o,timeout:r,useProxy:a,errorTTL:s}),f=vt.get(u);if(f&&f.until>Date.now())return K(z({},f.result),{fromCache:!0});f&&vt.delete(u);let m=Dt.get(u);if(m)return m;let b=We(t,a)?Oe(t,a):t,S=e.credentials;if(!S)try{let M=typeof location!="undefined"&&location.href?location.href:"http://localhost/",k=new URL(t,M);S=typeof location!="undefined"&&k.origin===location.origin?"include":"omit"}catch(M){S="omit"}let E=new AbortController,l=setTimeout(()=>E.abort("timeout"),r),p=$(null,null,function*(){var M,k;try{let C=yield fetch(b,{signal:E.signal,credentials:S,headers:c});if(!C.ok){let T={ok:!1,data:null,status:C.status,url:b,fromCache:!1,reason:"http_error"};if(s>0&&vt.set(u,{until:Date.now()+s,result:T}),!i){let D=`${C.status} ${C.statusText||""}`.trim();ce.warnOnce(`http:${C.status}:${o}:${new URL(t,(M=location==null?void 0:location.href)!=null?M:"http://localhost/").origin}`,`HTTP error ${D} while fetching ${o} ${t}`)}return e.onError&&e.onError(T),T}if(o==="text")return{ok:!0,data:yield C.text(),status:C.status,url:b,fromCache:!1};let _=yield C.blob(),L=_.type||C.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield le(_),status:C.status,url:b,fromCache:!1,mime:L}:{ok:!0,data:_,status:C.status,url:b,fromCache:!1,mime:L}}catch(C){let _=C&&typeof C=="object"&&"name"in C&&C.name==="AbortError"?String(C.message||"").includes("timeout")?"timeout":"abort":"network",L={ok:!1,data:null,status:0,url:b,fromCache:!1,reason:_};if(!/^blob:/i.test(t)&&s>0&&vt.set(u,{until:Date.now()+s,result:L}),!i){let T=`${_}:${o}:${new URL(t,(k=location==null?void 0:location.href)!=null?k:"http://localhost/").origin}`,D=_==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:_==="abort"?`Request aborted while fetching ${o} ${t}`:`Network/CORS issue while fetching ${o} ${t}. A proxy may be required`;ce.errorOnce(T,D)}return e.onError&&e.onError(L),L}finally{clearTimeout(l),Dt.delete(u)}});return Dt.set(u,p),p})}function mt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}function ht(n){return $(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=dt(t);if(!r)return t;let a=lt(r);if(h.background.has(a)){let s=h.background.get(a);return s?`url("${s}")`:"none"}try{let s=yield V(a,{as:"dataURL",useProxy:e.useProxy});return s.ok?(h.background.set(a,s.data),`url("${s.data}")`):(h.background.set(a,null),"none")}catch(s){return h.background.set(a,null),"none"}})}var Rt=new Set(["meta","script","noscript","title","link","template"]),bt=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"]),qe=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function qt(){for(let t of qe){let e=String(t).toLowerCase();Rt.has(e)||bt.has(e)||Ht(e)}}function Ht(t){if(t=String(t).toLowerCase(),bt.has(t)){let a={};return h.defaultStyle.set(t,a),a}if(h.defaultStyle.has(t))return h.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 o=getComputedStyle(n),r={};for(let a of o){if(fe(a))continue;let s=o.getPropertyValue(a);r[a]=s}return e.removeChild(n),h.defaultStyle.set(t,r),r}var He=/(?:^|-)(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,ze=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"]);function fe(t){let e=String(t).toLowerCase();return!!(ze.has(e)||je.test(e)||He.test(e))}function St(t,e){if(e=String(e||"").toLowerCase(),bt.has(e))return"";let n=[],o=Ht(e);for(let[r,a]of Object.entries(t)){if(fe(r))continue;let s=o[r];a&&a!==s&&n.push(`${r}:${a}`)}return n.sort(),n.join(";")}function jt(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 zt(t){let e=new Map;for(let o of t){let r=h.defaultStyle.get(o);if(!r)continue;let a=Object.entries(r).map(([s,c])=>`${s}:${c};`).sort().join("");a&&(e.has(a)||e.set(a,[]),e.get(a).push(o))}let n="";for(let[o,r]of e.entries())n+=`${r.join(",")} { ${o} }
2
- `;return n}function Vt(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function pt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=h.computedStyle.get(t);if(n||(n=new Map,h.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Gt(t){let e=t.replace(/^['"]|['"]$/g,"");if(e.startsWith("\\"))try{return String.fromCharCode(parseInt(e.replace("\\",""),16))}catch(n){return e}return e}function Ft(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function gt(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let a=t[r];a==="("&&n++,a===")"&&n--,a===","&&n===0&&(e.push(t.slice(o,r).trim()),o=r+1)}return e.push(t.slice(o).trim()),e}function st(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function it(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var ue=new WeakMap,Kt=new Map,Xt=0;function Ct(){Xt++}var de=!1;function Ve(t=document.documentElement){var e,n;if(!de){de=!0;try{new MutationObserver(()=>Ct()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{new MutationObserver(()=>Ct()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{let o=document.fonts;o&&((e=o.addEventListener)==null||e.call(o,"loadingdone",Ct),(n=o.ready)==null||n.then(()=>Ct()).catch(()=>{}))}catch(o){}}}function Ge(t){let e={},n=t.getPropertyValue("visibility");for(let o=0;o<t.length;o++){let r=t[o],a=t.getPropertyValue(r);(r==="background-image"||r==="content")&&a.includes("url(")&&!a.includes("data:")&&(a="none"),e[r]=a}return n==="hidden"&&(e.opacity="0"),e}var me=new WeakMap;function Ke(t){let e=me.get(t);return e||(e=Object.entries(t).sort((o,r)=>o[0]<r[0]?-1:o[0]>r[0]?1:0).map(([o,r])=>`${o}:${r}`).join(";"),me.set(t,e),e)}function Xe(t,e=null){let n=ue.get(t);if(n&&n.epoch===Xt)return n.snapshot;let o=e||getComputedStyle(t),r=Ge(o);return ue.set(t,{epoch:Xt,snapshot:r}),r}function Ye(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Kt,defaultStyle:h.defaultStyle,baseStyle:h.baseStyle,image:h.image,resource:h.resource,background:h.background,font:h.font},options:e||{}}:{session:h.session,persist:{snapshotKeyCache:Kt,defaultStyle:h.defaultStyle,baseStyle:h.baseStyle,image:h.image,resource:h.resource,background:h.background,font:h.font},options:t||e||{}}}function yt(t,e,n,o){return $(this,null,function*(){var b,S,E;if(t.tagName==="STYLE")return;let r=Ye(n,o),a=r.options&&r.options.cache||"auto";if(a!=="disabled"&&Ve(document.documentElement),a==="disabled"&&!r.session.__bumpedForDisabled&&(Ct(),Kt.clear(),r.session.__bumpedForDisabled=!0),bt.has((b=t.tagName)==null?void 0:b.toLowerCase())){let l=(S=t.getAttribute)==null?void 0:S.call(t,"style");l&&e.setAttribute("style",l)}let{session:s,persist:c}=r;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let i=s.styleCache.get(t),u=Xe(t,i),f=Ke(u),m=c.snapshotKeyCache.get(f);if(!m){let l=((E=t.tagName)==null?void 0:E.toLowerCase())||"div";m=St(u,l),c.snapshotKeyCache.set(f,m)}s.styleMap.set(e,m)})}function Yt(t,e,n){return Promise.all(t.map(o=>new Promise(r=>{function a(){st(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(o,r):a()},{fast:n})}a()})))}function Je(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Qe(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Je(o):o;return`:where(${e} ${r})`}).join(", ")}function Ze(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,a)=>{let s=Qe(a,e,!0);return`${o}${r}${s}{`}),t):""}function tn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function en(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
3
- `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let r of o.cssRules)e+=r.cssText+`
4
- `}catch(r){}}catch(n){}return e}function nn(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function on(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(n){}}function rn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function an(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch(n){}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch(n){}return""}function sn(t,e,n){let o=[];for(let r of e){let a=an(t,r);a&&o.push(`${r}: ${a};`)}return o.length?`${n}{${o.join("")}}
5
- `:""}function cn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function ln(t,e=3){return $(this,null,function*(){let n=()=>{var a;try{return t.contentDocument||((a=t.contentWindow)==null?void 0:a.document)||null}catch(s){return null}},o=n(),r=0;for(;r<e&&(!o||!o.body&&!o.documentElement);)yield new Promise(a=>setTimeout(a,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null})}function fn(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,a=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,o=parseFloat(i.borderRightWidth)||0,r=parseFloat(i.borderTopWidth)||0,a=parseFloat(i.borderBottomWidth)||0}catch(i){}let s=Math.max(0,Math.round(e.width-(n+o))),c=Math.max(0,Math.round(e.height-(r+a)));return{contentWidth:s,contentHeight:c,rect:e}}function un(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.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(o),()=>{try{o.remove()}catch(r){}}}function dn(t,e,n){return $(this,null,function*(){let o=yield ln(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:a,rect:s}=fn(t),c=n==null?void 0:n.snap;if(!c||typeof c.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=K(z({},n),{scale:1}),u=un(o,r,a),f;try{f=yield c.toPng(o.documentElement,i)}finally{u()}f.style.display="block",f.style.width=`${r}px`,f.style.height=`${a}px`;let m=document.createElement("div");return e.nodeMap.set(m,t),yt(t,m,e,n),m.style.overflow="hidden",m.style.display="block",m.style.width||(m.style.width=`${Math.round(s.width)}px`),m.style.height||(m.style.height=`${Math.round(s.height)}px`),m.appendChild(f),m})}function At(t,e,n){return $(this,null,function*(){var u,f,m,b,S,E;if(!t)throw new Error("Invalid node");let o=new Set,r=null,a=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Rt.has(l))return 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==="visuallyHide"){let l=document.createElement("div"),p=t.getBoundingClientRect();return l.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,l}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let l of n.exclude)try{if((u=t.matches)!=null&&u.call(t,l)){if(n.excludeMode==="visuallyHide"){let p=document.createElement("div"),x=t.getBoundingClientRect();return p.style.cssText=`display:inline-block;width:${x.width}px;height:${x.height}px;visibility:hidden;`,p}else if(n.excludeMode==="remove")return null}}catch(p){console.warn(`Invalid selector in exclude option: ${l}`,p)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="visuallyHide"){let l=document.createElement("div"),p=t.getBoundingClientRect();return l.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,l}else if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(t.tagName==="IFRAME"){let l=!1;try{l=!!(t.contentDocument||(f=t.contentWindow)!=null&&f.document)}catch(p){l=!1}if(l)try{return yield dn(t,e,n)}catch(p){console.warn("[SnapDOM] iframe rasterization failed, fallback:",p)}if(n.placeholders){let p=document.createElement("div");return p.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,yt(t,p,e,n),p}else{let p=t.getBoundingClientRect(),x=document.createElement("div");return x.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,yt(t,x,e,n),x}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),yt(t,l,e,n);let p=document.createElement("div");return p.textContent=t.getAttribute("data-placeholder-text")||"",p.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(p),l}if(t.tagName==="CANVAS"){let l=t.toDataURL(),p=document.createElement("img");return p.src=l,p.width=t.width,p.height=t.height,e.nodeMap.set(p,t),yt(t,p,e,n),p}let s;try{if(s=t.cloneNode(!1),e.nodeMap.set(s,t),t.tagName==="IMG"){on(t,s);try{let l=t.getBoundingClientRect(),p=Math.round(l.width||0),x=Math.round(l.height||0);if(!p||!x){let F=window.getComputedStyle(t),P=parseFloat(F.width)||0,M=parseFloat(F.height)||0,k=parseInt(t.getAttribute("width")||"",10)||0,C=parseInt(t.getAttribute("height")||"",10)||0,_=t.width||t.naturalWidth||0,L=t.height||t.naturalHeight||0;p=Math.round(p||P||k||_||0),x=Math.round(x||M||C||L||0)}p&&(s.dataset.snapdomWidth=String(p)),x&&(s.dataset.snapdomHeight=String(x))}catch(l){}}}catch(l){throw console.error("[Snapdom] Failed to clone node:",t,l),l}if(t instanceof HTMLTextAreaElement){let l=t.getBoundingClientRect();s.style.width=`${l.width}px`,s.style.height=`${l.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(a=t.value),yt(t,s,e,n),t.shadowRoot){let C=function(L,T){if(L.nodeType===Node.ELEMENT_NODE&&L.tagName==="STYLE")return T(null);At(L,e,n).then(D=>{T(D||null)}).catch(D=>{T(null)})};try{let L=t.shadowRoot.querySelectorAll("slot");for(let T of L){let D=[];try{D=((m=T.assignedNodes)==null?void 0:m.call(T,{flatten:!0}))||((b=T.assignedNodes)==null?void 0:b.call(T))||[]}catch(X){D=((S=T.assignedNodes)==null?void 0:S.call(T))||[]}for(let X of D)o.add(X)}}catch(L){}let l=tn(e),p=`[data-sd="${l}"]`;try{s.setAttribute("data-sd",l)}catch(L){}let x=en(t.shadowRoot),F=Ze(x,p),P=rn(x),M=sn(t,P,p);nn(s,M+F,l);let k=document.createDocumentFragment(),_=yield Yt(Array.from(t.shadowRoot.childNodes),C,n.fast);k.append(..._.filter(L=>!!L)),s.appendChild(k)}if(t.tagName==="SLOT"){let F=function(M,k){At(M,e,n).then(C=>{C&&cn(C),k(C||null)}).catch(C=>{k(null)})},l=((E=t.assignedNodes)==null?void 0:E.call(t,{flatten:!0}))||[],p=l.length>0?l:Array.from(t.childNodes),x=document.createDocumentFragment(),P=yield Yt(Array.from(p),F,n.fast);return x.append(...P.filter(M=>!!M)),x}function c(l,p){if(o.has(l))return p(null);At(l,e,n).then(x=>{p(x||null)}).catch(x=>{p(null)})}let i=yield Yt(Array.from(t.childNodes),c,n.fast);if(s.append(...i.filter(l=>!!l)),r!==null&&s instanceof HTMLSelectElement){s.value=r;for(let l of s.options)l.value===r?l.setAttribute("selected",""):l.removeAttribute("selected")}return a!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=a),s})}var mn=[/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],Jt=[];function he(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Jt.push(n):typeof n=="string"?Jt.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function tt(t){let e=typeof t=="string"?t:"",n=[...mn,...Jt];for(let o of n)if(o instanceof RegExp&&o.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 pe(t,e,n,o=32,r="#000"){return $(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let a=window.devicePixelRatio||1;yield document.fonts.ready;let s=document.createElement("span");s.textContent=t,s.style.position="absolute",s.style.visibility="hidden",s.style.fontFamily=`"${e}"`,s.style.fontWeight=n||"normal",s.style.fontSize=`${o}px`,s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.padding="0",s.style.margin="0",document.body.appendChild(s);let c=s.getBoundingClientRect(),i=Math.ceil(c.width),u=Math.ceil(c.height);document.body.removeChild(s);let f=document.createElement("canvas");f.width=i*a,f.height=u*a;let m=f.getContext("2d");return m.scale(a,a),m.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,m.textAlign="left",m.textBaseline="top",m.fillStyle=r,m.fillText(t,0,0),{dataUrl:f.toDataURL(),width:i,height:u}})}var hn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Lt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!hn.has(n.toLowerCase()))return n}return""}function Tt(t){let e=String(t!=null?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 Qt(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function pn(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function gn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Tt(n[1]),a=Tt(n[2]);return{min:Math.min(r,a),max:Math.max(r,a)}}let o=Tt(e);return{min:o,max:o}}function yn(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function wn(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let a=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(a,s),max:Math.max(a,s)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function bn(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let r=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(c=>r.endsWith(c)))return!0;let s=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(s)||/\.woff2?(\b|$)/.test(s))return!0;for(let c of e){let i=c.toLowerCase().replace(/\s+/g,"+"),u=c.toLowerCase().replace(/\s+/g,"-");if(s.includes(i)||s.includes(u))return!0}return!1}catch(n){return!1}}function Sn(t){var n;let e=new Set;for(let o of t||[]){let r=(n=String(o).split("__")[0])==null?void 0:n.trim();r&&e.add(r)}return e}function It(){return $(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r=""}={}){var L,T,D,X,ot,rt,ct,Q,H,Y,et,Et,xt,j,G,J,Z,at;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let d of t){let[w,g,A,y]=String(d).split("__");if(!w)continue;let v=a.get(w)||[];v.push({w:parseInt(g,10),s:A,st:parseInt(y,10)}),a.set(w,v)}let s=/@import\s+url\(["']?([^"')]+)["']?\)/g,c=/url\((["']?)([^"')]+)\1\)/g,i=/@font-face[^{}]*\{[^}]*\}/g;function u(d,w,g,A){if(!a.has(d))return!1;let y=a.get(d),v=gn(g),R=yn(w),I=wn(A),N=v.min!==v.max,B=v.min,U=O=>R.kind==="normal"&&O==="normal"||R.kind!=="normal"&&(O==="italic"||O==="oblique"),W=!1;for(let O of y){let nt=N?O.w>=v.min&&O.w<=v.max:O.w===B,ut=U(Qt(O.s)),wt=O.st>=I.min&&O.st<=I.max;if(nt&&ut&&wt){W=!0;break}}if(W)return!0;if(!N)for(let O of y){let nt=U(Qt(O.s)),ut=O.st>=I.min&&O.st<=I.max;if(Math.abs(B-O.w)<=300&&nt&&ut)return!0}return!1}function f(d){if(!d)return[];let w=[],g=d.split(",").map(A=>A.trim()).filter(Boolean);for(let A of g){let y=A.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!y)continue;let v=y[1],R=y[2],I=N=>{if(!N.includes("?"))return parseInt(N,16);let B=parseInt(N.replace(/\?/g,"0"),16),U=parseInt(N.replace(/\?/g,"F"),16);return[B,U]};if(R){let N=I(v),B=I(R),U=Array.isArray(N)?N[0]:N,W=Array.isArray(B)?B[1]:B;w.push([Math.min(U,W),Math.max(U,W)])}else{let N=I(v);Array.isArray(N)?w.push([N[0],N[1]]):w.push([N,N])}}return w}function m(d,w){if(!w.length||!d||d.size===0)return!0;for(let g of d)for(let[A,y]of w)if(g>=A&&g<=y)return!0;return!1}function b(d,w){let g=[];if(!d)return g;for(let A of d.matchAll(c)){let y=(A[2]||"").trim();if(!(!y||y.startsWith("data:"))){if(!/^https?:/i.test(y))try{y=new URL(y,w||location.href).href}catch(v){}g.push(y)}}return g}function S(d,w){return $(this,null,function*(){var A,y,v,R,I;let g=d;for(let N of d.matchAll(c)){let B=dt(N[0]);if(!B)continue;let U=B;if(!U.startsWith("http")&&!U.startsWith("data:"))try{U=new URL(U,w||location.href).href}catch(W){}if(!tt(U)){if((A=h.resource)!=null&&A.has(U)){(y=h.font)==null||y.add(U),g=g.replace(N[0],`url(${h.resource.get(U)})`);continue}if(!((v=h.font)!=null&&v.has(U)))try{let W=yield V(U,{as:"dataURL",useProxy:r,silent:!0});if(W.ok&&typeof W.data=="string"){let O=W.data;(R=h.resource)==null||R.set(U,O),(I=h.font)==null||I.add(U),g=g.replace(N[0],`url(${O})`)}}catch(W){console.warn("[snapDOM] Failed to fetch font resource:",U)}}}return g})}function E(d){if(!d.length)return null;let w=(I,N)=>d.some(([B,U])=>!(U<I||B>N)),g=w(0,255)||w(305,305),A=w(256,591)||w(7680,7935),y=w(880,1023),v=w(1024,1279);return w(7840,7929)||w(258,259)||w(416,417)||w(431,432)?"vietnamese":v?"cyrillic":y?"greek":A?"latin-ext":g?"latin":null}function l(d={}){let w=new Set((d.families||[]).map(y=>String(y).toLowerCase())),g=new Set((d.domains||[]).map(y=>String(y).toLowerCase())),A=new Set((d.subsets||[]).map(y=>String(y).toLowerCase()));return(y,v)=>{if(w.size&&w.has(y.family.toLowerCase()))return!0;if(g.size)for(let R of y.srcUrls)try{if(g.has(new URL(R).host.toLowerCase()))return!0}catch(I){}if(A.size){let R=E(v);if(R&&A.has(R))return!0}return!1}}let p=l(n);function x(d){var v,R,I,N,B,U;if(!d)return d;let w=/@font-face[^{}]*\{[^}]*\}/gi,g=new Set,A=[];for(let W of d.match(w)||[]){let O=((v=W.match(/font-family:\s*([^;]+);/i))==null?void 0:v[1])||"",nt=Lt(O),ut=(((R=W.match(/font-weight:\s*([^;]+);/i))==null?void 0:R[1])||"400").trim(),wt=(((I=W.match(/font-style:\s*([^;]+);/i))==null?void 0:I[1])||"normal").trim(),Me=(((N=W.match(/font-stretch:\s*([^;]+);/i))==null?void 0:N[1])||"100%").trim(),ve=(((B=W.match(/unicode-range:\s*([^;]+);/i))==null?void 0:B[1])||"").trim(),oe=(((U=W.match(/src\s*:\s*([^;]+);/i))==null?void 0:U[1])||"").trim(),re=b(oe,location.href),Re=re.length?re.map(Fe=>String(Fe).toLowerCase()).sort().join("|"):oe.toLowerCase(),ae=[String(nt||"").toLowerCase(),ut,wt,Me,ve.toLowerCase(),Re].join("|");g.has(ae)||(g.add(ae),A.push(W))}if(A.length===0)return d;let y=0;return d.replace(w,()=>A[y++]||"")}function F(){let d=Array.from(t||[]).sort().join("|"),w=n?JSON.stringify({families:(n.families||[]).map(y=>String(y).toLowerCase()).sort(),domains:(n.domains||[]).map(y=>String(y).toLowerCase()).sort(),subsets:(n.subsets||[]).map(y=>String(y).toLowerCase()).sort()}):"",g=(o||[]).map(y=>`${(y.family||"").toLowerCase()}::${y.weight||"normal"}::${y.style||"normal"}::${y.src||""}`).sort().join("|");return`fonts-embed-css::req=${d}::ex=${w}::lf=${g}::px=${r||""}`}let P=F();if((L=h.resource)!=null&&L.has(P))return h.resource.get(P);let M=Sn(t),k=[];for(let d of document.querySelectorAll("style")){let w=d.textContent||"";for(let g of w.matchAll(s)){let A=g[1];if(!A||tt(A))continue;!!document.querySelector(`link[rel="stylesheet"][href="${A}"]`)||k.push(A)}}k.length&&(yield Promise.all(k.map(d=>new Promise(w=>{if(document.querySelector(`link[rel="stylesheet"][href="${d}"]`))return w(null);let g=document.createElement("link");g.rel="stylesheet",g.href=d,g.setAttribute("data-snapdom","injected-import"),g.onload=()=>w(g),g.onerror=()=>w(null),document.head.appendChild(g)}))));let C="",_=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(d=>!!d.href);for(let d of _)try{if(tt(d.href))continue;let w="",g=!1;try{g=new URL(d.href,location.href).origin===location.origin}catch(y){}if(!g&&!bn(d.href,M))continue;if(g){let y=Array.from(document.styleSheets).find(v=>v.href===d.href);if(y)try{let v=y.cssRules||[];w=Array.from(v).map(R=>R.cssText).join("")}catch(v){}}if(!w&&(w=(yield V(d.href,{as:"text",useProxy:r})).data,tt(d.href)))continue;let A="";for(let y of w.match(i)||[]){let v=(((T=y.match(/font-family:\s*([^;]+);/i))==null?void 0:T[1])||"").trim(),R=Lt(v);if(!R||tt(R))continue;let I=(((D=y.match(/font-weight:\s*([^;]+);/i))==null?void 0:D[1])||"400").trim(),N=(((X=y.match(/font-style:\s*([^;]+);/i))==null?void 0:X[1])||"normal").trim(),B=(((ot=y.match(/font-stretch:\s*([^;]+);/i))==null?void 0:ot[1])||"100%").trim(),U=(((rt=y.match(/unicode-range:\s*([^;]+);/i))==null?void 0:rt[1])||"").trim(),W=(((ct=y.match(/src\s*:\s*([^;]+);/i))==null?void 0:ct[1])||"").trim(),O=b(W,d.href);if(!u(R,N,I,B))continue;let nt=f(U);if(!m(e,nt))continue;let ut={family:R,weightSpec:I,styleSpec:N,stretchSpec:B,unicodeRange:U,srcRaw:W,srcUrls:O,href:d.href};if(n&&p(ut,nt))continue;let wt=/url\(/i.test(W)?yield S(y,d.href):y;A+=wt+""}A.trim()&&(C+=A+"")}catch(w){console.warn("[snapdom] Failed to process stylesheet:",d.href)}for(let d of document.styleSheets)try{if(d.href&&_.some(g=>g.href===d.href))continue;let w=d.cssRules||[];for(let g of w){if(g.type!==CSSRule.FONT_FACE_RULE)continue;let A=(g.style.getPropertyValue("font-family")||"").trim(),y=Lt(A);if(!y||tt(y))continue;let v=(g.style.getPropertyValue("font-weight")||"400").trim(),R=(g.style.getPropertyValue("font-style")||"normal").trim(),I=(g.style.getPropertyValue("font-stretch")||"100%").trim(),N=(g.style.getPropertyValue("src")||"").trim(),B=(g.style.getPropertyValue("unicode-range")||"").trim(),U=b(N,d.href||location.href);if(!u(y,R,v,I))continue;let W=f(B);if(!m(e,W))continue;let O={family:y,weightSpec:v,styleSpec:R,stretchSpec:I,unicodeRange:B,srcRaw:N,srcUrls:U,href:d.href||location.href};if(!(n&&p(O,W)))if(/url\(/i.test(N)){let nt=yield S(N,d.href||location.href);C+=`@font-face{font-family:${y};src:${nt};font-style:${R};font-weight:${v};font-stretch:${I};${B?`unicode-range:${B};`:""}}`}else C+=`@font-face{font-family:${y};src:${N};font-style:${R};font-weight:${v};font-stretch:${I};${B?`unicode-range:${B};`:""}}`}}catch(w){}try{for(let d of document.fonts||[]){if(!d||!d.family||d.status!=="loaded"||!d._snapdomSrc)continue;let w=String(d.family).replace(/^['"]+|['"]+$/g,"");if(tt(w)||!a.has(w)||n!=null&&n.families&&n.families.some(A=>String(A).toLowerCase()===w.toLowerCase()))continue;let g=d._snapdomSrc;if(!String(g).startsWith("data:")){if((Q=h.resource)!=null&&Q.has(d._snapdomSrc))g=h.resource.get(d._snapdomSrc),(H=h.font)==null||H.add(d._snapdomSrc);else if(!((Y=h.font)!=null&&Y.has(d._snapdomSrc)))try{let A=yield V(d._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(A.ok&&typeof A.data=="string")g=A.data,(et=h.resource)==null||et.set(d._snapdomSrc,g),(Et=h.font)==null||Et.add(d._snapdomSrc);else continue}catch(A){console.warn("[snapdom] Failed to fetch dynamic font src:",d._snapdomSrc);continue}}C+=`@font-face{font-family:'${w}';src:url(${g});font-style:${d.style||"normal"};font-weight:${d.weight||"normal"};}`}}catch(d){}for(let d of o){if(!d||typeof d!="object")continue;let w=String(d.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||tt(w)||!a.has(w)||n!=null&&n.families&&n.families.some(I=>String(I).toLowerCase()===w.toLowerCase()))continue;let g=d.weight!=null?String(d.weight):"normal",A=d.style!=null?String(d.style):"normal",y=d.stretchPct!=null?`${d.stretchPct}%`:"100%",v=String(d.src||""),R=v;if(!R.startsWith("data:")){if((xt=h.resource)!=null&&xt.has(v))R=h.resource.get(v),(j=h.font)==null||j.add(v);else if(!((G=h.font)!=null&&G.has(v)))try{let I=yield V(v,{as:"dataURL",useProxy:r,silent:!0});if(I.ok&&typeof I.data=="string")R=I.data,(J=h.resource)==null||J.set(v,R),(Z=h.font)==null||Z.add(v);else continue}catch(I){console.warn("[snapdom] Failed to fetch localFonts src:",v);continue}}C+=`@font-face{font-family:'${w}';src:url(${R});font-style:${A};font-weight:${g};font-stretch:${y};}`}return C&&(C=x(C),(at=h.resource)==null||at.set(P,C)),C})}function Nt(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=s=>{let c=Lt(s.fontFamily);if(!c)return;let i=(u,f,m)=>`${c}__${Tt(u)}__${Qt(f)}__${pn(m)}`;e.add(i(s.fontWeight,s.fontStyle,s.fontStretch))};o(getComputedStyle(t));let r=getComputedStyle(t,"::before");r&&r.content&&r.content!=="none"&&o(r);let a=getComputedStyle(t,"::after");for(a&&a.content&&a.content!=="none"&&o(a);n.nextNode();){let s=n.currentNode,c=getComputedStyle(s);o(c);let i=getComputedStyle(s,"::before");i&&i.content&&i.content!=="none"&&o(i);let u=getComputedStyle(s,"::after");u&&u.content&&u.content!=="none"&&o(u)}return e}function _t(t){let e=new Set,n=r=>{if(r)for(let a of r)e.add(a.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let r=o.currentNode;if(r.nodeType===Node.TEXT_NODE)n(r.nodeValue||"");else if(r.nodeType===Node.ELEMENT_NODE){let a=r;for(let s of["::before","::after"]){let c=getComputedStyle(a,s),i=c==null?void 0:c.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let u=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(u)for(let f of u)try{e.add(parseInt(f.slice(1),16))}catch(m){}}}}}return e}function Ut(t,e=2){return $(this,null,function*(){try{yield document.fonts.ready}catch(r){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let r=document.createElement("div");r.style.cssText="position: absolute !important;left: -9999px !important;top: 0 !important;opacity: 0 !important;pointer-events: none !important;contain: layout size style;";for(let a of n){let s=document.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${a}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",r.appendChild(s)}document.body.appendChild(r),r.offsetWidth,document.body.removeChild(r)};for(let r=0;r<Math.max(1,e);r++)o(),yield new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(a)))})}function Zt(t,e,n,o){return $(this,null,function*(){var s;if(!(t instanceof Element)||!(e instanceof Element))return;for(let c of["::before","::after","::first-letter"])try{let i=pt(t,c);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(c==="::first-letter"){let j=getComputedStyle(t);if(!(i.color!==j.color||i.fontSize!==j.fontSize||i.fontWeight!==j.fontWeight))continue;let J=Array.from(e.childNodes).find(R=>{var I;return R.nodeType===Node.TEXT_NODE&&((I=R.textContent)==null?void 0:I.trim().length)>0});if(!J)continue;let Z=J.textContent,at=Z.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),d=at==null?void 0:at[0],w=Z.slice((d==null?void 0:d.length)||0);if(!d||/[\uD800-\uDFFF]/.test(d))continue;let g=document.createElement("span");g.textContent=d,g.dataset.snapdomPseudo="::first-letter";let A=Ft(i),y=St(A,"span");n.styleMap.set(g,y);let v=document.createTextNode(w);e.replaceChild(v,J),e.insertBefore(g,v);continue}let f=i.content,m=/counter\s*\(|counters\s*\(/.test(f)?"- ":Gt(f),b=i.backgroundImage,S=i.backgroundColor,E=i.fontFamily,l=parseInt(i.fontSize)||32,p=parseInt(i.fontWeight)||!1,x=i.color||"#000",F=i.display,P=parseFloat(i.width),M=parseFloat(i.height),k=i.borderStyle,C=parseFloat(i.borderWidth),_=i.transform,L=tt(E),T=f!=="none"&&m!=="",D=b&&b!=="none",X=S&&S!=="transparent"&&S!=="rgba(0, 0, 0, 0)",ot=F!=="inline"&&(P>0||M>0),rt=k&&k!=="none"&&C>0,ct=_&&_!=="none";if(!(T||D||X||ot||rt||ct))continue;let H=document.createElement("span");H.dataset.snapdomPseudo=c,H.style.verticalAlign="middle";let Y=Ft(i),et=St(Y,"span");if(n.styleMap.set(H,et),L&&m.length===1){let{dataUrl:j,width:G,height:J}=yield pe(m,E,p,l,x),Z=document.createElement("img");Z.src=j,Z.style=`height:${l}px;width:${G/J*l}px;object-fit:contain;`,H.appendChild(Z),e.dataset.snapdomHasIcon="true"}else if(m.startsWith("url(")){let j=dt(m);if(j!=null&&j.trim())try{let G=document.createElement("img"),J=yield V(lt(j),{as:"dataURL",useProxy:o.useProxy});G.src=J.data,G.style=`width:${l}px;height:auto;object-fit:contain;`,H.appendChild(G)}catch(G){console.error(`[snapdom] Error in pseudo ${c} for`,t,G)}}else!L&&T&&(H.textContent=m);if(D)try{let j=gt(b),G=yield Promise.all(j.map(ht));H.style.backgroundImage=G.join(", ")}catch(j){console.warn(`[snapdom] Failed to inline background-image for ${c}`,j)}if(X&&(H.style.backgroundColor=S),!(H.childNodes.length>0||((s=H.textContent)==null?void 0:s.trim())!==""||D||X||ot||rt||ct))continue;c==="::before"?e.insertBefore(H,e.firstChild):e.appendChild(H)}catch(i){console.warn(`[snapdom] Failed to capture ${c} for`,t,i)}let r=Array.from(t.children),a=Array.from(e.children).filter(c=>!c.dataset.snapdomPseudo);for(let c=0;c<Math.min(r.length,a.length);c++)yield Zt(r[c],a[c],n,o)})}function ge(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(c=>{let i=c.getAttribute("xlink:href")||c.getAttribute("href");i&&i.startsWith("#")&&e.add(i.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(c=>c.tagName.toLowerCase()==="symbol"),r=n.filter(c=>c.tagName.toLowerCase()==="defs"),a=t.querySelector("svg.inline-defs-container");a||(a=document.createElementNS("http://www.w3.org/2000/svg","svg"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),a.classList.add("inline-defs-container"),t.insertBefore(a,t.firstChild));let s=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(c=>{s.add(c.id)}),e.forEach(c=>{if(s.has(c))return;let i=o.find(u=>u.id===c);if(i){a.appendChild(i.cloneNode(!0)),s.add(c);return}for(let u of r){let f=u.querySelector(`#${CSS.escape(c)}`);if(f){let m=a.querySelector("defs");m||(m=document.createElementNS("http://www.w3.org/2000/svg","defs"),a.appendChild(m)),m.appendChild(f.cloneNode(!0)),s.add(c);break}}})}function we(n){return $(this,arguments,function*(t,e={}){var i,u;let o={styleMap:h.session.styleMap,styleCache:h.session.styleCache,nodeMap:h.session.nodeMap},r,a="",s="";xn(t);try{ge(t)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{r=yield At(t,o,e,t)}catch(f){throw console.warn("deepClone failed:",f),f}try{yield Zt(t,r,o,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}yield $n(r);try{let f=r.querySelectorAll("style[data-sd]");for(let m of f)s+=m.textContent||"",m.remove()}catch(f){}let c=Vt(o.styleMap);a=Array.from(c.entries()).map(([f,m])=>`.${m}{${f}}`).join(""),a=s+a;for(let[f,m]of o.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",m.replace(/;/g,"; "));continue}let b=c.get(m);b&&f.classList.add(b);let S=(i=f.style)==null?void 0:i.backgroundImage,E=(u=f.dataset)==null?void 0:u.snapdomHasIcon;S&&S!=="none"&&(f.style.backgroundImage=S),E&&(f.style.verticalAlign="middle",f.style.display="inline")}for(let[f,m]of o.nodeMap.entries()){let b=m.scrollLeft,S=m.scrollTop;if((b||S)&&f instanceof HTMLElement){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";let l=document.createElement("div");for(l.style.transform=`translate(${-b}px, ${-S}px)`,l.style.willChange="transform",l.style.display="inline-block",l.style.width="100%";f.firstChild;)l.appendChild(f.firstChild);f.appendChild(l)}}if(t===o.nodeMap.get(r)){let f=o.styleCache.get(t)||window.getComputedStyle(t);o.styleCache.set(t,f);let m=Ot(f.transform);r.style.margin="0",r.style.position="static",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.zIndex="auto",r.style.float="none",r.style.clear="none",r.style.transform=m||""}for(let[f,m]of o.nodeMap.entries())m.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:r,classCSS:a,styleCache:o.styleCache}})}function xn(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,a=e.borderWidth,s=n!=="none"&&parseFloat(o)>0,c=r==="none"||parseFloat(a)===0;s&&c&&(t.style.border=`${o} solid transparent`)}var kt=new Map;function $t(t){return $(this,null,function*(){var n;if((n=h.resource)!=null&&n.has(t))return h.resource.get(t);if(kt.has(t))return kt.get(t);let e=$(null,null,function*(){var r;let o=yield V(t,{as:"dataURL",silent:!0});if(!o.ok||typeof o.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(r=h.resource)==null||r.set(t,o.data),o.data});kt.set(t,e);try{let o=yield e;return kt.set(t,o),o}catch(o){throw kt.delete(t),o}})}var Cn=/\bblob:[^)"'\s]+/g;function ye(t){return $(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Cn)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=yield $t(o);n=n.split(o).join(r)}catch(r){}return n})}function Pt(t){return typeof t=="string"&&t.startsWith("blob:")}function An(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 kn(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function $n(t){return $(this,null,function*(){var s,c;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let f=i.getAttribute("src")||i.currentSrc||"";if(Pt(f)){let b=yield $t(f);i.setAttribute("src",b)}let m=i.getAttribute("srcset");if(m&&m.includes("blob:")){let b=An(m),S=!1;for(let E of b)if(Pt(E.url))try{E.url=yield $t(E.url),S=!0}catch(l){}S&&i.setAttribute("srcset",kn(b))}}catch(u){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let u="http://www.w3.org/1999/xlink",f=i.getAttribute("href")||((s=i.getAttributeNS)==null?void 0:s.call(i,u,"href"));if(Pt(f)){let m=yield $t(f);i.setAttribute("href",m),(c=i.removeAttributeNS)==null||c.call(i,u,"href")}}catch(u){}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of o)try{let u=i.getAttribute("style");if(u&&u.includes("blob:")){let f=yield ye(u);i.setAttribute("style",f)}}catch(u){}let r=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of r)try{let u=i.textContent||"";u.includes("blob:")&&(i.textContent=yield ye(u))}catch(u){}let a=["poster"];for(let i of a){let u=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let f of u)try{let m=f.getAttribute(i);Pt(m)&&f.setAttribute(i,yield $t(m))}catch(m){}}})}function be(n){return $(this,arguments,function*(t,e={}){let o=Array.from(t.querySelectorAll("img")),r=a=>$(null,null,function*(){var m,b,S,E;if(!a.getAttribute("src")){let l=a.currentSrc||a.src||"";l&&a.setAttribute("src",l)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=yield V(s,{as:"dataURL",useProxy:e.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{defaultImageUrl:i}=e||{};if(i)try{let l=parseInt(((m=a.dataset)==null?void 0:m.snapdomWidth)||"",10)||0,p=parseInt(((b=a.dataset)==null?void 0:b.snapdomHeight)||"",10)||0,x=parseInt(a.getAttribute("width")||"",10)||0,F=parseInt(a.getAttribute("height")||"",10)||0,P=parseFloat(((S=a.style)==null?void 0:S.width)||"")||0,M=parseFloat(((E=a.style)==null?void 0:E.height)||"")||0,k=l||P||x||a.width||void 0,C=p||M||F||a.height||void 0,_=typeof i=="function"?yield i({width:k,height:C,src:s,element:a}):i;if(_){let L=yield V(_,{as:"dataURL",useProxy:e.useProxy});a.src=L.data,!a.width&&k&&(a.width=k),!a.height&&C&&(a.height=C),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}}catch(l){}let u=a.width||a.naturalWidth||100,f=a.height||a.naturalHeight||100;if(e.placeholders!==!1){let l=document.createElement("div");l.style.cssText=[`width:${u}px`,`height:${f}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${f}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),l.textContent="img",a.replaceWith(l)}else{let l=document.createElement("div");l.style.cssText=`display:inline-block;width:${u}px;height:${f}px;visibility:hidden;`,a.replaceWith(l)}});for(let a=0;a<o.length;a+=4){let s=o.slice(a,a+4).map(r);yield Promise.allSettled(s)}})}function Bt(r,a,s){return $(this,arguments,function*(t,e,n,o={}){let c=[[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"],u=["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"],f=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;c.length;){let[m,b]=c.shift(),S=n.get(m)||pt(m);n.has(m)||n.set(m,S);let E=(()=>{let x=S.getPropertyValue("border-image"),F=S.getPropertyValue("border-image-source");return x&&x!=="none"||F&&F!=="none"})();for(let x of i){let F=S.getPropertyValue(x);if(!F||F==="none")continue;let P=gt(F),M=yield Promise.all(P.map(k=>ht(k,o)));M.some(k=>k&&k!=="none"&&!/^url\(undefined/.test(k))&&b.style.setProperty(x,M.join(", "))}for(let x of u){let F=S.getPropertyValue(x);!F||F==="initial"||b.style.setProperty(x,F)}if(E)for(let x of f){let F=S.getPropertyValue(x);!F||F==="initial"||b.style.setProperty(x,F)}let l=Array.from(m.children),p=Array.from(b.children);for(let x=0;x<Math.min(l.length,p.length);x++)c.push([l[x],p[x]])}})}function ee(t,e){return $(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Mt(e.cache);let n=e.fast,o,r,a,s="",c="",i,u;({clone:o,classCSS:r,styleCache:a}=yield we(t,e)),yield new Promise(S=>{st(()=>$(null,null,function*(){yield be(o,e),S()}),{fast:n})}),yield new Promise(S=>{st(()=>$(null,null,function*(){yield Bt(t,o,a,e),S()}),{fast:n})}),e.embedFonts&&(yield new Promise(S=>{st(()=>$(null,null,function*(){let E=Nt(t),l=_t(t);if(it){let p=new Set(Array.from(E).map(x=>String(x).split("__")[0]).filter(Boolean));yield Ut(p,2)}s=yield It({required:E,usedCodepoints:l,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),S()}),{fast:n})}));let f=jt(o).sort(),m=f.join(",");h.baseStyle.has(m)?c=h.baseStyle.get(m):yield new Promise(S=>{st(()=>{c=zt(f),h.baseStyle.set(m,c),S()},{fast:n})}),yield new Promise(S=>{st(()=>{var J,Z,at,d,w;let E=En(t),l=E.width,p=E.height,x=Number.isFinite(e.width),F=Number.isFinite(e.height),P=(J=e.scale)!=null?J:1,M=typeof P=="number"&&P!==1;if(!M){let g=E.width/E.height;x&&F?(l=e.width,p=e.height):x?(l=e.width,p=l/g):F&&(p=e.height,l=p*g)}l=Math.max(1,Math.ceil(l)),p=Math.max(1,Math.ceil(p));let k=getComputedStyle(t),C=k.transform&&k.transform!=="none"?k.transform:"",_=Rn(t),L,T,D,X,ot=0,rt=0;if(Fn(t)){let g=In({baseTransform:C,rotate:_.rotate||"0deg",scale:_.scale,translate:_.translate}),A=(at=(Z=g.e)!=null?Z:g.m41)!=null?at:0,y=(w=(d=g.f)!=null?d:g.m42)!=null?w:0;ot=-A,rt=-y;let v=g.is2D?Se(g):Se(new DOMMatrix(g.toString())),R=vn(l,p,v);L=Math.max(1,Math.ceil(R.width)),T=Math.max(1,Math.ceil(R.height)),D=-R.minX,X=-R.minY}else{let g=t.getBoundingClientRect(),A=Ln(g,{top:0,right:0,bottom:0,left:0});L=Math.max(1,A.width),T=Math.max(1,A.height),D=-(A.x-Math.floor(g.left)),X=-(A.y-Math.floor(g.top))}let ct="http://www.w3.org/2000/svg",Q=document.createElementNS(ct,"foreignObject");Q.setAttribute("width","100%"),Q.setAttribute("height","100%"),Q.setAttribute("x",String(D)),Q.setAttribute("y",String(X)),Q.style.overflow="visible";let H=document.createElement("style");H.textContent=c+s+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r,Q.appendChild(H);let Y=document.createElement("div");Y.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Y.style.width=`${l}px`,Y.style.height=`${p}px`,Y.style.overflow="visible",Y.style.transformOrigin="0 0";let et=[];if((ot||rt)&&et.push(`translate(${ot}px, ${rt}px)`),!M&&(x||F)){let g=E.width?l/E.width:1,A=E.height?p/E.height:1;et.push(`scale(${g}, ${A})`)}else M&&et.push(`scale(${P})`);et.length&&(Y.style.transform=et.join(" ")),o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),o.style.transformOrigin="0 0",o.style.position="static",o.style.left="0",o.style.top="0",C&&(o.style.transform=C),o.style.rotate=_.rotate||"0deg",o.style.scale=_.scale||"1",o.style.translate=_.translate||"0 0",Y.appendChild(o),Q.appendChild(Y);let xt=new XMLSerializer().serializeToString(Q);u=`<svg xmlns="${ct}" width="${L}" height="${T}" viewBox="0 0 ${L} ${T}">`+xt+"</svg>",i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,S()},{fast:n})});let b=document.getElementById("snapdom-sandbox");return b&&b.style.position==="absolute"&&b.remove(),i})}function En(t){let e=getComputedStyle(t),n=a=>parseFloat(a)||0,o=n(e.width),r=n(e.height);return e.boxSizing==="content-box"&&(o+=n(e.paddingLeft)+n(e.paddingRight)+n(e.borderLeftWidth)+n(e.borderRightWidth),r+=n(e.paddingTop)+n(e.paddingBottom)+n(e.borderTopWidth)+n(e.borderBottomWidth)),{width:o,height:r}}function Mn(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function Se(t){return new DOMMatrix([t.a,t.b,t.c,t.d,0,0])}function vn(t,e,n){let r=[{x:0,y:0},{x:t,y:0},{x:0,y:e},{x:t,y:e}].map(u=>({x:n.a*u.x+n.c*u.y,y:n.b*u.x+n.d*u.y})),a=Math.min(...r.map(u=>u.x)),s=Math.max(...r.map(u=>u.x)),c=Math.min(...r.map(u=>u.y)),i=Math.max(...r.map(u=>u.y));return{minX:a,minY:c,width:s-a,height:i-c}}function Rn(t){var r,a,s,c,i,u,f,m,b,S,E,l,p,x;let e={rotate:"0deg",scale:null,translate:null},n=(r=t.computedStyleMap)==null?void 0:r.call(t);if(n){let F=n.get("rotate");if(F){let k=(a=F.angle)!=null?a:F;k&&"unit"in k?e.rotate=k.unit==="rad"?k.value*180/Math.PI+"deg":k.value+k.unit:e.rotate=String(F)}let P=n.get("scale");if(P&&P.length){let k=(c=(s=P[0])==null?void 0:s.value)!=null?c:1,C=(u=(i=P[1])==null?void 0:i.value)!=null?u:k;e.scale=`${k} ${C}`}let M=n.get("translate");if(M&&M.length){let k=(m=(f=M[0])==null?void 0:f.value)!=null?m:0,C=(S=(b=M[1])==null?void 0:b.value)!=null?S:0,_=(l=(E=M[0])==null?void 0:E.unit)!=null?l:"px",L=(x=(p=M[1])==null?void 0:p.unit)!=null?x:"px";e.translate=`${k}${_} ${C}${L}`}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function Fn(t){let e=getComputedStyle(t).transform||"none";return!(e==="none"||e==="matrix(1, 0, 0, 1, 0, 0)"||/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,/i.test(e))}function Ln(t,e){let n=Math.floor(t.left-e.left),o=Math.floor(t.top-e.top),r=Math.ceil(t.width+e.left+e.right),a=Math.ceil(t.height+e.top+e.bottom);return{x:n,y:o,width:r,height:a}}var te=null;function Tn(){if(te)return te;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),te=t,t}function In(t){let e=Tn(),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 o=Mn(n);return e.removeChild(n),o}function Nn(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function xe(t={}){var o,r,a,s,c,i,u,f,m,b,S,E,l,p,x,F,P,M;let e=(o=t.format)!=null?o:"png",n=Nn(t.cache);return{debug:(r=t.debug)!=null?r:!1,fast:(a=t.fast)!=null?a:!0,scale:(s=t.scale)!=null?s:1,exclude:(c=t.exclude)!=null?c:[],excludeMode:(i=t.excludeMode)!=null?i:"visuallyHide",filter:(u=t.filter)!=null?u:null,filterMode:(f=t.filterMode)!=null?f:"visuallyHide",placeholders:t.placeholders!==!1,embedFonts:(m=t.embedFonts)!=null?m:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(b=t.excludeFonts)!=null?b:void 0,defaultImageUrl:(S=t.defaultImageUrl)!=null?S:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(E=t.width)!=null?E:null,height:(l=t.height)!=null?l:null,format:e,type:(p=t.type)!=null?p:"svg",quality:(x=t.quality)!=null?x:.92,dpr:(F=t.dpr)!=null?F:window.devicePixelRatio||1,backgroundColor:(P=t.backgroundColor)!=null?P:["jpg","jpeg","webp"].includes(e)?"#ffffff":null,filename:(M=t.filename)!=null?M:"snapDOM"}}function Ce(t,e){return $(this,null,function*(){let n=new Image;return n.src=t,yield n.decode(),e.scale!==1&&(n.style.width=`${n.naturalWidth*e.scale}px`,n.style.height=`${n.naturalHeight*e.scale}px`),n})}function ft(t,e){return $(this,null,function*(){let{scale:n,dpr:o}=e,r=new Image;r.crossOrigin="anonymous",r.loading="eager",r.decoding="sync",r.src=t,yield r.decode();let a=r.naturalWidth*n,s=r.naturalHeight*n,c=document.createElement("canvas");c.width=Math.ceil(a*o),c.height=Math.ceil(s*o),c.style.width=`${a}px`,c.style.height=`${s}px`;let i=c.getContext("2d");return o!==1&&i.scale(o,o),i.drawImage(r,0,0,a,s),c})}function Wt(t,e){return $(this,null,function*(){let n=e.type;if(n==="svg"){let a=decodeURIComponent(t.split(",")[1]);return new Blob([a],{type:"image/svg+xml"})}let o=yield ft(t,e),r=e.backgroundColor?mt(o,e.backgroundColor):o;return new Promise(a=>r.toBlob(s=>a(s),`image/${n}`,e.quality))})}function Ae(t,e){return $(this,null,function*(){let n=yield ft(t,e),o=e.backgroundColor?mt(n,e.backgroundColor):n,r=new Image;return r.src=o.toDataURL(`image/${e.format}`,e.quality),yield r.decode(),r.style.width=`${o.width/e.dpr}px`,r.style.height=`${o.height/e.dpr}px`,r})}function ke(t,e){return $(this,null,function*(){if(e.format==="svg"){let a=yield Wt(t,K(z({},e),{type:"svg"})),s=URL.createObjectURL(a),c=document.createElement("a");c.href=s,c.download=e.filename,c.click(),URL.revokeObjectURL(s);return}let n=yield ft(t,e),o=e.backgroundColor?mt(n,e.backgroundColor):n,r=document.createElement("a");r.href=o.toDataURL(`image/${e.format}`,e.quality),r.download=e.filename,r.click()})}var $e=Symbol("snapdom.internal"),ne=!1;function q(t,e){return $(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");if(it())for(let o=0;o<3;o++)try{yield _n(t,e),console.log("Iteraci\xF3n n\xFAmero:",o),ne=!1}catch(r){}let n=xe(e);return n.iconFonts&&n.iconFonts.length>0&&he(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>q.toPng(o,r),toImg:(o,r)=>q.toImg(o,r)}),q.capture(t,n,$e)})}q.capture=(t,e,n)=>$(null,null,function*(){if(n!==$e)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=yield ee(t,e),r=s=>z(z({},e),s||{}),a=s=>c=>{let i=r(K(z({},c||{}),{format:s})),u=s==="jpeg"||s==="jpg",f=i.backgroundColor==null||i.backgroundColor==="transparent";return u&&f&&(i.backgroundColor="#ffffff"),Ae(o,i)};return{url:o,toRaw:()=>o,toImg:s=>Ce(o,r(s)),toCanvas:s=>ft(o,r(s)),toBlob:s=>Wt(o,r(s)),toPng:a("png"),toJpg:a("jpeg"),toWebp:a("webp"),download:s=>ke(o,r(s))}});q.toRaw=(t,e)=>q(t,e).then(n=>n.toRaw());q.toImg=(t,e)=>q(t,e).then(n=>n.toImg());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,K(z({},e),{format:"png"})).then(n=>n.toPng());q.toJpg=(t,e)=>q(t,K(z({},e),{format:"jpeg"})).then(n=>n.toJpg());q.toWebp=(t,e)=>q(t,K(z({},e),{format:"webp"})).then(n=>n.toWebp());q.download=(t,e)=>q(t,e).then(n=>n.download());function _n(t,e){return $(this,null,function*(){if(ne)return;let n=K(z({},e),{fast:!0,embedFonts:!0,scale:.2}),o;try{o=yield ee(t,n)}catch(r){return}yield new Promise(r=>{let a=new Image;a.decoding="sync",a.loading="eager",a.style.position="fixed",a.style.left=0,a.style.top=0,a.style.width="10px",a.style.height="10px",a.style.opacity="0.01",a.style.transform="translateZ(10px)",a.style.willChange="transform,opacity;",a.src=o;let s=()=>$(null,null,function*(){yield new Promise(c=>setTimeout(c,100)),a&&a.parentNode&&a.parentNode.removeChild(a),ne=!0,r()});document.body.appendChild(a),s()})})}function Ee(){return $(this,arguments,function*(t=document,e={}){var i,u,f,m;let{embedFonts:n=!0,useProxy:o=""}=e,r=(u=(i=e.cache)!=null?i:e.cacheOpt)!=null?u:"full";Mt(r);try{yield(f=document.fonts)==null?void 0:f.ready}catch(b){}try{qt()}catch(b){}h.session=h.session||{},h.session.styleCache||(h.session.styleCache=new WeakMap),h.image=h.image||new Map;try{yield Bt(t,void 0,h.session.styleCache,{useProxy:o})}catch(b){}let a=[],s=[];try{t!=null&&t.querySelectorAll&&(a=Array.from(t.querySelectorAll("img[src]")),s=Array.from(t.querySelectorAll("*")))}catch(b){}let c=[];for(let b of a){let S=(b==null?void 0:b.currentSrc)||(b==null?void 0:b.src);if(S&&!h.image.has(S)){let E=Promise.resolve().then(()=>$(null,null,function*(){let l=yield V(S,{as:"dataURL",useProxy:o});l!=null&&l.ok&&typeof l.data=="string"&&h.image.set(S,l.data)})).catch(()=>{});c.push(E)}}for(let b of s){let S="";try{S=pt(b).backgroundImage}catch(E){}if(S&&S!=="none"){let E=gt(S);for(let l of E)if(l.startsWith("url(")){let p=Promise.resolve().then(()=>ht(l,K(z({},e),{useProxy:o}))).catch(()=>{});c.push(p)}}}if(n)try{let b=Nt(t),S=_t(t);if(typeof it=="function"?it():!!it){let l=new Set(Array.from(b).map(p=>String(p).split("__")[0]).filter(Boolean));yield Ut(l,2)}yield It({required:b,usedCodepoints:S,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(m=e.useProxy)!=null?m:o})}catch(b){}yield Promise.allSettled(c)})}typeof window!="undefined"&&(window.snapdom=q,window.preCache=Ee);})();
1
+ (()=>{var Be=Object.defineProperty,Oe=Object.defineProperties;var De=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var qe=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var ie=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e)=>{for(var n in e||(e={}))qe.call(e,n)&&ie(t,n,e[n]);if(se)for(var n of se(e))He.call(e,n)&&ie(t,n,e[n]);return t},G=(t,e)=>Oe(t,De(e));var v=(t,e,n)=>new Promise((r,o)=>{var a=i=>{try{c(n.next(i))}catch(f){o(f)}},s=i=>{try{c(n.throw(i))}catch(f){o(f)}},c=i=>i.done?r(i.value):Promise.resolve(i.value).then(a,s);c((n=n.apply(t,e)).next())});var g={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Et(t="soft"){switch(t){case"auto":{g.session.styleMap=new Map,g.session.nodeMap=new Map;return}case"soft":{g.session.styleMap=new Map,g.session.nodeMap=new Map,g.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{g.session.styleMap=new Map,g.session.nodeMap=new Map,g.session.styleCache=new WeakMap,g.computedStyle=new WeakMap,g.baseStyle=new Map,g.defaultStyle=new Map,g.image=new Map,g.background=new Map,g.resource=new Map,g.font=new Set;return}default:{g.session.styleMap=new Map,g.session.nodeMap=new Map,g.session.styleCache=new WeakMap;return}}}function dt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Ot(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(a=>a.trim());return o.length!==6?`matrix(${r})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(a=>a.trim());return o.length!==16?`matrix3d(${r})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function it(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function je(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,o=0;function a(s,c,i){if(o>=n)return;let f=Date.now();(r.get(c)||0)>f||(r.set(c,f+e),o++,s==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(s,c){a("warn",s,c)},errorOnce(s,c){a("error",s,c)},reset(){r.clear(),o=0}}}var ce=je("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Dt=new Map,vt=new Map;function ze(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Ve(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,o=new URL(r||".",n),a=new URL(t,n);if(a.origin===o.origin)return!0;let s=a.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch(n){}return!1}function Xe(t,e){if(!e||ze(t)||Ve(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location!="undefined"?r.origin!==location.origin:!0}catch(n){return!!e}}function Ge(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",it(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}${it(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function le(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 Ke(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("|")}function V(n){return v(this,arguments,function*(t,e={}){var y,$,L;let r=(y=e.as)!=null?y:"blob",o=($=e.timeout)!=null?$:3e3,a=e.useProxy||"",s=(L=e.errorTTL)!=null?L:8e3,c=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(r==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,M="",S=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],P=/;base64/i.test(M)?atob(S):decodeURIComponent(S),N=new Uint8Array([...P].map(O=>O.charCodeAt(0))),_=new Blob([N],{type:(M||"").split(";")[0]||""});return{ok:!0,data:_,status:200,url:t,fromCache:!1,mime:_.type||""}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let M=yield fetch(t);if(!M.ok)return{ok:!1,data:null,status:M.status,url:t,fromCache:!1,reason:"http_error"};let S=yield M.blob(),k=S.type||M.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield le(S),status:M.status,url:t,fromCache:!1,mime:k}:r==="text"?{ok:!0,data:yield S.text(),status:M.status,url:t,fromCache:!1,mime:k}:{ok:!0,data:S,status:M.status,url:t,fromCache:!1,mime:k}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let f=Ke(t,{as:r,timeout:o,useProxy:a,errorTTL:s}),l=vt.get(f);if(l&&l.until>Date.now())return G(z({},l.result),{fromCache:!0});l&&vt.delete(f);let u=Dt.get(f);if(u)return u;let h=Xe(t,a)?Ge(t,a):t,w=e.credentials;if(!w)try{let M=typeof location!="undefined"&&location.href?location.href:"http://localhost/",S=new URL(t,M);w=typeof location!="undefined"&&S.origin===location.origin?"include":"omit"}catch(M){w="omit"}let E=new AbortController,d=setTimeout(()=>E.abort("timeout"),o),p=v(null,null,function*(){var M,S;try{let k=yield fetch(h,{signal:E.signal,credentials:w,headers:c});if(!k.ok){let _={ok:!1,data:null,status:k.status,url:h,fromCache:!1,reason:"http_error"};if(s>0&&vt.set(f,{until:Date.now()+s,result:_}),!i){let O=`${k.status} ${k.statusText||""}`.trim();ce.warnOnce(`http:${k.status}:${r}:${new URL(t,(M=location==null?void 0:location.href)!=null?M:"http://localhost/").origin}`,`HTTP error ${O} while fetching ${r} ${t}`)}return e.onError&&e.onError(_),_}if(r==="text")return{ok:!0,data:yield k.text(),status:k.status,url:h,fromCache:!1};let P=yield k.blob(),N=P.type||k.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield le(P),status:k.status,url:h,fromCache:!1,mime:N}:{ok:!0,data:P,status:k.status,url:h,fromCache:!1,mime:N}}catch(k){let P=k&&typeof k=="object"&&"name"in k&&k.name==="AbortError"?String(k.message||"").includes("timeout")?"timeout":"abort":"network",N={ok:!1,data:null,status:0,url:h,fromCache:!1,reason:P};if(!/^blob:/i.test(t)&&s>0&&vt.set(f,{until:Date.now()+s,result:N}),!i){let _=`${P}:${r}:${new URL(t,(S=location==null?void 0:location.href)!=null?S:"http://localhost/").origin}`,O=P==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:P==="abort"?`Request aborted while fetching ${r} ${t}`:`Network/CORS issue while fetching ${r} ${t}. A proxy may be required`;ce.errorOnce(_,O)}return e.onError&&e.onError(N),N}finally{clearTimeout(d),Dt.delete(f)}});return Dt.set(f,p),p})}function mt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let r=n.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,n.width,n.height),r.drawImage(t,0,0),n}function ht(n){return v(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=dt(t);if(!o)return t;let a=it(o);if(g.background.has(a)){let s=g.background.get(a);return s?`url("${s}")`:"none"}try{let s=yield V(a,{as:"dataURL",useProxy:e.useProxy});return s.ok?(g.background.set(a,s.data),`url("${s.data}")`):(g.background.set(a,null),"none")}catch(s){return g.background.set(a,null),"none"}})}var Ft=new Set(["meta","script","noscript","title","link","template"]),St=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"]),Ye=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function qt(){for(let t of Ye){let e=String(t).toLowerCase();Ft.has(e)||St.has(e)||Ht(e)}}function Ht(t){if(t=String(t).toLowerCase(),St.has(t)){let a={};return g.defaultStyle.set(t,a),a}if(g.defaultStyle.has(t))return g.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),o={};for(let a of r){if(fe(a))continue;let s=r.getPropertyValue(a);o[a]=s}return e.removeChild(n),g.defaultStyle.set(t,o),o}var Je=/(?:^|-)(animation|transition)(?:-|$)/i,Qe=/^(--|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,Ze=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"]);function fe(t){let e=String(t).toLowerCase();return!!(Ze.has(e)||Qe.test(e)||Je.test(e))}function xt(t,e){if(e=String(e||"").toLowerCase(),St.has(e))return"";let n=[],r=Ht(e);for(let[o,a]of Object.entries(t)){if(fe(o))continue;let s=r[o];a&&a!==s&&n.push(`${o}:${a}`)}return n.sort(),n.join(";")}function jt(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 zt(t){let e=new Map;for(let r of t){let o=g.defaultStyle.get(r);if(!o)continue;let a=Object.entries(o).map(([s,c])=>`${s}:${c};`).sort().join("");a&&(e.has(a)||e.set(a,[]),e.get(a).push(r))}let n="";for(let[r,o]of e.entries())n+=`${o.join(",")} { ${r} }
2
+ `;return n}function Vt(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let o of e)n.set(o,`c${r++}`);return n}function pt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=g.computedStyle.get(t);if(n||(n=new Map,g.computedStyle.set(t,n)),!n.has(e)){let r=window.getComputedStyle(t,e);n.set(e,r)}return n.get(e)}function Xt(t){let e=t.replace(/^['"]|['"]$/g,"");if(e.startsWith("\\"))try{return String.fromCharCode(parseInt(e.replace("\\",""),16))}catch(n){return e}return e}function Rt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function gt(t){let e=[],n=0,r=0;for(let o=0;o<t.length;o++){let a=t[o];a==="("&&n++,a===")"&&n--,a===","&&n===0&&(e.push(t.slice(r,o).trim()),r=o+1)}return e.push(t.slice(r).trim()),e}function at(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function st(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n}var ue=new WeakMap,Gt=new Map,Kt=0;function Ct(){Kt++}var de=!1;function tn(t=document.documentElement){var e,n;if(!de){de=!0;try{new MutationObserver(()=>Ct()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{new MutationObserver(()=>Ct()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{let r=document.fonts;r&&((e=r.addEventListener)==null||e.call(r,"loadingdone",Ct),(n=r.ready)==null||n.then(()=>Ct()).catch(()=>{}))}catch(r){}}}function en(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let o=0;o<t.length;o++){let a=t[o],s=t.getPropertyValue(a);(a==="background-image"||a==="content")&&s.includes("url(")&&!s.includes("data:")&&(s="none"),n[a]=s}if(e.embedFonts){let o=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let a of o)if(!n[a])try{let s=t.getPropertyValue(a);s&&(n[a]=s)}catch(s){}}return r==="hidden"&&(n.opacity="0"),n}var me=new WeakMap;function nn(t){let e=me.get(t);return e||(e=Object.entries(t).sort((r,o)=>r[0]<o[0]?-1:r[0]>o[0]?1:0).map(([r,o])=>`${r}:${o}`).join(";"),me.set(t,e),e)}function rn(t,e=null,n={}){let r=ue.get(t);if(r&&r.epoch===Kt)return r.snapshot;let o=e||getComputedStyle(t),a=en(o,n);return ue.set(t,{epoch:Kt,snapshot:a}),a}function on(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Gt,defaultStyle:g.defaultStyle,baseStyle:g.baseStyle,image:g.image,resource:g.resource,background:g.background,font:g.font},options:e||{}}:{session:g.session,persist:{snapshotKeyCache:Gt,defaultStyle:g.defaultStyle,baseStyle:g.baseStyle,image:g.image,resource:g.resource,background:g.background,font:g.font},options:t||e||{}}}function yt(t,e,n,r){return v(this,null,function*(){var h,w,E;if(t.tagName==="STYLE")return;let o=on(n,r),a=o.options&&o.options.cache||"auto";if(a!=="disabled"&&tn(document.documentElement),a==="disabled"&&!o.session.__bumpedForDisabled&&(Ct(),Gt.clear(),o.session.__bumpedForDisabled=!0),St.has((h=t.tagName)==null?void 0:h.toLowerCase())){let d=(w=t.getAttribute)==null?void 0:w.call(t,"style");d&&e.setAttribute("style",d)}let{session:s,persist:c}=o;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let i=s.styleCache.get(t),f=rn(t,i,o.options),l=nn(f),u=c.snapshotKeyCache.get(l);if(!u){let d=((E=t.tagName)==null?void 0:E.toLowerCase())||"div";u=xt(f,d),c.snapshotKeyCache.set(l,u)}s.styleMap.set(e,u)})}function Yt(t,e,n){return Promise.all(t.map(r=>new Promise(o=>{function a(){at(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(r,o):a()},{fast:n})}a()})))}function an(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function sn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let o=n?an(r):r;return`:where(${e} ${o})`}).join(", ")}function cn(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,o,a)=>{let s=sn(a,e,!0);return`${r}${o}${s}{`}),t):""}function ln(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function fn(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 o of r.cssRules)e+=o.cssText+`
4
+ `}catch(o){}}catch(n){}return e}function un(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 dn(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(n){}}function mn(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 hn(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch(n){}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch(n){}return""}function pn(t,e,n){let r=[];for(let o of e){let a=hn(t,o);a&&r.push(`${o}: ${a};`)}return r.length?`${n}{${r.join("")}}
5
+ `:""}function gn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function yn(t,e=3){return v(this,null,function*(){let n=()=>{var a;try{return t.contentDocument||((a=t.contentWindow)==null?void 0:a.document)||null}catch(s){return null}},r=n(),o=0;for(;o<e&&(!r||!r.body&&!r.documentElement);)yield new Promise(a=>setTimeout(a,0)),r=n(),o++;return r&&(r.body||r.documentElement)?r:null})}function wn(t){let e=t.getBoundingClientRect(),n=0,r=0,o=0,a=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,r=parseFloat(i.borderRightWidth)||0,o=parseFloat(i.borderTopWidth)||0,a=parseFloat(i.borderBottomWidth)||0}catch(i){}let s=Math.max(0,Math.round(e.width-(n+r))),c=Math.max(0,Math.round(e.height-(o+a)));return{contentWidth:s,contentHeight:c,rect:e}}function bn(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(o){}}}function Sn(t,e,n){return v(this,null,function*(){let r=yield yn(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:a,rect:s}=wn(t),c=n==null?void 0:n.snap;if(!c||typeof c.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=G(z({},n),{scale:1}),f=bn(r,o,a),l;try{l=yield c.toPng(r.documentElement,i)}finally{f()}l.style.display="block",l.style.width=`${o}px`,l.style.height=`${a}px`;let u=document.createElement("div");return e.nodeMap.set(u,t),yt(t,u,e,n),u.style.overflow="hidden",u.style.display="block",u.style.width||(u.style.width=`${Math.round(s.width)}px`),u.style.height||(u.style.height=`${Math.round(s.height)}px`),u.appendChild(l),u})}function At(t,e,n){return v(this,null,function*(){var f,l,u,h,w,E;if(!t)throw new Error("Invalid node");let r=new Set,o=null,a=null;if(t.nodeType===Node.ELEMENT_NODE){let d=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ft.has(d))return 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 d=document.createElement("div"),p=t.getBoundingClientRect();return d.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,d}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let d of n.exclude)try{if((f=t.matches)!=null&&f.call(t,d)){if(n.excludeMode==="hide"){let p=document.createElement("div"),y=t.getBoundingClientRect();return p.style.cssText=`display:inline-block;width:${y.width}px;height:${y.height}px;visibility:hidden;`,p}else if(n.excludeMode==="remove")return null}}catch(p){console.warn(`Invalid selector in exclude option: ${d}`,p)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let d=document.createElement("div"),p=t.getBoundingClientRect();return d.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,d}else if(n.filterMode==="remove")return null}}catch(d){console.warn("Error in filter function:",d)}if(t.tagName==="IFRAME"){let d=!1;try{d=!!(t.contentDocument||(l=t.contentWindow)!=null&&l.document)}catch(p){d=!1}if(d)try{return yield Sn(t,e,n)}catch(p){console.warn("[SnapDOM] iframe rasterization failed, fallback:",p)}if(n.placeholders){let p=document.createElement("div");return p.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,yt(t,p,e,n),p}else{let p=t.getBoundingClientRect(),y=document.createElement("div");return y.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,yt(t,y,e,n),y}}if(t.getAttribute("data-capture")==="placeholder"){let d=t.cloneNode(!1);e.nodeMap.set(d,t),yt(t,d,e,n);let p=document.createElement("div");return p.textContent=t.getAttribute("data-placeholder-text")||"",p.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",d.appendChild(p),d}if(t.tagName==="CANVAS"){let d=t.toDataURL(),p=document.createElement("img");return p.src=d,p.width=t.width,p.height=t.height,e.nodeMap.set(p,t),yt(t,p,e,n),p}let s;try{if(s=t.cloneNode(!1),e.nodeMap.set(s,t),t.tagName==="IMG"){dn(t,s);try{let d=t.getBoundingClientRect(),p=Math.round(d.width||0),y=Math.round(d.height||0);if(!p||!y){let $=window.getComputedStyle(t),L=parseFloat($.width)||0,M=parseFloat($.height)||0,S=parseInt(t.getAttribute("width")||"",10)||0,k=parseInt(t.getAttribute("height")||"",10)||0,P=t.width||t.naturalWidth||0,N=t.height||t.naturalHeight||0;p=Math.round(p||L||S||P||0),y=Math.round(y||M||k||N||0)}p&&(s.dataset.snapdomWidth=String(p)),y&&(s.dataset.snapdomHeight=String(y))}catch(d){}}}catch(d){throw console.error("[Snapdom] Failed to clone node:",t,d),d}if(t instanceof HTMLTextAreaElement){let d=t.getBoundingClientRect();s.style.width=`${d.width}px`,s.style.height=`${d.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(o=t.value),t instanceof HTMLTextAreaElement&&(a=t.value),yt(t,s,e,n),t.shadowRoot){let k=function(N,_){if(N.nodeType===Node.ELEMENT_NODE&&N.tagName==="STYLE")return _(null);At(N,e,n).then(O=>{_(O||null)}).catch(O=>{_(null)})};try{let N=t.shadowRoot.querySelectorAll("slot");for(let _ of N){let O=[];try{O=((u=_.assignedNodes)==null?void 0:u.call(_,{flatten:!0}))||((h=_.assignedNodes)==null?void 0:h.call(_))||[]}catch(K){O=((w=_.assignedNodes)==null?void 0:w.call(_))||[]}for(let K of O)r.add(K)}}catch(N){}let d=ln(e),p=`[data-sd="${d}"]`;try{s.setAttribute("data-sd",d)}catch(N){}let y=fn(t.shadowRoot),$=cn(y,p),L=mn(y),M=pn(t,L,p);un(s,M+$,d);let S=document.createDocumentFragment(),P=yield Yt(Array.from(t.shadowRoot.childNodes),k,n.fast);S.append(...P.filter(N=>!!N)),s.appendChild(S)}if(t.tagName==="SLOT"){let $=function(M,S){At(M,e,n).then(k=>{k&&gn(k),S(k||null)}).catch(k=>{S(null)})},d=((E=t.assignedNodes)==null?void 0:E.call(t,{flatten:!0}))||[],p=d.length>0?d:Array.from(t.childNodes),y=document.createDocumentFragment(),L=yield Yt(Array.from(p),$,n.fast);return y.append(...L.filter(M=>!!M)),y}function c(d,p){if(r.has(d))return p(null);At(d,e,n).then(y=>{p(y||null)}).catch(y=>{p(null)})}let i=yield Yt(Array.from(t.childNodes),c,n.fast);if(s.append(...i.filter(d=>!!d)),o!==null&&s instanceof HTMLSelectElement){s.value=o;for(let d of s.options)d.value===o?d.setAttribute("selected",""):d.removeAttribute("selected")}return a!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=a),s})}var xn=[/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],Jt=[];function he(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Jt.push(n):typeof n=="string"?Jt.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function Q(t){let e=typeof t=="string"?t:"",n=[...xn,...Jt];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 pe(t,e,n,r=32,o="#000"){return v(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let a=window.devicePixelRatio||1;yield document.fonts.ready;let s=document.createElement("span");s.textContent=t,s.style.position="absolute",s.style.visibility="hidden",s.style.fontFamily=`"${e}"`,s.style.fontWeight=n||"normal",s.style.fontSize=`${r}px`,s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.padding="0",s.style.margin="0",document.body.appendChild(s);let c=s.getBoundingClientRect(),i=Math.ceil(c.width),f=Math.ceil(c.height);document.body.removeChild(s);let l=document.createElement("canvas");l.width=i*a,l.height=f*a;let u=l.getContext("2d");return u.scale(a,a),u.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,u.textAlign="left",u.textBaseline="top",u.fillStyle=o,u.fillText(t,0,0),{dataUrl:l.toDataURL(),width:i,height:f}})}var Cn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Lt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Cn.has(n.toLowerCase()))return n}return""}function Nt(t){let e=String(t!=null?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 Qt(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function An(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function kn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let o=Nt(n[1]),a=Nt(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=Nt(e);return{min:r,max:r}}function $n(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Mn(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let a=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(a,s),max:Math.max(a,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),o=r?parseFloat(r[1]):100;return{min:o,max:o}}function En(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(c=>o.endsWith(c)))return!0;let s=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(s)||/\.woff2?(\b|$)/.test(s))return!0;for(let c of e){let i=c.toLowerCase().replace(/\s+/g,"+"),f=c.toLowerCase().replace(/\s+/g,"-");if(s.includes(i)||s.includes(f))return!0}return!1}catch(n){return!1}}function vn(t){var n;let e=new Set;for(let r of t||[]){let o=(n=String(r).split("__")[0])==null?void 0:n.trim();o&&e.add(o)}return e}function Tt(){return v(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:o=""}={}){var N,_,O,K,et,nt,rt,wt,D,lt,Y,ot,Mt,j,X,J,Z,ft;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let m of t){let[C,x,F,b]=String(m).split("__");if(!C)continue;let A=a.get(C)||[];A.push({w:parseInt(x,10),s:F,st:parseInt(b,10)}),a.set(C,A)}let s=/@import\s+url\(["']?([^"')]+)["']?\)/g,c=/url\((["']?)([^"')]+)\1\)/g,i=/@font-face[^{}]*\{[^}]*\}/g;function f(m,C,x,F){if(!a.has(m))return!1;let b=a.get(m),A=kn(x),R=$n(C),T=Mn(F),I=A.min!==A.max,U=A.min,W=q=>R.kind==="normal"&&q==="normal"||R.kind!=="normal"&&(q==="italic"||q==="oblique"),B=!1;for(let q of b){let tt=I?q.w>=A.min&&q.w<=A.max:q.w===U,ut=W(Qt(q.s)),bt=q.st>=T.min&&q.st<=T.max;if(tt&&ut&&bt){B=!0;break}}if(B)return!0;if(!I)for(let q of b){let tt=W(Qt(q.s)),ut=q.st>=T.min&&q.st<=T.max;if(Math.abs(U-q.w)<=300&&tt&&ut)return!0}return!1}function l(m){if(!m)return[];let C=[],x=m.split(",").map(F=>F.trim()).filter(Boolean);for(let F of x){let b=F.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!b)continue;let A=b[1],R=b[2],T=I=>{if(!I.includes("?"))return parseInt(I,16);let U=parseInt(I.replace(/\?/g,"0"),16),W=parseInt(I.replace(/\?/g,"F"),16);return[U,W]};if(R){let I=T(A),U=T(R),W=Array.isArray(I)?I[0]:I,B=Array.isArray(U)?U[1]:U;C.push([Math.min(W,B),Math.max(W,B)])}else{let I=T(A);Array.isArray(I)?C.push([I[0],I[1]]):C.push([I,I])}}return C}function u(m,C){if(!C.length||!m||m.size===0)return!0;for(let x of m)for(let[F,b]of C)if(x>=F&&x<=b)return!0;return!1}function h(m,C){let x=[];if(!m)return x;for(let F of m.matchAll(c)){let b=(F[2]||"").trim();if(!(!b||b.startsWith("data:"))){if(!/^https?:/i.test(b))try{b=new URL(b,C||location.href).href}catch(A){}x.push(b)}}return x}function w(m,C){return v(this,null,function*(){var F,b,A,R,T;let x=m;for(let I of m.matchAll(c)){let U=dt(I[0]);if(!U)continue;let W=U;if(!W.startsWith("http")&&!W.startsWith("data:"))try{W=new URL(W,C||location.href).href}catch(B){}if(!Q(W)){if((F=g.resource)!=null&&F.has(W)){(b=g.font)==null||b.add(W),x=x.replace(I[0],`url(${g.resource.get(W)})`);continue}if(!((A=g.font)!=null&&A.has(W)))try{let B=yield V(W,{as:"dataURL",useProxy:o,silent:!0});if(B.ok&&typeof B.data=="string"){let q=B.data;(R=g.resource)==null||R.set(W,q),(T=g.font)==null||T.add(W),x=x.replace(I[0],`url(${q})`)}}catch(B){console.warn("[snapDOM] Failed to fetch font resource:",W)}}}return x})}function E(m){if(!m.length)return null;let C=(T,I)=>m.some(([U,W])=>!(W<T||U>I)),x=C(0,255)||C(305,305),F=C(256,591)||C(7680,7935),b=C(880,1023),A=C(1024,1279);return C(7840,7929)||C(258,259)||C(416,417)||C(431,432)?"vietnamese":A?"cyrillic":b?"greek":F?"latin-ext":x?"latin":null}function d(m={}){let C=new Set((m.families||[]).map(b=>String(b).toLowerCase())),x=new Set((m.domains||[]).map(b=>String(b).toLowerCase())),F=new Set((m.subsets||[]).map(b=>String(b).toLowerCase()));return(b,A)=>{if(C.size&&C.has(b.family.toLowerCase()))return!0;if(x.size)for(let R of b.srcUrls)try{if(x.has(new URL(R).host.toLowerCase()))return!0}catch(T){}if(F.size){let R=E(A);if(R&&F.has(R))return!0}return!1}}let p=d(n);function y(m){var A,R,T,I,U,W;if(!m)return m;let C=/@font-face[^{}]*\{[^}]*\}/gi,x=new Set,F=[];for(let B of m.match(C)||[]){let q=((A=B.match(/font-family:\s*([^;]+);/i))==null?void 0:A[1])||"",tt=Lt(q),ut=(((R=B.match(/font-weight:\s*([^;]+);/i))==null?void 0:R[1])||"400").trim(),bt=(((T=B.match(/font-style:\s*([^;]+);/i))==null?void 0:T[1])||"normal").trim(),_e=(((I=B.match(/font-stretch:\s*([^;]+);/i))==null?void 0:I[1])||"100%").trim(),Pe=(((U=B.match(/unicode-range:\s*([^;]+);/i))==null?void 0:U[1])||"").trim(),re=(((W=B.match(/src\s*:\s*([^;]+);/i))==null?void 0:W[1])||"").trim(),oe=h(re,location.href),Ue=oe.length?oe.map(We=>String(We).toLowerCase()).sort().join("|"):re.toLowerCase(),ae=[String(tt||"").toLowerCase(),ut,bt,_e,Pe.toLowerCase(),Ue].join("|");x.has(ae)||(x.add(ae),F.push(B))}if(F.length===0)return m;let b=0;return m.replace(C,()=>F[b++]||"")}function $(){let m=Array.from(t||[]).sort().join("|"),C=n?JSON.stringify({families:(n.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(n.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(n.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",x=(r||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.src||""}`).sort().join("|");return`fonts-embed-css::req=${m}::ex=${C}::lf=${x}::px=${o||""}`}let L=$();if((N=g.resource)!=null&&N.has(L))return g.resource.get(L);let M=vn(t),S=[];for(let m of document.querySelectorAll("style")){let C=m.textContent||"";for(let x of C.matchAll(s)){let F=x[1];if(!F||Q(F))continue;!!document.querySelector(`link[rel="stylesheet"][href="${F}"]`)||S.push(F)}}S.length&&(yield Promise.all(S.map(m=>new Promise(C=>{if(document.querySelector(`link[rel="stylesheet"][href="${m}"]`))return C(null);let x=document.createElement("link");x.rel="stylesheet",x.href=m,x.setAttribute("data-snapdom","injected-import"),x.onload=()=>C(x),x.onerror=()=>C(null),document.head.appendChild(x)}))));let k="",P=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(m=>!!m.href);for(let m of P)try{if(Q(m.href))continue;let C="",x=!1;try{x=new URL(m.href,location.href).origin===location.origin}catch(b){}if(!x&&!En(m.href,M))continue;if(x){let b=Array.from(document.styleSheets).find(A=>A.href===m.href);if(b)try{let A=b.cssRules||[];C=Array.from(A).map(R=>R.cssText).join("")}catch(A){}}if(!C&&(C=(yield V(m.href,{as:"text",useProxy:o})).data,Q(m.href)))continue;let F="";for(let b of C.match(i)||[]){let A=(((_=b.match(/font-family:\s*([^;]+);/i))==null?void 0:_[1])||"").trim(),R=Lt(A);if(!R||Q(R))continue;let T=(((O=b.match(/font-weight:\s*([^;]+);/i))==null?void 0:O[1])||"400").trim(),I=(((K=b.match(/font-style:\s*([^;]+);/i))==null?void 0:K[1])||"normal").trim(),U=(((et=b.match(/font-stretch:\s*([^;]+);/i))==null?void 0:et[1])||"100%").trim(),W=(((nt=b.match(/unicode-range:\s*([^;]+);/i))==null?void 0:nt[1])||"").trim(),B=(((rt=b.match(/src\s*:\s*([^;]+);/i))==null?void 0:rt[1])||"").trim(),q=h(B,m.href);if(!f(R,I,T,U))continue;let tt=l(W);if(!u(e,tt))continue;let ut={family:R,weightSpec:T,styleSpec:I,stretchSpec:U,unicodeRange:W,srcRaw:B,srcUrls:q,href:m.href};if(n&&p(ut,tt))continue;let bt=/url\(/i.test(B)?yield w(b,m.href):b;F+=bt+""}F.trim()&&(k+=F+"")}catch(C){console.warn("[snapdom] Failed to process stylesheet:",m.href)}for(let m of document.styleSheets)try{if(m.href&&P.some(x=>x.href===m.href))continue;let C=m.cssRules||[];for(let x of C){if(x.type!==CSSRule.FONT_FACE_RULE)continue;let F=(x.style.getPropertyValue("font-family")||"").trim(),b=Lt(F);if(!b||Q(b))continue;let A=(x.style.getPropertyValue("font-weight")||"400").trim(),R=(x.style.getPropertyValue("font-style")||"normal").trim(),T=(x.style.getPropertyValue("font-stretch")||"100%").trim(),I=(x.style.getPropertyValue("src")||"").trim(),U=(x.style.getPropertyValue("unicode-range")||"").trim(),W=h(I,m.href||location.href);if(!f(b,R,A,T))continue;let B=l(U);if(!u(e,B))continue;let q={family:b,weightSpec:A,styleSpec:R,stretchSpec:T,unicodeRange:U,srcRaw:I,srcUrls:W,href:m.href||location.href};if(!(n&&p(q,B)))if(/url\(/i.test(I)){let tt=yield w(I,m.href||location.href);k+=`@font-face{font-family:${b};src:${tt};font-style:${R};font-weight:${A};font-stretch:${T};${U?`unicode-range:${U};`:""}}`}else k+=`@font-face{font-family:${b};src:${I};font-style:${R};font-weight:${A};font-stretch:${T};${U?`unicode-range:${U};`:""}}`}}catch(C){}try{for(let m of document.fonts||[]){if(!m||!m.family||m.status!=="loaded"||!m._snapdomSrc)continue;let C=String(m.family).replace(/^['"]+|['"]+$/g,"");if(Q(C)||!a.has(C)||n!=null&&n.families&&n.families.some(F=>String(F).toLowerCase()===C.toLowerCase()))continue;let x=m._snapdomSrc;if(!String(x).startsWith("data:")){if((wt=g.resource)!=null&&wt.has(m._snapdomSrc))x=g.resource.get(m._snapdomSrc),(D=g.font)==null||D.add(m._snapdomSrc);else if(!((lt=g.font)!=null&&lt.has(m._snapdomSrc)))try{let F=yield V(m._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(F.ok&&typeof F.data=="string")x=F.data,(Y=g.resource)==null||Y.set(m._snapdomSrc,x),(ot=g.font)==null||ot.add(m._snapdomSrc);else continue}catch(F){console.warn("[snapdom] Failed to fetch dynamic font src:",m._snapdomSrc);continue}}k+=`@font-face{font-family:'${C}';src:url(${x});font-style:${m.style||"normal"};font-weight:${m.weight||"normal"};}`}}catch(m){}for(let m of r){if(!m||typeof m!="object")continue;let C=String(m.family||"").replace(/^['"]+|['"]+$/g,"");if(!C||Q(C)||!a.has(C)||n!=null&&n.families&&n.families.some(T=>String(T).toLowerCase()===C.toLowerCase()))continue;let x=m.weight!=null?String(m.weight):"normal",F=m.style!=null?String(m.style):"normal",b=m.stretchPct!=null?`${m.stretchPct}%`:"100%",A=String(m.src||""),R=A;if(!R.startsWith("data:")){if((Mt=g.resource)!=null&&Mt.has(A))R=g.resource.get(A),(j=g.font)==null||j.add(A);else if(!((X=g.font)!=null&&X.has(A)))try{let T=yield V(A,{as:"dataURL",useProxy:o,silent:!0});if(T.ok&&typeof T.data=="string")R=T.data,(J=g.resource)==null||J.set(A,R),(Z=g.font)==null||Z.add(A);else continue}catch(T){console.warn("[snapdom] Failed to fetch localFonts src:",A);continue}}k+=`@font-face{font-family:'${C}';src:url(${R});font-style:${F};font-weight:${x};font-stretch:${b};}`}return k&&(k=y(k),(ft=g.resource)==null||ft.set(L,k)),k})}function It(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=s=>{let c=Lt(s.fontFamily);if(!c)return;let i=(f,l,u)=>`${c}__${Nt(f)}__${Qt(l)}__${An(u)}`;e.add(i(s.fontWeight,s.fontStyle,s.fontStretch))};r(getComputedStyle(t));let o=getComputedStyle(t,"::before");o&&o.content&&o.content!=="none"&&r(o);let a=getComputedStyle(t,"::after");for(a&&a.content&&a.content!=="none"&&r(a);n.nextNode();){let s=n.currentNode,c=getComputedStyle(s);r(c);let i=getComputedStyle(s,"::before");i&&i.content&&i.content!=="none"&&r(i);let f=getComputedStyle(s,"::after");f&&f.content&&f.content!=="none"&&r(f)}return e}function _t(t){let e=new Set,n=o=>{if(o)for(let a of o)e.add(a.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let o=r.currentNode;if(o.nodeType===Node.TEXT_NODE)n(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let a=o;for(let s of["::before","::after"]){let c=getComputedStyle(a,s),i=c==null?void 0:c.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let f=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(f)for(let l of f)try{e.add(parseInt(l.slice(1),16))}catch(u){}}}}}return e}function Pt(t,e=2){return v(this,null,function*(){try{yield document.fonts.ready}catch(o){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let o=document.createElement("div");o.style.cssText="position: absolute !important;left: -9999px !important;top: 0 !important;opacity: 0 !important;pointer-events: none !important;contain: layout size style;";for(let a of n){let s=document.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${a}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",o.appendChild(s)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)r(),yield new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(a)))})}function be(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Fn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function ge(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 ye(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)),o="";for(let[a,s]of n)for(;r>=a;)o+=s,r-=a;return e?o:o.toLowerCase()}function we(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return ge(t,!1);case"upper-alpha":return ge(t,!0);case"lower-roman":return ye(t,!1);case"upper-roman":return ye(t,!0);default:return String(Math.max(0,t))}}function Se(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,r=f=>f&&f.tagName==="LI",o=f=>{let l=0,u=f==null?void 0:f.parentElement;if(!u)return 0;for(let h of u.children){if(h===f)break;h.tagName==="LI"&&l++}return l},a=f=>{let l=new Map;for(let[u,h]of f)l.set(u,h.slice());return l},s=(f,l,u)=>{var d,p;let h=a(f),w;try{w=((d=u.style)==null?void 0:d.counterReset)||getComputedStyle(u).counterReset}catch(y){}if(w&&w!=="none")for(let y of w.split(",")){let $=y.trim().split(/\s+/),L=$[0],M=Number.isFinite(Number($[1]))?Number($[1]):0;if(!L)continue;let S=l.get(L);if(S&&S.length){let k=S.slice();k.push(M),h.set(L,k)}else h.set(L,[M])}let E;try{E=((p=u.style)==null?void 0:p.counterIncrement)||getComputedStyle(u).counterIncrement}catch(y){}if(E&&E!=="none")for(let y of E.split(",")){let $=y.trim().split(/\s+/),L=$[0],M=Number.isFinite(Number($[1]))?Number($[1]):1;if(!L)continue;let S=h.get(L)||[];S.length===0&&S.push(0),S[S.length-1]+=M,h.set(L,S)}try{if(getComputedStyle(u).display==="list-item"&&r(u)){let $=u.parentElement,L=1;if($&&$.tagName==="OL"){let S=$.getAttribute("start"),k=Number.isFinite(Number(S))?Number(S):1,P=o(u),N=u.getAttribute("value");L=Number.isFinite(Number(N))?Number(N):k+P}else L=1+o(u);let M=h.get("list-item")||[];M.length===0&&M.push(0),M[M.length-1]=L,h.set("list-item",M)}}catch(y){}return h},c=(f,l,u)=>{let h=s(u,l,f);e.set(f,h);let w=h;for(let E of f.children)w=c(E,h,w);return h},i=new Map;return c(n,i,i),{get(f,l){var h;let u=(h=e.get(f))==null?void 0:h.get(l);return u&&u.length?u[u.length-1]:0},getStack(f,l){var h;let u=(h=e.get(f))==null?void 0:h.get(l);return u?u.slice():[]}}}function xe(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,o=t.replace(r,(a,s,c)=>{var f,l,u,h;let i=String(c).split(",").map(w=>w.trim());if(s==="counter"){let w=(f=i[0])==null?void 0:f.replace(/^["']|["']$/g,""),E=(i[1]||"decimal").toLowerCase(),d=n.get(e,w);return we(d,E)}else{let w=(l=i[0])==null?void 0:l.replace(/^["']|["']$/g,""),E=(h=(u=i[1])==null?void 0:u.replace(/^["']|["']$/g,""))!=null?h:"",d=(i[2]||"decimal").toLowerCase(),p=n.getStack(e,w);return p.length?p.map($=>we($,d)).join(E):""}});return Fn(o)}catch(r){return"- "}}var Ce=null;function Zt(t,e,n,r){return v(this,null,function*(){var s;if(!(t instanceof Element)||!(e instanceof Element))return;for(let c of["::before","::after","::first-letter"])try{let i=pt(t,c);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(c==="::first-letter"){let j=getComputedStyle(t);if(!(i.color!==j.color||i.fontSize!==j.fontSize||i.fontWeight!==j.fontWeight))continue;let J=Array.from(e.childNodes).find(R=>{var T;return R.nodeType===Node.TEXT_NODE&&((T=R.textContent)==null?void 0:T.trim().length)>0});if(!J)continue;let Z=J.textContent,ft=Z.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),m=ft==null?void 0:ft[0],C=Z.slice((m==null?void 0:m.length)||0);if(!m||/[\uD800-\uDFFF]/.test(m))continue;let x=document.createElement("span");x.textContent=m,x.dataset.snapdomPseudo="::first-letter";let F=Rt(i),b=xt(F,"span");n.styleMap.set(x,b);let A=document.createTextNode(C);e.replaceChild(A,J),e.insertBefore(x,A);continue}let l=i.content,u=Xt(l);be(l)&&(Ce=Se(t.ownerDocument||document),u=xe(u,t,Ce));let h=i.backgroundImage,w=i.backgroundColor,E=i.fontFamily,d=parseInt(i.fontSize)||32,p=parseInt(i.fontWeight)||!1,y=i.color||"#000",$=i.display,L=parseFloat(i.width),M=parseFloat(i.height),S=i.borderStyle,k=parseFloat(i.borderWidth),P=i.transform,N=Q(E),_=l!=="none"&&u!=="",O=h&&h!=="none",K=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",et=$!=="inline"&&(L>0||M>0),nt=S&&S!=="none"&&k>0,rt=P&&P!=="none";if(!(_||O||K||et||nt||rt))continue;let D=document.createElement("span");D.dataset.snapdomPseudo=c,D.style.verticalAlign="middle";let lt=Rt(i),Y=xt(lt,"span");if(n.styleMap.set(D,Y),N&&u.length===1){let{dataUrl:j,width:X,height:J}=yield pe(u,E,p,d,y),Z=document.createElement("img");Z.src=j,Z.style=`height:${d}px;width:${X/J*d}px;object-fit:contain;`,D.appendChild(Z),e.dataset.snapdomHasIcon="true"}else if(u.startsWith("url(")){let j=dt(u);if(j!=null&&j.trim())try{let X=document.createElement("img"),J=yield V(it(j),{as:"dataURL",useProxy:r.useProxy});X.src=J.data,X.style=`width:${d}px;height:auto;object-fit:contain;`,D.appendChild(X)}catch(X){console.error(`[snapdom] Error in pseudo ${c} for`,t,X)}}else!N&&_&&(D.textContent=u);if(O)try{let j=gt(h),X=yield Promise.all(j.map(ht));D.style.backgroundImage=X.join(", ")}catch(j){console.warn(`[snapdom] Failed to inline background-image for ${c}`,j)}if(K&&(D.style.backgroundColor=w),!(D.childNodes.length>0||((s=D.textContent)==null?void 0:s.trim())!==""||O||K||et||nt||rt))continue;c==="::before"?e.insertBefore(D,e.firstChild):e.appendChild(D)}catch(i){console.warn(`[snapdom] Failed to capture ${c} for`,t,i)}let o=Array.from(t.children),a=Array.from(e.children).filter(c=>!c.dataset.snapdomPseudo);for(let c=0;c<Math.min(o.length,a.length);c++)yield Zt(o[c],a[c],n,r)})}function Ae(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(c=>{let i=c.getAttribute("xlink:href")||c.getAttribute("href");i&&i.startsWith("#")&&e.add(i.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),r=n.filter(c=>c.tagName.toLowerCase()==="symbol"),o=n.filter(c=>c.tagName.toLowerCase()==="defs"),a=t.querySelector("svg.inline-defs-container");a||(a=document.createElementNS("http://www.w3.org/2000/svg","svg"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),a.classList.add("inline-defs-container"),t.insertBefore(a,t.firstChild));let s=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(c=>{s.add(c.id)}),e.forEach(c=>{if(s.has(c))return;let i=r.find(f=>f.id===c);if(i){a.appendChild(i.cloneNode(!0)),s.add(c);return}for(let f of o){let l=f.querySelector(`#${CSS.escape(c)}`);if(l){let u=a.querySelector("defs");u||(u=document.createElementNS("http://www.w3.org/2000/svg","defs"),a.appendChild(u)),u.appendChild(l.cloneNode(!0)),s.add(c);break}}})}function $e(n){return v(this,arguments,function*(t,e={}){var i,f;let r={styleMap:g.session.styleMap,styleCache:g.session.styleCache,nodeMap:g.session.nodeMap},o,a="",s="";Rn(t);try{Ae(t)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{o=yield At(t,r,e,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{yield Zt(t,o,r,e)}catch(l){console.warn("inlinePseudoElements failed:",l)}yield In(o);try{let l=o.querySelectorAll("style[data-sd]");for(let u of l)s+=u.textContent||"",u.remove()}catch(l){}let c=Vt(r.styleMap);a=Array.from(c.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),a=s+a;for(let[l,u]of r.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",u.replace(/;/g,"; "));continue}let h=c.get(u);h&&l.classList.add(h);let w=(i=l.style)==null?void 0:i.backgroundImage,E=(f=l.dataset)==null?void 0:f.snapdomHasIcon;w&&w!=="none"&&(l.style.backgroundImage=w),E&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,u]of r.nodeMap.entries()){let h=u.scrollLeft,w=u.scrollTop;if((h||w)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let d=document.createElement("div");for(d.style.transform=`translate(${-h}px, ${-w}px)`,d.style.willChange="transform",d.style.display="inline-block",d.style.width="100%";l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d)}}if(t===r.nodeMap.get(o)){let l=r.styleCache.get(t)||window.getComputedStyle(t);r.styleCache.set(t,l);let u=Ot(l.transform);o.style.margin="0",o.style.position="static",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.zIndex="auto",o.style.float="none",o.style.clear="none",o.style.transform=u||""}for(let[l,u]of r.nodeMap.entries())u.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:o,classCSS:a,styleCache:r.styleCache}})}function Rn(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,o=e.borderStyle,a=e.borderWidth,s=n!=="none"&&parseFloat(r)>0,c=o==="none"||parseFloat(a)===0;s&&c&&(t.style.border=`${r} solid transparent`)}var kt=new Map;function $t(t){return v(this,null,function*(){var n;if((n=g.resource)!=null&&n.has(t))return g.resource.get(t);if(kt.has(t))return kt.get(t);let e=v(null,null,function*(){var o;let r=yield V(t,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(o=g.resource)==null||o.set(t,r.data),r.data});kt.set(t,e);try{let r=yield e;return kt.set(t,r),r}catch(r){throw kt.delete(t),r}})}var Ln=/\bblob:[^)"'\s]+/g;function ke(t){return v(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Ln)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let o=yield $t(r);n=n.split(r).join(o)}catch(o){}return n})}function Ut(t){return typeof t=="string"&&t.startsWith("blob:")}function Nn(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 Tn(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function In(t){return v(this,null,function*(){var s,c;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let l=i.getAttribute("src")||i.currentSrc||"";if(Ut(l)){let h=yield $t(l);i.setAttribute("src",h)}let u=i.getAttribute("srcset");if(u&&u.includes("blob:")){let h=Nn(u),w=!1;for(let E of h)if(Ut(E.url))try{E.url=yield $t(E.url),w=!0}catch(d){}w&&i.setAttribute("srcset",Tn(h))}}catch(f){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let f="http://www.w3.org/1999/xlink",l=i.getAttribute("href")||((s=i.getAttributeNS)==null?void 0:s.call(i,f,"href"));if(Ut(l)){let u=yield $t(l);i.setAttribute("href",u),(c=i.removeAttributeNS)==null||c.call(i,f,"href")}}catch(f){}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of r)try{let f=i.getAttribute("style");if(f&&f.includes("blob:")){let l=yield ke(f);i.setAttribute("style",l)}}catch(f){}let o=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of o)try{let f=i.textContent||"";f.includes("blob:")&&(i.textContent=yield ke(f))}catch(f){}let a=["poster"];for(let i of a){let f=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let l of f)try{let u=l.getAttribute(i);Ut(u)&&l.setAttribute(i,yield $t(u))}catch(u){}}})}function Me(n){return v(this,arguments,function*(t,e={}){let r=Array.from(t.querySelectorAll("img")),o=a=>v(null,null,function*(){var u,h,w,E;if(!a.getAttribute("src")){let d=a.currentSrc||a.src||"";d&&a.setAttribute("src",d)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=yield V(s,{as:"dataURL",useProxy:e.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let d=parseInt(((u=a.dataset)==null?void 0:u.snapdomWidth)||"",10)||0,p=parseInt(((h=a.dataset)==null?void 0:h.snapdomHeight)||"",10)||0,y=parseInt(a.getAttribute("width")||"",10)||0,$=parseInt(a.getAttribute("height")||"",10)||0,L=parseFloat(((w=a.style)==null?void 0:w.width)||"")||0,M=parseFloat(((E=a.style)==null?void 0:E.height)||"")||0,S=d||L||y||a.width||void 0,k=p||M||$||a.height||void 0,P=typeof i=="function"?yield i({width:S,height:k,src:s,element:a}):i;if(P){let N=yield V(P,{as:"dataURL",useProxy:e.useProxy});a.src=N.data,!a.width&&S&&(a.width=S),!a.height&&k&&(a.height=k),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}}catch(d){}let f=a.width||a.naturalWidth||100,l=a.height||a.naturalHeight||100;if(e.placeholders!==!1){let d=document.createElement("div");d.style.cssText=[`width:${f}px`,`height:${l}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${l}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),d.textContent="img",a.replaceWith(d)}else{let d=document.createElement("div");d.style.cssText=`display:inline-block;width:${f}px;height:${l}px;visibility:hidden;`,a.replaceWith(d)}});for(let a=0;a<r.length;a+=4){let s=r.slice(a,a+4).map(o);yield Promise.allSettled(s)}})}function Wt(o,a,s){return v(this,arguments,function*(t,e,n,r={}){let c=[[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"],f=["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"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;c.length;){let[u,h]=c.shift(),w=n.get(u)||pt(u);n.has(u)||n.set(u,w);let E=(()=>{let y=w.getPropertyValue("border-image"),$=w.getPropertyValue("border-image-source");return y&&y!=="none"||$&&$!=="none"})();for(let y of i){let $=w.getPropertyValue(y);if(!$||$==="none")continue;let L=gt($),M=yield Promise.all(L.map(S=>ht(S,r)));M.some(S=>S&&S!=="none"&&!/^url\(undefined/.test(S))&&h.style.setProperty(y,M.join(", "))}for(let y of f){let $=w.getPropertyValue(y);!$||$==="initial"||h.style.setProperty(y,$)}if(E)for(let y of l){let $=w.getPropertyValue(y);!$||$==="initial"||h.style.setProperty(y,$)}let d=Array.from(u.children),p=Array.from(h.children);for(let y=0;y<Math.min(d.length,p.length);y++)c.push([d[y],p[y]])}})}function Ee(t){var f;if(!t)return()=>{};let e=_n(t);if(e<=0)return()=>{};if(!Wn(t))return()=>{};let n=getComputedStyle(t),r=Math.round(Pn(n)*e+Un(n)),o=(f=t.textContent)!=null?f:"",a=o;if(t.scrollHeight<=r+.5)return()=>{};let s=0,c=o.length,i=-1;for(;s<=c;){let l=s+c>>1;t.textContent=o.slice(0,l)+"\u2026",t.scrollHeight<=r+.5?(i=l,s=l+1):c=l-1}return t.textContent=(i>=0?o.slice(0,i):"")+"\u2026",()=>{t.textContent=a}}function _n(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 Pn(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 Un(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Wn(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function ee(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Et(e.cache);let n=e.fast,r,o,a,s="",c="",i,f,l=Ee(t);try{({clone:r,classCSS:o,styleCache:a}=yield $e(t,e))}finally{l()}yield new Promise(E=>{at(()=>v(null,null,function*(){yield Me(r,e),E()}),{fast:n})}),yield new Promise(E=>{at(()=>v(null,null,function*(){yield Wt(t,r,a,e),E()}),{fast:n})}),e.embedFonts&&(yield new Promise(E=>{at(()=>v(null,null,function*(){let d=It(t),p=_t(t);if(st){let y=new Set(Array.from(d).map($=>String($).split("__")[0]).filter(Boolean));yield Pt(y,2)}s=yield Tt({required:d,usedCodepoints:p,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),E()}),{fast:n})}));let u=jt(r).sort(),h=u.join(",");g.baseStyle.has(h)?c=g.baseStyle.get(h):yield new Promise(E=>{at(()=>{c=zt(u),g.baseStyle.set(h,c),E()},{fast:n})}),yield new Promise(E=>{at(()=>{var m,C,x,F,b;let d=t.getBoundingClientRect(),p=Number(d.width)||0,y=Number(d.height)||0,$=Number.isFinite(e.width),L=Number.isFinite(e.height),M=(m=e.scale)!=null?m:1,S=typeof M=="number"&&M!==1;if(!S){let A=y>0?p/y:1;$&&L?(p=Number(e.width),y=Number(e.height)):$?(p=Number(e.width),y=p/(A||1)):L&&(y=Number(e.height),p=y*(A||1))}p=Math.max(1,Math.ceil(Number.isFinite(p)?p:1)),y=Math.max(1,Math.ceil(Number.isFinite(y)?y:1));let k=getComputedStyle(t),P=k.transform&&k.transform!=="none"?k.transform:"",N=Dn(t),_,O,K,et,nt=0,rt=0;if(qn(t)){let A=zn({baseTransform:P,rotate:N.rotate||"0deg",scale:N.scale,translate:N.translate}),R=(x=(C=A.e)!=null?C:A.m41)!=null?x:0,T=(b=(F=A.f)!=null?F:A.m42)!=null?b:0;nt=-R,rt=-T;let I=A.is2D?ve(A):ve(new DOMMatrix(A.toString())),U=On(p,y,I);_=Math.max(1,Math.ceil(U.width)),O=Math.max(1,Math.ceil(U.height)),K=-U.minX,et=-U.minY}else{let A=t.getBoundingClientRect(),R=Hn(A,{top:0,right:0,bottom:0,left:0});_=Math.max(1,R.width),O=Math.max(1,R.height),K=-(R.x-Math.floor(A.left)),et=-(R.y-Math.floor(A.top))}let wt="http://www.w3.org/2000/svg",D=document.createElementNS(wt,"foreignObject");D.setAttribute("width","100%"),D.setAttribute("height","100%"),D.setAttribute("x",String(K)),D.setAttribute("y",String(et)),D.style.overflow="visible";let lt=document.createElement("style");lt.textContent=c+s+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o,D.appendChild(lt);let Y=document.createElement("div");Y.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Y.style.width=`${p}px`,Y.style.height=`${y}px`,Y.style.overflow="visible",Y.style.transformOrigin="0 0";let ot=[];if((nt||rt)&&ot.push(`translate(${nt}px, ${rt}px)`),!S&&($||L)){let A=d.width?p/d.width:1,R=d.height?y/d.height:1;ot.push(`scale(${A}, ${R})`)}else S&&ot.push(`scale(${M})`);ot.length&&(Y.style.transform=ot.join(" ")),r.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.style.transformOrigin="0 0",r.style.position="static",r.style.left="0",r.style.top="0",P&&(r.style.transform=P),r.style.rotate=N.rotate||"0deg",r.style.scale=N.scale||"1",r.style.translate=N.translate||"0 0",Y.appendChild(r),D.appendChild(Y);let j=new XMLSerializer().serializeToString(D);f=`<svg xmlns="${wt}" width="${!S&&($||L)?p:_}" height="${!S&&(L||$)?y:O}" viewBox="0 0 ${_} ${O}">`+j+"</svg>",i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,E()},{fast:n})});let w=document.getElementById("snapdom-sandbox");return w&&w.style.position==="absolute"&&w.remove(),i})}function Bn(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function ve(t){return new DOMMatrix([t.a,t.b,t.c,t.d,0,0])}function On(t,e,n){let o=[{x:0,y:0},{x:t,y:0},{x:0,y:e},{x:t,y:e}].map(f=>({x:n.a*f.x+n.c*f.y,y:n.b*f.x+n.d*f.y})),a=Math.min(...o.map(f=>f.x)),s=Math.max(...o.map(f=>f.x)),c=Math.min(...o.map(f=>f.y)),i=Math.max(...o.map(f=>f.y));return{minX:a,minY:c,width:s-a,height:i-c}}function Dn(t){var o,a,s,c,i,f,l,u,h,w,E,d,p;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let y=S=>{try{return typeof n.has=="function"&&!n.has(S)||typeof n.get!="function"?null:n.get(S)}catch(k){return null}},$=y("rotate");if($){let S=(o=$.angle)!=null?o:$;S&&typeof S=="object"&&"unit"in S?e.rotate=S.unit==="rad"?S.value*180/Math.PI+"deg":S.value+S.unit:e.rotate=String($)}let L=y("scale");if(L&&L.length){let S=(s=(a=L[0])==null?void 0:a.value)!=null?s:1,k=(i=(c=L[1])==null?void 0:c.value)!=null?i:S;e.scale=`${S} ${k}`}let M=y("translate");if(M&&M.length){let S=(l=(f=M[0])==null?void 0:f.value)!=null?l:0,k=(h=(u=M[1])==null?void 0:u.value)!=null?h:0,P=(E=(w=M[0])==null?void 0:w.unit)!=null?E:"px",N=(p=(d=M[1])==null?void 0:d.unit)!=null?p:"px";e.translate=`${S}${P} ${k}${N}`}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}function qn(t){let e=getComputedStyle(t).transform||"none";return!(e==="none"||e==="matrix(1, 0, 0, 1, 0, 0)"||/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,/i.test(e))}function Hn(t,e){let n=Math.floor(t.left-e.left),r=Math.floor(t.top-e.top),o=Math.ceil(t.width+e.left+e.right),a=Math.ceil(t.height+e.top+e.bottom);return{x:n,y:r,width:o,height:a}}var te=null;function jn(){if(te)return te;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),te=t,t}function zn(t){let e=jn(),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=Bn(n);return e.removeChild(n),r}function Vn(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function Fe(t={}){var r,o,a,s,c,i,f,l,u,h,w,E,d,p,y,$,L,M;let e=(r=t.format)!=null?r:"png",n=Vn(t.cache);return{debug:(o=t.debug)!=null?o:!1,fast:(a=t.fast)!=null?a:!0,scale:(s=t.scale)!=null?s:1,exclude:(c=t.exclude)!=null?c:[],excludeMode:(i=t.excludeMode)!=null?i:"hide",filter:(f=t.filter)!=null?f:null,filterMode:(l=t.filterMode)!=null?l:"hide",placeholders:t.placeholders!==!1,embedFonts:(u=t.embedFonts)!=null?u:!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,fallbackURL:(w=t.fallbackURL)!=null?w:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(E=t.width)!=null?E:null,height:(d=t.height)!=null?d:null,format:e,type:(p=t.type)!=null?p:"svg",quality:(y=t.quality)!=null?y:.92,dpr:($=t.dpr)!=null?$:window.devicePixelRatio||1,backgroundColor:(L=t.backgroundColor)!=null?L:["jpg","jpeg","webp"].includes(e)?"#ffffff":null,filename:(M=t.filename)!=null?M:"snapDOM"}}function Re(t,e){return v(this,null,function*(){let n=new Image;return n.src=t,yield n.decode(),e.scale!==1&&(n.style.width=`${n.naturalWidth*e.scale}px`,n.style.height=`${n.naturalHeight*e.scale}px`),n})}function ct(t,e){return v(this,null,function*(){let{scale:n,dpr:r}=e,o=new Image;o.crossOrigin="anonymous",o.loading="eager",o.decoding="sync",o.src=t,yield o.decode();let a=o.naturalWidth*n,s=o.naturalHeight*n,c=document.createElement("canvas");c.width=Math.ceil(a*r),c.height=Math.ceil(s*r),c.style.width=`${a}px`,c.style.height=`${s}px`;let i=c.getContext("2d");return r!==1&&i.scale(r,r),i.drawImage(o,0,0,a,s),c})}function Bt(t,e){return v(this,null,function*(){let n=e.type;if(n==="svg"){let a=decodeURIComponent(t.split(",")[1]);return new Blob([a],{type:"image/svg+xml"})}let r=yield ct(t,e),o=e.backgroundColor?mt(r,e.backgroundColor):r;return new Promise(a=>o.toBlob(s=>a(s),`image/${n}`,e.quality))})}function Le(t,e){return v(this,null,function*(){let n=yield ct(t,e),r=e.backgroundColor?mt(n,e.backgroundColor):n,o=new Image;return o.src=r.toDataURL(`image/${e.format}`,e.quality),yield o.decode(),o.style.width=`${r.width/e.dpr}px`,o.style.height=`${r.height/e.dpr}px`,o})}function Ne(t,e){return v(this,null,function*(){if(e.dpr=1,e.format==="svg"){let a=yield Bt(t,G(z({},e),{type:"svg"})),s=URL.createObjectURL(a),c=document.createElement("a");c.href=s,c.download=e.filename,c.click(),URL.revokeObjectURL(s);return}let n=yield ct(t,e),r=e.backgroundColor?mt(n,e.backgroundColor):n,o=document.createElement("a");o.href=r.toDataURL(`image/${e.format}`,e.quality),o.download=e.filename,o.click()})}var Te=Symbol("snapdom.internal"),ne=!1;function H(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");if(st())for(let r=0;r<3;r++)try{yield Xn(t,e),console.log("Iteraci\xF3n n\xFAmero:",r),ne=!1}catch(o){}let n=Fe(e);return n.iconFonts&&n.iconFonts.length>0&&he(n.iconFonts),n.snap||(n.snap={toPng:(r,o)=>H.toPng(r,o),toImg:(r,o)=>H.toImg(r,o)}),H.capture(t,n,Te)})}H.capture=(t,e,n)=>v(null,null,function*(){if(n!==Te)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=yield ee(t,e),o=s=>z(z({},e),s||{}),a=s=>c=>{let i=o(G(z({},c||{}),{format:s})),f=s==="jpeg"||s==="jpg",l=i.backgroundColor==null||i.backgroundColor==="transparent";return f&&l&&(i.backgroundColor="#ffffff"),Le(r,i)};return{url:r,toRaw:()=>r,toImg:s=>Re(r,o(s)),toCanvas:s=>ct(r,o(s)),toBlob:s=>Bt(r,o(s)),toPng:a("png"),toJpg:a("jpeg"),toWebp:a("webp"),download:s=>Ne(r,o(s))}});H.toRaw=(t,e)=>H(t,e).then(n=>n.toRaw());H.toImg=(t,e)=>H(t,e).then(n=>n.toImg());H.toCanvas=(t,e)=>H(t,e).then(n=>n.toCanvas());H.toBlob=(t,e)=>H(t,e).then(n=>n.toBlob());H.toPng=(t,e)=>H(t,G(z({},e),{format:"png"})).then(n=>n.toPng());H.toJpg=(t,e)=>H(t,G(z({},e),{format:"jpeg"})).then(n=>n.toJpg());H.toWebp=(t,e)=>H(t,G(z({},e),{format:"webp"})).then(n=>n.toWebp());H.download=(t,e)=>H(t,e).then(n=>n.download());function Xn(t,e){return v(this,null,function*(){if(ne)return;let n=G(z({},e),{fast:!0,embedFonts:!0,scale:.2}),r;try{r=yield ee(t,n)}catch(o){return}yield new Promise(o=>{let a=new Image;a.decoding="sync",a.loading="eager",a.style.position="fixed",a.style.left=0,a.style.top=0,a.style.width="10px",a.style.height="10px",a.style.opacity="0.01",a.style.transform="translateZ(10px)",a.style.willChange="transform,opacity;",a.src=r;let s=()=>v(null,null,function*(){yield new Promise(c=>setTimeout(c,100)),a&&a.parentNode&&a.parentNode.removeChild(a),ne=!0,o()});document.body.appendChild(a),s()})})}function Ie(){return v(this,arguments,function*(t=document,e={}){var i,f,l,u;let{embedFonts:n=!0,useProxy:r=""}=e,o=(f=(i=e.cache)!=null?i:e.cacheOpt)!=null?f:"full";Et(o);try{yield(l=document.fonts)==null?void 0:l.ready}catch(h){}try{qt()}catch(h){}g.session=g.session||{},g.session.styleCache||(g.session.styleCache=new WeakMap),g.image=g.image||new Map;try{yield Wt(t,void 0,g.session.styleCache,{useProxy:r})}catch(h){}let a=[],s=[];try{t!=null&&t.querySelectorAll&&(a=Array.from(t.querySelectorAll("img[src]")),s=Array.from(t.querySelectorAll("*")))}catch(h){}let c=[];for(let h of a){let w=(h==null?void 0:h.currentSrc)||(h==null?void 0:h.src);if(w&&!g.image.has(w)){let E=Promise.resolve().then(()=>v(null,null,function*(){let d=yield V(w,{as:"dataURL",useProxy:r});d!=null&&d.ok&&typeof d.data=="string"&&g.image.set(w,d.data)})).catch(()=>{});c.push(E)}}for(let h of s){let w="";try{w=pt(h).backgroundImage}catch(E){}if(w&&w!=="none"){let E=gt(w);for(let d of E)if(d.startsWith("url(")){let p=Promise.resolve().then(()=>ht(d,G(z({},e),{useProxy:r}))).catch(()=>{});c.push(p)}}}if(n)try{let h=It(t),w=_t(t);if(typeof st=="function"?st():!!st){let d=new Set(Array.from(h).map(p=>String(p).split("__")[0]).filter(Boolean));yield Pt(d,2)}yield Tt({required:h,usedCodepoints:w,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(u=e.useProxy)!=null?u:r})}catch(h){}yield Promise.allSettled(c)})}typeof window!="undefined"&&(window.snapdom=H,window.preCache=Ie);})();