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