From 88d2ea964ce42078bd49754c6838cf06cd2efcc2 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 10 Oct 2026 10:44:02 +0800 Subject: [PATCH 1/2] feat(Dom2Image): update SnapDOM to v3.3.3 --- .../BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs index 475e240c..37196f45 100644 --- a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs +++ b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs @@ -1,6 +1,6 @@ /* * SnapDOM -* v3.3.0 +* v3.3.3 * License: MIT */ var uc=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var be=(t,e)=>{for(var n in e)uc(t,n,{get:e[n],enumerable:!0})};function ni(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function ri(t="soft"){t==="disabled"&&(I.computedStyle=new WeakMap,I.measureHints=new WeakMap,I.baseStyle=new lt(50),I.defaultStyle=new lt(64),I.image=new lt(100),I.background=new lt(100),I.resource=new lt(150),I.compress=new lt(50))}var lt,I,yt=ct(()=>{"use strict";lt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},I={image:new lt(100),background:new lt(100),resource:new lt(150),defaultStyle:new lt(64),baseStyle:new lt(50),compress:new lt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function re(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function pc(t){let e=[],n=0,r=0,i="";for(let o=0;oo.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function Mr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function qt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Ar(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}function Qe(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function _r(t){return"\u2022".repeat(String(t??"").length)}function it(t,e){return t?.nodeType===1&&t.localName===e}function Rt(t){return t?.nodeType===1&&t.namespaceURI===hc}function It(t){return t?.nodeType===1&&t.namespaceURI===mc}function Ot(t){return t?.nodeType===11&&!!t.host}function Er(t){return t?.nodeType===9}var kr,dc,hc,mc,kt=ct(()=>{"use strict";kr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,dc=kr;hc="http://www.w3.org/1999/xhtml",mc="http://www.w3.org/2000/svg"});function gc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let u=Date.now();(r.get(a)||0)>u||(r.set(a,u+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function si(t,e,n){if(Dt.size>=ii){let r=Date.now();for(let[i,o]of Dt)o.until<=r&&Dt.delete(i);for(;Dt.size>=ii;)Dt.delete(Dt.keys().next().value)}Dt.set(t,{until:Date.now()+n,result:e})}function yc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function bc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function wc(t,e){if(!e||yc(t)||bc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Sc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>qt(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}${qt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function ai(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 xc(t,e){return new Headers(e.headers||{}).keys().next().done?JSON.stringify([e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,e.credentials||"",t]):null}function ci(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function Fr(t,e){try{t.onError?.(e)}catch{}}async function ft(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),v=new Uint8Array([...w].map(S=>S.charCodeAt(0))),C=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:C,status:200,url:t,fromCache:!1,mime:C.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ai(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:t,fromCache:!1,mime:b}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c;try{c=xc(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return Fr(e,g),g}let u=Dt.get(c);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Dt.delete(c);let l=Rr.get(c);if(l)return l;let f=wc(t,i)?Sc(t,i):t,d=e.credentials;if(!d)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),p=(async()=>{try{let g=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&si(c,w,o),!a){let v=`${g.status} ${g.statusText||""}`.trim();oi.warnOnce(`http:${g.status}:${n}:${ci(t)}`,`Couldn't load ${t} (HTTP ${v}).`)}return Fr(e,w),w}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ai(y),blob:y,status:g.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:f,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&si(c,b,o),!a){let w=`${y}:${n}:${ci(t)}`,v=y==="timeout"?`Timed out loading ${t} after ${r}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;oi.errorOnce(w,v)}return Fr(e,b),b}finally{clearTimeout(m),Rr.delete(c)}})();return c!==null&&Rr.set(c,p),p}var oi,Rr,ii,Dt,we=ct(()=>{"use strict";kt();oi=gc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),Rr=new Map,ii=50,Dt=new Map});async function Se(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ke(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(t);if(!r)return t;let i=Ar(r),o=qt(i),s=(e.useProxy||"")+"|"+o;if(I.background.has(s)){let a=I.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ft(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(I.background.set(s,a.data),`url("${a.data}")`):(I.background.set(s,null),"none")}catch{return I.background.set(s,null),"none"}}var li=ct(()=>{"use strict";yt();kt();we()});function _c(t){let e=t.replace(Ac,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function di(t,e,n,r){for(let i=0;i5&&(l[0]==="m"||l[0]==="p")){let f=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;f&&!r[f]&&Mc.test(s.getPropertyValue(l))&&(r[f]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||ui.test(a)||a.includes("+")||a.includes("~")))for(let c of $r(a,",")){let u=c.trim();u&&(r.inContainer||ui.test(u)||u.includes("+")||u.includes("~"))&&r.shareUnsafeSels.add(u)}if(a&&a.includes(":"))for(let c in fi)fi[c].test(a)&&n[c].push(_c(a));if(o.styleSheet){if(!Sn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let u=di(o.cssRules,e,n,r);if(c&&r.inContainer--,!u)return!1}}return!0}function Sn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?di(i,e,n,r):!1}function Pr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function pi(t){let e=new Set;return Sn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function $r(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s"||f==="+"||f==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let u=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function hi(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function Rc(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=hi(n,o)}return r}function mi(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(Tr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let u of t.styleSheets)if(!Sn(u,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let u of o)if(!Sn(u,n,r,i))return e}typeof t.getAnimations=="function"&&Pr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=hi(t.createElement("div"),s)===null?null:s.map(u=>({sel:u,key:Ec(u)})),c=new Set(Cc);for(let u of vc)n.has(u)&&c.add(u);for(let u of i.pseudoProps)c.add(u);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&c.add("transform-origin"),i.pseudoProps.has("perspective")&&c.add("perspective-origin"),{universe:n,pseudoUniverse:c,pseudoGates:Rc(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var Tr,vc,Cc,kc,Mc,fi,Ac,ui,xn=ct(()=>{"use strict";Tr=["display","position","top","right","bottom","left","float","clear","z-index","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","visibility","opacity","content-visibility","vertical-align","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","align-items","align-self","align-content","justify-content","justify-items","justify-self","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-auto-flow","grid-auto-columns","grid-auto-rows","grid-column-start","grid-column-end","grid-row-start","grid-row-end","color","font-family","font-size","font-weight","font-style","font-stretch","line-height","letter-spacing","word-spacing","white-space","text-align","text-transform","text-indent","text-overflow","text-shadow","direction","unicode-bidi","writing-mode","text-orientation","word-break","overflow-wrap","tab-size","list-style-type","list-style-position","list-style-image","counter-reset","counter-increment","counter-set","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","background-attachment","box-shadow","outline-width","outline-style","outline-color","outline-offset","transform","transform-origin","rotate","scale","translate","filter","mix-blend-mode","clip-path","object-fit","object-position","border-collapse","border-spacing","table-layout","caption-side","empty-cells"],vc=["color","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-kerning","font-feature-settings","font-variation-settings","line-height","letter-spacing","word-spacing","white-space","text-align","text-align-last","text-indent","text-transform","text-shadow","text-rendering","direction","unicode-bidi","word-break","overflow-wrap","writing-mode","text-orientation","hyphens","tab-size","visibility","list-style-type","list-style-position","list-style-image","border-collapse","border-spacing","caption-side","empty-cells","quotes","color-scheme","-webkit-text-fill-color","-webkit-font-smoothing","image-rendering"],Cc=["display","width","height","min-width","min-height"],kc=/::?(?:before|after|first-letter|first-line|marker)/,Mc=/%|\bauto\b|calc\(|var\(/i,fi={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Ac=/::?(?:before|after|first-letter|first-line|marker)\b/g;ui=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function Z(t){return gi.add(t),t.setAttribute("data-snapdom-internal",""),t}function Gt(t){return gi.has(t)}var gi,Mt=ct(()=>{"use strict";gi=new WeakSet});function Lr(t){if(t=String(t).toLowerCase(),Je.has(t)){let o={};return I.defaultStyle.set(t,o),o}if(I.defaultStyle.has(t))return I.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);e||(e=document.createElement("div"),Z(e),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.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(xe(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of Tr)!(o in i)&&!xe(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),I.defaultStyle.set(t,i),i}function xe(t){let e=yi.get(t);if(e===void 0){let n=String(t).toLowerCase();e=Pc.has(n)||Tc.test(n)||Fc.test(n),yi.set(t,e)}return e}function wi(t,e){let n=Oc.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function vn(t,e){return!Nc.has(t)&&(e==="inline"||$c.has(t)||bi.has(t))}function Ir(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||bi.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!Wc.has(r)}function ve(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Je.has(e))return"";let i=[],o=Lr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=vn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",l=u==="nowrap"||u==="pre",d=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(xe(m)||wi(m,t))continue;let p=t[m];if(d){if(Lc.has(m))continue;if(Ic.has(m)){p&&p!==o[m]&&(i.push(`${m}:${p}`),p!=="auto"&&(h=!0));continue}}if(p&&p!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&p.endsWith("px")&&p.includes(".")){let g=parseFloat(p);if(Number.isFinite(g)){i.push(`${m}:${(g+Dc).toFixed(3)}px`);continue}}i.push(`${m}:${p}`)}}if(d&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Or(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 Dr(t,e=null){let n=new Map;for(let s of t){let a=Lr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!wi(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=l.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:l}),n.get(f).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??=new Set;let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} } @@ -13,7 +13,7 @@ var uc=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&& /* inlined: ${p} */ ${g} `):l+=d[0]}return l+=a.slice(f),l}let s=gs(t,e||location.href);return s=await o(s,e||location.href,0),s}var vs=/url\((["']?)([^"')]+)\1\)/g,Mf=/@font-face[^{}]*\{[^}]*\}/g;function _t(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Cs(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let u=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[u,l]};if(s){let c=a(o),u=a(s),l=Array.isArray(c)?c[0]:c,f=Array.isArray(u)?u[1]:u;e.push([Math.min(l,f),Math.max(l,f)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function ks(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function io(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(vs)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function no(t,e,n=""){let r=t;for(let i of t.matchAll(vs)){let o=re(i[0]);if(!o)continue;let s=o;if(!s.startsWith("http")&&!s.startsWith("data:"))try{s=new URL(s,e||location.href).href}catch{}if(I.resource?.has(s)){r=r.replace(i[0],`url(${I.resource.get(s)})`);continue}try{let a=await ft(s,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;I.resource?.set(s,c),r=r.replace(i[0],`url(${c})`)}}catch{console.warn("[SnapDOM] Couldn't load font file:",s)}}return r}function Af(t){if(!t.length)return null;let e=(a,c)=>t.some(([u,l])=>!(lc)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function ys(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Af(o);if(s&&r.has(s))return!0}return!1}}function _f(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=_t(o,"font-family"),a=oo(s),c=_t(o,"font-weight","400"),u=_t(o,"font-style","normal"),l=_t(o,"font-stretch","100%"),f=_t(o,"unicode-range"),d=_t(o,"src"),h=io(d,location.href),m=h.length?h.map(g=>String(g).toLowerCase()).sort().join("|"):d.toLowerCase(),p=[String(a||"").toLowerCase(),c,u,l,f.toLowerCase(),m].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var bs=new WeakMap,Ef=0;function Rf(t){let e=bs.get(t);return e===void 0&&(e=Ef++,bs.set(t,e)),e}function Ff(t,e,n,r,i,o,s,a,c){let u=Array.from(t||[]).sort().join("|"),l=0,f=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,f++}let d=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",h=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),m=r||"",p=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Rf(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${u}::ex=${d}::lf=${h}::px=${m}::fd=${p}::doc=${g}::cp=${l}::n=${f}::ic=${y}::env=${c}`}async function ro(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=Dn){console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${Dn} levels.`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${c}`);continue}c&&r.visitedSheets.add(c);let u={...r,depth:(r.depth||0)+1};await ro(a.styleSheet,c,n,u);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await ro(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),u=oo(c);if(!u||Nt(u,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),f=(a.style.getPropertyValue("font-style")||"").trim(),d=(a.style.getPropertyValue("font-stretch")||"").trim(),h=(a.style.getPropertyValue("font-variation-settings")||"").trim(),m=(a.style.getPropertyValue("src")||"").trim(),p=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=f||"normal",b=d||"100%",w=(f?`font-style:${f};`:"")+(l?`font-weight:${l};`:"")+(d?`font-stretch:${d};`:"")+(h?`font-variation-settings:${h};`:"")+(p?`unicode-range:${p};`:""),v=r.faceMatchesRequired(u,y,g,b);if(!v&&!r.requiredIndex.has(u.toLowerCase()))continue;let C=Cs(p);if(!ks(r.usedCodepoints,C))continue;let S={family:u,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:p,srcRaw:m,srcUrls:io(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,C))continue;if(!v){r.provisionalFaces.push({family:u.toLowerCase(),block:`@font-face{font-family:${u};src:${m};${w}}`,srcRaw:m,baseHref:e||location.href});continue}r.coveredFamilies.add(u.toLowerCase());let M=`"${String(u).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(m)){let _=await no(m,e||location.href,r.useProxy);await n(`@font-face{font-family:${M};src:${_};${w}}`)}else await n(`@font-face{font-family:${M};src:${m};${w}}`)}}}async function Ms({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[M,_,E,x]=String(S).split("__");if(!M)continue;let k=M.toLowerCase(),R=c.get(k)||[];R.push({w:parseInt(_,10),s:E,st:parseInt(x,10)}),c.set(k,R)}function u(S,M,_,E){let x=String(S).toLowerCase();if(!c.has(x))return!1;let k=c.get(x),R=bf(_),T=wf(M),L=Sf(E),W=R.min!==R.max,P=R.min,A=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),N=!1;for(let $ of k){let F=W?$.w>=R.min&&$.w<=R.max:$.w===P,z=A(On($.s)),q=$.st>=L.min&&$.st<=L.max;if(F&&z&&q){N=!0;break}}if(N)return!0;if(!W)for(let $ of k){let F=A(On($.s)),z=$.st>=L.min&&$.st<=L.max;if(Math.abs(P-$.w)<=300&&F&&z)return!0}if(!W&&T.kind==="normal"&&k.some(F=>On(F.s)!=="normal"))for(let F of k){let z=Math.abs(P-F.w)<=300,q=F.st>=L.min&&F.st<=L.max;if(z&&q)return!0}return!1}let l=ys(n);_e(a),Tt();let f=Ff(t,n,r,i,o,a,e,s,_e(a));if(I.resource?.has(f))return I.resource.get(f);let d=Cf(t),h=[],m=xs;for(let S of a.querySelectorAll("style")){let M=S.textContent||"";for(let _ of M.matchAll(m)){let E=(_[2]||_[4]||"").trim();if(!E||eo(E,s))continue;a.querySelector(`link[rel="stylesheet"][href="${E}"]`)||h.push(E)}}let p=[];h.length&&await Promise.all(h.map(S=>new Promise(M=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return M(null);let _=a.createElement("link");_.rel="stylesheet",_.href=S,Z(_),_.setAttribute("data-snapdom","injected-import");let E=setTimeout(()=>M(null),3e3),x=k=>{clearTimeout(E),M(k)};_.onload=()=>x(_),_.onerror=()=>x(null),a.head.appendChild(_),p.push(_)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of p)try{S.remove()}catch{}for(let S of w)try{if(eo(S.href,s))continue;let M="",_=!1;try{_=new URL(S.href,location.href).origin===location.origin}catch{}if(!_){let x=Array.isArray(o)?o:[];if(!vf(S.href,d,x))continue}if(_){let x=Array.from(a.styleSheets).find(k=>k.href===S.href);if(x)try{let k=x.cssRules||[];M=Array.from(k).map(R=>R.cssText).join("")}catch{}}if(!M){let x=await ft(S.href,{as:"text",useProxy:i});x?.ok&&typeof x.data=="string"&&(M=x.data)}M=await kf(M,S.href,i);let E="";for(let x of M.match(Mf)||[]){let k=_t(x,"font-family"),R=oo(k);if(!R||Nt(R,s))continue;let T=_t(x,"font-weight","400"),L=_t(x,"font-style","normal"),W=_t(x,"font-stretch","100%"),P=_t(x,"unicode-range"),A=_t(x,"src"),N=io(A,S.href),$=u(R,L,T,W);if(!$&&!c.has(R.toLowerCase()))continue;let F=Cs(P);if(!ks(e,F))continue;let z={family:R,weightSpec:T,styleSpec:L,stretchSpec:W,unicodeRange:P,srcRaw:A,srcUrls:N,href:S.href};if(n&&l(z,F))continue;if(!$){b.push({family:R.toLowerCase(),block:x,srcRaw:A,baseHref:S.href});continue}y.add(R.toLowerCase());let q=/url\(/i.test(A)?await no(x,S.href,i):x;E+=q}E.trim()&&(g+=E)}catch{console.warn("[SnapDOM] Couldn't read stylesheet:",S.href)}let v={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:u,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?ys(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},C=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of C)if(!(S.href&&w.some(M=>M.href===S.href)))try{let M=S.href||a.baseURI||location.origin+"/";M&&v.visitedSheets.add(M),await ro(S,M,async _=>{g+=_},v)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await no(S.block,S.baseHref,i):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let M=String(S.family).replace(/^['"]+|['"]+$/g,"");if(Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(E=>String(E).toLowerCase()===M.toLowerCase()))continue;let _=S._snapdomSrc;if(!String(_).startsWith("data:"))if(I.resource?.has(S._snapdomSrc))_=I.resource.get(S._snapdomSrc);else try{let E=await ft(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(E.ok&&typeof E.data=="string")_=E.data,I.resource?.set(S._snapdomSrc,_);else continue}catch{console.warn("[SnapDOM] Couldn't load font file:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${M}';src:url(${_});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let M=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===M.toLowerCase()))continue;let _=S.weight!=null?String(S.weight):"normal",E=S.style!=null?String(S.style):"normal",x=S.stretchPct!=null?`${S.stretchPct}%`:"100%",k=String(S.src||""),R=k;if(!R.startsWith("data:"))if(I.resource?.has(k))R=I.resource.get(k);else try{let T=await ft(k,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")R=T.data,I.resource?.set(k,R);else continue}catch{console.warn("[SnapDOM] Couldn't load font file from localFonts:",k);continue}g+=`@font-face{font-family:'${M}';src:url(${R});font-style:${E};font-weight:${_};font-stretch:${x};}`}return g&&(g=_f(g),I.resource?.set(f,g)),g}function Wn(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let f of l)r.add(f.codePointAt(0))},o=l=>{let f=gf(l.fontFamily);if(f.length)for(let d of f)n.add(`${d}__${In(l.fontWeight)}__${On(l.fontStyle)}__${yf(l.fontStretch)}`)},s=Fe(t),a=t.getRootNode(),c=l=>{o(O(l));let f=l.getRootNode()===a?s:Fe(l);for(let d of["::before","::after"]){let h=d==="::before"?f.before:f.after;if(h!==null){if(h==="")continue;try{if(!l.matches(h))continue}catch{}}let m=O(l,d),p=m&&m.content;if(!(!p||p==="none"||p==="normal"))if(o(m),/^["']/.test(p))i(p.slice(1,-1));else{let g=p.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},u=[t];for(let l=0;l{let o=n.createElement("div");Z(o),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 s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function _s(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)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function Es(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return As(t,!1);case"upper-alpha":case"upper-latin":return As(t,!0);case"lower-roman":return _s(t,!1);case"upper-roman":return _s(t,!0);default:return String(t)}}function un(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;iu&&u.tagName==="LI",i=new WeakMap,o=u=>{let l=new Map;for(let[f,d]of u)l.set(f,d.slice());return l},s=(u,l,f)=>{let d=o(u),h;try{h=getComputedStyle(f)}catch{h=f.style}let m;try{m=h?.counterReset}catch{}if(m&&m!=="none")for(let[y,b]of un(m,0)){let w=l.get(y);if(w&&w.length){let v=w.slice();v.push(b),d.set(y,v)}else d.set(y,[b])}let p;try{p=h?.counterSet}catch{}if(p&&p!=="none")for(let[y,b]of un(p,0)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,d.set(y,w)}let g;try{g=h?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of un(g,1)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,d.set(y,w)}try{if(h?.display==="list-item"&&r(f)){let y=f.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,v=b===void 0?Number.isFinite(w)?w:1:b+1,C=y?.tagName==="OL"?parseInt(f.getAttribute("value"),10):NaN;Number.isFinite(C)&&(v=C),y&&i.set(y,v);let S=d.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=v,d.set("list-item",S)}}catch{}return d},a=(u,l,f)=>{let d=s(f,l,u);e.set(u,d);let h=d;for(let p of u.children)h=a(p,d,h);let m=new Map;for(let[p,g]of f){let y=g.length,b=h.get(p);m.set(p,b&&b.length?b.slice(0,y):g.slice())}for(let[p,g]of h)!m.has(p)&&g.length&&!l.has(p)&&m.set(p,g.slice(0,1));return m},c=new Map;return a(n,c,c),{get(u,l){let f=e.get(u)?.get(l);return f&&f.length?f[f.length-1]:0},getStack(u,l){let f=e.get(u)?.get(l);return f?f.slice():[]}}}function Ts(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),u=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return Es(l,u)}else{let c=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),f=n.getStack(e,c);return f.length?f.map(h=>Es(h,l)).join(u):""}})}catch{return"- "}}we();var Le=new WeakMap,Ps=1e3;function Tf(t,e){let n=Is(t);return e?(e.__pseudoPreflightFp!==n&&(Tt(),e.__pseudoPreflight=$s(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Tt(),$s(t,n))}function Un(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function Is(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s0;a++){let c=o.cssRules[a],u=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(u.includes(l))return!0}if(n.budget<=0)return!1}return!1}function $s(t=document,e=Is(t)){let n=Le.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&Ee();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a0;u++){let l=a[u],f=null;if(l.tagName,f=l.sheet||null,f&&so(f,i,c))return Le.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(t,{fingerprint:e,result:!0}),!0):(Le.set(t,{fingerprint:e,result:!1}),!1)}function Ns(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Pf(t,e){let n=null,r=()=>{if(!n)try{n=Fs(t)}catch(i){H(e,"Couldn't compute CSS counters; list numbers may be off.",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function $f(t){let e=!1;for(let n=0;n{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===` -`?"":r})}function Lf(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Nf(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function ao(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let u=a.slice();return u[u.length-1]=Math.max(u[u.length-1],c),u}return a}}:e}function co(t,e,n){let r=new Map,i=(u,l)=>un(u,l).map(([f,d])=>({name:f,num:d})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(u){if(r.has(u))return r.get(u).slice();let l=n.getStack(t,u);l=l.length?l.slice():[];let f=o.find(m=>m.name===u);if(f){let m=Number.isFinite(f.num)?f.num:0;l=l.length?[...l,m]:[m]}let d=s.find(m=>m.name===u);if(d){let m=Number.isFinite(d.num)?d.num:0;l.length===0&&(l=[0]),l[l.length-1]=m}let h=a.find(m=>m.name===u);if(h){let m=Number.isFinite(h.num)?h.num:1;l.length===0&&(l=[0]),l[l.length-1]+=m}return r.set(u,l.slice()),l}return{get(u,l){let f=c(l);return f.length?f[f.length-1]:0},getStack(u,l){return c(l)},__incs:a}}var If=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Of=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function Ls(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let f=O(t).display||"";if(i==="::marker"?!f.includes("list-item"):!(f==="block"||f==="flow-root"||f==="list-item"||f==="inline-block"||f==="table-cell"||f==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let c="";for(let f of o){let d=s.getPropertyValue(f);d&&d!==a.getPropertyValue(f)&&!(f==="background-color"&&d==="rgba(0, 0, 0, 0)")&&!(f==="vertical-align"&&d==="baseline")&&(c+=`${f}:${d};`)}if(i==="::marker"){let f=s.getPropertyValue("content");f&&f!=="normal"&&f!=="none"&&(c+=`content:${f};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function Df(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Wf(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=$f(o),o=Df(o,t);let s=ao(t,n,r),a=co(t,i,s),c=Rs(o)?Ts(o,t,a):o;return{text:Lf(c),incs:a.__incs||[]}}function Bf(t,e){if(e.__shadowPseudo)return!1;let n=Fe(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Ie(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Tf(o,n)&&!n.__shadowPseudo||!i&&Bf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Pf(t.ownerDocument||document,n));let s=n.__counterCtx,a=Fe(t);a.marker!==""&&Ls(t,e,n,a.marker,"::marker",If),a.firstLine!==""&&Ls(t,e,n,a.firstLine,"::first-line",Of);for(let u of["::before","::after","::first-letter"]){let l=a[u==="::before"?"before":u==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let f=O(t,u);if(!f||f.content==="none"&&f.backgroundImage==="none"&&(f.backgroundColor==="transparent"||f.backgroundColor==="rgba(0, 0, 0, 0)")&&!Ns(f)&&(!f.transform||f.transform==="none")&&f.display==="inline")continue;if(f.display==="none"||u!=="::first-letter"&&(f.content==="none"||f.content==="normal")){u==="::before"&&(e.dataset.snapdomHasBefore="1"),u==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(u==="::first-letter"){let V=O(t),G=(V?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let U=jt=>f[jt]!==V[jt]&&(parseFloat(f[jt])||0)!==0;if(!(f.color!==V.color||f.fontSize!==V.fontSize||f.fontWeight!==V.fontWeight||f.fontFamily!==V.fontFamily||f.fontStyle!==V.fontStyle||f.textTransform!==V.textTransform||f.float!==V.float&&f.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let Y=Array.from(e.childNodes).find(jt=>jt.nodeType===Node.TEXT_NODE&&jt.textContent?.trim().length>0);if(!Y)continue;let Ct=Y.textContent,ye=/^\s*/.exec(Ct)[0],bn=Ct.slice(ye.length),Xe=bn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Sr=bn.slice(Xe?.length||0);if(!Xe||/[\uD800-\uDFFF]/.test(Xe))continue;let Ht=document.createElement("span");Ht.textContent=Xe,Ht.dataset.snapdomPseudo="::first-letter";let xr=Ce(f,kn(t)),vr=ve(xr,"span");n.styleMap.set(Ht,vr);let wn=document.createTextNode(Sr);e.replaceChild(wn,Y),e.insertBefore(Ht,wn),ye&&e.insertBefore(document.createTextNode(ye),Ht);continue}let m=f.content??"",p=m===""||m==="none"||m==="normal",{text:g,incs:y}=Wf(t,u,s,n.__siblingCounters),b=f.backgroundImage,w=f.backgroundColor,v=f.fontFamily,C=parseInt(f.fontSize)||32,S=parseInt(f.fontWeight)||!1,M=f.fontStyle||"normal",_=f.color||"#000",E=f.transform,x=Nt(v,r?.__iconMatchers),k=!p&&g!=="",R=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",L=Ns(f),W=E&&E!=="none",P=m!=="none"&&m!=="normal",A=/^inline-/.test(f.display||""),N=P&&((parseFloat(f.width)||0)>0||(parseFloat(f.height)||0)>0||A),$=P&&f.boxShadow&&f.boxShadow!=="none",F=P&&f.outlineStyle&&f.outlineStyle!=="none"&&(parseFloat(f.outlineWidth)||0)>0;if(!(k||R||T||L||W||N||$||F)){if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let U=ao(t,s,n.__siblingCounters),Y=co(t,O(t,u),U).get(t,G);V.set(G,Y)}n.__siblingCounters.set(t.parentElement,V)}continue}let q=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),j=f.display==="inline"&&f.cssFloat==="none"&&f.position!=="absolute"&&f.position!=="fixed",J=!1;if(k&&!x&&g.length>1&&!q&&j){let V=O(t),G=parseFloat(V.fontSize)||16,U=parseFloat(V.lineHeight);Number.isFinite(U)||(U=G*1.5),t.getBoundingClientRect().height=1.5*(parseFloat(f.lineHeight)||(parseFloat(f.fontSize)||16)*1.2)&&(st=!1,B.style.whiteSpace=f.whiteSpace);let nt=ve(ut,"span",st,at);if(n.styleMap.set(B,nt),x&&g&&g.length===1){let{dataUrl:V,width:G,height:U}=await ws(g,v,S,C,_,M),ht=document.createElement("img");ht.src=V,ht.style=`height:${C}px;width:${G/U*C}px;object-fit:contain;`,B.appendChild(ht),e.dataset.snapdomHasIcon="true"}else if(g&&q){let V=Ke(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(g);if(V?.trim())try{let G=await ft(qt(V),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let U=document.createElement("img");U.src=G.data,U.style=`width:${C}px;height:auto;object-fit:contain;`,B.appendChild(U)}}catch(G){console.warn(`[SnapDOM] Couldn't draw the ${u} icon of`,t,G)}}else!x&&k&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=f.backgroundRepeat,B.style.backgroundSize=f.backgroundSize,f.backgroundPositionX&&f.backgroundPositionY?(B.style.backgroundPositionX=f.backgroundPositionX,B.style.backgroundPositionY=f.backgroundPositionY):B.style.backgroundPosition=f.backgroundPosition,B.style.backgroundOrigin=f.backgroundOrigin,B.style.backgroundClip=f.backgroundClip,B.style.backgroundAttachment=f.backgroundAttachment,B.style.backgroundBlendMode=f.backgroundBlendMode}catch{}if(R)try{let V=Xt(b),G=await Promise.all(V.map(U=>Se(U,r)));B.style.backgroundImage=G.join(", ")}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} background image.`,V)}T&&(B.style.backgroundColor=w);let pt=f.maskImage||f.webkitMaskImage;if(pt&&pt!=="none")try{let G=(await Promise.all(Xt(pt).map(U=>Se(U,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let U of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])f[U]&&(B.style[U]=f[U])}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} mask image.`,V)}let ge=B.childNodes.length>0||B.textContent?.trim()!==""||R||T||L||W||N||$||F;if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map,G=ao(t,s,n.__siblingCounters),U=co(t,O(t,u),G);for(let{name:ht}of y){if(!ht)continue;let Y=U.get(t,ht);V.set(ht,Y)}n.__siblingCounters.set(t.parentElement,V)}if(!ge)continue;u==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(f){console.warn(`[SnapDOM] Couldn't copy the ${u} of`,t,f)}}let c=Array.from(e.children).filter(u=>!u.dataset.snapdomPseudo);if(n.nodeMap)for(let u of c){let l=n.nodeMap.get(u);l?.nodeType===1&&await Ie(l,u,n,r,!0)}else{let u=Array.from(t.children);for(let l=0;lwindow.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),u="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let M=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(u,"href"):null);if(M)return M;let _=S.attributes;if(!_)return null;for(let E=0;E<_.length;E++){let x=_[E];if(!x||!x.name)continue;if(x.name==="href")return x.value;let k=x.name.indexOf(":");if(k!==-1&&x.name.slice(k+1)==="href")return x.value}return null},f=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),d=new Set,h=!1,m=(S,M=null)=>{if(!S)return;s.lastIndex=0;let _;for(;_=s.exec(S);){h=!0;let E=(_[1]||"").trim();E&&(f.has(E)||(d.add(E),M&&!M.has(E)&&M.add(E)))}},p=S=>{let M=S.querySelectorAll("use");for(let x of M){let k=l(x);if(!k||!k.startsWith("#"))continue;h=!0;let R=k.slice(1).trim();R&&!f.has(R)&&d.add(R)}let _='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';m(S.getAttribute("style")||"");for(let x of a)m(S.getAttribute(x));let E=S.querySelectorAll(_);for(let x of E){m(x.getAttribute("style")||"");for(let k of a)m(x.getAttribute(k))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let M="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",_=!1;try{_=!!(i.querySelector&&i.querySelector(M))}catch{return}if(!_)return;let E=["filter","clipPath","mask","maskImage","webkitMaskImage"],x=k=>{if(It(k))return;let R;try{R=getComputedStyle(k)}catch{return}for(let T of E){let L=R[T];L&&L.includes("url(")&&m(L)}};x(S);for(let k of S.querySelectorAll("*"))x(k)};for(let S of o)p(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||f.has(S))return null;let M=c(S),_=E=>{let x=i.querySelector(E);return x&&!t.contains(x)?x:null};return _(`svg defs > *#${M}`)||_(`svg > symbol#${M}`)||_(`*#${M}`)};if(!d.size)return;let v=new Set(d),C=new Set;for(;v.size;){let S=v.values().next().value;if(v.delete(S),!S||f.has(S)||C.has(S))continue;let M=w(S);if(!M){C.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let _=M.cloneNode(!0);_.id||_.setAttribute("id",S),b.appendChild(_),C.add(S),f.add(S);let E=[_,..._.querySelectorAll("*")];for(let x of E){let k=l(x);if(k&&k.startsWith("#")){let T=k.slice(1).trim();T&&!f.has(T)&&!C.has(T)&&v.add(T)}let R=x.getAttribute?.("style")||"";R&&m(R,v);for(let T of a){let L=x.getAttribute?.(T);L&&m(L,v)}}}}kt();var lo=new WeakMap,fo=new WeakMap;function zn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([u,l])=>{let f={property:u,value:i.getPropertyValue(u),priority:i.getPropertyPriority(u)};return i.setProperty(u,l,"important"),f.forcedValue=i.getPropertyValue(u),f}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function Ds(t){if(lo.has(t))return zn(t,[],lo);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return zn(t,s,lo)}return()=>{}}function Hn(t,e=null){let n=[],r=i=>{if(!Rt(i))return;if(fo.has(i)){n.push(zn(i,[],fo));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(zn(i,[["content-visibility","visible"]],fo))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.righte.right+200||a.bottome.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}St();yt();Mt();ke();Mt();function po(t){return Bs(t.boxShadow)}function ho(t){return Bs(t.textShadow)}function Bs(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;cparseFloat(g))||[];if(u.length<2)continue;let[l,f,d=0,h=0]=u,m=Math.abs(l)+d+h,p=Math.abs(f)+d+h;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),s=Math.max(s,p+Math.max(f,0)),i=Math.max(i,p+Math.max(-f,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function mo(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function go(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function yo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let u=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[l=0,f=0,d=0]=u,h=Math.abs(l)+d,m=Math.abs(f)+d;i=Math.max(i,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:D(r),right:D(i),bottom:D(o),left:D(s)},has:a}}function Uf(t){let e=po(t),n=ho(t),r=mo(t),i=go(t),o=yo(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function zf(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function Ws(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function Us(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,u=Ws(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let d=n.get(f);if(!d||!zf(d))continue;let h=Uf(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),p={left:m.left-h.left/r,top:m.top-h.top/i,right:m.right+h.right/r,bottom:m.bottom+h.bottom/i};for(let g=f.parentElement;g;g=g.parentElement){let y=Ws(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(p.left=Math.max(p.left,b.left),p.right=Math.min(p.right,b.right)),y.y&&(p.top=Math.max(p.top,b.top),p.bottom=Math.min(p.bottom,b.bottom))}if(g===t)break}u.x||(c=Math.max(c,(l.left-p.left)*r),s=Math.max(s,(p.right-l.right)*r)),u.y||(o=Math.max(o,(l.top-p.top)*i),a=Math.max(a,(p.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function zs(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=fe(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let u=Zt({scale:c});return{a:u.a,b:u.b,c:u.c,d:u.d}}function i(c,u,l,f){let d=Math.sqrt(c*c+u*u)||0,h=0,m=0;if(d>0){let p=c/d,g=u/d;h=p*l+g*f;let y=l-p*h,b=f-g*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let o=c=>{let u=fe(t).scale;if(!u)return c;let l=Zt({scale:u,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===6&&c.every(Number.isFinite)){let[u,l,f,d]=c,h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===16&&c.every(Number.isFinite)){let u=c[0],l=c[1],f=c[4],d=c[5],h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let c=new DOMMatrix(r),u=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return o(u)}catch{return null}}function Oe(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,u=n.e||0,l=n.f||0;function f(y,b){let w=y-r,v=b-i,C=o*w+a*v,S=s*w+c*v;return C+=r+u,S+=i+l,[C,S]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,p=-1/0,g=-1/0;for(let[y,b]of d)yp&&(p=y),b>g&&(g=b);return{minX:h,minY:m,maxX:p,maxY:g,width:p-h,height:g-m}}function dn(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?c/2:u==="right"||u==="bottom"?c:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*c/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(i,e),oy:s(o,n)}}function fe(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),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}var uo=null;function Hf(){if(uo?.isConnected)return uo;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Z(t),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),uo=t,t}function Zt(t){let e=o=>{let s=[],a=0,c=0,u=String(o).trim();for(let l=0;lc&&s.push(u.slice(c,l)),c=l+1);return co&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=Hf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");o.appendChild(s);try{return jf(s)}finally{s.remove()}}}function Hs(t){let e=O(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 i=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!!(i||o||s)}function jf(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Gs=new WeakSet;function jn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function bo(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Ot(e)?e.host:null}function Vf(t,e){for(let n=e;n;n=bo(n))if(n===t)return!0;return!1}function qf(t,e){for(let n=bo(t);n&&n!==e&&n?.nodeType===1;n=bo(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function So(t,e){try{return Zt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Xs(t,e,n,r,i){let o=t.getBoundingClientRect();Rt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!Rt(a)||c?.nodeType!==1||c===t||!Vf(t,c))continue;let u=r.get(c)||O(c),l=u.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let f=c.getBoundingClientRect();if(!(f.width>0&&f.height>0))continue;Gs.add(a);let d=u.transform&&u.transform!=="none"?u.transform:"",h=fe(c),m=!!(d||h.rotate!=="0deg"||h.scale||h.translate),p=m?So(d,h):null,g=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,y=f.width,b=f.height;g||(y=c.offsetWidth||f.width,b=c.offsetHeight||f.height);let w=c.getRootNode&&Ot(c.getRootNode()),v=o,C=t.clientLeft||0,S=t.clientTop||0;if(w){let k=qf(c,t);k&&(v=k.getBoundingClientRect(),C=k.clientLeft||0,S=k.clientTop||0)}let M=f.left-v.left-C,_=f.top-v.top-S;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:k,oy:R}=dn(u,y,b),T=Oe(y,b,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},k,R);M-=T.minX,_-=T.minY}if(l!=="fixed"){let k=a.cloneNode(!1);k.setAttribute("data-snap-ph","1"),k.style.position="static",k.style.visibility="hidden",k.style.width=`${y}px`,k.style.height=`${b}px`,k.style.boxSizing="border-box",a.parentElement?.insertBefore(k,a)}let E=y+2,x=b;i&&(Math.abs(_-i.y)<.5&&(_-=1,x+=1),Math.abs(M-i.x)<.5&&(M-=1,E+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${_}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${E}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function Ys(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){H(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){H(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){H(n,"Couldn't remove the root outline.",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){H(n,"Couldn't remove the root drop-shadow filter.",s)}}function Ks(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function js(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Gf(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Qs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!js(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=Gf(s,i);if(!c)break;let u=n?Array.from(a.children).find(d=>n.get(d)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),f=parseFloat(l[`margin${o}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${o}`]="0px"),js(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=u}}}var Xf=new Set(["xml","xlink"]);function Yf(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Xf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var Kf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,Vs=t=>t.replace(Kf,e=>e.length===2?e:""),Qf=/^data:[^,]{0,120};base64,/;function Vn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(Yf(c.name,n)){a.removeAttribute(c.name);continue}if(Qf.test(c.value))continue;let u=Vs(c.value);if(u!==c.value)try{a.setAttribute(c.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=Vs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Jf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var Zf=new Set(["img","canvas","video","iframe","object","embed"]);function tu(t){return It(t)||Zf.has(t?.localName)}function eu(t,e){if(t?.nodeType!==1||Jf(t)||tu(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function Js(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&eu(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",f=c.overflowX||c.overflowInline||"visible";(l!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(r)for(let l of u){let f=r.get(l);f&&f.nodeType===1&&i(f,l)}else{let l=Array.from(o.children);for(let f=0;fo&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,u=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+l+f+d+c}var D=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,De=.75;function Zs(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,u=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-u)>.02)return 0;let l=s.createElement("div");Z(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=l.attachShadow({mode:"open"}),d=s.createElement("style");d.textContent=n,f.appendChild(d);let h=e.cloneNode(!0);f.appendChild(h),s.body.appendChild(l);let m=0,p=(g,y,b)=>{let w=O(g),v=w.boxSizing==="border-box",C=(S,M,..._)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let x=E+(v?0:_.reduce((k,R)=>k+(parseFloat(R)||0),0));return Math.abs(x-M)<=.51?x:M};return{width:C(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:C(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,v=b>0&&g.height>0?g.height/b:1,C=(S,M,_=!1)=>{let E=S.children,x=M.children,k=Math.min(E.length,x.length);for(let R=0;R0&&A.height>0){let N=L.getBoundingClientRect(),$=A.width/c,F=A.height/u,z=N.width,q=N.height,j=W.offsetWidth||$,J=W.offsetHeight||F,B=L.offsetWidth||z,ut=L.offsetHeight||q,vt=Math.abs($-j)>De||Math.abs(F-J)>De||Math.abs(z-B)>De||Math.abs(q-ut)>De;if(P){let nt=p(L,B,ut);$=z>0?$*w*nt.width/z:$,F=q>0?F*v*nt.height/q:F,z=nt.width,q=nt.height}else if(vt){let nt=p(W,j,J),pt=p(L,B,ut);$=nt.width,F=nt.height,z=pt.width,q=pt.height}let at=z-$,st=q-F;(Math.abs(at)>De||Math.abs(st)>De)&&(T.style.boxSizing="border-box",T.style.width=`${D($)}px`,T.style.height=`${D(F)}px`,m++)}}C(T,L,P)}};C(e,h)}finally{l.remove()}return m}var ou=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function wo(t,e=new Set){let n="";if(!t)return n;for(let r=0;r{for(let b=y;b;b=b.assignedSlot||b.parentElement||b.getRootNode()?.host)if(b===g)return!0;return!1};for(;;){let g=[...qn].filter(({root:y})=>p(y,t)||p(t,y)).map(({promise:y})=>y.catch(()=>{}));if(!g.length)break;await Promise.all(g)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let p=t.getBoundingClientRect(),g=t.ownerDocument?.defaultView||window,y=p.right<=0||p.bottom<=0||p.left>=g.innerWidth||p.top>=g.innerHeight,b=[];if(y&&(()=>{let v=[];t.shadowRoot&&v.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&v.push(C.shadowRoot);for(;v.length;){let C=v.pop(),S=C.host?.localName==="calcite-icon";for(let M of C.querySelectorAll("*")){if(M.shadowRoot&&v.push(M.shadowRoot),!S||M.localName!=="svg")continue;let _=M.querySelectorAll("path");if(!_.length||[..._].some(x=>x.getAttribute("d")?.trim()))continue;let E=M.getBoundingClientRect();E.width&&E.height&&b.push(M)}}})(),b.length){let v=(async()=>{let S=t.style,M=t.hasAttribute("style"),_=new Map,E=(x,k)=>{_.has(x)||_.set(x,{value:S.getPropertyValue(x),priority:S.getPropertyPriority(x)}),S.setProperty(x,k,"important");let R=_.get(x);R.forcedValue=S.getPropertyValue(x),R.forcedPriority=S.getPropertyPriority(x)};try{E("left","0"),E("top","0"),E("right","auto"),E("bottom","auto"),E("margin-top","0"),E("margin-right","0"),E("margin-bottom","0"),E("margin-left","0"),E("transform","none"),E("translate","none"),E("opacity","0"),E("pointer-events","none");let x=t.getBoundingClientRect();if(x.right<=0||x.bottom<=0||x.left>=g.innerWidth||x.top>=g.innerHeight){let T=t.parentElement?.getBoundingClientRect(),L=T&&T.right>0&&T.left0&&T.topb.some(T=>{if([...T.querySelectorAll("path")].some(W=>W.getAttribute("d")?.trim()))return!1;let L=T.getBoundingClientRect();return L.width&&L.height&&L.right>0&&L.bottom>0&&L.leftsetTimeout(T,25));await bt(100)}finally{for(let[x,k]of _)S.getPropertyValue(x)!==k.forcedValue||S.getPropertyPriority(x)!==k.forcedPriority||(k.value?S.setProperty(x,k.value,k.priority):S.removeProperty(x));!M&&!S.length&&t.removeAttribute("style"),await bt(100)}})(),C={root:t,promise:v};qn.add(C);try{await v}finally{qn.delete(C)}}}catch{}let u=Ds(t),l=Hn(t,o);if(o){let p=t.getBoundingClientRect(),g=t.offsetWidth||p.width,y=t.offsetHeight||p.height,b=p.width&&Math.abs(g-p.width)>=1?g/p.width:1,w=p.height&&Math.abs(y-p.height)>=1?y/p.height:1;i={x:(o.left-p.left)*b,y:(o.top-p.top)*w,width:o.width*b,height:o.height*w}}try{s=await Jt(t,r,e)}catch(p){throw console.warn("[SnapDOM] Capture failed while copying the element.",p),p}finally{l(),u()}ss(r.nodeMap,t.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{Os(s,void 0,t)}catch(p){console.warn("[SnapDOM] Couldn't copy external SVG icons; some may be missing.",p)}try{await Ie(t,s,r,e)}catch(p){console.warn("[SnapDOM] Couldn't copy ::before/::after content; some decorations may be missing.",p)}await Fn(s,r);for(let[p,g]of r.nodeMap.entries())if(g?.tagName==="STYLE"&&p?.tagName==="STYLE"&&!p.hasAttribute("data-sd"))try{let y=g.sheet&&g.sheet.cssRules;y&&/@media/i.test(p.textContent||"")&&(p.textContent=le(y))}catch{}try{let p=s.querySelectorAll("style[data-sd]");for(let g of p)c+=g.textContent||"",g.remove()}catch(p){H(r,"Couldn't copy shadow DOM styles.",p)}r.slicer?.due()&&await r.slicer.pause();let f=Ze(r.styleMap);a=Array.from(f.entries()).map(([p,g])=>`.${g}{${p}}`).join("");let h=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__usesPlaceholder?au:"")+(r.__pseudoCSS||"");a=h+a;for(let[p,g]of r.styleMap.entries())vo(p,g,f);try{cu(t,s,r.nodeMap)}catch(p){H(r,"Couldn't bring an open dialog or popover into the capture.",p)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let p=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Xs(t,s,r.nodeMap,r.styleCache,p)}catch(p){H(r,"Couldn't keep fixed-position elements in place.",p)}for(let[p,g]of r.nodeMap.entries())r.clip&&g===t||Co(p,g);let m=t.ownerDocument;if((t===m.body||t===m.documentElement)&&m.documentElement.localName==="html"){let p=r.styleCache.get(m.documentElement)||O(m.documentElement);t===m.documentElement&&(s.style.overflow="visible");let g=t===m.body?s:s.querySelector("body");if(g&&p.overflowX==="visible"&&p.overflowY==="visible"&&p.contain==="none"&&!p.containerType?.includes("size")&&p.contentVisibility!=="auto"&&p.contentVisibility!=="hidden"){let y=r.styleCache.get(m.body)||O(m.body);y.contain==="none"&&!y.containerType?.includes("size")&&y.contentVisibility!=="auto"&&y.contentVisibility!=="hidden"&&y.display!=="none"&&(g.style.overflow="visible")}}if(t===r.nodeMap.get(s)){let p=r.styleCache.get(t)||O(t);r.styleCache.set(t,p);let g=Mr(p.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=g||"",s.style.translate="none"}for(let[p,g]of r.nodeMap.entries())g.tagName==="PRE"&&(p.style.marginTop="0",p.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function cu(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),u=c.backgroundColor,l=c.backgroundImage;if(u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||l&&l!=="none"){let d=document.createElement("div");d.setAttribute("data-sd-backdrop",""),d.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${u};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(d)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function vo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Ot(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function Co(t,e){let n=e.scrollLeft,r=e.scrollTop;if(!(n||r)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let s=t.querySelectorAll("*");for(let a of s){if(a.nodeType!==1||a.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let c=a.style.position;if(c==="fixed"||c==="absolute"){let u=parseFloat(a.style.top)||0,l=parseFloat(a.style.left)||0;a.style.top=`${u+r}px`,a.style.left=`${l+n}px`,c==="fixed"&&(a.style.position="absolute")}}}catch{}let o=document.createElement("div");for(o.style.all="unset",o.style.transform=`translate(${-n}px, ${-r}px)`,o.style.willChange="transform",o.style.display="inline-block",o.style.width="100%";t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}we();oe();yt();var na="http://www.w3.org/1999/xlink";function lu(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(na,"href"):null)}function fu(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Gn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||Pe(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let u=I.image?.get(c);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await ft(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){I.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:d}=fu(a),{fallbackURL:h}=e||{};if(h)try{let m=typeof h=="function"?await h({width:f,height:d,src:c,element:a}):h;if(m){let p=await ft(m,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=f),a.height||(a.height=d);return}}}catch{}if(e.placeholders!==!1){At(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let m=document.createElement("div");m.style.cssText=[`width:${f}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,a.replaceWith(m)}},i=6;for(let a=0;a{let c=lu(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let u=await ft(c,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(na,"href"))};for(let a=0;am in o?o[m]:"":m=>i.getPropertyValue(m),a=s("border-image"),c=s("border-image-source"),u=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),f=s("background-color"),d=l&&l!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=wt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(d&&!h)for(let m of pu){let p=s(m);p&&e.style.setProperty(m,p)}for(let m of uu){if(h&&m==="background-image")continue;let p=i.getPropertyValue(m);if(m==="background-image"&&(!p||p==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(p=Xt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let g=Xt(p),y=await Promise.all(g.map(b=>Se(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(m,y.join(", "))}for(let m of du){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(u)for(let m of hu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(d&&/fixed/.test(s("background-attachment")||""))try{await yu(t,e,i)}catch{}}function gu(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let d=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*d,h:n*d}}let s=o.split(/\s+/),a=(d,h)=>{if(d==="auto"||d===void 0)return null;if(d.endsWith("px"))return parseFloat(d);if(d.endsWith("%"))return h*parseFloat(d)/100},c=a(s[0],r),u=a(s[1],i);if(c===void 0||u===void 0)return null;let l=c,f=u;return l==null&&f==null?(l=e||r,f=n||i):l==null?l=e&&n?f*(e/n):r:f==null&&(f=e&&n?l*(n/e):i),!l||!f?null:{w:l,h:f}}async function yu(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(m=>m.trim()),i=tn();if(!i)for(let m=t.parentElement;m&&!i;m=m.parentElement){let p=O(m);(p.transform&&p.transform!=="none"||p.filter&&p.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,u=Xt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(m=>m.trim()),f=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(m=>m.trim()),d=[],h=[];for(let m=0;m{if(!x)return 0;if(x.endsWith("px"))return parseFloat(x);if(x.endsWith("%"))return(k-R)*parseFloat(x)/100},_=M(S[0]||"0%",a,C.w),E=M(S[1]||S[0]||"0%",c,C.h);if(_===void 0||E===void 0){d.push(g),h.push(y);continue}d.push(`${Xn(C.w)}px ${Xn(C.h)}px`),h.push(`${Xn(_-o.left)}px ${Xn(E-o.top)}px`)}e.style.setProperty("background-size",d.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Xn=t=>Math.round(t*100)/100;async function Yn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Yr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let u of c.children){if(u.tagName==="STYLE")continue;let l=i.get(u);l&&Yr(l)&&o.push([l,u]),s.push(u)}}let a=6;for(let c=0;cmu(u,l,n,r)))}St();function oa(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let u=O(c),l=u.getPropertyValue("backdrop-filter")||u.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:xu(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let u=e.cloneNode(!0);Su(u,e,a.orig.getBoundingClientRect(),n),vu(ra(u,a.path));for(let l=0;l.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",u.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let f of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(f,s.getPropertyValue(f));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(u)}var Kn=128;function Su(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Kn||l.rightn.bottom+Kn||l.bottom{};let n=[],r=200;function i(o){if(e){let u=o.getBoundingClientRect();if(u.width>0||u.height>0){let l=Math.max(u.right,u.left+(o.scrollWidth||0)),f=Math.max(u.bottom,u.top+(o.scrollHeight||0));if(le.right+r||fe.bottom+r)return}}let s=getComputedStyle(o),a=Cu(o,s);a&&n.push(a);let c=ku(o,s);c&&n.push(c);for(let u of o.children||[])i(u)}return i(t),()=>n.forEach(o=>o())}function Cu(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Mu(e);if(n<=0)return()=>{};if(!aa(t))return()=>{};let r=sa(t),i=r.text,o=_u(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Au(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let u=0,l=i.length,f=-1;for(;u<=l;){let h=u+l>>1;r.write(i.slice(0,Qn(i,h))+"\u2026"),t.scrollHeight<=c+.5?(f=h,u=h+1):l=h-1}let d=(f>=0?i.slice(0,Qn(i,f)):"")+"\u2026";return r.write(d),ia(t,d,r)}function ku(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!aa(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=sa(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,Qn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,Qn(r,s)):"")+"\u2026";return n.write(a),ia(t,a,n)}function ia(t,e,n){return()=>{t.textContent===e&&n.restore()}}function sa(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Mu(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Au(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 _u(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function aa(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var We=["clone","render"],pn={clone:0,render:1},gt="render";function ca(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:gt,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?gt:o.needs;if(!Object.prototype.hasOwnProperty.call(pn,s))throw new Error(`[SnapDOM] Plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${We.join(", ")}.`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,pn[s])}if(n<0)return{stage:gt,loweredBy:[]};let i=We[n];return{loweredBy:i===gt?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function Be(t,e){return pn[t]>=pn[e]}function la(t,e,n=We){let r=n[n.length-1];if(e==null)return r;if(!Object.prototype.hasOwnProperty.call(pn,e))throw new Error(`[SnapDOM] ${t}: needs must be one of ${We.join(", ")}, got ${JSON.stringify(e)}.`);if(!n.includes(e))throw new Error(`[SnapDOM] ${t} cannot run at stage '${e}'; it supports ${n.join(", ")}.`);return e}function fa(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[SnapDOM] No ${n}: this capture stopped at '${t}' because ${r} asked for needs: '${t}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var Ue=[];function ze(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function Mo(...t){let e=t.flat();for(let n of e){let r=ze(n);if(r){if(r.needs!==void 0&&r.needs!==gt)throw new Error(`[SnapDOM] '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}, so it can't be a global plugin (it would stop every capture before '${gt}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);Ue.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ue.push(r)}}}function ua(t){return t&&Array.isArray(t.plugins)?t.plugins:Ue}async function Bt(t,e,n){let r=n,i=ua(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function Zn(t,e,n){let r=[],i=ua(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}function Eu(){Ue.length=0}var Ru=0;function Fu(t){let e=[];if(Array.isArray(t))for(let n of t){let r=ze(n);if(!r)continue;r.name||(r.name=`anonymous-${++Ru}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of Ue)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function da(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Fu(e)),t}function Ao(){return Ue.slice()}var Tu=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function tr(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=ze(n);if(!(!r||r.pure===!0)){for(let i of Tu)if(typeof r[i]=="function")return!0}}return!1}yt();ke();var de="data-snapdom-asset",ga="http://www.w3.org/1999/xlink",Pu=0;function nr(t,e,n,r,i,o){let s=o.__compressedAssets||=new WeakMap,a=s.get(t);a||(a={token:String(++Pu),properties:[]},s.set(t,a),t.setAttribute(de,a.token));let c=a.properties.find(u=>u.kind===e&&u.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var ya=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function rr(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${de}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(de)!==o.token)continue;let s=o.properties.filter(a=>ya(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function or(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${de}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(de,i.token))}}function ba(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${de}]`))for(let s of e.get(o.getAttribute(de))||[])ya(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(ga,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function pa(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function _o(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(h,m)=>{try{return h[m]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),u=Number.isFinite(e.height);if(!i&&(c||u)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Zt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let m=Math.abs(h.a)*s+Math.abs(h.c)*a,p=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,m),a=Math.min(a,p)}}catch{s=0,a=0}let l=(c||u?Math.max(c?s?e.width/s:1/0:0,u?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let f=new WeakMap,d=h=>{if(!h||h.nodeType!==1)return 1;if(f.has(h))return f.get(h);let m=h.isConnected?O(h):h.style,p=1;try{m?.perspective&&m.perspective!=="none"&&(p=1/0);let g=m?.transform;if(g&&g!=="none")p*=pa(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;bparseFloat(b)/(b.endsWith("%")?100:1));p*=Math.max(...y.map(Math.abs))}if(h!==n&&m?.zoom&&m.zoom!=="normal"&&(p*=parseFloat(m.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=C=>/^\d+(?:\.\d+)?px$/.test(m?.[C]||"")?parseFloat(m[C]):o(h,C),w=b("width"),v=b("height");p*=w>0&&v>0?Math.max(w/y.width,v/y.height):1/0}}catch{p=1/0}return Number.isFinite(p)||(p=1/0),h!==n&&(p*=d(h.parentElement||h.getRootNode?.().host)),f.set(h,p),p};return{density:l,stretch:d}}var wa=.92,Sa=1;async function $u(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Nu(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var Lu=64*1024,ha=32*1024*1024,er=new Map;function Iu(t,e,n,r){if(n.length+(r?.length||0)>ha)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>ha;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Ou(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;ce[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function ma(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Wu=`self.onmessage = async (e) => { +`?"":r})}function Lf(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Nf(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function ao(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let u=a.slice();return u[u.length-1]=Math.max(u[u.length-1],c),u}return a}}:e}function co(t,e,n){let r=new Map,i=(u,l)=>un(u,l).map(([f,d])=>({name:f,num:d})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(u){if(r.has(u))return r.get(u).slice();let l=n.getStack(t,u);l=l.length?l.slice():[];let f=o.find(m=>m.name===u);if(f){let m=Number.isFinite(f.num)?f.num:0;l=l.length?[...l,m]:[m]}let d=s.find(m=>m.name===u);if(d){let m=Number.isFinite(d.num)?d.num:0;l.length===0&&(l=[0]),l[l.length-1]=m}let h=a.find(m=>m.name===u);if(h){let m=Number.isFinite(h.num)?h.num:1;l.length===0&&(l=[0]),l[l.length-1]+=m}return r.set(u,l.slice()),l}return{get(u,l){let f=c(l);return f.length?f[f.length-1]:0},getStack(u,l){return c(l)},__incs:a}}var If=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Of=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function Ls(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let f=O(t).display||"";if(i==="::marker"?!f.includes("list-item"):!(f==="block"||f==="flow-root"||f==="list-item"||f==="inline-block"||f==="table-cell"||f==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let c="";for(let f of o){let d=s.getPropertyValue(f);d&&d!==a.getPropertyValue(f)&&!(f==="background-color"&&d==="rgba(0, 0, 0, 0)")&&!(f==="vertical-align"&&d==="baseline")&&(c+=`${f}:${d};`)}if(i==="::marker"){let f=s.getPropertyValue("content");f&&f!=="normal"&&f!=="none"&&(c+=`content:${f};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function Df(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Wf(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=$f(o),o=Df(o,t);let s=ao(t,n,r),a=co(t,i,s),c=Rs(o)?Ts(o,t,a):o;return{text:Lf(c),incs:a.__incs||[]}}function Bf(t,e){if(e.__shadowPseudo)return!1;let n=Fe(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Ie(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Tf(o,n)&&!n.__shadowPseudo||!i&&Bf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Pf(t.ownerDocument||document,n));let s=n.__counterCtx,a=Fe(t);a.marker!==""&&Ls(t,e,n,a.marker,"::marker",If),a.firstLine!==""&&Ls(t,e,n,a.firstLine,"::first-line",Of);for(let u of["::before","::after","::first-letter"]){let l=a[u==="::before"?"before":u==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let f=O(t,u);if(!f||f.content==="none"&&f.backgroundImage==="none"&&(f.backgroundColor==="transparent"||f.backgroundColor==="rgba(0, 0, 0, 0)")&&!Ns(f)&&(!f.transform||f.transform==="none")&&f.display==="inline")continue;if(f.display==="none"||u!=="::first-letter"&&(f.content==="none"||f.content==="normal")){u==="::before"&&(e.dataset.snapdomHasBefore="1"),u==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(u==="::first-letter"){let V=O(t),G=(V?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let U=jt=>f[jt]!==V[jt]&&(parseFloat(f[jt])||0)!==0;if(!(f.color!==V.color||f.fontSize!==V.fontSize||f.fontWeight!==V.fontWeight||f.fontFamily!==V.fontFamily||f.fontStyle!==V.fontStyle||f.textTransform!==V.textTransform||f.float!==V.float&&f.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let Y=Array.from(e.childNodes).find(jt=>jt.nodeType===Node.TEXT_NODE&&jt.textContent?.trim().length>0);if(!Y)continue;let Ct=Y.textContent,ye=/^\s*/.exec(Ct)[0],bn=Ct.slice(ye.length),Xe=bn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Sr=bn.slice(Xe?.length||0);if(!Xe||/[\uD800-\uDFFF]/.test(Xe))continue;let Ht=document.createElement("span");Ht.textContent=Xe,Ht.dataset.snapdomPseudo="::first-letter";let xr=Ce(f,kn(t)),vr=ve(xr,"span");n.styleMap.set(Ht,vr);let wn=document.createTextNode(Sr);e.replaceChild(wn,Y),e.insertBefore(Ht,wn),ye&&e.insertBefore(document.createTextNode(ye),Ht);continue}let m=f.content??"",p=m===""||m==="none"||m==="normal",{text:g,incs:y}=Wf(t,u,s,n.__siblingCounters),b=f.backgroundImage,w=f.backgroundColor,v=f.fontFamily,C=parseInt(f.fontSize)||32,S=parseInt(f.fontWeight)||!1,M=f.fontStyle||"normal",_=f.color||"#000",E=f.transform,x=Nt(v,r?.__iconMatchers),k=!p&&g!=="",R=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",L=Ns(f),W=E&&E!=="none",P=m!=="none"&&m!=="normal",A=/^inline-/.test(f.display||""),N=P&&((parseFloat(f.width)||0)>0||(parseFloat(f.height)||0)>0||A),$=P&&f.boxShadow&&f.boxShadow!=="none",F=P&&f.outlineStyle&&f.outlineStyle!=="none"&&(parseFloat(f.outlineWidth)||0)>0;if(!(k||R||T||L||W||N||$||F)){if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let U=ao(t,s,n.__siblingCounters),Y=co(t,O(t,u),U).get(t,G);V.set(G,Y)}n.__siblingCounters.set(t.parentElement,V)}continue}let q=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),j=f.display==="inline"&&f.cssFloat==="none"&&f.position!=="absolute"&&f.position!=="fixed",J=!1;if(k&&!x&&g.length>1&&!q&&j){let V=O(t),G=parseFloat(V.fontSize)||16,U=parseFloat(V.lineHeight);Number.isFinite(U)||(U=G*1.5),t.getBoundingClientRect().height=1.5*(parseFloat(f.lineHeight)||(parseFloat(f.fontSize)||16)*1.2)&&(st=!1,B.style.whiteSpace=f.whiteSpace);let nt=ve(ut,"span",st,at);if(n.styleMap.set(B,nt),x&&g&&g.length===1){let{dataUrl:V,width:G,height:U}=await ws(g,v,S,C,_,M),ht=document.createElement("img");ht.src=V,ht.style=`height:${C}px;width:${G/U*C}px;object-fit:contain;`,B.appendChild(ht),e.dataset.snapdomHasIcon="true"}else if(g&&q){let V=Ke(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(g);if(V?.trim())try{let G=await ft(qt(V),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let U=document.createElement("img");U.src=G.data,U.style=`width:${C}px;height:auto;object-fit:contain;`,B.appendChild(U)}}catch(G){console.warn(`[SnapDOM] Couldn't draw the ${u} icon of`,t,G)}}else!x&&k&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=f.backgroundRepeat,B.style.backgroundSize=f.backgroundSize,f.backgroundPositionX&&f.backgroundPositionY?(B.style.backgroundPositionX=f.backgroundPositionX,B.style.backgroundPositionY=f.backgroundPositionY):B.style.backgroundPosition=f.backgroundPosition,B.style.backgroundOrigin=f.backgroundOrigin,B.style.backgroundClip=f.backgroundClip,B.style.backgroundAttachment=f.backgroundAttachment,B.style.backgroundBlendMode=f.backgroundBlendMode}catch{}if(R)try{let V=Xt(b),G=await Promise.all(V.map(U=>Se(U,r)));B.style.backgroundImage=G.join(", ")}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} background image.`,V)}T&&(B.style.backgroundColor=w);let pt=f.maskImage||f.webkitMaskImage;if(pt&&pt!=="none")try{let G=(await Promise.all(Xt(pt).map(U=>Se(U,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let U of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])f[U]&&(B.style[U]=f[U])}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} mask image.`,V)}let ge=B.childNodes.length>0||B.textContent?.trim()!==""||R||T||L||W||N||$||F;if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map,G=ao(t,s,n.__siblingCounters),U=co(t,O(t,u),G);for(let{name:ht}of y){if(!ht)continue;let Y=U.get(t,ht);V.set(ht,Y)}n.__siblingCounters.set(t.parentElement,V)}if(!ge)continue;u==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(f){console.warn(`[SnapDOM] Couldn't copy the ${u} of`,t,f)}}let c=Array.from(e.children).filter(u=>!u.dataset.snapdomPseudo);if(n.nodeMap)for(let u of c){let l=n.nodeMap.get(u);l?.nodeType===1&&await Ie(l,u,n,r,!0)}else{let u=Array.from(t.children);for(let l=0;lwindow.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),u="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let M=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(u,"href"):null);if(M)return M;let _=S.attributes;if(!_)return null;for(let E=0;E<_.length;E++){let x=_[E];if(!x||!x.name)continue;if(x.name==="href")return x.value;let k=x.name.indexOf(":");if(k!==-1&&x.name.slice(k+1)==="href")return x.value}return null},f=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),d=new Set,h=!1,m=(S,M=null)=>{if(!S)return;s.lastIndex=0;let _;for(;_=s.exec(S);){h=!0;let E=(_[1]||"").trim();E&&(f.has(E)||(d.add(E),M&&!M.has(E)&&M.add(E)))}},p=S=>{let M=S.querySelectorAll("use");for(let x of M){let k=l(x);if(!k||!k.startsWith("#"))continue;h=!0;let R=k.slice(1).trim();R&&!f.has(R)&&d.add(R)}let _='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';m(S.getAttribute("style")||"");for(let x of a)m(S.getAttribute(x));let E=S.querySelectorAll(_);for(let x of E){m(x.getAttribute("style")||"");for(let k of a)m(x.getAttribute(k))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let M="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",_=!1;try{_=!!(i.querySelector&&i.querySelector(M))}catch{return}if(!_)return;let E=["filter","clipPath","mask","maskImage","webkitMaskImage"],x=k=>{if(It(k))return;let R;try{R=getComputedStyle(k)}catch{return}for(let T of E){let L=R[T];L&&L.includes("url(")&&m(L)}};x(S);for(let k of S.querySelectorAll("*"))x(k)};for(let S of o)p(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||f.has(S))return null;let M=c(S),_=E=>{let x=i.querySelector(E);return x&&!t.contains(x)?x:null};return _(`svg defs > *#${M}`)||_(`svg > symbol#${M}`)||_(`*#${M}`)};if(!d.size)return;let v=new Set(d),C=new Set;for(;v.size;){let S=v.values().next().value;if(v.delete(S),!S||f.has(S)||C.has(S))continue;let M=w(S);if(!M){C.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let _=M.cloneNode(!0);_.id||_.setAttribute("id",S),b.appendChild(_),C.add(S),f.add(S);let E=[_,..._.querySelectorAll("*")];for(let x of E){let k=l(x);if(k&&k.startsWith("#")){let T=k.slice(1).trim();T&&!f.has(T)&&!C.has(T)&&v.add(T)}let R=x.getAttribute?.("style")||"";R&&m(R,v);for(let T of a){let L=x.getAttribute?.(T);L&&m(L,v)}}}}kt();var lo=new WeakMap,fo=new WeakMap;function zn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([u,l])=>{let f={property:u,value:i.getPropertyValue(u),priority:i.getPropertyPriority(u)};return i.setProperty(u,l,"important"),f.forcedValue=i.getPropertyValue(u),f}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function Ds(t){if(lo.has(t))return zn(t,[],lo);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return zn(t,s,lo)}return()=>{}}function Hn(t,e=null){let n=[],r=i=>{if(!Rt(i))return;if(fo.has(i)){n.push(zn(i,[],fo));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(zn(i,[["content-visibility","visible"]],fo))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.righte.right+200||a.bottome.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}St();yt();Mt();ke();Mt();function po(t){return Bs(t.boxShadow)}function ho(t){return Bs(t.textShadow)}function Bs(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;cparseFloat(g))||[];if(u.length<2)continue;let[l,f,d=0,h=0]=u,m=Math.abs(l)+d+h,p=Math.abs(f)+d+h;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),s=Math.max(s,p+Math.max(f,0)),i=Math.max(i,p+Math.max(-f,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function mo(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function go(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function yo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let u=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[l=0,f=0,d=0]=u,h=Math.abs(l)+d,m=Math.abs(f)+d;i=Math.max(i,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:D(r),right:D(i),bottom:D(o),left:D(s)},has:a}}function Uf(t){let e=po(t),n=ho(t),r=mo(t),i=go(t),o=yo(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function zf(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function Ws(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function Us(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,u=Ws(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let d=n.get(f);if(!d||!zf(d))continue;let h=Uf(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),p={left:m.left-h.left/r,top:m.top-h.top/i,right:m.right+h.right/r,bottom:m.bottom+h.bottom/i};for(let g=f.parentElement;g;g=g.parentElement){let y=Ws(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(p.left=Math.max(p.left,b.left),p.right=Math.min(p.right,b.right)),y.y&&(p.top=Math.max(p.top,b.top),p.bottom=Math.min(p.bottom,b.bottom))}if(g===t)break}u.x||(c=Math.max(c,(l.left-p.left)*r),s=Math.max(s,(p.right-l.right)*r)),u.y||(o=Math.max(o,(l.top-p.top)*i),a=Math.max(a,(p.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function zs(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=fe(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let u=Zt({scale:c});return{a:u.a,b:u.b,c:u.c,d:u.d}}function i(c,u,l,f){let d=Math.sqrt(c*c+u*u)||0,h=0,m=0;if(d>0){let p=c/d,g=u/d;h=p*l+g*f;let y=l-p*h,b=f-g*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let o=c=>{let u=fe(t).scale;if(!u)return c;let l=Zt({scale:u,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===6&&c.every(Number.isFinite)){let[u,l,f,d]=c,h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===16&&c.every(Number.isFinite)){let u=c[0],l=c[1],f=c[4],d=c[5],h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let c=new DOMMatrix(r),u=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return o(u)}catch{return null}}function Oe(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,u=n.e||0,l=n.f||0;function f(y,b){let w=y-r,v=b-i,C=o*w+a*v,S=s*w+c*v;return C+=r+u,S+=i+l,[C,S]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,p=-1/0,g=-1/0;for(let[y,b]of d)yp&&(p=y),b>g&&(g=b);return{minX:h,minY:m,maxX:p,maxY:g,width:p-h,height:g-m}}function dn(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?c/2:u==="right"||u==="bottom"?c:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*c/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(i,e),oy:s(o,n)}}function fe(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),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}var uo=null;function Hf(){if(uo?.isConnected)return uo;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Z(t),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),uo=t,t}function Zt(t){let e=o=>{let s=[],a=0,c=0,u=String(o).trim();for(let l=0;lc&&s.push(u.slice(c,l)),c=l+1);return co&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=Hf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");o.appendChild(s);try{return jf(s)}finally{s.remove()}}}function Hs(t){let e=O(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 i=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!!(i||o||s)}function jf(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Gs=new WeakSet;function jn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function bo(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Ot(e)?e.host:null}function Vf(t,e){for(let n=e;n;n=bo(n))if(n===t)return!0;return!1}function qf(t,e){for(let n=bo(t);n&&n!==e&&n?.nodeType===1;n=bo(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function So(t,e){try{return Zt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Xs(t,e,n,r,i){let o=t.getBoundingClientRect();Rt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!Rt(a)||c?.nodeType!==1||c===t||!Vf(t,c))continue;let u=r.get(c)||O(c),l=u.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let f=c.getBoundingClientRect();if(!(f.width>0&&f.height>0))continue;Gs.add(a);let d=u.transform&&u.transform!=="none"?u.transform:"",h=fe(c),m=!!(d||h.rotate!=="0deg"||h.scale||h.translate),p=m?So(d,h):null,g=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,y=f.width,b=f.height;g||(y=c.offsetWidth||f.width,b=c.offsetHeight||f.height);let w=c.getRootNode&&Ot(c.getRootNode()),v=o,C=t.clientLeft||0,S=t.clientTop||0;if(w){let k=qf(c,t);k&&(v=k.getBoundingClientRect(),C=k.clientLeft||0,S=k.clientTop||0)}let M=f.left-v.left-C,_=f.top-v.top-S;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:k,oy:R}=dn(u,y,b),T=Oe(y,b,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},k,R);M-=T.minX,_-=T.minY}if(l!=="fixed"){let k=a.cloneNode(!1);k.setAttribute("data-snap-ph","1"),k.style.position="static",k.style.visibility="hidden",k.style.width=`${y}px`,k.style.height=`${b}px`,k.style.boxSizing="border-box",a.parentElement?.insertBefore(k,a)}let E=y+2,x=b;i&&(Math.abs(_-i.y)<.5&&(_-=1,x+=1),Math.abs(M-i.x)<.5&&(M-=1,E+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${_}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${E}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function Ys(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){H(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){H(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){H(n,"Couldn't remove the root outline.",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){H(n,"Couldn't remove the root drop-shadow filter.",s)}}function Ks(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function js(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Gf(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Qs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!js(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=Gf(s,i);if(!c)break;let u=n?Array.from(a.children).find(d=>n.get(d)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),f=parseFloat(l[`margin${o}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${o}`]="0px"),js(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=u}}}var Xf=new Set(["xml","xlink"]);function Yf(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Xf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var Kf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,Vs=t=>t.replace(Kf,e=>e.length===2?e:""),Qf=/^data:[^,]{0,120};base64,/;function Vn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(Yf(c.name,n)){a.removeAttribute(c.name);continue}if(Qf.test(c.value))continue;let u=Vs(c.value);if(u!==c.value)try{a.setAttribute(c.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=Vs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Jf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var Zf=new Set(["img","canvas","video","iframe","object","embed"]);function tu(t){return It(t)||Zf.has(t?.localName)}function eu(t,e){if(t?.nodeType!==1||Jf(t)||tu(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function Js(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&eu(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",f=c.overflowX||c.overflowInline||"visible";(l!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(r)for(let l of u){let f=r.get(l);f&&f.nodeType===1&&i(f,l)}else{let l=Array.from(o.children);for(let f=0;fo&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,u=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+l+f+d+c}var D=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,De=.75;function Zs(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,u=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-u)>.02)return 0;let l=s.createElement("div");Z(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=l.attachShadow({mode:"open"}),d=s.createElement("style");d.textContent=n,f.appendChild(d);let h=e.cloneNode(!0);f.appendChild(h),s.body.appendChild(l);let m=0,p=(g,y,b)=>{let w=O(g),v=w.boxSizing==="border-box",C=(S,M,..._)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let x=E+(v?0:_.reduce((k,R)=>k+(parseFloat(R)||0),0));return Math.abs(x-M)<=.51?x:M};return{width:C(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:C(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,v=b>0&&g.height>0?g.height/b:1,C=(S,M,_=!1)=>{let E=S.children,x=M.children,k=Math.min(E.length,x.length);for(let R=0;R0&&A.height>0){let N=L.getBoundingClientRect(),$=A.width/c,F=A.height/u,z=N.width,q=N.height,j=W.offsetWidth||$,J=W.offsetHeight||F,B=L.offsetWidth||z,ut=L.offsetHeight||q,vt=Math.abs($-j)>De||Math.abs(F-J)>De||Math.abs(z-B)>De||Math.abs(q-ut)>De;if(P){let nt=p(L,B,ut);$=z>0?$*w*nt.width/z:$,F=q>0?F*v*nt.height/q:F,z=nt.width,q=nt.height}else if(vt){let nt=p(W,j,J),pt=p(L,B,ut);$=nt.width,F=nt.height,z=pt.width,q=pt.height}let at=z-$,st=q-F;(Math.abs(at)>De||Math.abs(st)>De)&&(T.style.boxSizing="border-box",T.style.width=`${D($)}px`,T.style.height=`${D(F)}px`,m++)}}C(T,L,P)}};C(e,h)}finally{l.remove()}return m}var ou=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function wo(t,e=new Set){let n="";if(!t)return n;for(let r=0;r{for(let b=y;b;b=b.assignedSlot||b.parentElement||b.getRootNode()?.host)if(b===g)return!0;return!1};for(;;){let g=[...qn].filter(({root:y})=>p(y,t)||p(t,y)).map(({promise:y})=>y.catch(()=>{}));if(!g.length)break;await Promise.all(g)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let p=t.getBoundingClientRect(),g=t.ownerDocument?.defaultView||window,y=p.right<=0||p.bottom<=0||p.left>=g.innerWidth||p.top>=g.innerHeight,b=[];if(y&&(()=>{let v=[];t.shadowRoot&&v.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&v.push(C.shadowRoot);for(;v.length;){let C=v.pop(),S=C.host?.localName==="calcite-icon";for(let M of C.querySelectorAll("*")){if(M.shadowRoot&&v.push(M.shadowRoot),!S||M.localName!=="svg")continue;let _=M.querySelectorAll("path");if(!_.length||[..._].some(x=>x.getAttribute("d")?.trim()))continue;let E=M.getBoundingClientRect();E.width&&E.height&&b.push(M)}}})(),b.length){let v=(async()=>{let S=t.style,M=t.hasAttribute("style"),_=new Map,E=(x,k)=>{_.has(x)||_.set(x,{value:S.getPropertyValue(x),priority:S.getPropertyPriority(x)}),S.setProperty(x,k,"important");let R=_.get(x);R.forcedValue=S.getPropertyValue(x),R.forcedPriority=S.getPropertyPriority(x)};try{E("left","0"),E("top","0"),E("right","auto"),E("bottom","auto"),E("margin-top","0"),E("margin-right","0"),E("margin-bottom","0"),E("margin-left","0"),E("transform","none"),E("translate","none"),E("opacity","0"),E("pointer-events","none");let x=t.getBoundingClientRect();if(x.right<=0||x.bottom<=0||x.left>=g.innerWidth||x.top>=g.innerHeight){let T=t.parentElement?.getBoundingClientRect(),L=T&&T.right>0&&T.left0&&T.topb.some(T=>{if([...T.querySelectorAll("path")].some(W=>W.getAttribute("d")?.trim()))return!1;let L=T.getBoundingClientRect();return L.width&&L.height&&L.right>0&&L.bottom>0&&L.leftsetTimeout(T,25));await bt(100)}finally{for(let[x,k]of _)S.getPropertyValue(x)!==k.forcedValue||S.getPropertyPriority(x)!==k.forcedPriority||(k.value?S.setProperty(x,k.value,k.priority):S.removeProperty(x));!M&&!S.length&&t.removeAttribute("style"),await bt(100)}})(),C={root:t,promise:v};qn.add(C);try{await v}finally{qn.delete(C)}}}catch{}let u=Ds(t),l=Hn(t,o);if(o){let p=t.getBoundingClientRect(),g=t.offsetWidth||p.width,y=t.offsetHeight||p.height,b=p.width&&Math.abs(g-p.width)>=1?g/p.width:1,w=p.height&&Math.abs(y-p.height)>=1?y/p.height:1;i={x:(o.left-p.left)*b,y:(o.top-p.top)*w,width:o.width*b,height:o.height*w}}try{s=await Jt(t,r,e)}catch(p){throw console.warn("[SnapDOM] Capture failed while copying the element.",p),p}finally{l(),u()}ss(r.nodeMap,t.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{Os(s,void 0,t)}catch(p){console.warn("[SnapDOM] Couldn't copy external SVG icons; some may be missing.",p)}try{await Ie(t,s,r,e)}catch(p){console.warn("[SnapDOM] Couldn't copy ::before/::after content; some decorations may be missing.",p)}await Fn(s,r);for(let[p,g]of r.nodeMap.entries())if(g?.tagName==="STYLE"&&p?.tagName==="STYLE"&&!p.hasAttribute("data-sd"))try{let y=g.sheet&&g.sheet.cssRules;y&&/@media/i.test(p.textContent||"")&&(p.textContent=le(y))}catch{}try{let p=s.querySelectorAll("style[data-sd]");for(let g of p)c+=g.textContent||"",g.remove()}catch(p){H(r,"Couldn't copy shadow DOM styles.",p)}r.slicer?.due()&&await r.slicer.pause();let f=Ze(r.styleMap);a=Array.from(f.entries()).map(([p,g])=>`.${g}{${p}}`).join("");let h=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__usesPlaceholder?au:"")+(r.__pseudoCSS||"");a=h+a;for(let[p,g]of r.styleMap.entries())vo(p,g,f);try{cu(t,s,r.nodeMap)}catch(p){H(r,"Couldn't bring an open dialog or popover into the capture.",p)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let p=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Xs(t,s,r.nodeMap,r.styleCache,p)}catch(p){H(r,"Couldn't keep fixed-position elements in place.",p)}for(let[p,g]of r.nodeMap.entries())r.clip&&g===t&&t===t.ownerDocument.scrollingElement||Co(p,g,r.nodeMap,r.styleCache);let m=t.ownerDocument;if((t===m.body||t===m.documentElement)&&m.documentElement.localName==="html"){let p=r.styleCache.get(m.documentElement)||O(m.documentElement);t===m.documentElement&&(s.style.overflow="visible");let g=t===m.body?s:s.querySelector("body");if(g&&p.overflowX==="visible"&&p.overflowY==="visible"&&p.contain==="none"&&!p.containerType?.includes("size")&&p.contentVisibility!=="auto"&&p.contentVisibility!=="hidden"){let y=r.styleCache.get(m.body)||O(m.body);y.contain==="none"&&!y.containerType?.includes("size")&&y.contentVisibility!=="auto"&&y.contentVisibility!=="hidden"&&y.display!=="none"&&(g.style.overflow="visible")}}if(t===r.nodeMap.get(s)){let p=r.styleCache.get(t)||O(t);r.styleCache.set(t,p);let g=Mr(p.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=g||"",s.style.translate="none"}for(let[p,g]of r.nodeMap.entries())g.tagName==="PRE"&&(p.style.marginTop="0",p.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function cu(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),u=c.backgroundColor,l=c.backgroundImage;if(u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||l&&l!=="none"){let d=document.createElement("div");d.setAttribute("data-sd-backdrop",""),d.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${u};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(d)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function vo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Ot(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function Co(t,e,n,r){let i=e.scrollLeft,o=e.scrollTop;if(!(i||o)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let c=t.querySelectorAll("*");for(let u of c){if(u.nodeType!==1||u.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let l=n?.get(u),f=l&&(r?.get(l)||O(l)),d=u.style.position||f?.position;if(d!=="fixed"&&d!=="absolute")continue;let h=f&&f.position!=="absolute"&&d==="absolute",m=null;if(l&&!h)for(let y=l.parentElement||l.getRootNode()?.host;y;y=y.parentElement||y.getRootNode()?.host){let b=r?.get(y)||O(y);if(d==="absolute"&&b.position!=="static"||b.transform&&b.transform!=="none"||b.translate&&b.translate!=="none"||b.rotate&&b.rotate!=="none"||b.scale&&b.scale!=="none"||b.filter&&b.filter!=="none"||b.backdropFilter&&b.backdropFilter!=="none"||b.perspective&&b.perspective!=="none"||/transform|perspective|filter/.test(b.willChange||"")||/layout|paint|strict|content/.test(b.contain||"")){m=y;break}if(y===e)break}if(m){m===e&&(u.style.top=f.top,u.style.left=f.left,u.style.right=f.right,u.style.bottom=f.bottom);continue}let p=parseFloat(u.style.top||f?.top)||0,g=parseFloat(u.style.left||f?.left)||0;u.style.top=`${p+o}px`,u.style.left=`${g+i}px`,d==="fixed"&&(u.style.position="absolute")}}catch{}let a=document.createElement("div");for(a.style.all="unset",a.style.transform=`translate(${-i}px, ${-o}px)`,a.style.willChange="transform",a.style.display="inline-block",a.style.width="100%";t.firstChild;)a.appendChild(t.firstChild);t.appendChild(a)}we();oe();yt();var na="http://www.w3.org/1999/xlink";function lu(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(na,"href"):null)}function fu(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Gn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||Pe(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let u=I.image?.get(c);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await ft(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){I.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:d}=fu(a),{fallbackURL:h}=e||{};if(h)try{let m=typeof h=="function"?await h({width:f,height:d,src:c,element:a}):h;if(m){let p=await ft(m,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=f),a.height||(a.height=d);return}}}catch{}if(e.placeholders!==!1){At(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let m=document.createElement("div");m.style.cssText=[`width:${f}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,a.replaceWith(m)}},i=6;for(let a=0;a{let c=lu(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let u=await ft(c,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(na,"href"))};for(let a=0;am in o?o[m]:"":m=>i.getPropertyValue(m),a=s("border-image"),c=s("border-image-source"),u=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),f=s("background-color"),d=l&&l!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=wt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(d&&!h)for(let m of pu){let p=s(m);p&&e.style.setProperty(m,p)}for(let m of uu){if(h&&m==="background-image")continue;let p=i.getPropertyValue(m);if(m==="background-image"&&(!p||p==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(p=Xt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let g=Xt(p),y=await Promise.all(g.map(b=>Se(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(m,y.join(", "))}for(let m of du){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(u)for(let m of hu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(d&&/fixed/.test(s("background-attachment")||""))try{await yu(t,e,i)}catch{}}function gu(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let d=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*d,h:n*d}}let s=o.split(/\s+/),a=(d,h)=>{if(d==="auto"||d===void 0)return null;if(d.endsWith("px"))return parseFloat(d);if(d.endsWith("%"))return h*parseFloat(d)/100},c=a(s[0],r),u=a(s[1],i);if(c===void 0||u===void 0)return null;let l=c,f=u;return l==null&&f==null?(l=e||r,f=n||i):l==null?l=e&&n?f*(e/n):r:f==null&&(f=e&&n?l*(n/e):i),!l||!f?null:{w:l,h:f}}async function yu(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(m=>m.trim()),i=tn();if(!i)for(let m=t.parentElement;m&&!i;m=m.parentElement){let p=O(m);(p.transform&&p.transform!=="none"||p.filter&&p.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,u=Xt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(m=>m.trim()),f=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(m=>m.trim()),d=[],h=[];for(let m=0;m{if(!x)return 0;if(x.endsWith("px"))return parseFloat(x);if(x.endsWith("%"))return(k-R)*parseFloat(x)/100},_=M(S[0]||"0%",a,C.w),E=M(S[1]||S[0]||"0%",c,C.h);if(_===void 0||E===void 0){d.push(g),h.push(y);continue}d.push(`${Xn(C.w)}px ${Xn(C.h)}px`),h.push(`${Xn(_-o.left)}px ${Xn(E-o.top)}px`)}e.style.setProperty("background-size",d.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Xn=t=>Math.round(t*100)/100;async function Yn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Yr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let u of c.children){if(u.tagName==="STYLE")continue;let l=i.get(u);l&&Yr(l)&&o.push([l,u]),s.push(u)}}let a=6;for(let c=0;cmu(u,l,n,r)))}St();function oa(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let u=O(c),l=u.getPropertyValue("backdrop-filter")||u.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:xu(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let u=e.cloneNode(!0);Su(u,e,a.orig.getBoundingClientRect(),n),vu(ra(u,a.path));for(let l=0;l.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",u.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let f of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(f,s.getPropertyValue(f));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(u)}var Kn=128;function Su(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Kn||l.rightn.bottom+Kn||l.bottom{};let n=[],r=200;function i(o){if(e){let u=o.getBoundingClientRect();if(u.width>0||u.height>0){let l=Math.max(u.right,u.left+(o.scrollWidth||0)),f=Math.max(u.bottom,u.top+(o.scrollHeight||0));if(le.right+r||fe.bottom+r)return}}let s=getComputedStyle(o),a=Cu(o,s);a&&n.push(a);let c=ku(o,s);c&&n.push(c);for(let u of o.children||[])i(u)}return i(t),()=>n.forEach(o=>o())}function Cu(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Mu(e);if(n<=0)return()=>{};if(!aa(t))return()=>{};let r=sa(t),i=r.text,o=_u(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Au(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let u=0,l=i.length,f=-1;for(;u<=l;){let h=u+l>>1;r.write(i.slice(0,Qn(i,h))+"\u2026"),t.scrollHeight<=c+.5?(f=h,u=h+1):l=h-1}let d=(f>=0?i.slice(0,Qn(i,f)):"")+"\u2026";return r.write(d),ia(t,d,r)}function ku(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!aa(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=sa(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,Qn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,Qn(r,s)):"")+"\u2026";return n.write(a),ia(t,a,n)}function ia(t,e,n){return()=>{t.textContent===e&&n.restore()}}function sa(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Mu(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Au(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 _u(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function aa(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var We=["clone","render"],pn={clone:0,render:1},gt="render";function ca(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:gt,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?gt:o.needs;if(!Object.prototype.hasOwnProperty.call(pn,s))throw new Error(`[SnapDOM] Plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${We.join(", ")}.`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,pn[s])}if(n<0)return{stage:gt,loweredBy:[]};let i=We[n];return{loweredBy:i===gt?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function Be(t,e){return pn[t]>=pn[e]}function la(t,e,n=We){let r=n[n.length-1];if(e==null)return r;if(!Object.prototype.hasOwnProperty.call(pn,e))throw new Error(`[SnapDOM] ${t}: needs must be one of ${We.join(", ")}, got ${JSON.stringify(e)}.`);if(!n.includes(e))throw new Error(`[SnapDOM] ${t} cannot run at stage '${e}'; it supports ${n.join(", ")}.`);return e}function fa(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[SnapDOM] No ${n}: this capture stopped at '${t}' because ${r} asked for needs: '${t}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var Ue=[];function ze(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function Mo(...t){let e=t.flat();for(let n of e){let r=ze(n);if(r){if(r.needs!==void 0&&r.needs!==gt)throw new Error(`[SnapDOM] '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}, so it can't be a global plugin (it would stop every capture before '${gt}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);Ue.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ue.push(r)}}}function ua(t){return t&&Array.isArray(t.plugins)?t.plugins:Ue}async function Bt(t,e,n){let r=n,i=ua(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function Zn(t,e,n){let r=[],i=ua(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}function Eu(){Ue.length=0}var Ru=0;function Fu(t){let e=[];if(Array.isArray(t))for(let n of t){let r=ze(n);if(!r)continue;r.name||(r.name=`anonymous-${++Ru}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of Ue)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function da(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Fu(e)),t}function Ao(){return Ue.slice()}var Tu=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function tr(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=ze(n);if(!(!r||r.pure===!0)){for(let i of Tu)if(typeof r[i]=="function")return!0}}return!1}yt();ke();var de="data-snapdom-asset",ga="http://www.w3.org/1999/xlink",Pu=0;function nr(t,e,n,r,i,o){let s=o.__compressedAssets||=new WeakMap,a=s.get(t);a||(a={token:String(++Pu),properties:[]},s.set(t,a),t.setAttribute(de,a.token));let c=a.properties.find(u=>u.kind===e&&u.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var ya=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function rr(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${de}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(de)!==o.token)continue;let s=o.properties.filter(a=>ya(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function or(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${de}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(de,i.token))}}function ba(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${de}]`))for(let s of e.get(o.getAttribute(de))||[])ya(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(ga,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function pa(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function _o(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(h,m)=>{try{return h[m]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),u=Number.isFinite(e.height);if(!i&&(c||u)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Zt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let m=Math.abs(h.a)*s+Math.abs(h.c)*a,p=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,m),a=Math.min(a,p)}}catch{s=0,a=0}let l=(c||u?Math.max(c?s?e.width/s:1/0:0,u?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let f=new WeakMap,d=h=>{if(!h||h.nodeType!==1)return 1;if(f.has(h))return f.get(h);let m=h.isConnected?O(h):h.style,p=1;try{m?.perspective&&m.perspective!=="none"&&(p=1/0);let g=m?.transform;if(g&&g!=="none")p*=pa(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;bparseFloat(b)/(b.endsWith("%")?100:1));p*=Math.max(...y.map(Math.abs))}if(h!==n&&m?.zoom&&m.zoom!=="normal"&&(p*=parseFloat(m.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=C=>/^\d+(?:\.\d+)?px$/.test(m?.[C]||"")?parseFloat(m[C]):o(h,C),w=b("width"),v=b("height");p*=w>0&&v>0?Math.max(w/y.width,v/y.height):1/0}}catch{p=1/0}return Number.isFinite(p)||(p=1/0),h!==n&&(p*=d(h.parentElement||h.getRootNode?.().host)),f.set(h,p),p};return{density:l,stretch:d}}var wa=.92,Sa=1;async function $u(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Nu(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var Lu=64*1024,ha=32*1024*1024,er=new Map;function Iu(t,e,n,r){if(n.length+(r?.length||0)>ha)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>ha;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Ou(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;ce[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function ma(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Wu=`self.onmessage = async (e) => { const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data try { const blob = given || await (await fetch(dataURL)).blob() @@ -37,4 +37,4 @@ ${g} } catch (err) { self.postMessage({ id, error: String(err) }) } -}`,Bu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Lt=null,Uu=0,zu=0,ue=new Map;function xa(){for(let t of ue.values())t(void 0);if(ue.clear(),Array.isArray(Lt))for(let t of Lt)try{t?.terminate()}catch{}Lt=!1}function Hu(){let t,e=null;try{t=URL.createObjectURL(new Blob([Wu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ue.get(n.data.id);r&&(ue.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=xa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function ju(){if(Lt===!1)return!1;if(Lt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Lt=!1;Lt=[]}let t=Uu++%Bu;if(!Lt[t]){let e=Hu();if(!e)return xa(),!1;Lt[t]=e}return Lt[t]}var Vu=5e3;function qu(t,e,n,r,i){let o=ju();return o?new Promise(s=>{let a=++zu,c=setTimeout(()=>{ue.delete(a),s(void 0)},Vu);ue.set(a,u=>{clearTimeout(c),s(u)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:Sa,quality:wa,mime:r})}catch{clearTimeout(c),ue.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function Eo(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=I.compress,s=o.get(i);if(s?.source===t)return s.result;let a=er.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Nu(t),f=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",d=Du(t);if(d&&d.w>0&&d.h>0&&!ma(d.w,d.h,e,n))return null;if(t.length>=Lu){let S=await qu(t,e,n,f,r);if(S!==void 0)return S}let h;try{h=await $u(t)}catch{return null}let m=h.naturalWidth||h.width,p=h.naturalHeight||h.height;if(!m||!p)return null;let g=ma(m,p,e,n);if(!g)return null;let y=g*Sa,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(p*y)),v=document.createElement("canvas");v.width=b,v.height=w;let C=v.getContext("2d");if(!C)return null;C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high",C.drawImage(h,0,0,b,w);try{let S=v.toDataURL(f,wa);if(typeof S=="string"&&S.startsWith("data:image")&&S.length{let f=l.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!d||!h)return;let m=r.value||=_o(t,e),p=m.density*m.stretch(n.get(l)||l),g=await Eo(f,d*p,h*p,l.__snapdomBlob);g&&(o++,s+=f.length,a+=g.length,l.setAttribute("src",g),nr(l,"attribute","src",f,g,e))},u=6;for(let l=0;l{let l=n.get(u);if(!l||!l.isConnected)return;let f;try{f=getComputedStyle(l)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(_=>_.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(_=>!Xu.test(_.trim())))return;let{w:m,h:p}=Yu(l);if(!m||!p)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(_=>parseFloat(_)/100)),y=r.value||=_o(t,e),b=y.density*y.stretch(l)*g,w=m*b,v=p*b,C=u.style.backgroundImage,S=[...C.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=C;for(let _ of S){let E=_[2];if(E.startsWith("data:image/svg"))continue;let x=await Eo(E,w,v);x&&(M=M.split(E).join(x),s++)}M!==C&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),nr(u,"style","background-image",C,u.style.backgroundImage,e))},c=6;for(let u=0;u{let u=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",f=c.getAttribute("height")||"";if(l.includes("%")||f.includes("%"))return;let d=n.get(c),h=d?O(d):c.style,m=(v,C)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[v]||""))return parseFloat(h[v]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(C.trim()))return parseFloat(C);try{return d?.[v]?.baseVal?.value||0}catch{return 0}},p=m("width",l),g=m("height",f);if(!p||!g)return;let y=r.value||=_o(t,e),b=y.density*y.stretch(d||c),w=await Eo(u,p*b,g*b);w&&(c.setAttribute("href",w),nr(c,"attribute","href",u,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(ga,"xlink:href",w),nr(c,"attribute","xlink:href",u,w,e)),o++)},a=6;for(let c=0;c");if(n===-1)return t;let r=/]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,u;for(let y of i)if(y.intern)for(c.lastIndex=0;u=c.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let f=Zu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],p=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,p):y.text;return t.slice(0,n)+m.join("")+g}function Zu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let u=c.getAttribute("style");u&&r.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=u=>{for(let l of u){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let l=u.textContent||"";if(/@import\b/i.test(l))return null;let f=new CSSStyleSheet;f.replaceSync(l),c(f.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&o.add(u[1])}return o}async function sr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Q,...et}=t;t=Object.assign(a,et),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,u;ta(t,s),await Bt("beforeRender",t);let l=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,D(t.element.offsetWidth||parseFloat(l.width)||f.width||1)),h=Math.max(1,D(t.element.offsetHeight||parseFloat(l.height)||f.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let Q=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),et=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0);Q>0&&(h=Math.max(h,D(Q))),et>0&&(d=Math.max(d,D(et)));try{let tt=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,rt=I.measureHints.get(t.element);if(rt&&rt.cssLen===tt&&rt.w0===d&&rt.docH===Q&&rt.docW===et)rt.csh>0&&(h=Math.max(h,D(rt.csh))),rt.csw>0&&(d=Math.max(d,D(rt.csw)));else{let ot=m.createElement("div");Z(ot),ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+d+"px!important;overflow:visible!important;visibility:hidden!important;";let ee=ot.attachShadow({mode:"open"}),ne=m.createElement("style");ne.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,ee.appendChild(ne),ee.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(ot);let Ye=ot.scrollHeight,Vt=ot.scrollWidth;m.body.removeChild(ot),I.measureHints.set(t.element,{cssLen:tt,w0:d,docH:Q,docW:et,csh:Ye,csw:Vt}),Ye>0&&(h=Math.max(h,D(Ye))),Vt>0&&(d=Math.max(d,D(Vt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Q=xo(t.element,t.options),et=1,tt=xo(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(tt)&&tt>=h-rt&&Number.isFinite(Q)&&Q>0&&(h=Math.max(1,Math.min(h,D(Q+et))))}if(t.options?.reconcile)try{let Q=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Zs(t.element,t.clone,Q,t.nodeMap,d,h)}catch(Q){console.warn("[SnapDOM] reconcile couldn't run; captured without it.",Q)}let g=(Q,et=NaN)=>{let tt=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(tt)?tt:et},y=g(t.options.width),b=g(t.options.height),w=n?D(n.width):d,v=n?D(n.height):h,C=w,S=v,M=Number.isFinite(y),_=Number.isFinite(b),E=v>0?w/v:1;M&&_?(C=Math.max(1,D(y)),S=Math.max(1,D(b))):M?(C=Math.max(1,D(y)),S=Math.max(1,D(C/(E||1)))):_&&(S=Math.max(1,D(b)),C=Math.max(1,D(S*(E||1))));let x=0,k=0,R=d,T=h;if(n){let Q=0,et=0;if(Ro(t.element)){let tt=null;if(!r&&o&&Number.isFinite(o.a))tt={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let rt=fe(t.element),ot=So(l.transform&&l.transform!=="none"?l.transform:"",rt);ot&&ot.is2D&&(tt={a:ot.a,b:ot.b,c:ot.c,d:ot.d,e:0,f:0})}if(tt&&!(tt.a===1&&tt.b===0&&tt.c===0&&tt.d===1)){let{ox:rt,oy:ot}=dn(l,d,h),ee=Oe(d,h,tt,rt,ot);Q=ee.minX,et=ee.minY}}x=D(n.x+Q),k=D(n.y+et),R=D(x+n.width),T=D(k+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},et=Oe(d,h,Q,0,0);x=D(et.minX),k=D(et.minY),R=D(et.maxX),T=D(et.maxY)}else if(r&&Ro(t.element)){let et=l.transform&&l.transform!=="none"?l.transform:"",tt=fe(t.element),rt=Zt({baseTransform:et,rotate:tt.rotate||"0deg",scale:tt.scale,translate:tt.translate,width:d,height:h}),{ox:ot,oy:ee}=dn(l,d,h),ne=rt.is2D?rt:new DOMMatrix(rt.toString()),Ye={a:ne.a,b:ne.b,c:ne.c,d:ne.d,e:0,f:0},Vt=Oe(d,h,Ye,ot,ee);x=D(Vt.minX),k=D(Vt.minY),R=D(Vt.maxX),T=D(Vt.maxY)}let L=po(l),W=ho(l),P=mo(l),A=go(l),N=yo(l),$=f.width>0?(R-x)/f.width:1,F=f.height>0?(T-k)/f.height:1,z=i==="subtree"&&!n?Us(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},q=n?{top:0,right:0,bottom:0,left:0}:i?{top:D(Math.max(L.top,W.top,z.top)+P.top+A.top+N.bleed.top),right:D(Math.max(L.right,W.right,z.right)+P.right+A.right+N.bleed.right),bottom:D(Math.max(L.bottom,W.bottom,z.bottom)+P.bottom+A.bottom+N.bleed.bottom),left:D(Math.max(L.left,W.left,z.left)+P.left+A.left+N.bleed.left)}:{top:P.top,right:P.right,bottom:P.bottom,left:P.left};x=D(x-q.left),k=D(k-q.top),R=D(R+q.right),T=D(T+q.bottom);let j=Math.max(1,D(R-x)),J=Math.max(1,D(T-k)),B="http://www.w3.org/2000/svg",ut=Ro(t.element)?2:0,at=D(ut+(r?0:1)),st=Math.ceil(j+at*2),nt=Math.ceil(J+at*2),pt=D(-(D(x)-at)),zt=D(-(D(k)-at)),ge=Math.max(0,pt),V=Math.max(0,zt),G=D(st-Math.min(0,pt)),U=D(nt-Math.min(0,zt)),ht=m.defaultView||window,Y=!X()&&CSS.supports("zoom","2")&&ht.devicePixelRatio||1;a.__layoutZoom=Y;let Ct=document.createElementNS(B,"foreignObject");Ct.setAttribute("x",String(Math.min(0,pt)*Y)),Ct.setAttribute("y",String(Math.min(0,zt)*Y)),Ct.setAttribute("width",String(G*Y)),Ct.setAttribute("height",String(U*Y)),Ct.style.overflow="visible";let ye=document.createElement("style"),bn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ye.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+bn+t.classCSS,Ct.appendChild(ye);let Ge=document.createElement("div");Ge.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ge.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${U}px`+(ge!==0||V!==0?`;padding:${V}px 0 0 ${ge}px !important`:"")+(Y!==1?`;zoom:${Y} !important`:""),Ge.appendChild(t.clone),Ct.appendChild(Ge);let Sr=new XMLSerializer().serializeToString(Ct),Ht=M||_,xr=Object.freeze({w0:w,h0:v,vbW:st,vbH:nt,targetW:C,targetH:S,contentX:D(pt+(n?x:0)),contentY:D(zt+(n?k:0)),clip:n?Object.freeze({x:D(x),y:D(k),width:w,height:v}):null});Object.defineProperty(a,"meta",{value:xr,enumerable:!0,writable:!1,configurable:!0});let vr=!Ht||X()?st:M?C:D(st*(S/nt)),wn=!Ht||X()?nt:_?S:D(nt*(C/st)),jt=parseFloat(O(m.documentElement)?.fontSize)||16,ei=Y!==1,lc=`${ei?``:""}`,fc=ei?"":"";u=lc+Ju(Sr,Ct)+fc,c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Bt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let Cr=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);return Cr&&Cr.style.position==="absolute"&&Cr.remove(),t.dataURL}function Ro(t){return Hs(t)}function td(t){let e=Array.isArray(t.plugins)?t.plugins:Ao(),n=[];for(let r of e){let i=ze(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function va(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ko(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=td(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,u,l="",f=null,d=e.needs||gt,h=n.format,m=n.type;await Bt("beforeSnap",n);let p=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||g){let R=String(p?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Bt("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?jn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Ni(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=xi(e.fast);for(;;){e.__slicer=v;let R=Jn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:u}=await ea(n.element,n.options)),c>0&&!e.reconcile&&(At(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),I.warnedReconcile||(I.warnedReconcile=!0,console.warn("[SnapDOM] Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!y&&r&&(f=zs(n.element,r)),!b&&r&&Ys(n.element,r,n.options),r&&(Qs(n.element,r,a),Ks(n.element,r))}finally{R()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=ko(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Bt("afterClone",n),!Be(d,"render"))return null;if(v?.due()&&await v.pause(),Vn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Js(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){At(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[SnapDOM] Couldn't close the gaps left by removed elements.",R)}try{await Ln(n.clone,n.element,n.nodeMap)}catch{}let C=R=>Promise.resolve().then(R),S=(async()=>{await Promise.all([C(()=>Gn(n.clone,n.options)),C(()=>Yn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{oa(n.element,n.clone,n.nodeMap)}catch(R){At(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[SnapDOM] Couldn't reproduce a backdrop-filter; captured without it.",R)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=f,await C(()=>ir(n.clone,n.options,n.nodeMap))),e.captureSelection)try{us(n.nodeMap)}catch(R){At(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),M=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(M=C(async()=>{let R=n.element.ownerDocument||document,T=w?P=>{try{let A=P.getBoundingClientRect();return A.right>=w.left-200&&A.left<=w.right+200&&A.bottom>=w.top-200&&A.top<=w.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:W}=!w&&e.__fontUsage||Wn(n.element,T);if(e.embedFonts==="auto"){let P=new Set;try{for(let N of R.fonts)P.add(String(N.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(P.size>0&&Array.from(L).some(N=>P.has(String(N).split("__")[0].toLowerCase()))))return}if(X()){let P=new Set(Array.from(L).map(A=>String(A).split("__")[0]).filter(Boolean));await Bn(P,1,R)}l=await Ms({required:L,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([S,M]);let E=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,v?.due()&&await v.pause();let x=n.clone;or(x,e.__compressedAssets);let k=await sr(n,{clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,fontsCSS:l});if(e.__compressedSnapshot=rr(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return k}yt();kt();var ed=new Set(["png","jpeg","jpg","webp","svg"]);function Ca(t={}){let e=typeof t.type=="string"&&ed.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=ni(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of o)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{console.warn(`[SnapDOM] Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&console.warn("[SnapDOM] Ignored an exclude entry: use a CSS selector or a function.",f);let c=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(l.exclude)?l.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(f))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:it(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ms(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}mt();oe();St();var ka="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function nd(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var rd=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function od(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(rd.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function id(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var Ma=new WeakMap;function sd(t){let e=Wt(),n=Ma.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a5e3&&ar.clear(),ar.set(t,e)}return e}function ud(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function dd(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var Fo={attempts:0,served:0,reconciled:0};async function Aa(t,e,n){Fo.attempts++;try{let r=await pd(t,e,n);return r&&Fo.served++,r}catch{return null}}async function pd(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||nd(t)||od(r)||r.fontsCSS||tr(n))return null;for(let f of n.plugins||[])if(f&&(typeof f.beforeSnap=="function"||typeof f.beforeClone=="function"||typeof f.resolveNode=="function"||typeof f.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=an(t);if(!o||sd(i))return null;let s=[];t:for(let f of e.dirtyRoots){if(!f.isConnected||f===t||!t.contains(f))return null;for(let d of e.dirtyRoots)if(d!==f&&d!==t&&d.contains(f))continue t;s.push(f)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let f of s){if(f.parentElement===t||f.matches?.(ka)||f.querySelector?.(ka)||id(f,o))return null;let d=r.srcToClone.get(f);if(!d||!d.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},p=Jn(f,null),g=Hn(f),y;try{y=await Jt(f,m,n)}finally{g(),p()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Ie(f,y,m,n),m.__pseudoCSS)||m.__usesPlaceholder&&!r.classPrefixCSS?.includes("[data-sd-ph]"))return null;await Fn(y,m),Vn(y);try{await Ln(y,f,h)}catch{}if(await Promise.all([Gn(y,n),Yn(f,y,r.styleCache,n,h)]),n.compress)try{await ir(y,n,h)}catch{}for(let[b,w]of h.entries())Co(b,w);d.replaceWith(y),dd(d,r);for(let[b,w]of h.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[f,d]of r.nodeMap.entries()){if(!d||d.nodeType!==1||!d.isConnected)continue;let h=r.styleMap.get(f);if(!h)continue;let m=fd(h);if(!m)continue;let p=null,g=!1;for(let y in m)if(p||=getComputedStyle(d),!cd(p.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(f))return null;Fo.reconciled++,await dt(d,f,a,n)}}let c=Ze(r.styleMap);for(let[f,d]of r.styleMap.entries())ud(f),vo(f,d,c);let u=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([f,d])=>`.${d}{${f}}`).join("");or(r.clone,n.__compressedAssets);let l=await sr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:u,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=rr(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}kt();var Po=new WeakMap,lr=new WeakMap,Oa=new WeakSet,To=new WeakMap,hd=64,hn=new Map,Da=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],md=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function gd(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":md.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function _a(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function Ea(t,e){if(e.disposed||(hn.delete(t),hn.set(t,e),hn.size<=hd))return;let[n,r]=hn.entries().next().value;Wa(n,r)}function Wa(t,e){e.disposed=!0,hn.delete(t),Po.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Da)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of No)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Ba(t){if(Oa.has(t))return!1;lr.delete(t);let e=[t],n=[],r=[];for(let i=0;i=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of No)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var No=["scroll","change","beforetoggle","toggle"];function fr(t,e){return[t,...e.trackedShadowRoots.keys()]}function Lo(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of fr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function Ra(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(ae(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var yd=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,je=t=>t&&(typeof t=="object"||typeof t=="function")?cr(t):"-";function bd(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function wd(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=bd(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function Fa(t){let e=String(t||"").trim();return e?yd.test(e)?!0:/^data:/i.test(e)?wd(e):!1:!1}function Ve(t){let e=String(t||"");if(Fa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Fa(n[1]??n[2]??n[3]))return!0;return!1}function Ta(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of Ua(i))if(Ve(o.getAttribute?.("src"))||Ve(o.getAttribute?.("href"))||Ve(o.getAttribute?.("style"))||Ve(t.styleMap?.get(o)))return!0;return!1}function Ua(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Io(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of fr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Oo(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of fr(t,e))for(let s of Ua(o))i(s);e.scrollNodes=n}function Pa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",gd(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(je))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(je))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(je(o)),(s?.contains(t)||t.contains(s))&&i.push(je(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let f=String(l.localName||"").toLowerCase();f==="input"?c.push(l.type,Qe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):f==="textarea"?c.push(l.value):f==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let u=[];for(let l of e.images){let f="";try{f=l.currentSrc||l.src||""}catch{}u.push(f,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:u,frameDriven:e.retainedFrameDriven}}function He(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o[je(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Sd(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function xd(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:_e(),styleEpoch:Wt(),styleStamp:sn(t),outsideMutations:on(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)ae(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of Da)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return $o(t,e)||Io(t,e),Oo(t,e),Lo(t,e),e}var vd=0,La=new WeakMap;function cr(t){let e=La.get(t);return e||(e="@"+ ++vd,La.set(t,e)),e}function Do(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(cr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(cr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Do(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(cr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Do(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function Ia(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Do(i,new Set);return o===null?null:`${(e||[]).map(je).join(",")}:${o}`}catch{return null}}function za(t,e,n,r,i=null){let o=Po.get(t);o||(o=xd(t),o.baselineSignature=Ia(e,n.plugins),Po.set(t,o));let s=Ia(e,n.plugins),a=async()=>{if(o.disposed)return r();let u=s===null||s!==o.baselineSignature;u&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,u=!1):o.pendingSig=s:o.pendingSig=null,$o(t,o),Lo(t,o);for(let M of o.observers)M.__flush(M.takeRecords());Tt();let l=on(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let f=t.getRootNode?.(),d=[...o.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),_n(t.ownerDocument||document,d);let h=sn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=Pa(t,o),p=$a(t,o);m.animation=Na(p),o.renderState&&(!He(o.renderState,m,"style")&&(Ee(),o.dirtyAll()),He(o.renderState,m,"scroll")||o.dirtyAll(),He(o.renderState,m,"controls")||(ce(t),o.dirtyAll()),!He(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=_e();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let M=_a(t);o.geometry!==null&&M!==o.geometry&&(ce(t),o.dirtyAll()),o.geometry=M}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!He(o.renderState,m,"animation");try{let M=new Set;w&&p.length===0&&(M=null);for(let _ of p){let E=_.playState==="running";if(!E&&!w)continue;E&&(b=!0),w=!0;let x=_.effect?.target;if(Sd(t,o,x)===t)M.add(x);else{M=null;break}}if(w&&M&&M.size&&o.retained){o.dirty=!0;for(let _ of M)o.dirtyRoots&&o.dirtyRoots.add(_),ce(_)}else w&&!M&&o.dirtyAll()}catch{}let v=m.frameDriven,C=b||v;if(C&&(o.last=null),v&&o.dirtyAll(),!u&&!C&&!o.dirty&&o.last)return Ea(t,o),o.last;o.capturing=!0;let S=null;try{let M=null,_=!1,E=null;if(!u&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){E=[...o.dirtyRoots];let x=await Aa(t,o,n);x&&(M=await i(x),_=!0)}if(M||(u||(n.__retain=x=>{let k=new Map;for(let[R,T]of x.nodeMap.entries())k.set(T,R);S={...x,srcToClone:k}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let k of x.takeRecords())o.pending.push(k);return Tt(),o.torn||Ra(o.pending)||on(t)!==l},M=await r()),!u&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=Ta(S),Io(t,o),Oo(t,o)):_&&(o.retainedFrameDriven||=Ta(o.retained,E),Io(t,o),Oo(t,o));let x=Pa(t,o);x.animation=Na($a(t,o));let k=["style","scroll","controls","images"];b||k.push("animation");let R=k.every(T=>He(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=sn(t),o.geometry=_a(t),o.renderState.frameDriven?(Oa.add(t),Wa(t,o)):R?!C&&!o.renderState.frameDriven&&(o.last=M,Ea(t,o)):(o.dirtyAll(),o.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let _ of o.observers)for(let E of _.takeRecords())o.pending.push(E);Tt();let M=on(t);(o.torn||Ra(o.pending)||M!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=M,o.styleEpoch=Wt(),o.styleStamp=sn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||($o(t,o),Lo(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var ur=null;function Va(t){ur=t}var Cd='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Wo=!1,mn=null,Bo=new WeakMap,Ha=!1;function qa(t,e){!Wo||!mn||e&&e.burst===!1||Bo.set(mn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ga(t){let e={control:t};mn=e,setTimeout(()=>{mn===e&&(mn=null)},0)}function zo(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Cd):null}function ja(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=zo(t);e&&(Ga(e),Uo(t,!1))}function kd(t){let e=zo(t);e&&Ga(e)}function Uo(t,e=!0){if(!ur||document.visibilityState==="hidden")return;let n=zo(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Bo.get(n);if(r){if(!r.element.isConnected){Bo.delete(n);return}ur(r.element,r.options).catch(()=>{});return}e&&!Ha&&(Ha=!0,ur(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Xa(){if(Wo||typeof document>"u"||typeof document.addEventListener!="function")return;Wo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",ja,t),document.addEventListener("keydown",ja,t),document.addEventListener("click",kd,t),document.addEventListener("pointerenter",Uo,t),document.addEventListener("focusin",Uo,t)}Mt();function Hd(...t){return Mo(...t),K}async function jd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await bt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await ti(i,{...e||{},burst:!1})}finally{n.remove()}}var Vd="3.3.0",K=Object.assign(ti,{plugins:Hd,fromString:jd,version:Vd,preCapture:Xa});Va(ti);var Zo=Symbol("snapdom.internal"),qd=Symbol("snapdom.internal.silent"),ac=new Set(["png","jpeg","jpg","webp","svg"]);async function ti(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Ca(e);n.element=t,n.invalidate&&Ee(),da(n,e&&e.plugins);let{stage:r,loweredBy:i}=ca(n);n.needs=r,n.__needsLoweredBy=i;let o=Be(r,"render"),s=n.burst===!0||!tr(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Ba(t);return u&&qa(t,e),n.snap||(n.snap={toPng:(l,f)=>K.toPng(l,f),toSvg:(l,f)=>K.toSvg(l,f)}),u?za(t,e,n,()=>K.capture(t,n,Zo),l=>cc(l,n)):K.capture(t,n,Zo)}K.capture=async(t,e,n)=>{if(n!==Zo)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Be(e.needs||gt,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Wn(t);e.clip||(e.__fontUsage=a);let c=a.required,u=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(u=new Set([...u].filter(l=>s.has(l.toLowerCase()))),u.size===0))throw null;await Bn(u,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(fn(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){H(e,"Couldn't prepare canvases for Safari.",s)}}let r=await va(t,e);return cc(r,e)};async function cc(t,e){let n=e.needs||gt,r=Be(n,"render"),i=A=>fa(n,e.__needsLoweredBy||[],A),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),c=o||t;o&&(t="");let u=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),p=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,g=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=A=>{if(o||!u?.size)return c;let N=d.vbW,$=d.vbH,F=A.crop;F&&(N=Math.max(1,Math.min(N,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let z=Number.isFinite(A.width),q=Number.isFinite(A.height);return(z&&q?Math.max(A.width/N,A.height/$):z?A.width/N*(F?Math.max(1,g/p):1):q?A.height/$*(F?Math.max(1,p/g):1):(A.scale||1)*Math.max(p,g))*(A.dpr||1)<=l?c:f??=ba(a(),u)},b=async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn));return $(c,{...A,...N||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let A=t.indexOf(",");return A>=0?decodeURIComponent(t.slice(A+1)):""},v=A=>Object.defineProperty({...A||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),C={img:async(A,N)=>{if(o)return b(A,N);let{toImg:$}=await Promise.resolve().then(()=>(Yo(),Xo)),F={...A,...N||{}};return $(y(F),F)},svg:async(A,N)=>{if(o)return b(A,N);let{toSvg:$}=await Promise.resolve().then(()=>(Yo(),Xo)),F={...A,...N||{}};return $(y(F),F)},canvas:async(A,N)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(me(),Za)),F={...A,...N||{}};return $(y(F),F)},blob:async(A,N)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Jo(),rc)),F={...A,...N||{}};return $(y(F),F)},png:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"png"};return $(y(F),F)},jpeg:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"jpeg"};return $(y(F),F)},webp:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"webp"};return $(y(F),F)},download:async(A,N)=>{let{download:$}=await Promise.resolve().then(()=>(sc(),ic)),F={...A,...N||{}};return $(y(F),F)}};if(!r)for(let A of Object.keys(C)){let N=A==="download"?"download()":`to${A.charAt(0).toUpperCase()}${A.slice(1)}()`;C[A]=async()=>{throw i(N)}}let S={};for(let A of["img","svg","canvas","blob","png","jpeg","webp"])S[A]=async N=>C[A](e,{...R(A,N||{}),[qd]:!0});S.jpg=S.jpeg;let M=A=>Object.defineProperty({...e,...A},"options",{value:e,configurable:!0}),_=M({artifacts:e.__artifacts||null,export:v(),exports:S}),E=await Zn("defineExports",_),x=Object.assign({},...E.filter(A=>A&&typeof A=="object").reverse()),k={...C,...x};k.jpeg&&!k.jpg&&(k.jpg=(A,N)=>k.jpeg(A,N));function R(A,N){let $=N||{},F={...e,...$},z=typeof $.type=="string"?$.type.toLowerCase():"",q=typeof $.format=="string"?$.format.toLowerCase():ac.has(z)?z:"";q&&(F.format=q==="jpg"?"jpeg":q),F.__explicitFormat=q?F.format:e.__explicitFormat??null,A==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let j=B=>B==="jpeg"||B==="jpg"||B==="webp";return[A,F.format,z].map(B=>typeof B=="string"?B.toLowerCase():"").find(j)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&H(F,"scale ignored: width/height already set the size."),F}let T=!1,L=Promise.resolve();async function W(A,N){let $=Object.freeze(N&&typeof N=="object"?{...N}:{}),F=async()=>{let q=k[A];if(!q)throw new Error(`[SnapDOM] Unknown export type: ${A}`);let j=R(A,$),J=M({artifacts:e.__artifacts||null,export:v({type:A,options:j,requestedOptions:$})}),B=j.format,ut=j.type;await Zn("beforeExport",J,{format:A,options:j});let vt=j.format!==B?j.format:j.type!==ut?j.type:"",at=typeof vt=="string"?vt.toLowerCase():"";ac.has(at)&&(j.format=at==="jpg"?"jpeg":at,j.type=j.format,j.__explicitFormat=j.format,/^(?:jpeg|webp)$/.test(j.format)&&(j.backgroundColor==null||j.backgroundColor==="transparent")&&(j.backgroundColor="#ffffff"));let st=await q(J,j);return await Zn("afterExport",J,{format:A,options:j,result:st}),T||(T=!0,await Bt("afterSnap",e)),st},z=L.then(F);return L=z.catch(()=>{}),z}let P={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(A,N)=>W(A,N),toImg:A=>W("img",A),toSvg:A=>W("svg",A),toCanvas:A=>W("canvas",A),toBlob:A=>W("blob",A),toPng:A=>W("png",A),toJpg:A=>W("jpg",A),toWebp:A=>W("webp",A),download:A=>W("download",A)};r?o&&Object.defineProperty(P,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(P,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(P,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let A of Object.keys(k)){let N="to"+A.charAt(0).toUpperCase()+A.slice(1);P[N]||(P[N]=$=>W(A,$))}return P}K.toRaw=(t,e)=>K(t,e).then(n=>n.toRaw());K.toImg=(t,e)=>K(t,e).then(n=>n.toImg());K.toSvg=(t,e)=>K(t,e).then(n=>n.toSvg());K.toCanvas=(t,e)=>K(t,e).then(n=>n.toCanvas());K.toBlob=(t,e)=>K(t,e).then(n=>n.toBlob());K.toPng=(t,e)=>K(t,{...e,format:"png"}).then(n=>n.toPng());K.toJpg=(t,e)=>K(t,{...e,format:"jpeg"}).then(n=>n.toJpg());K.toWebp=(t,e)=>K(t,{...e,format:"webp"}).then(n=>n.toWebp());K.download=(t,e)=>K(t,e).then(n=>n.download());export{gt as DEFAULT_STAGE,We as STAGES,la as assertNeeds,Eu as clearPlugins,Ao as getGlobalPlugins,ze as normalizePlugin,Mo as registerPlugins,K as snapdom}; +}`,Bu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Lt=null,Uu=0,zu=0,ue=new Map;function xa(){for(let t of ue.values())t(void 0);if(ue.clear(),Array.isArray(Lt))for(let t of Lt)try{t?.terminate()}catch{}Lt=!1}function Hu(){let t,e=null;try{t=URL.createObjectURL(new Blob([Wu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ue.get(n.data.id);r&&(ue.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=xa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function ju(){if(Lt===!1)return!1;if(Lt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Lt=!1;Lt=[]}let t=Uu++%Bu;if(!Lt[t]){let e=Hu();if(!e)return xa(),!1;Lt[t]=e}return Lt[t]}var Vu=5e3;function qu(t,e,n,r,i){let o=ju();return o?new Promise(s=>{let a=++zu,c=setTimeout(()=>{ue.delete(a),s(void 0)},Vu);ue.set(a,u=>{clearTimeout(c),s(u)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:Sa,quality:wa,mime:r})}catch{clearTimeout(c),ue.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function Eo(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=I.compress,s=o.get(i);if(s?.source===t)return s.result;let a=er.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Nu(t),f=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",d=Du(t);if(d&&d.w>0&&d.h>0&&!ma(d.w,d.h,e,n))return null;if(t.length>=Lu){let S=await qu(t,e,n,f,r);if(S!==void 0)return S}let h;try{h=await $u(t)}catch{return null}let m=h.naturalWidth||h.width,p=h.naturalHeight||h.height;if(!m||!p)return null;let g=ma(m,p,e,n);if(!g)return null;let y=g*Sa,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(p*y)),v=document.createElement("canvas");v.width=b,v.height=w;let C=v.getContext("2d");if(!C)return null;C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high",C.drawImage(h,0,0,b,w);try{let S=v.toDataURL(f,wa);if(typeof S=="string"&&S.startsWith("data:image")&&S.length{let f=l.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!d||!h)return;let m=r.value||=_o(t,e),p=m.density*m.stretch(n.get(l)||l),g=await Eo(f,d*p,h*p,l.__snapdomBlob);g&&(o++,s+=f.length,a+=g.length,l.setAttribute("src",g),nr(l,"attribute","src",f,g,e))},u=6;for(let l=0;l{let l=n.get(u);if(!l||!l.isConnected)return;let f;try{f=getComputedStyle(l)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(_=>_.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(_=>!Xu.test(_.trim())))return;let{w:m,h:p}=Yu(l);if(!m||!p)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(_=>parseFloat(_)/100)),y=r.value||=_o(t,e),b=y.density*y.stretch(l)*g,w=m*b,v=p*b,C=u.style.backgroundImage,S=[...C.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=C;for(let _ of S){let E=_[2];if(E.startsWith("data:image/svg"))continue;let x=await Eo(E,w,v);x&&(M=M.split(E).join(x),s++)}M!==C&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),nr(u,"style","background-image",C,u.style.backgroundImage,e))},c=6;for(let u=0;u{let u=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",f=c.getAttribute("height")||"";if(l.includes("%")||f.includes("%"))return;let d=n.get(c),h=d?O(d):c.style,m=(v,C)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[v]||""))return parseFloat(h[v]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(C.trim()))return parseFloat(C);try{return d?.[v]?.baseVal?.value||0}catch{return 0}},p=m("width",l),g=m("height",f);if(!p||!g)return;let y=r.value||=_o(t,e),b=y.density*y.stretch(d||c),w=await Eo(u,p*b,g*b);w&&(c.setAttribute("href",w),nr(c,"attribute","href",u,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(ga,"xlink:href",w),nr(c,"attribute","xlink:href",u,w,e)),o++)},a=6;for(let c=0;c");if(n===-1)return t;let r=/]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,u;for(let y of i)if(y.intern)for(c.lastIndex=0;u=c.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let f=Zu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],p=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,p):y.text;return t.slice(0,n)+m.join("")+g}function Zu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let u=c.getAttribute("style");u&&r.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=u=>{for(let l of u){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let l=u.textContent||"";if(/@import\b/i.test(l))return null;let f=new CSSStyleSheet;f.replaceSync(l),c(f.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&o.add(u[1])}return o}async function sr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Q,...et}=t;t=Object.assign(a,et),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,u;ta(t,s),await Bt("beforeRender",t);let l=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,D(t.element.offsetWidth||parseFloat(l.width)||f.width||1)),h=Math.max(1,D(t.element.offsetHeight||parseFloat(l.height)||f.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let Q=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),et=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0);Q>0&&(h=Math.max(h,D(Q))),et>0&&(d=Math.max(d,D(et)));try{let tt=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,rt=I.measureHints.get(t.element);if(rt&&rt.cssLen===tt&&rt.w0===d&&rt.docH===Q&&rt.docW===et)rt.csh>0&&(h=Math.max(h,D(rt.csh))),rt.csw>0&&(d=Math.max(d,D(rt.csw)));else{let ot=m.createElement("div");Z(ot),ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+d+"px!important;overflow:visible!important;visibility:hidden!important;";let ee=ot.attachShadow({mode:"open"}),ne=m.createElement("style");ne.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,ee.appendChild(ne),ee.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(ot);let Ye=ot.scrollHeight,Vt=ot.scrollWidth;m.body.removeChild(ot),I.measureHints.set(t.element,{cssLen:tt,w0:d,docH:Q,docW:et,csh:Ye,csw:Vt}),Ye>0&&(h=Math.max(h,D(Ye))),Vt>0&&(d=Math.max(d,D(Vt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Q=xo(t.element,t.options),et=1,tt=xo(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(tt)&&tt>=h-rt&&Number.isFinite(Q)&&Q>0&&(h=Math.max(1,Math.min(h,D(Q+et))))}if(t.options?.reconcile)try{let Q=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Zs(t.element,t.clone,Q,t.nodeMap,d,h)}catch(Q){console.warn("[SnapDOM] reconcile couldn't run; captured without it.",Q)}let g=(Q,et=NaN)=>{let tt=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(tt)?tt:et},y=g(t.options.width),b=g(t.options.height),w=n?D(n.width):d,v=n?D(n.height):h,C=w,S=v,M=Number.isFinite(y),_=Number.isFinite(b),E=v>0?w/v:1;M&&_?(C=Math.max(1,D(y)),S=Math.max(1,D(b))):M?(C=Math.max(1,D(y)),S=Math.max(1,D(C/(E||1)))):_&&(S=Math.max(1,D(b)),C=Math.max(1,D(S*(E||1))));let x=0,k=0,R=d,T=h;if(n){let Q=0,et=0;if(Ro(t.element)){let tt=null;if(!r&&o&&Number.isFinite(o.a))tt={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let rt=fe(t.element),ot=So(l.transform&&l.transform!=="none"?l.transform:"",rt);ot&&ot.is2D&&(tt={a:ot.a,b:ot.b,c:ot.c,d:ot.d,e:0,f:0})}if(tt&&!(tt.a===1&&tt.b===0&&tt.c===0&&tt.d===1)){let{ox:rt,oy:ot}=dn(l,d,h),ee=Oe(d,h,tt,rt,ot);Q=ee.minX,et=ee.minY}}x=D(n.x+Q),k=D(n.y+et),R=D(x+n.width),T=D(k+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},et=Oe(d,h,Q,0,0);x=D(et.minX),k=D(et.minY),R=D(et.maxX),T=D(et.maxY)}else if(r&&Ro(t.element)){let et=l.transform&&l.transform!=="none"?l.transform:"",tt=fe(t.element),rt=Zt({baseTransform:et,rotate:tt.rotate||"0deg",scale:tt.scale,translate:tt.translate,width:d,height:h}),{ox:ot,oy:ee}=dn(l,d,h),ne=rt.is2D?rt:new DOMMatrix(rt.toString()),Ye={a:ne.a,b:ne.b,c:ne.c,d:ne.d,e:0,f:0},Vt=Oe(d,h,Ye,ot,ee);x=D(Vt.minX),k=D(Vt.minY),R=D(Vt.maxX),T=D(Vt.maxY)}let L=po(l),W=ho(l),P=mo(l),A=go(l),N=yo(l),$=f.width>0?(R-x)/f.width:1,F=f.height>0?(T-k)/f.height:1,z=i==="subtree"&&!n?Us(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},q=n?{top:0,right:0,bottom:0,left:0}:i?{top:D(Math.max(L.top,W.top,z.top)+P.top+A.top+N.bleed.top),right:D(Math.max(L.right,W.right,z.right)+P.right+A.right+N.bleed.right),bottom:D(Math.max(L.bottom,W.bottom,z.bottom)+P.bottom+A.bottom+N.bleed.bottom),left:D(Math.max(L.left,W.left,z.left)+P.left+A.left+N.bleed.left)}:{top:P.top,right:P.right,bottom:P.bottom,left:P.left};x=D(x-q.left),k=D(k-q.top),R=D(R+q.right),T=D(T+q.bottom);let j=Math.max(1,D(R-x)),J=Math.max(1,D(T-k)),B="http://www.w3.org/2000/svg",ut=Ro(t.element)?2:0,at=D(ut+(r?0:1)),st=Math.ceil(j+at*2),nt=Math.ceil(J+at*2),pt=D(-(D(x)-at)),zt=D(-(D(k)-at)),ge=Math.max(0,pt),V=Math.max(0,zt),G=D(st-Math.min(0,pt)),U=D(nt-Math.min(0,zt)),ht=m.defaultView||window,Y=!X()&&CSS.supports("zoom","2")&&ht.devicePixelRatio||1;a.__layoutZoom=Y;let Ct=document.createElementNS(B,"foreignObject");Ct.setAttribute("x",String(Math.min(0,pt)*Y)),Ct.setAttribute("y",String(Math.min(0,zt)*Y)),Ct.setAttribute("width",String(G*Y)),Ct.setAttribute("height",String(U*Y)),Ct.style.overflow="visible";let ye=document.createElement("style"),bn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ye.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+bn+t.classCSS,Ct.appendChild(ye);let Ge=document.createElement("div");Ge.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ge.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${U}px`+(ge!==0||V!==0?`;padding:${V}px 0 0 ${ge}px !important`:"")+(Y!==1?`;zoom:${Y} !important`:""),Ge.appendChild(t.clone),Ct.appendChild(Ge);let Sr=new XMLSerializer().serializeToString(Ct),Ht=M||_,xr=Object.freeze({w0:w,h0:v,vbW:st,vbH:nt,targetW:C,targetH:S,contentX:D(pt+(n?x:0)),contentY:D(zt+(n?k:0)),clip:n?Object.freeze({x:D(x),y:D(k),width:w,height:v}):null});Object.defineProperty(a,"meta",{value:xr,enumerable:!0,writable:!1,configurable:!0});let vr=!Ht||X()?st:M?C:D(st*(S/nt)),wn=!Ht||X()?nt:_?S:D(nt*(C/st)),jt=parseFloat(O(m.documentElement)?.fontSize)||16,ei=Y!==1,lc=`${ei?``:""}`,fc=ei?"":"";u=lc+Ju(Sr,Ct)+fc,c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Bt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let Cr=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);return Cr&&Cr.style.position==="absolute"&&Cr.remove(),t.dataURL}function Ro(t){return Hs(t)}function td(t){let e=Array.isArray(t.plugins)?t.plugins:Ao(),n=[];for(let r of e){let i=ze(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function va(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ko(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=td(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,u,l="",f=null,d=e.needs||gt,h=n.format,m=n.type;await Bt("beforeSnap",n);let p=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||g){let R=String(p?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Bt("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?jn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Ni(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=xi(e.fast);for(;;){e.__slicer=v;let R=Jn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:u}=await ea(n.element,n.options)),c>0&&!e.reconcile&&(At(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),I.warnedReconcile||(I.warnedReconcile=!0,console.warn("[SnapDOM] Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!y&&r&&(f=zs(n.element,r)),!b&&r&&Ys(n.element,r,n.options),r&&(Qs(n.element,r,a),Ks(n.element,r))}finally{R()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=ko(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Bt("afterClone",n),!Be(d,"render"))return null;if(v?.due()&&await v.pause(),Vn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Js(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){At(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[SnapDOM] Couldn't close the gaps left by removed elements.",R)}try{await Ln(n.clone,n.element,n.nodeMap)}catch{}let C=R=>Promise.resolve().then(R),S=(async()=>{await Promise.all([C(()=>Gn(n.clone,n.options)),C(()=>Yn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{oa(n.element,n.clone,n.nodeMap)}catch(R){At(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[SnapDOM] Couldn't reproduce a backdrop-filter; captured without it.",R)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=f,await C(()=>ir(n.clone,n.options,n.nodeMap))),e.captureSelection)try{us(n.nodeMap)}catch(R){At(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),M=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(M=C(async()=>{let R=n.element.ownerDocument||document,T=w?P=>{try{let A=P.getBoundingClientRect();return A.right>=w.left-200&&A.left<=w.right+200&&A.bottom>=w.top-200&&A.top<=w.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:W}=!w&&e.__fontUsage||Wn(n.element,T);if(e.embedFonts==="auto"){let P=new Set;try{for(let N of R.fonts)P.add(String(N.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(P.size>0&&Array.from(L).some(N=>P.has(String(N).split("__")[0].toLowerCase()))))return}if(X()){let P=new Set(Array.from(L).map(A=>String(A).split("__")[0]).filter(Boolean));await Bn(P,1,R)}l=await Ms({required:L,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([S,M]);let E=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,v?.due()&&await v.pause();let x=n.clone;or(x,e.__compressedAssets);let k=await sr(n,{clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,fontsCSS:l});if(e.__compressedSnapshot=rr(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return k}yt();kt();var ed=new Set(["png","jpeg","jpg","webp","svg"]);function Ca(t={}){let e=typeof t.type=="string"&&ed.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=ni(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of o)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{console.warn(`[SnapDOM] Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&console.warn("[SnapDOM] Ignored an exclude entry: use a CSS selector or a function.",f);let c=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(l.exclude)?l.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(f))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:it(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ms(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}mt();oe();St();var ka="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function nd(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var rd=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function od(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(rd.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function id(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var Ma=new WeakMap;function sd(t){let e=Wt(),n=Ma.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a5e3&&ar.clear(),ar.set(t,e)}return e}function ud(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function dd(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var Fo={attempts:0,served:0,reconciled:0};async function Aa(t,e,n){Fo.attempts++;try{let r=await pd(t,e,n);return r&&Fo.served++,r}catch{return null}}async function pd(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||nd(t)||od(r)||r.fontsCSS||tr(n))return null;for(let f of n.plugins||[])if(f&&(typeof f.beforeSnap=="function"||typeof f.beforeClone=="function"||typeof f.resolveNode=="function"||typeof f.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=an(t);if(!o||sd(i))return null;let s=[];t:for(let f of e.dirtyRoots){if(!f.isConnected||f===t||!t.contains(f))return null;for(let d of e.dirtyRoots)if(d!==f&&d!==t&&d.contains(f))continue t;s.push(f)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let f of s){if(f.parentElement===t||f.matches?.(ka)||f.querySelector?.(ka)||id(f,o))return null;let d=r.srcToClone.get(f);if(!d||!d.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},p=Jn(f,null),g=Hn(f),y;try{y=await Jt(f,m,n)}finally{g(),p()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Ie(f,y,m,n),m.__pseudoCSS)||m.__usesPlaceholder&&!r.classPrefixCSS?.includes("[data-sd-ph]"))return null;await Fn(y,m),Vn(y);try{await Ln(y,f,h)}catch{}if(await Promise.all([Gn(y,n),Yn(f,y,r.styleCache,n,h)]),n.compress)try{await ir(y,n,h)}catch{}for(let[b,w]of h.entries())Co(b,w,h,r.styleCache);d.replaceWith(y),dd(d,r);for(let[b,w]of h.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[f,d]of r.nodeMap.entries()){if(!d||d.nodeType!==1||!d.isConnected)continue;let h=r.styleMap.get(f);if(!h)continue;let m=fd(h);if(!m)continue;let p=null,g=!1;for(let y in m)if(p||=getComputedStyle(d),!cd(p.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(f))return null;Fo.reconciled++,await dt(d,f,a,n)}}let c=Ze(r.styleMap);for(let[f,d]of r.styleMap.entries())ud(f),vo(f,d,c);let u=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([f,d])=>`.${d}{${f}}`).join("");or(r.clone,n.__compressedAssets);let l=await sr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:u,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=rr(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}kt();var Po=new WeakMap,lr=new WeakMap,Oa=new WeakSet,To=new WeakMap,hd=64,hn=new Map,Da=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],md=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function gd(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":md.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function _a(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function Ea(t,e){if(e.disposed||(hn.delete(t),hn.set(t,e),hn.size<=hd))return;let[n,r]=hn.entries().next().value;Wa(n,r)}function Wa(t,e){e.disposed=!0,hn.delete(t),Po.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Da)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of No)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Ba(t){if(Oa.has(t))return!1;lr.delete(t);let e=[t],n=[],r=[];for(let i=0;i=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of No)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var No=["scroll","change","beforetoggle","toggle"];function fr(t,e){return[t,...e.trackedShadowRoots.keys()]}function Lo(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of fr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function Ra(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(ae(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var yd=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,je=t=>t&&(typeof t=="object"||typeof t=="function")?cr(t):"-";function bd(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function wd(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=bd(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function Fa(t){let e=String(t||"").trim();return e?yd.test(e)?!0:/^data:/i.test(e)?wd(e):!1:!1}function Ve(t){let e=String(t||"");if(Fa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Fa(n[1]??n[2]??n[3]))return!0;return!1}function Ta(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of Ua(i))if(Ve(o.getAttribute?.("src"))||Ve(o.getAttribute?.("href"))||Ve(o.getAttribute?.("style"))||Ve(t.styleMap?.get(o)))return!0;return!1}function Ua(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Io(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of fr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Oo(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of fr(t,e))for(let s of Ua(o))i(s);e.scrollNodes=n}function Pa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",gd(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(je))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(je))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(je(o)),(s?.contains(t)||t.contains(s))&&i.push(je(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let f=String(l.localName||"").toLowerCase();f==="input"?c.push(l.type,Qe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):f==="textarea"?c.push(l.value):f==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let u=[];for(let l of e.images){let f="";try{f=l.currentSrc||l.src||""}catch{}u.push(f,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:u,frameDriven:e.retainedFrameDriven}}function He(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o[je(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Sd(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function xd(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:_e(),styleEpoch:Wt(),styleStamp:sn(t),outsideMutations:on(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)ae(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of Da)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return $o(t,e)||Io(t,e),Oo(t,e),Lo(t,e),e}var vd=0,La=new WeakMap;function cr(t){let e=La.get(t);return e||(e="@"+ ++vd,La.set(t,e)),e}function Do(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(cr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(cr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Do(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(cr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Do(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function Ia(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Do(i,new Set);return o===null?null:`${(e||[]).map(je).join(",")}:${o}`}catch{return null}}function za(t,e,n,r,i=null){let o=Po.get(t);o||(o=xd(t),o.baselineSignature=Ia(e,n.plugins),Po.set(t,o));let s=Ia(e,n.plugins),a=async()=>{if(o.disposed)return r();let u=s===null||s!==o.baselineSignature;u&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,u=!1):o.pendingSig=s:o.pendingSig=null,$o(t,o),Lo(t,o);for(let M of o.observers)M.__flush(M.takeRecords());Tt();let l=on(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let f=t.getRootNode?.(),d=[...o.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),_n(t.ownerDocument||document,d);let h=sn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=Pa(t,o),p=$a(t,o);m.animation=Na(p),o.renderState&&(!He(o.renderState,m,"style")&&(Ee(),o.dirtyAll()),He(o.renderState,m,"scroll")||o.dirtyAll(),He(o.renderState,m,"controls")||(ce(t),o.dirtyAll()),!He(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=_e();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let M=_a(t);o.geometry!==null&&M!==o.geometry&&(ce(t),o.dirtyAll()),o.geometry=M}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!He(o.renderState,m,"animation");try{let M=new Set;w&&p.length===0&&(M=null);for(let _ of p){let E=_.playState==="running";if(!E&&!w)continue;E&&(b=!0),w=!0;let x=_.effect?.target;if(Sd(t,o,x)===t)M.add(x);else{M=null;break}}if(w&&M&&M.size&&o.retained){o.dirty=!0;for(let _ of M)o.dirtyRoots&&o.dirtyRoots.add(_),ce(_)}else w&&!M&&o.dirtyAll()}catch{}let v=m.frameDriven,C=b||v;if(C&&(o.last=null),v&&o.dirtyAll(),!u&&!C&&!o.dirty&&o.last)return Ea(t,o),o.last;o.capturing=!0;let S=null;try{let M=null,_=!1,E=null;if(!u&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){E=[...o.dirtyRoots];let x=await Aa(t,o,n);x&&(M=await i(x),_=!0)}if(M||(u||(n.__retain=x=>{let k=new Map;for(let[R,T]of x.nodeMap.entries())k.set(T,R);S={...x,srcToClone:k}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let k of x.takeRecords())o.pending.push(k);return Tt(),o.torn||Ra(o.pending)||on(t)!==l},M=await r()),!u&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=Ta(S),Io(t,o),Oo(t,o)):_&&(o.retainedFrameDriven||=Ta(o.retained,E),Io(t,o),Oo(t,o));let x=Pa(t,o);x.animation=Na($a(t,o));let k=["style","scroll","controls","images"];b||k.push("animation");let R=k.every(T=>He(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=sn(t),o.geometry=_a(t),o.renderState.frameDriven?(Oa.add(t),Wa(t,o)):R?!C&&!o.renderState.frameDriven&&(o.last=M,Ea(t,o)):(o.dirtyAll(),o.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let _ of o.observers)for(let E of _.takeRecords())o.pending.push(E);Tt();let M=on(t);(o.torn||Ra(o.pending)||M!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=M,o.styleEpoch=Wt(),o.styleStamp=sn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||($o(t,o),Lo(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var ur=null;function Va(t){ur=t}var Cd='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Wo=!1,mn=null,Bo=new WeakMap,Ha=!1;function qa(t,e){!Wo||!mn||e&&e.burst===!1||Bo.set(mn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ga(t){let e={control:t};mn=e,setTimeout(()=>{mn===e&&(mn=null)},0)}function zo(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Cd):null}function ja(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=zo(t);e&&(Ga(e),Uo(t,!1))}function kd(t){let e=zo(t);e&&Ga(e)}function Uo(t,e=!0){if(!ur||document.visibilityState==="hidden")return;let n=zo(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Bo.get(n);if(r){if(!r.element.isConnected){Bo.delete(n);return}ur(r.element,r.options).catch(()=>{});return}e&&!Ha&&(Ha=!0,ur(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Xa(){if(Wo||typeof document>"u"||typeof document.addEventListener!="function")return;Wo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",ja,t),document.addEventListener("keydown",ja,t),document.addEventListener("click",kd,t),document.addEventListener("pointerenter",Uo,t),document.addEventListener("focusin",Uo,t)}Mt();function Hd(...t){return Mo(...t),K}async function jd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await bt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await ti(i,{...e||{},burst:!1})}finally{n.remove()}}var Vd="3.3.3",K=Object.assign(ti,{plugins:Hd,fromString:jd,version:Vd,preCapture:Xa});Va(ti);var Zo=Symbol("snapdom.internal"),qd=Symbol("snapdom.internal.silent"),ac=new Set(["png","jpeg","jpg","webp","svg"]);async function ti(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Ca(e);n.element=t,n.invalidate&&Ee(),da(n,e&&e.plugins);let{stage:r,loweredBy:i}=ca(n);n.needs=r,n.__needsLoweredBy=i;let o=Be(r,"render"),s=n.burst===!0||!tr(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Ba(t);return u&&qa(t,e),n.snap||(n.snap={toPng:(l,f)=>K.toPng(l,f),toSvg:(l,f)=>K.toSvg(l,f)}),u?za(t,e,n,()=>K.capture(t,n,Zo),l=>cc(l,n)):K.capture(t,n,Zo)}K.capture=async(t,e,n)=>{if(n!==Zo)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Be(e.needs||gt,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Wn(t);e.clip||(e.__fontUsage=a);let c=a.required,u=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(u=new Set([...u].filter(l=>s.has(l.toLowerCase()))),u.size===0))throw null;await Bn(u,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(fn(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){H(e,"Couldn't prepare canvases for Safari.",s)}}let r=await va(t,e);return cc(r,e)};async function cc(t,e){let n=e.needs||gt,r=Be(n,"render"),i=A=>fa(n,e.__needsLoweredBy||[],A),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),c=o||t;o&&(t="");let u=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),p=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,g=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=A=>{if(o||!u?.size)return c;let N=d.vbW,$=d.vbH,F=A.crop;F&&(N=Math.max(1,Math.min(N,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let z=Number.isFinite(A.width),q=Number.isFinite(A.height);return(z&&q?Math.max(A.width/N,A.height/$):z?A.width/N*(F?Math.max(1,g/p):1):q?A.height/$*(F?Math.max(1,p/g):1):(A.scale||1)*Math.max(p,g))*(A.dpr||1)<=l?c:f??=ba(a(),u)},b=async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn));return $(c,{...A,...N||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let A=t.indexOf(",");return A>=0?decodeURIComponent(t.slice(A+1)):""},v=A=>Object.defineProperty({...A||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),C={img:async(A,N)=>{if(o)return b(A,N);let{toImg:$}=await Promise.resolve().then(()=>(Yo(),Xo)),F={...A,...N||{}};return $(y(F),F)},svg:async(A,N)=>{if(o)return b(A,N);let{toSvg:$}=await Promise.resolve().then(()=>(Yo(),Xo)),F={...A,...N||{}};return $(y(F),F)},canvas:async(A,N)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(me(),Za)),F={...A,...N||{}};return $(y(F),F)},blob:async(A,N)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Jo(),rc)),F={...A,...N||{}};return $(y(F),F)},png:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"png"};return $(y(F),F)},jpeg:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"jpeg"};return $(y(F),F)},webp:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"webp"};return $(y(F),F)},download:async(A,N)=>{let{download:$}=await Promise.resolve().then(()=>(sc(),ic)),F={...A,...N||{}};return $(y(F),F)}};if(!r)for(let A of Object.keys(C)){let N=A==="download"?"download()":`to${A.charAt(0).toUpperCase()}${A.slice(1)}()`;C[A]=async()=>{throw i(N)}}let S={};for(let A of["img","svg","canvas","blob","png","jpeg","webp"])S[A]=async N=>C[A](e,{...R(A,N||{}),[qd]:!0});S.jpg=S.jpeg;let M=A=>Object.defineProperty({...e,...A},"options",{value:e,configurable:!0}),_=M({artifacts:e.__artifacts||null,export:v(),exports:S}),E=await Zn("defineExports",_),x=Object.assign({},...E.filter(A=>A&&typeof A=="object").reverse()),k={...C,...x};k.jpeg&&!k.jpg&&(k.jpg=(A,N)=>k.jpeg(A,N));function R(A,N){let $=N||{},F={...e,...$},z=typeof $.type=="string"?$.type.toLowerCase():"",q=typeof $.format=="string"?$.format.toLowerCase():ac.has(z)?z:"";q&&(F.format=q==="jpg"?"jpeg":q),F.__explicitFormat=q?F.format:e.__explicitFormat??null,A==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let j=B=>B==="jpeg"||B==="jpg"||B==="webp";return[A,F.format,z].map(B=>typeof B=="string"?B.toLowerCase():"").find(j)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&H(F,"scale ignored: width/height already set the size."),F}let T=!1,L=Promise.resolve();async function W(A,N){let $=Object.freeze(N&&typeof N=="object"?{...N}:{}),F=async()=>{let q=k[A];if(!q)throw new Error(`[SnapDOM] Unknown export type: ${A}`);let j=R(A,$),J=M({artifacts:e.__artifacts||null,export:v({type:A,options:j,requestedOptions:$})}),B=j.format,ut=j.type;await Zn("beforeExport",J,{format:A,options:j});let vt=j.format!==B?j.format:j.type!==ut?j.type:"",at=typeof vt=="string"?vt.toLowerCase():"";ac.has(at)&&(j.format=at==="jpg"?"jpeg":at,j.type=j.format,j.__explicitFormat=j.format,/^(?:jpeg|webp)$/.test(j.format)&&(j.backgroundColor==null||j.backgroundColor==="transparent")&&(j.backgroundColor="#ffffff"));let st=await q(J,j);return await Zn("afterExport",J,{format:A,options:j,result:st}),T||(T=!0,await Bt("afterSnap",e)),st},z=L.then(F);return L=z.catch(()=>{}),z}let P={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(A,N)=>W(A,N),toImg:A=>W("img",A),toSvg:A=>W("svg",A),toCanvas:A=>W("canvas",A),toBlob:A=>W("blob",A),toPng:A=>W("png",A),toJpg:A=>W("jpg",A),toWebp:A=>W("webp",A),download:A=>W("download",A)};r?o&&Object.defineProperty(P,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(P,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(P,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let A of Object.keys(k)){let N="to"+A.charAt(0).toUpperCase()+A.slice(1);P[N]||(P[N]=$=>W(A,$))}return P}K.toRaw=(t,e)=>K(t,e).then(n=>n.toRaw());K.toImg=(t,e)=>K(t,e).then(n=>n.toImg());K.toSvg=(t,e)=>K(t,e).then(n=>n.toSvg());K.toCanvas=(t,e)=>K(t,e).then(n=>n.toCanvas());K.toBlob=(t,e)=>K(t,e).then(n=>n.toBlob());K.toPng=(t,e)=>K(t,{...e,format:"png"}).then(n=>n.toPng());K.toJpg=(t,e)=>K(t,{...e,format:"jpeg"}).then(n=>n.toJpg());K.toWebp=(t,e)=>K(t,{...e,format:"webp"}).then(n=>n.toWebp());K.download=(t,e)=>K(t,e).then(n=>n.download());export{gt as DEFAULT_STAGE,We as STAGES,la as assertNeeds,Eu as clearPlugins,Ao as getGlobalPlugins,ze as normalizePlugin,Mo as registerPlugins,K as snapdom}; From f95b97dbc491d7bf3f60280f40ef57c7ce12b1b6 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 10 Oct 2026 10:45:23 +0800 Subject: [PATCH 2/2] chore: bump version 10.0.12 --- .../BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj index ef66fe16..7a4d2310 100644 --- a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj +++ b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj @@ -1,7 +1,7 @@  - 10.0.11 + 10.0.12