@zumer/snapdom 2.0.0-dev.2 → 2.0.0-dev.4
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 +50 -9
- package/dist/modules/chunks/chunk-23Q2XEDO.js +7 -0
- package/dist/modules/chunks/chunk-2FBS3OGP.js +7 -0
- package/dist/modules/chunks/chunk-43NWAKSV.js +7 -0
- package/dist/modules/chunks/chunk-5EIHY65Z.js +7 -0
- package/dist/modules/chunks/chunk-6FO4Y3OG.js +10 -0
- package/dist/modules/chunks/chunk-AOOOETXS.js +7 -0
- package/dist/modules/chunks/chunk-DV3SVS7E.js +10 -0
- package/dist/modules/chunks/chunk-FPOOW4FJ.js +7 -0
- package/dist/modules/chunks/chunk-FQFF5KMG.js +7 -0
- package/dist/modules/chunks/chunk-GU6SHZKJ.js +7 -0
- package/dist/modules/chunks/chunk-JUQT3OWD.js +7 -0
- package/dist/modules/chunks/chunk-LO3HOQZX.js +8 -0
- package/dist/modules/chunks/chunk-MI3WCG7V.js +8 -0
- package/dist/modules/chunks/chunk-R6NINER4.js +7 -0
- package/dist/modules/chunks/chunk-TWGUMDQG.js +10 -0
- package/dist/modules/chunks/chunk-UI252PBJ.js +7 -0
- package/dist/modules/chunks/chunk-XUQSCYHL.js +10 -0
- package/dist/modules/chunks/chunk-ZHRUQIHZ.js +7 -0
- package/dist/modules/chunks/rasterize-NVVIIRN2.js +7 -0
- package/dist/modules/chunks/rasterize-XGEI2GKT.js +7 -0
- package/dist/modules/exporters/download.js +7 -0
- package/dist/modules/exporters/toBlob.js +7 -0
- package/dist/modules/exporters/toCanvas.js +7 -0
- package/dist/modules/exporters/toImg.js +7 -0
- package/dist/modules/exporters/toJpg.js +7 -0
- package/dist/modules/exporters/toPng.js +7 -0
- package/dist/modules/exporters/toSvg.js +7 -0
- package/dist/modules/exporters/toWebp.js +7 -0
- package/dist/modules/plugins.js +7 -0
- package/dist/modules/preCache.js +7 -0
- package/dist/modules/snapdom.js +7 -0
- package/dist/snapdom.js +13 -5030
- package/dist/snapdom.mjs +2284 -1886
- package/package.json +29 -24
- package/dist/snapdom.min.js +0 -8
- package/dist/snapdom.min.mjs +0 -8
package/package.json
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zumer/snapdom",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.4",
|
|
4
4
|
"description": "snapDOM captures HTML elements to images with exceptional speed and accuracy.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/snapdom.js",
|
|
7
|
+
"module": "./dist/modules/snapdom.js",
|
|
8
|
+
"types": "./types/snapdom.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./types/snapdom.d.ts",
|
|
13
|
+
"import": "./dist/modules/snapdom.js",
|
|
14
|
+
"require": "./dist/snapdom.js",
|
|
15
|
+
"default": "./dist/snapdom.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./preCache": {
|
|
18
|
+
"import": "./dist/modules/preCache.js"
|
|
19
|
+
},
|
|
20
|
+
"./plugins": {
|
|
21
|
+
"import": "./dist/modules/plugins.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/",
|
|
26
|
+
"types/snapdom.d.ts",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
7
29
|
"scripts": {
|
|
30
|
+
"compile": "node esbuild.config.mjs",
|
|
8
31
|
"lint": "eslint src __tests__ --ext .js",
|
|
9
32
|
"lint:fix": "eslint src __tests__ --ext .js --fix",
|
|
10
33
|
"test": "npm run lint:fix && npx vitest run --browser.headless --reporter=verbose",
|
|
11
34
|
"test:benchmark": "npx vitest bench --browser.headless --watch=false",
|
|
12
|
-
"compile-browser": "npx @zumerbox/build -n snapdom -j src/index.browser.js -t es2015",
|
|
13
|
-
"compile-esm": "npx @zumerbox/build -n snapdom -j src/index.js -p neutral -x",
|
|
14
|
-
"compile": "npm run compile-browser && npm run compile-esm",
|
|
15
|
-
"build": "npm run compile && npm pack",
|
|
16
35
|
"bump:dry": "npx @zumerbox/bump -d",
|
|
17
36
|
"bump": "npx @zumerbox/bump && npx @zumerbox/changelog",
|
|
37
|
+
"build": "npm run compile && npm pack",
|
|
18
38
|
"prebuild": "git add CHANGELOG.md && git commit -m \"Bumped version\" && git push --follow-tags"
|
|
19
39
|
},
|
|
20
40
|
"repository": {
|
|
21
41
|
"type": "git",
|
|
22
42
|
"url": "git+https://github.com/zumerlab/snapdom.git"
|
|
23
43
|
},
|
|
24
|
-
"types": "types/snapdom.d.ts",
|
|
25
|
-
"exports": {
|
|
26
|
-
".": {
|
|
27
|
-
"types": "./types/snapdom.d.ts",
|
|
28
|
-
"import": "./dist/snapdom.mjs",
|
|
29
|
-
"require": "./dist/snapdom.js"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"files": [
|
|
33
|
-
"dist/snapdom.js",
|
|
34
|
-
"dist/snapdom.min.js",
|
|
35
|
-
"dist/snapdom.min.mjs",
|
|
36
|
-
"dist/snapdom.mjs",
|
|
37
|
-
"types/snapdom.d.ts",
|
|
38
|
-
"README.md"
|
|
39
|
-
],
|
|
40
44
|
"keywords": [
|
|
41
45
|
"zumerlab",
|
|
42
46
|
"snapDOM",
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
"@vitest/coverage-v8": "^3.1.2",
|
|
73
77
|
"eslint": "^9.36.0",
|
|
74
78
|
"globals": "^16.4.0",
|
|
75
|
-
"playwright": "^1.52.0"
|
|
79
|
+
"playwright": "^1.52.0",
|
|
80
|
+
"esbuild": "^0.24.0"
|
|
76
81
|
}
|
|
77
82
|
}
|
package/dist/snapdom.min.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
(()=>{var kn=Object.defineProperty,An=Object.defineProperties;var Mn=Object.getOwnPropertyDescriptors;var Se=Object.getOwnPropertySymbols;var vn=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable;var Gt=Math.pow,Ce=(t,e,n)=>e in t?kn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$=(t,e)=>{for(var n in e||(e={}))vn.call(e,n)&&Ce(t,n,e[n]);if(Se)for(var n of Se(e))En.call(e,n)&&Ce(t,n,e[n]);return t},W=(t,e)=>An(t,Mn(e));var k=(t,e,n)=>new Promise((o,s)=>{var r=i=>{try{f(n.next(i))}catch(l){s(l)}},a=i=>{try{f(n.throw(i))}catch(l){s(l)}},f=i=>i.done?o(i.value):Promise.resolve(i.value).then(r,a);f((n=n.apply(t,e)).next())});var x={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Rt(t="soft"){switch(x.session.__counterEpoch=(x.session.__counterEpoch||0)+1,t){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.baseStyle=new Map,x.defaultStyle=new Map,x.image=new Map,x.background=new Map,x.resource=new Map,x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}function ht(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Qt(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let s=o.split(",").map(r=>r.trim());return s.length!==6?`matrix(${o})`:(s[4]="0",s[5]="0",`matrix(${s.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let s=o.split(",").map(r=>r.trim());return s.length!==16?`matrix3d(${o})`:(s[12]="0",s[13]="0",`matrix3d(${s.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function dt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function Fn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,s=0;function r(a,f,i){if(s>=n)return;let l=Date.now();(o.get(f)||0)>l||(o.set(f,l+e),s++,a==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(a,f){r("warn",a,f)},errorOnce(a,f){r("error",a,f)},reset(){o.clear(),s=0}}}var ke=Fn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Jt=new Map,Tt=new Map;function $n(t){return/^data:|^blob:|^about:blank$/i.test(t)}function In(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,s=new URL(o||".",n),r=new URL(t,n);if(r.origin===s.origin)return!0;let a=r.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch(n){}return!1}function Ln(t,e){if(!e||$n(t)||In(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location!="undefined"?o.origin!==location.origin:!0}catch(n){return!!e}}function Nn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",dt(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${dt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Ae(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Rn(t,e){var n,o;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(o=e.errorTTL)!=null?o:8e3,t].join("|")}function X(n){return k(this,arguments,function*(t,e={}){var y,w,C;let o=(y=e.as)!=null?y:"blob",s=(w=e.timeout)!=null?w:3e3,r=e.useProxy||"",a=(C=e.errorTTL)!=null?C:8e3,f=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(o==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(o==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,S="",v=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],E=/;base64/i.test(S)?atob(v):decodeURIComponent(v),A=new Uint8Array([...E].map(L=>L.charCodeAt(0))),N=new Blob([A],{type:(S||"").split(";")[0]||""});return{ok:!0,data:N,status:200,url:t,fromCache:!1,mime:N.type||""}}catch(S){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let S=yield fetch(t);if(!S.ok)return{ok:!1,data:null,status:S.status,url:t,fromCache:!1,reason:"http_error"};let v=yield S.blob(),b=v.type||S.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield Ae(v),status:S.status,url:t,fromCache:!1,mime:b}:o==="text"?{ok:!0,data:yield v.text(),status:S.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:v,status:S.status,url:t,fromCache:!1,mime:b}}catch(S){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return o==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:o==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let l=Rn(t,{as:o,timeout:s,useProxy:r,errorTTL:a}),h=Tt.get(l);if(h&&h.until>Date.now())return W($({},h.result),{fromCache:!0});h&&Tt.delete(l);let d=Jt.get(l);if(d)return d;let p=Ln(t,r)?Nn(t,r):t,u=e.credentials;if(!u)try{let S=typeof location!="undefined"&&location.href?location.href:"http://localhost/",v=new URL(t,S);u=typeof location!="undefined"&&v.origin===location.origin?"include":"omit"}catch(S){u="omit"}let g=new AbortController,c=setTimeout(()=>g.abort("timeout"),s),m=k(null,null,function*(){var S,v;try{let b=yield fetch(p,{signal:g.signal,credentials:u,headers:f});if(!b.ok){let N={ok:!1,data:null,status:b.status,url:p,fromCache:!1,reason:"http_error"};if(a>0&&Tt.set(l,{until:Date.now()+a,result:N}),!i){let L=`${b.status} ${b.statusText||""}`.trim();ke.warnOnce(`http:${b.status}:${o}:${new URL(t,(S=location==null?void 0:location.href)!=null?S:"http://localhost/").origin}`,`HTTP error ${L} while fetching ${o} ${t}`)}return e.onError&&e.onError(N),N}if(o==="text")return{ok:!0,data:yield b.text(),status:b.status,url:p,fromCache:!1};let E=yield b.blob(),A=E.type||b.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield Ae(E),status:b.status,url:p,fromCache:!1,mime:A}:{ok:!0,data:E,status:b.status,url:p,fromCache:!1,mime:A}}catch(b){let E=b&&typeof b=="object"&&"name"in b&&b.name==="AbortError"?String(b.message||"").includes("timeout")?"timeout":"abort":"network",A={ok:!1,data:null,status:0,url:p,fromCache:!1,reason:E};if(!/^blob:/i.test(t)&&a>0&&Tt.set(l,{until:Date.now()+a,result:A}),!i){let N=`${E}:${o}:${new URL(t,(v=location==null?void 0:location.href)!=null?v:"http://localhost/").origin}`,L=E==="timeout"?`Timeout after ${s}ms. Consider increasing timeout or using a proxy for ${t}`:E==="abort"?`Request aborted while fetching ${o} ${t}`:`Network/CORS issue while fetching ${o} ${t}. A proxy may be required`;ke.errorOnce(N,L)}return e.onError&&e.onError(A),A}finally{clearTimeout(c),Jt.delete(l)}});return Jt.set(l,m),m})}function pt(n){return k(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let s=ht(t);if(!s)return t;let r=dt(s);if(x.background.has(r)){let a=x.background.get(r);return a?`url("${a}")`:"none"}try{let a=yield X(r,{as:"dataURL",useProxy:e.useProxy});return a.ok?(x.background.set(r,a.data),`url("${a.data}")`):(x.background.set(r,null),"none")}catch(a){return x.background.set(r,null),"none"}})}var Pt=new Set(["meta","script","noscript","title","link","template"]),xt=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"]),Tn=["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"];function Zt(){for(let t of Tn){let e=String(t).toLowerCase();Pt.has(e)||xt.has(e)||te(e)}}function te(t){if(t=String(t).toLowerCase(),xt.has(t)){let r={};return x.defaultStyle.set(t,r),r}if(x.defaultStyle.has(t))return x.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),s={};for(let r of o){if(Me(r))continue;let a=o.getPropertyValue(r);s[r]=a}return e.removeChild(n),x.defaultStyle.set(t,s),s}var Pn=/(?:^|-)(animation|transition)(?:-|$)/i,_n=/^(--|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,Wn=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function Me(t){let e=String(t).toLowerCase();return!!(Wn.has(e)||_n.test(e)||Pn.test(e))}function St(t,e){if(e=String(e||"").toLowerCase(),xt.has(e))return"";let n=[],o=te(e);for(let[s,r]of Object.entries(t)){if(Me(s))continue;let a=o[s];r&&r!==a&&n.push(`${s}:${r}`)}return n.sort(),n.join(";")}function ee(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function ne(t){let e=new Map;for(let o of t){let s=x.defaultStyle.get(o);if(!s)continue;let r=Object.entries(s).map(([a,f])=>`${a}:${f};`).sort().join("");r&&(e.has(r)||e.set(r,[]),e.get(r).push(o))}let n="";for(let[o,s]of e.entries())n+=`${s.join(",")} { ${o} }
|
|
2
|
-
`;return n}function oe(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let s of e)n.set(s,`c${o++}`);return n}function gt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=x.computedStyle.get(t);if(n||(n=new Map,x.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function _t(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function Mt(t){let e=[],n=0,o=0;for(let s=0;s<t.length;s++){let r=t[s];r==="("&&n++,r===")"&&n--,r===","&&n===0&&(e.push(t.slice(o,s).trim()),o=s+1)}return e.push(t.slice(o).trim()),e}function ct(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function Y(){if(typeof navigator=="undefined")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),o=/applewebkit/i.test(t),s=/mobile/i.test(t),r=!/safari/i.test(t),a=o&&s&&r,f=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),i=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),l=/ipad|iphone|ipod/.test(e)&&o;return n||a||f||i||l}var ve=new WeakMap,re=new Map,se=0;function vt(){se++}var Ee=!1;function On(t=document.documentElement){var e,n;if(!Ee){Ee=!0;try{new MutationObserver(()=>vt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{new MutationObserver(()=>vt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{let o=document.fonts;o&&((e=o.addEventListener)==null||e.call(o,"loadingdone",vt),(n=o.ready)==null||n.then(()=>vt()).catch(()=>{}))}catch(o){}}}function Un(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let r=0;r<t.length;r++){let a=t[r],f=t.getPropertyValue(a);(a==="background-image"||a==="content")&&f.includes("url(")&&!f.includes("data:")&&(f="none"),n[a]=f}let s=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let r of s)if(!n[r])try{let a=t.getPropertyValue(r);a&&(n[r]=a)}catch(a){}if(e.embedFonts){let r=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let a of r)if(!n[a])try{let f=t.getPropertyValue(a);f&&(n[a]=f)}catch(f){}}return o==="hidden"&&(n.opacity="0"),n}var Fe=new WeakMap;function Bn(t){let e=Fe.get(t);return e||(e=Object.entries(t).sort((o,s)=>o[0]<s[0]?-1:o[0]>s[0]?1:0).map(([o,s])=>`${o}:${s}`).join(";"),Fe.set(t,e),e)}function Dn(t,e=null,n={}){let o=ve.get(t);if(o&&o.epoch===se)return o.snapshot;let s=e||getComputedStyle(t),r=Un(s,n);return Xn(t,s,r),ve.set(t,{epoch:se,snapshot:r}),r}function Hn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:re,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||{}}:{session:x.session,persist:{snapshotKeyCache:re,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||e||{}}}function yt(t,e,n,o){return k(this,null,function*(){var p,u,g;if(t.tagName==="STYLE")return;let s=Hn(n,o),r=s.options&&s.options.cache||"auto";if(r!=="disabled"&&On(document.documentElement),r==="disabled"&&!s.session.__bumpedForDisabled&&(vt(),re.clear(),s.session.__bumpedForDisabled=!0),xt.has((p=t.tagName)==null?void 0:p.toLowerCase())){let c=(u=t.getAttribute)==null?void 0:u.call(t,"style");c&&e.setAttribute("style",c)}let{session:a,persist:f}=s;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let i=a.styleCache.get(t),l=Dn(t,i,s.options),h=Bn(l),d=f.snapshotKeyCache.get(h);if(!d){let c=((g=t.tagName)==null?void 0:g.toLowerCase())||"div";d=St(l,c),f.snapshotKeyCache.set(h,d)}a.styleMap.set(e,d)})}function qn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function jn(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function zn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function Vn(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let s=t.scrollHeight;if(s===0)return!1;let r=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return s>r+a}function Xn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||qn(t))return;let s=e.position;s==="absolute"||s==="fixed"||s==="sticky"||e.transform==="none"&&(jn(e)||zn(t)||Vn(t,e)&&(delete n.height,delete n["block-size"]))}var Ie=["fill","stroke","color","background-color","stop-color"],$e=new Map;function Yn(t,e){let n=e+"::"+t.toLowerCase(),o=$e.get(n);if(o)return o;let s=document,r=e==="http://www.w3.org/2000/svg"?s.createElementNS(e,t):s.createElement(t),a=s.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(r),s.documentElement.appendChild(a);let f=getComputedStyle(r),i={};for(let l of Ie)i[l]=f.getPropertyValue(l)||"";return a.remove(),$e.set(n,i),i}function Le(t,e){var r,a,f;if(!(t instanceof Element)||!(e instanceof Element))return;let n=(r=t.getAttribute)==null?void 0:r.call(t,"style"),o=!!(n&&n.includes("var("));if(!o&&((a=t.attributes)!=null&&a.length)){let i=t.attributes;for(let l=0;l<i.length;l++){let h=i[l];if(h&&typeof h.value=="string"&&h.value.includes("var(")){o=!0;break}}}let s=null;if(o)try{s=getComputedStyle(t)}catch(i){}if(o){let i=t.style;if(i&&i.length)for(let l=0;l<i.length;l++){let h=i[l],d=i.getPropertyValue(h);if(!d||!d.includes("var("))continue;let p=s&&s.getPropertyValue(h);if(p)try{e.style.setProperty(h,p.trim(),i.getPropertyPriority(h))}catch(u){}}}if(o&&((f=t.attributes)!=null&&f.length)){let i=t.attributes;for(let l=0;l<i.length;l++){let h=i[l];if(!h||typeof h.value!="string"||!h.value.includes("var("))continue;let d=h.name,p=s&&s.getPropertyValue(d);if(p)try{e.style.setProperty(d,p.trim())}catch(u){}}}if(!o){if(!s)try{s=getComputedStyle(t)}catch(h){s=null}if(!s)return;let i=t.namespaceURI||"html",l=Yn(t.tagName,i);for(let h of Ie){let d=s.getPropertyValue(h)||"",p=l[h]||"";if(d&&d!==p)try{e.style.setProperty(h,d.trim())}catch(u){}}}}function ae(t,e,n){return Promise.all(t.map(o=>new Promise(s=>{function r(){ct(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(o,s):r()},{fast:n})}r()})))}function Kn(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Gn(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let s=n?Kn(o):o;return`:where(${e} ${s})`}).join(", ")}function Qn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,s,r)=>{let a=Gn(r,e,!0);return`${o}${s}${a}{`}),t):""}function Jn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Zn(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
|
|
3
|
-
`});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let s of o.cssRules)e+=s.cssText+`
|
|
4
|
-
`}catch(s){}}catch(n){}return e}function to(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function eo(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function no(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function oo(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch(n){}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch(n){}return""}function ro(t,e,n){let o=[];for(let s of e){let r=oo(t,s);r&&o.push(`${s}: ${r};`)}return o.length?`${n}{${o.join("")}}
|
|
5
|
-
`:""}function so(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function ao(t,e=3){return k(this,null,function*(){let n=()=>{var r;try{return t.contentDocument||((r=t.contentWindow)==null?void 0:r.document)||null}catch(a){return null}},o=n(),s=0;for(;s<e&&(!o||!o.body&&!o.documentElement);)yield new Promise(r=>setTimeout(r,0)),o=n(),s++;return o&&(o.body||o.documentElement)?o:null})}function io(t){let e=t.getBoundingClientRect(),n=0,o=0,s=0,r=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,o=parseFloat(i.borderRightWidth)||0,s=parseFloat(i.borderTopWidth)||0,r=parseFloat(i.borderBottomWidth)||0}catch(i){}let a=Math.max(0,Math.round(e.width-(n+o))),f=Math.max(0,Math.round(e.height-(s+r)));return{contentWidth:a,contentHeight:f,rect:e}}function co(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch(s){}}}function lo(t,e,n){return k(this,null,function*(){let o=yield ao(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:s,contentHeight:r,rect:a}=io(t),f=n==null?void 0:n.snap;if(!f||typeof f.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=W($({},n),{scale:1}),l=co(o,s,r),h;try{h=yield f.toPng(o.documentElement,i)}finally{l()}h.style.display="block",h.style.width=`${s}px`,h.style.height=`${r}px`;let d=document.createElement("div");return e.nodeMap.set(d,t),yt(t,d,e,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(h),d})}function Et(t,e,n){return k(this,null,function*(){var l,h,d,p,u,g;if(!t)throw new Error("Invalid node");let o=new Set,s=null,r=null;if(t.nodeType===Node.ELEMENT_NODE){let c=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Pt.has(c))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let c=document.createElement("div"),m=t.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,c}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let c of n.exclude)try{if((l=t.matches)!=null&&l.call(t,c)){if(n.excludeMode==="hide"){let m=document.createElement("div"),y=t.getBoundingClientRect();return m.style.cssText=`display:inline-block;width:${y.width}px;height:${y.height}px;visibility:hidden;`,m}else if(n.excludeMode==="remove")return null}}catch(m){console.warn(`Invalid selector in exclude option: ${c}`,m)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let c=document.createElement("div"),m=t.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,c}else if(n.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.tagName==="IFRAME"){let c=!1;try{c=!!(t.contentDocument||(h=t.contentWindow)!=null&&h.document)}catch(m){c=!1}if(c)try{return yield lo(t,e,n)}catch(m){console.warn("[SnapDOM] iframe rasterization failed, fallback:",m)}if(n.placeholders){let m=document.createElement("div");return m.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,yt(t,m,e,n),m}else{let m=t.getBoundingClientRect(),y=document.createElement("div");return y.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,yt(t,y,e,n),y}}if(t.getAttribute("data-capture")==="placeholder"){let c=t.cloneNode(!1);e.nodeMap.set(c,t),yt(t,c,e,n);let m=document.createElement("div");return m.textContent=t.getAttribute("data-placeholder-text")||"",m.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(m),c}if(t.tagName==="CANVAS"){let c="";try{let y=t.getContext("2d",{willReadFrequently:!0});try{y&&y.getImageData(0,0,1,1)}catch(w){}if(yield new Promise(w=>requestAnimationFrame(w)),c=t.toDataURL("image/png"),!c||c==="data:,"){try{y&&y.getImageData(0,0,1,1)}catch(w){}if(yield new Promise(w=>requestAnimationFrame(w)),c=t.toDataURL("image/png"),!c||c==="data:,"){let w=document.createElement("canvas");w.width=t.width,w.height=t.height;let C=w.getContext("2d");C&&(C.drawImage(t,0,0),c=w.toDataURL("image/png"))}}}catch(y){}let m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch(y){}c&&(m.src=c),m.width=t.width,m.height=t.height;try{let y=getComputedStyle(t);y.width&&(m.style.width=y.width),y.height&&(m.style.height=y.height)}catch(y){}return e.nodeMap.set(m,t),yt(t,m,e,n),m}let a;try{if(a=t.cloneNode(!1),Le(t,a),e.nodeMap.set(a,t),t.tagName==="IMG"){eo(t,a);try{let c=t.getBoundingClientRect(),m=Math.round(c.width||0),y=Math.round(c.height||0);if(!m||!y){let w=window.getComputedStyle(t),C=parseFloat(w.width)||0,S=parseFloat(w.height)||0,v=parseInt(t.getAttribute("width")||"",10)||0,b=parseInt(t.getAttribute("height")||"",10)||0,E=t.width||t.naturalWidth||0,A=t.height||t.naturalHeight||0;m=Math.round(m||C||v||E||0),y=Math.round(y||S||b||A||0)}m&&(a.dataset.snapdomWidth=String(m)),y&&(a.dataset.snapdomHeight=String(y))}catch(c){}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",t,c),c}if(t instanceof HTMLTextAreaElement){let c=t.getBoundingClientRect();a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(s=t.value),t instanceof HTMLTextAreaElement&&(r=t.value),yt(t,a,e,n),t.shadowRoot){let b=function(A,N){if(A.nodeType===Node.ELEMENT_NODE&&A.tagName==="STYLE")return N(null);Et(A,e,n).then(L=>{N(L||null)}).catch(()=>{N(null)})};try{let A=t.shadowRoot.querySelectorAll("slot");for(let N of A){let L=[];try{L=((d=N.assignedNodes)==null?void 0:d.call(N,{flatten:!0}))||((p=N.assignedNodes)==null?void 0:p.call(N))||[]}catch(O){L=((u=N.assignedNodes)==null?void 0:u.call(N))||[]}for(let O of L)o.add(O)}}catch(A){}let c=Jn(e),m=`[data-sd="${c}"]`;try{a.setAttribute("data-sd",c)}catch(A){}let y=Zn(t.shadowRoot),w=Qn(y,m),C=no(y),S=ro(t,C,m);to(a,S+w,c);let v=document.createDocumentFragment(),E=yield ae(Array.from(t.shadowRoot.childNodes),b,n.fast);v.append(...E.filter(A=>!!A)),a.appendChild(v)}if(t.tagName==="SLOT"){let w=function(S,v){Et(S,e,n).then(b=>{b&&so(b),v(b||null)}).catch(()=>{v(null)})},c=((g=t.assignedNodes)==null?void 0:g.call(t,{flatten:!0}))||[],m=c.length>0?c:Array.from(t.childNodes),y=document.createDocumentFragment(),C=yield ae(Array.from(m),w,n.fast);return y.append(...C.filter(S=>!!S)),y}function f(c,m){if(o.has(c))return m(null);Et(c,e,n).then(y=>{m(y||null)}).catch(()=>{m(null)})}let i=yield ae(Array.from(t.childNodes),f,n.fast);if(a.append(...i.filter(c=>!!c)),s!==null&&a instanceof HTMLSelectElement){a.value=s;for(let c of a.options)c.value===s?c.setAttribute("selected",""):c.removeAttribute("selected")}return r!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=r),a})}var fo=[/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],Ct=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!="undefined"&&window.__SNAPDOM_ICON_FONTS__||{}),ie=[];function Re(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?ie.push(n):typeof n=="string"?ie.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function nt(t){let e=typeof t=="string"?t:"",n=[...fo,...ie];for(let o of n)if(o instanceof RegExp&&o.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function uo(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Ne=new Map;function mo(t=""){let e=Object.create(null),n=String(t||""),o=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,s;for(;s=o.exec(n);)e[s[1].toUpperCase()]=Number(s[2]);return e}function ho(t,e,n){return k(this,null,function*(){var p;let o=String(t||""),s=o.toLowerCase(),r=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(s)&&!/\bsymbols\b/.test(s))return{familyForMeasure:o,familyForCanvas:o};if(!/\bmaterial\s*symbols\b/.test(s))return{familyForMeasure:o,familyForCanvas:o};let f=n&&((p=n.FILL)!=null?p:n.fill),i="outlined";/\brounded\b/.test(r)||/\bround\b/.test(r)?i="rounded":/\bsharp\b/.test(r)?i="sharp":/\boutlined\b/.test(r)&&(i="outlined");let l=f===1,h=null;if(l&&(i==="outlined"&&Ct.materialIconsFilled?h={url:Ct.materialIconsFilled,alias:"snapdom-mi-filled"}:i==="rounded"&&Ct.materialIconsRound?h={url:Ct.materialIconsRound,alias:"snapdom-mi-round"}:i==="sharp"&&Ct.materialIconsSharp&&(h={url:Ct.materialIconsSharp,alias:"snapdom-mi-sharp"})),!h)return{familyForMeasure:o,familyForCanvas:o};if(!Ne.has(h.alias))try{let u=new FontFace(h.alias,`url(${h.url})`,{style:"normal",weight:"400"});document.fonts.add(u),yield u.load(),Ne.set(h.alias,!0)}catch(u){return{familyForMeasure:o,familyForCanvas:o}}let d=`"${h.alias}"`;return{familyForMeasure:d,familyForCanvas:d}})}function po(t="Material Icons",e=24){return k(this,null,function*(){try{yield Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch(n){}})}function go(t){var s,r;let e=((s=t.getPropertyValue("-webkit-text-fill-color"))==null?void 0:s.trim())||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let o=(r=t.color)==null?void 0:r.trim();return o&&o!=="inherit"?o:"#000"}function yo(f){return k(this,arguments,function*(t,{family:e="Material Icons",weight:n="normal",fontSize:o=32,color:s="#000",variation:r="",className:a=""}={}){let i=String(e||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,h=mo(r),{familyForMeasure:d,familyForCanvas:p}=yield ho(i,a,h);yield po(p.replace(/^["']+|["']+$/g,""),o);let u=document.createElement("span");u.textContent=t,u.style.position="absolute",u.style.visibility="hidden",u.style.left="-99999px",u.style.whiteSpace="nowrap",u.style.fontFamily=d,u.style.fontWeight=String(n||"normal"),u.style.fontSize=`${o}px`,u.style.lineHeight="1",u.style.margin="0",u.style.padding="0",u.style.fontFeatureSettings="'liga' 1",u.style.fontVariantLigatures="normal",u.style.color=s,document.body.appendChild(u);let g=u.getBoundingClientRect(),c=Math.max(1,Math.ceil(g.width)),m=Math.max(1,Math.ceil(g.height));document.body.removeChild(u);let y=document.createElement("canvas");y.width=c*l,y.height=m*l;let w=y.getContext("2d");w.scale(l,l),w.font=`${n?`${n} `:""}${o}px ${p}`,w.textAlign="left",w.textBaseline="top",w.fillStyle=s;try{w.fontKerning="normal"}catch(C){}return w.fillText(t,0,0),{dataUrl:y.toDataURL(),width:c,height:m}})}function Te(t,e){return k(this,null,function*(){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',o=Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(o.length===0)return 0;let s=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],r=0;for(let a=0;a<o.length;a++){let f=o[a],i=s[a]||null;try{let l=getComputedStyle(i||f),h=l.fontFamily||"Material Icons";if(!uo(h))continue;let d=(i||f).textContent.trim();if(!d)continue;let p=parseInt(l.fontSize,10)||24,u=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",g=go(l),c=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",m=(i||f).className||"",{dataUrl:y,width:w,height:C}=yield yo(d,{family:h,weight:u,fontSize:p,color:g,variation:c,className:m});f.textContent="";let S=f.ownerDocument.createElement("img");S.src=y,S.alt=d,S.style.height=`${p}px`,S.style.width=`${Math.max(1,Math.round(w/C*p))}px`,S.style.objectFit="contain",S.style.verticalAlign=getComputedStyle(f).verticalAlign||"baseline",f.appendChild(S),r++}catch(l){}}return r})}function We(t,e,n,o=32,s="#000"){return k(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let r=window.devicePixelRatio||1;try{yield document.fonts.ready}catch(p){}let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let f=a.getBoundingClientRect(),i=Math.ceil(f.width),l=Math.ceil(f.height);document.body.removeChild(a);let h=document.createElement("canvas");h.width=Math.max(1,i*r),h.height=Math.max(1,l*r);let d=h.getContext("2d");return d.scale(r,r),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=s,d.fillText(t,0,0),{dataUrl:h.toDataURL(),width:i,height:l}})}var wo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Ut(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!wo.has(n.toLowerCase()))return n}return""}function Wt(t){let e=String(t!=null?t:"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function ce(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function bo(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function xo(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let s=Wt(n[1]),r=Wt(n[2]);return{min:Math.min(s,r),max:Math.max(s,r)}}let o=Wt(e);return{min:o,max:o}}function So(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Co(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let r=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(r,a),max:Math.max(r,a)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),s=o?parseFloat(o[1]):100;return{min:s,max:s}}function ko(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let s=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(f=>s.endsWith(f)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let f of e){let i=f.toLowerCase().replace(/\s+/g,"+"),l=f.toLowerCase().replace(/\s+/g,"-");if(a.includes(i)||a.includes(l))return!0}return!1}catch(n){return!1}}function Ao(t){var n;let e=new Set;for(let o of t||[]){let s=(n=String(o).split("__")[0])==null?void 0:n.trim();s&&e.add(s)}return e}function Pe(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,o,s)=>{let r=(s||"").trim();if(!r||/^data:|^blob:|^https?:|^file:|^about:/i.test(r))return n;let a=r;try{a=new URL(r,e||location.href).href}catch(f){}return`url("${a}")`})}var le=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Ot=4;function Mo(t,e,n){return k(this,null,function*(){if(!t)return t;let o=new Set;function s(f,i){try{return new URL(f,i||location.href).href}catch(l){return f}}function r(f,i,l=0){return k(this,null,function*(){if(l>Ot)return console.warn(`[snapDOM] @import depth exceeded (${Ot}) at ${i}`),f;let h="",d=0,p;for(;p=le.exec(f);){h+=f.slice(d,p.index),d=le.lastIndex;let u=(p[2]||p[4]||"").trim(),g=s(u,i);if(o.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}o.add(g);let c="";try{let m=yield X(g,{as:"text",useProxy:n,silent:!0});m.ok&&typeof m.data=="string"&&(c=m.data)}catch(m){}c?(c=Pe(c,g),c=yield r(c,g,l+1),h+=`
|
|
6
|
-
/* inlined: ${g} */
|
|
7
|
-
${c}
|
|
8
|
-
`):h+=p[0]}return h+=f.slice(d),h})}let a=Pe(t,e||location.href);return a=yield r(a,e||location.href,0),a})}var Oe=/url\((["']?)([^"')]+)\1\)/g,vo=/@font-face[^{}]*\{[^}]*\}/g;function Ue(t){if(!t)return[];let e=[],n=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of n){let s=o.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!s)continue;let r=s[1],a=s[2],f=i=>{if(!i.includes("?"))return parseInt(i,16);let l=parseInt(i.replace(/\?/g,"0"),16),h=parseInt(i.replace(/\?/g,"F"),16);return[l,h]};if(a){let i=f(r),l=f(a),h=Array.isArray(i)?i[0]:i,d=Array.isArray(l)?l[1]:l;e.push([Math.min(h,d),Math.max(h,d)])}else{let i=f(r);Array.isArray(i)?e.push([i[0],i[1]]):e.push([i,i])}}return e}function Be(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[o,s]of e)if(n>=o&&n<=s)return!0;return!1}function fe(t,e){let n=[];if(!t)return n;for(let o of t.matchAll(Oe)){let s=(o[2]||"").trim();if(!(!s||s.startsWith("data:"))){if(!/^https?:/i.test(s))try{s=new URL(s,e||location.href).href}catch(r){}n.push(s)}}return n}function De(t,e,n=""){return k(this,null,function*(){var s,r,a,f,i;let o=t;for(let l of t.matchAll(Oe)){let h=ht(l[0]);if(!h)continue;let d=h;if(!d.startsWith("http")&&!d.startsWith("data:"))try{d=new URL(d,e||location.href).href}catch(p){}if(!nt(d)){if((s=x.resource)!=null&&s.has(d)){(r=x.font)==null||r.add(d),o=o.replace(l[0],`url(${x.resource.get(d)})`);continue}if(!((a=x.font)!=null&&a.has(d)))try{let p=yield X(d,{as:"dataURL",useProxy:n,silent:!0});if(p.ok&&typeof p.data=="string"){let u=p.data;(f=x.resource)==null||f.set(d,u),(i=x.font)==null||i.add(d),o=o.replace(l[0],`url(${u})`)}}catch(p){console.warn("[snapDOM] Failed to fetch font resource:",d)}}}return o})}function Eo(t){if(!t.length)return null;let e=(f,i)=>t.some(([l,h])=>!(h<f||l>i)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),s=e(880,1023),r=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":r?"cyrillic":s?"greek":o?"latin-ext":n?"latin":null}function _e(t={}){let e=new Set((t.families||[]).map(s=>String(s).toLowerCase())),n=new Set((t.domains||[]).map(s=>String(s).toLowerCase())),o=new Set((t.subsets||[]).map(s=>String(s).toLowerCase()));return(s,r)=>{if(e.size&&e.has(s.family.toLowerCase()))return!0;if(n.size)for(let a of s.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch(f){}if(o.size){let a=Eo(r);if(a&&o.has(a))return!0}return!1}}function Fo(t){var r,a,f,i,l,h;if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(let d of t.match(e)||[]){let p=((r=d.match(/font-family:\s*([^;]+);/i))==null?void 0:r[1])||"",u=Ut(p),g=(((a=d.match(/font-weight:\s*([^;]+);/i))==null?void 0:a[1])||"400").trim(),c=(((f=d.match(/font-style:\s*([^;]+);/i))==null?void 0:f[1])||"normal").trim(),m=(((i=d.match(/font-stretch:\s*([^;]+);/i))==null?void 0:i[1])||"100%").trim(),y=(((l=d.match(/unicode-range:\s*([^;]+);/i))==null?void 0:l[1])||"").trim(),w=(((h=d.match(/src\s*:\s*([^;}]+)[;}]/i))==null?void 0:h[1])||"").trim(),C=fe(w,location.href),S=C.length?C.map(b=>String(b).toLowerCase()).sort().join("|"):w.toLowerCase(),v=[String(u||"").toLowerCase(),g,c,m,y.toLowerCase(),S].join("|");n.has(v)||(n.add(v),o.push(d))}if(o.length===0)return t;let s=0;return t.replace(e,()=>o[s++]||"")}function $o(t,e,n,o){let s=Array.from(t||[]).sort().join("|"),r=e?JSON.stringify({families:(e.families||[]).map(i=>String(i).toLowerCase()).sort(),domains:(e.domains||[]).map(i=>String(i).toLowerCase()).sort(),subsets:(e.subsets||[]).map(i=>String(i).toLowerCase()).sort()}):"",a=(n||[]).map(i=>`${(i.family||"").toLowerCase()}::${i.weight||"normal"}::${i.style||"normal"}::${i.src||""}`).sort().join("|");return`fonts-embed-css::req=${s}::ex=${r}::lf=${a}::px=${o||""}`}function He(t,e,n,o){return k(this,null,function*(){let s;try{s=t.cssRules||[]}catch(a){return}let r=(a,f)=>{try{return new URL(a,f||location.href).href}catch(i){return a}};for(let a of s){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let f=a.href?r(a.href,e):e;if(o.depth>=Ot){console.warn(`[snapDOM] CSSOM import depth exceeded (${Ot}) at ${f}`);continue}if(f&&o.visitedSheets.has(f)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${f}`);continue}f&&o.visitedSheets.add(f);let i=W($({},o),{depth:(o.depth||0)+1});yield He(a.styleSheet,f,n,i);continue}if(a.type===CSSRule.FONT_FACE_RULE){let f=(a.style.getPropertyValue("font-family")||"").trim(),i=Ut(f);if(!i||nt(i))continue;let l=(a.style.getPropertyValue("font-weight")||"400").trim(),h=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),p=(a.style.getPropertyValue("src")||"").trim(),u=(a.style.getPropertyValue("unicode-range")||"").trim();if(!o.faceMatchesRequired(i,h,l,d))continue;let g=Ue(u);if(!Be(o.usedCodepoints,g))continue;let c={family:i,weightSpec:l,styleSpec:h,stretchSpec:d,unicodeRange:u,srcRaw:p,srcUrls:fe(p,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(c,g))continue;if(/url\(/i.test(p)){let m=yield De(p,e||location.href,o.useProxy);yield n(`@font-face{font-family:${i};src:${m};font-style:${h};font-weight:${l};font-stretch:${d};${u?`unicode-range:${u};`:""}}`)}else yield n(`@font-face{font-family:${i};src:${p};font-style:${h};font-weight:${l};font-stretch:${d};${u?`unicode-range:${u};`:""}}`)}}})}function Bt(){return k(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:s=""}={}){var c,m,y,w,C,S,v,b,E,A,N,L,O,q,V,K,ft,Z;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let r=new Map;for(let F of t){let[M,T,U,D]=String(F).split("__");if(!M)continue;let _=r.get(M)||[];_.push({w:parseInt(T,10),s:U,st:parseInt(D,10)}),r.set(M,_)}function a(F,M,T,U){if(!r.has(F))return!1;let D=r.get(F),_=xo(T),R=So(M),P=Co(U),j=_.min!==_.max,z=_.min,G=H=>R.kind==="normal"&&H==="normal"||R.kind!=="normal"&&(H==="italic"||H==="oblique"),Q=!1;for(let H of D){let J=j?H.w>=_.min&&H.w<=_.max:H.w===z,ot=G(ce(H.s)),ut=H.st>=P.min&&H.st<=P.max;if(J&&ot&&ut){Q=!0;break}}if(Q)return!0;if(!j)for(let H of D){let J=G(ce(H.s)),ot=H.st>=P.min&&H.st<=P.max;if(Math.abs(z-H.w)<=300&&J&&ot)return!0}return!1}let f=_e(n),i=$o(t,n,o,s);if((c=x.resource)!=null&&c.has(i))return x.resource.get(i);let l=Ao(t),h=[],d=le;for(let F of document.querySelectorAll("style")){let M=F.textContent||"";for(let T of M.matchAll(d)){let U=(T[2]||T[4]||"").trim();if(!U||nt(U))continue;!!document.querySelector(`link[rel="stylesheet"][href="${U}"]`)||h.push(U)}}h.length&&(yield Promise.all(h.map(F=>new Promise(M=>{if(document.querySelector(`link[rel="stylesheet"][href="${F}"]`))return M(null);let T=document.createElement("link");T.rel="stylesheet",T.href=F,T.setAttribute("data-snapdom","injected-import"),T.onload=()=>M(T),T.onerror=()=>M(null),document.head.appendChild(T)}))));let p="",u=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(F=>!!F.href);for(let F of u)try{if(nt(F.href))continue;let M="",T=!1;try{T=new URL(F.href,location.href).origin===location.origin}catch(D){}if(!T&&!ko(F.href,l))continue;if(T){let D=Array.from(document.styleSheets).find(_=>_.href===F.href);if(D)try{let _=D.cssRules||[];M=Array.from(_).map(R=>R.cssText).join("")}catch(_){}}if(!M&&(M=(yield X(F.href,{as:"text",useProxy:s})).data,nt(F.href)))continue;M=yield Mo(M,F.href,s);let U="";for(let D of M.match(vo)||[]){let _=(((m=D.match(/font-family:\s*([^;]+);/i))==null?void 0:m[1])||"").trim(),R=Ut(_);if(!R||nt(R))continue;let P=(((y=D.match(/font-weight:\s*([^;]+);/i))==null?void 0:y[1])||"400").trim(),j=(((w=D.match(/font-style:\s*([^;]+);/i))==null?void 0:w[1])||"normal").trim(),z=(((C=D.match(/font-stretch:\s*([^;]+);/i))==null?void 0:C[1])||"100%").trim(),G=(((S=D.match(/unicode-range:\s*([^;]+);/i))==null?void 0:S[1])||"").trim(),Q=(((v=D.match(/src\s*:\s*([^;}]+)[;}]/i))==null?void 0:v[1])||"").trim(),H=fe(Q,F.href);if(!a(R,j,P,z))continue;let J=Ue(G);if(!Be(e,J))continue;let ot={family:R,weightSpec:P,styleSpec:j,stretchSpec:z,unicodeRange:G,srcRaw:Q,srcUrls:H,href:F.href};if(n&&f(ot,J))continue;let ut=/url\(/i.test(Q)?yield De(D,F.href,s):D;U+=ut}U.trim()&&(p+=U)}catch(M){console.warn("[snapDOM] Failed to process stylesheet:",F.href)}let g={requiredIndex:r,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?_e(n):null,useProxy:s,visitedSheets:new Set,depth:0};for(let F of document.styleSheets)if(!(F.href&&u.some(M=>M.href===F.href)))try{let M=F.href||location.href;M&&g.visitedSheets.add(M),yield He(F,M,T=>k(null,null,function*(){p+=T}),g)}catch(M){}try{for(let F of document.fonts||[]){if(!F||!F.family||F.status!=="loaded"||!F._snapdomSrc)continue;let M=String(F.family).replace(/^['"]+|['"]+$/g,"");if(nt(M)||!r.has(M)||n!=null&&n.families&&n.families.some(U=>String(U).toLowerCase()===M.toLowerCase()))continue;let T=F._snapdomSrc;if(!String(T).startsWith("data:")){if((b=x.resource)!=null&&b.has(F._snapdomSrc))T=x.resource.get(F._snapdomSrc),(E=x.font)==null||E.add(F._snapdomSrc);else if(!((A=x.font)!=null&&A.has(F._snapdomSrc)))try{let U=yield X(F._snapdomSrc,{as:"dataURL",useProxy:s,silent:!0});if(U.ok&&typeof U.data=="string")T=U.data,(N=x.resource)==null||N.set(F._snapdomSrc,T),(L=x.font)==null||L.add(F._snapdomSrc);else continue}catch(U){console.warn("[snapDOM] Failed to fetch dynamic font src:",F._snapdomSrc);continue}}p+=`@font-face{font-family:'${M}';src:url(${T});font-style:${F.style||"normal"};font-weight:${F.weight||"normal"};}`}}catch(F){}for(let F of o){if(!F||typeof F!="object")continue;let M=String(F.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||nt(M)||!r.has(M)||n!=null&&n.families&&n.families.some(P=>String(P).toLowerCase()===M.toLowerCase()))continue;let T=F.weight!=null?String(F.weight):"normal",U=F.style!=null?String(F.style):"normal",D=F.stretchPct!=null?`${F.stretchPct}%`:"100%",_=String(F.src||""),R=_;if(!R.startsWith("data:")){if((O=x.resource)!=null&&O.has(_))R=x.resource.get(_),(q=x.font)==null||q.add(_);else if(!((V=x.font)!=null&&V.has(_)))try{let P=yield X(_,{as:"dataURL",useProxy:s,silent:!0});if(P.ok&&typeof P.data=="string")R=P.data,(K=x.resource)==null||K.set(_,R),(ft=x.font)==null||ft.add(_);else continue}catch(P){console.warn("[snapDOM] Failed to fetch localFonts src:",_);continue}}p+=`@font-face{font-family:'${M}';src:url(${R});font-style:${U};font-weight:${T};font-stretch:${D};}`}return p&&(p=Fo(p),(Z=x.resource)==null||Z.set(i,p)),p})}function Dt(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=a=>{let f=Ut(a.fontFamily);if(!f)return;let i=(l,h,d)=>`${f}__${Wt(l)}__${ce(h)}__${bo(d)}`;e.add(i(a.fontWeight,a.fontStyle,a.fontStretch))};o(getComputedStyle(t));let s=getComputedStyle(t,"::before");s&&s.content&&s.content!=="none"&&o(s);let r=getComputedStyle(t,"::after");for(r&&r.content&&r.content!=="none"&&o(r);n.nextNode();){let a=n.currentNode,f=getComputedStyle(a);o(f);let i=getComputedStyle(a,"::before");i&&i.content&&i.content!=="none"&&o(i);let l=getComputedStyle(a,"::after");l&&l.content&&l.content!=="none"&&o(l)}return e}function Ht(t){let e=new Set,n=s=>{if(s)for(let r of s)e.add(r.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let s=o.currentNode;if(s.nodeType===Node.TEXT_NODE)n(s.nodeValue||"");else if(s.nodeType===Node.ELEMENT_NODE){let r=s;for(let a of["::before","::after"]){let f=getComputedStyle(r,a),i=f==null?void 0:f.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let l=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(l)for(let h of l)try{e.add(parseInt(h.slice(1),16))}catch(d){}}}}}return e}function qt(t,e=2){return k(this,null,function*(){try{yield document.fonts.ready}catch(s){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let s=document.createElement("div");s.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let r of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${r}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",s.appendChild(a)}document.body.appendChild(s),s.offsetWidth,document.body.removeChild(s)};for(let s=0;s<Math.max(1,e);s++)o(),yield new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r)))})}function Ve(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Io(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function qe(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function je(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],o=Math.max(1,Math.min(3999,t)),s="";for(let[r,a]of n)for(;o>=r;)s+=a,o-=r;return e?s:s.toLowerCase()}function ze(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return qe(t,!1);case"upper-alpha":return qe(t,!0);case"lower-roman":return je(t,!1);case"upper-roman":return je(t,!0);default:return String(Math.max(0,t))}}function Xe(t){let e=()=>{var p,u,g;return(g=(u=(p=x)==null?void 0:p.session)==null?void 0:u.__counterEpoch)!=null?g:0},n=e(),o=new WeakMap,s=t instanceof Document?t.documentElement:t,r=p=>p&&p.tagName==="LI",a=p=>{let u=0,g=p==null?void 0:p.parentElement;if(!g)return 0;for(let c of g.children){if(c===p)break;c.tagName==="LI"&&u++}return u},f=p=>{let u=new Map;for(let[g,c]of p)u.set(g,c.slice());return u},i=(p,u,g)=>{var w,C;let c=f(p),m;try{m=((w=g.style)==null?void 0:w.counterReset)||getComputedStyle(g).counterReset}catch(S){}if(m&&m!=="none")for(let S of m.split(",")){let v=S.trim().split(/\s+/),b=v[0],E=Number.isFinite(Number(v[1]))?Number(v[1]):0;if(!b)continue;let A=u.get(b);if(A&&A.length){let N=A.slice();N.push(E),c.set(b,N)}else c.set(b,[E])}let y;try{y=((C=g.style)==null?void 0:C.counterIncrement)||getComputedStyle(g).counterIncrement}catch(S){}if(y&&y!=="none")for(let S of y.split(",")){let v=S.trim().split(/\s+/),b=v[0],E=Number.isFinite(Number(v[1]))?Number(v[1]):1;if(!b)continue;let A=c.get(b)||[];A.length===0&&A.push(0),A[A.length-1]+=E,c.set(b,A)}try{if(getComputedStyle(g).display==="list-item"&&r(g)){let v=g.parentElement,b=1;if(v&&v.tagName==="OL"){let A=v.getAttribute("start"),N=Number.isFinite(Number(A))?Number(A):1,L=a(g),O=g.getAttribute("value");b=Number.isFinite(Number(O))?Number(O):N+L}else b=1+a(g);let E=c.get("list-item")||[];E.length===0&&E.push(0),E[E.length-1]=b,c.set("list-item",E)}}catch(S){}return c},l=(p,u,g)=>{let c=i(g,u,p);o.set(p,c);let m=c;for(let y of p.children)m=l(y,c,m);return c},h=new Map;l(s,h,h);function d(){let p=e();if(p!==n){n=p;let u=new Map;l(s,u,u)}}return{get(p,u){var c;d();let g=(c=o.get(p))==null?void 0:c.get(u);return g&&g.length?g[g.length-1]:0},getStack(p,u){var c;d();let g=(c=o.get(p))==null?void 0:c.get(u);return g?g.slice():[]}}}function Ye(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,s=t.replace(o,(r,a,f)=>{var l,h,d,p;let i=String(f).split(",").map(u=>u.trim());if(a==="counter"){let u=(l=i[0])==null?void 0:l.replace(/^["']|["']$/g,""),g=(i[1]||"decimal").toLowerCase(),c=n.get(e,u);return ze(c,g)}else{let u=(h=i[0])==null?void 0:h.replace(/^["']|["']$/g,""),g=(p=(d=i[1])==null?void 0:d.replace(/^["']|["']$/g,""))!=null?p:"",c=(i[2]||"decimal").toLowerCase(),m=n.getStack(e,u);return m.length?m.map(w=>ze(w,c)).join(g):""}});return Io(s)}catch(o){return"- "}}var kt=new WeakMap,Ke=-1;function Lo(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function No(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):Lo(t)}function ue(t,e){let n=t.parentElement,o=n?kt.get(n):null;return o?{get(s,r){let a=e.get(s,r),f=o.get(r);return typeof f=="number"?Math.max(a,f):a},getStack(s,r){let a=e.getStack(s,r);if(!a.length)return a;let f=o.get(r);if(typeof f=="number"){let i=a.slice();return i[i.length-1]=Math.max(i[i.length-1],f),i}return a}}:e}function de(t,e,n){let o=new Map;function s(i){let l=[];if(!i||i==="none")return l;for(let h of String(i).split(",")){let d=h.trim().split(/\s+/),p=d[0],u=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;p&&l.push({name:p,num:u})}return l}let r=s(e==null?void 0:e.counterReset),a=s(e==null?void 0:e.counterIncrement);function f(i){if(o.has(i))return o.get(i).slice();let l=n.getStack(t,i);l=l.length?l.slice():[];let h=r.find(p=>p.name===i);if(h){let p=Number.isFinite(h.num)?h.num:0;l=l.length?[...l,p]:[p]}let d=a.find(p=>p.name===i);if(d){let p=Number.isFinite(d.num)?d.num:1;l.length===0&&(l=[0]),l[l.length-1]+=p}return o.set(i,l.slice()),l}return{get(i,l){let h=f(l);return h.length?h[h.length-1]:0},getStack(i,l){return f(l)},__incs:a}}function Ro(t,e,n){let o;try{o=getComputedStyle(t,e)}catch(l){}let s=o==null?void 0:o.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};let r=ue(t,n),a=de(t,o,r),f=Ve(s)?Ye(s,t,a):s;return{text:No(f),incs:a.__incs||[]}}function me(t,e,n,o){return k(this,null,function*(){var i,l,h,d;if(!(t instanceof Element)||!(e instanceof Element))return;let s=(h=(l=(i=x)==null?void 0:i.session)==null?void 0:l.__counterEpoch)!=null?h:0;if(Ke!==s&&(kt=new WeakMap,n&&(n.__counterCtx=null),Ke=s),!n.__counterCtx)try{n.__counterCtx=Xe(t.ownerDocument||document)}catch(p){}let r=n.__counterCtx;for(let p of["::before","::after","::first-letter"])try{let u=gt(t,p);if(!u||typeof u[Symbol.iterator]!="function"||u.content==="none"&&u.backgroundImage==="none"&&u.backgroundColor==="transparent"&&(u.borderStyle==="none"||parseFloat(u.borderWidth)===0)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(p==="::first-letter"){let R=getComputedStyle(t);if(!(u.color!==R.color||u.fontSize!==R.fontSize||u.fontWeight!==R.fontWeight))continue;let j=Array.from(e.childNodes).find(tt=>{var et;return tt.nodeType===Node.TEXT_NODE&&((et=tt.textContent)==null?void 0:et.trim().length)>0});if(!j)continue;let z=j.textContent,G=z.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),Q=G==null?void 0:G[0],H=z.slice((Q==null?void 0:Q.length)||0);if(!Q||/[\uD800-\uDFFF]/.test(Q))continue;let J=document.createElement("span");J.textContent=Q,J.dataset.snapdomPseudo="::first-letter";let ot=_t(u),ut=St(ot,"span");n.styleMap.set(J,ut);let Vt=document.createTextNode(H);e.replaceChild(Vt,j),e.insertBefore(J,Vt);continue}let c=u.content,{text:m,incs:y}=Ro(t,p,r),w=u.backgroundImage,C=u.backgroundColor,S=u.fontFamily,v=parseInt(u.fontSize)||32,b=parseInt(u.fontWeight)||!1,E=u.color||"#000",A=u.borderStyle,N=parseFloat(u.borderWidth),L=u.transform,O=nt(S),q=c!=="none"&&m!=="",V=w&&w!=="none",K=C&&C!=="transparent"&&C!=="rgba(0, 0, 0, 0)",ft=A&&A!=="none"&&N>0,Z=L&&L!=="none";if(!(q||V||K||ft||Z)){if(y&&y.length&&t.parentElement){let R=kt.get(t.parentElement)||new Map;for(let{name:P}of y){if(!P)continue;let j=ue(t,r),G=de(t,getComputedStyle(t,p),j).get(t,P);R.set(P,G)}kt.set(t.parentElement,R)}continue}let M=document.createElement("span");M.dataset.snapdomPseudo=p,M.style.display="inline",M.style.verticalAlign="baseline",M.style.pointerEvents="none";let T=_t(u),U=St(T,"span");if(n.styleMap.set(M,U),O&&m&&m.length===1){let{dataUrl:R,width:P,height:j}=yield We(m,S,b,v,E),z=document.createElement("img");z.src=R,z.style=`height:${v}px;width:${P/j*v}px;object-fit:contain;`,M.appendChild(z),e.dataset.snapdomHasIcon="true"}else if(m&&m.startsWith("url(")){let R=ht(m);if(R!=null&&R.trim())try{let P=document.createElement("img"),j=yield X(dt(R),{as:"dataURL",useProxy:o.useProxy});P.src=j.data,P.style=`width:${v}px;height:auto;object-fit:contain;`,M.appendChild(P)}catch(P){console.error(`[snapdom] Error in pseudo ${p} for`,t,P)}}else!O&&q&&(M.textContent=m);M.style.backgroundImage="none","maskImage"in M.style&&(M.style.maskImage="none"),"webkitMaskImage"in M.style&&(M.style.webkitMaskImage="none");try{M.style.backgroundRepeat=u.backgroundRepeat,M.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(M.style.backgroundPositionX=u.backgroundPositionX,M.style.backgroundPositionY=u.backgroundPositionY):M.style.backgroundPosition=u.backgroundPosition,M.style.backgroundOrigin=u.backgroundOrigin,M.style.backgroundClip=u.backgroundClip,M.style.backgroundAttachment=u.backgroundAttachment,M.style.backgroundBlendMode=u.backgroundBlendMode}catch(R){}if(V)try{let R=Mt(w),P=yield Promise.all(R.map(pt));M.style.backgroundImage=P.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${p}`,R)}K&&(M.style.backgroundColor=C);let _=M.childNodes.length>0||((d=M.textContent)==null?void 0:d.trim())!==""||V||K||ft||Z;if(y&&y.length&&t.parentElement){let R=kt.get(t.parentElement)||new Map,P=ue(t,r),j=de(t,getComputedStyle(t,p),P);for(let{name:z}of y){if(!z)continue;let G=j.get(t,z);R.set(z,G)}kt.set(t.parentElement,R)}if(!_)continue;p==="::before"?e.insertBefore(M,e.firstChild):e.appendChild(M)}catch(u){console.warn(`[snapdom] Failed to capture ${p} for`,t,u)}let a=Array.from(t.children),f=Array.from(e.children).filter(p=>!p.dataset.snapdomPseudo);for(let p=0;p<Math.min(a.length,f.length);p++)yield me(a[p],f[p],n,o)})}function Ge(t,e){var w,C,S,v;if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,o=e||n,s=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(s.length===0)return;let r=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],f=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),i=new Set(Array.from(t.querySelectorAll("[id]")).map(b=>b.id)),l=new Set,h=!1,d=b=>{if(!b)return;r.lastIndex=0;let E;for(;E=r.exec(b);){h=!0;let A=(E[1]||"").trim();A&&!i.has(A)&&l.add(A)}},p=b=>{let E=b.querySelectorAll('use[href^="#"], use[xlink\\:href^="#"]');for(let L of E){let O=L.getAttribute("href")||L.getAttribute("xlink:href");if(!O||!O.startsWith("#"))continue;h=!0;let q=O.slice(1).trim();q&&!i.has(q)&&l.add(q)}let N=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 L of N){d(L.getAttribute("style")||"");for(let O of a)d(L.getAttribute(O))}};for(let b of s)p(b);if(!h)return;let u=t.querySelector("svg.inline-defs-container");u||(u=n.createElementNS("http://www.w3.org/2000/svg","svg"),u.classList.add("inline-defs-container"),u.setAttribute("aria-hidden","true"),u.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(u,t.firstChild||null));let g=u.querySelector("defs")||null,c=b=>{if(!b||i.has(b))return null;let E=f(b),A=N=>{let L=o.querySelector(N);return L&&!t.contains(L)?L:null};return A(`svg defs > *#${E}`)||A(`svg > symbol#${E}`)||A(`*#${E}`)};if(!l.size)return;let m=new Set(l),y=new Set;for(;m.size;){let b=m.values().next().value;if(m.delete(b),!b||i.has(b)||y.has(b))continue;let E=c(b);if(!E){y.add(b);continue}g||(g=n.createElementNS("http://www.w3.org/2000/svg","defs"),u.appendChild(g));let A=E.cloneNode(!0);A.id||A.setAttribute("id",b),g.appendChild(A),y.add(b),i.add(b);let N=[A,...A.querySelectorAll("*")];for(let L of N){let O=((w=L.getAttribute)==null?void 0:w.call(L,"href"))||((C=L.getAttribute)==null?void 0:C.call(L,"xlink:href"));if(O&&O.startsWith("#")){let V=O.slice(1).trim();V&&!i.has(V)&&!y.has(V)&&m.add(V)}let q=((S=L.getAttribute)==null?void 0:S.call(L,"style"))||"";q&&d(q);for(let V of a){let K=(v=L.getAttribute)==null?void 0:v.call(L,V);K&&d(K)}}}}function Je(t,e){var f;if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let o=t.getBoundingClientRect(),s=t.clientHeight,r="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let i=a.currentNode,l=getComputedStyle(i),h=l.position;if(h!=="sticky"&&h!=="-webkit-sticky")continue;let d=Qe(l.top),p=Qe(l.bottom);if(d==null&&p==null)continue;let u=To(i,t),g=Po(e,u,r);if(!g)continue;let c=i.getBoundingClientRect(),m=c.width,y=c.height,w=c.left-o.left;if(!(m>0&&y>0)||!Number.isFinite(w))continue;let C=d!=null?d+n:n+(s-y-p);if(!Number.isFinite(C))continue;let S=Number.parseInt(l.zIndex,10),v=Number.isFinite(S),b=v?Math.max(S,1)+1:2,E=v?S-1:0,A=g.cloneNode(!1);A.setAttribute(r,"1"),A.style.position="sticky",A.style.left=`${w}px`,A.style.top=`${C}px`,A.style.width=`${m}px`,A.style.height=`${y}px`,A.style.visibility="hidden",A.style.zIndex=String(E),A.style.overflow="hidden",A.style.background="transparent",A.style.boxShadow="none",A.style.filter="none",(f=g.parentElement)==null||f.insertBefore(A,g),g.style.position="absolute",g.style.left=`${w}px`,g.style.top=`${C}px`,g.style.bottom="auto",g.style.zIndex=String(b),g.style.pointerEvents="none"}}function Qe(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function To(t,e){let n=[];for(let o=t;o&&o!==e;){let s=o.parentElement;if(!s)break;n.push(Array.prototype.indexOf.call(s.children,o)),o=s}return n.reverse()}function Po(t,e,n){let o=t;for(let s=0;s<e.length;s++)if(o=_o(o,n)[e[s]],!o)return null;return o instanceof HTMLElement?o:null}function _o(t,e){let n=[],o=t.children;for(let s=0;s<o.length;s++){let r=o[s];r.hasAttribute(e)||n.push(r)}return n}function tn(n){return k(this,arguments,function*(t,e={}){var l,h;let o={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap},s,r="",a="";Wo(t);try{Ge(t)}catch(d){console.warn("inlineExternal defs or symbol failed:",d)}try{s=yield Et(t,o,e,t)}catch(d){throw console.warn("deepClone failed:",d),d}try{yield me(t,s,o,e)}catch(d){console.warn("inlinePseudoElements failed:",d)}yield Do(s);try{let d=s.querySelectorAll("style[data-sd]");for(let p of d)a+=p.textContent||"",p.remove()}catch(d){}let f=oe(o.styleMap);r=Array.from(f.entries()).map(([d,p])=>`.${p}{${d}}`).join(""),r=a+r;for(let[d,p]of o.styleMap.entries()){if(d.tagName==="STYLE")continue;if(d.getRootNode&&d.getRootNode()instanceof ShadowRoot){d.setAttribute("style",p.replace(/;/g,"; "));continue}let u=f.get(p);u&&d.classList.add(u);let g=(l=d.style)==null?void 0:l.backgroundImage,c=(h=d.dataset)==null?void 0:h.snapdomHasIcon;g&&g!=="none"&&(d.style.backgroundImage=g),c&&(d.style.verticalAlign="middle",d.style.display="inline")}for(let[d,p]of o.nodeMap.entries()){let u=p.scrollLeft,g=p.scrollTop;if((u||g)&&d instanceof HTMLElement){d.style.overflow="hidden",d.style.scrollbarWidth="none",d.style.msOverflowStyle="none";let m=document.createElement("div");for(m.style.transform=`translate(${-u}px, ${-g}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";d.firstChild;)m.appendChild(d.firstChild);d.appendChild(m)}}let i=s instanceof HTMLElement&&s.firstElementChild instanceof HTMLElement?s.firstElementChild:s;if(Je(t,i),t===o.nodeMap.get(s)){let d=o.styleCache.get(t)||window.getComputedStyle(t);o.styleCache.set(t,d);let p=Qt(d.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=p||""}for(let[d,p]of o.nodeMap.entries())p.tagName==="PRE"&&(d.style.marginTop="0",d.style.marginBlockStart="0");return{clone:s,classCSS:r,styleCache:o.styleCache}})}function Wo(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,s=e.borderStyle,r=e.borderWidth,a=n!=="none"&&parseFloat(o)>0,f=s==="none"||parseFloat(r)===0;a&&f&&(t.style.border=`${o} solid transparent`)}var Ft=new Map;function $t(t){return k(this,null,function*(){var n;if((n=x.resource)!=null&&n.has(t))return x.resource.get(t);if(Ft.has(t))return Ft.get(t);let e=k(null,null,function*(){var s;let o=yield X(t,{as:"dataURL",silent:!0});if(!o.ok||typeof o.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(s=x.resource)==null||s.set(t,o.data),o.data});Ft.set(t,e);try{let o=yield e;return Ft.set(t,o),o}catch(o){throw Ft.delete(t),o}})}var Oo=/\bblob:[^)"'\s]+/g;function Ze(t){return k(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Oo)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let s=yield $t(o);n=n.split(o).join(s)}catch(s){}return n})}function jt(t){return typeof t=="string"&&t.startsWith("blob:")}function Uo(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Bo(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Do(t){return k(this,null,function*(){var a,f;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let h=i.getAttribute("src")||i.currentSrc||"";if(jt(h)){let p=yield $t(h);i.setAttribute("src",p)}let d=i.getAttribute("srcset");if(d&&d.includes("blob:")){let p=Uo(d),u=!1;for(let g of p)if(jt(g.url))try{g.url=yield $t(g.url),u=!0}catch(c){}u&&i.setAttribute("srcset",Bo(p))}}catch(l){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let l="http://www.w3.org/1999/xlink",h=i.getAttribute("href")||((a=i.getAttributeNS)==null?void 0:a.call(i,l,"href"));if(jt(h)){let d=yield $t(h);i.setAttribute("href",d),(f=i.removeAttributeNS)==null||f.call(i,l,"href")}}catch(l){}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of o)try{let l=i.getAttribute("style");if(l&&l.includes("blob:")){let h=yield Ze(l);i.setAttribute("style",h)}}catch(l){}let s=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of s)try{let l=i.textContent||"";l.includes("blob:")&&(i.textContent=yield Ze(l))}catch(l){}let r=["poster"];for(let i of r){let l=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let h of l)try{let d=h.getAttribute(i);jt(d)&&h.setAttribute(i,yield $t(d))}catch(d){}}})}function en(n){return k(this,arguments,function*(t,e={}){let o=Array.from(t.querySelectorAll("img")),s=r=>k(null,null,function*(){var d,p,u,g;if(!r.getAttribute("src")){let c=r.currentSrc||r.src||"";c&&r.setAttribute("src",c)}r.removeAttribute("srcset"),r.removeAttribute("sizes");let a=r.src||"";if(!a)return;let f=yield X(a,{as:"dataURL",useProxy:e.useProxy});if(f.ok&&typeof f.data=="string"&&f.data.startsWith("data:")){r.src=f.data,r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let c=parseInt(((d=r.dataset)==null?void 0:d.snapdomWidth)||"",10)||0,m=parseInt(((p=r.dataset)==null?void 0:p.snapdomHeight)||"",10)||0,y=parseInt(r.getAttribute("width")||"",10)||0,w=parseInt(r.getAttribute("height")||"",10)||0,C=parseFloat(((u=r.style)==null?void 0:u.width)||"")||0,S=parseFloat(((g=r.style)==null?void 0:g.height)||"")||0,v=c||C||y||r.width||void 0,b=m||S||w||r.height||void 0,E=typeof i=="function"?yield i({width:v,height:b,src:a,element:r}):i;if(E){let A=yield X(E,{as:"dataURL",useProxy:e.useProxy});r.src=A.data,!r.width&&v&&(r.width=v),!r.height&&b&&(r.height=b),r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}}catch(c){}let l=r.width||r.naturalWidth||100,h=r.height||r.naturalHeight||100;if(e.placeholders!==!1){let c=document.createElement("div");c.style.cssText=[`width:${l}px`,`height:${h}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${h}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),c.textContent="img",r.replaceWith(c)}else{let c=document.createElement("div");c.style.cssText=`display:inline-block;width:${l}px;height:${h}px;visibility:hidden;`,r.replaceWith(c)}});for(let r=0;r<o.length;r+=4){let a=o.slice(r,r+4).map(s);yield Promise.allSettled(a)}})}function zt(s,r,a){return k(this,arguments,function*(t,e,n,o={}){let f=[[t,e]],i=["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"],l=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],h=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],d=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;f.length;){let[p,u]=f.shift(),g=n.get(p)||gt(p);n.has(p)||n.set(p,g);let c=(()=>{let w=g.getPropertyValue("border-image"),C=g.getPropertyValue("border-image-source");return w&&w!=="none"||C&&C!=="none"})();for(let w of h){let C=g.getPropertyValue(w);C&&u.style.setProperty(w,C)}for(let w of i){let C=g.getPropertyValue(w);if(!C||C==="none")continue;let S=Mt(C),v=yield Promise.all(S.map(b=>pt(b,o)));v.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&u.style.setProperty(w,v.join(", "))}for(let w of l){let C=g.getPropertyValue(w);!C||C==="initial"||u.style.setProperty(w,C)}if(c)for(let w of d){let C=g.getPropertyValue(w);!C||C==="initial"||u.style.setProperty(w,C)}let m=Array.from(p.children),y=Array.from(u.children).filter(w=>!(w.dataset&&w.dataset.snapdomPseudo));for(let w=0;w<Math.min(m.length,y.length);w++)f.push([m[w],y[w]])}})}function nn(t){var l;if(!t)return()=>{};let e=Ho(t);if(e<=0)return()=>{};if(!zo(t))return()=>{};let n=getComputedStyle(t),o=Math.round(qo(n)*e+jo(n)),s=(l=t.textContent)!=null?l:"",r=s;if(t.scrollHeight<=o+.5)return()=>{};let a=0,f=s.length,i=-1;for(;a<=f;){let h=a+f>>1;t.textContent=s.slice(0,h)+"\u2026",t.scrollHeight<=o+.5?(i=h,a=h+1):f=h-1}return t.textContent=(i>=0?s.slice(0,i):"")+"\u2026",()=>{t.textContent=r}}function Ho(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function qo(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function jo(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function zo(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var It=[];function on(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function he(...t){let e=t.flat();for(let n of e){let o=on(n);o&&(It.some(s=>s&&s.name&&o.name&&s.name===o.name)||It.push(o))}}function rn(t){return(t&&Array.isArray(t.plugins)?t.plugins:It)||It}function st(t,e,n){return k(this,null,function*(){let o=n,s=rn(e);for(let r of s){let a=r&&typeof r[t]=="function"?r[t]:null;if(!a)continue;let f=yield a(e,o);typeof f!="undefined"&&(o=f)}return o})}function sn(t,e,n){return k(this,null,function*(){let o=[],s=rn(e);for(let r of s){let a=r&&typeof r[t]=="function"?r[t]:null;if(!a)continue;let f=yield a(e,n);typeof f!="undefined"&&o.push(f)}return o})}function Vo(t){let e=[];if(Array.isArray(t))for(let n of t){let o=on(n);if(!o||!o.name)continue;let s=e.findIndex(r=>r&&r.name===o.name);s>=0&&e.splice(s,1),e.push(o)}for(let n of It)n&&n.name&&!e.some(o=>o.name===n.name)&&e.push(n);return Object.freeze(e)}function an(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Vo(e)),t}function Xo(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch(r){}try{e.style.textShadow="none"}catch(r){}try{e.style.outline="none"}catch(r){}let s=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=s.length?s:"none"}catch(r){}}function Yo(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let o of n)o.remove()}function Ko(t,e={}){let{stripFrameworkDirectives:n=!0}=e,o=new Set(["xml","xlink"]),s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let r=s.currentNode;for(let a of Array.from(r.attributes)){let f=a.name;if(f.includes("@")){r.removeAttribute(f);continue}if(f.includes(":")){let i=f.split(":",1)[0];if(!o.has(i)){r.removeAttribute(f);continue}}if(n&&(f.startsWith("x-")||f.startsWith("v-")||f.startsWith(":")||f.startsWith("on:")||f.startsWith("bind:")||f.startsWith("let:")||f.startsWith("class:"))){r.removeAttribute(f);continue}}}}function Go(t,e={}){t&&(Ko(t,e),Yo(t))}function ge(t,e){return k(this,null,function*(){var w;if(!t)throw new Error("Element cannot be null or undefined");Rt(e.cache);let n=e.fast,o=e.outerTransforms!==!1,s=!!e.outerShadows,r={element:t,options:e,plugins:e.plugins},a,f,i,l="",h="",d,p,u=null;yield st("beforeSnap",r),yield st("beforeClone",r);let g=nn(r.element);try{({clone:a,classCSS:f,styleCache:i}=yield tn(r.element,r.options)),!o&&a&&(u=nr(r.element,a)),!s&&a&&Xo(r.element,a)}finally{g()}if(r=$({clone:a,classCSS:f,styleCache:i},r),yield st("afterClone",r),Go(r.clone),((w=r.options)==null?void 0:w.excludeMode)==="remove")try{tr(r.element,r.clone,r.styleCache)}catch(C){console.warn("[snapdom] shrink pass failed:",C)}try{yield Te(r.clone,r.element)}catch(C){}yield new Promise(C=>{ct(()=>k(null,null,function*(){yield en(r.clone,r.options),C()}),{fast:n})}),yield new Promise(C=>{ct(()=>k(null,null,function*(){yield zt(r.element,r.clone,r.styleCache,r.options),C()}),{fast:n})}),e.embedFonts&&(yield new Promise(C=>{ct(()=>k(null,null,function*(){let S=Dt(r.element),v=Ht(r.element);if(Y()){let b=new Set(Array.from(S).map(E=>String(E).split("__")[0]).filter(Boolean));yield qt(b,1)}l=yield Bt({required:S,usedCodepoints:v,preCached:!1,exclude:r.options.excludeFonts,useProxy:r.options.useProxy}),C()}),{fast:n})}));let c=ee(r.clone).sort(),m=c.join(",");x.baseStyle.has(m)?h=x.baseStyle.get(m):yield new Promise(C=>{ct(()=>{h=ne(c),x.baseStyle.set(m,h),C()},{fast:n})}),r=$({fontsCSS:l,baseCSS:h},r),yield st("beforeRender",r),yield new Promise(C=>{ct(()=>{var xe;let S=getComputedStyle(r.element),v=r.element.getBoundingClientRect(),b=Math.max(1,I(r.element.offsetWidth||parseFloat(S.width)||v.width||1)),E=Math.max(1,I(r.element.offsetHeight||parseFloat(S.height)||v.height||1));if(((xe=r.options)==null?void 0:xe.excludeMode)==="remove"){let rt=hr(r.element,r.options);Number.isFinite(rt)&&rt>0&&(E=Math.max(1,Math.min(E,I(rt+1))))}let A=(rt,it=NaN)=>{let bt=typeof rt=="string"?parseFloat(rt):rt;return Number.isFinite(bt)?bt:it},N=A(r.options.width),L=A(r.options.height),O=b,q=E,V=Number.isFinite(N),K=Number.isFinite(L),ft=E>0?b/E:1;V&&K?(O=Math.max(1,I(N)),q=Math.max(1,I(L))):V?(O=Math.max(1,I(N)),q=Math.max(1,I(O/(ft||1)))):K?(q=Math.max(1,I(L)),O=Math.max(1,I(q*(ft||1)))):(O=b,q=E);let Z=0,F=0,M=b,T=E;if(!o&&u&&Number.isFinite(u.a)){let rt={a:u.a,b:u.b||0,c:u.c||0,d:u.d||1,e:0,f:0},it=cn(b,E,rt,0,0);Z=I(it.minX),F=I(it.minY),M=I(it.maxX),T=I(it.maxY)}else if(o&&ar(r.element)){let it=S.transform&&S.transform!=="none"?S.transform:"",bt=ir(r.element),Kt=ur({baseTransform:it,rotate:bt.rotate||"0deg",scale:bt.scale,translate:bt.translate}),{ox:xn,oy:Sn}=lr(S,b,E),Cn=Kt.is2D?Kt:new DOMMatrix(Kt.toString()),Nt=cn(b,E,Cn,xn,Sn);Z=I(Nt.minX),F=I(Nt.minY),M=I(Nt.maxX),T=I(Nt.maxY)}let U=or(S),D=rr(S),_=sr(S),R=er(S),P=s?{top:I(U.top+D.top+_.top+R.bleed.top),right:I(U.right+D.right+_.right+R.bleed.right),bottom:I(U.bottom+D.bottom+_.bottom+R.bleed.bottom),left:I(U.left+D.left+_.left+R.bleed.left)}:{top:0,right:0,bottom:0,left:0};Z=I(Z-P.left),F=I(F-P.top),M=I(M+P.right),T=I(T+P.bottom);let j=Math.max(1,I(M-Z)),z=Math.max(1,I(T-F)),G=V||K?I(O/b):1,Q=K||V?I(q/E):1,H=Math.max(1,I(j*G)),J=Math.max(1,I(z*Q)),ot="http://www.w3.org/2000/svg",ut=Y()?1:0,tt=I(ut+(o?0:1)),et=document.createElementNS(ot,"foreignObject"),pn=I(Z),gn=I(F);et.setAttribute("x",String(I(-(pn-tt)))),et.setAttribute("y",String(I(-(gn-tt)))),et.setAttribute("width",String(I(b+tt*2))),et.setAttribute("height",String(I(E+tt*2))),et.style.overflow="visible";let we=document.createElement("style");we.textContent=r.baseCSS+r.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r.classCSS,et.appendChild(we);let wt=document.createElement("div");wt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),wt.style.width=`${I(b)}px`,wt.style.height=`${I(E)}px`,wt.style.overflow="visible",r.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),wt.appendChild(r.clone),et.appendChild(wt);let yn=new XMLSerializer().serializeToString(et),Xt=I(j+tt*2),Yt=I(z+tt*2),be=V||K;e.meta={w0:b,h0:E,vbW:Xt,vbH:Yt,targetW:O,targetH:q};let wn=Y()&&be?Xt:I(H+tt*2),bn=Y()&&be?Yt:I(J+tt*2);p=`<svg xmlns="${ot}" width="${wn}" height="${bn}" viewBox="0 0 ${Xt} ${Yt}">`+yn+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,r=$({svgString:p,dataURL:d},r),C()},{fast:n})}),yield st("afterRender",r);let y=document.getElementById("snapdom-sandbox");return y&&y.style.position==="absolute"&&y.remove(),r.dataURL})}function Qo(t){var e;try{let n=((e=t.getAttribute)==null?void 0:e.call(t,"style"))||"";return/\b(height|width|block-size|inline-size)\s*:/.test(n)}catch(n){return!1}}function Jo(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Zo(t,e){if(!(t instanceof Element)||Qo(t)||Jo(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function tr(t,e,n=new Map){function o(s,r){if(!(s instanceof Element)||!(r instanceof Element))return;let a=s.childElementCount>r.childElementCount,f=n.get(s)||getComputedStyle(s);if(n.has(s)||n.set(s,f),a&&Zo(s,f)){r.style.height||(r.style.height="auto"),r.style.width||(r.style.width="auto"),r.style.removeProperty("block-size"),r.style.removeProperty("inline-size"),r.style.minHeight||(r.style.minHeight="0"),r.style.minWidth||(r.style.minWidth="0"),r.style.maxHeight||(r.style.maxHeight="none"),r.style.maxWidth||(r.style.maxWidth="none");let h=f.overflowY||f.overflowBlock||"visible",d=f.overflowX||f.overflowInline||"visible";(h!=="visible"||d!=="visible")&&(r.style.overflow="visible")}let i=Array.from(s.children),l=Array.from(r.children);for(let h=0;h<Math.min(i.length,l.length);h++)o(i[h],l[h])}o(t,e)}var I=(t,e=3)=>Number.isFinite(t)?Math.round(t*Gt(10,e))/Gt(10,e):t;function er(t){var i;let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,s=0,r=0,a=0,f=!1;for(let l of n){f=!0;let h=((i=l.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:i.map(m=>parseFloat(m)))||[],[d=0,p=0,u=0]=h,g=Math.abs(d)+u,c=Math.abs(p)+u;s=Math.max(s,g+Math.max(d,0)),a=Math.max(a,g+Math.max(-d,0)),r=Math.max(r,c+Math.max(p,0)),o=Math.max(o,c+Math.max(-p,0))}return{bleed:{top:I(o),right:I(s),bottom:I(r),left:I(a)},has:f}}function nr(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch(r){}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch(r){}let o=n.transform||"none";if(!o||o==="none")try{let r=ln(t);if(r.a===1&&r.b===0&&r.c===0&&r.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch(r){}let s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let r=s[1].split(",").map(a=>parseFloat(a.trim()));if(r.length===6&&r.every(Number.isFinite)){let[a,f,i,l]=r,h=Math.sqrt(a*a+f*f)||0,d=0,p=0,u=0,g=0,c=0,m=0;h>0&&(d=a/h,p=f/h,u=d*i+p*l,g=i-d*u,c=l-p*u,m=Math.sqrt(g*g+c*c)||0,m>0?u=u/m:u=0);let y=h,w=0,C=u*m,S=m;try{e.style.transform=`matrix(${y}, ${w}, ${C}, ${S}, 0, 0)`}catch(v){}return{a:y,b:w,c:C,d:S}}}try{let r=String(o).trim();return e.style.transform=r+" translate(0px, 0px) rotate(0deg)",null}catch(r){return null}}function or(t){var f;let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(i=>i.trim()),o=0,s=0,r=0,a=0;for(let i of n){let l=((f=i.match(/-?\d+(\.\d+)?px/g))==null?void 0:f.map(m=>parseFloat(m)))||[];if(l.length<2)continue;let[h,d,p=0,u=0]=l,g=Math.abs(h)+p+u,c=Math.abs(d)+p+u;s=Math.max(s,g+Math.max(h,0)),a=Math.max(a,g+Math.max(-h,0)),r=Math.max(r,c+Math.max(d,0)),o=Math.max(o,c+Math.max(-d,0))}return{top:Math.ceil(o),right:Math.ceil(s),bottom:Math.ceil(r),left:Math.ceil(a)}}function rr(t){let e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function sr(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}function cn(t,e,n,o,s){let r=n.a,a=n.b,f=n.c,i=n.d,l=n.e||0,h=n.f||0;function d(y,w){let C=y-o,S=w-s,v=r*C+f*S,b=a*C+i*S;return v+=o+l,b+=s+h,[v,b]}let p=[d(0,0),d(t,0),d(0,e),d(t,e)],u=1/0,g=1/0,c=-1/0,m=-1/0;for(let[y,w]of p)y<u&&(u=y),w<g&&(g=w),y>c&&(c=y),w>m&&(m=w);return{minX:u,minY:g,maxX:c,maxY:m,width:c-u,height:m-g}}function ar(t){return cr(t)}function ln(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function ir(t){var s,r,a,f,i,l,h,d;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let p=m=>{try{return typeof n.has=="function"&&!n.has(m)||typeof n.get!="function"?null:n.get(m)}catch(y){return null}},u=p("rotate");if(u)if(u.angle){let m=u.angle;e.rotate=m.unit==="rad"?m.value*180/Math.PI+"deg":m.value+m.unit}else u.unit?e.rotate=u.unit==="rad"?u.value*180/Math.PI+"deg":u.value+u.unit:e.rotate=String(u);else{let m=getComputedStyle(t);e.rotate=m.rotate&&m.rotate!=="none"?m.rotate:"0deg"}let g=p("scale");if(g){let m="x"in g&&((s=g.x)==null?void 0:s.value)!=null?g.x.value:Array.isArray(g)?(r=g[0])==null?void 0:r.value:Number(g)||1,y="y"in g&&((a=g.y)==null?void 0:a.value)!=null?g.y.value:Array.isArray(g)?(f=g[1])==null?void 0:f.value:m;e.scale=`${m} ${y}`}else{let m=getComputedStyle(t);e.scale=m.scale&&m.scale!=="none"?m.scale:null}let c=p("translate");if(c){let m="x"in c&&"value"in c.x?c.x.value:Array.isArray(c)?(i=c[0])==null?void 0:i.value:0,y="y"in c&&"value"in c.y?c.y.value:Array.isArray(c)?(l=c[1])==null?void 0:l.value:0,w="x"in c&&((h=c.x)!=null&&h.unit)?c.x.unit:"px",C="y"in c&&((d=c.y)!=null&&d.unit)?c.y.unit:"px";e.translate=`${m}${w} ${y}${C}`}else{let m=getComputedStyle(t);e.translate=m.translate&&m.translate!=="none"?m.translate:null}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function cr(t){let e=getComputedStyle(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let s=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",r=e.scale&&e.scale!=="none"&&e.scale!=="1",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(s||r||a)}function lr(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[s,r]=[o[0]||"0",o[1]||"0"],a=(f,i)=>{let l=f.toLowerCase();return l==="left"||l==="top"?0:l==="center"?i/2:l==="right"||l==="bottom"?i:l.endsWith("px")?parseFloat(l)||0:l.endsWith("%")?(parseFloat(l)||0)*i/100:/^-?\d+(\.\d+)?$/.test(l)&&parseFloat(l)||0};return{ox:a(s,e),oy:a(r,n)}}var pe=null;function fr(){if(pe)return pe;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),pe=t,t}function ur(t){let e=fr(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let o=ln(n);return e.removeChild(n),o}function dr(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed"||e.position==="sticky"||(e.cssFloat||e.float||"none")!=="none"||e.transform&&e.transform!=="none")}function mr(t,e){if(!(t instanceof Element))return!1;if(t.getAttribute("data-capture")==="exclude"&&(e==null?void 0:e.excludeMode)==="remove")return!0;if(Array.isArray(e==null?void 0:e.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(o){}return!1}function hr(t,e){let n=getComputedStyle(t),o=t.getBoundingClientRect(),s=1/0,r=-1/0,a=!1,f=Array.from(t.children);for(let u of f){if(mr(u,e)||!dr(u))continue;let g=u.getBoundingClientRect(),c=g.top-o.top,m=g.bottom-o.top;m<=c||(c<s&&(s=c),m>r&&(r=m),a=!0)}let i=a?Math.max(0,r-s):0,l=parseFloat(n.borderTopWidth)||0,h=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return l+h+d+p+i}function pr(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function fn(t={}){var o,s,r,a,f,i,l,h,d,p,u,g,c,m,y,w,C,S,v,b;let e=(o=t.format)!=null?o:"png";e==="jpg"&&(e="jpeg");let n=pr(t.cache);return{debug:(s=t.debug)!=null?s:!1,fast:(r=t.fast)!=null?r:!0,scale:(a=t.scale)!=null?a:1,exclude:(f=t.exclude)!=null?f:[],excludeMode:(i=t.excludeMode)!=null?i:"hide",filter:(l=t.filter)!=null?l:null,filterMode:(h=t.filterMode)!=null?h:"hide",placeholders:t.placeholders!==!1,embedFonts:(d=t.embedFonts)!=null?d:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(p=t.excludeFonts)!=null?p:void 0,fallbackURL:(u=t.fallbackURL)!=null?u:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(g=t.width)!=null?g:null,height:(c=t.height)!=null?c:null,format:e,type:(m=t.type)!=null?m:"svg",quality:(y=t.quality)!=null?y:.92,dpr:(w=t.dpr)!=null?w:window.devicePixelRatio||1,backgroundColor:(C=t.backgroundColor)!=null?C:["jpeg","webp"].includes(e)?"#ffffff":null,filename:(S=t.filename)!=null?S:"snapDOM",outerTransforms:(v=t.outerTransforms)!=null?v:!0,outerShadows:(b=t.outerShadows)!=null?b:!1}}function gr(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function yr(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function wr(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function br(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let r=t[s];r==="("&&o++,r===")"&&(o=Math.max(0,o-1)),r===";"&&o===0?(e.push(n),n=""):n+=r}return n.trim()&&e.push(n),e.map(s=>s.trim()).filter(Boolean)}function xr(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let a=t[r];a==="("&&o++,a===")"&&(o=Math.max(0,o-1)),a===","&&o===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let s=[];for(let r of e){if(/\binset\b/i.test(r))continue;let a=r.match(/-?\d+(?:\.\d+)?px/gi)||[],[f="0px",i="0px",l="0px"]=a,h=r.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!h&&h!==",";s.push(`drop-shadow(${f} ${i} ${l}${d?` ${h}`:""})`)}return s.join(" ")}function un(t){let e=br(t),n=null,o=null,s=null,r=[];for(let f of e){let i=f.indexOf(":");if(i<0)continue;let l=f.slice(0,i).trim().toLowerCase(),h=f.slice(i+1).trim();l==="box-shadow"?s=h:l==="filter"?n=h:l==="-webkit-filter"?o=h:r.push([l,h])}if(s){let f=xr(s);f&&(n=n?`${n} ${f}`:f,o=o?`${o} ${f}`:f)}let a=[...r];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([f,i])=>`${f}:${i}`).join(";")}function Sr(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${un(o)}}`)}function Cr(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Sr(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${un(o)}${n}`),t}function kr(t){if(!Y()||!gr(t))return t;try{let e=yr(t),n=Cr(e);return wr(n)}catch(e){return t}}function lt(t,e){return k(this,null,function*(){let{width:n,height:o,scale:s=1,dpr:r=1,meta:a={},backgroundColor:f}=e;t=kr(t);let i=new Image;i.loading="eager",i.decoding="sync",i.crossOrigin="anonymous",i.src=t,yield i.decode();let l=i.naturalWidth,h=i.naturalHeight,d=Number.isFinite(a.w0)?a.w0:l,p=Number.isFinite(a.h0)?a.h0:h,u,g,c=Number.isFinite(n),m=Number.isFinite(o);if(c&&m)u=Math.max(1,n),g=Math.max(1,o);else if(c){let C=n/Math.max(1,d);u=n,g=p*C}else if(m){let C=o/Math.max(1,p);g=o,u=d*C}else u=l,g=h;u=u*s,g=g*s;let y=document.createElement("canvas");y.width=u*r,y.height=g*r,y.style.width=`${u}px`,y.style.height=`${g}px`;let w=y.getContext("2d");return r!==1&&w.scale(r,r),f&&(w.save(),w.fillStyle=f,w.fillRect(0,0,u,g),w.restore()),w.drawImage(i,0,0,u,g),y})}function at(t,e){return k(this,null,function*(){let n=yield lt(t,e),o=new Image;return o.src=n.toDataURL(`image/${e.format}`,e.quality),yield o.decode(),o.style.width=`${n.width/e.dpr}px`,o.style.height=`${n.height/e.dpr}px`,o})}function At(t,e){return k(this,null,function*(){let{scale:n=1,width:o,height:s,meta:r={}}=e,a=Number.isFinite(o),f=Number.isFinite(s),i=Number.isFinite(n)&&n!==1||a||f;if(Y()&&i)return yield at(t,W($({},e),{format:"png",quality:1,meta:r}));let l=new Image;if(l.decoding="sync",l.loading="eager",l.src=t,yield l.decode(),a&&f)l.style.width=`${o}px`,l.style.height=`${s}px`;else if(a){let h=Number.isFinite(r.w0)?r.w0:l.naturalWidth,d=Number.isFinite(r.h0)?r.h0:l.naturalHeight,p=o/Math.max(1,h);l.style.width=`${o}px`,l.style.height=`${Math.round(d*p)}px`}else if(f){let h=Number.isFinite(r.w0)?r.w0:l.naturalWidth,d=Number.isFinite(r.h0)?r.h0:l.naturalHeight,p=s/Math.max(1,d);l.style.height=`${s}px`,l.style.width=`${Math.round(h*p)}px`}else{let h=Math.round(l.naturalWidth*n),d=Math.round(l.naturalHeight*n);if(l.style.width=`${h}px`,l.style.height=`${d}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let u=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${h}"`).replace(/height="[^"]*"/,`height="${d}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,l.src=t}catch(p){}}return l})}function Lt(t,e){return k(this,null,function*(){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=yield lt(t,e);return new Promise(s=>o.toBlob(r=>s(r),`image/${n}`,e.quality))})}function dn(t,e){return k(this,null,function*(){if(e.dpr=1,e.format==="svg"){let s=yield Lt(t,W($({},e),{type:"svg"})),r=URL.createObjectURL(s),a=document.createElement("a");a.href=r,a.download=e.filename,a.click(),URL.revokeObjectURL(r);return}let n=yield lt(t,e),o=document.createElement("a");o.href=n.toDataURL(`image/${e.format}`,e.quality),o.download=e.filename,o.click()})}B.plugins=(...t)=>(he(...t),B);var mn=Symbol("snapdom.internal"),mt=Symbol("snapdom.internal.silent"),ye=!1;function B(t,e){return k(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");let n=fn(e);if(an(n,e&&e.plugins),Y()&&(n.embedFonts===!0||Mr(t)))for(let o=0;o<3;o++)try{yield Ar(t,e),console.log("safariWarmup:",o),ye=!1}catch(s){}return n.iconFonts&&n.iconFonts.length>0&&Re(n.iconFonts),n.snap||(n.snap={toPng:(o,s)=>B.toPng(o,s),toSvg:(o,s)=>B.toSvg(o,s)}),B.capture(t,n,mn)})}B.plugins=(...t)=>(he(...t),B);B.capture=(t,e,n)=>k(null,null,function*(){if(n!==mn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=yield ge(t,e),s={img:(c,m)=>k(null,null,function*(){return At(o,$($({},c),m||{}))}),svg:(c,m)=>k(null,null,function*(){return At(o,$($({},c),m||{}))}),canvas:(c,m)=>k(null,null,function*(){return lt(o,$($({},c),m||{}))}),blob:(c,m)=>k(null,null,function*(){return Lt(o,$($({},c),m||{}))}),png:(c,m)=>k(null,null,function*(){return at(o,W($($({},c),m||{}),{format:"png"}))}),jpeg:(c,m)=>k(null,null,function*(){return at(o,W($($({},c),m||{}),{format:"jpeg"}))}),webp:(c,m)=>k(null,null,function*(){return at(o,W($($({},c),m||{}),{format:"webp"}))}),download:(c,m)=>k(null,null,function*(){return dn(o,$($({},c),m||{}))})},r={svg:c=>At(o,W($($({},e),c||{}),{[mt]:!0})),canvas:c=>lt(o,W($($({},e),c||{}),{[mt]:!0})),png:c=>at(o,W($($({},e),c||{}),{format:"png",[mt]:!0})),jpeg:c=>at(o,W($($({},e),c||{}),{format:"jpeg",[mt]:!0})),jpg:c=>at(o,W($($({},e),c||{}),{format:"jpeg",[mt]:!0})),webp:c=>at(o,W($($({},e),c||{}),{format:"webp",[mt]:!0})),blob:c=>Lt(o,W($($({},e),c||{}),{[mt]:!0})),img:c=>At(o,W($($({},e),c||{}),{[mt]:!0}))},a=W($({},e),{export:{url:o},exports:r}),f=yield sn("defineExports",a),i=Object.assign({},...f.filter(c=>c&&typeof c=="object")),l=$($({},s),i);l.jpeg&&!l.jpg&&(l.jpg=(c,m)=>l.jpeg(c,m));function h(c,m){let y=$($({},e),m||{});return(c==="jpeg"||c==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,p=Promise.resolve();function u(c,m){return k(this,null,function*(){let y=()=>k(null,null,function*(){let w=l[c];if(!w)throw new Error(`[snapdom] Unknown export type: ${c}`);let C=h(c,m),S=W($({},e),{export:{type:c,options:C,url:o}});yield st("beforeExport",S);let v=yield w(S,C);return yield st("afterExport",S,v),d||(d=!0,yield st("afterSnap",e)),v});return p=p.then(y)})}let g={url:o,toRaw:()=>o,to:(c,m)=>u(c,m),toImg:c=>u("img",c),toSvg:c=>u("svg",c),toCanvas:c=>u("canvas",c),toBlob:c=>u("blob",c),toPng:c=>u("png",c),toJpg:c=>u("jpg",c),toWebp:c=>u("webp",c),download:c=>u("download",c)};for(let c of Object.keys(l)){let m="to"+c.charAt(0).toUpperCase()+c.slice(1);g[m]||(g[m]=y=>u(c,y))}return g});B.toRaw=(t,e)=>B(t,e).then(n=>n.toRaw());B.toImg=(t,e)=>B(t,e).then(n=>n.toImg());B.toSvg=(t,e)=>B(t,e).then(n=>n.toSvg());B.toCanvas=(t,e)=>B(t,e).then(n=>n.toCanvas());B.toBlob=(t,e)=>B(t,e).then(n=>n.toBlob());B.toPng=(t,e)=>B(t,W($({},e),{format:"png"})).then(n=>n.toPng());B.toJpg=(t,e)=>B(t,W($({},e),{format:"jpeg"})).then(n=>n.toJpg());B.toWebp=(t,e)=>B(t,W($({},e),{format:"webp"})).then(n=>n.toWebp());B.download=(t,e)=>B(t,e).then(n=>n.download());function Ar(t,e){return k(this,null,function*(){if(ye)return;let n=W($({},e),{fast:!0,embedFonts:!0,scale:.2}),o;try{o=yield ge(t,n)}catch(s){}yield new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),o&&(yield new Promise(s=>{let r=new Image;try{r.decoding="sync",r.loading="eager"}catch(a){}r.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",r.src=o,document.body.appendChild(r),k(null,null,function*(){try{typeof r.decode=="function"&&(yield r.decode())}catch(f){}let a=performance.now();for(;!(r.complete&&r.naturalWidth>0)&&performance.now()-a<900;)yield new Promise(f=>setTimeout(f,50));yield new Promise(f=>requestAnimationFrame(f));try{r.remove()}catch(f){}s()})})),t.querySelectorAll("canvas").forEach(s=>{try{let r=s.getContext("2d",{willReadFrequently:!0});r&&r.getImageData(0,0,1,1)}catch(r){}}),ye=!0})}function Mr(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),s=o.backgroundImage&&o.backgroundImage!=="none",r=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(s||r||n.tagName==="CANVAS")return!0}return!1}function hn(){return k(this,arguments,function*(t=document,e={}){var i,l,h,d,p,u;let{embedFonts:n=!0,useProxy:o=""}=e,s=(l=(i=e.cache)!=null?i:e.cacheOpt)!=null?l:"full";Rt(s);try{yield(h=document.fonts)==null?void 0:h.ready}catch(g){}try{Zt()}catch(g){}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new Map,x.background=x.background||new Map;try{yield zt(t,void 0,x.session.styleCache,{useProxy:o})}catch(g){}let r=[],a=[];try{if(t&&t.nodeType===1){let g=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];a=[t,...g],r=[],t.tagName==="IMG"&&t.getAttribute("src")&&r.push(t),r.push(...Array.from(((d=t.querySelectorAll)==null?void 0:d.call(t,"img[src]"))||[]))}else t!=null&&t.querySelectorAll&&(r=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch(g){}let f=[];for(let g of r){let c=(g==null?void 0:g.currentSrc)||(g==null?void 0:g.src);if(c&&!x.image.has(c)){let m=Promise.resolve().then(()=>k(null,null,function*(){let y=yield X(c,{as:"dataURL",useProxy:o});y!=null&&y.ok&&typeof y.data=="string"&&x.image.set(c,y.data)})).catch(()=>{});f.push(m)}}for(let g of a){let c="";try{c=((p=g==null?void 0:g.style)==null?void 0:p.backgroundImage)||"",(!c||c==="none")&&(c=gt(g).backgroundImage)}catch(m){}if(c&&c!=="none"){let m=c.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let y of m){let w=Promise.resolve().then(()=>pt(y,W($({},e),{useProxy:o}))).catch(()=>{});f.push(w)}}}if(n)try{let g=Dt(t),c=Ht(t);if(typeof Y=="function"?Y():!!Y){let y=new Set(Array.from(g).map(w=>String(w).split("__")[0]).filter(Boolean));yield qt(y,3)}yield Bt({required:g,usedCodepoints:c,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(u=e.useProxy)!=null?u:o})}catch(g){}yield Promise.allSettled(f)})}typeof window!="undefined"&&(window.snapdom=B,window.preCache=hn);})();
|