@mindstudio-ai/browser-agent 0.1.9 → 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.
- package/dist/index.js +17 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";var __MindStudioBrowserAgent=(()=>{var Ot=Object.defineProperty;var ei=Object.getOwnPropertyDescriptor;var ti=Object.getOwnPropertyNames;var ni=Object.prototype.hasOwnProperty;var ri=(e,t)=>{for(var n in t)Ot(e,n,{get:t[n],enumerable:!0})},oi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ti(t))!ni.call(e,i)&&i!==n&&Ot(e,i,{get:()=>t[i],enumerable:!(r=ei(t,i))||r.enumerable});return e};var ii=e=>oi(Ot({},"__esModule",{value:!0}),e);var Ps={};ri(Ps,{executeSteps:()=>Nt,getRefMap:()=>ut,resolveElement:()=>ge,takeSnapshot:()=>je,takeSnapshotSync:()=>qt});var An="/__mindstudio_dev__/logs";var be=[],Ae=null,st=!1,Be=[];function $n(){if(be.length===0)return;let e=be;be=[];try{let t=new XMLHttpRequest;t.open("POST",An,!0),t.setRequestHeader("Content-Type","application/json"),t.send(JSON.stringify(e))}catch{}}function ai(){Ae||(Ae=setTimeout(()=>{Ae=null,$n()},2e3))}function li(){Ae&&(clearTimeout(Ae),Ae=null),$n()}function J(e){be.push(e),st&&Be.push(e),ai()}function Wt(e){be.push(e),st&&Be.push(e),li()}function Ln(){st=!0,Be=[]}function Tn(){st=!1;let e=Be;return Be=[],e}function Nn(){window.addEventListener("beforeunload",()=>{be.length>0&&navigator.sendBeacon&&navigator.sendBeacon(An,JSON.stringify(be))})}var si={a:"link",button:"button",input:"textbox",textarea:"textbox",select:"combobox",option:"option",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",nav:"navigation",main:"main",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",details:"group",summary:"button",img:"img",ul:"list",ol:"list",li:"listitem",table:"table",tr:"row",th:"columnheader",td:"cell",form:"form",article:"article",section:"region",label:"label",fieldset:"group",legend:"legend",p:"paragraph",blockquote:"blockquote",pre:"code",code:"code",hr:"separator",progress:"progressbar"};function xe(e){let t=e.getAttribute("role");if(t)return t==="presentation"||t==="none"?null:t;let n=e.tagName.toLowerCase();if(n==="a")return e.hasAttribute("href")?"link":null;if(n==="section")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":null;if(n==="form")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"form":null;if(n==="img")return e.alt===""?null:"img";if(n==="input")switch(e.type){case"checkbox":return"checkbox";case"radio":return"radio";case"range":return"slider";case"submit":case"button":case"reset":return"button";case"hidden":return null;default:return"textbox"}return si[n]??null}function Rn(e){if(e.hasAttribute("onclick")||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1")return!0;try{if(getComputedStyle(e).cursor==="pointer")return!0}catch{}return!1}function $e(e){let t=e.getAttribute("aria-label");if(t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let a=n.split(/\s+/).map(c=>{let l=document.getElementById(c);return l?ve(l):""}).filter(Boolean).join(" ");if(a)return a}let r=e.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"){let a=ci(e);if(a)return a}if(r==="img"){let a=e.alt;if(a)return a.trim()}if(r==="fieldset"){let a=e.querySelector("legend");if(a)return ve(a)}let i=ve(e);if(i)return i;let o=e.getAttribute("title");return o?o.trim():""}function ve(e){if(!e.children.length)return(e.textContent||"").trim();let t=[];for(let n of Array.from(e.childNodes))if(n.nodeType===Node.TEXT_NODE){let r=(n.textContent||"").trim();r&&t.push(r)}else if(n.nodeType===Node.ELEMENT_NODE){let r=n;if(di(r))continue;let i=ui(r),o=ve(r);o&&(i&&t.length>0&&t.push(" "),t.push(o),i&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function ci(e){if(e.id){let n=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(n)return ve(n)}let t=e.closest("label");if(t){let n=t.cloneNode(!0),r=n.querySelector("input, textarea, select");r&&r.remove();let i=n.textContent?.trim();if(i)return i}return null}function ui(e){try{return!getComputedStyle(e).display.includes("inline")}catch{let t=e.tagName.toLowerCase();return["div","p","h1","h2","h3","h4","h5","h6","li","section","article","header","footer","nav","main","aside","blockquote","pre","form","fieldset","table","tr","br"].includes(t)}}function di(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||e.getAttribute("aria-hidden")==="true")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!0}catch{}return!1}function Ht(e,t){try{let n=getComputedStyle(e,t).content;if(!n||n==="none"||n==="normal")return"";let r=n.match(/^["'](.*)["']$/);return r?r[1]:""}catch{return""}}var Ue=0;function ct(){Ue++}function qe(){Ue=Math.max(0,Ue-1)}function
|
|
2
|
-
`);let o=r.length>0?t+1:t;return i+=jt(e.children,o),i}function Fn(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.stack||e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function U(e){return new Promise(t=>setTimeout(t,e))}var gi=["log","info","warn","error","debug"];function Dn(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of gi){let t=console[e];console[e]=(...n)=>{t&&t.apply(console,n),J({type:"console",level:e,args:n.map(Fn),url:location.href})}}}}function In(){window.addEventListener("error",e=>{Wt({type:"error",message:e.message,stack:e.error&&e.error.stack||"",source:e.filename,line:e.lineno,column:e.colno,url:location.href})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason||{};Wt({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})})}function On(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,n){let r=(n?.method||"GET").toUpperCase(),i=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(i.includes("/__mindstudio_dev__/"))return e.apply(this,[t,n]);let o=Date.now();return ct(),e.apply(this,[t,n]).then(a=>{qe();let c={type:"network",method:r,url:i,status:a.status,statusText:a.statusText,duration:Date.now()-o,ok:a.ok};if(a.ok)J(c);else try{a.clone().text().then(l=>{c.body=l.slice(0,1e3),J(c)}).catch(()=>J(c))}catch{J(c)}return a},a=>{throw qe(),J({type:"network",method:r,url:i,error:a.message||String(a),duration:Date.now()-o,ok:!1}),a})},window.fetch.__ms_patched=!0}function Wn(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target,n=(t?.textContent||"").trim().slice(0,100);J({type:"interaction",event:"click",target:Z(t),text:n,url:location.href})},!0))}function Hn(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,n=e.prototype.send;e.prototype.open=function(r,i,...o){return this.__ms_method=r.toUpperCase(),this.__ms_url=String(i),t.apply(this,[r,i,...o])},e.prototype.send=function(r){let i=this.__ms_method||"GET",o=this.__ms_url||"";if(o.includes("/__mindstudio_dev__/"))return n.apply(this,[r]);let a=Date.now();return ct(),this.addEventListener("loadend",function(){qe(),J({type:"network",method:i,url:o,status:this.status,statusText:this.statusText,duration:Date.now()-a,ok:this.status>=200&&this.status<300,...this.status>=400?{body:(this.responseText||"").slice(0,1e3)}:{},via:"xhr"})}),n.apply(this,[r])},XMLHttpRequest.prototype.open.__ms_patched=!0}function ge(e){let t=null;if(e.ref){let n=ut(),r=n.get(e.ref);if(r&&r.isConnected)if(le(r))t={element:r,matched:`${Z(r)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${zt(r)}). It may be inside a closed dialog or collapsed section.`);else{let i=[...n.entries()].filter(([,o])=>o.isConnected&&le(o)).slice(0,10).map(([o,a])=>`${Z(a)} [ref=${o}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(i?`Available refs: ${i}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let n=e.text,r=e.role,i=Bn(n,r);if(i.length===0){let o=Bn(n,r,!0);if(o.length>0)throw new Error(`Found ${r?r+" ":""}"${n}" but it is hidden (${zt(o[0])}). Wait for it to become visible or check if a dialog/modal needs to be opened first.`);let a=r?`${r} "${n}"`:`"${n}"`,c=Un(r);throw new Error(`No element found matching ${a}. `+(c?`Visible ${r||"element"}s: ${c}`:"The page may still be loading \u2014 try a wait command first."))}if(i.length>1){let o=i.filter(qn),a=o.length===1?o[0]:i[0];t={element:a,matched:Z(a)}}else t={element:i[0],matched:Z(i[0])}}if(!t&&e.role&&!e.text){let n=e.role,r=yi(n);if(r.length===0){let i=Un(n);throw new Error(`No visible element with role "${n}" found. `+(i?`Visible ${n}s: ${i}`:"The page may still be loading \u2014 try a wait command first."))}t={element:r[0],matched:Z(r[0])}}if(!t&&e.label){let n=e.label,r=wi(n);if(!r){let i=[...document.querySelectorAll("label")].filter(le).map(o=>`"${(o.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${n}". `+(i?`Visible labels: ${i}`:"No labels found on the page."))}t={element:r,matched:`${Z(r)} via label "${n}"`}}if(!t&&e.selector){let n=e.selector,r=document.querySelector(n);if(!r)throw new Error(`No element found for selector "${n}".`);if(!le(r))throw new Error(`Found element for selector "${n}" but it is hidden (${zt(r)}).`);t={element:r,matched:`${Z(r)} via selector "${n}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function Bn(e,t,n=!1){let r=[],i=e.toLowerCase();for(let o of document.querySelectorAll("*")){if(!n&&!le(o)||n&&!o.isConnected||t&&xe(o)!==t)continue;if($e(o).toLowerCase().includes(i)){r.push(o);continue}o.children.length||(o.textContent||"").trim().toLowerCase().includes(i)&&r.push(o)}return r}function yi(e){let t=[];for(let n of document.querySelectorAll("*"))le(n)&&xe(n)===e&&t.push(n);return t}function wi(e){let t=e.toLowerCase();for(let n of document.querySelectorAll("label")){if(!(n.textContent||"").trim().toLowerCase().includes(t))continue;let i=n.getAttribute("for");if(i){let a=document.getElementById(i);if(a&&le(a))return a}let o=n.querySelector("input, textarea, select");if(o&&le(o))return o}return null}function le(e){if(!e.isConnected)return!1;try{let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1}catch{return!1}return!0}function qn(e){if(e.matches('a, button, input, textarea, select, [role="button"], [role="link"], [tabindex]'))return!0;try{return getComputedStyle(e).cursor==="pointer"}catch{return!1}}function zt(e){try{let t=getComputedStyle(e);if(t.display==="none")return"display: none";if(t.visibility==="hidden")return"visibility: hidden"}catch{}return e.getAttribute("aria-hidden")==="true"?'aria-hidden="true"':"hidden"}function Un(e){let t=[];for(let n of document.querySelectorAll("*"))if(le(n)&&(e?xe(n)===e&&t.push(n):qn(n)&&t.push(n),t.length>=10))break;return t.length===0?"":t.map(n=>`"${$e(n).slice(0,40)||Z(n)}"`).join(", ")}function Vt(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i={bubbles:!0,cancelable:!0,clientX:n,clientY:r,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",i)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",i)),e.dispatchEvent(new MouseEvent("click",i))}var bi=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,xi=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function Vn(e,t,n={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Vt(e),n.clear&&(jn(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let r=0;r<t.length;r++){let i=t[r];e.dispatchEvent(new KeyboardEvent("keydown",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),jn(e,e.value+i),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),await U(vi(i))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function vi(e){let t=Math.random()*50-25;return e===" "?120+t:/[.,!?;:\-]/.test(e)?140+t:/[A-Z]/.test(e)?115+t:85+t}function jn(e,t){let n=e instanceof HTMLTextAreaElement?xi:bi;n?n.call(e,t):e.value=t}async function Xn(e){let t=e.timeout||5e3,n=Date.now(),r=n+t;for(;Date.now()<r;)try{return{...ge(e),elapsed:Date.now()-n}}catch{await U(100)}let i=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${i} after ${t}ms`)}var zn=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function Yn(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let n=t.toLowerCase(),r=null;for(let i of e.options)if(i.text.toLowerCase().includes(n)||i.value.toLowerCase()===n||i.label.toLowerCase().includes(n)){r=i;break}if(!r){let i=[...e.options].map(o=>`"${o.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${i}`)}return zn?zn.call(e,r.value):e.value=r.value,e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0})),r.text}async function Gn(e){try{let n=!/\b(return|;|\{)\b/.test(e.trim())?`return (${e})`:e,i=new Function(n)();return i instanceof Promise?await i:i}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var Ei=Object.defineProperty,G=(e,t)=>()=>(e&&(t=e(e=0)),t),Ke=(e,t)=>{for(var n in t)Ei(e,n,{get:t[n],enumerable:!0})};function Ci(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function ki(e="soft"){switch(E.session.__counterEpoch=(E.session.__counterEpoch||0)+1,e){case"auto":{E.session.styleMap=new Map,E.session.nodeMap=new Map;return}case"soft":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap,E.computedStyle=new WeakMap,E.baseStyle=new Q(50),E.defaultStyle=new Q(30),E.image=new Q(100),E.background=new Q(100),E.resource=new Q(150),E.font=new Set;return}default:{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}}}var Q,E,ne=G(()=>{Q=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let n=this.keys().next().value;n!==void 0&&this.delete(n)}return super.set(e,t)}},E={image:new Q(100),background:new Q(100),resource:new Q(150),defaultStyle:new Q(30),baseStyle:new Q(50),computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function cn(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function Mi(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function wt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Ai(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,n).href}catch{return e}}var xt=G(()=>{});function $i(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(a,c,l){if(i>=n)return;let s=Date.now();(r.get(c)||0)>s||(r.set(c,s+t),i++,a==="warn"&&console&&console.warn?console.warn(`${e} ${l}`):console&&console.error&&console.error(`${e} ${l}`))}return{warnOnce(a,c){o("warn",a,c)},errorOnce(a,c){o("error",a,c)},reset(){r.clear(),i=0}}}function Li(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Ti(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",n),o=new URL(e,n);if(o.origin===i.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Ni(e,t){if(!t||Li(e)||Ti(e,t))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function Ri(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",wt(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${wt(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function Kn(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}function _i(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function te(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",o=t.errorTTL??8e3,a=t.headers||{},c=!!t.silent;if(/^data:/i.test(e))try{if(n==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,m="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(m)?atob(y):decodeURIComponent(y),b=new Uint8Array([...x].map(C=>C.charCodeAt(0))),w=new Blob([b],{type:(m||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:e,fromCache:!1,mime:w.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let m=await fetch(e);if(!m.ok)return{ok:!1,data:null,status:m.status,url:e,fromCache:!1,reason:"http_error"};let y=await m.blob(),x=y.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Kn(y),status:m.status,url:e,fromCache:!1,mime:x}:n==="text"?{ok:!0,data:await y.text(),status:m.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:y,status:m.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let l=_i(e,{as:n,timeout:r,useProxy:i,errorTTL:o}),s=Ve.get(l);if(s&&s.until>Date.now())return{...s.result,fromCache:!0};s&&Ve.delete(l);let u=ft.get(l);if(u)return u;let d=Ni(e,i)?Ri(e,i):e,f=t.credentials;if(!f)try{let m=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,m);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let h=new AbortController,g=setTimeout(()=>h.abort("timeout"),r),p=(async()=>{try{let m=await fetch(d,{signal:h.signal,credentials:f,headers:a});if(!m.ok){let b={ok:!1,data:null,status:m.status,url:d,fromCache:!1,reason:"http_error"};if(o>0&&Ve.set(l,{until:Date.now()+o,result:b}),!c){let w=`${m.status} ${m.statusText||""}`.trim();Gt.warnOnce(`http:${m.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${w} while fetching ${n} ${e}`)}return t.onError&&t.onError(b),b}if(n==="text")return{ok:!0,data:await m.text(),status:m.status,url:d,fromCache:!1};let y=await m.blob(),x=y.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Kn(y),status:m.status,url:d,fromCache:!1,mime:x}:{ok:!0,data:y,status:m.status,url:d,fromCache:!1,mime:x}}catch(m){let y=m&&typeof m=="object"&&"name"in m&&m.name==="AbortError"?String(m.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&o>0&&Ve.set(l,{until:Date.now()+o,result:x}),!c){let b=`${y}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,w=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;Gt.errorOnce(b,w)}return t.onError&&t.onError(x),x}finally{clearTimeout(g),ft.delete(l)}})();return ft.set(l,p),p}var Gt,ft,Ve,Pe=G(()=>{xt(),Gt=$i("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),ft=new Map,Ve=new Map});async function xr(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=cn(e);if(!n)return e;let r=Ai(n),i=wt(r);if(E.background.has(i)){let o=E.background.get(i);return o?`url("${o}")`:"none"}try{let o=await te(i,{as:"dataURL",useProxy:t.useProxy});return o.ok?(E.background.set(i,o.data),`url("${o.data}")`):(E.background.set(i,null),"none")}catch{return E.background.set(i,null),"none"}}var Pi=G(()=>{ne(),xt(),Pe()});function Fi(e){if(e=String(e).toLowerCase(),dn.has(e)){let o={};return E.defaultStyle.set(e,o),o}if(E.defaultStyle.has(e))return E.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(un(o))continue;let a=r.getPropertyValue(o);i[o]=a}return t.removeChild(n),E.defaultStyle.set(e,i),i}function un(e){let t=String(e).toLowerCase();return!!(Cr.has(t)||Er.test(t)||Sr.test(t))}function Kt(e,t){if(t=String(t||"").toLowerCase(),dn.has(t))return"";let n=[],r=Fi(t),i=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[o,a]of Object.entries(e)){if(un(o)||i&&(o==="width"||o==="min-width"||o==="max-width"))continue;let c=r[o];a&&a!==c&&n.push(`${o}:${a}`)}return n.sort(),n.join(";")}function Di(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(n=>t.add(n.tagName.toLowerCase())),Array.from(t))}function Ii(e){let t=new Map;for(let r of e){let i=E.defaultStyle.get(r);if(!i)continue;let o=Object.entries(i).map(([a,c])=>`${a}:${c};`).sort().join("");o&&(t.has(o)||t.set(o,[]),t.get(o).push(r))}let n="";for(let[r,i]of t.entries())n+=`${i.join(",")} { ${r} }
|
|
3
|
-
`;return n}function Oi(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of t)n.set(i,`c${r++}`);return n}function Wi(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===t)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function ue(e,t=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(!(e instanceof Element)){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=E.computedStyle.get(e);r||(r=new Map,E.computedStyle.set(e,r));let i=r.get(t);if(!i){let o=Wi(e),a=null;try{a=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}i=a||n(),r.set(t,i)}return i}function Jn(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function Jt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var vr,dn,Hi,Sr,Er,Cr,kr=G(()=>{ne(),vr=new Set(["meta","script","noscript","title","link","template"]),dn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Hi=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],Sr=/(?:^|-)(animation|transition)(?:-|$)/i,Er=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Cr=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"])});function Ne(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Bi(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function Se(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),i=/mobile/i.test(e),o=!/safari/i.test(e),a=r&&i&&o,c=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),s=/ipad|iphone|ipod/.test(t)&&r;return n||a||c||l||s}function Ui(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Je=G(()=>{});function F(e,t,n){let r=e&&typeof e=="object"&&(e.options||e);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",t,n):console.warn("[snapdom]",t))}var Mr=G(()=>{}),re=G(()=>{Pi(),kr(),Je(),xt(),Mr()}),Ar={};Ke(Ar,{toCanvas:()=>vt});function qi(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function ji(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function zi(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Vi(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(i=>i.trim()).filter(Boolean)}function Xi(e){let t=[],n="",r=0;for(let o=0;o<e.length;o++){let a=e[o];a==="("&&r++,a===")"&&(r=Math.max(0,r-1)),a===","&&r===0?(t.push(n.trim()),n=""):n+=a}n.trim()&&t.push(n.trim());let i=[];for(let o of t){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[c="0px",l="0px",s="0px"]=a,u=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";i.push(`drop-shadow(${c} ${l} ${s}${d?` ${u}`:""})`)}return i.join(" ")}function $r(e){let t=Vi(e),n=null,r=null,i=null,o=[];for(let c of t){let l=c.indexOf(":");if(l<0)continue;let s=c.slice(0,l).trim().toLowerCase(),u=c.slice(l+1).trim();s==="box-shadow"?i=u:s==="filter"?n=u:s==="-webkit-filter"?r=u:o.push([s,u])}if(i){let c=Xi(i);c&&(n=n?`${n} ${c}`:c,r=r?`${r} ${c}`:c)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([c,l])=>`${c}:${l}`).join(";")}function Yi(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${$r(r)}}`)}function Gi(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,Yi(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${$r(r)}${n}`),e}function Ki(e){if(!Se()||!qi(e))return e;try{let t=ji(e),n=Gi(t);return zi(n)}catch{return e}}async function vt(e,t){let{width:n,height:r,scale:i=1,dpr:o=1,meta:a={},backgroundColor:c}=t;e=Ki(e);let l=new Image;l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=e,await l.decode();let s=l.naturalWidth,u=l.naturalHeight,d=Number.isFinite(a.w0)?a.w0:s,f=Number.isFinite(a.h0)?a.h0:u,h,g,p=Number.isFinite(n),m=Number.isFinite(r);if(p&&m)h=Math.max(1,n),g=Math.max(1,r);else if(p){let b=n/Math.max(1,d);h=n,g=f*b}else if(m){let b=r/Math.max(1,f);g=r,h=d*b}else h=s,g=u;h=h*i,g=g*i;let y=document.createElement("canvas");y.width=h*o,y.height=g*o,y.style.width=`${h}px`,y.style.height=`${g}px`;let x=y.getContext("2d");return o!==1&&x.scale(o,o),c&&(x.save(),x.fillStyle=c,x.fillRect(0,0,h,g),x.restore()),x.drawImage(l,0,0,h,g),y}var St=G(()=>{Je()}),mt={};Ke(mt,{rasterize:()=>Lr});async function Lr(e,t){let n=await vt(e,t),r=new Image;return r.src=n.toDataURL(`image/${t.format}`,t.quality),await r.decode(),r.style.width=`${n.width/t.dpr}px`,r.style.height=`${n.height/t.dpr}px`,r}var pt=G(()=>{St()}),Zt={};Ke(Zt,{toImg:()=>Zn,toSvg:()=>Zn});async function Zn(e,t){let{scale:n=1,width:r,height:i,meta:o={}}=t,a=Number.isFinite(r),c=Number.isFinite(i),l=Number.isFinite(n)&&n!==1||a||c;if(Se()&&l)return await Lr(e,{...t,format:"png",quality:1,meta:o});let s=new Image;if(s.decoding="sync",s.loading="eager",s.src=e,await s.decode(),a&&c)s.style.width=`${r}px`,s.style.height=`${i}px`;else if(a){let u=Number.isFinite(o.w0)?o.w0:s.naturalWidth,d=Number.isFinite(o.h0)?o.h0:s.naturalHeight,f=r/Math.max(1,u);s.style.width=`${r}px`,s.style.height=`${Math.round(d*f)}px`}else if(c){let u=Number.isFinite(o.w0)?o.w0:s.naturalWidth,d=Number.isFinite(o.h0)?o.h0:s.naturalHeight,f=i/Math.max(1,d);s.style.height=`${i}px`,s.style.width=`${Math.round(u*f)}px`}else{let u=Math.round(s.naturalWidth*n),d=Math.round(s.naturalHeight*n);if(s.style.width=`${u}px`,s.style.height=`${d}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,s.src=e}catch(f){F(t,"SVG width/height patch in toImg failed",f)}}return s}var Qn=G(()=>{re(),pt()}),Tr={};Ke(Tr,{toBlob:()=>Nr});async function Nr(e,t){let n=t.type;if(n==="svg"){let i=decodeURIComponent(e.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let r=await vt(e,t);return new Promise(i=>r.toBlob(o=>i(o),`image/${n}`,t.quality))}var Rr=G(()=>{St()}),_r={};Ke(_r,{download:()=>Ji});async function er(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Ji(e,t){let n=(t?.format||t?.type||"").toLowerCase(),r=n==="jpg"?"jpeg":n||"png",i=t?.filename||`snapdom.${r}`,o={...t||{},format:r,type:r};o.dpr=1;let a=Bi();if(r==="svg"){let s=await Nr(e,{...o,type:"svg"});if(a&&await er(s,i))return;let u=URL.createObjectURL(s),d=document.createElement("a");d.href=u,d.download=i,document.body.appendChild(d),d.click(),URL.revokeObjectURL(u),d.remove();return}let c=await vt(e,o);if(a){let s=`image/${r}`,u=await new Promise(d=>c.toBlob(d,s,t?.quality));if(u&&await er(u,i))return}let l=document.createElement("a");l.href=c.toDataURL(`image/${r}`,t?.quality),l.download=i,document.body.appendChild(l),l.click(),l.remove()}var Zi=G(()=>{Rr(),St(),Je()});re();re();ne();var tr=new WeakMap,Qt=new Map,en=0;function Xe(){en++}var nr=!1;function Qi(e=document.documentElement){if(!nr){nr=!0;try{new MutationObserver(()=>Xe()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Xe()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Xe),t.ready?.then(()=>Xe()).catch(()=>{}))}catch{}}}function ea(e,t={}){let n={},r=e.getPropertyValue("visibility"),i=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(un(f)||i&&(i instanceof RegExp&&i.test(f)||typeof i=="function"&&i(f)))continue;let h=e.getPropertyValue(f);(f==="background-image"||f==="content")&&h.includes("url(")&&!h.includes("data:")&&(h="none"),n[f]=h}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of o)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of a)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}if(t.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!n[f])try{let h=e.getPropertyValue(f);h&&(n[f]=h)}catch{}}r==="hidden"&&(n.opacity="0");let c=parseFloat(e.getPropertyValue("border-top-width")||0)||0,l=parseFloat(e.getPropertyValue("border-right-width")||0)||0,s=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(c===0&&l===0&&s===0&&u===0){let d=(e.getPropertyValue("border-image-source")||"").trim(),f=d&&d!=="none",h=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let g of h)delete n[g];f||(n.border="none")}return n}var rr=new WeakMap;function ta(e){let t=rr.get(e);return t||(t=Object.entries(e).sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:0).map(([n,r])=>`${n}:${r}`).join(";"),rr.set(e,t),t)}function na(e,t=null,n={}){let r=tr.get(e);if(r&&r.epoch===en)return r.snapshot;let i=t||getComputedStyle(e),o=ea(i,n);return ca(e,i,o),tr.set(e,{epoch:en,snapshot:o}),o}function ra(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Qt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:t||{}}:{session:E.session,persist:{snapshotKeyCache:Qt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:e||t||{}}}function oa(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let i=e.style[r],o=n.getPropertyValue(i);o&&t.style.setProperty(i,o)}}async function Re(e,t,n,r){if(e.tagName==="STYLE")return;let i=ra(n,r),o=i.options&&i.options.cache||"auto";o!=="disabled"&&Qi(document.documentElement),o==="disabled"&&!i.session.__bumpedForDisabled&&(Xe(),Qt.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:c}=i;a.styleCache.has(e)||a.styleCache.set(e,getComputedStyle(e));let l=a.styleCache.get(e);e.getAttribute?.("style")&&oa(e,t,l);let s=na(e,l,i.options),u=ta(s),d=c.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=Kt(s,f),c.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function ia(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function aa(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function la(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function sa(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let n=e.firstElementChild,r=e.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let i=e.scrollHeight;if(i===0)return!1;let o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return i>o+a}function ca(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let i=parseFloat(t.height);if(Number.isFinite(i)&&e.scrollHeight>0&&Math.abs(i-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid")||ia(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||aa(t)||la(e))return;let c=t.overflowX||t.overflow||"visible",l=t.overflowY||t.overflow||"visible";if(c!=="visible"||l!=="visible")return;let s=t.clip;s&&s!=="auto"&&s!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||sa(e,t)&&(delete n.height,delete n["block-size"])}kr();var Pr=["fill","stroke","color","background-color","stop-color"],or=new Map;function ua(e,t){let n=t+"::"+e.toLowerCase(),r=or.get(n);if(r)return r;let i=document,o=t==="http://www.w3.org/2000/svg"?i.createElementNS(t,e):i.createElement(e),a=i.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),i.documentElement.appendChild(a);let c=getComputedStyle(o),l={};for(let s of Pr)l[s]=c.getPropertyValue(s)||"";return a.remove(),or.set(n,l),l}function da(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let n=e.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let c=o[a];if(c&&typeof c.value=="string"&&c.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let o=e.style;if(o&&o.length)for(let a=0;a<o.length;a++){let c=o[a],l=o.getPropertyValue(c);if(!l||!l.includes("var("))continue;let s=i&&i.getPropertyValue(c);if(s)try{t.style.setProperty(c,s.trim(),o.getPropertyPriority(c))}catch{}}}if(r&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let c=o[a];if(!c||typeof c.value!="string"||!c.value.includes("var("))continue;let l=c.name,s=i&&i.getPropertyValue(l);if(s)try{t.style.setProperty(l,s.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let o=e.namespaceURI||"html",a=ua(e.tagName,o);for(let c of Pr){let l=i.getPropertyValue(c)||"",s=a[c]||"";if(l&&l!==s)try{t.style.setProperty(c,l.trim())}catch{}}}}re();re();ne();Pe();function Xt(e,t,n){return Promise.all(e.map(r=>new Promise(i=>{function o(){Ne(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,i):o()},{fast:n})}o()})))}function fa(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function ma(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let i=n?fa(r):r;return`:where(${t} ${i})`}).join(", ")}function pa(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${t}:is(${r.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${t} ${r.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,i,o)=>{let a=ma(o,t,!0);return`${r}${i}${a}{`}),e):""}function ha(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function ga(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+`
|
|
1
|
+
"use strict";var __MindStudioBrowserAgent=(()=>{var Ot=Object.defineProperty;var ei=Object.getOwnPropertyDescriptor;var ti=Object.getOwnPropertyNames;var ni=Object.prototype.hasOwnProperty;var ri=(e,t)=>{for(var n in t)Ot(e,n,{get:t[n],enumerable:!0})},oi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ti(t))!ni.call(e,i)&&i!==n&&Ot(e,i,{get:()=>t[i],enumerable:!(r=ei(t,i))||r.enumerable});return e};var ii=e=>oi(Ot({},"__esModule",{value:!0}),e);var Ps={};ri(Ps,{executeSteps:()=>Nt,getRefMap:()=>ut,resolveElement:()=>ge,takeSnapshot:()=>je,takeSnapshotSync:()=>qt});var An="/__mindstudio_dev__/logs";var be=[],Ae=null,st=!1,Be=[];function $n(){if(be.length===0)return;let e=be;be=[];try{let t=new XMLHttpRequest;t.open("POST",An,!0),t.setRequestHeader("Content-Type","application/json"),t.send(JSON.stringify(e))}catch{}}function ai(){Ae||(Ae=setTimeout(()=>{Ae=null,$n()},2e3))}function li(){Ae&&(clearTimeout(Ae),Ae=null),$n()}function J(e){be.push(e),st&&Be.push(e),ai()}function Wt(e){be.push(e),st&&Be.push(e),li()}function Ln(){st=!0,Be=[]}function Tn(){st=!1;let e=Be;return Be=[],e}function Nn(){window.addEventListener("beforeunload",()=>{be.length>0&&navigator.sendBeacon&&navigator.sendBeacon(An,JSON.stringify(be))})}var si={a:"link",button:"button",input:"textbox",textarea:"textbox",select:"combobox",option:"option",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",nav:"navigation",main:"main",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",details:"group",summary:"button",img:"img",ul:"list",ol:"list",li:"listitem",table:"table",tr:"row",th:"columnheader",td:"cell",form:"form",article:"article",section:"region",label:"label",fieldset:"group",legend:"legend",p:"paragraph",blockquote:"blockquote",pre:"code",code:"code",hr:"separator",progress:"progressbar"};function xe(e){let t=e.getAttribute("role");if(t)return t==="presentation"||t==="none"?null:t;let n=e.tagName.toLowerCase();if(n==="a")return e.hasAttribute("href")?"link":null;if(n==="section")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":null;if(n==="form")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"form":null;if(n==="img")return e.alt===""?null:"img";if(n==="input")switch(e.type){case"checkbox":return"checkbox";case"radio":return"radio";case"range":return"slider";case"submit":case"button":case"reset":return"button";case"hidden":return null;default:return"textbox"}return si[n]??null}function Rn(e){if(e.hasAttribute("onclick")||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1")return!0;try{if(getComputedStyle(e).cursor==="pointer")return!0}catch{}return!1}function $e(e){let t=e.getAttribute("aria-label");if(t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let a=n.split(/\s+/).map(c=>{let l=document.getElementById(c);return l?ve(l):""}).filter(Boolean).join(" ");if(a)return a}let r=e.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"){let a=ci(e);if(a)return a}if(r==="img"){let a=e.alt;if(a)return a.trim()}if(r==="fieldset"){let a=e.querySelector("legend");if(a)return ve(a)}let i=ve(e);if(i)return i;let o=e.getAttribute("title");return o?o.trim():""}function ve(e){if(!e.children.length)return(e.textContent||"").trim();let t=[];for(let n of Array.from(e.childNodes))if(n.nodeType===Node.TEXT_NODE){let r=(n.textContent||"").trim();r&&t.push(r)}else if(n.nodeType===Node.ELEMENT_NODE){let r=n;if(di(r))continue;let i=ui(r),o=ve(r);o&&(i&&t.length>0&&t.push(" "),t.push(o),i&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function ci(e){if(e.id){let n=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(n)return ve(n)}let t=e.closest("label");if(t){let n=t.cloneNode(!0),r=n.querySelector("input, textarea, select");r&&r.remove();let i=n.textContent?.trim();if(i)return i}return null}function ui(e){try{return!getComputedStyle(e).display.includes("inline")}catch{let t=e.tagName.toLowerCase();return["div","p","h1","h2","h3","h4","h5","h6","li","section","article","header","footer","nav","main","aside","blockquote","pre","form","fieldset","table","tr","br"].includes(t)}}function di(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||e.getAttribute("aria-hidden")==="true")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!0}catch{}return!1}function Ht(e,t){try{let n=getComputedStyle(e,t).content;if(!n||n==="none"||n==="normal")return"";let r=n.match(/^["'](.*)["']$/);return r?r[1]:""}catch{return""}}var Ue=0;function ct(){Ue++}function qe(){Ue=Math.max(0,Ue-1)}function Pn(e=5e3,t=200){return new Promise((n,r)=>{let i=Date.now()+e,o=null;function a(){if(Date.now()>i){o&&clearTimeout(o),n();return}Ue===0?o||(o=setTimeout(()=>{Ue===0?n():(o=null,a())},t)):(o&&(clearTimeout(o),o=null),setTimeout(a,50))}a()})}var Bt=0,Ut=new Map;function ut(){return Ut}async function je(){return await Pn(),qt()}function qt(){Bt=0,Ut=new Map;let e=document.body;if(!e)return"(empty page)";let t=_n(e);return jt(t,0).trimEnd()}function Z(e){let t=xe(e),n=$e(e),r=n.length>60?n.slice(0,57)+"...":n;if(t&&r)return`${t} "${r}"`;if(t)return t;if(r)return`"${r}"`;let i=e.tagName.toLowerCase();return e.id?`${i}#${e.id}`:i}function _n(e){if(mi(e))return[];let t=xe(e),n=!t&&Rn(e),r=t||(n?"clickable":null),i="";if(r){i=$e(e);let u=Ht(e,"::before"),d=Ht(e,"::after");(u||d)&&(i=[u,i,d].filter(Boolean).join(" ")),i.length>80&&(i=i.slice(0,77)+"...")}let o=pi(e),a=t==="button"||t==="link"||t==="textbox"||t==="combobox"||t==="checkbox"||t==="radio"||t==="slider"||t==="tab"||t==="menuitem"||n,c=r&&i&&!a,l=null;(a||c)&&(Bt++,l=`e${Bt}`,Ut.set(l,e));let s=fi(e);if(r){let u=s.length===0?"":jt(s,0).trim();return[{tag:r,name:i,attrs:o,ref:l,children:u&&u===i?[]:s,element:e}]}if(s.length===0){let u=ve(e);if(u)return[{tag:null,name:u.length>80?u.slice(0,77)+"...":u,attrs:[],ref:null,children:[],element:e}]}return s}function fi(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===Node.ELEMENT_NODE&&t.push(..._n(n));return t}function mi(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true"||e.id==="__mindstudio-browser-agent"||e.id==="__mindstudio-cursor"||e.id==="__mindstudio-cursor-ripple"||e.id==="__mindstudio-notes-overlay"||e.id==="__mindstudio-notes-cursor")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden"&&n.position!=="static")return!0}catch{}return!1}function pi(e){let t=[],n=e.tagName.toLowerCase();if((n==="dialog"&&e.open||n==="details"&&e.open)&&t.push("open"),e.disabled&&t.push("disabled"),n==="input"){let o=e;(o.type==="checkbox"||o.type==="radio")&&o.checked&&t.push("checked")}if(n==="input"){let o=e;o.type!=="checkbox"&&o.type!=="radio"&&o.type!=="hidden"&&o.type!=="submit"&&o.type!=="button"&&o.type!=="reset"&&(t.push(`value="${o.value}"`),o.placeholder&&t.push(`placeholder="${o.placeholder}"`))}if(n==="textarea"){let o=e;t.push(`value="${o.value}"`),o.placeholder&&t.push(`placeholder="${o.placeholder}"`)}if(n==="select"){let o=e,a=o.options[o.selectedIndex];a&&t.push(`value="${a.text}"`)}let r=n.match(/^h([1-6])$/);r&&t.push(`level=${r[1]}`);let i=e.getAttribute("aria-expanded");return i==="true"&&t.push("expanded"),i==="false"&&t.push("collapsed"),e.getAttribute("aria-selected")==="true"&&t.push("selected"),e.getAttribute("aria-pressed")==="true"&&t.push("pressed"),t}function jt(e,t){let n="";for(let r of e)n+=hi(r,t);return n}function hi(e,t){let n=" ".repeat(t),r=[];e.tag&&r.push(e.tag),e.name&&r.push(`"${e.name}"`);for(let a of e.attrs)r.push(`[${a}]`);e.ref&&r.push(`[ref=${e.ref}]`);let i="";r.length>0&&(i+=`${n}${r.join(" ")}
|
|
2
|
+
`);let o=r.length>0?t+1:t;return i+=jt(e.children,o),i}function Fn(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.stack||e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function U(e){return new Promise(t=>setTimeout(t,e))}var gi=["log","info","warn","error","debug"];function Dn(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of gi){let t=console[e];console[e]=(...n)=>{t&&t.apply(console,n),J({type:"console",level:e,args:n.map(Fn),url:location.href})}}}}function In(){window.addEventListener("error",e=>{Wt({type:"error",message:e.message,stack:e.error&&e.error.stack||"",source:e.filename,line:e.lineno,column:e.colno,url:location.href})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason||{};Wt({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})})}function On(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,n){let r=(n?.method||"GET").toUpperCase(),i=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(i.includes("/__mindstudio_dev__/"))return e.apply(this,[t,n]);let o=Date.now();return ct(),e.apply(this,[t,n]).then(a=>{qe();let c={type:"network",method:r,url:i,status:a.status,statusText:a.statusText,duration:Date.now()-o,ok:a.ok};if(a.ok)J(c);else try{a.clone().text().then(l=>{c.body=l.slice(0,1e3),J(c)}).catch(()=>J(c))}catch{J(c)}return a},a=>{throw qe(),J({type:"network",method:r,url:i,error:a.message||String(a),duration:Date.now()-o,ok:!1}),a})},window.fetch.__ms_patched=!0}function Wn(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target,n=(t?.textContent||"").trim().slice(0,100);J({type:"interaction",event:"click",target:Z(t),text:n,url:location.href})},!0))}function Hn(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,n=e.prototype.send;e.prototype.open=function(r,i,...o){return this.__ms_method=r.toUpperCase(),this.__ms_url=String(i),t.apply(this,[r,i,...o])},e.prototype.send=function(r){let i=this.__ms_method||"GET",o=this.__ms_url||"";if(o.includes("/__mindstudio_dev__/"))return n.apply(this,[r]);let a=Date.now();return ct(),this.addEventListener("loadend",function(){qe(),J({type:"network",method:i,url:o,status:this.status,statusText:this.statusText,duration:Date.now()-a,ok:this.status>=200&&this.status<300,...this.status>=400?{body:(this.responseText||"").slice(0,1e3)}:{},via:"xhr"})}),n.apply(this,[r])},XMLHttpRequest.prototype.open.__ms_patched=!0}function ge(e){let t=null;if(e.ref){let n=ut(),r=n.get(e.ref);if(r&&r.isConnected)if(le(r))t={element:r,matched:`${Z(r)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${zt(r)}). It may be inside a closed dialog or collapsed section.`);else{let i=[...n.entries()].filter(([,o])=>o.isConnected&&le(o)).slice(0,10).map(([o,a])=>`${Z(a)} [ref=${o}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(i?`Available refs: ${i}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let n=e.text,r=e.role,i=Bn(n,r);if(i.length===0){let o=Bn(n,r,!0);if(o.length>0)throw new Error(`Found ${r?r+" ":""}"${n}" but it is hidden (${zt(o[0])}). Wait for it to become visible or check if a dialog/modal needs to be opened first.`);let a=r?`${r} "${n}"`:`"${n}"`,c=Un(r);throw new Error(`No element found matching ${a}. `+(c?`Visible ${r||"element"}s: ${c}`:"The page may still be loading \u2014 try a wait command first."))}if(i.length>1){let o=i.filter(qn),a=o.length===1?o[0]:i[0];t={element:a,matched:Z(a)}}else t={element:i[0],matched:Z(i[0])}}if(!t&&e.role&&!e.text){let n=e.role,r=yi(n);if(r.length===0){let i=Un(n);throw new Error(`No visible element with role "${n}" found. `+(i?`Visible ${n}s: ${i}`:"The page may still be loading \u2014 try a wait command first."))}t={element:r[0],matched:Z(r[0])}}if(!t&&e.label){let n=e.label,r=wi(n);if(!r){let i=[...document.querySelectorAll("label")].filter(le).map(o=>`"${(o.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${n}". `+(i?`Visible labels: ${i}`:"No labels found on the page."))}t={element:r,matched:`${Z(r)} via label "${n}"`}}if(!t&&e.selector){let n=e.selector,r=document.querySelector(n);if(!r)throw new Error(`No element found for selector "${n}".`);if(!le(r))throw new Error(`Found element for selector "${n}" but it is hidden (${zt(r)}).`);t={element:r,matched:`${Z(r)} via selector "${n}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function Bn(e,t,n=!1){let r=[],i=e.toLowerCase();for(let o of document.querySelectorAll("*")){if(!n&&!le(o)||n&&!o.isConnected||t&&xe(o)!==t)continue;if($e(o).toLowerCase().includes(i)){r.push(o);continue}o.children.length||(o.textContent||"").trim().toLowerCase().includes(i)&&r.push(o)}return r}function yi(e){let t=[];for(let n of document.querySelectorAll("*"))le(n)&&xe(n)===e&&t.push(n);return t}function wi(e){let t=e.toLowerCase();for(let n of document.querySelectorAll("label")){if(!(n.textContent||"").trim().toLowerCase().includes(t))continue;let i=n.getAttribute("for");if(i){let a=document.getElementById(i);if(a&&le(a))return a}let o=n.querySelector("input, textarea, select");if(o&&le(o))return o}return null}function le(e){if(!e.isConnected)return!1;try{let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1}catch{return!1}return!0}function qn(e){if(e.matches('a, button, input, textarea, select, [role="button"], [role="link"], [tabindex]'))return!0;try{return getComputedStyle(e).cursor==="pointer"}catch{return!1}}function zt(e){try{let t=getComputedStyle(e);if(t.display==="none")return"display: none";if(t.visibility==="hidden")return"visibility: hidden"}catch{}return e.getAttribute("aria-hidden")==="true"?'aria-hidden="true"':"hidden"}function Un(e){let t=[];for(let n of document.querySelectorAll("*"))if(le(n)&&(e?xe(n)===e&&t.push(n):qn(n)&&t.push(n),t.length>=10))break;return t.length===0?"":t.map(n=>`"${$e(n).slice(0,40)||Z(n)}"`).join(", ")}function Vt(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i={bubbles:!0,cancelable:!0,clientX:n,clientY:r,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",i)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",i)),e.dispatchEvent(new MouseEvent("click",i))}var bi=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,xi=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function Vn(e,t,n={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Vt(e),n.clear&&(jn(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let r=0;r<t.length;r++){let i=t[r];e.dispatchEvent(new KeyboardEvent("keydown",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),jn(e,e.value+i),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),await U(vi(i))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function vi(e){let t=Math.random()*50-25;return e===" "?120+t:/[.,!?;:\-]/.test(e)?140+t:/[A-Z]/.test(e)?115+t:85+t}function jn(e,t){let n=e instanceof HTMLTextAreaElement?xi:bi;n?n.call(e,t):e.value=t}async function Xn(e){let t=e.timeout||5e3,n=Date.now(),r=n+t;for(;Date.now()<r;)try{return{...ge(e),elapsed:Date.now()-n}}catch{await U(100)}let i=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${i} after ${t}ms`)}var zn=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function Yn(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let n=t.toLowerCase(),r=null;for(let i of e.options)if(i.text.toLowerCase().includes(n)||i.value.toLowerCase()===n||i.label.toLowerCase().includes(n)){r=i;break}if(!r){let i=[...e.options].map(o=>`"${o.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${i}`)}return zn?zn.call(e,r.value):e.value=r.value,e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0})),r.text}async function Gn(e){try{let n=!/\b(return|;|\{)\b/.test(e.trim())?`return (${e})`:e,i=new Function(n)();return i instanceof Promise?await i:i}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var Ei=Object.defineProperty,G=(e,t)=>()=>(e&&(t=e(e=0)),t),Ke=(e,t)=>{for(var n in t)Ei(e,n,{get:t[n],enumerable:!0})};function Ci(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function ki(e="soft"){switch(E.session.__counterEpoch=(E.session.__counterEpoch||0)+1,e){case"auto":{E.session.styleMap=new Map,E.session.nodeMap=new Map;return}case"soft":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap,E.computedStyle=new WeakMap,E.baseStyle=new Q(50),E.defaultStyle=new Q(30),E.image=new Q(100),E.background=new Q(100),E.resource=new Q(150),E.font=new Set;return}default:{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}}}var Q,E,ne=G(()=>{Q=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let n=this.keys().next().value;n!==void 0&&this.delete(n)}return super.set(e,t)}},E={image:new Q(100),background:new Q(100),resource:new Q(150),defaultStyle:new Q(30),baseStyle:new Q(50),computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function cn(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function Mi(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function wt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Ai(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,n).href}catch{return e}}var xt=G(()=>{});function $i(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(a,c,l){if(i>=n)return;let s=Date.now();(r.get(c)||0)>s||(r.set(c,s+t),i++,a==="warn"&&console&&console.warn?console.warn(`${e} ${l}`):console&&console.error&&console.error(`${e} ${l}`))}return{warnOnce(a,c){o("warn",a,c)},errorOnce(a,c){o("error",a,c)},reset(){r.clear(),i=0}}}function Li(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Ti(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",n),o=new URL(e,n);if(o.origin===i.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Ni(e,t){if(!t||Li(e)||Ti(e,t))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function Ri(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",wt(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${wt(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function Kn(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}function Pi(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function te(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",o=t.errorTTL??8e3,a=t.headers||{},c=!!t.silent;if(/^data:/i.test(e))try{if(n==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,m="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(m)?atob(y):decodeURIComponent(y),b=new Uint8Array([...x].map(C=>C.charCodeAt(0))),w=new Blob([b],{type:(m||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:e,fromCache:!1,mime:w.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let m=await fetch(e);if(!m.ok)return{ok:!1,data:null,status:m.status,url:e,fromCache:!1,reason:"http_error"};let y=await m.blob(),x=y.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Kn(y),status:m.status,url:e,fromCache:!1,mime:x}:n==="text"?{ok:!0,data:await y.text(),status:m.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:y,status:m.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let l=Pi(e,{as:n,timeout:r,useProxy:i,errorTTL:o}),s=Ve.get(l);if(s&&s.until>Date.now())return{...s.result,fromCache:!0};s&&Ve.delete(l);let u=ft.get(l);if(u)return u;let d=Ni(e,i)?Ri(e,i):e,f=t.credentials;if(!f)try{let m=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,m);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let h=new AbortController,g=setTimeout(()=>h.abort("timeout"),r),p=(async()=>{try{let m=await fetch(d,{signal:h.signal,credentials:f,headers:a});if(!m.ok){let b={ok:!1,data:null,status:m.status,url:d,fromCache:!1,reason:"http_error"};if(o>0&&Ve.set(l,{until:Date.now()+o,result:b}),!c){let w=`${m.status} ${m.statusText||""}`.trim();Gt.warnOnce(`http:${m.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${w} while fetching ${n} ${e}`)}return t.onError&&t.onError(b),b}if(n==="text")return{ok:!0,data:await m.text(),status:m.status,url:d,fromCache:!1};let y=await m.blob(),x=y.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Kn(y),status:m.status,url:d,fromCache:!1,mime:x}:{ok:!0,data:y,status:m.status,url:d,fromCache:!1,mime:x}}catch(m){let y=m&&typeof m=="object"&&"name"in m&&m.name==="AbortError"?String(m.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&o>0&&Ve.set(l,{until:Date.now()+o,result:x}),!c){let b=`${y}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,w=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;Gt.errorOnce(b,w)}return t.onError&&t.onError(x),x}finally{clearTimeout(g),ft.delete(l)}})();return ft.set(l,p),p}var Gt,ft,Ve,_e=G(()=>{xt(),Gt=$i("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),ft=new Map,Ve=new Map});async function xr(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=cn(e);if(!n)return e;let r=Ai(n),i=wt(r);if(E.background.has(i)){let o=E.background.get(i);return o?`url("${o}")`:"none"}try{let o=await te(i,{as:"dataURL",useProxy:t.useProxy});return o.ok?(E.background.set(i,o.data),`url("${o.data}")`):(E.background.set(i,null),"none")}catch{return E.background.set(i,null),"none"}}var _i=G(()=>{ne(),xt(),_e()});function Fi(e){if(e=String(e).toLowerCase(),dn.has(e)){let o={};return E.defaultStyle.set(e,o),o}if(E.defaultStyle.has(e))return E.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(un(o))continue;let a=r.getPropertyValue(o);i[o]=a}return t.removeChild(n),E.defaultStyle.set(e,i),i}function un(e){let t=String(e).toLowerCase();return!!(Cr.has(t)||Er.test(t)||Sr.test(t))}function Kt(e,t){if(t=String(t||"").toLowerCase(),dn.has(t))return"";let n=[],r=Fi(t),i=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[o,a]of Object.entries(e)){if(un(o)||i&&(o==="width"||o==="min-width"||o==="max-width"))continue;let c=r[o];a&&a!==c&&n.push(`${o}:${a}`)}return n.sort(),n.join(";")}function Di(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(n=>t.add(n.tagName.toLowerCase())),Array.from(t))}function Ii(e){let t=new Map;for(let r of e){let i=E.defaultStyle.get(r);if(!i)continue;let o=Object.entries(i).map(([a,c])=>`${a}:${c};`).sort().join("");o&&(t.has(o)||t.set(o,[]),t.get(o).push(r))}let n="";for(let[r,i]of t.entries())n+=`${i.join(",")} { ${r} }
|
|
3
|
+
`;return n}function Oi(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of t)n.set(i,`c${r++}`);return n}function Wi(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===t)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function ue(e,t=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(!(e instanceof Element)){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=E.computedStyle.get(e);r||(r=new Map,E.computedStyle.set(e,r));let i=r.get(t);if(!i){let o=Wi(e),a=null;try{a=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}i=a||n(),r.set(t,i)}return i}function Jn(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function Jt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var vr,dn,Hi,Sr,Er,Cr,kr=G(()=>{ne(),vr=new Set(["meta","script","noscript","title","link","template"]),dn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Hi=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],Sr=/(?:^|-)(animation|transition)(?:-|$)/i,Er=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Cr=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"])});function Ne(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Bi(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function Se(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),i=/mobile/i.test(e),o=!/safari/i.test(e),a=r&&i&&o,c=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),s=/ipad|iphone|ipod/.test(t)&&r;return n||a||c||l||s}function Ui(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Je=G(()=>{});function F(e,t,n){let r=e&&typeof e=="object"&&(e.options||e);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",t,n):console.warn("[snapdom]",t))}var Mr=G(()=>{}),re=G(()=>{_i(),kr(),Je(),xt(),Mr()}),Ar={};Ke(Ar,{toCanvas:()=>vt});function qi(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function ji(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function zi(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Vi(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(i=>i.trim()).filter(Boolean)}function Xi(e){let t=[],n="",r=0;for(let o=0;o<e.length;o++){let a=e[o];a==="("&&r++,a===")"&&(r=Math.max(0,r-1)),a===","&&r===0?(t.push(n.trim()),n=""):n+=a}n.trim()&&t.push(n.trim());let i=[];for(let o of t){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[c="0px",l="0px",s="0px"]=a,u=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";i.push(`drop-shadow(${c} ${l} ${s}${d?` ${u}`:""})`)}return i.join(" ")}function $r(e){let t=Vi(e),n=null,r=null,i=null,o=[];for(let c of t){let l=c.indexOf(":");if(l<0)continue;let s=c.slice(0,l).trim().toLowerCase(),u=c.slice(l+1).trim();s==="box-shadow"?i=u:s==="filter"?n=u:s==="-webkit-filter"?r=u:o.push([s,u])}if(i){let c=Xi(i);c&&(n=n?`${n} ${c}`:c,r=r?`${r} ${c}`:c)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([c,l])=>`${c}:${l}`).join(";")}function Yi(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${$r(r)}}`)}function Gi(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,Yi(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${$r(r)}${n}`),e}function Ki(e){if(!Se()||!qi(e))return e;try{let t=ji(e),n=Gi(t);return zi(n)}catch{return e}}async function vt(e,t){let{width:n,height:r,scale:i=1,dpr:o=1,meta:a={},backgroundColor:c}=t;e=Ki(e);let l=new Image;l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=e,await l.decode();let s=l.naturalWidth,u=l.naturalHeight,d=Number.isFinite(a.w0)?a.w0:s,f=Number.isFinite(a.h0)?a.h0:u,h,g,p=Number.isFinite(n),m=Number.isFinite(r);if(p&&m)h=Math.max(1,n),g=Math.max(1,r);else if(p){let b=n/Math.max(1,d);h=n,g=f*b}else if(m){let b=r/Math.max(1,f);g=r,h=d*b}else h=s,g=u;h=h*i,g=g*i;let y=document.createElement("canvas");y.width=h*o,y.height=g*o,y.style.width=`${h}px`,y.style.height=`${g}px`;let x=y.getContext("2d");return o!==1&&x.scale(o,o),c&&(x.save(),x.fillStyle=c,x.fillRect(0,0,h,g),x.restore()),x.drawImage(l,0,0,h,g),y}var St=G(()=>{Je()}),mt={};Ke(mt,{rasterize:()=>Lr});async function Lr(e,t){let n=await vt(e,t),r=new Image;return r.src=n.toDataURL(`image/${t.format}`,t.quality),await r.decode(),r.style.width=`${n.width/t.dpr}px`,r.style.height=`${n.height/t.dpr}px`,r}var pt=G(()=>{St()}),Zt={};Ke(Zt,{toImg:()=>Zn,toSvg:()=>Zn});async function Zn(e,t){let{scale:n=1,width:r,height:i,meta:o={}}=t,a=Number.isFinite(r),c=Number.isFinite(i),l=Number.isFinite(n)&&n!==1||a||c;if(Se()&&l)return await Lr(e,{...t,format:"png",quality:1,meta:o});let s=new Image;if(s.decoding="sync",s.loading="eager",s.src=e,await s.decode(),a&&c)s.style.width=`${r}px`,s.style.height=`${i}px`;else if(a){let u=Number.isFinite(o.w0)?o.w0:s.naturalWidth,d=Number.isFinite(o.h0)?o.h0:s.naturalHeight,f=r/Math.max(1,u);s.style.width=`${r}px`,s.style.height=`${Math.round(d*f)}px`}else if(c){let u=Number.isFinite(o.w0)?o.w0:s.naturalWidth,d=Number.isFinite(o.h0)?o.h0:s.naturalHeight,f=i/Math.max(1,d);s.style.height=`${i}px`,s.style.width=`${Math.round(u*f)}px`}else{let u=Math.round(s.naturalWidth*n),d=Math.round(s.naturalHeight*n);if(s.style.width=`${u}px`,s.style.height=`${d}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,s.src=e}catch(f){F(t,"SVG width/height patch in toImg failed",f)}}return s}var Qn=G(()=>{re(),pt()}),Tr={};Ke(Tr,{toBlob:()=>Nr});async function Nr(e,t){let n=t.type;if(n==="svg"){let i=decodeURIComponent(e.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let r=await vt(e,t);return new Promise(i=>r.toBlob(o=>i(o),`image/${n}`,t.quality))}var Rr=G(()=>{St()}),Pr={};Ke(Pr,{download:()=>Ji});async function er(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Ji(e,t){let n=(t?.format||t?.type||"").toLowerCase(),r=n==="jpg"?"jpeg":n||"png",i=t?.filename||`snapdom.${r}`,o={...t||{},format:r,type:r};o.dpr=1;let a=Bi();if(r==="svg"){let s=await Nr(e,{...o,type:"svg"});if(a&&await er(s,i))return;let u=URL.createObjectURL(s),d=document.createElement("a");d.href=u,d.download=i,document.body.appendChild(d),d.click(),URL.revokeObjectURL(u),d.remove();return}let c=await vt(e,o);if(a){let s=`image/${r}`,u=await new Promise(d=>c.toBlob(d,s,t?.quality));if(u&&await er(u,i))return}let l=document.createElement("a");l.href=c.toDataURL(`image/${r}`,t?.quality),l.download=i,document.body.appendChild(l),l.click(),l.remove()}var Zi=G(()=>{Rr(),St(),Je()});re();re();ne();var tr=new WeakMap,Qt=new Map,en=0;function Xe(){en++}var nr=!1;function Qi(e=document.documentElement){if(!nr){nr=!0;try{new MutationObserver(()=>Xe()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Xe()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Xe),t.ready?.then(()=>Xe()).catch(()=>{}))}catch{}}}function ea(e,t={}){let n={},r=e.getPropertyValue("visibility"),i=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(un(f)||i&&(i instanceof RegExp&&i.test(f)||typeof i=="function"&&i(f)))continue;let h=e.getPropertyValue(f);(f==="background-image"||f==="content")&&h.includes("url(")&&!h.includes("data:")&&(h="none"),n[f]=h}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of o)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of a)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}if(t.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!n[f])try{let h=e.getPropertyValue(f);h&&(n[f]=h)}catch{}}r==="hidden"&&(n.opacity="0");let c=parseFloat(e.getPropertyValue("border-top-width")||0)||0,l=parseFloat(e.getPropertyValue("border-right-width")||0)||0,s=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(c===0&&l===0&&s===0&&u===0){let d=(e.getPropertyValue("border-image-source")||"").trim(),f=d&&d!=="none",h=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let g of h)delete n[g];f||(n.border="none")}return n}var rr=new WeakMap;function ta(e){let t=rr.get(e);return t||(t=Object.entries(e).sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:0).map(([n,r])=>`${n}:${r}`).join(";"),rr.set(e,t),t)}function na(e,t=null,n={}){let r=tr.get(e);if(r&&r.epoch===en)return r.snapshot;let i=t||getComputedStyle(e),o=ea(i,n);return ca(e,i,o),tr.set(e,{epoch:en,snapshot:o}),o}function ra(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Qt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:t||{}}:{session:E.session,persist:{snapshotKeyCache:Qt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:e||t||{}}}function oa(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let i=e.style[r],o=n.getPropertyValue(i);o&&t.style.setProperty(i,o)}}async function Re(e,t,n,r){if(e.tagName==="STYLE")return;let i=ra(n,r),o=i.options&&i.options.cache||"auto";o!=="disabled"&&Qi(document.documentElement),o==="disabled"&&!i.session.__bumpedForDisabled&&(Xe(),Qt.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:c}=i;a.styleCache.has(e)||a.styleCache.set(e,getComputedStyle(e));let l=a.styleCache.get(e);e.getAttribute?.("style")&&oa(e,t,l);let s=na(e,l,i.options),u=ta(s),d=c.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=Kt(s,f),c.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function ia(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function aa(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function la(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function sa(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let n=e.firstElementChild,r=e.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let i=e.scrollHeight;if(i===0)return!1;let o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return i>o+a}function ca(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let i=parseFloat(t.height);if(Number.isFinite(i)&&e.scrollHeight>0&&Math.abs(i-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid")||ia(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||aa(t)||la(e))return;let c=t.overflowX||t.overflow||"visible",l=t.overflowY||t.overflow||"visible";if(c!=="visible"||l!=="visible")return;let s=t.clip;s&&s!=="auto"&&s!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||sa(e,t)&&(delete n.height,delete n["block-size"])}kr();var _r=["fill","stroke","color","background-color","stop-color"],or=new Map;function ua(e,t){let n=t+"::"+e.toLowerCase(),r=or.get(n);if(r)return r;let i=document,o=t==="http://www.w3.org/2000/svg"?i.createElementNS(t,e):i.createElement(e),a=i.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),i.documentElement.appendChild(a);let c=getComputedStyle(o),l={};for(let s of _r)l[s]=c.getPropertyValue(s)||"";return a.remove(),or.set(n,l),l}function da(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let n=e.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let c=o[a];if(c&&typeof c.value=="string"&&c.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let o=e.style;if(o&&o.length)for(let a=0;a<o.length;a++){let c=o[a],l=o.getPropertyValue(c);if(!l||!l.includes("var("))continue;let s=i&&i.getPropertyValue(c);if(s)try{t.style.setProperty(c,s.trim(),o.getPropertyPriority(c))}catch{}}}if(r&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let c=o[a];if(!c||typeof c.value!="string"||!c.value.includes("var("))continue;let l=c.name,s=i&&i.getPropertyValue(l);if(s)try{t.style.setProperty(l,s.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let o=e.namespaceURI||"html",a=ua(e.tagName,o);for(let c of _r){let l=i.getPropertyValue(c)||"",s=a[c]||"";if(l&&l!==s)try{t.style.setProperty(c,l.trim())}catch{}}}}re();re();ne();_e();function Xt(e,t,n){return Promise.all(e.map(r=>new Promise(i=>{function o(){Ne(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,i):o()},{fast:n})}o()})))}function fa(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function ma(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let i=n?fa(r):r;return`:where(${t} ${i})`}).join(", ")}function pa(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${t}:is(${r.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${t} ${r.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,i,o)=>{let a=ma(o,t,!0);return`${r}${i}${a}{`}),e):""}function ha(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function ga(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+`
|
|
4
4
|
`});let n=e.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let i of r.cssRules)t+=i.cssText+`
|
|
5
5
|
`}catch{}}catch{}return t}function ya(e,t,n){if(!t)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function wa(e,t){try{let n=e.currentSrc||e.src||"";if(!n)return;t.setAttribute("src",n),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function ba(e){let t=new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function xa(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let n=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(n)return n}catch{}return""}function va(e,t,n){let r=[];for(let i of t){let o=xa(e,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
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 _a(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 Pa(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(!Pa(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}Pe();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+=`
|
|
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,P=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===P,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(P-$.w)<=300&&A&&j)return!0}if(!M&&S.kind==="normal"&&w.some($=>yt($.s)!=="normal"))for(let $ of w){let A=Math.abs(P-$.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(),P=(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,P))continue;let A=Dr(B);if(!Ir(t,A))continue;let j={family:S,weightSpec:v,styleSpec:M,stretchSpec:P,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"- "}}Pe();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 _e=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?_e.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&&(_e=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!=="",P=g&&g!=="none",B=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",I=w&&w!=="none"&&C>0,$=S&&S!=="none";if(!(M||P||B||I||$)){if(h&&h.length&&e.parentElement){let R=_e.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)}_e.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(P)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()!==""||P||B||I||$;if(h&&h.length&&e.parentElement){let R=_e.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)}_e.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 P=M.name.indexOf(":");if(P!==-1&&M.name.slice(P+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 P=M.slice(1).trim();P&&!u.has(P)&&d.add(P)}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 P=s(M);if(P&&P.startsWith("#")){let I=P.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}}Pe();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 _l(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 Pl(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),Pl(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&&_l(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 P=(V,Y=NaN)=>{let X=typeof V=="string"?parseFloat(V):V;return Number.isFinite(X)?X:Y},B=P(o.options.width),I=P(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();Pe();ne();function rs(...e){return Ll(...e),_}var _=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&&_a(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>_.toPng(r,i),toSvg:(r,i)=>_.toSvg(r,i)}),_.capture(e,n,Yr)}_.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(),_r));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};_.toRaw=(e,t)=>_(e,t).then(n=>n.toRaw());_.toImg=(e,t)=>_(e,t).then(n=>n.toImg());_.toSvg=(e,t)=>_(e,t).then(n=>n.toSvg());_.toCanvas=(e,t)=>_(e,t).then(n=>n.toCanvas());_.toBlob=(e,t)=>_(e,t).then(n=>n.toBlob());_.toPng=(e,t)=>_(e,{...t,format:"png"}).then(n=>n.toPng());_.toJpg=(e,t)=>_(e,{...t,format:"jpeg"}).then(n=>n.toJpg());_.toWebp=(e,t)=>_(e,{...t,format:"webp"}).then(n=>n.toWebp());_.download=(e,t)=>_(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 ss=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fast.fonts.net","cloud.typography.com"],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{let n=new URL(t);return ss.some(r=>n.hostname===r||n.hostname.endsWith("."+r))}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 cs(){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(),cs())}async function eo(){await Zr();try{await document.fonts.ready}catch{}}var us=300,ds=["#__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(us);let p=window.scrollY,m=Math.min(t,n-p);try{let y=await _.toPng(document.documentElement,{width:e,height:t,embedFonts:!0,exclude:ds,excludeMode:"remove"});if(y){let x=await fs(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 fs(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",ms="__mindstudio-cursor-ripple",ro=.07,ps=250,At=300,hs=2e3,kt=10,oo=1,$t="#DD2590",gs=`<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}"/>
|
|
@@ -23,8 +23,8 @@ ${p}
|
|
|
23
23
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4_78" result="shape"/>
|
|
24
24
|
</filter>
|
|
25
25
|
</defs>
|
|
26
|
-
</svg>`,
|
|
27
|
-
${
|
|
26
|
+
</svg>`,gs="Remy",T=null,K=null,de=0,fe=0,Qe=!1,io=!1,q=null,hn=null,lo=!1,Fe=null,Ze=null,Mt=null;function ao(e,t,n){return e+(t-e)*n}function so(){window.location.search.includes("mode=iframe")&&(co(),to())}function co(){if(document.getElementById(no))return;let e=document.createElement("div");e.id=no,e.innerHTML=`
|
|
27
|
+
${hs}
|
|
28
28
|
<div style="
|
|
29
29
|
position: absolute;
|
|
30
30
|
left: 33px;
|
|
@@ -40,9 +40,9 @@ ${p}
|
|
|
40
40
|
white-space: nowrap;
|
|
41
41
|
letter-spacing: 0.3px;
|
|
42
42
|
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
43
|
-
">${
|
|
44
|
-
`,e.style.cssText=["position: fixed","top: 0","left: 0","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let t=document.createElement("div");t.id=
|
|
45
|
-
width: ${
|
|
43
|
+
">${gs}</div>
|
|
44
|
+
`,e.style.cssText=["position: fixed","top: 0","left: 0","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let t=document.createElement("div");t.id=fs,t.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${$t}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(t),document.documentElement.appendChild(e),T=e,K=t}function ys(){Ze===null&&fo()}function uo(){Ze!==null&&(cancelAnimationFrame(Ze),Ze=null),Fe=null}function fo(){if(T){if(Fe&&Fe.isConnected){let e=Fe.getBoundingClientRect(),t=e.left+e.width/2,n=e.top+e.height/2,r=window.innerWidth,i=window.innerHeight,o=Math.max(kt,Math.min(t,r-kt)),a=Math.max(kt,Math.min(n,i-kt));if(de=ao(de,o,ro),fe=ao(fe,a,ro),T.style.transition="none",T.style.left=`${de}px`,T.style.top=`${fe}px`,Math.abs(de-o)<oo&&Math.abs(fe-a)<oo&&(de=o,fe=a,T.style.left=`${de}px`,T.style.top=`${fe}px`,Mt)){let c=Mt;Mt=null,c()}}Ze=requestAnimationFrame(fo)}}async function Lt(e){if(T){if(q&&(clearTimeout(q),q=null),Fe=e,!Qe){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2;io||(de=n+60,fe=r+60,T.style.transition="none",T.style.left=`${de}px`,T.style.top=`${fe}px`,T.style.opacity="0",T.offsetWidth),T.style.transition=`opacity ${At}ms ease`,T.style.opacity="1",Qe=!0,io=!0,await U(At)}return ys(),new Promise(t=>{Mt=t})}}async function mo(){T&&(T.style.transform="scale(0.85) translateY(1px)",K&&(K.style.transition="none",K.style.left=`${de}px`,K.style.top=`${fe}px`,K.style.width="0",K.style.height="0",K.style.opacity="0.35",K.offsetWidth,K.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",K.style.width="40px",K.style.height="40px",K.style.opacity="0"),await U(ms),T&&(T.style.transform="scale(1) translateY(0)"),await U(100))}function gn(e){lo=e}function po(){q&&(clearTimeout(q),q=null)}function yn(){T&&hn!=="visible"&&(Fe=null,q&&clearTimeout(q),q=setTimeout(()=>{hn!=="visible"&&(T&&(T.style.transition=`opacity ${At}ms ease`,T.style.opacity="0",Qe=!1),uo(),q=null)},ps))}function Tt(e){lo||(hn=e,e==="visible"&&!T&&co(),T&&(e==="visible"?(q&&(clearTimeout(q),q=null),T.style.transition=`opacity ${At}ms ease`,T.style.opacity="1",Qe=!0):e==="hidden"?(q&&(clearTimeout(q),q=null),T.style.opacity="0",Qe=!1,uo()):yn()))}var bs=150,ho=100;async function wn(e=300,t=2e3){return new Promise(n=>{let r=Date.now()+t,i=Date.now(),o=window.scrollY,a=window.scrollX,c=document.body.scrollTop,l=document.documentElement.scrollTop,s=document.body.scrollHeight,u=document.body.scrollWidth;function d(){if(Date.now()>r){n();return}let f=window.scrollY,h=window.scrollX,g=document.body.scrollTop,p=document.documentElement.scrollTop,m=document.body.scrollHeight,y=document.body.scrollWidth;(f!==o||h!==a||g!==c||p!==l||m!==s||y!==u)&&(o=f,a=h,c=g,l=p,s=m,u=y,i=Date.now()),Date.now()-i>=e?n():requestAnimationFrame(d)}requestAnimationFrame(d)})}var xs=350;async function bn(e){let t=vs(e),n=t.map(a=>({el:a,top:a.scrollTop,left:a.scrollLeft})),r=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",e.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"}),document.documentElement.style.scrollBehavior=r;let i=t.map(a=>({top:a.scrollTop,left:a.scrollLeft})),o=[];for(let a=0;a<t.length;a++)(n[a].top!==i[a].top||n[a].left!==i[a].left)&&o.push({el:t[a],fromTop:n[a].top,fromLeft:n[a].left,toTop:i[a].top,toLeft:i[a].left});if(o.length===0){await new Promise(a=>requestAnimationFrame(()=>a()));return}for(let a of o)a.el.scrollTop=a.fromTop,a.el.scrollLeft=a.fromLeft;await new Promise(a=>{let c=performance.now();function l(s){let u=s-c,d=Math.min(u/xs,1),f=1-Math.pow(1-d,3);for(let h of o)h.el.scrollTop=h.fromTop+(h.toTop-h.fromTop)*f,h.el.scrollLeft=h.fromLeft+(h.toLeft-h.fromLeft)*f;d<1?requestAnimationFrame(l):a()}requestAnimationFrame(l)})}function vs(e){let t=[],n=e.parentElement;for(;n;){let r=getComputedStyle(n),i=r.overflowY,o=r.overflowX;(i==="auto"||i==="scroll"||o==="auto"||o==="scroll")&&t.push(n),n=n.parentElement}return t.push(document.scrollingElement||document.documentElement),t}async function Nt(e,t){let n=Date.now(),r=[];gn(!0),po(),Ln();for(let a=0;a<t.length;a++){let c=t[a],l=c.command;try{a>0&&await U(bs+Math.random()*ho-ho/2);let s=await Ss(c);r.push({index:a,command:l,...s})}catch(s){r.push({index:a,command:l,error:s instanceof Error?s.message:String(s)});break}}let i=Tn(),o=await je();return gn(!1),yn(),{id:e,steps:r,snapshot:o,logs:i,duration:Date.now()-n}}async function Ss(e){switch(e.command){case"snapshot":return{result:await je()};case"click":{let{element:t,matched:n}=ge(e);return await bn(t),await Lt(t),await mo(),Vt(t),await wn(),await U(1e3),{result:"ok",matched:n}}case"type":{let{element:t,matched:n}=ge(e),r=e.text;if(!r&&r!=="")throw new Error('type command requires a "text" field');return await bn(t),await Lt(t),await Vn(t,r,{clear:!!e.clear}),await wn(),{result:"ok",matched:n}}case"select":{let{element:t,matched:n}=ge(e),r=e.option;if(!r)throw new Error('select command requires an "option" field');await bn(t),await Lt(t);let i=Yn(t,r);return await wn(),{result:`selected "${i}"`,matched:n}}case"wait":{let{matched:t,elapsed:n}=await Xn(e);return{result:"ok",matched:t,elapsed:n}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:await Gn(t)}}case"screenshot":{let{image:t,width:n,height:r}=await Ct();return{result:{image:t,width:n,height:r}}}case"reload":return location.reload(),{result:"ok"};default:throw new Error(`Unknown command: ${e.command}`)}}var Es="/__mindstudio_dev__/commands",Cs="/__mindstudio_dev__/results",go=1e3,xn=!1;function wo(){window.location.search.includes("mode=iframe")&&(xn||(xn=!0,ks()))}async function ks(){for(;xn;)try{let e=await fetch(Es);if(e.status===200){let t=await e.json();t?.id&&Array.isArray(t.steps)&&await Ms(t.id,t.steps)}else e.status!==204&&await U(go)}catch{await U(go)}}async function Ms(e,t){try{let n=await Nt(e,t);await yo(n)}catch{await yo({id:e,steps:[],snapshot:"",logs:[],duration:0})}}async function yo(e){try{await fetch(Cs,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}var oe="#DD2590";var bo="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",As=200,xo=`
|
|
45
|
+
width: ${As}px;
|
|
46
46
|
background: ${oe};
|
|
47
47
|
border-radius: 19px 120px 120px;
|
|
48
48
|
font-weight: bold;
|
|
@@ -55,7 +55,7 @@ ${p}
|
|
|
55
55
|
overflow-wrap: break-word;
|
|
56
56
|
white-space: pre-wrap;
|
|
57
57
|
transition: box-shadow 0.15s;
|
|
58
|
-
`.trim(),et={inactive:"0 2px 6px rgba(0, 0, 0, 0.15)",selected:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px",editing:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px"}
|
|
58
|
+
`.trim(),et={inactive:"0 2px 6px rgba(0, 0, 0, 0.15)",selected:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px",editing:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px"},$s=`
|
|
59
59
|
position: absolute;
|
|
60
60
|
top: -8px;
|
|
61
61
|
right: -4px;
|
|
@@ -74,7 +74,7 @@ ${p}
|
|
|
74
74
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
75
75
|
font-family: ${bo};
|
|
76
76
|
font-weight: bold;
|
|
77
|
-
`.trim(),vo=0;function So(){let e=document.createElement("div");return e.dataset.deleteBtn="true",e.innerHTML="\xD7",e.style.cssText
|
|
77
|
+
`.trim(),vo=0;function So(){let e=document.createElement("div");return e.dataset.deleteBtn="true",e.innerHTML="\xD7",e.style.cssText=$s,e}function Eo(e,t){let n=`note-${++vo}`,r=document.createElement("div");r.id=n,r.dataset.noteId=n,r.style.cssText=`
|
|
78
78
|
position: absolute;
|
|
79
79
|
left: ${e}px;
|
|
80
80
|
top: ${t}px;
|
|
@@ -116,7 +116,7 @@ ${p}
|
|
|
116
116
|
${xo}
|
|
117
117
|
box-shadow: ${et.inactive};
|
|
118
118
|
cursor: grab;
|
|
119
|
-
`;let s=So();return c.appendChild(l),c.appendChild(s),o.appendChild(a),o.appendChild(c),{id:i,type:"area",x:e,y:t,width:n,height:r,element:o,bubble:l,deleteBtn:s,state:"inactive"}}function ko(e){e.state="selected",e.bubble.contentEditable="false",e.bubble.style.boxShadow=et.selected,e.bubble.style.cursor="grab",e.deleteBtn.style.display="block"}function Rt(e){e.state="editing",e.bubble.contentEditable="true",e.bubble.style.boxShadow=et.editing,e.bubble.style.cursor="text",e.deleteBtn.style.display="block",e.bubble.focus();let t=window.getSelection();t&&(t.selectAllChildren(e.bubble),t.collapseToEnd())}function De(e){return e.bubble.textContent?.trim()||""?(e.state="inactive",e.bubble.contentEditable="false",e.bubble.style.boxShadow=et.inactive,e.bubble.style.cursor="grab",e.deleteBtn.style.display="none",!0):!1}var
|
|
119
|
+
`;let s=So();return c.appendChild(l),c.appendChild(s),o.appendChild(a),o.appendChild(c),{id:i,type:"area",x:e,y:t,width:n,height:r,element:o,bubble:l,deleteBtn:s,state:"inactive"}}function ko(e){e.state="selected",e.bubble.contentEditable="false",e.bubble.style.boxShadow=et.selected,e.bubble.style.cursor="grab",e.deleteBtn.style.display="block"}function Rt(e){e.state="editing",e.bubble.contentEditable="true",e.bubble.style.boxShadow=et.editing,e.bubble.style.cursor="text",e.deleteBtn.style.display="block",e.bubble.focus();let t=window.getSelection();t&&(t.selectAllChildren(e.bubble),t.collapseToEnd())}function De(e){return e.bubble.textContent?.trim()||""?(e.state="inactive",e.bubble.contentEditable="false",e.bubble.style.boxShadow=et.inactive,e.bubble.style.cursor="grab",e.deleteBtn.style.display="none",!0):!1}var Ls="__mindstudio-notes-overlay",Ts="__mindstudio-notes-cursor",Ns=5,Rs=`<svg width="25" height="26" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
120
120
|
<g filter="url(#filter0_d_notes)">
|
|
121
121
|
<path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${oe}"/>
|
|
122
122
|
<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="${oe}"/>
|
|
@@ -133,23 +133,23 @@ ${p}
|
|
|
133
133
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
|
134
134
|
</filter>
|
|
135
135
|
</defs>
|
|
136
|
-
</svg>`,D=null,z=null,Ce=[],L=null,
|
|
136
|
+
</svg>`,D=null,z=null,Ce=[],L=null,Pt=!1,Oe=0,We=0,_t=!1,tt=!1,H=null,ie=null,Ao=0,$o=0;function Lo(){D||(D=document.createElement("div"),D.id=Ls,D.style.cssText=`
|
|
137
137
|
position: fixed;
|
|
138
138
|
inset: 0;
|
|
139
139
|
z-index: 2147483646;
|
|
140
140
|
cursor: none;
|
|
141
141
|
touch-action: none;
|
|
142
|
-
`,z=document.createElement("div"),z.id=
|
|
142
|
+
`,z=document.createElement("div"),z.id=Ts,z.innerHTML=Rs,z.style.cssText=`
|
|
143
143
|
position: fixed;
|
|
144
144
|
top: 0;
|
|
145
145
|
left: 0;
|
|
146
146
|
z-index: 2147483647;
|
|
147
147
|
pointer-events: none;
|
|
148
148
|
will-change: left, top;
|
|
149
|
-
`,D.addEventListener("pointerdown",
|
|
149
|
+
`,D.addEventListener("pointerdown",Po),D.addEventListener("pointermove",Ro),document.addEventListener("pointermove",_o,{capture:!0}),document.addEventListener("pointerup",Fo,{capture:!0}),document.addEventListener("pointercancel",Do,{capture:!0}),document.addEventListener("keydown",Io),document.body.appendChild(D),document.body.appendChild(z))}function To(){document.removeEventListener("pointermove",_o,{capture:!0}),document.removeEventListener("pointerup",Fo,{capture:!0}),document.removeEventListener("pointercancel",Do,{capture:!0}),document.removeEventListener("keydown",Io),D&&(D.removeEventListener("pointerdown",Po),D.removeEventListener("pointermove",Ro),D.remove(),D=null),z&&(z.remove(),z=null),Ce=[],L=null,Ie()}function No(){z&&(z.style.display="none"),ie=null,tt=!1,Ie()}function Ro(e){if(!z||!D)return;z.style.left=`${e.clientX}px`,z.style.top=`${e.clientY}px`,Oo(e.target)?(z.style.display="none",D.style.cursor=""):(z.style.display="",D.style.cursor="none")}function Po(e){if(!D)return;let t=e.target;if(t.dataset?.deleteBtn==="true"||t.closest("[data-delete-btn]")){let r=t.closest("[data-note-id]");if(r){let i=Ce.find(o=>o.id===r.id);if(i){Ee(i),e.preventDefault(),e.stopPropagation();return}}}D.setPointerCapture(e.pointerId);let n=Oo(e.target);if(n){if(n.state==="editing")return;if(n.state==="selected"){let r=e.target;if(r.dataset?.bubble==="true"||r.closest("[data-bubble]")){Rt(n),L=n,e.preventDefault();return}Mo(n,e),e.preventDefault();return}L&&L!==n&&(De(L)||Ee(L)),ko(n),L=n,Mo(n,e),e.preventDefault();return}if(L&&(L.state==="editing"||L.state==="selected")){De(L)||Ee(L),L=null,tt=!0,e.preventDefault();return}Pt=!0,Oe=e.clientX,We=e.clientY,_t=!1,tt=!1,e.preventDefault()}function _o(e){if(ie){let r=e.clientX-Ao,i=e.clientY-$o;ie.x=r,ie.y=i,ie.element.style.left=`${r}px`,ie.element.style.top=`${i}px`;return}if(!Pt||!D)return;let t=e.clientX-Oe,n=e.clientY-We;Math.sqrt(t*t+n*n)>Ns&&(_t=!0,H||(H=document.createElement("div"),H.style.cssText=`
|
|
150
150
|
position: fixed;
|
|
151
151
|
border: 4px dashed ${oe};
|
|
152
152
|
border-radius: 12px;
|
|
153
153
|
pointer-events: none;
|
|
154
154
|
z-index: 2;
|
|
155
|
-
`,D.appendChild(H)),H.style.left=`${Math.min(Oe,e.clientX)}px`,H.style.top=`${Math.min(We,e.clientY)}px`,H.style.width=`${Math.abs(t)}px`,H.style.height=`${Math.abs(n)}px`)}function Fo(e){if(D)try{D.releasePointerCapture(e.pointerId)}catch{}if(ie){ie=null;return}if(tt){tt=!1,Ie();return}if(!
|
|
155
|
+
`,D.appendChild(H)),H.style.left=`${Math.min(Oe,e.clientX)}px`,H.style.top=`${Math.min(We,e.clientY)}px`,H.style.width=`${Math.abs(t)}px`,H.style.height=`${Math.abs(n)}px`)}function Fo(e){if(D)try{D.releasePointerCapture(e.pointerId)}catch{}if(ie){ie=null;return}if(tt){tt=!1,Ie();return}if(!Pt||!D){Ie();return}if(_t){H&&(H.remove(),H=null);let t=Math.min(Oe,e.clientX),n=Math.min(We,e.clientY),r=Math.abs(e.clientX-Oe),i=Math.abs(e.clientY-We);if(r>10&&i>10){let o=Co(t,n,r,i);D.appendChild(o.element),Ce.push(o),Rt(o),L=o}}else{let t=Eo(e.clientX,e.clientY);D.appendChild(t.element),Ce.push(t),Rt(t),L=t}Ie()}function Do(){H&&(H.remove(),H=null),ie=null,Ie()}function Io(e){if(L){if(e.key==="Enter"&&!e.shiftKey&&L.state==="editing"){De(L)||Ee(L),L=null,e.preventDefault();return}if(e.key==="Escape"){L.state==="editing"?(De(L)||Ee(L),L=null):L.state==="selected"&&(De(L),L=null),e.preventDefault();return}if(L.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){Ee(L),L=null,e.preventDefault();return}L.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&L.bubble.textContent?.trim()===""&&(Ee(L),L=null,e.preventDefault())}}function Mo(e,t){ie=e,Ao=t.clientX-e.x,$o=t.clientY-e.y}function Oo(e){for(let t of Ce)if(t.element.contains(e))return t;return null}function Ee(e){e.element.remove(),Ce=Ce.filter(t=>t.id!==e.id),L===e&&(L=null)}function Ie(){Pt=!1,Oe=0,We=0,_t=!1,H&&(H.remove(),H=null)}var Ft=!1;function Wo(){Ft||(Ft=!0,Lo())}function Ho(){Ft&&(Ft=!1,To())}async function Bo(){let{image:e}=await Ct();return e}var vn="mindstudio-browser-agent",Sn=null;function Uo(){Sn||(Sn=async e=>{if(e.source===window)return;let t=e.data;if(!(!t||t.channel!==vn))switch(t.command){case"notes-enter":Wo();break;case"notes-exit":Ho();break;case"notes-cursor-hide":No();break;case"cursor-show":Tt("visible");break;case"cursor-hide":Tt("hidden");break;case"cursor-auto":Tt(null);break;case"notes-screenshot":{try{let n=await Bo();window.parent.postMessage({channel:vn,command:"screenshot-result",image:n},"*")}catch(n){window.parent.postMessage({channel:vn,command:"screenshot-result",error:n instanceof Error?n.message:"Screenshot failed"},"*")}break}}},window.addEventListener("message",Sn))}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__=!0,Nn(),Dn(),In(),On(),Hn(),Wn(),wo(),so(),Uo(),Qr(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return ii(Ps);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstudio-ai/browser-agent",
|
|
3
|
-
"version": "0.1.
|
|
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": [
|