diff --git a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj index 6a7c5ff9..633c5678 100644 --- a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj +++ b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj @@ -1,7 +1,7 @@ - 11.0.0-rc.3.2 + 11.0.0-rc.3.3 diff --git a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs index d4adcf62..a3edb3ab 100644 --- a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs +++ b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs @@ -1,19 +1,19 @@ /* * SnapDOM -* v3.6.0 +* v3.7.0 * License: MIT */ -var Pc=Object.defineProperty;var ot=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var oe=(t,e)=>{for(var n in e)Pc(t,n,{get:e[n],enumerable:!0})};function Li(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Ii(t="soft"){t==="disabled"&&(j.computedStyle=new WeakMap,j.measureHints=new WeakMap,j.baseStyle=new gt(50),j.defaultStyle=new gt(64),j.image=new gt(100),j.background=new gt(100),j.resource=new gt(150),j.compress=new gt(50))}var gt,j,Mt=ot(()=>{"use strict";gt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},j={image:new gt(100),background:new gt(100),resource:new gt(150),defaultStyle:new gt(64),baseStyle:new gt(50),compress:new gt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function me(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Lc(t){let e=[],n=0,o=0,i="";for(let r=0;rr.dppx-s.dppx),(o.find(r=>r.dppx>=e)||o[o.length-1]).url):null}function er(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let i=o.split(",").map(r=>r.trim());return i.length!==6?`matrix(${o})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let i=o.split(",").map(r=>r.trim());return i.length!==16?`matrix3d(${o})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function re(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function nr(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 dn(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function or(t){return"\u2022".repeat(String(t??"").length)}function ct(t,e){return t?.nodeType===1&&t.localName===e}function Tt(t){return t?.nodeType===1&&t.namespaceURI===Ic}function Ot(t){return t?.nodeType===1&&t.namespaceURI===Wc}function Kt(t){return t?.nodeType===11&&!!t.host}function Dt(t){let e=t?.parentNode;return e?.nodeType===11?e.host:null}function rr(t){return t?.nodeType===9}var tr,Nc,Ic,Wc,$t=ot(()=>{"use strict";tr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Nc=tr;Ic="http://www.w3.org/1999/xhtml",Wc="http://www.w3.org/2000/svg"});function Oc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,i=0;function r(s,a,l){if(i>=n)return;let u=Date.now();(o.get(a)||0)>u||(o.set(a,u+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(s,a){r("warn",s,a)},errorOnce(s,a){r("error",s,a)},reset(){o.clear(),i=0}}}function Di(t,e,n){if(Jt.size>=Oi){let o=Date.now();for(let[i,r]of Jt)r.until<=o&&Jt.delete(i);for(;Jt.size>=Oi;)Jt.delete(Jt.keys().next().value)}Jt.set(t,{until:Date.now()+n,result:e})}function Dc(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/",o=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(o||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function zc(t,e){if(!e||Dc(t)||Bc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Uc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>re(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}${re(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Bi(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"").replace(/^data:[^,]*/,i=>i.replace(/\s+/g,""))),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Hc(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 zi(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function sr(t,e){try{t.onError?.(e)}catch{}}async function dt(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,i=e.useProxy||"",r=e.errorTTL??8e3,s=e.headers||{},a=!!e.debug;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[,p="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(p)?atob(y):decodeURIComponent(y),C=new Uint8Array([...w].map(v=>v.charCodeAt(0))),S=new Blob([C],{type:(p||"").split(";")[0]||""});return{ok:!0,data:S,status:200,url:t,fromCache:!1,mime:S.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let p=await fetch(t);if(!p.ok)return{ok:!1,data:null,status:p.status,url:t,fromCache:!1,reason:"http_error"};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Bi(y),blob:y,status:p.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.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 l;try{l=Hc(t,{as:n,timeout:o,useProxy:i,errorTTL:r,credentials:e.credentials,headers:s})}catch{let p={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return sr(e,p),p}let u=Jt.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Jt.delete(l);let c=ir.get(l);if(c)return c;let f=zc(t,i)?Uc(t,i):t,d=e.credentials;if(!d)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,p);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),o),g=(async()=>{try{let p=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!p.ok){let w={ok:!1,data:null,status:p.status,url:f,fromCache:!1,reason:"http_error"};if(l!==null&&r>0&&Di(l,w,r),a){let C=`${p.status} ${p.statusText||""}`.trim();Wi.warnOnce(`http:${p.status}:${n}:${zi(t)}`,`Couldn't load ${t} (HTTP ${C}).`)}return sr(e,w),w}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:f,fromCache:!1};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Bi(y),blob:y,status:p.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:f,fromCache:!1,mime:b}}catch(p){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":p&&typeof p=="object"&&p.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(l!==null&&!/^blob:/i.test(t)&&r>0&&Di(l,b,r),a){let w=`${y}:${n}:${zi(t)}`,C=y==="timeout"?`Timed out loading ${t} after ${o}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.`;Wi.errorOnce(w,C)}return sr(e,b),b}finally{clearTimeout(m),ir.delete(l)}})();return l!==null&&ir.set(l,g),g}var Wi,ir,Oi,Jt,ge=ot(()=>{"use strict";$t();Wi=Oc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),ir=new Map,Oi=50,Jt=new Map});async function Ne(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=un(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??me(t);if(!o)return t;let i=nr(o),r=re(i),s=(e.useProxy||"")+"|"+r;if(j.background.has(s)){let a=j.background.get(s);return a?`url("${a}")`:"none"}try{let a=await dt(r,{as:"dataURL",useProxy:e.useProxy,debug:e.debug});return a.ok?(j.background.set(s,a.data),`url("${a.data}")`):(j.background.set(s,null),"none")}catch{return j.background.set(s,null),"none"}}var Ui=ot(()=>{"use strict";Mt();$t();ge()});function Vi(t,e){if(jc.has(e))t.add(e);else if(e.startsWith("transform-origin-"))t.add("transform-origin");else return!1;return!0}function Xi(t){let e=t.replace(Yc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function Yi(t,e,n,o){for(let i=0;i5&&(d[0]==="m"||d[0]==="p")){let h=d.startsWith("margin")?"marginUnstable":d.startsWith("padding")?"paddingUnstable":null;h&&!o[h]&&Xc.test(s.getPropertyValue(d))&&(o[h]=!0)}}}let u=r.selectorText;if(u&&u.includes(":has(")&&(o.usesHas=!0),u&&/[+~]|:has\(|:nth-(?:last-)?child\([^)]*\bof\b/i.test(u)&&(o.leaksAcrossSubtrees=!0),s&&(s.counterReset||s.counterIncrement||s.counterSet||s.content&&s.content.includes("counter"))&&(o.leaksAcrossSubtrees=!0),u&&u.includes("&"))for(let c=r.parentRule;c&&u.includes("&");c=c.parentRule)c.selectorText&&(u=u.replace(/&/g,`:is(${c.selectorText})`));if(u&&(o.inContainer||ji.test(u)||u.includes("+")||u.includes("~")))for(let c of Un(u,",")){let f=c.trim();f&&(o.inContainer||ji.test(f)||f.includes("+")||f.includes("~"))&&o.shareUnsafeSels.add(f)}if((a||l)&&Kc(r,u,a,o),u&&u.includes(":"))for(let c in Hi)Hi[c].test(u)&&n[c].push(Xi(u));if(r.styleSheet){if(!zn(r.styleSheet,e,n,o))return!1}else if(r.cssRules&&r.cssRules.length){let c=r.constructor?.name==="CSSContainerRule",f=r.constructor?.name==="CSSScopeRule";c&&o.inContainer++,f&&(o.inScope=(o.inScope||0)+1);let d=Yi(r.cssRules,e,n,o);if(c&&o.inContainer--,f&&o.inScope--,!d)return!1}}return!0}function Kc(t,e,n,o){if(n&&t.constructor?.name==="CSSKeyframeRule"){o.svgKeyframes=!0;return}if(!e||o.inScope){n&&(o.svgGeometryAll=!0);return}let i=n?o.svgGeometrySels:o.svgAnimSels;for(let r of Un(e,",")){let s=r.trim();s&&i.add(Gi.test(s)?Xi(s):s)}}function zn(t,e,n,o){let i;try{i=t.cssRules}catch{i=o.crossOriginRules?.(t)}return i?Yi(i,e,n,o):!1}function lr(t,e){for(let n of t){let o=n.effect?.getKeyframes?.()||[];for(let i of o)for(let r of Object.keys(i))r==="offset"||r==="easing"||r==="composite"||r==="computedOffset"||e.add(r.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function Ki(t){let e=new Set;return zn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:qi,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Un(t,e){if(!t.includes(e))return[t];let n=[],o=0,i=null,r=0;for(let s=0;s"||f==="+"||f==="~")&&(o=c+1)}let i="",r=0;for(let c of t.slice(o))c==="("||c==="["?r++:c===")"||c==="]"?r--:r===0&&(i+=c);let s=c=>!c||/\\[0-9a-fA-F]/.test(c)?null:c.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let l=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(l)return"i"+l;let u=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function Ji(t,e){if(!e.length)return"";if(e.some(o=>o.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function Qc(t,e){let n=t.createElement("div"),o={};for(let i in e){let r=e[i];(i==="before"||i==="after")&&r.push("q"),o[i]=Ji(n,r)}return o}function Qi(t,e){let n={universe:null,pseudoUniverse:null,svgGeometry:null,svgGeometrySel:null,usesHas:!0,leaksAcrossSubtrees:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let o=new Set(ar),i={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},r={budget:qi,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set,svgGeometry:new Set,svgGeometrySels:new Set,svgAnimSels:new Set,svgKeyframes:!1,svgGeometryAll:!1,inScope:0,crossOriginRules:e};for(let f of t.styleSheets)if(!zn(f,o,i,r))return n;let s=t.adoptedStyleSheets;if(Array.isArray(s)){for(let f of s)if(!zn(f,o,i,r))return n}if(typeof t.getAnimations=="function"){let f=new Set;lr(t.getAnimations(),f);for(let d of f)o.add(d),Vi(r.svgGeometry,d)&&(r.svgGeometryAll=!0)}if(r.svgKeyframes)for(let f of r.svgAnimSels)r.svgGeometrySels.add(f);let a=r.svgGeometryAll?null:Array.from(r.svgGeometrySels).join(","),l=Array.from(r.shareUnsafeSels),u=Ji(t.createElement("div"),l)===null?null:l.map(f=>({sel:f,key:Jc(f)})),c=new Set(qc);for(let f of Gc)o.has(f)&&c.add(f);for(let f of r.pseudoProps)c.add(f);return(r.pseudoProps.has("transform")||r.pseudoProps.has("rotate")||r.pseudoProps.has("scale"))&&c.add("transform-origin"),r.pseudoProps.has("perspective")&&c.add("perspective-origin"),{universe:o,pseudoUniverse:c,svgGeometry:r.svgGeometry,svgGeometrySel:a,pseudoGates:Qc(t,i),usesHas:r.usesHas,leaksAcrossSubtrees:r.leaksAcrossSubtrees,shareGate:u,marginUnstable:r.marginUnstable,paddingUnstable:r.paddingUnstable,importantProps:r.importantProps}}catch{return n}}var jc,Vc,ar,Gc,qc,Gi,qi,Xc,Hi,Yc,ji,Hn=ot(()=>{"use strict";jc=new Set(["r","cx","cy","rx","ry","x","y","width","height","d","transform","translate","rotate","scale","transform-origin","transform-box","vector-effect"]);Vc=/^(?:animation|transition)/,ar=["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"],Gc=["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"],qc=["display","width","height","min-width","min-height"],Gi=/::?(?:before|after|first-letter|first-line|marker)/,qi=2e4,Xc=/%|\bauto\b|calc\(|var\(/i,Hi={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Yc=/::?(?:before|after|first-letter|first-line|marker)\b/g;ji=/:(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 Q(t){return Zi.add(t),t.setAttribute("data-snapdom-internal",""),t}function qt(t){return Zi.has(t)}var Zi,At=ot(()=>{"use strict";Zi=new WeakSet});function fr(t){if(t=String(t).toLowerCase(),pn.has(t)){let r={};return j.defaultStyle.set(t,r),r}if(j.defaultStyle.has(t))return j.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);e||(e=document.createElement("div"),Q(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 o=getComputedStyle(n),i={};for(let r of o){if(Le(r))continue;let s=o.getPropertyValue(r);i[r]=s}for(let r of ar)!(r in i)&&!Le(r)&&(i[r]=o.getPropertyValue(r));return e.removeChild(n),j.defaultStyle.set(t,i),i}function Le(t){let e=ts.get(t);if(e===void 0){let n=String(t).toLowerCase();e=ef.has(n)||tf.test(n)||Zc.test(n),ts.set(t,e)}return e}function os(t,e){let n=af.get(t);if(n===void 0||e[n]!==e[t])return!1;let o=e["writing-mode"];if(o&&o!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function jn(t,e){return!of.has(t)&&(e==="inline"||nf.has(t)||ns.has(t))}function ur(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||ns.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let r=(e.position||"static").toLowerCase();return r==="absolute"||r==="fixed"?!1:!cf.has(o)}function Ie(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),pn.has(e))return"";let i=[],r=fr(e),s=(t.display||"").toLowerCase(),a=s==="inline",l=jn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",c=u==="nowrap"||u==="pre",d=l&&n&&!(l&&n&&!a&&c),h=!1;for(let m in t){if(Le(m)||os(m,t))continue;let g=t[m];if(!(es.has(m)&&rf.has(e))){if(d){if(es.has(m))continue;if(sf.has(m)){g&&g!==r[m]&&(i.push(`${m}:${g}`),g!=="auto"&&(h=!0));continue}}if(g&&g!==r[m]){if((m==="height"||m==="block-size"||!c&&(m==="width"||m==="inline-size"))&&g.endsWith("px")&&g.includes(".")){let y=parseFloat(g);if(Number.isFinite(y)){i.push(`${m}:${(y+lf).toFixed(3)}px`);continue}}i.push(`${m}:${g}`)}}}if(d&&!a&&!o&&!h){let m=t.width;m&&m!=="auto"&&m!==r.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function dr(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 pr(t,e=null){let n=new Map;for(let s of t){let a=fr(s);if(!a)continue;let c=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!os(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=c.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:c}),n.get(f).tagList.push(s))}let o=[...n.values()],i=null;for(let{declarations:s}of o){let a=new Set(s);if(!i){i=a;continue}for(let l of i)a.has(l)||i.delete(l)}i??=new Set;let r="";if(i.size&&o.length>1){let s=o.flatMap(a=>a.tagList);r+=`${s.join(",")} { ${[...i].join("")} } -`}for(let{tagList:s,declarations:a}of o){let l=o.length>1?a.filter(c=>!i.has(c)):a;if(!l.length)continue;let u=l.join("");r+=`${s.join(",")} { ${u} } -`}return r}function hn(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let i of e)n.set(i,`c${o++}`);return n}function ff(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let o=0;o{let r={length:0,getPropertyValue:()=>"",item:()=>""};return r[Symbol.iterator]=function*(){},r};if(t?.nodeType!==1){let r=typeof window<"u"?window:null;if(r&&typeof r.getComputedStyle=="function")try{return r.getComputedStyle(t,e)||n()}catch{return n()}return n()}let o=j.computedStyle.get(t);o||(o=new Map,j.computedStyle.set(t,o));let i=o.get(e);if(!i){let r=ff(t),s=null;try{s=r&&typeof r.getComputedStyle=="function"?r.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}i=s||n(),o.set(e,i)}return i}function We(t,e=null){let n={};for(let o of e||t){let i=t.getPropertyValue(o);i&&(n[o]=i)}for(let o of uf){let i=n[`border-${o}-style`],r=n[`border-${o}-width`];(i==="none"||i==="hidden"||r==="0px")&&(delete n[`border-${o}-style`],delete n[`border-${o}-width`],delete n[`border-${o}-color`])}return n}function ie(t){let e=[],n=0,o=0,i="";for(let r=0;r{"use strict";Mt();Hn();At();cr=new Set(["meta","script","noscript","title","link","template"]),pn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);Zc=/(?:^|-)(animation|transition)(?:-|$)/i,tf=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,ef=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),ts=new Map;nf=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ns=new Set(["table","thead","tbody","tfoot","tr","td","th"]),of=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),es=new Set(["width","max-width","inline-size","max-inline-size"]),rf=new Set(["mi","mn","mo","ms","mtext"]),sf=new Set(["min-width","min-inline-size"]),af=new Map(Object.entries({"block-size":"height","inline-size":"width","min-block-size":"min-height","min-inline-size":"min-width","max-block-size":"max-height","max-inline-size":"max-width","margin-block-start":"margin-top","margin-block-end":"margin-bottom","margin-inline-start":"margin-left","margin-inline-end":"margin-right","padding-block-start":"padding-top","padding-block-end":"padding-bottom","padding-inline-start":"padding-left","padding-inline-end":"padding-right","inset-block-start":"top","inset-block-end":"bottom","inset-inline-start":"left","inset-inline-end":"right","border-block-start-width":"border-top-width","border-block-start-style":"border-top-style","border-block-start-color":"border-top-color","border-block-end-width":"border-bottom-width","border-block-end-style":"border-bottom-style","border-block-end-color":"border-bottom-color","border-inline-start-width":"border-left-width","border-inline-start-style":"border-left-style","border-inline-start-color":"border-left-color","border-inline-end-width":"border-right-width","border-inline-end-style":"border-right-style","border-inline-end-color":"border-right-color","border-start-start-radius":"border-top-left-radius","border-start-end-radius":"border-top-right-radius","border-end-start-radius":"border-bottom-left-radius","border-end-end-radius":"border-bottom-right-radius","overflow-block":"overflow-y","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width"}));lf=.001;cf=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);uf=["top","right","bottom","left"]});function vt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,o=()=>{n||(n=!0,e())};try{requestAnimationFrame(o)}catch{o();return}setTimeout(o,t)})}async function mn(t=document){let e=t.fonts,n=!1,o=e.ready.then(()=>{n=!0},()=>{n=!0});for(;!n&&e.status==="loading";){let i=[...e].filter(r=>r.status==="loading");if(!i.length)return;await Promise.race([o,Promise.allSettled(i.map(r=>r.loaded))])}}function is(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?df:rs),n=null,o={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=new Promise(i=>{let r=()=>{n=null,o.yielded=!0,e=performance.now()+rs,i()},s=new MessageChannel;s.port1.onmessage=r,s.port2.postMessage(0)}))};return o}function gn(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function Y(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),o=/applewebkit/i.test(t),i=/mobile/i.test(t),r=!/safari/i.test(t),s=o&&i&&r,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&o;return n||s||a||l||u}function Et(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var rs,df,yt=ot(()=>{"use strict";rs=16,df=40});function O(t,e,n){let o=t&&typeof t=="object"&&(t.options||t);o&&o.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function et(t,e,n,o){let i=t&&t.warnings;i&&i.length{"use strict";pf=50});var _t=ot(()=>{"use strict";Ui();Oe();yt();$t();wt()});function Bt(){Be++}function Gn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(qt(e))return!0;e.parentElement?e=e.parentElement:e=Dt(e)}return!1}function Xn(t){for(let e of t)if(we(e))return!0;return!1}function we(t){if(Gn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!Gn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!Gn(n)){e=!1;break}}if(e)return!1}return!0}function hs(t){for(let e of t){if(!we(e))continue;let n=e.target.ownerDocument||document;De.set(n,(De.get(n)||0)+1);let o=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;o;o=o.parentElement||Dt(o))De.set(o,(De.get(o)||0)+1)}}function xn(t){let e=t.ownerDocument||document;return He(e),(De.get(e)||0)-(De.get(t)||0)}function ze(t=document){return He(t),Pt}function xe(){return He(),Be}function Sn(t){return t?(He(t.ownerDocument||document),Yn(t,Sr(t))):0}function Ue(){Bt(),Pt++}function mf(t){be.set(t,++se)}function wr(t){if(!t||t.nodeType!==1)return;se++,be.set(t,se);let e=t.querySelectorAll("*");for(let n=0;nn?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let o=n.target,i=o&&(o.nodeType===1?o:o.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let r of n.addedNodes)if(e(r))return r.ownerDocument||document;for(let r of n.removedNodes)if(e(r))return r.ownerDocument||o&&o.ownerDocument||document}return null}function ms(t){if(!Xn(t))return;hs(t),Bt();let e=new Set;for(let n of t){if(!we(n))continue;let o=n.target.getRootNode&&n.target.getRootNode();if(!o||o.nodeType!==11||e.has(o))continue;e.add(o),o.host?wr(o.host):se++;let i=o.querySelectorAll("*");for(let r=0;r{Xn(i)&&(Bt(),Pt++)},o=()=>{Bt(),Pt++};try{let i=new MutationObserver(gs);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),wn.push({o:i,env:!1,doc:t})}catch{}try{let i=new MutationObserver(n);i.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),wn.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",o,{passive:!0})}catch{}try{let i=r=>{Bt();let s=r.composedPath?.()[0]||r.target;s&&s.nodeType===1&&!Gn(s)&&vr(s.ownerDocument||t)?xr(s):ae++};t.addEventListener("focusin",i,{capture:!0,passive:!0}),t.addEventListener("focusout",i,{capture:!0,passive:!0}),t.addEventListener("change",i,{capture:!0,passive:!0}),t.addEventListener("pointerdown",i,{capture:!0,passive:!0}),t.addEventListener("pointerup",i,{capture:!0,passive:!0}),t.addEventListener("pointercancel",i,{capture:!0,passive:!0}),t.addEventListener("keydown",i,{capture:!0,passive:!0}),t.addEventListener("keyup",i,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",i,{capture:!0,passive:!0}),t.addEventListener("toggle",i,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{Bt(),ae++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",o),i.status==="loading"&&i.ready?.then(o).catch(()=>{}))}catch{}}function ls(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let o=as.get(t)||[];if(o.length===n.length&&o.every((r,s)=>r===n[s]))return;if(as.set(t,n),Bt(),t.nodeType===11){t.host?wr(t.host):se++;for(let r of t.querySelectorAll("*"))be.set(r,se);return}let i=o.filter(r=>!n.includes(r)).concat(n.filter(r=>!o.includes(r)));for(let r of i)if(r.isConnected)if(vr(e))xr(r);else{ae++;return}}function Kn(t,e=null){if(!t)return;ls(t,t);let n=e||yn.filter(({root:o})=>o.host?.isConnected).map(({root:o})=>o);for(let o of n)ls(o,t)}function zt(){He();try{for(let t=wn.length-1;t>=0;t--){let{o:e,env:n,doc:o}=wn[t];if(o!==document&&!o.defaultView){try{e.disconnect()}catch{}yr.delete(o),bn===o&&(bn=null),wn.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?Xn(i)&&(Bt(),Pt++):gs(i))}for(let t=yn.length-1;t>=0;t--){let{o:e,root:n}=yn[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}gr.delete(n),yn.splice(t,1);continue}let o=e.takeRecords();o.length&&ms(o)}}catch{}}function Se(t){if(!(!t||t.nodeType!==1)){le.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)le.delete(e.currentNode)}catch{}}}function kr(t){let e=le.get(t);if(e&&Jn(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function ys(t){let e=le.get(t);if(!e||!Jn(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}function bf(t){let e=t.href;return!e||typeof CSSStyleSheet!="function"?null:Vn.has(e)?Vn.get(e):(Vn.set(e,null),dt(e,{as:"text"}).then(n=>{if(!n.ok||typeof n.data!="string"||/@import/i.test(n.data))return;let o=new CSSStyleSheet;o.replaceSync(n.data),Vn.set(e,o.cssRules),Bt(),Pt++}).catch(()=>{}),null)}function Ut(t){let e=cs.get(t);if(!e||e.epoch!==Be){let n=e&&e.universe;e={epoch:Be,...Qi(t,bf)};let o=e.universe;if(n&&o&&n.size===o.size){let i=!0;for(let r of o)if(!n.has(r)){i=!1;break}i&&(e.universe=n)}cs.set(t,e)}return e}function bs(t){return Ut(t).leaksAcrossSubtrees}function ws(t){try{let e=Ut(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,o=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let l=0;l{for(;Kt(a)&&!i.roots.has(a);a=a.host.getRootNode()){i.roots.add(a);for(let l of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=fs.get(l);if((!u||u.epoch!==Be)&&fs.set(l,u={epoch:Be,props:Ki(l)}),!u.props)return!1;for(let c of u.props)i.universe.add(c)}lr(a.getAnimations(),i.universe)}return!0},s=r(e)&&(!t.shadowRoot||r(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=r(a.getRootNode());return s?i.universe:o.__shadowUniverse=null}function qn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Ut(e).pseudoUniverse}function xs(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Ut(e).svgGeometry}function Ss(t){let e=Ut(t.ownerDocument||document).svgGeometrySel;if(e==null)return!0;if(!e)return!1;try{return t.matches(e)}catch{return!0}}function ce(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Sf:Ut(e).pseudoGates}function vf(t,e={},n=null,o=null){let i={},r=e.excludeStyleProps,s=h=>{if(i[h]!==void 0||Le(h)||r&&(r instanceof RegExp&&r.test(h)||typeof r=="function"&&r(h)))return;let m=t.getPropertyValue(h);m&&((h==="background-image"||h==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),i[h]=m)};if(o){for(let m of o)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;mr==="transparent"||r==="rgba(0, 0, 0, 0)",o=t["-webkit-text-fill-color"];if(!n(o!==void 0?o:t.color))return;let i=Af(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),o!==void 0&&(t["-webkit-text-fill-color"]=i),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:i,enumerable:!1}))}function kf(t,e,n){let o=n.textShadow;if(!o||o==="none"||!(parseFloat(n.webkitTextStrokeWidth)>0)||t.firstElementChild||n.backgroundImage!=="none"||n.boxShadow!=="none"||vs(n.backgroundColor)[3]!==0||["Top","Right","Bottom","Left"].some(u=>parseFloat(n[`border${u}Width`])>0)||o.replace(/\([^)]*\)/g,"").includes(","))return;let i=(o.match(/(?:rgba?|hsla?|color|oklch|oklab|lab|lch)\([^)]*\)|#[\da-f]+|\b[a-z]+\b/i)||[])[0],[r=0,s=0,a=0]=(o.match(/-?[\d.]+px/g)||[]).map(parseFloat);if(!i)return;let l=n.filter&&n.filter!=="none"?`${n.filter} `:"";e.style.setProperty("text-shadow","none","important"),e.style.setProperty("filter",`${l}drop-shadow(${r}px ${s}px ${a/2}px ${i})`,"important")}function vs(t){if(!ye){let e=document.createElement("canvas");e.width=e.height=1,ye=e.getContext("2d",{willReadFrequently:!0})}return ye.clearRect(0,0,1,1),ye.fillStyle="transparent",ye.fillStyle=t,ye.fillRect(0,0,1,1),ye.getImageData(0,0,1,1).data}function Af(t,e){let n=r=>{let s=[];for(let a of(r||"").match(Mf)||[]){let[l,u,c,f]=vs(a);f>13&&s.push([l,u,c])}return s},o=n(t);if(o.length||(o=n(e)),!o.length)return null;let i=[0,0,0];for(let[r,s,a]of o)i[0]+=r,i[1]+=s,i[2]+=a;return`rgb(${i.map(r=>Math.round(r/o.length)).join(", ")})`}function Cs(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let i of yf){let r=t.getPropertyValue(i);if(r&&r!=="none")return!0}let o=t.getPropertyValue("background");return!!(o&&/url\s*\(/i.test(o))}function Ef(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=D(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function _f(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!us(String(i).trim().toLowerCase())}}catch{}let o=t.style&&(t.style.width||t.style.inlineSize);return o&&!us(String(o).trim().toLowerCase())?!0:Ff(t,e)?n||Tf(t,e):!1}function us(t){return Rf.has(t)||t.startsWith("fit-content")}function Ff(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let o=1/0,i=-1/0,r=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(r=r||document.createRange(),r.selectNode(s),a=r.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let l=D(s);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.lefti&&(i=a.right)}return i===-1/0?!1:i-o0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}function $f(t,e){let n=br.get(t);if(n)return n;let o=[e];for(let i in t)o.push(i,t[i]);return n=o.join(""),br.set(t,n),n}function Jn(t,e){return t.env===Pt&&t.stamp===Yn(e,t.hosts)}function If(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function Wf(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let o=t.parentElement,i;if(!o)i="R";else if(i=e.ids.get(o),i===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;i="R"}if(e.rootSeen=!0,i===-1)return e.ids.set(t,-1),-1;let r="",s=t.attributes;if(s&&s.length)if(s.length===1)r=s[0].name+"="+s[0].value;else{let l=[];for(let u=0;uu[g])),h&&c.push(""+h),br.set(u,f.sig+""+c.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=Sr(t);return le.set(t,{env:Pt,stamp:Yn(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function Df(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:hr,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:hr,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:t||e||{}}}function Uf(t,e,n){if(!t.style||t.style.length===0)return;let o=wf(t),i=o!=null&&!Bf.test(t.getAttribute("style")||""),r;for(let s=0;sf.snapshot[d]===c)||n.borderWidth===c}if(i&&!o.has(a)&&(!l||r)&&!(a.startsWith("background")&&zf(t)))continue;let u=n.getPropertyValue(a);u&&(!l||u!==t.style.getPropertyValue(a))&&e.style.setProperty(a,u,t.style.getPropertyPriority(a))}}function xt(t,e,n,o){if(t.tagName==="STYLE")return;let i=Df(n,o),r=i.options&&i.options.cache||"soft";r!=="disabled"&&He(t.ownerDocument),r==="disabled"&&!i.session.__bumpedForDisabled&&(Bt(),hr.clear(),i.session.__bumpedForDisabled=!0);let{session:s,persist:a}=i;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let l=s.styleCache.get(t);t.getAttribute?.("style")&&Uf(t,e,l);let u=l.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let c=t.tagName?.toLowerCase()||"div";if(pn.has(c)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Cs(l),enumerable:!1});let b=Sr(t);le.set(t,{env:Pt,stamp:Yn(t,b),hosts:b,snapshot:y,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let f=null;if(i.options&&i.options.__styleShare&&s.styleMap){let y=If(s),b=Wf(t,y),w=t.ownerDocument||document,C=w.activeElement;b!==-1&&!Lf.has(t.tagName)&&!(C&&C!==w.body&&C!==w.documentElement&&C===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let d=Of(t,l,i.options,f,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;d[b]==="auto"&&e.style.setProperty(b,"auto","important")}d.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",d.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",d.__bgClipTextFix,"important"),(s.bgClipText||=[]).push([t,e])),Y()&&kf(t,e,l),Hf(t,l,d),e.style?.length&&d["box-sizing"]==="border-box"&&l.getPropertyValue("box-sizing")!=="border-box"&&qf(t,e,d);let h=Fs(t);if(Yf(t,e,d,h,s),h){let y=l.getPropertyValue("min-width");if(!y||y==="auto"||y==="0px"){d["min-width"]="0px";let b=l.getPropertyValue("overflow-x"),w=t.parentElement;if(y==="auto"&&(b==="visible"||b==="clip")&&w&&D(w).display.includes("flex")){let C=s.flexOverflow||(s.flexOverflow=new WeakMap),S=C.get(w);if(S===void 0){if(S=w.scrollWidth>w.clientWidth,!S){let v=D(w),M=E=>parseFloat(v.getPropertyValue(E))||0,F=M("width")-(v.boxSizing==="border-box"?M("padding-left")+M("padding-right")+M("border-left-width")+M("border-right-width"):0),A=v.flexDirection.startsWith("row")===(v.writingMode==="horizontal-tb")&&v.flexWrap==="nowrap",x=0,_=0;for(let E of w.children){s.styleCache.has(E)||s.styleCache.set(E,getComputedStyle(E));let $=s.styleCache.get(E);if($.display==="none"||$.position==="absolute"||$.position==="fixed")continue;let R=k=>parseFloat($.getPropertyValue(k))||0,W=R("width")+R("margin-left")+R("margin-right")+($.boxSizing==="border-box"?0:R("padding-left")+R("padding-right")+R("border-left-width")+R("border-right-width"));x=A?x+W:Math.max(x,W),_++}S=x+(A?Math.max(0,_-1)*M("column-gap"):0)>F+_/60}C.set(w,S)}S&&(d["min-width"]=d.width)}}}let m=$f(d,c),g=!0;if(jn(c,(d.display||"").toLowerCase())){g=Ef(t),g&&ur(c,d,h)&&_f(t,l,h)&&(g=!1),m=`${m}${g?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";g&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let p=a.snapshotKeyCache.get(m);p===void 0&&(p=Ie(d,c,g,h),a.snapshotKeyCache.size>=hf&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,p)),s.styleMap.set(e,p)}function Hf(t,e,n){let o=e.getPropertyValue("overflow-x"),i=e.getPropertyValue("overflow-y");if((o==="visible"||!o)&&(i==="visible"||!i)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let r=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-r(e.getPropertyValue("border-left-width"))-r(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-r(e.getPropertyValue("border-top-width"))-r(e.getPropertyValue("border-bottom-width")),l=(u,c)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let d=parseFloat(f);Number.isFinite(d)&&(n[u]=`${Math.round((d+c)*1e3)/1e3}px`)};s>=2&&(l("width",s),l("inline-size",s)),a>=2&&(l("height",a),l("block-size",a))}function jf(t,e,n){if(!As.some(l=>n[l]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let l of["width","height"]){let u=n[`min-${l}`],c=n[`max-${l}`];if(u&&u!=="0px"&&u!=="auto"||c&&c!=="none")return""}let o=l=>parseFloat(n[l])||0,i=o("padding-left")+o("padding-right")+o("border-left-width")+o("border-right-width"),r=o("padding-top")+o("padding-bottom")+o("border-top-width")+o("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let l of Es){let u=n[l];if(!u||!u.endsWith("px"))continue;let f=l==="width"||l==="inline-size"&&!s||l==="block-size"&&s?i:r;n[l]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let l=t.scrollWidth<=t.clientWidth;n["overflow-x"]=l?"hidden":"auto",l&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let l=t.scrollHeight<=t.clientHeight;n["overflow-y"]=l?"hidden":"auto",l&&(a+="y")}return a}function qf(t,e,n){if(Gf.test(t.getAttribute("style")))for(let o of Vf)e.style.getPropertyValue(o)&&n[o]&&e.style.setProperty(o,n[o],e.style.getPropertyPriority(o))}function Xf(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function Yf(t,e,n,o,i){let r=n.display||"";if(!o&&!r.startsWith("inline-")&&(n.float||"none")==="none"&&n.position!=="absolute"&&n.position!=="fixed")return;let s=n["text-wrap-mode"]||n["white-space"]||"";if(s==="nowrap"||s==="pre"||ds==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=i.__oneLine||=new WeakSet;for(let l=t.parentElement;l;l=l.parentElement)if(a.has(l))return;Kf(t,n,i)&&(a.add(t),e.style.setProperty(ds,"nowrap"))}function Kf(t,e,n){let o=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(o>3*(parseFloat(e["font-size"])||16)||e["word-break"]==="normal"&&e["overflow-wrap"]==="normal"&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(t.textContent.trim()))return!1;let i=t.ownerDocument||document,r=i.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=i.createRange(),a=null,l=0,u=0;for(let d=r.nextNode();d;d=r.nextNode()){if(d.nodeType===1){if(d.shadowRoot||d.localName==="br"||d.localName==="textarea")return!1;continue}if(/\S/.test(d.data)){if(++u>64)return!1;s.selectNodeContents(d);for(let h of s.getClientRects())if(h.height){if(a||=h,Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)2||(delete n.height,delete n["block-size"])}var le,ss,hr,hf,Be,De,Pt,be,se,ae,mr,gr,yn,yr,bn,wn,as,yf,cs,Vn,fs,Sf,Mf,ye,Rf,br,Pf,Nf,Lf,Bf,zf,As,Es,Vf,Gf,ds,Jf,ps,_s,Rt=ot(()=>{"use strict";_t();yt();Mt();Hn();At();ge();le=new WeakMap,ss=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],hr=new Map,hf=2e3,Be=0;De=new WeakMap;Pt=0;be=new WeakMap,se=0,ae=0;mr=new WeakMap;gr=new WeakSet,yn=[];yr=new WeakSet,bn=null,wn=[];as=new WeakMap;yf=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];cs=new WeakMap,Vn=new Map;fs=new WeakMap;Sf={before:null,after:null,firstLetter:null,marker:null,firstLine:null};Mf=/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^()]*\)/g;Rf=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);br=new WeakMap;Pf=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Nf=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,Lf=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);Bf=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,zf=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";As=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Es=["width","inline-size","height","block-size"];Vf=["box-sizing",...Es,"overflow-x","overflow-y"],Gf=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;ds=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";Jf=0,ps=1,_s=2});function Dr(t){return Ua(t.boxShadow)}function Br(t){return Ua(t.textShadow)}function Ua(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",o=0;for(let l=0;lparseFloat(p))||[];if(u.length<2)continue;let[c,f,d=0,h=0]=u,m=Math.abs(c)+d+h,g=Math.abs(f)+d+h;r=Math.max(r,m+Math.max(c,0)),a=Math.max(a,m+Math.max(-c,0)),s=Math.max(s,g+Math.max(f,0)),i=Math.max(i,g+Math.max(-f,0))}return{top:Math.ceil(i),right:Math.ceil(r),bottom:Math.ceil(s),left:Math.ceil(a)}}function zr(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,o=0,i;for(;i=n.exec(e);)o+=parseFloat(i[1])||0;let r=Math.ceil(o*2);return{top:r,right:r,bottom:r,left:r}}function Ur(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,o=e+Math.max(0,Math.ceil(n));return{top:o,right:o,bottom:o,left:o}}function Hr(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)||[],o=0,i=0,r=0,s=0,a=!1;for(let l of n){a=!0;let u=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[c=0,f=0,d=0]=u,h=Math.abs(c)+d,m=Math.abs(f)+d;i=Math.max(i,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),r=Math.max(r,m+Math.max(f,0)),o=Math.max(o,m+Math.max(-f,0))}return{bleed:{top:H(o),right:H(i),bottom:H(r),left:H(s)},has:a}}function Id(t){let e=Dr(t),n=Br(t),o=zr(t),i=Ur(t),r=Hr(t);return{top:Math.max(e.top,n.top)+o.top+i.top+r.bleed.top,right:Math.max(e.right,n.right)+o.right+i.right+r.bleed.right,bottom:Math.max(e.bottom,n.bottom)+o.bottom+i.bottom+r.bleed.bottom,left:Math.max(e.left,n.left)+o.left+i.left+r.bleed.left}}function Wd(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 za(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",o=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:o||e!=="visible",y:o||n!=="visible"}}function jr(t,e,n,o=1,i=1){let r=0,s=0,a=0,l=0,u=za(n.get(t)||D(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let c=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||!Wd(d))continue;let h=Id(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),g={left:m.left-h.left/o,top:m.top-h.top/i,right:m.right+h.right/o,bottom:m.bottom+h.bottom/i};for(let p=f.parentElement;p;p=p.parentElement){let y=za(n.get(p)||D(p));if(y.x||y.y){let b=p.getBoundingClientRect();y.x&&(g.left=Math.max(g.left,b.left),g.right=Math.min(g.right,b.right)),y.y&&(g.top=Math.max(g.top,b.top),g.bottom=Math.min(g.bottom,b.bottom))}if(p===t)break}u.x||(l=Math.max(l,(c.left-g.left)*o),s=Math.max(s,(g.right-c.right)*o)),u.y||(r=Math.max(r,(c.top-g.top)*i),a=Math.max(a,(g.bottom-c.bottom)*i))}return{top:Math.max(0,Math.ceil(r)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(l))}}function Ha(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 o=n.transform||"none";if(!o||o==="none"){let l=null;try{l=Ce(t).scale}catch{}try{e.style.transform="none"}catch{}if(!l)return{a:1,b:0,c:0,d:1};let u=ue({scale:l});return{a:u.a,b:u.b,c:u.c,d:u.d}}function i(l,u,c,f){let d=Math.sqrt(l*l+u*u)||0,h=0,m=0;if(d>0){let g=l/d,p=u/d;h=g*c+p*f;let y=c-g*h,b=f-p*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 r=l=>{let u=Ce(t).scale;if(!u)return l;let c=ue({scale:u,baseTransform:`matrix(${l.a},${l.b},${l.c},${l.d},0,0)`});return{a:c.a,b:c.b,c:c.c,d:c.d}},s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let l=s[1].split(",").map(u=>parseFloat(u.trim()));if(l.length===6&&l.every(Number.isFinite)){let[u,c,f,d]=l,h=i(u,c,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return r(h)}}let a=o.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let l=a[1].split(",").map(u=>parseFloat(u.trim()));if(l.length===16&&l.every(Number.isFinite)){let u=l[0],c=l[1],f=l[4],d=l[5],h=i(u,c,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return r(h)}}try{let l=new DOMMatrix(o),u=i(l.a,l.b,l.c,l.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return r(u)}catch{return null}}function Ke(t,e,n,o,i){let r=n.a,s=n.b,a=n.c,l=n.d,u=n.e||0,c=n.f||0;function f(y,b){let w=y-o,C=b-i,S=r*w+a*C,v=s*w+l*C;return S+=o+u,v+=i+c,[S,v]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,g=-1/0,p=-1/0;for(let[y,b]of d)yg&&(g=y),b>p&&(p=b);return{minX:h,minY:m,maxX:g,maxY:p,width:g-h,height:p-m}}function Rn(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,r]=[o[0]||"0",o[1]||"0"],s=(a,l)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?l/2:u==="right"||u==="bottom"?l:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*l/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(i,e),oy:s(r,n)}}function Ce(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=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},r=i("rotate");if(r)if(r.angle){let l=r.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit,r.is2D===!1&&r.x&&r.y&&r.z&&(e.rotate=`${r.x.value} ${r.y.value} ${r.z.value} ${e.rotate}`)}else r.unit?e.rotate=r.unit==="rad"?r.value*180/Math.PI+"deg":r.value+r.unit:e.rotate=String(r);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let s=i("scale");if(s){let l=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[l(s.x),l(s.y)??l(s.x),...s.is2D===!1?[l(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(l).join(" "):e.scale=String(s)}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let a=i("translate");if(a){let l=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[l(a.x),l(a.y)??"0px",...a.is2D===!1?[l(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(l).join(" "):e.translate=String(a)}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.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 o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function Od(){if(Or?.isConnected)return Or;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Q(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),Or=t,t}function ue(t){let e=r=>{let s=[],a=0,l=0,u=String(r).trim();for(let c=0;cl&&s.push(u.slice(l,c)),l=c+1);return lr&&r!=="none",o=[];if(n(t.translate)){let r=e(t.translate);for(let s=0;s<2&&s2?`translate3d(${r.join(",")})`:`translate(${r.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let r=e(t.rotate);r.length===4?o.push(`rotate3d(${r.join(",")})`):r.length===2&&/^[xyz]$/i.test(r[0])?o.push(`rotate${r[0].toUpperCase()}(${r[1]})`):o.push(`rotate(${r.join(" ")})`)}if(n(t.scale)){let r=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);o.push(r.length>2?`scale3d(${r.join(",")})`:`scale(${r.join(",")})`)}if(n(t.baseTransform)&&o.push(t.baseTransform),!o.length)return new DOMMatrix;let i=o.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let r=Od(),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.");r.appendChild(s);try{return Dd(s)}finally{s.remove()}}}function ja(t){let e=D(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",r=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||r||s)}function Dd(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Or,Fn=ot(()=>{"use strict";ke();Oe();At();Or=null});function xo(t,e){if(!e)return null;let n=t.ownerDocument||document,o=n.defaultView||window,i,r,s,a;if(e==="viewport")i=0,r=0,s=n.documentElement?.clientWidth||o.innerWidth,a=n.documentElement?.clientHeight||o.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(o.scrollX||0),r=(Number(e.y)||0)-(o.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:r,width:s,height:a,right:i+s,bottom:r+a}:null}function Tn(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Kt(e)?e.host:null}function Bd(t,e){for(let n=e;n;n=Tn(n))if(n===t)return!0;return!1}function zd(t,e){for(let n=Tn(t);n&&n!==e&&n?.nodeType===1;n=Tn(n)){let o=D(n);if(o.position!=="static"||Vr(o))return n}return null}function Vr(t){return t.transform&&t.transform!=="none"||t.filter&&t.filter!=="none"||t.backdropFilter&&t.backdropFilter!=="none"||t.perspective&&t.perspective!=="none"||/transform|perspective|filter/.test(t.willChange||"")||/layout|paint|strict|content/.test(t.contain||"")}function Xa(t,e,n,o,i,r){if(t.scrollTop||t.scrollLeft)return;let s=o.get(t)||D(t);if(Vr(s))return;let a=s.position!=="static",l=new Map;for(let[u,c]of e){let f=n.get(u);if(!f)continue;let d=l.get(f);if(d===void 0&&l.set(f,d=Ud.exec(f)?.[1]||""),!d||d==="absolute"&&a||qr.has(u))continue;let h=!1;for(let y=Tn(c);y&&y!==t&&y.nodeType===1;y=Tn(y)){let b=o.get(y)||D(y);if(d==="absolute"&&b.position!=="static"||Vr(b)){h=!0;break}}if(h)continue;let m=o.get(c)||D(c),g=parseFloat(m.left),p=parseFloat(m.top);i&&Number.isFinite(g)&&(u.style.left=`${g+i}px`),r&&Number.isFinite(p)&&(u.style.top=`${p+r}px`)}}function Xr(t,e){try{return ue({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Ya(t,e,n,o,i){let r=t.getBoundingClientRect();Tt(e)&&D(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,l]of n){if(l?.nodeType!==1)continue;let u=a.localName==="svg"&&Ot(a)&&!Ot(l.parentNode);if(!Tt(a)&&!u||l===t||!Bd(t,l))continue;let c=o.get(l)||D(l),f=c.position;if(f!=="fixed"&&f!=="sticky"&&f!=="-webkit-sticky"||a.style.position==="absolute")continue;let d=l.getBoundingClientRect();if(!(d.width>0&&d.height>0))continue;qr.add(a);let h=c.transform&&c.transform!=="none"?c.transform:"",m=Ce(l),g=!!(h||m.rotate!=="0deg"||m.scale||m.translate),p=g?Xr(h,m):null,y=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,b=d.width,w=d.height;y||(b=l.offsetWidth||d.width,w=l.offsetHeight||d.height);let C=l.getRootNode&&Kt(l.getRootNode()),S=r,v=t.clientLeft||0,M=t.clientTop||0;if(C){let _=zd(l,t);_&&(S=_.getBoundingClientRect(),v=_.clientLeft||0,M=_.clientTop||0)}let F=d.left-S.left-v,T=d.top-S.top-M;if(g)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",y)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:_,oy:E}=Rn(c,b,w),$=Ke(b,w,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},_,E);F-=$.minX,T-=$.minY}if(f!=="fixed"){let _=a.cloneNode(!1);_.setAttribute("data-snap-ph","1"),_.style.position="static",_.style.visibility="hidden",_.style.width=`${b}px`,_.style.height=`${w}px`,_.style.boxSizing="border-box",a.parentElement?.insertBefore(_,a)}let A=u?b:b+2,x=w;i&&(Math.abs(T-i.y)<.5&&(T-=1,x+=1),Math.abs(F-i.x)<.5&&(F-=1,A+=1)),a.style.position="absolute",a.style.left=`${F}px`,a.style.top=`${T}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${A}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",C||s.push(a)}for(let a of s)e.appendChild(a)}function Ka(t,e,n={}){if(!t||!e||!e.style)return;let o=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){O(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){O(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){O(n,"Couldn't remove the root outline.",s)}let r=(o.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=r.length?r:"none"}catch(s){O(n,"Couldn't remove the root drop-shadow filter.",s)}}function Ja(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 Va(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",o=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||o!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Hd(t,e){let n=Array.from(t.childNodes),o=e==="top"?n:n.reverse();for(let i of o){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let r=getComputedStyle(i),s=String(r.display||"");if(!(s==="none"||s==="contents")&&!(r.position==="absolute"||r.position==="fixed"))return r.float&&r.float!=="none"||s.startsWith("inline")?null:i}return null}function Qa(t,e,n,o=null){if(!t||!e||!e.style)return;let i=getComputedStyle(t);if(!Va(i))for(let r of["top","bottom"]){let s=r==="top"?"Top":"Bottom";if((parseFloat(i[`border${s}Width`])||0)>0||(parseFloat(i[`padding${s}`])||0)>0)continue;let a=t,l=e;for(;a&&l;){let u=Hd(a,r);if(!u)break;let c=n?Array.from(l.children).find(h=>n.get(h)===u)||o?.get(u)||null:l.children[Array.from(a.children).indexOf(u)]||null,f=getComputedStyle(u),d=parseFloat(f[`margin${s}`])||0;if(c&&c.style&&d>0&&(c.style[`margin${s}`]="0px"),Va(f)||(parseFloat(f[`border${s}Width`])||0)>0||(parseFloat(f[`padding${s}`])||0)>0)break;a=u,l=c}}}function Vd(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!jd.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}function So(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,o=a=>{for(let l of Array.from(a.attributes)){if(Vd(l.name,n)){a.removeAttribute(l.name);continue}if(qd.test(l.value))continue;let u=Ga(l.value);if(u!==l.value)try{a.setAttribute(l.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&o(t);let i=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=r.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)o(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=Ga(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Xd(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Kd(t){return Ot(t)||Yd.has(t?.localName)}function Jd(t,e){if(t?.nodeType!==1||Xd(t)||Kd(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function Za(t,e,n=new Map,o=null){function i(r,s){if(r?.nodeType!==1||s?.nodeType!==1)return;let a=r.childElementCount>s.childElementCount,l=n.get(r)||getComputedStyle(r);if(n.has(r)||n.set(r,l),a&&Jd(r,l)){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 c=l.overflowY||l.overflowBlock||"visible",f=l.overflowX||l.overflowInline||"visible";(c!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(o)for(let c of u){let f=o.get(c);f&&f.nodeType===1&&i(f,c)}else{let c=Array.from(r.children);for(let f=0;fr&&(r=p),s=!0)}let l=s?Math.max(0,r-i):0,u=parseFloat(n.borderTopWidth)||0,c=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+c+f+d+l}function Kr(t){let e=document.implementation.createHTMLDocument(""),n=e.importNode(t,!0);for(let o of[n,...n.querySelectorAll("*")]){let i=o.localName.includes("-");if(!Tt(o)||!(i||o.hasAttribute("is")))continue;let r=e.createElement(i?"span":o.localName);for(let s of o.attributes)s.name!=="is"&&r.setAttribute(s.name,s.value);r.append(...o.childNodes),o===n?n=r:o.replaceWith(r)}return n}function $n(t,e){try{let n=new t.ownerDocument.defaultView.CSSStyleSheet;n.replaceSync(e),t.adoptedStyleSheets=[n]}catch{let n=t.ownerDocument.createElement("style");n.textContent=e,t.appendChild(n)}}function tl(t,e,n,o,i,r){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),l=i>0&&a.width>0?a.width/i:1,u=r>0&&a.height>0?a.height/r:1;if(Math.abs(l-u)>.02)return 0;let c=s.createElement("div");Q(c),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=c.attachShadow({mode:"open"});$n(f,n);let d=Kr(e);f.appendChild(d),s.body.appendChild(c);let h=0,m=["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],g=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],p=(y,b,w)=>{let C=D(y),S=C.boxSizing==="border-box",v=(M,F,T)=>{let A=parseFloat(M);if(!Number.isFinite(A))return F;let x=0;if(!S)for(let E of T)x+=parseFloat(C[E])||0;let _=A+x;return Math.abs(_-F)<=.51?_:F};return{width:v(C.width,b,m),height:v(C.height,w,g)}};try{let y=d.getBoundingClientRect(),b=d.offsetWidth||i,w=d.offsetHeight||r,C=b>0&&y.width>0?y.width/b:1,S=w>0&&y.height>0?y.height/w:1,v=(M,F,T=!1)=>{let A=M.children,x=F.children,_=Math.min(A.length,x.length);for(let E=0;E<_;E++){let $=A[E],R=x[E],W=o.get($),k=T||qr.has($);if(W?.nodeType===1&&Tt($)&&$.style&&W.isConnected){let I=W.getBoundingClientRect();if(I.width>0&&I.height>0){let L=R.getBoundingClientRect(),P=I.width/l,N=I.height/u,B=L.width,U=L.height,V=W.offsetWidth||P,z=W.offsetHeight||N,at=R.offsetWidth||B,rt=R.offsetHeight||U,pt=Math.abs(P-V)>Je||Math.abs(N-z)>Je||Math.abs(B-at)>Je||Math.abs(U-rt)>Je;if(k){let lt=p(R,at,rt);P=B>0?P*C*lt.width/B:P,N=U>0?N*S*lt.height/U:N,B=lt.width,U=lt.height}else if(pt){let lt=p(W,V,z),Yt=p(R,at,rt);P=lt.width,N=lt.height,B=Yt.width,U=Yt.height}let kt=B-P,he=U-N;(Math.abs(kt)>Je||Math.abs(he)>Je)&&($.style.boxSizing="border-box",$.style.width=`${H(P)}px`,$.style.height=`${H(N)}px`,h++)}}v($,R,k)}};v(e,d)}finally{c.remove()}return h}function Gr(t,e=new Set){let n="";if(!t)return n;for(let o=0;o`${a*f/100}px`),u=parseFloat(r==="x"?n.width:n.height);e.style.setProperty(i,Number.isFinite(u)?`${i.slice(0,3)}(${l}, ${u}px)`:l)}}function rp(t,e){let n=t.ownerDocument,o=n.documentElement,i={w:o.clientWidth,h:o.clientHeight};if(e.position==="fixed")return i;if(e.position==="absolute"){let l=t.offsetParent;return!l||(l===n.body||l===o)&&getComputedStyle(l).position==="static"?i:{w:l.clientWidth,h:l.clientHeight}}let r=t.parentElement;if(!r)return i;let s=getComputedStyle(r),a=l=>parseFloat(s.getPropertyValue(l))||0;return{w:r.clientWidth-a("padding-left")-a("padding-right"),h:r.clientHeight-a("padding-top")-a("padding-bottom")}}var qr,Ud,jd,Gd,Ga,qd,Yd,H,Je,tp,qa,op,ke=ot(()=>{"use strict";_t();Mt();Rt();At();Fn();qr=new WeakSet;Ud=/(?:^|;)position:(absolute|fixed)(?:;|$)/;jd=new Set(["xml","xlink"]);Gd=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,Ga=t=>t.replace(Gd,e=>e.length===2?e:""),qd=/^data:[^,]{0,120};base64,/;Yd=new Set(["img","canvas","video","iframe","object","embed"]);H=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;Je=.75;tp=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;qa=new WeakMap;op=[["max-width","x"],["min-width","x"],["max-height","y"],["min-height","y"]]});var Al={};oe(Al,{detectDrawApi:()=>Ml,tryCanvasEngine:()=>ih});function Ml(){try{let t=document.createElement("canvas").getContext("2d");if(t&&typeof t.drawElementImage=="function")return"drawElementImage"}catch{}return null}function rh(t,e,n,o){let i=document.createElement("canvas");i.setAttribute("layoutsubtree",""),i.setAttribute("content","drawable"),Q(i),i.style.cssText="position:fixed;top:0;left:0;z-index:-2147483647;pointer-events:none";let r=document.createElement("div");r.setAttribute("drawable",""),r.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${n}px;height:${o}px`;let s=r.attachShadow({mode:"open"});return $n(s,e),s.appendChild(t),i.appendChild(r),{canvas:i,wrapper:r}}async function ih(t,e){let n=Ml();if(!n)return null;let o=t.element,i=t.clone;if(!o||!i)return null;let r=o.ownerDocument||document;if(!o.isConnected||r!==document||o===r.body||o===r.documentElement||o.scrollTop||o.scrollLeft||e.outerShadows||e.clip||e.excludeMode==="remove"||typeof e.filter=="function"&&e.filterMode==="remove"||e.width!=null||e.height!=null)return null;try{for(let S=o;S;S=S.assignedSlot||S.parentElement||S.getRootNode?.().host){let v=getComputedStyle(S);if(v.transform&&v.transform!=="none"||v.rotate&&v.rotate!=="none"||v.scale&&v.scale!=="none"||v.translate&&v.translate!=="none"||S===o&&v.filter&&v.filter!=="none")return null;let M=v.getPropertyValue("zoom");if(M&&Number.isFinite(parseFloat(M))&&Math.abs(parseFloat(M)-1)>1e-4)return null}}catch{return null}let s=o.getBoundingClientRect(),a=Math.max(1,s.width||o.offsetWidth||1),l=Math.max(1,s.height||o.offsetHeight||1),u=o.offsetWidth||Math.ceil(a),c=o.offsetHeight||Math.ceil(l),f=Number.isFinite(e.scale)&&e.scale>0?e.scale:1,d=Number.isFinite(e.dpr)&&e.dpr>0?e.dpr:window.devicePixelRatio||1,h=Math.max(1,Math.round(u*f*d)),m=Math.max(1,Math.round(c*f*d)),g=(t.scrollbarCSS||"")+(t.baseCSS||"")+(t.fontsCSS||"")+(t.classCSS||""),{canvas:p,wrapper:y}=rh(i,g,a,l);p.width=h,p.height=m,document.body.appendChild(p);let b;try{p.getBoundingClientRect(),await new Promise(T=>{requestAnimationFrame(()=>setTimeout(T,0)),setTimeout(T,50)});let S=p.getContext("2d"),v=S&&S[n];if(typeof v!="function")return null;S.save(),S.scale(d*f,d*f),v.call(S,y,0,0,a,l),S.restore();let M;try{M=S.getImageData(0,0,Math.min(64,h),Math.min(64,m)).data}catch{return O(e,`html-in-canvas: ${n} tainted the canvas; used the SVG engine.`),null}let F=!1;for(let T=3;T0){F=!0;break}if(!F){let T=S.getImageData(0,0,h,m).data,A=!1;for(let x=3;x0){A=!0;break}if(!A)return null}b=document.createElement("canvas"),b.width=h,b.height=m,b.getContext("2d").drawImage(p,0,0),b.style.width=`${u*f}px`,b.style.height=`${c*f}px`}catch(S){return O(e,"html-in-canvas: the browser couldn't paint it; used the SVG engine.",S),null}finally{try{p.remove()}catch{}}let w=Object.freeze({w0:a,h0:l,vbW:u,vbH:c,targetW:a,targetH:l,contentX:0,contentY:0,clip:null});Object.defineProperty(e,"meta",{value:w,enumerable:!0,writable:!1,configurable:!0}),e.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},t.clone=t.nodeMap=t.styleCache=t.svgString=null;let C=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);return C&&C.style.position==="absolute"&&C.remove(),b}var El=ot(()=>{"use strict";wt();At();ke()});var sc={};oe(sc,{MAX_RASTER_AREA:()=>pe,MAX_RASTER_SIDE:()=>jt,WEBP_MAX_SIDE:()=>Ci,__setDecodeFrameIdleMs:()=>zh,cropSvgText:()=>Go,decodeSvgFromDataURL:()=>Ee,encodeSvgToDataURL:()=>_e,fixSafariShadows:()=>Xo,peekSvgHeader:()=>qo,toCanvas:()=>Zt});function Fh(t,e){let n=e.__session;try{let o=t.match(/]*>/i);if(!o)return t;let i=o[0],r=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),s=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(r)||!Number.isFinite(s)||r<=0||s<=0)return t;let a=Math.min(1,jt/r,jt/s,Math.sqrt(pe/(r*s)));if(a>=1)return t;let l=Math.max(1,Math.floor(r*a)),u=Math.max(1,Math.floor(s*a));return et(n,"raster-clamp",`capture ${Math.round(r)}x${Math.round(s)}px exceeds decode limits; downscaled to ${l}x${u}px`),O(e,`${Math.round(r)}\xD7${Math.round(s)}px is too large for the browser to draw; scaled down to ${l}\xD7${u}px. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),t.replace(i,i.replace(/(\bwidth=")[\d.]+/i,`$1${l}`).replace(/(\bheight=")[\d.]+/i,`$1${u}`))}catch{return t}}function Go(t,e,{shiftContent:n=Y()}={}){let o=["x","y","width","height"].map(T=>Number(e?.[T]));if(!o.every(Number.isFinite)||o[2]<=0||o[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let i=t.match(/]*>/i);if(!i)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let r=i[0],s=(r.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(s||"").trim().split(/[\s,]+/).map(Number);if(a.length!==4||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[l,u,c,f]=a,d=Math.max(l,o[0]),h=Math.max(u,o[1]),m=Math.min(l+c,o[0]+o[2]),g=Math.min(u+f,o[1]+o[3]);if(!(m>d)||!(g>h))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let p=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),y=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]),b=Number.isFinite(p)&&p>0?p/c:1,w=Number.isFinite(y)&&y>0?y/f:1,C=Math.max(1,(m-d)*b),S=Math.max(1,(g-h)*w),v=r.replace(/(\bwidth=")[^"]*/i,`$1${C}`).replace(/(\bheight=")[^"]*/i,`$1${S}`),M=n?Th(t,r,d,h):null;if(M)return v.replace(/(\bviewBox=")[^"]*/i,(A,x)=>`${x}0 0 ${m-d} ${g-h}`)+M.slice(r.length);let F=v.replace(/(\bviewBox=")[^"]*/i,`$1${d} ${h} ${m-d} ${g-h}`);return t.replace(r,F)}function Th(t,e,n,o){if(!t.startsWith(e))return null;let i=/^\s*]*>/i.exec(t.slice(e.length,e.length+2048));if(!i)return null;let r=i[0],s=(u,c,f)=>{let d=new RegExp(`(\\s${c}=")([^"]*)`),h=u.match(d),m=h?parseFloat(h[2]):0;return Number.isFinite(m)?h?u.replace(d,(g,p)=>`${p}${m-f}`):u.replace(/^(\s*`${p} ${c}="${-f}"`):null},a=s(r,"x",n),l=a&&s(a,"y",o);return l?e+l+t.slice(e.length+r.length):null}function wi(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function Ee(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function qo(t){let e=t.indexOf(",");if(e<0)return"";let n=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}function _e(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function nc(t){let e=[],n="",o=0;for(let i=0;ii.trim()).filter(Boolean)}function $h(t){let e=[],n="",o=0;for(let r=0;r`${a}:${l}`).join(";")}function Ph(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${oc(o)}}`)}function Nh(t){return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Ph(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${oc(o)}${n}`),t}function Lh(){return Uo||(Uo=(async()=>{try{let t='
',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let o=n.getContext("2d",{willReadFrequently:!0});o.drawImage(e,0,0);let i=o.getImageData(2,18,1,1).data[3]>128,r=o.getImageData(2,2,1,1).data[3]>128;return{native:i||r,flippedY:r&&!i}}catch{return{native:!1,flippedY:!1}}})(),Uo)}function Ih(t){let e=[],n=0,o=0;for(let i=0;i{let r=0,s=0,a="",l=0;for(;lnc(o).map(i=>{let r=i.indexOf(":");if(r<0)return i;let s=i.slice(0,r).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Ih(i.slice(r+1))}`:i}).join(";");return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(o,i)=>o.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(r,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(o,i,r)=>`style=${i}${n(r)}${i}`),t}async function Xo(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await Lh();try{let i=t;return n||(i=Nh(i)),o&&(i=Wh(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Oh(t,e,n){let o=t.naturalWidth,i=t.naturalHeight,r=Math.min(8,i),s=document.createElement("canvas");s.width=Math.max(1,Math.ceil(o*e)),s.height=Math.max(1,Math.ceil(r*6*n));let a=s.getContext("2d",{willReadFrequently:!0});return!a||!(o>0&&i>0)?null:()=>{a.clearRect(0,0,s.width,s.height);for(let f=0;f<6;f++){let d=Math.floor((i-r)*f/5);a.drawImage(t,0,d,o,r,0,f*r*n,o*e,r*n)}let l=a.getImageData(0,0,s.width,s.height).data,u=!1,c=0;for(let f=3;f0&&(u=!0),c=c*31+l[f-3]+l[f-2]*7+l[f-1]*13+l[f]|0;return{ink:u,sig:c}}}async function Dh(t,e,n){Q(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await Ho(),await Ho(),!1;let o=performance.now()+(e?600:150),i=null;for(;;){let r;try{r=n()}catch{return!1}if(r.ink&&(!e||r.sig===i))return!0;if(i=r.sig,performance.now()>o)return r.ink;await Ho()}}finally{try{t.remove()}catch{}}}function Vo(){clearTimeout(ki),de?.remove(),de=null,jo=0}function zh(t){ic=t??rc}function tc(t){if(typeof document>"u"||!document.body)return new Image;if(clearTimeout(ki),de&&!de.contentDocument&&Vo(),de&&jo>Bh&&In===0&&Vo(),!de){let n=document.createElement("iframe");Q(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)de=n,jo=0;else{try{n.remove()}catch{}return new Image}}jo+=t.length,In+=1;let e=de.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function Si(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,In=Math.max(0,In-1),e&&(xi=!0),!(In>0)&&(xi?(xi=!1,Vo()):ki=setTimeout(Vo,ic)))}function ec(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Gh(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),o=0,i=0;for(let r=e;r+48<=t.length;r+=n){let s=t.slice(r,r+48);o++,Vh.some(a=>s.includes(a))||i++}return i*2>o}function vi(t,e,n,o,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,o);return}let r=n*o,s=r>Uh&&!Gh(i)?Math.min(jh,Math.ceil(r/Hh)):1;if(s===1){t.drawImage(e,0,0,n,o);return}let a=e.naturalWidth,l=e.naturalHeight/o;for(let u=0;u]*>/i)||[])[0]||"",g=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(g)&&Number.isFinite(p)&&g>0&&p>0&&Math.min(1,jt/g,jt/p,Math.sqrt(pe/(g*p)))<1;if(l||y||Y())try{let b=Ee(t);if(l&&(b=Go(b,l)),Y()){let w=await Xo(b);b=w.svg,f=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||l)&&(b=Fh(b,e)),c=_e(b)}catch(b){if(l)throw b;c=t}}let h=u||tc(c);try{u||await ec(h,c)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let g=h;h=tc(c),Si(g);try{await ec(h,c)}catch(p){throw Si(h,e.__releaseDecodeFrame),p}}try{!u&&!Y()&&wi(c)&&(Et()?/.data(?:%3A|:)image(?:%2F|\/)svg/i:/(?:%40|@)font-face/i).test(c)&&await new Promise(N=>{let B=new MessageChannel;B.port1.onmessage=()=>{B.port1.close(),B.port2.close(),N()},B.port2.postMessage(0)});let m=u?u.width:h.naturalWidth,g=u?u.height:h.naturalHeight,p=l?m:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:m,y=l?g:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:g,b,w,C=Number.isFinite(n),S=Number.isFinite(o);if(C&&S)b=Math.max(1,n),w=Math.max(1,o);else if(C){let N=n/Math.max(1,p);b=n,w=y*N}else if(S){let N=o/Math.max(1,y);w=o,b=p*N}else{let N=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);b=N?s.vbW:m,w=N?s.vbH:g}!C&&!S&&(b=b*i,w=w*i);let v=b*r,M=w*r,F=Math.max(v/jt,M/jt,Math.sqrt(v*M/pe)),T=e.__encodeFormat==="webp"?Math.max(v,M)/Ci:0,A=Math.max(F,T);if(A>1){let N=F<=1;et(e.__session,"canvas-clamp",`output ${Math.round(v)}x${Math.round(M)}px exceeds ${N?"WebP":"canvas"} limits; downscaled`),O(e,N?`${Math.round(v)}\xD7${Math.round(M)}px is larger than WebP can encode (${Ci}px per side); scaled down. For full size, export a PNG, an SVG, or crop.`:`${Math.round(v)}\xD7${Math.round(M)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),b/=A,w/=A}let x=Tt(e.canvas)&&ct(e.canvas,"canvas")?e.canvas:document.createElement("canvas");x.width=Math.max(1,b*r),x.height=Math.max(1,w*r),x.style.width=`${b}px`,x.style.height=`${w}px`;let _=x.getContext("2d");if(!_)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let E=null,$=e.__layoutZoom||1;if(!u&&Et()){let N=$*p/(b*r),B=Math.round(b*r*N),U=Math.round(w*r*N);N>1.01&&B<=jt&&U<=jt&&B*U<=pe&&(E={w:B,h:U})}let R=f&&(Math.round(b*r)!==m||Math.round(w*r)!==g),W=R?m:E?E.w:b*r,k=R?g:E?E.h:w*r,I=Y()&&!u?Oh(h,W/Math.max(1,m),k/Math.max(1,g)):null,L=!1;I&&(L=await Dh(h,d,I));let P=()=>{if(_.save(),r!==1&&_.scale(r,r),a&&(_.save(),_.fillStyle=a,_.fillRect(0,0,b,w),_.restore()),R){let N=document.createElement("canvas");N.width=m,N.height=g,vi(N.getContext("2d"),h,m,g,c),_.drawImage(N,0,0,b,w)}else{if(_.save(),_.setTransform(1,0,0,1,0,0),E){let N=document.createElement("canvas");for(N.width=E.w,N.height=E.h,vi(N.getContext("2d"),h,E.w,E.h,c);N.width>b*r*2;){let B=document.createElement("canvas");B.width=Math.ceil(N.width/2),B.height=Math.ceil(N.height/2),B.getContext("2d").drawImage(N,0,0,B.width,B.height),N=B}_.imageSmoothingQuality="high",_.drawImage(N,0,0,b*r,w*r)}else vi(_,h,b*r,w*r,c);_.restore()}_.restore()};if(P(),I&&L&&d){let N=!0;try{N=I().ink}catch{}if(!N){let B=performance.now()+600;do{await Ho();try{N=I().ink}catch{break}}while(!N&&performance.now(){"use strict";yt();wt();$t();At();jt=Y()?16384:32767,pe=16384*16384,Ci=16383;Uo=null;Ho=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Bh=24*1024*1024,rc=5e3,de=null,jo=0,In=0,xi=!1,ic=rc,ki=0;Uh=4e6,Hh=2e6,jh=8,Vh=["%3C","%3E","%20","%7B","%7D","%3B"]});var Wn={};oe(Wn,{rasterize:()=>Mi});async function Mi(t,e){let n=await Zt(t,{...e,__encodeFormat:e.format}),r=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let l=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return l();let c=new FileReader;c.onload=()=>a(String(c.result||"")),c.onerror=l,c.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{l()}}),s=new Image;return s.src=r,Y()?await s.decode():await new Promise((a,l)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=l}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var an=ot(()=>{"use strict";Re();yt()});var Ai={};oe(Ai,{toImg:()=>qh,toSvg:()=>qh});async function qh(t,e){let{scale:n=1,width:o,height:i,meta:r={}}=e,s=Number.isFinite(o),a=Number.isFinite(i),l=Number.isFinite(n)&&n!==1||s||a;if(Y()&&l)try{let{svg:d}=await Xo(Ee(t)),h=(d.match(/]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(g))throw new Error("The SVG has no size.");let p=Number.isFinite(r.vbW)?r.vbW:Number.isFinite(r.w0)?r.w0:m,y=Number.isFinite(r.vbH)?r.vbH:Number.isFinite(r.h0)?r.h0:g,b,w;s&&a?(b=o,w=i):s?(b=o,w=Math.max(1,Math.round(y*(o/Math.max(1,p))))):a?(w=i,b=Math.max(1,Math.round(p*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(g*n)));let C=d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),S=new Image;return S.decoding="sync",S.loading="eager",S.src=_e(C),await S.decode(),S.style.width=`${b}px`,S.style.height=`${w}px`,S}catch(d){return et(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),O(e,"Safari couldn't show the SVG; used a PNG.",d),Mi(t,{...e,format:"png",quality:1,meta:r})}let u=t,c=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=Ee(t),h=(d.match(/]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),g=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&g>0){let p=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(g*n))}"`);u=_e(d.replace(h,p)),c=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(d){if(!c)throw d;f.src=t,c=!1,await f.decode()}if(s&&a)f.style.width=`${o}px`,f.style.height=`${i}px`;else if(s){let d=Number.isFinite(r.vbW)?r.vbW:Number.isFinite(r.w0)?r.w0:f.naturalWidth,h=Number.isFinite(r.vbH)?r.vbH:Number.isFinite(r.h0)?r.h0:f.naturalHeight,m=o/Math.max(1,d);f.style.width=`${o}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(r.vbW)?r.vbW:Number.isFinite(r.w0)?r.w0:f.naturalWidth,h=Number.isFinite(r.vbH)?r.vbH:Number.isFinite(r.h0)?r.h0:f.naturalHeight,m=i/Math.max(1,h);f.style.height=`${i}px`,f.style.width=`${Math.max(1,Math.round(d*m))}px`}else{let d=Math.max(1,Math.round(f.naturalWidth*(c?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(c?1:n)));if(f.style.width=`${d}px`,f.style.height=`${h}px`,!c&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let g=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,await f.decode()}catch(m){O(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var Ei=ot(()=>{"use strict";_t();wt();an();Re()});var lc={};oe(lc,{encodePng:()=>Xh});function Yo(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),o=new DataView(n.buffer);o.setUint32(0,e.length);for(let r=0;r<4;r++)n[r+4]=t.charCodeAt(r);n.set(e,8);let i=4294967295;for(let r=4;r>>8;return o.setUint32(n.length-4,(i^4294967295)>>>0),n}async function Xh(t,e,n){if(![t,e].every(g=>Number.isInteger(g)&&g>0&&g<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let o=new Uint8Array(13),i=new DataView(o.buffer);i.setUint32(0,t),i.setUint32(4,e),o[8]=8,o[9]=6;let r=[new Uint8Array([137,80,78,71,13,10,26,10]),Yo("IHDR",o),Yo("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),l=new Uint8Array(s),u=0,c=new CompressionStream("deflate"),f=c.writable.getWriter(),d=c.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:g,value:p}=await d.read();if(g)return;r.push(Yo("IDAT",p))}}catch(g){h=g,await f.abort(g).catch(()=>{})}})();try{for await(let g of n){if(!(g instanceof Uint8Array||g instanceof Uint8ClampedArray)||!g.length||g.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let p=g.length/s;if(u+p>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y{"use strict";ac=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;ac[t]=e}});var yc={};oe(yc,{encodeJpeg:()=>Qh});function dc(t){let e=[0,240];for(let n=0;n<16;n++)for(let o=1;o<=10;o++)e.push(n<<4|o);return t.concat(e.filter(n=>!t.includes(n)).sort((n,o)=>n-o))}function Jh(t){for(let e=0;e<64;e+=8)mc(t,e,1);for(let e=0;e<8;e++)mc(t,e,8)}function mc(t,e,n){let o=t[e]+t[e+7*n],i=t[e]-t[e+7*n],r=t[e+n]+t[e+6*n],s=t[e+n]-t[e+6*n],a=t[e+2*n]+t[e+5*n],l=t[e+2*n]-t[e+5*n],u=t[e+3*n]+t[e+4*n],c=t[e+3*n]-t[e+4*n],f=o+u,d=o-u,h=r+a,m=r-a;t[e]=f+h,t[e+4*n]=f-h;let g=(m+d)*.707106781;t[e+2*n]=d+g,t[e+6*n]=d-g,f=c+l,h=l+s,m=s+i;let p=(f-m)*.382683433,y=.5411961*f+p,b=1.306562965*m+p,w=h*.707106781,C=i+w,S=i-w;t[e+5*n]=S+y,t[e+3*n]=S-y,t[e+n]=C+b,t[e+7*n]=C-b}async function Qh(t,e,n,o){if(![t,e].every(R=>Number.isInteger(R)&&R>0&&R<=65535))throw new RangeError("[SnapDOM] JPEG dimensions must be integers from 1 to 65535");let i=Math.min(100,Math.max(1,Math.round((typeof o=="number"&&o>=0&&o<=1?o:.92)*100))),r=i<50?5e3/i:200-i*2,s=i<90?1:0,a=8<{let k=new Uint8Array(64),I=new Float32Array(64);for(let L=0;L<64;L++){let P=Math.min(255,Math.max(1,Math.floor((R[L]*r+50)/100)));k[fc[L]]=P,I[L]=1/(P*uc[L>>3]*uc[L&7]*8)}return l.push(...W?[1]:[],...k),I}),c=(R,W)=>[255,R,W.length+2>>8,W.length+2&255,...W],f=[255,216,...c(224,[74,70,73,70,0,1,1,0,0,1,0,1,0,0]),...c(219,l),...c(192,[8,e>>8,e&255,t>>8,t&255,3,1,s?34:17,0,2,17,1,3,17,1]),...c(196,gc.flatMap(([R,,W,k])=>[R,...W,...k])),...c(218,[3,1,0,2,17,3,17,0,63,0])],d=[new Uint8Array(f)],h=new Uint8Array(65536),m=0,g=0,p=0;function y(R,W){for(g=g<=8;){p-=8;let k=g>>>p&255;m>=h.length-1&&(d.push(h.subarray(0,m)),h=new Uint8Array(65536),m=0),h[m++]=k,k===255&&(h[m++]=0)}g&=(1<15;B-=16)y(L[240][0],L[240][1]);N=32-Math.clz32(Math.abs(P));let V=L[B<<4|N];y(V[0],V[1]),y((P<0?P-1:P)&(1<>s)*8+(L>>s);T[V]+=(-.168736*N-.331264*B+.5*U)*x,A[V]+=(.5*N-.418688*B-.081312*U)*x}}for(let k=0;k<(s?4:1);k++){let I=(k>>1)*128+(k&1)*8;for(let L=0;L<64;L++)b[L]=F[I+(L>>3)*a+(L&7)];S(0,0)}b.set(T),S(1,1),b.set(A),S(2,1)}}let E=0,$=0;for await(let R of n){if(!(R instanceof Uint8Array||R instanceof Uint8ClampedArray)||!R.length||R.length%v)throw new RangeError("[SnapDOM] JPEG input must contain complete RGBA rows");let W=R.length/v;if(E+W>e)throw new RangeError("[SnapDOM] JPEG input exceeds the declared height");for(let k=0;k{"use strict";fc=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],Yh=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Kh=Array.from({length:64},(t,e)=>(e&7)<4&&e<32?[17,18,24,47,18,21,26,66,24,26,56,99,47,66,99,99][(e>>3)*4+(e&7)]:99),uc=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];pc=[0,1,2,3,4,5,6,7,8,9,10,11],gc=[[0,0,[0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],pc],[16,0,[0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],dc([1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130])],[1,1,[0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],pc],[17,1,[0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],dc([0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241])]],hc=gc.map(([,,t,e])=>{let n=[],o=0,i=0;for(let r=1;r<=16;r++,o<<=1)for(let s=0;s]*>/i)?.[0];if(!o)return null;let i=e.crop?Go(o,e.crop):o,r=parseFloat(i.match(/\bwidth="([^"]+)/i)?.[1]),s=parseFloat(i.match(/\bheight="([^"]+)/i)?.[1]),a=(i.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(r>0&&s>0)||a.length!==4||!a.every(Number.isFinite)||!(a[2]>0&&a[3]>0))return null;let l=Number.isFinite(e.width),u=Number.isFinite(e.height),c=e.meta||{},f=Math.max(1,Math.floor(r)),d=Math.max(1,Math.floor(s)),h=e.crop?f:Number.isFinite(c.vbW)?c.vbW:Number.isFinite(c.w0)?c.w0:f,m=e.crop?d:Number.isFinite(c.vbH)?c.vbH:Number.isFinite(c.h0)?c.h0:d,g=e.dpr??1,p=e.scale??1,y=(l&&u?Math.max(1,e.width):l?e.width:u?e.height*h/Math.max(1,m):f*p)*g,b=(l&&u?Math.max(1,e.height):u?e.height:l?e.width*m/Math.max(1,h):d*p)*g;if(Math.max(r,s,y,b)<=jt&&r*s<=pe&&y*b<=pe||(n==="png"?typeof CompressionStream!="function":Math.max(y,b)>=65536))return null;return w();async function w(){let C=Math.max(1,Math.floor(y)),S=Math.max(1,Math.floor(b)),v=Ee(t),M=v.slice(v.indexOf(o)+o.length,v.lastIndexOf("")),F=i.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",T=r/a[2],A=s/a[3],x=0,_=0;/\bnone\b/.test(F)||(T=A=/\bslice\b/.test(F)?Math.max(T,A):Math.min(T,A),x=(r-a[2]*T)*(/xMin/.test(F)?0:/xMax/.test(F)?1:.5),_=(s-a[3]*A)*(/YMin/.test(F)?0:/YMax/.test(F)?1:.5)),x-=a[0]*T,_-=a[1]*A;let E=i.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),$=Y()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(v),R=r/y,W=s/b,k=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/C),$?Math.floor(2046/W):8192)),I=Math.max(1,Math.min(8192,C,$?Math.floor(2046/R):8192));async function*L(){for(let P=0;P${M}`,X=await Zt(_e(q),{width:rt,height:pt,dpr:1,backgroundColor:$?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),G=X;try{if($){G=document.createElement("canvas"),G.width=V,G.height=N;let nt=G.getContext("2d");e.backgroundColor&&(nt.fillStyle=e.backgroundColor,nt.fillRect(0,0,V,N)),nt.drawImage(X,U*R-z,P*W-at,V*R,N*W,0,0,V,N)}let ht=G.getContext("2d").getImageData(0,0,V,N).data;for(let nt=0;nt(cc(),lc))).encodePng(C,S,L()):(await Promise.resolve().then(()=>(bc(),yc))).encodeJpeg(C,S,L(),e.quality)}}var _i=ot(()=>{"use strict";Re();yt()});var wc={};oe(wc,{toBlob:()=>Ri});async function Ri(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.");let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=n==="jpg"?"jpeg":n,i=(o==="png"||o==="jpeg")&&Ko(t,e,o);if(i)return i;let r=await Zt(t,{...e,__encodeFormat:o});return new Promise(s=>r.toBlob(a=>s(a),`image/${o}`,e.quality))}var Fi=ot(()=>{"use strict";Re();_i()});var Sc={};oe(Sc,{download:()=>Zh});async function xc(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(o){if(o.name!=="AbortError")return!1}return!0}async function Zh(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),o=(e?.type||"").toLowerCase(),i=n.has(o)?o:"",r=(e?.format||i||"").toLowerCase(),s=r==="jpg"?"jpeg":r||"png",a=e?.filename||"snapdom",l=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let c=gn(),f=(s==="png"||s==="jpeg")&&Ko(t,u,s);if(s==="svg"||f){let m=f?await f:await Ri(t,{...u,type:"svg"});if(c&&await xc(m,l))return;let g=URL.createObjectURL(m),p=document.createElement("a");p.href=g,p.download=l,document.body.appendChild(p),p.click(),setTimeout(()=>URL.revokeObjectURL(g),1e3),p.remove();return}let d=await Zt(t,{...u,__encodeFormat:s});if(c){let m=`image/${s}`,g=await new Promise(p=>d.toBlob(p,m,e?.quality));if(g&&await xc(g,l))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=l,document.body.appendChild(h),h.click(),h.remove()}var vc=ot(()=>{"use strict";Fi();Re();_i();yt()});_t();Rt();Oe();Rt();var eu=new Set(["symbol","defs"]),nu=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Mr=new WeakMap,Ts=-1;function Qn(t){let e=xe();return e!==Ts&&(Mr=new WeakMap,Ts=e),$s(t)}function $s(t){let e=Mr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(nu.has(t.localName)?n=!1:eu.has(t.localName)&&(n=!0)),n===void 0){let o=t.parentNode;n=!!(o&&o.nodeType===1)&&$s(o)}return Mr.set(t,n),n}function Ps(t,e){if(t?.nodeType!==1||e?.nodeType!==1||Qn(t))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let r=t.attributes;for(let s=0;sr.d-s.d);let i=window.devicePixelRatio||1;return(o.find(r=>r.d>=i)||o[o.length-1]).url}function Ns(t,e){let n=t.currentSrc||"";if(n&&!je(n))return n;let o=e.querySelectorAll("source[srcset]"),i=null;for(let r of o){let s=r.getAttribute("srcset");if(!s||je(s))continue;let a=r.getAttribute("type");if(a&&!tr.test(a.trim()))continue;let l=r.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return Ve(s,t)}catch{}i||(i=Ve(s,t))}return i}function Ls(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let o of e)if(o&&!je(o))return o;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let o=n.split(",")[0].trim().split(/\s+/)[0];if(o&&!je(o))return o}return null}At();yt();function ou(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var ru=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,iu=/^::?(?:before|after|first-letter)$/;function su(t,e,n=!0,o){return Un(t,",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let r=i.match(ru);if(r&&iu.test(r[0]))return":not(*)";let s=r?i.slice(0,r.index).trim():i,a=n?ou(s,o):s;return`:where(${e} ${a})${r?r[0]:""}`}).join(", ")}function Ds(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(o,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(o,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(o,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(o,i,r,s)=>{let a=su(s,e,!0,n);return`${i}${r}${a}{`}),t):""}function Bs(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function ve(t){let e="";for(let n of t)if(n.media&&n.cssRules){let o=!1;try{o=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}o&&(e+=ve(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${ve(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let o=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=o+(n.style?n.style.cssText:"")+ve(n.cssRules)+"}"}else e+=n.cssText+` -`;return e}function zs(t){let e="";try{t.querySelectorAll("style").forEach(o=>{let i=null;try{i=o.sheet&&o.sheet.cssRules}catch{}e+=(i?ve(i):o.textContent||"")+` -`});let n=t.adoptedStyleSheets||[];for(let o of n)try{o&&o.cssRules&&(e+=ve(o.cssRules))}catch{}}catch{}return e}function Us(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Hs(t,e,n={}){try{let o=null,i=D(t).content;if(i&&i.includes("url(")){let u=i.match(/url\(["']?([^"')]+)["']?\)/);u&&(o=u[1])}let r=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",l=o||(r?Ns(t,r):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Ve(a,t)||t.src||"";if((!l||je(l))&&n.resolvePicturePlaceholders!==!1){let u=Ls(t);u&&(l=u)}if(!l)return;e.getAttribute("src")!==l&&e.setAttribute("src",l),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function js(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function au(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function Vs(t,e,n){let o=[];for(let i of e){let r=au(t,i);r&&o.push(`${i}: ${r};`)}return o.length?`${n}{${o.join("")}} -`:""}function Gs(t,e){if(!t)return;let n=o=>{let i=o.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||o.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):o.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function lu(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),i=0;for(;isetTimeout(r,0)),o=n(),i++;return o&&(o.body||o.documentElement)?o:null}function cu(t){let e=t.getBoundingClientRect(),n=0,o=0,i=0,r=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,o=parseFloat(l.borderRightWidth)||0,i=parseFloat(l.borderTopWidth)||0,r=parseFloat(l.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+o))),a=Math.max(0,Math.round(e.height-(i+r)));return{contentWidth:s,contentHeight:a,rect:e}}function Ft(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let o=getComputedStyle(t);if(e===0){let i=parseFloat(o.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(o.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let o=parseFloat(t.getAttribute("width"));!isNaN(o)&&o>0&&(e=o)}if(n===0){let o=parseFloat(t.getAttribute("height"));!isNaN(o)&&o>0&&(n=o)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}var Is=new WeakMap;function fu(t,e,n){let o=t.defaultView,i=o?o.scrollX:0,r=o?o.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,l=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,c=0,f=0,d=0,h=0;try{let p=o&&t.body?o.getComputedStyle(t.body):null;p&&(c=(parseFloat(p.marginTop)||0)+(parseFloat(p.paddingTop)||0),f=(parseFloat(p.marginRight)||0)+(parseFloat(p.paddingRight)||0),d=(parseFloat(p.marginBottom)||0)+(parseFloat(p.paddingBottom)||0),h=(parseFloat(p.marginLeft)||0)+(parseFloat(p.paddingLeft)||0))}catch{}let m=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${f}px ${d}px ${h}px !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,g;try{let p=Is.get(t);p||Is.set(t,p=new o.CSSStyleSheet),p.replaceSync(m),t.adoptedStyleSheets=[...t.adoptedStyleSheets,p],g=()=>{t.adoptedStyleSheets=t.adoptedStyleSheets.filter(y=>y!==p)}}catch{let p=t.createElement("style");p.setAttribute("data-sd-iframe-pin",""),Q(p),p.textContent=m,(t.head||t.documentElement).appendChild(p),g=()=>p.remove()}if(Se(t.documentElement),i||r)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=r),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=r))}catch{}return()=>{try{g()}catch{}try{o&&typeof o.scrollTo=="function"&&o.scrollTo(i,r),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=u)}catch{}Se(t.documentElement)}}async function Ar(t,e,n){let o=await lu(t,3);if(!o)throw new Error("The iframe document isn't ready.");let{contentWidth:i,contentHeight:r,rect:s}=cu(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let l={...n,scale:1,clip:null,__pinned:!0},u=fu(o,i,r),c;try{c=await a.toPng(o.documentElement,l)}finally{u()}c.style.display="block",c.style.width=`${i}px`,c.style.height=`${r}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),xt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(c),f}function qs(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function Xs(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let r=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(r)&&r>0?r:e||o.width||128,l=Number.isFinite(s)&&s>0?s:n||o.height||16,u=Number.parseFloat(t.min)||0,c=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),d=c-u,h=d>0&&Number.isFinite(f)?Math.min(1,Math.max(0,(f-u)/d)):.5,m="middle";try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement","range"),g.style.cssText=`display:inline-block;width:${a}px;height:${l}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",String(a)),p.setAttribute("height",String(l)),p.setAttribute("viewBox",`0 0 ${a} ${l}`),p.style.cssText=`width:${a}px;height:${l}px;overflow:visible`,g.appendChild(p);function y(){let b=qs(i),w=!!t.disabled,C=Math.max(2,Math.min(4,l)),S=(l-C)/2,v=Math.max(10,Math.min(14,Math.max(l,10))),M=v/2,F=M+h*Math.max(0,a-v);p.innerHTML="";let T=(x,_,E,$)=>{let R=document.createElementNS("http://www.w3.org/2000/svg","rect");R.setAttribute("x",String(x)),R.setAttribute("y",String(S)),R.setAttribute("width",String(Math.max(0,_))),R.setAttribute("height",String(C)),R.setAttribute("rx",String(C/2)),R.setAttribute("fill",E),$&&R.setAttribute("fill-opacity",$),p.appendChild(R)};T(0,a,"#808080","0.4"),T(0,F,b);let A=document.createElementNS("http://www.w3.org/2000/svg","circle");A.setAttribute("cx",String(F)),A.setAttribute("cy",String(l/2)),A.setAttribute("r",String(M)),A.setAttribute("fill",b),p.appendChild(A),w&&p.setAttribute("opacity","0.5"),g.style.setProperty("width",`${a}px`,"important"),g.style.setProperty("height",`${l}px`,"important"),g.style.setProperty("min-width",`${a}px`,"important"),g.style.setProperty("min-height",`${l}px`,"important")}return y(),{el:g,applyVisual:y}}function Ys(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let r=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||o.width||0),l=Math.round(n||o.height||0),u=Number.isFinite(r)&&r>0?Math.round(r):Math.max(12,a||16),c=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,l||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,g=Math.max(Math.min(u,c),12),p=Math.max(u,g),y=Math.max(c,g),b="middle";try{i&&i.verticalAlign&&(b=i.verticalAlign)}catch{}let w=document.createElement("div");w.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),w.style.cssText=`display:inline-block;width:${p}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let C=document.createElementNS("http://www.w3.org/2000/svg","svg");C.setAttribute("width",String(p)),C.setAttribute("height",String(y)),C.setAttribute("viewBox",`0 0 ${g} ${g}`),C.style.cssText=`width:${p}px;height:${y}px`,w.appendChild(C);function S(){let v=qs(i),M=2,F=M/2,T=g-M;if(C.innerHTML="",f){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String(F)),A.setAttribute("y",String(F)),A.setAttribute("width",String(T)),A.setAttribute("height",String(T)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",d?v:"none"),A.setAttribute("stroke",v),A.setAttribute("stroke-width",String(M)),C.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",`M ${F+2} ${g/2} L ${g/2-1} ${g-F-2} L ${g-F-2} ${F+2}`),x.setAttribute("stroke","white"),x.setAttribute("stroke-width",String(Math.max(1.5,M))),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round"),C.appendChild(x)}else if(h){let x=document.createElementNS("http://www.w3.org/2000/svg","rect"),_=Math.max(6,T-4);x.setAttribute("x",String((g-_)/2)),x.setAttribute("y",String((g-M)/2)),x.setAttribute("width",String(_)),x.setAttribute("height",String(M)),x.setAttribute("fill",v),x.setAttribute("rx","1"),C.appendChild(x)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(g/2)),A.setAttribute("cy",String(g/2)),A.setAttribute("r",String((g-M)/2)),A.setAttribute("fill",d?v:"none"),A.setAttribute("stroke",v),A.setAttribute("stroke-width",String(M)),C.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","circle"),_=Math.max(2,(g-M*2)*.35);x.setAttribute("cx",String(g/2)),x.setAttribute("cy",String(g/2)),x.setAttribute("r",String(_)),x.setAttribute("fill","white"),C.appendChild(x)}}w.style.setProperty("width",`${p}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${p}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return S(),{el:w,applyVisual:S}}var Cn=new gt(80);async function uu(t){if(j.resource?.has(t))return j.resource.get(t);if(Cn.has(t))return Cn.get(t);let e=(async()=>{let n=await dt(t,{as:"dataURL"});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return j.resource?.set(t,n.data),n.data})();Cn.set(t,e);try{let n=await e;return Cn.set(t,n),n}catch(n){throw Cn.delete(t),n}}var Ws=/\bblob:[^)"'\s]+/g;function Zn(t){return typeof t=="string"&&t.startsWith("blob:")}function du(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function pu(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function kn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function to(t,e=null){if(!t)return;let n=e,o=new Set,i=[],r=new Map,s=(g,p,y,b)=>{o.add(y),i.push(()=>{r.has(y)&&(g.setAttribute(p,r.get(y)),b?.())})},a=(g,p)=>{if(!g||!g.includes("blob:"))return;let y=g.match(Ws)||[];if(y.length){for(let b of y)o.add(b);i.push(()=>{let b=g.replace(Ws,w=>r.get(w)||w);b!==g&&p(b)})}},l=kn(t,"img");for(let g of l)try{let y=g.getAttribute("src")||g.currentSrc||"";Zn(y)&&s(g,"src",y);let b=g.getAttribute("srcset");if(b&&b.includes("blob:")){let w=du(b);for(let C of w)Zn(C.url)&&o.add(C.url);i.push(()=>{let C=!1;for(let S of w)r.has(S.url)&&(S.url=r.get(S.url),C=!0);C&&g.setAttribute("srcset",pu(w))})}}catch(p){O(n,"Couldn't inline a blob: image.",p)}let u=kn(t,"image");for(let g of u)try{let p="http://www.w3.org/1999/xlink",y=g.getAttribute("href")||g.getAttributeNS?.(p,"href");Zn(y)&&s(g,"href",y,()=>g.removeAttributeNS?.(p,"href"))}catch(p){O(n,"Couldn't inline a blob: SVG image.",p)}let c=kn(t,"[style*='blob:']");for(let g of c)try{let p=g.getAttribute("style");a(p,y=>g.setAttribute("style",y))}catch(p){O(n,"Couldn't inline blob: URLs in a style attribute.",p)}let f=kn(t,"style");for(let g of f)try{let p=g.textContent||"";a(p,y=>{g.textContent=y})}catch(p){O(n,"Couldn't inline blob: URLs in a ");if(n===-1)return t;let o=/]*>[\s\S]*?<\/style>/g,i=[],r=n,s;for(o.lastIndex=n;s=o.exec(t);)i.push({text:t.slice(r,s.index),intern:!0}),i.push({text:s[0],intern:!1}),r=o.lastIndex;i.push({text:t.slice(r),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,u;for(let y of i)if(y.intern)for(l.lastIndex=0;u=l.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let f=nh(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],g=(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}"`},p="";for(let y of i)p+=y.intern?y.text.replace(l,g):y.text;return t.slice(0,n)+m.join("")+p}function nh(t,e,n){let o=new Set;if(!e&&!n)return o;if(!t||t.querySelector("[data-sdi]"))return null;let i=l=>{let u=l.getAttribute("style");u&&o.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let l=u=>{for(let c of u){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(i)}c.cssRules&&l(c.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let c=u.textContent||"";if(/@import\b/i.test(c))return null;let f=new CSSStyleSheet;f.replaceSync(c),l(f.cssRules)}}catch{return null}let r=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of o){s.setAttribute("style",l);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&r.add(u[1])}return r}async function Io(t,e){let{clipWindow:n,outerTransforms:o,outerShadows:i,rootTransform2D:r,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:J,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let l,u;vo(t,s),await Qt("beforeRender",t);let c=D(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,H(t.element.offsetWidth||parseFloat(c.width)||f.width||1)),h=Math.max(1,H(t.element.offsetHeight||parseFloat(c.height)||f.height||1)),m=t.element.ownerDocument||document,g=!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned,p=null,y=null,b=0;if(g){let J=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0),it=Math.max(d,H(tt)),ut=t.element===m.body,Vt=ut&&D(m.documentElement).direction==="rtl",St=K=>{K>0&&(Vt?b=Math.max(b,H(K-f.width)):d=Math.max(d,H(K)))};if(ut&&m.documentElement){let K=m.documentElement.getBoundingClientRect(),st={top:Math.max(0,f.top-K.top),right:Math.max(0,K.right-f.right),bottom:Math.max(0,K.bottom-f.bottom),left:Math.max(0,f.left-K.left)};if(p=st,i!=="subtree"&&(st.top||st.right||st.bottom||st.left)){let bt=t.__session?.styleMap,fn=new Map,Bn=new Map;for(let[ne,It]of t.nodeMap){let Wt=bt?.get(ne);if(Wt){let Zo=fn.get(Wt);if(Zo===void 0&&fn.set(Wt,Zo=th.test(Wt)),!Zo)continue}Bn.set(ne,It)}let Gt=jr(t.element,Bn,t.styleCache,f.width>0?d/f.width:1,f.height>0?h/f.height:1);y={top:Math.min(Gt.top,st.top),right:Math.min(Gt.right,st.right),bottom:Math.min(Gt.bottom,st.bottom),left:Math.min(Gt.left,st.left)}}J=Math.max(t.element.scrollHeight||0,nn(J,K.height,f.top-K.top,f.bottom-K.top)),tt=Math.max(t.element.scrollWidth||0,Vt?nn(tt,K.width,K.right-f.right,K.right-f.left):nn(tt,K.width,f.left-K.left,f.right-K.left))}J>0&&(h=Math.max(h,H(J))),St(tt);try{let K=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,st=j.measureHints.get(t.element);if(st&&st.cssLen===K&&st.w0===it&&st.docH===J&&st.docW===tt)st.csh>0&&(h=Math.max(h,H(st.csh))),St(st.csw);else{let bt=m.createElement("div");Q(bt),bt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+it+"px!important;overflow:visible!important;visibility:hidden!important;";let fn=bt.attachShadow({mode:"open"});$n(fn,(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS);let Bn=fn.appendChild(Kr(t.clone));m.body.appendChild(bt);let Gt=bt.scrollHeight,ne=bt.scrollWidth;if(ut){let It=bt.getBoundingClientRect(),Wt=Bn.getBoundingClientRect();Gt=nn(Gt,It.height,Wt.top-It.top,Wt.bottom-It.top),ne=Vt?nn(ne,It.width,It.right-Wt.right,It.right-Wt.left):nn(ne,It.width,Wt.left-It.left,Wt.right-It.left)}m.body.removeChild(bt),j.measureHints.set(t.element,{cssLen:K,w0:it,docH:J,docW:tt,csh:Gt,csw:ne}),Gt>0&&(h=Math.max(h,H(Gt))),St(ne)}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let J=Yr(t.element,t.options),tt=1,it=Yr(t.element,{}),ut=Math.max(2,h*.15);Number.isFinite(it)&&it>=h-ut&&Number.isFinite(J)&&J>0&&(h=Math.max(1,Math.min(h,H(J+tt))))}if(t.options?.reconcile)try{let J=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;tl(t.element,t.clone,J,t.nodeMap,d,h)}catch(J){et(t.options.__session,"reconcile-failed","reconcile pass failed",J),O(t.options,"reconcile couldn't run; captured without it.",J)}let w=(J,tt=NaN)=>{let it=typeof J=="string"?parseFloat(J):J;return Number.isFinite(it)?it:tt},C=w(t.options.width),S=w(t.options.height),v=n?H(n.width):d,M=n?H(n.height):h,F=v,T=M,A=Number.isFinite(C),x=Number.isFinite(S),_=M>0?v/M:1;A&&x?(F=Math.max(1,H(C)),T=Math.max(1,H(S))):A?(F=Math.max(1,H(C)),T=Math.max(1,H(F/(_||1)))):x&&(T=Math.max(1,H(S)),F=Math.max(1,H(T*(_||1))));let E=0,$=0,R=d,W=h;if(n){let J=0,tt=0;if(ii(t.element)){let ut=null;if(!o&&r&&Number.isFinite(r.a))ut={a:r.a,b:r.b||0,c:r.c||0,d:r.d||1,e:0,f:0};else{let Vt=Ce(t.element),St=Xr(c.transform&&c.transform!=="none"?c.transform:"",Vt);St&&St.is2D&&(ut={a:St.a,b:St.b,c:St.c,d:St.d,e:0,f:0})}if(ut&&!(ut.a===1&&ut.b===0&&ut.c===0&&ut.d===1)){let{ox:Vt,oy:St}=Rn(c,d,h),K=Ke(d,h,ut,Vt,St);J=K.minX,tt=K.minY}}let it=Y()?0:(a.dpr||1)*(A||x?F/v:a.scale||1);E=H(it?Math.round((n.x+J)*it)/it:n.x+J),$=H(it?Math.round((n.y+tt)*it)/it:n.y+tt),R=H(E+n.width),W=H($+n.height)}else if(!o&&r&&Number.isFinite(r.a)){let J={a:r.a,b:r.b||0,c:r.c||0,d:r.d||1,e:0,f:0},tt=Ke(d,h,J,0,0);E=H(tt.minX),$=H(tt.minY),R=H(tt.maxX),W=H(tt.maxY)}else if(o&&ii(t.element)){let tt=c.transform&&c.transform!=="none"?c.transform:"",it=Ce(t.element),ut=ue({baseTransform:tt,rotate:it.rotate||"0deg",scale:it.scale,translate:it.translate,width:d,height:h}),{ox:Vt,oy:St}=Rn(c,d,h),K=ut.is2D?ut:new DOMMatrix(ut.toString()),st={a:K.a,b:K.b,c:K.c,d:K.d,e:0,f:0},bt=Ke(d,h,st,Vt,St);E=H(bt.minX),$=H(bt.minY),R=H(bt.maxX),W=H(bt.maxY)}let k=Dr(c),I=Br(c),L=zr(c),P=Ur(c),N=Hr(c),B=f.width>0?(R-E)/f.width:1,U=f.height>0?(W-$)/f.height:1,V=i==="subtree"&&!n?jr(t.element,t.nodeMap,t.styleCache,B,U):{top:0,right:0,bottom:0,left:0};y&&(V={top:y.top,right:Math.max(0,y.right-(d-f.width)),bottom:Math.max(0,y.bottom-(h-f.height)),left:y.left}),b>0&&(V={...V,left:Math.max(V.left,b)});let z=n?{top:0,right:0,bottom:0,left:0}:i?{top:H(Math.max(k.top,I.top,V.top)+L.top+P.top+N.bleed.top),right:H(Math.max(k.right,I.right,V.right)+L.right+P.right+N.bleed.right),bottom:H(Math.max(k.bottom,I.bottom,V.bottom)+L.bottom+P.bottom+N.bleed.bottom),left:H(Math.max(k.left,I.left,V.left)+L.left+P.left+N.bleed.left)}:{top:H(L.top+V.top),right:H(L.right+V.right),bottom:H(L.bottom+V.bottom),left:H(L.left+V.left)};E=H(E-z.left),$=H($-z.top),R=H(R+z.right),W=H(W+z.bottom);let at=Math.max(1,H(R-E)),rt=Math.max(1,H(W-$)),pt="http://www.w3.org/2000/svg",kt=ii(t.element)?2:0,lt=H(kt+(o?0:1)),Yt=a.__subpixel?.x||0,Fe=a.__subpixel?.y||0,q=Math.ceil(at+lt*2+Yt),X=Math.ceil(rt+lt*2+Fe),G=H(-(H(E)-lt)),ht=H(-(H($)-lt)),nt=m.defaultView||window,ft=!Y()&&CSS.supports("zoom","2")?oh(nt):1;a.__layoutZoom=ft;let Te=n&&!Y(),te=Te?H(G-Math.floor(G*ft+.01)/ft):0,$e=Te?H(ht-Math.floor(ht*ft+.01)/ft):0,ee=Math.min(0,G-te)-(te?1/ft:0),ln=Math.min(0,ht-$e)-($e?1/ft:0),Lt=G-te-ee+Yt,Pe=ht-$e-ln+Fe,On=H(q-ee),cn=H(X-ln),mt=document.createElementNS(pt,"foreignObject");mt.setAttribute("x",String(ee*ft)),mt.setAttribute("y",String(ln*ft)),mt.setAttribute("width",String(On*ft)),mt.setAttribute("height",String(cn*ft)),mt.style.overflow="visible";let Pi=document.createElement("style"),Mc="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Pi.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+Mc+t.classCSS,mt.appendChild(Pi);let Dn=document.createElement("div");Dn.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Dn.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${a.__subpixel?H(Lt+f.width):On}px;height:${cn}px`+(Lt!==0||Pe!==0?`;padding:${Pe}px 0 0 ${Lt}px !important`:"")+(ft!==1?`;zoom:${ft} !important`:"")+";direction:ltr !important"+(p?Zp(m):""),p&&(Lt!==p.left||Pe!==p.top)&&t.__session&&Xa(t.element,t.nodeMap,t.__session.styleMap,t.styleCache,Lt-p.left,Pe-p.top),Dn.appendChild(t.clone),mt.appendChild(Dn);let Ac=new XMLSerializer().serializeToString(mt),Ni=A||x,Ec=Object.freeze({w0:v,h0:M,vbW:q,vbH:X,targetW:F,targetH:T,contentX:H(G+(n?E:0)),contentY:H(ht+(n?$:0)),clip:n?Object.freeze({x:H(E),y:H($),width:v,height:M}):null});Object.defineProperty(a,"meta",{value:Ec,enumerable:!0,writable:!1,configurable:!0});let _c=!Ni||Y()?q:A?F:H(q*(T/X)),Rc=!Ni||Y()?X:x?T:H(X*(F/q)),Fc=parseFloat(D(m.documentElement)?.fontSize)||16,Jo=[te||$e?`translate(${te} ${$e})`:"",ft!==1?`scale(${1/ft})`:""].join(" ").trim(),Tc=`${Jo?``:""}`,$c=Jo?"":"";u=Tc+eh(Ac,mt)+$c,l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=l,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Qt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let Qo=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);return Qo&&Qo.style.position==="absolute"&&Qo.remove(),t.dataURL}function ii(t){return ja(t)}function oh(t){let e=t.devicePixelRatio||1;if(e===1)return 1;let n=t.document,o=e;try{let i=n.createElement("div");Q(i),i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important",(n.body||n.documentElement).appendChild(i);let r=parseFloat(t.getComputedStyle(i).borderTopWidth);i.remove(),r>=1&&(o=1)}catch{}return o}ke();Fn();function sh(t){let e=Array.isArray(t.plugins)?t.plugins:ni(),n=[];for(let o of e){let i=en(o);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function _l(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=Zr(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=sh(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let o,i,r,s,a,l,u,c,f="",d=null,h=e.needs||Ct,m=n.format,g=n.type;await Qt("beforeSnap",n);let p=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),y=n.type!==g&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||y){let E=String(p?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Qt("beforeClone",n);let b=n.outerTransforms!==!1,w=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,C=n.clip?xo(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=ws(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let S=is(e.fast);for(;;){e.__slicer=S;let E=_o(n.element,C);try{({clone:o,classCSS:i,classPrefixCSS:r,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:u,standIns:c}=await nl(n.element,n.options)),l>0&&!e.reconcile&&(et(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),e.debug&&!j.warnedReconcile&&(j.warnedReconcile=!0,O(e,"Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!b&&o&&(d=Ha(n.element,o)),!w&&o&&Ka(n.element,o,n.options),o&&(Qa(n.element,o,a,c),Ja(n.element,o))}finally{E()}if(!S?.yielded||!e.__tornSinceStart?.())break;S=null,e.__session=Zr(e.cache)}if(e.__slicer=null,n.clone=o,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Qt("afterClone",n),!Ze(h,"render"))return null;if(S?.due()&&await S.pause(),So(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Za(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){et(e.__session,"shrink-failed","shrink pass failed",E),O(e,"Couldn't close the gaps left by removed elements.",E)}try{await so(n.clone,n.element,n.nodeMap)}catch{}try{let E=e.__session?.styleMap;E&&ao(E.keys(),E,n.nodeMap,n.options.__iconMatchers)}catch{}let v=E=>Promise.resolve().then(E),M=(async()=>{await Promise.all([v(()=>ko(n.clone,n.options)),v(()=>Ao(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{il(n.element,n.clone,n.nodeMap)}catch(E){et(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),O(e,"Couldn't reproduce a backdrop-filter; captured without it.",E)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=d,await v(()=>Lo(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ea(n.nodeMap)}catch(E){et(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),F=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(F=v(async()=>{let E=n.element.ownerDocument||document,$=C?L=>{try{let P=L.getBoundingClientRect();return P.right>=C.left-200&&P.left<=C.right+200&&P.bottom>=C.top-200&&P.top<=C.bottom+200}catch{return!0}}:null,{required:R,usedCodepoints:W}=!C&&e.__fontUsage||mo(n.element,$),k=R,I=R;if(e.embedFonts==="auto"){let{declared:L,drawn:P}=ho(E),N=B=>En(B).toLowerCase();if(k=new Set(Array.from(R).filter(B=>P.has(N(B)))),!k.size)return;I=new Set(Array.from(R).filter(B=>P.has(N(B))||!L.has(N(B))))}Y()&&await go(k,W,E),f=await Ma({required:I,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E,debug:n.options.debug})})),await Promise.all([M,F]);let A=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));if(n.options.engine==="html-in-canvas"&&!A){let{tryCanvasEngine:E}=await Promise.resolve().then(()=>(El(),Al));vo(n,f);let $=await E(n,n.options);if($)return $}S?.due()&&await S.pause();let x=n.clone;No(x,e.__compressedAssets);let _=await Io(n,{clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,fontsCSS:f});if(e.__compressedSnapshot=Po(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:o,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:r,fontsCSS:f,clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}Mt();$t();wt();var ah=new Set(["png","jpeg","jpg","webp","svg"]);function Rl(t={}){let e=typeof t.type=="string"&&ah.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let o=t.format!=null?n:e==="jpg"?"jpeg":e,i=Li(t.cache),r=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of r)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{O(t,`Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&O(t,"Ignored an exclude entry: use a CSS selector or a function.",f);let l=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(c.exclude)?c.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(f))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:ct(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ma(t.iconFonts,t),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:o,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,__subpixel:t.__subpixel??null,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return c}yt();wt();Rt();Rt();Rt();_t();ke();var Fl="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function lh(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var ch=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function fh(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(ch.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function uh(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(r=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(r.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let o=[t];t.querySelectorAll&&o.push(...t.querySelectorAll("*"));for(let i of o){let r=getComputedStyle(i),s=r.getPropertyValue("backdrop-filter")||r.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var dh=1/16;function ph(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),o=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n-o)<=dh}var Wo=new Map,hh=["width","height","min-width","min-height"];function mh(t){let e=Wo.get(t);if(e===void 0){e=null;for(let n of hh){let o=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));o&&o[1].endsWith("px")&&((e||={})[n]=o[1])}Wo.size>5e3&&Wo.clear(),Wo.set(t,e)}return e}function gh(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function yh(t,e){let n=[t];for(;n.length;){let o=n.pop();if(o.nodeType===1){let i=e.nodeMap.get(o);i!==void 0&&(e.nodeMap.delete(o),e.srcToClone.get(i)===o&&e.srcToClone.delete(i)),e.styleMap.delete(o)}for(let i=o.firstChild;i;i=i.nextSibling)n.push(i)}}var si={attempts:0,served:0,reconciled:0};async function Tl(t,e,n){si.attempts++;try{let o=await bh(t,e,n);return o&&si.served++,o}catch{return null}}async function bh(t,e,n){let o=e.retained;if(!o||!o.clone||!o.styleMap||!o.srcToClone||n.reconcile||n.clip||n.captureSelection||o.clipWindow||t.scrollTop||t.scrollLeft||lh(t)||fh(o)||o.fontsCSS||Fo(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(o.classPrefixCSS&&(o.classPrefixCSS.includes("::marker")||o.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,r=vn(t);if(!r||bs(i))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=o.__compressedAssets,n.__compressionDensity=o.__compressionDensity,n.__compressionRootTransform=o.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(Fl)||d.querySelector?.(Fl)||uh(d,r))return null;let h=o.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,g={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:m,options:n},p=_o(d,null),y=wo(d),b;try{b=await fe(d,g,n)}finally{y(),p()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Ye(d,b,g,n),g.__pseudoCSS)||g.__usesPlaceholder&&!o.classPrefixCSS?.includes("[data-sd-ph]"))return null;await to(b,g),So(b);try{await so(b,d,m)}catch{}try{ao([b,...b.querySelectorAll("*")],o.styleMap,m,n.__iconMatchers)}catch{}if(await Promise.all([ko(b,n),Ao(d,b,o.styleCache,n,m)]),n.compress)try{await Lo(b,n,m)}catch{}for(let[w,C]of m.entries())Qr(w,C,m,o.styleCache);h.replaceWith(b),yh(h,o);for(let[w,C]of m.entries())o.nodeMap.set(w,C),o.srcToClone.set(C,w)}let a={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:o.nodeMap,options:n},l=new WeakSet;for(let[d,h]of o.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=o.styleMap.get(d);if(!m)continue;let g=mh(m);if(!g)continue;let p=null,y=!1;for(let b in g){p||=getComputedStyle(h);let w=p.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let C=parseFloat(p.width);p.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(C+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((S,v)=>S+(parseFloat(p.getPropertyValue(v))||0),0)),w=`${C}px`}if(!ph(w,g[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),si.reconciled++,await xt(h,d,a,n)}}let u=hn(o.styleMap);for(let[d,h]of o.styleMap.entries())gh(d),Jr(d,h,u);let c=(o.classPrefixCSS||"")+Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");No(o.clone,n.__compressedAssets);let f=await Io({element:t,options:n,plugins:n.plugins,clone:o.clone,classCSS:c,styleCache:o.styleCache,nodeMap:o.nodeMap},{clipWindow:null,outerTransforms:o.outerTransforms,outerShadows:o.outerShadows,rootTransform2D:o.rootTransform2D,fontsCSS:o.fontsCSS||""});return n.__compressedSnapshot=Po(o.clone,n.__compressedAssets),o.__compressedAssets=n.__compressedAssets,o.__compressionDensity=n.__compressionDensity,f}$t();var li=new WeakMap,Do=new WeakMap,Ul=new WeakSet,ai=new WeakMap,wh=64,Nn=new Map,Hl=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],xh=["(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 Sh(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":xh.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function $l(t){let e=[];for(let n=t;n;){try{let o=n.getBoundingClientRect();e.push(o.x,o.y,o.width,o.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=Dt(n)||null}return e.join("|")}function Pl(t,e){if(e.disposed||(Nn.delete(t),Nn.set(t,e),Nn.size<=wh))return;let[n,o]=Nn.entries().next().value;jl(n,o)}function jl(t,e){e.disposed=!0,Nn.delete(t),li.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Hl)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let o of fi)n.removeEventListener(o,e.onMediaDirty,!0);for(let[n,o]of e.trackedImages)n.removeEventListener("load",o),n.removeEventListener("error",o);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 Vl(t){if(Ul.has(t))return!1;Do.delete(t);let e=[t],n=[],o=[];for(let i=0;i=0&&e.observers.splice(s,1)}for(let i of o)if(!e.trackedShadowRoots.has(i))try{let r=new MutationObserver(e.markDirty);r.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),r.__flush=e.markDirty,e.observers.push(r),e.trackedShadowRoots.set(i,r);for(let s of fi)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var fi=["scroll","change","beforetoggle","toggle"];function Bo(t,e){return[t,...e.trackedShadowRoots.keys()]}function ui(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let o of Bo(t,e))o.querySelectorAll&&n.push(...o.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let o=new Set(n);for(let[i,r]of e.trackedImages)o.has(i)||(i.removeEventListener("load",r),i.removeEventListener("error",r),e.trackedImages.delete(i))}for(let o of n){if(o.complete||e.trackedImages.has(o))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,o.removeEventListener("load",i),o.removeEventListener("error",i),e.trackedImages.delete(o)};e.trackedImages.set(o,i),o.addEventListener("load",i),o.addEventListener("error",i)}}function Nl(t){let e=new Map,n=new Map,o=new Map;for(let i of t)if(we(i))if(i.type==="attributes"){let r=e.get(i.target);r||e.set(i.target,r=new Map),r.has(i.attributeName)||r.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 r=o.get(i.target);r||o.set(i.target,r=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;r.set(s.data,(r.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;r.set(s.data,(r.get(s.data)||0)-1)}}else return!0;for(let[i,r]of e)for(let[s,a]of r)if(i.getAttribute(s)!==a)return!0;for(let[i,r]of n)if(i.data!==r)return!0;for(let i of o.values())for(let r of i.values())if(r!==0)return!0;return!1}var vh=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,rn=t=>t&&(typeof t=="object"||typeof t=="function")?Oo(t):"-";function Ch(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let o=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(o)){let r=Math.ceil(e/3)*4;return atob(i.slice(0,r-r%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(r,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function kh(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=Ch(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 Ll(t){let e=String(t||"").trim();return e?vh.test(e)?!0:/^data:/i.test(e)?kh(e):!1:!1}function sn(t){let e=String(t||"");if(Ll(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Ll(n[1]??n[2]??n[3]))return!0;return!1}function Il(t,e=null){let n=t&&t.clone;if(!n)return!1;let o=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of o)for(let r of Gl(i))if(sn(r.getAttribute?.("src"))||sn(r.getAttribute?.("href"))||sn(r.getAttribute?.("style"))||sn(t.styleMap?.get(r)))return!0;return!1}function Gl(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function di(t,e){let n=[],o=new Set,i=r=>{r&&!o.has(r)&&(o.add(r),n.push(r))};t.matches?.("input,textarea,select,option")&&i(t);for(let r of Bo(t,e))try{for(let s of r.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function pi(t,e){let n=[],o=new Set,i=(r,s=!1)=>{if(!(!r||o.has(r))){o.add(r);try{(s||r.scrollLeft||r.scrollTop||r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)&&n.push(r)}catch{}}};for(let r=t;r;r=r.parentElement)i(r,!0);for(let r of Bo(t,e))for(let s of Gl(r))i(s);e.scrollNodes=n}function Wl(t,e){let n=t.ownerDocument||document,o=n.defaultView,i=[o?.location?.hash||"",Sh(n),o?.innerWidth||0,o?.innerHeight||0,o?.devicePixelRatio||1,o?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(rn))}catch{}for(let c of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...c.adoptedStyleSheets||[]].map(rn))}catch{}let r=n.activeElement,s=n.fullscreenElement;(r?.contains(t)||t.contains(r))&&i.push(rn(r)),(s?.contains(t)||t.contains(s))&&i.push(rn(s));let a=[o?.scrollX||0,o?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let f=String(c.localName||"").toLowerCase();f==="input"?l.push(c.type,dn(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):f==="textarea"?l.push(c.value):f==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let u=[];for(let c of e.images){let f="";try{f=c.currentSrc||c.src||""}catch{}u.push(f,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:l,images:u,frameDriven:e.retainedFrameDriven}}function on(t,e,n){if(!t)return!1;let o=t[n],i=e[n];if(o===i)return!0;if(!Array.isArray(o)||o.length!==i.length)return!1;for(let r=0;r[rn(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Mh(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let o of e.trackedShadowRoots.keys())if(o.contains(n))return o;return null}function Ah(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:ze(),styleEpoch:xe(),styleStamp:Sn(t),outsideMutations:xn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},o=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},i=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)we(l)&&(e.dirty=!0,o(l.target))},r=()=>{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=r;try{for(let a of Hl)t.addEventListener(a,r,{capture:!0,passive:!0})}catch{}return ci(t,e)||di(t,e),pi(t,e),ui(t,e),e}var Eh=0,Bl=new WeakMap;function Oo(t){let e=Bl.get(t);return e||(e="@"+ ++Eh,Bl.set(t,e)),e}function hi(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(Oo(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Oo(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let r=[];for(let s of t){let a=hi(s,e);if(a===null)return null;r.push(a)}return"["+r.join(",")+"]"}let o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)return JSON.stringify(Oo(t));let i=[];for(let r of Object.keys(t).sort()){let s=t[r];if(s===void 0)continue;let a=hi(s,e);if(a===null)return null;i.push(JSON.stringify(r)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function zl(t,e){let{burst:n,invalidate:o,...i}=t||{};try{let r=hi(i,new Set);return r===null?null:`${(e||[]).map(rn).join(",")}:${r}`}catch{return null}}function ql(t,e,n,o,i=null){let r=li.get(t);r||(r=Ah(t),r.baselineSignature=zl(e,n.plugins),li.set(t,r));let s=zl(e,n.plugins),a=async()=>{if(r.disposed)return o();let u=s===null||s!==r.baselineSignature;u&&s!==null?r.pendingSig===s?(r.baselineSignature=s,r.last=null,r.dirty=!0,r.dirtyRoots=null,r.pendingSig=null,u=!1):r.pendingSig=s:r.pendingSig=null,ci(t,r),ui(t,r);for(let M of r.observers)M.__flush(M.takeRecords());zt();let c=xn(t);r.dirty&&r.outsideMutations!==c&&r.dirtyAll(),r.outsideMutations=c;let f=t.getRootNode?.(),d=[...r.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),Kn(t.ownerDocument||document,d);let h=Sn(t);r.styleStamp!==h&&(r.styleStamp=h,r.dirty||r.dirtyAll());let m=Wl(t,r),g=Ol(t,r);m.animation=Dl(g),r.renderState&&(!on(r.renderState,m,"style")&&(Ue(),r.dirtyAll()),on(r.renderState,m,"scroll")||r.dirtyAll(),on(r.renderState,m,"controls")||(Se(t),r.dirtyAll()),!on(r.renderState,m,"images")&&!r.dirty&&r.dirtyAll());let p=ze();r.envEpoch!==p&&(r.dirtyAll(),r.envEpoch=p);let y=xe();if(r.styleEpoch!==y&&(r.styleEpoch=y,!r.dirty)){let M=$l(t);r.geometry!==null&&M!==r.geometry&&(Se(t),r.dirtyAll()),r.geometry=M}n.invalidate&&r.dirtyAll();let b=!1,w=!!r.renderState&&!on(r.renderState,m,"animation");try{let M=new Set;w&&g.length===0&&(M=null);for(let F of g){let T=F.playState==="running";if(!T&&!w)continue;T&&(b=!0),w=!0;let A=F.effect?.target;if(Mh(t,r,A)===t)M.add(A);else{M=null;break}}if(w&&M&&M.size&&r.retained){r.dirty=!0;for(let F of M)r.dirtyRoots&&r.dirtyRoots.add(F),Se(F)}else w&&!M&&r.dirtyAll()}catch{}let C=m.frameDriven,S=b||C;if(S&&(r.last=null),C&&r.dirtyAll(),!u&&!S&&!r.dirty&&r.last)return Pl(t,r),r.last;r.capturing=!0;let v=null;try{let M=null,F=!1,T=null;if(!u&&r.dirty&&r.retained&&r.dirtyRoots&&r.dirtyRoots.size&&i){T=[...r.dirtyRoots];let A=await Tl(t,r,n);A&&(M=await i(A),F=!0)}if(M||(u||(n.__retain=A=>{let x=new Map;for(let[_,E]of A.nodeMap.entries())x.set(E,_);v={...A,srcToClone:x}}),n.__tornSinceStart=()=>{for(let A of r.observers)for(let x of A.takeRecords())r.pending.push(x);return zt(),r.torn||Nl(r.pending)||xn(t)!==c},M=await o()),!u&&!r.disposed){r.dirty=!1,r.dirtyRoots=new Set,v?(r.retained=v,r.retainedFrameDriven=Il(v),di(t,r),pi(t,r)):F&&(r.retainedFrameDriven||=Il(r.retained,T),di(t,r),pi(t,r));let A=Wl(t,r);A.animation=Dl(Ol(t,r));let x=["style","scroll","controls","images"];b||x.push("animation");let _=x.every(E=>on(m,A,E));r.renderState=A,r.styleEpoch=xe(),r.styleStamp=Sn(t),r.geometry=$l(t),r.renderState.frameDriven?(Ul.add(t),jl(t,r)):_?!S&&!r.renderState.frameDriven&&(r.last=M,Pl(t,r)):(r.dirtyAll(),r.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let F of r.observers)for(let T of F.takeRecords())r.pending.push(T);zt();let M=xn(t);(r.torn||Nl(r.pending)||M!==c)&&(r.dirtyAll(),r.last=null),r.outsideMutations=M,r.styleEpoch=xe(),r.styleStamp=Sn(t),r.pending.length=0,r.torn=!1,r.capturing=!1,r.disposed||(ci(t,r),ui(t,r))}},l=r.inflight.then(a,a);return r.inflight=l.catch(()=>{}),l}var zo=null;function Kl(t){zo=t}var _h='button, a[href], [role="button"], input, select, summary, label, [tabindex]',mi=!1,Ln=null,gi=new WeakMap,Xl=!1;function Jl(t,e){!mi||!Ln||e&&e.burst===!1||gi.set(Ln.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ql(t){let e={control:t};Ln=e,setTimeout(()=>{Ln===e&&(Ln=null)},0)}function bi(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(_h):null}function Yl(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=bi(t);e&&(Ql(e),yi(t,!1))}function Rh(t){let e=bi(t);e&&Ql(e)}function yi(t,e=!0){if(!zo||document.visibilityState==="hidden")return;let n=bi(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let o=gi.get(n);if(o){if(!o.element.isConnected){gi.delete(n);return}zo(o.element,o.options).catch(()=>{});return}e&&!Xl&&(Xl=!0,zo(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Zl(){if(mi||typeof document>"u"||typeof document.addEventListener!="function")return;mi=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Yl,t),document.addEventListener("keydown",Yl,t),document.addEventListener("click",Rh,t),document.addEventListener("pointerenter",yi,t),document.addEventListener("focusin",yi,t)}At();function tm(...t){return ei(...t),Z}async function em(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Q(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await vt();let o=Array.from(n.childNodes).some(r=>r.nodeType===3&&r.textContent.trim()),i=n.children.length===1&&!o?n.firstElementChild:n;return await $i(i,{...e||{},burst:!1})}finally{n.remove()}}var nm="3.6.0",Z=Object.assign($i,{plugins:tm,fromString:em,version:nm,preCapture:Zl});Kl($i);var Ti=Symbol("snapdom.internal"),om=Symbol("snapdom.internal.silent"),Cc=new Set(["png","jpeg","jpg","webp","svg"]);async function $i(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Rl(e);n.element=t,n.invalidate&&Ue(),ml(n,e&&e.plugins);let{stage:o,loweredBy:i}=ul(n);n.needs=o,n.__needsLoweredBy=i;let r=Ze(o,"render"),s=n.burst===!0||!Fo(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=r&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Vl(t);return u&&Jl(t,e),n.snap||(n.snap={toPng:(c,f)=>Z.toPng(c,f),toSvg:(c,f)=>Z.toSvg(c,f)}),u?ql(t,e,n,()=>Z.capture(t,n,Ti),c=>kc(c,n)):Z.capture(t,n,Ti)}Z.capture=async(t,e,n)=>{if(n!==Ti)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Ze(e.needs||Ct,"render")&&Y()){if(e.embedFonts)try{let r=t.ownerDocument||document,s=null;if(e.embedFonts==="auto"&&(t.getBoundingClientRect(),s=ho(r).drawn,s.size===0))throw null;let a=mo(t);e.clip||(e.__fontUsage=a);let l=a.required;if(s&&(l=new Set([...l].filter(u=>s.has(En(u).toLowerCase()))),l.size===0))throw null;await go(l,a.usedCodepoints,r)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let r of i)try{if(An(r))continue;let s=r.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){O(e,"Couldn't prepare canvases for Safari.",s)}}let o=await _l(t,e);return kc(o,e)};async function kc(t,e){let n=e.needs||Ct,o=Ze(n,"render"),i=k=>pl(n,e.__needsLoweredBy||[],k),r=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=r?null:t,a=()=>s??=r.toDataURL(),l=r||t;r&&(t="");let u=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),g=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,p=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=k=>{if(r||!u?.size)return l;let I=d.vbW,L=d.vbH,P=k.crop;P&&(I=Math.max(1,Math.min(I,P.x+P.width)-Math.max(0,P.x)),L=Math.max(1,Math.min(L,P.y+P.height)-Math.max(0,P.y)));let N=Number.isFinite(k.width),B=Number.isFinite(k.height);return(N&&B?Math.max(k.width/I,k.height/L):N?k.width/I*(P?Math.max(1,p/g):1):B?k.height/L*(P?Math.max(1,g/p):1):(k.scale||1)*Math.max(g,p))*(k.dpr||1)<=c?l:f??=Sl(a(),u)},b=async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),Wn));return L(l,{...k,...I||{},format:"png"})},w=()=>{if(!o)throw i("svgString");if(r)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let k=t.indexOf(",");return k>=0?decodeURIComponent(t.slice(k+1)):""},C=k=>Object.defineProperty({...k||{},svgString:w},"url",o?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),S={img:async(k,I)=>{if(r)return b(k,I);let{toImg:L}=await Promise.resolve().then(()=>(Ei(),Ai)),P={...k,...I||{}};return L(y(P),P)},svg:async(k,I)=>{if(r)return b(k,I);let{toSvg:L}=await Promise.resolve().then(()=>(Ei(),Ai)),P={...k,...I||{}};return L(y(P),P)},canvas:async(k,I)=>{let{toCanvas:L}=await Promise.resolve().then(()=>(Re(),sc)),P={...k,...I||{}};return L(y(P),P)},blob:async(k,I)=>{let{toBlob:L}=await Promise.resolve().then(()=>(Fi(),wc)),P={...k,...I||{}};return L(y(P),P)},png:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),Wn)),P={...k,...I||{},format:"png"};return L(y(P),P)},jpeg:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),Wn)),P={...k,...I||{},format:"jpeg"};return L(y(P),P)},webp:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),Wn)),P={...k,...I||{},format:"webp"};return L(y(P),P)},download:async(k,I)=>{let{download:L}=await Promise.resolve().then(()=>(vc(),Sc)),P={...k,...I||{}};return L(y(P),P)}};if(!o)for(let k of Object.keys(S)){let I=k==="download"?"download()":`to${k.charAt(0).toUpperCase()}${k.slice(1)}()`;S[k]=async()=>{throw i(I)}}let v={};for(let k of["img","svg","canvas","blob","png","jpeg","webp"])v[k]=async I=>S[k](e,{..._(k,I||{}),[om]:!0});v.jpg=v.jpeg;let M=k=>Object.defineProperty({...e,...k},"options",{value:e,configurable:!0}),F=M({artifacts:e.__artifacts||null,export:C(),exports:v}),T=await Ro("defineExports",F),A=Object.assign({},...T.filter(k=>k&&typeof k=="object").reverse()),x={...S,...A};x.jpeg&&!x.jpg&&(x.jpg=(k,I)=>x.jpeg(k,I));function _(k,I){let L=I||{},P={...e,...L},N=typeof L.type=="string"?L.type.toLowerCase():"",B=typeof L.format=="string"?L.format.toLowerCase():Cc.has(N)?N:"";B&&(P.format=B==="jpg"?"jpeg":B),P.__explicitFormat=B?P.format:e.__explicitFormat??null,k==="blob"&&!P.__explicitFormat&&(P.format=r?"png":"svg"),P.type=P.format;let U=z=>z==="jpeg"||z==="jpg"||z==="webp";return[k,P.format,N].map(z=>typeof z=="string"?z.toLowerCase():"").find(U)&&(P.backgroundColor==null||P.backgroundColor==="transparent")&&(P.backgroundColor="#ffffff"),P.scale!==1&&(Number.isFinite(P.width)||Number.isFinite(P.height))&&O(P,"scale ignored: width/height already set the size."),P}let E=!1,$=Promise.resolve();async function R(k,I){let L=Object.freeze(I&&typeof I=="object"?{...I}:{}),P=async()=>{let B=x[k];if(!B)throw new Error(`[SnapDOM] Unknown export type: ${k}`);let U=_(k,L),V=M({artifacts:e.__artifacts||null,export:C({type:k,options:U,requestedOptions:L})}),z=U.format,at=U.type;await Ro("beforeExport",V,{format:k,options:U});let rt=U.format!==z?U.format:U.type!==at?U.type:"",pt=typeof rt=="string"?rt.toLowerCase():"";Cc.has(pt)&&(U.format=pt==="jpg"?"jpeg":pt,U.type=U.format,U.__explicitFormat=U.format,/^(?:jpeg|webp)$/.test(U.format)&&(U.backgroundColor==null||U.backgroundColor==="transparent")&&(U.backgroundColor="#ffffff"));let kt=await B(V,U);return await Ro("afterExport",V,{format:k,options:U,result:kt}),E||(E=!0,await Qt("afterSnap",e)),kt},N=$.then(P);return $=N.catch(()=>{}),N}let W={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!o)throw i("toRaw()");return a()},to:(k,I)=>R(k,I),toImg:k=>R("img",k),toSvg:k=>R("svg",k),toCanvas:k=>R("canvas",k),toBlob:k=>R("blob",k),toPng:k=>R("png",k),toJpg:k=>R("jpg",k),toWebp:k=>R("webp",k),download:k=>R("download",k)};o?r&&Object.defineProperty(W,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(W,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(W,"meta",o?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let k of Object.keys(x)){let I="to"+k.charAt(0).toUpperCase()+k.slice(1);W[I]||(W[I]=L=>R(k,L))}return W}Z.toRaw=(t,e)=>Z(t,e).then(n=>n.toRaw());Z.toImg=(t,e)=>Z(t,e).then(n=>n.toImg());Z.toSvg=(t,e)=>Z(t,e).then(n=>n.toSvg());Z.toCanvas=(t,e)=>Z(t,e).then(n=>n.toCanvas());Z.toBlob=(t,e)=>Z(t,e).then(n=>n.toBlob());Z.toPng=(t,e)=>Z(t,{...e,format:"png"}).then(n=>n.toPng());Z.toJpg=(t,e)=>Z(t,{...e,format:"jpeg"}).then(n=>n.toJpg());Z.toWebp=(t,e)=>Z(t,{...e,format:"webp"}).then(n=>n.toWebp());Z.download=(t,e)=>Z(t,e).then(n=>n.download());export{Ct as DEFAULT_STAGE,Qe as STAGES,dl as assertNeeds,Rp as clearPlugins,ni as getGlobalPlugins,en as normalizePlugin,ei as registerPlugins,Z as snapdom}; +}`,Gp=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Xt=null,qp=0,Xp=0,Me=new Map;function _l(){for(let t of Me.values())t(void 0);if(Me.clear(),Array.isArray(Xt))for(let t of Xt)try{t?.terminate()}catch{}Xt=!1}function Yp(){let t,e=null;try{t=URL.createObjectURL(new Blob([Vp],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let o=Me.get(n.data.id);o&&(Me.delete(n.data.id),o(n.data.error?void 0:n.data.url??null))},e.onerror=_l}catch{e=null}return t&&URL.revokeObjectURL(t),e}function Kp(){if(Xt===!1)return!1;if(Xt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Xt=!1;Xt=[]}let t=qp++%Gp;if(!Xt[t]){let e=Yp();if(!e)return _l(),!1;Xt[t]=e}return Xt[t]}var Jp=5e3;function Qp(t,e,n,o,r){let i=Kp();return i?new Promise(s=>{let a=++Xp,l=setTimeout(()=>{Me.delete(a),s(void 0)},Jp);Me.set(a,u=>{clearTimeout(l),s(u)});try{i.postMessage({id:a,dataURL:r?"":t,blob:r,srcLength:t.length,targetW:e,targetH:n,resFactor:El,quality:Al,mime:o})}catch{clearTimeout(l),Me.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function ci(t,e,n,o){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let r=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,i=j.compress,s=i.get(r);if(s?.source===t)return s.result;let a=Po.get(r);if(a?.source===t&&a.cache===i)return a.promise;let l=(async()=>{let c=Bp(t),f=c==="image/jpeg"?"image/jpeg":c==="image/webp"?"image/webp":"image/png",d=jp(t);if(d&&d.w>0&&d.h>0&&!vl(d.w,d.h,e,n))return null;if(t.length>=zp){let C=await Qp(t,e,n,f,o);if(C!==void 0)return C}let h;try{h=await Dp(t)}catch{return null}let m=h.naturalWidth||h.width,g=h.naturalHeight||h.height;if(!m||!g)return null;let p=vl(m,g,e,n);if(!p)return null;let y=p*El,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(g*y)),S=document.createElement("canvas");S.width=b,S.height=w;let v=S.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,w);try{let C=S.toDataURL(f,Al);if(typeof C=="string"&&C.startsWith("data:image")&&C.length{let f=c.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(c.dataset.snapdomWidth)||parseFloat(c.style.width)||c.width||0,h=parseFloat(c.dataset.snapdomHeight)||parseFloat(c.style.height)||c.height||0;if(!d||!h)return;let m=o.value||=li(t,e),g=m.density*m.stretch(n.get(c)||c),p=await ci(f,d*g,h*g,c.__snapdomBlob);p&&(i++,s+=f.length,a+=p.length,c.setAttribute("src",p),No(c,"attribute","src",f,p,e))},u=6;for(let c=0;c{let c=n.get(u);if(!c||!c.isConnected)return;let f;try{f=getComputedStyle(c)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(F=>F.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(F=>!th.test(F.trim())))return;let{w:m,h:g}=eh(c);if(!m||!g)return;let p=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(F=>parseFloat(F)/100)),y=o.value||=li(t,e),b=y.density*y.stretch(c)*p,w=m*b,S=g*b,v=u.style.backgroundImage,C=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=v;for(let F of C){let T=F[2];if(T.startsWith("data:image/svg"))continue;let A=await ci(T,w,S);A&&(M=M.split(T).join(A),s++)}M!==v&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),No(u,"style","background-image",v,u.style.backgroundImage,e))},l=6;for(let u=0;u{let u=l.getAttribute("href")||(typeof l.getAttributeNS=="function"?l.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let c=l.getAttribute("width")||"",f=l.getAttribute("height")||"";if(c.includes("%")||f.includes("%"))return;let d=n.get(l),h=d?O(d):l.style,m=(S,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[S]||""))return parseFloat(h[S]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return d?.[S]?.baseVal?.value||0}catch{return 0}},g=m("width",c),p=m("height",f);if(!g||!p)return;let y=o.value||=li(t,e),b=y.density*y.stretch(d||l),w=await ci(u,g*b,p*b);w&&(l.setAttribute("href",w),No(l,"attribute","href",u,w,e),l.hasAttribute("xlink:href")&&(l.setAttributeNS(Cl,"xlink:href",w),No(l,"attribute","xlink:href",u,w,e)),i++)},a=6;for(let l=0;le+.5?t-n:o-n}function rh(t){let e=r=>r&&r!=="transparent"&&!/^rgba\(.*,\s*0\)$/.test(r),n=O(t.documentElement).backgroundColor,o=e(n)?n:O(t.body).backgroundColor;return e(o)?`;background-color:${o} !important`:""}var ih=/(?:^|;)(?:box-shadow|text-shadow|outline-style|filter|-webkit-filter):/;function sh(t,e){if(Y())return t;let n=t.indexOf("");if(n===-1)return t;let o=/]*>[\s\S]*?<\/style>/g,r=[],i=n,s;for(o.lastIndex=n;s=o.exec(t);)r.push({text:t.slice(i,s.index),intern:!0}),r.push({text:s[0],intern:!1}),i=o.lastIndex;r.push({text:t.slice(i),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,u;for(let y of r)if(y.intern)for(l.lastIndex=0;u=l.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let f=ah(e,r.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],g=(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}"`},p="";for(let y of r)p+=y.intern?y.text.replace(l,g):y.text;return t.slice(0,n)+m.join("")+p}function ah(t,e,n){let o=new Set;if(!e&&!n)return o;if(!t||t.querySelector("[data-sdi]"))return null;let r=l=>{let u=l.getAttribute("style");u&&o.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(r),e)try{let l=u=>{for(let c of u){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(r)}c.cssRules&&l(c.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let c=u.textContent||"";if(/@import\b/i.test(c))return null;let f=new CSSStyleSheet;f.replaceSync(c),l(f.cssRules)}}catch{return null}let i=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of o){s.setAttribute("style",l);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&i.add(u[1])}return i}async function Oo(t,e){let{clipWindow:n,outerTransforms:o,outerShadows:r,rootTransform2D:i,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:J,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let l,u;ko(t,s),await Qt("beforeRender",t);let c=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,H(t.element.offsetWidth||parseFloat(c.width)||f.width||1)),h=Math.max(1,H(t.element.offsetHeight||parseFloat(c.height)||f.height||1)),m=t.element.ownerDocument||document,g=!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned,p=null,y=null,b=0;if(g){let J=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0),it=Math.max(d,H(tt)),ut=t.element===m.body,Vt=ut&&O(m.documentElement).direction==="rtl",St=K=>{K>0&&(Vt?b=Math.max(b,H(K-f.width)):d=Math.max(d,H(K)))};if(ut&&m.documentElement){let K=m.documentElement.getBoundingClientRect(),st={top:Math.max(0,f.top-K.top),right:Math.max(0,K.right-f.right),bottom:Math.max(0,K.bottom-f.bottom),left:Math.max(0,f.left-K.left)};if(p=st,r!=="subtree"&&(st.top||st.right||st.bottom||st.left)){let bt=t.__session?.styleMap,fn=new Map,zn=new Map;for(let[ne,Wt]of t.nodeMap){let Ot=bt?.get(ne);if(Ot){let er=fn.get(Ot);if(er===void 0&&fn.set(Ot,er=ih.test(Ot)),!er)continue}zn.set(ne,Wt)}let Gt=Yr(t.element,zn,t.styleCache,f.width>0?d/f.width:1,f.height>0?h/f.height:1);y={top:Math.min(Gt.top,st.top),right:Math.min(Gt.right,st.right),bottom:Math.min(Gt.bottom,st.bottom),left:Math.min(Gt.left,st.left)}}J=Math.max(t.element.scrollHeight||0,nn(J,K.height,f.top-K.top,f.bottom-K.top)),tt=Math.max(t.element.scrollWidth||0,Vt?nn(tt,K.width,K.right-f.right,K.right-f.left):nn(tt,K.width,f.left-K.left,f.right-K.left))}J>0&&(h=Math.max(h,H(J))),St(tt);try{let K=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,st=j.measureHints.get(t.element);if(st&&st.cssLen===K&&st.w0===it&&st.docH===J&&st.docW===tt)st.csh>0&&(h=Math.max(h,H(st.csh))),St(st.csw);else{let bt=m.createElement("div");Q(bt),bt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+it+"px!important;overflow:visible!important;visibility:hidden!important;";let fn=bt.attachShadow({mode:"open"});Pn(fn,(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS);let zn=fn.appendChild(ei(t.clone));m.body.appendChild(bt);let Gt=bt.scrollHeight,ne=bt.scrollWidth;if(ut){let Wt=bt.getBoundingClientRect(),Ot=zn.getBoundingClientRect();Gt=nn(Gt,Wt.height,Ot.top-Wt.top,Ot.bottom-Wt.top),ne=Vt?nn(ne,Wt.width,Wt.right-Ot.right,Wt.right-Ot.left):nn(ne,Wt.width,Ot.left-Wt.left,Ot.right-Wt.left)}m.body.removeChild(bt),j.measureHints.set(t.element,{cssLen:K,w0:it,docH:J,docW:tt,csh:Gt,csw:ne}),Gt>0&&(h=Math.max(h,H(Gt))),St(ne)}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let J=ti(t.element,t.options),tt=1,it=ti(t.element,{}),ut=Math.max(2,h*.15);Number.isFinite(it)&&it>=h-ut&&Number.isFinite(J)&&J>0&&(h=Math.max(1,Math.min(h,H(J+tt))))}if(t.options?.reconcile)try{let J=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;rl(t.element,t.clone,J,t.nodeMap,d,h)}catch(J){et(t.options.__session,"reconcile-failed","reconcile pass failed",J),D(t.options,"reconcile couldn't run; captured without it.",J)}let w=(J,tt=NaN)=>{let it=typeof J=="string"?parseFloat(J):J;return Number.isFinite(it)?it:tt},S=w(t.options.width),v=w(t.options.height),C=n?H(n.width):d,M=n?H(n.height):h,F=C,T=M,A=Number.isFinite(S),x=Number.isFinite(v),_=M>0?C/M:1;A&&x?(F=Math.max(1,H(S)),T=Math.max(1,H(v))):A?(F=Math.max(1,H(S)),T=Math.max(1,H(F/(_||1)))):x&&(T=Math.max(1,H(v)),F=Math.max(1,H(T*(_||1))));let E=0,$=0,R=d,W=h;if(n){let J=0,tt=0;if(fi(t.element)){let ut=null;if(!o&&i&&Number.isFinite(i.a))ut={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0};else{let Vt=Ce(t.element),St=Zr(c.transform&&c.transform!=="none"?c.transform:"",Vt);St&&St.is2D&&(ut={a:St.a,b:St.b,c:St.c,d:St.d,e:0,f:0})}if(ut&&!(ut.a===1&&ut.b===0&&ut.c===0&&ut.d===1)){let{ox:Vt,oy:St}=Fn(c,d,h),K=Ke(d,h,ut,Vt,St);J=K.minX,tt=K.minY}}let it=Y()?0:(a.dpr||1)*(A||x?F/C:a.scale||1);E=H(it?Math.round((n.x+J)*it)/it:n.x+J),$=H(it?Math.round((n.y+tt)*it)/it:n.y+tt),R=H(E+n.width),W=H($+n.height)}else if(!o&&i&&Number.isFinite(i.a)){let J={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0},tt=Ke(d,h,J,0,0);E=H(tt.minX),$=H(tt.minY),R=H(tt.maxX),W=H(tt.maxY)}else if(o&&fi(t.element)){let tt=c.transform&&c.transform!=="none"?c.transform:"",it=Ce(t.element),ut=ue({baseTransform:tt,rotate:it.rotate||"0deg",scale:it.scale,translate:it.translate,width:d,height:h}),{ox:Vt,oy:St}=Fn(c,d,h),K=ut.is2D?ut:new DOMMatrix(ut.toString()),st={a:K.a,b:K.b,c:K.c,d:K.d,e:0,f:0},bt=Ke(d,h,st,Vt,St);E=H(bt.minX),$=H(bt.minY),R=H(bt.maxX),W=H(bt.maxY)}let k=jr(c),I=Vr(c),L=Gr(c),P=qr(c),N=Xr(c),B=f.width>0?(R-E)/f.width:1,U=f.height>0?(W-$)/f.height:1,V=r==="subtree"&&!n?Yr(t.element,t.nodeMap,t.styleCache,B,U):{top:0,right:0,bottom:0,left:0};y&&(V={top:y.top,right:Math.max(0,y.right-(d-f.width)),bottom:Math.max(0,y.bottom-(h-f.height)),left:y.left}),b>0&&(V={...V,left:Math.max(V.left,b)});let z=n?{top:0,right:0,bottom:0,left:0}:r?{top:H(Math.max(k.top,I.top,V.top)+L.top+P.top+N.bleed.top),right:H(Math.max(k.right,I.right,V.right)+L.right+P.right+N.bleed.right),bottom:H(Math.max(k.bottom,I.bottom,V.bottom)+L.bottom+P.bottom+N.bleed.bottom),left:H(Math.max(k.left,I.left,V.left)+L.left+P.left+N.bleed.left)}:{top:H(L.top+V.top),right:H(L.right+V.right),bottom:H(L.bottom+V.bottom),left:H(L.left+V.left)};E=H(E-z.left),$=H($-z.top),R=H(R+z.right),W=H(W+z.bottom);let at=Math.max(1,H(R-E)),rt=Math.max(1,H(W-$)),pt="http://www.w3.org/2000/svg",kt=fi(t.element)?2:0,lt=H(kt+(o?0:1)),Yt=a.__subpixel?.x||0,Fe=a.__subpixel?.y||0,q=Math.ceil(at+lt*2+Yt),X=Math.ceil(rt+lt*2+Fe),G=H(-(H(E)-lt)),mt=H(-(H($)-lt)),nt=m.defaultView||window,ft=!Y()&&CSS.supports("zoom","2")?lh(nt):1;a.__layoutZoom=ft;let Te=n&&!Y(),te=Te?H(G-Math.floor(G*ft+.01)/ft):0,$e=Te?H(mt-Math.floor(mt*ft+.01)/ft):0,ee=Math.min(0,G-te)-(te?1/ft:0),ln=Math.min(0,mt-$e)-($e?1/ft:0),It=G-te-ee+Yt,Pe=mt-$e-ln+Fe,Dn=H(q-ee),cn=H(X-ln),gt=document.createElementNS(pt,"foreignObject");gt.setAttribute("x",String(ee*ft)),gt.setAttribute("y",String(ln*ft)),gt.setAttribute("width",String(Dn*ft)),gt.setAttribute("height",String(cn*ft)),gt.style.overflow="visible";let Oi=document.createElement("style"),Rc="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Oi.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+Rc+t.classCSS,gt.appendChild(Oi);let Bn=document.createElement("div");Bn.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Bn.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${a.__subpixel?H(It+f.width):Dn}px;height:${cn}px`+(It!==0||Pe!==0?`;padding:${Pe}px 0 0 ${It}px !important`:"")+(ft!==1?`;zoom:${ft} !important`:"")+";direction:ltr !important"+(p?rh(m):""),p&&(It!==p.left||Pe!==p.top)&&t.__session&&Ja(t.element,t.nodeMap,t.__session.styleMap,t.styleCache,It-p.left,Pe-p.top),Bn.appendChild(t.clone),gt.appendChild(Bn);let Fc=new XMLSerializer().serializeToString(gt),Di=A||x,Tc=Object.freeze({w0:C,h0:M,vbW:q,vbH:X,targetW:F,targetH:T,contentX:H(G+(n?E:0)),contentY:H(mt+(n?$:0)),clip:n?Object.freeze({x:H(E),y:H($),width:C,height:M}):null});Object.defineProperty(a,"meta",{value:Tc,enumerable:!0,writable:!1,configurable:!0});let $c=!Di||Y()?q:A?F:H(q*(T/X)),Pc=!Di||Y()?X:x?T:H(X*(F/q)),Nc=parseFloat(O(m.documentElement)?.fontSize)||16,Zo=[te||$e?`translate(${te} ${$e})`:"",ft!==1?`scale(${1/ft})`:""].join(" ").trim(),Lc=`${Zo?``:""}`,Ic=Zo?"":"";u=Lc+sh(Fc,gt)+Ic,l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=l,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Qt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let tr=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);return tr&&tr.style.position==="absolute"&&tr.remove(),t.dataURL}function fi(t){return qa(t)}function lh(t){let e=t.devicePixelRatio||1;if(e===1)return 1;let n=t.document,o=e;try{let r=n.createElement("div");Q(r),r.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important",(n.body||n.documentElement).appendChild(r);let i=parseFloat(t.getComputedStyle(r).borderTopWidth);r.remove(),i>=1&&(o=1)}catch{}return o}ke();Tn();function uh(t){let e=Array.isArray(t.plugins)?t.plugins:ai(),n=[];for(let o of e){let r=en(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}async function $l(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ri(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=uh(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let o,r,i,s,a,l,u,c,f="",d=null,h=e.needs||Ct,m=n.format,g=n.type;await Qt("beforeSnap",n);let p=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),y=n.type!==g&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||y){let E=String(p?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Qt("beforeClone",n);let b=n.outerTransforms!==!1,w=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?vo(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Cs(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=cs(e.fast);for(;;){e.__slicer=v;let E=Fo(n.element,S);try{({clone:o,classCSS:r,classPrefixCSS:i,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:u,standIns:c}=await sl(n.element,n.options)),l>0&&!e.reconcile&&(et(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),e.debug&&!j.warnedReconcile&&(j.warnedReconcile=!0,D(e,"Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!b&&o&&(d=Ga(n.element,o)),!w&&o&&Za(n.element,o,n.options),o&&(nl(n.element,o,a,c),tl(n.element,o))}finally{E()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=ri(e.cache)}if(e.__slicer=null,n.clone=o,n.classCSS=r,n.styleCache=s,n.nodeMap=a,await Qt("afterClone",n),!Ze(h,"render"))return null;if(v?.due()&&await v.pause(),Co(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{ol(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){et(e.__session,"shrink-failed","shrink pass failed",E),D(e,"Couldn't close the gaps left by removed elements.",E)}try{await lo(n.clone,n.element,n.nodeMap)}catch{}try{let E=e.__session?.styleMap;E&&co(E.keys(),E,n.nodeMap,n.options.__iconMatchers)}catch{}let C=E=>Promise.resolve().then(E),M=(async()=>{await Promise.all([C(()=>Ao(n.clone,n.options)),C(()=>_o(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{cl(n.element,n.clone,n.nodeMap)}catch(E){et(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),D(e,"Couldn't reproduce a backdrop-filter; captured without it.",E)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=d,await C(()=>Wo(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ia(n.nodeMap)}catch(E){et(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),F=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(F=C(async()=>{let E=n.element.ownerDocument||document,$=S?L=>{try{let P=L.getBoundingClientRect();return P.right>=S.left-200&&P.left<=S.right+200&&P.bottom>=S.top-200&&P.top<=S.bottom+200}catch{return!0}}:null,{required:R,usedCodepoints:W}=!S&&e.__fontUsage||yo(n.element,$),k=R,I=R;if(e.embedFonts==="auto"){let{declared:L,drawn:P}=go(E),N=B=>_n(B).toLowerCase();if(k=new Set(Array.from(R).filter(B=>P.has(N(B)))),!k.size)return;I=new Set(Array.from(R).filter(B=>P.has(N(B))||!L.has(N(B))))}Y()&&await bo(k,W,E),f=await _a({required:I,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E,debug:n.options.debug})})),await Promise.all([M,F]);let A=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));if(n.options.engine==="html-in-canvas"&&!A){let{tryCanvasEngine:E}=await Promise.resolve().then(()=>(Tl(),Fl));ko(n,f);let $=await E(n,n.options);if($)return $}v?.due()&&await v.pause();let x=n.clone;Io(x,e.__compressedAssets);let _=await Oo(n,{clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,fontsCSS:f});if(e.__compressedSnapshot=Lo(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:o,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:i,fontsCSS:f,clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}Mt();Pt();wt();var dh=new Set(["png","jpeg","jpg","webp","svg"]);function Pl(t={}){let e=typeof t.type=="string"&&dh.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let o=t.format!=null?n:e==="jpg"?"jpeg":e,r=Bi(t.cache),i=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of i)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{D(t,`Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&D(t,"Ignored an exclude entry: use a CSS selector or a function.",f);let l=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(c.exclude)?c.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(f))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:ct(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ba(t.iconFonts,t),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:r,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:o,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,__subpixel:t.__subpixel??null,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return c}ht();wt();Rt();Rt();Rt();_t();ke();var Nl="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function ph(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var hh=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function mh(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(hh.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function gh(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(i=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(i.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let o=[t];t.querySelectorAll&&o.push(...t.querySelectorAll("*"));for(let r of o){let i=getComputedStyle(r),s=i.getPropertyValue("backdrop-filter")||i.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var yh=1/16;function bh(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),o=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n-o)<=yh}var Do=new Map,wh=["width","height","min-width","min-height"];function xh(t){let e=Do.get(t);if(e===void 0){e=null;for(let n of wh){let o=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));o&&o[1].endsWith("px")&&((e||={})[n]=o[1])}Do.size>5e3&&Do.clear(),Do.set(t,e)}return e}function Sh(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function vh(t,e){let n=[t];for(;n.length;){let o=n.pop();if(o.nodeType===1){let r=e.nodeMap.get(o);r!==void 0&&(e.nodeMap.delete(o),e.srcToClone.get(r)===o&&e.srcToClone.delete(r)),e.styleMap.delete(o)}for(let r=o.firstChild;r;r=r.nextSibling)n.push(r)}}var ui={attempts:0,served:0,reconciled:0};async function Ll(t,e,n){ui.attempts++;try{let o=await Ch(t,e,n);return o&&ui.served++,o}catch{return null}}async function Ch(t,e,n){let o=e.retained;if(!o||!o.clone||!o.styleMap||!o.srcToClone||n.reconcile||n.clip||n.captureSelection||o.clipWindow||t.scrollTop||t.scrollLeft||ph(t)||mh(o)||o.fontsCSS||$o(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(o.classPrefixCSS&&(o.classPrefixCSS.includes("::marker")||o.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let r=t.ownerDocument||document,i=Cn(t);if(!i||vs(r))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=o.__compressedAssets,n.__compressionDensity=o.__compressionDensity,n.__compressionRootTransform=o.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(Nl)||d.querySelector?.(Nl)||gh(d,i))return null;let h=o.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,g={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:m,options:n},p=Fo(d,null),y=So(d),b;try{b=await fe(d,g,n)}finally{y(),p()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Ye(d,b,g,n),g.__pseudoCSS)||g.__usesPlaceholder&&!o.classPrefixCSS?.includes("[data-sd-ph]"))return null;await no(b,g),Co(b);try{await lo(b,d,m)}catch{}try{co([b,...b.querySelectorAll("*")],o.styleMap,m,n.__iconMatchers)}catch{}if(await Promise.all([Ao(b,n),_o(d,b,o.styleCache,n,m)]),n.compress)try{await Wo(b,n,m)}catch{}for(let[w,S]of m.entries())oi(w,S,m,o.styleCache);h.replaceWith(b),vh(h,o);for(let[w,S]of m.entries())o.nodeMap.set(w,S),o.srcToClone.set(S,w)}let a={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:o.nodeMap,options:n},l=new WeakSet;for(let[d,h]of o.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=o.styleMap.get(d);if(!m)continue;let g=xh(m);if(!g)continue;let p=null,y=!1;for(let b in g){p||=getComputedStyle(h);let w=p.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let S=parseFloat(p.width);p.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(S+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((v,C)=>v+(parseFloat(p.getPropertyValue(C))||0),0)),w=`${S}px`}if(!bh(w,g[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),ui.reconciled++,await xt(h,d,a,n)}}let u=hn(o.styleMap);for(let[d,h]of o.styleMap.entries())Sh(d),ni(d,h,u);let c=(o.classPrefixCSS||"")+Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");Io(o.clone,n.__compressedAssets);let f=await Oo({element:t,options:n,plugins:n.plugins,clone:o.clone,classCSS:c,styleCache:o.styleCache,nodeMap:o.nodeMap},{clipWindow:null,outerTransforms:o.outerTransforms,outerShadows:o.outerShadows,rootTransform2D:o.rootTransform2D,fontsCSS:o.fontsCSS||""});return n.__compressedSnapshot=Lo(o.clone,n.__compressedAssets),o.__compressedAssets=n.__compressedAssets,o.__compressionDensity=n.__compressionDensity,f}Pt();ht();var pi=new WeakMap,zo=new WeakMap,Gl=new WeakSet,di=new WeakMap,kh=64,Ln=new Map,ql=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Mh=["(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 Ah(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Mh.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Il(t){let e=[];for(let n=t;n;){try{let o=n.getBoundingClientRect();e.push(o.x,o.y,o.width,o.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=Dt(n)||null}return e.join("|")}function Wl(t,e){if(e.disposed||(Ln.delete(t),Ln.set(t,e),Ln.size<=kh))return;let[n,o]=Ln.entries().next().value;Xl(n,o)}function Xl(t,e){e.disposed=!0,Ln.delete(t),pi.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of ql)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let o of mi)n.removeEventListener(o,e.onMediaDirty,!0);for(let[n,o]of e.trackedImages)n.removeEventListener("load",o),n.removeEventListener("error",o);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 Yl(t){if(Gl.has(t))return!1;zo.delete(t);let e=[t],n=[],o=[];for(let r=0;r=0&&e.observers.splice(s,1)}for(let r of o)if(!e.trackedShadowRoots.has(r))try{let i=new MutationObserver(e.markDirty);i.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),i.__flush=e.markDirty,e.observers.push(i),e.trackedShadowRoots.set(r,i);for(let s of mi)r.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var mi=["scroll","change","beforetoggle","toggle"];function Uo(t,e){return[t,...e.trackedShadowRoots.keys()]}function gi(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let o of Uo(t,e))o.querySelectorAll&&n.push(...o.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let o=new Set(n);for(let[r,i]of e.trackedImages)o.has(r)||(r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r))}for(let o of n){if(o.complete||e.trackedImages.has(o))continue;let r=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,o.removeEventListener("load",r),o.removeEventListener("error",r),e.trackedImages.delete(o)};e.trackedImages.set(o,r),o.addEventListener("load",r),o.addEventListener("error",r)}}function Ol(t){let e=new Map,n=new Map,o=new Map;for(let r of t)if(we(r))if(r.type==="attributes"){let i=e.get(r.target);i||e.set(r.target,i=new Map),i.has(r.attributeName)||i.set(r.attributeName,r.oldValue)}else if(r.type==="characterData")n.has(r.target)||n.set(r.target,r.oldValue);else if(r.type==="childList"){let i=o.get(r.target);i||o.set(r.target,i=new Map);for(let s of r.addedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)+1)}for(let s of r.removedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)-1)}}else return!0;for(let[r,i]of e)for(let[s,a]of i)if(r.getAttribute(s)!==a)return!0;for(let[r,i]of n)if(r.data!==i)return!0;for(let r of o.values())for(let i of r.values())if(i!==0)return!0;return!1}var Eh=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,rn=t=>t&&(typeof t=="object"||typeof t=="function")?Bo(t):"-";function _h(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let o=t.slice(0,n),r=t.slice(n+1);try{if(/;base64/i.test(o)){let i=Math.ceil(e/3)*4;return atob(r.slice(0,i-i%4))}return r.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(i,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Rh(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=_h(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 Dl(t){let e=String(t||"").trim();return e?Eh.test(e)?!0:/^data:/i.test(e)?Rh(e):!1:!1}function sn(t){let e=String(t||"");if(Dl(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Dl(n[1]??n[2]??n[3]))return!0;return!1}function Bl(t,e=null){let n=t&&t.clone;if(!n)return!1;let o=e?e.map(r=>t.srcToClone?.get(r)).filter(Boolean):[n];for(let r of o)for(let i of Kl(r))if(sn(i.getAttribute?.("src"))||sn(i.getAttribute?.("href"))||sn(i.getAttribute?.("style"))||sn(t.styleMap?.get(i)))return!0;return!1}function Kl(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function yi(t,e){let n=[],o=new Set,r=i=>{i&&!o.has(i)&&(o.add(i),n.push(i))};t.matches?.("input,textarea,select,option")&&r(t);for(let i of Uo(t,e))try{for(let s of i.querySelectorAll("input,textarea,select,option"))r(s)}catch{}e.controls=n}function bi(t,e){let n=[],o=new Set,r=(i,s=!1)=>{if(!(!i||o.has(i))){o.add(i);try{(s||i.scrollLeft||i.scrollTop||i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight)&&n.push(i)}catch{}}};for(let i=t;i;i=i.parentElement)r(i,!0);for(let i of Uo(t,e))for(let s of Kl(i))r(s);e.scrollNodes=n}function zl(t,e){let n=t.ownerDocument||document,o=n.defaultView,r=[o?.location?.hash||"",Ah(n),o?.innerWidth||0,o?.innerHeight||0,o?.devicePixelRatio||1,o?.screen?.orientation?.type||""];try{r.push(...[...n.adoptedStyleSheets||[]].map(rn))}catch{}for(let c of e.trackedShadowRoots.keys())try{r.push("#shadow",...[...c.adoptedStyleSheets||[]].map(rn))}catch{}let i=n.activeElement,s=n.fullscreenElement;(i?.contains(t)||t.contains(i))&&r.push(rn(i)),(s?.contains(t)||t.contains(s))&&r.push(rn(s));let a=[o?.scrollX||0,o?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let f=String(c.localName||"").toLowerCase();f==="input"?l.push(c.type,dn(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):f==="textarea"?l.push(c.value):f==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let u=[];for(let c of e.images){let f="";try{f=c.currentSrc||c.src||""}catch{}u.push(f,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:r.join("|"),scroll:a.join("|"),controls:l,images:u,frameDriven:e.retainedFrameDriven}}function on(t,e,n){if(!t)return!1;let o=t[n],r=e[n];if(o===r)return!0;if(!Array.isArray(o)||o.length!==r.length)return!1;for(let i=0;i[rn(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Fh(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let o of e.trackedShadowRoots.keys())if(o.contains(n))return o;return null}function Th(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:ze(),styleEpoch:xe(),styleStamp:vn(t),outsideMutations:Sn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},o=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},r=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)we(l)&&(e.dirty=!0,o(l.target))},i=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(r);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=r,e.observers.push(a)}catch{}e.markDirty=r,e.onMediaDirty=i;try{for(let a of ql)t.addEventListener(a,i,{capture:!0,passive:!0})}catch{}return hi(t,e)||yi(t,e),bi(t,e),gi(t,e),e}var $h=0,jl=new WeakMap;function Bo(t){let e=jl.get(t);return e||(e="@"+ ++$h,jl.set(t,e)),e}function wi(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(Bo(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Bo(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let i=[];for(let s of t){let a=wi(s,e);if(a===null)return null;i.push(a)}return"["+i.join(",")+"]"}let o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)return JSON.stringify(Bo(t));let r=[];for(let i of Object.keys(t).sort()){let s=t[i];if(s===void 0)continue;let a=wi(s,e);if(a===null)return null;r.push(JSON.stringify(i)+":"+a)}return"{"+r.join(",")+"}"}finally{e.delete(t)}}function Vl(t,e){let{burst:n,invalidate:o,...r}=t||{};try{let i=wi(r,new Set);return i===null?null:`${(e||[]).map(rn).join(",")}:${i}`}catch{return null}}function Jl(t,e,n,o,r=null){let i=pi.get(t);i||(i=Th(t),i.baselineSignature=Vl(e,n.plugins),pi.set(t,i));let s=Vl(e,n.plugins),a=async()=>{if(await Gn(),i.disposed)return o();let u=s===null||s!==i.baselineSignature;u&&s!==null?i.pendingSig===s?(i.baselineSignature=s,i.last=null,i.dirty=!0,i.dirtyRoots=null,i.pendingSig=null,u=!1):i.pendingSig=s:i.pendingSig=null,hi(t,i),gi(t,i);for(let M of i.observers)M.__flush(M.takeRecords());zt();let c=Sn(t);i.dirty&&i.outsideMutations!==c&&i.dirtyAll(),i.outsideMutations=c;let f=t.getRootNode?.(),d=[...i.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),Qn(t.ownerDocument||document,d);let h=vn(t);i.styleStamp!==h&&(i.styleStamp=h,i.dirty||i.dirtyAll());let m=zl(t,i),g=Ul(t,i);m.animation=Hl(g),i.renderState&&(!on(i.renderState,m,"style")&&(Ue(),i.dirtyAll()),on(i.renderState,m,"scroll")||i.dirtyAll(),on(i.renderState,m,"controls")||(Se(t),i.dirtyAll()),!on(i.renderState,m,"images")&&!i.dirty&&i.dirtyAll());let p=ze();i.envEpoch!==p&&(i.dirtyAll(),i.envEpoch=p);let y=xe();if(i.styleEpoch!==y&&(i.styleEpoch=y,!i.dirty)){let M=Il(t);i.geometry!==null&&M!==i.geometry&&(Se(t),i.dirtyAll()),i.geometry=M}n.invalidate&&i.dirtyAll();let b=!1,w=!!i.renderState&&!on(i.renderState,m,"animation");try{let M=new Set;w&&g.length===0&&(M=null);for(let F of g){let T=F.playState==="running";if(!T&&!w)continue;T&&(b=!0),w=!0;let A=F.effect?.target;if(Fh(t,i,A)===t)M.add(A);else{M=null;break}}if(w&&M&&M.size&&i.retained){i.dirty=!0;for(let F of M)i.dirtyRoots&&i.dirtyRoots.add(F),Se(F)}else w&&!M&&i.dirtyAll()}catch{}let S=m.frameDriven,v=b||S;if(v&&(i.last=null),S&&i.dirtyAll(),!u&&!v&&!i.dirty&&i.last)return Wl(t,i),i.last;i.capturing=!0;let C=null;try{let M=null,F=!1,T=null;if(!u&&i.dirty&&i.retained&&i.dirtyRoots&&i.dirtyRoots.size&&r){T=[...i.dirtyRoots];let A=await Ll(t,i,n);A&&(M=await r(A),F=!0)}if(M||(u||(n.__retain=A=>{let x=new Map;for(let[_,E]of A.nodeMap.entries())x.set(E,_);C={...A,srcToClone:x}}),n.__tornSinceStart=()=>{for(let A of i.observers)for(let x of A.takeRecords())i.pending.push(x);return zt(),i.torn||Ol(i.pending)||Sn(t)!==c},M=await o()),!u&&!i.disposed){i.dirty=!1,i.dirtyRoots=new Set,C?(i.retained=C,i.retainedFrameDriven=Bl(C),yi(t,i),bi(t,i)):F&&(i.retainedFrameDriven||=Bl(i.retained,T),yi(t,i),bi(t,i));let A=zl(t,i);A.animation=Hl(Ul(t,i));let x=["style","scroll","controls","images"];b||x.push("animation");let _=x.every(E=>on(m,A,E));i.renderState=A,i.styleEpoch=xe(),i.styleStamp=vn(t),i.geometry=Il(t),i.renderState.frameDriven?(Gl.add(t),Xl(t,i)):_?!v&&!i.renderState.frameDriven&&(i.last=M,Wl(t,i)):(i.dirtyAll(),i.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let F of i.observers)for(let T of F.takeRecords())i.pending.push(T);zt();let M=Sn(t);(i.torn||Ol(i.pending)||M!==c)&&(i.dirtyAll(),i.last=null),i.outsideMutations=M,i.styleEpoch=xe(),i.styleStamp=vn(t),i.pending.length=0,i.torn=!1,i.capturing=!1,i.disposed||(hi(t,i),gi(t,i))}},l=i.inflight.then(a,a);return i.inflight=l.catch(()=>{}),l}var Ho=null;function tc(t){Ho=t}var Ph='button, a[href], [role="button"], input, select, summary, label, [tabindex]',xi=!1,In=null,Si=new WeakMap,Ql=!1;function ec(t,e){!xi||!In||e&&e.burst===!1||Si.set(In.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function nc(t){let e={control:t};In=e,setTimeout(()=>{In===e&&(In=null)},0)}function Ci(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Ph):null}function Zl(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Ci(t);e&&(nc(e),vi(t,!1))}function Nh(t){let e=Ci(t);e&&nc(e)}function vi(t,e=!0){if(!Ho||document.visibilityState==="hidden")return;let n=Ci(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let o=Si.get(n);if(o){if(!o.element.isConnected){Si.delete(n);return}Ho(o.element,o.options).catch(()=>{});return}e&&!Ql&&(Ql=!0,Ho(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function oc(){if(xi||typeof document>"u"||typeof document.addEventListener!="function")return;xi=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Zl,t),document.addEventListener("keydown",Zl,t),document.addEventListener("click",Nh,t),document.addEventListener("pointerenter",vi,t),document.addEventListener("focusin",vi,t)}At();function im(...t){return si(...t),Z}async function sm(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Q(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await vt();let o=Array.from(n.childNodes).some(i=>i.nodeType===3&&i.textContent.trim()),r=n.children.length===1&&!o?n.firstElementChild:n;return await Wi(r,{...e||{},burst:!1})}finally{n.remove()}}var am="3.7.0",Z=Object.assign(Wi,{plugins:im,fromString:sm,version:am,preCapture:oc});tc(Wi);var Ii=Symbol("snapdom.internal"),lm=Symbol("snapdom.internal.silent"),Ec=new Set(["png","jpeg","jpg","webp","svg"]);async function Wi(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Pl(e);n.element=t,n.invalidate&&Ue(),wl(n,e&&e.plugins);let{stage:o,loweredBy:r}=ml(n);n.needs=o,n.__needsLoweredBy=r;let i=Ze(o,"render"),s=n.burst===!0||!$o(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=i&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Yl(t);return u&&ec(t,e),n.snap||(n.snap={toPng:(c,f)=>Z.toPng(c,f),toSvg:(c,f)=>Z.toSvg(c,f)}),u?Jl(t,e,n,()=>Z.capture(t,n,Ii),c=>_c(c,n)):(await Gn(),Z.capture(t,n,Ii))}Z.capture=async(t,e,n)=>{if(n!==Ii)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Ze(e.needs||Ct,"render")&&Y()){if(e.embedFonts)try{let i=t.ownerDocument||document,s=null;if(e.embedFonts==="auto"&&(t.getBoundingClientRect(),s=go(i).drawn,s.size===0))throw null;let a=yo(t);e.clip||(e.__fontUsage=a);let l=a.required;if(s&&(l=new Set([...l].filter(u=>s.has(_n(u).toLowerCase()))),l.size===0))throw null;await bo(l,a.usedCodepoints,i)}catch{}let r=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&r.unshift(t);for(let i of r)try{if(En(i))continue;let s=i.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"Couldn't prepare canvases for Safari.",s)}}let o=await $l(t,e);return _c(o,e)};async function _c(t,e){let n=e.needs||Ct,o=Ze(n,"render"),r=k=>yl(n,e.__needsLoweredBy||[],k),i=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=i?null:t,a=()=>s??=i.toDataURL(),l=i||t;i&&(t="");let u=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),g=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,p=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=k=>{if(i||!u?.size)return l;let I=d.vbW,L=d.vbH,P=k.crop;P&&(I=Math.max(1,Math.min(I,P.x+P.width)-Math.max(0,P.x)),L=Math.max(1,Math.min(L,P.y+P.height)-Math.max(0,P.y)));let N=Number.isFinite(k.width),B=Number.isFinite(k.height);return(N&&B?Math.max(k.width/I,k.height/L):N?k.width/I*(P?Math.max(1,p/g):1):B?k.height/L*(P?Math.max(1,g/p):1):(k.scale||1)*Math.max(g,p))*(k.dpr||1)<=c?l:f??=Ml(a(),u)},b=async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On));return L(l,{...k,...I||{},format:"png"})},w=()=>{if(!o)throw r("svgString");if(i)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let k=t.indexOf(",");return k>=0?decodeURIComponent(t.slice(k+1)):""},S=k=>Object.defineProperty({...k||{},svgString:w},"url",o?{get:a,enumerable:!0}:{get(){throw r("export.url")},enumerable:!1,configurable:!0}),v={img:async(k,I)=>{if(i)return b(k,I);let{toImg:L}=await Promise.resolve().then(()=>($i(),Ti)),P={...k,...I||{}};return L(y(P),P)},svg:async(k,I)=>{if(i)return b(k,I);let{toSvg:L}=await Promise.resolve().then(()=>($i(),Ti)),P={...k,...I||{}};return L(y(P),P)},canvas:async(k,I)=>{let{toCanvas:L}=await Promise.resolve().then(()=>(Re(),fc)),P={...k,...I||{}};return L(y(P),P)},blob:async(k,I)=>{let{toBlob:L}=await Promise.resolve().then(()=>(Li(),Cc)),P={...k,...I||{}};return L(y(P),P)},png:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On)),P={...k,...I||{},format:"png"};return L(y(P),P)},jpeg:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On)),P={...k,...I||{},format:"jpeg"};return L(y(P),P)},webp:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On)),P={...k,...I||{},format:"webp"};return L(y(P),P)},download:async(k,I)=>{let{download:L}=await Promise.resolve().then(()=>(Ac(),Mc)),P={...k,...I||{}};return L(y(P),P)}};if(!o)for(let k of Object.keys(v)){let I=k==="download"?"download()":`to${k.charAt(0).toUpperCase()}${k.slice(1)}()`;v[k]=async()=>{throw r(I)}}let C={};for(let k of["img","svg","canvas","blob","png","jpeg","webp"])C[k]=async I=>v[k](e,{..._(k,I||{}),[lm]:!0});C.jpg=C.jpeg;let M=k=>Object.defineProperty({...e,...k},"options",{value:e,configurable:!0}),F=M({artifacts:e.__artifacts||null,export:S(),exports:C}),T=await To("defineExports",F),A=Object.assign({},...T.filter(k=>k&&typeof k=="object").reverse()),x={...v,...A};x.jpeg&&!x.jpg&&(x.jpg=(k,I)=>x.jpeg(k,I));function _(k,I){let L=I||{},P={...e,...L},N=typeof L.type=="string"?L.type.toLowerCase():"",B=typeof L.format=="string"?L.format.toLowerCase():Ec.has(N)?N:"";B&&(P.format=B==="jpg"?"jpeg":B),P.__explicitFormat=B?P.format:e.__explicitFormat??null,k==="blob"&&!P.__explicitFormat&&(P.format=i?"png":"svg"),P.type=P.format;let U=z=>z==="jpeg"||z==="jpg"||z==="webp";return[k,P.format,N].map(z=>typeof z=="string"?z.toLowerCase():"").find(U)&&(P.backgroundColor==null||P.backgroundColor==="transparent")&&(P.backgroundColor="#ffffff"),P.scale!==1&&(Number.isFinite(P.width)||Number.isFinite(P.height))&&D(P,"scale ignored: width/height already set the size."),P}let E=!1,$=Promise.resolve();async function R(k,I){let L=Object.freeze(I&&typeof I=="object"?{...I}:{}),P=async()=>{let B=x[k];if(!B)throw new Error(`[SnapDOM] Unknown export type: ${k}`);let U=_(k,L),V=M({artifacts:e.__artifacts||null,export:S({type:k,options:U,requestedOptions:L})}),z=U.format,at=U.type;await To("beforeExport",V,{format:k,options:U});let rt=U.format!==z?U.format:U.type!==at?U.type:"",pt=typeof rt=="string"?rt.toLowerCase():"";Ec.has(pt)&&(U.format=pt==="jpg"?"jpeg":pt,U.type=U.format,U.__explicitFormat=U.format,/^(?:jpeg|webp)$/.test(U.format)&&(U.backgroundColor==null||U.backgroundColor==="transparent")&&(U.backgroundColor="#ffffff"));let kt=await B(V,U);return await To("afterExport",V,{format:k,options:U,result:kt}),E||(E=!0,await Qt("afterSnap",e)),kt},N=$.then(P);return $=N.catch(()=>{}),N}let W={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!o)throw r("toRaw()");return a()},to:(k,I)=>R(k,I),toImg:k=>R("img",k),toSvg:k=>R("svg",k),toCanvas:k=>R("canvas",k),toBlob:k=>R("blob",k),toPng:k=>R("png",k),toJpg:k=>R("jpg",k),toWebp:k=>R("webp",k),download:k=>R("download",k)};o?i&&Object.defineProperty(W,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(W,"url",{get(){throw r("url")},enumerable:!1,configurable:!0}),Object.defineProperty(W,"meta",o?{value:e.meta,enumerable:!0}:{get(){throw r("meta")},enumerable:!1,configurable:!0});for(let k of Object.keys(x)){let I="to"+k.charAt(0).toUpperCase()+k.slice(1);W[I]||(W[I]=L=>R(k,L))}return W}Z.toRaw=(t,e)=>Z(t,e).then(n=>n.toRaw());Z.toImg=(t,e)=>Z(t,e).then(n=>n.toImg());Z.toSvg=(t,e)=>Z(t,e).then(n=>n.toSvg());Z.toCanvas=(t,e)=>Z(t,e).then(n=>n.toCanvas());Z.toBlob=(t,e)=>Z(t,e).then(n=>n.toBlob());Z.toPng=(t,e)=>Z(t,{...e,format:"png"}).then(n=>n.toPng());Z.toJpg=(t,e)=>Z(t,{...e,format:"jpeg"}).then(n=>n.toJpg());Z.toWebp=(t,e)=>Z(t,{...e,format:"webp"}).then(n=>n.toWebp());Z.download=(t,e)=>Z(t,e).then(n=>n.download());export{Ct as DEFAULT_STAGE,Qe as STAGES,gl as assertNeeds,Np as clearPlugins,ai as getGlobalPlugins,en as normalizePlugin,si as registerPlugins,Z as snapdom};