@mindstudio-ai/browser-agent 0.1.10 → 0.1.11

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  `:""}function Sa(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}async function Ea(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Ca(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let l=getComputedStyle(e);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,i=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),c=Math.max(0,Math.round(t.height-(i+o)));return{contentWidth:a,contentHeight:c,rect:t}}function se(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(t=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(t===0||n===0)try{if(t===0){let r=parseFloat(e.getAttribute("width"));!isNaN(r)&&r>0&&(t=r)}if(n===0){let r=parseFloat(e.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}function ka(e,t,n){let r=e.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(r),()=>{try{r.remove()}catch{}}}async function Ma(e,t,n){let r=await Ea(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=Ca(e),c=n?.snap;if(!c&&typeof window<"u"&&window.snapdom&&(c=window.snapdom),!c||typeof c.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l={...n,scale:1},s=ka(r,i,o),u;try{u=await c.toPng(r.documentElement,l)}finally{s()}u.style.display="block",u.style.width=`${i}px`,u.style.height=`${o}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),Re(e,d,t,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}function Aa(e){let{width:t,height:n}=se(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let o=i?parseFloat(i.width):NaN,a=i?parseFloat(i.height):NaN,c=Math.round(t||r.width||0),l=Math.round(n||r.height||0),s=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,c||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),d=(e.type||"text").toLowerCase()==="checkbox",f=!!e.checked,h=!!e.indeterminate,g=Math.max(Math.min(s,u),12),p=document.createElement("div");p.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),p.style.cssText=`display:inline-block;width:${g}px;height:${g}px;vertical-align:middle;flex-shrink:0;line-height:0;`;let m=document.createElementNS("http://www.w3.org/2000/svg","svg");m.setAttribute("width",String(g)),m.setAttribute("height",String(g)),m.setAttribute("viewBox",`0 0 ${g} ${g}`),p.appendChild(m);function y(){let x="#0a6ed1";try{i&&(x=i.accentColor||i.color||x)}catch{}let b=2,w=b/2,C=g-b;if(m.innerHTML="",d){let S=document.createElementNS("http://www.w3.org/2000/svg","rect");if(S.setAttribute("x",String(w)),S.setAttribute("y",String(w)),S.setAttribute("width",String(C)),S.setAttribute("height",String(C)),S.setAttribute("rx","2"),S.setAttribute("ry","2"),S.setAttribute("fill",f?x:"none"),S.setAttribute("stroke",x),S.setAttribute("stroke-width",String(b)),m.appendChild(S),f){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",`M ${w+2} ${g/2} L ${g/2-1} ${g-w-2} L ${g-w-2} ${w+2}`),v.setAttribute("stroke","white"),v.setAttribute("stroke-width",String(Math.max(1.5,b))),v.setAttribute("fill","none"),v.setAttribute("stroke-linecap","round"),v.setAttribute("stroke-linejoin","round"),m.appendChild(v)}else if(h){let v=document.createElementNS("http://www.w3.org/2000/svg","rect"),M=Math.max(6,C-4);v.setAttribute("x",String((g-M)/2)),v.setAttribute("y",String((g-b)/2)),v.setAttribute("width",String(M)),v.setAttribute("height",String(b)),v.setAttribute("fill",x),v.setAttribute("rx","1"),m.appendChild(v)}}else{let S=document.createElementNS("http://www.w3.org/2000/svg","circle");if(S.setAttribute("cx",String(g/2)),S.setAttribute("cy",String(g/2)),S.setAttribute("r",String((g-b)/2)),S.setAttribute("fill",f?x:"none"),S.setAttribute("stroke",x),S.setAttribute("stroke-width",String(b)),m.appendChild(S),f){let v=document.createElementNS("http://www.w3.org/2000/svg","circle"),M=Math.max(2,(g-b*2)*.35);v.setAttribute("cx",String(g/2)),v.setAttribute("cy",String(g/2)),v.setAttribute("r",String(M)),v.setAttribute("fill","white"),m.appendChild(v)}}p.style.setProperty("width",`${g}px`,"important"),p.style.setProperty("height",`${g}px`,"important"),p.style.setProperty("min-width",`${g}px`,"important"),p.style.setProperty("min-height",`${g}px`,"important")}return y(),{el:p,applyVisual:y}}var ze=new Q(80);async function Ye(e){if(E.resource?.has(e))return E.resource.get(e);if(ze.has(e))return ze.get(e);let t=(async()=>{let n=await te(e,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return E.resource?.set(e,n.data),n.data})();ze.set(e,t);try{let n=await t;return ze.set(e,n),n}catch(n){throw ze.delete(e),n}}var $a=/\bblob:[^)"'\s]+/g;async function ir(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match($a)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let i=await Ye(r);n=n.split(r).join(i)}catch{}return n}function dt(e){return typeof e=="string"&&e.startsWith("blob:")}function La(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let n=t.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Ta(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function Na(e,t=null){if(!e)return;let n=t,r=e.querySelectorAll?e.querySelectorAll("img"):[];for(let l of r)try{let s=l.getAttribute("src")||l.currentSrc||"";if(dt(s)){let d=await Ye(s);l.setAttribute("src",d)}let u=l.getAttribute("srcset");if(u&&u.includes("blob:")){let d=La(u),f=!1;for(let h of d)if(dt(h.url))try{h.url=await Ye(h.url),f=!0}catch(g){F(n,"blobUrlToDataUrl for srcset item failed",g)}f&&l.setAttribute("srcset",Ta(d))}}catch(s){F(n,"resolveBlobUrls for img failed",s)}let i=e.querySelectorAll?e.querySelectorAll("image"):[];for(let l of i)try{let s="http://www.w3.org/1999/xlink",u=l.getAttribute("href")||l.getAttributeNS?.(s,"href");if(dt(u)){let d=await Ye(u);l.setAttribute("href",d),l.removeAttributeNS?.(s,"href")}}catch(s){F(n,"resolveBlobUrls for SVG image href failed",s)}let o=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let l of o)try{let s=l.getAttribute("style");if(s&&s.includes("blob:")){let u=await ir(s);l.setAttribute("style",u)}}catch(s){F(n,"replaceBlobUrls in inline style failed",s)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let l of a)try{let s=l.textContent||"";s.includes("blob:")&&(l.textContent=await ir(s))}catch(s){F(n,"replaceBlobUrls in style tag failed",s)}let c=["poster"];for(let l of c){let s=e.querySelectorAll?e.querySelectorAll(`[${l}^='blob:']`):[];for(let u of s)try{let d=u.getAttribute(l);dt(d)&&u.setAttribute(l,await Ye(d))}catch(d){F(n,`resolveBlobUrls for ${l} failed`,d)}}}Je();async function ht(e,t,n){if(!e)throw new Error("Invalid node");let r=new Set,i=null,o=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||vr.has(u))return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=se(e),h=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${h}px;height:${g}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let u of n.exclude)try{if(e.matches?.(u)){if(n.excludeMode==="hide"){let d=document.createElement("div"),{width:f,height:h}=se(e),g=f||e.getBoundingClientRect().width||0,p=h||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${g}px;height:${p}px;visibility:hidden;`,d}else if(n.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${u}`,d)}if(typeof n.filter=="function")try{if(!n.filter(e)){if(n.filterMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=se(e),h=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${h}px;height:${g}px;visibility:hidden;`,u}else if(n.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(e.tagName==="IFRAME"){let u=!1;try{u=!!(e.contentDocument||e.contentWindow?.document)}catch(d){F(t,"iframe same-origin probe failed",d)}if(u)try{return await Ma(e,t,n)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(n.placeholders){let{width:d,height:f}=se(e),h=document.createElement("div");return h.style.cssText=`width:${d}px;height:${f}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;`,Re(e,h,t,n),h}else{let{width:d,height:f}=se(e),h=document.createElement("div");return h.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,Re(e,h,t,n),h}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Re(e,u,t,n);let d=document.createElement("div");return d.textContent=e.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(d),u}if(e.tagName==="CANVAS"){let u="";try{let g=e.getContext("2d",{willReadFrequently:!0});try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),u=e.toDataURL("image/png"),!u||u==="data:,"){let p=document.createElement("canvas");p.width=e.width,p.height=e.height;let m=p.getContext("2d");m&&(m.drawImage(e,0,0),u=p.toDataURL("image/png"))}}}catch(g){F(t,"Canvas toDataURL failed, using empty/fallback",g)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(g){F(t,"img decoding/loading hints failed",g)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:h}=se(e);return f>0&&(d.style.width=`${f}px`),h>0&&(d.style.height=`${h}px`),t.nodeMap.set(d,e),Re(e,d,t,n),d}let a;try{if(a=e.cloneNode(!1),da(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){wa(e,a);try{let{width:u,height:d}=se(e),f=Math.round(u||0),h=Math.round(d||0);f&&(a.dataset.snapdomWidth=String(f)),h&&(a.dataset.snapdomHeight=String(h))}catch(u){F(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=y=>{let x=u.match(new RegExp(`${y}\\s*:\\s*([^;]+)`,"i")),b=x?x[1].trim():d.getPropertyValue(y);return/%|auto/i.test(String(b||""))},h=parseInt(a.dataset.snapdomWidth||"0",10),g=parseInt(a.dataset.snapdomHeight||"0",10),p=f("width")||!h,m=f("height")||!g;p&&h&&(a.style.width=`${h}px`),m&&g&&(a.style.height=`${g}px`),h&&(a.style.minWidth=`${h}px`),g&&(a.style.minHeight=`${g}px`)}catch(u){F(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let c=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:d}=se(e),f=u||e.getBoundingClientRect().width||0,h=d||e.getBoundingClientRect().height||0;f&&(a.style.width=`${f}px`),h&&(a.style.height=`${h}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&Ui()){let{el:d,applyVisual:f}=Aa(e);t.nodeMap.set(d,e),c=f,a=d}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if(e instanceof HTMLSelectElement&&(i=e.value),e instanceof HTMLTextAreaElement&&(o=e.value),Re(e,a,t,n),c&&c(),e.shadowRoot){let u=function(b,w){if(b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE")return w(null);ht(b,t,n).then(C=>{w(C||null)}).catch(()=>{w(null)})};try{let b=e.shadowRoot.querySelectorAll("slot");for(let w of b){let C=[];try{C=w.assignedNodes?.({flatten:!0})||w.assignedNodes?.()||[]}catch{C=w.assignedNodes?.()||[]}for(let S of C)r.add(S)}}catch{}let d=ha(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let h=ga(e.shadowRoot),g=pa(h,f),p=ba(h),m=va(e,p,f);ya(a,m+g,d);let y=document.createDocumentFragment(),x=await Xt(Array.from(e.shadowRoot.childNodes),u,n.fast);y.append(...x.filter(b=>!!b)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(p,m){ht(p,t,n).then(y=>{y&&Sa(y),m(y||null)}).catch(()=>{m(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),h=document.createDocumentFragment(),g=await Xt(Array.from(f),u,n.fast);return h.append(...g.filter(p=>!!p)),h}function l(u,d){if(r.has(u))return d(null);ht(u,t,n).then(f=>{d(f||null)}).catch(()=>{d(null)})}let s=await Xt(Array.from(e.childNodes),l,n.fast);if(a.append(...s.filter(u=>!!u)),i!==null&&a instanceof HTMLSelectElement){a.value=i;for(let u of a.options)u.value===i?u.setAttribute("selected",""):u.removeAttribute("selected")}return o!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=o),a}re();xt();ne();var Ra=[/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],Le=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__||{}),tn=[];function Pa(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?tn.push(n):typeof n=="string"?tn.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function ce(e){let t=typeof e=="string"?e:"",n=[...Ra,...tn];for(let r of n)if(r instanceof RegExp&&r.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function _a(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var ar=new Map;function Fa(e=""){let t=Object.create(null),n=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function Da(e,t,n){let r=String(e||""),i=r.toLowerCase(),o=String(t||"").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 l=a===1,s=null;if(l&&(c==="outlined"&&Le.materialIconsFilled?s={url:Le.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Le.materialIconsRound?s={url:Le.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Le.materialIconsSharp&&(s={url:Le.materialIconsSharp,alias:"snapdom-mi-sharp"})),!s)return{familyForMeasure:r,familyForCanvas:r};if(!ar.has(s.alias))try{let d=new FontFace(s.alias,`url(${s.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),ar.set(s.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${s.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function Ia(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Oa(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!=="currentcolor")return t;let r=e.color?.trim();return r&&r!=="inherit"?r:"#000"}async function Wa(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:a=""}={}){let c=String(t||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,s=Fa(o),{familyForMeasure:u,familyForCanvas:d}=await Da(c,a,s);await Ia(d.replace(/^["']+|["']+$/g,""),r);let f=document.createElement("span");f.textContent=e,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=u,f.style.fontWeight=String(n||"normal"),f.style.fontSize=`${r}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=i,document.body.appendChild(f);let h=f.getBoundingClientRect(),g=Math.max(1,Math.ceil(h.width)),p=Math.max(1,Math.ceil(h.height));document.body.removeChild(f);let m=document.createElement("canvas");m.width=g*l,m.height=p*l;let y=m.getContext("2d");y.scale(l,l),y.font=`${n?`${n} `:""}${r}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:m.toDataURL(),width:g,height:p}}async function Ha(e,t){if(!(e instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let i=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],o=0;for(let a=0;a<r.length;a++){let c=r[a],l=i[a]||null;try{let s=getComputedStyle(l||c),u=s.fontFamily||"Material Icons";if(!_a(u))continue;let d=(l||c).textContent.trim();if(!d)continue;let f=parseInt(s.fontSize,10)||24,h=s.fontWeight&&s.fontWeight!=="normal"?s.fontWeight:"normal",g=Oa(s),p=s.fontVariationSettings&&s.fontVariationSettings!=="normal"?s.fontVariationSettings:"",m=(l||c).className||"",{dataUrl:y,width:x,height:b}=await Wa(d,{family:u,weight:h,fontSize:f,color:g,variation:p,className:m});c.textContent="";let w=c.ownerDocument.createElement("img");w.src=y,w.alt=d,w.style.height=`${f}px`,w.style.width=`${Math.max(1,Math.round(x/b*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(w),o++}catch{}}return o}_e();async function Ba(e,t,n,r=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=n||"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(),l=Math.ceil(c.width),s=Math.ceil(c.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,l*o),u.height=Math.max(1,s*o);let d=u.getContext("2d");return d.scale(o,o),d.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:l,height:s}}var Ua=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),qa=["katex","mathjax","mathml"];function Et(e){if(!e)return"";for(let t of e.split(",")){let n=t.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Ua.has(n.toLowerCase()))return n}return""}function gt(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function yt(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function ja(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function za(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=gt(n[1]),o=gt(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=gt(t);return{min:r,max:r}}function Va(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Xa(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Ya(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Ga(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=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(a=>i.endsWith(a))||n.some(a=>i===a.toLowerCase()||i.endsWith("."+a.toLowerCase())))return!0;let o=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||qa.some(a=>o.includes(a)))return!0;for(let a of t){let c=a.toLowerCase().replace(/\s+/g,"+"),l=a.toLowerCase().replace(/\s+/g,"-"),s=Ya(a);if(o.includes(c)||o.includes(l)||s&&o.includes(s))return!0}return!1}catch{return!1}}function Ka(e){let t=new Set;for(let n of e||[]){let r=String(n).split("__")[0]?.trim();r&&t.add(r)}return t}function lr(e,t){return e&&e.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 a=o;try{a=new URL(o,t||location.href).href}catch{}return`url("${a}")`})}var nn=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,bt=4;async function Ja(e,t,n){if(!e)return e;let r=new Set;function i(c,l){try{return new URL(c,l||location.href).href}catch{return c}}async function o(c,l,s=0){if(s>bt)return console.warn(`[snapDOM] @import depth exceeded (${bt}) at ${l}`),c;let u="",d=0,f;for(;f=nn.exec(c);){u+=c.slice(d,f.index),d=nn.lastIndex;let h=(f[2]||f[4]||"").trim(),g=i(h,l);if(r.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}r.add(g);let p="";try{let m=await te(g,{as:"text",useProxy:n,silent:!0});m.ok&&typeof m.data=="string"&&(p=m.data)}catch{}p?(p=lr(p,g),p=await o(p,g,s+1),u+=`
7
7
  /* inlined: ${g} */
8
8
  ${p}
9
- `):u+=f[0]}return u+=c.slice(d),u}let a=lr(e,t||location.href);return a=await o(a,t||location.href,0),a}var Fr=/url\((["']?)([^"')]+)\1\)/g,Za=/@font-face[^{}]*\{[^}]*\}/g;function Dr(e){if(!e)return[];let t=[],n=e.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],a=i[2],c=l=>{if(!l.includes("?"))return parseInt(l,16);let s=parseInt(l.replace(/\?/g,"0"),16),u=parseInt(l.replace(/\?/g,"F"),16);return[s,u]};if(a){let l=c(o),s=c(a),u=Array.isArray(l)?l[0]:l,d=Array.isArray(s)?s[1]:s;t.push([Math.min(u,d),Math.max(u,d)])}else{let l=c(o);Array.isArray(l)?t.push([l[0],l[1]]):t.push([l,l])}}return t}function Ir(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,i]of t)if(n>=r&&n<=i)return!0;return!1}function fn(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Fr)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}n.push(i)}}return n}async function Or(e,t,n=""){let r=e;for(let i of e.matchAll(Fr)){let o=cn(i[0]);if(!o)continue;let a=o;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!ce(a)){if(E.resource?.has(a)){E.font?.add(a),r=r.replace(i[0],`url(${E.resource.get(a)})`);continue}if(!E.font?.has(a))try{let c=await te(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let l=c.data;E.resource?.set(a,l),E.font?.add(a),r=r.replace(i[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function Qa(e){if(!e.length)return null;let t=(a,c)=>e.some(([l,s])=>!(s<a||l>c)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),o=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function sr(e={}){let t=new Set((e.families||[]).map(i=>String(i).toLowerCase())),n=new Set((e.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((e.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(n.size)for(let a of i.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=Qa(o);if(a&&r.has(a))return!0}return!1}}function el(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of e.match(t)||[]){let a=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",c=Et(a),l=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),s=(o.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(o.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),h=fn(f,location.href),g=h.length?h.map(m=>String(m).toLowerCase()).sort().join("|"):f.toLowerCase(),p=[String(c||"").toLowerCase(),l,s,u,d.toLowerCase(),g].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||"")}function tl(e,t,n,r,i){let o=Array.from(e||[]).sort().join("|"),a=t?JSON.stringify({families:(t.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(t.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(t.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",c=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),l=r||"",s=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${c}::px=${l}::fd=${s}`}async function Wr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?o(a.href,t):t;if(r.depth>=bt){console.warn(`[snapDOM] CSSOM import depth exceeded (${bt}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let l={...r,depth:(r.depth||0)+1};await Wr(a.styleSheet,c,n,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),l=Et(c);if(!l||ce(l))continue;let s=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),f=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,u,s,d))continue;let g=Dr(h);if(!Ir(r.usedCodepoints,g))continue;let p={family:l,weightSpec:s,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:f,srcUrls:fn(f,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(p,g))continue;if(/url\(/i.test(f)){let m=await Or(f,t||location.href,r.useProxy);await n(`@font-face{font-family:${l};src:${m};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}else await n(`@font-face{font-family:${l};src:${f};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}}}async function nl({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let m of e){let[y,x,b,w]=String(m).split("__");if(!y)continue;let C=a.get(y)||[];C.push({w:parseInt(x,10),s:b,st:parseInt(w,10)}),a.set(y,C)}function c(m,y,x,b){if(!a.has(m))return!1;let w=a.get(m),C=za(x),S=Va(y),v=Xa(b),M=C.min!==C.max,_=C.min,B=$=>S.kind==="normal"&&$==="normal"||S.kind!=="normal"&&($==="italic"||$==="oblique"),I=!1;for(let $ of w){let A=M?$.w>=C.min&&$.w<=C.max:$.w===_,j=B(yt($.s)),ee=$.st>=v.min&&$.st<=v.max;if(A&&j&&ee){I=!0;break}}if(I)return!0;if(!M)for(let $ of w){let A=B(yt($.s)),j=$.st>=v.min&&$.st<=v.max;if(Math.abs(_-$.w)<=300&&A&&j)return!0}if(!M&&S.kind==="normal"&&w.some($=>yt($.s)!=="normal"))for(let $ of w){let A=Math.abs(_-$.w)<=300,j=$.st>=v.min&&$.st<=v.max;if(A&&j)return!0}return!1}let l=sr(n),s=tl(e,n,r,i,o);if(E.resource?.has(s))return E.resource.get(s);let u=Ka(e),d=[],f=nn;for(let m of document.querySelectorAll("style")){let y=m.textContent||"";for(let x of y.matchAll(f)){let b=(x[2]||x[4]||"").trim();!b||ce(b)||document.querySelector(`link[rel="stylesheet"][href="${b}"]`)||d.push(b)}}d.length&&await Promise.all(d.map(m=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${m}"]`))return y(null);let x=document.createElement("link");x.rel="stylesheet",x.href=m,x.setAttribute("data-snapdom","injected-import"),x.onload=()=>y(x),x.onerror=()=>y(null),document.head.appendChild(x)})));let h="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(m=>!!m.href);for(let m of g)try{if(ce(m.href))continue;let y="",x=!1;try{x=new URL(m.href,location.href).origin===location.origin}catch{}if(!x){let w=Array.isArray(o)?o:[];if(!Ga(m.href,u,w))continue}if(x){let w=Array.from(document.styleSheets).find(C=>C.href===m.href);if(w)try{let C=w.cssRules||[];y=Array.from(C).map(S=>S.cssText).join("")}catch{}}if(!y){let w=await te(m.href,{as:"text",useProxy:i});if(w?.ok&&typeof w.data=="string"&&(y=w.data),ce(m.href))continue}y=await Ja(y,m.href,i);let b="";for(let w of y.match(Za)||[]){let C=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),S=Et(C);if(!S||ce(S))continue;let v=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),M=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),_=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),B=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),I=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),$=fn(I,m.href);if(!c(S,M,v,_))continue;let A=Dr(B);if(!Ir(t,A))continue;let j={family:S,weightSpec:v,styleSpec:M,stretchSpec:_,unicodeRange:B,srcRaw:I,srcUrls:$,href:m.href};if(n&&l(j,A))continue;let ee=/url\(/i.test(I)?await Or(w,m.href,i):w;b+=ee}b.trim()&&(h+=b)}catch{console.warn("[snapDOM] Failed to process stylesheet:",m.href)}let p={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:c,simpleExcluder:n?sr(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let m of document.styleSheets)if(!(m.href&&g.some(y=>y.href===m.href)))try{let y=m.href||location.origin+"/";y&&p.visitedSheets.add(y),await Wr(m,y,async x=>{h+=x},p)}catch{}try{for(let m of document.fonts||[]){if(!m||!m.family||m.status!=="loaded"||!m._snapdomSrc)continue;let y=String(m.family).replace(/^['"]+|['"]+$/g,"");if(ce(y)||!a.has(y)||n?.families&&n.families.some(b=>String(b).toLowerCase()===y.toLowerCase()))continue;let x=m._snapdomSrc;if(!String(x).startsWith("data:")){if(E.resource?.has(m._snapdomSrc))x=E.resource.get(m._snapdomSrc),E.font?.add(m._snapdomSrc);else if(!E.font?.has(m._snapdomSrc))try{let b=await te(m._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(b.ok&&typeof b.data=="string")x=b.data,E.resource?.set(m._snapdomSrc,x),E.font?.add(m._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",m._snapdomSrc);continue}}h+=`@font-face{font-family:'${y}';src:url(${x});font-style:${m.style||"normal"};font-weight:${m.weight||"normal"};}`}}catch{}for(let m of r){if(!m||typeof m!="object")continue;let y=String(m.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||ce(y)||!a.has(y)||n?.families&&n.families.some(v=>String(v).toLowerCase()===y.toLowerCase()))continue;let x=m.weight!=null?String(m.weight):"normal",b=m.style!=null?String(m.style):"normal",w=m.stretchPct!=null?`${m.stretchPct}%`:"100%",C=String(m.src||""),S=C;if(!S.startsWith("data:")){if(E.resource?.has(C))S=E.resource.get(C),E.font?.add(C);else if(!E.font?.has(C))try{let v=await te(C,{as:"dataURL",useProxy:i,silent:!0});if(v.ok&&typeof v.data=="string")S=v.data,E.resource?.set(C,S),E.font?.add(C);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",C);continue}}h+=`@font-face{font-family:'${y}';src:url(${S});font-style:${b};font-weight:${x};font-stretch:${w};}`}return h&&(h=el(h),E.resource?.set(s,h)),h}function Hr(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let c=Et(a.fontFamily);if(!c)return;let l=(s,u,d)=>`${c}__${gt(s)}__${yt(u)}__${ja(d)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))};r(getComputedStyle(e));let i=getComputedStyle(e,"::before");i&&i.content&&i.content!=="none"&&r(i);let o=getComputedStyle(e,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let a=n.currentNode,c=getComputedStyle(a);r(c);let l=getComputedStyle(a,"::before");l&&l.content&&l.content!=="none"&&r(l);let s=getComputedStyle(a,"::after");s&&s.content&&s.content!=="none"&&r(s)}return t}function rl(e){let t=new Set,n=i=>{if(i)for(let o of i)t.add(o.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let i=r.currentNode;if(i.nodeType===Node.TEXT_NODE)n(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let o=i;for(let a of["::before","::after"]){let c=getComputedStyle(o,a)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let l=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(l)for(let s of l)try{t.add(parseInt(s.slice(1),16))}catch{}}}}}return t}async function Br(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let i=document.createElement("div");i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let o of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${o}"`,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",i.appendChild(a)}document.body.appendChild(i),i.offsetWidth,document.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)r(),await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))}ne();function ol(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function il(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function cr(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function ur(e,t=!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,e)),i="";for(let[o,a]of n)for(;r>=o;)i+=a,r-=o;return t?i:i.toLowerCase()}function dr(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,e));case"decimal-leading-zero":return(e<10?"0":"")+String(Math.max(0,e));case"lower-alpha":return cr(e,!1);case"upper-alpha":return cr(e,!0);case"lower-roman":return ur(e,!1);case"upper-roman":return ur(e,!0);default:return String(Math.max(0,e))}}function al(e){let t=()=>E?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,o=f=>f&&f.tagName==="LI",a=f=>{let h=0,g=f?.parentElement;if(!g)return 0;for(let p of g.children){if(p===f)break;p.tagName==="LI"&&h++}return h},c=f=>{let h=new Map;for(let[g,p]of f)h.set(g,p.slice());return h},l=(f,h,g)=>{let p=c(f),m;try{m=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(m&&m!=="none")for(let x of m.split(",")){let b=x.trim().split(/\s+/),w=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!w)continue;let S=h.get(w);if(S&&S.length){let v=S.slice();v.push(C),p.set(w,v)}else p.set(w,[C])}let y;try{y=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(y&&y!=="none")for(let x of y.split(",")){let b=x.trim().split(/\s+/),w=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!w)continue;let S=p.get(w)||[];S.length===0&&S.push(0),S[S.length-1]+=C,p.set(w,S)}try{if(getComputedStyle(g).display==="list-item"&&o(g)){let x=g.parentElement,b=1;if(x&&x.tagName==="OL"){let C=x.getAttribute("start"),S=Number.isFinite(Number(C))?Number(C):1,v=a(g),M=g.getAttribute("value");b=Number.isFinite(Number(M))?Number(M):S+v}else b=1+a(g);let w=p.get("list-item")||[];w.length===0&&w.push(0),w[w.length-1]=b,p.set("list-item",w)}}catch{}return p},s=(f,h,g)=>{let p=l(g,h,f);r.set(f,p);let m=p;for(let y of f.children)m=s(y,p,m);return p},u=new Map;s(i,u,u);function d(){let f=t();if(f!==n){n=f;let h=new Map;s(i,h,h)}}return{get(f,h){d();let g=r.get(f)?.get(h);return g&&g.length?g[g.length-1]:0},getStack(f,h){d();let g=r.get(f)?.get(h);return g?g.slice():[]}}}function ll(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,i=e.replace(r,(o,a,c)=>{let l=String(c).split(",").map(s=>s.trim());if(a==="counter"){let s=l[0]?.replace(/^["']|["']$/g,""),u=(l[1]||"decimal").toLowerCase(),d=n.get(t,s);return dr(d,u)}else{let s=l[0]?.replace(/^["']|["']$/g,""),u=l[1]?.replace(/^["']|["']$/g,"")??"",d=(l[2]||"decimal").toLowerCase(),f=n.getStack(t,s);return f.length?f.map(h=>dr(h,d)).join(u):""}});return il(i)}catch{return"- "}}_e();ne();var Te=new WeakMap,fr=300;function sl(e,t){let n=Ur(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=pr(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):pr(e)}function rn(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Ur(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let o=0;o<t.length;o++){let a=t[o];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let l=a.sheet,s=l?rn(l):null;s&&(r+=s.length)}else{let c=a.getAttribute("href")||"",l=a.getAttribute("media")||"all";n+=`L${c}|m:${l}|`;let s=a.sheet,u=s?rn(s):null;u&&(r+=u.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function mr(e,t,n){let r=rn(e);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],a=o&&o.cssText?o.cssText:"";n.budget--;for(let c of t)if(a.includes(c))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let c=0;c<o.cssRules.length&&n.budget>0;c++){let l=o.cssRules[c],s=l&&l.cssText?l.cssText:"";n.budget--;for(let u of t)if(s.includes(u))return!0}if(n.budget<=0)return!1}return!1}function pr(e=document){let t=Ur(e),n=Te.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],i=e.querySelectorAll("style");for(let a=0;a<i.length;a++){let c=i[a].textContent||"";for(let l of r)if(c.includes(l))return Te.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:fr};try{for(let c of o)if(mr(c,r,a))return Te.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:fr};for(let l=0;l<a.length&&c.budget>0;l++){let s=a[l],u=null;if(s.tagName,u=s.sheet||null,u&&mr(u,r,c))return Te.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Te.set(e,{fingerprint:t,result:!0}),!0):(Te.set(e,{fingerprint:t,result:!1}),!1)}var Pe=new WeakMap,hr=-1;function cl(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function ul(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):cl(e)}function on(e,t){let n=e.parentElement,r=n?Pe.get(n):null;return r?{get(i,o){let a=t.get(i,o),c=r.get(o);return typeof c=="number"?Math.max(a,c):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let c=r.get(o);if(typeof c=="number"){let l=a.slice();return l[l.length-1]=Math.max(l[l.length-1],c),l}return a}}:t}function an(e,t,n){let r=new Map;function i(l){let s=[];if(!l||l==="none")return s;for(let u of String(l).split(",")){let d=u.trim().split(/\s+/),f=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&s.push({name:f,num:h})}return s}let o=i(t?.counterReset),a=i(t?.counterIncrement);function c(l){if(r.has(l))return r.get(l).slice();let s=n.getStack(e,l);s=s.length?s.slice():[];let u=o.find(f=>f.name===l);if(u){let f=Number.isFinite(u.num)?u.num:0;s=s.length?[...s,f]:[f]}let d=a.find(f=>f.name===l);if(d){let f=Number.isFinite(d.num)?d.num:1;s.length===0&&(s=[0]),s[s.length-1]+=f}return r.set(l,s.slice()),s}return{get(l,s){let u=c(s);return u.length?u[u.length-1]:0},getStack(l,s){return c(s)},__incs:a}}function dl(e,t,n){let r;try{r=ue(e,t)}catch{}let i=r?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=on(e,n),a=an(e,r,o),c=ol(i)?ll(i,e,a):i;return{text:ul(c),incs:a.__incs||[]}}async function ln(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!sl(i,n))return;let o=E?.session?.__counterEpoch??0;if(hr!==o&&(Pe=new WeakMap,n&&(n.__counterCtx=null),hr=o),!n.__counterCtx)try{n.__counterCtx=al(e.ownerDocument||document)}catch(l){F(n,"buildCounterContext failed",l)}let a=n.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let s=ue(e,l);if(!s||s.content==="none"&&s.backgroundImage==="none"&&s.backgroundColor==="transparent"&&(s.borderStyle==="none"||parseFloat(s.borderWidth)===0)&&(!s.transform||s.transform==="none")&&s.display==="inline")continue;if(l==="::first-letter"){let R=ue(e);if(!(s.color!==R.color||s.fontSize!==R.fontSize||s.fontWeight!==R.fontWeight))continue;let N=Array.from(t.childNodes).find(He=>He.nodeType===Node.TEXT_NODE&&He.textContent?.trim().length>0);if(!N)continue;let W=N.textContent,O=W.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],me=W.slice(O?.length||0);if(!O||/[\uD800-\uDFFF]/.test(O))continue;let ae=document.createElement("span");ae.textContent=O,ae.dataset.snapdomPseudo="::first-letter";let ke=Jn(s),Me=Kt(ke,"span");n.styleMap.set(ae,Me);let we=document.createTextNode(me);t.replaceChild(we,N),t.insertBefore(ae,we);continue}let u=s.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:h}=dl(e,l,a),g=s.backgroundImage,p=s.backgroundColor,m=s.fontFamily,y=parseInt(s.fontSize)||32,x=parseInt(s.fontWeight)||!1,b=s.color||"#000",w=s.borderStyle,C=parseFloat(s.borderWidth),S=s.transform,v=ce(m),M=!d&&f!=="",_=g&&g!=="none",B=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",I=w&&w!=="none"&&C>0,$=S&&S!=="none";if(!(M||_||B||I||$)){if(h&&h.length&&e.parentElement){let R=Pe.get(e.parentElement)||new Map;for(let{name:N}of h){if(!N)continue;let W=on(e,a),O=an(e,ue(e,l),W).get(e,N);R.set(N,O)}Pe.set(e.parentElement,R)}continue}let A=document.createElement("span");A.dataset.snapdomPseudo=l,A.style.pointerEvents="none";let j=Jn(s),ee=Kt(j,"span");if(n.styleMap.set(A,ee),v&&f&&f.length===1){let{dataUrl:R,width:N,height:W}=await Ba(f,m,x,y,b),O=document.createElement("img");O.src=R,O.style=`height:${y}px;width:${N/W*y}px;object-fit:contain;`,A.appendChild(O),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let R=cn(f);if(R?.trim())try{let N=await te(wt(R),{as:"dataURL",useProxy:r.useProxy});if(N?.ok&&typeof N.data=="string"){let W=document.createElement("img");W.src=N.data,W.style=`width:${y}px;height:auto;object-fit:contain;`,A.appendChild(W)}}catch(N){console.error(`[snapdom] Error in pseudo ${l} for`,e,N)}}else!v&&M&&(A.textContent=f);A.style.backgroundImage="none","maskImage"in A.style&&(A.style.maskImage="none"),"webkitMaskImage"in A.style&&(A.style.webkitMaskImage="none");try{A.style.backgroundRepeat=s.backgroundRepeat,A.style.backgroundSize=s.backgroundSize,s.backgroundPositionX&&s.backgroundPositionY?(A.style.backgroundPositionX=s.backgroundPositionX,A.style.backgroundPositionY=s.backgroundPositionY):A.style.backgroundPosition=s.backgroundPosition,A.style.backgroundOrigin=s.backgroundOrigin,A.style.backgroundClip=s.backgroundClip,A.style.backgroundAttachment=s.backgroundAttachment,A.style.backgroundBlendMode=s.backgroundBlendMode}catch{}if(_)try{let R=Jt(g),N=await Promise.all(R.map(xr));A.style.backgroundImage=N.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${l}`,R)}B&&(A.style.backgroundColor=p);let nt=A.childNodes.length>0||A.textContent?.trim()!==""||_||B||I||$;if(h&&h.length&&e.parentElement){let R=Pe.get(e.parentElement)||new Map,N=on(e,a),W=an(e,ue(e,l),N);for(let{name:O}of h){if(!O)continue;let me=W.get(e,O);R.set(O,me)}Pe.set(e.parentElement,R)}if(!nt)continue;l==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(A,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(A))}catch(s){console.warn(`[snapdom] Failed to capture ${l} for`,e,s)}let c=Array.from(t.children).filter(l=>!l.dataset.snapdomPseudo);if(n.nodeMap)for(let l of c){let s=n.nodeMap.get(l);s instanceof Element&&await ln(s,l,n,r)}else{let l=Array.from(e.children);for(let s=0;s<Math.min(l.length,c.length);s++)await ln(l[s],c[s],n,r)}}function fl(e,t){if(!e||!(e instanceof Element))return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(i.length===0)return;let o=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",s=w=>{if(!w||!w.getAttribute)return null;let C=w.getAttribute("href")||w.getAttribute("xlink:href")||(typeof w.getAttributeNS=="function"?w.getAttributeNS(l,"href"):null);if(C)return C;let S=w.attributes;if(!S)return null;for(let v=0;v<S.length;v++){let M=S[v];if(!M||!M.name)continue;if(M.name==="href")return M.value;let _=M.name.indexOf(":");if(_!==-1&&M.name.slice(_+1)==="href")return M.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(w=>w.id)),d=new Set,f=!1,h=(w,C=null)=>{if(!w)return;o.lastIndex=0;let S;for(;S=o.exec(w);){f=!0;let v=(S[1]||"").trim();v&&(u.has(v)||(d.add(v),C&&!C.has(v)&&C.add(v)))}},g=w=>{let C=w.querySelectorAll("use");for(let v of C){let M=s(v);if(!M||!M.startsWith("#"))continue;f=!0;let _=M.slice(1).trim();_&&!u.has(_)&&d.add(_)}let S=w.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let v of S){h(v.getAttribute("style")||"");for(let M of a)h(v.getAttribute(M))}};for(let w of i)g(w);if(!f)return;let p=e.querySelector("svg.inline-defs-container");p||(p=n.createElementNS("http://www.w3.org/2000/svg","svg"),p.classList.add("inline-defs-container"),p.setAttribute("aria-hidden","true"),p.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(p,e.firstChild||null));let m=p.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let C=c(w),S=v=>{let M=r.querySelector(v);return M&&!e.contains(M)?M:null};return S(`svg defs > *#${C}`)||S(`svg > symbol#${C}`)||S(`*#${C}`)};if(!d.size)return;let x=new Set(d),b=new Set;for(;x.size;){let w=x.values().next().value;if(x.delete(w),!w||u.has(w)||b.has(w))continue;let C=y(w);if(!C){b.add(w);continue}m||(m=n.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(m));let S=C.cloneNode(!0);S.id||S.setAttribute("id",w),m.appendChild(S),b.add(w),u.add(w);let v=[S,...S.querySelectorAll("*")];for(let M of v){let _=s(M);if(_&&_.startsWith("#")){let I=_.slice(1).trim();I&&!u.has(I)&&!b.has(I)&&x.add(I)}let B=M.getAttribute?.("style")||"";B&&h(B,x);for(let I of a){let $=M.getAttribute?.(I);$&&h($,x)}}}}ne();function ml(e,t){if(!e||!t)return;let n=e.scrollTop||0;if(!n)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let r=e.getBoundingClientRect(),i=e.clientHeight,o="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let c=a.currentNode,l=getComputedStyle(c),s=l.position;if(s!=="sticky"&&s!=="-webkit-sticky")continue;let u=gr(l.top),d=gr(l.bottom);if(u==null&&d==null)continue;let f=pl(c,e),h=hl(t,f,o);if(!h)continue;let g=c.getBoundingClientRect(),p=g.width,m=g.height,y=g.left-r.left;if(!(p>0&&m>0)||!Number.isFinite(y))continue;let x=u!=null?u+n:n+(i-m-d);if(!Number.isFinite(x))continue;let b=Number.parseInt(l.zIndex,10),w=Number.isFinite(b),C=w?Math.max(b,1)+1:2,S=w?b-1:0,v=h.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${y}px`,v.style.top=`${x}px`,v.style.width=`${p}px`,v.style.height=`${m}px`,v.style.visibility="hidden",v.style.zIndex=String(S),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",h.parentElement?.insertBefore(v,h),h.style.position="absolute",h.style.left=`${y}px`,h.style.top=`${x}px`,h.style.bottom="auto",h.style.zIndex=String(C),h.style.pointerEvents="none"}}function gr(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function pl(e,t){let n=[];for(let r=e;r&&r!==t;){let i=r.parentElement;if(!i)break;n.push(Array.prototype.indexOf.call(i.children,r)),r=i}return n.reverse()}function hl(e,t,n){let r=e;for(let i=0;i<t.length;i++)if(r=gl(r,n)[t[i]],!r)return null;return r instanceof HTMLElement?r:null}function gl(e,t){let n=[],r=e.children;for(let i=0;i<r.length;i++){let o=r[i];o.hasAttribute(t)||n.push(o)}return n}function yl(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,c=i==="none"||parseFloat(o)===0;a&&c&&(e.style.border=`${r} solid transparent`)}async function wl(e,t={}){let n={styleMap:E.session.styleMap,styleCache:E.session.styleCache,nodeMap:E.session.nodeMap,options:t},r,i="",o="";yl(e);try{fl(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await ht(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{await ln(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await Na(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let s of l)o+=s.textContent||"",s.remove()}catch(l){F(n,"Failed to extract shadow CSS from style[data-sd]",l)}let a=Oi(n.styleMap);i=Array.from(a.entries()).map(([l,s])=>`.${s}{${l}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[l,s]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",s.replace(/;/g,"; "));continue}let u=a.get(s);u&&l.classList.add(u);let d=l.style?.backgroundImage,f=l.dataset?.snapdomHasIcon;d&&d!=="none"&&(l.style.backgroundImage=d),f&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,s]of n.nodeMap.entries()){let u=s.scrollLeft,d=s.scrollTop;if((u||d)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let f=document.createElement("div");for(f.style.transform=`translate(${-u}px, ${-d}px)`,f.style.willChange="transform",f.style.display="inline-block",f.style.width="100%";l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f)}}let c=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(ml(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||ue(e);n.styleCache.set(e,l);let s=Mi(l.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=s||""}for(let[l,s]of n.nodeMap.entries())s.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:i,styleCache:n.styleCache}}_e();var qr="http://www.w3.org/1999/xlink";function bl(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(qr,"href"):null)}function xl(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,o=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,c=t||o||r||e.width||e.naturalWidth||100,l=n||a||i||e.height||e.naturalHeight||100;return{width:c,height:l}}async function vl(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let f=a.currentSrc||a.src||"";f&&a.setAttribute("src",f)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){a.src=l.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:s,height:u}=xl(a),{fallbackURL:d}=t||{};if(d)try{let f=typeof d=="function"?await d({width:s,height:u,src:c,element:a}):d;if(f){let h=await te(f,{as:"dataURL",useProxy:t.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=s),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${s}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",a.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${s}px;height:${u}px;visibility:hidden;`,a.replaceWith(f)}};for(let a=0;a<n.length;a+=4){let c=n.slice(a,a+4).map(r);await Promise.allSettled(c)}let i=Array.from(e.querySelectorAll("image")),o=async a=>{let c=bl(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")&&(a.setAttribute("href",l.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(qr,"href"))};for(let a=0;a<i.length;a+=4){let c=i.slice(a,a+4).map(o);await Promise.allSettled(c)}}re();async function Sl(e,t,n,r={}){let i=[[e,t]],o=["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"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],c=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){let[s,u]=i.shift();if(!u)continue;let d=n.get(s)||ue(s);n.has(s)||n.set(s,d);let f=(()=>{let p=d.getPropertyValue("border-image"),m=d.getPropertyValue("border-image-source");return p&&p!=="none"||m&&m!=="none"})();for(let p of c){let m=d.getPropertyValue(p);m&&u.style.setProperty(p,m)}for(let p of o){let m=d.getPropertyValue(p);if(p==="background-image"&&(!m||m==="none")){let b=d.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(m=Jt(b).find(w=>/url\s*\(/.test(w))||m)}if(!m||m==="none")continue;let y=Jt(m),x=await Promise.all(y.map(b=>xr(b,r)));x.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&u.style.setProperty(p,x.join(", "))}for(let p of a){let m=d.getPropertyValue(p);!m||m==="initial"||u.style.setProperty(p,m)}if(f)for(let p of l){let m=d.getPropertyValue(p);!m||m==="initial"||u.style.setProperty(p,m)}let h=s.shadowRoot?Array.from(s.shadowRoot.children).filter(p=>p.tagName!=="STYLE"):Array.from(s.children),g=Array.from(u.children).filter(p=>!(p.dataset?.snapdomPseudo||p.tagName==="STYLE"&&p.dataset?.sd));for(let p=0;p<Math.min(h.length,g.length);p++)i.push([h[p],g[p]])}}re();ne();function El(e){if(!e)return()=>{};let t=[];function n(r){let i=Cl(r);i&&t.push(i);for(let o of r.children||[])n(o)}return n(e),()=>t.forEach(r=>r())}function Cl(e){if(!e)return()=>{};let t=kl(e);if(t<=0)return()=>{};if(!$l(e))return()=>{};let n=getComputedStyle(e),r=Math.round(Ml(n)*t+Al(n)),i=e.textContent??"",o=i;if(e.scrollHeight<=r+.5)return()=>{};let a=0,c=i.length,l=-1;for(;a<=c;){let s=a+c>>1;e.textContent=i.slice(0,s)+"\u2026",e.scrollHeight<=r+.5?(l=s,a=s+1):c=s-1}return e.textContent=(l>=0?i.slice(0,l):"")+"\u2026",()=>{e.textContent=o}}function kl(e){let t=getComputedStyle(e),n=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function Ml(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(n*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function Al(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function $l(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Ge=[];function jr(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t=="function"?t(n):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:n}=e;return typeof t=="function"?t(n):t}return typeof e=="function"?e():e}function Ll(...e){let t=e.flat();for(let n of t){let r=jr(n);r&&(Ge.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ge.push(r))}}function zr(e){return(e&&Array.isArray(e.plugins)?e.plugins:Ge)||Ge}async function ye(e,t,n){let r=n,i=zr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,r);typeof c<"u"&&(r=c)}return r}async function Tl(e,t,n){let r=[],i=zr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,n);typeof c<"u"&&r.push(c)}return r}function Nl(e){let t=[];if(Array.isArray(e))for(let n of e){let r=jr(n);if(!r||!r.name)continue;let i=t.findIndex(o=>o&&o.name===r.name);i>=0&&t.splice(i,1),t.push(r)}for(let n of Ge)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function Rl(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=Nl(t)),e}re();function Pl(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){F(n,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){F(n,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){F(n,"stripRootShadows outline",o)}let i=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(o){F(n,"stripRootShadows filter",o)}}function _l(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let r of n)r.remove()}function Fl(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let o=i.currentNode;for(let a of Array.from(o.attributes)){let c=a.name;if(c.includes("@")){o.removeAttribute(c);continue}if(c.includes(":")){let l=c.split(":",1)[0];if(!r.has(l)){o.removeAttribute(c);continue}}if(n&&(c.startsWith("x-")||c.startsWith("v-")||c.startsWith(":")||c.startsWith("on:")||c.startsWith("bind:")||c.startsWith("let:")||c.startsWith("class:"))){o.removeAttribute(c);continue}}}}function Dl(e,t={}){e&&(Fl(e,t),_l(e))}function Il(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Ol(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Wl(e,t){if(!(e instanceof Element)||Il(e)||Ol(e))return!1;let n=t.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&t.transform!=="none")}function Hl(e,t,n=new Map){function r(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,c=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,c),a&&Wl(i,c)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let u=c.overflowY||c.overflowBlock||"visible",d=c.overflowX||c.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(o.style.overflow="visible")}let l=Array.from(i.children),s=Array.from(o.children);for(let u=0;u<Math.min(l.length,s.length);u++)r(l[u],s[u])}r(e,t)}function Bl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Ul(e,t){if(!(e instanceof Element))return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return t.excludeMode==="remove"}catch(r){F(t,"exclude selector match failed",r)}return!1}function ql(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,c=Array.from(e.children);for(let h of c){if(Ul(h,t)||!Bl(h))continue;let g=h.getBoundingClientRect(),p=g.top-r.top,m=g.bottom-r.top;m<=p||(p<i&&(i=p),m>o&&(o=m),a=!0)}let l=a?Math.max(0,o-i):0,s=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return s+u+d+f+l}var k=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,jl=/::-webkit-scrollbar(-[a-z]+)?\b/i;function sn(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=sn(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=sn(i.cssRules,t);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(jl.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function zl(e){if(!e||!e.styleSheets)return"";let t=new Set,n="";for(let r of Array.from(e.styleSheets))try{let i=r.cssRules;i&&(n+=sn(i,t))}catch{}return n}function Vl(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(c=>c.trim()),r=0,i=0,o=0,a=0;for(let c of n){let l=c.match(/-?\d+(\.\d+)?px/g)?.map(p=>parseFloat(p))||[];if(l.length<2)continue;let[s,u,d=0,f=0]=l,h=Math.abs(s)+d+f,g=Math.abs(u)+d+f;i=Math.max(i,h+Math.max(s,0)),a=Math.max(a,h+Math.max(-s,0)),o=Math.max(o,g+Math.max(u,0)),r=Math.max(r,g+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(i),bottom:Math.ceil(o),left:Math.ceil(a)}}function Xl(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=t?Math.ceil(parseFloat(t[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function Yl(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0);return{top:t,right:t,bottom:t,left:t}}function Gl(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,a=0,c=!1;for(let l of n){c=!0;let s=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[u=0,d=0,f=0]=s,h=Math.abs(u)+f,g=Math.abs(d)+f;i=Math.max(i,h+Math.max(u,0)),a=Math.max(a,h+Math.max(-u,0)),o=Math.max(o,g+Math.max(d,0)),r=Math.max(r,g+Math.max(-d,0))}return{bleed:{top:k(r),right:k(i),bottom:k(o),left:k(a)},has:c}}function Kl(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let o=Vr(e);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let o=i[1].split(",").map(a=>parseFloat(a.trim()));if(o.length===6&&o.every(Number.isFinite)){let[a,c,l,s]=o,u=Math.sqrt(a*a+c*c)||0,d=0,f=0,h=0,g=0,p=0,m=0;u>0&&(d=a/u,f=c/u,h=d*l+f*s,g=l-d*h,p=s-f*h,m=Math.sqrt(g*g+p*p)||0,m>0?h=h/m:h=0);let y=u,x=0,b=h*m,w=m;try{t.style.transform=`matrix(${y}, ${x}, ${b}, ${w}, 0, 0)`}catch{}return{a:y,b:x,c:b,d:w}}}try{let o=String(r).trim();return t.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function yr(e,t,n,r,i){let o=n.a,a=n.b,c=n.c,l=n.d,s=n.e||0,u=n.f||0;function d(y,x){let b=y-r,w=x-i,C=o*b+c*w,S=a*b+l*w;return C+=r+s,S+=i+u,[C,S]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],h=1/0,g=1/0,p=-1/0,m=-1/0;for(let[y,x]of f)y<h&&(h=y),x<g&&(g=x),y>p&&(p=y),x>m&&(m=x);return{minX:h,minY:g,maxX:p,maxY:m,width:p-h,height:m-g}}function Jl(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],a=(c,l)=>{let s=c.toLowerCase();return s==="left"||s==="top"?0:s==="center"?l/2:s==="right"||s==="bottom"?l:s.endsWith("px")?parseFloat(s)||0:s.endsWith("%")?(parseFloat(s)||0)*l/100:/^-?\d+(\.\d+)?$/.test(s)&&parseFloat(s)||0};return{ox:a(i,t),oy:a(o,n)}}function Zl(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let i=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=i("rotate");if(o)if(o.angle){let l=o.angle;t.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else o.unit?t.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:t.rotate=String(o);else{let l=getComputedStyle(e);t.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=i("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,s="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;t.scale=`${l} ${s}`}else{let l=getComputedStyle(e);t.scale=l.scale&&l.scale!=="none"?l.scale:null}let c=i("translate");if(c){let l="x"in c&&"value"in c.x?c.x.value:Array.isArray(c)?c[0]?.value:0,s="y"in c&&"value"in c.y?c.y.value:Array.isArray(c)?c[1]?.value:0,u="x"in c&&c.x?.unit?c.x.unit:"px",d="y"in c&&c.y?.unit?c.y.unit:"px";t.translate=`${l}${u} ${s}${d}`}else{let l=getComputedStyle(e);t.translate=l.translate&&l.translate!=="none"?l.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",t.scale=r.scale&&r.scale!=="none"?r.scale:null,t.translate=r.translate&&r.translate!=="none"?r.translate:null,t}var Yt=null;function Ql(){if(Yt)return Yt;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Yt=e,e}function es(e){let t=Ql(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=Vr(n);return t.removeChild(n),r}function ts(e){let t=getComputedStyle(e),n=t.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 r=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",i=t.scale&&t.scale!=="none"&&t.scale!=="1",o=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||i||o)}function Vr(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function Xr(e,t){if(!e)throw new Error("Element cannot be null or undefined");ki(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,c,l,s="",u="",d,f,h=null;await ye("beforeSnap",o),await ye("beforeClone",o);let g=El(o.element);try{({clone:a,classCSS:c,styleCache:l}=await wl(o.element,o.options)),!r&&a&&(h=Kl(o.element,a)),!i&&a&&Pl(o.element,a,o.options)}finally{g()}if(o={clone:a,classCSS:c,styleCache:l,...o},await ye("afterClone",o),Dl(o.clone),o.options?.excludeMode==="remove")try{Hl(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await Ha(o.clone,o.element)}catch{}await new Promise(b=>{Ne(async()=>{await vl(o.clone,o.options),b()},{fast:n})}),await new Promise(b=>{Ne(async()=>{await Sl(o.element,o.clone,o.styleCache,o.options),b()},{fast:n})}),t.embedFonts&&await new Promise(b=>{Ne(async()=>{let w=Hr(o.element),C=rl(o.element);if(Se()){let S=new Set(Array.from(w).map(v=>String(v).split("__")[0]).filter(Boolean));await Br(S,1)}s=await nl({required:w,usedCodepoints:C,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),b()},{fast:n})});let p=Di(o.clone).sort(),m=p.join(",");E.baseStyle.has(m)?u=E.baseStyle.get(m):await new Promise(b=>{Ne(()=>{u=Ii(p),E.baseStyle.set(m,u),b()},{fast:n})});let y=zl(o.element?.ownerDocument||document);o={fontsCSS:s,baseCSS:u,scrollbarCSS:y,...o},await ye("beforeRender",o),await new Promise(b=>{Ne(()=>{let w=ue(o.element),C=o.element.getBoundingClientRect(),S=Math.max(1,k(o.element.offsetWidth||parseFloat(w.width)||C.width||1)),v=Math.max(1,k(o.element.offsetHeight||parseFloat(w.height)||C.height||1)),M=o.element.ownerDocument||document;if(o.element===M.body||o.element===M.documentElement){let V=Math.max(o.element.scrollHeight||0,M.documentElement?.scrollHeight||0,M.body?.scrollHeight||0),Y=Math.max(o.element.scrollWidth||0,M.documentElement?.scrollWidth||0,M.body?.scrollWidth||0);V>0&&(v=Math.max(v,k(V))),Y>0&&(S=Math.max(S,k(Y)));try{let X=M.createElement("div");X.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+S+"px!important;overflow:visible!important;visibility:hidden!important;";let ot=M.createElement("style");ot.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,X.appendChild(ot),X.appendChild(o.clone.cloneNode(!0)),M.body.appendChild(X);let it=X.scrollHeight,at=X.scrollWidth;M.body.removeChild(X),it>0&&(v=Math.max(v,k(it))),at>0&&(S=Math.max(S,k(at)))}catch{}}if(o.options?.excludeMode==="remove"){let V=ql(o.element,o.options);Number.isFinite(V)&&V>0&&(v=Math.max(1,Math.min(v,k(V+1))))}let _=(V,Y=NaN)=>{let X=typeof V=="string"?parseFloat(V):V;return Number.isFinite(X)?X:Y},B=_(o.options.width),I=_(o.options.height),$=S,A=v,j=Number.isFinite(B),ee=Number.isFinite(I),nt=v>0?S/v:1;j&&ee?($=Math.max(1,k(B)),A=Math.max(1,k(I))):j?($=Math.max(1,k(B)),A=Math.max(1,k($/(nt||1)))):ee?(A=Math.max(1,k(I)),$=Math.max(1,k(A*(nt||1)))):($=S,A=v);let R=0,N=0,W=S,O=v;if(!r&&h&&Number.isFinite(h.a)){let V={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},Y=yr(S,v,V,0,0);R=k(Y.minX),N=k(Y.minY),W=k(Y.maxX),O=k(Y.maxY)}else if(r&&wr(o.element)){let V=w.transform&&w.transform!=="none"?w.transform:"",Y=Zl(o.element),X=es({baseTransform:V,rotate:Y.rotate||"0deg",scale:Y.scale,translate:Y.translate}),{ox:ot,oy:it}=Jl(w,S,v),at=X.is2D?X:new DOMMatrix(X.toString()),lt=yr(S,v,at,ot,it);R=k(lt.minX),N=k(lt.minY),W=k(lt.maxX),O=k(lt.maxY)}let me=Vl(w),ae=Xl(w),ke=Yl(w),Me=Gl(w),we=i?{top:k(me.top+ae.top+ke.top+Me.bleed.top),right:k(me.right+ae.right+ke.right+Me.bleed.right),bottom:k(me.bottom+ae.bottom+ke.bottom+Me.bleed.bottom),left:k(me.left+ae.left+ke.left+Me.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=k(R-we.left),N=k(N-we.top),W=k(W+we.right),O=k(O+we.bottom);let He=Math.max(1,k(W-R)),En=Math.max(1,k(O-N)),qo=j||ee?k($/S):1,jo=ee||j?k(A/v):1,zo=Math.max(1,k(He*qo)),Vo=Math.max(1,k(En*jo)),Cn="http://www.w3.org/2000/svg",Xo=Se()&&wr(o.element)?1:0,pe=k(Xo+(r?0:1)),he=document.createElementNS(Cn,"foreignObject"),Yo=k(R),Go=k(N);he.setAttribute("x",String(k(-(Yo-pe)))),he.setAttribute("y",String(k(-(Go-pe)))),he.setAttribute("width",String(k(S+pe*2))),he.setAttribute("height",String(k(v+pe*2))),he.style.overflow="visible";let kn=document.createElement("style");kn.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,he.appendChild(kn);let rt=document.createElement("div");rt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),rt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${k(S)}px;height:${k(v)}px`,rt.appendChild(o.clone),he.appendChild(rt);let Ko=new XMLSerializer().serializeToString(he),Dt=k(He+pe*2),It=k(En+pe*2),Mn=j||ee;t.meta={w0:S,h0:v,vbW:Dt,vbH:It,targetW:$,targetH:A};let Jo=Se()&&Mn?Dt:k(zo+pe*2),Zo=Se()&&Mn?It:k(Vo+pe*2),Qo=parseFloat(ue(M.documentElement)?.fontSize)||16;f=`<svg xmlns="${Cn}" width="${Jo}" height="${Zo}" viewBox="0 0 ${Dt} ${It}" font-size="${Qo}px">`+Ko+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,o={svgString:f,dataURL:d,...o},b()},{fast:n})}),await ye("afterRender",o);let x=document.getElementById("snapdom-sandbox");return x&&x.style.position==="absolute"&&x.remove(),o.dataURL}function wr(e){return ts(e)}ne();function ns(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=Ci(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null}}Je();Mr();re();_e();ne();function rs(...e){return Ll(...e),P}var P=Object.assign(is,{plugins:rs}),Yr=Symbol("snapdom.internal"),os=Symbol("snapdom.internal.silent"),br=!1;async function is(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=ns(t);if(Rl(n,t&&t.plugins),Se()&&(n.embedFonts===!0||ls(e))){if(n.embedFonts)try{let i=Hr(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await Br(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let i=0;i<r;i++)try{await as(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&Pa(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>P.toPng(r,i),toSvg:(r,i)=>P.toSvg(r,i)}),P.capture(e,n,Yr)}P.capture=async(e,t,n)=>{if(n!==Yr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Xr(e,t),i={img:async(p,m)=>{let{toImg:y}=await Promise.resolve().then(()=>(Qn(),Zt));return y(r,{...p,...m||{}})},svg:async(p,m)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Qn(),Zt));return y(r,{...p,...m||{}})},canvas:async(p,m)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(St(),Ar));return y(r,{...p,...m||{}})},blob:async(p,m)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Rr(),Tr));return y(r,{...p,...m||{}})},png:async(p,m)=>{let{rasterize:y}=await Promise.resolve().then(()=>(pt(),mt));return y(r,{...p,...m||{},format:"png"})},jpeg:async(p,m)=>{let{rasterize:y}=await Promise.resolve().then(()=>(pt(),mt));return y(r,{...p,...m||{},format:"jpeg"})},webp:async(p,m)=>{let{rasterize:y}=await Promise.resolve().then(()=>(pt(),mt));return y(r,{...p,...m||{},format:"webp"})},download:async(p,m)=>{let{download:y}=await Promise.resolve().then(()=>(Zi(),Pr));return y(r,{...p,...m||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async m=>i[p](t,{...m||{},[os]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},c=await Tl("defineExports",a),l=Object.assign({},...c.filter(p=>p&&typeof p=="object")),s={...i,...l};s.jpeg&&!s.jpg&&(s.jpg=(p,m)=>s.jpeg(p,m));function u(p,m){let y={...t,...m||{}};return(p==="jpeg"||p==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function h(p,m){let y=async()=>{let x=s[p];if(!x)throw new Error(`[snapdom] Unknown export type: ${p}`);let b=u(p,m),w={...t,export:{type:p,options:b,url:r}};await ye("beforeExport",w);let C=await x(w,b);return await ye("afterExport",w,C),d||(d=!0,await ye("afterSnap",t)),C};return f=f.then(y)}let g={url:r,toRaw:()=>r,to:(p,m)=>h(p,m),toImg:p=>h("img",p),toSvg:p=>h("svg",p),toCanvas:p=>h("canvas",p),toBlob:p=>h("blob",p),toPng:p=>h("png",p),toJpg:p=>h("jpg",p),toWebp:p=>h("webp",p),download:p=>h("download",p)};for(let p of Object.keys(s)){let m="to"+p.charAt(0).toUpperCase()+p.slice(1);g[m]||(g[m]=y=>h(p,y))}return g};P.toRaw=(e,t)=>P(e,t).then(n=>n.toRaw());P.toImg=(e,t)=>P(e,t).then(n=>n.toImg());P.toSvg=(e,t)=>P(e,t).then(n=>n.toSvg());P.toCanvas=(e,t)=>P(e,t).then(n=>n.toCanvas());P.toBlob=(e,t)=>P(e,t).then(n=>n.toBlob());P.toPng=(e,t)=>P(e,{...t,format:"png"}).then(n=>n.toPng());P.toJpg=(e,t)=>P(e,{...t,format:"jpeg"}).then(n=>n.toJpg());P.toWebp=(e,t)=>P(e,{...t,format:"webp"}).then(n=>n.toWebp());P.download=(e,t)=>P(e,t).then(n=>n.download());async function as(e,t){if(br)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Xr(e,n)}catch(i){F(t,"safariWarmup pre-capture failed",i)}await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),r&&await new Promise(i=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){F(t,"safariWarmup img hints failed",a)}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(c){F(t,"safariWarmup img.decode failed",c)}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)await new Promise(c=>setTimeout(c,200));await new Promise(c=>requestAnimationFrame(c));try{let c=document.createElement("canvas");c.width=Math.max(1,o.naturalWidth||10),c.height=Math.max(1,o.naturalHeight||10);let l=c.getContext("2d");l&&l.drawImage(o,0,0)}catch{}await new Promise(c=>requestAnimationFrame(c));try{o.remove()}catch(c){F(t,"safariWarmup img.remove failed",c)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){F(t,"safariWarmup canvas poke failed",o)}}),br=!0}function ls(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),i=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(i||o||n.tagName==="CANVAS")return!0}return!1}var Gr=!1,mn=null;function Kr(e){if(e.getAttribute("crossorigin")!==null||!e.rel||!e.rel.includes("stylesheet"))return!1;let t=e.href||"";try{return new URL(t).origin!==window.location.origin}catch{return!1}}function Jr(e){return new Promise(t=>{let n=document.createElement("link");n.rel="stylesheet",n.href=e.href,n.crossOrigin="anonymous",e.media&&(n.media=e.media),n.onload=()=>{e.remove(),t()},n.onerror=()=>{t()},e.parentNode?.insertBefore(n,e.nextSibling)})}async function Zr(){let e=document.querySelectorAll('link[rel~="stylesheet"]'),t=[];for(let n of e)Kr(n)&&t.push(Jr(n));t.length>0&&await Promise.all(t)}function ss(){mn||(mn=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes)n instanceof HTMLLinkElement&&Kr(n)&&Jr(n)}),mn.observe(document.documentElement,{childList:!0,subtree:!0}))}function Qr(){Gr||(Gr=!0,Zr(),ss())}async function eo(){await Zr();try{await document.fonts.ready}catch{}}var cs=300,us=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor"];async function Ct(){await eo();let e=window.innerWidth,t=window.innerHeight,n=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),r=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),i=window.scrollX,o=window.scrollY,a=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto";let c=[],l=0;for(;l<n;){window.scrollTo(0,l),await U(cs);let p=window.scrollY,m=Math.min(t,n-p);try{let y=await P.toPng(document.documentElement,{width:e,height:t,embedFonts:!0,exclude:us,excludeMode:"remove"});if(y){let x=await ds(y,e,m);x&&c.push({y:p,canvas:x})}}catch{}l+=t}if(window.scrollTo(i,o),document.documentElement.style.scrollBehavior=a,c.length===0)throw new Error("Screenshot capture produced no image data");let s=e,u=n,d=document.createElement("canvas");d.width=s,d.height=u;let f=d.getContext("2d");if(!f)throw new Error("Failed to create output canvas");for(let p of c)f.drawImage(p.canvas,0,p.y);let g=d.toDataURL("image/png").replace(/^data:image\/png;base64,/,"");if(!g)throw new Error("Canvas export produced no image data");return{image:g,width:s,height:u}}async function ds(e,t,n){let r;typeof e=="string"?(r=new Image,r.src=e,await new Promise((a,c)=>{r.onload=()=>a(),r.onerror=()=>c(new Error("Failed to load chunk"))})):(r=e,r.complete||await Promise.race([new Promise((a,c)=>{r.onload=()=>a(),r.onerror=()=>c(new Error("Chunk image failed to load"))}),U(1e4).then(()=>{throw new Error("Chunk load timed out")})]));let i=document.createElement("canvas");i.width=t,i.height=n;let o=i.getContext("2d");return o?(o.drawImage(r,0,0,t,n,0,0,t,n),i):null}var pn=!1;function to(){pn=new URLSearchParams(window.location.search).get("display-mode")==="pip",window.addEventListener("message",t=>{!t.data||typeof t.data.command!="string"||(t.data.command==="display-mode-pip"?pn=!0:t.data.command==="display-mode-full"&&(pn=!1))})}var no="__mindstudio-cursor",fs="__mindstudio-cursor-ripple",ro=.07,ms=250,At=300,ps=2e3,kt=10,oo=1,$t="#DD2590",hs=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
9
+ `):u+=f[0]}return u+=c.slice(d),u}let a=lr(e,t||location.href);return a=await o(a,t||location.href,0),a}var Fr=/url\((["']?)([^"')]+)\1\)/g,Za=/@font-face[^{}]*\{[^}]*\}/g;function Dr(e){if(!e)return[];let t=[],n=e.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],a=i[2],c=l=>{if(!l.includes("?"))return parseInt(l,16);let s=parseInt(l.replace(/\?/g,"0"),16),u=parseInt(l.replace(/\?/g,"F"),16);return[s,u]};if(a){let l=c(o),s=c(a),u=Array.isArray(l)?l[0]:l,d=Array.isArray(s)?s[1]:s;t.push([Math.min(u,d),Math.max(u,d)])}else{let l=c(o);Array.isArray(l)?t.push([l[0],l[1]]):t.push([l,l])}}return t}function Ir(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,i]of t)if(n>=r&&n<=i)return!0;return!1}function fn(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Fr)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}n.push(i)}}return n}async function Or(e,t,n=""){let r=e;for(let i of e.matchAll(Fr)){let o=cn(i[0]);if(!o)continue;let a=o;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!ce(a)){if(E.resource?.has(a)){E.font?.add(a),r=r.replace(i[0],`url(${E.resource.get(a)})`);continue}if(!E.font?.has(a))try{let c=await te(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let l=c.data;E.resource?.set(a,l),E.font?.add(a),r=r.replace(i[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function Qa(e){if(!e.length)return null;let t=(a,c)=>e.some(([l,s])=>!(s<a||l>c)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),o=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function sr(e={}){let t=new Set((e.families||[]).map(i=>String(i).toLowerCase())),n=new Set((e.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((e.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(n.size)for(let a of i.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=Qa(o);if(a&&r.has(a))return!0}return!1}}function el(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of e.match(t)||[]){let a=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",c=Et(a),l=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),s=(o.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(o.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),h=fn(f,location.href),g=h.length?h.map(m=>String(m).toLowerCase()).sort().join("|"):f.toLowerCase(),p=[String(c||"").toLowerCase(),l,s,u,d.toLowerCase(),g].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||"")}function tl(e,t,n,r,i){let o=Array.from(e||[]).sort().join("|"),a=t?JSON.stringify({families:(t.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(t.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(t.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",c=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),l=r||"",s=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${c}::px=${l}::fd=${s}`}async function Wr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?o(a.href,t):t;if(r.depth>=bt){console.warn(`[snapDOM] CSSOM import depth exceeded (${bt}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let l={...r,depth:(r.depth||0)+1};await Wr(a.styleSheet,c,n,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),l=Et(c);if(!l||ce(l))continue;let s=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),f=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,u,s,d))continue;let g=Dr(h);if(!Ir(r.usedCodepoints,g))continue;let p={family:l,weightSpec:s,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:f,srcUrls:fn(f,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(p,g))continue;if(/url\(/i.test(f)){let m=await Or(f,t||location.href,r.useProxy);await n(`@font-face{font-family:${l};src:${m};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}else await n(`@font-face{font-family:${l};src:${f};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}}}async function nl({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let m of e){let[y,x,b,w]=String(m).split("__");if(!y)continue;let C=a.get(y)||[];C.push({w:parseInt(x,10),s:b,st:parseInt(w,10)}),a.set(y,C)}function c(m,y,x,b){if(!a.has(m))return!1;let w=a.get(m),C=za(x),S=Va(y),v=Xa(b),M=C.min!==C.max,_=C.min,B=$=>S.kind==="normal"&&$==="normal"||S.kind!=="normal"&&($==="italic"||$==="oblique"),I=!1;for(let $ of w){let A=M?$.w>=C.min&&$.w<=C.max:$.w===_,j=B(yt($.s)),ee=$.st>=v.min&&$.st<=v.max;if(A&&j&&ee){I=!0;break}}if(I)return!0;if(!M)for(let $ of w){let A=B(yt($.s)),j=$.st>=v.min&&$.st<=v.max;if(Math.abs(_-$.w)<=300&&A&&j)return!0}if(!M&&S.kind==="normal"&&w.some($=>yt($.s)!=="normal"))for(let $ of w){let A=Math.abs(_-$.w)<=300,j=$.st>=v.min&&$.st<=v.max;if(A&&j)return!0}return!1}let l=sr(n),s=tl(e,n,r,i,o);if(E.resource?.has(s))return E.resource.get(s);let u=Ka(e),d=[],f=nn;for(let m of document.querySelectorAll("style")){let y=m.textContent||"";for(let x of y.matchAll(f)){let b=(x[2]||x[4]||"").trim();!b||ce(b)||document.querySelector(`link[rel="stylesheet"][href="${b}"]`)||d.push(b)}}d.length&&await Promise.all(d.map(m=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${m}"]`))return y(null);let x=document.createElement("link");x.rel="stylesheet",x.href=m,x.setAttribute("data-snapdom","injected-import"),x.onload=()=>y(x),x.onerror=()=>y(null),document.head.appendChild(x)})));let h="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(m=>!!m.href);for(let m of g)try{if(ce(m.href))continue;let y="",x=!1;try{x=new URL(m.href,location.href).origin===location.origin}catch{}if(!x){let w=Array.isArray(o)?o:[];if(!Ga(m.href,u,w))continue}if(x){let w=Array.from(document.styleSheets).find(C=>C.href===m.href);if(w)try{let C=w.cssRules||[];y=Array.from(C).map(S=>S.cssText).join("")}catch{}}if(!y){let w=await te(m.href,{as:"text",useProxy:i});if(w?.ok&&typeof w.data=="string"&&(y=w.data),ce(m.href))continue}y=await Ja(y,m.href,i);let b="";for(let w of y.match(Za)||[]){let C=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),S=Et(C);if(!S||ce(S))continue;let v=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),M=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),_=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),B=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),I=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),$=fn(I,m.href);if(!c(S,M,v,_))continue;let A=Dr(B);if(!Ir(t,A))continue;let j={family:S,weightSpec:v,styleSpec:M,stretchSpec:_,unicodeRange:B,srcRaw:I,srcUrls:$,href:m.href};if(n&&l(j,A))continue;let ee=/url\(/i.test(I)?await Or(w,m.href,i):w;b+=ee}b.trim()&&(h+=b)}catch{console.warn("[snapDOM] Failed to process stylesheet:",m.href)}let p={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:c,simpleExcluder:n?sr(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let m of document.styleSheets)if(!(m.href&&g.some(y=>y.href===m.href)))try{let y=m.href||location.origin+"/";y&&p.visitedSheets.add(y),await Wr(m,y,async x=>{h+=x},p)}catch{}try{for(let m of document.fonts||[]){if(!m||!m.family||m.status!=="loaded"||!m._snapdomSrc)continue;let y=String(m.family).replace(/^['"]+|['"]+$/g,"");if(ce(y)||!a.has(y)||n?.families&&n.families.some(b=>String(b).toLowerCase()===y.toLowerCase()))continue;let x=m._snapdomSrc;if(!String(x).startsWith("data:")){if(E.resource?.has(m._snapdomSrc))x=E.resource.get(m._snapdomSrc),E.font?.add(m._snapdomSrc);else if(!E.font?.has(m._snapdomSrc))try{let b=await te(m._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(b.ok&&typeof b.data=="string")x=b.data,E.resource?.set(m._snapdomSrc,x),E.font?.add(m._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",m._snapdomSrc);continue}}h+=`@font-face{font-family:'${y}';src:url(${x});font-style:${m.style||"normal"};font-weight:${m.weight||"normal"};}`}}catch{}for(let m of r){if(!m||typeof m!="object")continue;let y=String(m.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||ce(y)||!a.has(y)||n?.families&&n.families.some(v=>String(v).toLowerCase()===y.toLowerCase()))continue;let x=m.weight!=null?String(m.weight):"normal",b=m.style!=null?String(m.style):"normal",w=m.stretchPct!=null?`${m.stretchPct}%`:"100%",C=String(m.src||""),S=C;if(!S.startsWith("data:")){if(E.resource?.has(C))S=E.resource.get(C),E.font?.add(C);else if(!E.font?.has(C))try{let v=await te(C,{as:"dataURL",useProxy:i,silent:!0});if(v.ok&&typeof v.data=="string")S=v.data,E.resource?.set(C,S),E.font?.add(C);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",C);continue}}h+=`@font-face{font-family:'${y}';src:url(${S});font-style:${b};font-weight:${x};font-stretch:${w};}`}return h&&(h=el(h),E.resource?.set(s,h)),h}function Hr(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let c=Et(a.fontFamily);if(!c)return;let l=(s,u,d)=>`${c}__${gt(s)}__${yt(u)}__${ja(d)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))};r(getComputedStyle(e));let i=getComputedStyle(e,"::before");i&&i.content&&i.content!=="none"&&r(i);let o=getComputedStyle(e,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let a=n.currentNode,c=getComputedStyle(a);r(c);let l=getComputedStyle(a,"::before");l&&l.content&&l.content!=="none"&&r(l);let s=getComputedStyle(a,"::after");s&&s.content&&s.content!=="none"&&r(s)}return t}function rl(e){let t=new Set,n=i=>{if(i)for(let o of i)t.add(o.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let i=r.currentNode;if(i.nodeType===Node.TEXT_NODE)n(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let o=i;for(let a of["::before","::after"]){let c=getComputedStyle(o,a)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let l=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(l)for(let s of l)try{t.add(parseInt(s.slice(1),16))}catch{}}}}}return t}async function Br(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let i=document.createElement("div");i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let o of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${o}"`,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",i.appendChild(a)}document.body.appendChild(i),i.offsetWidth,document.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)r(),await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))}ne();function ol(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function il(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function cr(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function ur(e,t=!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,e)),i="";for(let[o,a]of n)for(;r>=o;)i+=a,r-=o;return t?i:i.toLowerCase()}function dr(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,e));case"decimal-leading-zero":return(e<10?"0":"")+String(Math.max(0,e));case"lower-alpha":return cr(e,!1);case"upper-alpha":return cr(e,!0);case"lower-roman":return ur(e,!1);case"upper-roman":return ur(e,!0);default:return String(Math.max(0,e))}}function al(e){let t=()=>E?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,o=f=>f&&f.tagName==="LI",a=f=>{let h=0,g=f?.parentElement;if(!g)return 0;for(let p of g.children){if(p===f)break;p.tagName==="LI"&&h++}return h},c=f=>{let h=new Map;for(let[g,p]of f)h.set(g,p.slice());return h},l=(f,h,g)=>{let p=c(f),m;try{m=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(m&&m!=="none")for(let x of m.split(",")){let b=x.trim().split(/\s+/),w=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!w)continue;let S=h.get(w);if(S&&S.length){let v=S.slice();v.push(C),p.set(w,v)}else p.set(w,[C])}let y;try{y=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(y&&y!=="none")for(let x of y.split(",")){let b=x.trim().split(/\s+/),w=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!w)continue;let S=p.get(w)||[];S.length===0&&S.push(0),S[S.length-1]+=C,p.set(w,S)}try{if(getComputedStyle(g).display==="list-item"&&o(g)){let x=g.parentElement,b=1;if(x&&x.tagName==="OL"){let C=x.getAttribute("start"),S=Number.isFinite(Number(C))?Number(C):1,v=a(g),M=g.getAttribute("value");b=Number.isFinite(Number(M))?Number(M):S+v}else b=1+a(g);let w=p.get("list-item")||[];w.length===0&&w.push(0),w[w.length-1]=b,p.set("list-item",w)}}catch{}return p},s=(f,h,g)=>{let p=l(g,h,f);r.set(f,p);let m=p;for(let y of f.children)m=s(y,p,m);return p},u=new Map;s(i,u,u);function d(){let f=t();if(f!==n){n=f;let h=new Map;s(i,h,h)}}return{get(f,h){d();let g=r.get(f)?.get(h);return g&&g.length?g[g.length-1]:0},getStack(f,h){d();let g=r.get(f)?.get(h);return g?g.slice():[]}}}function ll(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,i=e.replace(r,(o,a,c)=>{let l=String(c).split(",").map(s=>s.trim());if(a==="counter"){let s=l[0]?.replace(/^["']|["']$/g,""),u=(l[1]||"decimal").toLowerCase(),d=n.get(t,s);return dr(d,u)}else{let s=l[0]?.replace(/^["']|["']$/g,""),u=l[1]?.replace(/^["']|["']$/g,"")??"",d=(l[2]||"decimal").toLowerCase(),f=n.getStack(t,s);return f.length?f.map(h=>dr(h,d)).join(u):""}});return il(i)}catch{return"- "}}_e();ne();var Te=new WeakMap,fr=300;function sl(e,t){let n=Ur(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=pr(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):pr(e)}function rn(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Ur(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let o=0;o<t.length;o++){let a=t[o];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let l=a.sheet,s=l?rn(l):null;s&&(r+=s.length)}else{let c=a.getAttribute("href")||"",l=a.getAttribute("media")||"all";n+=`L${c}|m:${l}|`;let s=a.sheet,u=s?rn(s):null;u&&(r+=u.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function mr(e,t,n){let r=rn(e);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],a=o&&o.cssText?o.cssText:"";n.budget--;for(let c of t)if(a.includes(c))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let c=0;c<o.cssRules.length&&n.budget>0;c++){let l=o.cssRules[c],s=l&&l.cssText?l.cssText:"";n.budget--;for(let u of t)if(s.includes(u))return!0}if(n.budget<=0)return!1}return!1}function pr(e=document){let t=Ur(e),n=Te.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],i=e.querySelectorAll("style");for(let a=0;a<i.length;a++){let c=i[a].textContent||"";for(let l of r)if(c.includes(l))return Te.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:fr};try{for(let c of o)if(mr(c,r,a))return Te.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:fr};for(let l=0;l<a.length&&c.budget>0;l++){let s=a[l],u=null;if(s.tagName,u=s.sheet||null,u&&mr(u,r,c))return Te.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Te.set(e,{fingerprint:t,result:!0}),!0):(Te.set(e,{fingerprint:t,result:!1}),!1)}var Pe=new WeakMap,hr=-1;function cl(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function ul(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):cl(e)}function on(e,t){let n=e.parentElement,r=n?Pe.get(n):null;return r?{get(i,o){let a=t.get(i,o),c=r.get(o);return typeof c=="number"?Math.max(a,c):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let c=r.get(o);if(typeof c=="number"){let l=a.slice();return l[l.length-1]=Math.max(l[l.length-1],c),l}return a}}:t}function an(e,t,n){let r=new Map;function i(l){let s=[];if(!l||l==="none")return s;for(let u of String(l).split(",")){let d=u.trim().split(/\s+/),f=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&s.push({name:f,num:h})}return s}let o=i(t?.counterReset),a=i(t?.counterIncrement);function c(l){if(r.has(l))return r.get(l).slice();let s=n.getStack(e,l);s=s.length?s.slice():[];let u=o.find(f=>f.name===l);if(u){let f=Number.isFinite(u.num)?u.num:0;s=s.length?[...s,f]:[f]}let d=a.find(f=>f.name===l);if(d){let f=Number.isFinite(d.num)?d.num:1;s.length===0&&(s=[0]),s[s.length-1]+=f}return r.set(l,s.slice()),s}return{get(l,s){let u=c(s);return u.length?u[u.length-1]:0},getStack(l,s){return c(s)},__incs:a}}function dl(e,t,n){let r;try{r=ue(e,t)}catch{}let i=r?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=on(e,n),a=an(e,r,o),c=ol(i)?ll(i,e,a):i;return{text:ul(c),incs:a.__incs||[]}}async function ln(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!sl(i,n))return;let o=E?.session?.__counterEpoch??0;if(hr!==o&&(Pe=new WeakMap,n&&(n.__counterCtx=null),hr=o),!n.__counterCtx)try{n.__counterCtx=al(e.ownerDocument||document)}catch(l){F(n,"buildCounterContext failed",l)}let a=n.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let s=ue(e,l);if(!s||s.content==="none"&&s.backgroundImage==="none"&&s.backgroundColor==="transparent"&&(s.borderStyle==="none"||parseFloat(s.borderWidth)===0)&&(!s.transform||s.transform==="none")&&s.display==="inline")continue;if(l==="::first-letter"){let R=ue(e);if(!(s.color!==R.color||s.fontSize!==R.fontSize||s.fontWeight!==R.fontWeight))continue;let N=Array.from(t.childNodes).find(He=>He.nodeType===Node.TEXT_NODE&&He.textContent?.trim().length>0);if(!N)continue;let W=N.textContent,O=W.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],me=W.slice(O?.length||0);if(!O||/[\uD800-\uDFFF]/.test(O))continue;let ae=document.createElement("span");ae.textContent=O,ae.dataset.snapdomPseudo="::first-letter";let ke=Jn(s),Me=Kt(ke,"span");n.styleMap.set(ae,Me);let we=document.createTextNode(me);t.replaceChild(we,N),t.insertBefore(ae,we);continue}let u=s.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:h}=dl(e,l,a),g=s.backgroundImage,p=s.backgroundColor,m=s.fontFamily,y=parseInt(s.fontSize)||32,x=parseInt(s.fontWeight)||!1,b=s.color||"#000",w=s.borderStyle,C=parseFloat(s.borderWidth),S=s.transform,v=ce(m),M=!d&&f!=="",_=g&&g!=="none",B=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",I=w&&w!=="none"&&C>0,$=S&&S!=="none";if(!(M||_||B||I||$)){if(h&&h.length&&e.parentElement){let R=Pe.get(e.parentElement)||new Map;for(let{name:N}of h){if(!N)continue;let W=on(e,a),O=an(e,ue(e,l),W).get(e,N);R.set(N,O)}Pe.set(e.parentElement,R)}continue}let A=document.createElement("span");A.dataset.snapdomPseudo=l,A.style.pointerEvents="none";let j=Jn(s),ee=Kt(j,"span");if(n.styleMap.set(A,ee),v&&f&&f.length===1){let{dataUrl:R,width:N,height:W}=await Ba(f,m,x,y,b),O=document.createElement("img");O.src=R,O.style=`height:${y}px;width:${N/W*y}px;object-fit:contain;`,A.appendChild(O),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let R=cn(f);if(R?.trim())try{let N=await te(wt(R),{as:"dataURL",useProxy:r.useProxy});if(N?.ok&&typeof N.data=="string"){let W=document.createElement("img");W.src=N.data,W.style=`width:${y}px;height:auto;object-fit:contain;`,A.appendChild(W)}}catch(N){console.error(`[snapdom] Error in pseudo ${l} for`,e,N)}}else!v&&M&&(A.textContent=f);A.style.backgroundImage="none","maskImage"in A.style&&(A.style.maskImage="none"),"webkitMaskImage"in A.style&&(A.style.webkitMaskImage="none");try{A.style.backgroundRepeat=s.backgroundRepeat,A.style.backgroundSize=s.backgroundSize,s.backgroundPositionX&&s.backgroundPositionY?(A.style.backgroundPositionX=s.backgroundPositionX,A.style.backgroundPositionY=s.backgroundPositionY):A.style.backgroundPosition=s.backgroundPosition,A.style.backgroundOrigin=s.backgroundOrigin,A.style.backgroundClip=s.backgroundClip,A.style.backgroundAttachment=s.backgroundAttachment,A.style.backgroundBlendMode=s.backgroundBlendMode}catch{}if(_)try{let R=Jt(g),N=await Promise.all(R.map(xr));A.style.backgroundImage=N.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${l}`,R)}B&&(A.style.backgroundColor=p);let nt=A.childNodes.length>0||A.textContent?.trim()!==""||_||B||I||$;if(h&&h.length&&e.parentElement){let R=Pe.get(e.parentElement)||new Map,N=on(e,a),W=an(e,ue(e,l),N);for(let{name:O}of h){if(!O)continue;let me=W.get(e,O);R.set(O,me)}Pe.set(e.parentElement,R)}if(!nt)continue;l==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(A,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(A))}catch(s){console.warn(`[snapdom] Failed to capture ${l} for`,e,s)}let c=Array.from(t.children).filter(l=>!l.dataset.snapdomPseudo);if(n.nodeMap)for(let l of c){let s=n.nodeMap.get(l);s instanceof Element&&await ln(s,l,n,r)}else{let l=Array.from(e.children);for(let s=0;s<Math.min(l.length,c.length);s++)await ln(l[s],c[s],n,r)}}function fl(e,t){if(!e||!(e instanceof Element))return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(i.length===0)return;let o=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",s=w=>{if(!w||!w.getAttribute)return null;let C=w.getAttribute("href")||w.getAttribute("xlink:href")||(typeof w.getAttributeNS=="function"?w.getAttributeNS(l,"href"):null);if(C)return C;let S=w.attributes;if(!S)return null;for(let v=0;v<S.length;v++){let M=S[v];if(!M||!M.name)continue;if(M.name==="href")return M.value;let _=M.name.indexOf(":");if(_!==-1&&M.name.slice(_+1)==="href")return M.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(w=>w.id)),d=new Set,f=!1,h=(w,C=null)=>{if(!w)return;o.lastIndex=0;let S;for(;S=o.exec(w);){f=!0;let v=(S[1]||"").trim();v&&(u.has(v)||(d.add(v),C&&!C.has(v)&&C.add(v)))}},g=w=>{let C=w.querySelectorAll("use");for(let v of C){let M=s(v);if(!M||!M.startsWith("#"))continue;f=!0;let _=M.slice(1).trim();_&&!u.has(_)&&d.add(_)}let S=w.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let v of S){h(v.getAttribute("style")||"");for(let M of a)h(v.getAttribute(M))}};for(let w of i)g(w);if(!f)return;let p=e.querySelector("svg.inline-defs-container");p||(p=n.createElementNS("http://www.w3.org/2000/svg","svg"),p.classList.add("inline-defs-container"),p.setAttribute("aria-hidden","true"),p.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(p,e.firstChild||null));let m=p.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let C=c(w),S=v=>{let M=r.querySelector(v);return M&&!e.contains(M)?M:null};return S(`svg defs > *#${C}`)||S(`svg > symbol#${C}`)||S(`*#${C}`)};if(!d.size)return;let x=new Set(d),b=new Set;for(;x.size;){let w=x.values().next().value;if(x.delete(w),!w||u.has(w)||b.has(w))continue;let C=y(w);if(!C){b.add(w);continue}m||(m=n.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(m));let S=C.cloneNode(!0);S.id||S.setAttribute("id",w),m.appendChild(S),b.add(w),u.add(w);let v=[S,...S.querySelectorAll("*")];for(let M of v){let _=s(M);if(_&&_.startsWith("#")){let I=_.slice(1).trim();I&&!u.has(I)&&!b.has(I)&&x.add(I)}let B=M.getAttribute?.("style")||"";B&&h(B,x);for(let I of a){let $=M.getAttribute?.(I);$&&h($,x)}}}}ne();function ml(e,t){if(!e||!t)return;let n=e.scrollTop||0;if(!n)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let r=e.getBoundingClientRect(),i=e.clientHeight,o="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let c=a.currentNode,l=getComputedStyle(c),s=l.position;if(s!=="sticky"&&s!=="-webkit-sticky")continue;let u=gr(l.top),d=gr(l.bottom);if(u==null&&d==null)continue;let f=pl(c,e),h=hl(t,f,o);if(!h)continue;let g=c.getBoundingClientRect(),p=g.width,m=g.height,y=g.left-r.left;if(!(p>0&&m>0)||!Number.isFinite(y))continue;let x=u!=null?u+n:n+(i-m-d);if(!Number.isFinite(x))continue;let b=Number.parseInt(l.zIndex,10),w=Number.isFinite(b),C=w?Math.max(b,1)+1:2,S=w?b-1:0,v=h.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${y}px`,v.style.top=`${x}px`,v.style.width=`${p}px`,v.style.height=`${m}px`,v.style.visibility="hidden",v.style.zIndex=String(S),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",h.parentElement?.insertBefore(v,h),h.style.position="absolute",h.style.left=`${y}px`,h.style.top=`${x}px`,h.style.bottom="auto",h.style.zIndex=String(C),h.style.pointerEvents="none"}}function gr(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function pl(e,t){let n=[];for(let r=e;r&&r!==t;){let i=r.parentElement;if(!i)break;n.push(Array.prototype.indexOf.call(i.children,r)),r=i}return n.reverse()}function hl(e,t,n){let r=e;for(let i=0;i<t.length;i++)if(r=gl(r,n)[t[i]],!r)return null;return r instanceof HTMLElement?r:null}function gl(e,t){let n=[],r=e.children;for(let i=0;i<r.length;i++){let o=r[i];o.hasAttribute(t)||n.push(o)}return n}function yl(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,c=i==="none"||parseFloat(o)===0;a&&c&&(e.style.border=`${r} solid transparent`)}async function wl(e,t={}){let n={styleMap:E.session.styleMap,styleCache:E.session.styleCache,nodeMap:E.session.nodeMap,options:t},r,i="",o="";yl(e);try{fl(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await ht(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{await ln(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await Na(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let s of l)o+=s.textContent||"",s.remove()}catch(l){F(n,"Failed to extract shadow CSS from style[data-sd]",l)}let a=Oi(n.styleMap);i=Array.from(a.entries()).map(([l,s])=>`.${s}{${l}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[l,s]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",s.replace(/;/g,"; "));continue}let u=a.get(s);u&&l.classList.add(u);let d=l.style?.backgroundImage,f=l.dataset?.snapdomHasIcon;d&&d!=="none"&&(l.style.backgroundImage=d),f&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,s]of n.nodeMap.entries()){let u=s.scrollLeft,d=s.scrollTop;if((u||d)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let f=document.createElement("div");for(f.style.transform=`translate(${-u}px, ${-d}px)`,f.style.willChange="transform",f.style.display="inline-block",f.style.width="100%";l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f)}}let c=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(ml(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||ue(e);n.styleCache.set(e,l);let s=Mi(l.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=s||""}for(let[l,s]of n.nodeMap.entries())s.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:i,styleCache:n.styleCache}}_e();var qr="http://www.w3.org/1999/xlink";function bl(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(qr,"href"):null)}function xl(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,o=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,c=t||o||r||e.width||e.naturalWidth||100,l=n||a||i||e.height||e.naturalHeight||100;return{width:c,height:l}}async function vl(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let f=a.currentSrc||a.src||"";f&&a.setAttribute("src",f)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){a.src=l.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:s,height:u}=xl(a),{fallbackURL:d}=t||{};if(d)try{let f=typeof d=="function"?await d({width:s,height:u,src:c,element:a}):d;if(f){let h=await te(f,{as:"dataURL",useProxy:t.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=s),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${s}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",a.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${s}px;height:${u}px;visibility:hidden;`,a.replaceWith(f)}};for(let a=0;a<n.length;a+=4){let c=n.slice(a,a+4).map(r);await Promise.allSettled(c)}let i=Array.from(e.querySelectorAll("image")),o=async a=>{let c=bl(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")&&(a.setAttribute("href",l.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(qr,"href"))};for(let a=0;a<i.length;a+=4){let c=i.slice(a,a+4).map(o);await Promise.allSettled(c)}}re();async function Sl(e,t,n,r={}){let i=[[e,t]],o=["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"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],c=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){let[s,u]=i.shift();if(!u)continue;let d=n.get(s)||ue(s);n.has(s)||n.set(s,d);let f=(()=>{let p=d.getPropertyValue("border-image"),m=d.getPropertyValue("border-image-source");return p&&p!=="none"||m&&m!=="none"})();for(let p of c){let m=d.getPropertyValue(p);m&&u.style.setProperty(p,m)}for(let p of o){let m=d.getPropertyValue(p);if(p==="background-image"&&(!m||m==="none")){let b=d.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(m=Jt(b).find(w=>/url\s*\(/.test(w))||m)}if(!m||m==="none")continue;let y=Jt(m),x=await Promise.all(y.map(b=>xr(b,r)));x.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&u.style.setProperty(p,x.join(", "))}for(let p of a){let m=d.getPropertyValue(p);!m||m==="initial"||u.style.setProperty(p,m)}if(f)for(let p of l){let m=d.getPropertyValue(p);!m||m==="initial"||u.style.setProperty(p,m)}let h=s.shadowRoot?Array.from(s.shadowRoot.children).filter(p=>p.tagName!=="STYLE"):Array.from(s.children),g=Array.from(u.children).filter(p=>!(p.dataset?.snapdomPseudo||p.tagName==="STYLE"&&p.dataset?.sd));for(let p=0;p<Math.min(h.length,g.length);p++)i.push([h[p],g[p]])}}re();ne();function El(e){if(!e)return()=>{};let t=[];function n(r){let i=Cl(r);i&&t.push(i);for(let o of r.children||[])n(o)}return n(e),()=>t.forEach(r=>r())}function Cl(e){if(!e)return()=>{};let t=kl(e);if(t<=0)return()=>{};if(!$l(e))return()=>{};let n=getComputedStyle(e),r=Math.round(Ml(n)*t+Al(n)),i=e.textContent??"",o=i;if(e.scrollHeight<=r+.5)return()=>{};let a=0,c=i.length,l=-1;for(;a<=c;){let s=a+c>>1;e.textContent=i.slice(0,s)+"\u2026",e.scrollHeight<=r+.5?(l=s,a=s+1):c=s-1}return e.textContent=(l>=0?i.slice(0,l):"")+"\u2026",()=>{e.textContent=o}}function kl(e){let t=getComputedStyle(e),n=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function Ml(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(n*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function Al(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function $l(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Ge=[];function jr(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t=="function"?t(n):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:n}=e;return typeof t=="function"?t(n):t}return typeof e=="function"?e():e}function Ll(...e){let t=e.flat();for(let n of t){let r=jr(n);r&&(Ge.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ge.push(r))}}function zr(e){return(e&&Array.isArray(e.plugins)?e.plugins:Ge)||Ge}async function ye(e,t,n){let r=n,i=zr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,r);typeof c<"u"&&(r=c)}return r}async function Tl(e,t,n){let r=[],i=zr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,n);typeof c<"u"&&r.push(c)}return r}function Nl(e){let t=[];if(Array.isArray(e))for(let n of e){let r=jr(n);if(!r||!r.name)continue;let i=t.findIndex(o=>o&&o.name===r.name);i>=0&&t.splice(i,1),t.push(r)}for(let n of Ge)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function Rl(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=Nl(t)),e}re();function Pl(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){F(n,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){F(n,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){F(n,"stripRootShadows outline",o)}let i=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(o){F(n,"stripRootShadows filter",o)}}function _l(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let r of n)r.remove()}function Fl(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let o=i.currentNode;for(let a of Array.from(o.attributes)){let c=a.name;if(c.includes("@")){o.removeAttribute(c);continue}if(c.includes(":")){let l=c.split(":",1)[0];if(!r.has(l)){o.removeAttribute(c);continue}}if(n&&(c.startsWith("x-")||c.startsWith("v-")||c.startsWith(":")||c.startsWith("on:")||c.startsWith("bind:")||c.startsWith("let:")||c.startsWith("class:"))){o.removeAttribute(c);continue}}}}function Dl(e,t={}){e&&(Fl(e,t),_l(e))}function Il(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Ol(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Wl(e,t){if(!(e instanceof Element)||Il(e)||Ol(e))return!1;let n=t.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&t.transform!=="none")}function Hl(e,t,n=new Map){function r(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,c=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,c),a&&Wl(i,c)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let u=c.overflowY||c.overflowBlock||"visible",d=c.overflowX||c.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(o.style.overflow="visible")}let l=Array.from(i.children),s=Array.from(o.children);for(let u=0;u<Math.min(l.length,s.length);u++)r(l[u],s[u])}r(e,t)}function Bl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Ul(e,t){if(!(e instanceof Element))return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return t.excludeMode==="remove"}catch(r){F(t,"exclude selector match failed",r)}return!1}function ql(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,c=Array.from(e.children);for(let h of c){if(Ul(h,t)||!Bl(h))continue;let g=h.getBoundingClientRect(),p=g.top-r.top,m=g.bottom-r.top;m<=p||(p<i&&(i=p),m>o&&(o=m),a=!0)}let l=a?Math.max(0,o-i):0,s=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return s+u+d+f+l}var k=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,jl=/::-webkit-scrollbar(-[a-z]+)?\b/i;function sn(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=sn(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=sn(i.cssRules,t);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(jl.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function zl(e){if(!e||!e.styleSheets)return"";let t=new Set,n="";for(let r of Array.from(e.styleSheets))try{let i=r.cssRules;i&&(n+=sn(i,t))}catch{}return n}function Vl(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(c=>c.trim()),r=0,i=0,o=0,a=0;for(let c of n){let l=c.match(/-?\d+(\.\d+)?px/g)?.map(p=>parseFloat(p))||[];if(l.length<2)continue;let[s,u,d=0,f=0]=l,h=Math.abs(s)+d+f,g=Math.abs(u)+d+f;i=Math.max(i,h+Math.max(s,0)),a=Math.max(a,h+Math.max(-s,0)),o=Math.max(o,g+Math.max(u,0)),r=Math.max(r,g+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(i),bottom:Math.ceil(o),left:Math.ceil(a)}}function Xl(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=t?Math.ceil(parseFloat(t[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function Yl(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0);return{top:t,right:t,bottom:t,left:t}}function Gl(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,a=0,c=!1;for(let l of n){c=!0;let s=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[u=0,d=0,f=0]=s,h=Math.abs(u)+f,g=Math.abs(d)+f;i=Math.max(i,h+Math.max(u,0)),a=Math.max(a,h+Math.max(-u,0)),o=Math.max(o,g+Math.max(d,0)),r=Math.max(r,g+Math.max(-d,0))}return{bleed:{top:k(r),right:k(i),bottom:k(o),left:k(a)},has:c}}function Kl(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let o=Vr(e);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let o=i[1].split(",").map(a=>parseFloat(a.trim()));if(o.length===6&&o.every(Number.isFinite)){let[a,c,l,s]=o,u=Math.sqrt(a*a+c*c)||0,d=0,f=0,h=0,g=0,p=0,m=0;u>0&&(d=a/u,f=c/u,h=d*l+f*s,g=l-d*h,p=s-f*h,m=Math.sqrt(g*g+p*p)||0,m>0?h=h/m:h=0);let y=u,x=0,b=h*m,w=m;try{t.style.transform=`matrix(${y}, ${x}, ${b}, ${w}, 0, 0)`}catch{}return{a:y,b:x,c:b,d:w}}}try{let o=String(r).trim();return t.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function yr(e,t,n,r,i){let o=n.a,a=n.b,c=n.c,l=n.d,s=n.e||0,u=n.f||0;function d(y,x){let b=y-r,w=x-i,C=o*b+c*w,S=a*b+l*w;return C+=r+s,S+=i+u,[C,S]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],h=1/0,g=1/0,p=-1/0,m=-1/0;for(let[y,x]of f)y<h&&(h=y),x<g&&(g=x),y>p&&(p=y),x>m&&(m=x);return{minX:h,minY:g,maxX:p,maxY:m,width:p-h,height:m-g}}function Jl(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],a=(c,l)=>{let s=c.toLowerCase();return s==="left"||s==="top"?0:s==="center"?l/2:s==="right"||s==="bottom"?l:s.endsWith("px")?parseFloat(s)||0:s.endsWith("%")?(parseFloat(s)||0)*l/100:/^-?\d+(\.\d+)?$/.test(s)&&parseFloat(s)||0};return{ox:a(i,t),oy:a(o,n)}}function Zl(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let i=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=i("rotate");if(o)if(o.angle){let l=o.angle;t.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else o.unit?t.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:t.rotate=String(o);else{let l=getComputedStyle(e);t.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=i("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,s="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;t.scale=`${l} ${s}`}else{let l=getComputedStyle(e);t.scale=l.scale&&l.scale!=="none"?l.scale:null}let c=i("translate");if(c){let l="x"in c&&"value"in c.x?c.x.value:Array.isArray(c)?c[0]?.value:0,s="y"in c&&"value"in c.y?c.y.value:Array.isArray(c)?c[1]?.value:0,u="x"in c&&c.x?.unit?c.x.unit:"px",d="y"in c&&c.y?.unit?c.y.unit:"px";t.translate=`${l}${u} ${s}${d}`}else{let l=getComputedStyle(e);t.translate=l.translate&&l.translate!=="none"?l.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",t.scale=r.scale&&r.scale!=="none"?r.scale:null,t.translate=r.translate&&r.translate!=="none"?r.translate:null,t}var Yt=null;function Ql(){if(Yt)return Yt;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Yt=e,e}function es(e){let t=Ql(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=Vr(n);return t.removeChild(n),r}function ts(e){let t=getComputedStyle(e),n=t.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 r=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",i=t.scale&&t.scale!=="none"&&t.scale!=="1",o=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||i||o)}function Vr(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function Xr(e,t){if(!e)throw new Error("Element cannot be null or undefined");ki(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,c,l,s="",u="",d,f,h=null;await ye("beforeSnap",o),await ye("beforeClone",o);let g=El(o.element);try{({clone:a,classCSS:c,styleCache:l}=await wl(o.element,o.options)),!r&&a&&(h=Kl(o.element,a)),!i&&a&&Pl(o.element,a,o.options)}finally{g()}if(o={clone:a,classCSS:c,styleCache:l,...o},await ye("afterClone",o),Dl(o.clone),o.options?.excludeMode==="remove")try{Hl(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await Ha(o.clone,o.element)}catch{}await new Promise(b=>{Ne(async()=>{await vl(o.clone,o.options),b()},{fast:n})}),await new Promise(b=>{Ne(async()=>{await Sl(o.element,o.clone,o.styleCache,o.options),b()},{fast:n})}),t.embedFonts&&await new Promise(b=>{Ne(async()=>{let w=Hr(o.element),C=rl(o.element);if(Se()){let S=new Set(Array.from(w).map(v=>String(v).split("__")[0]).filter(Boolean));await Br(S,1)}s=await nl({required:w,usedCodepoints:C,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),b()},{fast:n})});let p=Di(o.clone).sort(),m=p.join(",");E.baseStyle.has(m)?u=E.baseStyle.get(m):await new Promise(b=>{Ne(()=>{u=Ii(p),E.baseStyle.set(m,u),b()},{fast:n})});let y=zl(o.element?.ownerDocument||document);o={fontsCSS:s,baseCSS:u,scrollbarCSS:y,...o},await ye("beforeRender",o),await new Promise(b=>{Ne(()=>{let w=ue(o.element),C=o.element.getBoundingClientRect(),S=Math.max(1,k(o.element.offsetWidth||parseFloat(w.width)||C.width||1)),v=Math.max(1,k(o.element.offsetHeight||parseFloat(w.height)||C.height||1)),M=o.element.ownerDocument||document;if(o.element===M.body||o.element===M.documentElement){let V=Math.max(o.element.scrollHeight||0,M.documentElement?.scrollHeight||0,M.body?.scrollHeight||0),Y=Math.max(o.element.scrollWidth||0,M.documentElement?.scrollWidth||0,M.body?.scrollWidth||0);V>0&&(v=Math.max(v,k(V))),Y>0&&(S=Math.max(S,k(Y)));try{let X=M.createElement("div");X.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+S+"px!important;overflow:visible!important;visibility:hidden!important;";let ot=M.createElement("style");ot.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,X.appendChild(ot),X.appendChild(o.clone.cloneNode(!0)),M.body.appendChild(X);let it=X.scrollHeight,at=X.scrollWidth;M.body.removeChild(X),it>0&&(v=Math.max(v,k(it))),at>0&&(S=Math.max(S,k(at)))}catch{}}if(o.options?.excludeMode==="remove"){let V=ql(o.element,o.options);Number.isFinite(V)&&V>0&&(v=Math.max(1,Math.min(v,k(V+1))))}let _=(V,Y=NaN)=>{let X=typeof V=="string"?parseFloat(V):V;return Number.isFinite(X)?X:Y},B=_(o.options.width),I=_(o.options.height),$=S,A=v,j=Number.isFinite(B),ee=Number.isFinite(I),nt=v>0?S/v:1;j&&ee?($=Math.max(1,k(B)),A=Math.max(1,k(I))):j?($=Math.max(1,k(B)),A=Math.max(1,k($/(nt||1)))):ee?(A=Math.max(1,k(I)),$=Math.max(1,k(A*(nt||1)))):($=S,A=v);let R=0,N=0,W=S,O=v;if(!r&&h&&Number.isFinite(h.a)){let V={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},Y=yr(S,v,V,0,0);R=k(Y.minX),N=k(Y.minY),W=k(Y.maxX),O=k(Y.maxY)}else if(r&&wr(o.element)){let V=w.transform&&w.transform!=="none"?w.transform:"",Y=Zl(o.element),X=es({baseTransform:V,rotate:Y.rotate||"0deg",scale:Y.scale,translate:Y.translate}),{ox:ot,oy:it}=Jl(w,S,v),at=X.is2D?X:new DOMMatrix(X.toString()),lt=yr(S,v,at,ot,it);R=k(lt.minX),N=k(lt.minY),W=k(lt.maxX),O=k(lt.maxY)}let me=Vl(w),ae=Xl(w),ke=Yl(w),Me=Gl(w),we=i?{top:k(me.top+ae.top+ke.top+Me.bleed.top),right:k(me.right+ae.right+ke.right+Me.bleed.right),bottom:k(me.bottom+ae.bottom+ke.bottom+Me.bleed.bottom),left:k(me.left+ae.left+ke.left+Me.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=k(R-we.left),N=k(N-we.top),W=k(W+we.right),O=k(O+we.bottom);let He=Math.max(1,k(W-R)),En=Math.max(1,k(O-N)),qo=j||ee?k($/S):1,jo=ee||j?k(A/v):1,zo=Math.max(1,k(He*qo)),Vo=Math.max(1,k(En*jo)),Cn="http://www.w3.org/2000/svg",Xo=Se()&&wr(o.element)?1:0,pe=k(Xo+(r?0:1)),he=document.createElementNS(Cn,"foreignObject"),Yo=k(R),Go=k(N);he.setAttribute("x",String(k(-(Yo-pe)))),he.setAttribute("y",String(k(-(Go-pe)))),he.setAttribute("width",String(k(S+pe*2))),he.setAttribute("height",String(k(v+pe*2))),he.style.overflow="visible";let kn=document.createElement("style");kn.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,he.appendChild(kn);let rt=document.createElement("div");rt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),rt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${k(S)}px;height:${k(v)}px`,rt.appendChild(o.clone),he.appendChild(rt);let Ko=new XMLSerializer().serializeToString(he),Dt=k(He+pe*2),It=k(En+pe*2),Mn=j||ee;t.meta={w0:S,h0:v,vbW:Dt,vbH:It,targetW:$,targetH:A};let Jo=Se()&&Mn?Dt:k(zo+pe*2),Zo=Se()&&Mn?It:k(Vo+pe*2),Qo=parseFloat(ue(M.documentElement)?.fontSize)||16;f=`<svg xmlns="${Cn}" width="${Jo}" height="${Zo}" viewBox="0 0 ${Dt} ${It}" font-size="${Qo}px">`+Ko+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,o={svgString:f,dataURL:d,...o},b()},{fast:n})}),await ye("afterRender",o);let x=document.getElementById("snapdom-sandbox");return x&&x.style.position==="absolute"&&x.remove(),o.dataURL}function wr(e){return ts(e)}ne();function ns(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=Ci(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null}}Je();Mr();re();_e();ne();function rs(...e){return Ll(...e),P}var P=Object.assign(is,{plugins:rs}),Yr=Symbol("snapdom.internal"),os=Symbol("snapdom.internal.silent"),br=!1;async function is(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=ns(t);if(Rl(n,t&&t.plugins),Se()&&(n.embedFonts===!0||ls(e))){if(n.embedFonts)try{let i=Hr(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await Br(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let i=0;i<r;i++)try{await as(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&Pa(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>P.toPng(r,i),toSvg:(r,i)=>P.toSvg(r,i)}),P.capture(e,n,Yr)}P.capture=async(e,t,n)=>{if(n!==Yr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Xr(e,t),i={img:async(p,m)=>{let{toImg:y}=await Promise.resolve().then(()=>(Qn(),Zt));return y(r,{...p,...m||{}})},svg:async(p,m)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Qn(),Zt));return y(r,{...p,...m||{}})},canvas:async(p,m)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(St(),Ar));return y(r,{...p,...m||{}})},blob:async(p,m)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Rr(),Tr));return y(r,{...p,...m||{}})},png:async(p,m)=>{let{rasterize:y}=await Promise.resolve().then(()=>(pt(),mt));return y(r,{...p,...m||{},format:"png"})},jpeg:async(p,m)=>{let{rasterize:y}=await Promise.resolve().then(()=>(pt(),mt));return y(r,{...p,...m||{},format:"jpeg"})},webp:async(p,m)=>{let{rasterize:y}=await Promise.resolve().then(()=>(pt(),mt));return y(r,{...p,...m||{},format:"webp"})},download:async(p,m)=>{let{download:y}=await Promise.resolve().then(()=>(Zi(),Pr));return y(r,{...p,...m||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async m=>i[p](t,{...m||{},[os]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},c=await Tl("defineExports",a),l=Object.assign({},...c.filter(p=>p&&typeof p=="object")),s={...i,...l};s.jpeg&&!s.jpg&&(s.jpg=(p,m)=>s.jpeg(p,m));function u(p,m){let y={...t,...m||{}};return(p==="jpeg"||p==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function h(p,m){let y=async()=>{let x=s[p];if(!x)throw new Error(`[snapdom] Unknown export type: ${p}`);let b=u(p,m),w={...t,export:{type:p,options:b,url:r}};await ye("beforeExport",w);let C=await x(w,b);return await ye("afterExport",w,C),d||(d=!0,await ye("afterSnap",t)),C};return f=f.then(y)}let g={url:r,toRaw:()=>r,to:(p,m)=>h(p,m),toImg:p=>h("img",p),toSvg:p=>h("svg",p),toCanvas:p=>h("canvas",p),toBlob:p=>h("blob",p),toPng:p=>h("png",p),toJpg:p=>h("jpg",p),toWebp:p=>h("webp",p),download:p=>h("download",p)};for(let p of Object.keys(s)){let m="to"+p.charAt(0).toUpperCase()+p.slice(1);g[m]||(g[m]=y=>h(p,y))}return g};P.toRaw=(e,t)=>P(e,t).then(n=>n.toRaw());P.toImg=(e,t)=>P(e,t).then(n=>n.toImg());P.toSvg=(e,t)=>P(e,t).then(n=>n.toSvg());P.toCanvas=(e,t)=>P(e,t).then(n=>n.toCanvas());P.toBlob=(e,t)=>P(e,t).then(n=>n.toBlob());P.toPng=(e,t)=>P(e,{...t,format:"png"}).then(n=>n.toPng());P.toJpg=(e,t)=>P(e,{...t,format:"jpeg"}).then(n=>n.toJpg());P.toWebp=(e,t)=>P(e,{...t,format:"webp"}).then(n=>n.toWebp());P.download=(e,t)=>P(e,t).then(n=>n.download());async function as(e,t){if(br)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Xr(e,n)}catch(i){F(t,"safariWarmup pre-capture failed",i)}await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),r&&await new Promise(i=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){F(t,"safariWarmup img hints failed",a)}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(c){F(t,"safariWarmup img.decode failed",c)}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)await new Promise(c=>setTimeout(c,200));await new Promise(c=>requestAnimationFrame(c));try{let c=document.createElement("canvas");c.width=Math.max(1,o.naturalWidth||10),c.height=Math.max(1,o.naturalHeight||10);let l=c.getContext("2d");l&&l.drawImage(o,0,0)}catch{}await new Promise(c=>requestAnimationFrame(c));try{o.remove()}catch(c){F(t,"safariWarmup img.remove failed",c)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){F(t,"safariWarmup canvas poke failed",o)}}),br=!0}function ls(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),i=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(i||o||n.tagName==="CANVAS")return!0}return!1}var Gr=!1,mn=null;function Kr(e){if(e.getAttribute("crossorigin")!==null||!e.rel||!e.rel.includes("stylesheet"))return!1;let t=e.href||"";try{return new URL(t).origin!==window.location.origin}catch{return!1}}function Jr(e){return new Promise(t=>{let n=document.createElement("link");n.rel="stylesheet",n.href=e.href,n.crossOrigin="anonymous",e.media&&(n.media=e.media),n.onload=()=>{e.remove(),t()},n.onerror=()=>{t()},e.parentNode?.insertBefore(n,e.nextSibling)})}async function Zr(){let e=document.querySelectorAll('link[rel~="stylesheet"]'),t=[];for(let n of e)Kr(n)&&t.push(Jr(n));t.length>0&&await Promise.all(t)}function ss(){mn||(mn=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes)n instanceof HTMLLinkElement&&Kr(n)&&Jr(n)}),mn.observe(document.documentElement,{childList:!0,subtree:!0}))}function Qr(){Gr||(Gr=!0,Zr(),ss())}async function eo(){await Zr();try{await document.fonts.ready}catch{}}var cs=750,us=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor"];async function Ct(){await eo();let e=window.innerWidth,t=window.innerHeight,n=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),r=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),i=window.scrollX,o=window.scrollY,a=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto";let c=[],l=0;for(;l<n;){window.scrollTo(0,l),await U(cs);let p=window.scrollY,m=Math.min(t,n-p);try{let y=await P.toPng(document.documentElement,{width:e,height:t,embedFonts:!0,exclude:us,excludeMode:"remove"});if(y){let x=await ds(y,e,m);x&&c.push({y:p,canvas:x})}}catch{}l+=t}if(window.scrollTo(i,o),document.documentElement.style.scrollBehavior=a,c.length===0)throw new Error("Screenshot capture produced no image data");let s=e,u=n,d=document.createElement("canvas");d.width=s,d.height=u;let f=d.getContext("2d");if(!f)throw new Error("Failed to create output canvas");for(let p of c)f.drawImage(p.canvas,0,p.y);let g=d.toDataURL("image/png").replace(/^data:image\/png;base64,/,"");if(!g)throw new Error("Canvas export produced no image data");return{image:g,width:s,height:u}}async function ds(e,t,n){let r;typeof e=="string"?(r=new Image,r.src=e,await new Promise((a,c)=>{r.onload=()=>a(),r.onerror=()=>c(new Error("Failed to load chunk"))})):(r=e,r.complete||await Promise.race([new Promise((a,c)=>{r.onload=()=>a(),r.onerror=()=>c(new Error("Chunk image failed to load"))}),U(1e4).then(()=>{throw new Error("Chunk load timed out")})]));let i=document.createElement("canvas");i.width=t,i.height=n;let o=i.getContext("2d");return o?(o.drawImage(r,0,0,t,n,0,0,t,n),i):null}var pn=!1;function to(){pn=new URLSearchParams(window.location.search).get("display-mode")==="pip",window.addEventListener("message",t=>{!t.data||typeof t.data.command!="string"||(t.data.command==="display-mode-pip"?pn=!0:t.data.command==="display-mode-full"&&(pn=!1))})}var no="__mindstudio-cursor",fs="__mindstudio-cursor-ripple",ro=.07,ms=250,At=300,ps=2e3,kt=10,oo=1,$t="#DD2590",hs=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
10
10
  <g filter="url(#filter0_d_4_78)">
11
11
  <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${$t}"/>
12
12
  <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${$t}"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/browser-agent",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Browser-side agent for MindStudio dev previews — captures logs, provides DOM snapshots, and enables remote interaction.",
5
5
  "main": "dist/index.js",
6
6
  "files": [