chamba 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -1
- package/dist/cli.js +1691 -0
- package/dist/server.js +1919 -0
- package/inject/annotate.js +49 -0
- package/package.json +24 -3
- package/skill/README.md +12 -0
- package/skill/SKILL.md +285 -0
- package/web/assets/abnfDiagram-VRR7QNED-C5V2hrtE.js +1 -0
- package/web/assets/arc-d7OTmxZy.js +1 -0
- package/web/assets/architectureDiagram-ZJ3FMSHR--CztaeAS.js +36 -0
- package/web/assets/blockDiagram-677ZJIJ3-DkA5Z_uK.js +132 -0
- package/web/assets/c4Diagram-LMCZKHZV-C78dI0l-.js +10 -0
- package/web/assets/channel-D9AxU8kk.js +1 -0
- package/web/assets/chunk-2Q5K7J3B-LBNP12XV.js +1 -0
- package/web/assets/chunk-32BRIVSS-DZoXrhCs.js +1 -0
- package/web/assets/chunk-5VM5RSS4-CPjoRxF_.js +15 -0
- package/web/assets/chunk-EX3LRPZG-DSlL8FE9.js +231 -0
- package/web/assets/chunk-JWPE2WC7-BjbBLYge.js +1 -0
- package/web/assets/chunk-MOJQB5TN-DCKqdaDr.js +88 -0
- package/web/assets/chunk-RYQCIY6F-D5yAURhE.js +1 -0
- package/web/assets/chunk-V7JOEXUC-DKY2sn06.js +206 -0
- package/web/assets/chunk-VR4S4FIN-DGiVMHh6.js +1 -0
- package/web/assets/chunk-XXDRQBXY-CUI1Tkrr.js +1 -0
- package/web/assets/classDiagram-OUVF2IWQ-D7gWuzIF.js +1 -0
- package/web/assets/classDiagram-v2-EOCWNBFH-D7gWuzIF.js +1 -0
- package/web/assets/cose-bilkent-JH36ORCC-Ao3LzalV.js +1 -0
- package/web/assets/cynefin-VYW2F7L2-7JQwpRwH.js +178 -0
- package/web/assets/cynefinDiagram-TSTJHNR4-BfuANy_V.js +62 -0
- package/web/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/web/assets/dagre-VKFMJZFB-DHVnVJCL.js +4 -0
- package/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/web/assets/diagram-FQU43EPY-OYrtwA2f.js +3 -0
- package/web/assets/diagram-G47NLZAW-CbkLZxYp.js +24 -0
- package/web/assets/diagram-NH7WQ7WH-B0z_jTdi.js +24 -0
- package/web/assets/diagram-OA4YK3LP-BRu_2nwx.js +30 -0
- package/web/assets/diagram-WEI45ONY-B9cpw86D.js +41 -0
- package/web/assets/ebnfDiagram-CCIWWBDH-DaBQ7T4R.js +1 -0
- package/web/assets/erDiagram-Q63AITRT-D6PQiFj3.js +85 -0
- package/web/assets/flowDiagram-23GEKE2U-p_8Wj7It.js +156 -0
- package/web/assets/ganttDiagram-NO4QXBWP-BZBwuqu3.js +292 -0
- package/web/assets/gitGraphDiagram-IHSO6WYX-DyPcQ-91.js +106 -0
- package/web/assets/graph-C9eacEi8.js +1 -0
- package/web/assets/highlighted-body-OFNGDK62-Cq7RJZcn.js +1 -0
- package/web/assets/index-BN-QUr5b.js +350 -0
- package/web/assets/index-D6-LVQ5m.css +1 -0
- package/web/assets/infoDiagram-FWYZ7A6U-sAgBAeWC.js +2 -0
- package/web/assets/init-Gi6I4Gst.js +1 -0
- package/web/assets/ishikawaDiagram-FXEZZL3T-COEn9wCs.js +70 -0
- package/web/assets/journeyDiagram-5HDEW3XC-BPddPRXW.js +139 -0
- package/web/assets/kanban-definition-HUTT4EX6-B8TW97Oy.js +89 -0
- package/web/assets/katex-C5jXJg4s.js +257 -0
- package/web/assets/layout-DEXfKzaS.js +1 -0
- package/web/assets/linear-CnW5uQ_k.js +1 -0
- package/web/assets/map-Czzmt4hB.js +1 -0
- package/web/assets/mermaid.core-bOV5iNX_.js +314 -0
- package/web/assets/mindmap-definition-LN4V7U3C-Dtr4xW_-.js +96 -0
- package/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/web/assets/pegDiagram-2B236MQR-DqBITK5N.js +1 -0
- package/web/assets/pieDiagram-ENE6RG2P-DXjxZgy3.js +39 -0
- package/web/assets/quadrantDiagram-ABIIQ3AL-D4MXx3U7.js +7 -0
- package/web/assets/railroadDiagram-RFXS5EU6-LPfpHg4_.js +1 -0
- package/web/assets/requirementDiagram-TGXJPOKE-CiDswbjt.js +84 -0
- package/web/assets/sankeyDiagram-HTMAVEWB-VfN_qTEI.js +40 -0
- package/web/assets/sequenceDiagram-DBY2YBRQ-kJRIx4zm.js +162 -0
- package/web/assets/sizeCapture-X5ZJPWSS-D8vJbAt-.js +1 -0
- package/web/assets/stateDiagram-2N3HPSRC-9qku-qAj.js +1 -0
- package/web/assets/stateDiagram-v2-6OUMAXLB-DbOQICyv.js +1 -0
- package/web/assets/swimlanes-5IMT3BWC-Cdb5FDUM.js +2 -0
- package/web/assets/swimlanesDiagram-G3AALYLV-EDpLmqQv.js +8 -0
- package/web/assets/timeline-definition-FHXFAJF6-D0hyJCMm.js +120 -0
- package/web/assets/vennDiagram-L72KCM5P-KsCkGMtr.js +34 -0
- package/web/assets/wardleyDiagram-EHGQE667-B4jT_1ak.js +78 -0
- package/web/assets/xychartDiagram-FW5EYKEG-Bmy0rt8j.js +7 -0
- package/web/index.html +28 -0
|
@@ -0,0 +1,49 @@
|
|
|
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()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chamba",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A browser workspace paired to your terminal coding agent over one shared conversation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"chamba": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"web",
|
|
15
|
+
"inject",
|
|
16
|
+
"skill",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"hono": "4.12.27",
|
|
21
|
+
"@hono/node-server": "1.19.14",
|
|
22
|
+
"@hono/node-ws": "1.3.1",
|
|
23
|
+
"ws": "8.21.0",
|
|
24
|
+
"marked": "18.0.5",
|
|
25
|
+
"zod": "3.25.76"
|
|
26
|
+
}
|
|
6
27
|
}
|
package/skill/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# skill/
|
|
2
|
+
|
|
3
|
+
The `/chamba` skill: the single entry point that opens the browser workspace from
|
|
4
|
+
a terminal agent session.
|
|
5
|
+
|
|
6
|
+
`SKILL.md` is the tracked source and the published skill. It drives the CLI
|
|
7
|
+
through `npx chamba@latest <command>`, so it works in any project once installed
|
|
8
|
+
with `npx chamba@latest skill install`.
|
|
9
|
+
|
|
10
|
+
In the chamba repo itself the skill is made discoverable to Claude Code by a
|
|
11
|
+
symlink at `.claude/skills/chamba` pointing here, and the CLI is driven from the
|
|
12
|
+
repo-root script `pnpm -s chamba <command>` against the local sources.
|