@zumer/snapdom 3.3.0 → 3.3.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/snapdom.js +9 -9
- package/dist/snapdom.mjs +3 -3
- package/package.json +1 -1
package/dist/snapdom.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* SnapDOM
|
|
3
|
-
* v3.3.0
|
|
3
|
+
* v3.3.1-dev.0
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";(()=>{var fc=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var be=(t,e)=>{for(var n in e)fc(t,n,{get:e[n],enumerable:!0})};function Zo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function ti(t="soft"){t==="disabled"&&(I.computedStyle=new WeakMap,I.measureHints=new WeakMap,I.baseStyle=new lt(50),I.defaultStyle=new lt(64),I.image=new lt(100),I.background=new lt(100),I.resource=new lt(150),I.compress=new lt(50))}var lt,I,gt=ct(()=>{"use strict";lt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},I={image:new lt(100),background:new lt(100),resource:new lt(150),defaultStyle:new lt(64),baseStyle:new lt(50),compress:new lt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function re(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function dc(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function Ge(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of dc(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!uc.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),u=1;if(c){let l=parseFloat(c[1]);u=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:u})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function kr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function qt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Mr(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 Xe(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function Ar(t){return"\u2022".repeat(String(t??"").length)}function it(t,e){return t?.nodeType===1&&t.localName===e}function Rt(t){return t?.nodeType===1&&t.namespaceURI===pc}function It(t){return t?.nodeType===1&&t.namespaceURI===hc}function Ot(t){return t?.nodeType===11&&!!t.host}function _r(t){return t?.nodeType===9}var Cr,uc,pc,hc,Ct=ct(()=>{"use strict";Cr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,uc=Cr;pc="http://www.w3.org/1999/xhtml",hc="http://www.w3.org/2000/svg"});function mc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let u=Date.now();(r.get(a)||0)>u||(r.set(a,u+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function ri(t,e,n){if(Dt.size>=ni){let r=Date.now();for(let[i,o]of Dt)o.until<=r&&Dt.delete(i);for(;Dt.size>=ni;)Dt.delete(Dt.keys().next().value)}Dt.set(t,{until:Date.now()+n,result:e})}function gc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function yc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function bc(t,e){if(!e||gc(t)||yc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function wc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>qt(t)).replace("{url}",()=>encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${qt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function oi(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Sc(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 ii(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function Rr(t,e){try{t.onError?.(e)}catch{}}async function ft(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),v=new Uint8Array([...w].map(S=>S.charCodeAt(0))),C=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:C,status:200,url:t,fromCache:!1,mime:C.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await oi(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:t,fromCache:!1,mime:b}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c;try{c=Sc(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return Rr(e,g),g}let u=Dt.get(c);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Dt.delete(c);let l=Er.get(c);if(l)return l;let f=bc(t,i)?wc(t,i):t,p=e.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),d=(async()=>{try{let g=await fetch(f,{signal:h.signal,credentials:p,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&ri(c,w,o),!a){let v=`${g.status} ${g.statusText||""}`.trim();ei.warnOnce(`http:${g.status}:${n}:${ii(t)}`,`Couldn't load ${t} (HTTP ${v}).`)}return Rr(e,w),w}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await oi(y),blob:y,status:g.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:f,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&ri(c,b,o),!a){let w=`${y}:${n}:${ii(t)}`,v=y==="timeout"?`Timed out loading ${t} after ${r}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;ei.errorOnce(w,v)}return Rr(e,b),b}finally{clearTimeout(m),Er.delete(c)}})();return c!==null&&Er.set(c,d),d}var ei,Er,ni,Dt,we=ct(()=>{"use strict";Ct();ei=mc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),Er=new Map,ni=50,Dt=new Map});async function Se(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ge(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(t);if(!r)return t;let i=Mr(r),o=qt(i),s=(e.useProxy||"")+"|"+o;if(I.background.has(s)){let a=I.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ft(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(I.background.set(s,a.data),`url("${a.data}")`):(I.background.set(s,null),"none")}catch{return I.background.set(s,null),"none"}}var si=ct(()=>{"use strict";gt();Ct();we()});function Ac(t){let e=t.replace(Mc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function li(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&Cc.test(o.selectorText);for(let u=0;u<s.length;u++){let l=s[u];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let f=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;f&&!r[f]&&kc.test(s.getPropertyValue(l))&&(r[f]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||ci.test(a)||a.includes("+")||a.includes("~")))for(let c of Pr(a,",")){let u=c.trim();u&&(r.inContainer||ci.test(u)||u.includes("+")||u.includes("~"))&&r.shareUnsafeSels.add(u)}if(a&&a.includes(":"))for(let c in ai)ai[c].test(a)&&n[c].push(Ac(a));if(o.styleSheet){if(!bn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let u=li(o.cssRules,e,n,r);if(c&&r.inContainer--,!u)return!1}}return!0}function bn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?li(i,e,n,r):!1}function Tr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function fi(t){let e=new Set;return bn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Pr(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(a==="\\"){s++;continue}if(i){a===i&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function _c(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let f=t[l];if(n){f===n&&t[l-1]!=="\\"&&(n=null);continue}f==='"'||f==="'"?n=f:f==="("||f==="["?e++:f===")"||f==="]"?e--:e===0&&(f===" "||f===">"||f==="+"||f==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let u=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function ui(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function Ec(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=ui(n,o)}return r}function di(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(Fr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let u of t.styleSheets)if(!bn(u,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let u of o)if(!bn(u,n,r,i))return e}typeof t.getAnimations=="function"&&Tr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=ui(t.createElement("div"),s)===null?null:s.map(u=>({sel:u,key:_c(u)})),c=new Set(vc);for(let u of xc)n.has(u)&&c.add(u);for(let u of i.pseudoProps)c.add(u);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&c.add("transform-origin"),i.pseudoProps.has("perspective")&&c.add("perspective-origin"),{universe:n,pseudoUniverse:c,pseudoGates:Ec(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var Fr,xc,vc,Cc,kc,ai,Mc,ci,wn=ct(()=>{"use strict";Fr=["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"],xc=["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"],vc=["display","width","height","min-width","min-height"],Cc=/::?(?:before|after|first-letter|first-line|marker)/,kc=/%|\bauto\b|calc\(|var\(/i,ai={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Mc=/::?(?:before|after|first-letter|first-line|marker)\b/g;ci=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function Z(t){return pi.add(t),t.setAttribute("data-snapdom-internal",""),t}function Gt(t){return pi.has(t)}var pi,kt=ct(()=>{"use strict";pi=new WeakSet});function Nr(t){if(t=String(t).toLowerCase(),Ye.has(t)){let o={};return I.defaultStyle.set(t,o),o}if(I.defaultStyle.has(t))return I.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);e||(e=document.createElement("div"),Z(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(xe(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of Fr)!(o in i)&&!xe(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),I.defaultStyle.set(t,i),i}function xe(t){let e=hi.get(t);if(e===void 0){let n=String(t).toLowerCase();e=Tc.has(n)||Fc.test(n)||Rc.test(n),hi.set(t,e)}return e}function gi(t,e){let n=Ic.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function Sn(t,e){return!$c.has(t)&&(e==="inline"||Pc.has(t)||mi.has(t))}function Lr(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||mi.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!Dc.has(r)}function ve(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ye.has(e))return"";let i=[],o=Nr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=Sn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",l=u==="nowrap"||u==="pre",p=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(xe(m)||gi(m,t))continue;let d=t[m];if(p){if(Nc.has(m))continue;if(Lc.has(m)){d&&d!==o[m]&&(i.push(`${m}:${d}`),d!=="auto"&&(h=!0));continue}}if(d&&d!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&d.endsWith("px")&&d.includes(".")){let g=parseFloat(d);if(Number.isFinite(g)){i.push(`${m}:${(g+Oc).toFixed(3)}px`);continue}}i.push(`${m}:${d}`)}}if(p&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Ir(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 Or(t,e=null){let n=new Map;for(let s of t){let a=Nr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!gi(p,a)).map(([p,h])=>`${p}:${h};`).sort(),f=l.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:l}),n.get(f).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??(i=new Set);let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
|
|
6
|
+
"use strict";(()=>{var fc=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var be=(t,e)=>{for(var n in e)fc(t,n,{get:e[n],enumerable:!0})};function Zo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function ti(t="soft"){t==="disabled"&&(I.computedStyle=new WeakMap,I.measureHints=new WeakMap,I.baseStyle=new lt(50),I.defaultStyle=new lt(64),I.image=new lt(100),I.background=new lt(100),I.resource=new lt(150),I.compress=new lt(50))}var lt,I,gt=ct(()=>{"use strict";lt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},I={image:new lt(100),background:new lt(100),resource:new lt(150),defaultStyle:new lt(64),baseStyle:new lt(50),compress:new lt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function re(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function dc(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function Ge(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of dc(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!uc.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),u=1;if(c){let l=parseFloat(c[1]);u=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:u})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function kr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function qt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Mr(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 Xe(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function Ar(t){return"\u2022".repeat(String(t??"").length)}function it(t,e){return t?.nodeType===1&&t.localName===e}function Rt(t){return t?.nodeType===1&&t.namespaceURI===pc}function It(t){return t?.nodeType===1&&t.namespaceURI===hc}function Ot(t){return t?.nodeType===11&&!!t.host}function _r(t){return t?.nodeType===9}var Cr,uc,pc,hc,Ct=ct(()=>{"use strict";Cr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,uc=Cr;pc="http://www.w3.org/1999/xhtml",hc="http://www.w3.org/2000/svg"});function mc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let u=Date.now();(r.get(a)||0)>u||(r.set(a,u+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function ri(t,e,n){if(Dt.size>=ni){let r=Date.now();for(let[i,o]of Dt)o.until<=r&&Dt.delete(i);for(;Dt.size>=ni;)Dt.delete(Dt.keys().next().value)}Dt.set(t,{until:Date.now()+n,result:e})}function gc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function yc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function bc(t,e){if(!e||gc(t)||yc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function wc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>qt(t)).replace("{url}",()=>encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${qt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function oi(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Sc(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 ii(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function Rr(t,e){try{t.onError?.(e)}catch{}}async function ft(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),v=new Uint8Array([...w].map(S=>S.charCodeAt(0))),C=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:C,status:200,url:t,fromCache:!1,mime:C.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await oi(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:t,fromCache:!1,mime:b}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c;try{c=Sc(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return Rr(e,g),g}let u=Dt.get(c);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Dt.delete(c);let l=Er.get(c);if(l)return l;let f=bc(t,i)?wc(t,i):t,d=e.credentials;if(!d)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),p=(async()=>{try{let g=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&ri(c,w,o),!a){let v=`${g.status} ${g.statusText||""}`.trim();ei.warnOnce(`http:${g.status}:${n}:${ii(t)}`,`Couldn't load ${t} (HTTP ${v}).`)}return Rr(e,w),w}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await oi(y),blob:y,status:g.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:f,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&ri(c,b,o),!a){let w=`${y}:${n}:${ii(t)}`,v=y==="timeout"?`Timed out loading ${t} after ${r}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;ei.errorOnce(w,v)}return Rr(e,b),b}finally{clearTimeout(m),Er.delete(c)}})();return c!==null&&Er.set(c,p),p}var ei,Er,ni,Dt,we=ct(()=>{"use strict";Ct();ei=mc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),Er=new Map,ni=50,Dt=new Map});async function Se(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ge(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(t);if(!r)return t;let i=Mr(r),o=qt(i),s=(e.useProxy||"")+"|"+o;if(I.background.has(s)){let a=I.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ft(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(I.background.set(s,a.data),`url("${a.data}")`):(I.background.set(s,null),"none")}catch{return I.background.set(s,null),"none"}}var si=ct(()=>{"use strict";gt();Ct();we()});function Ac(t){let e=t.replace(Mc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function li(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&Cc.test(o.selectorText);for(let u=0;u<s.length;u++){let l=s[u];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let f=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;f&&!r[f]&&kc.test(s.getPropertyValue(l))&&(r[f]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||ci.test(a)||a.includes("+")||a.includes("~")))for(let c of Pr(a,",")){let u=c.trim();u&&(r.inContainer||ci.test(u)||u.includes("+")||u.includes("~"))&&r.shareUnsafeSels.add(u)}if(a&&a.includes(":"))for(let c in ai)ai[c].test(a)&&n[c].push(Ac(a));if(o.styleSheet){if(!bn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let u=li(o.cssRules,e,n,r);if(c&&r.inContainer--,!u)return!1}}return!0}function bn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?li(i,e,n,r):!1}function Tr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function fi(t){let e=new Set;return bn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Pr(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(a==="\\"){s++;continue}if(i){a===i&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function _c(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let f=t[l];if(n){f===n&&t[l-1]!=="\\"&&(n=null);continue}f==='"'||f==="'"?n=f:f==="("||f==="["?e++:f===")"||f==="]"?e--:e===0&&(f===" "||f===">"||f==="+"||f==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let u=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function ui(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function Ec(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=ui(n,o)}return r}function di(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(Fr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let u of t.styleSheets)if(!bn(u,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let u of o)if(!bn(u,n,r,i))return e}typeof t.getAnimations=="function"&&Tr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=ui(t.createElement("div"),s)===null?null:s.map(u=>({sel:u,key:_c(u)})),c=new Set(vc);for(let u of xc)n.has(u)&&c.add(u);for(let u of i.pseudoProps)c.add(u);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&c.add("transform-origin"),i.pseudoProps.has("perspective")&&c.add("perspective-origin"),{universe:n,pseudoUniverse:c,pseudoGates:Ec(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var Fr,xc,vc,Cc,kc,ai,Mc,ci,wn=ct(()=>{"use strict";Fr=["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"],xc=["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"],vc=["display","width","height","min-width","min-height"],Cc=/::?(?:before|after|first-letter|first-line|marker)/,kc=/%|\bauto\b|calc\(|var\(/i,ai={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Mc=/::?(?:before|after|first-letter|first-line|marker)\b/g;ci=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function Z(t){return pi.add(t),t.setAttribute("data-snapdom-internal",""),t}function Gt(t){return pi.has(t)}var pi,kt=ct(()=>{"use strict";pi=new WeakSet});function Nr(t){if(t=String(t).toLowerCase(),Ye.has(t)){let o={};return I.defaultStyle.set(t,o),o}if(I.defaultStyle.has(t))return I.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);e||(e=document.createElement("div"),Z(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(xe(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of Fr)!(o in i)&&!xe(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),I.defaultStyle.set(t,i),i}function xe(t){let e=hi.get(t);if(e===void 0){let n=String(t).toLowerCase();e=Tc.has(n)||Fc.test(n)||Rc.test(n),hi.set(t,e)}return e}function gi(t,e){let n=Ic.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function Sn(t,e){return!$c.has(t)&&(e==="inline"||Pc.has(t)||mi.has(t))}function Lr(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||mi.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!Dc.has(r)}function ve(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ye.has(e))return"";let i=[],o=Nr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=Sn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",l=u==="nowrap"||u==="pre",d=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(xe(m)||gi(m,t))continue;let p=t[m];if(d){if(Nc.has(m))continue;if(Lc.has(m)){p&&p!==o[m]&&(i.push(`${m}:${p}`),p!=="auto"&&(h=!0));continue}}if(p&&p!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&p.endsWith("px")&&p.includes(".")){let g=parseFloat(p);if(Number.isFinite(g)){i.push(`${m}:${(g+Oc).toFixed(3)}px`);continue}}i.push(`${m}:${p}`)}}if(d&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Ir(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 Or(t,e=null){let n=new Map;for(let s of t){let a=Nr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!gi(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=l.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:l}),n.get(f).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??(i=new Set);let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
|
|
7
7
|
`}for(let{tagList:s,declarations:a}of r){let c=r.length>1?a.filter(l=>!i.has(l)):a;if(!c.length)continue;let u=c.join("");o+=`${s.join(",")} { ${u} }
|
|
8
|
-
`}return o}function Ke(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of e)n.set(i,`c${r++}`);return n}function Wc(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 r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function O(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(t?.nodeType!==1){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=I.computedStyle.get(t);r||(r=new Map,I.computedStyle.set(t,r));let i=r.get(e);if(!i){let o=Wc(t),s=null;try{s=o&&typeof o.getComputedStyle=="function"?o.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(),r.set(e,i)}return i}function Ce(t,e=null){let n={};for(let r of e||t){let i=t.getPropertyValue(r);i&&(n[r]=i)}for(let r of Bc){let i=n[`border-${r}-style`],o=n[`border-${r}-width`];(i==="none"||i==="hidden"||o==="0px")&&(delete n[`border-${r}-style`],delete n[`border-${r}-width`],delete n[`border-${r}-color`])}return n}function Xt(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var $r,Ye,Rc,Fc,Tc,hi,Pc,mi,$c,Nc,Lc,Ic,Oc,Dc,Bc,ke=ct(()=>{"use strict";gt();wn();kt();$r=new Set(["meta","script","noscript","title","link","template"]),Ye=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"]);Rc=/(?:^|-)(animation|transition)(?:-|$)/i,Fc=/^(--.+|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,Tc=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"]),hi=new Map;Pc=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),mi=new Set(["table","thead","tbody","tfoot","tr","td","th"]),$c=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Nc=new Set(["width","max-width","inline-size","max-inline-size"]),Lc=new Set(["min-width","min-inline-size"]),Ic=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"}));Oc=.001;Dc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);Bc=["top","right","bottom","left"]});function yt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,r=()=>{n||(n=!0,e())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,t)})}function bi(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?Uc:yi),n=null,r={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=new Promise(i=>{let o=()=>{n=null,r.yielded=!0,e=performance.now()+yi,i()},s=new MessageChannel;s.port1.onmessage=o,s.port2.postMessage(0)}))};return r}function Qe(){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 X(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),r=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),s=r&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&r;return n||s||a||c||u}function bt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var yi,Uc,mt=ct(()=>{"use strict";yi=16,Uc=40});function H(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function Mt(t,e,n,r){let i=t&&t.warnings;i&&i.length<zc&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var zc,oe=ct(()=>{"use strict";zc=50});var wt=ct(()=>{"use strict";si();ke();mt();Ct();oe()});var Ja={};be(Ja,{MAX_RASTER_AREA:()=>te,MAX_RASTER_SIDE:()=>Pt,cropSvgText:()=>hr,decodeSvgFromDataURL:()=>pe,encodeSvgToDataURL:()=>he,fixSafariShadows:()=>gr,peekSvgHeader:()=>mr,toCanvas:()=>Ut});function Cd(t,e){try{let n=t.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return t;let s=Math.min(1,Pt/i,Pt/o,Math.sqrt(te/(i*o)));if(s>=1)return t;let a=Math.max(1,Math.floor(i*s)),c=Math.max(1,Math.floor(o*s));return Mt(e,"raster-clamp",`capture ${Math.round(i)}x${Math.round(o)}px exceeds decode limits; downscaled to ${a}x${c}px`),console.warn(`[SnapDOM] ${Math.round(i)}\xD7${Math.round(o)}px is too large for the browser to draw; scaled down to ${a}\xD7${c}px. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return t}}function hr(t,e){let n=["x","y","width","height"].map(S=>Number(e?.[S]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let r=t.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||"").trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[a,c,u,l]=s,f=Math.max(a,n[0]),p=Math.max(c,n[1]),h=Math.min(a+u,n[0]+n[2]),m=Math.min(c+l,n[1]+n[3]);if(!(h>f)||!(m>p))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let d=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(d)&&d>0?d/u:1,b=Number.isFinite(g)&&g>0?g/l:1,w=Math.max(1,(h-f)*y),v=Math.max(1,(m-p)*b),C=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${v}`).replace(/(\bviewBox=")[^"]*/i,`$1${f} ${p} ${h-f} ${m-p}`);return t.replace(i,C)}function Bo(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function pe(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function mr(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 he(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Ka(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function kd(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",u="0px"]=s;u=`${parseFloat(u)/2}px`;let l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!l&&l!==",";i.push(`drop-shadow(${a} ${c} ${u}${f?` ${l}`:""})`)}return i.join(" ")}function Qa(t){let e=Ka(t),n=null,r=null,i=null,o=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let u=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();u==="box-shadow"?i=l:u==="filter"?n=l:u==="-webkit-filter"?r=l:o.push([u,l])}if(i){let a=kd(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,c])=>`${a}:${c}`).join(";")}function Md(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Qa(r)}}`)}function Ad(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Md(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Qa(r)}${n}`),t}function _d(){return ur||(ur=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',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 r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),ur)}function Ed(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",c=0;for(;c<i.length;){let u=i[c];if(u==="("?o++:u===")"&&(o=Math.max(0,o-1)),o===0&&(c===0||i[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(i.slice(c));if(l){s++,a+=s===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=u,c++}return a}).join(",")}function Rd(t,e){let n=r=>Ka(r).map(i=>{let o=i.indexOf(":");if(o<0)return i;let s=i.slice(0,o).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Ed(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(r,i)=>r.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(o,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(r,i,o)=>`style=${i}${n(o)}${i}`),t}async function gr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await _d();try{let i=t;return n||(i=Ad(i)),r&&(i=Rd(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Fd(){let t=document.createElement("canvas");t.width=16,t.height=16;let e=t.getContext("2d",{willReadFrequently:!0});return e?n=>{e.clearRect(0,0,16,16),e.drawImage(n,0,0,16,16);let r=e.getImageData(0,0,16,16).data;for(let i=3;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function Td(t,e,n){Z(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await dr(),await dr(),!1;let r=performance.now()+(e?600:150);for(;;){let i;try{i=n(t)}catch{return!1}if(i)return!0;if(performance.now()>r)return!1;await dr()}}finally{try{t.remove()}catch{}}}function Xa(t){if(typeof document>"u"||!document.body)return new Image;if(Et&&!Et.contentDocument){try{Et.remove()}catch{}Et=null}if(Et&&pr>Pd&&hn===0){try{Et.remove()}catch{}Et=null}if(!Et){let n=document.createElement("iframe");Z(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)Et=n,pr=0;else{try{n.remove()}catch{}return new Image}}pr+=t.length,hn+=1;let e=Et.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function zo(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,hn=Math.max(0,hn-1),e&&(Uo=!0),Uo&&hn===0&&(Et?.remove(),Et=null,pr=0,Uo=!1))}function Ya(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Od(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),r=0,i=0;for(let o=e;o+48<=t.length;o+=n){let s=t.slice(o,o+48);r++,Id.some(a=>s.includes(a))||i++}return i*2>r}function Ho(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>$d&&!Od(i)?Math.min(Ld,Math.ceil(o/Nd)):1;if(s===1){t.drawImage(e,0,0,n,r);return}let a=e.naturalWidth,c=e.naturalHeight/r;for(let u=0;u<s;u++){let l=Math.round(u*r/s),f=u===s-1?r:Math.round((u+1)*r/s);t.drawImage(e,0,l*c,a,(f-l)*c,0,l,n,f-l)}}async function Ut(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:c=null}=e,u=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,l=t,f=!1,p=!1;if(c&&!Bo(t))throw new RangeError("[SnapDOM] Only SVG captures can be cropped.");if(Bo(t)){let m=(mr(t).match(/<svg\b[^>]*>/i)||[])[0]||"",d=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(d)&&Number.isFinite(g)&&d>0&&g>0&&Math.min(1,Pt/d,Pt/g,Math.sqrt(te/(d*g)))<1;if(c||y||X())try{let b=pe(t);if(c&&(b=hr(b,c)),X()){let w=await gr(b);b=w.svg,f=w.naturalOnly,p=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Cd(b,e.__session)),l=he(b)}catch(b){if(c)throw b;l=t}}let h=u||Xa(l);try{u||await Ya(h,l)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let d=h;h=Xa(l),zo(d);try{await Ya(h,l)}catch(g){throw zo(h,e.__releaseDecodeFrame),g}}try{!u&&!X()&&!bt()&&Bo(l)&&/(?:%40|@)font-face/i.test(l)&&await new Promise(P=>{let A=new MessageChannel;A.port1.onmessage=()=>{A.port1.close(),A.port2.close(),P()},A.port2.postMessage(0)});let m=X()&&!u?Fd():null,d=!1;m&&(d=await Td(h,p,m));let g=u?u.width:h.naturalWidth,y=u?u.height:h.naturalHeight,b=c?g:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:g,w=c?y:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:y,v,C,S=Number.isFinite(n),M=Number.isFinite(r);if(S&&M)v=Math.max(1,n),C=Math.max(1,r);else if(S){let P=n/Math.max(1,b);v=n,C=w*P}else if(M){let P=r/Math.max(1,w);C=r,v=b*P}else{let P=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);v=P?s.vbW:g,C=P?s.vbH:y}!S&&!M&&(v=v*i,C=C*i);let _=v*o,E=C*o,x=Math.max(_/Pt,E/Pt,Math.sqrt(_*E/te));x>1&&(Mt(e.__session,"canvas-clamp",`output ${Math.round(_)}x${Math.round(E)}px exceeds canvas limits; downscaled`),console.warn(`[SnapDOM] ${Math.round(_)}\xD7${Math.round(E)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),v/=x,C/=x);let k=Rt(e.canvas)&&it(e.canvas,"canvas")?e.canvas:document.createElement("canvas");k.width=Math.max(1,v*o),k.height=Math.max(1,C*o),k.style.width=`${v}px`,k.style.height=`${C}px`;let R=k.getContext("2d");if(!R)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let T=null,L=e.__layoutZoom||1;if(!u&&L>1&&bt()){let P=L*b/(v*o),A=Math.round(v*o*P),N=Math.round(C*o*P);P>1.01&&A<=Pt&&N<=Pt&&A*N<=te&&(T={w:A,h:N})}let W=()=>{if(o!==1&&R.scale(o,o),a&&(R.save(),R.fillStyle=a,R.fillRect(0,0,v,C),R.restore()),f&&(Math.round(v*o)!==g||Math.round(C*o)!==y)){let P=document.createElement("canvas");P.width=g,P.height=y,Ho(P.getContext("2d"),h,g,y,l),R.drawImage(P,0,0,v,C)}else{if(R.save(),R.setTransform(1,0,0,1,0,0),T){let P=document.createElement("canvas");for(P.width=T.w,P.height=T.h,Ho(P.getContext("2d"),h,T.w,T.h,l);P.width>v*o*2;){let A=document.createElement("canvas");A.width=Math.ceil(P.width/2),A.height=Math.ceil(P.height/2),A.getContext("2d").drawImage(P,0,0,A.width,A.height),P=A}R.imageSmoothingQuality="high",R.drawImage(P,0,0,v*o,C*o)}else Ho(R,h,v*o,C*o,l);R.restore()}};if(W(),m&&d&&p){let P=!0;try{P=m(h)}catch{}if(!P){let A=performance.now()+600;do{await dr();try{P=m(h)}catch{break}}while(!P&&performance.now()<A);k.width=k.width,W()}}return k}finally{zo(h,e.__releaseDecodeFrame)}}var Pt,te,ur,dr,Pd,Et,pr,hn,Uo,$d,Nd,Ld,Id,me=ct(()=>{"use strict";mt();oe();Ct();kt();Pt=X()?16384:32767,te=16384*16384;ur=null;dr=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Pd=24*1024*1024,Et=null,pr=0,hn=0,Uo=!1;$d=4e6,Nd=2e6,Ld=8,Id=["%3C","%3E","%20","%7B","%7D","%3B"]});var mn={};be(mn,{rasterize:()=>jo});async function jo(t,e){let n=await Ut(t,e),o=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let c=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return c();let l=new FileReader;l.onload=()=>a(String(l.result||"")),l.onerror=c,l.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{c()}}),s=new Image;return s.src=o,X()?await s.decode():await new Promise((a,c)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=c}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var He=ct(()=>{"use strict";me();mt()});var Vo={};be(Vo,{toImg:()=>Dd,toSvg:()=>Dd});async function Dd(t,e){let{scale:n=1,width:r,height:i,meta:o={}}=e,s=Number.isFinite(r),a=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||s||a;if(X()&&c)try{let{svg:p}=await gr(pe(t)),h=(p.match(/<svg\b[^>]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),d=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(d))throw new Error("The SVG has no size.");let g=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:m,y=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:d,b,w;s&&a?(b=r,w=i):s?(b=r,w=Math.max(1,Math.round(y*(r/Math.max(1,g))))):a?(w=i,b=Math.max(1,Math.round(g*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(d*n)));let v=p.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),C=new Image;return C.decoding="sync",C.loading="eager",C.src=he(v),await C.decode(),C.style.width=`${b}px`,C.style.height=`${w}px`,C}catch(p){return Mt(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",p),H(e,"Safari couldn't show the SVG; used a PNG.",p),jo(t,{...e,format:"png",quality:1,meta:o})}let u=t,l=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=pe(t),h=(p.match(/<svg\b[^>]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),d=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&d>0){let g=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(d*n))}"`);u=he(p.replace(h,g)),l=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(p){if(!l)throw p;f.src=t,l=!1,await f.decode()}if(s&&a)f.style.width=`${r}px`,f.style.height=`${i}px`;else if(s){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:f.naturalHeight,m=r/Math.max(1,p);f.style.width=`${r}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:f.naturalHeight,m=i/Math.max(1,h);f.style.height=`${i}px`,f.style.width=`${Math.max(1,Math.round(p*m))}px`}else{let p=Math.max(1,Math.round(f.naturalWidth*(l?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(l?1:n)));if(f.style.width=`${p}px`,f.style.height=`${h}px`,!l&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,await f.decode()}catch(m){H(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var qo=ct(()=>{"use strict";wt();oe();He();me()});var tc={};be(tc,{encodePng:()=>Wd});function yr(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),r=new DataView(n.buffer);r.setUint32(0,e.length);for(let o=0;o<4;o++)n[o+4]=t.charCodeAt(o);n.set(e,8);let i=4294967295;for(let o=4;o<n.length-4;o++)i=Za[(i^n[o])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function Wd(t,e,n){if(![t,e].every(d=>Number.isInteger(d)&&d>0&&d<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,t),i.setUint32(4,e),r[8]=8,r[9]=6;let o=[new Uint8Array([137,80,78,71,13,10,26,10]),yr("IHDR",r),yr("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),c=new Uint8Array(s),u=0,l=new CompressionStream("deflate"),f=l.writable.getWriter(),p=l.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:d,value:g}=await p.read();if(d)return;o.push(yr("IDAT",g))}}catch(d){h=d,await f.abort(d).catch(()=>{})}})();try{for await(let d of n){if(!(d instanceof Uint8Array||d instanceof Uint8ClampedArray)||!d.length||d.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let g=d.length/s;if(u+g>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y<g;y+=a){let b=Math.min(g,y+a),w=new Uint8Array((b-y)*(s+1));for(let v=y;v<b;v++){let C=d.subarray(v*s,(v+1)*s),S=(v-y)*(s+1),M=0,_=0;for(let E=0;E<s;E++){let x=C[E]-(E<4?0:C[E-4])&255,k=C[E]-c[E]&255;M+=Math.min(x,256-x),_+=Math.min(k,256-k),w[S+E+1]=k}if(w[S]=_<=M?2:1,M<_)for(let E=0;E<s;E++)w[S+E+1]=C[E]-(E<4?0:C[E-4]);c=C}await f.write(w)}c=c.slice(),u+=g}if(u!==e)throw new RangeError("[SnapDOM] PNG input does not match the declared height");if(await f.close(),await m,h)throw h;return o.push(yr("IEND")),new Blob(o,{type:"image/png"})}catch(d){throw await Promise.allSettled([f.abort(d),p.cancel(d)]),await m,d}finally{f.releaseLock(),p.releaseLock()}}var Za,ec=ct(()=>{"use strict";Za=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;Za[t]=e}});function br(t,e){if(typeof t!="string"||!t.startsWith("data:image/svg+xml"))return null;let n=mr(t).match(/<svg\b[^>]*>/i)?.[0];if(!n)return null;let r=e.crop?hr(n,e.crop):n,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),o=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),s=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&o>0)||s.length!==4||!s.every(Number.isFinite)||!(s[2]>0&&s[3]>0))return null;let a=Number.isFinite(e.width),c=Number.isFinite(e.height),u=e.meta||{},l=Math.max(1,Math.floor(i)),f=Math.max(1,Math.floor(o)),p=e.crop?l:Number.isFinite(u.vbW)?u.vbW:Number.isFinite(u.w0)?u.w0:l,h=e.crop?f:Number.isFinite(u.vbH)?u.vbH:Number.isFinite(u.h0)?u.h0:f,m=e.dpr??1,d=e.scale??1,g=(a&&c?Math.max(1,e.width):a?e.width:c?e.height*p/Math.max(1,h):l*d)*m,y=(a&&c?Math.max(1,e.height):c?e.height:a?e.width*h/Math.max(1,p):f*d)*m;if(Math.max(i,o,g,y)<=Pt&&i*o<=te&&g*y<=te||typeof CompressionStream!="function")return null;return b();async function b(){let{encodePng:w}=await Promise.resolve().then(()=>(ec(),tc)),v=Math.max(1,Math.floor(g)),C=Math.max(1,Math.floor(y)),S=pe(t),M=S.slice(S.indexOf(n)+n.length,S.lastIndexOf("</svg>")),_=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",E=i/s[2],x=o/s[3],k=0,R=0;/\bnone\b/.test(_)||(E=x=/\bslice\b/.test(_)?Math.max(E,x):Math.min(E,x),k=(i-s[2]*E)*(/xMin/.test(_)?0:/xMax/.test(_)?1:.5),R=(o-s[3]*x)*(/YMin/.test(_)?0:/YMax/.test(_)?1:.5)),k-=s[0]*E,R-=s[1]*x;let T=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),L=X()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(S),W=i/g,P=o/y,A=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/v),L?Math.floor(2046/P):8192)),N=Math.max(1,Math.min(8192,v,L?Math.floor(2046/W):8192));async function*$(){for(let F=0;F<C;F+=A){let z=Math.min(A,C-F),q=new Uint8Array(v*z*4);for(let j=0;j<v;j+=N){let J=Math.min(N,v-j),B=L?Math.max(0,Math.floor(j*W)-1):j*W,ut=L?Math.max(0,Math.floor(F*P)-1):F*P,xt=L?Math.min(l,Math.ceil((j+J)*W)+1)-B:J,at=L?Math.min(f,Math.ceil((F+z)*P)+1)-ut:z,st=xt/s[2],nt=at/s[3],pt=L?1:1/W,zt=L?1:1/P,ge=`matrix(${E*pt/st},0,0,${x*zt/nt},${(k-B)*pt/st+s[0]},${(R-ut)*zt/nt+s[1]})`,V=`${T} width="${xt}" height="${at}" preserveAspectRatio="none"><g style="all:unset!important;transform:${ge}!important;transform-origin:0 0!important">${M}</g></svg>`,G=await Ut(he(V),{width:xt,height:at,dpr:1,backgroundColor:L?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),U=G;try{if(L){U=document.createElement("canvas"),U.width=J,U.height=z;let Y=U.getContext("2d");e.backgroundColor&&(Y.fillStyle=e.backgroundColor,Y.fillRect(0,0,J,z)),Y.drawImage(G,j*W-B,F*P-ut,J*W,z*P,0,0,J,z)}let ht=U.getContext("2d").getImageData(0,0,J,z).data;for(let Y=0;Y<z;Y++)q.set(ht.subarray(Y*J*4,(Y+1)*J*4),(Y*v+j)*4)}finally{G.width=G.height=0,U!==G&&(U.width=U.height=0)}}yield q}}return w(v,C,$())}}var Go=ct(()=>{"use strict";me();mt()});var nc={};be(nc,{toBlob:()=>Xo});async function Xo(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 o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=n==="png"&&br(t,e);if(r)return r;let i=await Ut(t,e);return new Promise(o=>i.toBlob(s=>o(s),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Yo=ct(()=>{"use strict";me();Go()});var oc={};be(oc,{download:()=>Bd});async function rc(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(r){if(r.name!=="AbortError")return!1}return!0}async function Bd(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(e?.format||i||"").toLowerCase(),s=o==="jpg"?"jpeg":o||"png",a=e?.filename||"snapdom",c=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let l=Qe(),f=s==="png"&&br(t,u);if(s==="svg"||f){let m=f?await f:await Xo(t,{...u,type:"svg"});if(l&&await rc(m,c))return;let d=URL.createObjectURL(m),g=document.createElement("a");g.href=d,g.download=c,document.body.appendChild(g),g.click(),setTimeout(()=>URL.revokeObjectURL(d),1e3),g.remove();return}let p=await Ut(t,u);if(l){let m=`image/${s}`,d=await new Promise(g=>p.toBlob(g,m,e?.quality));if(d&&await rc(d,c))return}let h=document.createElement("a");h.href=p.toDataURL(`image/${s}`,e?.quality),h.download=c,document.body.appendChild(h),h.click(),h.remove()}var ic=ct(()=>{"use strict";Yo();me();Go();mt()});wt();wt();mt();gt();wn();kt();var ie=new WeakMap,wi=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Dr=new Map,Hc=2e3,Ae=0;function $t(){Ae++}function xn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Gt(e))return!0;if(e.parentElement)e=e.parentElement;else{let n=e.getRootNode?.();e=n&&n.host?n.host:null}}return!1}function Cn(t){for(let e of t)if(ae(e))return!0;return!1}function ae(t){if(xn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!xn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!xn(n)){e=!1;break}}if(e)return!1}return!0}var Me=new WeakMap;function _i(t){for(let e of t){if(!ae(e))continue;let n=e.target.ownerDocument||document;Me.set(n,(Me.get(n)||0)+1);let r=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;r;r=r.parentElement||r.getRootNode?.()?.host)Me.set(r,(Me.get(r)||0)+1)}}function en(t){let e=t.ownerDocument||document;return Re(e),(Me.get(e)||0)-(Me.get(t)||0)}var Ft=0;function _e(t=document){return Re(t),Ft}function Wt(){return Re(),Ae}function nn(t){return t?(Re(t.ownerDocument||document),kn(t,Vr(t))):0}function Ee(){$t(),Ft++}var se=new WeakMap,Yt=0,Kt=0;function jc(t){se.set(t,++Yt)}function Hr(t){if(!t||t.nodeType!==1)return;Yt++,se.set(t,Yt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)se.set(e[n],Yt)}function jr(t){Hr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)jc(e)}function kn(t,e=null){let n=se.get(t)||0;if(e)for(let r of e)n=Math.max(n,se.get(r)||0);return Kt*1e9+n}function Vr(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Gr(e),n.push(e.host),e=e.host.getRootNode?.();return n}var Wr=new WeakMap;function qr(t){t=t||document;let e=Wr.get(t);if(!e||e.env!==Ft){let n=!0;try{n=Qt(t).usesHas}catch{}e={env:Ft,usesHas:n},Wr.set(t,e)}return!e.usesHas}function Vc(t){let e=n=>n?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let r=n.target,i=r&&(r.nodeType===1?r:r.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let o of n.addedNodes)if(e(o))return o.ownerDocument||document;for(let o of n.removedNodes)if(e(o))return o.ownerDocument||r&&r.ownerDocument||document}return null}var Br=new WeakSet,Je=[];function Ei(t){if(!Cn(t))return;_i(t),$t();let e=new Set;for(let n of t){if(!ae(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?Hr(r.host):Yt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)se.set(i[o],Yt)}}function Gr(t){if(!(!t||Br.has(t))){Br.add(t);try{let e=new MutationObserver(Ei);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Je.push({o:e,root:t})}catch{}}}function Ri(t){if(!Cn(t))return;_i(t),$t();let e=Vc(t);if(e){Wr.delete(e),Ft++,Kt++;return}let n=new Set;for(let r of t){if(!ae(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!qr(o)){Kt++;return}if(i===o.documentElement||i===o.body){Kt++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),jr(i))}}var Ur=new WeakSet,Ze=null,tn=[];function Re(t=document){if(t===Ze||!t||t.nodeType!==9)return;if(Ur.has(t)){Ze=t;return}Ur.add(t),Ze=t;let e=t.defaultView,n=i=>{Cn(i)&&($t(),Ft++)},r=()=>{$t(),Ft++};try{let i=new MutationObserver(Ri);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),tn.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}),tn.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{$t();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!xn(s)&&qr(s.ownerDocument||t)?jr(s):Kt++};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",()=>{$t(),Kt++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var Si=new WeakMap;function xi(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=Si.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(Si.set(t,n),$t(),t.nodeType===11){t.host?Hr(t.host):Yt++;for(let o of t.querySelectorAll("*"))se.set(o,Yt);return}let i=r.filter(o=>!n.includes(o)).concat(n.filter(o=>!r.includes(o)));for(let o of i)if(o.isConnected)if(qr(e))jr(o);else{Kt++;return}}function Mn(t,e=null){if(!t)return;xi(t,t);let n=e||Je.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)xi(r,t)}function Tt(){Re();try{for(let t=tn.length-1;t>=0;t--){let{o:e,env:n,doc:r}=tn[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}Ur.delete(r),Ze===r&&(Ze=null),tn.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?Cn(i)&&($t(),Ft++):Ri(i))}for(let t=Je.length-1;t>=0;t--){let{o:e,root:n}=Je[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Br.delete(n),Je.splice(t,1);continue}let r=e.takeRecords();r.length&&Ei(r)}}catch{}}function ce(t){if(!(!t||t.nodeType!==1)){ie.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)ie.delete(e.currentNode)}catch{}}}var qc=["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"];function Xr(t){let e=ie.get(t);if(e&&Yr(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function Fi(t){let e=ie.get(t);if(!e||!Yr(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var vi=new WeakMap;function Qt(t){let e=vi.get(t);if(!e||e.epoch!==Ae){let n=e&&e.universe;e={epoch:Ae,...di(t)};let r=e.universe;if(n&&r&&n.size===r.size){let i=!0;for(let o of r)if(!n.has(o)){i=!1;break}i&&(e.universe=n)}vi.set(t,e)}return e}function Ti(t){try{let e=Qt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,r=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let c=0;c<a.length;c++)n.add("c"+a[c])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function Gc(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Qt(e).importantProps}function rn(t,e){let n=t.ownerDocument||document,r=t.getRootNode?t.getRootNode():n;return r===n?Qt(n).universe:e&&Ot(r)?Xc(t,r,n,e):null}var Ci=new WeakMap;function Xc(t,e,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let a=Qt(n).universe;if(!a)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(a),roots:new Set}}let o=a=>{for(;Ot(a)&&!i.roots.has(a);a=a.host.getRootNode()){i.roots.add(a);for(let c of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=Ci.get(c);if((!u||u.epoch!==Ae)&&Ci.set(c,u={epoch:Ae,props:fi(c)}),!u.props)return!1;for(let l of u.props)i.universe.add(l)}Tr(a.getAnimations(),i.universe)}return!0},s=o(e)&&(!t.shadowRoot||o(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=o(a.getRootNode());return s?i.universe:r.__shadowUniverse=null}function vn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Qt(e).pseudoUniverse}var Yc={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function Fe(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Yc:Qt(e).pseudoGates}function Kc(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=h=>{if(i[h]!==void 0||xe(h)||o&&(o instanceof RegExp&&o.test(h)||typeof o=="function"&&o(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(r){for(let m of r)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;m<h.length;m++)s(h[m])}else for(let h=0;h<t.length;h++)s(t[h]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let h of a)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}let c=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let h of c)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}if(e.embedFonts){let h=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let m of h)if(!i[m])try{let d=t.getPropertyValue(m);d&&(i[m]=d)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:Pi(t),enumerable:!1});let u=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,f=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,p=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(u===0&&l===0&&f===0&&p===0){let h=(t.getPropertyValue("border-image-source")||"").trim(),m=h&&h!=="none",d=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of d)delete i[g];m||(i.border="none")}return Qc(i),i}function Qc(t){if(!bt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=Jc(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),r!==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 Jc(t,e){let n=o=>{let s=[],a=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,c;for(;c=a.exec(o||"");){let u=c[4];(u===void 0?1:parseFloat(u)/(u.endsWith("%")?100:1))>.05&&s.push([+c[1],+c[2],+c[3]])}return s},r=n(t);if(r.length||(r=n(e)),!r.length)return null;let i=[0,0,0];for(let[o,s,a]of r)i[0]+=o,i[1]+=s,i[2]+=a;return`rgb(${i.map(o=>Math.round(o/r.length)).join(", ")})`}function Pi(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 qc){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function Zc(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=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function tl(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!ki(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!ki(String(r).trim().toLowerCase())?!0:nl(t,e)?n||rl(t,e):!1}var el=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function ki(t){return el.has(t)||t.startsWith("fit-content")}function nl(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 r=1/0,i=-1/0,o=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(o=o||document.createRange(),o.selectNode(s),a=o.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let c=O(s);if(c.display==="none"||c.position==="absolute"||c.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function rl(t,e){let n=t.parentElement;if(!n)return!1;let r=O(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var zr=new WeakMap;function ol(t,e){let n=zr.get(t);if(n)return n;let r=[e];for(let i in t)r.push(i,t[i]);return n=r.join(""),zr.set(t,n),n}function Yr(t,e){return t.env===Ft&&t.stamp===kn(e,t.hosts)}var il=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,sl=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,al=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function cl(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function ll(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let r=t.parentElement,i;if(!r)i="R";else if(i=e.ids.get(r),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 o="",s=t.attributes;if(s&&s.length)if(s.length===1)o=s[0].name+"="+s[0].value;else{let c=[];for(let u=0;u<s.length;u++)c.push(s[u].name+"="+s[u].value);c.sort(),o=c.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function $i(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=Qt(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&sl.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),c=!!i.paddingUnstable||s&&/padding/i.test(o),u=r.display!==void 0&&r.display.includes("grid"),l=r.transform!==void 0&&r.transform!=="none",f=[];for(let m in r)(il.test(m)||u&&(m==="grid-template-columns"||m==="grid-template-rows")||l&&m==="transform"||a&&m.charCodeAt(0)===109&&m.startsWith("margin-")||c&&m.charCodeAt(0)===112&&m.startsWith("padding-"))&&f.push(m);t.h&&!("height"in r)&&f.push("height"),t.b&&!("block-size"in r)&&f.push("block-size");let p=new Set(f),h=[e.tagName.toLowerCase()];for(let m in r)p.has(m)||h.push(m,r[m]);return t.rr=f,t.sig=h.join("")+""+f.join(""),f}function Ni(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return Ce(n,vn(t));let a=s+e,c=o.pseudo||(o.pseudo=new Map),u=c.get(a);if(u){let f={...u.snap},p=u.rr||$i(u,t);for(let h=0;h<p.length;h++){let m=n.getPropertyValue(p[h]);m?f[p[h]]=m:delete f[p[h]]}return f}let l=Ce(n,vn(t));return c.set(a,{snap:l,rr:null,sig:null,h:"height"in l,b:"block-size"in l}),l}function fl(t,e=null,n={},r=null,i=null){let o=ie.get(t),s=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(typeof a!="function"&&o&&Yr(o,t)&&o.embedFonts===s&&o.excludeStyleProps===a)return o.snapshot;let c=e||getComputedStyle(t),u,l=null,f=r&&r.st.snaps.get(r.id);if(f){u={...f.snap};let d=f.rr||$i(f,t);l=[];for(let g=0;g<d.length;g++){let y=d[g],b=c.getPropertyValue(y);b?u[y]=b:delete u[y],l.push(b)}Object.defineProperty(u,"__needsBgInline",{value:f.snap.__needsBgInline,enumerable:!1}),f.snap.__bgClipTextFix!==void 0&&Object.defineProperty(u,"__bgClipTextFix",{value:f.snap.__bgClipTextFix,enumerable:!1})}else u=Kc(c,n,t,rn(t,i)),r&&r.st.snaps.set(r.id,{snap:u,rr:null,sig:null,h:"height"in u,b:"block-size"in u});let p=!1;if(typeof t.computedStyleMap=="function"){let d;for(let g of wi)if(u[g]==="0px")try{d||(d=t.computedStyleMap()),d.get(g)?.toString()==="auto"&&(u[g]="auto",p=!0)}catch{}}_l(t,c,u);let h=yl(t,c,u);l!==null&&(p&&l.push("",...wi.map(d=>u[d])),h&&l.push(""+h),zr.set(u,f.sig+""+l.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=Vr(t);return ie.set(t,{env:Ft,stamp:kn(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function ul(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:Dr,defaultStyle:I.defaultStyle,baseStyle:I.baseStyle,image:I.image,resource:I.resource,background:I.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Dr,defaultStyle:I.defaultStyle,baseStyle:I.baseStyle,image:I.image,resource:I.resource,background:I.background},options:t||e||{}}}var dl=/%|[\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,pl=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function hl(t,e,n){if(!t.style||t.style.length===0)return;let r=Gc(t),i=r!=null&&!dl.test(t.getAttribute("style")||"");for(let o=0;o<t.style.length;o++){let s=t.style[o];if(i&&!r.has(s)&&!(s.startsWith("background")&&pl(t)))continue;let a=n.getPropertyValue(s);a&&e.style.setProperty(s,a,t.style.getPropertyPriority(s))}}function dt(t,e,n,r){if(t.tagName==="STYLE")return;let i=ul(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&Re(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&($t(),Dr.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 c=s.styleCache.get(t);t.getAttribute?.("style")&&hl(t,e,c);let u=c.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let l=t.tagName?.toLowerCase()||"div";if(Ye.has(l)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Pi(c),enumerable:!1});let b=Vr(t);ie.set(t,{env:Ft,stamp:kn(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=cl(s),b=ll(t,y),w=t.ownerDocument||document,v=w.activeElement;b!==-1&&!al.has(t.tagName)&&!(v&&v!==w.body&&v!==w.documentElement&&v===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let p=fl(t,c,i.options,f,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;p[b]==="auto"&&e.style.setProperty(b,"auto","important")}p.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",p.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",p.__bgClipTextFix,"important")),ml(t,c,p),e.style?.length&&p["box-sizing"]==="border-box"&&c.getPropertyValue("box-sizing")!=="border-box"&&Sl(t,e,p);let h=Di(t);if(vl(t,e,p,h,s),h){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(p["min-width"]="0px")}let m=ol(p,l),d=!0;if(Sn(l,(p.display||"").toLowerCase())){d=Zc(t),d&&Lr(l,p,h)&&tl(t,c,h)&&(d=!1),m=`${m}${d?"|c":""}${h?"|f":""}`;let y=p["text-wrap-mode"]||p["white-space"]||"";d&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(m);g===void 0&&(g=ve(p,l,d,h),a.snapshotKeyCache.size>=Hc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,g)),s.styleMap.set(e,g)}function ml(t,e,n){let r=e.getPropertyValue("overflow-x"),i=e.getPropertyValue("overflow-y");if((r==="visible"||!r)&&(i==="visible"||!i)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let o=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-o(e.getPropertyValue("border-left-width"))-o(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-o(e.getPropertyValue("border-top-width"))-o(e.getPropertyValue("border-bottom-width")),c=(u,l)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let p=parseFloat(f);Number.isFinite(p)&&(n[u]=`${Math.round((p+l)*1e3)/1e3}px`)};s>=2&&(c("width",s),c("inline-size",s)),a>=2&&(c("height",a),c("block-size",a))}var gl=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Li=["width","inline-size","height","block-size"];function yl(t,e,n){if(!gl.some(c=>n[c]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let c of["width","height"]){let u=n[`min-${c}`],l=n[`max-${c}`];if(u&&u!=="0px"&&u!=="auto"||l&&l!=="none")return""}let r=c=>parseFloat(n[c])||0,i=r("padding-left")+r("padding-right")+r("border-left-width")+r("border-right-width"),o=r("padding-top")+r("padding-bottom")+r("border-top-width")+r("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let c of Li){let u=n[c];if(!u||!u.endsWith("px"))continue;let f=c==="width"||c==="inline-size"&&!s||c==="block-size"&&s?i:o;n[c]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let c=t.scrollWidth<=t.clientWidth;n["overflow-x"]=c?"hidden":"auto",c&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let c=t.scrollHeight<=t.clientHeight;n["overflow-y"]=c?"hidden":"auto",c&&(a+="y")}return a}var bl=["box-sizing",...Li,"overflow-x","overflow-y"],wl=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function Sl(t,e,n){if(wl.test(t.getAttribute("style")))for(let r of bl)e.style.getPropertyValue(r)&&n[r]&&e.style.setProperty(r,n[r],e.style.getPropertyPriority(r))}function xl(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"}var Mi=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";function vl(t,e,n,r,i){let o=n.display||"";if(!r&&!o.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"||Mi==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=i.__oneLine||(i.__oneLine=new WeakSet);for(let c=t.parentElement;c;c=c.parentElement)if(a.has(c))return;Cl(t,n,i)&&(a.add(t),e.style.setProperty(Mi,"nowrap"))}function Cl(t,e,n){let r=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(r>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,o=i.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=i.createRange(),a=null,c=0,u=0;for(let p=o.nextNode();p;p=o.nextNode()){if(p.nodeType===1){if(p.shadowRoot||p.localName==="br"||p.localName==="textarea")return!1;continue}if(/\S/.test(p.data)){if(++u>64)return!1;s.selectNodeContents(p);for(let h of s.getClientRects())if(h.height){if(a||(a=h),Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)<Math.min(a.height,h.height)/2)return!1;c=Math.max(c,h.height)}}}if(!a)return!1;let l=Oi(t,n.__axes||(n.__axes=new WeakMap));if(!l)return!1;let f=l===Ii&&t.offsetHeight?t.getBoundingClientRect().height/t.offsetHeight:1;return r*f<=2*c}var kl=0,Ai=1,Ii=2;function Oi(t,e){let n=e.get(t);if(n!==void 0)return n;let r=O(t),i=r.transform,o=i&&i!=="none"?i.slice(i.indexOf("(")+1,-1).split(",").map(parseFloat):null;if(r.rotate&&r.rotate!=="none"||o&&(i.startsWith("matrix3d")?o[1]||o[4]:o[1]||o[2]))n=kl;else{let s=t.parentElement||t.getRootNode?.().host;n=s?Oi(s,e):Ai,n===Ai&&(r.scale&&r.scale!=="none"||r.zoom&&r.zoom!=="1"||o&&(i.startsWith("matrix3d")?o[0]!==1||o[5]!==1:o[0]!==1||o[3]!==1))&&(n=Ii)}return e.set(t,n),n}function Di(t){let e=t.parentElement;if(!e)return!1;let n=O(e).display||"";return n.includes("flex")||n.includes("grid")}function Ml(t){for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===3&&/\S/.test(r.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let r=t.firstElementChild;r;r=r.nextElementSibling){let i=O(r);if(i.display==="none")continue;let o=i.position;if(o!=="absolute"&&o!=="fixed")return!0}return!1}function Al(t){let e=t.getBoundingClientRect().top,n=-1/0,r=null;for(let i=t.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(i);let a=r.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(i.nodeType!==1)continue;let o=O(i);if(o.display==="none")continue;let s=o.position;s==="absolute"||s==="fixed"||o.float&&o.float!=="none"||(n=Math.max(n,i.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function _l(t,e,n){if(Rt(t)&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;let s=e.position;if(s==="absolute"||s==="fixed"||s==="sticky"||e.transform!=="none"||xl(e)||Di(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let u=e.clip;if(u&&u!=="auto"&&u!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!Ml(t))return;let l=parseFloat(e.height),f=Al(t);Number.isFinite(l)&&Number.isFinite(f)&&Math.abs(l-f)>2||(delete n.height,delete n["block-size"])}ke();var El=new Set(["symbol","defs"]),Rl=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Kr=new WeakMap,Wi=-1;function An(t){let e=Wt();return e!==Wi&&(Kr=new WeakMap,Wi=e),Bi(t)}function Bi(t){let e=Kr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(Rl.has(t.localName)?n=!1:El.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&Bi(r)}return Kr.set(t,n),n}function Ui(t,e){if(t?.nodeType!==1||e?.nodeType!==1||An(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let c=o[a];if(s.has(c))continue;s.add(c);let u=o.getPropertyValue(c);if(!u||!u.includes("var("))continue;let l=i&&i.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let c=a.name,u=i&&i.getPropertyValue(c);if(u)try{e.style.setProperty(c,u.trim())}catch{}}}}wt();wt();gt();we();wn();Ct();function Te(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function Pe(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),r.push({url:s[0],d:c})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function zi(t,e){let n=t.currentSrc||"";if(n&&!Te(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||Te(s))continue;let a=o.getAttribute("type");if(a&&!Cr.test(a.trim()))continue;let c=o.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Pe(s,t)}catch{}i||(i=Pe(s,t))}return i}function Hi(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!Te(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!Te(r))return r}return null}kt();mt();function Fl(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 Tl=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,Pl=/^::?(?:before|after|first-letter)$/;function $l(t,e,n=!0,r){return Pr(t,",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(Tl);if(o&&Pl.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?Fl(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function qi(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(r,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(r,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(r,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(r,i,o,s)=>{let a=$l(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Gi(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function le(t){let e="";for(let n of t)if(n.media&&n.cssRules){let r=!1;try{r=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}r&&(e+=le(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${le(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let r=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=r+(n.style?n.style.cssText:"")+le(n.cssRules)+"}"}else e+=n.cssText+`
|
|
8
|
+
`}return o}function Ke(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of e)n.set(i,`c${r++}`);return n}function Wc(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 r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function O(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(t?.nodeType!==1){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=I.computedStyle.get(t);r||(r=new Map,I.computedStyle.set(t,r));let i=r.get(e);if(!i){let o=Wc(t),s=null;try{s=o&&typeof o.getComputedStyle=="function"?o.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(),r.set(e,i)}return i}function Ce(t,e=null){let n={};for(let r of e||t){let i=t.getPropertyValue(r);i&&(n[r]=i)}for(let r of Bc){let i=n[`border-${r}-style`],o=n[`border-${r}-width`];(i==="none"||i==="hidden"||o==="0px")&&(delete n[`border-${r}-style`],delete n[`border-${r}-width`],delete n[`border-${r}-color`])}return n}function Xt(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var $r,Ye,Rc,Fc,Tc,hi,Pc,mi,$c,Nc,Lc,Ic,Oc,Dc,Bc,ke=ct(()=>{"use strict";gt();wn();kt();$r=new Set(["meta","script","noscript","title","link","template"]),Ye=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"]);Rc=/(?:^|-)(animation|transition)(?:-|$)/i,Fc=/^(--.+|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,Tc=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"]),hi=new Map;Pc=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),mi=new Set(["table","thead","tbody","tfoot","tr","td","th"]),$c=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Nc=new Set(["width","max-width","inline-size","max-inline-size"]),Lc=new Set(["min-width","min-inline-size"]),Ic=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"}));Oc=.001;Dc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);Bc=["top","right","bottom","left"]});function yt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,r=()=>{n||(n=!0,e())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,t)})}function bi(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?Uc:yi),n=null,r={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=new Promise(i=>{let o=()=>{n=null,r.yielded=!0,e=performance.now()+yi,i()},s=new MessageChannel;s.port1.onmessage=o,s.port2.postMessage(0)}))};return r}function Qe(){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 X(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),r=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),s=r&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&r;return n||s||a||c||u}function bt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var yi,Uc,mt=ct(()=>{"use strict";yi=16,Uc=40});function H(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function Mt(t,e,n,r){let i=t&&t.warnings;i&&i.length<zc&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var zc,oe=ct(()=>{"use strict";zc=50});var wt=ct(()=>{"use strict";si();ke();mt();Ct();oe()});var Ja={};be(Ja,{MAX_RASTER_AREA:()=>te,MAX_RASTER_SIDE:()=>Pt,cropSvgText:()=>hr,decodeSvgFromDataURL:()=>pe,encodeSvgToDataURL:()=>he,fixSafariShadows:()=>gr,peekSvgHeader:()=>mr,toCanvas:()=>Ut});function Cd(t,e){try{let n=t.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return t;let s=Math.min(1,Pt/i,Pt/o,Math.sqrt(te/(i*o)));if(s>=1)return t;let a=Math.max(1,Math.floor(i*s)),c=Math.max(1,Math.floor(o*s));return Mt(e,"raster-clamp",`capture ${Math.round(i)}x${Math.round(o)}px exceeds decode limits; downscaled to ${a}x${c}px`),console.warn(`[SnapDOM] ${Math.round(i)}\xD7${Math.round(o)}px is too large for the browser to draw; scaled down to ${a}\xD7${c}px. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return t}}function hr(t,e){let n=["x","y","width","height"].map(S=>Number(e?.[S]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let r=t.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||"").trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[a,c,u,l]=s,f=Math.max(a,n[0]),d=Math.max(c,n[1]),h=Math.min(a+u,n[0]+n[2]),m=Math.min(c+l,n[1]+n[3]);if(!(h>f)||!(m>d))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let p=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(p)&&p>0?p/u:1,b=Number.isFinite(g)&&g>0?g/l:1,w=Math.max(1,(h-f)*y),v=Math.max(1,(m-d)*b),C=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${v}`).replace(/(\bviewBox=")[^"]*/i,`$1${f} ${d} ${h-f} ${m-d}`);return t.replace(i,C)}function Bo(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function pe(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function mr(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 he(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Ka(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function kd(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",u="0px"]=s;u=`${parseFloat(u)/2}px`;let l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!l&&l!==",";i.push(`drop-shadow(${a} ${c} ${u}${f?` ${l}`:""})`)}return i.join(" ")}function Qa(t){let e=Ka(t),n=null,r=null,i=null,o=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let u=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();u==="box-shadow"?i=l:u==="filter"?n=l:u==="-webkit-filter"?r=l:o.push([u,l])}if(i){let a=kd(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,c])=>`${a}:${c}`).join(";")}function Md(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Qa(r)}}`)}function Ad(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Md(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Qa(r)}${n}`),t}function _d(){return ur||(ur=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',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 r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),ur)}function Ed(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",c=0;for(;c<i.length;){let u=i[c];if(u==="("?o++:u===")"&&(o=Math.max(0,o-1)),o===0&&(c===0||i[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(i.slice(c));if(l){s++,a+=s===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=u,c++}return a}).join(",")}function Rd(t,e){let n=r=>Ka(r).map(i=>{let o=i.indexOf(":");if(o<0)return i;let s=i.slice(0,o).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Ed(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(r,i)=>r.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(o,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(r,i,o)=>`style=${i}${n(o)}${i}`),t}async function gr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await _d();try{let i=t;return n||(i=Ad(i)),r&&(i=Rd(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Fd(){let t=document.createElement("canvas");t.width=16,t.height=16;let e=t.getContext("2d",{willReadFrequently:!0});return e?n=>{e.clearRect(0,0,16,16),e.drawImage(n,0,0,16,16);let r=e.getImageData(0,0,16,16).data;for(let i=3;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function Td(t,e,n){Z(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await dr(),await dr(),!1;let r=performance.now()+(e?600:150);for(;;){let i;try{i=n(t)}catch{return!1}if(i)return!0;if(performance.now()>r)return!1;await dr()}}finally{try{t.remove()}catch{}}}function Xa(t){if(typeof document>"u"||!document.body)return new Image;if(Et&&!Et.contentDocument){try{Et.remove()}catch{}Et=null}if(Et&&pr>Pd&&hn===0){try{Et.remove()}catch{}Et=null}if(!Et){let n=document.createElement("iframe");Z(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)Et=n,pr=0;else{try{n.remove()}catch{}return new Image}}pr+=t.length,hn+=1;let e=Et.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function zo(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,hn=Math.max(0,hn-1),e&&(Uo=!0),Uo&&hn===0&&(Et?.remove(),Et=null,pr=0,Uo=!1))}function Ya(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Od(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),r=0,i=0;for(let o=e;o+48<=t.length;o+=n){let s=t.slice(o,o+48);r++,Id.some(a=>s.includes(a))||i++}return i*2>r}function Ho(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>$d&&!Od(i)?Math.min(Ld,Math.ceil(o/Nd)):1;if(s===1){t.drawImage(e,0,0,n,r);return}let a=e.naturalWidth,c=e.naturalHeight/r;for(let u=0;u<s;u++){let l=Math.round(u*r/s),f=u===s-1?r:Math.round((u+1)*r/s);t.drawImage(e,0,l*c,a,(f-l)*c,0,l,n,f-l)}}async function Ut(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:c=null}=e,u=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,l=t,f=!1,d=!1;if(c&&!Bo(t))throw new RangeError("[SnapDOM] Only SVG captures can be cropped.");if(Bo(t)){let m=(mr(t).match(/<svg\b[^>]*>/i)||[])[0]||"",p=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(p)&&Number.isFinite(g)&&p>0&&g>0&&Math.min(1,Pt/p,Pt/g,Math.sqrt(te/(p*g)))<1;if(c||y||X())try{let b=pe(t);if(c&&(b=hr(b,c)),X()){let w=await gr(b);b=w.svg,f=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Cd(b,e.__session)),l=he(b)}catch(b){if(c)throw b;l=t}}let h=u||Xa(l);try{u||await Ya(h,l)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let p=h;h=Xa(l),zo(p);try{await Ya(h,l)}catch(g){throw zo(h,e.__releaseDecodeFrame),g}}try{!u&&!X()&&!bt()&&Bo(l)&&/(?:%40|@)font-face/i.test(l)&&await new Promise(P=>{let A=new MessageChannel;A.port1.onmessage=()=>{A.port1.close(),A.port2.close(),P()},A.port2.postMessage(0)});let m=X()&&!u?Fd():null,p=!1;m&&(p=await Td(h,d,m));let g=u?u.width:h.naturalWidth,y=u?u.height:h.naturalHeight,b=c?g:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:g,w=c?y:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:y,v,C,S=Number.isFinite(n),M=Number.isFinite(r);if(S&&M)v=Math.max(1,n),C=Math.max(1,r);else if(S){let P=n/Math.max(1,b);v=n,C=w*P}else if(M){let P=r/Math.max(1,w);C=r,v=b*P}else{let P=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);v=P?s.vbW:g,C=P?s.vbH:y}!S&&!M&&(v=v*i,C=C*i);let _=v*o,E=C*o,x=Math.max(_/Pt,E/Pt,Math.sqrt(_*E/te));x>1&&(Mt(e.__session,"canvas-clamp",`output ${Math.round(_)}x${Math.round(E)}px exceeds canvas limits; downscaled`),console.warn(`[SnapDOM] ${Math.round(_)}\xD7${Math.round(E)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),v/=x,C/=x);let k=Rt(e.canvas)&&it(e.canvas,"canvas")?e.canvas:document.createElement("canvas");k.width=Math.max(1,v*o),k.height=Math.max(1,C*o),k.style.width=`${v}px`,k.style.height=`${C}px`;let R=k.getContext("2d");if(!R)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let T=null,L=e.__layoutZoom||1;if(!u&&L>1&&bt()){let P=L*b/(v*o),A=Math.round(v*o*P),N=Math.round(C*o*P);P>1.01&&A<=Pt&&N<=Pt&&A*N<=te&&(T={w:A,h:N})}let W=()=>{if(o!==1&&R.scale(o,o),a&&(R.save(),R.fillStyle=a,R.fillRect(0,0,v,C),R.restore()),f&&(Math.round(v*o)!==g||Math.round(C*o)!==y)){let P=document.createElement("canvas");P.width=g,P.height=y,Ho(P.getContext("2d"),h,g,y,l),R.drawImage(P,0,0,v,C)}else{if(R.save(),R.setTransform(1,0,0,1,0,0),T){let P=document.createElement("canvas");for(P.width=T.w,P.height=T.h,Ho(P.getContext("2d"),h,T.w,T.h,l);P.width>v*o*2;){let A=document.createElement("canvas");A.width=Math.ceil(P.width/2),A.height=Math.ceil(P.height/2),A.getContext("2d").drawImage(P,0,0,A.width,A.height),P=A}R.imageSmoothingQuality="high",R.drawImage(P,0,0,v*o,C*o)}else Ho(R,h,v*o,C*o,l);R.restore()}};if(W(),m&&p&&d){let P=!0;try{P=m(h)}catch{}if(!P){let A=performance.now()+600;do{await dr();try{P=m(h)}catch{break}}while(!P&&performance.now()<A);k.width=k.width,W()}}return k}finally{zo(h,e.__releaseDecodeFrame)}}var Pt,te,ur,dr,Pd,Et,pr,hn,Uo,$d,Nd,Ld,Id,me=ct(()=>{"use strict";mt();oe();Ct();kt();Pt=X()?16384:32767,te=16384*16384;ur=null;dr=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Pd=24*1024*1024,Et=null,pr=0,hn=0,Uo=!1;$d=4e6,Nd=2e6,Ld=8,Id=["%3C","%3E","%20","%7B","%7D","%3B"]});var mn={};be(mn,{rasterize:()=>jo});async function jo(t,e){let n=await Ut(t,e),o=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let c=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return c();let l=new FileReader;l.onload=()=>a(String(l.result||"")),l.onerror=c,l.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{c()}}),s=new Image;return s.src=o,X()?await s.decode():await new Promise((a,c)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=c}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var He=ct(()=>{"use strict";me();mt()});var Vo={};be(Vo,{toImg:()=>Dd,toSvg:()=>Dd});async function Dd(t,e){let{scale:n=1,width:r,height:i,meta:o={}}=e,s=Number.isFinite(r),a=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||s||a;if(X()&&c)try{let{svg:d}=await gr(pe(t)),h=(d.match(/<svg\b[^>]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(p))throw new Error("The SVG has no size.");let g=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:m,y=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:p,b,w;s&&a?(b=r,w=i):s?(b=r,w=Math.max(1,Math.round(y*(r/Math.max(1,g))))):a?(w=i,b=Math.max(1,Math.round(g*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(p*n)));let v=d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),C=new Image;return C.decoding="sync",C.loading="eager",C.src=he(v),await C.decode(),C.style.width=`${b}px`,C.style.height=`${w}px`,C}catch(d){return Mt(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),H(e,"Safari couldn't show the SVG; used a PNG.",d),jo(t,{...e,format:"png",quality:1,meta:o})}let u=t,l=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=pe(t),h=(d.match(/<svg\b[^>]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),p=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&p>0){let g=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(p*n))}"`);u=he(d.replace(h,g)),l=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(d){if(!l)throw d;f.src=t,l=!1,await f.decode()}if(s&&a)f.style.width=`${r}px`,f.style.height=`${i}px`;else if(s){let d=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:f.naturalHeight,m=r/Math.max(1,d);f.style.width=`${r}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.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*(l?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(l?1:n)));if(f.style.width=`${d}px`,f.style.height=`${h}px`,!l&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,await f.decode()}catch(m){H(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var qo=ct(()=>{"use strict";wt();oe();He();me()});var tc={};be(tc,{encodePng:()=>Wd});function yr(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),r=new DataView(n.buffer);r.setUint32(0,e.length);for(let o=0;o<4;o++)n[o+4]=t.charCodeAt(o);n.set(e,8);let i=4294967295;for(let o=4;o<n.length-4;o++)i=Za[(i^n[o])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function Wd(t,e,n){if(![t,e].every(p=>Number.isInteger(p)&&p>0&&p<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,t),i.setUint32(4,e),r[8]=8,r[9]=6;let o=[new Uint8Array([137,80,78,71,13,10,26,10]),yr("IHDR",r),yr("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),c=new Uint8Array(s),u=0,l=new CompressionStream("deflate"),f=l.writable.getWriter(),d=l.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:p,value:g}=await d.read();if(p)return;o.push(yr("IDAT",g))}}catch(p){h=p,await f.abort(p).catch(()=>{})}})();try{for await(let p of n){if(!(p instanceof Uint8Array||p instanceof Uint8ClampedArray)||!p.length||p.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let g=p.length/s;if(u+g>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y<g;y+=a){let b=Math.min(g,y+a),w=new Uint8Array((b-y)*(s+1));for(let v=y;v<b;v++){let C=p.subarray(v*s,(v+1)*s),S=(v-y)*(s+1),M=0,_=0;for(let E=0;E<s;E++){let x=C[E]-(E<4?0:C[E-4])&255,k=C[E]-c[E]&255;M+=Math.min(x,256-x),_+=Math.min(k,256-k),w[S+E+1]=k}if(w[S]=_<=M?2:1,M<_)for(let E=0;E<s;E++)w[S+E+1]=C[E]-(E<4?0:C[E-4]);c=C}await f.write(w)}c=c.slice(),u+=g}if(u!==e)throw new RangeError("[SnapDOM] PNG input does not match the declared height");if(await f.close(),await m,h)throw h;return o.push(yr("IEND")),new Blob(o,{type:"image/png"})}catch(p){throw await Promise.allSettled([f.abort(p),d.cancel(p)]),await m,p}finally{f.releaseLock(),d.releaseLock()}}var Za,ec=ct(()=>{"use strict";Za=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;Za[t]=e}});function br(t,e){if(typeof t!="string"||!t.startsWith("data:image/svg+xml"))return null;let n=mr(t).match(/<svg\b[^>]*>/i)?.[0];if(!n)return null;let r=e.crop?hr(n,e.crop):n,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),o=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),s=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&o>0)||s.length!==4||!s.every(Number.isFinite)||!(s[2]>0&&s[3]>0))return null;let a=Number.isFinite(e.width),c=Number.isFinite(e.height),u=e.meta||{},l=Math.max(1,Math.floor(i)),f=Math.max(1,Math.floor(o)),d=e.crop?l:Number.isFinite(u.vbW)?u.vbW:Number.isFinite(u.w0)?u.w0:l,h=e.crop?f:Number.isFinite(u.vbH)?u.vbH:Number.isFinite(u.h0)?u.h0:f,m=e.dpr??1,p=e.scale??1,g=(a&&c?Math.max(1,e.width):a?e.width:c?e.height*d/Math.max(1,h):l*p)*m,y=(a&&c?Math.max(1,e.height):c?e.height:a?e.width*h/Math.max(1,d):f*p)*m;if(Math.max(i,o,g,y)<=Pt&&i*o<=te&&g*y<=te||typeof CompressionStream!="function")return null;return b();async function b(){let{encodePng:w}=await Promise.resolve().then(()=>(ec(),tc)),v=Math.max(1,Math.floor(g)),C=Math.max(1,Math.floor(y)),S=pe(t),M=S.slice(S.indexOf(n)+n.length,S.lastIndexOf("</svg>")),_=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",E=i/s[2],x=o/s[3],k=0,R=0;/\bnone\b/.test(_)||(E=x=/\bslice\b/.test(_)?Math.max(E,x):Math.min(E,x),k=(i-s[2]*E)*(/xMin/.test(_)?0:/xMax/.test(_)?1:.5),R=(o-s[3]*x)*(/YMin/.test(_)?0:/YMax/.test(_)?1:.5)),k-=s[0]*E,R-=s[1]*x;let T=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),L=X()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(S),W=i/g,P=o/y,A=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/v),L?Math.floor(2046/P):8192)),N=Math.max(1,Math.min(8192,v,L?Math.floor(2046/W):8192));async function*$(){for(let F=0;F<C;F+=A){let z=Math.min(A,C-F),q=new Uint8Array(v*z*4);for(let j=0;j<v;j+=N){let J=Math.min(N,v-j),B=L?Math.max(0,Math.floor(j*W)-1):j*W,ut=L?Math.max(0,Math.floor(F*P)-1):F*P,xt=L?Math.min(l,Math.ceil((j+J)*W)+1)-B:J,at=L?Math.min(f,Math.ceil((F+z)*P)+1)-ut:z,st=xt/s[2],nt=at/s[3],pt=L?1:1/W,zt=L?1:1/P,ge=`matrix(${E*pt/st},0,0,${x*zt/nt},${(k-B)*pt/st+s[0]},${(R-ut)*zt/nt+s[1]})`,V=`${T} width="${xt}" height="${at}" preserveAspectRatio="none"><g style="all:unset!important;transform:${ge}!important;transform-origin:0 0!important">${M}</g></svg>`,G=await Ut(he(V),{width:xt,height:at,dpr:1,backgroundColor:L?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),U=G;try{if(L){U=document.createElement("canvas"),U.width=J,U.height=z;let Y=U.getContext("2d");e.backgroundColor&&(Y.fillStyle=e.backgroundColor,Y.fillRect(0,0,J,z)),Y.drawImage(G,j*W-B,F*P-ut,J*W,z*P,0,0,J,z)}let ht=U.getContext("2d").getImageData(0,0,J,z).data;for(let Y=0;Y<z;Y++)q.set(ht.subarray(Y*J*4,(Y+1)*J*4),(Y*v+j)*4)}finally{G.width=G.height=0,U!==G&&(U.width=U.height=0)}}yield q}}return w(v,C,$())}}var Go=ct(()=>{"use strict";me();mt()});var nc={};be(nc,{toBlob:()=>Xo});async function Xo(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 o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=n==="png"&&br(t,e);if(r)return r;let i=await Ut(t,e);return new Promise(o=>i.toBlob(s=>o(s),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Yo=ct(()=>{"use strict";me();Go()});var oc={};be(oc,{download:()=>Bd});async function rc(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(r){if(r.name!=="AbortError")return!1}return!0}async function Bd(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(e?.format||i||"").toLowerCase(),s=o==="jpg"?"jpeg":o||"png",a=e?.filename||"snapdom",c=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let l=Qe(),f=s==="png"&&br(t,u);if(s==="svg"||f){let m=f?await f:await Xo(t,{...u,type:"svg"});if(l&&await rc(m,c))return;let p=URL.createObjectURL(m),g=document.createElement("a");g.href=p,g.download=c,document.body.appendChild(g),g.click(),setTimeout(()=>URL.revokeObjectURL(p),1e3),g.remove();return}let d=await Ut(t,u);if(l){let m=`image/${s}`,p=await new Promise(g=>d.toBlob(g,m,e?.quality));if(p&&await rc(p,c))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=c,document.body.appendChild(h),h.click(),h.remove()}var ic=ct(()=>{"use strict";Yo();me();Go();mt()});wt();wt();mt();gt();wn();kt();var ie=new WeakMap,wi=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Dr=new Map,Hc=2e3,Ae=0;function $t(){Ae++}function xn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Gt(e))return!0;if(e.parentElement)e=e.parentElement;else{let n=e.getRootNode?.();e=n&&n.host?n.host:null}}return!1}function Cn(t){for(let e of t)if(ae(e))return!0;return!1}function ae(t){if(xn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!xn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!xn(n)){e=!1;break}}if(e)return!1}return!0}var Me=new WeakMap;function _i(t){for(let e of t){if(!ae(e))continue;let n=e.target.ownerDocument||document;Me.set(n,(Me.get(n)||0)+1);let r=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;r;r=r.parentElement||r.getRootNode?.()?.host)Me.set(r,(Me.get(r)||0)+1)}}function en(t){let e=t.ownerDocument||document;return Re(e),(Me.get(e)||0)-(Me.get(t)||0)}var Ft=0;function _e(t=document){return Re(t),Ft}function Wt(){return Re(),Ae}function nn(t){return t?(Re(t.ownerDocument||document),kn(t,Vr(t))):0}function Ee(){$t(),Ft++}var se=new WeakMap,Yt=0,Kt=0;function jc(t){se.set(t,++Yt)}function Hr(t){if(!t||t.nodeType!==1)return;Yt++,se.set(t,Yt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)se.set(e[n],Yt)}function jr(t){Hr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)jc(e)}function kn(t,e=null){let n=se.get(t)||0;if(e)for(let r of e)n=Math.max(n,se.get(r)||0);return Kt*1e9+n}function Vr(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Gr(e),n.push(e.host),e=e.host.getRootNode?.();return n}var Wr=new WeakMap;function qr(t){t=t||document;let e=Wr.get(t);if(!e||e.env!==Ft){let n=!0;try{n=Qt(t).usesHas}catch{}e={env:Ft,usesHas:n},Wr.set(t,e)}return!e.usesHas}function Vc(t){let e=n=>n?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let r=n.target,i=r&&(r.nodeType===1?r:r.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let o of n.addedNodes)if(e(o))return o.ownerDocument||document;for(let o of n.removedNodes)if(e(o))return o.ownerDocument||r&&r.ownerDocument||document}return null}var Br=new WeakSet,Je=[];function Ei(t){if(!Cn(t))return;_i(t),$t();let e=new Set;for(let n of t){if(!ae(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?Hr(r.host):Yt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)se.set(i[o],Yt)}}function Gr(t){if(!(!t||Br.has(t))){Br.add(t);try{let e=new MutationObserver(Ei);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Je.push({o:e,root:t})}catch{}}}function Ri(t){if(!Cn(t))return;_i(t),$t();let e=Vc(t);if(e){Wr.delete(e),Ft++,Kt++;return}let n=new Set;for(let r of t){if(!ae(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!qr(o)){Kt++;return}if(i===o.documentElement||i===o.body){Kt++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),jr(i))}}var Ur=new WeakSet,Ze=null,tn=[];function Re(t=document){if(t===Ze||!t||t.nodeType!==9)return;if(Ur.has(t)){Ze=t;return}Ur.add(t),Ze=t;let e=t.defaultView,n=i=>{Cn(i)&&($t(),Ft++)},r=()=>{$t(),Ft++};try{let i=new MutationObserver(Ri);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),tn.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}),tn.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{$t();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!xn(s)&&qr(s.ownerDocument||t)?jr(s):Kt++};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",()=>{$t(),Kt++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var Si=new WeakMap;function xi(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=Si.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(Si.set(t,n),$t(),t.nodeType===11){t.host?Hr(t.host):Yt++;for(let o of t.querySelectorAll("*"))se.set(o,Yt);return}let i=r.filter(o=>!n.includes(o)).concat(n.filter(o=>!r.includes(o)));for(let o of i)if(o.isConnected)if(qr(e))jr(o);else{Kt++;return}}function Mn(t,e=null){if(!t)return;xi(t,t);let n=e||Je.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)xi(r,t)}function Tt(){Re();try{for(let t=tn.length-1;t>=0;t--){let{o:e,env:n,doc:r}=tn[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}Ur.delete(r),Ze===r&&(Ze=null),tn.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?Cn(i)&&($t(),Ft++):Ri(i))}for(let t=Je.length-1;t>=0;t--){let{o:e,root:n}=Je[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Br.delete(n),Je.splice(t,1);continue}let r=e.takeRecords();r.length&&Ei(r)}}catch{}}function ce(t){if(!(!t||t.nodeType!==1)){ie.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)ie.delete(e.currentNode)}catch{}}}var qc=["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"];function Xr(t){let e=ie.get(t);if(e&&Yr(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function Fi(t){let e=ie.get(t);if(!e||!Yr(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var vi=new WeakMap;function Qt(t){let e=vi.get(t);if(!e||e.epoch!==Ae){let n=e&&e.universe;e={epoch:Ae,...di(t)};let r=e.universe;if(n&&r&&n.size===r.size){let i=!0;for(let o of r)if(!n.has(o)){i=!1;break}i&&(e.universe=n)}vi.set(t,e)}return e}function Ti(t){try{let e=Qt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,r=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let c=0;c<a.length;c++)n.add("c"+a[c])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function Gc(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Qt(e).importantProps}function rn(t,e){let n=t.ownerDocument||document,r=t.getRootNode?t.getRootNode():n;return r===n?Qt(n).universe:e&&Ot(r)?Xc(t,r,n,e):null}var Ci=new WeakMap;function Xc(t,e,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let a=Qt(n).universe;if(!a)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(a),roots:new Set}}let o=a=>{for(;Ot(a)&&!i.roots.has(a);a=a.host.getRootNode()){i.roots.add(a);for(let c of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=Ci.get(c);if((!u||u.epoch!==Ae)&&Ci.set(c,u={epoch:Ae,props:fi(c)}),!u.props)return!1;for(let l of u.props)i.universe.add(l)}Tr(a.getAnimations(),i.universe)}return!0},s=o(e)&&(!t.shadowRoot||o(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=o(a.getRootNode());return s?i.universe:r.__shadowUniverse=null}function vn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Qt(e).pseudoUniverse}var Yc={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function Fe(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Yc:Qt(e).pseudoGates}function Kc(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=h=>{if(i[h]!==void 0||xe(h)||o&&(o instanceof RegExp&&o.test(h)||typeof o=="function"&&o(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(r){for(let m of r)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;m<h.length;m++)s(h[m])}else for(let h=0;h<t.length;h++)s(t[h]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let h of a)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}let c=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let h of c)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}if(e.embedFonts){let h=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let m of h)if(!i[m])try{let p=t.getPropertyValue(m);p&&(i[m]=p)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:Pi(t),enumerable:!1});let u=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,f=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,d=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(u===0&&l===0&&f===0&&d===0){let h=(t.getPropertyValue("border-image-source")||"").trim(),m=h&&h!=="none",p=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of p)delete i[g];m||(i.border="none")}return Qc(i),i}function Qc(t){if(!bt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=Jc(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),r!==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 Jc(t,e){let n=o=>{let s=[],a=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,c;for(;c=a.exec(o||"");){let u=c[4];(u===void 0?1:parseFloat(u)/(u.endsWith("%")?100:1))>.05&&s.push([+c[1],+c[2],+c[3]])}return s},r=n(t);if(r.length||(r=n(e)),!r.length)return null;let i=[0,0,0];for(let[o,s,a]of r)i[0]+=o,i[1]+=s,i[2]+=a;return`rgb(${i.map(o=>Math.round(o/r.length)).join(", ")})`}function Pi(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 qc){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function Zc(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=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function tl(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!ki(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!ki(String(r).trim().toLowerCase())?!0:nl(t,e)?n||rl(t,e):!1}var el=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function ki(t){return el.has(t)||t.startsWith("fit-content")}function nl(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 r=1/0,i=-1/0,o=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(o=o||document.createRange(),o.selectNode(s),a=o.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let c=O(s);if(c.display==="none"||c.position==="absolute"||c.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function rl(t,e){let n=t.parentElement;if(!n)return!1;let r=O(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var zr=new WeakMap;function ol(t,e){let n=zr.get(t);if(n)return n;let r=[e];for(let i in t)r.push(i,t[i]);return n=r.join(""),zr.set(t,n),n}function Yr(t,e){return t.env===Ft&&t.stamp===kn(e,t.hosts)}var il=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,sl=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,al=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function cl(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function ll(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let r=t.parentElement,i;if(!r)i="R";else if(i=e.ids.get(r),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 o="",s=t.attributes;if(s&&s.length)if(s.length===1)o=s[0].name+"="+s[0].value;else{let c=[];for(let u=0;u<s.length;u++)c.push(s[u].name+"="+s[u].value);c.sort(),o=c.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function $i(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=Qt(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&sl.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),c=!!i.paddingUnstable||s&&/padding/i.test(o),u=r.display!==void 0&&r.display.includes("grid"),l=r.transform!==void 0&&r.transform!=="none",f=[];for(let m in r)(il.test(m)||u&&(m==="grid-template-columns"||m==="grid-template-rows")||l&&m==="transform"||a&&m.charCodeAt(0)===109&&m.startsWith("margin-")||c&&m.charCodeAt(0)===112&&m.startsWith("padding-"))&&f.push(m);t.h&&!("height"in r)&&f.push("height"),t.b&&!("block-size"in r)&&f.push("block-size");let d=new Set(f),h=[e.tagName.toLowerCase()];for(let m in r)d.has(m)||h.push(m,r[m]);return t.rr=f,t.sig=h.join("")+""+f.join(""),f}function Ni(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return Ce(n,vn(t));let a=s+e,c=o.pseudo||(o.pseudo=new Map),u=c.get(a);if(u){let f={...u.snap},d=u.rr||$i(u,t);for(let h=0;h<d.length;h++){let m=n.getPropertyValue(d[h]);m?f[d[h]]=m:delete f[d[h]]}return f}let l=Ce(n,vn(t));return c.set(a,{snap:l,rr:null,sig:null,h:"height"in l,b:"block-size"in l}),l}function fl(t,e=null,n={},r=null,i=null){let o=ie.get(t),s=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(typeof a!="function"&&o&&Yr(o,t)&&o.embedFonts===s&&o.excludeStyleProps===a)return o.snapshot;let c=e||getComputedStyle(t),u,l=null,f=r&&r.st.snaps.get(r.id);if(f){u={...f.snap};let p=f.rr||$i(f,t);l=[];for(let g=0;g<p.length;g++){let y=p[g],b=c.getPropertyValue(y);b?u[y]=b:delete u[y],l.push(b)}Object.defineProperty(u,"__needsBgInline",{value:f.snap.__needsBgInline,enumerable:!1}),f.snap.__bgClipTextFix!==void 0&&Object.defineProperty(u,"__bgClipTextFix",{value:f.snap.__bgClipTextFix,enumerable:!1})}else u=Kc(c,n,t,rn(t,i)),r&&r.st.snaps.set(r.id,{snap:u,rr:null,sig:null,h:"height"in u,b:"block-size"in u});let d=!1;if(typeof t.computedStyleMap=="function"){let p;for(let g of wi)if(u[g]==="0px")try{p||(p=t.computedStyleMap()),p.get(g)?.toString()==="auto"&&(u[g]="auto",d=!0)}catch{}}_l(t,c,u);let h=yl(t,c,u);l!==null&&(d&&l.push("",...wi.map(p=>u[p])),h&&l.push(""+h),zr.set(u,f.sig+""+l.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=Vr(t);return ie.set(t,{env:Ft,stamp:kn(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function ul(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:Dr,defaultStyle:I.defaultStyle,baseStyle:I.baseStyle,image:I.image,resource:I.resource,background:I.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Dr,defaultStyle:I.defaultStyle,baseStyle:I.baseStyle,image:I.image,resource:I.resource,background:I.background},options:t||e||{}}}var dl=/%|[\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,pl=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function hl(t,e,n){if(!t.style||t.style.length===0)return;let r=Gc(t),i=r!=null&&!dl.test(t.getAttribute("style")||"");for(let o=0;o<t.style.length;o++){let s=t.style[o];if(i&&!r.has(s)&&!(s.startsWith("background")&&pl(t)))continue;let a=n.getPropertyValue(s);a&&e.style.setProperty(s,a,t.style.getPropertyPriority(s))}}function dt(t,e,n,r){if(t.tagName==="STYLE")return;let i=ul(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&Re(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&($t(),Dr.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 c=s.styleCache.get(t);t.getAttribute?.("style")&&hl(t,e,c);let u=c.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let l=t.tagName?.toLowerCase()||"div";if(Ye.has(l)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Pi(c),enumerable:!1});let b=Vr(t);ie.set(t,{env:Ft,stamp:kn(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=cl(s),b=ll(t,y),w=t.ownerDocument||document,v=w.activeElement;b!==-1&&!al.has(t.tagName)&&!(v&&v!==w.body&&v!==w.documentElement&&v===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let d=fl(t,c,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")),ml(t,c,d),e.style?.length&&d["box-sizing"]==="border-box"&&c.getPropertyValue("box-sizing")!=="border-box"&&Sl(t,e,d);let h=Di(t);if(vl(t,e,d,h,s),h){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(d["min-width"]="0px")}let m=ol(d,l),p=!0;if(Sn(l,(d.display||"").toLowerCase())){p=Zc(t),p&&Lr(l,d,h)&&tl(t,c,h)&&(p=!1),m=`${m}${p?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";p&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(m);g===void 0&&(g=ve(d,l,p,h),a.snapshotKeyCache.size>=Hc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,g)),s.styleMap.set(e,g)}function ml(t,e,n){let r=e.getPropertyValue("overflow-x"),i=e.getPropertyValue("overflow-y");if((r==="visible"||!r)&&(i==="visible"||!i)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let o=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-o(e.getPropertyValue("border-left-width"))-o(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-o(e.getPropertyValue("border-top-width"))-o(e.getPropertyValue("border-bottom-width")),c=(u,l)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let d=parseFloat(f);Number.isFinite(d)&&(n[u]=`${Math.round((d+l)*1e3)/1e3}px`)};s>=2&&(c("width",s),c("inline-size",s)),a>=2&&(c("height",a),c("block-size",a))}var gl=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Li=["width","inline-size","height","block-size"];function yl(t,e,n){if(!gl.some(c=>n[c]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let c of["width","height"]){let u=n[`min-${c}`],l=n[`max-${c}`];if(u&&u!=="0px"&&u!=="auto"||l&&l!=="none")return""}let r=c=>parseFloat(n[c])||0,i=r("padding-left")+r("padding-right")+r("border-left-width")+r("border-right-width"),o=r("padding-top")+r("padding-bottom")+r("border-top-width")+r("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let c of Li){let u=n[c];if(!u||!u.endsWith("px"))continue;let f=c==="width"||c==="inline-size"&&!s||c==="block-size"&&s?i:o;n[c]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let c=t.scrollWidth<=t.clientWidth;n["overflow-x"]=c?"hidden":"auto",c&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let c=t.scrollHeight<=t.clientHeight;n["overflow-y"]=c?"hidden":"auto",c&&(a+="y")}return a}var bl=["box-sizing",...Li,"overflow-x","overflow-y"],wl=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function Sl(t,e,n){if(wl.test(t.getAttribute("style")))for(let r of bl)e.style.getPropertyValue(r)&&n[r]&&e.style.setProperty(r,n[r],e.style.getPropertyPriority(r))}function xl(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"}var Mi=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";function vl(t,e,n,r,i){let o=n.display||"";if(!r&&!o.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"||Mi==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=i.__oneLine||(i.__oneLine=new WeakSet);for(let c=t.parentElement;c;c=c.parentElement)if(a.has(c))return;Cl(t,n,i)&&(a.add(t),e.style.setProperty(Mi,"nowrap"))}function Cl(t,e,n){let r=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(r>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,o=i.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=i.createRange(),a=null,c=0,u=0;for(let d=o.nextNode();d;d=o.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||(a=h),Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)<Math.min(a.height,h.height)/2)return!1;c=Math.max(c,h.height)}}}if(!a)return!1;let l=Oi(t,n.__axes||(n.__axes=new WeakMap));if(!l)return!1;let f=l===Ii&&t.offsetHeight?t.getBoundingClientRect().height/t.offsetHeight:1;return r*f<=2*c}var kl=0,Ai=1,Ii=2;function Oi(t,e){let n=e.get(t);if(n!==void 0)return n;let r=O(t),i=r.transform,o=i&&i!=="none"?i.slice(i.indexOf("(")+1,-1).split(",").map(parseFloat):null;if(r.rotate&&r.rotate!=="none"||o&&(i.startsWith("matrix3d")?o[1]||o[4]:o[1]||o[2]))n=kl;else{let s=t.parentElement||t.getRootNode?.().host;n=s?Oi(s,e):Ai,n===Ai&&(r.scale&&r.scale!=="none"||r.zoom&&r.zoom!=="1"||o&&(i.startsWith("matrix3d")?o[0]!==1||o[5]!==1:o[0]!==1||o[3]!==1))&&(n=Ii)}return e.set(t,n),n}function Di(t){let e=t.parentElement;if(!e)return!1;let n=O(e).display||"";return n.includes("flex")||n.includes("grid")}function Ml(t){for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===3&&/\S/.test(r.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let r=t.firstElementChild;r;r=r.nextElementSibling){let i=O(r);if(i.display==="none")continue;let o=i.position;if(o!=="absolute"&&o!=="fixed")return!0}return!1}function Al(t){let e=t.getBoundingClientRect().top,n=-1/0,r=null;for(let i=t.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(i);let a=r.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(i.nodeType!==1)continue;let o=O(i);if(o.display==="none")continue;let s=o.position;s==="absolute"||s==="fixed"||o.float&&o.float!=="none"||(n=Math.max(n,i.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function _l(t,e,n){if(Rt(t)&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;let s=e.position;if(s==="absolute"||s==="fixed"||s==="sticky"||e.transform!=="none"||xl(e)||Di(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let u=e.clip;if(u&&u!=="auto"&&u!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!Ml(t))return;let l=parseFloat(e.height),f=Al(t);Number.isFinite(l)&&Number.isFinite(f)&&Math.abs(l-f)>2||(delete n.height,delete n["block-size"])}ke();var El=new Set(["symbol","defs"]),Rl=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Kr=new WeakMap,Wi=-1;function An(t){let e=Wt();return e!==Wi&&(Kr=new WeakMap,Wi=e),Bi(t)}function Bi(t){let e=Kr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(Rl.has(t.localName)?n=!1:El.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&Bi(r)}return Kr.set(t,n),n}function Ui(t,e){if(t?.nodeType!==1||e?.nodeType!==1||An(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let c=o[a];if(s.has(c))continue;s.add(c);let u=o.getPropertyValue(c);if(!u||!u.includes("var("))continue;let l=i&&i.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let c=a.name,u=i&&i.getPropertyValue(c);if(u)try{e.style.setProperty(c,u.trim())}catch{}}}}wt();wt();gt();we();wn();Ct();function Te(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function Pe(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),r.push({url:s[0],d:c})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function zi(t,e){let n=t.currentSrc||"";if(n&&!Te(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||Te(s))continue;let a=o.getAttribute("type");if(a&&!Cr.test(a.trim()))continue;let c=o.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Pe(s,t)}catch{}i||(i=Pe(s,t))}return i}function Hi(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!Te(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!Te(r))return r}return null}kt();mt();function Fl(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 Tl=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,Pl=/^::?(?:before|after|first-letter)$/;function $l(t,e,n=!0,r){return Pr(t,",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(Tl);if(o&&Pl.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?Fl(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function qi(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(r,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(r,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(r,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(r,i,o,s)=>{let a=$l(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Gi(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function le(t){let e="";for(let n of t)if(n.media&&n.cssRules){let r=!1;try{r=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}r&&(e+=le(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${le(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let r=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=r+(n.style?n.style.cssText:"")+le(n.cssRules)+"}"}else e+=n.cssText+`
|
|
9
9
|
`;return e}function Xi(t){let e="";try{t.querySelectorAll("style").forEach(r=>{let i=null;try{i=r.sheet&&r.sheet.cssRules}catch{}e+=(i?le(i):r.textContent||"")+`
|
|
10
10
|
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=le(r.cssRules))}catch{}}catch{}return e}function Yi(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function Ki(t,e,n={}){try{let r=null,i=O(t).content;if(i&&i.includes("url(")){let u=i.match(/url\(["']?([^"')]+)["']?\)/);u&&(r=u[1])}let o=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",c=r||(o?zi(t,o):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Pe(a,t)||t.src||"";if((!c||Te(c))&&n.resolvePicturePlaceholders!==!1){let u=Hi(t);u&&(c=u)}if(!c)return;e.getAttribute("src")!==c&&e.setAttribute("src",c),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Qi(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function Nl(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function Ji(t,e,n){let r=[];for(let i of e){let o=Nl(t,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
11
|
-
`:""}function Zi(t,e){if(!t)return;let n=r=>{let i=r.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||r.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):r.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function Ll(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Il(t){let e=t.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(i+o)));return{contentWidth:s,contentHeight:a,rect:e}}function St(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Ol(t,e,n){let r=t.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,l=0,f=0,p=0,h=0;try{let d=r&&t.body?r.getComputedStyle(t.body):null;d&&(l=(parseFloat(d.marginTop)||0)+(parseFloat(d.paddingTop)||0),f=(parseFloat(d.marginRight)||0)+(parseFloat(d.paddingRight)||0),p=(parseFloat(d.marginBottom)||0)+(parseFloat(d.paddingBottom)||0),h=(parseFloat(d.marginLeft)||0)+(parseFloat(d.paddingLeft)||0))}catch{}let m=t.createElement("style");if(m.setAttribute("data-sd-iframe-pin",""),Z(m),m.textContent=`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: ${l}px ${f}px ${p}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;}`,(t.head||t.documentElement).appendChild(m),ce(t.documentElement),i||o)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=o),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=o))}catch{}return()=>{try{m.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(i,o),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=u)}catch{}ce(t.documentElement)}}async function Qr(t,e,n){let r=await Ll(t,3);if(!r)throw new Error("The iframe document isn't ready.");let{contentWidth:i,contentHeight:o,rect:s}=Il(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let c={...n,scale:1,clip:null,__pinned:!0},u=Ol(r,i,o),l;try{l=await a.toPng(r.documentElement,c)}finally{u()}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),dt(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(l),f}function ts(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 es(t){let{width:e,height:n}=St(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(o)&&o>0?o:e||r.width||128,c=Number.isFinite(s)&&s>0?s:n||r.height||16,u=Number.parseFloat(t.min)||0,l=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),p=l-u,h=p>0&&Number.isFinite(f)?Math.min(1,Math.max(0,(f-u)/p)):.5,m="middle";try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let d=document.createElement("div");d.setAttribute("data-snapdom-input-replacement","range"),d.style.cssText=`display:inline-block;width:${a}px;height:${c}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",String(a)),g.setAttribute("height",String(c)),g.setAttribute("viewBox",`0 0 ${a} ${c}`),g.style.cssText=`width:${a}px;height:${c}px;overflow:visible`,d.appendChild(g);function y(){let b=ts(i),w=!!t.disabled,v=Math.max(2,Math.min(4,c)),C=(c-v)/2,S=Math.max(10,Math.min(14,Math.max(c,10))),M=S/2,_=M+h*Math.max(0,a-S);g.innerHTML="";let E=(k,R,T,L)=>{let W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.setAttribute("x",String(k)),W.setAttribute("y",String(C)),W.setAttribute("width",String(Math.max(0,R))),W.setAttribute("height",String(v)),W.setAttribute("rx",String(v/2)),W.setAttribute("fill",T),L&&W.setAttribute("fill-opacity",L),g.appendChild(W)};E(0,a,"#808080","0.4"),E(0,_,b);let x=document.createElementNS("http://www.w3.org/2000/svg","circle");x.setAttribute("cx",String(_)),x.setAttribute("cy",String(c/2)),x.setAttribute("r",String(M)),x.setAttribute("fill",b),g.appendChild(x),w&&g.setAttribute("opacity","0.5"),d.style.setProperty("width",`${a}px`,"important"),d.style.setProperty("height",`${c}px`,"important"),d.style.setProperty("min-width",`${a}px`,"important"),d.style.setProperty("min-height",`${c}px`,"important")}return y(),{el:d,applyVisual:y}}function ns(t){let{width:e,height:n}=St(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||r.width||0),c=Math.round(n||r.height||0),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),l=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,c||16),f=(t.type||"text").toLowerCase()==="checkbox",p=!!t.checked,h=!!t.indeterminate,d=Math.max(Math.min(u,l),12),g=Math.max(u,d),y=Math.max(l,d),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:${g}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("width",String(g)),v.setAttribute("height",String(y)),v.setAttribute("viewBox",`0 0 ${d} ${d}`),v.style.cssText=`width:${g}px;height:${y}px`,w.appendChild(v);function C(){let S=ts(i),M=2,_=M/2,E=d-M;if(v.innerHTML="",f){let x=document.createElementNS("http://www.w3.org/2000/svg","rect");if(x.setAttribute("x",String(_)),x.setAttribute("y",String(_)),x.setAttribute("width",String(E)),x.setAttribute("height",String(E)),x.setAttribute("rx","2"),x.setAttribute("ry","2"),x.setAttribute("fill",p?S:"none"),x.setAttribute("stroke",S),x.setAttribute("stroke-width",String(M)),v.appendChild(x),p){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${_+2} ${d/2} L ${d/2-1} ${d-_-2} L ${d-_-2} ${_+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,M))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),v.appendChild(k)}else if(h){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),R=Math.max(6,E-4);k.setAttribute("x",String((d-R)/2)),k.setAttribute("y",String((d-M)/2)),k.setAttribute("width",String(R)),k.setAttribute("height",String(M)),k.setAttribute("fill",S),k.setAttribute("rx","1"),v.appendChild(k)}}else{let x=document.createElementNS("http://www.w3.org/2000/svg","circle");if(x.setAttribute("cx",String(d/2)),x.setAttribute("cy",String(d/2)),x.setAttribute("r",String((d-M)/2)),x.setAttribute("fill",p?S:"none"),x.setAttribute("stroke",S),x.setAttribute("stroke-width",String(M)),v.appendChild(x),p){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),R=Math.max(2,(d-M*2)*.35);k.setAttribute("cx",String(d/2)),k.setAttribute("cy",String(d/2)),k.setAttribute("r",String(R)),k.setAttribute("fill","white"),v.appendChild(k)}}w.style.setProperty("width",`${g}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${g}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return C(),{el:w,applyVisual:C}}var on=new lt(80);async function Dl(t){if(I.resource?.has(t))return I.resource.get(t);if(on.has(t))return on.get(t);let e=(async()=>{let n=await ft(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return I.resource?.set(t,n.data),n.data})();on.set(t,e);try{let n=await e;return on.set(t,n),n}catch(n){throw on.delete(t),n}}var ji=/\bblob:[^)"'\s]+/g;function _n(t){return typeof t=="string"&&t.startsWith("blob:")}function Wl(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 Bl(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function sn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function En(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(d,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(d.setAttribute(g,o.get(y)),b?.())})},a=(d,g)=>{if(!d||!d.includes("blob:"))return;let y=d.match(ji)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=d.replace(ji,w=>o.get(w)||w);b!==d&&g(b)})}},c=sn(t,"img");for(let d of c)try{let y=d.getAttribute("src")||d.currentSrc||"";_n(y)&&s(d,"src",y);let b=d.getAttribute("srcset");if(b&&b.includes("blob:")){let w=Wl(b);for(let v of w)_n(v.url)&&r.add(v.url);i.push(()=>{let v=!1;for(let C of w)o.has(C.url)&&(C.url=o.get(C.url),v=!0);v&&d.setAttribute("srcset",Bl(w))})}}catch(g){H(n,"Couldn't inline a blob: image.",g)}let u=sn(t,"image");for(let d of u)try{let g="http://www.w3.org/1999/xlink",y=d.getAttribute("href")||d.getAttributeNS?.(g,"href");_n(y)&&s(d,"href",y,()=>d.removeAttributeNS?.(g,"href"))}catch(g){H(n,"Couldn't inline a blob: SVG image.",g)}let l=sn(t,"[style*='blob:']");for(let d of l)try{let g=d.getAttribute("style");a(g,y=>d.setAttribute("style",y))}catch(g){H(n,"Couldn't inline blob: URLs in a style attribute.",g)}let f=sn(t,"style");for(let d of f)try{let g=d.textContent||"";a(g,y=>{d.textContent=y})}catch(g){H(n,"Couldn't inline blob: URLs in a <style>.",g)}let p=["poster"];for(let d of p){let g=sn(t,`[${d}^='blob:']`);for(let y of g)try{let b=y.getAttribute(d);_n(b)&&s(y,d,b)}catch(b){H(n,`Couldn't inline the blob: URL in ${d}.`,b)}}if(!r.size)return;let h=[...r],m=0;await Promise.all(Array.from({length:Math.min(4,h.length)},async()=>{for(;m<h.length;){let d=h[m++];try{o.set(d,await Dl(d))}catch(g){H(n,"Couldn't read a blob: URL; kept it as is.",g)}}}));for(let d of i)try{d()}catch(g){H(n,"Couldn't write an inlined blob: URL.",g)}}var Ul=["font-family","font-size","font-style","font-weight","font-stretch","font-variant","font-feature-settings","font-variation-settings","font-kerning","letter-spacing","text-transform"],zl=new Set(["text","search","email","url","tel","number","submit","reset","button"]),Hl=/[^\s\uD800-\uDFFF]{2,}/;function rs(t,e=document){let n=e.defaultView||window;if(!bt()||!e.body||!(n.visualViewport?.scale<1||n.screen.width<e.documentElement.clientWidth))return;let r=Z(e.createElement("div"));r.style.cssText="position:absolute;left:0;top:0;width:0;height:0;overflow:hidden;visibility:hidden";let i=[];for(let[o,s]of t){if(o.nodeType!==1||s.nodeType!==1)continue;let a=n.getComputedStyle(s),c=s.localName==="textarea"||s.localName==="input"&&zl.has(s.type)?Vl(s,a,e):jl(s);if(!c)continue;let u=s.getBoundingClientRect(),l=s.offsetWidth&&u.width?u.width/s.offsetWidth:1,f=e.createElement("span");f.style.whiteSpace="pre";for(let p of Ul)f.style.setProperty(p,a.getPropertyValue(p));f.textContent=c.word,r.appendChild(f),i.push({clone:o,cs:a,span:f,live:c.distance/l,centers:c.centers})}if(i.length){e.body.appendChild(r);try{for(let{clone:o,cs:s,span:a,live:c,centers:u}of i){let l=a.firstChild,f=(parseFloat(s.letterSpacing)||0)*(u?l.length-1:l.length),p=u?Math.abs(Vi(l,l.length-1)-Vi(l,0)):a.getBoundingClientRect().width,h=(c-f)/(p-f);h>1.005&&Number.isFinite(h)&&(o.style.setProperty("font-size",`${parseFloat(s.fontSize)*h}px`),s.lineHeight!=="normal"&&o.style.setProperty("line-height",`${parseFloat(s.lineHeight)*h}px`))}}finally{r.remove()}}}function Vi(t,e){let n=t.ownerDocument.createRange();n.setStart(t,e),n.setEnd(t,e+1);let r=n.getBoundingClientRect();return r.left+r.width/2}function jl(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType!==3)continue;let n=/\S+/.exec(e.data);if(!n)continue;let r=t.ownerDocument.createRange();r.setStart(e,n.index),r.setEnd(e,n.index+n[0].length);let i=r.getClientRects();return i.length===1?{word:n[0],distance:i[0].width,centers:!1}:null}return null}function Vl(t,e,n){let r=Hl.exec(t.value.split(`
|
|
12
|
-
`)[0]);if(!r||t.scrollLeft||t.scrollTop||!n.caretPositionFromPoint)return null;let i=t.getBoundingClientRect(),o=t.localName==="textarea"?i.top+(parseFloat(e.borderTopWidth)||0)+(parseFloat(e.paddingTop)||0)+3:i.top+i.height/2,s=l=>{let f=n.caretPositionFromPoint(l,o);return f&&f.offsetNode===t?f.offset:-1},a=i.width/16,c=l=>{let f=i.left;for(;f<=i.right&&s(f)<l;)f+=a;if(f>i.right)return NaN;let p=f-a;for(let h=0;h<16;h++){let m=(p+f)/2;s(m)>=l?f=m:p=m}return f},u=Math.abs(c(r.index+r[0].length)-c(r.index+1));return Number.isFinite(u)?{word:r[0],distance:u,centers:!0}:null}mt();var os=new Set(["rgba(0, 0, 0, 0)","transparent"]),Jr="Highlight";function is(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function ql(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!os.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:Jr}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${Jr}`}return e.styles.set(t,n),n}function ss(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let u of e.ranges){let l=!1;try{l=u.intersectsNode(t)}catch{}if(!l)continue;let f=u.startContainer===t?u.startOffset:0,p=u.endContainer===t?u.endOffset:n.length;p>f&&i.push([f,p])}if(i.length===0)return null;let o=ql(r,e);if(!o)return null;i.sort((u,l)=>u[0]-l[0]);let s=t.ownerDocument||document,a=s.createDocumentFragment(),c=0;for(let[u,l]of i){u>c&&a.append(s.createTextNode(n.slice(c,u)));let f=s.createElement("span");f.setAttribute("data-snapdom-selection",""),f.setAttribute("style",`all:unset;${o}`),f.textContent=n.slice(u,l),a.append(f),c=l}return c<n.length&&a.append(s.createTextNode(n.slice(c))),a}var Rn=t=>Number.parseFloat(t)||0,Gl=["font-family","font-size","font-weight","font-style","font-variant","font-stretch","letter-spacing","word-spacing","text-transform","text-indent","text-align","line-height","tab-size","direction"];function Xl(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!os.has(r)&&r!==e.backgroundColor)return r}catch{}return Jr}function as(t,e){let n=t.ownerDocument||document;if(n.activeElement!==t)return;let r=null,i=null;try{r=t.selectionStart,i=t.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let o=t.value||"";if(t.localName==="input"&&t.type==="password"&&(o="\u2022".repeat(o.length)),!o)return;let s=getComputedStyle(t),a=t.localName==="textarea",c=Rn(s.paddingLeft),u=Rn(s.paddingTop),l=t.clientWidth-c-Rn(s.paddingRight),f=t.clientHeight-u-Rn(s.paddingBottom),p=n.createElement("div");p.style.cssText="position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;";for(let g of Gl)p.style.setProperty(g,s.getPropertyValue(g));a?(p.style.whiteSpace="pre-wrap",p.style.overflowWrap="break-word",p.style.width=`${Math.max(0,l)}px`):p.style.whiteSpace="pre";let h=n.createElement("span");h.textContent=o.slice(r,i),p.append(n.createTextNode(o.slice(0,r)),h,n.createTextNode(o.slice(i))),n.body.appendChild(p);let m=[];try{let g=p.getBoundingClientRect(),y=-t.scrollLeft,b=-t.scrollTop;if(!a){b+=Math.max(0,(f-g.height)/2);let w=s.direction==="rtl",v=s.textAlign;v==="start"?v=w?"right":"left":v==="end"&&(v=w?"left":"right");let C=l-g.width;C>0&&(v==="right"?y+=C:v==="center"&&(y+=C/2))}for(let w of h.getClientRects())w.width<=0||w.height<=0||m.push({x:c+(w.left-g.left)+y,y:u+(w.top-g.top)+b,width:w.width,height:w.height})}finally{p.remove()}if(m.length===0)return;let d=Xl(t,s);e.__snapdomFieldSelection={images:m.map(()=>`linear-gradient(${d},${d})`),positions:m.map(g=>`${g.x}px ${g.y}px`),sizes:m.map(g=>`${g.width}px ${g.height}px`),repeats:m.map(()=>"no-repeat"),origins:m.map(()=>"padding-box"),clips:m.map(()=>"padding-box"),base:{image:s.backgroundImage,position:s.backgroundPosition,size:s.backgroundSize,repeat:s.backgroundRepeat,origin:s.backgroundOrigin,clip:s.backgroundClip}}}function cs(t){for(let e of t.keys()){let n=e.__snapdomFieldSelection;if(!n)continue;delete e.__snapdomFieldSelection;let{images:r,positions:i,sizes:o,repeats:s,origins:a,clips:c,base:u}=n,l=e.style.backgroundImage||u.image;l&&l!=="none"?(r.push(l),i.push(e.style.backgroundPosition||u.position),o.push(e.style.backgroundSize||u.size),s.push(e.style.backgroundRepeat||u.repeat),a.push(e.style.backgroundOrigin||u.origin),c.push(e.style.backgroundClip||u.clip)):(r.push("linear-gradient(transparent,transparent)"),i.push("0% 0%"),o.push("auto"),s.push("repeat"),a.push(u.origin||"padding-box"),c.push(u.clip||"border-box")),e.style.backgroundImage=r.join(","),e.style.backgroundPosition=i.join(","),e.style.backgroundSize=o.join(","),e.style.backgroundRepeat=s.join(","),e.style.backgroundOrigin=a.join(","),e.style.backgroundClip=c.join(",")}}kt();var Zr=new Map,ls=new Set(["IFRAME"]);function $e(t,e){Zr.set(String(t).toUpperCase(),e)}function Fn(t){let e=O(t),n=e.display;if(n==="none")return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=h=>parseFloat(h)||0,o=(h,m,d,g,y)=>{if(!r||!h?.endsWith("px"))return null;let b=parseFloat(h);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-d;return b+m+d+(w>0&&b+m<y+w/2?w:0)},[s,a,c,u]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],l=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),f=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),c,u);if(l===null||f===null){let{width:h,height:m}=St(t),d=h,g=m;if(l===null&&!d||f===null&&!g){let y=t.getBoundingClientRect();d||(d=y.width||0),g||(g=y.height||0)}l??(l=d),f??(f=g)}let p=document.createElement("div");return p.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${l}px;height:${f}px;visibility:hidden;`,p}var Yl=new Set(["style","option","optgroup"]),Tn=200,Kl=new Set(["img","canvas","video","iframe","object","embed"]);function fs(t,e){return t.right>=e.left-Tn&&t.left<=e.right+Tn&&t.bottom>=e.top-Tn&&t.top<=e.bottom+Tn}function Ql(t,e){if(t===e.root)return!1;let n;try{n=t.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=O(t);if(r.display==="inline"&&!Kl.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,s=t.scrollHeight||0,a={left:r.direction==="rtl"?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+s)},c=r.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-s),a.left=Math.min(a.left,n.right-o)),fs(a,i))return!1;let u=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;u.nextNode();){let l=u.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&fs(l,i))return!1}return!0}function Jl(t,e,n){let r=t.cloneNode(!1);t.tagName==="IMG"&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),dt(t,r,e,n);let{width:i,height:o}=St(t);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden";let s=t.parentElement?O(t.parentElement).display:"",a=O(t).position;if(!/flex|grid|table/.test(s)&&(a==="static"||a==="relative")){let c=p=>{let h=O(p);return h.display!=="none"&&h.position!=="absolute"&&h.position!=="fixed"},u=t.getBoundingClientRect(),l=t.previousElementSibling;for(;l&&!c(l);)l=l.previousElementSibling;if(l){let p=u.top-l.getBoundingClientRect().bottom;p>=0&&(r.style.marginTop=`${p}px`)}let f=t.nextElementSibling;for(;f&&!c(f);)f=f.nextElementSibling;if(f){let p=f.getBoundingClientRect().top-u.bottom;p>=0&&(r.style.marginBottom=`${p}px`)}}return r.style.boxSizing="border-box",r}async function Jt(t,e,n){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.slicer?.due()&&await e.slicer.pause();let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase(),f=Gt(t);if(f&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&f||$r.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return H(e,"Skipped a nested <foreignObject>; it can't be captured."),null;if(l==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE){if(e.selection){let l=ss(t,e.selection);if(l)return l}return t.cloneNode(!0)}if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return Fn(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let l of n.exclude)try{if(t.matches?.(l)){if(n.excludeMode==="hide")return Fn(t);if(n.excludeMode==="remove")return null}}catch{console.warn(`[SnapDOM] Invalid exclude selector "${l}"; ignored.`)}if(n.excludePredicates)for(let l of n.excludePredicates)try{if(l(t))return n.excludeMode==="remove"?null:Fn(t)}catch(f){console.warn("[SnapDOM] Your exclude function threw; the element was kept.",f)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Fn(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("[SnapDOM] Your filter function threw; the element was kept.",l)}if(t!==n.element&&!Yl.has(t.localName)&&!It(t)&&O(t).display==="none"){let l=t.cloneNode(!1);t.tagName==="IMG"&&(l.removeAttribute("src"),l.removeAttribute("srcset")),l.style.setProperty("display","none","important");for(let f of t.querySelectorAll("style")){let p=await Jt(f,e,n);p&&l.appendChild(p)}return l}if(e.clip&&Ql(t,e.clip))return Jl(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let f;try{f=await l(t,n)}catch(p){H(e,"A plugin's resolveNode hook threw; ignored it.",p)}if(f===null)return null;if(f?.nodeType)return f.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(f,t),dt(t,f,e,n)),f}{let l=ls.has(t.tagName)&&Zr.get(t.tagName);if(l){let f=await l(t,e,n);if(f!==void 0)return f}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),dt(t,l,e,n);let f=document.createElement("div");return f.textContent=t.getAttribute("data-placeholder-text")||"",f.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(f),l}{let l=!ls.has(t.tagName)&&Zr.get(t.tagName);if(l){let f=await l(t,e,n);if(f!==void 0)return f}}let s;try{if(s=t.cloneNode(!1),Ui(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){Ki(t,s,n);try{let l=window.getComputedStyle(t),f=parseFloat(l.width),p=parseFloat(l.height);if(!(f>0)||!(p>0)){let d=St(t),g=b=>parseFloat(l.getPropertyValue(b))||0,y=l.getPropertyValue("box-sizing")==="border-box";f>0||(f=d.width-(y?0:g("padding-left")+g("padding-right")+g("border-left-width")+g("border-right-width"))),p>0||(p=d.height-(y?0:g("padding-top")+g("padding-bottom")+g("border-top-width")+g("border-bottom-width")))}let h=Math.round((f||0)*1e3)/1e3,m=Math.round((p||0)*1e3)/1e3;h&&(s.dataset.snapdomWidth=String(h)),m&&(s.dataset.snapdomHeight=String(m))}catch(l){H(e,"Couldn't measure an image; kept its own size.",l)}try{let l=t.getAttribute("style")||"",f=window.getComputedStyle(t),p=w=>{let v=l.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),C=v?v[1].trim():f.getPropertyValue(w);return/%|auto/i.test(String(C||""))},h=parseFloat(s.dataset.snapdomWidth||"0")||0,m=parseFloat(s.dataset.snapdomHeight||"0")||0,d=p("width")||!(h>0),g=p("height")||!(m>0);d&&h>0&&(s.style.width=`${h}px`),g&&m>0&&(s.style.height=`${m}px`);let y=f.getPropertyValue("object-fit"),b=f.getPropertyValue("object-position");y&&y!=="fill"?(s.style.objectFit=y,b&&(s.style.objectPosition=b)):(h>0&&(s.style.minWidth=`${h}px`),m>0&&(s.style.minHeight=`${m}px`))}catch(l){H(e,"Couldn't fix the size of an image.",l)}}}catch(l){throw console.error("[SnapDOM] Couldn't copy this element:",t,l),l}let a=null;if(it(t,"textarea")){let{width:l,height:f}=St(t),p=l||t.getBoundingClientRect().width||0,h=f||t.getBoundingClientRect().height||0;p&&(s.style.width=`${p}px`),h&&(s.style.height=`${h}px`)}if(it(t,"input")){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&(bt()||t.indeterminate)){let{el:p,applyVisual:h}=ns(t);e.nodeMap.set(p,t),a=h,s=p}else if(l==="range"&&(bt()||X())){let{el:p,applyVisual:h}=es(t);e.nodeMap.set(p,t),a=h,s=p}else if(l==="color"&&X()){let p=s,h=t.value||"#000000";a=()=>{p.style.setProperty("background-color",h,"important"),p.style.setProperty("color","transparent","important"),p.style.setProperty("-webkit-text-fill-color","transparent","important"),p.style.setProperty("appearance","none","important"),p.style.setProperty("-webkit-appearance","none","important")},p.removeAttribute("value")}else if((l==="date"||l==="time"||l==="datetime-local")&&(bt()||X())){s.setAttribute("type","text");let p=t.value;l==="date"&&t.valueAsDate&&(p=t.valueAsDate.toLocaleDateString(void 0,{timeZone:"UTC"})),s.value=p,s.setAttribute("value",p)}else{let p=Xe(t)?Ar(t.value):t.value;s.value=p,s.setAttribute("value",p),t.checked!==void 0&&(s.checked=t.checked,t.checked?s.setAttribute("checked",""):s.removeAttribute("checked"),t.indeterminate&&(s.indeterminate=t.indeterminate))}}if((it(t,"input")||it(t,"textarea"))&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),f=l&&l.color;f&&f!=="rgba(0, 0, 0, 0)"&&(e.__usesPlaceholder=!0,s.setAttribute("data-sd-ph",""),s.style.setProperty("--sd-ph",f),s.style.setProperty("--sd-ph-o",l.opacity||"1"))}catch{}if(it(t,"select")&&(i=new Set(Array.from(t.options).filter(l=>l.selected))),it(t,"textarea")&&(o=t.value),it(t,"input")||it(t,"textarea")||it(t,"select")){t.disabled&&s.setAttribute("disabled",""),t.required&&s.setAttribute("required",""),t.readOnly&&s.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&s.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&s.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&s.setAttribute("pattern",l.pattern);let f=t.getAttribute("aria-invalid");f!==null&&s.setAttribute("aria-invalid",f)}if(An(t)||dt(t,s,e,n),a&&a(),n.captureSelection&&(it(t,"input")||it(t,"textarea")))try{as(t,s)}catch(l){H(e,"Couldn't copy the selection of a text field.",l)}if(It(t)&&!An(t)){let l=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display","color"];try{let f=window.getComputedStyle(t);for(let p of l){let h=f.getPropertyValue(p);h&&s.style.setProperty(p,h)}t.localName==="stop"&&(s.style.setProperty("stop-color",f.getPropertyValue("stop-color")),s.style.setProperty("stop-opacity",f.getPropertyValue("stop-opacity")))}catch{}}if(t.shadowRoot){Gr(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let v=w.assignedNodes?.()||[];for(let C of v)r.add(C)}}catch{}let l=Gi(e),f=`[data-sd="${l}"]`;e.shadowScopes||(e.shadowScopes=new WeakMap),e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let p=Xi(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(p)&&(e.__shadowPseudo=!0);let h=qi(p,f,l),m=Qi(p),d=Ji(t,m,f);Yi(s,d+h,l);let g=document.createDocumentFragment(),y=await Promise.all(Array.from(t.shadowRoot.childNodes).map(b=>b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE"?null:Jt(b,e,n).catch(()=>null)));g.append(...y.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let l=e.shadowScopes?.get(t.getRootNode()),f=t.assignedNodes?.()||[],p=f.length?t.assignedNodes?.({flatten:!0})||f:[],h=p.length?p:Array.from(t.childNodes),m=document.createDocumentFragment(),d=await Promise.all(h.map(g=>Jt(g,e,n).then(y=>(y&&f.length&&Zi(y,l),y||null)).catch(()=>null)));return m.append(...d.filter(g=>!!g)),m}let c=l=>r.has(l)||t.shadowRoot&&!l.assignedSlot,u=await Promise.all(Array.from(t.childNodes).map(l=>c(l)?null:Jt(l,e,n).catch(()=>null)));if(s.append(...u.filter(l=>!!l)),i&&it(s,"select")){let l=!1;for(let f of s.options){let p=i.has(e.nodeMap.get(f));f.selected=p,p?f.setAttribute("selected",""):f.removeAttribute("selected"),l||(l=p)}if(!l&&!s.multiple){let f=s.ownerDocument.createElement("option");f.hidden=!0,f.style.setProperty("display","none","important"),f.setAttribute("selected",""),f.value="",s.appendChild(f)}}return o!==null&&it(s,"textarea")&&(s.textContent=o),s}async function Zl(t,e,n){let r=!1;try{r=!!(t.contentDocument||t.contentWindow?.document)}catch(i){H(e,"Couldn't tell if an iframe is same-origin; treated it as cross-origin.",i)}if(r)try{return await Qr(t,e,n)}catch(i){console.warn("[SnapDOM] Couldn't capture an iframe, so it was left out.",i)}if(r||console.warn(n.placeholders?"[SnapDOM] Can't capture a cross-origin iframe; showing a placeholder. Set placeholders: false to hide it.":"[SnapDOM] Can't capture a cross-origin iframe; left it out.",t),n.placeholders){let{width:i,height:o}=St(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,dt(t,s,e,n),s}else{let{width:i,height:o}=St(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,dt(t,s,e,n),s}}function an(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var tf=.95;function ef(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function nf(t,e,n){let r="";try{let a=an(t);a&&(await yt(),a=an(t));let c=null;if(!a){c=t.getContext("2d",{willReadFrequently:!0});try{c&&c.getImageData(0,0,1,1)}catch{}X()&&await yt()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{c&&c.getImageData(0,0,1,1)}catch{}if(await yt(),r=t.toDataURL("image/png"),!r||r==="data:,"){let u=document.createElement("canvas");u.width=t.width,u.height=t.height;let l=u.getContext("2d");l&&(l.drawImage(t,0,0),r=u.toDataURL("image/png"))}}}catch(a){H(e,"Couldn't read the pixels of a canvas; used its fallback content.",a)}n&&n.debug&&r&&an(t)&&H(e,"Empty canvas; capture after its first frame",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){H(e,"Couldn't set image loading hints.",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=St(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),dt(t,i,e,n),i}async function rf(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let c=document.createElement("canvas");c.width=t.videoWidth||t.offsetWidth||320,c.height=t.videoHeight||t.offsetHeight||240;let u=c.getContext("2d");u&&(u.drawImage(t,0,0,c.width,c.height),r=c.toDataURL(ef(u,c.width,c.height)?"image/jpeg":"image/png",tf),(!r||r==="data:,")&&(r=""))}catch(c){H(e,"Couldn't capture a video frame; used its poster.",c)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=St(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),dt(t,o,e,n),o}async function of(t,e,n){if(!t.controls)return;let{width:r,height:i}=St(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,c=Math.max(4,s*.16),u=s*.34,l=o-s*.34,f=u+c+s*.55,p=Math.max(0,l-s*.7-f),h=Math.max(9,Math.round(s*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${u} ${a-c} L ${u+c} ${a} L ${u} ${a+c} Z" fill="#5f6368"/><rect x="${f}" y="${a-1.5}" width="${p}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${f}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch{}return d.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,d.width=o,d.height=s,d.style.width=`${o}px`,d.style.height=`${s}px`,e.nodeMap.set(d,t),dt(t,d,e,n),d}async function us(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:c,height:u}=St(t);return c>0&&(a.style.width=`${c}px`),u>0&&(a.style.height=`${u}px`),e.nodeMap.set(a,t),dt(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Qr(t,e,n);if(a)return a}catch{}r&&console.warn(`[SnapDOM] Couldn't capture <${t.localName}>${i?` (${i})`:""}; showing its fallback content.`)}$e("IFRAME",Zl);$e("CANVAS",nf);$e("VIDEO",rf);$e("AUDIO",of);$e("OBJECT",us);$e("EMBED",us);wt();Ct();ke();gt();kt();var sf=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Ne=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function af(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ds(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(af(r),"i")):console.warn("[SnapDOM] Ignored an iconFonts entry: use a string or a RegExp.",r);return n}function Nt(t,e){let n=typeof t=="string"?t:"";for(let r of sf)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function to(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return Nt(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>Nt(i,e)):Nt(t,e)}function cf(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Pn=new Map;function lf(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function ff(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let u=a===1,l=null;if(u&&(c==="outlined"&&Ne.materialIconsFilled?l={url:Ne.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Ne.materialIconsRound?l={url:Ne.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Ne.materialIconsSharp&&(l={url:Ne.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Pn.has(l.alias))try{let p=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});await p.load(),document.fonts.add(p),Pn.set(l.alias,!0)}catch{return Pn.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(Pn.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let f=`"${l.alias}"`;return{familyForMeasure:f,familyForCanvas:f}}async function uf(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function df(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function pf(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,u=lf(o),{familyForMeasure:l,familyForCanvas:f}=await ff(a,s,u);await uf(f.replace(/^["']+|["']+$/g,""),r);let p=document.createElement("span");Z(p),p.textContent=t,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=l,p.style.fontWeight=String(n||"normal"),p.style.fontSize=`${r}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=i,document.body.appendChild(p);let h=p.getBoundingClientRect(),m=Math.max(1,Math.ceil(h.width)),d=Math.max(1,Math.ceil(h.height));document.body.removeChild(p);let g=document.createElement("canvas");g.width=m*c,g.height=d*c;let y=g.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${f}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:m,height:d}}async function $n(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let c=i[a],u=n&&n.get(c)||o[a]||null;try{let l=getComputedStyle(u||c),f=l.fontFamily||"Material Icons";if(!cf(f))continue;let p=(u||c).textContent.trim();if(!p)continue;let h=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",d=df(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(u||c).className||"",{dataUrl:b,width:w,height:v}=await pf(p,{family:f,weight:m,fontSize:h,color:d,variation:g,className:y});c.textContent="";let C=c.ownerDocument.createElement("img");C.src=b,C.alt=p,C.style.height=`${h}px`,C.style.width=`${Math.max(1,Math.round(w/v*h))}px`,C.style.objectFit="contain",C.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(C),s++}catch{}}return s}we();mt();kt();async function gs(t,e,n,r=32,i="#000",o="normal"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");Z(a),a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontStyle=o||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let c=a.getBoundingClientRect(),u=Math.ceil(c.width),l=Math.ceil(c.height);document.body.removeChild(a);let f=document.createElement("canvas");f.width=Math.max(1,u*s),f.height=Math.max(1,l*s);let p=f.getContext("2d");return p.scale(s,s),p.font=`${o||"normal"} ${n||"normal"} ${r}px "${e}"`,p.textAlign="left",p.textBaseline="top",p.fillStyle=i,p.fillText(t,0,0),{dataUrl:f.toDataURL(),width:u,height:l}}var ys=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),hf=["katex","mathjax","mathml"];function ro(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!ys.has(n.toLowerCase()))return n}return""}function mf(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(ys.has(r.toLowerCase())||e.push(r))}return e}function Nn(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Ln(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function gf(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function yf(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=Nn(n[1]),o=Nn(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=Nn(e);return{min:r,max:r}}function bf(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function wf(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Sf(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function xf(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(c=>o.endsWith(c))||n.some(c=>o===c.toLowerCase()||o.endsWith("."+c.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||hf.some(c=>a.includes(c)))return!0;for(let c of e){let u=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),f=Sf(c);if(a.includes(u)||a.includes(l)||f&&a.includes(f))return!0}return!1}catch{return!1}}function vf(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function ps(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var bs=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,In=4;async function Cf(t,e,n){if(!t)return t;let r=new Set;function i(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function o(a,c,u=0){if(u>In)return console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${In} levels.`),a;let l="",f=0,p,h=new RegExp(bs.source,"g");for(;p=h.exec(a);){l+=a.slice(f,p.index),f=h.lastIndex;let m=(p[2]||p[4]||"").trim(),d=i(m,c);if(r.has(d)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${d}`);continue}r.add(d);let g="";try{let y=await ft(d,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=ps(g,d),g=await o(g,d,u+1),l+=`
|
|
13
|
-
/* inlined: ${
|
|
11
|
+
`:""}function Zi(t,e){if(!t)return;let n=r=>{let i=r.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||r.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):r.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function Ll(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Il(t){let e=t.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(i+o)));return{contentWidth:s,contentHeight:a,rect:e}}function St(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Ol(t,e,n){let r=t.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,l=0,f=0,d=0,h=0;try{let p=r&&t.body?r.getComputedStyle(t.body):null;p&&(l=(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=t.createElement("style");if(m.setAttribute("data-sd-iframe-pin",""),Z(m),m.textContent=`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: ${l}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;}`,(t.head||t.documentElement).appendChild(m),ce(t.documentElement),i||o)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=o),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=o))}catch{}return()=>{try{m.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(i,o),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=u)}catch{}ce(t.documentElement)}}async function Qr(t,e,n){let r=await Ll(t,3);if(!r)throw new Error("The iframe document isn't ready.");let{contentWidth:i,contentHeight:o,rect:s}=Il(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let c={...n,scale:1,clip:null,__pinned:!0},u=Ol(r,i,o),l;try{l=await a.toPng(r.documentElement,c)}finally{u()}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),dt(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(l),f}function ts(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 es(t){let{width:e,height:n}=St(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(o)&&o>0?o:e||r.width||128,c=Number.isFinite(s)&&s>0?s:n||r.height||16,u=Number.parseFloat(t.min)||0,l=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),d=l-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 p=document.createElement("div");p.setAttribute("data-snapdom-input-replacement","range"),p.style.cssText=`display:inline-block;width:${a}px;height:${c}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",String(a)),g.setAttribute("height",String(c)),g.setAttribute("viewBox",`0 0 ${a} ${c}`),g.style.cssText=`width:${a}px;height:${c}px;overflow:visible`,p.appendChild(g);function y(){let b=ts(i),w=!!t.disabled,v=Math.max(2,Math.min(4,c)),C=(c-v)/2,S=Math.max(10,Math.min(14,Math.max(c,10))),M=S/2,_=M+h*Math.max(0,a-S);g.innerHTML="";let E=(k,R,T,L)=>{let W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.setAttribute("x",String(k)),W.setAttribute("y",String(C)),W.setAttribute("width",String(Math.max(0,R))),W.setAttribute("height",String(v)),W.setAttribute("rx",String(v/2)),W.setAttribute("fill",T),L&&W.setAttribute("fill-opacity",L),g.appendChild(W)};E(0,a,"#808080","0.4"),E(0,_,b);let x=document.createElementNS("http://www.w3.org/2000/svg","circle");x.setAttribute("cx",String(_)),x.setAttribute("cy",String(c/2)),x.setAttribute("r",String(M)),x.setAttribute("fill",b),g.appendChild(x),w&&g.setAttribute("opacity","0.5"),p.style.setProperty("width",`${a}px`,"important"),p.style.setProperty("height",`${c}px`,"important"),p.style.setProperty("min-width",`${a}px`,"important"),p.style.setProperty("min-height",`${c}px`,"important")}return y(),{el:p,applyVisual:y}}function ns(t){let{width:e,height:n}=St(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||r.width||0),c=Math.round(n||r.height||0),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),l=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,c||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,p=Math.max(Math.min(u,l),12),g=Math.max(u,p),y=Math.max(l,p),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:${g}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("width",String(g)),v.setAttribute("height",String(y)),v.setAttribute("viewBox",`0 0 ${p} ${p}`),v.style.cssText=`width:${g}px;height:${y}px`,w.appendChild(v);function C(){let S=ts(i),M=2,_=M/2,E=p-M;if(v.innerHTML="",f){let x=document.createElementNS("http://www.w3.org/2000/svg","rect");if(x.setAttribute("x",String(_)),x.setAttribute("y",String(_)),x.setAttribute("width",String(E)),x.setAttribute("height",String(E)),x.setAttribute("rx","2"),x.setAttribute("ry","2"),x.setAttribute("fill",d?S:"none"),x.setAttribute("stroke",S),x.setAttribute("stroke-width",String(M)),v.appendChild(x),d){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${_+2} ${p/2} L ${p/2-1} ${p-_-2} L ${p-_-2} ${_+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,M))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),v.appendChild(k)}else if(h){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),R=Math.max(6,E-4);k.setAttribute("x",String((p-R)/2)),k.setAttribute("y",String((p-M)/2)),k.setAttribute("width",String(R)),k.setAttribute("height",String(M)),k.setAttribute("fill",S),k.setAttribute("rx","1"),v.appendChild(k)}}else{let x=document.createElementNS("http://www.w3.org/2000/svg","circle");if(x.setAttribute("cx",String(p/2)),x.setAttribute("cy",String(p/2)),x.setAttribute("r",String((p-M)/2)),x.setAttribute("fill",d?S:"none"),x.setAttribute("stroke",S),x.setAttribute("stroke-width",String(M)),v.appendChild(x),d){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),R=Math.max(2,(p-M*2)*.35);k.setAttribute("cx",String(p/2)),k.setAttribute("cy",String(p/2)),k.setAttribute("r",String(R)),k.setAttribute("fill","white"),v.appendChild(k)}}w.style.setProperty("width",`${g}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${g}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return C(),{el:w,applyVisual:C}}var on=new lt(80);async function Dl(t){if(I.resource?.has(t))return I.resource.get(t);if(on.has(t))return on.get(t);let e=(async()=>{let n=await ft(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return I.resource?.set(t,n.data),n.data})();on.set(t,e);try{let n=await e;return on.set(t,n),n}catch(n){throw on.delete(t),n}}var ji=/\bblob:[^)"'\s]+/g;function _n(t){return typeof t=="string"&&t.startsWith("blob:")}function Wl(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 Bl(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function sn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function En(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(p,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(p.setAttribute(g,o.get(y)),b?.())})},a=(p,g)=>{if(!p||!p.includes("blob:"))return;let y=p.match(ji)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=p.replace(ji,w=>o.get(w)||w);b!==p&&g(b)})}},c=sn(t,"img");for(let p of c)try{let y=p.getAttribute("src")||p.currentSrc||"";_n(y)&&s(p,"src",y);let b=p.getAttribute("srcset");if(b&&b.includes("blob:")){let w=Wl(b);for(let v of w)_n(v.url)&&r.add(v.url);i.push(()=>{let v=!1;for(let C of w)o.has(C.url)&&(C.url=o.get(C.url),v=!0);v&&p.setAttribute("srcset",Bl(w))})}}catch(g){H(n,"Couldn't inline a blob: image.",g)}let u=sn(t,"image");for(let p of u)try{let g="http://www.w3.org/1999/xlink",y=p.getAttribute("href")||p.getAttributeNS?.(g,"href");_n(y)&&s(p,"href",y,()=>p.removeAttributeNS?.(g,"href"))}catch(g){H(n,"Couldn't inline a blob: SVG image.",g)}let l=sn(t,"[style*='blob:']");for(let p of l)try{let g=p.getAttribute("style");a(g,y=>p.setAttribute("style",y))}catch(g){H(n,"Couldn't inline blob: URLs in a style attribute.",g)}let f=sn(t,"style");for(let p of f)try{let g=p.textContent||"";a(g,y=>{p.textContent=y})}catch(g){H(n,"Couldn't inline blob: URLs in a <style>.",g)}let d=["poster"];for(let p of d){let g=sn(t,`[${p}^='blob:']`);for(let y of g)try{let b=y.getAttribute(p);_n(b)&&s(y,p,b)}catch(b){H(n,`Couldn't inline the blob: URL in ${p}.`,b)}}if(!r.size)return;let h=[...r],m=0;await Promise.all(Array.from({length:Math.min(4,h.length)},async()=>{for(;m<h.length;){let p=h[m++];try{o.set(p,await Dl(p))}catch(g){H(n,"Couldn't read a blob: URL; kept it as is.",g)}}}));for(let p of i)try{p()}catch(g){H(n,"Couldn't write an inlined blob: URL.",g)}}var Ul=["font-family","font-size","font-style","font-weight","font-stretch","font-variant","font-feature-settings","font-variation-settings","font-kerning","letter-spacing","text-transform"],zl=new Set(["text","search","email","url","tel","number","submit","reset","button"]),Hl=/[^\s\uD800-\uDFFF]{2,}/;function rs(t,e=document){let n=e.defaultView||window;if(!bt()||!e.body||!(n.visualViewport?.scale<1||n.screen.width<e.documentElement.clientWidth))return;let r=Z(e.createElement("div"));r.style.cssText="position:absolute;left:0;top:0;width:0;height:0;overflow:hidden;visibility:hidden";let i=[];for(let[o,s]of t){if(o.nodeType!==1||s.nodeType!==1)continue;let a=n.getComputedStyle(s),c=s.localName==="textarea"||s.localName==="input"&&zl.has(s.type)?Vl(s,a,e):jl(s);if(!c)continue;let u=s.getBoundingClientRect(),l=s.offsetWidth&&u.width?u.width/s.offsetWidth:1,f=e.createElement("span");f.style.whiteSpace="pre";for(let d of Ul)f.style.setProperty(d,a.getPropertyValue(d));f.textContent=c.word,r.appendChild(f),i.push({clone:o,cs:a,span:f,live:c.distance/l,centers:c.centers})}if(i.length){e.body.appendChild(r);try{for(let{clone:o,cs:s,span:a,live:c,centers:u}of i){let l=a.firstChild,f=(parseFloat(s.letterSpacing)||0)*(u?l.length-1:l.length),d=u?Math.abs(Vi(l,l.length-1)-Vi(l,0)):a.getBoundingClientRect().width,h=(c-f)/(d-f);h>1.005&&Number.isFinite(h)&&(o.style.setProperty("font-size",`${parseFloat(s.fontSize)*h}px`),s.lineHeight!=="normal"&&o.style.setProperty("line-height",`${parseFloat(s.lineHeight)*h}px`))}}finally{r.remove()}}}function Vi(t,e){let n=t.ownerDocument.createRange();n.setStart(t,e),n.setEnd(t,e+1);let r=n.getBoundingClientRect();return r.left+r.width/2}function jl(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType!==3)continue;let n=/\S+/.exec(e.data);if(!n)continue;let r=t.ownerDocument.createRange();r.setStart(e,n.index),r.setEnd(e,n.index+n[0].length);let i=r.getClientRects();return i.length===1?{word:n[0],distance:i[0].width,centers:!1}:null}return null}function Vl(t,e,n){let r=Hl.exec(t.value.split(`
|
|
12
|
+
`)[0]);if(!r||t.scrollLeft||t.scrollTop||!n.caretPositionFromPoint)return null;let i=t.getBoundingClientRect(),o=t.localName==="textarea"?i.top+(parseFloat(e.borderTopWidth)||0)+(parseFloat(e.paddingTop)||0)+3:i.top+i.height/2,s=l=>{let f=n.caretPositionFromPoint(l,o);return f&&f.offsetNode===t?f.offset:-1},a=i.width/16,c=l=>{let f=i.left;for(;f<=i.right&&s(f)<l;)f+=a;if(f>i.right)return NaN;let d=f-a;for(let h=0;h<16;h++){let m=(d+f)/2;s(m)>=l?f=m:d=m}return f},u=Math.abs(c(r.index+r[0].length)-c(r.index+1));return Number.isFinite(u)?{word:r[0],distance:u,centers:!0}:null}mt();var os=new Set(["rgba(0, 0, 0, 0)","transparent"]),Jr="Highlight";function is(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function ql(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!os.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:Jr}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${Jr}`}return e.styles.set(t,n),n}function ss(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let u of e.ranges){let l=!1;try{l=u.intersectsNode(t)}catch{}if(!l)continue;let f=u.startContainer===t?u.startOffset:0,d=u.endContainer===t?u.endOffset:n.length;d>f&&i.push([f,d])}if(i.length===0)return null;let o=ql(r,e);if(!o)return null;i.sort((u,l)=>u[0]-l[0]);let s=t.ownerDocument||document,a=s.createDocumentFragment(),c=0;for(let[u,l]of i){u>c&&a.append(s.createTextNode(n.slice(c,u)));let f=s.createElement("span");f.setAttribute("data-snapdom-selection",""),f.setAttribute("style",`all:unset;${o}`),f.textContent=n.slice(u,l),a.append(f),c=l}return c<n.length&&a.append(s.createTextNode(n.slice(c))),a}var Rn=t=>Number.parseFloat(t)||0,Gl=["font-family","font-size","font-weight","font-style","font-variant","font-stretch","letter-spacing","word-spacing","text-transform","text-indent","text-align","line-height","tab-size","direction"];function Xl(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!os.has(r)&&r!==e.backgroundColor)return r}catch{}return Jr}function as(t,e){let n=t.ownerDocument||document;if(n.activeElement!==t)return;let r=null,i=null;try{r=t.selectionStart,i=t.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let o=t.value||"";if(t.localName==="input"&&t.type==="password"&&(o="\u2022".repeat(o.length)),!o)return;let s=getComputedStyle(t),a=t.localName==="textarea",c=Rn(s.paddingLeft),u=Rn(s.paddingTop),l=t.clientWidth-c-Rn(s.paddingRight),f=t.clientHeight-u-Rn(s.paddingBottom),d=n.createElement("div");d.style.cssText="position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;";for(let g of Gl)d.style.setProperty(g,s.getPropertyValue(g));a?(d.style.whiteSpace="pre-wrap",d.style.overflowWrap="break-word",d.style.width=`${Math.max(0,l)}px`):d.style.whiteSpace="pre";let h=n.createElement("span");h.textContent=o.slice(r,i),d.append(n.createTextNode(o.slice(0,r)),h,n.createTextNode(o.slice(i))),n.body.appendChild(d);let m=[];try{let g=d.getBoundingClientRect(),y=-t.scrollLeft,b=-t.scrollTop;if(!a){b+=Math.max(0,(f-g.height)/2);let w=s.direction==="rtl",v=s.textAlign;v==="start"?v=w?"right":"left":v==="end"&&(v=w?"left":"right");let C=l-g.width;C>0&&(v==="right"?y+=C:v==="center"&&(y+=C/2))}for(let w of h.getClientRects())w.width<=0||w.height<=0||m.push({x:c+(w.left-g.left)+y,y:u+(w.top-g.top)+b,width:w.width,height:w.height})}finally{d.remove()}if(m.length===0)return;let p=Xl(t,s);e.__snapdomFieldSelection={images:m.map(()=>`linear-gradient(${p},${p})`),positions:m.map(g=>`${g.x}px ${g.y}px`),sizes:m.map(g=>`${g.width}px ${g.height}px`),repeats:m.map(()=>"no-repeat"),origins:m.map(()=>"padding-box"),clips:m.map(()=>"padding-box"),base:{image:s.backgroundImage,position:s.backgroundPosition,size:s.backgroundSize,repeat:s.backgroundRepeat,origin:s.backgroundOrigin,clip:s.backgroundClip}}}function cs(t){for(let e of t.keys()){let n=e.__snapdomFieldSelection;if(!n)continue;delete e.__snapdomFieldSelection;let{images:r,positions:i,sizes:o,repeats:s,origins:a,clips:c,base:u}=n,l=e.style.backgroundImage||u.image;l&&l!=="none"?(r.push(l),i.push(e.style.backgroundPosition||u.position),o.push(e.style.backgroundSize||u.size),s.push(e.style.backgroundRepeat||u.repeat),a.push(e.style.backgroundOrigin||u.origin),c.push(e.style.backgroundClip||u.clip)):(r.push("linear-gradient(transparent,transparent)"),i.push("0% 0%"),o.push("auto"),s.push("repeat"),a.push(u.origin||"padding-box"),c.push(u.clip||"border-box")),e.style.backgroundImage=r.join(","),e.style.backgroundPosition=i.join(","),e.style.backgroundSize=o.join(","),e.style.backgroundRepeat=s.join(","),e.style.backgroundOrigin=a.join(","),e.style.backgroundClip=c.join(",")}}kt();var Zr=new Map,ls=new Set(["IFRAME"]);function $e(t,e){Zr.set(String(t).toUpperCase(),e)}function Fn(t){let e=O(t),n=e.display;if(n==="none")return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=h=>parseFloat(h)||0,o=(h,m,p,g,y)=>{if(!r||!h?.endsWith("px"))return null;let b=parseFloat(h);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-p;return b+m+p+(w>0&&b+m<y+w/2?w:0)},[s,a,c,u]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],l=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),f=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),c,u);if(l===null||f===null){let{width:h,height:m}=St(t),p=h,g=m;if(l===null&&!p||f===null&&!g){let y=t.getBoundingClientRect();p||(p=y.width||0),g||(g=y.height||0)}l??(l=p),f??(f=g)}let d=document.createElement("div");return d.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${l}px;height:${f}px;visibility:hidden;`,d}var Yl=new Set(["style","option","optgroup"]),Tn=200,Kl=new Set(["img","canvas","video","iframe","object","embed"]);function fs(t,e){return t.right>=e.left-Tn&&t.left<=e.right+Tn&&t.bottom>=e.top-Tn&&t.top<=e.bottom+Tn}function Ql(t,e){if(t===e.root)return!1;let n;try{n=t.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=O(t);if(r.display==="inline"&&!Kl.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,s=t.scrollHeight||0,a={left:r.direction==="rtl"?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+s)},c=r.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-s),a.left=Math.min(a.left,n.right-o)),fs(a,i))return!1;let u=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;u.nextNode();){let l=u.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&fs(l,i))return!1}return!0}function Jl(t,e,n){let r=t.cloneNode(!1);t.tagName==="IMG"&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),dt(t,r,e,n);let{width:i,height:o}=St(t);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden";let s=t.parentElement?O(t.parentElement).display:"",a=O(t).position;if(!/flex|grid|table/.test(s)&&(a==="static"||a==="relative")){let c=d=>{let h=O(d);return h.display!=="none"&&h.position!=="absolute"&&h.position!=="fixed"},u=t.getBoundingClientRect(),l=t.previousElementSibling;for(;l&&!c(l);)l=l.previousElementSibling;if(l){let d=u.top-l.getBoundingClientRect().bottom;d>=0&&(r.style.marginTop=`${d}px`)}let f=t.nextElementSibling;for(;f&&!c(f);)f=f.nextElementSibling;if(f){let d=f.getBoundingClientRect().top-u.bottom;d>=0&&(r.style.marginBottom=`${d}px`)}}return r.style.boxSizing="border-box",r}async function Jt(t,e,n){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.slicer?.due()&&await e.slicer.pause();let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase(),f=Gt(t);if(f&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&f||$r.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return H(e,"Skipped a nested <foreignObject>; it can't be captured."),null;if(l==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE){if(e.selection){let l=ss(t,e.selection);if(l)return l}return t.cloneNode(!0)}if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return Fn(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let l of n.exclude)try{if(t.matches?.(l)){if(n.excludeMode==="hide")return Fn(t);if(n.excludeMode==="remove")return null}}catch{console.warn(`[SnapDOM] Invalid exclude selector "${l}"; ignored.`)}if(n.excludePredicates)for(let l of n.excludePredicates)try{if(l(t))return n.excludeMode==="remove"?null:Fn(t)}catch(f){console.warn("[SnapDOM] Your exclude function threw; the element was kept.",f)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Fn(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("[SnapDOM] Your filter function threw; the element was kept.",l)}if(t!==n.element&&!Yl.has(t.localName)&&!It(t)&&O(t).display==="none"){let l=t.cloneNode(!1);t.tagName==="IMG"&&(l.removeAttribute("src"),l.removeAttribute("srcset")),l.style.setProperty("display","none","important");for(let f of t.querySelectorAll("style")){let d=await Jt(f,e,n);d&&l.appendChild(d)}return l}if(e.clip&&Ql(t,e.clip))return Jl(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let f;try{f=await l(t,n)}catch(d){H(e,"A plugin's resolveNode hook threw; ignored it.",d)}if(f===null)return null;if(f?.nodeType)return f.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(f,t),dt(t,f,e,n)),f}{let l=ls.has(t.tagName)&&Zr.get(t.tagName);if(l){let f=await l(t,e,n);if(f!==void 0)return f}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),dt(t,l,e,n);let f=document.createElement("div");return f.textContent=t.getAttribute("data-placeholder-text")||"",f.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(f),l}{let l=!ls.has(t.tagName)&&Zr.get(t.tagName);if(l){let f=await l(t,e,n);if(f!==void 0)return f}}let s;try{if(s=t.cloneNode(!1),Ui(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){Ki(t,s,n);try{let l=window.getComputedStyle(t),f=parseFloat(l.width),d=parseFloat(l.height);if(!(f>0)||!(d>0)){let p=St(t),g=b=>parseFloat(l.getPropertyValue(b))||0,y=l.getPropertyValue("box-sizing")==="border-box";f>0||(f=p.width-(y?0:g("padding-left")+g("padding-right")+g("border-left-width")+g("border-right-width"))),d>0||(d=p.height-(y?0:g("padding-top")+g("padding-bottom")+g("border-top-width")+g("border-bottom-width")))}let h=Math.round((f||0)*1e3)/1e3,m=Math.round((d||0)*1e3)/1e3;h&&(s.dataset.snapdomWidth=String(h)),m&&(s.dataset.snapdomHeight=String(m))}catch(l){H(e,"Couldn't measure an image; kept its own size.",l)}try{let l=t.getAttribute("style")||"",f=window.getComputedStyle(t),d=w=>{let v=l.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),C=v?v[1].trim():f.getPropertyValue(w);return/%|auto/i.test(String(C||""))},h=parseFloat(s.dataset.snapdomWidth||"0")||0,m=parseFloat(s.dataset.snapdomHeight||"0")||0,p=d("width")||!(h>0),g=d("height")||!(m>0);p&&h>0&&(s.style.width=`${h}px`),g&&m>0&&(s.style.height=`${m}px`);let y=f.getPropertyValue("object-fit"),b=f.getPropertyValue("object-position");y&&y!=="fill"?(s.style.objectFit=y,b&&(s.style.objectPosition=b)):(h>0&&(s.style.minWidth=`${h}px`),m>0&&(s.style.minHeight=`${m}px`))}catch(l){H(e,"Couldn't fix the size of an image.",l)}}}catch(l){throw console.error("[SnapDOM] Couldn't copy this element:",t,l),l}let a=null;if(it(t,"textarea")){let{width:l,height:f}=St(t),d=l||t.getBoundingClientRect().width||0,h=f||t.getBoundingClientRect().height||0;d&&(s.style.width=`${d}px`),h&&(s.style.height=`${h}px`)}if(it(t,"input")){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&(bt()||t.indeterminate)){let{el:d,applyVisual:h}=ns(t);e.nodeMap.set(d,t),a=h,s=d}else if(l==="range"&&(bt()||X())){let{el:d,applyVisual:h}=es(t);e.nodeMap.set(d,t),a=h,s=d}else if(l==="color"&&X()){let d=s,h=t.value||"#000000";a=()=>{d.style.setProperty("background-color",h,"important"),d.style.setProperty("color","transparent","important"),d.style.setProperty("-webkit-text-fill-color","transparent","important"),d.style.setProperty("appearance","none","important"),d.style.setProperty("-webkit-appearance","none","important")},d.removeAttribute("value")}else if((l==="date"||l==="time"||l==="datetime-local")&&(bt()||X())){s.setAttribute("type","text");let d=t.value;l==="date"&&t.valueAsDate&&(d=t.valueAsDate.toLocaleDateString(void 0,{timeZone:"UTC"})),s.value=d,s.setAttribute("value",d)}else{let d=Xe(t)?Ar(t.value):t.value;s.value=d,s.setAttribute("value",d),t.checked!==void 0&&(s.checked=t.checked,t.checked?s.setAttribute("checked",""):s.removeAttribute("checked"),t.indeterminate&&(s.indeterminate=t.indeterminate))}}if((it(t,"input")||it(t,"textarea"))&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),f=l&&l.color;f&&f!=="rgba(0, 0, 0, 0)"&&(e.__usesPlaceholder=!0,s.setAttribute("data-sd-ph",""),s.style.setProperty("--sd-ph",f),s.style.setProperty("--sd-ph-o",l.opacity||"1"))}catch{}if(it(t,"select")&&(i=new Set(Array.from(t.options).filter(l=>l.selected))),it(t,"textarea")&&(o=t.value),it(t,"input")||it(t,"textarea")||it(t,"select")){t.disabled&&s.setAttribute("disabled",""),t.required&&s.setAttribute("required",""),t.readOnly&&s.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&s.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&s.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&s.setAttribute("pattern",l.pattern);let f=t.getAttribute("aria-invalid");f!==null&&s.setAttribute("aria-invalid",f)}if(An(t)||dt(t,s,e,n),a&&a(),n.captureSelection&&(it(t,"input")||it(t,"textarea")))try{as(t,s)}catch(l){H(e,"Couldn't copy the selection of a text field.",l)}if(It(t)&&!An(t)){let l=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display","color"];try{let f=window.getComputedStyle(t);for(let d of l){let h=f.getPropertyValue(d);h&&s.style.setProperty(d,h)}t.localName==="stop"&&(s.style.setProperty("stop-color",f.getPropertyValue("stop-color")),s.style.setProperty("stop-opacity",f.getPropertyValue("stop-opacity")))}catch{}}if(t.shadowRoot){Gr(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let v=w.assignedNodes?.()||[];for(let C of v)r.add(C)}}catch{}let l=Gi(e),f=`[data-sd="${l}"]`;e.shadowScopes||(e.shadowScopes=new WeakMap),e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let d=Xi(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(d)&&(e.__shadowPseudo=!0);let h=qi(d,f,l),m=Qi(d),p=Ji(t,m,f);Yi(s,p+h,l);let g=document.createDocumentFragment(),y=await Promise.all(Array.from(t.shadowRoot.childNodes).map(b=>b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE"?null:Jt(b,e,n).catch(()=>null)));g.append(...y.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let l=e.shadowScopes?.get(t.getRootNode()),f=t.assignedNodes?.()||[],d=f.length?t.assignedNodes?.({flatten:!0})||f:[],h=d.length?d:Array.from(t.childNodes),m=document.createDocumentFragment(),p=await Promise.all(h.map(g=>Jt(g,e,n).then(y=>(y&&f.length&&Zi(y,l),y||null)).catch(()=>null)));return m.append(...p.filter(g=>!!g)),m}let c=l=>r.has(l)||t.shadowRoot&&!l.assignedSlot,u=await Promise.all(Array.from(t.childNodes).map(l=>c(l)?null:Jt(l,e,n).catch(()=>null)));if(s.append(...u.filter(l=>!!l)),i&&it(s,"select")){let l=!1;for(let f of s.options){let d=i.has(e.nodeMap.get(f));f.selected=d,d?f.setAttribute("selected",""):f.removeAttribute("selected"),l||(l=d)}if(!l&&!s.multiple){let f=s.ownerDocument.createElement("option");f.hidden=!0,f.style.setProperty("display","none","important"),f.setAttribute("selected",""),f.value="",s.appendChild(f)}}return o!==null&&it(s,"textarea")&&(s.textContent=o),s}async function Zl(t,e,n){let r=!1;try{r=!!(t.contentDocument||t.contentWindow?.document)}catch(i){H(e,"Couldn't tell if an iframe is same-origin; treated it as cross-origin.",i)}if(r)try{return await Qr(t,e,n)}catch(i){console.warn("[SnapDOM] Couldn't capture an iframe, so it was left out.",i)}if(r||console.warn(n.placeholders?"[SnapDOM] Can't capture a cross-origin iframe; showing a placeholder. Set placeholders: false to hide it.":"[SnapDOM] Can't capture a cross-origin iframe; left it out.",t),n.placeholders){let{width:i,height:o}=St(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,dt(t,s,e,n),s}else{let{width:i,height:o}=St(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,dt(t,s,e,n),s}}function an(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var tf=.95;function ef(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function nf(t,e,n){let r="";try{let a=an(t);a&&(await yt(),a=an(t));let c=null;if(!a){c=t.getContext("2d",{willReadFrequently:!0});try{c&&c.getImageData(0,0,1,1)}catch{}X()&&await yt()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{c&&c.getImageData(0,0,1,1)}catch{}if(await yt(),r=t.toDataURL("image/png"),!r||r==="data:,"){let u=document.createElement("canvas");u.width=t.width,u.height=t.height;let l=u.getContext("2d");l&&(l.drawImage(t,0,0),r=u.toDataURL("image/png"))}}}catch(a){H(e,"Couldn't read the pixels of a canvas; used its fallback content.",a)}n&&n.debug&&r&&an(t)&&H(e,"Empty canvas; capture after its first frame",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){H(e,"Couldn't set image loading hints.",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=St(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),dt(t,i,e,n),i}async function rf(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let c=document.createElement("canvas");c.width=t.videoWidth||t.offsetWidth||320,c.height=t.videoHeight||t.offsetHeight||240;let u=c.getContext("2d");u&&(u.drawImage(t,0,0,c.width,c.height),r=c.toDataURL(ef(u,c.width,c.height)?"image/jpeg":"image/png",tf),(!r||r==="data:,")&&(r=""))}catch(c){H(e,"Couldn't capture a video frame; used its poster.",c)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=St(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),dt(t,o,e,n),o}async function of(t,e,n){if(!t.controls)return;let{width:r,height:i}=St(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,c=Math.max(4,s*.16),u=s*.34,l=o-s*.34,f=u+c+s*.55,d=Math.max(0,l-s*.7-f),h=Math.max(9,Math.round(s*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${u} ${a-c} L ${u+c} ${a} L ${u} ${a+c} Z" fill="#5f6368"/><rect x="${f}" y="${a-1.5}" width="${d}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${f}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,p=document.createElement("img");try{p.decoding="sync",p.loading="eager"}catch{}return p.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,p.width=o,p.height=s,p.style.width=`${o}px`,p.style.height=`${s}px`,e.nodeMap.set(p,t),dt(t,p,e,n),p}async function us(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:c,height:u}=St(t);return c>0&&(a.style.width=`${c}px`),u>0&&(a.style.height=`${u}px`),e.nodeMap.set(a,t),dt(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Qr(t,e,n);if(a)return a}catch{}r&&console.warn(`[SnapDOM] Couldn't capture <${t.localName}>${i?` (${i})`:""}; showing its fallback content.`)}$e("IFRAME",Zl);$e("CANVAS",nf);$e("VIDEO",rf);$e("AUDIO",of);$e("OBJECT",us);$e("EMBED",us);wt();Ct();ke();gt();kt();var sf=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Ne=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function af(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ds(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(af(r),"i")):console.warn("[SnapDOM] Ignored an iconFonts entry: use a string or a RegExp.",r);return n}function Nt(t,e){let n=typeof t=="string"?t:"";for(let r of sf)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function to(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return Nt(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>Nt(i,e)):Nt(t,e)}function cf(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Pn=new Map;function lf(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function ff(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let u=a===1,l=null;if(u&&(c==="outlined"&&Ne.materialIconsFilled?l={url:Ne.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Ne.materialIconsRound?l={url:Ne.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Ne.materialIconsSharp&&(l={url:Ne.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Pn.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});await d.load(),document.fonts.add(d),Pn.set(l.alias,!0)}catch{return Pn.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(Pn.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let f=`"${l.alias}"`;return{familyForMeasure:f,familyForCanvas:f}}async function uf(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function df(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function pf(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,u=lf(o),{familyForMeasure:l,familyForCanvas:f}=await ff(a,s,u);await uf(f.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");Z(d),d.textContent=t,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=l,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let h=d.getBoundingClientRect(),m=Math.max(1,Math.ceil(h.width)),p=Math.max(1,Math.ceil(h.height));document.body.removeChild(d);let g=document.createElement("canvas");g.width=m*c,g.height=p*c;let y=g.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${f}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:m,height:p}}async function $n(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let c=i[a],u=n&&n.get(c)||o[a]||null;try{let l=getComputedStyle(u||c),f=l.fontFamily||"Material Icons";if(!cf(f))continue;let d=(u||c).textContent.trim();if(!d)continue;let h=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",p=df(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(u||c).className||"",{dataUrl:b,width:w,height:v}=await pf(d,{family:f,weight:m,fontSize:h,color:p,variation:g,className:y});c.textContent="";let C=c.ownerDocument.createElement("img");C.src=b,C.alt=d,C.style.height=`${h}px`,C.style.width=`${Math.max(1,Math.round(w/v*h))}px`,C.style.objectFit="contain",C.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(C),s++}catch{}}return s}we();mt();kt();async function gs(t,e,n,r=32,i="#000",o="normal"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");Z(a),a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontStyle=o||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let c=a.getBoundingClientRect(),u=Math.ceil(c.width),l=Math.ceil(c.height);document.body.removeChild(a);let f=document.createElement("canvas");f.width=Math.max(1,u*s),f.height=Math.max(1,l*s);let d=f.getContext("2d");return d.scale(s,s),d.font=`${o||"normal"} ${n||"normal"} ${r}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(t,0,0),{dataUrl:f.toDataURL(),width:u,height:l}}var ys=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),hf=["katex","mathjax","mathml"];function ro(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!ys.has(n.toLowerCase()))return n}return""}function mf(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(ys.has(r.toLowerCase())||e.push(r))}return e}function Nn(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Ln(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function gf(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function yf(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=Nn(n[1]),o=Nn(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=Nn(e);return{min:r,max:r}}function bf(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function wf(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Sf(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function xf(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(c=>o.endsWith(c))||n.some(c=>o===c.toLowerCase()||o.endsWith("."+c.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||hf.some(c=>a.includes(c)))return!0;for(let c of e){let u=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),f=Sf(c);if(a.includes(u)||a.includes(l)||f&&a.includes(f))return!0}return!1}catch{return!1}}function vf(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function ps(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var bs=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,In=4;async function Cf(t,e,n){if(!t)return t;let r=new Set;function i(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function o(a,c,u=0){if(u>In)return console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${In} levels.`),a;let l="",f=0,d,h=new RegExp(bs.source,"g");for(;d=h.exec(a);){l+=a.slice(f,d.index),f=h.lastIndex;let m=(d[2]||d[4]||"").trim(),p=i(m,c);if(r.has(p)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${p}`);continue}r.add(p);let g="";try{let y=await ft(p,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=ps(g,p),g=await o(g,p,u+1),l+=`
|
|
13
|
+
/* inlined: ${p} */
|
|
14
14
|
${g}
|
|
15
|
-
`):l+=p[0]}return l+=a.slice(f),l}let s=ps(t,e||location.href);return s=await o(s,e||location.href,0),s}var ws=/url\((["']?)([^"')]+)\1\)/g,kf=/@font-face[^{}]*\{[^}]*\}/g;function At(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Ss(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let u=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[u,l]};if(s){let c=a(o),u=a(s),l=Array.isArray(c)?c[0]:c,f=Array.isArray(u)?u[1]:u;e.push([Math.min(l,f),Math.max(l,f)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function xs(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function oo(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(ws)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function eo(t,e,n=""){let r=t;for(let i of t.matchAll(ws)){let o=re(i[0]);if(!o)continue;let s=o;if(!s.startsWith("http")&&!s.startsWith("data:"))try{s=new URL(s,e||location.href).href}catch{}if(I.resource?.has(s)){r=r.replace(i[0],`url(${I.resource.get(s)})`);continue}try{let a=await ft(s,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;I.resource?.set(s,c),r=r.replace(i[0],`url(${c})`)}}catch{console.warn("[SnapDOM] Couldn't load font file:",s)}}return r}function Mf(t){if(!t.length)return null;let e=(a,c)=>t.some(([u,l])=>!(l<a||u>c)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function hs(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Mf(o);if(s&&r.has(s))return!0}return!1}}function Af(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=At(o,"font-family"),a=ro(s),c=At(o,"font-weight","400"),u=At(o,"font-style","normal"),l=At(o,"font-stretch","100%"),f=At(o,"unicode-range"),p=At(o,"src"),h=oo(p,location.href),m=h.length?h.map(g=>String(g).toLowerCase()).sort().join("|"):p.toLowerCase(),d=[String(a||"").toLowerCase(),c,u,l,f.toLowerCase(),m].join("|");n.has(d)||(n.add(d),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var ms=new WeakMap,_f=0;function Ef(t){let e=ms.get(t);return e===void 0&&(e=_f++,ms.set(t,e)),e}function Rf(t,e,n,r,i,o,s,a,c){let u=Array.from(t||[]).sort().join("|"),l=0,f=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,f++}let p=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",h=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),m=r||"",d=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Ef(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${u}::ex=${p}::lf=${h}::px=${m}::fd=${d}::doc=${g}::cp=${l}::n=${f}::ic=${y}::env=${c}`}async function no(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=In){console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${In} levels.`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${c}`);continue}c&&r.visitedSheets.add(c);let u={...r,depth:(r.depth||0)+1};await no(a.styleSheet,c,n,u);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await no(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),u=ro(c);if(!u||Nt(u,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),f=(a.style.getPropertyValue("font-style")||"").trim(),p=(a.style.getPropertyValue("font-stretch")||"").trim(),h=(a.style.getPropertyValue("font-variation-settings")||"").trim(),m=(a.style.getPropertyValue("src")||"").trim(),d=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=f||"normal",b=p||"100%",w=(f?`font-style:${f};`:"")+(l?`font-weight:${l};`:"")+(p?`font-stretch:${p};`:"")+(h?`font-variation-settings:${h};`:"")+(d?`unicode-range:${d};`:""),v=r.faceMatchesRequired(u,y,g,b);if(!v&&!r.requiredIndex.has(u.toLowerCase()))continue;let C=Ss(d);if(!xs(r.usedCodepoints,C))continue;let S={family:u,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:d,srcRaw:m,srcUrls:oo(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,C))continue;if(!v){r.provisionalFaces.push({family:u.toLowerCase(),block:`@font-face{font-family:${u};src:${m};${w}}`,srcRaw:m,baseHref:e||location.href});continue}r.coveredFamilies.add(u.toLowerCase());let M=`"${String(u).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(m)){let _=await eo(m,e||location.href,r.useProxy);await n(`@font-face{font-family:${M};src:${_};${w}}`)}else await n(`@font-face{font-family:${M};src:${m};${w}}`)}}}async function vs({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[M,_,E,x]=String(S).split("__");if(!M)continue;let k=M.toLowerCase(),R=c.get(k)||[];R.push({w:parseInt(_,10),s:E,st:parseInt(x,10)}),c.set(k,R)}function u(S,M,_,E){let x=String(S).toLowerCase();if(!c.has(x))return!1;let k=c.get(x),R=yf(_),T=bf(M),L=wf(E),W=R.min!==R.max,P=R.min,A=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),N=!1;for(let $ of k){let F=W?$.w>=R.min&&$.w<=R.max:$.w===P,z=A(Ln($.s)),q=$.st>=L.min&&$.st<=L.max;if(F&&z&&q){N=!0;break}}if(N)return!0;if(!W)for(let $ of k){let F=A(Ln($.s)),z=$.st>=L.min&&$.st<=L.max;if(Math.abs(P-$.w)<=300&&F&&z)return!0}if(!W&&T.kind==="normal"&&k.some(F=>Ln(F.s)!=="normal"))for(let F of k){let z=Math.abs(P-F.w)<=300,q=F.st>=L.min&&F.st<=L.max;if(z&&q)return!0}return!1}let l=hs(n);_e(a),Tt();let f=Rf(t,n,r,i,o,a,e,s,_e(a));if(I.resource?.has(f))return I.resource.get(f);let p=vf(t),h=[],m=bs;for(let S of a.querySelectorAll("style")){let M=S.textContent||"";for(let _ of M.matchAll(m)){let E=(_[2]||_[4]||"").trim();if(!E||to(E,s))continue;a.querySelector(`link[rel="stylesheet"][href="${E}"]`)||h.push(E)}}let d=[];h.length&&await Promise.all(h.map(S=>new Promise(M=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return M(null);let _=a.createElement("link");_.rel="stylesheet",_.href=S,Z(_),_.setAttribute("data-snapdom","injected-import");let E=setTimeout(()=>M(null),3e3),x=k=>{clearTimeout(E),M(k)};_.onload=()=>x(_),_.onerror=()=>x(null),a.head.appendChild(_),d.push(_)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of d)try{S.remove()}catch{}for(let S of w)try{if(to(S.href,s))continue;let M="",_=!1;try{_=new URL(S.href,location.href).origin===location.origin}catch{}if(!_){let x=Array.isArray(o)?o:[];if(!xf(S.href,p,x))continue}if(_){let x=Array.from(a.styleSheets).find(k=>k.href===S.href);if(x)try{let k=x.cssRules||[];M=Array.from(k).map(R=>R.cssText).join("")}catch{}}if(!M){let x=await ft(S.href,{as:"text",useProxy:i});x?.ok&&typeof x.data=="string"&&(M=x.data)}M=await Cf(M,S.href,i);let E="";for(let x of M.match(kf)||[]){let k=At(x,"font-family"),R=ro(k);if(!R||Nt(R,s))continue;let T=At(x,"font-weight","400"),L=At(x,"font-style","normal"),W=At(x,"font-stretch","100%"),P=At(x,"unicode-range"),A=At(x,"src"),N=oo(A,S.href),$=u(R,L,T,W);if(!$&&!c.has(R.toLowerCase()))continue;let F=Ss(P);if(!xs(e,F))continue;let z={family:R,weightSpec:T,styleSpec:L,stretchSpec:W,unicodeRange:P,srcRaw:A,srcUrls:N,href:S.href};if(n&&l(z,F))continue;if(!$){b.push({family:R.toLowerCase(),block:x,srcRaw:A,baseHref:S.href});continue}y.add(R.toLowerCase());let q=/url\(/i.test(A)?await eo(x,S.href,i):x;E+=q}E.trim()&&(g+=E)}catch{console.warn("[SnapDOM] Couldn't read stylesheet:",S.href)}let v={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:u,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?hs(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},C=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of C)if(!(S.href&&w.some(M=>M.href===S.href)))try{let M=S.href||a.baseURI||location.origin+"/";M&&v.visitedSheets.add(M),await no(S,M,async _=>{g+=_},v)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await eo(S.block,S.baseHref,i):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let M=String(S.family).replace(/^['"]+|['"]+$/g,"");if(Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(E=>String(E).toLowerCase()===M.toLowerCase()))continue;let _=S._snapdomSrc;if(!String(_).startsWith("data:"))if(I.resource?.has(S._snapdomSrc))_=I.resource.get(S._snapdomSrc);else try{let E=await ft(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(E.ok&&typeof E.data=="string")_=E.data,I.resource?.set(S._snapdomSrc,_);else continue}catch{console.warn("[SnapDOM] Couldn't load font file:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${M}';src:url(${_});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let M=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===M.toLowerCase()))continue;let _=S.weight!=null?String(S.weight):"normal",E=S.style!=null?String(S.style):"normal",x=S.stretchPct!=null?`${S.stretchPct}%`:"100%",k=String(S.src||""),R=k;if(!R.startsWith("data:"))if(I.resource?.has(k))R=I.resource.get(k);else try{let T=await ft(k,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")R=T.data,I.resource?.set(k,R);else continue}catch{console.warn("[SnapDOM] Couldn't load font file from localFonts:",k);continue}g+=`@font-face{font-family:'${M}';src:url(${R});font-style:${E};font-weight:${_};font-stretch:${x};}`}return g&&(g=Af(g),I.resource?.set(f,g)),g}function On(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let f of l)r.add(f.codePointAt(0))},o=l=>{let f=mf(l.fontFamily);if(f.length)for(let p of f)n.add(`${p}__${Nn(l.fontWeight)}__${Ln(l.fontStyle)}__${gf(l.fontStretch)}`)},s=Fe(t),a=t.getRootNode(),c=l=>{o(O(l));let f=l.getRootNode()===a?s:Fe(l);for(let p of["::before","::after"]){let h=p==="::before"?f.before:f.after;if(h!==null){if(h==="")continue;try{if(!l.matches(h))continue}catch{}}let m=O(l,p),d=m&&m.content;if(!(!d||d==="none"||d==="normal"))if(o(m),/^["']/.test(d))i(d.slice(1,-1));else{let g=d.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},u=[t];for(let l=0;l<u.length;l++){let f=u[l];f.nodeType===Node.ELEMENT_NODE&&c(f),f.shadowRoot&&u.push(f.shadowRoot);let p=(t.ownerDocument||document).createTreeWalker(f,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;p.nextNode();){let h=p.currentNode;if(h.nodeType===Node.TEXT_NODE){if(e&&h.parentElement&&!e(h.parentElement))continue;i(h.nodeValue||"")}else{if(e&&!e(h))continue;c(h),h.shadowRoot&&u.push(h.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function Dn(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");Z(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await yt(),await yt()}Ct();function As(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Cs(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ks(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function Ms(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return Cs(t,!1);case"upper-alpha":case"upper-latin":return Cs(t,!0);case"lower-roman":return ks(t,!1);case"upper-roman":return ks(t,!0);default:return String(t)}}function cn(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function _s(t){let e=new WeakMap,n=_r(t)?t.documentElement:t,r=u=>u&&u.tagName==="LI",i=new WeakMap,o=u=>{let l=new Map;for(let[f,p]of u)l.set(f,p.slice());return l},s=(u,l,f)=>{let p=o(u),h;try{h=getComputedStyle(f)}catch{h=f.style}let m;try{m=h?.counterReset}catch{}if(m&&m!=="none")for(let[y,b]of cn(m,0)){let w=l.get(y);if(w&&w.length){let v=w.slice();v.push(b),p.set(y,v)}else p.set(y,[b])}let d;try{d=h?.counterSet}catch{}if(d&&d!=="none")for(let[y,b]of cn(d,0)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,p.set(y,w)}let g;try{g=h?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of cn(g,1)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,p.set(y,w)}try{if(h?.display==="list-item"&&r(f)){let y=f.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,v=b===void 0?Number.isFinite(w)?w:1:b+1,C=y?.tagName==="OL"?parseInt(f.getAttribute("value"),10):NaN;Number.isFinite(C)&&(v=C),y&&i.set(y,v);let S=p.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=v,p.set("list-item",S)}}catch{}return p},a=(u,l,f)=>{let p=s(f,l,u);e.set(u,p);let h=p;for(let d of u.children)h=a(d,p,h);let m=new Map;for(let[d,g]of f){let y=g.length,b=h.get(d);m.set(d,b&&b.length?b.slice(0,y):g.slice())}for(let[d,g]of h)!m.has(d)&&g.length&&!l.has(d)&&m.set(d,g.slice(0,1));return m},c=new Map;return a(n,c,c),{get(u,l){let f=e.get(u)?.get(l);return f&&f.length?f[f.length-1]:0},getStack(u,l){let f=e.get(u)?.get(l);return f?f.slice():[]}}}function Es(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),u=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return Ms(l,u)}else{let c=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),f=n.getStack(e,c);return f.length?f.map(h=>Ms(h,l)).join(u):""}})}catch{return"- "}}we();var Le=new WeakMap,Rs=1e3;function Ff(t,e){let n=$s(t);return e?(e.__pseudoPreflightFp!==n&&(Tt(),e.__pseudoPreflight=Fs(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Tt(),Fs(t,n))}function Wn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function $s(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let u=a.sheet,l=u?Wn(u):null;l&&(r+=l.length)}else{let c=a.getAttribute("href")||"",u=a.getAttribute("media")||"all";n+=`L${c}|m:${u}|`;let l=a.sheet,f=l?Wn(l):null;f&&(r+=f.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=Wn(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function io(t,e,n){let r=Wn(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&io(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let c=o.cssRules[a],u=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(u.includes(l))return!0}if(n.budget<=0)return!1}return!1}function Fs(t=document,e=$s(t)){let n=Le.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&Ee();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let c=o[a].textContent||"";for(let u of i)if(c.includes(u))return Le.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:Rs};try{for(let c of s)if(io(c,i,a))return Le.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:Rs};for(let u=0;u<a.length&&c.budget>0;u++){let l=a[u],f=null;if(l.tagName,f=l.sheet||null,f&&io(f,i,c))return Le.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(t,{fingerprint:e,result:!0}),!0):(Le.set(t,{fingerprint:e,result:!1}),!1)}function Ts(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Tf(t,e){let n=null,r=()=>{if(!n)try{n=_s(t)}catch(i){H(e,"Couldn't compute CSS counters; list numbers may be off.",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function Pf(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function $f(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
16
|
-
`?"":r})}function Nf(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push($f(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function so(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let u=a.slice();return u[u.length-1]=Math.max(u[u.length-1],c),u}return a}}:e}function ao(t,e,n){let r=new Map,i=(u,l)=>cn(u,l).map(([f,p])=>({name:f,num:p})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(u){if(r.has(u))return r.get(u).slice();let l=n.getStack(t,u);l=l.length?l.slice():[];let f=o.find(m=>m.name===u);if(f){let m=Number.isFinite(f.num)?f.num:0;l=l.length?[...l,m]:[m]}let p=s.find(m=>m.name===u);if(p){let m=Number.isFinite(p.num)?p.num:0;l.length===0&&(l=[0]),l[l.length-1]=m}let h=a.find(m=>m.name===u);if(h){let m=Number.isFinite(h.num)?h.num:1;l.length===0&&(l=[0]),l[l.length-1]+=m}return r.set(u,l.slice()),l}return{get(u,l){let f=c(l);return f.length?f[f.length-1]:0},getStack(u,l){return c(l)},__incs:a}}var Lf=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],If=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function Ps(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let f=O(t).display||"";if(i==="::marker"?!f.includes("list-item"):!(f==="block"||f==="flow-root"||f==="list-item"||f==="inline-block"||f==="table-cell"||f==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let c="";for(let f of o){let p=s.getPropertyValue(f);p&&p!==a.getPropertyValue(f)&&!(f==="background-color"&&p==="rgba(0, 0, 0, 0)")&&!(f==="vertical-align"&&p==="baseline")&&(c+=`${f}:${p};`)}if(i==="::marker"){let f=s.getPropertyValue("content");f&&f!=="normal"&&f!=="none"&&(c+=`content:${f};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function Of(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Df(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=Pf(o),o=Of(o,t);let s=so(t,n,r),a=ao(t,i,s),c=As(o)?Es(o,t,a):o;return{text:Nf(c),incs:a.__incs||[]}}function Wf(t,e){if(e.__shadowPseudo)return!1;let n=Fe(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Ie(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Ff(o,n)&&!n.__shadowPseudo||!i&&Wf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Tf(t.ownerDocument||document,n));let s=n.__counterCtx,a=Fe(t);a.marker!==""&&Ps(t,e,n,a.marker,"::marker",Lf),a.firstLine!==""&&Ps(t,e,n,a.firstLine,"::first-line",If);for(let u of["::before","::after","::first-letter"]){let l=a[u==="::before"?"before":u==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let f=O(t,u);if(!f||f.content==="none"&&f.backgroundImage==="none"&&(f.backgroundColor==="transparent"||f.backgroundColor==="rgba(0, 0, 0, 0)")&&!Ts(f)&&(!f.transform||f.transform==="none")&&f.display==="inline")continue;if(f.display==="none"||u!=="::first-letter"&&(f.content==="none"||f.content==="normal")){u==="::before"&&(e.dataset.snapdomHasBefore="1"),u==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(u==="::first-letter"){let V=O(t),G=(V?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let U=jt=>f[jt]!==V[jt]&&(parseFloat(f[jt])||0)!==0;if(!(f.color!==V.color||f.fontSize!==V.fontSize||f.fontWeight!==V.fontWeight||f.fontFamily!==V.fontFamily||f.fontStyle!==V.fontStyle||f.textTransform!==V.textTransform||f.float!==V.float&&f.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let Y=Array.from(e.childNodes).find(jt=>jt.nodeType===Node.TEXT_NODE&&jt.textContent?.trim().length>0);if(!Y)continue;let vt=Y.textContent,ye=/^\s*/.exec(vt)[0],gn=vt.slice(ye.length),Ve=gn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],wr=gn.slice(Ve?.length||0);if(!Ve||/[\uD800-\uDFFF]/.test(Ve))continue;let Ht=document.createElement("span");Ht.textContent=Ve,Ht.dataset.snapdomPseudo="::first-letter";let Sr=Ce(f,vn(t)),xr=ve(Sr,"span");n.styleMap.set(Ht,xr);let yn=document.createTextNode(wr);e.replaceChild(yn,Y),e.insertBefore(Ht,yn),ye&&e.insertBefore(document.createTextNode(ye),Ht);continue}let m=f.content??"",d=m===""||m==="none"||m==="normal",{text:g,incs:y}=Df(t,u,s,n.__siblingCounters),b=f.backgroundImage,w=f.backgroundColor,v=f.fontFamily,C=parseInt(f.fontSize)||32,S=parseInt(f.fontWeight)||!1,M=f.fontStyle||"normal",_=f.color||"#000",E=f.transform,x=Nt(v,r?.__iconMatchers),k=!d&&g!=="",R=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",L=Ts(f),W=E&&E!=="none",P=m!=="none"&&m!=="normal",A=/^inline-/.test(f.display||""),N=P&&((parseFloat(f.width)||0)>0||(parseFloat(f.height)||0)>0||A),$=P&&f.boxShadow&&f.boxShadow!=="none",F=P&&f.outlineStyle&&f.outlineStyle!=="none"&&(parseFloat(f.outlineWidth)||0)>0;if(!(k||R||T||L||W||N||$||F)){if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let U=so(t,s,n.__siblingCounters),Y=ao(t,O(t,u),U).get(t,G);V.set(G,Y)}n.__siblingCounters.set(t.parentElement,V)}continue}let q=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),j=f.display==="inline"&&f.cssFloat==="none"&&f.position!=="absolute"&&f.position!=="fixed",J=!1;if(k&&!x&&g.length>1&&!q&&j){let V=O(t),G=parseFloat(V.fontSize)||16,U=parseFloat(V.lineHeight);Number.isFinite(U)||(U=G*1.5),t.getBoundingClientRect().height<U*1.6&&(e.style.whiteSpace="nowrap",J=!0)}let B=document.createElement("span");B.dataset.snapdomPseudo=u,B.style.pointerEvents="none",J&&(B.style.whiteSpace="nowrap");let ut=Ni(t,u,f,n,r),xt=(O(t).display||"").toLowerCase(),at=xt.includes("flex")||xt.includes("grid");if(at){let V=ut["min-width"];(!V||V==="auto"||V==="0px")&&(ut["min-width"]="0px")}let st=k;st&&!j&&parseFloat(f.height)>=1.5*(parseFloat(f.lineHeight)||(parseFloat(f.fontSize)||16)*1.2)&&(st=!1,B.style.whiteSpace=f.whiteSpace);let nt=ve(ut,"span",st,at);if(n.styleMap.set(B,nt),x&&g&&g.length===1){let{dataUrl:V,width:G,height:U}=await gs(g,v,S,C,_,M),ht=document.createElement("img");ht.src=V,ht.style=`height:${C}px;width:${G/U*C}px;object-fit:contain;`,B.appendChild(ht),e.dataset.snapdomHasIcon="true"}else if(g&&q){let V=Ge(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(g);if(V?.trim())try{let G=await ft(qt(V),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let U=document.createElement("img");U.src=G.data,U.style=`width:${C}px;height:auto;object-fit:contain;`,B.appendChild(U)}}catch(G){console.warn(`[SnapDOM] Couldn't draw the ${u} icon of`,t,G)}}else!x&&k&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=f.backgroundRepeat,B.style.backgroundSize=f.backgroundSize,f.backgroundPositionX&&f.backgroundPositionY?(B.style.backgroundPositionX=f.backgroundPositionX,B.style.backgroundPositionY=f.backgroundPositionY):B.style.backgroundPosition=f.backgroundPosition,B.style.backgroundOrigin=f.backgroundOrigin,B.style.backgroundClip=f.backgroundClip,B.style.backgroundAttachment=f.backgroundAttachment,B.style.backgroundBlendMode=f.backgroundBlendMode}catch{}if(R)try{let V=Xt(b),G=await Promise.all(V.map(U=>Se(U,r)));B.style.backgroundImage=G.join(", ")}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} background image.`,V)}T&&(B.style.backgroundColor=w);let pt=f.maskImage||f.webkitMaskImage;if(pt&&pt!=="none")try{let G=(await Promise.all(Xt(pt).map(U=>Se(U,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let U of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])f[U]&&(B.style[U]=f[U])}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} mask image.`,V)}let ge=B.childNodes.length>0||B.textContent?.trim()!==""||R||T||L||W||N||$||F;if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map,G=so(t,s,n.__siblingCounters),U=ao(t,O(t,u),G);for(let{name:ht}of y){if(!ht)continue;let Y=U.get(t,ht);V.set(ht,Y)}n.__siblingCounters.set(t.parentElement,V)}if(!ge)continue;u==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(f){console.warn(`[SnapDOM] Couldn't copy the ${u} of`,t,f)}}let c=Array.from(e.children).filter(u=>!u.dataset.snapdomPseudo);if(n.nodeMap)for(let u of c){let l=n.nodeMap.get(u);l?.nodeType===1&&await Ie(l,u,n,r,!0)}else{let u=Array.from(t.children);for(let l=0;l<Math.min(u.length,c.length);l++)await Ie(u[l],c[l],n,r,!0)}}Ct();function Ns(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=It(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),u="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let M=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(u,"href"):null);if(M)return M;let _=S.attributes;if(!_)return null;for(let E=0;E<_.length;E++){let x=_[E];if(!x||!x.name)continue;if(x.name==="href")return x.value;let k=x.name.indexOf(":");if(k!==-1&&x.name.slice(k+1)==="href")return x.value}return null},f=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),p=new Set,h=!1,m=(S,M=null)=>{if(!S)return;s.lastIndex=0;let _;for(;_=s.exec(S);){h=!0;let E=(_[1]||"").trim();E&&(f.has(E)||(p.add(E),M&&!M.has(E)&&M.add(E)))}},d=S=>{let M=S.querySelectorAll("use");for(let x of M){let k=l(x);if(!k||!k.startsWith("#"))continue;h=!0;let R=k.slice(1).trim();R&&!f.has(R)&&p.add(R)}let _='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';m(S.getAttribute("style")||"");for(let x of a)m(S.getAttribute(x));let E=S.querySelectorAll(_);for(let x of E){m(x.getAttribute("style")||"");for(let k of a)m(x.getAttribute(k))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let M="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",_=!1;try{_=!!(i.querySelector&&i.querySelector(M))}catch{return}if(!_)return;let E=["filter","clipPath","mask","maskImage","webkitMaskImage"],x=k=>{if(It(k))return;let R;try{R=getComputedStyle(k)}catch{return}for(let T of E){let L=R[T];L&&L.includes("url(")&&m(L)}};x(S);for(let k of S.querySelectorAll("*"))x(k)};for(let S of o)d(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||f.has(S))return null;let M=c(S),_=E=>{let x=i.querySelector(E);return x&&!t.contains(x)?x:null};return _(`svg defs > *#${M}`)||_(`svg > symbol#${M}`)||_(`*#${M}`)};if(!p.size)return;let v=new Set(p),C=new Set;for(;v.size;){let S=v.values().next().value;if(v.delete(S),!S||f.has(S)||C.has(S))continue;let M=w(S);if(!M){C.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let _=M.cloneNode(!0);_.id||_.setAttribute("id",S),b.appendChild(_),C.add(S),f.add(S);let E=[_,..._.querySelectorAll("*")];for(let x of E){let k=l(x);if(k&&k.startsWith("#")){let T=k.slice(1).trim();T&&!f.has(T)&&!C.has(T)&&v.add(T)}let R=x.getAttribute?.("style")||"";R&&m(R,v);for(let T of a){let L=x.getAttribute?.(T);L&&m(L,v)}}}}Ct();var co=new WeakMap,lo=new WeakMap;function Bn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([u,l])=>{let f={property:u,value:i.getPropertyValue(u),priority:i.getPropertyPriority(u)};return i.setProperty(u,l,"important"),f.forcedValue=i.getPropertyValue(u),f}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function Ls(t){if(co.has(t))return Bn(t,[],co);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return Bn(t,s,co)}return()=>{}}function Un(t,e=null){let n=[],r=i=>{if(!Rt(i))return;if(lo.has(i)){n.push(Bn(i,[],lo));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(Bn(i,[["content-visibility","visible"]],lo))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}wt();gt();kt();ke();kt();function uo(t){return Os(t.boxShadow)}function po(t){return Os(t.textShadow)}function Os(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;c<t.length;c++){let u=t[c];u==="("?r++:u===")"&&(r=Math.max(0,r-1)),u===","&&r===0?(e.push(n),n=""):n+=u}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let u=c.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(u.length<2)continue;let[l,f,p=0,h=0]=u,m=Math.abs(l)+p+h,d=Math.abs(f)+p+h;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),s=Math.max(s,d+Math.max(f,0)),i=Math.max(i,d+Math.max(-f,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function ho(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function mo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function go(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let u=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(d=>parseFloat(d))||[],[l=0,f=0,p=0]=u,h=Math.abs(l)+p,m=Math.abs(f)+p;i=Math.max(i,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:D(r),right:D(i),bottom:D(o),left:D(s)},has:a}}function Bf(t){let e=uo(t),n=po(t),r=ho(t),i=mo(t),o=go(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function Uf(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 Is(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function Ds(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,u=Is(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let p=n.get(f);if(!p||!Uf(p))continue;let h=Bf(p);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),d={left:m.left-h.left/r,top:m.top-h.top/i,right:m.right+h.right/r,bottom:m.bottom+h.bottom/i};for(let g=f.parentElement;g;g=g.parentElement){let y=Is(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(d.left=Math.max(d.left,b.left),d.right=Math.min(d.right,b.right)),y.y&&(d.top=Math.max(d.top,b.top),d.bottom=Math.min(d.bottom,b.bottom))}if(g===t)break}u.x||(c=Math.max(c,(l.left-d.left)*r),s=Math.max(s,(d.right-l.right)*r)),u.y||(o=Math.max(o,(l.top-d.top)*i),a=Math.max(a,(d.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function Ws(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=fe(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let u=Zt({scale:c});return{a:u.a,b:u.b,c:u.c,d:u.d}}function i(c,u,l,f){let p=Math.sqrt(c*c+u*u)||0,h=0,m=0;if(p>0){let d=c/p,g=u/p;h=d*l+g*f;let y=l-d*h,b=f-g*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:p,b:0,c:h*m,d:m}}let o=c=>{let u=fe(t).scale;if(!u)return c;let l=Zt({scale:u,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===6&&c.every(Number.isFinite)){let[u,l,f,p]=c,h=i(u,l,f,p);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===16&&c.every(Number.isFinite)){let u=c[0],l=c[1],f=c[4],p=c[5],h=i(u,l,f,p);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let c=new DOMMatrix(r),u=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return o(u)}catch{return null}}function Oe(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,u=n.e||0,l=n.f||0;function f(y,b){let w=y-r,v=b-i,C=o*w+a*v,S=s*w+c*v;return C+=r+u,S+=i+l,[C,S]}let p=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,d=-1/0,g=-1/0;for(let[y,b]of p)y<h&&(h=y),b<m&&(m=b),y>d&&(d=y),b>g&&(g=b);return{minX:h,minY:m,maxX:d,maxY:g,width:d-h,height:g-m}}function ln(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?c/2:u==="right"||u==="bottom"?c:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*c/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(i,e),oy:s(o,n)}}function fe(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var fo=null;function zf(){if(fo?.isConnected)return fo;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Z(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),fo=t,t}function Zt(t){let e=o=>{let s=[],a=0,c=0,u=String(o).trim();for(let l=0;l<u.length;l++)u[l]==="("?a++:u[l]===")"?a--:/\s/.test(u[l])&&!a&&(l>c&&s.push(u.slice(c,l)),c=l+1);return c<u.length&&s.push(u.slice(c)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=zf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");o.appendChild(s);try{return Hf(s)}finally{s.remove()}}}function Bs(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function Hf(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var js=new WeakSet;function zn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function yo(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Ot(e)?e.host:null}function jf(t,e){for(let n=e;n;n=yo(n))if(n===t)return!0;return!1}function Vf(t,e){for(let n=yo(t);n&&n!==e&&n?.nodeType===1;n=yo(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function wo(t,e){try{return Zt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Vs(t,e,n,r,i){let o=t.getBoundingClientRect();Rt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!Rt(a)||c?.nodeType!==1||c===t||!jf(t,c))continue;let u=r.get(c)||O(c),l=u.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let f=c.getBoundingClientRect();if(!(f.width>0&&f.height>0))continue;js.add(a);let p=u.transform&&u.transform!=="none"?u.transform:"",h=fe(c),m=!!(p||h.rotate!=="0deg"||h.scale||h.translate),d=m?wo(p,h):null,g=!d||!d.is2D||d.a===1&&d.b===0&&d.c===0&&d.d===1,y=f.width,b=f.height;g||(y=c.offsetWidth||f.width,b=c.offsetHeight||f.height);let w=c.getRootNode&&Ot(c.getRootNode()),v=o,C=t.clientLeft||0,S=t.clientTop||0;if(w){let k=Vf(c,t);k&&(v=k.getBoundingClientRect(),C=k.clientLeft||0,S=k.clientTop||0)}let M=f.left-v.left-C,_=f.top-v.top-S;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${d.a},${d.b},${d.c},${d.d},0,0)`;let{ox:k,oy:R}=ln(u,y,b),T=Oe(y,b,{a:d.a,b:d.b,c:d.c,d:d.d,e:0,f:0},k,R);M-=T.minX,_-=T.minY}if(l!=="fixed"){let k=a.cloneNode(!1);k.setAttribute("data-snap-ph","1"),k.style.position="static",k.style.visibility="hidden",k.style.width=`${y}px`,k.style.height=`${b}px`,k.style.boxSizing="border-box",a.parentElement?.insertBefore(k,a)}let E=y+2,x=b;i&&(Math.abs(_-i.y)<.5&&(_-=1,x+=1),Math.abs(M-i.x)<.5&&(M-=1,E+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${_}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${E}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function qs(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){H(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){H(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){H(n,"Couldn't remove the root outline.",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){H(n,"Couldn't remove the root drop-shadow filter.",s)}}function Gs(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 Us(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function qf(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Xs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!Us(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=qf(s,i);if(!c)break;let u=n?Array.from(a.children).find(p=>n.get(p)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),f=parseFloat(l[`margin${o}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${o}`]="0px"),Us(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=u}}}var Gf=new Set(["xml","xlink"]);function Xf(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Gf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var Yf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,zs=t=>t.replace(Yf,e=>e.length===2?e:""),Kf=/^data:[^,]{0,120};base64,/;function Hn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(Xf(c.name,n)){a.removeAttribute(c.name);continue}if(Kf.test(c.value))continue;let u=zs(c.value);if(u!==c.value)try{a.setAttribute(c.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=zs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Qf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var Jf=new Set(["img","canvas","video","iframe","object","embed"]);function Zf(t){return It(t)||Jf.has(t?.localName)}function tu(t,e){if(t?.nodeType!==1||Qf(t)||Zf(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function Ys(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&tu(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",f=c.overflowX||c.overflowInline||"visible";(l!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(r)for(let l of u){let f=r.get(l);f&&f.nodeType===1&&i(f,l)}else{let l=Array.from(o.children);for(let f=0;f<Math.min(l.length,u.length);f++)i(l[f],u[f])}}i(t,e)}function eu(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function nu(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){H(e,"Invalid exclude selector; ignored.",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){H(e,"Your exclude function threw; ignored.",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){H(e,"Your filter function threw; ignored.",n)}return!1}function So(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let h of a){if(nu(h,e)||!eu(h))continue;let m=h.getBoundingClientRect(),d=m.top-r.top,g=m.bottom-r.top;g<=d||(d<i&&(i=d),g>o&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,u=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return u+l+f+p+c}var D=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,De=.75;function Ks(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,u=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-u)>.02)return 0;let l=s.createElement("div");Z(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=l.attachShadow({mode:"open"}),p=s.createElement("style");p.textContent=n,f.appendChild(p);let h=e.cloneNode(!0);f.appendChild(h),s.body.appendChild(l);let m=0,d=(g,y,b)=>{let w=O(g),v=w.boxSizing==="border-box",C=(S,M,..._)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let x=E+(v?0:_.reduce((k,R)=>k+(parseFloat(R)||0),0));return Math.abs(x-M)<=.51?x:M};return{width:C(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:C(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,v=b>0&&g.height>0?g.height/b:1,C=(S,M,_=!1)=>{let E=S.children,x=M.children,k=Math.min(E.length,x.length);for(let R=0;R<k;R++){let T=E[R],L=x[R],W=r.get(T),P=_||js.has(T);if(W?.nodeType===1&&Rt(T)&&T.style&&W.isConnected){let A=W.getBoundingClientRect();if(A.width>0&&A.height>0){let N=L.getBoundingClientRect(),$=A.width/c,F=A.height/u,z=N.width,q=N.height,j=W.offsetWidth||$,J=W.offsetHeight||F,B=L.offsetWidth||z,ut=L.offsetHeight||q,xt=Math.abs($-j)>De||Math.abs(F-J)>De||Math.abs(z-B)>De||Math.abs(q-ut)>De;if(P){let nt=d(L,B,ut);$=z>0?$*w*nt.width/z:$,F=q>0?F*v*nt.height/q:F,z=nt.width,q=nt.height}else if(xt){let nt=d(W,j,J),pt=d(L,B,ut);$=nt.width,F=nt.height,z=pt.width,q=pt.height}let at=z-$,st=q-F;(Math.abs(at)>De||Math.abs(st)>De)&&(T.style.boxSizing="border-box",T.style.width=`${D($)}px`,T.style.height=`${D(F)}px`,m++)}}C(T,L,P)}};C(e,h)}finally{l.remove()}return m}var ru=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function bo(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=bo(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=bo(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(ru.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var Hs=new WeakMap;function ou(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function iu(t){if(!t||!t.styleSheets)return"";let e=ou(t),n=Hs.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=bo(s,r))}catch{}return Hs.set(t,{fp:e,css:i}),i}function Qs(t,e){let n=Ir(t.clone).sort(),r=n.join(","),i=rn(t.element),o=I.baseStyle.get(r),s;o&&o.universe===i?s=o.css:(s=Or(n,i),I.baseStyle.set(r,{universe:i,css:s}));let a=iu(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=s,t.scrollbarCSS=a,{baseCSS:s,scrollbarCSS:a,fontsCSS:e}}mt();var jn=new Set,su="[data-sd-ph]::placeholder{color:var(--sd-ph)!important;opacity:var(--sd-ph-o)!important;-webkit-text-fill-color:var(--sd-ph)!important}";async function Js(t,e={}){Tt(),Mn(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e,slicer:e.__slicer||null},i=null,o=null;if(e.clip&&(o=zn(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=is(t)}catch(d){H(r,"Couldn't read the text selection.",d)}let s,a="",c="";if(jn.size){let d=(g,y)=>{for(let b=y;b;b=b.assignedSlot||b.parentElement||b.getRootNode()?.host)if(b===g)return!0;return!1};for(;;){let g=[...jn].filter(({root:y})=>d(y,t)||d(t,y)).map(({promise:y})=>y.catch(()=>{}));if(!g.length)break;await Promise.all(g)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let d=t.getBoundingClientRect(),g=t.ownerDocument?.defaultView||window,y=d.right<=0||d.bottom<=0||d.left>=g.innerWidth||d.top>=g.innerHeight,b=[];if(y&&(()=>{let v=[];t.shadowRoot&&v.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&v.push(C.shadowRoot);for(;v.length;){let C=v.pop(),S=C.host?.localName==="calcite-icon";for(let M of C.querySelectorAll("*")){if(M.shadowRoot&&v.push(M.shadowRoot),!S||M.localName!=="svg")continue;let _=M.querySelectorAll("path");if(!_.length||[..._].some(x=>x.getAttribute("d")?.trim()))continue;let E=M.getBoundingClientRect();E.width&&E.height&&b.push(M)}}})(),b.length){let v=(async()=>{let S=t.style,M=t.hasAttribute("style"),_=new Map,E=(x,k)=>{_.has(x)||_.set(x,{value:S.getPropertyValue(x),priority:S.getPropertyPriority(x)}),S.setProperty(x,k,"important");let R=_.get(x);R.forcedValue=S.getPropertyValue(x),R.forcedPriority=S.getPropertyPriority(x)};try{E("left","0"),E("top","0"),E("right","auto"),E("bottom","auto"),E("margin-top","0"),E("margin-right","0"),E("margin-bottom","0"),E("margin-left","0"),E("transform","none"),E("translate","none"),E("opacity","0"),E("pointer-events","none");let x=t.getBoundingClientRect();if(x.right<=0||x.bottom<=0||x.left>=g.innerWidth||x.top>=g.innerHeight){let T=t.parentElement?.getBoundingClientRect(),L=T&&T.right>0&&T.left<g.innerWidth?Math.max(0,T.left):0,W=T&&T.bottom>0&&T.top<g.innerHeight?Math.max(0,T.top):0;E("position","fixed"),E("left",`${L}px`),E("top",`${W}px`)}await yt(100);let k=Date.now()+1500,R=()=>b.some(T=>{if([...T.querySelectorAll("path")].some(W=>W.getAttribute("d")?.trim()))return!1;let L=T.getBoundingClientRect();return L.width&&L.height&&L.right>0&&L.bottom>0&&L.left<g.innerWidth&&L.top<g.innerHeight});for(;Date.now()<k&&R();)await new Promise(T=>setTimeout(T,25));await yt(100)}finally{for(let[x,k]of _)S.getPropertyValue(x)!==k.forcedValue||S.getPropertyPriority(x)!==k.forcedPriority||(k.value?S.setProperty(x,k.value,k.priority):S.removeProperty(x));!M&&!S.length&&t.removeAttribute("style"),await yt(100)}})(),C={root:t,promise:v};jn.add(C);try{await v}finally{jn.delete(C)}}}catch{}let u=Ls(t),l=Un(t,o);if(o){let d=t.getBoundingClientRect(),g=t.offsetWidth||d.width,y=t.offsetHeight||d.height,b=d.width&&Math.abs(g-d.width)>=1?g/d.width:1,w=d.height&&Math.abs(y-d.height)>=1?y/d.height:1;i={x:(o.left-d.left)*b,y:(o.top-d.top)*w,width:o.width*b,height:o.height*w}}try{s=await Jt(t,r,e)}catch(d){throw console.warn("[SnapDOM] Capture failed while copying the element.",d),d}finally{l(),u()}rs(r.nodeMap,t.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{Ns(s,void 0,t)}catch(d){console.warn("[SnapDOM] Couldn't copy external SVG icons; some may be missing.",d)}try{await Ie(t,s,r,e)}catch(d){console.warn("[SnapDOM] Couldn't copy ::before/::after content; some decorations may be missing.",d)}await En(s,r);for(let[d,g]of r.nodeMap.entries())if(g?.tagName==="STYLE"&&d?.tagName==="STYLE"&&!d.hasAttribute("data-sd"))try{let y=g.sheet&&g.sheet.cssRules;y&&/@media/i.test(d.textContent||"")&&(d.textContent=le(y))}catch{}try{let d=s.querySelectorAll("style[data-sd]");for(let g of d)c+=g.textContent||"",g.remove()}catch(d){H(r,"Couldn't copy shadow DOM styles.",d)}r.slicer?.due()&&await r.slicer.pause();let f=Ke(r.styleMap);a=Array.from(f.entries()).map(([d,g])=>`.${g}{${d}}`).join("");let h=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__usesPlaceholder?su:"")+(r.__pseudoCSS||"");a=h+a;for(let[d,g]of r.styleMap.entries())xo(d,g,f);try{au(t,s,r.nodeMap)}catch(d){H(r,"Couldn't bring an open dialog or popover into the capture.",d)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let d=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Vs(t,s,r.nodeMap,r.styleCache,d)}catch(d){H(r,"Couldn't keep fixed-position elements in place.",d)}for(let[d,g]of r.nodeMap.entries())r.clip&&g===t||vo(d,g);let m=t.ownerDocument;if((t===m.body||t===m.documentElement)&&m.documentElement.localName==="html"){let d=r.styleCache.get(m.documentElement)||O(m.documentElement);t===m.documentElement&&(s.style.overflow="visible");let g=t===m.body?s:s.querySelector("body");if(g&&d.overflowX==="visible"&&d.overflowY==="visible"&&d.contain==="none"&&!d.containerType?.includes("size")&&d.contentVisibility!=="auto"&&d.contentVisibility!=="hidden"){let y=r.styleCache.get(m.body)||O(m.body);y.contain==="none"&&!y.containerType?.includes("size")&&y.contentVisibility!=="auto"&&y.contentVisibility!=="hidden"&&y.display!=="none"&&(g.style.overflow="visible")}}if(t===r.nodeMap.get(s)){let d=r.styleCache.get(t)||O(t);r.styleCache.set(t,d);let g=kr(d.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=g||"",s.style.translate="none"}for(let[d,g]of r.nodeMap.entries())g.tagName==="PRE"&&(d.style.marginTop="0",d.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function au(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),u=c.backgroundColor,l=c.backgroundImage;if(u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||l&&l!=="none"){let p=document.createElement("div");p.setAttribute("data-sd-backdrop",""),p.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${u};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(p)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function xo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Ot(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function vo(t,e){let n=e.scrollLeft,r=e.scrollTop;if(!(n||r)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let s=t.querySelectorAll("*");for(let a of s){if(a.nodeType!==1||a.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let c=a.style.position;if(c==="fixed"||c==="absolute"){let u=parseFloat(a.style.top)||0,l=parseFloat(a.style.left)||0;a.style.top=`${u+r}px`,a.style.left=`${l+n}px`,c==="fixed"&&(a.style.position="absolute")}}}catch{}let o=document.createElement("div");for(o.style.all="unset",o.style.transform=`translate(${-n}px, ${-r}px)`,o.style.willChange="transform",o.style.display="inline-block",o.style.width="100%";t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}we();oe();gt();var Zs="http://www.w3.org/1999/xlink";function cu(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Zs,"href"):null)}function lu(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Vn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||Pe(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let u=I.image?.get(c);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await ft(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){I.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:p}=lu(a),{fallbackURL:h}=e||{};if(h)try{let m=typeof h=="function"?await h({width:f,height:p,src:c,element:a}):h;if(m){let d=await ft(m,{as:"dataURL",useProxy:e.useProxy});if(d?.ok&&typeof d.data=="string"){a.src=d.data,a.width||(a.width=f),a.height||(a.height=p);return}}}catch{}if(e.placeholders!==!1){Mt(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let m=document.createElement("div");m.style.cssText=[`width:${f}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${f}px;height:${p}px;visibility:hidden;`,a.replaceWith(m)}},i=6;for(let a=0;a<n.length;a+=i){let c=n.slice(a,a+i).map(r);await Promise.allSettled(c)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let c=cu(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let u=await ft(c,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Zs,"href"))};for(let a=0;a<o.length;a+=i){let c=o.slice(a,a+i).map(s);await Promise.allSettled(c)}}mt();wt();var fu=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],uu=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],du=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],pu=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function hu(t,e,n,r){let i=n.get(t)||O(t);n.has(t)||n.set(t,i);let o=Fi(t),s=o?m=>m in o?o[m]:"":m=>i.getPropertyValue(m),a=s("border-image"),c=s("border-image-source"),u=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),f=s("background-color"),p=l&&l!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=bt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(p&&!h)for(let m of du){let d=s(m);d&&e.style.setProperty(m,d)}for(let m of fu){if(h&&m==="background-image")continue;let d=i.getPropertyValue(m);if(m==="background-image"&&(!d||d==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(d=Xt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||d)}if(!d||d==="none")continue;let g=Xt(d),y=await Promise.all(g.map(b=>Se(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(m,y.join(", "))}for(let m of uu){let d=s(m);!d||d==="initial"||e.style.setProperty(m,d)}if(u)for(let m of pu){let d=s(m);!d||d==="initial"||e.style.setProperty(m,d)}if(p&&/fixed/.test(s("background-attachment")||""))try{await gu(t,e,i)}catch{}}function mu(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let p=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*p,h:n*p}}let s=o.split(/\s+/),a=(p,h)=>{if(p==="auto"||p===void 0)return null;if(p.endsWith("px"))return parseFloat(p);if(p.endsWith("%"))return h*parseFloat(p)/100},c=a(s[0],r),u=a(s[1],i);if(c===void 0||u===void 0)return null;let l=c,f=u;return l==null&&f==null?(l=e||r,f=n||i):l==null?l=e&&n?f*(e/n):r:f==null&&(f=e&&n?l*(n/e):i),!l||!f?null:{w:l,h:f}}async function gu(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(m=>m.trim()),i=Qe();if(!i)for(let m=t.parentElement;m&&!i;m=m.parentElement){let d=O(m);(d.transform&&d.transform!=="none"||d.filter&&d.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,u=Xt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(m=>m.trim()),f=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(m=>m.trim()),p=[],h=[];for(let m=0;m<u.length;m++){let d=r[m%r.length]||"scroll",g=l[m%l.length],y=f[m%f.length];if(d!=="fixed"){p.push(g),h.push(y);continue}let b=0,w=0,v=u[m]&&u[m].match(/url\(["']?([^"')]+)["']?\)/);if(v)try{let x=new Image;x.src=v[1],await x.decode(),b=x.naturalWidth,w=x.naturalHeight}catch{p.push(g),h.push(y);continue}let C=mu(g,b,w,a,c);if(!C){p.push(g),h.push(y);continue}let S=y.split(/\s+/),M=(x,k,R)=>{if(!x)return 0;if(x.endsWith("px"))return parseFloat(x);if(x.endsWith("%"))return(k-R)*parseFloat(x)/100},_=M(S[0]||"0%",a,C.w),E=M(S[1]||S[0]||"0%",c,C.h);if(_===void 0||E===void 0){p.push(g),h.push(y);continue}p.push(`${qn(C.w)}px ${qn(C.h)}px`),h.push(`${qn(_-o.left)}px ${qn(E-o.top)}px`)}e.style.setProperty("background-size",p.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var qn=t=>Math.round(t*100)/100;async function Gn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Xr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let u of c.children){if(u.tagName==="STYLE")continue;let l=i.get(u);l&&Xr(l)&&o.push([l,u]),s.push(u)}}let a=6;for(let c=0;c<o.length;c+=a)await Promise.allSettled(o.slice(c,c+a).map(([u,l])=>hu(u,l,n,r)))}wt();function ea(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let u=O(c),l=u.getPropertyValue("backdrop-filter")||u.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:Su(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let u=e.cloneNode(!0);wu(u,e,a.orig.getBoundingClientRect(),n),xu(ta(u,a.path));for(let l=0;l<c;l++){let f=ta(u,r[l].path);f&&(f.style.setProperty("backdrop-filter","none","important"),f.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:u}});for(let{cloneEl:a,orig:c,bf:u,copy:l}of s)yu.has(a.tagName)||bu(a,c,u,l,o)}var yu=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function bu(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=O(e),a=e.offsetWidth?o.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",u.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let f of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(f,s.getPropertyValue(f));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(u)}var Xn=128;function wu(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Xn||l.right<n.left-Xn||l.top>n.bottom+Xn||l.bottom<n.top-Xn)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let c=o.children,u=s.children;for(let l=0;l<c.length;l++)i.push([c[l],u[l]])}}function Su(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function ta(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function xu(t){if(t)for(let e=t;e&&e.parentNode;){let n=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=n}}wt();mt();gt();gt();function Co(t){return ti(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}oe();function Kn(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let u=o.getBoundingClientRect();if(u.width>0||u.height>0){let l=Math.max(u.right,u.left+(o.scrollWidth||0)),f=Math.max(u.bottom,u.top+(o.scrollHeight||0));if(l<e.left-r||u.left>e.right+r||f<e.top-r||u.top>e.bottom+r)return}}let s=getComputedStyle(o),a=vu(o,s);a&&n.push(a);let c=Cu(o,s);c&&n.push(c);for(let u of o.children||[])i(u)}return i(t),()=>n.forEach(o=>o())}function vu(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=ku(e);if(n<=0)return()=>{};if(!oa(t))return()=>{};let r=ra(t),i=r.text,o=Au(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Mu(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let u=0,l=i.length,f=-1;for(;u<=l;){let h=u+l>>1;r.write(i.slice(0,Yn(i,h))+"\u2026"),t.scrollHeight<=c+.5?(f=h,u=h+1):l=h-1}let p=(f>=0?i.slice(0,Yn(i,f)):"")+"\u2026";return r.write(p),na(t,p,r)}function Cu(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!oa(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=ra(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,Yn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,Yn(r,s)):"")+"\u2026";return n.write(a),na(t,a,n)}function na(t,e,n){return()=>{t.textContent===e&&n.restore()}}function ra(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function Yn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function ku(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Mu(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Au(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function oa(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var ia=["clone","render"],Qn={clone:0,render:1},_t="render";function sa(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:_t,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?_t:o.needs;if(!Object.prototype.hasOwnProperty.call(Qn,s))throw new Error(`[SnapDOM] Plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${ia.join(", ")}.`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,Qn[s])}if(n<0)return{stage:_t,loweredBy:[]};let i=ia[n];return{loweredBy:i===_t?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function We(t,e){return Qn[t]>=Qn[e]}function aa(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[SnapDOM] No ${n}: this capture stopped at '${t}' because ${r} asked for needs: '${t}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var fn=[];function un(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function ca(...t){let e=t.flat();for(let n of e){let r=un(n);if(r){if(r.needs!==void 0&&r.needs!==_t)throw new Error(`[SnapDOM] '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}, so it can't be a global plugin (it would stop every capture before '${_t}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);fn.some(i=>i&&i.name&&r.name&&i.name===r.name)||fn.push(r)}}}function la(t){return t&&Array.isArray(t.plugins)?t.plugins:fn}async function Bt(t,e,n){let r=n,i=la(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function Jn(t,e,n){let r=[],i=la(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}var _u=0;function Eu(t){let e=[];if(Array.isArray(t))for(let n of t){let r=un(n);if(!r)continue;r.name||(r.name=`anonymous-${++_u}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of fn)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function fa(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Eu(e)),t}function ua(){return fn.slice()}var Ru=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function Zn(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=un(n);if(!(!r||r.pure===!0)){for(let i of Ru)if(typeof r[i]=="function")return!0}}return!1}gt();ke();var de="data-snapdom-asset",ma="http://www.w3.org/1999/xlink",Fu=0;function er(t,e,n,r,i,o){let s=o.__compressedAssets||(o.__compressedAssets=new WeakMap),a=s.get(t);a||(a={token:String(++Fu),properties:[]},s.set(t,a),t.setAttribute(de,a.token));let c=a.properties.find(u=>u.kind===e&&u.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var ga=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function nr(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${de}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(de)!==o.token)continue;let s=o.properties.filter(a=>ga(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function rr(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${de}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(de,i.token))}}function ya(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${de}]`))for(let s of e.get(o.getAttribute(de))||[])ga(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(ma,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function da(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function ko(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(h,m)=>{try{return h[m]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),u=Number.isFinite(e.height);if(!i&&(c||u)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Zt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let m=Math.abs(h.a)*s+Math.abs(h.c)*a,d=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,m),a=Math.min(a,d)}}catch{s=0,a=0}let l=(c||u?Math.max(c?s?e.width/s:1/0:0,u?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let f=new WeakMap,p=h=>{if(!h||h.nodeType!==1)return 1;if(f.has(h))return f.get(h);let m=h.isConnected?O(h):h.style,d=1;try{m?.perspective&&m.perspective!=="none"&&(d=1/0);let g=m?.transform;if(g&&g!=="none")d*=da(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<h.transform.baseVal.numberOfItems;b++){let w=h.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}d*=da(y)}if(m?.scale&&m.scale!=="none"){let y=m.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));d*=Math.max(...y.map(Math.abs))}if(h!==n&&m?.zoom&&m.zoom!=="normal"&&(d*=parseFloat(m.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=C=>/^\d+(?:\.\d+)?px$/.test(m?.[C]||"")?parseFloat(m[C]):o(h,C),w=b("width"),v=b("height");d*=w>0&&v>0?Math.max(w/y.width,v/y.height):1/0}}catch{d=1/0}return Number.isFinite(d)||(d=1/0),h!==n&&(d*=p(h.parentElement||h.getRootNode?.().host)),f.set(h,d),d};return{density:l,stretch:p}}var ba=.92,wa=1;async function Tu(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Pu(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var $u=64*1024,pa=32*1024*1024,tr=new Map;function Nu(t,e,n,r){if(n.length+(r?.length||0)>pa)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>pa;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Lu(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}catch{return null}}function Iu(t){let e=Lu(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function ha(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Ou=`self.onmessage = async (e) => {
|
|
15
|
+
`):l+=d[0]}return l+=a.slice(f),l}let s=ps(t,e||location.href);return s=await o(s,e||location.href,0),s}var ws=/url\((["']?)([^"')]+)\1\)/g,kf=/@font-face[^{}]*\{[^}]*\}/g;function At(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Ss(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let u=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[u,l]};if(s){let c=a(o),u=a(s),l=Array.isArray(c)?c[0]:c,f=Array.isArray(u)?u[1]:u;e.push([Math.min(l,f),Math.max(l,f)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function xs(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function oo(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(ws)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function eo(t,e,n=""){let r=t;for(let i of t.matchAll(ws)){let o=re(i[0]);if(!o)continue;let s=o;if(!s.startsWith("http")&&!s.startsWith("data:"))try{s=new URL(s,e||location.href).href}catch{}if(I.resource?.has(s)){r=r.replace(i[0],`url(${I.resource.get(s)})`);continue}try{let a=await ft(s,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;I.resource?.set(s,c),r=r.replace(i[0],`url(${c})`)}}catch{console.warn("[SnapDOM] Couldn't load font file:",s)}}return r}function Mf(t){if(!t.length)return null;let e=(a,c)=>t.some(([u,l])=>!(l<a||u>c)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function hs(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Mf(o);if(s&&r.has(s))return!0}return!1}}function Af(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=At(o,"font-family"),a=ro(s),c=At(o,"font-weight","400"),u=At(o,"font-style","normal"),l=At(o,"font-stretch","100%"),f=At(o,"unicode-range"),d=At(o,"src"),h=oo(d,location.href),m=h.length?h.map(g=>String(g).toLowerCase()).sort().join("|"):d.toLowerCase(),p=[String(a||"").toLowerCase(),c,u,l,f.toLowerCase(),m].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var ms=new WeakMap,_f=0;function Ef(t){let e=ms.get(t);return e===void 0&&(e=_f++,ms.set(t,e)),e}function Rf(t,e,n,r,i,o,s,a,c){let u=Array.from(t||[]).sort().join("|"),l=0,f=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,f++}let d=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",h=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),m=r||"",p=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Ef(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${u}::ex=${d}::lf=${h}::px=${m}::fd=${p}::doc=${g}::cp=${l}::n=${f}::ic=${y}::env=${c}`}async function no(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=In){console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${In} levels.`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${c}`);continue}c&&r.visitedSheets.add(c);let u={...r,depth:(r.depth||0)+1};await no(a.styleSheet,c,n,u);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await no(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),u=ro(c);if(!u||Nt(u,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),f=(a.style.getPropertyValue("font-style")||"").trim(),d=(a.style.getPropertyValue("font-stretch")||"").trim(),h=(a.style.getPropertyValue("font-variation-settings")||"").trim(),m=(a.style.getPropertyValue("src")||"").trim(),p=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=f||"normal",b=d||"100%",w=(f?`font-style:${f};`:"")+(l?`font-weight:${l};`:"")+(d?`font-stretch:${d};`:"")+(h?`font-variation-settings:${h};`:"")+(p?`unicode-range:${p};`:""),v=r.faceMatchesRequired(u,y,g,b);if(!v&&!r.requiredIndex.has(u.toLowerCase()))continue;let C=Ss(p);if(!xs(r.usedCodepoints,C))continue;let S={family:u,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:p,srcRaw:m,srcUrls:oo(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,C))continue;if(!v){r.provisionalFaces.push({family:u.toLowerCase(),block:`@font-face{font-family:${u};src:${m};${w}}`,srcRaw:m,baseHref:e||location.href});continue}r.coveredFamilies.add(u.toLowerCase());let M=`"${String(u).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(m)){let _=await eo(m,e||location.href,r.useProxy);await n(`@font-face{font-family:${M};src:${_};${w}}`)}else await n(`@font-face{font-family:${M};src:${m};${w}}`)}}}async function vs({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[M,_,E,x]=String(S).split("__");if(!M)continue;let k=M.toLowerCase(),R=c.get(k)||[];R.push({w:parseInt(_,10),s:E,st:parseInt(x,10)}),c.set(k,R)}function u(S,M,_,E){let x=String(S).toLowerCase();if(!c.has(x))return!1;let k=c.get(x),R=yf(_),T=bf(M),L=wf(E),W=R.min!==R.max,P=R.min,A=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),N=!1;for(let $ of k){let F=W?$.w>=R.min&&$.w<=R.max:$.w===P,z=A(Ln($.s)),q=$.st>=L.min&&$.st<=L.max;if(F&&z&&q){N=!0;break}}if(N)return!0;if(!W)for(let $ of k){let F=A(Ln($.s)),z=$.st>=L.min&&$.st<=L.max;if(Math.abs(P-$.w)<=300&&F&&z)return!0}if(!W&&T.kind==="normal"&&k.some(F=>Ln(F.s)!=="normal"))for(let F of k){let z=Math.abs(P-F.w)<=300,q=F.st>=L.min&&F.st<=L.max;if(z&&q)return!0}return!1}let l=hs(n);_e(a),Tt();let f=Rf(t,n,r,i,o,a,e,s,_e(a));if(I.resource?.has(f))return I.resource.get(f);let d=vf(t),h=[],m=bs;for(let S of a.querySelectorAll("style")){let M=S.textContent||"";for(let _ of M.matchAll(m)){let E=(_[2]||_[4]||"").trim();if(!E||to(E,s))continue;a.querySelector(`link[rel="stylesheet"][href="${E}"]`)||h.push(E)}}let p=[];h.length&&await Promise.all(h.map(S=>new Promise(M=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return M(null);let _=a.createElement("link");_.rel="stylesheet",_.href=S,Z(_),_.setAttribute("data-snapdom","injected-import");let E=setTimeout(()=>M(null),3e3),x=k=>{clearTimeout(E),M(k)};_.onload=()=>x(_),_.onerror=()=>x(null),a.head.appendChild(_),p.push(_)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of p)try{S.remove()}catch{}for(let S of w)try{if(to(S.href,s))continue;let M="",_=!1;try{_=new URL(S.href,location.href).origin===location.origin}catch{}if(!_){let x=Array.isArray(o)?o:[];if(!xf(S.href,d,x))continue}if(_){let x=Array.from(a.styleSheets).find(k=>k.href===S.href);if(x)try{let k=x.cssRules||[];M=Array.from(k).map(R=>R.cssText).join("")}catch{}}if(!M){let x=await ft(S.href,{as:"text",useProxy:i});x?.ok&&typeof x.data=="string"&&(M=x.data)}M=await Cf(M,S.href,i);let E="";for(let x of M.match(kf)||[]){let k=At(x,"font-family"),R=ro(k);if(!R||Nt(R,s))continue;let T=At(x,"font-weight","400"),L=At(x,"font-style","normal"),W=At(x,"font-stretch","100%"),P=At(x,"unicode-range"),A=At(x,"src"),N=oo(A,S.href),$=u(R,L,T,W);if(!$&&!c.has(R.toLowerCase()))continue;let F=Ss(P);if(!xs(e,F))continue;let z={family:R,weightSpec:T,styleSpec:L,stretchSpec:W,unicodeRange:P,srcRaw:A,srcUrls:N,href:S.href};if(n&&l(z,F))continue;if(!$){b.push({family:R.toLowerCase(),block:x,srcRaw:A,baseHref:S.href});continue}y.add(R.toLowerCase());let q=/url\(/i.test(A)?await eo(x,S.href,i):x;E+=q}E.trim()&&(g+=E)}catch{console.warn("[SnapDOM] Couldn't read stylesheet:",S.href)}let v={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:u,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?hs(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},C=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of C)if(!(S.href&&w.some(M=>M.href===S.href)))try{let M=S.href||a.baseURI||location.origin+"/";M&&v.visitedSheets.add(M),await no(S,M,async _=>{g+=_},v)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await eo(S.block,S.baseHref,i):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let M=String(S.family).replace(/^['"]+|['"]+$/g,"");if(Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(E=>String(E).toLowerCase()===M.toLowerCase()))continue;let _=S._snapdomSrc;if(!String(_).startsWith("data:"))if(I.resource?.has(S._snapdomSrc))_=I.resource.get(S._snapdomSrc);else try{let E=await ft(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(E.ok&&typeof E.data=="string")_=E.data,I.resource?.set(S._snapdomSrc,_);else continue}catch{console.warn("[SnapDOM] Couldn't load font file:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${M}';src:url(${_});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let M=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===M.toLowerCase()))continue;let _=S.weight!=null?String(S.weight):"normal",E=S.style!=null?String(S.style):"normal",x=S.stretchPct!=null?`${S.stretchPct}%`:"100%",k=String(S.src||""),R=k;if(!R.startsWith("data:"))if(I.resource?.has(k))R=I.resource.get(k);else try{let T=await ft(k,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")R=T.data,I.resource?.set(k,R);else continue}catch{console.warn("[SnapDOM] Couldn't load font file from localFonts:",k);continue}g+=`@font-face{font-family:'${M}';src:url(${R});font-style:${E};font-weight:${_};font-stretch:${x};}`}return g&&(g=Af(g),I.resource?.set(f,g)),g}function On(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let f of l)r.add(f.codePointAt(0))},o=l=>{let f=mf(l.fontFamily);if(f.length)for(let d of f)n.add(`${d}__${Nn(l.fontWeight)}__${Ln(l.fontStyle)}__${gf(l.fontStretch)}`)},s=Fe(t),a=t.getRootNode(),c=l=>{o(O(l));let f=l.getRootNode()===a?s:Fe(l);for(let d of["::before","::after"]){let h=d==="::before"?f.before:f.after;if(h!==null){if(h==="")continue;try{if(!l.matches(h))continue}catch{}}let m=O(l,d),p=m&&m.content;if(!(!p||p==="none"||p==="normal"))if(o(m),/^["']/.test(p))i(p.slice(1,-1));else{let g=p.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},u=[t];for(let l=0;l<u.length;l++){let f=u[l];f.nodeType===Node.ELEMENT_NODE&&c(f),f.shadowRoot&&u.push(f.shadowRoot);let d=(t.ownerDocument||document).createTreeWalker(f,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;d.nextNode();){let h=d.currentNode;if(h.nodeType===Node.TEXT_NODE){if(e&&h.parentElement&&!e(h.parentElement))continue;i(h.nodeValue||"")}else{if(e&&!e(h))continue;c(h),h.shadowRoot&&u.push(h.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function Dn(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");Z(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await yt(),await yt()}Ct();function As(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Cs(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ks(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function Ms(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return Cs(t,!1);case"upper-alpha":case"upper-latin":return Cs(t,!0);case"lower-roman":return ks(t,!1);case"upper-roman":return ks(t,!0);default:return String(t)}}function cn(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function _s(t){let e=new WeakMap,n=_r(t)?t.documentElement:t,r=u=>u&&u.tagName==="LI",i=new WeakMap,o=u=>{let l=new Map;for(let[f,d]of u)l.set(f,d.slice());return l},s=(u,l,f)=>{let d=o(u),h;try{h=getComputedStyle(f)}catch{h=f.style}let m;try{m=h?.counterReset}catch{}if(m&&m!=="none")for(let[y,b]of cn(m,0)){let w=l.get(y);if(w&&w.length){let v=w.slice();v.push(b),d.set(y,v)}else d.set(y,[b])}let p;try{p=h?.counterSet}catch{}if(p&&p!=="none")for(let[y,b]of cn(p,0)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,d.set(y,w)}let g;try{g=h?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of cn(g,1)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,d.set(y,w)}try{if(h?.display==="list-item"&&r(f)){let y=f.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,v=b===void 0?Number.isFinite(w)?w:1:b+1,C=y?.tagName==="OL"?parseInt(f.getAttribute("value"),10):NaN;Number.isFinite(C)&&(v=C),y&&i.set(y,v);let S=d.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=v,d.set("list-item",S)}}catch{}return d},a=(u,l,f)=>{let d=s(f,l,u);e.set(u,d);let h=d;for(let p of u.children)h=a(p,d,h);let m=new Map;for(let[p,g]of f){let y=g.length,b=h.get(p);m.set(p,b&&b.length?b.slice(0,y):g.slice())}for(let[p,g]of h)!m.has(p)&&g.length&&!l.has(p)&&m.set(p,g.slice(0,1));return m},c=new Map;return a(n,c,c),{get(u,l){let f=e.get(u)?.get(l);return f&&f.length?f[f.length-1]:0},getStack(u,l){let f=e.get(u)?.get(l);return f?f.slice():[]}}}function Es(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),u=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return Ms(l,u)}else{let c=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),f=n.getStack(e,c);return f.length?f.map(h=>Ms(h,l)).join(u):""}})}catch{return"- "}}we();var Le=new WeakMap,Rs=1e3;function Ff(t,e){let n=$s(t);return e?(e.__pseudoPreflightFp!==n&&(Tt(),e.__pseudoPreflight=Fs(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Tt(),Fs(t,n))}function Wn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function $s(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let u=a.sheet,l=u?Wn(u):null;l&&(r+=l.length)}else{let c=a.getAttribute("href")||"",u=a.getAttribute("media")||"all";n+=`L${c}|m:${u}|`;let l=a.sheet,f=l?Wn(l):null;f&&(r+=f.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=Wn(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function io(t,e,n){let r=Wn(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&io(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let c=o.cssRules[a],u=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(u.includes(l))return!0}if(n.budget<=0)return!1}return!1}function Fs(t=document,e=$s(t)){let n=Le.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&Ee();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let c=o[a].textContent||"";for(let u of i)if(c.includes(u))return Le.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:Rs};try{for(let c of s)if(io(c,i,a))return Le.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:Rs};for(let u=0;u<a.length&&c.budget>0;u++){let l=a[u],f=null;if(l.tagName,f=l.sheet||null,f&&io(f,i,c))return Le.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(t,{fingerprint:e,result:!0}),!0):(Le.set(t,{fingerprint:e,result:!1}),!1)}function Ts(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Tf(t,e){let n=null,r=()=>{if(!n)try{n=_s(t)}catch(i){H(e,"Couldn't compute CSS counters; list numbers may be off.",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function Pf(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function $f(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
16
|
+
`?"":r})}function Nf(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push($f(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function so(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let u=a.slice();return u[u.length-1]=Math.max(u[u.length-1],c),u}return a}}:e}function ao(t,e,n){let r=new Map,i=(u,l)=>cn(u,l).map(([f,d])=>({name:f,num:d})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(u){if(r.has(u))return r.get(u).slice();let l=n.getStack(t,u);l=l.length?l.slice():[];let f=o.find(m=>m.name===u);if(f){let m=Number.isFinite(f.num)?f.num:0;l=l.length?[...l,m]:[m]}let d=s.find(m=>m.name===u);if(d){let m=Number.isFinite(d.num)?d.num:0;l.length===0&&(l=[0]),l[l.length-1]=m}let h=a.find(m=>m.name===u);if(h){let m=Number.isFinite(h.num)?h.num:1;l.length===0&&(l=[0]),l[l.length-1]+=m}return r.set(u,l.slice()),l}return{get(u,l){let f=c(l);return f.length?f[f.length-1]:0},getStack(u,l){return c(l)},__incs:a}}var Lf=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],If=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function Ps(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let f=O(t).display||"";if(i==="::marker"?!f.includes("list-item"):!(f==="block"||f==="flow-root"||f==="list-item"||f==="inline-block"||f==="table-cell"||f==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let c="";for(let f of o){let d=s.getPropertyValue(f);d&&d!==a.getPropertyValue(f)&&!(f==="background-color"&&d==="rgba(0, 0, 0, 0)")&&!(f==="vertical-align"&&d==="baseline")&&(c+=`${f}:${d};`)}if(i==="::marker"){let f=s.getPropertyValue("content");f&&f!=="normal"&&f!=="none"&&(c+=`content:${f};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function Of(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Df(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=Pf(o),o=Of(o,t);let s=so(t,n,r),a=ao(t,i,s),c=As(o)?Es(o,t,a):o;return{text:Nf(c),incs:a.__incs||[]}}function Wf(t,e){if(e.__shadowPseudo)return!1;let n=Fe(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Ie(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Ff(o,n)&&!n.__shadowPseudo||!i&&Wf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Tf(t.ownerDocument||document,n));let s=n.__counterCtx,a=Fe(t);a.marker!==""&&Ps(t,e,n,a.marker,"::marker",Lf),a.firstLine!==""&&Ps(t,e,n,a.firstLine,"::first-line",If);for(let u of["::before","::after","::first-letter"]){let l=a[u==="::before"?"before":u==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let f=O(t,u);if(!f||f.content==="none"&&f.backgroundImage==="none"&&(f.backgroundColor==="transparent"||f.backgroundColor==="rgba(0, 0, 0, 0)")&&!Ts(f)&&(!f.transform||f.transform==="none")&&f.display==="inline")continue;if(f.display==="none"||u!=="::first-letter"&&(f.content==="none"||f.content==="normal")){u==="::before"&&(e.dataset.snapdomHasBefore="1"),u==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(u==="::first-letter"){let V=O(t),G=(V?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let U=jt=>f[jt]!==V[jt]&&(parseFloat(f[jt])||0)!==0;if(!(f.color!==V.color||f.fontSize!==V.fontSize||f.fontWeight!==V.fontWeight||f.fontFamily!==V.fontFamily||f.fontStyle!==V.fontStyle||f.textTransform!==V.textTransform||f.float!==V.float&&f.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let Y=Array.from(e.childNodes).find(jt=>jt.nodeType===Node.TEXT_NODE&&jt.textContent?.trim().length>0);if(!Y)continue;let vt=Y.textContent,ye=/^\s*/.exec(vt)[0],gn=vt.slice(ye.length),Ve=gn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],wr=gn.slice(Ve?.length||0);if(!Ve||/[\uD800-\uDFFF]/.test(Ve))continue;let Ht=document.createElement("span");Ht.textContent=Ve,Ht.dataset.snapdomPseudo="::first-letter";let Sr=Ce(f,vn(t)),xr=ve(Sr,"span");n.styleMap.set(Ht,xr);let yn=document.createTextNode(wr);e.replaceChild(yn,Y),e.insertBefore(Ht,yn),ye&&e.insertBefore(document.createTextNode(ye),Ht);continue}let m=f.content??"",p=m===""||m==="none"||m==="normal",{text:g,incs:y}=Df(t,u,s,n.__siblingCounters),b=f.backgroundImage,w=f.backgroundColor,v=f.fontFamily,C=parseInt(f.fontSize)||32,S=parseInt(f.fontWeight)||!1,M=f.fontStyle||"normal",_=f.color||"#000",E=f.transform,x=Nt(v,r?.__iconMatchers),k=!p&&g!=="",R=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",L=Ts(f),W=E&&E!=="none",P=m!=="none"&&m!=="normal",A=/^inline-/.test(f.display||""),N=P&&((parseFloat(f.width)||0)>0||(parseFloat(f.height)||0)>0||A),$=P&&f.boxShadow&&f.boxShadow!=="none",F=P&&f.outlineStyle&&f.outlineStyle!=="none"&&(parseFloat(f.outlineWidth)||0)>0;if(!(k||R||T||L||W||N||$||F)){if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let U=so(t,s,n.__siblingCounters),Y=ao(t,O(t,u),U).get(t,G);V.set(G,Y)}n.__siblingCounters.set(t.parentElement,V)}continue}let q=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),j=f.display==="inline"&&f.cssFloat==="none"&&f.position!=="absolute"&&f.position!=="fixed",J=!1;if(k&&!x&&g.length>1&&!q&&j){let V=O(t),G=parseFloat(V.fontSize)||16,U=parseFloat(V.lineHeight);Number.isFinite(U)||(U=G*1.5),t.getBoundingClientRect().height<U*1.6&&(e.style.whiteSpace="nowrap",J=!0)}let B=document.createElement("span");B.dataset.snapdomPseudo=u,B.style.pointerEvents="none",J&&(B.style.whiteSpace="nowrap");let ut=Ni(t,u,f,n,r),xt=(O(t).display||"").toLowerCase(),at=xt.includes("flex")||xt.includes("grid");if(at){let V=ut["min-width"];(!V||V==="auto"||V==="0px")&&(ut["min-width"]="0px")}let st=k;st&&!j&&parseFloat(f.height)>=1.5*(parseFloat(f.lineHeight)||(parseFloat(f.fontSize)||16)*1.2)&&(st=!1,B.style.whiteSpace=f.whiteSpace);let nt=ve(ut,"span",st,at);if(n.styleMap.set(B,nt),x&&g&&g.length===1){let{dataUrl:V,width:G,height:U}=await gs(g,v,S,C,_,M),ht=document.createElement("img");ht.src=V,ht.style=`height:${C}px;width:${G/U*C}px;object-fit:contain;`,B.appendChild(ht),e.dataset.snapdomHasIcon="true"}else if(g&&q){let V=Ge(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(g);if(V?.trim())try{let G=await ft(qt(V),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let U=document.createElement("img");U.src=G.data,U.style=`width:${C}px;height:auto;object-fit:contain;`,B.appendChild(U)}}catch(G){console.warn(`[SnapDOM] Couldn't draw the ${u} icon of`,t,G)}}else!x&&k&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=f.backgroundRepeat,B.style.backgroundSize=f.backgroundSize,f.backgroundPositionX&&f.backgroundPositionY?(B.style.backgroundPositionX=f.backgroundPositionX,B.style.backgroundPositionY=f.backgroundPositionY):B.style.backgroundPosition=f.backgroundPosition,B.style.backgroundOrigin=f.backgroundOrigin,B.style.backgroundClip=f.backgroundClip,B.style.backgroundAttachment=f.backgroundAttachment,B.style.backgroundBlendMode=f.backgroundBlendMode}catch{}if(R)try{let V=Xt(b),G=await Promise.all(V.map(U=>Se(U,r)));B.style.backgroundImage=G.join(", ")}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} background image.`,V)}T&&(B.style.backgroundColor=w);let pt=f.maskImage||f.webkitMaskImage;if(pt&&pt!=="none")try{let G=(await Promise.all(Xt(pt).map(U=>Se(U,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let U of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])f[U]&&(B.style[U]=f[U])}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} mask image.`,V)}let ge=B.childNodes.length>0||B.textContent?.trim()!==""||R||T||L||W||N||$||F;if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map,G=so(t,s,n.__siblingCounters),U=ao(t,O(t,u),G);for(let{name:ht}of y){if(!ht)continue;let Y=U.get(t,ht);V.set(ht,Y)}n.__siblingCounters.set(t.parentElement,V)}if(!ge)continue;u==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(f){console.warn(`[SnapDOM] Couldn't copy the ${u} of`,t,f)}}let c=Array.from(e.children).filter(u=>!u.dataset.snapdomPseudo);if(n.nodeMap)for(let u of c){let l=n.nodeMap.get(u);l?.nodeType===1&&await Ie(l,u,n,r,!0)}else{let u=Array.from(t.children);for(let l=0;l<Math.min(u.length,c.length);l++)await Ie(u[l],c[l],n,r,!0)}}Ct();function Ns(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=It(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),u="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let M=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(u,"href"):null);if(M)return M;let _=S.attributes;if(!_)return null;for(let E=0;E<_.length;E++){let x=_[E];if(!x||!x.name)continue;if(x.name==="href")return x.value;let k=x.name.indexOf(":");if(k!==-1&&x.name.slice(k+1)==="href")return x.value}return null},f=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),d=new Set,h=!1,m=(S,M=null)=>{if(!S)return;s.lastIndex=0;let _;for(;_=s.exec(S);){h=!0;let E=(_[1]||"").trim();E&&(f.has(E)||(d.add(E),M&&!M.has(E)&&M.add(E)))}},p=S=>{let M=S.querySelectorAll("use");for(let x of M){let k=l(x);if(!k||!k.startsWith("#"))continue;h=!0;let R=k.slice(1).trim();R&&!f.has(R)&&d.add(R)}let _='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';m(S.getAttribute("style")||"");for(let x of a)m(S.getAttribute(x));let E=S.querySelectorAll(_);for(let x of E){m(x.getAttribute("style")||"");for(let k of a)m(x.getAttribute(k))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let M="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",_=!1;try{_=!!(i.querySelector&&i.querySelector(M))}catch{return}if(!_)return;let E=["filter","clipPath","mask","maskImage","webkitMaskImage"],x=k=>{if(It(k))return;let R;try{R=getComputedStyle(k)}catch{return}for(let T of E){let L=R[T];L&&L.includes("url(")&&m(L)}};x(S);for(let k of S.querySelectorAll("*"))x(k)};for(let S of o)p(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||f.has(S))return null;let M=c(S),_=E=>{let x=i.querySelector(E);return x&&!t.contains(x)?x:null};return _(`svg defs > *#${M}`)||_(`svg > symbol#${M}`)||_(`*#${M}`)};if(!d.size)return;let v=new Set(d),C=new Set;for(;v.size;){let S=v.values().next().value;if(v.delete(S),!S||f.has(S)||C.has(S))continue;let M=w(S);if(!M){C.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let _=M.cloneNode(!0);_.id||_.setAttribute("id",S),b.appendChild(_),C.add(S),f.add(S);let E=[_,..._.querySelectorAll("*")];for(let x of E){let k=l(x);if(k&&k.startsWith("#")){let T=k.slice(1).trim();T&&!f.has(T)&&!C.has(T)&&v.add(T)}let R=x.getAttribute?.("style")||"";R&&m(R,v);for(let T of a){let L=x.getAttribute?.(T);L&&m(L,v)}}}}Ct();var co=new WeakMap,lo=new WeakMap;function Bn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([u,l])=>{let f={property:u,value:i.getPropertyValue(u),priority:i.getPropertyPriority(u)};return i.setProperty(u,l,"important"),f.forcedValue=i.getPropertyValue(u),f}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function Ls(t){if(co.has(t))return Bn(t,[],co);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return Bn(t,s,co)}return()=>{}}function Un(t,e=null){let n=[],r=i=>{if(!Rt(i))return;if(lo.has(i)){n.push(Bn(i,[],lo));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(Bn(i,[["content-visibility","visible"]],lo))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}wt();gt();kt();ke();kt();function uo(t){return Os(t.boxShadow)}function po(t){return Os(t.textShadow)}function Os(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;c<t.length;c++){let u=t[c];u==="("?r++:u===")"&&(r=Math.max(0,r-1)),u===","&&r===0?(e.push(n),n=""):n+=u}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let u=c.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(u.length<2)continue;let[l,f,d=0,h=0]=u,m=Math.abs(l)+d+h,p=Math.abs(f)+d+h;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),s=Math.max(s,p+Math.max(f,0)),i=Math.max(i,p+Math.max(-f,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function ho(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function mo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function go(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let u=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[l=0,f=0,d=0]=u,h=Math.abs(l)+d,m=Math.abs(f)+d;i=Math.max(i,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:D(r),right:D(i),bottom:D(o),left:D(s)},has:a}}function Bf(t){let e=uo(t),n=po(t),r=ho(t),i=mo(t),o=go(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function Uf(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 Is(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function Ds(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,u=Is(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let d=n.get(f);if(!d||!Uf(d))continue;let h=Bf(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),p={left:m.left-h.left/r,top:m.top-h.top/i,right:m.right+h.right/r,bottom:m.bottom+h.bottom/i};for(let g=f.parentElement;g;g=g.parentElement){let y=Is(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(p.left=Math.max(p.left,b.left),p.right=Math.min(p.right,b.right)),y.y&&(p.top=Math.max(p.top,b.top),p.bottom=Math.min(p.bottom,b.bottom))}if(g===t)break}u.x||(c=Math.max(c,(l.left-p.left)*r),s=Math.max(s,(p.right-l.right)*r)),u.y||(o=Math.max(o,(l.top-p.top)*i),a=Math.max(a,(p.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function Ws(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=fe(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let u=Zt({scale:c});return{a:u.a,b:u.b,c:u.c,d:u.d}}function i(c,u,l,f){let d=Math.sqrt(c*c+u*u)||0,h=0,m=0;if(d>0){let p=c/d,g=u/d;h=p*l+g*f;let y=l-p*h,b=f-g*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let o=c=>{let u=fe(t).scale;if(!u)return c;let l=Zt({scale:u,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===6&&c.every(Number.isFinite)){let[u,l,f,d]=c,h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===16&&c.every(Number.isFinite)){let u=c[0],l=c[1],f=c[4],d=c[5],h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let c=new DOMMatrix(r),u=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return o(u)}catch{return null}}function Oe(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,u=n.e||0,l=n.f||0;function f(y,b){let w=y-r,v=b-i,C=o*w+a*v,S=s*w+c*v;return C+=r+u,S+=i+l,[C,S]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,p=-1/0,g=-1/0;for(let[y,b]of d)y<h&&(h=y),b<m&&(m=b),y>p&&(p=y),b>g&&(g=b);return{minX:h,minY:m,maxX:p,maxY:g,width:p-h,height:g-m}}function ln(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?c/2:u==="right"||u==="bottom"?c:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*c/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(i,e),oy:s(o,n)}}function fe(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var fo=null;function zf(){if(fo?.isConnected)return fo;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Z(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),fo=t,t}function Zt(t){let e=o=>{let s=[],a=0,c=0,u=String(o).trim();for(let l=0;l<u.length;l++)u[l]==="("?a++:u[l]===")"?a--:/\s/.test(u[l])&&!a&&(l>c&&s.push(u.slice(c,l)),c=l+1);return c<u.length&&s.push(u.slice(c)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=zf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");o.appendChild(s);try{return Hf(s)}finally{s.remove()}}}function Bs(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function Hf(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var js=new WeakSet;function zn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function yo(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Ot(e)?e.host:null}function jf(t,e){for(let n=e;n;n=yo(n))if(n===t)return!0;return!1}function Vf(t,e){for(let n=yo(t);n&&n!==e&&n?.nodeType===1;n=yo(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function wo(t,e){try{return Zt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Vs(t,e,n,r,i){let o=t.getBoundingClientRect();Rt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!Rt(a)||c?.nodeType!==1||c===t||!jf(t,c))continue;let u=r.get(c)||O(c),l=u.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let f=c.getBoundingClientRect();if(!(f.width>0&&f.height>0))continue;js.add(a);let d=u.transform&&u.transform!=="none"?u.transform:"",h=fe(c),m=!!(d||h.rotate!=="0deg"||h.scale||h.translate),p=m?wo(d,h):null,g=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,y=f.width,b=f.height;g||(y=c.offsetWidth||f.width,b=c.offsetHeight||f.height);let w=c.getRootNode&&Ot(c.getRootNode()),v=o,C=t.clientLeft||0,S=t.clientTop||0;if(w){let k=Vf(c,t);k&&(v=k.getBoundingClientRect(),C=k.clientLeft||0,S=k.clientTop||0)}let M=f.left-v.left-C,_=f.top-v.top-S;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:k,oy:R}=ln(u,y,b),T=Oe(y,b,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},k,R);M-=T.minX,_-=T.minY}if(l!=="fixed"){let k=a.cloneNode(!1);k.setAttribute("data-snap-ph","1"),k.style.position="static",k.style.visibility="hidden",k.style.width=`${y}px`,k.style.height=`${b}px`,k.style.boxSizing="border-box",a.parentElement?.insertBefore(k,a)}let E=y+2,x=b;i&&(Math.abs(_-i.y)<.5&&(_-=1,x+=1),Math.abs(M-i.x)<.5&&(M-=1,E+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${_}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${E}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function qs(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){H(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){H(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){H(n,"Couldn't remove the root outline.",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){H(n,"Couldn't remove the root drop-shadow filter.",s)}}function Gs(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 Us(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function qf(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Xs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!Us(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=qf(s,i);if(!c)break;let u=n?Array.from(a.children).find(d=>n.get(d)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),f=parseFloat(l[`margin${o}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${o}`]="0px"),Us(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=u}}}var Gf=new Set(["xml","xlink"]);function Xf(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Gf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var Yf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,zs=t=>t.replace(Yf,e=>e.length===2?e:""),Kf=/^data:[^,]{0,120};base64,/;function Hn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(Xf(c.name,n)){a.removeAttribute(c.name);continue}if(Kf.test(c.value))continue;let u=zs(c.value);if(u!==c.value)try{a.setAttribute(c.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=zs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Qf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var Jf=new Set(["img","canvas","video","iframe","object","embed"]);function Zf(t){return It(t)||Jf.has(t?.localName)}function tu(t,e){if(t?.nodeType!==1||Qf(t)||Zf(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function Ys(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&tu(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",f=c.overflowX||c.overflowInline||"visible";(l!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(r)for(let l of u){let f=r.get(l);f&&f.nodeType===1&&i(f,l)}else{let l=Array.from(o.children);for(let f=0;f<Math.min(l.length,u.length);f++)i(l[f],u[f])}}i(t,e)}function eu(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function nu(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){H(e,"Invalid exclude selector; ignored.",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){H(e,"Your exclude function threw; ignored.",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){H(e,"Your filter function threw; ignored.",n)}return!1}function So(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let h of a){if(nu(h,e)||!eu(h))continue;let m=h.getBoundingClientRect(),p=m.top-r.top,g=m.bottom-r.top;g<=p||(p<i&&(i=p),g>o&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,u=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+l+f+d+c}var D=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,De=.75;function Ks(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,u=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-u)>.02)return 0;let l=s.createElement("div");Z(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=l.attachShadow({mode:"open"}),d=s.createElement("style");d.textContent=n,f.appendChild(d);let h=e.cloneNode(!0);f.appendChild(h),s.body.appendChild(l);let m=0,p=(g,y,b)=>{let w=O(g),v=w.boxSizing==="border-box",C=(S,M,..._)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let x=E+(v?0:_.reduce((k,R)=>k+(parseFloat(R)||0),0));return Math.abs(x-M)<=.51?x:M};return{width:C(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:C(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,v=b>0&&g.height>0?g.height/b:1,C=(S,M,_=!1)=>{let E=S.children,x=M.children,k=Math.min(E.length,x.length);for(let R=0;R<k;R++){let T=E[R],L=x[R],W=r.get(T),P=_||js.has(T);if(W?.nodeType===1&&Rt(T)&&T.style&&W.isConnected){let A=W.getBoundingClientRect();if(A.width>0&&A.height>0){let N=L.getBoundingClientRect(),$=A.width/c,F=A.height/u,z=N.width,q=N.height,j=W.offsetWidth||$,J=W.offsetHeight||F,B=L.offsetWidth||z,ut=L.offsetHeight||q,xt=Math.abs($-j)>De||Math.abs(F-J)>De||Math.abs(z-B)>De||Math.abs(q-ut)>De;if(P){let nt=p(L,B,ut);$=z>0?$*w*nt.width/z:$,F=q>0?F*v*nt.height/q:F,z=nt.width,q=nt.height}else if(xt){let nt=p(W,j,J),pt=p(L,B,ut);$=nt.width,F=nt.height,z=pt.width,q=pt.height}let at=z-$,st=q-F;(Math.abs(at)>De||Math.abs(st)>De)&&(T.style.boxSizing="border-box",T.style.width=`${D($)}px`,T.style.height=`${D(F)}px`,m++)}}C(T,L,P)}};C(e,h)}finally{l.remove()}return m}var ru=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function bo(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=bo(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=bo(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(ru.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var Hs=new WeakMap;function ou(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function iu(t){if(!t||!t.styleSheets)return"";let e=ou(t),n=Hs.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=bo(s,r))}catch{}return Hs.set(t,{fp:e,css:i}),i}function Qs(t,e){let n=Ir(t.clone).sort(),r=n.join(","),i=rn(t.element),o=I.baseStyle.get(r),s;o&&o.universe===i?s=o.css:(s=Or(n,i),I.baseStyle.set(r,{universe:i,css:s}));let a=iu(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=s,t.scrollbarCSS=a,{baseCSS:s,scrollbarCSS:a,fontsCSS:e}}mt();var jn=new Set,su="[data-sd-ph]::placeholder{color:var(--sd-ph)!important;opacity:var(--sd-ph-o)!important;-webkit-text-fill-color:var(--sd-ph)!important}";async function Js(t,e={}){Tt(),Mn(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e,slicer:e.__slicer||null},i=null,o=null;if(e.clip&&(o=zn(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=is(t)}catch(p){H(r,"Couldn't read the text selection.",p)}let s,a="",c="";if(jn.size){let p=(g,y)=>{for(let b=y;b;b=b.assignedSlot||b.parentElement||b.getRootNode()?.host)if(b===g)return!0;return!1};for(;;){let g=[...jn].filter(({root:y})=>p(y,t)||p(t,y)).map(({promise:y})=>y.catch(()=>{}));if(!g.length)break;await Promise.all(g)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let p=t.getBoundingClientRect(),g=t.ownerDocument?.defaultView||window,y=p.right<=0||p.bottom<=0||p.left>=g.innerWidth||p.top>=g.innerHeight,b=[];if(y&&(()=>{let v=[];t.shadowRoot&&v.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&v.push(C.shadowRoot);for(;v.length;){let C=v.pop(),S=C.host?.localName==="calcite-icon";for(let M of C.querySelectorAll("*")){if(M.shadowRoot&&v.push(M.shadowRoot),!S||M.localName!=="svg")continue;let _=M.querySelectorAll("path");if(!_.length||[..._].some(x=>x.getAttribute("d")?.trim()))continue;let E=M.getBoundingClientRect();E.width&&E.height&&b.push(M)}}})(),b.length){let v=(async()=>{let S=t.style,M=t.hasAttribute("style"),_=new Map,E=(x,k)=>{_.has(x)||_.set(x,{value:S.getPropertyValue(x),priority:S.getPropertyPriority(x)}),S.setProperty(x,k,"important");let R=_.get(x);R.forcedValue=S.getPropertyValue(x),R.forcedPriority=S.getPropertyPriority(x)};try{E("left","0"),E("top","0"),E("right","auto"),E("bottom","auto"),E("margin-top","0"),E("margin-right","0"),E("margin-bottom","0"),E("margin-left","0"),E("transform","none"),E("translate","none"),E("opacity","0"),E("pointer-events","none");let x=t.getBoundingClientRect();if(x.right<=0||x.bottom<=0||x.left>=g.innerWidth||x.top>=g.innerHeight){let T=t.parentElement?.getBoundingClientRect(),L=T&&T.right>0&&T.left<g.innerWidth?Math.max(0,T.left):0,W=T&&T.bottom>0&&T.top<g.innerHeight?Math.max(0,T.top):0;E("position","fixed"),E("left",`${L}px`),E("top",`${W}px`)}await yt(100);let k=Date.now()+1500,R=()=>b.some(T=>{if([...T.querySelectorAll("path")].some(W=>W.getAttribute("d")?.trim()))return!1;let L=T.getBoundingClientRect();return L.width&&L.height&&L.right>0&&L.bottom>0&&L.left<g.innerWidth&&L.top<g.innerHeight});for(;Date.now()<k&&R();)await new Promise(T=>setTimeout(T,25));await yt(100)}finally{for(let[x,k]of _)S.getPropertyValue(x)!==k.forcedValue||S.getPropertyPriority(x)!==k.forcedPriority||(k.value?S.setProperty(x,k.value,k.priority):S.removeProperty(x));!M&&!S.length&&t.removeAttribute("style"),await yt(100)}})(),C={root:t,promise:v};jn.add(C);try{await v}finally{jn.delete(C)}}}catch{}let u=Ls(t),l=Un(t,o);if(o){let p=t.getBoundingClientRect(),g=t.offsetWidth||p.width,y=t.offsetHeight||p.height,b=p.width&&Math.abs(g-p.width)>=1?g/p.width:1,w=p.height&&Math.abs(y-p.height)>=1?y/p.height:1;i={x:(o.left-p.left)*b,y:(o.top-p.top)*w,width:o.width*b,height:o.height*w}}try{s=await Jt(t,r,e)}catch(p){throw console.warn("[SnapDOM] Capture failed while copying the element.",p),p}finally{l(),u()}rs(r.nodeMap,t.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{Ns(s,void 0,t)}catch(p){console.warn("[SnapDOM] Couldn't copy external SVG icons; some may be missing.",p)}try{await Ie(t,s,r,e)}catch(p){console.warn("[SnapDOM] Couldn't copy ::before/::after content; some decorations may be missing.",p)}await En(s,r);for(let[p,g]of r.nodeMap.entries())if(g?.tagName==="STYLE"&&p?.tagName==="STYLE"&&!p.hasAttribute("data-sd"))try{let y=g.sheet&&g.sheet.cssRules;y&&/@media/i.test(p.textContent||"")&&(p.textContent=le(y))}catch{}try{let p=s.querySelectorAll("style[data-sd]");for(let g of p)c+=g.textContent||"",g.remove()}catch(p){H(r,"Couldn't copy shadow DOM styles.",p)}r.slicer?.due()&&await r.slicer.pause();let f=Ke(r.styleMap);a=Array.from(f.entries()).map(([p,g])=>`.${g}{${p}}`).join("");let h=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__usesPlaceholder?su:"")+(r.__pseudoCSS||"");a=h+a;for(let[p,g]of r.styleMap.entries())xo(p,g,f);try{au(t,s,r.nodeMap)}catch(p){H(r,"Couldn't bring an open dialog or popover into the capture.",p)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let p=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Vs(t,s,r.nodeMap,r.styleCache,p)}catch(p){H(r,"Couldn't keep fixed-position elements in place.",p)}for(let[p,g]of r.nodeMap.entries())r.clip&&g===t&&t===t.ownerDocument.scrollingElement||vo(p,g,r.nodeMap,r.styleCache);let m=t.ownerDocument;if((t===m.body||t===m.documentElement)&&m.documentElement.localName==="html"){let p=r.styleCache.get(m.documentElement)||O(m.documentElement);t===m.documentElement&&(s.style.overflow="visible");let g=t===m.body?s:s.querySelector("body");if(g&&p.overflowX==="visible"&&p.overflowY==="visible"&&p.contain==="none"&&!p.containerType?.includes("size")&&p.contentVisibility!=="auto"&&p.contentVisibility!=="hidden"){let y=r.styleCache.get(m.body)||O(m.body);y.contain==="none"&&!y.containerType?.includes("size")&&y.contentVisibility!=="auto"&&y.contentVisibility!=="hidden"&&y.display!=="none"&&(g.style.overflow="visible")}}if(t===r.nodeMap.get(s)){let p=r.styleCache.get(t)||O(t);r.styleCache.set(t,p);let g=kr(p.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=g||"",s.style.translate="none"}for(let[p,g]of r.nodeMap.entries())g.tagName==="PRE"&&(p.style.marginTop="0",p.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function au(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),u=c.backgroundColor,l=c.backgroundImage;if(u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||l&&l!=="none"){let d=document.createElement("div");d.setAttribute("data-sd-backdrop",""),d.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${u};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(d)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function xo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Ot(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function vo(t,e,n,r){let i=e.scrollLeft,o=e.scrollTop;if(!(i||o)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let c=t.querySelectorAll("*");for(let u of c){if(u.nodeType!==1||u.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let l=n?.get(u),f=l&&(r?.get(l)||O(l)),d=u.style.position||f?.position;if(d!=="fixed"&&d!=="absolute")continue;let h=f&&f.position!=="absolute"&&d==="absolute",m=null;if(l&&!h)for(let y=l.parentElement||l.getRootNode()?.host;y;y=y.parentElement||y.getRootNode()?.host){let b=r?.get(y)||O(y);if(d==="absolute"&&b.position!=="static"||b.transform&&b.transform!=="none"||b.translate&&b.translate!=="none"||b.rotate&&b.rotate!=="none"||b.scale&&b.scale!=="none"||b.filter&&b.filter!=="none"||b.backdropFilter&&b.backdropFilter!=="none"||b.perspective&&b.perspective!=="none"||/transform|perspective|filter/.test(b.willChange||"")||/layout|paint|strict|content/.test(b.contain||"")){m=y;break}if(y===e)break}if(m){m===e&&(u.style.top=f.top,u.style.left=f.left,u.style.right=f.right,u.style.bottom=f.bottom);continue}let p=parseFloat(u.style.top||f?.top)||0,g=parseFloat(u.style.left||f?.left)||0;u.style.top=`${p+o}px`,u.style.left=`${g+i}px`,d==="fixed"&&(u.style.position="absolute")}}catch{}let a=document.createElement("div");for(a.style.all="unset",a.style.transform=`translate(${-i}px, ${-o}px)`,a.style.willChange="transform",a.style.display="inline-block",a.style.width="100%";t.firstChild;)a.appendChild(t.firstChild);t.appendChild(a)}we();oe();gt();var Zs="http://www.w3.org/1999/xlink";function cu(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Zs,"href"):null)}function lu(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Vn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||Pe(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let u=I.image?.get(c);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await ft(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){I.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:d}=lu(a),{fallbackURL:h}=e||{};if(h)try{let m=typeof h=="function"?await h({width:f,height:d,src:c,element:a}):h;if(m){let p=await ft(m,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=f),a.height||(a.height=d);return}}}catch{}if(e.placeholders!==!1){Mt(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let m=document.createElement("div");m.style.cssText=[`width:${f}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,a.replaceWith(m)}},i=6;for(let a=0;a<n.length;a+=i){let c=n.slice(a,a+i).map(r);await Promise.allSettled(c)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let c=cu(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let u=await ft(c,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Zs,"href"))};for(let a=0;a<o.length;a+=i){let c=o.slice(a,a+i).map(s);await Promise.allSettled(c)}}mt();wt();var fu=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],uu=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],du=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],pu=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function hu(t,e,n,r){let i=n.get(t)||O(t);n.has(t)||n.set(t,i);let o=Fi(t),s=o?m=>m in o?o[m]:"":m=>i.getPropertyValue(m),a=s("border-image"),c=s("border-image-source"),u=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),f=s("background-color"),d=l&&l!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=bt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(d&&!h)for(let m of du){let p=s(m);p&&e.style.setProperty(m,p)}for(let m of fu){if(h&&m==="background-image")continue;let p=i.getPropertyValue(m);if(m==="background-image"&&(!p||p==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(p=Xt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let g=Xt(p),y=await Promise.all(g.map(b=>Se(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(m,y.join(", "))}for(let m of uu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(u)for(let m of pu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(d&&/fixed/.test(s("background-attachment")||""))try{await gu(t,e,i)}catch{}}function mu(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let d=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*d,h:n*d}}let s=o.split(/\s+/),a=(d,h)=>{if(d==="auto"||d===void 0)return null;if(d.endsWith("px"))return parseFloat(d);if(d.endsWith("%"))return h*parseFloat(d)/100},c=a(s[0],r),u=a(s[1],i);if(c===void 0||u===void 0)return null;let l=c,f=u;return l==null&&f==null?(l=e||r,f=n||i):l==null?l=e&&n?f*(e/n):r:f==null&&(f=e&&n?l*(n/e):i),!l||!f?null:{w:l,h:f}}async function gu(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(m=>m.trim()),i=Qe();if(!i)for(let m=t.parentElement;m&&!i;m=m.parentElement){let p=O(m);(p.transform&&p.transform!=="none"||p.filter&&p.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,u=Xt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(m=>m.trim()),f=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(m=>m.trim()),d=[],h=[];for(let m=0;m<u.length;m++){let p=r[m%r.length]||"scroll",g=l[m%l.length],y=f[m%f.length];if(p!=="fixed"){d.push(g),h.push(y);continue}let b=0,w=0,v=u[m]&&u[m].match(/url\(["']?([^"')]+)["']?\)/);if(v)try{let x=new Image;x.src=v[1],await x.decode(),b=x.naturalWidth,w=x.naturalHeight}catch{d.push(g),h.push(y);continue}let C=mu(g,b,w,a,c);if(!C){d.push(g),h.push(y);continue}let S=y.split(/\s+/),M=(x,k,R)=>{if(!x)return 0;if(x.endsWith("px"))return parseFloat(x);if(x.endsWith("%"))return(k-R)*parseFloat(x)/100},_=M(S[0]||"0%",a,C.w),E=M(S[1]||S[0]||"0%",c,C.h);if(_===void 0||E===void 0){d.push(g),h.push(y);continue}d.push(`${qn(C.w)}px ${qn(C.h)}px`),h.push(`${qn(_-o.left)}px ${qn(E-o.top)}px`)}e.style.setProperty("background-size",d.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var qn=t=>Math.round(t*100)/100;async function Gn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Xr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let u of c.children){if(u.tagName==="STYLE")continue;let l=i.get(u);l&&Xr(l)&&o.push([l,u]),s.push(u)}}let a=6;for(let c=0;c<o.length;c+=a)await Promise.allSettled(o.slice(c,c+a).map(([u,l])=>hu(u,l,n,r)))}wt();function ea(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let u=O(c),l=u.getPropertyValue("backdrop-filter")||u.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:Su(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let u=e.cloneNode(!0);wu(u,e,a.orig.getBoundingClientRect(),n),xu(ta(u,a.path));for(let l=0;l<c;l++){let f=ta(u,r[l].path);f&&(f.style.setProperty("backdrop-filter","none","important"),f.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:u}});for(let{cloneEl:a,orig:c,bf:u,copy:l}of s)yu.has(a.tagName)||bu(a,c,u,l,o)}var yu=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function bu(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=O(e),a=e.offsetWidth?o.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",u.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let f of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(f,s.getPropertyValue(f));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(u)}var Xn=128;function wu(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Xn||l.right<n.left-Xn||l.top>n.bottom+Xn||l.bottom<n.top-Xn)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let c=o.children,u=s.children;for(let l=0;l<c.length;l++)i.push([c[l],u[l]])}}function Su(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function ta(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function xu(t){if(t)for(let e=t;e&&e.parentNode;){let n=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=n}}wt();mt();gt();gt();function Co(t){return ti(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}oe();function Kn(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let u=o.getBoundingClientRect();if(u.width>0||u.height>0){let l=Math.max(u.right,u.left+(o.scrollWidth||0)),f=Math.max(u.bottom,u.top+(o.scrollHeight||0));if(l<e.left-r||u.left>e.right+r||f<e.top-r||u.top>e.bottom+r)return}}let s=getComputedStyle(o),a=vu(o,s);a&&n.push(a);let c=Cu(o,s);c&&n.push(c);for(let u of o.children||[])i(u)}return i(t),()=>n.forEach(o=>o())}function vu(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=ku(e);if(n<=0)return()=>{};if(!oa(t))return()=>{};let r=ra(t),i=r.text,o=Au(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Mu(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let u=0,l=i.length,f=-1;for(;u<=l;){let h=u+l>>1;r.write(i.slice(0,Yn(i,h))+"\u2026"),t.scrollHeight<=c+.5?(f=h,u=h+1):l=h-1}let d=(f>=0?i.slice(0,Yn(i,f)):"")+"\u2026";return r.write(d),na(t,d,r)}function Cu(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!oa(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=ra(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,Yn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,Yn(r,s)):"")+"\u2026";return n.write(a),na(t,a,n)}function na(t,e,n){return()=>{t.textContent===e&&n.restore()}}function ra(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function Yn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function ku(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Mu(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Au(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function oa(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var ia=["clone","render"],Qn={clone:0,render:1},_t="render";function sa(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:_t,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?_t:o.needs;if(!Object.prototype.hasOwnProperty.call(Qn,s))throw new Error(`[SnapDOM] Plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${ia.join(", ")}.`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,Qn[s])}if(n<0)return{stage:_t,loweredBy:[]};let i=ia[n];return{loweredBy:i===_t?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function We(t,e){return Qn[t]>=Qn[e]}function aa(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[SnapDOM] No ${n}: this capture stopped at '${t}' because ${r} asked for needs: '${t}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var fn=[];function un(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function ca(...t){let e=t.flat();for(let n of e){let r=un(n);if(r){if(r.needs!==void 0&&r.needs!==_t)throw new Error(`[SnapDOM] '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}, so it can't be a global plugin (it would stop every capture before '${_t}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);fn.some(i=>i&&i.name&&r.name&&i.name===r.name)||fn.push(r)}}}function la(t){return t&&Array.isArray(t.plugins)?t.plugins:fn}async function Bt(t,e,n){let r=n,i=la(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function Jn(t,e,n){let r=[],i=la(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}var _u=0;function Eu(t){let e=[];if(Array.isArray(t))for(let n of t){let r=un(n);if(!r)continue;r.name||(r.name=`anonymous-${++_u}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of fn)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function fa(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Eu(e)),t}function ua(){return fn.slice()}var Ru=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function Zn(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=un(n);if(!(!r||r.pure===!0)){for(let i of Ru)if(typeof r[i]=="function")return!0}}return!1}gt();ke();var de="data-snapdom-asset",ma="http://www.w3.org/1999/xlink",Fu=0;function er(t,e,n,r,i,o){let s=o.__compressedAssets||(o.__compressedAssets=new WeakMap),a=s.get(t);a||(a={token:String(++Fu),properties:[]},s.set(t,a),t.setAttribute(de,a.token));let c=a.properties.find(u=>u.kind===e&&u.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var ga=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function nr(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${de}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(de)!==o.token)continue;let s=o.properties.filter(a=>ga(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function rr(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${de}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(de,i.token))}}function ya(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${de}]`))for(let s of e.get(o.getAttribute(de))||[])ga(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(ma,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function da(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function ko(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(h,m)=>{try{return h[m]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),u=Number.isFinite(e.height);if(!i&&(c||u)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Zt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let m=Math.abs(h.a)*s+Math.abs(h.c)*a,p=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,m),a=Math.min(a,p)}}catch{s=0,a=0}let l=(c||u?Math.max(c?s?e.width/s:1/0:0,u?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let f=new WeakMap,d=h=>{if(!h||h.nodeType!==1)return 1;if(f.has(h))return f.get(h);let m=h.isConnected?O(h):h.style,p=1;try{m?.perspective&&m.perspective!=="none"&&(p=1/0);let g=m?.transform;if(g&&g!=="none")p*=da(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<h.transform.baseVal.numberOfItems;b++){let w=h.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}p*=da(y)}if(m?.scale&&m.scale!=="none"){let y=m.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));p*=Math.max(...y.map(Math.abs))}if(h!==n&&m?.zoom&&m.zoom!=="normal"&&(p*=parseFloat(m.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=C=>/^\d+(?:\.\d+)?px$/.test(m?.[C]||"")?parseFloat(m[C]):o(h,C),w=b("width"),v=b("height");p*=w>0&&v>0?Math.max(w/y.width,v/y.height):1/0}}catch{p=1/0}return Number.isFinite(p)||(p=1/0),h!==n&&(p*=d(h.parentElement||h.getRootNode?.().host)),f.set(h,p),p};return{density:l,stretch:d}}var ba=.92,wa=1;async function Tu(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Pu(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var $u=64*1024,pa=32*1024*1024,tr=new Map;function Nu(t,e,n,r){if(n.length+(r?.length||0)>pa)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>pa;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Lu(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}catch{return null}}function Iu(t){let e=Lu(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function ha(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Ou=`self.onmessage = async (e) => {
|
|
17
17
|
const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data
|
|
18
18
|
try {
|
|
19
19
|
const blob = given || await (await fetch(dataURL)).blob()
|
|
@@ -37,4 +37,4 @@ ${g}
|
|
|
37
37
|
} catch (err) {
|
|
38
38
|
self.postMessage({ id, error: String(err) })
|
|
39
39
|
}
|
|
40
|
-
}`,Du=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Lt=null,Wu=0,Bu=0,ue=new Map;function Sa(){for(let t of ue.values())t(void 0);if(ue.clear(),Array.isArray(Lt))for(let t of Lt)try{t?.terminate()}catch{}Lt=!1}function Uu(){let t,e=null;try{t=URL.createObjectURL(new Blob([Ou],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ue.get(n.data.id);r&&(ue.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=Sa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function zu(){if(Lt===!1)return!1;if(Lt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Lt=!1;Lt=[]}let t=Wu++%Du;if(!Lt[t]){let e=Uu();if(!e)return Sa(),!1;Lt[t]=e}return Lt[t]}var Hu=5e3;function ju(t,e,n,r,i){let o=zu();return o?new Promise(s=>{let a=++Bu,c=setTimeout(()=>{ue.delete(a),s(void 0)},Hu);ue.set(a,u=>{clearTimeout(c),s(u)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:wa,quality:ba,mime:r})}catch{clearTimeout(c),ue.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function Mo(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=I.compress,s=o.get(i);if(s?.source===t)return s.result;let a=tr.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Pu(t),f=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=Iu(t);if(p&&p.w>0&&p.h>0&&!ha(p.w,p.h,e,n))return null;if(t.length>=$u){let S=await ju(t,e,n,f,r);if(S!==void 0)return S}let h;try{h=await Tu(t)}catch{return null}let m=h.naturalWidth||h.width,d=h.naturalHeight||h.height;if(!m||!d)return null;let g=ha(m,d,e,n);if(!g)return null;let y=g*wa,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(d*y)),v=document.createElement("canvas");v.width=b,v.height=w;let C=v.getContext("2d");if(!C)return null;C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high",C.drawImage(h,0,0,b,w);try{let S=v.toDataURL(f,ba);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),u={source:t,promise:c,cache:o};tr.set(i,u);try{let l=await c;return Nu(o,i,t,l),l}finally{tr.get(i)===u&&tr.delete(i)}}async function Vu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let f=l.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!h)return;let m=r.value||(r.value=ko(t,e)),d=m.density*m.stretch(n.get(l)||l),g=await Mo(f,p*d,h*d,l.__snapdomBlob);g&&(o++,s+=f.length,a+=g.length,l.setAttribute("src",g),er(l,"attribute","src",f,g,e))},u=6;for(let l=0;l<i.length;l+=u)await Promise.allSettled(i.slice(l,l+u).map(c));return{count:o,before:s,after:a}}var qu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function Gu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function Xu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let u of o){let l=u.style&&u.style.backgroundImage;l&&l.includes("data:image")&&i.push(u)}let s=0,a=async u=>{let l=n.get(u);if(!l||!l.isConnected)return;let f;try{f=getComputedStyle(l)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(_=>_.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(_=>!qu.test(_.trim())))return;let{w:m,h:d}=Gu(l);if(!m||!d)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(_=>parseFloat(_)/100)),y=r.value||(r.value=ko(t,e)),b=y.density*y.stretch(l)*g,w=m*b,v=d*b,C=u.style.backgroundImage,S=[...C.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=C;for(let _ of S){let E=_[2];if(E.startsWith("data:image/svg"))continue;let x=await Mo(E,w,v);x&&(M=M.split(E).join(x),s++)}M!==C&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),er(u,"style","background-image",C,u.style.backgroundImage,e))},c=6;for(let u=0;u<i.length;u+=c)await Promise.allSettled(i.slice(u,u+c).map(a));return{count:s}}async function Yu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let u=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",f=c.getAttribute("height")||"";if(l.includes("%")||f.includes("%"))return;let p=n.get(c),h=p?O(p):c.style,m=(v,C)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[v]||""))return parseFloat(h[v]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(C.trim()))return parseFloat(C);try{return p?.[v]?.baseVal?.value||0}catch{return 0}},d=m("width",l),g=m("height",f);if(!d||!g)return;let y=r.value||(r.value=ko(t,e)),b=y.density*y.stretch(p||c),w=await Mo(u,d*b,g*b);w&&(c.setAttribute("href",w),er(c,"attribute","href",u,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(ma,"xlink:href",w),er(c,"attribute","xlink:href",u,w,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function or(t,e,n){if(!e.compress)return;let r={};await Vu(t,e,n,r),await Xu(t,e,n,r),await Yu(t,e,n,r)}wt();gt();kt();function Ku(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,u;for(let y of i)if(y.intern)for(c.lastIndex=0;u=c.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let f=Qu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let p=new Map,h=0,m=[],d=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(h++).toString(36),p.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,d):y.text;return t.slice(0,n)+m.join("")+g}function Qu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let u=c.getAttribute("style");u&&r.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=u=>{for(let l of u){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let l=u.textContent||"";if(/@import\b/i.test(l))return null;let f=new CSSStyleSheet;f.replaceSync(l),c(f.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&o.add(u[1])}return o}async function ir(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Q,...et}=t;t=Object.assign(a,et),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,u;Qs(t,s),await Bt("beforeRender",t);let l=O(t.element),f=t.element.getBoundingClientRect(),p=Math.max(1,D(t.element.offsetWidth||parseFloat(l.width)||f.width||1)),h=Math.max(1,D(t.element.offsetHeight||parseFloat(l.height)||f.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let Q=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),et=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0);Q>0&&(h=Math.max(h,D(Q))),et>0&&(p=Math.max(p,D(et)));try{let tt=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,rt=I.measureHints.get(t.element);if(rt&&rt.cssLen===tt&&rt.w0===p&&rt.docH===Q&&rt.docW===et)rt.csh>0&&(h=Math.max(h,D(rt.csh))),rt.csw>0&&(p=Math.max(p,D(rt.csw)));else{let ot=m.createElement("div");Z(ot),ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let ee=ot.attachShadow({mode:"open"}),ne=m.createElement("style");ne.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,ee.appendChild(ne),ee.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(ot);let qe=ot.scrollHeight,Vt=ot.scrollWidth;m.body.removeChild(ot),I.measureHints.set(t.element,{cssLen:tt,w0:p,docH:Q,docW:et,csh:qe,csw:Vt}),qe>0&&(h=Math.max(h,D(qe))),Vt>0&&(p=Math.max(p,D(Vt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Q=So(t.element,t.options),et=1,tt=So(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(tt)&&tt>=h-rt&&Number.isFinite(Q)&&Q>0&&(h=Math.max(1,Math.min(h,D(Q+et))))}if(t.options?.reconcile)try{let Q=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ks(t.element,t.clone,Q,t.nodeMap,p,h)}catch(Q){console.warn("[SnapDOM] reconcile couldn't run; captured without it.",Q)}let g=(Q,et=NaN)=>{let tt=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(tt)?tt:et},y=g(t.options.width),b=g(t.options.height),w=n?D(n.width):p,v=n?D(n.height):h,C=w,S=v,M=Number.isFinite(y),_=Number.isFinite(b),E=v>0?w/v:1;M&&_?(C=Math.max(1,D(y)),S=Math.max(1,D(b))):M?(C=Math.max(1,D(y)),S=Math.max(1,D(C/(E||1)))):_&&(S=Math.max(1,D(b)),C=Math.max(1,D(S*(E||1))));let x=0,k=0,R=p,T=h;if(n){let Q=0,et=0;if(Ao(t.element)){let tt=null;if(!r&&o&&Number.isFinite(o.a))tt={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let rt=fe(t.element),ot=wo(l.transform&&l.transform!=="none"?l.transform:"",rt);ot&&ot.is2D&&(tt={a:ot.a,b:ot.b,c:ot.c,d:ot.d,e:0,f:0})}if(tt&&!(tt.a===1&&tt.b===0&&tt.c===0&&tt.d===1)){let{ox:rt,oy:ot}=ln(l,p,h),ee=Oe(p,h,tt,rt,ot);Q=ee.minX,et=ee.minY}}x=D(n.x+Q),k=D(n.y+et),R=D(x+n.width),T=D(k+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},et=Oe(p,h,Q,0,0);x=D(et.minX),k=D(et.minY),R=D(et.maxX),T=D(et.maxY)}else if(r&&Ao(t.element)){let et=l.transform&&l.transform!=="none"?l.transform:"",tt=fe(t.element),rt=Zt({baseTransform:et,rotate:tt.rotate||"0deg",scale:tt.scale,translate:tt.translate,width:p,height:h}),{ox:ot,oy:ee}=ln(l,p,h),ne=rt.is2D?rt:new DOMMatrix(rt.toString()),qe={a:ne.a,b:ne.b,c:ne.c,d:ne.d,e:0,f:0},Vt=Oe(p,h,qe,ot,ee);x=D(Vt.minX),k=D(Vt.minY),R=D(Vt.maxX),T=D(Vt.maxY)}let L=uo(l),W=po(l),P=ho(l),A=mo(l),N=go(l),$=f.width>0?(R-x)/f.width:1,F=f.height>0?(T-k)/f.height:1,z=i==="subtree"&&!n?Ds(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},q=n?{top:0,right:0,bottom:0,left:0}:i?{top:D(Math.max(L.top,W.top,z.top)+P.top+A.top+N.bleed.top),right:D(Math.max(L.right,W.right,z.right)+P.right+A.right+N.bleed.right),bottom:D(Math.max(L.bottom,W.bottom,z.bottom)+P.bottom+A.bottom+N.bleed.bottom),left:D(Math.max(L.left,W.left,z.left)+P.left+A.left+N.bleed.left)}:{top:P.top,right:P.right,bottom:P.bottom,left:P.left};x=D(x-q.left),k=D(k-q.top),R=D(R+q.right),T=D(T+q.bottom);let j=Math.max(1,D(R-x)),J=Math.max(1,D(T-k)),B="http://www.w3.org/2000/svg",ut=Ao(t.element)?2:0,at=D(ut+(r?0:1)),st=Math.ceil(j+at*2),nt=Math.ceil(J+at*2),pt=D(-(D(x)-at)),zt=D(-(D(k)-at)),ge=Math.max(0,pt),V=Math.max(0,zt),G=D(st-Math.min(0,pt)),U=D(nt-Math.min(0,zt)),ht=m.defaultView||window,Y=!X()&&CSS.supports("zoom","2")&&ht.devicePixelRatio||1;a.__layoutZoom=Y;let vt=document.createElementNS(B,"foreignObject");vt.setAttribute("x",String(Math.min(0,pt)*Y)),vt.setAttribute("y",String(Math.min(0,zt)*Y)),vt.setAttribute("width",String(G*Y)),vt.setAttribute("height",String(U*Y)),vt.style.overflow="visible";let ye=document.createElement("style"),gn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ye.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+gn+t.classCSS,vt.appendChild(ye);let je=document.createElement("div");je.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),je.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${U}px`+(ge!==0||V!==0?`;padding:${V}px 0 0 ${ge}px !important`:"")+(Y!==1?`;zoom:${Y} !important`:""),je.appendChild(t.clone),vt.appendChild(je);let wr=new XMLSerializer().serializeToString(vt),Ht=M||_,Sr=Object.freeze({w0:w,h0:v,vbW:st,vbH:nt,targetW:C,targetH:S,contentX:D(pt+(n?x:0)),contentY:D(zt+(n?k:0)),clip:n?Object.freeze({x:D(x),y:D(k),width:w,height:v}):null});Object.defineProperty(a,"meta",{value:Sr,enumerable:!0,writable:!1,configurable:!0});let xr=!Ht||X()?st:M?C:D(st*(S/nt)),yn=!Ht||X()?nt:_?S:D(nt*(C/st)),jt=parseFloat(O(m.documentElement)?.fontSize)||16,Jo=Y!==1,cc=`<svg xmlns="${B}" width="${xr}" height="${yn}" viewBox="0 0 ${st} ${nt}" font-size="${jt}px">${Jo?`<g transform="scale(${1/Y})">`:""}`,lc=Jo?"</g></svg>":"</svg>";u=cc+Ku(wr,vt)+lc,c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Bt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let vr=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);return vr&&vr.style.position==="absolute"&&vr.remove(),t.dataURL}function Ao(t){return Bs(t)}function Ju(t){let e=Array.isArray(t.plugins)?t.plugins:ua(),n=[];for(let r of e){let i=un(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function xa(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=Co(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=Ju(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,u,l="",f=null,p=e.needs||_t,h=n.format,m=n.type;await Bt("beforeSnap",n);let d=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(d||g){let R=String(d?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Bt("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?zn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Ti(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=bi(e.fast);for(;;){e.__slicer=v;let R=Kn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:u}=await Js(n.element,n.options)),c>0&&!e.reconcile&&(Mt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),I.warnedReconcile||(I.warnedReconcile=!0,console.warn("[SnapDOM] Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!y&&r&&(f=Ws(n.element,r)),!b&&r&&qs(n.element,r,n.options),r&&(Xs(n.element,r,a),Gs(n.element,r))}finally{R()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=Co(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Bt("afterClone",n),!We(p,"render"))return null;if(v?.due()&&await v.pause(),Hn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Ys(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){Mt(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[SnapDOM] Couldn't close the gaps left by removed elements.",R)}try{await $n(n.clone,n.element,n.nodeMap)}catch{}let C=R=>Promise.resolve().then(R),S=(async()=>{await Promise.all([C(()=>Vn(n.clone,n.options)),C(()=>Gn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{ea(n.element,n.clone,n.nodeMap)}catch(R){Mt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[SnapDOM] Couldn't reproduce a backdrop-filter; captured without it.",R)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=f,await C(()=>or(n.clone,n.options,n.nodeMap))),e.captureSelection)try{cs(n.nodeMap)}catch(R){Mt(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),M=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(M=C(async()=>{let R=n.element.ownerDocument||document,T=w?P=>{try{let A=P.getBoundingClientRect();return A.right>=w.left-200&&A.left<=w.right+200&&A.bottom>=w.top-200&&A.top<=w.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:W}=!w&&e.__fontUsage||On(n.element,T);if(e.embedFonts==="auto"){let P=new Set;try{for(let N of R.fonts)P.add(String(N.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(P.size>0&&Array.from(L).some(N=>P.has(String(N).split("__")[0].toLowerCase()))))return}if(X()){let P=new Set(Array.from(L).map(A=>String(A).split("__")[0]).filter(Boolean));await Dn(P,1,R)}l=await vs({required:L,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([S,M]);let E=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,v?.due()&&await v.pause();let x=n.clone;rr(x,e.__compressedAssets);let k=await ir(n,{clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,fontsCSS:l});if(e.__compressedSnapshot=nr(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return k}gt();Ct();var Zu=new Set(["png","jpeg","jpg","webp","svg"]);function va(t={}){let e=typeof t.type=="string"&&Zu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=Zo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of o)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{console.warn(`[SnapDOM] Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&console.warn("[SnapDOM] Ignored an exclude entry: use a CSS selector or a function.",f);let c=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(f.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(f))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(f))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:it(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ds(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}mt();oe();wt();var Ca="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function td(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var ed=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function nd(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(ed.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function rd(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var ka=new WeakMap;function od(t){let e=Wt(),n=ka.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],u=c.selectorText;if(u&&/[+~]|:has\(/.test(u)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return ka.set(t,{epoch:e,leaky:r}),r}var id=1/16;function sd(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=id}var sr=new Map,ad=["width","height","min-width","min-height"];function cd(t){let e=sr.get(t);if(e===void 0){e=null;for(let n of ad){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||(e={}))[n]=r[1])}sr.size>5e3&&sr.clear(),sr.set(t,e)}return e}function ld(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function fd(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var _o={attempts:0,served:0,reconciled:0};async function Ma(t,e,n){_o.attempts++;try{let r=await ud(t,e,n);return r&&_o.served++,r}catch{return null}}async function ud(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||td(t)||nd(r)||r.fontsCSS||Zn(n))return null;for(let f of n.plugins||[])if(f&&(typeof f.beforeSnap=="function"||typeof f.beforeClone=="function"||typeof f.resolveNode=="function"||typeof f.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=rn(t);if(!o||od(i))return null;let s=[];t:for(let f of e.dirtyRoots){if(!f.isConnected||f===t||!t.contains(f))return null;for(let p of e.dirtyRoots)if(p!==f&&p!==t&&p.contains(f))continue t;s.push(f)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let f of s){if(f.parentElement===t||f.matches?.(Ca)||f.querySelector?.(Ca)||rd(f,o))return null;let p=r.srcToClone.get(f);if(!p||!p.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},d=Kn(f,null),g=Un(f),y;try{y=await Jt(f,m,n)}finally{g(),d()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Ie(f,y,m,n),m.__pseudoCSS)||m.__usesPlaceholder&&!r.classPrefixCSS?.includes("[data-sd-ph]"))return null;await En(y,m),Hn(y);try{await $n(y,f,h)}catch{}if(await Promise.all([Vn(y,n),Gn(f,y,r.styleCache,n,h)]),n.compress)try{await or(y,n,h)}catch{}for(let[b,w]of h.entries())vo(b,w);p.replaceWith(y),fd(p,r);for(let[b,w]of h.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[f,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let h=r.styleMap.get(f);if(!h)continue;let m=cd(h);if(!m)continue;let d=null,g=!1;for(let y in m)if(d||(d=getComputedStyle(p)),!sd(d.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(f))return null;_o.reconciled++,await dt(p,f,a,n)}}let c=Ke(r.styleMap);for(let[f,p]of r.styleMap.entries())ld(f),xo(f,p,c);let u=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([f,p])=>`.${p}{${f}}`).join("");rr(r.clone,n.__compressedAssets);let l=await ir({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:u,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=nr(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}Ct();var Ro=new WeakMap,cr=new WeakMap,Ia=new WeakSet,Eo=new WeakMap,dd=64,dn=new Map,Oa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],pd=["(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 hd(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":pd.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Aa(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function _a(t,e){if(e.disposed||(dn.delete(t),dn.set(t,e),dn.size<=dd))return;let[n,r]=dn.entries().next().value;Da(n,r)}function Da(t,e){e.disposed=!0,dn.delete(t),Ro.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Oa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of To)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Wa(t){if(Ia.has(t))return!1;cr.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let u="";if(c==="img"){r.push(a);try{u=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",f=Eo.get(a);if(u||l){if((!f||f.src!==u||f.style!==l)&&(f={src:u,style:l,animated:ze(u)||ze(l)},Eo.set(a,f)),f.animated)return!1}else f&&Eo.delete(a)}}return cr.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function Fo(t,e){if(!t.querySelectorAll)return!1;let n=cr.get(t);cr.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of To)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of To)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var To=["scroll","change","beforetoggle","toggle"];function lr(t,e){return[t,...e.trackedShadowRoots.keys()]}function Po(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of lr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function Ea(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(ae(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var md=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ue=t=>t&&(typeof t=="object"||typeof t=="function")?ar(t):"-";function gd(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function yd(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=gd(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 Ra(t){let e=String(t||"").trim();return e?md.test(e)?!0:/^data:/i.test(e)?yd(e):!1:!1}function ze(t){let e=String(t||"");if(Ra(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Ra(n[1]??n[2]??n[3]))return!0;return!1}function Fa(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of Ba(i))if(ze(o.getAttribute?.("src"))||ze(o.getAttribute?.("href"))||ze(o.getAttribute?.("style"))||ze(t.styleMap?.get(o)))return!0;return!1}function Ba(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function $o(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of lr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function No(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of lr(t,e))for(let s of Ba(o))i(s);e.scrollNodes=n}function Ta(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",hd(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ue))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Ue))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ue(o)),(s?.contains(t)||t.contains(s))&&i.push(Ue(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let f=String(l.localName||"").toLowerCase();f==="input"?c.push(l.type,Xe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):f==="textarea"?c.push(l.value):f==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let u=[];for(let l of e.images){let f="";try{f=l.currentSrc||l.src||""}catch{}u.push(f,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:u,frameDriven:e.retainedFrameDriven}}function Be(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Pa(t,e){let n=new Set;for(let r of lr(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function $a(t){return t.map(e=>[Ue(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function bd(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function wd(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:_e(),styleEpoch:Wt(),styleStamp:nn(t),outsideMutations:en(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)ae(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of Oa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return Fo(t,e)||$o(t,e),No(t,e),Po(t,e),e}var Sd=0,Na=new WeakMap;function ar(t){let e=Na.get(t);return e||(e="@"+ ++Sd,Na.set(t,e)),e}function Lo(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(ar(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(ar(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Lo(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(ar(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Lo(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function La(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Lo(i,new Set);return o===null?null:`${(e||[]).map(Ue).join(",")}:${o}`}catch{return null}}function Ua(t,e,n,r,i=null){let o=Ro.get(t);o||(o=wd(t),o.baselineSignature=La(e,n.plugins),Ro.set(t,o));let s=La(e,n.plugins),a=async()=>{if(o.disposed)return r();let u=s===null||s!==o.baselineSignature;u&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,u=!1):o.pendingSig=s:o.pendingSig=null,Fo(t,o),Po(t,o);for(let M of o.observers)M.__flush(M.takeRecords());Tt();let l=en(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let f=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];f?.nodeType===11&&!p.includes(f)&&p.push(f),Mn(t.ownerDocument||document,p);let h=nn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=Ta(t,o),d=Pa(t,o);m.animation=$a(d),o.renderState&&(!Be(o.renderState,m,"style")&&(Ee(),o.dirtyAll()),Be(o.renderState,m,"scroll")||o.dirtyAll(),Be(o.renderState,m,"controls")||(ce(t),o.dirtyAll()),!Be(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=_e();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let M=Aa(t);o.geometry!==null&&M!==o.geometry&&(ce(t),o.dirtyAll()),o.geometry=M}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Be(o.renderState,m,"animation");try{let M=new Set;w&&d.length===0&&(M=null);for(let _ of d){let E=_.playState==="running";if(!E&&!w)continue;E&&(b=!0),w=!0;let x=_.effect?.target;if(bd(t,o,x)===t)M.add(x);else{M=null;break}}if(w&&M&&M.size&&o.retained){o.dirty=!0;for(let _ of M)o.dirtyRoots&&o.dirtyRoots.add(_),ce(_)}else w&&!M&&o.dirtyAll()}catch{}let v=m.frameDriven,C=b||v;if(C&&(o.last=null),v&&o.dirtyAll(),!u&&!C&&!o.dirty&&o.last)return _a(t,o),o.last;o.capturing=!0;let S=null;try{let M=null,_=!1,E=null;if(!u&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){E=[...o.dirtyRoots];let x=await Ma(t,o,n);x&&(M=await i(x),_=!0)}if(M||(u||(n.__retain=x=>{let k=new Map;for(let[R,T]of x.nodeMap.entries())k.set(T,R);S={...x,srcToClone:k}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let k of x.takeRecords())o.pending.push(k);return Tt(),o.torn||Ea(o.pending)||en(t)!==l},M=await r()),!u&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=Fa(S),$o(t,o),No(t,o)):_&&(o.retainedFrameDriven||(o.retainedFrameDriven=Fa(o.retained,E)),$o(t,o),No(t,o));let x=Ta(t,o);x.animation=$a(Pa(t,o));let k=["style","scroll","controls","images"];b||k.push("animation");let R=k.every(T=>Be(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=nn(t),o.geometry=Aa(t),o.renderState.frameDriven?(Ia.add(t),Da(t,o)):R?!C&&!o.renderState.frameDriven&&(o.last=M,_a(t,o)):(o.dirtyAll(),o.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let _ of o.observers)for(let E of _.takeRecords())o.pending.push(E);Tt();let M=en(t);(o.torn||Ea(o.pending)||M!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=M,o.styleEpoch=Wt(),o.styleStamp=nn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(Fo(t,o),Po(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var fr=null;function ja(t){fr=t}var xd='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Io=!1,pn=null,Oo=new WeakMap,za=!1;function Va(t,e){!Io||!pn||e&&e.burst===!1||Oo.set(pn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function qa(t){let e={control:t};pn=e,setTimeout(()=>{pn===e&&(pn=null)},0)}function Wo(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(xd):null}function Ha(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Wo(t);e&&(qa(e),Do(t,!1))}function vd(t){let e=Wo(t);e&&qa(e)}function Do(t,e=!0){if(!fr||document.visibilityState==="hidden")return;let n=Wo(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Oo.get(n);if(r){if(!r.element.isConnected){Oo.delete(n);return}fr(r.element,r.options).catch(()=>{});return}e&&!za&&(za=!0,fr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ga(){if(Io||typeof document>"u"||typeof document.addEventListener!="function")return;Io=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ha,t),document.addEventListener("keydown",Ha,t),document.addEventListener("click",vd,t),document.addEventListener("pointerenter",Do,t),document.addEventListener("focusin",Do,t)}kt();function Ud(...t){return ca(...t),K}async function zd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await yt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Qo(i,{...e||{},burst:!1})}finally{n.remove()}}var Hd="3.3.0",K=Object.assign(Qo,{plugins:Ud,fromString:zd,version:Hd,preCapture:Ga});ja(Qo);var Ko=Symbol("snapdom.internal"),jd=Symbol("snapdom.internal.silent"),sc=new Set(["png","jpeg","jpg","webp","svg"]);async function Qo(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=va(e);n.element=t,n.invalidate&&Ee(),fa(n,e&&e.plugins);let{stage:r,loweredBy:i}=sa(n);n.needs=r,n.__needsLoweredBy=i;let o=We(r,"render"),s=n.burst===!0||!Zn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Wa(t);return u&&Va(t,e),n.snap||(n.snap={toPng:(l,f)=>K.toPng(l,f),toSvg:(l,f)=>K.toSvg(l,f)}),u?Ua(t,e,n,()=>K.capture(t,n,Ko),l=>ac(l,n)):K.capture(t,n,Ko)}K.capture=async(t,e,n)=>{if(n!==Ko)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(We(e.needs||_t,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=On(t);e.clip||(e.__fontUsage=a);let c=a.required,u=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(u=new Set([...u].filter(l=>s.has(l.toLowerCase()))),u.size===0))throw null;await Dn(u,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(an(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){H(e,"Couldn't prepare canvases for Safari.",s)}}let r=await xa(t,e);return ac(r,e)};async function ac(t,e){let n=e.needs||_t,r=We(n,"render"),i=A=>aa(n,e.__needsLoweredBy||[],A),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??(s=o.toDataURL()),c=o||t;o&&(t="");let u=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,p=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),d=m?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=m?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=A=>{if(o||!u?.size)return c;let N=p.vbW,$=p.vbH,F=A.crop;F&&(N=Math.max(1,Math.min(N,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let z=Number.isFinite(A.width),q=Number.isFinite(A.height);return(z&&q?Math.max(A.width/N,A.height/$):z?A.width/N*(F?Math.max(1,g/d):1):q?A.height/$*(F?Math.max(1,d/g):1):(A.scale||1)*Math.max(d,g))*(A.dpr||1)<=l?c:f??(f=ya(a(),u))},b=async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn));return $(c,{...A,...N||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let A=t.indexOf(",");return A>=0?decodeURIComponent(t.slice(A+1)):""},v=A=>Object.defineProperty({...A||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),C={img:async(A,N)=>{if(o)return b(A,N);let{toImg:$}=await Promise.resolve().then(()=>(qo(),Vo)),F={...A,...N||{}};return $(y(F),F)},svg:async(A,N)=>{if(o)return b(A,N);let{toSvg:$}=await Promise.resolve().then(()=>(qo(),Vo)),F={...A,...N||{}};return $(y(F),F)},canvas:async(A,N)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(me(),Ja)),F={...A,...N||{}};return $(y(F),F)},blob:async(A,N)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Yo(),nc)),F={...A,...N||{}};return $(y(F),F)},png:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn)),F={...A,...N||{},format:"png"};return $(y(F),F)},jpeg:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn)),F={...A,...N||{},format:"jpeg"};return $(y(F),F)},webp:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn)),F={...A,...N||{},format:"webp"};return $(y(F),F)},download:async(A,N)=>{let{download:$}=await Promise.resolve().then(()=>(ic(),oc)),F={...A,...N||{}};return $(y(F),F)}};if(!r)for(let A of Object.keys(C)){let N=A==="download"?"download()":`to${A.charAt(0).toUpperCase()}${A.slice(1)}()`;C[A]=async()=>{throw i(N)}}let S={};for(let A of["img","svg","canvas","blob","png","jpeg","webp"])S[A]=async N=>C[A](e,{...R(A,N||{}),[jd]:!0});S.jpg=S.jpeg;let M=A=>Object.defineProperty({...e,...A},"options",{value:e,configurable:!0}),_=M({artifacts:e.__artifacts||null,export:v(),exports:S}),E=await Jn("defineExports",_),x=Object.assign({},...E.filter(A=>A&&typeof A=="object").reverse()),k={...C,...x};k.jpeg&&!k.jpg&&(k.jpg=(A,N)=>k.jpeg(A,N));function R(A,N){let $=N||{},F={...e,...$},z=typeof $.type=="string"?$.type.toLowerCase():"",q=typeof $.format=="string"?$.format.toLowerCase():sc.has(z)?z:"";q&&(F.format=q==="jpg"?"jpeg":q),F.__explicitFormat=q?F.format:e.__explicitFormat??null,A==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let j=B=>B==="jpeg"||B==="jpg"||B==="webp";return[A,F.format,z].map(B=>typeof B=="string"?B.toLowerCase():"").find(j)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&H(F,"scale ignored: width/height already set the size."),F}let T=!1,L=Promise.resolve();async function W(A,N){let $=Object.freeze(N&&typeof N=="object"?{...N}:{}),F=async()=>{let q=k[A];if(!q)throw new Error(`[SnapDOM] Unknown export type: ${A}`);let j=R(A,$),J=M({artifacts:e.__artifacts||null,export:v({type:A,options:j,requestedOptions:$})}),B=j.format,ut=j.type;await Jn("beforeExport",J,{format:A,options:j});let xt=j.format!==B?j.format:j.type!==ut?j.type:"",at=typeof xt=="string"?xt.toLowerCase():"";sc.has(at)&&(j.format=at==="jpg"?"jpeg":at,j.type=j.format,j.__explicitFormat=j.format,/^(?:jpeg|webp)$/.test(j.format)&&(j.backgroundColor==null||j.backgroundColor==="transparent")&&(j.backgroundColor="#ffffff"));let st=await q(J,j);return await Jn("afterExport",J,{format:A,options:j,result:st}),T||(T=!0,await Bt("afterSnap",e)),st},z=L.then(F);return L=z.catch(()=>{}),z}let P={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(A,N)=>W(A,N),toImg:A=>W("img",A),toSvg:A=>W("svg",A),toCanvas:A=>W("canvas",A),toBlob:A=>W("blob",A),toPng:A=>W("png",A),toJpg:A=>W("jpg",A),toWebp:A=>W("webp",A),download:A=>W("download",A)};r?o&&Object.defineProperty(P,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(P,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(P,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let A of Object.keys(k)){let N="to"+A.charAt(0).toUpperCase()+A.slice(1);P[N]||(P[N]=$=>W(A,$))}return P}K.toRaw=(t,e)=>K(t,e).then(n=>n.toRaw());K.toImg=(t,e)=>K(t,e).then(n=>n.toImg());K.toSvg=(t,e)=>K(t,e).then(n=>n.toSvg());K.toCanvas=(t,e)=>K(t,e).then(n=>n.toCanvas());K.toBlob=(t,e)=>K(t,e).then(n=>n.toBlob());K.toPng=(t,e)=>K(t,{...e,format:"png"}).then(n=>n.toPng());K.toJpg=(t,e)=>K(t,{...e,format:"jpeg"}).then(n=>n.toJpg());K.toWebp=(t,e)=>K(t,{...e,format:"webp"}).then(n=>n.toWebp());K.download=(t,e)=>K(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=K);})();
|
|
40
|
+
}`,Du=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Lt=null,Wu=0,Bu=0,ue=new Map;function Sa(){for(let t of ue.values())t(void 0);if(ue.clear(),Array.isArray(Lt))for(let t of Lt)try{t?.terminate()}catch{}Lt=!1}function Uu(){let t,e=null;try{t=URL.createObjectURL(new Blob([Ou],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ue.get(n.data.id);r&&(ue.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=Sa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function zu(){if(Lt===!1)return!1;if(Lt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Lt=!1;Lt=[]}let t=Wu++%Du;if(!Lt[t]){let e=Uu();if(!e)return Sa(),!1;Lt[t]=e}return Lt[t]}var Hu=5e3;function ju(t,e,n,r,i){let o=zu();return o?new Promise(s=>{let a=++Bu,c=setTimeout(()=>{ue.delete(a),s(void 0)},Hu);ue.set(a,u=>{clearTimeout(c),s(u)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:wa,quality:ba,mime:r})}catch{clearTimeout(c),ue.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function Mo(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=I.compress,s=o.get(i);if(s?.source===t)return s.result;let a=tr.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Pu(t),f=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",d=Iu(t);if(d&&d.w>0&&d.h>0&&!ha(d.w,d.h,e,n))return null;if(t.length>=$u){let S=await ju(t,e,n,f,r);if(S!==void 0)return S}let h;try{h=await Tu(t)}catch{return null}let m=h.naturalWidth||h.width,p=h.naturalHeight||h.height;if(!m||!p)return null;let g=ha(m,p,e,n);if(!g)return null;let y=g*wa,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(p*y)),v=document.createElement("canvas");v.width=b,v.height=w;let C=v.getContext("2d");if(!C)return null;C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high",C.drawImage(h,0,0,b,w);try{let S=v.toDataURL(f,ba);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),u={source:t,promise:c,cache:o};tr.set(i,u);try{let l=await c;return Nu(o,i,t,l),l}finally{tr.get(i)===u&&tr.delete(i)}}async function Vu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let f=l.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!d||!h)return;let m=r.value||(r.value=ko(t,e)),p=m.density*m.stretch(n.get(l)||l),g=await Mo(f,d*p,h*p,l.__snapdomBlob);g&&(o++,s+=f.length,a+=g.length,l.setAttribute("src",g),er(l,"attribute","src",f,g,e))},u=6;for(let l=0;l<i.length;l+=u)await Promise.allSettled(i.slice(l,l+u).map(c));return{count:o,before:s,after:a}}var qu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function Gu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function Xu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let u of o){let l=u.style&&u.style.backgroundImage;l&&l.includes("data:image")&&i.push(u)}let s=0,a=async u=>{let l=n.get(u);if(!l||!l.isConnected)return;let f;try{f=getComputedStyle(l)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(_=>_.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(_=>!qu.test(_.trim())))return;let{w:m,h:p}=Gu(l);if(!m||!p)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(_=>parseFloat(_)/100)),y=r.value||(r.value=ko(t,e)),b=y.density*y.stretch(l)*g,w=m*b,v=p*b,C=u.style.backgroundImage,S=[...C.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=C;for(let _ of S){let E=_[2];if(E.startsWith("data:image/svg"))continue;let x=await Mo(E,w,v);x&&(M=M.split(E).join(x),s++)}M!==C&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),er(u,"style","background-image",C,u.style.backgroundImage,e))},c=6;for(let u=0;u<i.length;u+=c)await Promise.allSettled(i.slice(u,u+c).map(a));return{count:s}}async function Yu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let u=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",f=c.getAttribute("height")||"";if(l.includes("%")||f.includes("%"))return;let d=n.get(c),h=d?O(d):c.style,m=(v,C)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[v]||""))return parseFloat(h[v]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(C.trim()))return parseFloat(C);try{return d?.[v]?.baseVal?.value||0}catch{return 0}},p=m("width",l),g=m("height",f);if(!p||!g)return;let y=r.value||(r.value=ko(t,e)),b=y.density*y.stretch(d||c),w=await Mo(u,p*b,g*b);w&&(c.setAttribute("href",w),er(c,"attribute","href",u,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(ma,"xlink:href",w),er(c,"attribute","xlink:href",u,w,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function or(t,e,n){if(!e.compress)return;let r={};await Vu(t,e,n,r),await Xu(t,e,n,r),await Yu(t,e,n,r)}wt();gt();kt();function Ku(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,u;for(let y of i)if(y.intern)for(c.lastIndex=0;u=c.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let f=Qu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],p=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,p):y.text;return t.slice(0,n)+m.join("")+g}function Qu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let u=c.getAttribute("style");u&&r.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=u=>{for(let l of u){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let l=u.textContent||"";if(/@import\b/i.test(l))return null;let f=new CSSStyleSheet;f.replaceSync(l),c(f.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&o.add(u[1])}return o}async function ir(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Q,...et}=t;t=Object.assign(a,et),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,u;Qs(t,s),await Bt("beforeRender",t);let l=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,D(t.element.offsetWidth||parseFloat(l.width)||f.width||1)),h=Math.max(1,D(t.element.offsetHeight||parseFloat(l.height)||f.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let Q=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),et=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0);Q>0&&(h=Math.max(h,D(Q))),et>0&&(d=Math.max(d,D(et)));try{let tt=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,rt=I.measureHints.get(t.element);if(rt&&rt.cssLen===tt&&rt.w0===d&&rt.docH===Q&&rt.docW===et)rt.csh>0&&(h=Math.max(h,D(rt.csh))),rt.csw>0&&(d=Math.max(d,D(rt.csw)));else{let ot=m.createElement("div");Z(ot),ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+d+"px!important;overflow:visible!important;visibility:hidden!important;";let ee=ot.attachShadow({mode:"open"}),ne=m.createElement("style");ne.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,ee.appendChild(ne),ee.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(ot);let qe=ot.scrollHeight,Vt=ot.scrollWidth;m.body.removeChild(ot),I.measureHints.set(t.element,{cssLen:tt,w0:d,docH:Q,docW:et,csh:qe,csw:Vt}),qe>0&&(h=Math.max(h,D(qe))),Vt>0&&(d=Math.max(d,D(Vt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Q=So(t.element,t.options),et=1,tt=So(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(tt)&&tt>=h-rt&&Number.isFinite(Q)&&Q>0&&(h=Math.max(1,Math.min(h,D(Q+et))))}if(t.options?.reconcile)try{let Q=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ks(t.element,t.clone,Q,t.nodeMap,d,h)}catch(Q){console.warn("[SnapDOM] reconcile couldn't run; captured without it.",Q)}let g=(Q,et=NaN)=>{let tt=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(tt)?tt:et},y=g(t.options.width),b=g(t.options.height),w=n?D(n.width):d,v=n?D(n.height):h,C=w,S=v,M=Number.isFinite(y),_=Number.isFinite(b),E=v>0?w/v:1;M&&_?(C=Math.max(1,D(y)),S=Math.max(1,D(b))):M?(C=Math.max(1,D(y)),S=Math.max(1,D(C/(E||1)))):_&&(S=Math.max(1,D(b)),C=Math.max(1,D(S*(E||1))));let x=0,k=0,R=d,T=h;if(n){let Q=0,et=0;if(Ao(t.element)){let tt=null;if(!r&&o&&Number.isFinite(o.a))tt={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let rt=fe(t.element),ot=wo(l.transform&&l.transform!=="none"?l.transform:"",rt);ot&&ot.is2D&&(tt={a:ot.a,b:ot.b,c:ot.c,d:ot.d,e:0,f:0})}if(tt&&!(tt.a===1&&tt.b===0&&tt.c===0&&tt.d===1)){let{ox:rt,oy:ot}=ln(l,d,h),ee=Oe(d,h,tt,rt,ot);Q=ee.minX,et=ee.minY}}x=D(n.x+Q),k=D(n.y+et),R=D(x+n.width),T=D(k+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},et=Oe(d,h,Q,0,0);x=D(et.minX),k=D(et.minY),R=D(et.maxX),T=D(et.maxY)}else if(r&&Ao(t.element)){let et=l.transform&&l.transform!=="none"?l.transform:"",tt=fe(t.element),rt=Zt({baseTransform:et,rotate:tt.rotate||"0deg",scale:tt.scale,translate:tt.translate,width:d,height:h}),{ox:ot,oy:ee}=ln(l,d,h),ne=rt.is2D?rt:new DOMMatrix(rt.toString()),qe={a:ne.a,b:ne.b,c:ne.c,d:ne.d,e:0,f:0},Vt=Oe(d,h,qe,ot,ee);x=D(Vt.minX),k=D(Vt.minY),R=D(Vt.maxX),T=D(Vt.maxY)}let L=uo(l),W=po(l),P=ho(l),A=mo(l),N=go(l),$=f.width>0?(R-x)/f.width:1,F=f.height>0?(T-k)/f.height:1,z=i==="subtree"&&!n?Ds(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},q=n?{top:0,right:0,bottom:0,left:0}:i?{top:D(Math.max(L.top,W.top,z.top)+P.top+A.top+N.bleed.top),right:D(Math.max(L.right,W.right,z.right)+P.right+A.right+N.bleed.right),bottom:D(Math.max(L.bottom,W.bottom,z.bottom)+P.bottom+A.bottom+N.bleed.bottom),left:D(Math.max(L.left,W.left,z.left)+P.left+A.left+N.bleed.left)}:{top:P.top,right:P.right,bottom:P.bottom,left:P.left};x=D(x-q.left),k=D(k-q.top),R=D(R+q.right),T=D(T+q.bottom);let j=Math.max(1,D(R-x)),J=Math.max(1,D(T-k)),B="http://www.w3.org/2000/svg",ut=Ao(t.element)?2:0,at=D(ut+(r?0:1)),st=Math.ceil(j+at*2),nt=Math.ceil(J+at*2),pt=D(-(D(x)-at)),zt=D(-(D(k)-at)),ge=Math.max(0,pt),V=Math.max(0,zt),G=D(st-Math.min(0,pt)),U=D(nt-Math.min(0,zt)),ht=m.defaultView||window,Y=!X()&&CSS.supports("zoom","2")&&ht.devicePixelRatio||1;a.__layoutZoom=Y;let vt=document.createElementNS(B,"foreignObject");vt.setAttribute("x",String(Math.min(0,pt)*Y)),vt.setAttribute("y",String(Math.min(0,zt)*Y)),vt.setAttribute("width",String(G*Y)),vt.setAttribute("height",String(U*Y)),vt.style.overflow="visible";let ye=document.createElement("style"),gn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ye.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+gn+t.classCSS,vt.appendChild(ye);let je=document.createElement("div");je.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),je.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${U}px`+(ge!==0||V!==0?`;padding:${V}px 0 0 ${ge}px !important`:"")+(Y!==1?`;zoom:${Y} !important`:""),je.appendChild(t.clone),vt.appendChild(je);let wr=new XMLSerializer().serializeToString(vt),Ht=M||_,Sr=Object.freeze({w0:w,h0:v,vbW:st,vbH:nt,targetW:C,targetH:S,contentX:D(pt+(n?x:0)),contentY:D(zt+(n?k:0)),clip:n?Object.freeze({x:D(x),y:D(k),width:w,height:v}):null});Object.defineProperty(a,"meta",{value:Sr,enumerable:!0,writable:!1,configurable:!0});let xr=!Ht||X()?st:M?C:D(st*(S/nt)),yn=!Ht||X()?nt:_?S:D(nt*(C/st)),jt=parseFloat(O(m.documentElement)?.fontSize)||16,Jo=Y!==1,cc=`<svg xmlns="${B}" width="${xr}" height="${yn}" viewBox="0 0 ${st} ${nt}" font-size="${jt}px">${Jo?`<g transform="scale(${1/Y})">`:""}`,lc=Jo?"</g></svg>":"</svg>";u=cc+Ku(wr,vt)+lc,c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Bt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let vr=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);return vr&&vr.style.position==="absolute"&&vr.remove(),t.dataURL}function Ao(t){return Bs(t)}function Ju(t){let e=Array.isArray(t.plugins)?t.plugins:ua(),n=[];for(let r of e){let i=un(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function xa(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=Co(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=Ju(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,u,l="",f=null,d=e.needs||_t,h=n.format,m=n.type;await Bt("beforeSnap",n);let p=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||g){let R=String(p?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Bt("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?zn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Ti(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=bi(e.fast);for(;;){e.__slicer=v;let R=Kn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:u}=await Js(n.element,n.options)),c>0&&!e.reconcile&&(Mt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),I.warnedReconcile||(I.warnedReconcile=!0,console.warn("[SnapDOM] Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!y&&r&&(f=Ws(n.element,r)),!b&&r&&qs(n.element,r,n.options),r&&(Xs(n.element,r,a),Gs(n.element,r))}finally{R()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=Co(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Bt("afterClone",n),!We(d,"render"))return null;if(v?.due()&&await v.pause(),Hn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Ys(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){Mt(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[SnapDOM] Couldn't close the gaps left by removed elements.",R)}try{await $n(n.clone,n.element,n.nodeMap)}catch{}let C=R=>Promise.resolve().then(R),S=(async()=>{await Promise.all([C(()=>Vn(n.clone,n.options)),C(()=>Gn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{ea(n.element,n.clone,n.nodeMap)}catch(R){Mt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[SnapDOM] Couldn't reproduce a backdrop-filter; captured without it.",R)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=f,await C(()=>or(n.clone,n.options,n.nodeMap))),e.captureSelection)try{cs(n.nodeMap)}catch(R){Mt(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),M=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(M=C(async()=>{let R=n.element.ownerDocument||document,T=w?P=>{try{let A=P.getBoundingClientRect();return A.right>=w.left-200&&A.left<=w.right+200&&A.bottom>=w.top-200&&A.top<=w.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:W}=!w&&e.__fontUsage||On(n.element,T);if(e.embedFonts==="auto"){let P=new Set;try{for(let N of R.fonts)P.add(String(N.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(P.size>0&&Array.from(L).some(N=>P.has(String(N).split("__")[0].toLowerCase()))))return}if(X()){let P=new Set(Array.from(L).map(A=>String(A).split("__")[0]).filter(Boolean));await Dn(P,1,R)}l=await vs({required:L,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([S,M]);let E=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,v?.due()&&await v.pause();let x=n.clone;rr(x,e.__compressedAssets);let k=await ir(n,{clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,fontsCSS:l});if(e.__compressedSnapshot=nr(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return k}gt();Ct();var Zu=new Set(["png","jpeg","jpg","webp","svg"]);function va(t={}){let e=typeof t.type=="string"&&Zu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=Zo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of o)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{console.warn(`[SnapDOM] Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&console.warn("[SnapDOM] Ignored an exclude entry: use a CSS selector or a function.",f);let c=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(l.exclude)?l.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(f))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:it(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ds(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}mt();oe();wt();var Ca="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function td(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var ed=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function nd(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(ed.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function rd(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var ka=new WeakMap;function od(t){let e=Wt(),n=ka.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],u=c.selectorText;if(u&&/[+~]|:has\(/.test(u)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return ka.set(t,{epoch:e,leaky:r}),r}var id=1/16;function sd(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=id}var sr=new Map,ad=["width","height","min-width","min-height"];function cd(t){let e=sr.get(t);if(e===void 0){e=null;for(let n of ad){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||(e={}))[n]=r[1])}sr.size>5e3&&sr.clear(),sr.set(t,e)}return e}function ld(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function fd(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var _o={attempts:0,served:0,reconciled:0};async function Ma(t,e,n){_o.attempts++;try{let r=await ud(t,e,n);return r&&_o.served++,r}catch{return null}}async function ud(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||td(t)||nd(r)||r.fontsCSS||Zn(n))return null;for(let f of n.plugins||[])if(f&&(typeof f.beforeSnap=="function"||typeof f.beforeClone=="function"||typeof f.resolveNode=="function"||typeof f.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=rn(t);if(!o||od(i))return null;let s=[];t:for(let f of e.dirtyRoots){if(!f.isConnected||f===t||!t.contains(f))return null;for(let d of e.dirtyRoots)if(d!==f&&d!==t&&d.contains(f))continue t;s.push(f)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let f of s){if(f.parentElement===t||f.matches?.(Ca)||f.querySelector?.(Ca)||rd(f,o))return null;let d=r.srcToClone.get(f);if(!d||!d.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},p=Kn(f,null),g=Un(f),y;try{y=await Jt(f,m,n)}finally{g(),p()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Ie(f,y,m,n),m.__pseudoCSS)||m.__usesPlaceholder&&!r.classPrefixCSS?.includes("[data-sd-ph]"))return null;await En(y,m),Hn(y);try{await $n(y,f,h)}catch{}if(await Promise.all([Vn(y,n),Gn(f,y,r.styleCache,n,h)]),n.compress)try{await or(y,n,h)}catch{}for(let[b,w]of h.entries())vo(b,w,h,r.styleCache);d.replaceWith(y),fd(d,r);for(let[b,w]of h.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[f,d]of r.nodeMap.entries()){if(!d||d.nodeType!==1||!d.isConnected)continue;let h=r.styleMap.get(f);if(!h)continue;let m=cd(h);if(!m)continue;let p=null,g=!1;for(let y in m)if(p||(p=getComputedStyle(d)),!sd(p.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(f))return null;_o.reconciled++,await dt(d,f,a,n)}}let c=Ke(r.styleMap);for(let[f,d]of r.styleMap.entries())ld(f),xo(f,d,c);let u=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([f,d])=>`.${d}{${f}}`).join("");rr(r.clone,n.__compressedAssets);let l=await ir({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:u,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=nr(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}Ct();var Ro=new WeakMap,cr=new WeakMap,Ia=new WeakSet,Eo=new WeakMap,dd=64,dn=new Map,Oa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],pd=["(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 hd(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":pd.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Aa(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function _a(t,e){if(e.disposed||(dn.delete(t),dn.set(t,e),dn.size<=dd))return;let[n,r]=dn.entries().next().value;Da(n,r)}function Da(t,e){e.disposed=!0,dn.delete(t),Ro.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Oa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of To)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Wa(t){if(Ia.has(t))return!1;cr.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let u="";if(c==="img"){r.push(a);try{u=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",f=Eo.get(a);if(u||l){if((!f||f.src!==u||f.style!==l)&&(f={src:u,style:l,animated:ze(u)||ze(l)},Eo.set(a,f)),f.animated)return!1}else f&&Eo.delete(a)}}return cr.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function Fo(t,e){if(!t.querySelectorAll)return!1;let n=cr.get(t);cr.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of To)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of To)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var To=["scroll","change","beforetoggle","toggle"];function lr(t,e){return[t,...e.trackedShadowRoots.keys()]}function Po(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of lr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function Ea(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(ae(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var md=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ue=t=>t&&(typeof t=="object"||typeof t=="function")?ar(t):"-";function gd(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function yd(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=gd(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 Ra(t){let e=String(t||"").trim();return e?md.test(e)?!0:/^data:/i.test(e)?yd(e):!1:!1}function ze(t){let e=String(t||"");if(Ra(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Ra(n[1]??n[2]??n[3]))return!0;return!1}function Fa(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of Ba(i))if(ze(o.getAttribute?.("src"))||ze(o.getAttribute?.("href"))||ze(o.getAttribute?.("style"))||ze(t.styleMap?.get(o)))return!0;return!1}function Ba(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function $o(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of lr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function No(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of lr(t,e))for(let s of Ba(o))i(s);e.scrollNodes=n}function Ta(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",hd(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ue))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Ue))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ue(o)),(s?.contains(t)||t.contains(s))&&i.push(Ue(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let f=String(l.localName||"").toLowerCase();f==="input"?c.push(l.type,Xe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):f==="textarea"?c.push(l.value):f==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let u=[];for(let l of e.images){let f="";try{f=l.currentSrc||l.src||""}catch{}u.push(f,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:u,frameDriven:e.retainedFrameDriven}}function Be(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Pa(t,e){let n=new Set;for(let r of lr(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function $a(t){return t.map(e=>[Ue(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function bd(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function wd(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:_e(),styleEpoch:Wt(),styleStamp:nn(t),outsideMutations:en(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)ae(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of Oa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return Fo(t,e)||$o(t,e),No(t,e),Po(t,e),e}var Sd=0,Na=new WeakMap;function ar(t){let e=Na.get(t);return e||(e="@"+ ++Sd,Na.set(t,e)),e}function Lo(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(ar(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(ar(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Lo(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(ar(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Lo(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function La(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Lo(i,new Set);return o===null?null:`${(e||[]).map(Ue).join(",")}:${o}`}catch{return null}}function Ua(t,e,n,r,i=null){let o=Ro.get(t);o||(o=wd(t),o.baselineSignature=La(e,n.plugins),Ro.set(t,o));let s=La(e,n.plugins),a=async()=>{if(o.disposed)return r();let u=s===null||s!==o.baselineSignature;u&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,u=!1):o.pendingSig=s:o.pendingSig=null,Fo(t,o),Po(t,o);for(let M of o.observers)M.__flush(M.takeRecords());Tt();let l=en(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let f=t.getRootNode?.(),d=[...o.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),Mn(t.ownerDocument||document,d);let h=nn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=Ta(t,o),p=Pa(t,o);m.animation=$a(p),o.renderState&&(!Be(o.renderState,m,"style")&&(Ee(),o.dirtyAll()),Be(o.renderState,m,"scroll")||o.dirtyAll(),Be(o.renderState,m,"controls")||(ce(t),o.dirtyAll()),!Be(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=_e();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let M=Aa(t);o.geometry!==null&&M!==o.geometry&&(ce(t),o.dirtyAll()),o.geometry=M}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Be(o.renderState,m,"animation");try{let M=new Set;w&&p.length===0&&(M=null);for(let _ of p){let E=_.playState==="running";if(!E&&!w)continue;E&&(b=!0),w=!0;let x=_.effect?.target;if(bd(t,o,x)===t)M.add(x);else{M=null;break}}if(w&&M&&M.size&&o.retained){o.dirty=!0;for(let _ of M)o.dirtyRoots&&o.dirtyRoots.add(_),ce(_)}else w&&!M&&o.dirtyAll()}catch{}let v=m.frameDriven,C=b||v;if(C&&(o.last=null),v&&o.dirtyAll(),!u&&!C&&!o.dirty&&o.last)return _a(t,o),o.last;o.capturing=!0;let S=null;try{let M=null,_=!1,E=null;if(!u&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){E=[...o.dirtyRoots];let x=await Ma(t,o,n);x&&(M=await i(x),_=!0)}if(M||(u||(n.__retain=x=>{let k=new Map;for(let[R,T]of x.nodeMap.entries())k.set(T,R);S={...x,srcToClone:k}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let k of x.takeRecords())o.pending.push(k);return Tt(),o.torn||Ea(o.pending)||en(t)!==l},M=await r()),!u&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=Fa(S),$o(t,o),No(t,o)):_&&(o.retainedFrameDriven||(o.retainedFrameDriven=Fa(o.retained,E)),$o(t,o),No(t,o));let x=Ta(t,o);x.animation=$a(Pa(t,o));let k=["style","scroll","controls","images"];b||k.push("animation");let R=k.every(T=>Be(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=nn(t),o.geometry=Aa(t),o.renderState.frameDriven?(Ia.add(t),Da(t,o)):R?!C&&!o.renderState.frameDriven&&(o.last=M,_a(t,o)):(o.dirtyAll(),o.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let _ of o.observers)for(let E of _.takeRecords())o.pending.push(E);Tt();let M=en(t);(o.torn||Ea(o.pending)||M!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=M,o.styleEpoch=Wt(),o.styleStamp=nn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(Fo(t,o),Po(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var fr=null;function ja(t){fr=t}var xd='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Io=!1,pn=null,Oo=new WeakMap,za=!1;function Va(t,e){!Io||!pn||e&&e.burst===!1||Oo.set(pn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function qa(t){let e={control:t};pn=e,setTimeout(()=>{pn===e&&(pn=null)},0)}function Wo(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(xd):null}function Ha(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Wo(t);e&&(qa(e),Do(t,!1))}function vd(t){let e=Wo(t);e&&qa(e)}function Do(t,e=!0){if(!fr||document.visibilityState==="hidden")return;let n=Wo(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Oo.get(n);if(r){if(!r.element.isConnected){Oo.delete(n);return}fr(r.element,r.options).catch(()=>{});return}e&&!za&&(za=!0,fr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ga(){if(Io||typeof document>"u"||typeof document.addEventListener!="function")return;Io=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ha,t),document.addEventListener("keydown",Ha,t),document.addEventListener("click",vd,t),document.addEventListener("pointerenter",Do,t),document.addEventListener("focusin",Do,t)}kt();function Ud(...t){return ca(...t),K}async function zd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await yt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Qo(i,{...e||{},burst:!1})}finally{n.remove()}}var Hd="3.3.1-dev.0",K=Object.assign(Qo,{plugins:Ud,fromString:zd,version:Hd,preCapture:Ga});ja(Qo);var Ko=Symbol("snapdom.internal"),jd=Symbol("snapdom.internal.silent"),sc=new Set(["png","jpeg","jpg","webp","svg"]);async function Qo(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=va(e);n.element=t,n.invalidate&&Ee(),fa(n,e&&e.plugins);let{stage:r,loweredBy:i}=sa(n);n.needs=r,n.__needsLoweredBy=i;let o=We(r,"render"),s=n.burst===!0||!Zn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Wa(t);return u&&Va(t,e),n.snap||(n.snap={toPng:(l,f)=>K.toPng(l,f),toSvg:(l,f)=>K.toSvg(l,f)}),u?Ua(t,e,n,()=>K.capture(t,n,Ko),l=>ac(l,n)):K.capture(t,n,Ko)}K.capture=async(t,e,n)=>{if(n!==Ko)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(We(e.needs||_t,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=On(t);e.clip||(e.__fontUsage=a);let c=a.required,u=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(u=new Set([...u].filter(l=>s.has(l.toLowerCase()))),u.size===0))throw null;await Dn(u,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(an(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){H(e,"Couldn't prepare canvases for Safari.",s)}}let r=await xa(t,e);return ac(r,e)};async function ac(t,e){let n=e.needs||_t,r=We(n,"render"),i=A=>aa(n,e.__needsLoweredBy||[],A),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??(s=o.toDataURL()),c=o||t;o&&(t="");let u=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),p=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,g=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=A=>{if(o||!u?.size)return c;let N=d.vbW,$=d.vbH,F=A.crop;F&&(N=Math.max(1,Math.min(N,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let z=Number.isFinite(A.width),q=Number.isFinite(A.height);return(z&&q?Math.max(A.width/N,A.height/$):z?A.width/N*(F?Math.max(1,g/p):1):q?A.height/$*(F?Math.max(1,p/g):1):(A.scale||1)*Math.max(p,g))*(A.dpr||1)<=l?c:f??(f=ya(a(),u))},b=async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn));return $(c,{...A,...N||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let A=t.indexOf(",");return A>=0?decodeURIComponent(t.slice(A+1)):""},v=A=>Object.defineProperty({...A||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),C={img:async(A,N)=>{if(o)return b(A,N);let{toImg:$}=await Promise.resolve().then(()=>(qo(),Vo)),F={...A,...N||{}};return $(y(F),F)},svg:async(A,N)=>{if(o)return b(A,N);let{toSvg:$}=await Promise.resolve().then(()=>(qo(),Vo)),F={...A,...N||{}};return $(y(F),F)},canvas:async(A,N)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(me(),Ja)),F={...A,...N||{}};return $(y(F),F)},blob:async(A,N)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Yo(),nc)),F={...A,...N||{}};return $(y(F),F)},png:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn)),F={...A,...N||{},format:"png"};return $(y(F),F)},jpeg:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn)),F={...A,...N||{},format:"jpeg"};return $(y(F),F)},webp:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(He(),mn)),F={...A,...N||{},format:"webp"};return $(y(F),F)},download:async(A,N)=>{let{download:$}=await Promise.resolve().then(()=>(ic(),oc)),F={...A,...N||{}};return $(y(F),F)}};if(!r)for(let A of Object.keys(C)){let N=A==="download"?"download()":`to${A.charAt(0).toUpperCase()}${A.slice(1)}()`;C[A]=async()=>{throw i(N)}}let S={};for(let A of["img","svg","canvas","blob","png","jpeg","webp"])S[A]=async N=>C[A](e,{...R(A,N||{}),[jd]:!0});S.jpg=S.jpeg;let M=A=>Object.defineProperty({...e,...A},"options",{value:e,configurable:!0}),_=M({artifacts:e.__artifacts||null,export:v(),exports:S}),E=await Jn("defineExports",_),x=Object.assign({},...E.filter(A=>A&&typeof A=="object").reverse()),k={...C,...x};k.jpeg&&!k.jpg&&(k.jpg=(A,N)=>k.jpeg(A,N));function R(A,N){let $=N||{},F={...e,...$},z=typeof $.type=="string"?$.type.toLowerCase():"",q=typeof $.format=="string"?$.format.toLowerCase():sc.has(z)?z:"";q&&(F.format=q==="jpg"?"jpeg":q),F.__explicitFormat=q?F.format:e.__explicitFormat??null,A==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let j=B=>B==="jpeg"||B==="jpg"||B==="webp";return[A,F.format,z].map(B=>typeof B=="string"?B.toLowerCase():"").find(j)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&H(F,"scale ignored: width/height already set the size."),F}let T=!1,L=Promise.resolve();async function W(A,N){let $=Object.freeze(N&&typeof N=="object"?{...N}:{}),F=async()=>{let q=k[A];if(!q)throw new Error(`[SnapDOM] Unknown export type: ${A}`);let j=R(A,$),J=M({artifacts:e.__artifacts||null,export:v({type:A,options:j,requestedOptions:$})}),B=j.format,ut=j.type;await Jn("beforeExport",J,{format:A,options:j});let xt=j.format!==B?j.format:j.type!==ut?j.type:"",at=typeof xt=="string"?xt.toLowerCase():"";sc.has(at)&&(j.format=at==="jpg"?"jpeg":at,j.type=j.format,j.__explicitFormat=j.format,/^(?:jpeg|webp)$/.test(j.format)&&(j.backgroundColor==null||j.backgroundColor==="transparent")&&(j.backgroundColor="#ffffff"));let st=await q(J,j);return await Jn("afterExport",J,{format:A,options:j,result:st}),T||(T=!0,await Bt("afterSnap",e)),st},z=L.then(F);return L=z.catch(()=>{}),z}let P={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(A,N)=>W(A,N),toImg:A=>W("img",A),toSvg:A=>W("svg",A),toCanvas:A=>W("canvas",A),toBlob:A=>W("blob",A),toPng:A=>W("png",A),toJpg:A=>W("jpg",A),toWebp:A=>W("webp",A),download:A=>W("download",A)};r?o&&Object.defineProperty(P,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(P,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(P,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let A of Object.keys(k)){let N="to"+A.charAt(0).toUpperCase()+A.slice(1);P[N]||(P[N]=$=>W(A,$))}return P}K.toRaw=(t,e)=>K(t,e).then(n=>n.toRaw());K.toImg=(t,e)=>K(t,e).then(n=>n.toImg());K.toSvg=(t,e)=>K(t,e).then(n=>n.toSvg());K.toCanvas=(t,e)=>K(t,e).then(n=>n.toCanvas());K.toBlob=(t,e)=>K(t,e).then(n=>n.toBlob());K.toPng=(t,e)=>K(t,{...e,format:"png"}).then(n=>n.toPng());K.toJpg=(t,e)=>K(t,{...e,format:"jpeg"}).then(n=>n.toJpg());K.toWebp=(t,e)=>K(t,{...e,format:"webp"}).then(n=>n.toWebp());K.download=(t,e)=>K(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=K);})();
|