chamba 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +6 -7
  2. package/inject/annotate.js +18 -49
  3. package/package.json +6 -7
  4. package/skill/SKILL.md +67 -259
  5. package/web/assets/highlighted-body-OFNGDK62-Bn4Eu7CG.js +1 -0
  6. package/web/assets/index-B9DI4F1Z.js +202 -0
  7. package/web/assets/index-DK_n6CTo.css +2 -0
  8. package/web/assets/mermaid-GHXKKRXX-CEMduc-U.js +1 -0
  9. package/web/index.html +2 -2
  10. package/web/assets/abnfDiagram-VRR7QNED-C5V2hrtE.js +0 -1
  11. package/web/assets/arc-d7OTmxZy.js +0 -1
  12. package/web/assets/architectureDiagram-ZJ3FMSHR--CztaeAS.js +0 -36
  13. package/web/assets/blockDiagram-677ZJIJ3-DkA5Z_uK.js +0 -132
  14. package/web/assets/c4Diagram-LMCZKHZV-C78dI0l-.js +0 -10
  15. package/web/assets/channel-D9AxU8kk.js +0 -1
  16. package/web/assets/chunk-2Q5K7J3B-LBNP12XV.js +0 -1
  17. package/web/assets/chunk-32BRIVSS-DZoXrhCs.js +0 -1
  18. package/web/assets/chunk-5VM5RSS4-CPjoRxF_.js +0 -15
  19. package/web/assets/chunk-EX3LRPZG-DSlL8FE9.js +0 -231
  20. package/web/assets/chunk-JWPE2WC7-BjbBLYge.js +0 -1
  21. package/web/assets/chunk-MOJQB5TN-DCKqdaDr.js +0 -88
  22. package/web/assets/chunk-RYQCIY6F-D5yAURhE.js +0 -1
  23. package/web/assets/chunk-V7JOEXUC-DKY2sn06.js +0 -206
  24. package/web/assets/chunk-VR4S4FIN-DGiVMHh6.js +0 -1
  25. package/web/assets/chunk-XXDRQBXY-CUI1Tkrr.js +0 -1
  26. package/web/assets/classDiagram-OUVF2IWQ-D7gWuzIF.js +0 -1
  27. package/web/assets/classDiagram-v2-EOCWNBFH-D7gWuzIF.js +0 -1
  28. package/web/assets/cose-bilkent-JH36ORCC-Ao3LzalV.js +0 -1
  29. package/web/assets/cynefin-VYW2F7L2-7JQwpRwH.js +0 -178
  30. package/web/assets/cynefinDiagram-TSTJHNR4-BfuANy_V.js +0 -62
  31. package/web/assets/cytoscape.esm-DTSO7Bv0.js +0 -331
  32. package/web/assets/dagre-VKFMJZFB-DHVnVJCL.js +0 -4
  33. package/web/assets/defaultLocale-DX6XiGOO.js +0 -1
  34. package/web/assets/diagram-FQU43EPY-OYrtwA2f.js +0 -3
  35. package/web/assets/diagram-G47NLZAW-CbkLZxYp.js +0 -24
  36. package/web/assets/diagram-NH7WQ7WH-B0z_jTdi.js +0 -24
  37. package/web/assets/diagram-OA4YK3LP-BRu_2nwx.js +0 -30
  38. package/web/assets/diagram-WEI45ONY-B9cpw86D.js +0 -41
  39. package/web/assets/ebnfDiagram-CCIWWBDH-DaBQ7T4R.js +0 -1
  40. package/web/assets/erDiagram-Q63AITRT-D6PQiFj3.js +0 -85
  41. package/web/assets/flowDiagram-23GEKE2U-p_8Wj7It.js +0 -156
  42. package/web/assets/ganttDiagram-NO4QXBWP-BZBwuqu3.js +0 -292
  43. package/web/assets/gitGraphDiagram-IHSO6WYX-DyPcQ-91.js +0 -106
  44. package/web/assets/graph-C9eacEi8.js +0 -1
  45. package/web/assets/highlighted-body-OFNGDK62-Cq7RJZcn.js +0 -1
  46. package/web/assets/index-BN-QUr5b.js +0 -350
  47. package/web/assets/index-D6-LVQ5m.css +0 -1
  48. package/web/assets/infoDiagram-FWYZ7A6U-sAgBAeWC.js +0 -2
  49. package/web/assets/init-Gi6I4Gst.js +0 -1
  50. package/web/assets/ishikawaDiagram-FXEZZL3T-COEn9wCs.js +0 -70
  51. package/web/assets/journeyDiagram-5HDEW3XC-BPddPRXW.js +0 -139
  52. package/web/assets/kanban-definition-HUTT4EX6-B8TW97Oy.js +0 -89
  53. package/web/assets/katex-C5jXJg4s.js +0 -257
  54. package/web/assets/layout-DEXfKzaS.js +0 -1
  55. package/web/assets/linear-CnW5uQ_k.js +0 -1
  56. package/web/assets/map-Czzmt4hB.js +0 -1
  57. package/web/assets/mermaid.core-bOV5iNX_.js +0 -314
  58. package/web/assets/mindmap-definition-LN4V7U3C-Dtr4xW_-.js +0 -96
  59. package/web/assets/ordinal-Cboi1Yqb.js +0 -1
  60. package/web/assets/pegDiagram-2B236MQR-DqBITK5N.js +0 -1
  61. package/web/assets/pieDiagram-ENE6RG2P-DXjxZgy3.js +0 -39
  62. package/web/assets/quadrantDiagram-ABIIQ3AL-D4MXx3U7.js +0 -7
  63. package/web/assets/railroadDiagram-RFXS5EU6-LPfpHg4_.js +0 -1
  64. package/web/assets/requirementDiagram-TGXJPOKE-CiDswbjt.js +0 -84
  65. package/web/assets/sankeyDiagram-HTMAVEWB-VfN_qTEI.js +0 -40
  66. package/web/assets/sequenceDiagram-DBY2YBRQ-kJRIx4zm.js +0 -162
  67. package/web/assets/sizeCapture-X5ZJPWSS-D8vJbAt-.js +0 -1
  68. package/web/assets/stateDiagram-2N3HPSRC-9qku-qAj.js +0 -1
  69. package/web/assets/stateDiagram-v2-6OUMAXLB-DbOQICyv.js +0 -1
  70. package/web/assets/swimlanes-5IMT3BWC-Cdb5FDUM.js +0 -2
  71. package/web/assets/swimlanesDiagram-G3AALYLV-EDpLmqQv.js +0 -8
  72. package/web/assets/timeline-definition-FHXFAJF6-D0hyJCMm.js +0 -120
  73. package/web/assets/vennDiagram-L72KCM5P-KsCkGMtr.js +0 -34
  74. package/web/assets/wardleyDiagram-EHGQE667-B4jT_1ak.js +0 -78
  75. package/web/assets/xychartDiagram-FW5EYKEG-Bmy0rt8j.js +0 -7
@@ -1,49 +1,18 @@
1
- (function(){"use strict";const _e="chamba-annotate/1";function An(e){let t=null;return window.addEventListener("message",n=>{const i=n.data;if(!(!i||i.tag!==_e)){if(i.t==="hello"){if(n.source!==window.parent)return;t=n.origin}t===null||n.origin!==t||e(i)}}),{emit:n=>{t!==null&&window.parent.postMessage(n,t)}}}var kn=Object.defineProperty,z=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}},ve=(e,t)=>{for(var r in t)kn(e,r,{get:t[r],enumerable:!0})};function Mn(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 En(e="soft"){switch(A.session.__counterEpoch=(A.session.__counterEpoch||0)+1,e){case"auto":{A.session.styleMap=new Map,A.session.nodeMap=new Map;return}case"soft":{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap,A.computedStyle=new WeakMap,A.measureHints=new WeakMap,A.baseStyle=new q(50),A.defaultStyle=new q(30),A.image=new q(100),A.background=new q(100),A.resource=new q(150),A.font=new Set;return}default:{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap;return}}}var q,A,D=z(()=>{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 r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,t)}},A={image:new q(100),background:new q(100),resource:new q(150),defaultStyle:new q(30),baseStyle:new q(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Ze(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function Nn(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(r,n)=>{let i=n.split(",").map(o=>o.trim());return i.length!==6?`matrix(${n})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(r,n)=>{let i=n.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${n})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Oe(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Fn(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let r=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,r).href}catch{return e}}var We=z(()=>{});function Ln(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:r=12}={}){let n=new Map,i=0;function o(a,l,c){if(i>=r)return;let s=Date.now();(n.get(l)||0)>s||(n.set(l,s+t),i++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,l){o("warn",a,l)},errorOnce(a,l){o("error",a,l)},reset(){n.clear(),i=0}}}function Rn(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Tn(e,t){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(n||".",r),o=new URL(e,r);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 Pn(e,t){if(!t||Rn(e)||Tn(e,t))return!1;try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,r);return typeof location<"u"?n.origin!==location.origin:!0}catch{return!!t}}function _n(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Oe(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}${Oe(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function _t(e){return new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(e)})}function On(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function Y(e,t={}){let r=t.as??"blob",n=t.timeout??3e3,i=t.useProxy||"",o=t.errorTTL??8e3,a=t.headers||{},l=!!t.silent;if(/^data:/i.test(e))try{if(r==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,g="",w=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(g)?atob(w):decodeURIComponent(w),S=new Uint8Array([...x].map(v=>v.charCodeAt(0))),b=new Blob([S],{type:(g||"").split(";")[0]||""});return{ok:!0,data:b,status:200,url:e,fromCache:!1,mime:b.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let g=await fetch(e);if(!g.ok)return{ok:!1,data:null,status:g.status,url:e,fromCache:!1,reason:"http_error"};let w=await g.blob(),x=w.type||g.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await _t(w),status:g.status,url:e,fromCache:!1,mime:x}:r==="text"?{ok:!0,data:await w.text(),status:g.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:w,status:g.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 r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let c=On(e,{as:r,timeout:n,useProxy:i,errorTTL:o}),s=$e.get(c);if(s&&s.until>Date.now())return{...s.result,fromCache:!0};s&&$e.delete(c);let u=Ie.get(c);if(u)return u;let f=Pn(e,i)?_n(e,i):e,d=t.credentials;if(!d)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",w=new URL(e,g);d=typeof location<"u"&&w.origin===location.origin?"include":"omit"}catch{d="omit"}let m=new AbortController,h=setTimeout(()=>m.abort("timeout"),n),p=(async()=>{try{let g=await fetch(f,{signal:m.signal,credentials:d,headers:a});if(!g.ok){let S={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(o>0&&$e.set(c,{until:Date.now()+o,result:S}),!l){let b=`${g.status} ${g.statusText||""}`.trim();Je.warnOnce(`http:${g.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${b} while fetching ${r} ${e}`)}return t.onError&&t.onError(S),S}if(r==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let w=await g.blob(),x=w.type||g.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await _t(w),status:g.status,url:f,fromCache:!1,mime:x}:{ok:!0,data:w,status:g.status,url:f,fromCache:!1,mime:x}}catch(g){let w=g&&typeof g=="object"&&"name"in g&&g.name==="AbortError"?String(g.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:w};if(!/^blob:/i.test(e)&&o>0&&$e.set(c,{until:Date.now()+o,result:x}),!l){let S=`${w}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,b=w==="timeout"?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${e}`:w==="abort"?`Request aborted while fetching ${r} ${e}`:`Network/CORS issue while fetching ${r} ${e}. A proxy may be required`;Je.errorOnce(S,b)}return t.onError&&t.onError(x),x}finally{clearTimeout(h),Ie.delete(c)}})();return Ie.set(c,p),p}var Je,Ie,$e,he=z(()=>{We(),Je=Ln("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Ie=new Map,$e=new Map});async function Ot(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=Ze(e);if(!r)return e;let n=Fn(r),i=Oe(n),o=(t.useProxy||"")+"|"+i;if(A.background.has(o)){let a=A.background.get(o);return a?`url("${a}")`:"none"}try{let a=await Y(i,{as:"dataURL",useProxy:t.useProxy});return a.ok?(A.background.set(o,a.data),`url("${a.data}")`):(A.background.set(o,null),"none")}catch{return A.background.set(o,null),"none"}}var Wn=z(()=>{D(),We(),he()});function In(e){if(e=String(e).toLowerCase(),nt.has(e)){let o={};return A.defaultStyle.set(e,o),o}if(A.defaultStyle.has(e))return A.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 r=document.createElement(e);r.style.all="initial",t.appendChild(r);let n=getComputedStyle(r),i={};for(let o of n){if(et(o))continue;let a=n.getPropertyValue(o);i[o]=a}return t.removeChild(r),A.defaultStyle.set(e,i),i}function et(e){let t=ot.get(e);if(t===void 0){let r=String(e).toLowerCase();t=Ut.has(r)||Ht.test(r)||jt.test(r),ot.set(e,t)}return t}function Wt(e,t){return!qt.has(e)&&(t==="inline"||zt.has(e)||Vt.has(e))}function tt(e,t,r=!0,n=!1){if(t=String(t||"").toLowerCase(),nt.has(t))return"";let i=[],o=In(t),a=(e.display||"").toLowerCase(),l=a==="inline",c=Wt(t,a)&&r,s=!1;for(let u in e){if(et(u))continue;let f=e[u];if(c){if(Bt.has(u))continue;if(Xt.has(u)){f&&f!==o[u]&&(i.push(`${u}:${f}`),f!=="auto"&&(s=!0));continue}}f&&f!==o[u]&&i.push(`${u}:${f}`)}if(c&&!l&&!n&&!s){let u=e.width;u&&u!=="auto"&&u!==o.width&&i.push(`min-width:${u}`)}return i.sort(),i.join(";")}function Dn(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(r=>t.add(r.tagName.toLowerCase())),Array.from(t))}function jn(e){let t=new Map;for(let n of e){let i=A.defaultStyle.get(n);if(!i)continue;let o=Object.entries(i).map(([a,l])=>`${a}:${l};`).sort().join("");o&&(t.has(o)||t.set(o,[]),t.get(o).push(n))}let r="";for(let[n,i]of t.entries())r+=`${i.join(",")} { ${n} }
2
- `;return r}function Hn(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),r=new Map,n=1;for(let i of t)r.set(i,`c${n++}`);return r}function Un(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let r=t.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let n=0;n<window.frames.length;n++)try{if(window.frames[n]?.document===t)return window.frames[n]}catch{}}catch{}return typeof window<"u"?window:null}function B(e,t=null){let r=()=>{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)||r()}catch{return r()}return r()}let n=A.computedStyle.get(e);n||(n=new Map,A.computedStyle.set(e,n));let i=n.get(t);if(!i){let o=Un(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||r(),n.set(t,i)}return i}function It(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);for(let r of Yt){let n=t[`border-${r}-style`],i=t[`border-${r}-width`];(n==="none"||n==="hidden"||i==="0px")&&(delete t[`border-${r}-style`],delete t[`border-${r}-width`],delete t[`border-${r}-color`])}return t}function rt(e){let t=[],r=0,n=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&r++,o===")"&&r--,o===","&&r===0&&(t.push(e.slice(n,i).trim()),n=i+1)}return t.push(e.slice(n).trim()),t}var Dt,nt,zn,jt,Ht,Ut,ot,zt,Vt,qt,Bt,Xt,Yt,it=z(()=>{D(),Dt=new Set(["meta","script","noscript","title","link","template"]),nt=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"]),zn=["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"],jt=/(?:^|-)(animation|transition)(?:-|$)/i,Ht=/^(--.+|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,Ut=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"]),ot=new Map,zt=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),Vt=new Set(["table","thead","tbody","tfoot","tr","td","th"]),qt=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Bt=new Set(["width","max-width","inline-size","max-inline-size"]),Xt=new Set(["min-width","min-inline-size"]),Yt=["top","right","bottom","left"]});function ce(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Vn(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),r=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||r}function oe(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),r=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),n=/applewebkit/i.test(e),i=/mobile/i.test(e),o=!/safari/i.test(e),a=n&&i&&o,l=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),s=/ipad|iphone|ipod/.test(t)&&n;return r||a||l||c||s}function qn(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Ce=z(()=>{});function R(e,t,r){let n=e&&typeof e=="object"&&(e.options||e);n&&n.debug&&(r!==void 0?console.warn("[snapdom]",t,r):console.warn("[snapdom]",t))}var Gt=z(()=>{}),G=z(()=>{Wn(),it(),Ce(),We(),Gt()}),Kt={};ve(Kt,{toCanvas:()=>De});function Bn(e){if(!Qt(e))return e;try{let t=Zt(e),r=t.match(/<svg\b[^>]*>/i);if(!r)return e;let n=r[0],i=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return e;let a=Math.min(1,fe/i,fe/o,Math.sqrt(at/(i*o)));if(a>=1)return e;let l=Math.max(1,Math.floor(i*a)),c=Math.max(1,Math.floor(o*a));console.warn(`[snapDOM] Capture ${Math.round(i)}×${Math.round(o)}px exceeds the browser image-decode limit (${fe}px/side); downscaling to ${l}×${c}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`);let s=t.replace(n,n.replace(/(\bwidth=")[\d.]+/i,`$1${l}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`));return Jt(s)}catch{return e}}function Qt(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Zt(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Jt(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Xn(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&n++,o===")"&&(n=Math.max(0,n-1)),o===";"&&n===0?(t.push(r),r=""):r+=o}return r.trim()&&t.push(r),t.map(i=>i.trim()).filter(Boolean)}function Yn(e){let t=[],r="",n=0;for(let o=0;o<e.length;o++){let a=e[o];a==="("&&n++,a===")"&&(n=Math.max(0,n-1)),a===","&&n===0?(t.push(r.trim()),r=""):r+=a}r.trim()&&t.push(r.trim());let i=[];for(let o of t){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",c="0px",s="0px"]=a,u=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!u&&u!==",";i.push(`drop-shadow(${l} ${c} ${s}${f?` ${u}`:""})`)}return i.join(" ")}function er(e){let t=Xn(e),r=null,n=null,i=null,o=[];for(let l of t){let c=l.indexOf(":");if(c<0)continue;let s=l.slice(0,c).trim().toLowerCase(),u=l.slice(c+1).trim();s==="box-shadow"?i=u:s==="filter"?r=u:s==="-webkit-filter"?n=u:o.push([s,u])}if(i){let l=Yn(i);l&&(r=r?`${r} ${l}`:l,n=n?`${n} ${l}`:l)}let a=[...o];return r&&a.push(["filter",r]),n&&a.push(["-webkit-filter",n]),a.map(([l,c])=>`${l}:${c}`).join(";")}function Gn(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${er(n)}}`)}function Kn(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,Gn(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${er(n)}${r}`),e}function Qn(e){if(!oe()||!Qt(e))return e;try{let t=Zt(e),r=Kn(t);return Jt(r)}catch{return e}}async function De(e,t){let{width:r,height:n,scale:i=1,dpr:o=1,meta:a={},backgroundColor:l}=t;e=Qn(e),e=Bn(e);let c=new Image;if(c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=e,await c.decode(),oe()){c.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(c);try{await new Promise(C=>requestAnimationFrame(()=>requestAnimationFrame(C)))}finally{try{c.remove()}catch{}}}let s=c.naturalWidth,u=c.naturalHeight,f=Number.isFinite(a.w0)?a.w0:s,d=Number.isFinite(a.h0)?a.h0:u,m,h,p=Number.isFinite(r),g=Number.isFinite(n);if(p&&g)m=Math.max(1,r),h=Math.max(1,n);else if(p){let C=r/Math.max(1,f);m=r,h=d*C}else if(g){let C=n/Math.max(1,d);h=n,m=f*C}else m=s,h=u;m=m*i,h=h*i;let w=m*o,x=h*o,S=Math.max(w/fe,x/fe,Math.sqrt(w*x/at));S>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}×${Math.round(x)}px exceeds the browser canvas limit (${fe}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),m/=S,h/=S);let b=document.createElement("canvas");b.width=m*o,b.height=h*o,b.style.width=`${m}px`,b.style.height=`${h}px`;let v=b.getContext("2d");return o!==1&&v.scale(o,o),l&&(v.save(),v.fillStyle=l,v.fillRect(0,0,m,h),v.restore()),v.drawImage(c,0,0,m,h),b}var fe,at,je=z(()=>{Ce(),fe=16384,at=16384*16384}),He={};ve(He,{rasterize:()=>tr});async function tr(e,t){let r=await De(e,t),n=new Image;return n.src=r.toDataURL(`image/${t.format}`,t.quality),await n.decode(),n.style.width=`${r.width/t.dpr}px`,n.style.height=`${r.height/t.dpr}px`,n}var Ue=z(()=>{je()}),lt={};ve(lt,{toImg:()=>rr,toSvg:()=>rr});async function rr(e,t){let{scale:r=1,width:n,height:i,meta:o={}}=t,a=Number.isFinite(n),l=Number.isFinite(i),c=Number.isFinite(r)&&r!==1||a||l;if(oe()&&c)return await tr(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&&l)s.style.width=`${n}px`,s.style.height=`${i}px`;else if(a){let u=Number.isFinite(o.w0)?o.w0:s.naturalWidth,f=Number.isFinite(o.h0)?o.h0:s.naturalHeight,d=n/Math.max(1,u);s.style.width=`${n}px`,s.style.height=`${Math.round(f*d)}px`}else if(l){let u=Number.isFinite(o.w0)?o.w0:s.naturalWidth,f=Number.isFinite(o.h0)?o.h0:s.naturalHeight,d=i/Math.max(1,f);s.style.height=`${i}px`,s.style.width=`${Math.round(u*d)}px`}else{let u=Math.round(s.naturalWidth*r),f=Math.round(s.naturalHeight*r);if(s.style.width=`${u}px`,s.style.height=`${f}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let d=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${f}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,s.src=e}catch(d){R(t,"SVG width/height patch in toImg failed",d)}}return s}var nr=z(()=>{G(),Ue()}),or={};ve(or,{toBlob:()=>ir});async function ir(e,t){let r=t.type;if(r==="svg"){let i=decodeURIComponent(e.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let n=await De(e,t);return new Promise(i=>n.toBlob(o=>i(o),`image/${r}`,t.quality))}var ar=z(()=>{je()}),lr={};ve(lr,{download:()=>Zn});async function sr(e,t){let r=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:t})}catch(n){if(n.name!=="AbortError")return!1}return!0}async function Zn(e,t){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(t?.type||"").toLowerCase(),i=r.has(n)?n:"",o=(t?.format||i||"").toLowerCase(),a=o==="jpg"?"jpeg":o||"png",l=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let s=Vn();if(a==="svg"){let d=await ir(e,{...c,type:"svg"});if(s&&await sr(d,l))return;let m=URL.createObjectURL(d),h=document.createElement("a");h.href=m,h.download=l,document.body.appendChild(h),h.click(),URL.revokeObjectURL(m),h.remove();return}let u=await De(e,c);if(s){let d=`image/${a}`,m=await new Promise(h=>u.toBlob(h,d,t?.quality));if(m&&await sr(m,l))return}let f=document.createElement("a");f.href=u.toDataURL(`image/${a}`,t?.quality),f.download=l,document.body.appendChild(f),f.click(),f.remove()}var Jn=z(()=>{ar(),je(),Ce()});G(),G(),D();var ur=new WeakMap,Ae=new Map,eo=2e3,st=0;function ke(){st++,Ae.size>eo&&Ae.clear()}var cr=!1;function to(e=document.documentElement){if(!cr){cr=!0;try{new MutationObserver(()=>ke()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>ke()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",ke),t.ready?.then(()=>ke()).catch(()=>{}))}catch{}}}function ro(e,t={}){let r={},n=e.getPropertyValue("visibility"),i=t.excludeStyleProps;for(let f=0;f<e.length;f++){let d=e[f];if(et(d)||i&&(i instanceof RegExp&&i.test(d)||typeof i=="function"&&i(d)))continue;let m=e.getPropertyValue(d);(d==="background-image"||d==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),r[d]=m}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let f of o)if(!r[f])try{let d=e.getPropertyValue(f);d&&(r[f]=d)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let f of a)if(!r[f])try{let d=e.getPropertyValue(f);d&&(r[f]=d)}catch{}if(t.embedFonts){let f=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let d of f)if(!r[d])try{let m=e.getPropertyValue(d);m&&(r[d]=m)}catch{}}n==="hidden"&&(r.opacity="0");try{(r["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(r.visibility="hidden")}catch{}let l=parseFloat(e.getPropertyValue("border-top-width")||0)||0,c=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(l===0&&c===0&&s===0&&u===0){let f=(e.getPropertyValue("border-image-source")||"").trim(),d=f&&f!=="none",m=["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 h of m)delete r[h];d||(r.border="none")}return r}function no(e){if(e.firstElementChild)return!0;for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===3&&/\S/.test(t.nodeValue||""))return!0;return!1}var fr=new WeakMap;function oo(e){let t=fr.get(e);return t||(t=Object.entries(e).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0).map(([r,n])=>`${r}:${n}`).join(";"),fr.set(e,t),t)}function io(e,t=null,r={}){let n=ur.get(e),i=!!(r&&r.embedFonts),o=r&&r.excludeStyleProps||null;if(n&&n.epoch===st&&n.embedFonts===i&&n.excludeStyleProps===o)return n.snapshot;let a=t||getComputedStyle(e),l=ro(a,r);return fo(e,a,l),ur.set(e,{epoch:st,snapshot:l,embedFonts:i,excludeStyleProps:o}),l}function ao(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Ae,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:t||{}}:{session:A.session,persist:{snapshotKeyCache:Ae,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:e||t||{}}}function lo(e,t,r){if(!(!e.style||e.style.length===0))for(let n=0;n<e.style.length;n++){let i=e.style[n],o=r.getPropertyValue(i);o&&t.style.setProperty(i,o)}}async function ie(e,t,r,n){if(e.tagName==="STYLE")return;let i=ao(r,n),o=i.options&&i.options.cache||"auto";o!=="disabled"&&to(document.documentElement),o==="disabled"&&!i.session.__bumpedForDisabled&&(ke(),Ae.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:l}=i;if(!a.styleCache.has(e)){let p=null;try{p=getComputedStyle(e)}catch{}a.styleCache.set(e,p||getComputedStyle(document.documentElement))}let c=a.styleCache.get(e);e.getAttribute?.("style")&&lo(e,t,c);let s=io(e,c,i.options),u=dr(e);if(u){let p=c.getPropertyValue("min-width");(!p||p==="auto"||p==="0px")&&(s["min-width"]="0px")}let f=e.tagName?.toLowerCase()||"div",d=oo(s),m=!0;Wt(f,(s.display||"").toLowerCase())&&(m=no(e),d=`${d}|${f}${m?"|c":""}${u?"|f":""}`);let h=l.snapshotKeyCache.get(d);h===void 0&&(h=tt(s,f,m,u),l.snapshotKeyCache.set(d,h)),a.styleMap.set(t,h)}function so(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function uo(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 dr(e){let t=e.parentElement;if(!t)return!1;let r=B(t).display||"";return r.includes("flex")||r.includes("grid")}function co(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let r=e.firstElementChild,n=e.lastElementChild;if(r&&r.tagName==="BR"||n&&n.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 fo(e,t,r){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let n=e.tagName&&e.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n))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")||so(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||uo(t)||dr(e))return;let l=t.overflowX||t.overflow||"visible",c=t.overflowY||t.overflow||"visible";if(l!=="visible"||c!=="visible")return;let s=t.clip;s&&s!=="auto"&&s!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||co(e,t)&&(delete r.height,delete r["block-size"])}it();var mr=["fill","stroke","color","background-color","stop-color"],mo=new Set(["symbol","defs","pattern","mask","clipPath","marker","linearGradient","radialGradient","filter"]);function ut(e){let t=e;for(;t&&t.nodeType===1;){if(t.namespaceURI==="http://www.w3.org/2000/svg"&&mo.has(t.localName))return!0;t=t.parentNode}return!1}var hr=new Map;function ho(e,t){let r=t+"::"+e.toLowerCase(),n=hr.get(r);if(n)return n;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 l=getComputedStyle(o),c={};for(let s of mr)c[s]=l.getPropertyValue(s)||"";return a.remove(),hr.set(r,c),c}function po(e,t){if(!(e instanceof Element)||!(t instanceof Element)||ut(e))return;let r=e.getAttribute?.("style"),n=!!(r&&r.includes("var("));if(!n&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let l=o[a];if(l&&typeof l.value=="string"&&l.value.includes("var(")){n=!0;break}}}let i=null;if(n)try{i=getComputedStyle(e)}catch{}if(n){let o=e.style;if(o&&o.length){let a=new Set;for(let l=0;l<o.length;l++){let c=o[l];if(a.has(c))continue;a.add(c);let s=o.getPropertyValue(c);if(!s||!s.includes("var("))continue;let u=i&&i.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),o.getPropertyPriority(c))}catch{}}}}if(n&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let l=o[a];if(!l||typeof l.value!="string"||!l.value.includes("var("))continue;let c=l.name,s=i&&i.getPropertyValue(c);if(s)try{t.style.setProperty(c,s.trim())}catch{}}}if(!n){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let o=e.namespaceURI||"html",a=ho(e.tagName,o);for(let l of mr){let c=i.getPropertyValue(l)||"",s=a[l]||"";if(c&&c!==s)try{t.style.setProperty(l,c.trim())}catch{}}}}G(),G(),D(),he();function ct(e,t,r){return Promise.all(e.map(n=>new Promise(i=>{function o(){ce(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(n,i):o()},{fast:r})}o()})))}function go(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function yo(e,t,r=!0){return e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{if(n.startsWith(":where(")||n.startsWith("@"))return n;let i=r?go(n):n;return`:where(${t} ${i})`}).join(", ")}function bo(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(r,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(r,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(r,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(r,n,i,o)=>{let a=yo(o,t,!0);return`${n}${i}${a}{`}),e):""}function wo(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function xo(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
3
- `});let r=e.adoptedStyleSheets||[];for(let n of r)try{if(n&&n.cssRules)for(let i of n.cssRules)t+=i.cssText+`
4
- `}catch{}}catch{}return t}function So(e,t,r){if(!t)return;let n=document.createElement("style");n.setAttribute("data-sd",r),n.textContent=t,e.insertBefore(n,e.firstChild||null)}function vo(e,t){try{let r=e.currentSrc||e.src||"";if(!r)return;t.setAttribute("src",r),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function $o(e){let t=new Set;if(!e)return t;let r=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,n;for(;n=r.exec(e);)t.add(n[1]);return t}function Co(e,t){try{let r=getComputedStyle(e).getPropertyValue(t).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(r)return r}catch{}return""}function Ao(e,t,r){let n=[];for(let i of t){let o=Co(e,i);o&&n.push(`${i}: ${o};`)}return n.length?`${r}{${n.join("")}}
5
- `:""}function ko(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 Mo(e,t=3){let r=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},n=r(),i=0;for(;i<t&&(!n||!n.body&&!n.documentElement);)await new Promise(o=>setTimeout(o,0)),n=r(),i++;return n&&(n.body||n.documentElement)?n:null}function Eo(e){let t=e.getBoundingClientRect(),r=0,n=0,i=0,o=0;try{let c=getComputedStyle(e);r=parseFloat(c.borderLeftWidth)||0,n=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(r+n))),l=Math.max(0,Math.round(t.height-(i+o)));return{contentWidth:a,contentHeight:l,rect:t}}function Q(e){let t=0,r=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(r=e.offsetHeight),t===0||r===0)try{let n=getComputedStyle(e);if(t===0){let i=parseFloat(n.width);!isNaN(i)&&i>0&&(t=i)}if(r===0){let i=parseFloat(n.height);!isNaN(i)&&i>0&&(r=i)}}catch{}if(t===0||r===0)try{if(t===0){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(r===0){let n=parseFloat(e.getAttribute("height"));!isNaN(n)&&n>0&&(r=n)}}catch{}if((t===0||r===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),r===0&&e.naturalHeight>0&&(r=e.naturalHeight)}catch{}return{width:t,height:r}}function No(e,t,r){let n=e.defaultView,i=n?n.scrollX:0,o=n?n.scrollY:0,a=e.body?e.body.scrollLeft:0,l=e.body?e.body.scrollTop:0,c=e.documentElement?e.documentElement.scrollLeft:0,s=e.documentElement?e.documentElement.scrollTop:0,u=e.createElement("style");return u.setAttribute("data-sd-iframe-pin",""),u.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(u),()=>{try{u.remove()}catch{}try{n&&typeof n.scrollTo=="function"&&n.scrollTo(i,o),e.body&&(e.body.scrollLeft=a,e.body.scrollTop=l),e.documentElement&&(e.documentElement.scrollLeft=c,e.documentElement.scrollTop=s)}catch{}}}async function Fo(e,t,r){let n=await Mo(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=Eo(e),l=r?.snap;if(!l&&typeof window<"u"&&window.snapdom&&(l=window.snapdom),!l||typeof l.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 c={...r,scale:1},s=No(n,i,o),u=A.session.nodeMap,f=A.session.styleMap,d=A.session.styleCache,m;try{m=await l.toPng(n.documentElement,c)}finally{s(),A.session.nodeMap=u,A.session.styleMap=f,A.session.styleCache=d}m.style.display="block",m.style.width=`${i}px`,m.style.height=`${o}px`;let h=document.createElement("div");return t.nodeMap.set(h,e),ie(e,h,t,r),h.style.overflow="hidden",h.style.display="block",h.style.width||(h.style.width=`${Math.round(a.width)}px`),h.style.height||(h.style.height=`${Math.round(a.height)}px`),h.appendChild(m),h}function Lo(e){let{width:t,height:r}=Q(e),n=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let o=i?parseFloat(i.width):NaN,a=i?parseFloat(i.height):NaN,l=Math.round(t||n.width||0),c=Math.round(r||n.height||0),s=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,l||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,c||16),f=(e.type||"text").toLowerCase()==="checkbox",d=!!e.checked,m=!!e.indeterminate,h=Math.max(Math.min(s,u),12),p="middle";try{i&&i.verticalAlign&&(p=i.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),g.style.cssText=`display:inline-block;width:${h}px;height:${h}px;vertical-align:${p};flex-shrink:0;line-height:0;`;let w=document.createElementNS("http://www.w3.org/2000/svg","svg");w.setAttribute("width",String(h)),w.setAttribute("height",String(h)),w.setAttribute("viewBox",`0 0 ${h} ${h}`),g.appendChild(w);function x(){let S="#0a6ed1";try{i&&(S=i.accentColor||i.color||S)}catch{}let b=2,v=b/2,C=h-b;if(w.innerHTML="",f){let y=document.createElementNS("http://www.w3.org/2000/svg","rect");if(y.setAttribute("x",String(v)),y.setAttribute("y",String(v)),y.setAttribute("width",String(C)),y.setAttribute("height",String(C)),y.setAttribute("rx","2"),y.setAttribute("ry","2"),y.setAttribute("fill",d?S:"none"),y.setAttribute("stroke",S),y.setAttribute("stroke-width",String(b)),w.appendChild(y),d){let $=document.createElementNS("http://www.w3.org/2000/svg","path");$.setAttribute("d",`M ${v+2} ${h/2} L ${h/2-1} ${h-v-2} L ${h-v-2} ${v+2}`),$.setAttribute("stroke","white"),$.setAttribute("stroke-width",String(Math.max(1.5,b))),$.setAttribute("fill","none"),$.setAttribute("stroke-linecap","round"),$.setAttribute("stroke-linejoin","round"),w.appendChild($)}else if(m){let $=document.createElementNS("http://www.w3.org/2000/svg","rect"),k=Math.max(6,C-4);$.setAttribute("x",String((h-k)/2)),$.setAttribute("y",String((h-b)/2)),$.setAttribute("width",String(k)),$.setAttribute("height",String(b)),$.setAttribute("fill",S),$.setAttribute("rx","1"),w.appendChild($)}}else{let y=document.createElementNS("http://www.w3.org/2000/svg","circle");if(y.setAttribute("cx",String(h/2)),y.setAttribute("cy",String(h/2)),y.setAttribute("r",String((h-b)/2)),y.setAttribute("fill",d?S:"none"),y.setAttribute("stroke",S),y.setAttribute("stroke-width",String(b)),w.appendChild(y),d){let $=document.createElementNS("http://www.w3.org/2000/svg","circle"),k=Math.max(2,(h-b*2)*.35);$.setAttribute("cx",String(h/2)),$.setAttribute("cy",String(h/2)),$.setAttribute("r",String(k)),$.setAttribute("fill","white"),w.appendChild($)}}g.style.setProperty("width",`${h}px`,"important"),g.style.setProperty("height",`${h}px`,"important"),g.style.setProperty("min-width",`${h}px`,"important"),g.style.setProperty("min-height",`${h}px`,"important")}return x(),{el:g,applyVisual:x}}var Me=new q(80);async function Ee(e){if(A.resource?.has(e))return A.resource.get(e);if(Me.has(e))return Me.get(e);let t=(async()=>{let r=await Y(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return A.resource?.set(e,r.data),r.data})();Me.set(e,t);try{let r=await t;return Me.set(e,r),r}catch(r){throw Me.delete(e),r}}var Ro=/\bblob:[^)"'\s]+/g;async function pr(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(Ro)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let i=await Ee(n);r=r.split(n).join(i)}catch{}return r}function ze(e){return typeof e=="string"&&e.startsWith("blob:")}function To(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let r=t.match(/^(\S+)(\s+.+)?$/);return r?{url:r[1],desc:r[2]||""}:null}).filter(Boolean)}function Po(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function _o(e,t=null){if(!e)return;let r=t,n=e.querySelectorAll?e.querySelectorAll("img"):[];for(let c of n)try{let s=c.getAttribute("src")||c.currentSrc||"";if(ze(s)){let f=await Ee(s);c.setAttribute("src",f)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let f=To(u),d=!1;for(let m of f)if(ze(m.url))try{m.url=await Ee(m.url),d=!0}catch(h){R(r,"blobUrlToDataUrl for srcset item failed",h)}d&&c.setAttribute("srcset",Po(f))}}catch(s){R(r,"resolveBlobUrls for img failed",s)}let i=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of i)try{let s="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(s,"href");if(ze(u)){let f=await Ee(u);c.setAttribute("href",f),c.removeAttributeNS?.(s,"href")}}catch(s){R(r,"resolveBlobUrls for SVG image href failed",s)}let o=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of o)try{let s=c.getAttribute("style");if(s&&s.includes("blob:")){let u=await pr(s);c.setAttribute("style",u)}}catch(s){R(r,"replaceBlobUrls in inline style failed",s)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let c of a)try{let s=c.textContent||"";s.includes("blob:")&&(c.textContent=await pr(s))}catch(s){R(r,"replaceBlobUrls in style tag failed",s)}let l=["poster"];for(let c of l){let s=e.querySelectorAll?e.querySelectorAll(`[${c}^='blob:']`):[];for(let u of s)try{let f=u.getAttribute(c);ze(f)&&u.setAttribute(c,await Ee(f))}catch(f){R(r,`resolveBlobUrls for ${c} failed`,f)}}}Ce();function ft(e){let{width:t,height:r}=Q(e),n=t,i=r;if(!n||!i){let a=e.getBoundingClientRect();n=n||a.width||0,i=i||a.height||0}let o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${n}px;height:${i}px;visibility:hidden;`,o}async function Ve(e,t,r){if(!e)throw new Error("Invalid node");let n=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")||Dt.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return R(t,"Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)"),null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(r.excludeMode==="hide")return ft(e);if(r.excludeMode==="remove")return null}if(r.exclude&&Array.isArray(r.exclude))for(let u of r.exclude)try{if(e.matches?.(u)){if(r.excludeMode==="hide")return ft(e);if(r.excludeMode==="remove")return null}}catch(f){console.warn(`Invalid selector in exclude option: ${u}`,f)}if(typeof r.filter=="function")try{if(!r.filter(e)){if(r.filterMode==="hide")return ft(e);if(r.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(f){R(t,"iframe same-origin probe failed",f)}if(u)try{return await Fo(e,t,r)}catch(f){console.warn("[SnapDOM] iframe rasterization failed, fallback:",f)}if(u||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",e),r.placeholders){let{width:f,height:d}=Q(e),m=document.createElement("div");return m.style.cssText=`width:${f}px;height:${d}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;`,ie(e,m,t,r),m}else{let{width:f,height:d}=Q(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,ie(e,m,t,r),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),ie(e,u,t,r);let f=document.createElement("div");return f.textContent=e.getAttribute("data-placeholder-text")||"",f.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(f),u}if(e.tagName==="CANVAS"){let u="";try{let h=e.getContext("2d",{willReadFrequently:!0});try{h&&h.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{h&&h.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 g=p.getContext("2d");g&&(g.drawImage(e,0,0),u=p.toDataURL("image/png"))}}}catch(h){R(t,"Canvas toDataURL failed, using empty/fallback",h)}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch(h){R(t,"img decoding/loading hints failed",h)}u&&(f.src=u),f.width=e.width,f.height=e.height;let{width:d,height:m}=Q(e);return d>0&&(f.style.width=`${d}px`),m>0&&(f.style.height=`${m}px`),t.nodeMap.set(f,e),ie(e,f,t,r),f}if(e.tagName==="VIDEO"){let u="";try{let h=document.createElement("canvas");h.width=e.videoWidth||e.offsetWidth||320,h.height=e.videoHeight||e.offsetHeight||240;let p=h.getContext("2d");p&&(p.drawImage(e,0,0,h.width,h.height),u=h.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(h){R(t,"Video frame capture failed, using poster fallback",h)}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch{}u?f.src=u:e.poster&&(f.src=e.poster),f.width=e.videoWidth||e.offsetWidth||0,f.height=e.videoHeight||e.offsetHeight||0;let{width:d,height:m}=Q(e);return d>0&&(f.style.width=`${d}px`),m>0&&(f.style.height=`${m}px`),f.style.objectFit="contain",t.nodeMap.set(f,e),ie(e,f,t,r),f}if(e.tagName==="AUDIO"&&e.controls){let{width:u,height:f}=Q(e),d=Math.round(u||e.offsetWidth||300),m=Math.round(f||e.offsetHeight||54),h=m/2,p=Math.max(4,m*.16),g=m*.34,w=d-m*.34,x=g+p+m*.55,S=Math.max(0,w-m*.7-x),b=Math.max(9,Math.round(m*.24)),v=`<svg xmlns="http://www.w3.org/2000/svg" width="${d}" height="${m}" viewBox="0 0 ${d} ${m}"><rect width="${d}" height="${m}" rx="${Math.min(m/2,10)}" fill="#f1f3f4"/><path d="M ${g} ${h-p} L ${g+p} ${h} L ${g} ${h+p} Z" fill="#5f6368"/><rect x="${x}" y="${h-1.5}" width="${S}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${x}" cy="${h}" r="${Math.max(3,m*.09)}" fill="#5f6368"/><text x="${w}" y="${h}" fill="#5f6368" font-family="sans-serif" font-size="${b}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,C=document.createElement("img");try{C.decoding="sync",C.loading="eager"}catch{}return C.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(v)}`,C.width=d,C.height=m,C.style.width=`${d}px`,C.style.height=`${m}px`,t.nodeMap.set(C,e),ie(e,C,t,r),C}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let u of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(u.value)&&a.setAttribute(u.name,u.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(po(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){vo(e,a);try{let{width:u,height:f}=Q(e),d=Math.round(u||0),m=Math.round(f||0);d&&(a.dataset.snapdomWidth=String(d)),m&&(a.dataset.snapdomHeight=String(m))}catch(u){R(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",f=window.getComputedStyle(e),d=S=>{let b=u.match(new RegExp(`${S}\\s*:\\s*([^;]+)`,"i")),v=b?b[1].trim():f.getPropertyValue(S);return/%|auto/i.test(String(v||""))},m=parseInt(a.dataset.snapdomWidth||"0",10),h=parseInt(a.dataset.snapdomHeight||"0",10),p=d("width")||!m,g=d("height")||!h;p&&m&&(a.style.width=`${m}px`),g&&h&&(a.style.height=`${h}px`);let w=f.getPropertyValue("object-fit"),x=f.getPropertyValue("object-position");w&&w!=="fill"?(a.style.objectFit=w,x&&(a.style.objectPosition=x)):(m&&(a.style.minWidth=`${m}px`),h&&(a.style.minHeight=`${h}px`))}catch(u){R(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let l=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:f}=Q(e),d=u||e.getBoundingClientRect().width||0,m=f||e.getBoundingClientRect().height||0;d&&(a.style.width=`${d}px`),m&&(a.style.height=`${m}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&qn()){let{el:f,applyVisual:d}=Lo(e);t.nodeMap.set(f,e),l=d,a=f}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 HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let u=window.getComputedStyle(e,"::placeholder"),f=u&&u.color;if(f&&f!=="rgba(0, 0, 0, 0)"){let d="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(d);let m=document.createElement("style");m.textContent=`.${d}::placeholder{color:${f}!important;opacity:${u.opacity||"1"}!important;-webkit-text-fill-color:${f}!important;}`,a.prepend(m)}}catch{}if(e instanceof HTMLSelectElement&&(i=e.value),e instanceof HTMLTextAreaElement&&(o=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let u=e;u.min!==void 0&&u.min!==""&&a.setAttribute("min",u.min),u.max!==void 0&&u.max!==""&&a.setAttribute("max",u.max),u.pattern!==void 0&&u.pattern!==""&&a.setAttribute("pattern",u.pattern);let f=e.getAttribute("aria-invalid");f!==null&&a.setAttribute("aria-invalid",f)}if(ut(e)||ie(e,a,t,r),l&&l(),e instanceof SVGElement&&!ut(e)){let u=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let f=window.getComputedStyle(e);for(let d of u){let m=f.getPropertyValue(d);m&&a.style.setProperty(d,m)}}catch{}}if(e.shadowRoot){let u=function(S,b){if(S.nodeType===Node.ELEMENT_NODE&&S.tagName==="STYLE")return b(null);Ve(S,t,r).then(v=>{b(v||null)}).catch(()=>{b(null)})};try{let S=e.shadowRoot.querySelectorAll("slot");for(let b of S){let v=[];try{v=b.assignedNodes?.({flatten:!0})||b.assignedNodes?.()||[]}catch{v=b.assignedNodes?.()||[]}for(let C of v)n.add(C)}}catch{}let f=wo(t),d=`[data-sd="${f}"]`;try{a.setAttribute("data-sd",f)}catch{}let m=xo(e.shadowRoot),h=bo(m,d),p=$o(m),g=Ao(e,p,d);So(a,g+h,f);let w=document.createDocumentFragment(),x=await ct(Array.from(e.shadowRoot.childNodes),u,r.fast);w.append(...x.filter(S=>!!S)),a.appendChild(w)}if(e.tagName==="SLOT"){let u=function(p,g){Ve(p,t,r).then(w=>{w&&ko(w),g(w||null)}).catch(()=>{g(null)})},f=e.assignedNodes?.({flatten:!0})||[],d=f.length>0?f:Array.from(e.childNodes),m=document.createDocumentFragment(),h=await ct(Array.from(d),u,r.fast);return m.append(...h.filter(p=>!!p)),m}function c(u,f){if(n.has(u))return f(null);Ve(u,t,r).then(d=>{f(d||null)}).catch(()=>{f(null)})}let s=await ct(Array.from(e.childNodes),c,r.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}G(),We(),D(),D();var Oo=[/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],pe=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__||{}),dt=[];function Wo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Io(e){let t=Array.isArray(e)?e:[e];for(let r of t)r instanceof RegExp?dt.push(r):typeof r=="string"?dt.push(new RegExp(Wo(r),"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r)}function Z(e){let t=typeof e=="string"?e:"",r=[...Oo,...dt];for(let n of r)if(n instanceof RegExp&&n.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 Do(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var gr=new Map;function jo(e=""){let t=Object.create(null),r=String(e||""),n=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=n.exec(r);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function Ho(e,t,r){let n=String(e||""),i=n.toLowerCase(),o=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:n,familyForCanvas:n};let a=r&&(r.FILL??r.fill),l="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?l="rounded":/\bsharp\b/.test(o)?l="sharp":/\boutlined\b/.test(o)&&(l="outlined");let c=a===1,s=null;if(c&&(l==="outlined"&&pe.materialIconsFilled?s={url:pe.materialIconsFilled,alias:"snapdom-mi-filled"}:l==="rounded"&&pe.materialIconsRound?s={url:pe.materialIconsRound,alias:"snapdom-mi-round"}:l==="sharp"&&pe.materialIconsSharp&&(s={url:pe.materialIconsSharp,alias:"snapdom-mi-sharp"})),!s)return{familyForMeasure:n,familyForCanvas:n};if(!gr.has(s.alias))try{let f=new FontFace(s.alias,`url(${s.url})`,{style:"normal",weight:"400"});document.fonts.add(f),await f.load(),gr.set(s.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let u=`"${s.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function Uo(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function zo(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!r&&t.toLowerCase()!=="currentcolor")return t;let n=e.color?.trim();return n&&n!=="inherit"?n:"#000"}async function Vo(e,{family:t="Material Icons",weight:r="normal",fontSize:n=32,color:i="#000",variation:o="",className:a=""}={}){let l=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,s=jo(o),{familyForMeasure:u,familyForCanvas:f}=await Ho(l,a,s);await Uo(f.replace(/^["']+|["']+$/g,""),n);let d=document.createElement("span");d.textContent=e,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=u,d.style.fontWeight=String(r||"normal"),d.style.fontSize=`${n}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let m=d.getBoundingClientRect(),h=Math.max(1,Math.ceil(m.width)),p=Math.max(1,Math.ceil(m.height));document.body.removeChild(d);let g=document.createElement("canvas");g.width=h*c,g.height=p*c;let w=g.getContext("2d");w.scale(c,c),w.font=`${r?`${r} `:""}${n}px ${f}`,w.textAlign="left",w.textBaseline="top",w.fillStyle=i;try{w.fontKerning="normal"}catch{}return w.fillText(e,0,0),{dataUrl:g.toDataURL(),width:h,height:p}}async function qo(e,t){if(!(e instanceof Element))return 0;let r='.material-icons, [class*="material-symbols"]',n=Array.from(e.querySelectorAll(r)).filter(l=>l&&l.textContent&&l.textContent.trim());if(n.length===0)return 0;let i=A.session.nodeMap,o=t instanceof Element?Array.from(t.querySelectorAll(r)).filter(l=>l&&l.textContent&&l.textContent.trim()):[],a=0;for(let l=0;l<n.length;l++){let c=n[l],s=i&&i.get(c)||o[l]||null;try{let u=getComputedStyle(s||c),f=u.fontFamily||"Material Icons";if(!Do(f))continue;let d=(s||c).textContent.trim();if(!d)continue;let m=parseInt(u.fontSize,10)||24,h=u.fontWeight&&u.fontWeight!=="normal"?u.fontWeight:"normal",p=zo(u),g=u.fontVariationSettings&&u.fontVariationSettings!=="normal"?u.fontVariationSettings:"",w=(s||c).className||"",{dataUrl:x,width:S,height:b}=await Vo(d,{family:f,weight:h,fontSize:m,color:p,variation:g,className:w});c.textContent="";let v=c.ownerDocument.createElement("img");v.src=x,v.alt=d,v.style.height=`${m}px`,v.style.width=`${Math.max(1,Math.round(S/b*m))}px`,v.style.objectFit="contain",v.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(v),a++}catch{}}return a}he();async function Bo(e,t,r,n=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=r||"normal",a.style.fontSize=`${n}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let l=a.getBoundingClientRect(),c=Math.ceil(l.width),s=Math.ceil(l.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,c*o),u.height=Math.max(1,s*o);let f=u.getContext("2d");return f.scale(o,o),f.font=r?`${r} ${n}px "${t}"`:`${n}px "${t}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=i,f.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:s}}var yr=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Xo=["katex","mathjax","mathml"];function mt(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!yr.has(r.toLowerCase()))return r}return""}function Yo(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(yr.has(n.toLowerCase())||t.push(n))}return t}function qe(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let r=parseInt(t,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function Be(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Go(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Ko(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let i=qe(r[1]),o=qe(r[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let n=qe(t);return{min:n,max:n}}function Qo(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Zo(e){let t=String(e||"100%").trim(),r=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let o=parseFloat(r[1]),a=parseFloat(r[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let n=t.match(/(\d+(?:\.\d+)?)\s*%/),i=n?parseFloat(n[1]):100;return{min:i,max:i}}function Jo(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ei(e,t,r=[]){if(!e)return!1;try{let n=new URL(e,location.href);if(n.origin===location.origin)return!0;let i=n.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))||r.some(a=>i===a.toLowerCase()||i.endsWith("."+a.toLowerCase())))return!0;let o=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||Xo.some(a=>o.includes(a)))return!0;for(let a of t){let l=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),s=Jo(a);if(o.includes(l)||o.includes(c)||s&&o.includes(s))return!0}return!1}catch{return!1}}function ti(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function br(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(r,n,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return r;let a=o;try{a=new URL(o,t||location.href).href}catch{}return`url("${a}")`})}var ht=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Xe=4;async function ri(e,t,r){if(!e)return e;let n=new Set;function i(l,c){try{return new URL(l,c||location.href).href}catch{return l}}async function o(l,c,s=0){if(s>Xe)return console.warn(`[snapDOM] @import depth exceeded (${Xe}) at ${c}`),l;let u="",f=0,d;for(;d=ht.exec(l);){u+=l.slice(f,d.index),f=ht.lastIndex;let m=(d[2]||d[4]||"").trim(),h=i(m,c);if(n.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}n.add(h);let p="";try{let g=await Y(h,{as:"text",useProxy:r,silent:!0});g.ok&&typeof g.data=="string"&&(p=g.data)}catch{}p?(p=br(p,h),p=await o(p,h,s+1),u+=`
6
- /* inlined: ${h} */
7
- ${p}
8
- `):u+=d[0]}return u+=l.slice(f),u}let a=br(e,t||location.href);return a=await o(a,t||location.href,0),a}var wr=/url\((["']?)([^"')]+)\1\)/g,ni=/@font-face[^{}]*\{[^}]*\}/g;function xr(e){if(!e)return[];let t=[],r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r){let i=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],a=i[2],l=c=>{if(!c.includes("?"))return parseInt(c,16);let s=parseInt(c.replace(/\?/g,"0"),16),u=parseInt(c.replace(/\?/g,"F"),16);return[s,u]};if(a){let c=l(o),s=l(a),u=Array.isArray(c)?c[0]:c,f=Array.isArray(s)?s[1]:s;t.push([Math.min(u,f),Math.max(u,f)])}else{let c=l(o);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function Sr(e,t){if(!t.length||!e||e.size===0)return!0;for(let r of e)for(let[n,i]of t)if(r>=n&&r<=i)return!0;return!1}function pt(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(wr)){let i=(n[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}r.push(i)}}return r}async function vr(e,t,r=""){let n=e;for(let i of e.matchAll(wr)){let o=Ze(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(!Z(a)){if(A.resource?.has(a)){A.font?.add(a),n=n.replace(i[0],`url(${A.resource.get(a)})`);continue}try{let l=await Y(a,{as:"dataURL",useProxy:r,silent:!0});if(l.ok&&typeof l.data=="string"){let c=l.data;A.resource?.set(a,c),A.font?.add(a),n=n.replace(i[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return n}function oi(e){if(!e.length)return null;let t=(a,l)=>e.some(([c,s])=>!(s<a||c>l)),r=t(0,255)||t(305,305),n=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":n?"latin-ext":r?"latin":null}function $r(e={}){let t=new Set((e.families||[]).map(i=>String(i).toLowerCase())),r=new Set((e.domains||[]).map(i=>String(i).toLowerCase())),n=new Set((e.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(r.size)for(let a of i.srcUrls)try{if(r.has(new URL(a).host.toLowerCase()))return!0}catch{}if(n.size){let a=oi(o);if(a&&n.has(a))return!0}return!1}}function ii(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let o of e.match(t)||[]){let a=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",l=mt(a),c=(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(),f=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),d=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=pt(d,location.href),h=m.length?m.map(g=>String(g).toLowerCase()).sort().join("|"):d.toLowerCase(),p=[String(l||"").toLowerCase(),c,s,u,f.toLowerCase(),h].join("|");r.has(p)||(r.add(p),n.push(o))}if(n.length===0)return e;let i=0;return e.replace(t,()=>n[i++]||"")}function ai(e,t,r,n,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()}):"",l=(r||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),c=n||"",s=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${l}::px=${c}::fd=${s}`}async function Cr(e,t,r,n){let i;try{i=e.cssRules||[]}catch{return}let o=(a,l)=>{try{return new URL(a,l||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let l=a.href?o(a.href,t):t;if(n.depth>=Xe){console.warn(`[snapDOM] CSSOM import depth exceeded (${Xe}) at ${l}`);continue}if(l&&n.visitedSheets.has(l)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${l}`);continue}l&&n.visitedSheets.add(l);let c={...n,depth:(n.depth||0)+1};await Cr(a.styleSheet,l,r,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let l=(a.style.getPropertyValue("font-family")||"").trim(),c=mt(l);if(!c||Z(c))continue;let s=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),f=(a.style.getPropertyValue("font-stretch")||"100%").trim(),d=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim();if(!n.faceMatchesRequired(c,u,s,f))continue;let h=xr(m);if(!Sr(n.usedCodepoints,h))continue;let p={family:c,weightSpec:s,styleSpec:u,stretchSpec:f,unicodeRange:m,srcRaw:d,srcUrls:pt(d,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(p,h))continue;if(/url\(/i.test(d)){let g=await vr(d,t||location.href,n.useProxy);await r(`@font-face{font-family:${c};src:${g};font-style:${u};font-weight:${s};font-stretch:${f};${m?`unicode-range:${m};`:""}}`)}else await r(`@font-face{font-family:${c};src:${d};font-style:${u};font-weight:${s};font-stretch:${f};${m?`unicode-range:${m};`:""}}`)}}}async function li({required:e,usedCodepoints:t,exclude:r=void 0,localFonts:n=[],useProxy:i="",fontStylesheetDomains:o=[],doc:a=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let l=new Map;for(let x of e){let[S,b,v,C]=String(x).split("__");if(!S)continue;let y=S.toLowerCase(),$=l.get(y)||[];$.push({w:parseInt(b,10),s:v,st:parseInt(C,10)}),l.set(y,$)}function c(x,S,b,v){let C=String(x).toLowerCase();if(!l.has(C))return!1;let y=l.get(C),$=Ko(b),k=Qo(S),O=Zo(v),_=$.min!==$.max,I=$.min,N=F=>k.kind==="normal"&&F==="normal"||k.kind!=="normal"&&(F==="italic"||F==="oblique"),H=!1;for(let F of y){let j=_?F.w>=$.min&&F.w<=$.max:F.w===I,E=N(Be(F.s)),L=F.st>=O.min&&F.st<=O.max;if(j&&E&&L){H=!0;break}}if(H)return!0;if(!_)for(let F of y){let j=N(Be(F.s)),E=F.st>=O.min&&F.st<=O.max;if(Math.abs(I-F.w)<=300&&j&&E)return!0}if(!_&&k.kind==="normal"&&y.some(F=>Be(F.s)!=="normal"))for(let F of y){let j=Math.abs(I-F.w)<=300,E=F.st>=O.min&&F.st<=O.max;if(j&&E)return!0}return!1}let s=$r(r),u=ai(e,r,n,i,o);if(A.resource?.has(u))return A.resource.get(u);let f=ti(e),d=[],m=ht;for(let x of a.querySelectorAll("style")){let S=x.textContent||"";for(let b of S.matchAll(m)){let v=(b[2]||b[4]||"").trim();!v||Z(v)||a.querySelector(`link[rel="stylesheet"][href="${v}"]`)||d.push(v)}}let h=[];d.length&&await Promise.all(d.map(x=>new Promise(S=>{if(a.querySelector(`link[rel="stylesheet"][href="${x}"]`))return S(null);let b=a.createElement("link");b.rel="stylesheet",b.href=x,b.setAttribute("data-snapdom","injected-import"),b.onload=()=>S(b),b.onerror=()=>S(null),a.head.appendChild(b),h.push(b)})));let p="",g=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(x=>!!x.href);for(let x of h)try{x.remove()}catch{}for(let x of g)try{if(Z(x.href))continue;let S="",b=!1;try{b=new URL(x.href,location.href).origin===location.origin}catch{}if(!b){let C=Array.isArray(o)?o:[];if(!ei(x.href,f,C))continue}if(b){let C=Array.from(a.styleSheets).find(y=>y.href===x.href);if(C)try{let y=C.cssRules||[];S=Array.from(y).map($=>$.cssText).join("")}catch{}}if(!S){let C=await Y(x.href,{as:"text",useProxy:i});if(C?.ok&&typeof C.data=="string"&&(S=C.data),Z(x.href))continue}S=await ri(S,x.href,i);let v="";for(let C of S.match(ni)||[]){let y=(C.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),$=mt(y);if(!$||Z($))continue;let k=(C.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),O=(C.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),_=(C.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),I=(C.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),N=(C.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),H=pt(N,x.href);if(!c($,O,k,_))continue;let F=xr(I);if(!Sr(t,F))continue;let j={family:$,weightSpec:k,styleSpec:O,stretchSpec:_,unicodeRange:I,srcRaw:N,srcUrls:H,href:x.href};if(r&&s(j,F))continue;let E=/url\(/i.test(N)?await vr(C,x.href,i):C;v+=E}v.trim()&&(p+=v)}catch{console.warn("[snapDOM] Failed to process stylesheet:",x.href)}let w={requiredIndex:l,usedCodepoints:t,faceMatchesRequired:c,simpleExcluder:r?$r(r):null,useProxy:i,visitedSheets:new Set,depth:0};for(let x of a.styleSheets)if(!(x.href&&g.some(S=>S.href===x.href)))try{let S=x.href||location.origin+"/";S&&w.visitedSheets.add(S),await Cr(x,S,async b=>{p+=b},w)}catch{}try{for(let x of a.fonts||[]){if(!x||!x.family||x.status!=="loaded"||!x._snapdomSrc)continue;let S=String(x.family).replace(/^['"]+|['"]+$/g,"");if(Z(S)||!l.has(S.toLowerCase())||r?.families&&r.families.some(v=>String(v).toLowerCase()===S.toLowerCase()))continue;let b=x._snapdomSrc;if(!String(b).startsWith("data:")){if(A.resource?.has(x._snapdomSrc))b=A.resource.get(x._snapdomSrc),A.font?.add(x._snapdomSrc);else if(!A.font?.has(x._snapdomSrc))try{let v=await Y(x._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(v.ok&&typeof v.data=="string")b=v.data,A.resource?.set(x._snapdomSrc,b),A.font?.add(x._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",x._snapdomSrc);continue}}p+=`@font-face{font-family:'${S}';src:url(${b});font-style:${x.style||"normal"};font-weight:${x.weight||"normal"};}`}}catch{}for(let x of n){if(!x||typeof x!="object")continue;let S=String(x.family||"").replace(/^['"]+|['"]+$/g,"");if(!S||Z(S)||!l.has(S.toLowerCase())||r?.families&&r.families.some(k=>String(k).toLowerCase()===S.toLowerCase()))continue;let b=x.weight!=null?String(x.weight):"normal",v=x.style!=null?String(x.style):"normal",C=x.stretchPct!=null?`${x.stretchPct}%`:"100%",y=String(x.src||""),$=y;if(!$.startsWith("data:")){if(A.resource?.has(y))$=A.resource.get(y),A.font?.add(y);else if(!A.font?.has(y))try{let k=await Y(y,{as:"dataURL",useProxy:i,silent:!0});if(k.ok&&typeof k.data=="string")$=k.data,A.resource?.set(y,$),A.font?.add(y);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",y);continue}}p+=`@font-face{font-family:'${S}';src:url(${$});font-style:${v};font-weight:${b};font-stretch:${C};}`}return p&&(p=ii(p),A.resource?.set(u,p)),p}function Ar(e){let t=new Set;if(!e)return t;let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),n=a=>{let l=Yo(a.fontFamily);if(l.length)for(let c of l){let s=(u,f,d)=>`${c}__${qe(u)}__${Be(f)}__${Go(d)}`;t.add(s(a.fontWeight,a.fontStyle,a.fontStretch))}};n(getComputedStyle(e));let i=getComputedStyle(e,"::before");i&&i.content&&i.content!=="none"&&n(i);let o=getComputedStyle(e,"::after");for(o&&o.content&&o.content!=="none"&&n(o);r.nextNode();){let a=r.currentNode,l=getComputedStyle(a);n(l);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&n(c);let s=getComputedStyle(a,"::after");s&&s.content&&s.content!=="none"&&n(s)}return t}function si(e){let t=new Set,r=i=>{if(i)for(let o of i)t.add(o.codePointAt(0))},n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;n.nextNode();){let i=n.currentNode;if(i.nodeType===Node.TEXT_NODE)r(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let o=i;for(let a of["::before","::after"]){let l=getComputedStyle(o,a)?.getPropertyValue("content");if(!(!l||l==="none"))if(/^"/.test(l)||/^'/.test(l))r(l.slice(1,-1));else{let c=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let s of c)try{t.add(parseInt(s.slice(1),16))}catch{}}}}}return t}async function kr(e,t=2,r=document){try{await r.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let i=()=>{let o=r.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let a of n){let l=r.createElement("span");l.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",l.style.fontFamily=`"${a}"`,l.style.fontWeight="700",l.style.fontStyle="italic",l.style.fontSize="32px",l.style.lineHeight="1",l.style.whiteSpace="nowrap",l.style.margin="0",l.style.padding="0",o.appendChild(l)}r.body.appendChild(o),o.offsetWidth,r.body.removeChild(o)};for(let o=0;o<Math.max(1,t);o++)i(),await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(a)))}D();function ui(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Mr(e,t=!1){let r="",n=Math.max(1,e);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return t?r.toUpperCase():r}function Er(e,t=!0){let r=[[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"]],n=Math.max(1,Math.min(3999,e)),i="";for(let[o,a]of r)for(;n>=o;)i+=a,n-=o;return t?i:i.toLowerCase()}function Nr(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let r=Math.abs(e);return(e<0?"-":"")+(r<10?"0":"")+String(r)}case"lower-alpha":return Mr(e,!1);case"upper-alpha":return Mr(e,!0);case"lower-roman":return Er(e,!1);case"upper-roman":return Er(e,!0);default:return String(e)}}function ci(e){let t=()=>A?.session?.__counterEpoch??0,r=t(),n=new WeakMap,i=e instanceof Document?e.documentElement:e,o=d=>d&&d.tagName==="LI",a=d=>{let m=0,h=d?.parentElement;if(!h)return 0;for(let p of h.children){if(p===d)break;p.tagName==="LI"&&m++}return m},l=d=>{let m=new Map;for(let[h,p]of d)m.set(h,p.slice());return m},c=(d,m,h)=>{let p=l(d),g;try{g=h.style?.counterReset||getComputedStyle(h).counterReset}catch{}if(g&&g!=="none")for(let S of g.split(",")){let b=S.trim().split(/\s+/),v=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!v)continue;let y=m.get(v);if(y&&y.length){let $=y.slice();$.push(C),p.set(v,$)}else p.set(v,[C])}let w;try{w=h.style?.counterSet||getComputedStyle(h).counterSet}catch{}if(w&&w!=="none")for(let S of w.split(",")){let b=S.trim().split(/\s+/),v=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!v)continue;let y=p.get(v)||[];y.length===0&&y.push(0),y[y.length-1]=C,p.set(v,y)}let x;try{x=h.style?.counterIncrement||getComputedStyle(h).counterIncrement}catch{}if(x&&x!=="none")for(let S of x.split(",")){let b=S.trim().split(/\s+/),v=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!v)continue;let y=p.get(v)||[];y.length===0&&y.push(0),y[y.length-1]+=C,p.set(v,y)}try{if(getComputedStyle(h).display==="list-item"&&o(h)){let S=h.parentElement,b=1;if(S&&S.tagName==="OL"){let C=S.getAttribute("start"),y=Number.isFinite(Number(C))?Number(C):1,$=a(h),k=h.getAttribute("value");b=Number.isFinite(Number(k))?Number(k):y+$}else b=1+a(h);let v=p.get("list-item")||[];v.length===0&&v.push(0),v[v.length-1]=b,p.set("list-item",v)}}catch{}return p},s=(d,m,h)=>{let p=c(h,m,d);n.set(d,p);let g=p;for(let x of d.children)g=s(x,p,g);let w=new Map;for(let[x,S]of h){let b=S.length,v=g.get(x);w.set(x,v&&v.length?v.slice(0,b):S.slice())}for(let[x,S]of g)!w.has(x)&&S.length&&!m.has(x)&&w.set(x,S.slice(0,1));return w},u=new Map;s(i,u,u);function f(){let d=t();if(d!==r){r=d;let m=new Map;s(i,m,m)}}return{get(d,m){f();let h=n.get(d)?.get(m);return h&&h.length?h[h.length-1]:0},getStack(d,m){f();let h=n.get(d)?.get(m);return h?h.slice():[]}}}function fi(e,t,r){if(!e||e==="none")return e;try{let n=/\b(counter|counters)\s*\(([^)]+)\)/g;return e.replace(n,(i,o,a)=>{let l=String(a).split(",").map(c=>c.trim());if(o==="counter"){let c=l[0]?.replace(/^["']|["']$/g,""),s=(l[1]||"decimal").toLowerCase(),u=r.get(t,c);return Nr(u,s)}else{let c=l[0]?.replace(/^["']|["']$/g,""),s=l[1]?.replace(/^["']|["']$/g,"")??"",u=(l[2]||"decimal").toLowerCase(),f=r.getStack(t,c);return f.length?f.map(d=>Nr(d,u)).join(s):""}})}catch{return"- "}}he(),D();var ge=new WeakMap,Fr=1e3;function di(e,t){let r=Lr(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=Tr(e,r),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):Tr(e,r)}function gt(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Lr(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${t.length}|`,n=0;for(let o=0;o<t.length;o++){let a=t[o];if(a.tagName==="STYLE"){let l=a.textContent?a.textContent.length:0;r+=`S${l}|`;let c=a.sheet,s=c?gt(c):null;s&&(n+=s.length)}else{let l=a.getAttribute("href")||"",c=a.getAttribute("media")||"all";r+=`L${l}|m:${c}|`;let s=a.sheet,u=s?gt(s):null;u&&(n+=u.length)}}let i=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(i)?i.length:0}|tr:${n}`,r}function Rr(e,t,r){let n=gt(e);if(!n)return!1;for(let i=0;i<n.length;i++){if(r.budget<=0)return!1;let o=n[i],a=o&&o.cssText?o.cssText:"";r.budget--;for(let l of t)if(a.includes(l))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let l=0;l<o.cssRules.length&&r.budget>0;l++){let c=o.cssRules[l],s=c&&c.cssText?c.cssText:"";r.budget--;for(let u of t)if(s.includes(u))return!0}if(r.budget<=0)return!1}return!1}function Tr(e=document,t=Lr(e)){let r=ge.get(e);if(r&&r.fingerprint===t)return r.result;let n=["::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 l=i[a].textContent||"";for(let c of n)if(l.includes(c))return ge.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:Fr};try{for(let l of o)if(Rr(l,n,a))return ge.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),l={budget:Fr};for(let c=0;c<a.length&&l.budget>0;c++){let s=a[c],u=null;if(s.tagName,u=s.sheet||null,u&&Rr(u,n,l))return ge.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(ge.set(e,{fingerprint:t,result:!0}),!0):(ge.set(e,{fingerprint:t,result:!1}),!1)}var ye=new WeakMap;function Pr(e){for(let t of["Top","Right","Bottom","Left"]){let r=parseFloat(e[`border${t}Width`])||0,n=e[`border${t}Style`];if(r>0&&n&&n!=="none"&&n!=="hidden")return!0}return!1}var _r=-1;function mi(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n=0,i;for(;i=r.exec(e);){let a=e.slice(n,i.index).trim();a&&t.push(a),t.push(i[1]),n=r.lastIndex}let o=e.slice(n).trim();return o&&t.push(o),t.join("")}function yt(e,t){let r=e.parentElement,n=r?ye.get(r):null;return n?{get(i,o){let a=t.get(i,o),l=n.get(o);return typeof l=="number"?Math.max(a,l):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let l=n.get(o);if(typeof l=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],l),c}return a}}:t}function bt(e,t,r){let n=new Map;function i(s){let u=[];if(!s||s==="none")return u;for(let f of String(s).split(",")){let d=f.trim().split(/\s+/),m=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;m&&u.push({name:m,num:h})}return u}let o=i(t?.counterReset),a=i(t?.counterSet),l=i(t?.counterIncrement);function c(s){if(n.has(s))return n.get(s).slice();let u=r.getStack(e,s);u=u.length?u.slice():[];let f=o.find(h=>h.name===s);if(f){let h=Number.isFinite(f.num)?f.num:0;u=u.length?[...u,h]:[h]}let d=a.find(h=>h.name===s);if(d){let h=Number.isFinite(d.num)?d.num:0;u.length===0&&(u=[0]),u[u.length-1]=h}let m=l.find(h=>h.name===s);if(m){let h=Number.isFinite(m.num)?m.num:1;u.length===0&&(u=[0]),u[u.length-1]+=h}return n.set(s,u.slice()),u}return{get(s,u){let f=c(u);return f.length?f[f.length-1]:0},getStack(s,u){return c(u)},__incs:l}}function hi(e,t,r){let n;try{n=B(e,t)}catch{}let i=n?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=yt(e,r),a=bt(e,n,o),l=ui(i)?fi(i,e,a):i;return{text:mi(l),incs:a.__incs||[]}}async function wt(e,t,r,n){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!di(i,r))return;let o=A?.session?.__counterEpoch??0;if(_r!==o&&(ye=new WeakMap,r&&(r.__counterCtx=null),_r=o),!r.__counterCtx)try{r.__counterCtx=ci(e.ownerDocument||document)}catch(c){R(r,"buildCounterContext failed",c)}let a=r.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let s=B(e,c);if(!s||s.content==="none"&&s.backgroundImage==="none"&&s.backgroundColor==="transparent"&&!Pr(s)&&(!s.transform||s.transform==="none")&&s.display==="inline")continue;if(c==="::first-letter"){let E=B(e),L=(E?.display||"").toLowerCase();if(L.includes("flex")||L.includes("grid")||!(s.color!==E.color||s.fontSize!==E.fontSize||s.fontWeight!==E.fontWeight||s.fontFamily!==E.fontFamily||s.fontStyle!==E.fontStyle||s.textTransform!==E.textTransform||s.float!==E.float||s.paddingTop!==E.paddingTop||s.paddingRight!==E.paddingRight||s.paddingBottom!==E.paddingBottom||s.paddingLeft!==E.paddingLeft||s.marginTop!==E.marginTop||s.marginRight!==E.marginRight||s.marginBottom!==E.marginBottom||s.marginLeft!==E.marginLeft))continue;let P=Array.from(t.childNodes).find(Pe=>Pe.nodeType===Node.TEXT_NODE&&Pe.textContent?.trim().length>0);if(!P)continue;let W=P.textContent,X=W.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],we=W.slice(X?.length||0);if(!X||/[\uD800-\uDFFF]/.test(X))continue;let ee=document.createElement("span");ee.textContent=X,ee.dataset.snapdomPseudo="::first-letter";let xe=It(s),Se=tt(xe,"span");r.styleMap.set(ee,Se);let me=document.createTextNode(we);t.replaceChild(me,P),t.insertBefore(ee,me);continue}let u=s.content??"",f=u===""||u==="none"||u==="normal",{text:d,incs:m}=hi(e,c,a),h=s.backgroundImage,p=s.backgroundColor,g=s.fontFamily,w=parseInt(s.fontSize)||32,x=parseInt(s.fontWeight)||!1,S=s.color||"#000",b=s.transform,v=Z(g),C=!f&&d!=="",y=h&&h!=="none",$=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",k=Pr(s),O=b&&b!=="none",_=u!=="none"&&u!=="normal"&&((parseFloat(s.width)||0)>0||(parseFloat(s.height)||0)>0);if(!(C||y||$||k||O||_)){if(m&&m.length&&e.parentElement){let E=ye.get(e.parentElement)||new Map;for(let{name:L}of m){if(!L)continue;let P=yt(e,a),W=bt(e,B(e,c),P).get(e,L);E.set(L,W)}ye.set(e.parentElement,E)}continue}let I=!1;if(C&&!v&&d.length>1&&!d.startsWith("url(")){let E=B(e),L=parseFloat(E.fontSize)||16,P=parseFloat(E.lineHeight);Number.isFinite(P)||(P=L*1.5),e.getBoundingClientRect().height<P*1.6&&(t.style.whiteSpace="nowrap",I=!0)}let N=document.createElement("span");N.dataset.snapdomPseudo=c,N.style.pointerEvents="none",I&&(N.style.whiteSpace="nowrap");let H=It(s),F=tt(H,"span");if(r.styleMap.set(N,F),v&&d&&d.length===1){let{dataUrl:E,width:L,height:P}=await Bo(d,g,x,w,S),W=document.createElement("img");W.src=E,W.style=`height:${w}px;width:${L/P*w}px;object-fit:contain;`,N.appendChild(W),t.dataset.snapdomHasIcon="true"}else if(d&&d.startsWith("url(")){let E=Ze(d);if(E?.trim())try{let L=await Y(Oe(E),{as:"dataURL",useProxy:n.useProxy});if(L?.ok&&typeof L.data=="string"){let P=document.createElement("img");P.src=L.data,P.style=`width:${w}px;height:auto;object-fit:contain;`,N.appendChild(P)}}catch(L){console.error(`[snapdom] Error in pseudo ${c} for`,e,L)}}else!v&&C&&(N.textContent=d);N.style.backgroundImage="none","maskImage"in N.style&&(N.style.maskImage="none"),"webkitMaskImage"in N.style&&(N.style.webkitMaskImage="none");try{N.style.backgroundRepeat=s.backgroundRepeat,N.style.backgroundSize=s.backgroundSize,s.backgroundPositionX&&s.backgroundPositionY?(N.style.backgroundPositionX=s.backgroundPositionX,N.style.backgroundPositionY=s.backgroundPositionY):N.style.backgroundPosition=s.backgroundPosition,N.style.backgroundOrigin=s.backgroundOrigin,N.style.backgroundClip=s.backgroundClip,N.style.backgroundAttachment=s.backgroundAttachment,N.style.backgroundBlendMode=s.backgroundBlendMode}catch{}if(y)try{let E=rt(h),L=await Promise.all(E.map(Ot));N.style.backgroundImage=L.join(", ")}catch(E){console.warn(`[snapdom] Failed to inline background-image for ${c}`,E)}$&&(N.style.backgroundColor=p);let j=N.childNodes.length>0||N.textContent?.trim()!==""||y||$||k||O||_;if(m&&m.length&&e.parentElement){let E=ye.get(e.parentElement)||new Map,L=yt(e,a),P=bt(e,B(e,c),L);for(let{name:W}of m){if(!W)continue;let X=P.get(e,W);E.set(W,X)}ye.set(e.parentElement,E)}if(!j)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(N,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(N))}catch(s){console.warn(`[snapdom] Failed to capture ${c} for`,e,s)}let l=Array.from(t.children).filter(c=>!c.dataset.snapdomPseudo);if(r.nodeMap)for(let c of l){let s=r.nodeMap.get(c);s instanceof Element&&await wt(s,c,r,n)}else{let c=Array.from(e.children);for(let s=0;s<Math.min(c.length,l.length);s++)await wt(c[s],l[s],r,n)}}function pi(e,t){if(!e||!(e instanceof Element))return;let r=e.ownerDocument||document,n=r,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"],l=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",s=b=>{if(!b||!b.getAttribute)return null;let v=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(c,"href"):null);if(v)return v;let C=b.attributes;if(!C)return null;for(let y=0;y<C.length;y++){let $=C[y];if(!$||!$.name)continue;if($.name==="href")return $.value;let k=$.name.indexOf(":");if(k!==-1&&$.name.slice(k+1)==="href")return $.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),f=new Set,d=!1,m=(b,v=null)=>{if(!b)return;o.lastIndex=0;let C;for(;C=o.exec(b);){d=!0;let y=(C[1]||"").trim();y&&(u.has(y)||(f.add(y),v&&!v.has(y)&&v.add(y)))}},h=b=>{let v=b.querySelectorAll("use");for(let y of v){let $=s(y);if(!$||!$.startsWith("#"))continue;d=!0;let k=$.slice(1).trim();k&&!u.has(k)&&f.add(k)}let C=b.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 y of C){m(y.getAttribute("style")||"");for(let $ of a)m(y.getAttribute($))}};for(let b of i)h(b);if(!d)return;let p=e.querySelector("svg.inline-defs-container");p||(p=r.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 g=p.querySelector("defs")||null,w=b=>{if(!b||u.has(b))return null;let v=l(b),C=y=>{let $=n.querySelector(y);return $&&!e.contains($)?$:null};return C(`svg defs > *#${v}`)||C(`svg > symbol#${v}`)||C(`*#${v}`)};if(!f.size)return;let x=new Set(f),S=new Set;for(;x.size;){let b=x.values().next().value;if(x.delete(b),!b||u.has(b)||S.has(b))continue;let v=w(b);if(!v){S.add(b);continue}g||(g=r.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(g));let C=v.cloneNode(!0);C.id||C.setAttribute("id",b),g.appendChild(C),S.add(b),u.add(b);let y=[C,...C.querySelectorAll("*")];for(let $ of y){let k=s($);if(k&&k.startsWith("#")){let _=k.slice(1).trim();_&&!u.has(_)&&!S.has(_)&&x.add(_)}let O=$.getAttribute?.("style")||"";O&&m(O,x);for(let _ of a){let I=$.getAttribute?.(_);I&&m(I,x)}}}}D();function gi(e,t){if(!e||!t)return;let r=e.scrollTop||0;if(!r)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let n=e.getBoundingClientRect(),i=e.clientHeight,o="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let l=a.currentNode,c=getComputedStyle(l),s=c.position;if(s!=="sticky"&&s!=="-webkit-sticky")continue;let u=Or(c.top),f=Or(c.bottom);if(u==null&&f==null)continue;let d=yi(l,e),m=bi(t,d,o);if(!m)continue;let h=l.getBoundingClientRect(),p=h.width,g=h.height,w=h.left-n.left;if(!(p>0&&g>0)||!Number.isFinite(w))continue;let x=u!=null?u+r:r+(i-g-f);if(!Number.isFinite(x))continue;let S=Number.parseInt(c.zIndex,10),b=Number.isFinite(S),v=b?Math.max(S,1)+1:2,C=b?S-1:0,y=m.cloneNode(!1);y.setAttribute(o,"1"),y.style.position="sticky",y.style.left=`${w}px`,y.style.top=`${x}px`,y.style.width=`${p}px`,y.style.height=`${g}px`,y.style.visibility="hidden",y.style.zIndex=String(C),y.style.overflow="hidden",y.style.background="transparent",y.style.boxShadow="none",y.style.filter="none",m.parentElement?.insertBefore(y,m),m.style.position="absolute",m.style.left=`${w}px`,m.style.top=`${x}px`,m.style.bottom="auto",m.style.zIndex=String(v),m.style.pointerEvents="none"}}function Or(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function yi(e,t){let r=[];for(let n=e;n&&n!==t;){let i=n.parentElement;if(!i)break;r.push(Array.prototype.indexOf.call(i.children,n)),n=i}return r.reverse()}function bi(e,t,r){let n=e;for(let i=0;i<t.length;i++)if(n=wi(n,r)[t[i]],!n)return null;return n instanceof HTMLElement?n:null}function wi(e,t){let r=[],n=e.children;for(let i=0;i<n.length;i++){let o=n[i];o.hasAttribute(t)||r.push(o)}return r}function xi(e){let t=getComputedStyle(e),r=t.outlineStyle,n=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=r!=="none"&&parseFloat(n)>0,l=i==="none"||parseFloat(o)===0;a&&l&&(e.style.border=`${n} solid transparent`)}function Si(e){let t=[];try{let r=e.querySelectorAll("*");for(let n of r){if(!(n instanceof HTMLElement))continue;let i=n.style.contentVisibility||"",o=getComputedStyle(n),a=o.contentVisibility||o.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:n,original:i}),n.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e),i=n.contentVisibility||n.getPropertyValue("content-visibility")||"";(i==="auto"||i==="hidden")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:r,original:n}of t)try{r.style.contentVisibility=n}catch{}}}async function vi(e,t={}){let r={styleMap:A.session.styleMap,styleCache:A.session.styleCache,nodeMap:A.session.nodeMap,options:t},n,i="",o="";xi(e);let a=Si(e);try{n=await Ve(e,r,t)}catch(s){throw console.warn("deepClone failed:",s),s}finally{a()}try{pi(n)}catch(s){console.warn("inlineExternal defs or symbol failed:",s)}try{await wt(e,n,r,t)}catch(s){console.warn("inlinePseudoElements failed:",s)}await _o(n,r);try{let s=n.querySelectorAll("style[data-sd]");for(let u of s)o+=u.textContent||"",u.remove()}catch(s){R(r,"Failed to extract shadow CSS from style[data-sd]",s)}let l=Hn(r.styleMap);i=Array.from(l.entries()).map(([s,u])=>`.${u}{${s}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[s,u]of r.styleMap.entries()){if(s.tagName==="STYLE")continue;if(s.getRootNode&&s.getRootNode()instanceof ShadowRoot){s.setAttribute("style",u.replace(/;/g,"; "));continue}let f=l.get(u);f&&s.classList.add(f);let d=s.style?.backgroundImage,m=s.dataset?.snapdomHasIcon;d&&d!=="none"&&(s.style.backgroundImage=d),m&&(s.style.verticalAlign="middle",s.style.display="inline")}for(let[s,u]of r.nodeMap.entries()){let f=u.scrollLeft,d=u.scrollTop;if((f||d)&&s instanceof HTMLElement){s.style.overflow="hidden",s.style.scrollbarWidth="none",s.style.msOverflowStyle="none";try{let h=s.querySelectorAll("*");for(let p of h){if(!(p instanceof HTMLElement))continue;let g=p.style.position;if(g==="fixed"||g==="absolute"){let w=parseFloat(p.style.top)||0,x=parseFloat(p.style.left)||0;p.style.top=`${w+d}px`,p.style.left=`${x+f}px`,g==="fixed"&&(p.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.all="unset",m.style.transform=`translate(${-f}px, ${-d}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";s.firstChild;)m.appendChild(s.firstChild);s.appendChild(m)}}let c=n instanceof HTMLElement&&n.firstElementChild instanceof HTMLElement?n.firstElementChild:n;if(gi(e,c),e===r.nodeMap.get(n)){let s=r.styleCache.get(e)||B(e);r.styleCache.set(e,s);let u=Nn(s.transform);n.style.margin="0",n.style.top="auto",n.style.left="auto",n.style.right="auto",n.style.bottom="auto",n.style.animation="none",n.style.transition="none",n.style.willChange="auto",n.style.float="none",n.style.clear="none",n.style.transform=u||""}for(let[s,u]of r.nodeMap.entries())u.tagName==="PRE"&&(s.style.marginTop="0",s.style.marginBlockStart="0");return{clone:n,classCSS:i,styleCache:r.styleCache}}he(),D();var Wr="http://www.w3.org/1999/xlink";function $i(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(Wr,"href"):null)}function Ci(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,r=parseInt(e.dataset?.snapdomHeight||"",10)||0,n=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,l=t||o||n||e.width||e.naturalWidth||100,c=r||a||i||e.height||e.naturalHeight||100;return{width:l,height:c}}async function Ai(e,t={}){let r=Array.from(e.querySelectorAll("img")),n=async l=>{if(!l.getAttribute("src")){let h=l.currentSrc||l.src||"";h&&l.setAttribute("src",h)}l.removeAttribute("srcset"),l.removeAttribute("sizes");let c=l.src||"";if(!c)return;let s=A.image?.get(c);if(s){l.src=s,l.width||(l.width=l.naturalWidth||100),l.height||(l.height=l.naturalHeight||100);return}let u=await Y(c,{as:"dataURL",useProxy:t.useProxy});if(u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")){A.image?.set(c,u.data),l.src=u.data,l.width||(l.width=l.naturalWidth||100),l.height||(l.height=l.naturalHeight||100);return}let{width:f,height:d}=Ci(l),{fallbackURL:m}=t||{};if(m)try{let h=typeof m=="function"?await m({width:f,height:d,src:c,element:l}):m;if(h){let p=await Y(h,{as:"dataURL",useProxy:t.useProxy});if(p?.ok&&typeof p.data=="string"){l.src=p.data,l.width||(l.width=f),l.height||(l.height=d);return}}}catch{}if(t.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${f}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",l.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,l.replaceWith(h)}},i=6;for(let l=0;l<r.length;l+=i){let c=r.slice(l,l+i).map(n);await Promise.allSettled(c)}let o=Array.from(e.querySelectorAll("image")),a=async l=>{let c=$i(l);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let s=await Y(c,{as:"dataURL",useProxy:t.useProxy});s.ok&&typeof s.data=="string"&&s.data.startsWith("data:")&&(l.setAttribute("href",s.data),l.removeAttribute("xlink:href"),typeof l.removeAttributeNS=="function"&&l.removeAttributeNS(Wr,"href"))};for(let l=0;l<o.length;l+=i){let c=o.slice(l,l+i).map(a);await Promise.allSettled(c)}}G(),D();async function ki(e,t,r,n={}){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","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],l=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){let[s,u]=i.shift();if(!u)continue;let f=r.get(s)||B(s);r.has(s)||r.set(s,f);let d=(()=>{let p=f.getPropertyValue("border-image"),g=f.getPropertyValue("border-image-source");return p&&p!=="none"||g&&g!=="none"})(),m=f.getPropertyValue("background-image"),h=f.getPropertyValue("background-color");if(m&&m!=="none"||h&&h!=="rgba(0, 0, 0, 0)"&&h!=="transparent"||/url\s*\(|gradient\s*\(/i.test(f.getPropertyValue("background")||""))for(let p of l){let g=f.getPropertyValue(p);g&&u.style.setProperty(p,g)}for(let p of o){let g=f.getPropertyValue(p);if(p==="background-image"&&(!g||g==="none")){let S=f.getPropertyValue("background");S&&/url\s*\(/.test(S)&&(g=rt(S).filter(b=>/url\s*\(/.test(b)).join(", ")||g)}if(!g||g==="none")continue;let w=rt(g),x=await Promise.all(w.map(S=>Ot(S,n)));x.some(S=>S&&S!=="none"&&!/^url\(undefined/.test(S))&&u.style.setProperty(p,x.join(", "))}for(let p of a){let g=f.getPropertyValue(p);!g||g==="initial"||u.style.setProperty(p,g)}if(d)for(let p of c){let g=f.getPropertyValue(p);!g||g==="initial"||u.style.setProperty(p,g)}if(s.shadowRoot){let p=Array.from(s.shadowRoot.children).filter(w=>w.tagName!=="STYLE"),g=Array.from(u.children).filter(w=>!w.dataset?.snapdomPseudo&&!(w.tagName==="STYLE"&&w.dataset?.sd));for(let w=0;w<Math.min(p.length,g.length);w++)i.push([p[w],g[w]])}else{let p=A.session.nodeMap;for(let g of u.children){let w=p.get(g);w&&i.push([w,g])}}}}G(),D();function Mi(e){if(!e)return()=>{};let t=[];function r(n){let i=getComputedStyle(n),o=Ei(n,i);o&&t.push(o);let a=Ni(n,i);a&&t.push(a);for(let l of n.children||[])r(l)}return r(e),()=>t.forEach(n=>n())}function Ei(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let r=Fi(t);if(r<=0)return()=>{};if(!Ir(e))return()=>{};let n=e.textContent??"",i=n,o=Ri(t);e.textContent="X";let a=e.scrollHeight-o;e.textContent=n;let l=a>0?a:Li(t),c=Math.round(l*r+o);if(e.scrollHeight<=c+.5)return()=>{};let s=0,u=n.length,f=-1;for(;s<=u;){let d=s+u>>1;e.textContent=n.slice(0,d)+"…",e.scrollHeight<=c+.5?(f=d,s=d+1):u=d-1}return e.textContent=(f>=0?n.slice(0,f):"")+"…",()=>{e.textContent=i}}function Ni(e,t){if(!e)return()=>{};if(t=t||getComputedStyle(e),t.textOverflow!=="ellipsis")return()=>{};if(t.whiteSpace!=="nowrap"&&t.whiteSpace!=="pre")return()=>{};if(t.overflowX!=="hidden"&&t.overflowX!=="clip")return()=>{};if(!Ir(e))return()=>{};if(e.scrollWidth<=e.clientWidth+.5)return()=>{};let r=e.textContent??"",n=r,i=0,o=r.length,a=-1;for(;i<=o;){let l=i+o>>1;e.textContent=r.slice(0,l)+"…",e.scrollWidth<=e.clientWidth+.5?(a=l,i=l+1):o=l-1}return e.textContent=(a>=0?r.slice(0,a):"")+"…",()=>{e.textContent=n}}function Fi(e){let t=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");t=(t||"").trim();let r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:0}function Li(e){let t=(e.lineHeight||"").trim(),r=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(r*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*r):t.endsWith("%")?Math.round(parseFloat(t)/100*r):Math.round(r*1.2)}function Ri(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function Ir(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Ne=[];function xt(e){if(!e)return null;if(Array.isArray(e)){let[t,r]=e;return typeof t=="function"?t(r):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:r}=e;return typeof t=="function"?t(r):t}return typeof e=="function"?e():e}function Ti(...e){let t=e.flat();for(let r of t){let n=xt(r);n&&(Ne.some(i=>i&&i.name&&n.name&&i.name===n.name)||Ne.push(n))}}function Dr(e){return e&&Array.isArray(e.plugins)?e.plugins:Ne}async function ae(e,t,r){let n=r,i=Dr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let l=await a(t,n);typeof l<"u"&&(n=l)}return n}async function Pi(e,t,r){let n=[],i=Dr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let l=await a(t,r);typeof l<"u"&&n.push(l)}return n}function _i(e){let t=[];if(Array.isArray(e))for(let r of e){let n=xt(r);if(!n||!n.name)continue;let i=t.findIndex(o=>o&&o.name===n.name);i>=0&&t.splice(i,1),t.push(n)}for(let r of Ne)r&&r.name&&!t.some(n=>n.name===r.name)&&t.push(r);return Object.freeze(t)}function Oi(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=_i(t)),e}function Wi(){return Ne.slice()}function de(e){return!!(!e||e.startsWith("data:")||e.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}function Ii(e,t){return!e||!(e instanceof Element)?!1:e.querySelector("picture")?!0:t?!!e.querySelector("img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]"):!1}function Di(e,t){let r=e.currentSrc||"";if(r&&!de(r))return r;let n=t.querySelectorAll("source[srcset]"),i=null;for(let o of n){let a=o.getAttribute("srcset");if(!a||de(a))continue;let l=o.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return a.split(",")[0].trim().split(/\s+/)[0]}catch{}i||(i=a.split(",")[0].trim().split(/\s+/)[0])}return i}function ji(e){let t=[e.getAttribute("data-src"),e.getAttribute("data-lazy-src"),e.getAttribute("data-original"),e.getAttribute("data-hi-res-src")];for(let n of t)if(n&&!de(n))return n;let r=e.getAttribute("data-srcset")||e.getAttribute("data-lazy-srcset");if(r){let n=r.split(",")[0].trim().split(/\s+/)[0];if(n&&!de(n))return n}return null}function Hi(e={}){let t=e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:t.resolveLazySrc!==!1,silent:t.silent??!1,useProxy:typeof e.useProxy=="string"?e.useProxy:""}}async function Ui(e,t={}){if(!e||!(e instanceof Element)||t.resolvePicturePlaceholders===!1)return null;let{timeout:r,concurrency:n,resolveLazySrc:i,silent:o,useProxy:a}=Hi(t);if(!Ii(e,i))return null;let l=[],c=[];async function s(d){let m=new AbortController,h=setTimeout(()=>m.abort(),r);try{let p=await fetch(d,{credentials:"include",signal:m.signal});if(!p.ok&&a){let w=a.includes("{url}")?a.replace("{url}",encodeURIComponent(d)):a.endsWith("?")?`${a}${encodeURIComponent(d)}`:`${a}${a.includes("?")?"&":"?"}url=${encodeURIComponent(d)}`;p=await fetch(w,{signal:m.signal})}if(!p.ok)return null;let g=await p.blob();return await new Promise((w,x)=>{let S=new FileReader;S.onload=()=>w(S.result),S.onerror=x,S.readAsDataURL(g)})}catch{return null}finally{clearTimeout(h)}}async function u(d){for(let m=0;m<d.length;m+=n){let h=d.slice(m,m+n);await Promise.allSettled(h.map(p=>p()))}}let f=e.querySelectorAll("picture");for(let d of f){let m=d.querySelector("img");if(!m)continue;let h=m.getAttribute("src")||"";if(!de(h))continue;let p=Di(m,d);p&&c.push(async()=>{let g=await s(p);if(!g){o||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${p.slice(0,60)}`);return}let w=m.getAttribute("src"),x=m.getAttribute("srcset"),S=m.getAttribute("sizes"),b=[];m.src=g,m.setAttribute("src",g),m.removeAttribute("srcset"),m.removeAttribute("sizes");let v=d.querySelectorAll("source");for(let C of v)b.push({el:C,parent:C.parentElement,next:C.nextSibling}),C.remove();l.push(()=>{w!==null?m.setAttribute("src",w):m.removeAttribute("src"),x!==null&&m.setAttribute("srcset",x),S!==null&&m.setAttribute("sizes",S);for(let{el:C,parent:y,next:$}of b)y&&y.insertBefore(C,$)})})}if(i){let d=e.querySelectorAll("img");for(let m of d){if(m.closest("picture")&&de(m.getAttribute("src")||""))continue;let h=m.getAttribute("src")||"",p=ji(m);p&&de(h)&&c.push(async()=>{let g=await s(p);if(!g)return;let w=m.getAttribute("src");m.src=g,m.setAttribute("src",g),m.removeAttribute("srcset"),m.removeAttribute("sizes"),l.push(()=>{w!==null?m.setAttribute("src",w):m.removeAttribute("src")})})}}return c.length===0?null:(await u(c),async function(){for(let d of l)try{d()}catch{}})}D();var zi=.92,Vi=.95;async function qi(e){let t=new Image;if(t.decoding="sync",t.src=e,typeof t.decode=="function")try{return await t.decode(),t}catch{}return await new Promise((r,n)=>{t.onload=()=>r(),t.onerror=n}),t}function Bi(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:""}async function St(e,t,r){if(typeof e!="string"||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return null;let n;try{n=await qi(e)}catch{return null}let i=n.naturalWidth||n.width,o=n.naturalHeight||n.height;if(!i||!o)return null;let a=Math.min(1,Math.max(t/i,r/o));if(!(a>0)||a>=.95)return null;let l=a*Vi,c=Math.max(1,Math.round(i*l)),s=Math.max(1,Math.round(o*l)),u=document.createElement("canvas");u.width=c,u.height=s;let f=u.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(n,0,0,c,s);let d=Bi(e),m=d==="image/jpeg"?"image/jpeg":d==="image/webp"?"image/webp":"image/png";try{let h=u.toDataURL(m,zi);if(typeof h=="string"&&h.startsWith("data:image")&&h.length<e.length)return h}catch{}return null}async function Xi(e,t){if(!t.compress)return{count:0,before:0,after:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("img")),i=0,o=0,a=0,l=async s=>{let u=s.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let f=parseFloat(s.dataset.snapdomWidth)||parseFloat(s.style.width)||s.width||0,d=parseFloat(s.dataset.snapdomHeight)||parseFloat(s.style.height)||s.height||0;if(!f||!d)return;let m=await St(u,f*r,d*r);m&&(i++,o+=u.length,a+=m.length,s.setAttribute("src",m))},c=6;for(let s=0;s<n.length;s+=c)await Promise.allSettled(n.slice(s,s+c).map(l));return{count:i,before:o,after:a}}function Yi(e){let t=e.offsetWidth||e.getBoundingClientRect().width||0,r=e.offsetHeight||e.getBoundingClientRect().height||0;return{w:t,h:r}}async function Gi(e,t){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),n=A.session.nodeMap,i=[],o=[e,...e.querySelectorAll("*")];for(let s of o){let u=s.style&&s.style.backgroundImage;u&&u.includes("data:image")&&i.push(s)}let a=0,l=async s=>{let u=n.get(s);if(!u||!u.isConnected)return;let f;try{f=getComputedStyle(u)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(S=>S.trim()!=="no-repeat"))return;let{w:d,h:m}=Yi(u);if(!d||!m)return;let h=d*r,p=m*r,g=s.style.backgroundImage,w=[...g.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],x=g;for(let S of w){let b=S[2];if(b.startsWith("data:image/svg"))continue;let v=await St(b,h,p);v&&(x=x.split(b).join(v),a++)}x!==g&&(s.style.backgroundImage=x)},c=6;for(let s=0;s<i.length;s+=c)await Promise.allSettled(i.slice(s,s+c).map(l));return{count:a}}async function Ki(e,t){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("image")),i=0,o=async l=>{let c=l.getAttribute("href")||(typeof l.getAttributeNS=="function"?l.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!c||!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let s=parseFloat(l.getAttribute("width"))||0,u=parseFloat(l.getAttribute("height"))||0;if(!s||!u)return;let f=await St(c,s*r,u*r);f&&(l.setAttribute("href",f),l.hasAttribute("xlink:href")&&l.setAttribute("xlink:href",f),i++)},a=6;for(let l=0;l<n.length;l+=a)await Promise.allSettled(n.slice(l,l+a).map(o));return{count:i}}async function Qi(e,t){t.compress&&(await Xi(e,t),await Gi(e,t),await Ki(e,t))}G();function Zi(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){R(r,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){R(r,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){R(r,"stripRootShadows outline",o)}let i=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(o){R(r,"stripRootShadows filter",o)}}function jr(e){let t=e.display||"";if(t.includes("flex")||t.includes("grid")||t.startsWith("table")||t==="inline-block"||t==="flow-root"||e.position==="absolute"||e.position==="fixed"||e.float&&e.float!=="none")return!0;let r=e.overflowX||e.overflow||"visible",n=e.overflowY||e.overflow||"visible";return!!(r!=="visible"||n!=="visible"||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function Ji(e,t){let r=Array.from(e.childNodes),n=t==="top"?r:r.reverse();for(let i of n){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),a=String(o.display||"");if(!(a==="none"||a==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||a.startsWith("inline")?null:i}return null}function ea(e,t){if(!e||!t||!t.style)return;let r=getComputedStyle(e);if(!jr(r))for(let n of["top","bottom"]){let i=n==="top"?"Top":"Bottom";if((parseFloat(r[`border${i}Width`])||0)>0||(parseFloat(r[`padding${i}`])||0)>0)continue;let o=e,a=t;for(;o&&a;){let l=Ji(o,n);if(!l)break;let c=Array.from(o.children).indexOf(l),s=c>=0?a.children[c]:null,u=getComputedStyle(l),f=parseFloat(u[`margin${i}`])||0;if(s&&s.style&&f>0&&(s.style[`margin${i}`]="0px"),jr(u)||(parseFloat(u[`border${i}Width`])||0)>0||(parseFloat(u[`padding${i}`])||0)>0)break;o=l,a=s}}}function ta(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),r=[];for(;t.nextNode();)r.push(t.currentNode);for(let n of r)n.remove()}function ra(e,t={}){let{stripFrameworkDirectives:r=!0}=t,n=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 l=a.name;if(l.startsWith("*")){o.removeAttribute(l);continue}if(l.includes("@")){o.removeAttribute(l);continue}if(l.includes(":")){let c=l.split(":",1)[0];if(!n.has(c)){o.removeAttribute(l);continue}}if(r&&(l.startsWith("x-")||l.startsWith("v-")||l.startsWith(":")||l.startsWith("on:")||l.startsWith("bind:")||l.startsWith("let:")||l.startsWith("class:"))){o.removeAttribute(l);continue}}}}var Hr=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function na(e){if(!e)return;let t=i=>{if(i.nodeType===Node.ELEMENT_NODE){if(i.attributes)for(let o of Array.from(i.attributes)){let a=o.value.replace(Hr,"");if(a!==o.value)try{i.setAttribute(o.name,a)}catch{}}}else if(i.nodeType===Node.TEXT_NODE||i.nodeType===Node.CDATA_SECTION_NODE){let o=i.data.replace(Hr,"");o!==i.data&&(i.data=o)}};t(e);let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),n;for(;n=r.nextNode();)t(n)}function oa(e,t={}){e&&(ra(e,t),ta(e),na(e))}function ia(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function aa(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function la(e,t){if(!(e instanceof Element)||ia(e)||aa(e))return!1;let r=t.position;if(r==="absolute"||r==="fixed"||r==="sticky")return!1;let n=t.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||t.transform&&t.transform!=="none")}function sa(e,t,r=new Map){function n(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,l=r.get(i)||getComputedStyle(i);if(r.has(i)||r.set(i,l),a&&la(i,l)){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=l.overflowY||l.overflowBlock||"visible",f=l.overflowX||l.overflowInline||"visible";(u!=="visible"||f!=="visible")&&(o.style.overflow="visible")}let c=Array.from(i.children),s=Array.from(o.children);for(let u=0;u<Math.min(c.length,s.length);u++)n(c[u],s[u])}n(e,t)}function ua(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function ca(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 r of t.exclude)try{if(e.matches(r))return t.excludeMode==="remove"}catch(n){R(t,"exclude selector match failed",n)}return!1}function fa(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,l=Array.from(e.children);for(let m of l){if(ca(m,t)||!ua(m))continue;let h=m.getBoundingClientRect(),p=h.top-n.top,g=h.bottom-n.top;g<=p||(p<i&&(i=p),g>o&&(o=g),a=!0)}let c=a?Math.max(0,o-i):0,s=parseFloat(r.borderTopWidth)||0,u=parseFloat(r.borderBottomWidth)||0,f=parseFloat(r.paddingTop)||0,d=parseFloat(r.paddingBottom)||0;return s+u+f+d+c}var M=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,da=/::-webkit-scrollbar(-[a-z]+)?\b/i;function vt(e,t=new Set){let r="";if(!e)return r;for(let n=0;n<e.length;n++){let i=e[n];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){r+=vt(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=vt(i.cssRules,t);o&&(r+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(da.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),r+=a)}}}catch{}}return r}function ma(e){if(!e||!e.styleSheets)return"";let t=new Set,r="";for(let n of Array.from(e.styleSheets))try{let i=n.cssRules;i&&(r+=vt(i,t))}catch{}return r}it();function ha(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let r=[],n="",i=0;for(let s=0;s<t.length;s++){let u=t[s];u==="("?i++:u===")"&&(i=Math.max(0,i-1)),u===","&&i===0?(r.push(n),n=""):n+=u}n.trim()&&r.push(n);let o=0,a=0,l=0,c=0;for(let s of r){if(/\binset\b/i.test(s))continue;let u=s.match(/-?\d+(\.\d+)?px/g)?.map(w=>parseFloat(w))||[];if(u.length<2)continue;let[f,d,m=0,h=0]=u,p=Math.abs(f)+m+h,g=Math.abs(d)+m+h;a=Math.max(a,p+Math.max(f,0)),c=Math.max(c,p+Math.max(-f,0)),l=Math.max(l,g+Math.max(d,0)),o=Math.max(o,g+Math.max(-d,0))}return{top:Math.ceil(o),right:Math.ceil(a),bottom:Math.ceil(l),left:Math.ceil(c)}}function pa(e){let t=e.filter&&e.filter!=="none"?e.filter:e.webkitFilter||"",r=/blur\(\s*([0-9.]+)px\s*\)/gi,n=0,i;for(;i=r.exec(t);)n+=parseFloat(i[1])||0;let o=Math.ceil(n);return{top:o,right:o,bottom:o,left:o}}function ga(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),r=parseFloat(e.outlineOffset||"0")||0,n=t+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}function ya(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 r=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,i=0,o=0,a=0,l=!1;for(let c of r){l=!0;let s=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[u=0,f=0,d=0]=s,m=Math.abs(u)+d,h=Math.abs(f)+d;i=Math.max(i,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),o=Math.max(o,h+Math.max(f,0)),n=Math.max(n,h+Math.max(-f,0))}return{bleed:{top:M(n),right:M(i),bottom:M(o),left:M(a)},has:l}}function ba(e,t){if(!e||!t||!t.style)return null;let r=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 n=r.transform||"none";if(n==="none"){let l=null;try{l=zr(e).scale}catch{}try{t.style.transform="none"}catch{}if(!l)return{a:1,b:0,c:0,d:1};let c=l.trim().split(/\s+/).map(parseFloat),s=Number.isFinite(c[0])?c[0]:1,u=Number.isFinite(c[1])?c[1]:s;return{a:s,b:0,c:0,d:u}}function i(l,c,s,u){let f=Math.sqrt(l*l+c*c)||0,d=0,m=0;if(f>0){let h=l/f,p=c/f;d=h*s+p*u;let g=s-h*d,w=u-p*d;m=Math.sqrt(g*g+w*w)||0,m>0?d=d/m:d=0}return{a:f,b:0,c:d*m,d:m}}let o=n.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let l=o[1].split(",").map(c=>parseFloat(c.trim()));if(l.length===6&&l.every(Number.isFinite)){let[c,s,u,f]=l,d=i(c,s,u,f);try{t.style.transform=`matrix(${d.a}, ${d.b}, ${d.c}, ${d.d}, 0, 0)`}catch{}return d}}let a=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let l=a[1].split(",").map(c=>parseFloat(c.trim()));if(l.length===16&&l.every(Number.isFinite)){let c=l[0],s=l[1],u=l[4],f=l[5],d=i(c,s,u,f);try{t.style.transform=`matrix(${d.a}, ${d.b}, ${d.c}, ${d.d}, 0, 0)`}catch{}return d}}try{let l=new DOMMatrix(n),c=i(l.a,l.b,l.c,l.d);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function Ur(e,t,r,n,i){let o=r.a,a=r.b,l=r.c,c=r.d,s=r.e||0,u=r.f||0;function f(w,x){let S=w-n,b=x-i,v=o*S+l*b,C=a*S+c*b;return v+=n+s,C+=i+u,[v,C]}let d=[f(0,0),f(e,0),f(0,t),f(e,t)],m=1/0,h=1/0,p=-1/0,g=-1/0;for(let[w,x]of d)w<m&&(m=w),x<h&&(h=x),w>p&&(p=w),x>g&&(g=x);return{minX:m,minY:h,maxX:p,maxY:g,width:p-m,height:g-h}}function wa(e,t,r){let n=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[n[0]||"0",n[1]||"0"],a=(l,c)=>{let s=l.toLowerCase();return s==="left"||s==="top"?0:s==="center"?c/2:s==="right"||s==="bottom"?c:s.endsWith("px")?parseFloat(s)||0:s.endsWith("%")?(parseFloat(s)||0)*c/100:/^-?\d+(\.\d+)?$/.test(s)&&parseFloat(s)||0};return{ox:a(i,t),oy:a(o,r)}}function zr(e){let t={rotate:"0deg",scale:null,translate:null},r=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(r){let i=c=>{try{return typeof r.has=="function"&&!r.has(c)||typeof r.get!="function"?null:r.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.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 c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=i("scale");if(a){let c="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:c;t.scale=`${c} ${s}`}else{let c=getComputedStyle(e);t.scale=c.scale&&c.scale!=="none"?c.scale:null}let l=i("translate");if(l){let c="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,s="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0,u="x"in l&&l.x?.unit?l.x.unit:"px",f="y"in l&&l.y?.unit?l.y.unit:"px";t.translate=`${c}${u} ${s}${f}`}else{let c=getComputedStyle(e);t.translate=c.translate&&c.translate!=="none"?c.translate:null}return t}let n=getComputedStyle(e);return t.rotate=n.rotate&&n.rotate!=="none"?n.rotate:"0deg",t.scale=n.scale&&n.scale!=="none"?n.scale:null,t.translate=n.translate&&n.translate!=="none"?n.translate:null,t}var $t=null;function xa(){if($t)return $t;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),$t=e,e}function Sa(e){let t=xa(),r=document.createElement("div");r.style.transformOrigin="0 0",e.baseTransform&&(r.style.transform=e.baseTransform),e.rotate&&(r.style.rotate=e.rotate),e.scale&&(r.style.scale=e.scale),e.translate&&(r.style.translate=e.translate),t.appendChild(r);let n=$a(r);return t.removeChild(r),n}function va(e){let t=B(e),r=t.transform||"none";if(r!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=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!!(n||i||o)}function $a(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}function Ca(e){if(Array.isArray(e.plugins)){for(let t of e.plugins)if(xt(t)?.name==="picture-resolver")return!0}return Wi().some(t=>t?.name==="picture-resolver")}async function Vr(e,t){if(!e)throw new Error("Element cannot be null or undefined");En(t.cache);let r=t.fast,n=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,l,c,s="",u="",f,d,m=null;await ae("beforeSnap",o);let h=null;t.resolvePicturePlaceholders!==!1&&!Ca(t)&&(h=await Ui(o.element,o.options)),await ae("beforeClone",o);let p=Mi(o.element);try{({clone:a,classCSS:l,styleCache:c}=await vi(o.element,o.options)),!n&&a&&(m=ba(o.element,a)),!i&&a&&Zi(o.element,a,o.options),a&&ea(o.element,a)}finally{p()}if(o={clone:a,classCSS:l,styleCache:c,...o},await ae("afterClone",o),h&&await h(),oa(o.clone),o.options?.excludeMode==="remove")try{sa(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await qo(o.clone,o.element)}catch{}await new Promise(b=>{ce(async()=>{await Ai(o.clone,o.options),b()},{fast:r})}),await new Promise(b=>{ce(async()=>{await ki(o.element,o.clone,o.styleCache,o.options),b()},{fast:r})}),t.compress&&await new Promise(b=>{ce(async()=>{await Qi(o.clone,o.options),b()},{fast:r})}),t.embedFonts&&await new Promise(b=>{ce(async()=>{let v=o.element.ownerDocument||document,C=Ar(o.element),y=si(o.element);if(oe()){let $=new Set(Array.from(C).map(k=>String(k).split("__")[0]).filter(Boolean));await kr($,1,v)}s=await li({required:C,usedCodepoints:y,exclude:o.options.excludeFonts,localFonts:o.options.localFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains,doc:v}),b()},{fast:r})});let g=Dn(o.clone).sort(),w=g.join(",");A.baseStyle.has(w)?u=A.baseStyle.get(w):await new Promise(b=>{ce(()=>{u=jn(g),A.baseStyle.set(w,u),b()},{fast:r})});let x=ma(o.element?.ownerDocument||document);o={fontsCSS:s,baseCSS:u,scrollbarCSS:x,...o},await ae("beforeRender",o),await new Promise(b=>{ce(()=>{let v=B(o.element),C=o.element.getBoundingClientRect(),y=Math.max(1,M(o.element.offsetWidth||parseFloat(v.width)||C.width||1)),$=Math.max(1,M(o.element.offsetHeight||parseFloat(v.height)||C.height||1)),k=o.element.ownerDocument||document;if(o.element===k.body||o.element===k.documentElement){let U=Math.max(o.element.scrollHeight||0,k.documentElement?.scrollHeight||0,k.body?.scrollHeight||0),V=Math.max(o.element.scrollWidth||0,k.documentElement?.scrollWidth||0,k.body?.scrollWidth||0);U>0&&($=Math.max($,M(U))),V>0&&(y=Math.max(y,M(V)));try{let te=(o.scrollbarCSS||"").length+(o.baseCSS||"").length+(o.fontsCSS||"").length+(o.classCSS||"").length,re=A.measureHints.get(o.element);if(re&&re.cssLen===te&&re.w0===y)re.csh>0&&($=Math.max($,M(re.csh))),re.csw>0&&(y=Math.max(y,M(re.csw)));else{let ne=k.createElement("div");ne.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+y+"px!important;overflow:visible!important;visibility:hidden!important;";let Qe=k.createElement("style");Qe.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,ne.appendChild(Qe),ne.appendChild(o.clone.cloneNode(!0)),k.body.appendChild(ne);let ue=ne.scrollHeight,Pt=ne.scrollWidth;k.body.removeChild(ne),A.measureHints.set(o.element,{cssLen:te,w0:y,csh:ue,csw:Pt}),ue>0&&($=Math.max($,M(ue))),Pt>0&&(y=Math.max(y,M(Pt)))}}catch{}}if(o.options?.excludeMode==="remove"){let U=fa(o.element,o.options);Number.isFinite(U)&&U>0&&($=Math.max(1,Math.min($,M(U+1))))}let O=(U,V=NaN)=>{let te=typeof U=="string"?parseFloat(U):U;return Number.isFinite(te)?te:V},_=O(o.options.width),I=O(o.options.height),N=y,H=$,F=Number.isFinite(_),j=Number.isFinite(I),E=$>0?y/$:1;F&&j?(N=Math.max(1,M(_)),H=Math.max(1,M(I))):F?(N=Math.max(1,M(_)),H=Math.max(1,M(N/(E||1)))):j?(H=Math.max(1,M(I)),N=Math.max(1,M(H*(E||1)))):(N=y,H=$);let L=0,P=0,W=y,X=$;if(!n&&m&&Number.isFinite(m.a)){let U={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},V=Ur(y,$,U,0,0);L=M(V.minX),P=M(V.minY),W=M(V.maxX),X=M(V.maxY)}else if(n&&qr(o.element)){let U=v.transform&&v.transform!=="none"?v.transform:"",V=zr(o.element),te=Sa({baseTransform:U,rotate:V.rotate||"0deg",scale:V.scale,translate:V.translate}),{ox:re,oy:ne}=wa(v,y,$),Qe=te.is2D?te:new DOMMatrix(te.toString()),ue=Ur(y,$,Qe,re,ne);L=M(ue.minX),P=M(ue.minY),W=M(ue.maxX),X=M(ue.maxY)}let we=ha(v),ee=pa(v),xe=ga(v),Se=ya(v),me=i?{top:M(we.top+ee.top+xe.top+Se.bleed.top),right:M(we.right+ee.right+xe.right+Se.bleed.right),bottom:M(we.bottom+ee.bottom+xe.bottom+Se.bleed.bottom),left:M(we.left+ee.left+xe.left+Se.bleed.left)}:{top:0,right:0,bottom:0,left:0};L=M(L-me.left),P=M(P-me.top),W=M(W+me.right),X=M(X+me.bottom);let Pe=Math.max(1,M(W-L)),Sn=Math.max(1,M(X-P)),ls=F||j?M(N/y):1,ss=j||F?M(H/$):1,us=Math.max(1,M(Pe*ls)),cs=Math.max(1,M(Sn*ss)),vn="http://www.w3.org/2000/svg",fs=oe()&&qr(o.element)?1:0,le=M(fs+(n?0:1)),se=document.createElementNS(vn,"foreignObject"),ds=M(L),ms=M(P);se.setAttribute("x",String(M(-(ds-le)))),se.setAttribute("y",String(M(-(ms-le)))),se.setAttribute("width",String(M(y+le*2))),se.setAttribute("height",String(M($+le*2))),se.style.overflow="visible";let $n=document.createElement("style"),hs="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";$n.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+hs+o.classCSS,se.appendChild($n);let Ke=document.createElement("div");Ke.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ke.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${M(y)}px;height:${M($)}px`,Ke.appendChild(o.clone),se.appendChild(Ke);let ps=new XMLSerializer().serializeToString(se),Rt=M(Pe+le*2),Tt=M(Sn+le*2),Cn=F||j;t.meta={w0:y,h0:$,vbW:Rt,vbH:Tt,targetW:N,targetH:H};let gs=oe()&&Cn?Rt:M(us+le*2),ys=oe()&&Cn?Tt:M(cs+le*2),bs=parseFloat(B(k.documentElement)?.fontSize)||16;d=`<svg xmlns="${vn}" width="${gs}" height="${ys}" viewBox="0 0 ${Rt} ${Tt}" font-size="${bs}px">`+ps+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,o={svgString:d,dataURL:f,...o},b()},{fast:r})}),await ae("afterRender",o);let S=document.getElementById("snapdom-sandbox");return S&&S.style.position==="absolute"&&S.remove(),o.dataURL}function qr(e){return va(e)}D();function Aa(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=Mn(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:r,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,compress:e.compress!==!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1,pictureResolver:e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{}}}Ce(),Gt(),G(),he(),D();function ka(...e){return Ti(...e),T}var T=Object.assign(Ea,{plugins:ka}),Br=Symbol("snapdom.internal"),Ma=Symbol("snapdom.internal.silent"),Xr=!1;async function Ea(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=Aa(t);if(Oi(r,t&&t.plugins),oe()&&(r.embedFonts===!0||Fa(e))){if(r.embedFonts)try{let i=Ar(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await kr(o,1)}catch{}let n=r.safariWarmupAttempts??3;for(let i=0;i<n;i++)try{await Na(e,t)}catch{}}return r.iconFonts&&r.iconFonts.length>0&&Io(r.iconFonts),r.snap||(r.snap={toPng:(n,i)=>T.toPng(n,i),toSvg:(n,i)=>T.toSvg(n,i)}),T.capture(e,r,Br)}T.capture=async(e,t,r)=>{if(r!==Br)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let n=await Vr(e,t),i={img:async(p,g)=>{let{toImg:w}=await Promise.resolve().then(()=>(nr(),lt));return w(n,{...p,...g||{}})},svg:async(p,g)=>{let{toSvg:w}=await Promise.resolve().then(()=>(nr(),lt));return w(n,{...p,...g||{}})},canvas:async(p,g)=>{let{toCanvas:w}=await Promise.resolve().then(()=>(je(),Kt));return w(n,{...p,...g||{}})},blob:async(p,g)=>{let{toBlob:w}=await Promise.resolve().then(()=>(ar(),or));return w(n,{...p,...g||{}})},png:async(p,g)=>{let{rasterize:w}=await Promise.resolve().then(()=>(Ue(),He));return w(n,{...p,...g||{},format:"png"})},jpeg:async(p,g)=>{let{rasterize:w}=await Promise.resolve().then(()=>(Ue(),He));return w(n,{...p,...g||{},format:"jpeg"})},webp:async(p,g)=>{let{rasterize:w}=await Promise.resolve().then(()=>(Ue(),He));return w(n,{...p,...g||{},format:"webp"})},download:async(p,g)=>{let{download:w}=await Promise.resolve().then(()=>(Jn(),lr));return w(n,{...p,...g||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async g=>i[p](t,{...g||{},[Ma]:!0});o.jpg=o.jpeg;let a={...t,export:{url:n},exports:o},l=await Pi("defineExports",a),c=Object.assign({},...l.filter(p=>p&&typeof p=="object").reverse()),s={...i,...c};s.jpeg&&!s.jpg&&(s.jpg=(p,g)=>s.jpeg(p,g));function u(p,g){let w={...t,...g||{}},x=S=>S==="jpeg"||S==="jpg"||S==="webp";return[p,w.format,w.type].map(S=>typeof S=="string"?S.toLowerCase():"").find(x)&&(w.backgroundColor==null||w.backgroundColor==="transparent")&&(w.backgroundColor="#ffffff"),w}let f=!1,d=Promise.resolve();async function m(p,g){let w=async()=>{let x=s[p];if(!x)throw new Error(`[snapdom] Unknown export type: ${p}`);let S=u(p,g),b={...t,export:{type:p,options:S,url:n}};await ae("beforeExport",b,{format:p,options:S});let v=await x(b,S);return await ae("afterExport",b,{format:p,options:S,result:v}),f||(f=!0,await ae("afterSnap",t)),v};return d=d.then(w)}let h={url:n,toRaw:()=>n,to:(p,g)=>m(p,g),toImg:p=>m("img",p),toSvg:p=>m("svg",p),toCanvas:p=>m("canvas",p),toBlob:p=>m("blob",p),toPng:p=>m("png",p),toJpg:p=>m("jpg",p),toWebp:p=>m("webp",p),download:p=>m("download",p)};for(let p of Object.keys(s)){let g="to"+p.charAt(0).toUpperCase()+p.slice(1);h[g]||(h[g]=w=>m(p,w))}return h},T.toRaw=(e,t)=>T(e,t).then(r=>r.toRaw()),T.toImg=(e,t)=>T(e,t).then(r=>r.toImg()),T.toSvg=(e,t)=>T(e,t).then(r=>r.toSvg()),T.toCanvas=(e,t)=>T(e,t).then(r=>r.toCanvas()),T.toBlob=(e,t)=>T(e,t).then(r=>r.toBlob()),T.toPng=(e,t)=>T(e,{...t,format:"png"}).then(r=>r.toPng()),T.toJpg=(e,t)=>T(e,{...t,format:"jpeg"}).then(r=>r.toJpg()),T.toWebp=(e,t)=>T(e,{...t,format:"webp"}).then(r=>r.toWebp()),T.download=(e,t)=>T(e,t).then(r=>r.download());async function Na(e,t){if(Xr)return;let r={...t,fast:!0,embedFonts:!0,scale:.2},n;try{n=await Vr(e,r)}catch(i){R(t,"safariWarmup pre-capture failed",i)}await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),n&&await new Promise(i=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){R(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=n,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(l){R(t,"safariWarmup img.decode failed",l)}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)await new Promise(l=>setTimeout(l,200));await new Promise(l=>requestAnimationFrame(l));try{let l=document.createElement("canvas");l.width=Math.max(1,o.naturalWidth||10),l.height=Math.max(1,o.naturalHeight||10);let c=l.getContext("2d");c&&c.drawImage(o,0,0)}catch{}await new Promise(l=>requestAnimationFrame(l));try{o.remove()}catch(l){R(t,"safariWarmup img.remove failed",l)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){R(t,"safariWarmup canvas poke failed",o)}}),Xr=!0}function Fa(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let r=t.currentNode,n=getComputedStyle(r),i=n.backgroundImage&&n.backgroundImage!=="none",o=n.maskImage&&n.maskImage!=="none"||n.webkitMaskImage&&n.webkitMaskImage!=="none";if(i||o||r.tagName==="CANVAS")return!0}return!1}const Yr={scale:1,backgroundColor:"#ffffff"};function La(e){return T.toBlob(e,{...Yr,type:"png"})}async function Ra(e){const t=await T.toCanvas(document.documentElement,Yr),r=Math.max(1,Math.round(e.width)),n=Math.max(1,Math.round(e.height)),i=document.createElement("canvas");i.width=r,i.height=n;const o=i.getContext("2d");if(!o)throw new Error("could not create a 2d context for the region crop");return o.drawImage(t,e.x+window.scrollX,e.y+window.scrollY,r,n,0,0,r,n),await new Promise((a,l)=>{i.toBlob(c=>c?a(c):l(new Error("region toBlob failed")),"image/png")})}function Ta(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/([^A-Za-z0-9_-])/g,"\\$1")}function Pa(e){const t=[];let r=e;for(;r&&r.nodeType===1;){if(r.id){t.unshift(`#${Ta(r.id)}`);break}let n=r.localName;const i=r.parentElement;if(i){const o=Array.from(i.children).filter(a=>a.localName===r?.localName);o.length>1&&(n+=`:nth-of-type(${o.indexOf(r)+1})`)}t.unshift(n),r=r.parentElement}return t.join(" > ")}function _a(e){const t=e.id?`#${e.id}`:"",r=typeof e.className=="string"?e.className.trim():"",n=r?`.${r.split(/\s+/)[0]}`:"",i=(e.textContent??"").replace(/\s+/g," ").trim().slice(0,40),o=i?` "${i}"`:"";return`${e.localName}${t}${n}${o}`}function Oa(){return{width:window.innerWidth,height:window.innerHeight}}const Wa="2147483646",Gr="#378ADD";function Ia(e){let t="off",r=!1,n={x:0,y:0};const i=document.createElement("div");i.setAttribute("data-chamba-annotate","root"),be(i,{position:"fixed",inset:"0",zIndex:Wa,pointerEvents:"none",fontFamily:"-apple-system, system-ui, sans-serif"});const o=document.createElement("div");be(o,{position:"fixed",display:"none",border:`2px solid ${Gr}`,background:"rgba(55,138,221,0.12)",borderRadius:"3px",boxSizing:"border-box",transition:"all 60ms ease-out"});const a=document.createElement("div");be(a,{position:"fixed",display:"none",border:`2px dashed ${Gr}`,background:"rgba(55,138,221,0.10)",boxSizing:"border-box"});const l=document.createElement("div");be(l,{position:"fixed",top:"12px",left:"50%",transform:"translateX(-50%)",display:"none",padding:"6px 12px",borderRadius:"999px",background:"#2C2C2A",color:"#FCFBF8",fontSize:"12px",boxShadow:"0 2px 10px rgba(0,0,0,0.25)",whiteSpace:"nowrap"}),i.append(o,a,l);const c=(y,$)=>{const k=document.elementFromPoint(y,$);return!k||k===i||i.contains(k)?null:k},s=y=>{const $=y.getBoundingClientRect();be(o,{display:"block",left:`${$.left}px`,top:`${$.top}px`,width:`${$.width}px`,height:`${$.height}px`})},u=y=>{if(t==="annotate"){const $=c(y.clientX,y.clientY);$&&s($)}else t==="region"&&r&&Qr(a,Kr(n,{x:y.clientX,y:y.clientY}))},f=y=>{y.relatedTarget||(o.style.display="none")},d=y=>{y.preventDefault(),y.stopImmediatePropagation()},m=y=>{if(t==="off"||(d(y),t!=="annotate"))return;const $=c(y.clientX,y.clientY);$&&e.onPick($)},h=y=>{if(t==="annotate"){d(y);return}t==="region"&&(d(y),r=!0,n={x:y.clientX,y:y.clientY},Qr(a,{x:y.clientX,y:y.clientY,width:0,height:0}))},p=y=>{if(t==="annotate"){d(y);return}if(t==="region"&&r){d(y),r=!1;const $=Kr(n,{x:y.clientX,y:y.clientY});a.style.display="none",$.width>=8&&$.height>=8&&e.onRegion($)}},g=y=>{y.key==="Escape"&&e.onExit()},w=y=>{t!=="off"&&d(y)},x=[["mousemove",u,!0],["mouseout",f,!0],["click",m,!0],["mousedown",h,!0],["mouseup",p,!0],["dblclick",w,!0],["contextmenu",w,!0],["keydown",g,!0]],S=()=>{for(const[y,$,k]of x)document.addEventListener(y,$,k)},b=()=>{for(const[y,$,k]of x)document.removeEventListener(y,$,k)},v=y=>{if(y===t)return;const $=t==="off";if(t=y,r=!1,o.style.display="none",a.style.display="none",t==="off"){l.style.display="none",document.documentElement.style.cursor="",i.isConnected&&i.remove(),b();return}l.textContent=t==="annotate"?"Annotate - click an element to comment · Esc to stop":"Region - drag a box to screenshot · Esc to stop",l.style.display="block",document.documentElement.style.cursor="crosshair",i.isConnected||document.documentElement.appendChild(i),$&&S()};return{setMode:v,destroy:()=>v("off")}}function Kr(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}function Qr(e,t){be(e,{display:"block",left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})}function be(e,t){Object.assign(e.style,t)}/**
9
- * @license bippy
10
- *
11
- * Copyright (c) Aiden Bai
12
- *
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */const Da="0.5.43",Zr=`bippy-${Da}`,Jr=Object.defineProperty,ja=Object.prototype.hasOwnProperty,Fe=()=>{},en=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")})}catch{}},Ha=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&"getFiberRoots"in e);let tn=!1,rn;const nn=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>tn?!0:(e&&typeof e.inject=="function"&&(rn=e.inject.toString()),!!rn?.includes("(injected)")),Ct=new Set,Le=new Set,Ua=e=>{let t=new Map,r=0,n={_instrumentationIsActive:!1,_instrumentationSource:Zr,checkDCE:en,hasUnsupportedRendererAttached:!1,inject(i){let o=++r;return t.set(o,i),Le.add(i),n._instrumentationIsActive||(n._instrumentationIsActive=!0,Ct.forEach(a=>a())),o},on:Fe,onCommitFiberRoot:Fe,onCommitFiberUnmount:Fe,onPostCommitFiberRoot:Fe,renderers:t,supportsFiber:!0,supportsFlight:!0};try{Jr(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return n},set(a){if(a&&typeof a=="object"){let l=n.renderers;n=a,l.size>0&&(l.forEach((c,s)=>{Le.add(c),a.renderers.set(s,c)}),At(e))}}});let i=window.hasOwnProperty,o=!1;Jr(window,"hasOwnProperty",{configurable:!0,value:function(...a){try{if(!o&&a[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,o=!0,-0}catch{}return i.apply(this,a)},writable:!0})}catch{At(e)}return n},At=e=>{try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=en,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Zr,t._instrumentationIsActive=!1;let r=Ha(t);if(r||(t.on=Fe),t.renderers.size){t._instrumentationIsActive=!0,Ct.forEach(o=>o());return}let n=t.inject,i=nn(t);i&&!r&&(tn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=o=>{let a=n(o);return Le.add(o),i&&t.renderers.set(a,o),t._instrumentationIsActive=!0,Ct.forEach(l=>l()),a}}(t.renderers.size||t._instrumentationIsActive||nn())&&e?.()}catch{}},za=()=>ja.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),on=e=>za()?(At(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Ua(e),Va=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),qa=()=>{try{Va()&&on()}catch{}};/**
16
- * @license bippy
17
- *
18
- * Copyright (c) Aiden Bai
19
- *
20
- * This source code is licensed under the MIT license found in the
21
- * LICENSE file in the root directory of this source tree.
22
- */qa();/**
23
- * @license bippy
24
- *
25
- * Copyright (c) Aiden Bai
26
- *
27
- * This source code is licensed under the MIT license found in the
28
- * LICENSE file in the root directory of this source tree.
29
- */const an=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}};function Ba(e,t,r=!1){if(!e)return null;let n=t(e);if(n instanceof Promise)return(async()=>{if(await n===!0)return e;let o=r?e.return:e.child;for(;o;){let a=await ln(o,t,r);if(a)return a;o=r?null:o.sibling}return null})();if(n===!0)return e;let i=r?e.return:e.child;for(;i;){let o=kt(i,t,r);if(o)return o;i=r?null:i.sibling}return null}const kt=(e,t,r=!1)=>{if(!e)return null;if(t(e)===!0)return e;let n=r?e.return:e.child;for(;n;){let i=kt(n,t,r);if(i)return i;n=r?null:n.sibling}return null},ln=async(e,t,r=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let n=r?e.return:e.child;for(;n;){let i=await ln(n,t,r);if(i)return i;n=r?null:n.sibling}return null},sn=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?sn(t.type||t.render):null},Ye=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let r=t.displayName||t.name||null;if(r)return r;let n=sn(t);return n&&(n.displayName||n.name)||null},Xa=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let r of t.renderers.values())try{let n=r.findFiberByHostInstance?.(e);if(n)return n}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let r in e)if(r.startsWith("__reactContainer$")||r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber"))return e[r]||null}return null};/**
30
- * @license bippy
31
- *
32
- * Copyright (c) Aiden Bai
33
- *
34
- * This source code is licensed under the MIT license found in the
35
- * LICENSE file in the root directory of this source tree.
36
- */const Ya=/\(at [^)]+\)$/,Ga=/(^|@)\S+:\d+/,Ka=/^\s*at .*(\S+:\d+|\(native\))/m,Qa=/^(eval@)?(\[native code\])?$/,un=(e,t)=>{{let r=e.split(`
37
- `),n=[];for(let i of r)if(/^\s*at\s+/.test(i)){let o=Za(i,void 0)[0];o&&n.push(o)}else if(/^\s*in\s+/.test(i)){let o=i.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");n.push({functionName:o,source:i})}else if(i.match(Ga)){let o=Ja(i,void 0)[0];o&&n.push(o)}return Mt(n,t)}},cn=e=>{if(!e.includes(":"))return[e,void 0,void 0];let t=e.startsWith("(")&&/:\d+\)$/.test(e)?e.slice(1,-1):e,r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return r?[r[1],r[2]||void 0,r[3]||void 0]:[t,void 0,void 0]},Mt=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,Za=(e,t)=>Mt(e.split(`
38
- `).filter(r=>!!r.match(Ka)),t).map(r=>{let n=r;n.includes("(eval ")&&(n=n.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=n.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),o=i.match(/ (\(.+\)$)/);i=o?i.replace(o[0],""):i;let a=cn(o?o[1]:i);return{functionName:o&&i||void 0,fileName:["eval","<anonymous>"].includes(a[0])?void 0:a[0],lineNumber:a[1]?+a[1]:void 0,columnNumber:a[2]?+a[2]:void 0,source:n}}),Ja=(e,t)=>Mt(e.split(`
39
- `).filter(r=>!r.match(Qa)),t).map(r=>{let n=r;if(n.includes(" > eval")&&(n=n.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!n.includes("@")&&!n.includes(":"))return{functionName:n};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,o=n.match(i),a=o&&o[1]?o[1]:void 0,l=cn(n.replace(i,""));return{functionName:a,fileName:l[0],lineNumber:l[1]?+l[1]:void 0,columnNumber:l[2]?+l[2]:void 0,source:n}}});var el=44,fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tl=new Uint8Array(64),dn=new Uint8Array(128);for(let e=0;e<fn.length;e++){let t=fn.charCodeAt(e);tl[e]=t,dn[t]=e}function Re(e,t){let r=0,n=0,i=0;do i=dn[e.next()],r|=(i&31)<<n,n+=5;while(i&32);let o=r&1;return r>>>=1,o&&(r=-2147483648|-r),t+r}function mn(e,t){return e.pos>=t?!1:e.peek()!==el}var rl=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:r}=this,n=t.indexOf(e,r);return n===-1?t.length:n}};function hn(e){let{length:t}=e,r=new rl(e),n=[],i=0,o=0,a=0,l=0,c=0;do{let s=r.indexOf(";"),u=[],f=!0,d=0;for(i=0;r.pos<s;){let m;i=Re(r,i),i<d&&(f=!1),d=i,mn(r,s)?(o=Re(r,o),a=Re(r,a),l=Re(r,l),mn(r,s)?(c=Re(r,c),m=[i,o,a,l,c]):m=[i,o,a,l]):m=[i],u.push(m),r.pos++}f||nl(u),n.push(u),r.pos=s+1}while(r.pos<=t);return n}function nl(e){e.sort(ol)}function ol(e,t){return e[0]-t[0]}const pn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,il=/^data:application\/json[^,]+base64,/,al=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Et=new Map,Nt=new Map,gn=(e,t,r,n)=>{if(r<0||r>=e.length)return null;let i=e[r];if(!i||i.length===0)return null;let o=null;for(let u of i)if(u[0]<=n)o=u;else break;if(!o||o.length<4)return null;let[,a,l,c]=o;if(a===void 0||l===void 0||c===void 0)return null;let s=t[a];return s?{columnNumber:c,fileName:s,lineNumber:l+1}:null},ll=(e,t,r)=>{if(e.sections){let n=null;for(let a of e.sections)if(t>a.offset.line||t===a.offset.line&&r>=a.offset.column)n=a;else break;if(!n)return null;let i=t-n.offset.line,o=t===n.offset.line?r-n.offset.column:r;return gn(n.map.mappings,n.map.sources,i,o)}return gn(e.mappings,e.sources,t-1,r)},sl=(e,t)=>{let r=t.split(`
40
- `),n;for(let o=r.length-1;o>=0&&!n;o--){let a=r[o].match(al);a&&(n=a[1]||a[2])}if(!n)return null;let i=pn.test(n);if(!(il.test(n)||i||n.startsWith("/"))){let o=e.split("/");o[o.length-1]=n,n=o.join("/")}return n},ul=e=>({file:e.file,mappings:hn(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),cl=e=>{let t=e.sections.map(({map:n,offset:i})=>({map:{...n,mappings:hn(n.mappings)},offset:i})),r=new Set;for(let n of t)for(let i of n.map.sources)r.add(i);return{file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(r),sourcesContent:void 0,version:3}},yn=e=>{if(!e)return!1;let t=e.trim();if(!t)return!1;let r=t.match(pn);if(!r)return!0;let n=r[0].toLowerCase();return n==="http:"||n==="https:"},fl=async(e,t=fetch)=>{if(!yn(e))return null;let r=await t(e);if(!r.ok)return null;let n=await r.text();if(!n)return null;let i=sl(e,n);if(!i||!yn(i))return null;let o=await t(i);if(!o.ok)return null;try{let a=await o.json();return"sections"in a?cl(a):ul(a)}catch{return null}},dl=async(e,t=!0,r)=>{if(t&&Et.has(e))return Et.get(e)??null;let n=t?Nt.get(e):void 0;if(n)return(await n).sourceMap;let i=fl(e,r).then(l=>({sourceMap:l,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));t&&Nt.set(e,i);let{sourceMap:o,isTransientFailure:a}=await i;return t&&(Nt.delete(e),a||Et.set(e,o)),o},ml=async(e,t=!0,r)=>await Promise.all(e.map(async n=>{if(!n.fileName)return n;let i=await dl(n.fileName,t,r);if(!i||typeof n.lineNumber!="number"||typeof n.columnNumber!="number")return n;let o=ll(i,n.lineNumber,n.columnNumber);return o?{...n,source:o.fileName&&n.source?n.source.replace(n.fileName,o.fileName):n.source,fileName:o.fileName,lineNumber:o.lineNumber,columnNumber:o.columnNumber,isSymbolicated:!0}:n})),hl=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",pl=()=>{let e=on();for(let t of[...Array.from(Le),...Array.from(e.renderers.values())]){let r=t.currentDispatcherRef;if(r&&typeof r=="object")return"H"in r?r.H:r.current}return null},bn=e=>{for(let t of Le){let r=t.currentDispatcherRef;r&&typeof r=="object"&&("H"in r?r.H=e:r.current=e)}},J=e=>`
41
- in ${e}`,gl=(e,t)=>{let r=J(e);return t&&(r+=` (at ${t})`),r};let Ft=!1;const Lt=(e,t)=>{if(!e||Ft)return"";let r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Ft=!0;let n=pl();bn(null);let i=console.error,o=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let u;try{if(t){let f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){u=d}Reflect.construct(e,[],f)}else{try{f.call()}catch(d){u=d}e.call(f.prototype)}}else{try{throw Error()}catch(d){u=d}let f=e();f&&typeof f.catch=="function"&&f.catch(()=>{})}}catch(f){if(f instanceof Error&&u instanceof Error&&typeof f.stack=="string")return[f.stack,u.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[c,s]=l.DetermineComponentFrameRoot();if(c&&s){let u=c.split(`
42
- `),f=s.split(`
43
- `),d=0,m=0;for(;d<u.length&&!u[d].includes("DetermineComponentFrameRoot");)d++;for(;m<f.length&&!f[m].includes("DetermineComponentFrameRoot");)m++;if(d===u.length||m===f.length)for(d=u.length-1,m=f.length-1;d>=1&&m>=0&&u[d]!==f[m];)m--;for(;d>=1&&m>=0;d--,m--)if(u[d]!==f[m]){if(d!==1||m!==1)do if(d--,m--,m<0||u[d]!==f[m]){let h=`
44
- ${u[d].replace(" at new "," at ")}`,p=Ye(e);return p&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",p)),h}while(d>=1&&m>=0);break}}}finally{Ft=!1,Error.prepareStackTrace=r,bn(n),console.error=i,console.warn=o}let a=e?Ye(e):"";return a?J(a):""},yl=(e,t)=>{let r=e.tag,n="";switch(r){case 28:n=J("Activity");break;case 1:n=Lt(e.type,!0);break;case 11:n=Lt(e.type.render,!1);break;case 0:case 15:n=Lt(e.type,!1);break;case 5:case 26:case 27:n=J(e.type);break;case 16:n=J("Lazy");break;case 13:n=e.child!==t&&t!==null?J("Suspense Fallback"):J("Suspense");break;case 19:n=J("SuspenseList");break;case 30:n=J("ViewTransition");break;default:return""}return n},bl=e=>{try{let t="",r=e,n=null;do{t+=yl(r,n);let i=r._debugInfo;if(i&&Array.isArray(i))for(let o=i.length-1;o>=0;o--){let a=i[o];typeof a.name=="string"&&(t+=gl(a.name,a.env))}n=r,r=r.return}while(r);return t}catch(t){return t instanceof Error?`
45
- Error generating stack: ${t.message}
46
- ${t.stack}`:""}},wl=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let r=e;if(!r)return"";Error.prepareStackTrace=t,r.startsWith(`Error: react-stack-top-frame
47
- `)&&(r=r.slice(29));let n=r.indexOf(`
48
- `);if(n!==-1&&(r=r.slice(n+1)),n=Math.max(r.indexOf("react_stack_bottom_frame"),r.indexOf("react-stack-bottom-frame")),n!==-1&&(n=r.lastIndexOf(`
49
- `,n)),n!==-1)r=r.slice(0,n);else return"";return r},xl=e=>!!(e.functionName&&e.fileName&&(e.fileName.startsWith("rsc://")||e.fileName.startsWith("about://React/"))),Sl=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,vl=e=>{let t=new Map;for(let r of e)for(let n of r.stackFrames){if(!xl(n))continue;let i=n.functionName,o=t.get(i)??[];o.some(a=>Sl(a,n))||(o.push(n),t.set(i,o))}return t},$l=(e,t,r)=>{if(!e.functionName)return{...e,isServer:!0};let n=t.get(e.functionName);if(!n||n.length===0)return{...e,isServer:!0};let i=r.get(e.functionName)??0,o=n[i%n.length];return r.set(e.functionName,i+1),{...e,isServer:!0,fileName:o.fileName,lineNumber:o.lineNumber,columnNumber:o.columnNumber,source:e.source?.replace("(at Server)",`(${o.fileName}:${o.lineNumber}:${o.columnNumber})`)}},Cl=e=>{let t=[];return Ba(e,r=>{if(!hl(r))return;let n=typeof r.type=="string"?r.type:Ye(r.type)||"<anonymous>";t.push({componentName:n,stackFrames:un(wl(r._debugStack?.stack))})},!0),t},Al=async(e,t=!0,r)=>{let n=Cl(e),i=un(bl(e)),o=vl(n),a=new Map;return ml(i.map(l=>(l.source?.includes("(at Server)")??!1)||l.source!=null&&Ya.test(l.source)?$l(l,o,a):l).filter((l,c,s)=>{if(c===0)return!0;let u=s[c-1];return l.functionName!==u.functionName}),t,r)},kl=e=>{let t=e._debugSource;return t?typeof t=="object"&&!!t&&"fileName"in t&&typeof t.fileName=="string"&&"lineNumber"in t&&typeof t.lineNumber=="number":!1},Ml=async(e,t=!0,r)=>{if(kl(e))return e._debugSource||null;let n=await Al(e,t,r);for(let i of n)if(i.fileName)return{fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,functionName:i.functionName};return null},El=Symbol.for("react.context");let Nl=null;const Fl=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render."),K=()=>Nl,Ge=e=>e._currentValue,Te=(e,t,r,n=null)=>{},Ll=e=>{if(typeof e=="object"&&e){let t=e;if(typeof t.then=="function"){let r=t;switch(r.status){case"fulfilled":return Te("Promise",r.value),r.value;case"rejected":throw r.reason}throw Fl}if(t.$$typeof===El&&"_currentValue"in t){let r=t,n=Ge(r);return Te("Context (use)",n,"Use",r.displayName||"Context"),n}}throw Error("An unsupported type was passed to use(): "+String(e))},Rl=e=>{let t=Ge(e);return Te("Context",t,"Context",e.displayName||null),t},Tl=e=>{let t=K();return[t===null?typeof e=="function"?e():e:t.memoizedState,()=>{}]},Pl=(e,t,r)=>{let n=K();return[n===null?r===void 0?t:r(t):n.memoizedState,()=>{}]},_l=e=>{let t=K(),r=t===null?{current:e}:t.memoizedState;return Te("Ref",r.current),r},Ol=()=>()=>{},Wl=e=>{},Il=e=>{},Dl=e=>{},jl=e=>{typeof e=="object"&&e&&"current"in e&&e.current},Hl=(e,t)=>{Te("DebugValue",typeof t=="function"?t(e):e)},Ul=e=>e,zl=e=>{let t=K();return t===null?e():t.memoizedState[0]},Vl=(e,t)=>{let r=K();return r===null?t():r.memoizedState},ql=()=>{let e=K();return[e===null?!1:e.memoizedState,()=>{}]},Bl=e=>{let t=K();return t===null?e:t.memoizedState},Xl=()=>{let e=K();return e===null?"":e.memoizedState},Yl=e=>[],Gl=e=>{let t=K();return[t===null?e:t.memoizedState,()=>{}]},Kl=(e,t)=>{let r,n=null;return r=t,{value:r,error:n}},wn=e=>(t,r)=>{let n=K(),{value:i}=Kl(n,r);return[i,()=>{},!1]},Ql=wn(),xn={readContext:Ge,use:Ll,useCallback:Ul,useContext:Rl,useEffect:Dl,useImperativeHandle:jl,useLayoutEffect:Wl,useInsertionEffect:Il,useMemo:zl,useReducer:Pl,useRef:_l,useState:Tl,useDebugValue:Hl,useDeferredValue:Bl,useTransition:ql,useSyncExternalStore:Vl,useId:Xl,useHostTransitionStatus:()=>Ge({_currentValue:null}),useFormState:wn(),useActionState:Ql,useOptimistic:Gl,useMemoCache:Yl,useCacheRefresh:Ol,useEffectEvent:e=>e};typeof Proxy>"u"||new Proxy(xn,{get(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let r=Error("Missing method in Dispatcher: "+t);throw r.name="ReactDebugToolsUnsupportedHookError",r}});const Zl=2e3;function Jl(){const e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e?.renderers&&e.renderers.size>0)return!0;const t=document.querySelector("#root, #__next, [data-reactroot]")??document.body;if(!t)return!1;for(const r of[t,...Array.from(t.children).slice(0,4)])if(Object.keys(r).some(n=>n.startsWith("__reactFiber$")||n.startsWith("__reactContainer$")))return!0;return!1}async function es(e){const t=rs(e);if(!t)return null;const n=(an(t)?t:kt(t,a=>an(a),!0))??t,i=ns(n);if(!i)return null;const o=await os(n);return o&&ts(o.file)?null:{name:i,...o?{source:o}:{}}}function ts(e){return e.includes("node_modules")}function rs(e){try{return Xa(e)}catch{return null}}function ns(e){try{return Ye(e.type)}catch{return null}}async function os(e){try{const t=await is(Ml(e,!0),Zl,null);return t?.fileName?{file:t.fileName,...t.lineNumber?{line:t.lineNumber}:{},...t.columnNumber?{column:t.columnNumber}:{}}:void 0}catch{return}}function is(e,t,r){return new Promise(n=>{let i=!1;const o=setTimeout(()=>{i||(i=!0,n(r))},t),a=l=>{i||(i=!0,clearTimeout(o),n(l))};e.then(a,()=>a(r))})}function as(){if(window.parent===window)return;const e=Ia({onPick:i=>void r(i),onRegion:i=>void n(i),onExit:()=>e.setMode("off")}),t=An(i=>{i.t==="hello"?t.emit({tag:_e,t:"ready",react:Jl(),url:location.href}):i.t==="mode"&&e.setMode(i.mode)});async function r(i){const o=await es(i),a={selector:Pa(i),pageUrl:location.href,viewport:Oa(),label:_a(i),...o?{component:o}:{}};let l;try{l=await La(i)}catch{}t.emit({tag:_e,t:"selected",target:a,...l?{screenshot:l}:{}})}async function n(i){let o;try{o=await Ra(i)}catch{return}t.emit({tag:_e,t:"region",screenshot:o}),e.setMode("off")}}as()})();
1
+ (function(){var e=`chamba-annotate/1`;function t(e){let t=null;return window.addEventListener(`message`,n=>{let r=n.data;if(!(!r||r.tag!==`chamba-annotate/1`)){if(r.t===`hello`){if(n.source!==window.parent)return;t=n.origin}t===null||n.origin!==t||e(r)}}),{emit:e=>{t!==null&&window.parent.postMessage(e,t)}}}var n=Object.defineProperty,r=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},i=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})};function a(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 o(e=`soft`){switch(c.session.__counterEpoch=(c.session.__counterEpoch||0)+1,e){case`auto`:c.session.styleMap=new Map,c.session.nodeMap=new Map;return;case`soft`:c.session.styleMap=new Map,c.session.nodeMap=new Map,c.session.styleCache=new WeakMap;return;case`full`:return;case`disabled`:c.session.styleMap=new Map,c.session.nodeMap=new Map,c.session.styleCache=new WeakMap,c.computedStyle=new WeakMap,c.measureHints=new WeakMap,c.baseStyle=new s(50),c.defaultStyle=new s(30),c.image=new s(100),c.background=new s(100),c.resource=new s(150),c.font=new Set;return;default:c.session.styleMap=new Map,c.session.nodeMap=new Map,c.session.styleCache=new WeakMap;return}}var s,c,l=r(()=>{s=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let e=this.keys().next().value;e!==void 0&&this.delete(e)}return super.set(e,t)}},c={image:new s(100),background:new s(100),resource:new s(150),defaultStyle:new s(30),baseStyle:new s(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function u(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith(`#`)?null:n}function d(e){if(!e||e===`none`)return``;let t=e.replace(/translate[XY]?\([^)]*\)/g,``);return t=t.replace(/matrix\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===6?(n[4]=`0`,n[5]=`0`,`matrix(${n.join(`, `)})`):`matrix(${t})`}),t=t.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===16?(n[12]=`0`,n[13]=`0`,`matrix3d(${n.join(`, `)})`):`matrix3d(${t})`}),t.trim().replace(/\s{2,}/g,` `)}function f(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function p(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 m=r(()=>{});function h(e=`[snapDOM]`,{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function a(a,o,s){if(i>=n)return;let c=Date.now();(r.get(o)||0)>c||(r.set(o,c+t),i++,a===`warn`&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(e,t){a(`warn`,e,t)},errorOnce(e,t){a(`error`,e,t)},reset(){r.clear(),i=0}}}function g(e){return/^data:|^blob:|^about:blank$/i.test(e)}function _(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),a=new URL(e,n);if(a.origin===i.origin)return!0;let o=a.searchParams;if(o&&(o.has(`url`)||o.has(`target`)))return!0}catch{}return!1}function v(e,t){if(!t||g(e)||_(e,t))return!1;try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);return typeof location<`u`?n.origin!==location.origin:!0}catch{return!!t}}function y(e,t){return t?t.includes(`{url}`)?t.replace(`{urlRaw}`,f(e)).replace(`{url}`,encodeURIComponent(e)):/[?&]url=?$/.test(t)?`${t}${encodeURIComponent(e)}`:t.endsWith(`?`)?`${t}url=${encodeURIComponent(e)}`:t.endsWith(`/`)?`${t}${f(e)}`:`${t}${t.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`:e}function b(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(Error(`read_failed`)),r.readAsDataURL(e)})}function x(e,t){return[t.as||`blob`,t.timeout??3e3,t.useProxy||``,t.errorTTL??8e3,e].join(`|`)}async function S(e,t={}){let n=t.as??`blob`,r=t.timeout??3e3,i=t.useProxy||``,a=t.errorTTL??8e3,o=t.headers||{},s=!!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[,t=``,r=``]=String(e).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(t)?atob(r):decodeURIComponent(r),a=new Uint8Array([...i].map(e=>e.charCodeAt(0))),o=new Blob([a],{type:(t||``).split(`;`)[0]||``});return{ok:!0,data:o,status:200,url:e,fromCache:!1,mime:o.type||``}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:`special_url_error`}}if(/^blob:/i.test(e))try{let t=await fetch(e);if(!t.ok)return{ok:!1,data:null,status:t.status,url:e,fromCache:!1,reason:`http_error`};let r=await t.blob(),i=r.type||t.headers.get(`content-type`)||``;return n===`dataURL`?{ok:!0,data:await b(r),status:t.status,url:e,fromCache:!1,mime:i}:n===`text`?{ok:!0,data:await r.text(),status:t.status,url:e,fromCache:!1,mime:i}:{ok:!0,data:r,status:t.status,url:e,fromCache:!1,mime:i}}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 c=x(e,{as:n,timeout:r,useProxy:i,errorTTL:a}),l=T.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&T.delete(c);let u=w.get(c);if(u)return u;let d=v(e,i)?y(e,i):e,f=t.credentials;if(!f)try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);f=typeof location<`u`&&n.origin===location.origin?`include`:`omit`}catch{f=`omit`}let p=new AbortController,m=setTimeout(()=>p.abort(`timeout`),r),h=(async()=>{try{let r=await fetch(d,{signal:p.signal,credentials:f,headers:o});if(!r.ok){let i={ok:!1,data:null,status:r.status,url:d,fromCache:!1,reason:`http_error`};if(a>0&&T.set(c,{until:Date.now()+a,result:i}),!s){let t=`${r.status} ${r.statusText||``}`.trim();C.warnOnce(`http:${r.status}:${n}:${new URL(e,location?.href??`http://localhost/`).origin}`,`HTTP error ${t} while fetching ${n} ${e}`)}return t.onError&&t.onError(i),i}if(n===`text`)return{ok:!0,data:await r.text(),status:r.status,url:d,fromCache:!1};let i=await r.blob(),l=i.type||r.headers.get(`content-type`)||``;return n===`dataURL`?{ok:!0,data:await b(i),status:r.status,url:d,fromCache:!1,mime:l}:{ok:!0,data:i,status:r.status,url:d,fromCache:!1,mime:l}}catch(i){let o=i&&typeof i==`object`&&`name`in i&&i.name===`AbortError`?String(i.message||``).includes(`timeout`)?`timeout`:`abort`:`network`,l={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:o};if(!/^blob:/i.test(e)&&a>0&&T.set(c,{until:Date.now()+a,result:l}),!s){let t=`${o}:${n}:${new URL(e,location?.href??`http://localhost/`).origin}`,i=o===`timeout`?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:o===`abort`?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;C.errorOnce(t,i)}return t.onError&&t.onError(l),l}finally{clearTimeout(m),w.delete(c)}})();return w.set(c,h),h}var C,w,T,E=r(()=>{m(),C=h(`[snapDOM]`,{ttlMs:3*6e4,maxEntries:10}),w=new Map,T=new Map});async function D(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()===`none`)return e;let n=u(e);if(!n)return e;let r=f(p(n)),i=(t.useProxy||``)+`|`+r;if(c.background.has(i)){let e=c.background.get(i);return e?`url("${e}")`:`none`}try{let e=await S(r,{as:`dataURL`,useProxy:t.useProxy});return e.ok?(c.background.set(i,e.data),`url("${e.data}")`):(c.background.set(i,null),`none`)}catch{return c.background.set(i,null),`none`}}var O=r(()=>{l(),m(),E()});function k(e){if(e=String(e).toLowerCase(),se.has(e)){let t={};return c.defaultStyle.set(e,t),t}if(c.defaultStyle.has(e))return c.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 e of r)A(e)||(i[e]=r.getPropertyValue(e));return t.removeChild(n),c.defaultStyle.set(e,i),i}function A(e){let t=ue.get(e);if(t===void 0){let n=String(e).toLowerCase();t=P.has(n)||le.test(n)||ce.test(n),ue.set(e,t)}return t}function ee(e,t){return!pe.has(e)&&(t===`inline`||de.has(e)||fe.has(e))}function te(e,t,n=!0,r=!1){if(t=String(t||``).toLowerCase(),se.has(t))return``;let i=[],a=k(t),o=(e.display||``).toLowerCase(),s=o===`inline`,c=ee(t,o)&&n,l=!1;for(let t in e){if(A(t))continue;let n=e[t];if(c){if(me.has(t))continue;if(he.has(t)){n&&n!==a[t]&&(i.push(`${t}:${n}`),n!==`auto`&&(l=!0));continue}}n&&n!==a[t]&&i.push(`${t}:${n}`)}if(c&&!s&&!r&&!l){let t=e.width;t&&t!==`auto`&&t!==a.width&&i.push(`min-width:${t}`)}return i.sort(),i.join(`;`)}function ne(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(e=>t.add(e.tagName.toLowerCase())),Array.from(t))}function re(e){let t=new Map;for(let n of e){let e=c.defaultStyle.get(n);if(!e)continue;let r=Object.entries(e).map(([e,t])=>`${e}:${t};`).sort().join(``);r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}let n=``;for(let[e,r]of t.entries())n+=`${r.join(`,`)} { ${e} }
2
+ `;return n}function ie(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let e of t)n.set(e,`c${r++}`);return n}function ae(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 e=0;e<window.frames.length;e++)try{if(window.frames[e]?.document===t)return window.frames[e]}catch{}}catch{}return typeof window<`u`?window:null}function j(e,t=null){let n=()=>{let e={length:0,getPropertyValue:()=>``,item:()=>``};return e[Symbol.iterator]=function*(){},e};if(!(e instanceof Element)){let r=typeof window<`u`?window:null;if(r&&typeof r.getComputedStyle==`function`)try{return r.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=c.computedStyle.get(e);r||(r=new Map,c.computedStyle.set(e,r));let i=r.get(t);if(!i){let a=ae(e),o=null;try{o=a&&typeof a.getComputedStyle==`function`?a.getComputedStyle(e,t):null}catch{}if(!o&&typeof window<`u`&&typeof window.getComputedStyle==`function`)try{e.ownerDocument===document&&(o=window.getComputedStyle(e,t))}catch{}i=o||n(),r.set(t,i)}return i}function oe(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);for(let e of ge){let n=t[`border-${e}-style`];(n===`none`||n===`hidden`||t[`border-${e}-width`]===`0px`)&&(delete t[`border-${e}-style`],delete t[`border-${e}-width`],delete t[`border-${e}-color`])}return t}function M(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&n++,a===`)`&&n--,a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var N,se,ce,le,P,ue,de,fe,pe,me,he,ge,_e=r(()=>{l(),N=new Set([`meta`,`script`,`noscript`,`title`,`link`,`template`]),se=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`]),ce=/(?:^|-)(animation|transition)(?:-|$)/i,le=/^(--.+|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,P=new Set([`cursor`,`pointer-events`,`touch-action`,`user-select`,`print-color-adjust`,`speak`,`reading-flow`,`reading-order`,`anchor-name`,`anchor-scope`,`container-name`,`container-type`,`timeline-scope`,`zoom`]),ue=new Map,de=new Set([`span`,`small`,`em`,`strong`,`b`,`i`,`u`,`s`,`code`,`cite`,`mark`,`sub`,`sup`]),fe=new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`]),pe=new Set([`img`,`video`,`canvas`,`svg`,`iframe`,`embed`,`object`,`input`,`textarea`,`select`]),me=new Set([`width`,`max-width`,`inline-size`,`max-inline-size`]),he=new Set([`min-width`,`min-inline-size`]),ge=[`top`,`right`,`bottom`,`left`]});function F(e,{fast:t=!1}={}){if(t)return e();`requestIdleCallback`in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function ve(){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 I(){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),a=!/safari/i.test(e),o=r&&i&&a,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&r;return n||o||s||c||l}function ye(){if(typeof navigator>`u`)return!1;let e=(navigator.userAgent||``).toLowerCase();return e.includes(`firefox`)||e.includes(`fxios`)}var be=r(()=>{});function L(e,t,n){let r=e&&typeof e==`object`&&(e.options||e);r&&r.debug&&(n===void 0?console.warn(`[snapdom]`,t):console.warn(`[snapdom]`,t,n))}var xe=r(()=>{}),R=r(()=>{O(),_e(),be(),m(),xe()}),Se={};i(Se,{toCanvas:()=>Ne});function Ce(e){if(!we(e))return e;try{let t=Te(e),n=t.match(/<svg\b[^>]*>/i);if(!n)return e;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),a=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(a)||i<=0||a<=0)return e;let o=Math.min(1,z/i,z/a,Math.sqrt(Pe/(i*a)));if(o>=1)return e;let s=Math.max(1,Math.floor(i*o)),c=Math.max(1,Math.floor(a*o));return console.warn(`[snapDOM] Capture ${Math.round(i)}\xD7${Math.round(a)}px exceeds the browser image-decode limit (${z}px/side); downscaling to ${s}\xD7${c}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),Ee(t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${s}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`)))}catch{return e}}function we(e){return typeof e==`string`&&/^data:image\/svg\+xml/i.test(e)}function Te(e){let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``}function Ee(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function De(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`;`&&r===0?(t.push(n),n=``):n+=a}return n.trim()&&t.push(n),t.map(e=>e.trim()).filter(Boolean)}function Oe(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];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 e of t){if(/\binset\b/i.test(e))continue;let[t=`0px`,n=`0px`,r=`0px`]=e.match(/-?\d+(?:\.\d+)?px/gi)||[],a=e.replace(/-?\d+(?:\.\d+)?px/gi,``).replace(/\binset\b/gi,``).trim().replace(/\s{2,}/g,` `),o=!!a&&a!==`,`;i.push(`drop-shadow(${t} ${n} ${r}${o?` ${a}`:``})`)}return i.join(` `)}function ke(e){let t=De(e),n=null,r=null,i=null,a=[];for(let e of t){let t=e.indexOf(`:`);if(t<0)continue;let o=e.slice(0,t).trim().toLowerCase(),s=e.slice(t+1).trim();o===`box-shadow`?i=s:o===`filter`?n=s:o===`-webkit-filter`?r=s:a.push([o,s])}if(i){let e=Oe(i);e&&(n=n?`${n} ${e}`:e,r=r?`${r} ${e}`:e)}let o=[...a];return n&&o.push([`filter`,n]),r&&o.push([`-webkit-filter`,r]),o.map(([e,t])=>`${e}:${t}`).join(`;`)}function Ae(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${ke(n)}}`)}function je(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,Ae(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${ke(n)}${t}`),e}function Me(e){if(!I()||!we(e))return e;try{return Ee(je(Te(e)))}catch{return e}}async function Ne(e,t){let{width:n,height:r,scale:i=1,dpr:a=1,meta:o={},backgroundColor:s}=t;e=Me(e),e=Ce(e);let c=new Image;if(c.loading=`eager`,c.decoding=`sync`,c.crossOrigin=`anonymous`,c.src=e,await c.decode(),I()){c.style.cssText=`position:fixed;left:-99999px;top:-99999px;pointer-events:none`,document.body.appendChild(c);try{await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))}finally{try{c.remove()}catch{}}}let l=c.naturalWidth,u=c.naturalHeight,d=Number.isFinite(o.w0)?o.w0:l,f=Number.isFinite(o.h0)?o.h0:u,p,m,h=Number.isFinite(n),g=Number.isFinite(r);if(h&&g)p=Math.max(1,n),m=Math.max(1,r);else if(h){let e=n/Math.max(1,d);p=n,m=f*e}else if(g){let e=r/Math.max(1,f);m=r,p=d*e}else p=l,m=u;p*=i,m*=i;let _=p*a,v=m*a,y=Math.max(_/z,v/z,Math.sqrt(_*v/Pe));y>1&&(console.warn(`[snapDOM] Output ${Math.round(_)}\xD7${Math.round(v)}px exceeds the browser canvas limit (${z}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),p/=y,m/=y);let b=document.createElement(`canvas`);b.width=p*a,b.height=m*a,b.style.width=`${p}px`,b.style.height=`${m}px`;let x=b.getContext(`2d`);return a!==1&&x.scale(a,a),s&&(x.save(),x.fillStyle=s,x.fillRect(0,0,p,m),x.restore()),x.drawImage(c,0,0,p,m),b}var z,Pe,Fe=r(()=>{be(),z=16384,Pe=16384*16384}),Ie={};i(Ie,{rasterize:()=>Le});async function Le(e,t){let n=await Ne(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 Re=r(()=>{Fe()}),ze={};i(ze,{toImg:()=>Be,toSvg:()=>Be});async function Be(e,t){let{scale:n=1,width:r,height:i,meta:a={}}=t,o=Number.isFinite(r),s=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||o||s;if(I()&&c)return await Le(e,{...t,format:`png`,quality:1,meta:a});let l=new Image;if(l.decoding=`sync`,l.loading=`eager`,l.src=e,await l.decode(),o&&s)l.style.width=`${r}px`,l.style.height=`${i}px`;else if(o){let e=Number.isFinite(a.w0)?a.w0:l.naturalWidth,t=Number.isFinite(a.h0)?a.h0:l.naturalHeight,n=r/Math.max(1,e);l.style.width=`${r}px`,l.style.height=`${Math.round(t*n)}px`}else if(s){let e=Number.isFinite(a.w0)?a.w0:l.naturalWidth,t=Number.isFinite(a.h0)?a.h0:l.naturalHeight,n=i/Math.max(1,t);l.style.height=`${i}px`,l.style.width=`${Math.round(e*n)}px`}else{let r=Math.round(l.naturalWidth*n),i=Math.round(l.naturalHeight*n);if(l.style.width=`${r}px`,l.style.height=`${i}px`,typeof e==`string`&&e.startsWith(`data:image/svg+xml`))try{let t=decodeURIComponent(e.split(`,`)[1]).replace(/width="[^"]*"/,`width="${r}"`).replace(/height="[^"]*"/,`height="${i}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,l.src=e}catch(e){L(t,`SVG width/height patch in toImg failed`,e)}}return l}var Ve=r(()=>{R(),Re()}),He={};i(He,{toBlob:()=>Ue});async function Ue(e,t){let n=t.type;if(n===`svg`){let t=decodeURIComponent(e.split(`,`)[1]);return new Blob([t],{type:`image/svg+xml`})}let r=await Ne(e,t);return new Promise(e=>r.toBlob(t=>e(t),`image/${n}`,t.quality))}var We=r(()=>{Fe()}),Ge={};i(Ge,{download:()=>qe});async function Ke(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(e){if(e.name!==`AbortError`)return!1}return!0}async function qe(e,t){let n=new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]),r=(t?.type||``).toLowerCase(),i=n.has(r)?r:``,a=(t?.format||i||``).toLowerCase(),o=a===`jpg`?`jpeg`:a||`png`,s=t?.filename||`snapdom.${o}`,c={...t||{},format:o,type:o};c.dpr=1;let l=ve();if(o===`svg`){let t=await Ue(e,{...c,type:`svg`});if(l&&await Ke(t,s))return;let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=s,document.body.appendChild(r),r.click(),URL.revokeObjectURL(n),r.remove();return}let u=await Ne(e,c);if(l){let e=`image/${o}`,n=await new Promise(n=>u.toBlob(n,e,t?.quality));if(n&&await Ke(n,s))return}let d=document.createElement(`a`);d.href=u.toDataURL(`image/${o}`,t?.quality),d.download=s,document.body.appendChild(d),d.click(),d.remove()}var Je=r(()=>{We(),Fe(),be()});R(),R(),l();var Ye=new WeakMap,Xe=new Map,Ze=2e3,Qe=0;function $e(){Qe++,Xe.size>Ze&&Xe.clear()}var et=!1;function tt(e=document.documentElement){if(!et){et=!0;try{new MutationObserver(()=>$e()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>$e()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.(`loadingdone`,$e),e.ready?.then(()=>$e()).catch(()=>{}))}catch{}}}function nt(e,t={}){let n={},r=e.getPropertyValue(`visibility`),i=t.excludeStyleProps;for(let t=0;t<e.length;t++){let r=e[t];if(A(r)||i&&(i instanceof RegExp&&i.test(r)||typeof i==`function`&&i(r)))continue;let a=e.getPropertyValue(r);(r===`background-image`||r===`content`)&&a.includes(`url(`)&&!a.includes(`data:`)&&(a=`none`),n[r]=a}for(let t of[`text-decoration-line`,`text-decoration-color`,`text-decoration-style`,`text-decoration-thickness`,`text-underline-offset`,`text-decoration-skip-ink`])if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}for(let t of[`-webkit-text-stroke`,`-webkit-text-stroke-width`,`-webkit-text-stroke-color`,`paint-order`])if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}if(t.embedFonts){for(let t of[`font-feature-settings`,`font-variation-settings`,`font-kerning`,`font-variant`,`font-variant-ligatures`,`font-optical-sizing`])if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}}r===`hidden`&&(n.opacity=`0`);try{(n[`content-visibility`]||e.getPropertyValue(`content-visibility`))===`hidden`&&(n.visibility=`hidden`)}catch{}let a=parseFloat(e.getPropertyValue(`border-top-width`)||0)||0,o=parseFloat(e.getPropertyValue(`border-right-width`)||0)||0,s=parseFloat(e.getPropertyValue(`border-bottom-width`)||0)||0,c=parseFloat(e.getPropertyValue(`border-left-width`)||0)||0;if(a===0&&o===0&&s===0&&c===0){let t=(e.getPropertyValue(`border-image-source`)||``).trim(),r=t&&t!==`none`;for(let e of`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`.split(`.`))delete n[e];r||(n.border=`none`)}return n}function rt(e){if(e.firstElementChild)return!0;for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===3&&/\S/.test(t.nodeValue||``))return!0;return!1}var it=new WeakMap;function at(e){let t=it.get(e);return t||(t=Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])).map(([e,t])=>`${e}:${t}`).join(`;`),it.set(e,t),t)}function ot(e,t=null,n={}){let r=Ye.get(e),i=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(r&&r.epoch===Qe&&r.embedFonts===i&&r.excludeStyleProps===a)return r.snapshot;let o=t||getComputedStyle(e),s=nt(o,n);return pt(e,o,s),Ye.set(e,{epoch:Qe,snapshot:s,embedFonts:i,excludeStyleProps:a}),s}function st(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Xe,defaultStyle:c.defaultStyle,baseStyle:c.baseStyle,image:c.image,resource:c.resource,background:c.background,font:c.font},options:t||{}}:{session:c.session,persist:{snapshotKeyCache:Xe,defaultStyle:c.defaultStyle,baseStyle:c.baseStyle,image:c.image,resource:c.resource,background:c.background,font:c.font},options:e||t||{}}}function ct(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let i=e.style[r],a=n.getPropertyValue(i);a&&t.style.setProperty(i,a)}}async function B(e,t,n,r){if(e.tagName===`STYLE`)return;let i=st(n,r),a=i.options&&i.options.cache||`auto`;a!==`disabled`&&tt(document.documentElement),a===`disabled`&&!i.session.__bumpedForDisabled&&($e(),Xe.clear(),i.session.__bumpedForDisabled=!0);let{session:o,persist:s}=i;if(!o.styleCache.has(e)){let t=null;try{t=getComputedStyle(e)}catch{}o.styleCache.set(e,t||getComputedStyle(document.documentElement))}let c=o.styleCache.get(e);e.getAttribute?.(`style`)&&ct(e,t,c);let l=ot(e,c,i.options),u=dt(e);if(u){let e=c.getPropertyValue(`min-width`);(!e||e===`auto`||e===`0px`)&&(l[`min-width`]=`0px`)}let d=e.tagName?.toLowerCase()||`div`,f=at(l),p=!0;ee(d,(l.display||``).toLowerCase())&&(p=rt(e),f=`${f}|${d}${p?`|c`:``}${u?`|f`:``}`);let m=s.snapshotKeyCache.get(f);m===void 0&&(m=te(l,d,p,u),s.snapshotKeyCache.set(f,m)),o.styleMap.set(t,m)}function lt(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function ut(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 dt(e){let t=e.parentElement;if(!t)return!1;let n=j(t).display||``;return n.includes(`flex`)||n.includes(`grid`)}function ft(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;return i!==0&&i>(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function pt(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 a=t.display||``;if(a.includes(`flex`)||a.includes(`grid`)||lt(e))return;let o=t.position;if(o===`absolute`||o===`fixed`||o===`sticky`||t.transform!==`none`||ut(t)||dt(e))return;let s=t.overflowX||t.overflow||`visible`,c=t.overflowY||t.overflow||`visible`;if(s!==`visible`||c!==`visible`)return;let l=t.clip;l&&l!==`auto`&&l!==`rect(auto, auto, auto, auto)`||t.visibility===`hidden`||t.opacity===`0`||ft(e,t)&&(delete n.height,delete n[`block-size`])}_e();var mt=[`fill`,`stroke`,`color`,`background-color`,`stop-color`],ht=new Set([`symbol`,`defs`,`pattern`,`mask`,`clipPath`,`marker`,`linearGradient`,`radialGradient`,`filter`]);function gt(e){let t=e;for(;t&&t.nodeType===1;){if(t.namespaceURI===`http://www.w3.org/2000/svg`&&ht.has(t.localName))return!0;t=t.parentNode}return!1}var _t=new Map;function vt(e,t){let n=t+`::`+e.toLowerCase(),r=_t.get(n);if(r)return r;let i=document,a=t===`http://www.w3.org/2000/svg`?i.createElementNS(t,e):i.createElement(e),o=i.createElement(`div`);o.style.cssText=`position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;`,o.appendChild(a),i.documentElement.appendChild(o);let s=getComputedStyle(a),c={};for(let e of mt)c[e]=s.getPropertyValue(e)||``;return o.remove(),_t.set(n,c),c}function yt(e,t){if(!(e instanceof Element)||!(t instanceof Element)||gt(e))return;let n=e.getAttribute?.(`style`),r=!!(n&&n.includes(`var(`));if(!r&&e.attributes?.length){let t=e.attributes;for(let e=0;e<t.length;e++){let n=t[e];if(n&&typeof n.value==`string`&&n.value.includes(`var(`)){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let n=e.style;if(n&&n.length){let e=new Set;for(let r=0;r<n.length;r++){let a=n[r];if(e.has(a))continue;e.add(a);let o=n.getPropertyValue(a);if(!o||!o.includes(`var(`))continue;let s=i&&i.getPropertyValue(a);if(s)try{t.style.setProperty(a,s.trim(),n.getPropertyPriority(a))}catch{}}}}if(r&&e.attributes?.length){let n=e.attributes;for(let e=0;e<n.length;e++){let r=n[e];if(!r||typeof r.value!=`string`||!r.value.includes(`var(`))continue;let a=r.name,o=i&&i.getPropertyValue(a);if(o)try{t.style.setProperty(a,o.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let n=e.namespaceURI||`html`,r=vt(e.tagName,n);for(let e of mt){let n=i.getPropertyValue(e)||``,a=r[e]||``;if(n&&n!==a)try{t.style.setProperty(e,n.trim())}catch{}}}}R(),R(),l(),E();function bt(e,t,n){return Promise.all(e.map(e=>new Promise(r=>{function i(){F(n=>{!(n&&typeof n.timeRemaining==`function`)||n.timeRemaining()>0?t(e,r):i()},{fast:n})}i()})))}function xt(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function St(e,t,n=!0){return e.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>e.startsWith(`:where(`)||e.startsWith(`@`)?e:`:where(${t} ${n?xt(e):e})`).join(`, `)}function Ct(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(e,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(e,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(e,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(e,n,r,i)=>`${n}${r}${St(i,t,!0)}{`),e):``}function wt(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Tt(e){let t=``;try{e.querySelectorAll(`style`).forEach(e=>{t+=(e.textContent||``)+`
3
+ `});let n=e.adoptedStyleSheets||[];for(let e of n)try{if(e&&e.cssRules)for(let n of e.cssRules)t+=n.cssText+`
4
+ `}catch{}}catch{}return t}function Et(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 Dt(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 Ot(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 kt(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let e=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(e)return e}catch{}return``}function At(e,t,n){let r=[];for(let n of t){let t=kt(e,n);t&&r.push(`${n}: ${t};`)}return r.length?`${n}{${r.join(``)}}
5
+ `:``}function jt(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute(`data-sd-slotted`,``),e.querySelectorAll&&e.querySelectorAll(`*`).forEach(e=>e.setAttribute(`data-sd-slotted`,``)))}async function Mt(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(e=>setTimeout(e,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Nt(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,a=0;try{let t=getComputedStyle(e);n=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,a=parseFloat(t.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(t.width-(n+r))),contentHeight:Math.max(0,Math.round(t.height-(i+a))),rect:t}}function V(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 e=parseFloat(r.width);!isNaN(e)&&e>0&&(t=e)}if(n===0){let e=parseFloat(r.height);!isNaN(e)&&e>0&&(n=e)}}catch{}if(t===0||n===0)try{if(t===0){let n=parseFloat(e.getAttribute(`width`));!isNaN(n)&&n>0&&(t=n)}if(n===0){let t=parseFloat(e.getAttribute(`height`));!isNaN(t)&&t>0&&(n=t)}}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 Pt(e,t,n){let r=e.defaultView,i=r?r.scrollX:0,a=r?r.scrollY:0,o=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,c=e.documentElement?e.documentElement.scrollLeft:0,l=e.documentElement?e.documentElement.scrollTop:0,u=0,d=0,f=0,p=0;try{let t=r&&e.body?r.getComputedStyle(e.body):null;t&&(u=(parseFloat(t.marginTop)||0)+(parseFloat(t.paddingTop)||0),d=(parseFloat(t.marginRight)||0)+(parseFloat(t.paddingRight)||0),f=(parseFloat(t.marginBottom)||0)+(parseFloat(t.paddingBottom)||0),p=(parseFloat(t.marginLeft)||0)+(parseFloat(t.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute(`data-sd-pinned`,``)}catch{}let m=e.createElement(`style`);return m.setAttribute(`data-sd-iframe-pin`,``),m.textContent=`html {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;}body {margin: 0 !important;padding: ${u}px ${d}px ${f}px ${p}px !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(m),()=>{try{m.remove()}catch{}try{e.documentElement.removeAttribute(`data-sd-pinned`)}catch{}try{r&&typeof r.scrollTo==`function`&&r.scrollTo(i,a),e.body&&(e.body.scrollLeft=o,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=c,e.documentElement.scrollTop=l)}catch{}}}async function Ft(e,t,n){let r=await Mt(e,3);if(!r)throw Error(`iframe document not accessible/ready`);let{contentWidth:i,contentHeight:a,rect:o}=Nt(e),s=n?.snap;if(!s&&typeof window<`u`&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!=`function`)throw 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},u=Pt(r,i,a),d=c.session.nodeMap,f=c.session.styleMap,p=c.session.styleCache,m;try{m=await s.toPng(r.documentElement,l)}finally{u(),c.session.nodeMap=d,c.session.styleMap=f,c.session.styleCache=p}m.style.display=`block`,m.style.width=`${i}px`,m.style.height=`${a}px`;let h=document.createElement(`div`);return t.nodeMap.set(h,e),B(e,h,t,n),h.style.overflow=`hidden`,h.style.display=`block`,h.style.width||(h.style.width=`${Math.round(o.width)}px`),h.style.height||(h.style.height=`${Math.round(o.height)}px`),h.appendChild(m),h}function It(e){let{width:t,height:n}=V(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,s||16),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,c||16),d=(e.type||`text`).toLowerCase()===`checkbox`,f=!!e.checked,p=!!e.indeterminate,m=Math.max(Math.min(l,u),12),h=`middle`;try{i&&i.verticalAlign&&(h=i.verticalAlign)}catch{}let g=document.createElement(`div`);g.setAttribute(`data-snapdom-input-replacement`,e.type||`checkbox`),g.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${h};flex-shrink:0;line-height:0;`;let _=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);_.setAttribute(`width`,String(m)),_.setAttribute(`height`,String(m)),_.setAttribute(`viewBox`,`0 0 ${m} ${m}`),g.appendChild(_);function v(){let e=`#0a6ed1`;try{i&&(e=i.accentColor||i.color||e)}catch{}let t=m-2;if(_.innerHTML=``,d){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);if(n.setAttribute(`x`,`1`),n.setAttribute(`y`,`1`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`rx`,`2`),n.setAttribute(`ry`,`2`),n.setAttribute(`fill`,f?e:`none`),n.setAttribute(`stroke`,e),n.setAttribute(`stroke-width`,`2`),_.appendChild(n),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);e.setAttribute(`d`,`M 3 ${m/2} L ${m/2-1} ${m-1-2} L ${m-1-2} 3`),e.setAttribute(`stroke`,`white`),e.setAttribute(`stroke-width`,`2`),e.setAttribute(`fill`,`none`),e.setAttribute(`stroke-linecap`,`round`),e.setAttribute(`stroke-linejoin`,`round`),_.appendChild(e)}else if(p){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),r=Math.max(6,t-4);n.setAttribute(`x`,String((m-r)/2)),n.setAttribute(`y`,String((m-2)/2)),n.setAttribute(`width`,String(r)),n.setAttribute(`height`,`2`),n.setAttribute(`fill`,e),n.setAttribute(`rx`,`1`),_.appendChild(n)}}else{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);if(t.setAttribute(`cx`,String(m/2)),t.setAttribute(`cy`,String(m/2)),t.setAttribute(`r`,String((m-2)/2)),t.setAttribute(`fill`,f?e:`none`),t.setAttribute(`stroke`,e),t.setAttribute(`stroke-width`,`2`),_.appendChild(t),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),t=Math.max(2,(m-4)*.35);e.setAttribute(`cx`,String(m/2)),e.setAttribute(`cy`,String(m/2)),e.setAttribute(`r`,String(t)),e.setAttribute(`fill`,`white`),_.appendChild(e)}}g.style.setProperty(`width`,`${m}px`,`important`),g.style.setProperty(`height`,`${m}px`,`important`),g.style.setProperty(`min-width`,`${m}px`,`important`),g.style.setProperty(`min-height`,`${m}px`,`important`)}return v(),{el:g,applyVisual:v}}var Lt=new s(80);async function Rt(e){if(c.resource?.has(e))return c.resource.get(e);if(Lt.has(e))return Lt.get(e);let t=(async()=>{let t=await S(e,{as:`dataURL`,silent:!0});if(!t.ok||typeof t.data!=`string`)throw Error(`[snapDOM] Failed to read blob URL: ${e}`);return c.resource?.set(e,t.data),t.data})();Lt.set(e,t);try{let n=await t;return Lt.set(e,n),n}catch(t){throw Lt.delete(e),t}}var zt=/\bblob:[^)"'\s]+/g;async function Bt(e){if(!e||e.indexOf(`blob:`)===-1)return e;let t=Array.from(new Set(e.match(zt)||[]));if(t.length===0)return e;let n=e;for(let e of t)try{let t=await Rt(e);n=n.split(e).join(t)}catch{}return n}function Vt(e){return typeof e==`string`&&e.startsWith(`blob:`)}function Ht(e){return(e||``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.match(/^(\S+)(\s+.+)?$/);return t?{url:t[1],desc:t[2]||``}:null}).filter(Boolean)}function Ut(e){return e.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(`, `)}async function Wt(e,t=null){if(!e)return;let n=t,r=e.querySelectorAll?e.querySelectorAll(`img`):[];for(let e of r)try{let t=e.getAttribute(`src`)||e.currentSrc||``;if(Vt(t)){let n=await Rt(t);e.setAttribute(`src`,n)}let r=e.getAttribute(`srcset`);if(r&&r.includes(`blob:`)){let t=Ht(r),i=!1;for(let e of t)if(Vt(e.url))try{e.url=await Rt(e.url),i=!0}catch(e){L(n,`blobUrlToDataUrl for srcset item failed`,e)}i&&e.setAttribute(`srcset`,Ut(t))}}catch(e){L(n,`resolveBlobUrls for img failed`,e)}let i=e.querySelectorAll?e.querySelectorAll(`image`):[];for(let e of i)try{let t=`http://www.w3.org/1999/xlink`,n=e.getAttribute(`href`)||e.getAttributeNS?.(t,`href`);if(Vt(n)){let r=await Rt(n);e.setAttribute(`href`,r),e.removeAttributeNS?.(t,`href`)}}catch(e){L(n,`resolveBlobUrls for SVG image href failed`,e)}let a=e.querySelectorAll?e.querySelectorAll(`[style*='blob:']`):[];for(let e of a)try{let t=e.getAttribute(`style`);if(t&&t.includes(`blob:`)){let n=await Bt(t);e.setAttribute(`style`,n)}}catch(e){L(n,`replaceBlobUrls in inline style failed`,e)}let o=e.querySelectorAll?e.querySelectorAll(`style`):[];for(let e of o)try{let t=e.textContent||``;t.includes(`blob:`)&&(e.textContent=await Bt(t))}catch(e){L(n,`replaceBlobUrls in style tag failed`,e)}for(let t of[`poster`]){let r=e.querySelectorAll?e.querySelectorAll(`[${t}^='blob:']`):[];for(let e of r)try{let n=e.getAttribute(t);Vt(n)&&e.setAttribute(t,await Rt(n))}catch(e){L(n,`resolveBlobUrls for ${t} failed`,e)}}}be();function Gt(e){let{width:t,height:n}=V(e),r=t,i=n;if(!r||!i){let t=e.getBoundingClientRect();r=r||t.width||0,i=i||t.height||0}let a=document.createElement(`div`);return a.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,a}async function Kt(e,t,n){if(!e)throw Error(`Invalid node`);let r=new Set,i=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let n=(e.localName||e.tagName||``).toLowerCase();if(e.id===`snapdom-sandbox`||e.hasAttribute(`data-snapdom-sandbox`)||N.has(n))return null;if(n===`foreignobject`&&e.parentElement?.closest?.(`foreignObject`))return L(t,`Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)`),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`)return Gt(e);if(n.excludeMode===`remove`)return null}if(n.exclude&&Array.isArray(n.exclude))for(let t of n.exclude)try{if(e.matches?.(t)){if(n.excludeMode===`hide`)return Gt(e);if(n.excludeMode===`remove`)return null}}catch(e){console.warn(`Invalid selector in exclude option: ${t}`,e)}if(typeof n.filter==`function`)try{if(!n.filter(e)){if(n.filterMode===`hide`)return Gt(e);if(n.filterMode===`remove`)return null}}catch(e){console.warn(`Error in filter function:`,e)}if(e.tagName===`IFRAME`){let r=!1;try{r=!!(e.contentDocument||e.contentWindow?.document)}catch(e){L(t,`iframe same-origin probe failed`,e)}if(r)try{return await Ft(e,t,n)}catch(e){console.warn(`[SnapDOM] iframe rasterization failed, fallback:`,e)}if(r||console.warn(`[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.`,e),n.placeholders){let{width:r,height:i}=V(e),a=document.createElement(`div`);return a.style.cssText=`width:${r}px;height:${i}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;`,B(e,a,t,n),a}else{let{width:r,height:i}=V(e),a=document.createElement(`div`);return a.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,B(e,a,t,n),a}}if(e.getAttribute(`data-capture`)===`placeholder`){let r=e.cloneNode(!1);t.nodeMap.set(r,e),B(e,r,t,n);let i=document.createElement(`div`);return i.textContent=e.getAttribute(`data-placeholder-text`)||``,i.style.cssText=`color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;`,r.appendChild(i),r}if(e.tagName===`CANVAS`){let r=``;try{let t=e.getContext(`2d`,{willReadFrequently:!0});try{t&&t.getImageData(0,0,1,1)}catch{}if(await new Promise(e=>requestAnimationFrame(e)),r=e.toDataURL(`image/png`),!r||r===`data:,`){try{t&&t.getImageData(0,0,1,1)}catch{}if(await new Promise(e=>requestAnimationFrame(e)),r=e.toDataURL(`image/png`),!r||r===`data:,`){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0),r=t.toDataURL(`image/png`))}}}catch(e){L(t,`Canvas toDataURL failed, using empty/fallback`,e)}let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch(e){L(t,`img decoding/loading hints failed`,e)}r&&(i.src=r),i.width=e.width,i.height=e.height;let{width:a,height:o}=V(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),B(e,i,t,n),i}if(e.tagName===`VIDEO`){let r=``;try{let t=document.createElement(`canvas`);t.width=e.videoWidth||e.offsetWidth||320,t.height=e.videoHeight||e.offsetHeight||240;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0,t.width,t.height),r=t.toDataURL(`image/png`),(!r||r===`data:,`)&&(r=``))}catch(e){L(t,`Video frame capture failed, using poster fallback`,e)}let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch{}r?i.src=r:e.poster&&(i.src=e.poster),i.width=e.videoWidth||e.offsetWidth||0,i.height=e.videoHeight||e.offsetHeight||0;let{width:a,height:o}=V(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),i.style.objectFit=`contain`,t.nodeMap.set(i,e),B(e,i,t,n),i}if(e.tagName===`AUDIO`&&e.controls){let{width:r,height:i}=V(e),a=Math.round(r||e.offsetWidth||300),o=Math.round(i||e.offsetHeight||54),s=o/2,c=Math.max(4,o*.16),l=o*.34,u=a-o*.34,d=l+c+o*.55,f=Math.max(0,u-o*.7-d),p=Math.max(9,Math.round(o*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}" viewBox="0 0 ${a} ${o}"><rect width="${a}" height="${o}" rx="${Math.min(o/2,10)}" fill="#f1f3f4"/><path d="M ${l} ${s-c} L ${l+c} ${s} L ${l} ${s+c} Z" fill="#5f6368"/><rect x="${d}" y="${s-1.5}" width="${f}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${s}" r="${Math.max(3,o*.09)}" fill="#5f6368"/><text x="${u}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${p}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,h=document.createElement(`img`);try{h.decoding=`sync`,h.loading=`eager`}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,h.width=a,h.height=o,h.style.width=`${a}px`,h.style.height=`${o}px`,t.nodeMap.set(h,e),B(e,h,t,n),h}let o;try{if(o=e.cloneNode(!1),o.attributes?.length)try{for(let e of o.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(e.value)&&o.setAttribute(e.name,e.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,``))}catch{}if(yt(e,o),t.nodeMap.set(o,e),e.tagName===`IMG`){Dt(e,o);try{let{width:t,height:n}=V(e),r=Math.round(t||0),i=Math.round(n||0);r&&(o.dataset.snapdomWidth=String(r)),i&&(o.dataset.snapdomHeight=String(i))}catch(e){L(t,`getUnscaledDimensions for IMG failed`,e)}try{let t=e.getAttribute(`style`)||``,n=window.getComputedStyle(e),r=e=>{let r=t.match(RegExp(`${e}\\s*:\\s*([^;]+)`,`i`)),i=r?r[1].trim():n.getPropertyValue(e);return/%|auto/i.test(String(i||``))},i=parseInt(o.dataset.snapdomWidth||`0`,10),a=parseInt(o.dataset.snapdomHeight||`0`,10),s=r(`width`)||!i,c=r(`height`)||!a;s&&i&&(o.style.width=`${i}px`),c&&a&&(o.style.height=`${a}px`);let l=n.getPropertyValue(`object-fit`),u=n.getPropertyValue(`object-position`);l&&l!==`fill`?(o.style.objectFit=l,u&&(o.style.objectPosition=u)):(i&&(o.style.minWidth=`${i}px`),a&&(o.style.minHeight=`${a}px`))}catch(e){L(t,`IMG dimension freeze failed`,e)}}}catch(t){throw console.error(`[Snapdom] Failed to clone node:`,e,t),t}let s=null;if(e instanceof HTMLTextAreaElement){let{width:t,height:n}=V(e),r=t||e.getBoundingClientRect().width||0,i=n||e.getBoundingClientRect().height||0;r&&(o.style.width=`${r}px`),i&&(o.style.height=`${i}px`)}if(e instanceof HTMLInputElement){let n=(e.type||`text`).toLowerCase();if((n===`checkbox`||n===`radio`)&&ye()){let{el:n,applyVisual:r}=It(e);t.nodeMap.set(n,e),s=r,o=n}else o.value=e.value,o.setAttribute(`value`,e.value),e.checked!==void 0&&(o.checked=e.checked,e.checked&&o.setAttribute(`checked`,``),e.indeterminate&&(o.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let t=window.getComputedStyle(e,`::placeholder`),n=t&&t.color;if(n&&n!==`rgba(0, 0, 0, 0)`){let e=`snapdom-ph-`+(Math.random()*1e6|0);o.classList.add(e);let r=document.createElement(`style`);r.textContent=`.${e}::placeholder{color:${n}!important;opacity:${t.opacity||`1`}!important;-webkit-text-fill-color:${n}!important;}`,o.prepend(r)}}catch{}if(e instanceof HTMLSelectElement&&(i=e.value),e instanceof HTMLTextAreaElement&&(a=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&o.setAttribute(`disabled`,``),e.required&&o.setAttribute(`required`,``),e.readOnly&&o.setAttribute(`readonly`,``);let t=e;t.min!==void 0&&t.min!==``&&o.setAttribute(`min`,t.min),t.max!==void 0&&t.max!==``&&o.setAttribute(`max`,t.max),t.pattern!==void 0&&t.pattern!==``&&o.setAttribute(`pattern`,t.pattern);let n=e.getAttribute(`aria-invalid`);n!==null&&o.setAttribute(`aria-invalid`,n)}if(gt(e)||B(e,o,t,n),s&&s(),e instanceof SVGElement&&!gt(e)){let t=[`fill`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-miterlimit`,`opacity`,`fill-opacity`,`stroke-opacity`,`fill-rule`,`clip-rule`,`marker`,`marker-start`,`marker-mid`,`marker-end`,`visibility`,`display`];try{let n=window.getComputedStyle(e);for(let e of t){let t=n.getPropertyValue(e);t&&o.style.setProperty(e,t)}}catch{}}if(e.shadowRoot){let i=function(e,r){if(e.nodeType===Node.ELEMENT_NODE&&e.tagName===`STYLE`)return r(null);Kt(e,t,n).then(e=>{r(e||null)}).catch(()=>{r(null)})};try{let t=e.shadowRoot.querySelectorAll(`slot`);for(let e of t){let t=[];try{t=e.assignedNodes?.({flatten:!0})||e.assignedNodes?.()||[]}catch{t=e.assignedNodes?.()||[]}for(let e of t)r.add(e)}}catch{}let a=wt(t),s=`[data-sd="${a}"]`;try{o.setAttribute(`data-sd`,a)}catch{}let c=Tt(e.shadowRoot),l=Ct(c,s),u=At(e,Ot(c),s);Et(o,u+l,a);let d=document.createDocumentFragment(),f=await bt(Array.from(e.shadowRoot.childNodes),i,n.fast);d.append(...f.filter(e=>!!e)),o.appendChild(d)}if(e.tagName===`SLOT`){let r=function(e,r){Kt(e,t,n).then(e=>{e&&jt(e),r(e||null)}).catch(()=>{r(null)})},i=e.assignedNodes?.({flatten:!0})||[],a=i.length>0?i:Array.from(e.childNodes),o=document.createDocumentFragment(),s=await bt(Array.from(a),r,n.fast);return o.append(...s.filter(e=>!!e)),o}function c(e,i){if(r.has(e))return i(null);Kt(e,t,n).then(e=>{i(e||null)}).catch(()=>{i(null)})}let l=await bt(Array.from(e.childNodes),c,n.fast);if(o.append(...l.filter(e=>!!e)),i!==null&&o instanceof HTMLSelectElement){o.value=i;for(let e of o.options)e.value===i?e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}return a!==null&&o instanceof HTMLTextAreaElement&&(o.textContent=a),o}R(),m(),l(),l();var qt=[/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],H=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__||{}),Jt=[];function Yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Xt(e){let t=Array.isArray(e)?e:[e];for(let e of t)e instanceof RegExp?Jt.push(e):typeof e==`string`?Jt.push(new RegExp(Yt(e),`i`)):console.warn(`[snapdom] Ignored invalid iconFont value:`,e)}function U(e){let t=typeof e==`string`?e:``,n=[...qt,...Jt];for(let e of n)if(e instanceof RegExp&&e.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 Zt(e=``){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var Qt=new Map;function $t(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 en(e,t,n){let r=String(e||``),i=r.toLowerCase(),a=String(t||``).toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i)||!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let o=n&&(n.FILL??n.fill),s=`outlined`;/\brounded\b/.test(a)||/\bround\b/.test(a)?s=`rounded`:/\bsharp\b/.test(a)?s=`sharp`:/\boutlined\b/.test(a)&&(s=`outlined`);let c=o===1,l=null;if(c&&(s===`outlined`&&H.materialIconsFilled?l={url:H.materialIconsFilled,alias:`snapdom-mi-filled`}:s===`rounded`&&H.materialIconsRound?l={url:H.materialIconsRound,alias:`snapdom-mi-round`}:s===`sharp`&&H.materialIconsSharp&&(l={url:H.materialIconsSharp,alias:`snapdom-mi-sharp`})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Qt.has(l.alias))try{let e=new FontFace(l.alias,`url(${l.url})`,{style:`normal`,weight:`400`});document.fonts.add(e),await e.load(),Qt.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function tn(e=`Material Icons`,t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,``)}"`),document.fonts.ready])}catch{}}function nn(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 rn(e,{family:t=`Material Icons`,weight:n=`normal`,fontSize:r=32,color:i=`#000`,variation:a=``,className:o=``}={}){let s=String(t||``).replace(/^['"]+|['"]+$/g,``),c=window.devicePixelRatio||1,{familyForMeasure:l,familyForCanvas:u}=await en(s,o,$t(a));await tn(u.replace(/^["']+|["']+$/g,``),r);let d=document.createElement(`span`);d.textContent=e,d.style.position=`absolute`,d.style.visibility=`hidden`,d.style.left=`-99999px`,d.style.whiteSpace=`nowrap`,d.style.fontFamily=l,d.style.fontWeight=String(n||`normal`),d.style.fontSize=`${r}px`,d.style.lineHeight=`1`,d.style.margin=`0`,d.style.padding=`0`,d.style.fontFeatureSettings=`'liga' 1`,d.style.fontVariantLigatures=`normal`,d.style.color=i,document.body.appendChild(d);let f=d.getBoundingClientRect(),p=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(d);let h=document.createElement(`canvas`);h.width=p*c,h.height=m*c;let g=h.getContext(`2d`);g.scale(c,c),g.font=`${n?`${n} `:``}${r}px ${u}`,g.textAlign=`left`,g.textBaseline=`top`,g.fillStyle=i;try{g.fontKerning=`normal`}catch{}return g.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:m}}async function an(e,t){if(!(e instanceof Element))return 0;let n=`.material-icons, [class*="material-symbols"]`,r=Array.from(e.querySelectorAll(n)).filter(e=>e&&e.textContent&&e.textContent.trim());if(r.length===0)return 0;let i=c.session.nodeMap,a=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(e=>e&&e.textContent&&e.textContent.trim()):[],o=0;for(let e=0;e<r.length;e++){let t=r[e],n=i&&i.get(t)||a[e]||null;try{let e=getComputedStyle(n||t),r=e.fontFamily||`Material Icons`;if(!Zt(r))continue;let i=(n||t).textContent.trim();if(!i)continue;let a=parseInt(e.fontSize,10)||24,{dataUrl:s,width:c,height:l}=await rn(i,{family:r,weight:e.fontWeight&&e.fontWeight!==`normal`?e.fontWeight:`normal`,fontSize:a,color:nn(e),variation:e.fontVariationSettings&&e.fontVariationSettings!==`normal`?e.fontVariationSettings:``,className:(n||t).className||``});t.textContent=``;let u=t.ownerDocument.createElement(`img`);u.src=s,u.alt=i,u.style.height=`${a}px`,u.style.width=`${Math.max(1,Math.round(c/l*a))}px`,u.style.objectFit=`contain`,u.style.verticalAlign=getComputedStyle(t).verticalAlign||`baseline`,t.appendChild(u),o++}catch{}}return o}E();async function on(e,t,n,r=32,i=`#000`){t=t.replace(/^['"]+|['"]+$/g,``);let a=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let o=document.createElement(`span`);o.textContent=e,o.style.position=`absolute`,o.style.visibility=`hidden`,o.style.fontFamily=`"${t}"`,o.style.fontWeight=n||`normal`,o.style.fontSize=`${r}px`,o.style.lineHeight=`1`,o.style.whiteSpace=`nowrap`,o.style.padding=`0`,o.style.margin=`0`,document.body.appendChild(o);let s=o.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(o);let u=document.createElement(`canvas`);u.width=Math.max(1,c*a),u.height=Math.max(1,l*a);let d=u.getContext(`2d`);return d.scale(a,a),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:c,height:l}}var sn=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`emoji`,`math`,`fangsong`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`]),cn=[`katex`,`mathjax`,`mathml`];function ln(e){if(!e)return``;for(let t of e.split(`,`)){let e=t.trim().replace(/^['"]+|['"]+$/g,``);if(e&&!sn.has(e.toLowerCase()))return e}return``}function un(e){if(!e)return[];let t=[];for(let n of e.split(`,`)){let e=n.trim().replace(/^['"]+|['"]+$/g,``);e&&(sn.has(e.toLowerCase())||t.push(e))}return t}function dn(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 fn(e){let t=String(e??`normal`).trim().toLowerCase();return t.startsWith(`italic`)?`italic`:t.startsWith(`oblique`)?`oblique`:`normal`}function pn(e){let t=String(e??`100%`).match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function mn(e){let t=String(e||`400`).trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let e=dn(n[1]),t=dn(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=dn(t);return{min:r,max:r}}function hn(e){let t=String(e||`normal`).trim().toLowerCase();return t===`italic`?{kind:`italic`}:t.startsWith(`oblique`)?{kind:`oblique`}:{kind:`normal`}}function gn(e){let t=String(e||`100%`).trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function _n(e){return!e||typeof e!=`string`?``:e.replace(/\s+(variable|vf|v[0-9]+)$/i,``).trim().toLowerCase().replace(/\s+/g,`-`)}function vn(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(e=>i.endsWith(e))||n.some(e=>i===e.toLowerCase()||i.endsWith(`.`+e.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||cn.some(e=>a.includes(e)))return!0;for(let e of t){let t=e.toLowerCase().replace(/\s+/g,`+`),n=e.toLowerCase().replace(/\s+/g,`-`),r=_n(e);if(a.includes(t)||a.includes(n)||r&&a.includes(r))return!0}return!1}catch{return!1}}function yn(e){let t=new Set;for(let n of e||[]){let e=String(n).split(`__`)[0]?.trim();e&&t.add(e)}return t}function bn(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(e,n,r)=>{let i=(r||``).trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return e;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var xn=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Sn=4;async function Cn(e,t,n){if(!e)return e;let r=new Set;function i(e,t){try{return new URL(e,t||location.href).href}catch{return e}}async function a(e,t,o=0){if(o>Sn)return console.warn(`[snapDOM] @import depth exceeded (${Sn}) at ${t}`),e;let s=``,c=0,l;for(;l=xn.exec(e);){s+=e.slice(c,l.index),c=xn.lastIndex;let u=i((l[2]||l[4]||``).trim(),t);if(r.has(u)){console.warn(`[snapDOM] Skipping circular @import: ${u}`);continue}r.add(u);let d=``;try{let e=await S(u,{as:`text`,useProxy:n,silent:!0});e.ok&&typeof e.data==`string`&&(d=e.data)}catch{}d?(d=bn(d,u),d=await a(d,u,o+1),s+=`
6
+ /* inlined: ${u} */
7
+ ${d}
8
+ `):s+=l[0]}return s+=e.slice(c),s}let o=bn(e,t||location.href);return o=await a(o,t||location.href,0),o}var wn=/url\((["']?)([^"')]+)\1\)/g,Tn=/@font-face[^{}]*\{[^}]*\}/g;function En(e){if(!e)return[];let t=[],n=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of n){let n=e.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;let r=n[1],i=n[2],a=e=>e.includes(`?`)?[parseInt(e.replace(/\?/g,`0`),16),parseInt(e.replace(/\?/g,`F`),16)]:parseInt(e,16);if(i){let e=a(r),n=a(i),o=Array.isArray(e)?e[0]:e,s=Array.isArray(n)?n[1]:n;t.push([Math.min(o,s),Math.max(o,s)])}else{let e=a(r);Array.isArray(e)?t.push([e[0],e[1]]):t.push([e,e])}}return t}function Dn(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[e,r]of t)if(n>=e&&n<=r)return!0;return!1}function On(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(wn)){let e=(r[2]||``).trim();if(!(!e||e.startsWith(`data:`))){if(!/^https?:/i.test(e))try{e=new URL(e,t||location.href).href}catch{}n.push(e)}}return n}async function kn(e,t,n=``){let r=e;for(let i of e.matchAll(wn)){let e=u(i[0]);if(!e)continue;let a=e;if(!a.startsWith(`http`)&&!a.startsWith(`data:`))try{a=new URL(a,t||location.href).href}catch{}if(!U(a)){if(c.resource?.has(a)){c.font?.add(a),r=r.replace(i[0],`url(${c.resource.get(a)})`);continue}try{let e=await S(a,{as:`dataURL`,useProxy:n,silent:!0});if(e.ok&&typeof e.data==`string`){let t=e.data;c.resource?.set(a,t),c.font?.add(a),r=r.replace(i[0],`url(${t})`)}}catch{console.warn(`[snapDOM] Failed to fetch font resource:`,a)}}}return r}function An(e){if(!e.length)return null;let t=(t,n)=>e.some(([e,r])=>!(r<t||e>n)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),a=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?`vietnamese`:a?`cyrillic`:i?`greek`:r?`latin-ext`:n?`latin`:null}function jn(e={}){let t=new Set((e.families||[]).map(e=>String(e).toLowerCase())),n=new Set((e.domains||[]).map(e=>String(e).toLowerCase())),r=new Set((e.subsets||[]).map(e=>String(e).toLowerCase()));return(e,i)=>{if(t.size&&t.has(e.family.toLowerCase()))return!0;if(n.size)for(let t of e.srcUrls)try{if(n.has(new URL(t).host.toLowerCase()))return!0}catch{}if(r.size){let e=An(i);if(e&&r.has(e))return!0}return!1}}function Mn(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let e=ln(i.match(/font-family:\s*([^;]+);/i)?.[1]||``),t=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||`400`).trim(),a=(i.match(/font-style:\s*([^;]+);/i)?.[1]||`normal`).trim(),o=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||`100%`).trim(),s=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||``).trim(),c=(i.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||``).trim(),l=On(c,location.href),u=l.length?l.map(e=>String(e).toLowerCase()).sort().join(`|`):c.toLowerCase(),d=[String(e||``).toLowerCase(),t,a,o,s.toLowerCase(),u].join(`|`);n.has(d)||(n.add(d),r.push(i))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||``)}function Nn(e,t,n,r,i){return`fonts-embed-css::req=${Array.from(e||[]).sort().join(`|`)}::ex=${t?JSON.stringify({families:(t.families||[]).map(e=>String(e).toLowerCase()).sort(),domains:(t.domains||[]).map(e=>String(e).toLowerCase()).sort(),subsets:(t.subsets||[]).map(e=>String(e).toLowerCase()).sort()}):``}::lf=${(n||[]).map(e=>`${(e.family||``).toLowerCase()}::${e.weight||`normal`}::${e.style||`normal`}::${e.src||``}`).sort().join(`|`)}::px=${r||``}::fd=${(i||[]).map(e=>String(e).toLowerCase()).sort().join(`|`)}`}async function Pn(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let a=(e,t)=>{try{return new URL(e,t||location.href).href}catch{return e}};for(let e of i){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let i=e.href?a(e.href,t):t;if(r.depth>=Sn){console.warn(`[snapDOM] CSSOM import depth exceeded (${Sn}) at ${i}`);continue}if(i&&r.visitedSheets.has(i)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${i}`);continue}i&&r.visitedSheets.add(i);let o={...r,depth:(r.depth||0)+1};await Pn(e.styleSheet,i,n,o);continue}if(e.type===CSSRule.FONT_FACE_RULE){let i=ln((e.style.getPropertyValue(`font-family`)||``).trim());if(!i||U(i))continue;let a=(e.style.getPropertyValue(`font-weight`)||`400`).trim(),o=(e.style.getPropertyValue(`font-style`)||`normal`).trim(),s=(e.style.getPropertyValue(`font-stretch`)||`100%`).trim(),c=(e.style.getPropertyValue(`src`)||``).trim(),l=(e.style.getPropertyValue(`unicode-range`)||``).trim();if(!r.faceMatchesRequired(i,o,a,s))continue;let u=En(l);if(!Dn(r.usedCodepoints,u))continue;let d={family:i,weightSpec:a,styleSpec:o,stretchSpec:s,unicodeRange:l,srcRaw:c,srcUrls:On(c,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(d,u))continue;/url\(/i.test(c)?await n(`@font-face{font-family:${i};src:${await kn(c,t||location.href,r.useProxy)};font-style:${o};font-weight:${a};font-stretch:${s};${l?`unicode-range:${l};`:``}}`):await n(`@font-face{font-family:${i};src:${c};font-style:${o};font-weight:${a};font-stretch:${s};${l?`unicode-range:${l};`:``}}`)}}}async function Fn({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i=``,fontStylesheetDomains:a=[],doc:o=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let s=new Map;for(let t of e){let[e,n,r,i]=String(t).split(`__`);if(!e)continue;let a=e.toLowerCase(),o=s.get(a)||[];o.push({w:parseInt(n,10),s:r,st:parseInt(i,10)}),s.set(a,o)}function l(e,t,n,r){let i=String(e).toLowerCase();if(!s.has(i))return!1;let a=s.get(i),o=mn(n),c=hn(t),l=gn(r),u=o.min!==o.max,d=o.min,f=e=>c.kind===`normal`&&e===`normal`||c.kind!==`normal`&&(e===`italic`||e===`oblique`),p=!1;for(let e of a){let t=u?e.w>=o.min&&e.w<=o.max:e.w===d,n=f(fn(e.s)),r=e.st>=l.min&&e.st<=l.max;if(t&&n&&r){p=!0;break}}if(p)return!0;if(!u)for(let e of a){let t=f(fn(e.s)),n=e.st>=l.min&&e.st<=l.max;if(Math.abs(d-e.w)<=300&&t&&n)return!0}if(!u&&c.kind===`normal`&&a.some(e=>fn(e.s)!==`normal`))for(let e of a){let t=Math.abs(d-e.w)<=300,n=e.st>=l.min&&e.st<=l.max;if(t&&n)return!0}return!1}let u=jn(n),d=Nn(e,n,r,i,a);if(c.resource?.has(d))return c.resource.get(d);let f=yn(e),p=[],m=xn;for(let e of o.querySelectorAll(`style`)){let t=e.textContent||``;for(let e of t.matchAll(m)){let t=(e[2]||e[4]||``).trim();!t||U(t)||o.querySelector(`link[rel="stylesheet"][href="${t}"]`)||p.push(t)}}let h=[];p.length&&await Promise.all(p.map(e=>new Promise(t=>{if(o.querySelector(`link[rel="stylesheet"][href="${e}"]`))return t(null);let n=o.createElement(`link`);n.rel=`stylesheet`,n.href=e,n.setAttribute(`data-snapdom`,`injected-import`),n.onload=()=>t(n),n.onerror=()=>t(null),o.head.appendChild(n),h.push(n)})));let g=``,_=Array.from(o.querySelectorAll(`link[rel="stylesheet"]`)).filter(e=>!!e.href);for(let e of h)try{e.remove()}catch{}for(let e of _)try{if(U(e.href))continue;let r=``,s=!1;try{s=new URL(e.href,location.href).origin===location.origin}catch{}if(!s){let t=Array.isArray(a)?a:[];if(!vn(e.href,f,t))continue}if(s){let t=Array.from(o.styleSheets).find(t=>t.href===e.href);if(t)try{let e=t.cssRules||[];r=Array.from(e).map(e=>e.cssText).join(``)}catch{}}if(!r){let t=await S(e.href,{as:`text`,useProxy:i});if(t?.ok&&typeof t.data==`string`&&(r=t.data),U(e.href))continue}r=await Cn(r,e.href,i);let c=``;for(let a of r.match(Tn)||[]){let r=ln((a.match(/font-family:\s*([^;]+);/i)?.[1]||``).trim());if(!r||U(r))continue;let o=(a.match(/font-weight:\s*([^;]+);/i)?.[1]||`400`).trim(),s=(a.match(/font-style:\s*([^;]+);/i)?.[1]||`normal`).trim(),d=(a.match(/font-stretch:\s*([^;]+);/i)?.[1]||`100%`).trim(),f=(a.match(/unicode-range:\s*([^;]+);/i)?.[1]||``).trim(),p=(a.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||``).trim(),m=On(p,e.href);if(!l(r,s,o,d))continue;let h=En(f);if(!Dn(t,h))continue;let g={family:r,weightSpec:o,styleSpec:s,stretchSpec:d,unicodeRange:f,srcRaw:p,srcUrls:m,href:e.href};if(n&&u(g,h))continue;let _=/url\(/i.test(p)?await kn(a,e.href,i):a;c+=_}c.trim()&&(g+=c)}catch{console.warn(`[snapDOM] Failed to process stylesheet:`,e.href)}let v={requiredIndex:s,usedCodepoints:t,faceMatchesRequired:l,simpleExcluder:n?jn(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let e of o.styleSheets)if(!(e.href&&_.some(t=>t.href===e.href)))try{let t=e.href||location.origin+`/`;t&&v.visitedSheets.add(t),await Pn(e,t,async e=>{g+=e},v)}catch{}try{for(let e of o.fonts||[]){if(!e||!e.family||e.status!==`loaded`||!e._snapdomSrc)continue;let t=String(e.family).replace(/^['"]+|['"]+$/g,``);if(U(t)||!s.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e._snapdomSrc;if(!String(r).startsWith(`data:`)){if(c.resource?.has(e._snapdomSrc))r=c.resource.get(e._snapdomSrc),c.font?.add(e._snapdomSrc);else if(!c.font?.has(e._snapdomSrc))try{let t=await S(e._snapdomSrc,{as:`dataURL`,useProxy:i,silent:!0});if(t.ok&&typeof t.data==`string`)r=t.data,c.resource?.set(e._snapdomSrc,r),c.font?.add(e._snapdomSrc);else continue}catch{console.warn(`[snapDOM] Failed to fetch dynamic font src:`,e._snapdomSrc);continue}}g+=`@font-face{font-family:'${t}';src:url(${r});font-style:${e.style||`normal`};font-weight:${e.weight||`normal`};}`}}catch{}for(let e of r){if(!e||typeof e!=`object`)continue;let t=String(e.family||``).replace(/^['"]+|['"]+$/g,``);if(!t||U(t)||!s.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e.weight==null?`normal`:String(e.weight),a=e.style==null?`normal`:String(e.style),o=e.stretchPct==null?`100%`:`${e.stretchPct}%`,l=String(e.src||``),u=l;if(!u.startsWith(`data:`)){if(c.resource?.has(l))u=c.resource.get(l),c.font?.add(l);else if(!c.font?.has(l))try{let e=await S(l,{as:`dataURL`,useProxy:i,silent:!0});if(e.ok&&typeof e.data==`string`)u=e.data,c.resource?.set(l,u),c.font?.add(l);else continue}catch{console.warn(`[snapDOM] Failed to fetch localFonts src:`,l);continue}}g+=`@font-face{font-family:'${t}';src:url(${u});font-style:${a};font-weight:${r};font-stretch:${o};}`}return g&&(g=Mn(g),c.resource?.set(d,g)),g}function In(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=e=>{let n=un(e.fontFamily);if(n.length)for(let r of n)t.add(((e,t,n)=>`${r}__${dn(e)}__${fn(t)}__${pn(n)}`)(e.fontWeight,e.fontStyle,e.fontStretch))};r(getComputedStyle(e));let i=getComputedStyle(e,`::before`);i&&i.content&&i.content!==`none`&&r(i);let a=getComputedStyle(e,`::after`);for(a&&a.content&&a.content!==`none`&&r(a);n.nextNode();){let e=n.currentNode;r(getComputedStyle(e));let t=getComputedStyle(e,`::before`);t&&t.content&&t.content!==`none`&&r(t);let i=getComputedStyle(e,`::after`);i&&i.content&&i.content!==`none`&&r(i)}return t}function Ln(e){let t=new Set,n=e=>{if(e)for(let n of e)t.add(n.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let e=r.currentNode;if(e.nodeType===Node.TEXT_NODE)n(e.nodeValue||``);else if(e.nodeType===Node.ELEMENT_NODE){let r=e;for(let e of[`::before`,`::after`]){let i=getComputedStyle(r,e)?.getPropertyValue(`content`);if(!(!i||i===`none`))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let e=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(e)for(let n of e)try{t.add(parseInt(n.slice(1),16))}catch{}}}}}return t}async function Rn(e,t=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let e=n.createElement(`div`);e.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;`;for(let t of r){let r=n.createElement(`span`);r.textContent=`AaBbGg1234ÁÉÍÓÚçñ—∞`,r.style.fontFamily=`"${t}"`,r.style.fontWeight=`700`,r.style.fontStyle=`italic`,r.style.fontSize=`32px`,r.style.lineHeight=`1`,r.style.whiteSpace=`nowrap`,r.style.margin=`0`,r.style.padding=`0`,e.appendChild(r)}n.body.appendChild(e),e.offsetWidth,n.body.removeChild(e)};for(let e=0;e<Math.max(1,t);e++)i(),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))}l();function zn(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||``)}function Bn(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 Vn(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[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function Hn(e,t){switch((t||`decimal`).toLowerCase()){case`decimal`:return String(e);case`decimal-leading-zero`:{let t=Math.abs(e);return(e<0?`-`:``)+(t<10?`0`:``)+String(t)}case`lower-alpha`:return Bn(e,!1);case`upper-alpha`:return Bn(e,!0);case`lower-roman`:return Vn(e,!1);case`upper-roman`:return Vn(e,!0);default:return String(e)}}function Un(e){let t=()=>c?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,a=e=>e&&e.tagName===`LI`,o=e=>{let t=0,n=e?.parentElement;if(!n)return 0;for(let r of n.children){if(r===e)break;r.tagName===`LI`&&t++}return t},s=e=>{let t=new Map;for(let[n,r]of e)t.set(n,r.slice());return t},l=(e,t,n)=>{let r=s(e),i;try{i=n.style?.counterReset||getComputedStyle(n).counterReset}catch{}if(i&&i!==`none`)for(let e of i.split(`,`)){let n=e.trim().split(/\s+/),i=n[0],a=Number.isFinite(Number(n[1]))?Number(n[1]):0;if(!i)continue;let o=t.get(i);if(o&&o.length){let e=o.slice();e.push(a),r.set(i,e)}else r.set(i,[a])}let c;try{c=n.style?.counterSet||getComputedStyle(n).counterSet}catch{}if(c&&c!==`none`)for(let e of c.split(`,`)){let t=e.trim().split(/\s+/),n=t[0],i=Number.isFinite(Number(t[1]))?Number(t[1]):0;if(!n)continue;let a=r.get(n)||[];a.length===0&&a.push(0),a[a.length-1]=i,r.set(n,a)}let l;try{l=n.style?.counterIncrement||getComputedStyle(n).counterIncrement}catch{}if(l&&l!==`none`)for(let e of l.split(`,`)){let t=e.trim().split(/\s+/),n=t[0],i=Number.isFinite(Number(t[1]))?Number(t[1]):1;if(!n)continue;let a=r.get(n)||[];a.length===0&&a.push(0),a[a.length-1]+=i,r.set(n,a)}try{if(getComputedStyle(n).display===`list-item`&&a(n)){let e=n.parentElement,t=1;if(e&&e.tagName===`OL`){let r=e.getAttribute(`start`),i=Number.isFinite(Number(r))?Number(r):1,a=o(n),s=n.getAttribute(`value`);t=Number.isFinite(Number(s))?Number(s):i+a}else t=1+o(n);let i=r.get(`list-item`)||[];i.length===0&&i.push(0),i[i.length-1]=t,r.set(`list-item`,i)}}catch{}return r},u=(e,t,n)=>{let i=l(n,t,e);r.set(e,i);let a=i;for(let t of e.children)a=u(t,i,a);let o=new Map;for(let[e,t]of n){let n=t.length,r=a.get(e);o.set(e,r&&r.length?r.slice(0,n):t.slice())}for(let[e,n]of a)!o.has(e)&&n.length&&!t.has(e)&&o.set(e,n.slice(0,1));return o},d=new Map;u(i,d,d);function f(){let e=t();if(e!==n){n=e;let t=new Map;u(i,t,t)}}return{get(e,t){f();let n=r.get(e)?.get(t);return n&&n.length?n[n.length-1]:0},getStack(e,t){f();let n=r.get(e)?.get(t);return n?n.slice():[]}}}function Wn(e,t,n){if(!e||e===`none`)return e;try{return e.replace(/\b(counter|counters)\s*\(([^)]+)\)/g,(e,r,i)=>{let a=String(i).split(`,`).map(e=>e.trim());if(r===`counter`){let e=a[0]?.replace(/^["']|["']$/g,``),r=(a[1]||`decimal`).toLowerCase();return Hn(n.get(t,e),r)}else{let e=a[0]?.replace(/^["']|["']$/g,``),r=a[1]?.replace(/^["']|["']$/g,``)??``,i=(a[2]||`decimal`).toLowerCase(),o=n.getStack(t,e);return o.length?o.map(e=>Hn(e,i)).join(r):``}})}catch{return`- `}}E(),l();var W=new WeakMap,Gn=1e3;function Kn(e,t){let n=Jn(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=Xn(e,n),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):Xn(e,n)}function qn(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Jn(e){let t=e.querySelectorAll(`style,link[rel~="stylesheet"]`),n=`n:${t.length}|`,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i.tagName===`STYLE`){let e=i.textContent?i.textContent.length:0;n+=`S${e}|`;let t=i.sheet,a=t?qn(t):null;a&&(r+=a.length)}else{let e=i.getAttribute(`href`)||``,t=i.getAttribute(`media`)||`all`;n+=`L${e}|m:${t}|`;let a=i.sheet,o=a?qn(a):null;o&&(r+=o.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function Yn(e,t,n){let r=qn(e);if(!r)return!1;for(let e=0;e<r.length;e++){if(n.budget<=0)return!1;let i=r[e],a=i&&i.cssText?i.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let e=0;e<i.cssRules.length&&n.budget>0;e++){let r=i.cssRules[e],a=r&&r.cssText?r.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0}if(n.budget<=0)return!1}return!1}function Xn(e=document,t=Jn(e)){let n=W.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 n=0;n<i.length;n++){let a=i[n].textContent||``;for(let n of r)if(a.includes(n))return W.set(e,{fingerprint:t,result:!0}),!0}let a=e.adoptedStyleSheets;if(Array.isArray(a)&&a.length){let n={budget:Gn};try{for(let i of a)if(Yn(i,r,n))return W.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let n=e.querySelectorAll(`style,link[rel~="stylesheet"]`),i={budget:Gn};for(let a=0;a<n.length&&i.budget>0;a++){let o=n[a],s=null;if(o.tagName,s=o.sheet||null,s&&Yn(s,r,i))return W.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector(`[style*="counter("], [style*="counters("]`)?(W.set(e,{fingerprint:t,result:!0}),!0):(W.set(e,{fingerprint:t,result:!1}),!1)}var G=new WeakMap;function Zn(e){for(let t of[`Top`,`Right`,`Bottom`,`Left`]){let n=parseFloat(e[`border${t}Width`])||0,r=e[`border${t}Style`];if(n>0&&r&&r!==`none`&&r!==`hidden`)return!0}return!1}var Qn=-1;function $n(e){if(!e)return``;let t=[],n=/"([^"]*)"/g,r=0,i;for(;i=n.exec(e);){let a=e.slice(r,i.index).trim();a&&t.push(a),t.push(i[1]),r=n.lastIndex}let a=e.slice(r).trim();return a&&t.push(a),t.join(``)}function er(e,t){let n=e.parentElement,r=n?G.get(n):null;return r?{get(e,n){let i=t.get(e,n),a=r.get(n);return typeof a==`number`?Math.max(i,a):i},getStack(e,n){let i=t.getStack(e,n);if(!i.length)return i;let a=r.get(n);if(typeof a==`number`){let e=i.slice();return e[e.length-1]=Math.max(e[e.length-1],a),e}return i}}:t}function tr(e,t,n){let r=new Map;function i(e){let t=[];if(!e||e===`none`)return t;for(let n of String(e).split(`,`)){let e=n.trim().split(/\s+/),r=e[0],i=Number.isFinite(Number(e[1]))?Number(e[1]):void 0;r&&t.push({name:r,num:i})}return t}let a=i(t?.counterReset),o=i(t?.counterSet),s=i(t?.counterIncrement);function c(t){if(r.has(t))return r.get(t).slice();let i=n.getStack(e,t);i=i.length?i.slice():[];let c=a.find(e=>e.name===t);if(c){let e=Number.isFinite(c.num)?c.num:0;i=i.length?[...i,e]:[e]}let l=o.find(e=>e.name===t);if(l){let e=Number.isFinite(l.num)?l.num:0;i.length===0&&(i=[0]),i[i.length-1]=e}let u=s.find(e=>e.name===t);if(u){let e=Number.isFinite(u.num)?u.num:1;i.length===0&&(i=[0]),i[i.length-1]+=e}return r.set(t,i.slice()),i}return{get(e,t){let n=c(t);return n.length?n[n.length-1]:0},getStack(e,t){return c(t)},__incs:s}}function nr(e,t,n){let r;try{r=j(e,t)}catch{}let i=r?.content;if(!i||i===`none`||i===`normal`)return{text:``,incs:[]};let a=er(e,n),o=tr(e,r,a);return{text:$n(zn(i)?Wn(i,e,o):i),incs:o.__incs||[]}}async function rr(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element)||e instanceof HTMLTextAreaElement||!Kn(e.ownerDocument||document,n))return;let i=c?.session?.__counterEpoch??0;if(Qn!==i&&(G=new WeakMap,n&&(n.__counterCtx=null),Qn=i),!n.__counterCtx)try{n.__counterCtx=Un(e.ownerDocument||document)}catch(e){L(n,`buildCounterContext failed`,e)}let a=n.__counterCtx;for(let i of[`::before`,`::after`,`::first-letter`])try{let o=j(e,i);if(!o||o.content===`none`&&o.backgroundImage===`none`&&o.backgroundColor===`transparent`&&!Zn(o)&&(!o.transform||o.transform===`none`)&&o.display===`inline`)continue;if(i===`::first-letter`){let r=j(e),i=(r?.display||``).toLowerCase();if(i.includes(`flex`)||i.includes(`grid`)||!(o.color!==r.color||o.fontSize!==r.fontSize||o.fontWeight!==r.fontWeight||o.fontFamily!==r.fontFamily||o.fontStyle!==r.fontStyle||o.textTransform!==r.textTransform||o.float!==r.float||o.paddingTop!==r.paddingTop||o.paddingRight!==r.paddingRight||o.paddingBottom!==r.paddingBottom||o.paddingLeft!==r.paddingLeft||o.marginTop!==r.marginTop||o.marginRight!==r.marginRight||o.marginBottom!==r.marginBottom||o.marginLeft!==r.marginLeft))continue;let a=Array.from(t.childNodes).find(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim().length>0);if(!a)continue;let s=a.textContent,c=s.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],l=s.slice(c?.length||0);if(!c||/[\uD800-\uDFFF]/.test(c))continue;let u=document.createElement(`span`);u.textContent=c,u.dataset.snapdomPseudo=`::first-letter`;let d=te(oe(o),`span`);n.styleMap.set(u,d);let f=document.createTextNode(l);t.replaceChild(f,a),t.insertBefore(u,f);continue}let s=o.content??``,c=s===``||s===`none`||s===`normal`,{text:l,incs:d}=nr(e,i,a),p=o.backgroundImage,m=o.backgroundColor,h=o.fontFamily,g=parseInt(o.fontSize)||32,_=parseInt(o.fontWeight)||!1,v=o.color||`#000`,y=o.transform,b=U(h),x=!c&&l!==``,C=p&&p!==`none`,w=m&&m!==`transparent`&&m!==`rgba(0, 0, 0, 0)`,T=Zn(o),E=y&&y!==`none`,O=s!==`none`&&s!==`normal`&&((parseFloat(o.width)||0)>0||(parseFloat(o.height)||0)>0);if(!(x||C||w||T||E||O)){if(d&&d.length&&e.parentElement){let t=G.get(e.parentElement)||new Map;for(let{name:n}of d){if(!n)continue;let r=er(e,a),o=tr(e,j(e,i),r).get(e,n);t.set(n,o)}G.set(e.parentElement,t)}continue}let k=!1;if(x&&!b&&l.length>1&&!l.startsWith(`url(`)){let n=j(e),r=parseFloat(n.fontSize)||16,i=parseFloat(n.lineHeight);Number.isFinite(i)||(i=r*1.5),e.getBoundingClientRect().height<i*1.6&&(t.style.whiteSpace=`nowrap`,k=!0)}let A=document.createElement(`span`);A.dataset.snapdomPseudo=i,A.style.pointerEvents=`none`,k&&(A.style.whiteSpace=`nowrap`);let ee=te(oe(o),`span`);if(n.styleMap.set(A,ee),b&&l&&l.length===1){let{dataUrl:e,width:n,height:r}=await on(l,h,_,g,v),i=document.createElement(`img`);i.src=e,i.style=`height:${g}px;width:${n/r*g}px;object-fit:contain;`,A.appendChild(i),t.dataset.snapdomHasIcon=`true`}else if(l&&l.startsWith(`url(`)){let t=u(l);if(t?.trim())try{let e=await S(f(t),{as:`dataURL`,useProxy:r.useProxy});if(e?.ok&&typeof e.data==`string`){let t=document.createElement(`img`);t.src=e.data,t.style=`width:${g}px;height:auto;object-fit:contain;`,A.appendChild(t)}}catch(t){console.error(`[snapdom] Error in pseudo ${i} for`,e,t)}}else!b&&x&&(A.textContent=l);A.style.backgroundImage=`none`,`maskImage`in A.style&&(A.style.maskImage=`none`),`webkitMaskImage`in A.style&&(A.style.webkitMaskImage=`none`);try{A.style.backgroundRepeat=o.backgroundRepeat,A.style.backgroundSize=o.backgroundSize,o.backgroundPositionX&&o.backgroundPositionY?(A.style.backgroundPositionX=o.backgroundPositionX,A.style.backgroundPositionY=o.backgroundPositionY):A.style.backgroundPosition=o.backgroundPosition,A.style.backgroundOrigin=o.backgroundOrigin,A.style.backgroundClip=o.backgroundClip,A.style.backgroundAttachment=o.backgroundAttachment,A.style.backgroundBlendMode=o.backgroundBlendMode}catch{}if(C)try{let e=M(p),t=await Promise.all(e.map(D));A.style.backgroundImage=t.join(`, `)}catch(e){console.warn(`[snapdom] Failed to inline background-image for ${i}`,e)}w&&(A.style.backgroundColor=m);let ne=A.childNodes.length>0||A.textContent?.trim()!==``||C||w||T||E||O;if(d&&d.length&&e.parentElement){let t=G.get(e.parentElement)||new Map,n=er(e,a),r=tr(e,j(e,i),n);for(let{name:n}of d){if(!n)continue;let i=r.get(e,n);t.set(n,i)}G.set(e.parentElement,t)}if(!ne)continue;i===`::before`?(t.dataset.snapdomHasBefore=`1`,t.insertBefore(A,t.firstChild)):(t.dataset.snapdomHasAfter=`1`,t.appendChild(A))}catch(t){console.warn(`[snapdom] Failed to capture ${i} for`,e,t)}let o=Array.from(t.children).filter(e=>!e.dataset.snapdomPseudo);if(n.nodeMap)for(let e of o){let t=n.nodeMap.get(e);t instanceof Element&&await rr(t,e,n,r)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,o.length);e++)await rr(t[e],o[e],n,r)}}function ir(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 a=/url\(\s*#([^)]+)\)/g,o=[`fill`,`stroke`,`filter`,`clip-path`,`mask`,`marker`,`marker-start`,`marker-mid`,`marker-end`],s=e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`),c=e=>{if(!e||!e.getAttribute)return null;let t=e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(t)return t;let n=e.attributes;if(!n)return null;for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name)continue;if(t.name===`href`)return t.value;let r=t.name.indexOf(`:`);if(r!==-1&&t.name.slice(r+1)===`href`)return t.value}return null},l=new Set(Array.from(e.querySelectorAll(`[id]`)).map(e=>e.id)),u=new Set,d=!1,f=(e,t=null)=>{if(!e)return;a.lastIndex=0;let n;for(;n=a.exec(e);){d=!0;let e=(n[1]||``).trim();e&&(l.has(e)||(u.add(e),t&&!t.has(e)&&t.add(e)))}},p=e=>{let t=e.querySelectorAll(`use`);for(let e of t){let t=c(e);if(!t||!t.startsWith(`#`))continue;d=!0;let n=t.slice(1).trim();n&&!l.has(n)&&u.add(n)}let n=e.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 e of n){f(e.getAttribute(`style`)||``);for(let t of o)f(e.getAttribute(t))}};for(let e of i)p(e);if(!d)return;let m=e.querySelector(`svg.inline-defs-container`);m||(m=n.createElementNS(`http://www.w3.org/2000/svg`,`svg`),m.classList.add(`inline-defs-container`),m.setAttribute(`aria-hidden`,`true`),m.setAttribute(`style`,`position:absolute;width:0;height:0;overflow:hidden`),e.insertBefore(m,e.firstChild||null));let h=m.querySelector(`defs`)||null,g=t=>{if(!t||l.has(t))return null;let n=s(t),i=t=>{let n=r.querySelector(t);return n&&!e.contains(n)?n:null};return i(`svg defs > *#${n}`)||i(`svg > symbol#${n}`)||i(`*#${n}`)};if(!u.size)return;let _=new Set(u),v=new Set;for(;_.size;){let e=_.values().next().value;if(_.delete(e),!e||l.has(e)||v.has(e))continue;let t=g(e);if(!t){v.add(e);continue}h||(h=n.createElementNS(`http://www.w3.org/2000/svg`,`defs`),m.appendChild(h));let r=t.cloneNode(!0);r.id||r.setAttribute(`id`,e),h.appendChild(r),v.add(e),l.add(e);let i=[r,...r.querySelectorAll(`*`)];for(let e of i){let t=c(e);if(t&&t.startsWith(`#`)){let e=t.slice(1).trim();e&&!l.has(e)&&!v.has(e)&&_.add(e)}let n=e.getAttribute?.(`style`)||``;n&&f(n,_);for(let t of o){let n=e.getAttribute?.(t);n&&f(n,_)}}}}l();function ar(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,a=`data-snap-ph`,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let s=o.currentNode,c=getComputedStyle(s),l=c.position;if(l!==`sticky`&&l!==`-webkit-sticky`)continue;let u=or(c.top),d=or(c.bottom);if(u==null&&d==null)continue;let f=cr(t,sr(s,e),a);if(!f)continue;let p=s.getBoundingClientRect(),m=p.width,h=p.height,g=p.left-r.left;if(!(m>0&&h>0)||!Number.isFinite(g))continue;let _=u==null?n+(i-h-d):u+n;if(!Number.isFinite(_))continue;let v=Number.parseInt(c.zIndex,10),y=Number.isFinite(v),b=y?Math.max(v,1)+1:2,x=y?v-1:0,S=f.cloneNode(!1);S.setAttribute(a,`1`),S.style.position=`sticky`,S.style.left=`${g}px`,S.style.top=`${_}px`,S.style.width=`${m}px`,S.style.height=`${h}px`,S.style.visibility=`hidden`,S.style.zIndex=String(x),S.style.overflow=`hidden`,S.style.background=`transparent`,S.style.boxShadow=`none`,S.style.filter=`none`,f.parentElement?.insertBefore(S,f),f.style.position=`absolute`,f.style.left=`${g}px`,f.style.top=`${_}px`,f.style.bottom=`auto`,f.style.zIndex=String(b),f.style.pointerEvents=`none`}}function or(e){if(!e||e===`auto`)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function sr(e,t){let n=[];for(let r=e;r&&r!==t;){let e=r.parentElement;if(!e)break;n.push(Array.prototype.indexOf.call(e.children,r)),r=e}return n.reverse()}function cr(e,t,n){let r=e;for(let e=0;e<t.length;e++)if(r=lr(r,n)[t[e]],!r)return null;return r instanceof HTMLElement?r:null}function lr(e,t){let n=[],r=e.children;for(let e=0;e<r.length;e++){let i=r[e];i.hasAttribute(t)||n.push(i)}return n}function ur(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,a=t.borderWidth;n!==`none`&&parseFloat(r)>0&&(i===`none`||parseFloat(a)===0)&&(e.style.border=`${r} solid transparent`)}function dr(e){let t=[];try{let n=e.querySelectorAll(`*`);for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.style.contentVisibility||``,r=getComputedStyle(e),i=r.contentVisibility||r.getPropertyValue(`content-visibility`)||``;(i===`auto`||i===`hidden`)&&(t.push({el:e,original:n}),e.style.contentVisibility=`visible`)}if(e instanceof HTMLElement){let n=getComputedStyle(e),r=n.contentVisibility||n.getPropertyValue(`content-visibility`)||``;(r===`auto`||r===`hidden`)&&(t.push({el:e,original:e.style.contentVisibility||``}),e.style.contentVisibility=`visible`)}}catch{}return()=>{for(let{el:e,original:n}of t)try{e.style.contentVisibility=n}catch{}}}async function fr(e,t={}){let n={styleMap:c.session.styleMap,styleCache:c.session.styleCache,nodeMap:c.session.nodeMap,options:t},r,i=``,a=``;ur(e);let o=dr(e);try{r=await Kt(e,n,t)}catch(e){throw console.warn(`deepClone failed:`,e),e}finally{o()}try{ir(r)}catch(e){console.warn(`inlineExternal defs or symbol failed:`,e)}try{await rr(e,r,n,t)}catch(e){console.warn(`inlinePseudoElements failed:`,e)}await Wt(r,n);try{let e=r.querySelectorAll(`style[data-sd]`);for(let t of e)a+=t.textContent||``,t.remove()}catch(e){L(n,`Failed to extract shadow CSS from style[data-sd]`,e)}let s=ie(n.styleMap);i=Array.from(s.entries()).map(([e,t])=>`.${t}{${e}}`).join(``),i=a+`[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}`+i;for(let[e,t]of n.styleMap.entries()){if(e.tagName===`STYLE`)continue;if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){e.setAttribute(`style`,t.replace(/;/g,`; `));continue}let n=s.get(t);n&&e.classList.add(n);let r=e.style?.backgroundImage,i=e.dataset?.snapdomHasIcon;r&&r!==`none`&&(e.style.backgroundImage=r),i&&(e.style.verticalAlign=`middle`,e.style.display=`inline`)}for(let[e,t]of n.nodeMap.entries()){let n=t.scrollLeft,r=t.scrollTop;if((n||r)&&e instanceof HTMLElement){e.style.overflow=`hidden`,e.style.scrollbarWidth=`none`,e.style.msOverflowStyle=`none`;try{let t=e.querySelectorAll(`*`);for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.style.position;if(t===`fixed`||t===`absolute`){let i=parseFloat(e.style.top)||0,a=parseFloat(e.style.left)||0;e.style.top=`${i+r}px`,e.style.left=`${a+n}px`,t===`fixed`&&(e.style.position=`absolute`)}}}catch{}let t=document.createElement(`div`);for(t.style.all=`unset`,t.style.transform=`translate(${-n}px, ${-r}px)`,t.style.willChange=`transform`,t.style.display=`inline-block`,t.style.width=`100%`;e.firstChild;)t.appendChild(e.firstChild);e.appendChild(t)}}if(ar(e,r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r),e===n.nodeMap.get(r)){let t=n.styleCache.get(e)||j(e);n.styleCache.set(e,t);let i=d(t.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=i||``}for(let[e,t]of n.nodeMap.entries())t.tagName===`PRE`&&(e.style.marginTop=`0`,e.style.marginBlockStart=`0`);return{clone:r,classCSS:i,styleCache:n.styleCache}}E(),l();var pr=`http://www.w3.org/1999/xlink`;function mr(e){return e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(pr,`href`):null)}function hr(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,a=parseFloat(e.style?.width||``)||0,o=parseFloat(e.style?.height||``)||0;return{width:t||a||r||e.width||e.naturalWidth||100,height:n||o||i||e.height||e.naturalHeight||100}}async function gr(e,t={}){let n=Array.from(e.querySelectorAll(`img`)),r=async e=>{if(!e.getAttribute(`src`)){let t=e.currentSrc||e.src||``;t&&e.setAttribute(`src`,t)}e.removeAttribute(`srcset`),e.removeAttribute(`sizes`);let n=e.src||``;if(!n)return;let r=c.image?.get(n);if(r){e.src=r,e.width||(e.width=e.naturalWidth||100),e.height||(e.height=e.naturalHeight||100);return}let i=await S(n,{as:`dataURL`,useProxy:t.useProxy});if(i.ok&&typeof i.data==`string`&&i.data.startsWith(`data:`)){c.image?.set(n,i.data),e.src=i.data,e.width||(e.width=e.naturalWidth||100),e.height||(e.height=e.naturalHeight||100);return}let{width:a,height:o}=hr(e),{fallbackURL:s}=t||{};if(s)try{let r=typeof s==`function`?await s({width:a,height:o,src:n,element:e}):s;if(r){let n=await S(r,{as:`dataURL`,useProxy:t.useProxy});if(n?.ok&&typeof n.data==`string`){e.src=n.data,e.width||(e.width=a),e.height||(e.height=o);return}}}catch{}if(t.placeholders!==!1){let t=document.createElement(`div`);t.style.cssText=[`width:${a}px`,`height:${o}px`,`background:#ccc`,`display:inline-block`,`text-align:center`,`line-height:${o}px`,`color:#666`,`font-size:12px`,`overflow:hidden`].join(`;`),t.textContent=`img`,e.replaceWith(t)}else{let t=document.createElement(`div`);t.style.cssText=`display:inline-block;width:${a}px;height:${o}px;visibility:hidden;`,e.replaceWith(t)}};for(let e=0;e<n.length;e+=6){let t=n.slice(e,e+6).map(r);await Promise.allSettled(t)}let i=Array.from(e.querySelectorAll(`image`)),a=async e=>{let n=mr(e);if(!n||n.startsWith(`data:`)||n.startsWith(`blob:`))return;let r=await S(n,{as:`dataURL`,useProxy:t.useProxy});r.ok&&typeof r.data==`string`&&r.data.startsWith(`data:`)&&(e.setAttribute(`href`,r.data),e.removeAttribute(`xlink:href`),typeof e.removeAttributeNS==`function`&&e.removeAttributeNS(pr,`href`))};for(let e=0;e<i.length;e+=6){let t=i.slice(e,e+6).map(a);await Promise.allSettled(t)}}R(),l();async function _r(e,t,n,r={}){let i=[[e,t]],a=[`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`],o=[`mask-position`,`mask-size`,`mask-repeat`,`mask-mode`,`mask-composite`,`-webkit-mask-position`,`-webkit-mask-size`,`-webkit-mask-repeat`,`-webkit-mask-composite`,`mask-origin`,`mask-clip`,`-webkit-mask-origin`,`-webkit-mask-clip`,`-webkit-mask-position-x`,`-webkit-mask-position-y`],s=[`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[e,t]=i.shift();if(!t)continue;let u=n.get(e)||j(e);n.has(e)||n.set(e,u);let d=(()=>{let e=u.getPropertyValue(`border-image`),t=u.getPropertyValue(`border-image-source`);return e&&e!==`none`||t&&t!==`none`})(),f=u.getPropertyValue(`background-image`),p=u.getPropertyValue(`background-color`);if(f&&f!==`none`||p&&p!==`rgba(0, 0, 0, 0)`&&p!==`transparent`||/url\s*\(|gradient\s*\(/i.test(u.getPropertyValue(`background`)||``))for(let e of s){let n=u.getPropertyValue(e);n&&t.style.setProperty(e,n)}for(let e of a){let n=u.getPropertyValue(e);if(e===`background-image`&&(!n||n===`none`)){let e=u.getPropertyValue(`background`);e&&/url\s*\(/.test(e)&&(n=M(e).filter(e=>/url\s*\(/.test(e)).join(`, `)||n)}if(!n||n===`none`)continue;let i=M(n),a=await Promise.all(i.map(e=>D(e,r)));a.some(e=>e&&e!==`none`&&!/^url\(undefined/.test(e))&&t.style.setProperty(e,a.join(`, `))}for(let e of o){let n=u.getPropertyValue(e);!n||n===`initial`||t.style.setProperty(e,n)}if(d)for(let e of l){let n=u.getPropertyValue(e);!n||n===`initial`||t.style.setProperty(e,n)}if(e.shadowRoot){let n=Array.from(e.shadowRoot.children).filter(e=>e.tagName!==`STYLE`),r=Array.from(t.children).filter(e=>!e.dataset?.snapdomPseudo&&!(e.tagName===`STYLE`&&e.dataset?.sd));for(let e=0;e<Math.min(n.length,r.length);e++)i.push([n[e],r[e]])}else{let e=c.session.nodeMap;for(let n of t.children){let t=e.get(n);t&&i.push([t,n])}}}}R(),l();function vr(e){if(!e)return()=>{};let t=[];function n(e){let r=getComputedStyle(e),i=yr(e,r);i&&t.push(i);let a=br(e,r);a&&t.push(a);for(let t of e.children||[])n(t)}return n(e),()=>t.forEach(e=>e())}function yr(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let n=xr(t);if(n<=0||!wr(e))return()=>{};let r=e.textContent??``,i=r,a=Cr(t);e.textContent=`X`;let o=e.scrollHeight-a;e.textContent=r;let s=o>0?o:Sr(t),c=Math.round(s*n+a);if(e.scrollHeight<=c+.5)return()=>{};let l=0,u=r.length,d=-1;for(;l<=u;){let t=l+u>>1;e.textContent=r.slice(0,t)+`…`,e.scrollHeight<=c+.5?(d=t,l=t+1):u=t-1}return e.textContent=(d>=0?r.slice(0,d):``)+`…`,()=>{e.textContent=i}}function br(e,t){if(!e||(t=t||getComputedStyle(e),t.textOverflow!==`ellipsis`)||t.whiteSpace!==`nowrap`&&t.whiteSpace!==`pre`||t.overflowX!==`hidden`&&t.overflowX!==`clip`||!wr(e)||e.scrollWidth<=e.clientWidth+.5)return()=>{};let n=e.textContent??``,r=n,i=0,a=n.length,o=-1;for(;i<=a;){let t=i+a>>1;e.textContent=n.slice(0,t)+`…`,e.scrollWidth<=e.clientWidth+.5?(o=t,i=t+1):a=t-1}return e.textContent=(o>=0?n.slice(0,o):``)+`…`,()=>{e.textContent=r}}function xr(e){let t=e.getPropertyValue(`-webkit-line-clamp`)||e.getPropertyValue(`line-clamp`);t=(t||``).trim();let n=parseInt(t,10);return Number.isFinite(n)&&n>0?n:0}function Sr(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 Cr(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function wr(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Tr=[];function Er(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 Dr(...e){let t=e.flat();for(let e of t){let t=Er(e);t&&(Tr.some(e=>e&&e.name&&t.name&&e.name===t.name)||Tr.push(t))}}function Or(e){return e&&Array.isArray(e.plugins)?e.plugins:Tr}async function K(e,t,n){let r=n,i=Or(t);for(let n of i){let i=n&&typeof n[e]==`function`?n[e]:null;if(!i)continue;let a=await i(t,r);typeof a<`u`&&(r=a)}return r}async function kr(e,t,n){let r=[],i=Or(t);for(let a of i){let i=a&&typeof a[e]==`function`?a[e]:null;if(!i)continue;let o=await i(t,n);typeof o<`u`&&r.push(o)}return r}function Ar(e){let t=[];if(Array.isArray(e))for(let n of e){let e=Er(n);if(!e||!e.name)continue;let r=t.findIndex(t=>t&&t.name===e.name);r>=0&&t.splice(r,1),t.push(e)}for(let e of Tr)e&&e.name&&!t.some(t=>t.name===e.name)&&t.push(e);return Object.freeze(t)}function jr(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=Ar(t)),e}function Mr(){return Tr.slice()}function q(e){return!!(!e||e.startsWith(`data:`)||e.startsWith(`blob:`)||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}function Nr(e,t){return!e||!(e instanceof Element)?!1:e.querySelector(`picture`)?!0:t?!!e.querySelector(`img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]`):!1}function Pr(e,t){let n=e.currentSrc||``;if(n&&!q(n))return n;let r=t.querySelectorAll(`source[srcset]`),i=null;for(let e of r){let t=e.getAttribute(`srcset`);if(!t||q(t))continue;let n=e.getAttribute(`media`);if(n)try{if(window.matchMedia(n).matches)return t.split(`,`)[0].trim().split(/\s+/)[0]}catch{}i||(i=t.split(`,`)[0].trim().split(/\s+/)[0])}return i}function Fr(e){let t=[e.getAttribute(`data-src`),e.getAttribute(`data-lazy-src`),e.getAttribute(`data-original`),e.getAttribute(`data-hi-res-src`)];for(let e of t)if(e&&!q(e))return e;let n=e.getAttribute(`data-srcset`)||e.getAttribute(`data-lazy-srcset`);if(n){let e=n.split(`,`)[0].trim().split(/\s+/)[0];if(e&&!q(e))return e}return null}function Ir(e={}){let t=e.pictureResolver&&typeof e.pictureResolver==`object`?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:t.resolveLazySrc!==!1,silent:t.silent??!1,useProxy:typeof e.useProxy==`string`?e.useProxy:``}}async function Lr(e,t={}){if(!e||!(e instanceof Element)||t.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:r,resolveLazySrc:i,silent:a,useProxy:o}=Ir(t);if(!Nr(e,i))return null;let s=[],c=[];async function l(e){let t=new AbortController,r=setTimeout(()=>t.abort(),n);try{let n=await fetch(e,{credentials:`include`,signal:t.signal});if(!n.ok&&o){let r=o.includes(`{url}`)?o.replace(`{url}`,encodeURIComponent(e)):o.endsWith(`?`)?`${o}${encodeURIComponent(e)}`:`${o}${o.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`;n=await fetch(r,{signal:t.signal})}if(!n.ok)return null;let r=await n.blob();return await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)})}catch{return null}finally{clearTimeout(r)}}async function u(e){for(let t=0;t<e.length;t+=r){let n=e.slice(t,t+r);await Promise.allSettled(n.map(e=>e()))}}let d=e.querySelectorAll(`picture`);for(let e of d){let t=e.querySelector(`img`);if(!t||!q(t.getAttribute(`src`)||``))continue;let n=Pr(t,e);n&&c.push(async()=>{let r=await l(n);if(!r){a||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${n.slice(0,60)}`);return}let i=t.getAttribute(`src`),o=t.getAttribute(`srcset`),c=t.getAttribute(`sizes`),u=[];t.src=r,t.setAttribute(`src`,r),t.removeAttribute(`srcset`),t.removeAttribute(`sizes`);let d=e.querySelectorAll(`source`);for(let e of d)u.push({el:e,parent:e.parentElement,next:e.nextSibling}),e.remove();s.push(()=>{i===null?t.removeAttribute(`src`):t.setAttribute(`src`,i),o!==null&&t.setAttribute(`srcset`,o),c!==null&&t.setAttribute(`sizes`,c);for(let{el:e,parent:t,next:n}of u)t&&t.insertBefore(e,n)})})}if(i){let t=e.querySelectorAll(`img`);for(let e of t){if(e.closest(`picture`)&&q(e.getAttribute(`src`)||``))continue;let t=e.getAttribute(`src`)||``,n=Fr(e);n&&q(t)&&c.push(async()=>{let t=await l(n);if(!t)return;let r=e.getAttribute(`src`);e.src=t,e.setAttribute(`src`,t),e.removeAttribute(`srcset`),e.removeAttribute(`sizes`),s.push(()=>{r===null?e.removeAttribute(`src`):e.setAttribute(`src`,r)})})}}return c.length===0?null:(await u(c),async function(){for(let e of s)try{e()}catch{}})}l();var Rr=.92,zr=.95;async function Br(e){let t=new Image;if(t.decoding=`sync`,t.src=e,typeof t.decode==`function`)try{return await t.decode(),t}catch{}return await new Promise((e,n)=>{t.onload=()=>e(),t.onerror=n}),t}function Vr(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:``}async function Hr(e,t,n){if(typeof e!=`string`||!e.startsWith(`data:image`)||e.startsWith(`data:image/svg`))return null;let r;try{r=await Br(e)}catch{return null}let i=r.naturalWidth||r.width,a=r.naturalHeight||r.height;if(!i||!a)return null;let o=Math.min(1,Math.max(t/i,n/a));if(!(o>0)||o>=.95)return null;let s=o*zr,c=Math.max(1,Math.round(i*s)),l=Math.max(1,Math.round(a*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)return null;d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(r,0,0,c,l);let f=Vr(e),p=f===`image/jpeg`?`image/jpeg`:f===`image/webp`?`image/webp`:`image/png`;try{let t=u.toDataURL(p,Rr);if(typeof t==`string`&&t.startsWith(`data:image`)&&t.length<e.length)return t}catch{}return null}async function Ur(e,t){if(!t.compress)return{count:0,before:0,after:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll(`img`)),i=0,a=0,o=0,s=async e=>{let t=e.getAttribute(`src`)||``;if(!t.startsWith(`data:image`)||t.startsWith(`data:image/svg`))return;let r=parseFloat(e.dataset.snapdomWidth)||parseFloat(e.style.width)||e.width||0,s=parseFloat(e.dataset.snapdomHeight)||parseFloat(e.style.height)||e.height||0;if(!r||!s)return;let c=await Hr(t,r*n,s*n);c&&(i++,a+=t.length,o+=c.length,e.setAttribute(`src`,c))};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(s));return{count:i,before:a,after:o}}function Wr(e){return{w:e.offsetWidth||e.getBoundingClientRect().width||0,h:e.offsetHeight||e.getBoundingClientRect().height||0}}async function Gr(e,t){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),r=c.session.nodeMap,i=[],a=[e,...e.querySelectorAll(`*`)];for(let e of a){let t=e.style&&e.style.backgroundImage;t&&t.includes(`data:image`)&&i.push(e)}let o=0,s=async e=>{let t=r.get(e);if(!t||!t.isConnected)return;let i;try{i=getComputedStyle(t)}catch{return}if((i.backgroundRepeat||`repeat`).toLowerCase().split(`,`).some(e=>e.trim()!==`no-repeat`))return;let{w:a,h:s}=Wr(t);if(!a||!s)return;let c=a*n,l=s*n,u=e.style.backgroundImage,d=[...u.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],f=u;for(let e of d){let t=e[2];if(t.startsWith(`data:image/svg`))continue;let n=await Hr(t,c,l);n&&(f=f.split(t).join(n),o++)}f!==u&&(e.style.backgroundImage=f)};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(s));return{count:o}}async function Kr(e,t){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll(`image`)),i=0,a=async e=>{let t=e.getAttribute(`href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(!t||!t.startsWith(`data:image`)||t.startsWith(`data:image/svg`))return;let r=parseFloat(e.getAttribute(`width`))||0,a=parseFloat(e.getAttribute(`height`))||0;if(!r||!a)return;let o=await Hr(t,r*n,a*n);o&&(e.setAttribute(`href`,o),e.hasAttribute(`xlink:href`)&&e.setAttribute(`xlink:href`,o),i++)};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(a));return{count:i}}async function qr(e,t){t.compress&&(await Ur(e,t),await Gr(e,t),await Kr(e,t))}R();function Jr(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow=`none`}catch(e){L(n,`stripRootShadows boxShadow`,e)}try{t.style.textShadow=`none`}catch(e){L(n,`stripRootShadows textShadow`,e)}try{t.style.outline=`none`}catch(e){L(n,`stripRootShadows outline`,e)}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(e){L(n,`stripRootShadows filter`,e)}}function Yr(e){let t=e.display||``;if(t.includes(`flex`)||t.includes(`grid`)||t.startsWith(`table`)||t===`inline-block`||t===`flow-root`||e.position===`absolute`||e.position===`fixed`||e.float&&e.float!==`none`)return!0;let n=e.overflowX||e.overflow||`visible`,r=e.overflowY||e.overflow||`visible`;return!!(n!==`visible`||r!==`visible`||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function Xr(e,t){let n=Array.from(e.childNodes),r=t===`top`?n:n.reverse();for(let e of r){if(e.nodeType===Node.TEXT_NODE){if(/\S/.test(e.textContent||``))return null;continue}if(e.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(e),n=String(t.display||``);if(!(n===`none`||n===`contents`)&&!(t.position===`absolute`||t.position===`fixed`))return t.float&&t.float!==`none`||n.startsWith(`inline`)?null:e}return null}function Zr(e,t){if(!e||!t||!t.style)return;let n=getComputedStyle(e);if(!Yr(n))for(let r of[`top`,`bottom`]){let i=r===`top`?`Top`:`Bottom`;if((parseFloat(n[`border${i}Width`])||0)>0||(parseFloat(n[`padding${i}`])||0)>0)continue;let a=e,o=t;for(;a&&o;){let e=Xr(a,r);if(!e)break;let t=Array.from(a.children).indexOf(e),n=t>=0?o.children[t]:null,s=getComputedStyle(e),c=parseFloat(s[`margin${i}`])||0;if(n&&n.style&&c>0&&(n.style[`margin${i}`]=`0px`),Yr(s)||(parseFloat(s[`border${i}Width`])||0)>0||(parseFloat(s[`padding${i}`])||0)>0)break;a=e,o=n}}}function Qr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let e of n)e.remove()}function $r(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set([`xml`,`xlink`]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let e=i.currentNode;for(let t of Array.from(e.attributes)){let i=t.name;if(i.startsWith(`*`)){e.removeAttribute(i);continue}if(i.includes(`@`)){e.removeAttribute(i);continue}if(i.includes(`:`)){let t=i.split(`:`,1)[0];if(!r.has(t)){e.removeAttribute(i);continue}}if(n&&(i.startsWith(`x-`)||i.startsWith(`v-`)||i.startsWith(`:`)||i.startsWith(`on:`)||i.startsWith(`bind:`)||i.startsWith(`let:`)||i.startsWith(`class:`))){e.removeAttribute(i);continue}}}}var ei=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function ti(e){if(!e)return;let t=e=>{if(e.nodeType===Node.ELEMENT_NODE){if(e.attributes)for(let t of Array.from(e.attributes)){let n=t.value.replace(ei,``);if(n!==t.value)try{e.setAttribute(t.name,n)}catch{}}}else if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.CDATA_SECTION_NODE){let t=e.data.replace(ei,``);t!==e.data&&(e.data=t)}};t(e);let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),r;for(;r=n.nextNode();)t(r)}function ni(e,t={}){e&&($r(e,t),Qr(e),ti(e))}function ri(e){try{let t=e.getAttribute?.(`style`)||``;return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function ii(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function ai(e,t){if(!(e instanceof Element)||ri(e)||ii(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 oi(e,t,n=new Map){function r(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.childElementCount>t.childElementCount,a=n.get(e)||getComputedStyle(e);if(n.has(e)||n.set(e,a),i&&ai(e,a)){t.style.height||(t.style.height=`auto`),t.style.width||(t.style.width=`auto`),t.style.removeProperty(`block-size`),t.style.removeProperty(`inline-size`),t.style.minHeight||(t.style.minHeight=`0`),t.style.minWidth||(t.style.minWidth=`0`),t.style.maxHeight||(t.style.maxHeight=`none`),t.style.maxWidth||(t.style.maxWidth=`none`);let e=a.overflowY||a.overflowBlock||`visible`,n=a.overflowX||a.overflowInline||`visible`;(e!==`visible`||n!==`visible`)&&(t.style.overflow=`visible`)}let o=Array.from(e.children),s=Array.from(t.children);for(let e=0;e<Math.min(o.length,s.length);e++)r(o[e],s[e])}r(e,t)}function si(e){let t=getComputedStyle(e);return!(t.display===`none`||t.position===`absolute`||t.position===`fixed`)}function ci(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(e){L(t,`exclude selector match failed`,e)}return!1}function li(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,a=-1/0,o=!1,s=Array.from(e.children);for(let e of s){if(ci(e,t)||!si(e))continue;let n=e.getBoundingClientRect(),s=n.top-r.top,c=n.bottom-r.top;c<=s||(s<i&&(i=s),c>a&&(a=c),o=!0)}let c=o?Math.max(0,a-i):0,l=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return l+u+d+f+c}var J=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,ui=/::-webkit-scrollbar(-[a-z]+)?\b/i;function di(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+=di(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let e=di(i.cssRules,t);e&&(n+=`@media ${i.conditionText}{${e}}`);continue}if(i.type===CSSRule.STYLE_RULE){let e=i.selectorText||``;if(ui.test(e)){let e=i.cssText;e&&!t.has(e)&&(t.add(e),n+=e)}}}catch{}}return n}function fi(e){if(!e||!e.styleSheets)return``;let t=new Set,n=``;for(let r of Array.from(e.styleSheets))try{let e=r.cssRules;e&&(n+=di(e,t))}catch{}return n}_e();function pi(e){let t=e.boxShadow||``;if(!t||t===`none`)return{top:0,right:0,bottom:0,left:0};let n=[],r=``,i=0;for(let e=0;e<t.length;e++){let a=t[e];a===`(`?i++:a===`)`&&(i=Math.max(0,i-1)),a===`,`&&i===0?(n.push(r),r=``):r+=a}r.trim()&&n.push(r);let a=0,o=0,s=0,c=0;for(let e of n){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(\.\d+)?px/g)?.map(e=>parseFloat(e))||[];if(t.length<2)continue;let[n,r,i=0,l=0]=t,u=Math.abs(n)+i+l,d=Math.abs(r)+i+l;o=Math.max(o,u+Math.max(n,0)),c=Math.max(c,u+Math.max(-n,0)),s=Math.max(s,d+Math.max(r,0)),a=Math.max(a,d+Math.max(-r,0))}return{top:Math.ceil(a),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(c)}}function mi(e){let t=e.filter&&e.filter!==`none`?e.filter:e.webkitFilter||``,n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(t);)r+=parseFloat(i[1])||0;let a=Math.ceil(r);return{top:a,right:a,bottom:a,left:a}}function hi(e){if((e.outlineStyle||`none`)===`none`)return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||`0`)||0),n=parseFloat(e.outlineOffset||`0`)||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function gi(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,a=0,o=0,s=!1;for(let e of n){s=!0;let[t=0,n=0,c=0]=e.match(/-?\d+(?:\.\d+)?px/gi)?.map(e=>parseFloat(e))||[],l=Math.abs(t)+c,u=Math.abs(n)+c;i=Math.max(i,l+Math.max(t,0)),o=Math.max(o,l+Math.max(-t,0)),a=Math.max(a,u+Math.max(n,0)),r=Math.max(r,u+Math.max(-n,0))}return{bleed:{top:J(r),right:J(i),bottom:J(a),left:J(o)},has:s}}function _i(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`){let n=null;try{n=bi(e).scale}catch{}try{t.style.transform=`none`}catch{}if(!n)return{a:1,b:0,c:0,d:1};let r=n.trim().split(/\s+/).map(parseFloat),i=Number.isFinite(r[0])?r[0]:1;return{a:i,b:0,c:0,d:Number.isFinite(r[1])?r[1]:i}}function i(e,t,n,r){let i=Math.sqrt(e*e+t*t)||0,a=0,o=0;if(i>0){let s=e/i,c=t/i;a=s*n+c*r;let l=n-s*a,u=r-c*a;o=Math.sqrt(l*l+u*u)||0,o>0?a/=o:a=0}return{a:i,b:0,c:a*o,d:o}}let a=r.match(/^matrix\(\s*([^)]+)\)$/i);if(a){let e=a[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===6&&e.every(Number.isFinite)){let[n,r,a,o]=e,s=i(n,r,a,o);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}}let o=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(o){let e=o[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===16&&e.every(Number.isFinite)){let n=e[0],r=e[1],a=e[4],o=e[5],s=i(n,r,a,o);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}}try{let e=new DOMMatrix(r),n=i(e.a,e.b,e.c,e.d);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return n}catch{return null}}function vi(e,t,n,r,i){let a=n.a,o=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(e,t){let n=e-r,d=t-i,f=a*n+s*d,p=o*n+c*d;return f+=r+l,p+=i+u,[f,p]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],p=1/0,m=1/0,h=-1/0,g=-1/0;for(let[e,t]of f)e<p&&(p=e),t<m&&(m=t),e>h&&(h=e),t>g&&(g=t);return{minX:p,minY:m,maxX:h,maxY:g,width:h-p,height:g-m}}function yi(e,t,n){let r=(e.transformOrigin||`0 0`).trim().split(/\s+/),[i,a]=[r[0]||`0`,r[1]||`0`],o=(e,t)=>{let n=e.toLowerCase();return n===`left`||n===`top`?0:n===`center`?t/2:n===`right`||n===`bottom`?t:n.endsWith(`px`)?parseFloat(n)||0:n.endsWith(`%`)?(parseFloat(n)||0)*t/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:o(i,t),oy:o(a,n)}}function bi(e){let t={rotate:`0deg`,scale:null,translate:null},n=typeof e.computedStyleMap==`function`?e.computedStyleMap():null;if(n){let r=e=>{try{return typeof n.has==`function`&&!n.has(e)||typeof n.get!=`function`?null:n.get(e)}catch{return null}},i=r(`rotate`);if(i)if(i.angle){let e=i.angle;t.rotate=e.unit===`rad`?e.value*180/Math.PI+`deg`:e.value+e.unit}else i.unit?t.rotate=i.unit===`rad`?i.value*180/Math.PI+`deg`:i.value+i.unit:t.rotate=String(i);else{let n=getComputedStyle(e);t.rotate=n.rotate&&n.rotate!==`none`?n.rotate:`0deg`}let a=r(`scale`);if(a){let e=`x`in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1;t.scale=`${e} ${`y`in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:e}`}else{let n=getComputedStyle(e);t.scale=n.scale&&n.scale!==`none`?n.scale:null}let o=r(`translate`);if(o){let e=`x`in o&&`value`in o.x?o.x.value:Array.isArray(o)?o[0]?.value:0,n=`y`in o&&`value`in o.y?o.y.value:Array.isArray(o)?o[1]?.value:0;t.translate=`${e}${`x`in o&&o.x?.unit?o.x.unit:`px`} ${n}${`y`in o&&o.y?.unit?o.y.unit:`px`}`}else{let n=getComputedStyle(e);t.translate=n.translate&&n.translate!==`none`?n.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 xi=null;function Si(){if(xi)return xi;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),xi=e,e}function Ci(e){let t=Si(),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=Ti(n);return t.removeChild(n),r}function wi(e){let t=j(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`,a=t.translate&&t.translate!==`none`&&t.translate!==`0px 0px`;return!!(r||i||a)}function Ti(e){let t=getComputedStyle(e).transform;if(!t||t===`none`)return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}function Ei(e){if(Array.isArray(e.plugins)){for(let t of e.plugins)if(Er(t)?.name===`picture-resolver`)return!0}return Mr().some(e=>e?.name===`picture-resolver`)}async function Di(e,t){if(!e)throw Error(`Element cannot be null or undefined`);o(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,a={element:e,options:t,plugins:t.plugins},s,l,u,d=``,f=``,p,m,h=null;await K(`beforeSnap`,a);let g=null;t.resolvePicturePlaceholders!==!1&&!Ei(t)&&(g=await Lr(a.element,a.options)),await K(`beforeClone`,a);let _=vr(a.element);try{({clone:s,classCSS:l,styleCache:u}=await fr(a.element,a.options)),!r&&s&&(h=_i(a.element,s)),!i&&s&&Jr(a.element,s,a.options),s&&Zr(a.element,s)}finally{_()}if(a={clone:s,classCSS:l,styleCache:u,...a},await K(`afterClone`,a),g&&await g(),ni(a.clone),a.options?.excludeMode===`remove`)try{oi(a.element,a.clone,a.styleCache)}catch(e){console.warn(`[snapdom] shrink pass failed:`,e)}try{await an(a.clone,a.element)}catch{}await new Promise(e=>{F(async()=>{await gr(a.clone,a.options),e()},{fast:n})}),await new Promise(e=>{F(async()=>{await _r(a.element,a.clone,a.styleCache,a.options),e()},{fast:n})}),t.compress&&await new Promise(e=>{F(async()=>{await qr(a.clone,a.options),e()},{fast:n})}),t.embedFonts&&await new Promise(e=>{F(async()=>{let t=a.element.ownerDocument||document,n=In(a.element),r=Ln(a.element);I()&&await Rn(new Set(Array.from(n).map(e=>String(e).split(`__`)[0]).filter(Boolean)),1,t),d=await Fn({required:n,usedCodepoints:r,preCached:!1,exclude:a.options.excludeFonts,localFonts:a.options.localFonts,useProxy:a.options.useProxy,fontStylesheetDomains:a.options.fontStylesheetDomains,doc:t}),e()},{fast:n})});let v=ne(a.clone).sort(),y=v.join(`,`);c.baseStyle.has(y)?f=c.baseStyle.get(y):await new Promise(e=>{F(()=>{f=re(v),c.baseStyle.set(y,f),e()},{fast:n})});let b=fi(a.element?.ownerDocument||document);a={fontsCSS:d,baseCSS:f,scrollbarCSS:b,...a},await K(`beforeRender`,a),await new Promise(e=>{F(()=>{let n=j(a.element),o=a.element.getBoundingClientRect(),s=Math.max(1,J(a.element.offsetWidth||parseFloat(n.width)||o.width||1)),l=Math.max(1,J(a.element.offsetHeight||parseFloat(n.height)||o.height||1)),u=a.element.ownerDocument||document;if((a.element===u.body||a.element===u.documentElement)&&!u.documentElement.hasAttribute(`data-sd-pinned`)){let e=Math.max(a.element.scrollHeight||0,u.documentElement?.scrollHeight||0,u.body?.scrollHeight||0),t=Math.max(a.element.scrollWidth||0,u.documentElement?.scrollWidth||0,u.body?.scrollWidth||0);e>0&&(l=Math.max(l,J(e))),t>0&&(s=Math.max(s,J(t)));try{let e=(a.scrollbarCSS||``).length+(a.baseCSS||``).length+(a.fontsCSS||``).length+(a.classCSS||``).length,t=c.measureHints.get(a.element);if(t&&t.cssLen===e&&t.w0===s)t.csh>0&&(l=Math.max(l,J(t.csh))),t.csw>0&&(s=Math.max(s,J(t.csw)));else{let t=u.createElement(`div`);t.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+s+`px!important;overflow:visible!important;visibility:hidden!important;`;let n=u.createElement(`style`);n.textContent=(a.scrollbarCSS||``)+a.baseCSS+a.fontsCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+a.classCSS,t.appendChild(n),t.appendChild(a.clone.cloneNode(!0)),u.body.appendChild(t);let r=t.scrollHeight,i=t.scrollWidth;u.body.removeChild(t),c.measureHints.set(a.element,{cssLen:e,w0:s,csh:r,csw:i}),r>0&&(l=Math.max(l,J(r))),i>0&&(s=Math.max(s,J(i)))}}catch{}}if(a.options?.excludeMode===`remove`){let e=li(a.element,a.options);Number.isFinite(e)&&e>0&&(l=Math.max(1,Math.min(l,J(e+1))))}let d=(e,t=NaN)=>{let n=typeof e==`string`?parseFloat(e):e;return Number.isFinite(n)?n:t},f=d(a.options.width),g=d(a.options.height),_=s,v=l,y=Number.isFinite(f),b=Number.isFinite(g),x=l>0?s/l:1;y&&b?(_=Math.max(1,J(f)),v=Math.max(1,J(g))):y?(_=Math.max(1,J(f)),v=Math.max(1,J(_/(x||1)))):b?(v=Math.max(1,J(g)),_=Math.max(1,J(v*(x||1)))):(_=s,v=l);let S=0,C=0,w=s,T=l;if(!r&&h&&Number.isFinite(h.a)){let e={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},t=vi(s,l,e,0,0);S=J(t.minX),C=J(t.minY),w=J(t.maxX),T=J(t.maxY)}else if(r&&Oi(a.element)){let e=n.transform&&n.transform!==`none`?n.transform:``,t=bi(a.element),r=Ci({baseTransform:e,rotate:t.rotate||`0deg`,scale:t.scale,translate:t.translate}),{ox:i,oy:o}=yi(n,s,l),c=r.is2D?r:new DOMMatrix(r.toString()),u=vi(s,l,c,i,o);S=J(u.minX),C=J(u.minY),w=J(u.maxX),T=J(u.maxY)}let E=pi(n),D=mi(n),O=hi(n),k=gi(n),A=i?{top:J(E.top+D.top+O.top+k.bleed.top),right:J(E.right+D.right+O.right+k.bleed.right),bottom:J(E.bottom+D.bottom+O.bottom+k.bleed.bottom),left:J(E.left+D.left+O.left+k.bleed.left)}:{top:0,right:0,bottom:0,left:0};S=J(S-A.left),C=J(C-A.top),w=J(w+A.right),T=J(T+A.bottom);let ee=Math.max(1,J(w-S)),te=Math.max(1,J(T-C)),ne=y||b?J(_/s):1,re=b||y?J(v/l):1,ie=Math.max(1,J(ee*ne)),ae=Math.max(1,J(te*re)),oe=`http://www.w3.org/2000/svg`,M=J((I()&&Oi(a.element)?1:0)+ +!r),N=document.createElementNS(oe,`foreignObject`),se=J(S),ce=J(C);N.setAttribute(`x`,String(J(-(se-M)))),N.setAttribute(`y`,String(J(-(ce-M)))),N.setAttribute(`width`,String(J(s+M*2))),N.setAttribute(`height`,String(J(l+M*2))),N.style.overflow=`visible`;let le=document.createElement(`style`);le.textContent=(a.scrollbarCSS||``)+a.baseCSS+a.fontsCSS+`svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}`+a.classCSS,N.appendChild(le);let P=document.createElement(`div`);P.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),P.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${J(s)}px;height:${J(l)}px`,P.appendChild(a.clone),N.appendChild(P);let ue=new XMLSerializer().serializeToString(N),de=J(ee+M*2),fe=J(te+M*2),pe=y||b;t.meta={w0:s,h0:l,vbW:de,vbH:fe,targetW:_,targetH:v},m=`<svg xmlns="${oe}" width="${I()&&pe?de:J(ie+M*2)}" height="${I()&&pe?fe:J(ae+M*2)}" viewBox="0 0 ${de} ${fe}" font-size="${parseFloat(j(u.documentElement)?.fontSize)||16}px">`+ue+`</svg>`,p=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,a={svgString:m,dataURL:p,...a},e()},{fast:n})}),await K(`afterRender`,a);let x=document.getElementById(`snapdom-sandbox`);return x&&x.style.position===`absolute`&&x.remove(),a.dataURL}function Oi(e){return wi(e)}l();function ki(e={}){let t=e.format??`png`;t===`jpg`&&(t=`jpeg`);let n=a(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,compress:e.compress!==!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1,pictureResolver:e.pictureResolver&&typeof e.pictureResolver==`object`?e.pictureResolver:{}}}be(),xe(),R(),E(),l();function Ai(...e){return Dr(...e),Y}var Y=Object.assign(Pi,{plugins:Ai}),ji=Symbol(`snapdom.internal`),Mi=Symbol(`snapdom.internal.silent`),Ni=!1;async function Pi(e,t){if(!e)throw Error(`Element cannot be null or undefined`);let n=ki(t);if(jr(n,t&&t.plugins),I()&&(n.embedFonts===!0||Ii(e))){if(n.embedFonts)try{let t=In(e);await Rn(new Set([...t].map(e=>String(e).split(`__`)[0]).filter(Boolean)),1)}catch{}let r=n.safariWarmupAttempts??3;for(let n=0;n<r;n++)try{await Fi(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&Xt(n.iconFonts),n.snap||(n.snap={toPng:(e,t)=>Y.toPng(e,t),toSvg:(e,t)=>Y.toSvg(e,t)}),Y.capture(e,n,ji)}Y.capture=async(e,t,n)=>{if(n!==ji)throw Error(`[snapdom.capture] is internal. Use snapdom(...) instead.`);let r=await Di(e,t),i={img:async(e,t)=>{let{toImg:n}=await Promise.resolve().then(()=>(Ve(),ze));return n(r,{...e,...t||{}})},svg:async(e,t)=>{let{toSvg:n}=await Promise.resolve().then(()=>(Ve(),ze));return n(r,{...e,...t||{}})},canvas:async(e,t)=>{let{toCanvas:n}=await Promise.resolve().then(()=>(Fe(),Se));return n(r,{...e,...t||{}})},blob:async(e,t)=>{let{toBlob:n}=await Promise.resolve().then(()=>(We(),He));return n(r,{...e,...t||{}})},png:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Re(),Ie));return n(r,{...e,...t||{},format:`png`})},jpeg:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Re(),Ie));return n(r,{...e,...t||{},format:`jpeg`})},webp:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Re(),Ie));return n(r,{...e,...t||{},format:`webp`})},download:async(e,t)=>{let{download:n}=await Promise.resolve().then(()=>(Je(),Ge));return n(r,{...e,...t||{}})}},a={};for(let e of[`img`,`svg`,`canvas`,`blob`,`png`,`jpeg`,`webp`])a[e]=async n=>i[e](t,{...n||{},[Mi]:!0});a.jpg=a.jpeg;let o=await kr(`defineExports`,{...t,export:{url:r},exports:a}),s=Object.assign({},...o.filter(e=>e&&typeof e==`object`).reverse()),c={...i,...s};c.jpeg&&!c.jpg&&(c.jpg=(e,t)=>c.jpeg(e,t));function l(e,n){let r={...t,...n||{}};return[e,r.format,r.type].map(e=>typeof e==`string`?e.toLowerCase():``).find(e=>e===`jpeg`||e===`jpg`||e===`webp`)&&(r.backgroundColor==null||r.backgroundColor===`transparent`)&&(r.backgroundColor=`#ffffff`),r}let u=!1,d=Promise.resolve();async function f(e,n){return d=d.then(async()=>{let i=c[e];if(!i)throw Error(`[snapdom] Unknown export type: ${e}`);let a=l(e,n),o={...t,export:{type:e,options:a,url:r}};await K(`beforeExport`,o,{format:e,options:a});let s=await i(o,a);return await K(`afterExport`,o,{format:e,options:a,result:s}),u||(u=!0,await K(`afterSnap`,t)),s})}let p={url:r,toRaw:()=>r,to:(e,t)=>f(e,t),toImg:e=>f(`img`,e),toSvg:e=>f(`svg`,e),toCanvas:e=>f(`canvas`,e),toBlob:e=>f(`blob`,e),toPng:e=>f(`png`,e),toJpg:e=>f(`jpg`,e),toWebp:e=>f(`webp`,e),download:e=>f(`download`,e)};for(let e of Object.keys(c)){let t=`to`+e.charAt(0).toUpperCase()+e.slice(1);p[t]||(p[t]=t=>f(e,t))}return p},Y.toRaw=(e,t)=>Y(e,t).then(e=>e.toRaw()),Y.toImg=(e,t)=>Y(e,t).then(e=>e.toImg()),Y.toSvg=(e,t)=>Y(e,t).then(e=>e.toSvg()),Y.toCanvas=(e,t)=>Y(e,t).then(e=>e.toCanvas()),Y.toBlob=(e,t)=>Y(e,t).then(e=>e.toBlob()),Y.toPng=(e,t)=>Y(e,{...t,format:`png`}).then(e=>e.toPng()),Y.toJpg=(e,t)=>Y(e,{...t,format:`jpeg`}).then(e=>e.toJpg()),Y.toWebp=(e,t)=>Y(e,{...t,format:`webp`}).then(e=>e.toWebp()),Y.download=(e,t)=>Y(e,t).then(e=>e.download());async function Fi(e,t){if(Ni)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Di(e,n)}catch(e){L(t,`safariWarmup pre-capture failed`,e)}await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))),r&&await new Promise(e=>{let n=new Image;try{n.decoding=`sync`,n.loading=`eager`}catch(e){L(t,`safariWarmup img hints failed`,e)}n.style.cssText=`position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;`,n.src=r,document.body.appendChild(n),(async()=>{try{typeof n.decode==`function`&&await n.decode()}catch(e){L(t,`safariWarmup img.decode failed`,e)}let r=performance.now();for(;!(n.complete&&n.naturalWidth>0)&&performance.now()-r<900;)await new Promise(e=>setTimeout(e,200));await new Promise(e=>requestAnimationFrame(e));try{let e=document.createElement(`canvas`);e.width=Math.max(1,n.naturalWidth||10),e.height=Math.max(1,n.naturalHeight||10);let t=e.getContext(`2d`);t&&t.drawImage(n,0,0)}catch{}await new Promise(e=>requestAnimationFrame(e));try{n.remove()}catch(e){L(t,`safariWarmup img.remove failed`,e)}e()})()}),e.querySelectorAll(`canvas`).forEach(e=>{try{let t=e.getContext(`2d`,{willReadFrequently:!0});t&&t.getImageData(0,0,1,1)}catch(e){L(t,`safariWarmup canvas poke failed`,e)}}),Ni=!0}function Ii(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let e=t.currentNode,n=getComputedStyle(e),r=n.backgroundImage&&n.backgroundImage!==`none`,i=n.maskImage&&n.maskImage!==`none`||n.webkitMaskImage&&n.webkitMaskImage!==`none`;if(r||i||e.tagName===`CANVAS`)return!0}return!1}var Li={scale:1,backgroundColor:`#ffffff`};function Ri(e){return Y.toBlob(e,{...Li,type:`png`})}async function zi(e){let t=await Y.toCanvas(document.documentElement,Li),n=Math.max(1,Math.round(e.width)),r=Math.max(1,Math.round(e.height)),i=document.createElement(`canvas`);i.width=n,i.height=r;let a=i.getContext(`2d`);if(!a)throw Error(`could not create a 2d context for the region crop`);return a.drawImage(t,e.x+window.scrollX,e.y+window.scrollY,n,r,0,0,n,r),await new Promise((e,t)=>{i.toBlob(n=>n?e(n):t(Error(`region toBlob failed`)),`image/png`)})}function Bi(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/([^A-Za-z0-9_-])/g,`\\$1`)}function Vi(e){let t=[],n=e;for(;n&&n.nodeType===1;){if(n.id){t.unshift(`#${Bi(n.id)}`);break}let e=n.localName,r=n.parentElement;if(r){let t=Array.from(r.children).filter(e=>e.localName===n?.localName);t.length>1&&(e+=`:nth-of-type(${t.indexOf(n)+1})`)}t.unshift(e),n=n.parentElement}return t.join(` > `)}function Hi(e){let t=e.id?`#${e.id}`:``,n=typeof e.className==`string`?e.className.trim():``,r=n?`.${n.split(/\s+/)[0]}`:``,i=(e.textContent??``).replace(/\s+/g,` `).trim().slice(0,40),a=i?` "${i}"`:``;return`${e.localName}${t}${r}${a}`}function Ui(){return{width:window.innerWidth,height:window.innerHeight}}var Wi=`2147483646`,Gi=`#378ADD`;function Ki(e){let t=`off`,n=!1,r={x:0,y:0},i=document.createElement(`div`);i.setAttribute(`data-chamba-annotate`,`root`),X(i,{position:`fixed`,inset:`0`,zIndex:Wi,pointerEvents:`none`,fontFamily:`-apple-system, system-ui, sans-serif`});let a=document.createElement(`div`);X(a,{position:`fixed`,display:`none`,border:`2px solid ${Gi}`,background:`rgba(55,138,221,0.12)`,borderRadius:`3px`,boxSizing:`border-box`,transition:`all 60ms ease-out`});let o=document.createElement(`div`);X(o,{position:`fixed`,display:`none`,border:`2px dashed ${Gi}`,background:`rgba(55,138,221,0.10)`,boxSizing:`border-box`});let s=document.createElement(`div`);X(s,{position:`fixed`,top:`12px`,left:`50%`,transform:`translateX(-50%)`,display:`none`,padding:`6px 12px`,borderRadius:`999px`,background:`#2C2C2A`,color:`#FCFBF8`,fontSize:`12px`,boxShadow:`0 2px 10px rgba(0,0,0,0.25)`,whiteSpace:`nowrap`}),i.append(a,o,s);let c=(e,t)=>{let n=document.elementFromPoint(e,t);return!n||n===i||i.contains(n)?null:n},l=e=>{let t=e.getBoundingClientRect();X(a,{display:`block`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})},u=e=>{if(t===`annotate`){let t=c(e.clientX,e.clientY);t&&l(t)}else t===`region`&&n&&Ji(o,qi(r,{x:e.clientX,y:e.clientY}))},d=e=>{e.relatedTarget||(a.style.display=`none`)},f=e=>{e.preventDefault(),e.stopImmediatePropagation()},p=n=>{if(t===`off`||(f(n),t!==`annotate`))return;let r=c(n.clientX,n.clientY);r&&e.onPick(r)},m=e=>{if(t===`annotate`){f(e);return}t===`region`&&(f(e),n=!0,r={x:e.clientX,y:e.clientY},Ji(o,{x:e.clientX,y:e.clientY,width:0,height:0}))},h=i=>{if(t===`annotate`){f(i);return}if(t===`region`&&n){f(i),n=!1;let t=qi(r,{x:i.clientX,y:i.clientY});o.style.display=`none`,t.width>=8&&t.height>=8&&e.onRegion(t)}},g=t=>{t.key===`Escape`&&e.onExit()},_=e=>{t!==`off`&&f(e)},v=[[`mousemove`,u,!0],[`mouseout`,d,!0],[`click`,p,!0],[`mousedown`,m,!0],[`mouseup`,h,!0],[`dblclick`,_,!0],[`contextmenu`,_,!0],[`keydown`,g,!0]],y=()=>{for(let[e,t,n]of v)document.addEventListener(e,t,n)},b=()=>{for(let[e,t,n]of v)document.removeEventListener(e,t,n)},x=e=>{if(e===t)return;let r=t===`off`;if(t=e,n=!1,a.style.display=`none`,o.style.display=`none`,t===`off`){s.style.display=`none`,document.documentElement.style.cursor=``,i.isConnected&&i.remove(),b();return}s.textContent=t===`annotate`?`Annotate - click an element to comment · Esc to stop`:`Region - drag a box to screenshot · Esc to stop`,s.style.display=`block`,document.documentElement.style.cursor=`crosshair`,i.isConnected||document.documentElement.appendChild(i),r&&y()};return{setMode:x,destroy:()=>x(`off`)}}function qi(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}function Ji(e,t){X(e,{display:`block`,left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})}function X(e,t){Object.assign(e.style,t)}var Yi=`bippy-0.6.0`,Xi=Object.defineProperty,Zi=Object.prototype.hasOwnProperty,Qi=()=>{},$i=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},ea=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e),ta=!1,na,ra=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>ta?!0:(e&&typeof e.inject==`function`&&(na=e.inject.toString()),!!na?.includes(`(injected)`)),ia=new Set,aa=new Set,oa=e=>{e&&ia.add(e);let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:Yi,checkDCE:$i,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),aa.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,ia.forEach(e=>e())),i},on:Qi,onCommitFiberRoot:Qi,onCommitFiberUnmount:Qi,onPostCommitFiberRoot:Qi,renderers:t,supportsFiber:!0,supportsFlight:!0};try{Xi(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{aa.add(e),t.renderers.set(n,e)}),sa(e))}}});let t=window.hasOwnProperty,n=!1;Xi(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{sa(e)}return r},sa=e=>{e&&ia.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=$i,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Yi,t._instrumentationIsActive=!1;let e=ea(t);if(e||(t.on=Qi),t.renderers.size){t._instrumentationIsActive=!0,ia.forEach(e=>e());return}let n=t.inject,r=ra(t);r&&!e&&(ta=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return aa.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,ia.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||ra())&&e?.()}catch{}},ca=()=>Zi.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),la=e=>ca()?(sa(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):oa(e),ua=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));(()=>{try{ua()&&la()}catch{}})();var da=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},fa=e=>!e||typeof e!=`object`?!1:`pendingProps`in e&&!(`containerInfo`in e);function pa(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await ha(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=ma(i,t,n);if(e)return e;i=n?null:i.sibling}return null}var ma=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=ma(r,t,n);if(e)return e;r=n?null:r.sibling}return null},ha=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await ha(r,t,n);if(e)return e;r=n?null:r.sibling}return null},ga=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?ga(t.type||t.render):null},_a=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=ga(t);return r&&(r.displayName||r.name)||null},va=new Set,ya=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),ba=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;let t=e.__internalInstanceHandle??e._internalInstanceHandle;if(fa(t))return t;let n=e;for(let e of va){let t=n[e];if(t)return t}for(let e of Object.keys(n))if(ya(e))return va.add(e),n[e]||null}return null},xa=[`rsc://`,`about://React/`],Sa=/\(at [^)]+\)$/,Ca=[`react_stack_bottom_frame`,`react-stack-bottom-frame`],wa=/(^|@)\S+:\d+/,Ta=/^\s*at .*(\S+:\d+|\(native\))/m,Ea=/^(eval@)?(\[native code\])?$/,Da=(e,t)=>{if(t?.includeInElement!==!1){let n=e.split(`
9
+ `),r=[];for(let e of n)if(/^\s*at\s+/.test(e)){let t=Aa(e,void 0)[0];t&&r.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*\(at .*\)$/,``);r.push({functionName:t,source:e})}else if(e.match(wa)){let t=ja(e,void 0)[0];t&&r.push(t)}return ka(r,t)}return e.match(Ta)?Aa(e,t):ja(e,t)},Oa=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},ka=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,Aa=(e,t)=>ka(e.split(`
10
+ `).filter(e=>!!e.match(Ta)),t).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=Oa(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),ja=(e,t)=>ka(e.split(`
11
+ `).filter(e=>!e.match(Ea)),t).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=Oa(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}}),Ma=new WeakMap,Na=e=>Ca.some(t=>e.includes(t)),Pa=e=>{let t=e.getFunctionName?.()??``;if(t)return t;let n=e.getTypeName?.()??``,r=e.getMethodName?.()??``;return n&&r?`${n}.${r}`:r},Fa=e=>{let t=[];for(let n=1;n<e.length;n++){let r=e[n],i=Pa(r);if(Na(i))return{frames:t,isTrusted:!0};if(r.isNative?.()){t.push({functionName:i||void 0});continue}let a=r.getScriptNameOrSourceURL?.()??``;!a&&r.isEval?.()&&(a=r.getEvalOrigin?.()??``),t.push({functionName:i&&i!==`<anonymous>`?i:void 0,fileName:a&&a!==`<anonymous>`?a:void 0,lineNumber:r.getLineNumber?.()??void 0,columnNumber:r.getColumnNumber?.()??void 0,enclosingLineNumber:r.getEnclosingLineNumber?.()??void 0,enclosingColumnNumber:r.getEnclosingColumnNumber?.()??void 0,source:` at ${r.toString()}`})}return{frames:t,isTrusted:!1}},Ia=e=>{let t=-1;for(let n of Ca)if(t=e.indexOf(n),t!==-1)break;return{frames:Da(t===-1?e:e.slice(0,e.lastIndexOf(`
12
+ `,t))).slice(1),isTrusted:t!==-1}},La=e=>{let t=Ma.get(e);if(t)return t;let n=null,r=(e,t)=>{n=Fa(t);let r=`${e.name||`Error`}: ${e.message||``}`;for(let e of t)r+=`\n at ${e.toString()}`;return r},i=Error.prepareStackTrace;Error.prepareStackTrace=r;let a;try{a=String(e.stack)}finally{Error.prepareStackTrace=i}let o=n??Ia(a);return Ma.set(e,o),o},Ra=44,za=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ba=new Uint8Array(64),Va=new Uint8Array(128);for(let e=0;e<za.length;e++){let t=za.charCodeAt(e);Ba[e]=t,Va[t]=e}function Ha(e,t){let n=0,r=0,i=0;do i=Va[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function Ua(e,t){return e.pos>=t?!1:e.peek()!==Ra}var Wa=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function Ga(e){let{length:t}=e,n=new Wa(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i=Ha(n,i),i<u&&(l=!1),u=i,Ua(n,e)?(a=Ha(n,a),o=Ha(n,o),s=Ha(n,s),Ua(n,e)?(c=Ha(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||Ka(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function Ka(e){e.sort(qa)}function qa(e,t){return e[0]-t[0]}var Ja=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Ya=/^data:application\/json[^,]+base64,/,Xa=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Za=new Map,Qa=new Map,$a=(e,t,n,r,i)=>{if(n<0||n>=e.length)return null;let a=e[n];if(!a||a.length===0)return null;let o=null,s=0,c=a.length-1;for(;s<=c;){let e=s+c>>1;a[e][0]<=r?(o=a[e],s=e+1):c=e-1}if(!o||o.length<4)return null;let[,l,u,d]=o;if(l===void 0||u===void 0||d===void 0)return null;let f=t[l];return f?{columnNumber:d,fileName:f,lineNumber:u+1,isIgnoreListed:i?.has(l)??!1}:null},eo=(e,t,n)=>{if(e.sections){let r=t-1,i=null;for(let t of e.sections)if(r>t.offset.line||r===t.offset.line&&n>=t.offset.column)i=t;else break;if(!i)return null;let a=r-i.offset.line,o=r===i.offset.line?n-i.offset.column:n;return $a(i.map.mappings,i.map.sources,a,o,i.map.ignoredSourceIndices)}return $a(e.mappings,e.sources,t-1,n,e.ignoredSourceIndices)},to=(e,t)=>{let n,r=t.length;for(;r>0&&!n;){let e=t.lastIndexOf(`
13
+ `,r-1)+1,i=t.slice(e,r).match(Xa);i&&(n=i[1]||i[2]),r=e-1}if(!n)return null;let i=Ja.test(n);if(!(Ya.test(n)||i||n.startsWith(`/`))){let t=e.split(`/`);t[t.length-1]=n,n=t.join(`/`)}return n},no=e=>{let t=e.ignoreList??e.x_google_ignoreList;return Array.isArray(t)&&t.length>0?new Set(t):void 0},ro=e=>({file:e.file,ignoredSourceIndices:no(e),mappings:Ga(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),io=e=>{let t=e.sections.map(({map:e,offset:t})=>({map:{...e,ignoredSourceIndices:no(e),mappings:Ga(e.mappings)},offset:t})),n=new Set;for(let e of t)for(let t of e.map.sources)n.add(t);return{file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},ao=e=>{if(!e)return!1;let t=e.trim();if(!t)return!1;let n=t.match(Ja);if(!n)return!0;let r=n[0].toLowerCase();return r===`http:`||r===`https:`},oo=async(e,t=fetch)=>{if(!ao(e))return null;let n=await t(e);if(!n.ok)return null;let r=await n.text();if(!r)return null;let i=to(e,r);if(!i||!ao(i)&&!Ya.test(i))return null;let a=await t(i);if(!a.ok)return null;try{let e=await a.json();return`sections`in e?io(e):ro(e)}catch{return null}},so=async(e,t=!0,n)=>{if(t&&Za.has(e))return Za.get(e)??null;let r=t?Qa.get(e):void 0;if(r)return(await r).sourceMap;let i=oo(e,n).then(e=>({sourceMap:e,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));t&&Qa.set(e,i);let{sourceMap:a,isTransientFailure:o}=await i;return t&&(Qa.delete(e),o||Za.set(e,a)),a},co=async(e,t=!0,n)=>await Promise.all(e.map(async e=>{if(!e.fileName)return e;let r=await so(e.fileName,t,n);if(!r||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let i=eo(r,e.lineNumber,e.columnNumber);return i?{...e,source:i.fileName&&e.source?e.source.replace(e.fileName,i.fileName):e.source,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,isIgnoreListed:i.isIgnoreListed,isSymbolicated:!0}:e})),lo=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,uo=e=>{let t=null;if(pa(e,n=>{if(n===e)return!1;let r=n._debugOwner;return(r===e||e.alternate!==null&&r===e.alternate)&&n._debugStack instanceof Error?(t=n._debugStack,!0):!1}),!t)return null;let{frames:n,isTrusted:r}=La(t);if(!r)return null;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.fileName)return{...t,lineNumber:t.enclosingLineNumber||t.lineNumber,columnNumber:t.enclosingColumnNumber||t.columnNumber}}return null},fo=()=>{let e=la();for(let t of[...Array.from(aa),...Array.from(e.renderers.values())]){let e=t.currentDispatcherRef;if(e&&typeof e==`object`)return`H`in e?e.H:e.current}return null},po=e=>{for(let t of aa){let n=t.currentDispatcherRef;n&&typeof n==`object`&&(`H`in n?n.H=e:n.current=e)}},Z=e=>`\n in ${e}`,mo=(e,t)=>{let n=Z(e);return t&&(n+=` (at ${t})`),n},ho=!1,go=new WeakMap,_o=(e,t)=>{if(!e||ho)return``;let n=go.get(e);if(n!==void 0)return n;let r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,ho=!0;let i=fo();po(null);let a=console.error,o=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let n;try{if(t){let t=function(){throw Error()};if(Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){n=e}let t=e();t&&typeof t.catch==`function`&&t.catch(()=>{})}}catch(e){if(e instanceof Error&&n instanceof Error&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`,Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,`name`)?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});let[r,i]=n.DetermineComponentFrameRoot();if(r&&i){let t=r.split(`
14
+ `),n=i.split(`
15
+ `),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,r=_a(e);return r&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,r)),go.set(e,n),n}while(a>=1&&o>=0);break}}}finally{ho=!1,Error.prepareStackTrace=r,po(i),console.error=a,console.warn=o}let s=e?_a(e):``,c=s?Z(s):``;return go.set(e,c),c},vo=(e,t)=>{let n=e.tag,r=``;switch(n){case 28:r=Z(`Activity`);break;case 1:r=_o(e.type,!0);break;case 11:r=_o(e.type.render,!1);break;case 0:case 15:r=_o(e.type,!1);break;case 5:case 26:case 27:r=Z(e.type);break;case 16:r=Z(`Lazy`);break;case 13:r=e.child!==t&&t!==null?Z(`Suspense Fallback`):Z(`Suspense`);break;case 19:r=Z(`SuspenseList`);break;case 30:r=Z(`ViewTransition`);break;default:return``}return r},yo=e=>{try{let t=``,n=e,r=null;do{t+=vo(n,r);let e=n._debugInfo;if(e&&Array.isArray(e))for(let n=e.length-1;n>=0;n--){let r=e[n];typeof r.name==`string`&&(t+=mo(r.name,r.env))}r=n,n=n.return}while(n);return t}catch(e){return e instanceof Error?`\nError generating stack: ${e.message}\n${e.stack}`:``}},bo=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return``;Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
16
+ `)&&(n=n.slice(29));let r=n.indexOf(`
17
+ `);r!==-1&&(n=n.slice(r+1));let i=Math.max(n.indexOf(`react_stack_bottom_frame`),n.indexOf(`react-stack-bottom-frame`));if(i!==-1&&(i=n.lastIndexOf(`
18
+ `,i)),i!==-1)n=n.slice(0,i);else return``;return n},xo=e=>!!(e.functionName&&e.fileName&&To(e.fileName)),So=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Co=e=>{let t=new Map;for(let n of e)for(let e of n.stackFrames){if(!xo(e))continue;let n=e.functionName,r=t.get(n)??[];r.some(t=>So(t,e))||(r.push(e),t.set(n,r))}return t},wo=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(`(at Server)`,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},To=e=>xa.some(t=>e.startsWith(t)),Eo=e=>{let t=[];return pa(e,e=>{if(!lo(e))return;let n=typeof e.type==`string`?e.type:_a(e.type)||`<anonymous>`;t.push({componentName:n,stackFrames:Da(bo(e._debugStack?.stack))})},!0),t},Do=async(e,t=!0,n)=>{let r=Eo(e),i=Da(yo(e)),a=Co(r),o=new Map;return co(i.map(e=>(e.source?.includes(`(at Server)`)??!1)||e.source!=null&&Sa.test(e.source)?wo(e,a,o):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName}),t,n)},Oo=e=>{let t=e._debugSource;return t?typeof t==`object`&&!!t&&`fileName`in t&&typeof t.fileName==`string`&&`lineNumber`in t&&typeof t.lineNumber==`number`:!1},ko=e=>e.fileName?{fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,functionName:e.functionName}:null,Ao=e=>{if(!lo(e))return null;let{frames:t,isTrusted:n}=La(e._debugStack);if(!n)return null;for(let e of t)if(e.fileName)return e;return null},jo=async(e,t=!0,n)=>{if(Oo(e))return e._debugSource||null;let r=Ao(e)??uo(e);if(r){let[e]=await co([r],t,n),i=ko(e);if(i)return i}let i=await Do(e,t,n);for(let e of i)if(e.fileName)return ko(e);return null},Mo=Symbol.for(`react.context`),No=Symbol.for(`react.memo_cache_sentinel`),Po=[],Fo=null,Io=null,Lo=null,Ro=0,zo=null,Bo=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render."),Q=()=>{let e=Io;return e!==null&&(Io=e.next),e},Vo=e=>{if(Fo===null)return e._currentValue;if(Lo===null)throw Error(`Context reads do not line up with context dependencies.`);if(Object.prototype.hasOwnProperty.call(Lo,`memoizedValue`)){let e=Lo.memoizedValue;return Lo=Lo.next,e}return e._currentValue},$=(e,t,n,r=null)=>{Po.push({displayName:r,primitive:e,stackError:Error(),value:t,dispatcherHookName:n})},Ho=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.then==`function`){let e=zo!==null&&Ro<zo.length?zo[Ro++]:t;switch(e.status){case`fulfilled`:return $(`Promise`,e.value,`Use`),e.value;case`rejected`:throw e.reason}throw $(`Unresolved`,e,`Use`),Bo}if(t.$$typeof===Mo&&`_currentValue`in t){let e=t,n=Vo(e);return $(`Context (use)`,n,`Use`,e.displayName||`Context`),n}}throw Error(`An unsupported type was passed to use(): `+String(e))},Uo=e=>{let t=Vo(e);return $(`Context`,t,`Context`,e.displayName||null),t},Wo=e=>{let t=Q(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return $(`State`,n,`State`),[n,()=>{}]},Go=(e,t,n)=>{let r=Q(),i=r===null?n===void 0?t:n(t):r.memoizedState;return $(`Reducer`,i,`Reducer`),[i,()=>{}]},Ko=e=>{let t=Q(),n=t===null?{current:e}:t.memoizedState;return $(`Ref`,n.current,`Ref`),n},qo=()=>{let e=Q();return $(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},Jo=e=>{Q(),$(`LayoutEffect`,e,`LayoutEffect`)},Yo=e=>{Q(),$(`InsertionEffect`,e,`InsertionEffect`)},Xo=e=>{Q(),$(`Effect`,e,`Effect`)},Zo=e=>{Q();let t;typeof e==`object`&&e&&`current`in e&&(t=e.current),$(`ImperativeHandle`,t,`ImperativeHandle`)},Qo=(e,t)=>{$(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},$o=e=>{let t=Q();return $(`Callback`,t===null?e:t.memoizedState[0],`Callback`),e},es=e=>{let t=Q(),n=t===null?e():t.memoizedState[0];return $(`Memo`,n,`Memo`),n},ts=(e,t)=>{let n=Q();Q();let r=n===null?t():n.memoizedState;return $(`SyncExternalStore`,r,`SyncExternalStore`),r},ns=()=>{let e=Q();Q();let t=e!==null&&e.memoizedState;return $(`Transition`,t,`Transition`),[t,()=>{}]},rs=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`DeferredValue`,n,`DeferredValue`),n},is=()=>{let e=Q(),t=e===null?``:e.memoizedState;return $(`Id`,t,`Id`),t},as=e=>{let t=Fo;if(t==null)return[];let n=t.updateQueue?.memoCache;if(n==null)return[];let r=n.data[n.index];return r===void 0&&(r=n.data[n.index]=Array.from({length:e},()=>No)),n.index++,r},os=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`Optimistic`,n,`Optimistic`),[n,()=>{}]},ss=(e,t)=>{let n,r=null;if(e!==null){let t=e.memoizedState;if(typeof t==`object`&&t&&`then`in t&&typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:n=e.value;break;case`rejected`:r=e.reason;break;default:r=Bo,n=e}}else n=t}else n=t;return{value:n,error:r}},cs=e=>(t,n)=>{let r=Q();Q(),Q();let i=Error(),{value:a,error:o}=ss(r,n);if(Po.push({displayName:null,primitive:e,stackError:i,value:a,dispatcherHookName:e}),o!==null)throw o;return[a,()=>{},!1]},ls=cs(`ActionState`),us={readContext:Vo,use:Ho,useCallback:$o,useContext:Uo,useEffect:Xo,useImperativeHandle:Zo,useLayoutEffect:Jo,useInsertionEffect:Yo,useMemo:es,useReducer:Go,useRef:Ko,useState:Wo,useDebugValue:Qo,useDeferredValue:rs,useTransition:ns,useSyncExternalStore:ts,useId:is,useHostTransitionStatus:()=>{let e=Vo({_currentValue:null});return $(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:cs(`FormState`),useActionState:ls,useOptimistic:os,useMemoCache:as,useCacheRefresh:qo,useEffectEvent:e=>(Q(),$(`EffectEvent`,e,`EffectEvent`),e)};typeof Proxy>`u`||new Proxy(us,{get(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=Error(`Missing method in Dispatcher: `+t);throw n.name=`ReactDebugToolsUnsupportedHookError`,n}});var ds=2e3;function fs(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e?.renderers&&e.renderers.size>0)return!0;let t=document.querySelector(`#root, #__next, [data-reactroot]`)??document.body;if(!t)return!1;for(let e of[t,...Array.from(t.children).slice(0,4)])if(Object.keys(e).some(e=>e.startsWith(`__reactFiber$`)||e.startsWith(`__reactContainer$`)))return!0;return!1}async function ps(e){let t=hs(e);if(!t)return null;let n=(da(t)?t:pa(t,e=>da(e),!0))??t,r=gs(n);if(!r)return null;let i=await _s(n);return i&&ms(i.file)?null:{name:r,...i?{source:i}:{}}}function ms(e){return e.includes(`node_modules`)}function hs(e){try{return ba(e)}catch{return null}}function gs(e){try{return _a(e.type)}catch{return null}}async function _s(e){try{let t=await vs(jo(e,!0),ds,null);return t?.fileName?{file:t.fileName,...t.lineNumber?{line:t.lineNumber}:{},...t.columnNumber?{column:t.columnNumber}:{}}:void 0}catch{return}}function vs(e,t,n){return new Promise(r=>{let i=!1,a=setTimeout(()=>{i||(i=!0,r(n))},t),o=e=>{i||(i=!0,clearTimeout(a),r(e))};e.then(o,()=>o(n))})}function ys(){if(window.parent===window)return;let n=Ki({onPick:e=>void i(e),onRegion:e=>void a(e),onExit:()=>n.setMode(`off`)}),r=t(t=>{t.t===`hello`?r.emit({tag:e,t:`ready`,react:fs(),url:location.href}):t.t===`mode`&&n.setMode(t.mode)});async function i(t){let n=await ps(t),i={selector:Vi(t),pageUrl:location.href,viewport:Ui(),label:Hi(t),...n?{component:n}:{}},a;try{a=await Ri(t)}catch{}r.emit({tag:e,t:`selected`,target:i,...a?{screenshot:a}:{}})}async function a(t){let i;try{i=await zi(t)}catch{return}r.emit({tag:e,t:`region`,screenshot:i}),n.setMode(`off`)}}ys()})();